From 09dc82470c52fa5e3c339dfe6a1b2f4a97beddf9 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Mon, 5 Nov 2018 14:38:05 -0700 Subject: [PATCH 001/239] 'create branch for cesm2_1 release Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90187 Committed by Brian Eaton at 2018-11-05 14:38:05 -0700 Original svn commit message: create branch for cesm2_1 release' --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 99d0dceb22..98e88383c4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # CAM: The Community Atmosphere Model -## NOTE: This is unsupported development code and is subject to the [CESM developer's agreement](http://www.cgd.ucar.edu/cseg/development-code.html). - CAM Documentation - https://ncar.github.io/CAM/doc/build/html/index.html CAM6 namelist settings - http://www.cesm.ucar.edu/models/cesm2/settings/current/cam_nml.html From 1ed8a1bec6713f20e0573170b5fe448f0c5efb53 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Tue, 6 Nov 2018 10:55:41 -0700 Subject: [PATCH 002/239] 'use release tags for CAM externals; disable some SE functionality Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90188 Committed by Brian Eaton at 2018-11-06 10:55:41 -0700 Original svn commit message: use release tags for CAM externals; disable some SE functionality' --- Externals_CAM.cfg | 12 ++-- bld/build-namelist | 5 ++ bld/configure | 2 +- bld/namelist_files/namelist_defaults_cam.xml | 51 ----------------- .../use_cases/hist_trop_strat_vbs_cam6.xml | 1 - .../hist_trop_strat_vbsfire_cam6.xml | 1 - .../use_cases/waccm_sc_2000_cam4.xml | 2 - doc/ChangeLog | 56 +++++++++++++++++++ src/dynamics/se/dyn_comp.F90 | 45 +-------------- 9 files changed, 69 insertions(+), 106 deletions(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index b9f5082208..3e0e721533 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -1,22 +1,22 @@ [chem_proc] local_path = chem_proc protocol = svn -repo_url = https://svn-ccsm-models.cgd.ucar.edu/tools/proc_atm/chem_proc/trunk_tags/ -tag = chem_proc5_0_03 +repo_url = https://svn-ccsm-models.cgd.ucar.edu/tools/proc_atm/chem_proc/release_tags/ +tag = chem_proc5_0_03_rel required = True [carma] local_path = src/physics/carma/base protocol = svn -repo_url = https://svn-ccsm-models.cgd.ucar.edu/carma/trunk_tags/ -tag = carma3_49 +repo_url = https://svn-ccsm-models.cgd.ucar.edu/carma/release_tags/ +tag = carma3_49_rel required = True [clubb] local_path = src/physics/clubb protocol = svn -repo_url = https://svn-ccsm-models.cgd.ucar.edu/clubb_core/branch_tags/ -tag = vendor_clubb_r8099_tags/vendor_clubb_r8099_n02 +repo_url = https://svn-ccsm-models.cgd.ucar.edu/clubb_core/release_tags/ +tag = clubb_r8099_n02_rel required = True [cosp2] diff --git a/bld/build-namelist b/bld/build-namelist index 2b470043b8..f16c27a1a5 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -3416,6 +3416,11 @@ if ($cfg->get('camiop')) { if ($dyn =~ /se/) { + ## topography not supported for CESM2.0 + if (!defined $use_topo_file or ($use_topo_file =~ m/$TRUE/io)) { + die "$ProgName - ERROR: Use of topography not currently supported with SE dycore\n"; + } + #################################################### # namelist group: dyn_se_inparm (for CAM_SE) # #################################################### diff --git a/bld/configure b/bld/configure index 581657e6d0..e00e6ae57a 100755 --- a/bld/configure +++ b/bld/configure @@ -1882,7 +1882,7 @@ if ($dyn_pkg eq 'se') { # Check to see if physics grid is being used my $npg = $cfg_ref->get('npg'); if ($npg > 0) { - $cfg_cppdefs .= " -DFVM_TRACERS"; + die "CSLAM and FVM physics grid are not currently supported.$eol"; } if ($smp eq 'ON') { diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index aa77beaba3..3f297fe4f0 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -128,25 +128,6 @@ atm/cam/inic/gaus/cami_0000-09-01_8x16_L26_c030918.nc atm/cam/inic/gaus/cami_0000-01-01_8x16_L30_c090102.nc - -atm/cam/inic/homme/cami-mam3_0000-01_ne5np4_L30.140707.nc -atm/cam/inic/se/ape_topo_cam4_ne16np4_L26_c171020.nc -atm/cam/inic/se/ape_topo_cam4_ne16np4_L30_c171020.nc -atm/cam/inic/se/ape_topo_cam4_ne16np4_L32_c171020.nc -atm/cam/inic/se/ape_topo_cam4_ne30np4_L26_c171020.nc -atm/cam/inic/se/ape_topo_cam4_ne30np4_L30_c171020.nc -atm/cam/inic/se/ape_topo_cam6_ne30np4_L32_c171023.nc -atm/cam/inic/se/ape_topo_cam4_ne60np4_L26_c171018.nc -atm/cam/inic/se/ape_topo_cam4_ne60np4_L30_c171020.nc -atm/cam/inic/se/ape_topo_cam4_ne60np4_L32_c171020.nc -atm/cam/inic/se/ape_topo_cam4_ne120np4_L26_c171018.nc -atm/cam/inic/se/ape_topo_cam4_ne120np4_L30_c171024.nc -atm/cam/inic/se/ape_topo_cam4_ne120np4_L32_c171023.nc -atm/cam/inic/homme/cami_1850-01-01_ne240np4_L26_c110314.nc -atm/cam/inic/homme/cami_0000-09-01_ne240np4_L26_c061106.nc - -atm/cam/inic/homme/cami-mam3_0000-01-ne240np4_L30_c111004.nc - atm/cam/inic/se/ape_cam4_ne5np4_L26_c170517.nc atm/cam/inic/se/ape_cam4_ne16np4_L26_c170417.nc atm/cam/inic/se/ape_cam4_ne30np4_L26_c170417.nc @@ -165,10 +146,6 @@ atm/cam/inic/se/ape_cam6_ne120np4_L32_c170908.nc atm/cam/inic/se/ape_cam6_ne240np4_L32_c170908.nc -atm/waccm/ic/wa3_ne5np4_1950_spinup.cam2.i.1960-01-01-00000_c150810.nc -atm/waccm/ic/waccm5_1850_ne30np4_L70_0001-01-11-00000_c151217.nc -atm/cam/inic/se/f_asd2017.cam6_clm5_ne0conus30x8_t12_1980-01-01-00000.nc - atm/cam/topo/topo-from-cami_0000-01-01_256x512_L26_c030918.nc atm/cam/topo/USGS-gtopo30_128x256_c050520.nc @@ -186,34 +163,6 @@ atm/cam/topo/USGS-gtopo30_4x5_remap_c050520.nc atm/cam/topo/fv_10x15_nc0540_Nsw042_Nrs008_Co060_Fi001_20171220.nc -atm/cam/topo/se/ne5np4_nc3000_Co360_Fi001_MulG_PF_nullRR_Nsw064_20170515.nc -atm/cam/topo/se/ne16np4_nc3000_Co120_Fi001_PF_nullRR_Nsw084_20171012.nc -atm/cam/topo/se/ne30np4_nc3000_Co060_Fi001_PF_nullRR_Nsw042_20171020.nc -atm/cam/topo/se/ne60np4_nc3000_Co030_Fi001_PF_nullRR_Nsw021_20171012.nc -atm/cam/topo/se/ne120np4_nc3000_Co015_Fi001_PF_nullRR_Nsw010_20171011.nc -atm/cam/topo/se/ne240np4_nc3000_Co008_Fi001_PF_nullRR_Nsw005_20171014.nc - -atm/cam/topo/se/ne5pg2_nc3000_Co360_Fi001_MulG_PF_nullRR_Nsw060_20170706.nc -atm/cam/topo/se/ne30pg2_nc3000_Co060_Fi001_PF_nullRR_Nsw042_20171014.nc -atm/cam/topo/se/ne60pg2_nc3000_Co030_Fi001_PF_nullRR_Nsw021_20171014.nc -atm/cam/topo/se/ne120pg2_nc3000_Co015_Fi001_PF_nullRR_Nsw010_20171012.nc -atm/cam/topo/se/ne240pg2_nc3000_Co008_Fi001_PF_nullRR_Nsw005_20171014.nc - -atm/cam/topo/se/ne5pg3_nc3000_Co360_Fi001_MulG_PF_nullRR_Nsw064_20170516.nc -atm/cam/topo/se/ne16pg3_nc3000_Co120_Fi001_PF_nullRR_Nsw084_20171012.nc -atm/cam/topo/se/ne30pg3_nc3000_Co060_Fi001_PF_nullRR_Nsw042_20171014.nc -atm/cam/topo/se/ne60pg3_nc3000_Co030_Fi001_PF_nullRR_Nsw021_20171012.nc -atm/cam/topo/se/ne120pg3_nc3000_Co015_Fi001_PF_nullRR_Nsw010_20171014.nc -atm/cam/topo/se/ne240pg3_nc3000_Co008_Fi001_PF_nullRR_Nsw005_20171015.nc - -atm/cam/topo/se/ne5pg4_nc3000_Co360_Fi001_MulG_PF_nullRR_Nsw060_20170707.nc -atm/cam/topo/se/ne30pg4_nc3000_Co060_Fi001_PF_nullRR_Nsw042_20171014.nc -atm/cam/topo/se/ne60pg4_nc3000_Co030_Fi001_PF_nullRR_Nsw021_20171018.nc -atm/cam/topo/se/ne120pg4_nc3000_Co015_Fi001_PF_nullRR_Nsw010_20171014.nc - - -atm/cam/topo/conus_30_x8_nc3000_Co060_Fi001_MulG_PF_CONUS_Nsw042_20170417.nc - atm/cam/topo/fv_0.9x1.25_nc3000_Nsw006_Nrs002_Co008_Fi001_ZR_c160505.nc atm/cam/topo/fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_ZR_061116.nc diff --git a/bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml b/bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml index 18e25be5b7..de0a37ca2f 100644 --- a/bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml +++ b/bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml @@ -5,7 +5,6 @@ 00010101 atm/cam/inic/fv/f.e20.FCHIST.f09_f09_mg17.cesm2_0_rel.emis_fix.001.cam.i.1996-01-01-00000_c180716.nc -atm/cam/inic/se/f.e20.FCHIST.ne30_ne30.chem01_cam5_4_152.001.cam.i.2011-01-01-00000_c171215.nc atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc diff --git a/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml b/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml index 54883a048c..8ff766ab4c 100644 --- a/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml +++ b/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml @@ -5,7 +5,6 @@ 00010101 atm/cam/inic/fv/f.e20.FCHIST.f09_f09_mg17.cesm2_0_rel.emis_fix.001.cam.i.1996-01-01-00000_c180716.nc -atm/cam/inic/se/f.e20.FCHIST.ne30_ne30.chem01_cam5_4_152.001.cam.i.2011-01-01-00000_c171215.nc atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc diff --git a/bld/namelist_files/use_cases/waccm_sc_2000_cam4.xml b/bld/namelist_files/use_cases/waccm_sc_2000_cam4.xml index 434e30a76c..5321d3a61e 100644 --- a/bld/namelist_files/use_cases/waccm_sc_2000_cam4.xml +++ b/bld/namelist_files/use_cases/waccm_sc_2000_cam4.xml @@ -26,8 +26,6 @@ atm/waccm/ic/f2000.e10r02.2deg.waccm.005.cam2.i.0017-01-01-00000.nc atm/waccm/ic/f40.2000.track1.4deg.001.cam2.i.0013-01-01-00000.nc -atm/waccm/ic/f.e11.FWSC.ne30_ne30.wm_SE.003.cam.i.0006-01-01-00000.nc - diff --git a/doc/ChangeLog b/doc/ChangeLog index 5a3d37a4b6..83a427d070 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,61 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_01 +Originator(s): eaton +Date: Tue Nov 6 10:40:02 MST 2018 +One-line Summary: use release tags for CAM externals; disable some SE functionality + +Purpose of changes: + +. Change CAM externals to use release_tag versions. + +. Disable ability of SE dycore to run with topography or with the new CSLAM + advection and physics grid. The dycore may still be run for simple + models and aquaplanet mode using the GLL advection. + +Bugs fixed (include bugzilla ID): none + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +components/cam/SVN_EXTERNAL_DIRECTORIES +. same changes to use release tags for CAM externals as done for cesm2_0 + +components/cam/bld/build-namelist +. don't allow SE with topo files + +components/cam/bld/configure +. disable SE with CSLAM and FVM physics grid + +components/cam/bld/namelist_files/namelist_defaults_cam.xml +. remove SE IC files for runs w/ topo. Remove all SE topo files. + +components/cam/bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml +components/cam/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml +components/cam/bld/namelist_files/use_cases/waccm_sc_2000_cam4.xml +. remove SE IC file + +components/cam/src/dynamics/se/dyn_comp.F90 +. call endrun if fh_topo is associated. + +*** No testing done *** + +=============================================================== +=============================================================== + Tag name: cam6_0_034 Originator(s): aconley, eaton Date: Mon Nov 5 10:01:13 MST 2018 diff --git a/src/dynamics/se/dyn_comp.F90 b/src/dynamics/se/dyn_comp.F90 index 45da6ea86f..c7b3cbde6b 100644 --- a/src/dynamics/se/dyn_comp.F90 +++ b/src/dynamics/se/dyn_comp.F90 @@ -1649,50 +1649,7 @@ subroutine read_phis(dyn_in) if (associated(fh_topo)) then - ! Set PIO to return error flags. - call pio_seterrorhandling(fh_topo, PIO_BCAST_ERROR, pio_errtype) - - ! Set name of grid object which will be used to read data from file - ! into internal data structure via PIO. - if (fv_nphys == 0) then - grid_name = 'GLL' - else - grid_name = 'physgrid_d' - end if - - ! Get number of global columns from the grid object and check that - ! it matches the file data. - call cam_grid_dimensions(grid_name, dims) - dyn_cols = dims(1) - - ! The dimension of the unstructured grid in the TOPO file is 'ncol'. - ierr = pio_inq_dimid(fh_topo, 'ncol', ncol_did) - if (ierr /= PIO_NOERR) then - call endrun(subname//': dimension ncol not found in bnd_topo file') - end if - ierr = pio_inq_dimlen(fh_topo, ncol_did, ncol_size) - if (ncol_size /= dyn_cols) then - if (masterproc) then - write(iulog,*) subname//': ncol_size=', ncol_size, ' : dyn_cols=', dyn_cols - end if - call endrun(subname//': ncol size in bnd_topo file does not match grid definition') - end if - - fieldname = 'PHIS' - if (dyn_field_exists(fh_topo, trim(fieldname))) then - if (fv_nphys == 0) then - call read_dyn_var(fieldname, fh_topo, 'ncol', phis_tmp) - else - call read_phys_field_2d(fieldname, fh_topo, 'ncol', phis_phys_tmp) - call map_phis_from_physgrid_to_gll(dyn_in%fvm, elem, phis_phys_tmp, & - phis_tmp, pmask) - end if - else - call endrun(subname//': Could not find PHIS field on input datafile') - end if - - ! Put the error handling back the way it was - call pio_seterrorhandling(fh_topo, pio_errtype) + call endrun(subname//': surface components with topography not supported') else if (analytic_ic_active() .and. (iam < par%nprocs)) then From 1abe24c21b64791878ebc87f475a1d544089f0fb Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 16 Nov 2018 10:51:19 -0700 Subject: [PATCH 003/239] 'Update the science support and testing to reflect what is in the release Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90212 Committed by Cheryl Craig at 2018-11-16 10:51:19 -0700 Original svn commit message: Update the science support and testing to reflect what is in the release' --- cime_config/config_compsets.xml | 35 +++++++++++----------- cime_config/testdefs/testlist_cam.xml | 13 ++++----- doc/ChangeLog | 42 +++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 26 deletions(-) diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 5e07c0c925..324fd3c21a 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -68,6 +68,13 @@ + + FKESSLER + 2000_CAM%KESSLER_SLND_SICE_SOCN_SROF_SGLC_SWAV + + + + FSCAM 2000_CAM60%SCAM_CLM50%SP_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV @@ -150,10 +157,6 @@ 2000_CAM%TJ16_SLND_SICE_SOCN_SROF_SGLC_SWAV - - FKESSLER - 2000_CAM%KESSLER_SLND_SICE_SOCN_SROF_SGLC_SWAV - @@ -266,40 +269,36 @@ + + FW1850 + 1850_CAM60%WCTS_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV + + + + + + + FWsc2010climo 2010_CAM60%WCSC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV - FWsc2000climo 2000_CAM60%WCSC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV - FWsc1850 1850_CAM60%WCSC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV - FWscHIST HIST_CAM60%WCSC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV - - - FW1850 - 1850_CAM60%WCTS_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV - - - - - - - FW2000climo 2000_CAM60%WCTS_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV diff --git a/cime_config/testdefs/testlist_cam.xml b/cime_config/testdefs/testlist_cam.xml index caf172fad4..2f6161b26a 100644 --- a/cime_config/testdefs/testlist_cam.xml +++ b/cime_config/testdefs/testlist_cam.xml @@ -107,14 +107,6 @@ - - - - - - - - @@ -255,6 +247,11 @@ + + + + + diff --git a/doc/ChangeLog b/doc/ChangeLog index 83a427d070..ff555ae48e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,47 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_02 +Originator(s): cacraig +Date: Nov 16, 2018 +One-line Summary: Update the science support and testing to reflect what is in the release + +Purpose of changes: + +- add science support flag for 1 and 2 degree FKESSLER runs +- remove science support flag from FWsc... compsets +- remove F2000climo ne30 test as CAM-SE is not supported in CESM2.1 +- introduce FKESSLER 1 degree test (since it is science supported) + +Bugs fixed (include bugzilla ID): none + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: AMP scientists directed these changes + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: +M components/cam/cime_config/config_compsets.xml + - Set 1 and 2 degree FKESSLER to science supported + - Remove science support flag from FWscXXX compsets + +M components/cam/cime_config/testdefs/testlist_cam.xml + - Remove F2000climo ne30 test as CAM-SE is not in this release + - Add FKESSLER 1 degree test scine it is science supported + +*** No testing done *** + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_01 Originator(s): eaton Date: Tue Nov 6 10:40:02 MST 2018 From 472dfd611e6d145441bb0fe1bf2d57a236fe36c3 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Wed, 21 Nov 2018 10:48:10 -0700 Subject: [PATCH 004/239] 'workaround for cam.input_data_list Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90227 Committed by Brian Eaton at 2018-11-21 10:48:10 -0700 Original svn commit message: workaround for cam.input_data_list' --- bld/build-namelist | 10 +++- bld/namelist_files/namelist_defaults_cam.xml | 11 ++-- bld/namelist_files/namelist_definition.xml | 8 +++ doc/ChangeLog | 56 ++++++++++++++++++++ 4 files changed, 80 insertions(+), 5 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index f16c27a1a5..8cffb24c6f 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -895,9 +895,17 @@ if ($co2_cycle) { # Check whether user has explicitly turned off reading the aircraft CO2 dataset. # (user specification has higher precedence than the true value set above) if ($nl->get_value('co2_readflux_aircraft') =~ /$TRUE/io) { - add_default($nl, 'aircraft_specifier'); + + my $rel_filepath = get_default_value('ac_CO2_emis'); + my $emisval = quote_string('ac_CO2 -> ' . $rel_filepath); + add_default($nl, 'aircraft_specifier', 'val'=>$emisval); + add_default($nl, 'aircraft_datapath'); add_default($nl, 'aircraft_type'); + # This should be the same file as the one in the aircraft_specifier file. + # This is a workaround to get this filepath into the cam.input_data_list file + # to allow the CESM scripts to obtain all required data for a run. + add_default($nl, 'aircraft_co2_file'); } } } diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 3f297fe4f0..17ebec5ca6 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -399,10 +399,13 @@ atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_1.9x2.5_c20181011.nc -ac_CO2 -> ac_CO2_filelist_175001-201512_fv_0.9x1.25_c20181011.txt -ac_CO2 -> ac_CO2_filelist_175001-201512_fv_1.9x2.5_c20181011.txt -atm/cam/ggas -SERIAL +ac_CO2_filelist_175001-201512_fv_0.9x1.25_c20181011.txt +ac_CO2_filelist_175001-201512_fv_1.9x2.5_c20181011.txt +atm/cam/ggas +SERIAL + +atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_175001-201512_fv_0.9x1.25_c20181011.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_175001-201512_fv_1.9x2.5_c20181011.nc atm/cam/scyc/DMS_emissions_128x256_clim_c040122.nc diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 28899a7082..8d8acbafa4 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -5289,6 +5289,14 @@ Type of time interpolation for data in aircraft aerosol files. Default: 'CYCLICAL_LIST' + +Full pathname of the ac_CO2 file specified in the filelist in +{{ hilight }}aircraft_specifier{{ closehilight }}. This is only to +get this name into the cam.input_data_list for the CESM scripts. +Default: set by build-namelist. + + Date: Mon, 26 Nov 2018 15:13:56 -0700 Subject: [PATCH 005/239] 'fixes for EUL w/ simple models Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90236 Committed by Brian Eaton at 2018-11-26 15:13:56 -0700 Original svn commit message: fixes for EUL w/ simple models' --- doc/ChangeLog | 57 +++++++++++++++++++ src/dynamics/eul/dyn_comp.F90 | 31 ++++++---- .../initial_conditions/ic_baroclinic.F90 | 31 +++++++--- 3 files changed, 99 insertions(+), 20 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 61fb2ff475..9d2f308b28 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,62 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_04 +Originator(s): eaton +Date: Mon Nov 26 14:58:38 MST 2018 +One-line Summary: fixes for simple models w/ EUL dycore + +Purpose of changes: + +. Don't allow EUL initialization to change the dry mass when it has been + set via the analytic initial conditions option. + +. Fix analytic IC code for baroclinic wave to correctly initialize + constituents. + +Bugs fixed (include bugzilla ID): + +. see above + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +components/cam/src/dynamics/eul/dyn_comp.F90 +. global_int + - modify so that no change is made to PS if the analytic IC code is + active. + +components/cam/src/dynamics/tests/initial_conditions/ic_baroclinic.F90 +. bc_wav_set_ic + - remove assumption that all constituents are present in input + constituent array. This is to handle the Eulerian dycore which passes + one constituent at a time. + +Testing: + +Check that Eulerian core gives reasonable results compared to FV when run +with baroclinic wave ICs, terminator chemistry, and moist or dry physics. + +Summarize any changes to answers: BFB except: +1) Eulerian dycore with analytic baroclinic wave ICs and terminator + chemistry. +2) Eulerian dycore with moist simple physics (kessler or tj2016). + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_03 Originator(s): eaton Date: Wed Nov 21 10:46:40 MST 2018 diff --git a/src/dynamics/eul/dyn_comp.F90 b/src/dynamics/eul/dyn_comp.F90 index d50ef6df21..5208bd122d 100644 --- a/src/dynamics/eul/dyn_comp.F90 +++ b/src/dynamics/eul/dyn_comp.F90 @@ -918,6 +918,7 @@ subroutine global_int() use hycoef, only: hyai, ps0 use eul_control_mod, only: pdela, qmass1, tmassf, fixmas, & tmass0, zgsint, qmass2, qmassf + use inic_analytic, only: analytic_ic_active !---------------------------Local workspace----------------------------- @@ -1020,11 +1021,15 @@ subroutine global_int() zgsint_tmp = zgsint_tmp*.5_r8/gravit qmassf_tmp = qmass1_tmp + qmass2_tmp - ! Globally avgd sfc. partial pressure of dry air (i.e. global dry mass): - tmass0 = 98222._r8/gravit - if (.not. associated(fh_topo)) tmass0 = (101325._r8-245._r8)/gravit - if (adiabatic) tmass0 = tmassf_tmp - if (ideal_phys ) tmass0 = 100000._r8/gravit + if (analytic_ic_active()) then + tmass0 = tmassf_tmp + else + ! Globally avgd sfc. partial pressure of dry air (i.e. global dry mass): + tmass0 = 98222._r8/gravit + if (.not. associated(fh_topo)) tmass0 = (101325._r8-245._r8)/gravit + if (adiabatic) tmass0 = tmassf_tmp + if (ideal_phys ) tmass0 = 100000._r8/gravit + end if if (masterproc) then write(iulog,*) sub//': INFO:' @@ -1034,14 +1039,18 @@ subroutine global_int() write(iulog,*) ' Globally averaged geopotential height (m) = ', zgsint_tmp end if - ! Compute and apply an initial mass fix factor which preserves horizontal - ! gradients of ln(ps). - if (.not. moist_physics) then - fixmas = tmass0/tmassf_tmp + if (analytic_ic_active()) then + fixmas = 1._r8 else - fixmas = (tmass0 + qmass1_tmp)/(tmassf_tmp - qmass2_tmp) + ! Compute and apply an initial mass fix factor which preserves horizontal + ! gradients of ln(ps). + if (.not. moist_physics) then + fixmas = tmass0/tmassf_tmp + else + fixmas = (tmass0 + qmass1_tmp)/(tmassf_tmp - qmass2_tmp) + end if + ps_tmp = ps_tmp*fixmas end if - ps_tmp = ps_tmp*fixmas ! Global integerals tmassf = tmassf_tmp diff --git a/src/dynamics/tests/initial_conditions/ic_baroclinic.F90 b/src/dynamics/tests/initial_conditions/ic_baroclinic.F90 index 34a25922c3..4bc9b0e7bb 100644 --- a/src/dynamics/tests/initial_conditions/ic_baroclinic.F90 +++ b/src/dynamics/tests/initial_conditions/ic_baroclinic.F90 @@ -113,6 +113,7 @@ subroutine bc_wav_set_ic(vcoord,latvals, lonvals, U, V, T, PS, PHIS, & real(r8) :: psurface real(r8) :: wvp,qdry logical :: lU, lV, lT, lQ, l3d_vars + logical :: cnst1_is_moisture real(r8), allocatable :: pdry_half(:), pwet_half(:),zdry_half(:),zk(:) if ((vcoord == vc_moist_pressure) .or. (vcoord == vc_dry_pressure)) then @@ -216,7 +217,13 @@ subroutine bc_wav_set_ic(vcoord,latvals, lonvals, U, V, T, PS, PHIS, & if (lu) nlev = size(U, 2) if (lv) nlev = size(V, 2) if (lt) nlev = size(T, 2) - if (lq) nlev = size(Q, 2) + + if (lq) then + nlev = size(Q, 2) + ! check whether first constituent in Q is water vapor. + cnst1_is_moisture = m_cnst(1) == 1 + end if + allocate(zk(nlev+1)) if ((lq.or.lt) .and. (vcoord == vc_dry_pressure)) then allocate(pdry_half(nlev+1)) @@ -259,7 +266,7 @@ subroutine bc_wav_set_ic(vcoord,latvals, lonvals, U, V, T, PS, PHIS, & else qk = 0.d0 end if - if (lq) Q(i,k,1) = qk + if (lq .and. cnst1_is_moisture) Q(i,k,1) = qk if (lt) then tvk = Tv_given_z(zk(k),latvals(i)) T(i,k) = tvk / (1.d0 + Mvap * qk) @@ -290,7 +297,7 @@ subroutine bc_wav_set_ic(vcoord,latvals, lonvals, U, V, T, PS, PHIS, & else qdry = 0.0_r8 end if - if (lq) then + if (lq .and. cnst1_is_moisture) then Q(i,k,1) = qdry end if if (lt) then @@ -307,21 +314,25 @@ subroutine bc_wav_set_ic(vcoord,latvals, lonvals, U, V, T, PS, PHIS, & if(lu .and. masterproc.and. verbose_use) write(iulog,*) ' U initialized by "',subname,'"' if(lv .and. masterproc.and. verbose_use) write(iulog,*) ' V initialized by "',subname,'"' if(lt .and. masterproc.and. verbose_use) write(iulog,*) ' T initialized by "',subname,'"' - if(lq .and. masterproc.and. verbose_use) write(iulog,*) & + if(lq .and. cnst1_is_moisture .and. masterproc.and. verbose_use) write(iulog,*) & ' ', trim(cnst_name(m_cnst(1))), ' initialized by "',subname,'"' end if if (lq) then ncnst = size(m_cnst, 1) if ((vcoord == vc_moist_pressure) .or. (vcoord == vc_dry_pressure)) then - do m = 2, ncnst - call cnst_init_default(m_cnst(m), latvals, lonvals, Q(:,:,m_cnst(m)),& + do m = 1, ncnst + + ! water vapor already done above + if (m_cnst(m) == 1) cycle + + call cnst_init_default(m_cnst(m), latvals, lonvals, Q(:,:,m),& mask=mask_use, verbose=verbose_use, notfound=.false.) #if 0 do k = 1, nlev do i=1,ncol if (mask_use(i)) then - Q(i,k,m_cnst(m)) = test_func(latvals(i),lonvals(i), k, m) + Q(i,k,m) = test_func(latvals(i),lonvals(i), k, m) end if end do end do @@ -330,8 +341,10 @@ subroutine bc_wav_set_ic(vcoord,latvals, lonvals, U, V, T, PS, PHIS, & end if #endif end do - end if - end if + + end if ! vcoord + end if ! lq + deallocate(mask_use) if (l3d_vars) then deallocate(zk) From 9816b5daea1320f5a2d6c22ba1e7e9b85fef68a0 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Tue, 27 Nov 2018 13:59:57 -0700 Subject: [PATCH 006/239] 'Change longname format of SD compsets; bug fix for simple physics Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90244 Committed by Francis Vitt at 2018-11-27 13:59:57 -0700 Original svn commit message: Change longname format of SD compsets; bug fix for simple physics M components/cam/cime_config/config_component.xml M components/cam/cime_config/config_compsets.xml M components/cam/doc/ChangeLog M components/cam/src/physics/simple/tj2016.F90 ' --- cime_config/config_component.xml | 39 +++++++------- cime_config/config_compsets.xml | 45 +++++------------ doc/ChangeLog | 87 ++++++++++++++++++++++++++++++++ src/physics/simple/tj2016.F90 | 2 +- 4 files changed, 121 insertions(+), 52 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 7873931219..dfbba10270 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -8,9 +8,9 @@ CAM =============== --> - CAM cam6 physics: - CAM cam5 physics: - CAM cam4 physics: + CAM cam6 physics: + CAM cam5 physics: + CAM cam4 physics: CAM simplified and non-versioned physics : CAM stand-alone single column mode -- need to define usermods directory with IOP settings: - CAM winds and temperature nudged towards prescribed meteorology: + CAM winds and temperature nudged towards prescribed meteorology: -analytic_ic @@ -240,13 +240,14 @@ 2006-2100_cam5_rcp60 2006-2100_cam5_rcp85 - sd_waccmx_ma_cam4 - sd_waccm_tsmlt_cam6 - sd_waccm_ma_cam6 - sd_waccm_ma_cam6 - sd_waccm_ma_cam4 - sd_trop_strat_vbs_cam6 - sd_cam6 + sd_waccmx_ma_cam4 + sd_waccmx_ma_cam4 + sd_waccm_tsmlt_cam6 + sd_waccm_ma_cam6 + sd_waccm_ma_cam6 + sd_waccm_ma_cam4 + sd_trop_strat_vbs_cam6 + sd_cam6 dabi_p2004 held_suarez_1994 diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 324fd3c21a..b93b3da8fe 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -218,12 +218,12 @@ FCSD - SDYN_CAM60%CCTS_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV + HIST_CAM60%CCTS%SDYN_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV FSD - SDYN_CAM60_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV + HIST_CAM60%SDYN_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV @@ -311,7 +311,7 @@ FWSD - SDYN_CAM60%WCTS_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV + HIST_CAM60%WCTS%SDYN_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV @@ -326,7 +326,7 @@ FWmaSD - SDYN_CAM60%WCCM_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV + HIST_CAM60%WCCM%SDYN_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV @@ -336,7 +336,7 @@ FWmadSD - SDYN_CAM60%WCMD_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV + HIST_CAM60%WCMD%SDYN_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV @@ -345,7 +345,7 @@ FW4madSD - SDYN_CAM40%WCMD_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV + HIST_CAM40%WCMD%SDYN_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV @@ -355,13 +355,11 @@ FX2000 2000_CAM40%WXIE_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV - FXHIST HIST_CAM40%WXIE_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV - @@ -371,13 +369,12 @@ FXSD - SDYN_CAM40%WXIE_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV - + HIST_CAM40%WXIE%SDYN_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV FXmadSD - SDYN_CAM40%WXIED_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV + HIST_CAM40%WXIED%SDYN_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV @@ -395,9 +392,9 @@ 1995-01-01 1995-01-01 2005-01-01 - 2005-01-01 - 2010-01-01 - 2000-01-01 + 2005-01-01 + 2010-01-01 + 2000-01-01 2004-01-01 1950-01-01 @@ -426,7 +423,7 @@ - GREGORIAN + GREGORIAN GREGORIAN @@ -468,12 +465,6 @@ $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_2010climo_c180511.nc $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_2010climo_c180511.nc $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_2010climo_c180511.nc - - - $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_1850_2016_c170525.nc - $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_1850_2016_c170525.nc - $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_1850_2016_c170525.nc - $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_1850_2016_c170525.nc @@ -501,19 +492,9 @@ $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.0.23x0.31_gx1v6_101108.nc - - - 1850 - - - - - 1850 - - - 2016 + 2016 diff --git a/doc/ChangeLog b/doc/ChangeLog index 9d2f308b28..7d08612f91 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,92 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_05 +Originator(s): fvitt, eaton +Date: 27 Nov 2018 +One-line Summary: Change longname format of SD compsets; bug fix for simple physics + +Purpose of changes: + + Use "HIST_" time period and "%SDYN" in longname of SD compsets (specified dynamics). + This configures CLM to be in a transient mode. + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: + +M components/cam/cime_config/config_component.xml +M components/cam/cime_config/config_compsets.xml + - use "HIST_" time period and "%SDYN" in longname of SD compsets (specified dynamics). + +M components/cam/src/physics/simple/tj2016.F90 + - bug fix from eaton -- correction to argument array size + +Testing: + +cheyenne/intel/waccm: + ERP_Ld3.f09_f09_mg17.FWmaSD.cheyenne_intel.cam-outfrq3d (Overall: DIFF) details: + FAIL ERP_Ld3.f09_f09_mg17.FWmaSD.cheyenne_intel.cam-outfrq3d NLCOMP + FAIL ERP_Ld3.f09_f09_mg17.FWmaSD.cheyenne_intel.cam-outfrq3d BASELINE cesm2_1_rel_04 + ERP_Ld3.f09_f09_mg17.FWSD.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details: + FAIL ERP_Ld3.f09_f09_mg17.FWSD.cheyenne_intel.cam-outfrq1d NLCOMP + FAIL ERP_Ld3.f09_f09_mg17.FWSD.cheyenne_intel.cam-outfrq1d BASELINE cesm2_1_rel_04 + ERP_Ld3.f19_f19_mg16.FW4madSD.cheyenne_intel.cam-outfrq3d (Overall: DIFF) details: + FAIL ERP_Ld3.f19_f19_mg16.FW4madSD.cheyenne_intel.cam-outfrq3d NLCOMP + FAIL ERP_Ld3.f19_f19_mg16.FW4madSD.cheyenne_intel.cam-outfrq3d BASELINE cesm2_1_rel_04 + SMS_D_Ln9.f09_f09_mg17.FWSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9.f09_f09_mg17.FWSD.cheyenne_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.f09_f09_mg17.FWSD.cheyenne_intel.cam-outfrq9s BASELINE cesm2_1_rel_04 + SMS_D_Ln9.f19_f19_mg16.FW4madSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9.f19_f19_mg16.FW4madSD.cheyenne_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.f19_f19_mg16.FW4madSD.cheyenne_intel.cam-outfrq9s BASELINE cesm2_1_rel_04 + SMS_Ld5.f09_f09_mg17.FWmadSD.cheyenne_intel.cam-reduced_hist5d (Overall: DIFF) details: + FAIL SMS_Ld5.f09_f09_mg17.FWmadSD.cheyenne_intel.cam-reduced_hist5d NLCOMP + FAIL SMS_Ld5.f09_f09_mg17.FWmadSD.cheyenne_intel.cam-reduced_hist5d BASELINE cesm2_1_rel_04 + - expected baseline failures due to changes in CLM namelist options in SD compsets + +cheyenne/intel/camchem: + ERP_Ld3.f09_f09_mg17.FCSD.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details: + FAIL ERP_Ld3.f09_f09_mg17.FCSD.cheyenne_intel.cam-outfrq1d NLCOMP + FAIL ERP_Ld3.f09_f09_mg17.FCSD.cheyenne_intel.cam-outfrq1d BASELINE cesm2_1_rel_04 + - expected baseline failure due to changes in CLM namelist options in SD compsets + + ERP_Ln9.f05_f05_mg17.FCSD.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details: + FAIL ERP_Ln9.f05_f05_mg17.FCSD.cheyenne_intel.cam-outfrq9s NLCOMP + FAIL ERP_Ln9.f05_f05_mg17.FCSD.cheyenne_intel.cam-outfrq9s RUN time=52 + SMS_D_Ln9.f05_f05_mg17.FCSD.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details: + FAIL SMS_D_Ln9.f05_f05_mg17.FCSD.cheyenne_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.f05_f05_mg17.FCSD.cheyenne_intel.cam-outfrq9s MODEL_BUILD time=21 + - f05 resolution is broken -- clm fix is need to point to an existing fsurdat file + +cheyenne/intel/aux_cam: + + ERP_Ld3.f19_f19_mg16.FW4madSD.cheyenne_intel.cam-outfrq3d (Overall: DIFF) details: + FAIL ERP_Ld3.f19_f19_mg16.FW4madSD.cheyenne_intel.cam-outfrq3d NLCOMP + FAIL ERP_Ld3.f19_f19_mg16.FW4madSD.cheyenne_intel.cam-outfrq3d BASELINE cam6_0_034 + SMS_D_Ln9.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s BASELINE cam6_0_034 + - expected baseline failures due to changes in CLM namelist options in SD compsets + +Summarize any changes to answers: SD compsets change answers, otherwise B4B + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_04 Originator(s): eaton Date: Mon Nov 26 14:58:38 MST 2018 diff --git a/src/physics/simple/tj2016.F90 b/src/physics/simple/tj2016.F90 index 542ae54da4..5f46b13e2d 100644 --- a/src/physics/simple/tj2016.F90 +++ b/src/physics/simple/tj2016.F90 @@ -176,7 +176,7 @@ subroutine Thatcher_Jablonowski_sfc_pbl_hs(ncol, pver, dtime, clat, & real(r8), intent(in) :: clat(ncol) ! latitude real(r8), intent(in) :: PS(ncol) ! surface pressure (Pa) real(r8), intent(in) :: pmid(ncol,pver) ! mid-point pressure (Pa) - real(r8), intent(in) :: pint(ncol,pver) ! interface pressure (Pa) + real(r8), intent(in) :: pint(ncol,pver+1) ! interface pressure (Pa) real(r8), intent(in) :: lnpint(ncol,2) ! ln(interface pressure (Pa)) at and above the surface real(r8), intent(in) :: rpdel(ncol,pver) ! reciprocal of layer thickness (Pa) From 0802a7f26b5a56bb92eade865e675d6f8cc3a668 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Fri, 11 Jan 2019 15:01:57 -0700 Subject: [PATCH 007/239] 'fix for dry constituent mixing ratios in FV initial file Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90469 Committed by Brian Eaton at 2019-01-11 15:01:57 -0700 Original svn commit message: fix for dry constituent mixing ratios in FV initial file' --- doc/ChangeLog | 97 +++++++++++++++++++++++++++++ src/control/cam_history.F90 | 32 +++++++--- src/control/cam_history_support.F90 | 1 + src/dynamics/fv/diag_dynvar_ic.F90 | 23 ++++--- src/dynamics/fv/dyn_comp.F90 | 45 +++++++++++-- src/dynamics/fv/stepon.F90 | 7 +-- 6 files changed, 181 insertions(+), 24 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 7d08612f91..f3bac1e2aa 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,102 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_06 +Originator(s): klindsay, eaton +Date: Fri Jan 11 14:42:36 MST 2019 +One-line Summary: fix for dry constituent mixing ratios in FV initial file output + +Purpose of changes: + +The bug discovered by Keith is that CAM-FV has been writing initial files with +all constituents having wet mixing ratios. But in an initial run (which is +the mode CAM is in for a hybrid startup) the FV code assumes that +constitutents which are are registered as 'dry' will have dry mixing ratios +in the initial file. It then converts the dry mixing ratio to wet since +that is what the dycore needs. But since they are already wet (due to the +bug) an extra dry to wet conversion is being applied. This reduces the +mixing ratios, so is effectively a small mass sink. It would be difficult +to notice this except if you're looking closely at a field like CO2 which +is nearly constant and you see a strange pattern in it that looks like the +water vapor distribution. That's how Keith noticed the problem. + +The fix that's been implemented is: + +1) fix the output initial files so that constituents declared as dry are + output as dry mixing ratios + +2) add an attribute to all constituent output which explicitly declares + whether the mixing ratio is wet or dry + +3) add a backward compatibility feature so that when reading constituents + from an initial file, if this new attribute is not present then treat + the mixing ratio as wet. This will eliminate the extra dry to wet + conversion that is happening in the current code. + +Bugs fixed (include bugzilla ID): see above + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +components/cam/src/control/cam_history.F90 +. addfld_nd + - check whether field is an advected constituent, and if so then add + whether the mixing ratio uses a dry or wet air basis to the field_info + object. + +. h_define + - check whether the mixing_ratio component of the field_info object is + set, and if so then use it as the value of attribute mixing_ratio + +components/cam/src/control/cam_history_support.F90 +. add mixing_ratio to the field_info type. + +components/cam/src/dynamics/fv/diag_dynvar_ic.F90 +. add wet to dry mixing ratio conversion for dry constituents. + +components/cam/src/dynamics/fv/dyn_comp.F90 +. read_inidat + - set new initial_mr array to specify whether the constituent has been + initialized with wet or dry mixing ratios. This is for backwards + compatibility with previously written initial files which contain wet + mixing ratio for all constituents. The old initial files do not + contain the mixing_ratio attribute, and this will be used to indicate + that the mixing ratio is wet. + +components/cam/src/dynamics/fv/stepon.F90 +. stepon_init + - use new initial_mr array to decide whether constituents need to have a dry + to wet conversion applied. This replaces the use of cnst_type to allow + correct treatment of mixing ratios read from old initial files which + were written with wet values but registered as dry in the constituents + module. + +Testing: + +Checked that the new attribute appears in all history files. + +Checked that the initial files contains diffs for constituents that are now +output with dry mixing ratios, but previously contained wet mixing ratios. + +Expect to see different simulations for FV runs that read an old initial +file and now do not apply the redundant dry to wet conversion to the +constituents that are type 'dry'. + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_05 Originator(s): fvitt, eaton Date: 27 Nov 2018 diff --git a/src/control/cam_history.F90 b/src/control/cam_history.F90 index 0f08e35904..b95a9f39d2 100644 --- a/src/control/cam_history.F90 +++ b/src/control/cam_history.F90 @@ -4239,13 +4239,20 @@ subroutine h_define (t, restart) 'h_define: cannot define units for '//trim(fname_tmp)) end if + str = tape(t)%hlist(f)%field%mixing_ratio + if (len_trim(str) > 0) then + ierr=pio_put_att (tape(t)%File, varid, 'mixing_ratio', trim(str)) + call cam_pio_handle_error(ierr, & + 'h_define: cannot define mixing_ratio for '//trim(fname_tmp)) + end if + str = tape(t)%hlist(f)%field%long_name ierr=pio_put_att (tape(t)%File, varid, 'long_name', trim(str)) call cam_pio_handle_error(ierr, & 'h_define: cannot define long_name for '//trim(fname_tmp)) - ! + ! Assign field attributes defining valid levels and averaging info - ! + cell_methods = '' if (len_trim(tape(t)%hlist(f)%field%cell_methods) > 0) then if (len_trim(cell_methods) > 0) then @@ -5051,6 +5058,7 @@ subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, & use cam_history_support, only: fillvalue, hist_coord_find_levels use cam_grid_support, only: cam_grid_id, cam_grid_is_zonal use cam_grid_support, only: cam_grid_get_coord_names + use constituents, only: pcnst, cnst_get_ind, cnst_get_type_byind ! ! Arguments @@ -5075,9 +5083,11 @@ subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, & character(len=max_fieldname_len) :: fname_tmp ! local copy of fname character(len=max_fieldname_len) :: coord_name ! for cell_methods character(len=128) :: errormsg + character(len=3) :: mixing_ratio type(master_entry), pointer :: listentry integer :: dimcnt + integer :: idx if (htapes_defined) then call endrun ('ADDFLD: Attempt to add field '//trim(fname)//' after history files set') @@ -5110,14 +5120,22 @@ subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, & call endrun ('ADDFLD: '//fname//' already on list') end if - ! + ! If the field is an advected constituent determine whether its concentration + ! is based on dry or wet air. + call cnst_get_ind(fname_tmp, idx, abort=.false.) + mixing_ratio = '' + if (idx > 0) then + mixing_ratio = cnst_get_type_byind(idx) + end if + ! Add field to Master Field List arrays fieldn and iflds ! allocate(listentry) - listentry%field%name = fname - listentry%field%long_name = long_name - listentry%field%numlev = 1 ! Will change if lev or ilev in shape - listentry%field%units = units + listentry%field%name = fname + listentry%field%long_name = long_name + listentry%field%numlev = 1 ! Will change if lev or ilev in shape + listentry%field%units = units + listentry%field%mixing_ratio = mixing_ratio listentry%field%meridional_complement = -1 listentry%field%zonal_complement = -1 listentry%htapeindx(:) = -1 diff --git a/src/control/cam_history_support.F90 b/src/control/cam_history_support.F90 index 948080e19c..49c5e77437 100644 --- a/src/control/cam_history_support.F90 +++ b/src/control/cam_history_support.F90 @@ -121,6 +121,7 @@ module cam_history_support character(len=max_fieldname_len) :: name ! field name character(len=max_chars) :: long_name ! long name character(len=max_chars) :: units ! units + character(len=3) :: mixing_ratio ! 'dry' or 'wet' character(len=max_chars) :: sampling_seq ! sampling sequence - if not every timestep, how often field is sampled ! (i.e., how often "outfld" is called): every other; only during LW/SW ! radiation calcs; etc. diff --git a/src/dynamics/fv/diag_dynvar_ic.F90 b/src/dynamics/fv/diag_dynvar_ic.F90 index d568932845..06f89acc11 100644 --- a/src/dynamics/fv/diag_dynvar_ic.F90 +++ b/src/dynamics/fv/diag_dynvar_ic.F90 @@ -8,7 +8,7 @@ subroutine diag_dynvar_ic(grid, phis, ps, t3, u3s, v3s, tracer) ! !USES: use shr_kind_mod , only: r8 => shr_kind_r8 use cam_history , only: outfld, write_inithist - use constituents , only: cnst_name, pcnst + use constituents , only: cnst_name, pcnst, cnst_type use dynamics_vars, only: T_FVDYCORE_GRID implicit none @@ -92,12 +92,23 @@ subroutine diag_dynvar_ic(grid, phis, ps, t3, u3s, v3s, tracer) enddo call outfld ('VS&IC ', tmp , idim, j) + ! The tracers are all wet mixing ratios in the dycore. If cnst_type is dry + ! then need to convert before writing to initial file. do m = 1, pcnst - do k = 1, km - do i = ifirstxy, ilastxy - tmp(i,k) = tracer(i,j,k,m) + if (cnst_type(m) == 'dry') then + do k = 1, km + do i = ifirstxy, ilastxy + ! convert wet to dry + tmp(i,k) = tracer(i,j,k,m) / (1._r8 - tracer(i,j,k,1)) + enddo enddo - enddo + else + do k = 1, km + do i = ifirstxy, ilastxy + tmp(i,k) = tracer(i,j,k,m) + enddo + enddo + end if call outfld(trim(cnst_name(m))//'&IC' , tmp , idim, j) end do @@ -105,6 +116,4 @@ subroutine diag_dynvar_ic(grid, phis, ps, t3, u3s, v3s, tracer) end if - return -!EOC end subroutine diag_dynvar_ic diff --git a/src/dynamics/fv/dyn_comp.F90 b/src/dynamics/fv/dyn_comp.F90 index a16f0672e0..f7f8226c70 100644 --- a/src/dynamics/fv/dyn_comp.F90 +++ b/src/dynamics/fv/dyn_comp.F90 @@ -44,7 +44,7 @@ module dyn_comp use spmd_utils, only: masterproc, iam use pmgrid, only: plon, plat -use constituents, only: cnst_name, cnst_read_iv, qmin +use constituents, only: pcnst, cnst_name, cnst_read_iv, qmin use time_manager, only: get_step_size @@ -61,14 +61,14 @@ module dyn_comp use cam_initfiles, only: initial_file_get_id, topo_file_get_id, pertlim use cam_pio_utils, only: clean_iodesc_list use ncdio_atm, only: infld -use pio, only: pio_inq_varid, pio_get_att - +use pio, only: pio_seterrorhandling, pio_bcast_error, pio_noerr, & + file_desc_t, pio_inq_dimid, pio_inq_dimlen, & + pio_inq_varid, pio_get_att use perf_mod, only: t_startf, t_stopf, t_barrierf use cam_logfile, only: iulog use cam_abortutils, only: endrun -use pio, only: file_desc_t, pio_inq_dimid, pio_inq_dimlen use par_vecsum_mod, only: par_vecsum use te_map_mod, only: te_map @@ -87,7 +87,8 @@ module dyn_comp dyn_state, & frontgf_idx, & frontga_idx, & - uzm_idx + uzm_idx, & + initial_mr type (t_fvdycore_state), target :: dyn_state @@ -138,6 +139,8 @@ module dyn_comp integer, protected :: frontga_idx = -1 integer, protected :: uzm_idx = -1 +character(len=3), protected :: initial_mr(pcnst) ! constituents initialized with wet or dry mr + logical :: readvar ! inquiry flag: true => variable exists on netCDF file character(len=8) :: fv_print_dpcoup_warn = "off" @@ -2810,7 +2813,7 @@ subroutine read_inidat(dyn_in) use physconst, only: pi use dyn_grid, only: get_horiz_grid_dim_d use commap, only: clat, clon, clat_staggered, londeg_st - use constituents, only: pcnst + use constituents, only: cnst_type ! Read initial dataset @@ -2855,6 +2858,14 @@ subroutine read_inidat(dyn_in) km = grid%km ntotq = grid%ntotq + ! Set the array initial_mr assuming that constituents are initialized with mixing ratios + ! that are consistent with their declared type in the constituents module. This array + ! may be modified below to provide backwards compatibility for reading old initial files + ! that contain wet mixing ratios for all constituents regardless of how they were registered. + do i = 1, pcnst + initial_mr(i) = cnst_type(i) + end do + if (analytic_ic_active()) then readvar = .false. if (jfirstxy == 1) then @@ -3007,9 +3018,11 @@ subroutine process_inidat(fh_ini, grid, dyn_in, fieldname, m_cnst) real(r8) :: xsum(grid%km) ! temp array for parallel sums + integer :: err_handling integer :: varid ! variable id integer :: ret ! return values character(len=256) :: trunits ! tracer untis + character(len=3) :: mixing_ratio character(len=*), parameter :: sub='process_inidat' !---------------------------------------------------------------------------- @@ -3098,6 +3111,26 @@ subroutine process_inidat(fh_ini, grid, dyn_in, fieldname, m_cnst) //trim(cnst_name(m_cnst))//' must be in KG/KG') end if + ! Check for mixing_ratio attribute. If present then use it to + ! specify whether the initial file contains wet or dry values. If + ! not present then assume the mixing ratio is wet. This is for + ! backwards compatibility with old initial files that were written + ! will all wet mixing ratios. + + ! We will handle errors for this routine + call pio_seterrorhandling(fh_ini, pio_bcast_error, err_handling) + + ret = pio_get_att(fh_ini, varid, 'mixing_ratio', mixing_ratio) + if (ret == pio_noerr) then + initial_mr(m_cnst) = mixing_ratio + else + initial_mr(m_cnst) = 'wet' + end if + + ! reset PIO to handle errors as before + call pio_seterrorhandling(fh_ini, err_handling) + + else if (.not. analytic_ic_active()) then ! Constituents not read from initial file are initialized by the diff --git a/src/dynamics/fv/stepon.F90 b/src/dynamics/fv/stepon.F90 index d91867bdbe..4aa446cdb0 100644 --- a/src/dynamics/fv/stepon.F90 +++ b/src/dynamics/fv/stepon.F90 @@ -20,7 +20,7 @@ module stepon use physics_types, only: physics_state, physics_tend -use dyn_comp, only: dyn_import_t, dyn_export_t +use dyn_comp, only: dyn_import_t, dyn_export_t, initial_mr use dynamics_vars, only: t_fvdycore_state, t_fvdycore_grid use dyn_internal_state, only: get_dyn_state, get_dyn_state_grid @@ -55,7 +55,7 @@ module stepon subroutine stepon_init(dyn_in, dyn_out) - use constituents, only: pcnst, cnst_get_type_byind + use constituents, only: pcnst use time_manager, only: get_step_size use physconst, only: physconst_calc_kappav, rair, cpair use inic_analytic, only: analytic_ic_active @@ -238,7 +238,7 @@ subroutine stepon_init(dyn_in, dyn_out) enddo enddo do m = 1,pcnst - if (cnst_get_type_byind(m).eq.'dry') then + if (initial_mr(m) == 'dry') then do k=1, km do j = jfirstxy, jlastxy do i = ifirstxy, ilastxy @@ -254,7 +254,6 @@ subroutine stepon_init(dyn_in, dyn_out) end if -!EOC end subroutine stepon_init !========================================================================================= From 2277d87a236606bcec6524e874291718e4a39c87 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Tue, 15 Jan 2019 18:16:28 -0700 Subject: [PATCH 008/239] 'register constituent mixing ratios as dry for WACCM Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90484 Committed by Brian Eaton at 2019-01-15 18:16:28 -0700 Original svn commit message: register constituent mixing ratios as dry for WACCM' --- doc/ChangeLog | 46 ++++++++++++++++++++++++++ src/chemistry/mozart/chemistry.F90 | 8 +---- src/physics/cam/constituents.F90 | 2 +- src/physics/cam/vertical_diffusion.F90 | 16 +++++++-- 4 files changed, 62 insertions(+), 10 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f3bac1e2aa..173cfe307b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,51 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_06 +Originator(s): pel, eaton +Date: Tue Jan 15 17:59:55 MST 2019 +One-line Summary: change WACCM configs to use dry constituents + +Purpose of changes: + +. WACCM configurations were setting constituents to have wet mmr in the + physics and chemistry code due to the molecular diffusion code needing + this. The change is to declare the constituents dry and to only convert + the mixing ratios to wet in the vertical diffusion code, and only for + waccm configurations. + +Bugs fixed (include bugzilla ID): none + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +components/cam/src/chemistry/mozart/chemistry.F90 +. remove code that sets mixtype='wet' if do_molec_diff + +components/cam/src/physics/cam/constituents.F90 +. make cnst_type protected + +components/cam/src/physics/cam/vertical_diffusion.F90 +. if do_molec_diff=.true. then + - set constituent flags in fieldlist_wet object + - call set_dry_to_wet at top of vertical_diffusion_tend + - call set_wet_to_dry at bottom of vertical_diffusion_tend + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_06 Originator(s): klindsay, eaton Date: Fri Jan 11 14:42:36 MST 2019 diff --git a/src/chemistry/mozart/chemistry.F90 b/src/chemistry/mozart/chemistry.F90 index dc7db5eadd..5afddc2d64 100644 --- a/src/chemistry/mozart/chemistry.F90 +++ b/src/chemistry/mozart/chemistry.F90 @@ -7,7 +7,7 @@ module chemistry use shr_kind_mod, only : r8 => shr_kind_r8, shr_kind_cl use ppgrid, only : pcols, pver, begchunk, endchunk use physconst, only : gravit - use constituents, only : pcnst, cnst_add, cnst_name, cnst_fixed_ubc, cnst_type + use constituents, only : pcnst, cnst_add, cnst_name, cnst_fixed_ubc use chem_mods, only : gas_pcnst use cam_history, only : fieldname_len use physics_types, only : physics_state, physics_ptend, physics_ptend_init @@ -852,12 +852,6 @@ subroutine chem_init(phys_state, pbuf2d) endif endif - ! this is moved out of chem_register because we need to know where (what pressure) - ! the upper boundary is to determine if this is a high top configuration -- after - ! initialization of ref_pres ... - if ( do_molec_diff ) then ! molecular diffusion requires 'wet' mixing ratios - cnst_type(n) = 'wet' - endif endif end do diff --git a/src/physics/cam/constituents.F90 b/src/physics/cam/constituents.F90 index 4f26c10988..89231628e4 100644 --- a/src/physics/cam/constituents.F90 +++ b/src/physics/cam/constituents.F90 @@ -51,7 +51,7 @@ module constituents real(r8), public :: cnst_cp (pcnst) ! specific heat at constant pressure (J/kg/K) real(r8), public :: cnst_cv (pcnst) ! specific heat at constant volume (J/kg/K) real(r8), public :: cnst_mw (pcnst) ! molecular weight (kg/kmole) -character*3, public :: cnst_type(pcnst) ! wet or dry mixing ratio +character*3, public, protected :: cnst_type(pcnst)! wet or dry mixing ratio character*5, public :: cnst_molec(pcnst) ! major or minor species molecular diffusion real(r8), public :: cnst_rgas(pcnst) ! gas constant () real(r8), public :: qmin (pcnst) ! minimum permitted constituent concentration (kg/kg) diff --git a/src/physics/cam/vertical_diffusion.F90 b/src/physics/cam/vertical_diffusion.F90 index d74a16a512..20a5a5f66a 100644 --- a/src/physics/cam/vertical_diffusion.F90 +++ b/src/physics/cam/vertical_diffusion.F90 @@ -444,7 +444,7 @@ subroutine vertical_diffusion_init(pbuf2d) enddo end if - if( cnst_get_type_byind(k) .eq. 'wet' ) then + if (cnst_get_type_byind(k) .eq. 'wet' .or. do_molec_diff) then if( vdiff_select( fieldlist_wet, 'q', k ) .ne. '' ) call endrun( vdiff_select( fieldlist_wet, 'q', k ) ) else if( vdiff_select( fieldlist_dry, 'q', k ) .ne. '' ) call endrun( vdiff_select( fieldlist_dry, 'q', k ) ) @@ -653,6 +653,8 @@ subroutine vertical_diffusion_tend( & !---------------------------------------------------- ! use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_set_field use physics_types, only : physics_state, physics_ptend, physics_ptend_init + use physics_types, only : set_dry_to_wet, set_wet_to_dry + use camsrfexch, only : cam_in_t use cam_history, only : outfld @@ -677,7 +679,7 @@ subroutine vertical_diffusion_tend( & ! Input Arguments ! ! --------------- ! - type(physics_state), intent(in) :: state ! Physics state variables + type(physics_state), intent(inout) :: state ! Physics state variables type(cam_in_t), intent(in) :: cam_in ! Surface inputs real(r8), intent(in) :: ztodt ! 2 delta-t [ s ] @@ -845,6 +847,11 @@ subroutine vertical_diffusion_tend( & ! Main Computation Begins ! ! ----------------------- ! + ! molecular diffusion requires 'wet' mixing ratios + if (do_molec_diff) then + call set_dry_to_wet(state) + end if + rztodt = 1._r8 / ztodt lchnk = state%lchnk ncol = state%ncol @@ -1341,6 +1348,11 @@ subroutine vertical_diffusion_tend( & end if + ! convert wet mmr back to dry before conservation check + if (do_molec_diff) then + call set_wet_to_dry(state) + end if + ! -------------------------------------------------------------- ! ! mass conservation check......... ! -------------------------------------------------------------- ! From 89f2745c48d9fa8d83a68ed58f33c71445841dda Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Tue, 15 Jan 2019 18:22:06 -0700 Subject: [PATCH 009/239] 'fix cam tag name Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90485 Committed by Brian Eaton at 2019-01-15 18:22:06 -0700 Original svn commit message: fix cam tag name' --- doc/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 173cfe307b..b1d321f5e3 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,6 @@ =============================================================== -Tag name: release_tags/cam_cesm2_1_rel_06 +Tag name: release_tags/cam_cesm2_1_rel_07 Originator(s): pel, eaton Date: Tue Jan 15 17:59:55 MST 2019 One-line Summary: change WACCM configs to use dry constituents From df1eb58752ef2005603ad307d427807032a280f8 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Thu, 17 Jan 2019 15:54:47 -0700 Subject: [PATCH 010/239] 'treat tracer mmr as wet in clubb and vertical diffusion code Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90496 Committed by Brian Eaton at 2019-01-17 15:54:47 -0700 Original svn commit message: treat tracer mmr as wet in clubb and vertical diffusion code' --- doc/ChangeLog | 52 ++++++++++++++++++++++++++ src/physics/cam/clubb_intr.F90 | 26 ++++++++++--- src/physics/cam/vertical_diffusion.F90 | 34 ++++++++--------- 3 files changed, 89 insertions(+), 23 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index b1d321f5e3..30519224ec 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,57 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_08 +Originator(s): pel, eaton +Date: Thu Jan 17 15:30:40 MST 2019 +One-line Summary: treat all tracers as wet in vertical diffusion and clubb + +Purpose of changes: + +. Doing mass conservation checks on the previous tag revealed problems in + standard CAM configs with mass conservation in CLUBB and vertical + diffusion. The problems are mitigated by always using wet mmr in those + parameterizations. This is done for all model configurations, not just + for WACCM as in the previous tag. + +Bugs fixed (include bugzilla ID): + +. The constituent surface fluxes for the modal aerosol species were being + added to the bottom layer assuming wet mmr. But those species are all + declared dry. Treating all species as wet in vertical_diffusion_tend + fixes this bug. + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +components/cam/src/physics/cam/clubb_intr.F90 +. clubb_tend_cam uses a copy of state. Convert all dry constituent mixing + ratios in that copy to a wet basis. +. After all contributions to ptend are made, convert the constituent + tendencies for dry constituents back to a dry basis. + +components/cam/src/physics/cam/vertical_diffusion.F90 +. In vertical_diffusion_tend treat all constituents on a wet basis. Apply + the dry to wet conversion to the state object. After constituent + diffusion tendencies are computed, convert any that apply to dry + constituents to a dry basis. Convert dry constituent mmr in state object + back to dry basis before leaving the subroutine. + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_07 Originator(s): pel, eaton Date: Tue Jan 15 17:59:55 MST 2019 diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index 2531857278..589e73e873 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -1027,18 +1027,18 @@ subroutine clubb_tend_cam( & use physics_types, only: physics_state, physics_ptend, & physics_state_copy, physics_ptend_init, & - physics_ptend_sum, physics_update + physics_ptend_sum, physics_update, set_dry_to_wet use physics_buffer, only: pbuf_get_index, pbuf_old_tim_idx, pbuf_get_field, & physics_buffer_desc - use constituents, only: cnst_get_ind + use constituents, only: cnst_get_ind, cnst_type use camsrfexch, only: cam_in_t use time_manager, only: is_first_step use cam_abortutils, only: endrun use cam_logfile, only: iulog use tropopause, only: tropopause_findChemTrop - + #ifdef CLUBB_SGS use hb_diff, only: pblintd use scamMOD, only: single_column,scm_clubb_iop_name @@ -1368,13 +1368,15 @@ subroutine clubb_tend_cam( & call cnst_get_ind('NUMLIQ',ixnumliq) call cnst_get_ind('NUMICE',ixnumice) - ! Copy the state to state1 array to use in this routine - ! Initialize physics tendency arrays, copy the state to state1 array to use in this routine call physics_ptend_init(ptend_loc,state%psetcols, 'clubb', ls=.true., lu=.true., lv=.true., lq=lq) call physics_ptend_init(ptend_all, state%psetcols, 'clubb') - call physics_state_copy(state,state1) + ! Copy the state to state1 array to use in this routine + call physics_state_copy(state, state1) + + ! constituents are all treated as wet mmr by clubb + call set_dry_to_wet(state1) if (clubb_do_liqsupersat) then npccn_idx = pbuf_get_index('NPCCN') @@ -2389,6 +2391,18 @@ subroutine clubb_tend_cam( & call physics_ptend_sum(ptend_loc,ptend_all,ncol) call physics_update(state1,ptend_loc,hdtime) + ! ptend_all now has all accumulated tendencies. Convert the tendencies for the + ! dry constituents to dry air basis. + do ixind = 1, pcnst + if (lq(ixind) .and. cnst_type(ixind).eq.'dry') then + do k = 1, pver + do i = 1, ncol + ptend_all%q(i,k,ixind) = ptend_all%q(i,k,ixind)*state1%pdel(i,k)/state1%pdeldry(i,k) + end do + end do + end if + end do + ! ------------------------------------------------- ! ! Diagnose relative cloud water variance ! ! ------------------------------------------------- ! diff --git a/src/physics/cam/vertical_diffusion.F90 b/src/physics/cam/vertical_diffusion.F90 index 20a5a5f66a..7fbcf1e79c 100644 --- a/src/physics/cam/vertical_diffusion.F90 +++ b/src/physics/cam/vertical_diffusion.F90 @@ -444,11 +444,8 @@ subroutine vertical_diffusion_init(pbuf2d) enddo end if - if (cnst_get_type_byind(k) .eq. 'wet' .or. do_molec_diff) then - if( vdiff_select( fieldlist_wet, 'q', k ) .ne. '' ) call endrun( vdiff_select( fieldlist_wet, 'q', k ) ) - else - if( vdiff_select( fieldlist_dry, 'q', k ) .ne. '' ) call endrun( vdiff_select( fieldlist_dry, 'q', k ) ) - endif + ! Convert all constituents to wet before doing diffusion. + if( vdiff_select( fieldlist_wet, 'q', k ) .ne. '' ) call endrun( vdiff_select( fieldlist_wet, 'q', k ) ) ! ----------------------------------------------- ! ! Select constituents for molecular diffusion ! @@ -664,7 +661,7 @@ subroutine vertical_diffusion_tend( & use hb_diff, only : compute_hb_diff use wv_saturation, only : qsat use molec_diff, only : compute_molec_diff, vd_lu_qdecomp - use constituents, only : qmincg, qmin + use constituents, only : qmincg, qmin, cnst_type use diffusion_solver, only : compute_vdiff, any, operator(.not.) use physconst, only : cpairv, rairv !Needed for calculation of upward H flux use time_manager, only : get_nstep @@ -847,10 +844,8 @@ subroutine vertical_diffusion_tend( & ! Main Computation Begins ! ! ----------------------- ! - ! molecular diffusion requires 'wet' mixing ratios - if (do_molec_diff) then - call set_dry_to_wet(state) - end if + ! Assume 'wet' mixing ratios in diffusion code. + call set_dry_to_wet(state) rztodt = 1._r8 / ztodt lchnk = state%lchnk @@ -1175,7 +1170,7 @@ subroutine vertical_diffusion_tend( & if (prog_modal_aero) then ! Modal aerosol species not diffused, so just add the explicit surface fluxes to the - ! lowest layer + ! lowest layer. **NOTE** This code assumes wet mmr. tmp1(:ncol) = ztodt * gravit * state%rpdel(:ncol,pver) do m = 1, pmam_ncnst @@ -1269,7 +1264,6 @@ subroutine vertical_diffusion_tend( & ! Convert the new profiles into vertical diffusion tendencies. ! ! Convert KE dissipative heat change into "temperature" tendency. ! ! --------------------------------------------------------------- ! - ! All variables are modified by vertical diffusion lq(:) = .TRUE. @@ -1280,6 +1274,16 @@ subroutine vertical_diffusion_tend( & ptend%u(:ncol,:) = ( u_tmp(:ncol,:) - state%u(:ncol,:) ) * rztodt ptend%v(:ncol,:) = ( v_tmp(:ncol,:) - state%v(:ncol,:) ) * rztodt ptend%q(:ncol,:pver,:) = ( q_tmp(:ncol,:pver,:) - state%q(:ncol,:pver,:) ) * rztodt + + ! Convert tendencies of dry constituents to dry basis. + do m = 1,pcnst + if (cnst_type(m).eq.'dry') then + ptend%q(:ncol,:pver,m) = ptend%q(:ncol,:pver,m)*state%pdel(:ncol,:pver)/state%pdeldry(:ncol,:pver) + endif + end do + ! convert wet mmr back to dry before conservation check + call set_wet_to_dry(state) + if (.not. do_pbl_diags) then slten(:ncol,:) = ( sl(:ncol,:) - sl_prePBL(:ncol,:) ) * rztodt qtten(:ncol,:) = ( qt(:ncol,:) - qt_prePBL(:ncol,:) ) * rztodt @@ -1348,10 +1352,6 @@ subroutine vertical_diffusion_tend( & end if - ! convert wet mmr back to dry before conservation check - if (do_molec_diff) then - call set_wet_to_dry(state) - end if ! -------------------------------------------------------------- ! ! mass conservation check......... @@ -1384,7 +1384,7 @@ subroutine vertical_diffusion_tend( & 'MASSCHECK vert diff : nstep,lon,lat,mass1,mass2,sum3,sflx,rel-diff : ', & trim(cnst_name(m)), ' : ', nstep, state%lon(i)*180._r8/pi, state%lat(i)*180._r8/pi, & sum1, sum2, sum3, sflx, abs(sum2-sum1)/sum1 - call endrun('vertical_diffusion_tend : mass not conserved' ) +!xxx call endrun('vertical_diffusion_tend : mass not conserved' ) endif endif enddo col_loop From bfadff12c7271e54198fde679fdac6b8ec18f8a6 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Fri, 18 Jan 2019 12:10:08 -0700 Subject: [PATCH 011/239] 'treat tracer mmr as wet in gravity wave drag code Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90501 Committed by Brian Eaton at 2019-01-18 12:10:08 -0700 Original svn commit message: treat tracer mmr as wet in gravity wave drag code' --- doc/ChangeLog | 39 +++++++++++++++++++++++++++++++++++++ src/physics/cam/gw_drag.F90 | 30 +++++++++++++++++++++++++--- 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 30519224ec..426b970755 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,44 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_09 +Originator(s): pel, eaton +Date: Fri Jan 18 12:02:18 MST 2019 +One-line Summary: treat all tracers as wet in gravity wave drag code + +Purpose of changes: + +. Doing mass conservation checks on the previous tag revealed problems in + standard CAM configs with mass conservation in the gravity wave drag + code. The problems are corrected by always using wet mmr in that + parameterization. This is done for all model configurations. + +Bugs fixed (include bugzilla ID): none + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +components/cam/src/physics/cam/gw_drag.F90 +. gw_tend + - copy input state and convert dry constituents to wet mmr + - convert constituent tendencies for dry constituents back to dry basis + in ptend object. + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_08 Originator(s): pel, eaton Date: Thu Jan 17 15:30:40 MST 2019 diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 796a0fb3d2..0199a20e51 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -1168,10 +1168,13 @@ end subroutine handle_pio_error !========================================================================== -subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) +subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) !----------------------------------------------------------------------- ! Interface for multiple gravity wave drag parameterization. !----------------------------------------------------------------------- + + use physics_types, only: physics_state_copy, set_dry_to_wet + use constituents, only: cnst_type use physics_buffer, only: physics_buffer_desc, pbuf_get_field use camsrfexch, only: cam_in_t ! Location-dependent cpair @@ -1183,8 +1186,9 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) use gw_oro, only: gw_oro_src use gw_front, only: gw_cm_src use gw_convect, only: gw_beres_src + !------------------------------Arguments-------------------------------- - type(physics_state), intent(in) :: state ! physics state structure + type(physics_state), intent(in) :: state_in ! physics state structure type(physics_buffer_desc), pointer :: pbuf(:) ! Physics buffer real(r8), intent(in) :: dt ! time step ! Parameterization net tendencies. @@ -1193,6 +1197,9 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) real(r8), intent(out) :: flx_heat(pcols) !---------------------------Local storage------------------------------- + + type(physics_state) :: state ! Local copy of state variable + integer :: lchnk ! chunk identifier integer :: ncol ! number of atmospheric columns @@ -1325,9 +1332,14 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) real(r8) :: piln(state%ncol,pver+1) real(r8) :: zm(state%ncol,pver) real(r8) :: zi(state%ncol,pver+1) - !------------------------------------------------------------------------ + ! Make local copy of state_in. + call physics_state_copy(state_in, state) + + ! constituents are all treated as wet mmr + call set_dry_to_wet(state) + lchnk = state%lchnk ncol = state%ncol @@ -1885,6 +1897,18 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) endif + ! ptend now has all accumulated tendencies. Convert the tendencies for the + ! dry constituents to dry air basis. + do m = 1, pcnst + if (cnst_type(m).eq.'dry') then + do k = 1, pver + do i = 1, ncol + ptend%q(i,k,m) = ptend%q(i,k,m)*state%pdel(i,k)/state%pdeldry(i,k) + end do + end do + end if + end do + ! Write totals to history file. call outfld('EKGW', egwdffi_tot , ncol, lchnk) call outfld('TTGW', ptend%s/cpairv(:,:,lchnk), pcols, lchnk) From b660da29782252e70d89ca7e63c3c78af6a100a5 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Fri, 18 Jan 2019 13:12:58 -0700 Subject: [PATCH 012/239] 'fix gw_tend Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90505 Committed by Brian Eaton at 2019-01-18 13:12:58 -0700 Original svn commit message: fix gw_tend' --- doc/ChangeLog | 8 ++++++ src/physics/cam/gw_drag.F90 | 54 ++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 426b970755..832d032bfc 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,13 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_10 +Originator(s): eaton +Date: Fri Jan 18 13:11:46 MST 2019 +One-line Summary: fix the fix in gw_tend + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_09 Originator(s): pel, eaton Date: Fri Jan 18 12:02:18 MST 2019 diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 0199a20e51..7e12a0579d 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -1168,7 +1168,7 @@ end subroutine handle_pio_error !========================================================================== -subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) +subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) !----------------------------------------------------------------------- ! Interface for multiple gravity wave drag parameterization. !----------------------------------------------------------------------- @@ -1188,7 +1188,7 @@ subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) use gw_convect, only: gw_beres_src !------------------------------Arguments-------------------------------- - type(physics_state), intent(in) :: state_in ! physics state structure + type(physics_state), intent(in) :: state ! physics state structure type(physics_buffer_desc), pointer :: pbuf(:) ! Physics buffer real(r8), intent(in) :: dt ! time step ! Parameterization net tendencies. @@ -1198,7 +1198,7 @@ subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) !---------------------------Local storage------------------------------- - type(physics_state) :: state ! Local copy of state variable + type(physics_state) :: state1 ! Local copy of state variable integer :: lchnk ! chunk identifier integer :: ncol ! number of atmospheric columns @@ -1334,28 +1334,28 @@ subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) real(r8) :: zi(state%ncol,pver+1) !------------------------------------------------------------------------ - ! Make local copy of state_in. - call physics_state_copy(state_in, state) + ! Make local copy of input state. + call physics_state_copy(state, state1) ! constituents are all treated as wet mmr - call set_dry_to_wet(state) + call set_dry_to_wet(state1) - lchnk = state%lchnk - ncol = state%ncol + lchnk = state1%lchnk + ncol = state1%ncol - p = Coords1D(state%pint(:ncol,:)) + p = Coords1D(state1%pint(:ncol,:)) - dse = state%s(:ncol,:) - t = state%t(:ncol,:) - u = state%u(:ncol,:) - v = state%v(:ncol,:) - q = state%q(:ncol,:,:) - piln = state%lnpint(:ncol,:) - zm = state%zm(:ncol,:) - zi = state%zi(:ncol,:) + dse = state1%s(:ncol,:) + t = state1%t(:ncol,:) + u = state1%u(:ncol,:) + v = state1%v(:ncol,:) + q = state1%q(:ncol,:,:) + piln = state1%lnpint(:ncol,:) + zm = state1%zm(:ncol,:) + zi = state1%zi(:ncol,:) lq = .true. - call physics_ptend_init(ptend, state%psetcols, "Gravity wave drag", & + call physics_ptend_init(ptend, state1%psetcols, "Gravity wave drag", & ls=.true., lu=.true., lv=.true., lq=lq) ! Profiles of background state variables @@ -1389,7 +1389,7 @@ subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) end if if (use_gw_front_igw) then - u_coriolis = coriolis_speed(band_long, state%lat(:ncol)) + u_coriolis = coriolis_speed(band_long, state1%lat(:ncol)) end if ! Totals that accumulate over different sources. @@ -1411,7 +1411,7 @@ subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) ! Efficiency of gravity wave momentum transfer. ! This is really only to remove the pole points. - where (pi/2._r8 - abs(state%lat(:ncol)) >= 4*epsilon(1._r8)) + where (pi/2._r8 - abs(state1%lat(:ncol)) >= 4*epsilon(1._r8)) effgw = effgw_beres_dp elsewhere effgw = 0._r8 @@ -1496,7 +1496,7 @@ subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) ! Efficiency of gravity wave momentum transfer. ! This is really only to remove the pole points. - where (pi/2._r8 - abs(state%lat(:ncol)) >= 4*epsilon(1._r8)) + where (pi/2._r8 - abs(state1%lat(:ncol)) >= 4*epsilon(1._r8)) effgw = effgw_beres_sh elsewhere effgw = 0._r8 @@ -1586,7 +1586,7 @@ subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) effgw = effgw_cm ! Frontogenesis is too high at the poles (at least for the FV ! dycore), so introduce a polar taper. - if (gw_polar_taper) effgw = effgw * cos(state%lat(:ncol)) + if (gw_polar_taper) effgw = effgw * cos(state1%lat(:ncol)) ! Determine the wave source for C&M background spectrum call gw_cm_src(ncol, band_mid, cm_desc, u, v, frontgf(:ncol,:), & @@ -1663,10 +1663,10 @@ subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) ! Frontogenesis is too high at the poles (at least for the FV ! dycore), so introduce a polar taper. if (gw_polar_taper) then - where (abs(state%lat(:ncol)) <= 89._r8*degree2radian) + where (abs(state1%lat(:ncol)) <= 89._r8*degree2radian) effgw = effgw * 0.25_r8 * & - (1._r8+tanh((state%lat(:ncol)+al0)/dlat0)) * & - (1._r8-tanh((state%lat(:ncol)-al0)/dlat0)) + (1._r8+tanh((state1%lat(:ncol)+al0)/dlat0)) * & + (1._r8-tanh((state1%lat(:ncol)-al0)/dlat0)) elsewhere effgw = 0._r8 end where @@ -1769,7 +1769,7 @@ subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) src_level, tend_level, tau, ubm, ubi, xv, yv, c) endif do i = 1, ncol - if (state%lat(i) < 0._r8) then + if (state1%lat(i) < 0._r8) then tau(i,:,:) = tau(i,:,:) * gw_oro_south_fac end if end do @@ -1903,7 +1903,7 @@ subroutine gw_tend(state_in, pbuf, dt, ptend, cam_in, flx_heat) if (cnst_type(m).eq.'dry') then do k = 1, pver do i = 1, ncol - ptend%q(i,k,m) = ptend%q(i,k,m)*state%pdel(i,k)/state%pdeldry(i,k) + ptend%q(i,k,m) = ptend%q(i,k,m)*state1%pdel(i,k)/state1%pdeldry(i,k) end do end do end if From c1929c3c47979ebfbff696e17fefa8bc1fff4245 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 7 Feb 2019 16:46:06 -0700 Subject: [PATCH 013/239] 'M components/cam/bld/namelist_files/use_cases/sd_waccm_ma_cam4.xml Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90578 Committed by Francis Vitt at 2019-02-07 16:46:06 -0700 Original svn commit message: M components/cam/bld/namelist_files/use_cases/sd_waccm_ma_cam4.xml A + components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml M components/cam/bld/namelist_files/use_cases/sd_waccm_ma_cam6.xml A + components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml M components/cam/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml A + components/cam/bld/namelist_files/use_cases/sd_waccm_mad_cam6.xml M components/cam/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml M components/cam/bld/namelist_files/use_cases/sd_cam6.xml M components/cam/bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml M components/cam/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml M components/cam/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml M components/cam/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml M components/cam/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml M components/cam/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml A + components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml M components/cam/bld/namelist_files/use_cases/waccm_sc_hist_cam6.xml M components/cam/cime_config/config_compsets.xml M components/cam/cime_config/config_component.xml M components/cam/doc/ChangeLog M components/cam/src/physics/cam/physics_types.F90 M components/cam/src/chemistry/utils/apex.F90 M components/cam/src/chemistry/modal_aero/aero_model.F90 ' --- bld/namelist_files/use_cases/sd_cam6.xml | 4 +- .../use_cases/sd_trop_strat_vbs_cam6.xml | 4 +- .../use_cases/sd_waccm_ma_cam4.xml | 2 +- .../use_cases/sd_waccm_ma_cam6.xml | 13 +- .../use_cases/sd_waccm_mad_cam6.xml | 110 +++++++ .../use_cases/sd_waccm_tsmlt_cam6.xml | 12 +- .../use_cases/waccm_ma_1850_cam6.xml | 2 +- .../use_cases/waccm_ma_2000_cam6.xml | 2 +- .../use_cases/waccm_ma_hist_cam6.xml | 2 +- .../use_cases/waccm_sc_1850_cam6.xml | 2 +- .../use_cases/waccm_sc_hist_cam6.xml | 2 +- .../use_cases/waccm_tsmlt_1850_cam6.xml | 2 +- .../use_cases/waccm_tsmlt_hist_cam6.xml | 2 +- .../use_cases/waccm_tsmlt_ssp126_cam6.xml | 292 ++++++++++++++++++ .../use_cases/waccm_tsmlt_ssp534_cam6.xml | 292 ++++++++++++++++++ .../use_cases/waccm_tsmlt_ssp585_cam6.xml | 292 ++++++++++++++++++ cime_config/config_component.xml | 5 +- cime_config/config_compsets.xml | 65 +++- doc/ChangeLog | 86 ++++++ src/chemistry/modal_aero/aero_model.F90 | 18 +- src/chemistry/utils/apex.F90 | 13 +- src/physics/cam/physics_types.F90 | 4 +- 22 files changed, 1191 insertions(+), 35 deletions(-) create mode 100644 bld/namelist_files/use_cases/sd_waccm_mad_cam6.xml create mode 100644 bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml create mode 100644 bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml create mode 100644 bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml diff --git a/bld/namelist_files/use_cases/sd_cam6.xml b/bld/namelist_files/use_cases/sd_cam6.xml index f3a7cba4a2..34665ad5d8 100644 --- a/bld/namelist_files/use_cases/sd_cam6.xml +++ b/bld/namelist_files/use_cases/sd_cam6.xml @@ -8,9 +8,9 @@ .true. '2005/MERRA2_0.9x1.25_20050101.nc' atm/cam/met/MERRA2/0.9x1.25 - atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c180430.txt + atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c190125.txt - 'atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc' + 'atm/cam/solar/SolarForcingNRLSSI2_daily_s18820101_e20171231_c180702.nc' 'atm/cam/tracer_cnst' 'tracer_cnst_halons_3D_L70_1849-2015_CMIP6ensAvg_c180927.nc' diff --git a/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml b/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml index 9dd7c31692..dd4d3d215b 100644 --- a/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml +++ b/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml @@ -15,14 +15,14 @@ 2005/MERRA2_0.9x1.25_20050101.nc atm/cam/met/MERRA2/0.9x1.25 -atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c180430.txt +atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c190125.txt 2010/MERRA2_0.5x0.63_20100101.nc atm/cam/met/MERRA2/0.5x0.63 atm/cam/met/MERRA2/0.5x0.63/filenames_list_c180612 -atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +atm/cam/solar/SolarForcingNRLSSI2_daily_s18820101_e20171231_c180702.nc SERIAL diff --git a/bld/namelist_files/use_cases/sd_waccm_ma_cam4.xml b/bld/namelist_files/use_cases/sd_waccm_ma_cam4.xml index e9747838ff..9f93bd3495 100644 --- a/bld/namelist_files/use_cases/sd_waccm_ma_cam4.xml +++ b/bld/namelist_files/use_cases/sd_waccm_ma_cam4.xml @@ -13,7 +13,7 @@ .true. 2005/MERRA2_0.9x1.25_20050101.nc atm/cam/met/MERRA2/0.9x1.25 -atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c180430.txt +atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c190125.txt 2005/MERRA2_1.9x2.5_20050101.nc atm/cam/met/MERRA2/1.9x2.5 atm/cam/met/MERRA2/1.9x2.5/filenames_list_c180824 diff --git a/bld/namelist_files/use_cases/sd_waccm_ma_cam6.xml b/bld/namelist_files/use_cases/sd_waccm_ma_cam6.xml index 95aee0ff3f..485ddad44d 100644 --- a/bld/namelist_files/use_cases/sd_waccm_ma_cam6.xml +++ b/bld/namelist_files/use_cases/sd_waccm_ma_cam6.xml @@ -5,13 +5,13 @@ 20050101 -atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +atm/cam/solar/SolarForcingNRLSSI2_daily_s18820101_e20171231_c180702.nc -atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +atm/cam/solar/SolarParmsEPP_CMIP6_daily_s18491230_e20150101_c190109.nc -atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +atm/cam/solar/SolarParmsEPP_CMIP6_daily_s18491230_e20150101_c190109.nc 'epp_ion_rates' @@ -21,15 +21,16 @@ 60. 50. .true. -2005/MERRA2_0.9x1.25_20050101.nc +1980/MERRA2_0.9x1.25_19800101.nc atm/cam/met/MERRA2/0.9x1.25 -atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c180430.txt +atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c190125.txt +0.84 atm/cam/met/MERRA2/0.9x1.25/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_sgh30_24km_GRNL_MERRA2_c171218.nc SERIAL -atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180227.nc +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'CFC11eq' diff --git a/bld/namelist_files/use_cases/sd_waccm_mad_cam6.xml b/bld/namelist_files/use_cases/sd_waccm_mad_cam6.xml new file mode 100644 index 0000000000..c3e1dee2b3 --- /dev/null +++ b/bld/namelist_files/use_cases/sd_waccm_mad_cam6.xml @@ -0,0 +1,110 @@ + + + + +20050101 + + +atm/cam/solar/SolarForcingNRLSSI2_daily_s18820101_e20171231_c180702.nc + + +atm/cam/solar/SolarParmsEPP_CMIP6_daily_s18491230_e20150101_c190109.nc + + +atm/cam/solar/SolarParmsEPP_CMIP6_daily_s18491230_e20150101_c190109.nc +'epp_ion_rates' + + +atm/cam/inic/fv/f.e21.FWSD.f09_f09_mg17.spinup02.cam.i.2005-01-01-00000_c180801.nc + +50. +60. +50. +.true. +2005/MERRA2_0.9x1.25_20050101.nc +atm/cam/met/MERRA2/0.9x1.25 +atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c190125.txt +0.84 + +atm/cam/met/MERRA2/0.9x1.25/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_sgh30_24km_GRNL_MERRA2_c171218.nc + + +SERIAL +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc + + 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', + 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'CFC11eq' + + + +atm/waccm/ub/tgcm_ubc_1850-2100_c100204.nc +'INTERP_MISSING_MONTHS' + + +.true. +.false. +.true. +atm/waccm/qbo/qbocyclic28months.nc + + + + +INTERP_MISSING_MONTHS + + +INTERP_MISSING_MONTHS + + + + 1, 30, 120, 240, 240, 480, 365, 73, 30 + 0, -24, -6, -3, -1, 1, -24,-120,-240 + 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'I' + + + 'AOA1', 'AOA2', 'CLDHGH', 'CLDLOW', 'CLDMED', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', + 'DTCOND', 'DTV', 'DUV', 'DVV', 'EKGW', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC', + 'FSDS', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'HORZ', 'LANDFRAC', 'LHFLX', 'OCNFRAC', + 'OH', 'OMEGA', 'PHIS', 'PRECC', 'PRECL', 'PS', 'QFLX', 'QRL', 'QRLNLTE', + 'QRS', 'RELHUM', 'SHFLX', 'SOLIN', 'SWCF', 'QCP', 'QTHERMAL', 'QRL_TOT', 'QRS_TOT', + 'QJOULE', 'PSL', 'HNO3_STS', 'HNO3_NAT', 'HNO3_GAS', 'NO_Lightning', 'QNO', 'QRS_AUR', + 'QRS_CO2NIR', 'QRS_EUV', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'TREFHT', 'TTGW', + 'UTGWORO', 'UTGWSPEC', 'VERT', 'VTGWORO', 'VTGWSPEC', 'Z3', 'HOX', 'NOX', 'NOY', 'CLOX', + 'CLOY', 'BROX', 'BROY', 'TCLY', 'TOTH', 'QJOULE', 'UI', 'VI', 'UIONTEND', 'VIONTEND', + 'DTCORE', 'T_24_COS', 'T_24_SIN', 'T_12_COS', 'T_12_SIN', 'OMEGA_24_COS', 'OMEGA_24_SIN', + 'OMEGA_12_COS', 'OMEGA_12_SIN', 'U_24_COS', 'U_24_SIN', 'U_12_COS', 'U_12_SIN', + 'V_24_COS', 'V_24_SIN', 'V_12_COS', 'V_12_SIN', 'PS_24_COS', 'PS_24_SIN', 'PS_12_COS', + 'PS_12_SIN', 'CLDLIQ', 'CLDICE', 'CONCLD', 'FRONTGF:I', 'BUTGWSPEC', 'BTAUE', 'BTAUW', + 'BTAUN', 'BTAUS', 'TAUE', 'TAUW', 'TAUN', 'TAUS', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', + 'SNOWHLND', 'SNOWHICE', 'ICEFRAC', 'FSDSC', 'SFNO', 'SFCO', 'SFCH2O', 'CFC11STAR', + 'TROPP_FD', 'NITROP_PD', 'TROP_P', 'TROP_T', 'TROP_Z', 'SAD_AERO', 'REFF_AERO', + 'AODVISstdn', 'EXTINCTdn', 'EXTxASYMdn', 'AODUVstdn', 'AODNIRstdn', 'AODVISdn', 'MASS', + 'TMOCS', 'TMSO2', 'TMDMS', 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'BURDENDUSTdn', + 'BURDENPOMdn', 'bc_a1', 'bc_a4', 'dst_a1', 'dst_a2', 'dst_a3', 'ncl_a1', 'ncl_a1', + 'ncl_a2', 'ncl_a3', 'pom_a1', 'pom_a4', 'so4_a1', 'so4_a2', 'so4_a3', 'soa_a1', + 'soa_a2', 'bc_c1', 'bc_c4', 'dst_c1', 'dst_c2', 'dst_c3', 'ncl_c1', 'ncl_c1', + 'ncl_c2', 'ncl_c3', 'pom_c1', 'pom_c4', 'so4_c1', 'so4_c2', 'so4_c3', 'soa_c1', 'soa_c2', + 'num_a1','num_a2','num_a3','num_a4','num_c1','num_c2','num_c3','num_c4', + 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'LNO_PROD', 'LNO_COL_PROD', 'dry_deposition_NHx_as_N', 'dry_deposition_NOy_as_N', + 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N' + + + 'MSKtem','PS','PSL','VTHzm','UVzm','UWzm','Uzm','Vzm','THzm','Wzm','PHIS' + + + 'PS', 'PSL', 'U', 'V', 'T', 'Z3', 'PHIS', 'FRONTGF:I', 'OMEGA', 'O3', + 'REFF_AERO', 'SAD_AERO', 'so4_a1', 'so4_a2', 'so4_a3', 'AODVISstdn', 'NITROP_PD', + 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'QRS_TOT', 'CO2', 'H', 'NO', 'O' + + +.true. +.true. +.true. +.true. +.false. +.false. +.false. +.false. +.false. +.false. + + diff --git a/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml b/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml index 6d5a482d4e..0a5f993155 100644 --- a/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml +++ b/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml @@ -5,13 +5,13 @@ 20050101 -atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +atm/cam/solar/SolarForcingNRLSSI2_daily_s18820101_e20171231_c180702.nc -atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +atm/cam/solar/SolarParmsEPP_CMIP6_daily_s18491230_e20150101_c190109.nc -atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +atm/cam/solar/SolarParmsEPP_CMIP6_daily_s18491230_e20150101_c190109.nc 'epp_ion_rates' yearly @@ -23,15 +23,15 @@ 60. 50. .true. -2005/MERRA2_0.9x1.25_20050101.nc +1980/MERRA2_0.9x1.25_19800101.nc atm/cam/met/MERRA2/0.9x1.25 -atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c180430.txt +atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c190125.txt atm/cam/met/MERRA2/0.9x1.25/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_sgh30_24km_GRNL_MERRA2_c171218.nc SERIAL -atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180227.nc +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'SF6', 'CFC11eq' diff --git a/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml b/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml index 42ed5df073..bb5a471e8c 100644 --- a/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml @@ -27,7 +27,7 @@ CYCLICAL 1850 -atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180227.nc +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'CFC11eq' diff --git a/bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml b/bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml index 35ca796c86..1cc69f065c 100644 --- a/bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml @@ -22,7 +22,7 @@ CYCLICAL 2000 -atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180227.nc +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'CFC11eq' diff --git a/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml b/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml index d81a15e2db..5e40e7d871 100644 --- a/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml @@ -22,7 +22,7 @@ SERIAL -atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180227.nc +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'CFC11eq' diff --git a/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml b/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml index 73d7ca59c0..bd75c5f664 100644 --- a/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml @@ -19,7 +19,7 @@ CYCLICAL 1850 -atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180227.nc +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc 'CO2','CH4','N2O','CFC11','CFC12','CFC11eq' diff --git a/bld/namelist_files/use_cases/waccm_sc_hist_cam6.xml b/bld/namelist_files/use_cases/waccm_sc_hist_cam6.xml index 82560b98ba..3af7fde0a5 100644 --- a/bld/namelist_files/use_cases/waccm_sc_hist_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_sc_hist_cam6.xml @@ -15,7 +15,7 @@ atm/waccm/ic/f.e15.FWmaAMIP.f19_f19.misc08_cam5_4_81.003.cam.i.1980-01-01-00000_c160928.nc -atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180227.nc +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc 'SERIAL' 'CO2','CH4','N2O','CFC11','CFC12','CFC11eq' diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml index 77e051275d..ba06534fd7 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml @@ -27,7 +27,7 @@ CYCLICAL 1850 -atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180227.nc +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'SF6', 'CFC11eq' diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml index edbdaf726e..9a3e627bc8 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml @@ -22,7 +22,7 @@ SERIAL -atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180227.nc +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'SF6', 'CFC11eq' diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml new file mode 100644 index 0000000000..0043c2baf8 --- /dev/null +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml @@ -0,0 +1,292 @@ + + + + +19900101 + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +'epp_ion_rates' + + +atm/waccm/ic/b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.001.cam.i.2015-01-01-00000.nc + + +SERIAL +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP126_0p5degLat_c180905.nc + + 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', + 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'SF6', 'CFC11eq' + + + +atm/waccm/ub/tgcm_ubc_1850-2100_c100204.nc +'INTERP_MISSING_MONTHS' + + +.true. +.true. +.true. +.false. + + + + +INTERP_MISSING_MONTHS + + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_ext_1deg_ZeroTrop_c181020.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' + + +INTERP_MISSING_MONTHS + + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BENZENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BENZENE_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGALK_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGALK_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGENE_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H2_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H2_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H5OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H5OH_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H6_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H6_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H8_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H8_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH2O_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH2O_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CHO_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CHO_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CN_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CN_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COCH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COCH3_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COCHO_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COOH_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3OH_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CO_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CO_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_CO_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_1750-2100_0.9x1.25_c20170322.nc', + 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_GLYALD_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCN_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCN_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCOOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCOOH_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_ISOP_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_IVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_IVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_MEK_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_MEK_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_MTERP_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NH3_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NO_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NO_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_NO_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_TOLUENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_TOLUENE_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_XYLENES_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_XYLENES_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_DMS_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ene_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc' + + +'noy', 'nhx' + + + + 1, 5, 20, 40, 120, 240, 365, 73, 365 + 0, -24, -6, -3, -1, 1, -24,-120,-240 +'A', 'A', 'A', 'A', 'I', 'A', 'A', 'A', 'I' + +.true. +.false. +.false. +.false. +.false. +.false. +.true. +.true. +.true. + + 'AOA1SRC', 'AOA2SRC', 'NO2_CMXF' + + + 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2', + 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', + 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn', 'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF', + 'bc_a1SFWET', 'bc_a4', 'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF', + 'bc_c4SFWET', 'BENZENE', 'BENZO2', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALD', 'BIGALK', 'BIGENE', + 'BR', 'BRCL', 'BRO', 'BRONO2', 'BROX', 'BROY', 'BRY', 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', + 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', + 'BURDENSOAdn', 'BUTGWSPEC', 'BZALD', 'BZOO', 'BZOOH', 'C2H2', 'C2H4', 'C2H5O2', 'C2H5OH', 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7O2', + 'C3H7OOH', 'C3H8', 'C6H5O2', 'C6H5OOH', 'CCL4', 'CDNUMC', 'CF2CLBR', 'CF3BR', 'CFC113', 'CFC114', 'CFC115', 'CFC11', 'CFC11STAR', + 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CCL3_CHML', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3CO3', 'CH3COCH3', 'CH3COCHO', + 'CH3COOH', 'CH3COOOH', 'CH3O2', 'CH3OH', 'CH3OOH', 'CH4', 'CH4_CHML', 'CHBR3', 'CL2', 'CL2O2', 'CL', + 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', 'CLOX', 'CLOY', 'CLY', 'CME', 'CMFDQ', 'CMFMC', + 'CMFMCDZM', 'CO2', 'CO2_CHML', 'CO', 'CO_CHML', 'CO_CHMP', 'COF2', 'COFCL', 'CONCLD', 'CRESOL', + 'DCOCHM', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O', + 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH', + 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', + 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', + 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2', 'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', + 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', + 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH', 'DF_XYLENOOH', + 'DF_XYLOLOOH', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'DH2O2CHM', 'DHNO3CHM', 'DICARBO2', 'DMS', 'DO3CHM', 'dry_deposition_NHx_as_N', + 'dry_deposition_NOy_as_N', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'dst_a1', 'dst_a1DDF', 'dst_a1SFWET', 'dst_a2', 'dst_a2DDF', + 'dst_a2SFWET', 'dst_a3', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c1', 'dst_c1DDF', 'dst_c1SFWET', 'dst_c2', 'dst_c2DDF', 'dst_c2SFWET', + 'dst_c3', 'dst_c3DDF', 'dst_c3SFWET', 'DTCORE', 'E90', 'e', 'ENEO2', 'EO2', 'EO', 'EOOH', 'EVAPPREC', + 'EVAPQZM', 'EVAPTZM', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'F', 'FCTL', + 'FLASHFRQ', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FREQI', 'FREQL', 'FREQZM', 'FSDS', + 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'FSNTOAC', 'FSUTOA', 'GLYALD', 'GLYOXAL', + 'GS_SO2', 'H2402', 'H2', 'H2O2', 'H2O', 'H2SO4', 'H2SO4M_C', 'H2SO4_sfnnuc1', 'H', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', 'HCL', + 'HCL_GAS', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS', 'HO2', 'HO2NO2', 'HOBR', 'HOCH2OO', 'HOCL', 'HONITR', + 'HPALD', 'HYAC', 'HYDRALD', 'ICEFRAC', 'IEPOX', 'ISOP', 'ISOPAO2', 'ISOPBO2', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3', + 'ISOPNOOH', 'ISOPOOH', 'IVOC', 'IVOC_CHML', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan', 'KVH_CLUBB', + 'LANDFRAC', 'LHFLX', 'LNO_COL_PROD', 'LNO_PROD', 'MACR', 'MACRO2', 'MACROOH', 'MALO2', 'MASS', 'MCO3', 'MDIALO2', + 'MEG_BCARY', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_C2H4', 'MEG_C2H5OH', 'MEG_C2H6', 'MEG_C3H6', 'MEG_C3H8', 'MEG_CH2O', + 'MEG_CH3CHO', 'MEG_CH3COCH3', 'MEG_CH3COOH', 'MEG_CH3OH', 'MEG_CO', 'MEG_HCN', 'MEG_HCOOH', 'MEG_ISOP', 'MEG_MTERP', 'MEG_TOLUENE', + 'MEK', 'MEKO2', 'MEKOOH', 'MPAN', 'MTERP', 'MVK', 'N2D', 'N2O5', 'N2O', 'N2O_CHML', 'N2p', 'N', 'NC4CH2OH', + 'NC4CHO', 'ncl_a1', 'ncl_a1DDF', 'ncl_a1SFWET', 'ncl_a2', 'ncl_a2DDF', 'ncl_a2SFWET', 'ncl_a3', 'ncl_a3DDF', 'ncl_a3SFWET', 'ncl_c1', + 'ncl_c1DDF', 'ncl_c1SFWET', 'ncl_c2', 'ncl_c2DDF', 'ncl_c2SFWET', 'ncl_c3', 'ncl_c3DDF', 'ncl_c3SFWET', 'NDEP', 'NH3', 'NH4', 'NH_50', + 'NH_5', 'NHDEP', 'NITROP_PD', 'NO2', 'NO2_CLXF', 'NO3', 'NO', 'NOA', 'NOp', 'NOX', 'NOY', 'Np', 'NTERPO2', 'NTERPOOH', + 'num_a1', 'num_a1_CLXF', 'num_a1DDF', 'num_a2', 'num_a2_CLXF', 'num_a2DDF', 'num_a2_sfnnuc1', 'num_a3', 'num_a3DDF', 'num_a4', + 'num_a4DDF', 'num_c1', 'num_c1DDF', 'num_c2', 'num_c2DDF', 'num_c3', 'num_c3DDF', 'num_c4', 'num_c4DDF', 'NUMLIQ', 'O1D', 'O2_1D', + 'O2_1S', 'O2', 'O2p', 'O3', 'O3_CHML', 'O3_CHMP', 'O3_Loss', 'O3_Prod', 'O', 'OCLO', 'OCS', 'OddOx_CLOxBROx_Loss', + 'OddOx_HOx_Loss', 'OddOx_Loss_Tot', 'OddOx_NOx_Loss', 'OddOx_Ox_Loss', 'OddOx_Prod_Tot', 'OH', 'OMEGA', 'OMEGAT', 'ONITR', 'Op', + 'PAN', 'PBLH', 'PBZNIT', 'PDELDRY', 'PHENO2', 'PHENO', 'PHENOL', 'PHENOOH', 'PHIS', 'PM25', 'PO2', 'pom_a1', 'pom_a1DDF', 'pom_a1SFWET', + 'pom_a4', 'pom_a4DDF', 'pom_a4SFWET', 'pom_c1', 'pom_c1DDF', 'pom_c1SFWET', 'pom_c4', 'pom_c4DDF', 'pom_c4SFWET', + 'POOH', 'PRECC', 'PRECT', 'PS', 'PSL', 'PTEQ', 'PTTEND', 'Q', 'QFLX', 'QRAIN', 'QREFHT', 'QRL', 'QRLC', 'QRS', + 'QRSC', 'QSNOW', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RELHUM', 'r_GLYOXAL_aer', + 'r_het10', 'r_het11', 'r_het12', 'r_het13', 'r_het15', 'r_het16', 'r_het17', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', + 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_HO2_O3', 'RHREFHT', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', + 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1', 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', + 'r_OH_O3', 'r_OH_O', 'ROOH', 'RO2', 'RO2_NO_sum', 'RO2_NO3_sum', 'RO2_HO2_sum', 'RO2_RO2_sum', 'RCO2_NO2_sum', + 'S', 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SF6', 'SFbc_a4', 'SFBCARY', + 'SFBENZENE', 'SFBIGALK', 'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO', 'SFCH3CN', + 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH', + 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2', + 'SFnum_a3', 'SFpom_a4', 'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2', + 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1', 'so4_a1SFWET', + 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3', + 'so4_a3DDF', 'so4_a3_sfgaex1', 'so4_a3SFWET', 'so4_c1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_c1SFWET', 'so4_c2', 'so4_c2AQH2SO4', + 'so4_c2AQSO4', 'so4_c2DDF', 'so4_c2SFWET', 'so4_c3', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_c3SFWET', 'SO', 'soa1_a1', + 'soa1_a1_CHML', 'soa1_a1DDF', 'soa1_a1_sfgaex1', 'soa1_a1SFWET', 'soa1_a2', 'soa1_a2_CHML', 'soa1_a2DDF', + 'soa1_a2_sfgaex1', 'soa1_a2SFWET', 'soa1_c1', 'soa1_c1DDF', 'soa1_c1SFWET', 'soa1_c2', 'soa1_c2DDF', 'soa1_c2SFWET', 'soa2_a1', 'soa2_a1_CHML', + 'soa2_a1DDF', 'soa2_a1_sfgaex1', 'soa2_a1SFWET', 'soa2_a2', 'soa2_a2_CHML', 'soa2_a2DDF', 'soa2_a2_sfgaex1', + 'soa2_a2SFWET', 'soa2_c1', 'soa2_c1DDF', 'soa2_c1SFWET', 'soa2_c2', 'soa2_c2DDF', 'soa2_c2SFWET', 'soa3_a1', 'soa3_a1_CHML', + 'soa3_a1DDF', 'soa3_a1_sfgaex1', 'soa3_a1SFWET', 'soa3_a2', 'soa3_a2_CHML', 'soa3_a2DDF', 'soa3_a2_sfgaex1', 'soa3_a2SFWET', + 'soa3_c1', 'soa3_c1DDF', 'soa3_c1SFWET', 'soa3_c2', 'soa3_c2DDF', 'soa3_c2SFWET', 'soa4_a1', 'soa4_a1_CHML', 'soa4_a1DDF', + 'soa4_a1_sfgaex1', 'soa4_a1SFWET', 'soa4_a2', 'soa4_a2_CHML', 'soa4_a2DDF', 'soa4_a2_sfgaex1', 'soa4_a2SFWET', 'soa4_c1', + 'soa4_c1DDF', 'soa4_c1SFWET', 'soa4_c2', 'soa4_c2DDF', 'soa4_c2SFWET', 'soa5_a1', 'soa5_a1_CHML', 'soa5_a1DDF', 'soa5_a1_sfgaex1', + 'soa5_a1SFWET', 'soa5_a2', 'soa5_a2_CHML', 'soa5_a2DDF', 'soa5_a2_sfgaex1', 'soa5_a2SFWET', 'soa5_c1', 'soa5_c1DDF', + 'soa5_c1SFWET', 'soa5_c2', 'soa5_c2DDF', 'soa5_c2SFWET', 'SOAG0', 'SOAG0_CHMP', 'SOAG1', 'SOAG1_CHMP', 'SOAG2', 'SOAG2_CHMP', + 'SOAG3', 'SOAG3_CHMP', 'SOAG4', 'SOAG4_CHMP', 'SOLIN', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST', 'ST80_25', 'SVOC', 'SVOC_CHML', + 'T', 'TAQ', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TBRY', 'TCLY', 'TEPOMUC', 'TERP2O2', 'TERP2OOH', + 'TERPNIT', 'TERPO2', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TGCLDIWP', 'TGCLDLWP', 'THzm', 'TMDMS', 'TMOCS', 'TMQ', 'TMSO2', + 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'TOLO2', 'TOLOOH', 'TOLUENE', 'TOT_CLD_VISTAU', 'TOTH', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TROP_P', + 'TROP_T', 'TROP_Z', 'TS', 'TSMN:M', 'TSMX:X', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO', 'TTGWSPEC', + 'U10', 'U', 'UTGWORO', 'UTGWSPEC', 'UU', 'UVzm', 'UWzm', 'Uzm', 'V', 'VD01', 'VEL_NAT2', 'VTHzm', 'VV', 'Vzm', 'WD_ALKNIT', 'WD_ALKOOH', 'WD_BENZOOH', 'WD_BRONO2', + 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO', 'WD_CH3CN', 'WD_CH3COCH3', 'WD_CH3COCHO', + 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL', 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', + 'WD_HBR', 'WD_HCL', 'WD_HCN', 'WD_HCOOH', 'WD_HF', 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD', 'WD_HYAC', + 'WD_HYDRALD', 'WD_IEPOX', 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC', 'WD_MACR', 'WD_MACROOH', + 'WD_MEKOOH', 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP', 'WD_NOA', 'WD_NTERPOOH', + 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', + 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1', 'WD_TERPROD2', 'WD_TOLOOH', 'WD_XOOH', 'WD_XYLENOOH', 'WD_XYLOLOOH', + 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N', 'Wzm', 'XO2', 'XOOH', 'XYLENES', 'XYLENO2', 'XYLENOOH', 'XYLOL', 'XYLOLO2', + 'XYLOLOOH', 'Z3', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU' + + + + 'ACTNL', 'ACTREL', 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn', 'BUTGWSPEC', + 'CDNUMC', 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLOUD', 'CMFMC', 'CMFMCDZM', 'FCTL', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', + 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FSDS', 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNTOA', 'FSNTOAC', 'LHFLX', 'MASS', 'O3', 'OMEGA', + 'OMEGA500', 'PBLH', 'PDELDRY', 'PM25_SRF', 'PRECC', 'PRECT', 'PS', 'PSL', 'Q', 'QREFHT', 'QSNOW', 'RELHUM', 'RHREFHT', 'SHFLX', + 'SOLIN', 'SOLLD', 'SOLSD', 'T', 'T500', 'T700', 'T850', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', + 'TGCLDIWP', 'TGCLDLWP', 'TMQ', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TS', 'TSMN:M', 'TSMX:X', 'U', 'U10', 'UTGWORO', 'UTGWSPEC', + 'V', 'Z3', 'Z500' + + + 'O3_SRF','TS','PM25_SRF','NO2_SRF' + + + 'MSKtem','PS','PSL','VTHzm','UVzm','UWzm','Uzm','Vzm','THzm','Wzm','PHIS' + + + 'PS', 'PSL', 'U', 'V', 'T', 'Z3', 'PHIS', 'FRONTGF:I', 'OMEGA', 'O3', 'REFF_AERO', 'SAD_AERO', + 'so4_a1', 'so4_a2', 'so4_a3', 'AODVISstdn', 'NITROP_PD', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'QRS_TOT', 'CO2', 'H', 'NO', 'O' + + + + 'O3_Prod = NO_HO2 + CH3O2_NO + PO2_NO + CH3CO3_NO + C2H5O2_NO + .92*ISOPAO2_NO + .92*ISOPBO2_NO + MACRO2_NOa + MCO3_NO + C3H7O2_NO + RO2_NO + XO2_NO + .9*TOLO2_NO +', + '.9*PHENO2_NO + .9*C6H5O2_NO + .9*BENZO2_NO + .9*MALO2_NO + .9*BZOO_NO + .9*ACBZO2_NO + .9*DICARBO2_NO + .9*MDIALO2_NO + .9*XYLOLO2_NO + .9*XYLENO2_NO + TERPO2_NO +', + 'TERP2O2_NO + NTERPO2_NO + ALKO2_NO + ENEO2_NO + EO2_NO + MEKO2_NO + HOCH2OO_NO + jonitr', + 'O3_Loss = O1D_H2O + OH_O3 + HO2_O3 + H_O3 + C3H6_O3 + .9*ISOP_O3 + C2H4_O3 + .8*MVK_O3 + 0.8*MACR_O3 + MTERP_O3 + BCARY_O3', + 'RO2_NO_sum = NO_HO2 + CH3O2_NO + HOCH2OO_NO + EO2_NO + C2H5O2_NO + CH3CO3_NO + C3H7O2_NO + PO2_NO + RO2_NO + ENEO2_NO + ENEO2_NOb + MEKO2_NO + MACRO2_NOa + MACRO2_NOb +', + 'MCO3_NO + ISOPAO2_NO + ISOPBO2_NO + ALKO2_NO + ALKO2_NOb + XO2_NO + TOLO2_NO + PHENO2_NO + C6H5O2_NO + BENZO2_NO + MALO2_NO + BZOO_NO + ACBZO2_NO + DICARBO2_NO +', + 'MDIALO2_NO + XYLOLO2_NO + XYLENO2_NO + TERPO2_NO + TERP2O2_NO + NTERPO2_NO', + 'RO2_NO3_sum = NO3_HO2 + MACRO2_NO3 + MCO3_NO3 + ISOPAO2_NO3 + ISOPBO2_NO3 + XO2_NO3', + 'RO2_HO2_sum = CH3O2_HO2 + HOCH2OO_HO2 + EO2_HO2 + C2H5O2_HO2 + CH3CO3_HO2 + C3H7O2_HO2 + PO2_HO2 + RO2_HO2 + MEKO2_HO2 + MACRO2_HO2 + ISOPAO2_HO2 + ISOPBO2_HO2 + ALKO2_HO2 +', + 'XO2_HO2 + TOLO2_HO2 + PHENO2_HO2 + C6H5O2_HO2 + BENZO2_HO2 + MALO2_HO2 + BZOO_HO2 + ACBZO2_HO2 + DICARBO2_HO2 + MDIALO2_HO2 + XYLOLO2_HO2 + XYLENO2_HO2 + TERPO2_HO2 +', + 'TERP2O2_HO2 + NTERPO2_HO2', + 'RO2_RO2_sum = CH3O2_CH3O2a + CH3O2_CH3O2b + C2H5O2_CH3O2 + C2H5O2_C2H5O2 + CH3CO3_CH3O2 + CH3CO3_CH3CO3 + C3H7O2_CH3O2 + RO2_CH3O2 + MACRO2_CH3O2 + MACRO2_CH3CO3 + MCO3_CH3O2 +', + ' MCO3_CH3CO3 + MCO3_MCO3 + ISOPAO2_CH3O2 + ISOPBO2_CH3O2 + ISOPAO2_CH3CO3 + ISOPBO2_CH3CO3 + XO2_CH3O2 + XO2_CH3CO3', + 'RCO2_NO2_sum = CH3CO3_NO2 + MCO3_NO2', + 'OddOx_Ox_Loss = 2.0*O_O3 + O1D_H2O', + 'OddOx_HOx_Loss = HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3', + 'OddOx_NOx_Loss = 2.0*NO2_O + 2.0*jno3_b', + 'OddOx_CLOxBROx_Loss = 2.0*CLO_O + 2.0*jcl2o2 + 2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2', + 'OddOx_Loss_Tot = 2.0*O_O3 + O1D_H2O + HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3 + 2.0*NO2_O + 2.0*jno3_b + 2.0*CLO_O + 2.0*jcl2o2 + 2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb +', + ' 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2', + 'OddOx_Prod_Tot = 2.0*jo2_a + 2.0*jo2_b' + + + diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml new file mode 100644 index 0000000000..fffb9d54f9 --- /dev/null +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml @@ -0,0 +1,292 @@ + + + + +19900101 + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +'epp_ion_rates' + + +atm/waccm/ic/b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.001.cam.i.2015-01-01-00000.nc + + +SERIAL +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP534os_0p5degLat_c180905.nc + + 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', + 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'SF6', 'CFC11eq' + + + +atm/waccm/ub/tgcm_ubc_1850-2100_c100204.nc +'INTERP_MISSING_MONTHS' + + +.true. +.true. +.true. +.false. + + + + +INTERP_MISSING_MONTHS + + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_ext_1deg_ZeroTrop_c181020.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' + + +INTERP_MISSING_MONTHS + + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BENZENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BENZENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGALK_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGALK_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H2_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H2_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H5OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H5OH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H6_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H6_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H8_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H8_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH2O_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH2O_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CHO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CHO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CN_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CN_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COCH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COCH3_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COCHO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COOH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3OH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_CO_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_1750-2100_0.9x1.25_c20170322.nc', + 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_GLYALD_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCN_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCN_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCOOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCOOH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_ISOP_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_IVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_IVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_MEK_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_MEK_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_MTERP_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NH3_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_NO_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_TOLUENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_TOLUENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_XYLENES_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_XYLENES_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_DMS_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_anthro-ene_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc' + + +'noy', 'nhx' + + + + 1, 5, 20, 40, 120, 240, 365, 73, 365 + 0, -24, -6, -3, -1, 1, -24,-120,-240 +'A', 'A', 'A', 'A', 'I', 'A', 'A', 'A', 'I' + +.true. +.false. +.false. +.false. +.false. +.false. +.true. +.true. +.true. + + 'AOA1SRC', 'AOA2SRC', 'NO2_CMXF' + + + 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2', + 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', + 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn', 'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF', + 'bc_a1SFWET', 'bc_a4', 'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF', + 'bc_c4SFWET', 'BENZENE', 'BENZO2', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALD', 'BIGALK', 'BIGENE', + 'BR', 'BRCL', 'BRO', 'BRONO2', 'BROX', 'BROY', 'BRY', 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', + 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', + 'BURDENSOAdn', 'BUTGWSPEC', 'BZALD', 'BZOO', 'BZOOH', 'C2H2', 'C2H4', 'C2H5O2', 'C2H5OH', 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7O2', + 'C3H7OOH', 'C3H8', 'C6H5O2', 'C6H5OOH', 'CCL4', 'CDNUMC', 'CF2CLBR', 'CF3BR', 'CFC113', 'CFC114', 'CFC115', 'CFC11', 'CFC11STAR', + 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CCL3_CHML', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3CO3', 'CH3COCH3', 'CH3COCHO', + 'CH3COOH', 'CH3COOOH', 'CH3O2', 'CH3OH', 'CH3OOH', 'CH4', 'CH4_CHML', 'CHBR3', 'CL2', 'CL2O2', 'CL', + 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', 'CLOX', 'CLOY', 'CLY', 'CME', 'CMFDQ', 'CMFMC', + 'CMFMCDZM', 'CO2', 'CO2_CHML', 'CO', 'CO_CHML', 'CO_CHMP', 'COF2', 'COFCL', 'CONCLD', 'CRESOL', + 'DCOCHM', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O', + 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH', + 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', + 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', + 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2', 'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', + 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', + 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH', 'DF_XYLENOOH', + 'DF_XYLOLOOH', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'DH2O2CHM', 'DHNO3CHM', 'DICARBO2', 'DMS', 'DO3CHM', 'dry_deposition_NHx_as_N', + 'dry_deposition_NOy_as_N', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'dst_a1', 'dst_a1DDF', 'dst_a1SFWET', 'dst_a2', 'dst_a2DDF', + 'dst_a2SFWET', 'dst_a3', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c1', 'dst_c1DDF', 'dst_c1SFWET', 'dst_c2', 'dst_c2DDF', 'dst_c2SFWET', + 'dst_c3', 'dst_c3DDF', 'dst_c3SFWET', 'DTCORE', 'E90', 'e', 'ENEO2', 'EO2', 'EO', 'EOOH', 'EVAPPREC', + 'EVAPQZM', 'EVAPTZM', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'F', 'FCTL', + 'FLASHFRQ', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FREQI', 'FREQL', 'FREQZM', 'FSDS', + 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'FSNTOAC', 'FSUTOA', 'GLYALD', 'GLYOXAL', + 'GS_SO2', 'H2402', 'H2', 'H2O2', 'H2O', 'H2SO4', 'H2SO4M_C', 'H2SO4_sfnnuc1', 'H', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', 'HCL', + 'HCL_GAS', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS', 'HO2', 'HO2NO2', 'HOBR', 'HOCH2OO', 'HOCL', 'HONITR', + 'HPALD', 'HYAC', 'HYDRALD', 'ICEFRAC', 'IEPOX', 'ISOP', 'ISOPAO2', 'ISOPBO2', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3', + 'ISOPNOOH', 'ISOPOOH', 'IVOC', 'IVOC_CHML', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan', 'KVH_CLUBB', + 'LANDFRAC', 'LHFLX', 'LNO_COL_PROD', 'LNO_PROD', 'MACR', 'MACRO2', 'MACROOH', 'MALO2', 'MASS', 'MCO3', 'MDIALO2', + 'MEG_BCARY', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_C2H4', 'MEG_C2H5OH', 'MEG_C2H6', 'MEG_C3H6', 'MEG_C3H8', 'MEG_CH2O', + 'MEG_CH3CHO', 'MEG_CH3COCH3', 'MEG_CH3COOH', 'MEG_CH3OH', 'MEG_CO', 'MEG_HCN', 'MEG_HCOOH', 'MEG_ISOP', 'MEG_MTERP', 'MEG_TOLUENE', + 'MEK', 'MEKO2', 'MEKOOH', 'MPAN', 'MTERP', 'MVK', 'N2D', 'N2O5', 'N2O', 'N2O_CHML', 'N2p', 'N', 'NC4CH2OH', + 'NC4CHO', 'ncl_a1', 'ncl_a1DDF', 'ncl_a1SFWET', 'ncl_a2', 'ncl_a2DDF', 'ncl_a2SFWET', 'ncl_a3', 'ncl_a3DDF', 'ncl_a3SFWET', 'ncl_c1', + 'ncl_c1DDF', 'ncl_c1SFWET', 'ncl_c2', 'ncl_c2DDF', 'ncl_c2SFWET', 'ncl_c3', 'ncl_c3DDF', 'ncl_c3SFWET', 'NDEP', 'NH3', 'NH4', 'NH_50', + 'NH_5', 'NHDEP', 'NITROP_PD', 'NO2', 'NO2_CLXF', 'NO3', 'NO', 'NOA', 'NOp', 'NOX', 'NOY', 'Np', 'NTERPO2', 'NTERPOOH', + 'num_a1', 'num_a1_CLXF', 'num_a1DDF', 'num_a2', 'num_a2_CLXF', 'num_a2DDF', 'num_a2_sfnnuc1', 'num_a3', 'num_a3DDF', 'num_a4', + 'num_a4DDF', 'num_c1', 'num_c1DDF', 'num_c2', 'num_c2DDF', 'num_c3', 'num_c3DDF', 'num_c4', 'num_c4DDF', 'NUMLIQ', 'O1D', 'O2_1D', + 'O2_1S', 'O2', 'O2p', 'O3', 'O3_CHML', 'O3_CHMP', 'O3_Loss', 'O3_Prod', 'O', 'OCLO', 'OCS', 'OddOx_CLOxBROx_Loss', + 'OddOx_HOx_Loss', 'OddOx_Loss_Tot', 'OddOx_NOx_Loss', 'OddOx_Ox_Loss', 'OddOx_Prod_Tot', 'OH', 'OMEGA', 'OMEGAT', 'ONITR', 'Op', + 'PAN', 'PBLH', 'PBZNIT', 'PDELDRY', 'PHENO2', 'PHENO', 'PHENOL', 'PHENOOH', 'PHIS', 'PM25', 'PO2', 'pom_a1', 'pom_a1DDF', 'pom_a1SFWET', + 'pom_a4', 'pom_a4DDF', 'pom_a4SFWET', 'pom_c1', 'pom_c1DDF', 'pom_c1SFWET', 'pom_c4', 'pom_c4DDF', 'pom_c4SFWET', + 'POOH', 'PRECC', 'PRECT', 'PS', 'PSL', 'PTEQ', 'PTTEND', 'Q', 'QFLX', 'QRAIN', 'QREFHT', 'QRL', 'QRLC', 'QRS', + 'QRSC', 'QSNOW', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RELHUM', 'r_GLYOXAL_aer', + 'r_het10', 'r_het11', 'r_het12', 'r_het13', 'r_het15', 'r_het16', 'r_het17', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', + 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_HO2_O3', 'RHREFHT', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', + 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1', 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', + 'r_OH_O3', 'r_OH_O', 'ROOH', 'RO2', 'RO2_NO_sum', 'RO2_NO3_sum', 'RO2_HO2_sum', 'RO2_RO2_sum', 'RCO2_NO2_sum', + 'S', 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SF6', 'SFbc_a4', 'SFBCARY', + 'SFBENZENE', 'SFBIGALK', 'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO', 'SFCH3CN', + 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH', + 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2', + 'SFnum_a3', 'SFpom_a4', 'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2', + 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1', 'so4_a1SFWET', + 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3', + 'so4_a3DDF', 'so4_a3_sfgaex1', 'so4_a3SFWET', 'so4_c1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_c1SFWET', 'so4_c2', 'so4_c2AQH2SO4', + 'so4_c2AQSO4', 'so4_c2DDF', 'so4_c2SFWET', 'so4_c3', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_c3SFWET', 'SO', 'soa1_a1', + 'soa1_a1_CHML', 'soa1_a1DDF', 'soa1_a1_sfgaex1', 'soa1_a1SFWET', 'soa1_a2', 'soa1_a2_CHML', 'soa1_a2DDF', + 'soa1_a2_sfgaex1', 'soa1_a2SFWET', 'soa1_c1', 'soa1_c1DDF', 'soa1_c1SFWET', 'soa1_c2', 'soa1_c2DDF', 'soa1_c2SFWET', 'soa2_a1', 'soa2_a1_CHML', + 'soa2_a1DDF', 'soa2_a1_sfgaex1', 'soa2_a1SFWET', 'soa2_a2', 'soa2_a2_CHML', 'soa2_a2DDF', 'soa2_a2_sfgaex1', + 'soa2_a2SFWET', 'soa2_c1', 'soa2_c1DDF', 'soa2_c1SFWET', 'soa2_c2', 'soa2_c2DDF', 'soa2_c2SFWET', 'soa3_a1', 'soa3_a1_CHML', + 'soa3_a1DDF', 'soa3_a1_sfgaex1', 'soa3_a1SFWET', 'soa3_a2', 'soa3_a2_CHML', 'soa3_a2DDF', 'soa3_a2_sfgaex1', 'soa3_a2SFWET', + 'soa3_c1', 'soa3_c1DDF', 'soa3_c1SFWET', 'soa3_c2', 'soa3_c2DDF', 'soa3_c2SFWET', 'soa4_a1', 'soa4_a1_CHML', 'soa4_a1DDF', + 'soa4_a1_sfgaex1', 'soa4_a1SFWET', 'soa4_a2', 'soa4_a2_CHML', 'soa4_a2DDF', 'soa4_a2_sfgaex1', 'soa4_a2SFWET', 'soa4_c1', + 'soa4_c1DDF', 'soa4_c1SFWET', 'soa4_c2', 'soa4_c2DDF', 'soa4_c2SFWET', 'soa5_a1', 'soa5_a1_CHML', 'soa5_a1DDF', 'soa5_a1_sfgaex1', + 'soa5_a1SFWET', 'soa5_a2', 'soa5_a2_CHML', 'soa5_a2DDF', 'soa5_a2_sfgaex1', 'soa5_a2SFWET', 'soa5_c1', 'soa5_c1DDF', + 'soa5_c1SFWET', 'soa5_c2', 'soa5_c2DDF', 'soa5_c2SFWET', 'SOAG0', 'SOAG0_CHMP', 'SOAG1', 'SOAG1_CHMP', 'SOAG2', 'SOAG2_CHMP', + 'SOAG3', 'SOAG3_CHMP', 'SOAG4', 'SOAG4_CHMP', 'SOLIN', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST', 'ST80_25', 'SVOC', 'SVOC_CHML', + 'T', 'TAQ', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TBRY', 'TCLY', 'TEPOMUC', 'TERP2O2', 'TERP2OOH', + 'TERPNIT', 'TERPO2', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TGCLDIWP', 'TGCLDLWP', 'THzm', 'TMDMS', 'TMOCS', 'TMQ', 'TMSO2', + 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'TOLO2', 'TOLOOH', 'TOLUENE', 'TOT_CLD_VISTAU', 'TOTH', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TROP_P', + 'TROP_T', 'TROP_Z', 'TS', 'TSMN:M', 'TSMX:X', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO', 'TTGWSPEC', + 'U10', 'U', 'UTGWORO', 'UTGWSPEC', 'UU', 'UVzm', 'UWzm', 'Uzm', 'V', 'VD01', 'VEL_NAT2', 'VTHzm', 'VV', 'Vzm', 'WD_ALKNIT', 'WD_ALKOOH', 'WD_BENZOOH', 'WD_BRONO2', + 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO', 'WD_CH3CN', 'WD_CH3COCH3', 'WD_CH3COCHO', + 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL', 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', + 'WD_HBR', 'WD_HCL', 'WD_HCN', 'WD_HCOOH', 'WD_HF', 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD', 'WD_HYAC', + 'WD_HYDRALD', 'WD_IEPOX', 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC', 'WD_MACR', 'WD_MACROOH', + 'WD_MEKOOH', 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP', 'WD_NOA', 'WD_NTERPOOH', + 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', + 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1', 'WD_TERPROD2', 'WD_TOLOOH', 'WD_XOOH', 'WD_XYLENOOH', 'WD_XYLOLOOH', + 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N', 'Wzm', 'XO2', 'XOOH', 'XYLENES', 'XYLENO2', 'XYLENOOH', 'XYLOL', 'XYLOLO2', + 'XYLOLOOH', 'Z3', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU' + + + + 'ACTNL', 'ACTREL', 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn', 'BUTGWSPEC', + 'CDNUMC', 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLOUD', 'CMFMC', 'CMFMCDZM', 'FCTL', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', + 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FSDS', 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNTOA', 'FSNTOAC', 'LHFLX', 'MASS', 'O3', 'OMEGA', + 'OMEGA500', 'PBLH', 'PDELDRY', 'PM25_SRF', 'PRECC', 'PRECT', 'PS', 'PSL', 'Q', 'QREFHT', 'QSNOW', 'RELHUM', 'RHREFHT', 'SHFLX', + 'SOLIN', 'SOLLD', 'SOLSD', 'T', 'T500', 'T700', 'T850', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', + 'TGCLDIWP', 'TGCLDLWP', 'TMQ', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TS', 'TSMN:M', 'TSMX:X', 'U', 'U10', 'UTGWORO', 'UTGWSPEC', + 'V', 'Z3', 'Z500' + + + 'O3_SRF','TS','PM25_SRF','NO2_SRF' + + + 'MSKtem','PS','PSL','VTHzm','UVzm','UWzm','Uzm','Vzm','THzm','Wzm','PHIS' + + + 'PS', 'PSL', 'U', 'V', 'T', 'Z3', 'PHIS', 'FRONTGF:I', 'OMEGA', 'O3', 'REFF_AERO', 'SAD_AERO', + 'so4_a1', 'so4_a2', 'so4_a3', 'AODVISstdn', 'NITROP_PD', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'QRS_TOT', 'CO2', 'H', 'NO', 'O' + + + + 'O3_Prod = NO_HO2 + CH3O2_NO + PO2_NO + CH3CO3_NO + C2H5O2_NO + .92*ISOPAO2_NO + .92*ISOPBO2_NO + MACRO2_NOa + MCO3_NO + C3H7O2_NO + RO2_NO + XO2_NO + .9*TOLO2_NO +', + '.9*PHENO2_NO + .9*C6H5O2_NO + .9*BENZO2_NO + .9*MALO2_NO + .9*BZOO_NO + .9*ACBZO2_NO + .9*DICARBO2_NO + .9*MDIALO2_NO + .9*XYLOLO2_NO + .9*XYLENO2_NO + TERPO2_NO +', + 'TERP2O2_NO + NTERPO2_NO + ALKO2_NO + ENEO2_NO + EO2_NO + MEKO2_NO + HOCH2OO_NO + jonitr', + 'O3_Loss = O1D_H2O + OH_O3 + HO2_O3 + H_O3 + C3H6_O3 + .9*ISOP_O3 + C2H4_O3 + .8*MVK_O3 + 0.8*MACR_O3 + MTERP_O3 + BCARY_O3', + 'RO2_NO_sum = NO_HO2 + CH3O2_NO + HOCH2OO_NO + EO2_NO + C2H5O2_NO + CH3CO3_NO + C3H7O2_NO + PO2_NO + RO2_NO + ENEO2_NO + ENEO2_NOb + MEKO2_NO + MACRO2_NOa + MACRO2_NOb +', + 'MCO3_NO + ISOPAO2_NO + ISOPBO2_NO + ALKO2_NO + ALKO2_NOb + XO2_NO + TOLO2_NO + PHENO2_NO + C6H5O2_NO + BENZO2_NO + MALO2_NO + BZOO_NO + ACBZO2_NO + DICARBO2_NO +', + 'MDIALO2_NO + XYLOLO2_NO + XYLENO2_NO + TERPO2_NO + TERP2O2_NO + NTERPO2_NO', + 'RO2_NO3_sum = NO3_HO2 + MACRO2_NO3 + MCO3_NO3 + ISOPAO2_NO3 + ISOPBO2_NO3 + XO2_NO3', + 'RO2_HO2_sum = CH3O2_HO2 + HOCH2OO_HO2 + EO2_HO2 + C2H5O2_HO2 + CH3CO3_HO2 + C3H7O2_HO2 + PO2_HO2 + RO2_HO2 + MEKO2_HO2 + MACRO2_HO2 + ISOPAO2_HO2 + ISOPBO2_HO2 + ALKO2_HO2 +', + 'XO2_HO2 + TOLO2_HO2 + PHENO2_HO2 + C6H5O2_HO2 + BENZO2_HO2 + MALO2_HO2 + BZOO_HO2 + ACBZO2_HO2 + DICARBO2_HO2 + MDIALO2_HO2 + XYLOLO2_HO2 + XYLENO2_HO2 + TERPO2_HO2 +', + 'TERP2O2_HO2 + NTERPO2_HO2', + 'RO2_RO2_sum = CH3O2_CH3O2a + CH3O2_CH3O2b + C2H5O2_CH3O2 + C2H5O2_C2H5O2 + CH3CO3_CH3O2 + CH3CO3_CH3CO3 + C3H7O2_CH3O2 + RO2_CH3O2 + MACRO2_CH3O2 + MACRO2_CH3CO3 + MCO3_CH3O2 +', + ' MCO3_CH3CO3 + MCO3_MCO3 + ISOPAO2_CH3O2 + ISOPBO2_CH3O2 + ISOPAO2_CH3CO3 + ISOPBO2_CH3CO3 + XO2_CH3O2 + XO2_CH3CO3', + 'RCO2_NO2_sum = CH3CO3_NO2 + MCO3_NO2', + 'OddOx_Ox_Loss = 2.0*O_O3 + O1D_H2O', + 'OddOx_HOx_Loss = HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3', + 'OddOx_NOx_Loss = 2.0*NO2_O + 2.0*jno3_b', + 'OddOx_CLOxBROx_Loss = 2.0*CLO_O + 2.0*jcl2o2 + 2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2', + 'OddOx_Loss_Tot = 2.0*O_O3 + O1D_H2O + HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3 + 2.0*NO2_O + 2.0*jno3_b + 2.0*CLO_O + 2.0*jcl2o2 + 2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb +', + ' 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2', + 'OddOx_Prod_Tot = 2.0*jo2_a + 2.0*jo2_b' + + + diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml new file mode 100644 index 0000000000..9e6df49780 --- /dev/null +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml @@ -0,0 +1,292 @@ + + + + +19900101 + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +'epp_ion_rates' + + +atm/waccm/ic/b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.001.cam.i.2015-01-01-00000.nc + + +SERIAL +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP585_0p5degLat_c180905.nc + + 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', + 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'SF6', 'CFC11eq' + + + +atm/waccm/ub/tgcm_ubc_1850-2100_c100204.nc +'INTERP_MISSING_MONTHS' + + +.true. +.true. +.true. +.false. + + + + +INTERP_MISSING_MONTHS + + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_ext_1deg_ZeroTrop_c181020.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' + + +INTERP_MISSING_MONTHS + + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BENZENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BENZENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGALK_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGALK_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H2_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H2_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H5OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H5OH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H6_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H6_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H8_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H8_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH2O_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH2O_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CHO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CHO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CN_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CN_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCH3_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCHO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COOH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3OH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_CO_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_1750-2100_0.9x1.25_c20170322.nc', + 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_GLYALD_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCN_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCN_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCOOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCOOH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_ISOP_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_IVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_IVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MEK_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MEK_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MTERP_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NH3_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_NO_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_TOLUENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_TOLUENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_XYLENES_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_XYLENES_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_DMS_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ene_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc' + + +'noy', 'nhx' + + + + 1, 5, 20, 40, 120, 240, 365, 73, 365 + 0, -24, -6, -3, -1, 1, -24,-120,-240 +'A', 'A', 'A', 'A', 'I', 'A', 'A', 'A', 'I' + +.true. +.false. +.false. +.false. +.false. +.false. +.true. +.true. +.true. + + 'AOA1SRC', 'AOA2SRC', 'NO2_CMXF' + + + 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2', + 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', + 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn', 'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF', + 'bc_a1SFWET', 'bc_a4', 'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF', + 'bc_c4SFWET', 'BENZENE', 'BENZO2', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALD', 'BIGALK', 'BIGENE', + 'BR', 'BRCL', 'BRO', 'BRONO2', 'BROX', 'BROY', 'BRY', 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', + 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', + 'BURDENSOAdn', 'BUTGWSPEC', 'BZALD', 'BZOO', 'BZOOH', 'C2H2', 'C2H4', 'C2H5O2', 'C2H5OH', 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7O2', + 'C3H7OOH', 'C3H8', 'C6H5O2', 'C6H5OOH', 'CCL4', 'CDNUMC', 'CF2CLBR', 'CF3BR', 'CFC113', 'CFC114', 'CFC115', 'CFC11', 'CFC11STAR', + 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CCL3_CHML', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3CO3', 'CH3COCH3', 'CH3COCHO', + 'CH3COOH', 'CH3COOOH', 'CH3O2', 'CH3OH', 'CH3OOH', 'CH4', 'CH4_CHML', 'CHBR3', 'CL2', 'CL2O2', 'CL', + 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', 'CLOX', 'CLOY', 'CLY', 'CME', 'CMFDQ', 'CMFMC', + 'CMFMCDZM', 'CO2', 'CO2_CHML', 'CO', 'CO_CHML', 'CO_CHMP', 'COF2', 'COFCL', 'CONCLD', 'CRESOL', + 'DCOCHM', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O', + 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH', + 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', + 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', + 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2', 'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', + 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', + 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH', 'DF_XYLENOOH', + 'DF_XYLOLOOH', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'DH2O2CHM', 'DHNO3CHM', 'DICARBO2', 'DMS', 'DO3CHM', 'dry_deposition_NHx_as_N', + 'dry_deposition_NOy_as_N', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'dst_a1', 'dst_a1DDF', 'dst_a1SFWET', 'dst_a2', 'dst_a2DDF', + 'dst_a2SFWET', 'dst_a3', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c1', 'dst_c1DDF', 'dst_c1SFWET', 'dst_c2', 'dst_c2DDF', 'dst_c2SFWET', + 'dst_c3', 'dst_c3DDF', 'dst_c3SFWET', 'DTCORE', 'E90', 'e', 'ENEO2', 'EO2', 'EO', 'EOOH', 'EVAPPREC', + 'EVAPQZM', 'EVAPTZM', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'F', 'FCTL', + 'FLASHFRQ', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FREQI', 'FREQL', 'FREQZM', 'FSDS', + 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'FSNTOAC', 'FSUTOA', 'GLYALD', 'GLYOXAL', + 'GS_SO2', 'H2402', 'H2', 'H2O2', 'H2O', 'H2SO4', 'H2SO4M_C', 'H2SO4_sfnnuc1', 'H', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', 'HCL', + 'HCL_GAS', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS', 'HO2', 'HO2NO2', 'HOBR', 'HOCH2OO', 'HOCL', 'HONITR', + 'HPALD', 'HYAC', 'HYDRALD', 'ICEFRAC', 'IEPOX', 'ISOP', 'ISOPAO2', 'ISOPBO2', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3', + 'ISOPNOOH', 'ISOPOOH', 'IVOC', 'IVOC_CHML', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan', 'KVH_CLUBB', + 'LANDFRAC', 'LHFLX', 'LNO_COL_PROD', 'LNO_PROD', 'MACR', 'MACRO2', 'MACROOH', 'MALO2', 'MASS', 'MCO3', 'MDIALO2', + 'MEG_BCARY', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_C2H4', 'MEG_C2H5OH', 'MEG_C2H6', 'MEG_C3H6', 'MEG_C3H8', 'MEG_CH2O', + 'MEG_CH3CHO', 'MEG_CH3COCH3', 'MEG_CH3COOH', 'MEG_CH3OH', 'MEG_CO', 'MEG_HCN', 'MEG_HCOOH', 'MEG_ISOP', 'MEG_MTERP', 'MEG_TOLUENE', + 'MEK', 'MEKO2', 'MEKOOH', 'MPAN', 'MTERP', 'MVK', 'N2D', 'N2O5', 'N2O', 'N2O_CHML', 'N2p', 'N', 'NC4CH2OH', + 'NC4CHO', 'ncl_a1', 'ncl_a1DDF', 'ncl_a1SFWET', 'ncl_a2', 'ncl_a2DDF', 'ncl_a2SFWET', 'ncl_a3', 'ncl_a3DDF', 'ncl_a3SFWET', 'ncl_c1', + 'ncl_c1DDF', 'ncl_c1SFWET', 'ncl_c2', 'ncl_c2DDF', 'ncl_c2SFWET', 'ncl_c3', 'ncl_c3DDF', 'ncl_c3SFWET', 'NDEP', 'NH3', 'NH4', 'NH_50', + 'NH_5', 'NHDEP', 'NITROP_PD', 'NO2', 'NO2_CLXF', 'NO3', 'NO', 'NOA', 'NOp', 'NOX', 'NOY', 'Np', 'NTERPO2', 'NTERPOOH', + 'num_a1', 'num_a1_CLXF', 'num_a1DDF', 'num_a2', 'num_a2_CLXF', 'num_a2DDF', 'num_a2_sfnnuc1', 'num_a3', 'num_a3DDF', 'num_a4', + 'num_a4DDF', 'num_c1', 'num_c1DDF', 'num_c2', 'num_c2DDF', 'num_c3', 'num_c3DDF', 'num_c4', 'num_c4DDF', 'NUMLIQ', 'O1D', 'O2_1D', + 'O2_1S', 'O2', 'O2p', 'O3', 'O3_CHML', 'O3_CHMP', 'O3_Loss', 'O3_Prod', 'O', 'OCLO', 'OCS', 'OddOx_CLOxBROx_Loss', + 'OddOx_HOx_Loss', 'OddOx_Loss_Tot', 'OddOx_NOx_Loss', 'OddOx_Ox_Loss', 'OddOx_Prod_Tot', 'OH', 'OMEGA', 'OMEGAT', 'ONITR', 'Op', + 'PAN', 'PBLH', 'PBZNIT', 'PDELDRY', 'PHENO2', 'PHENO', 'PHENOL', 'PHENOOH', 'PHIS', 'PM25', 'PO2', 'pom_a1', 'pom_a1DDF', 'pom_a1SFWET', + 'pom_a4', 'pom_a4DDF', 'pom_a4SFWET', 'pom_c1', 'pom_c1DDF', 'pom_c1SFWET', 'pom_c4', 'pom_c4DDF', 'pom_c4SFWET', + 'POOH', 'PRECC', 'PRECT', 'PS', 'PSL', 'PTEQ', 'PTTEND', 'Q', 'QFLX', 'QRAIN', 'QREFHT', 'QRL', 'QRLC', 'QRS', + 'QRSC', 'QSNOW', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RELHUM', 'r_GLYOXAL_aer', + 'r_het10', 'r_het11', 'r_het12', 'r_het13', 'r_het15', 'r_het16', 'r_het17', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', + 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_HO2_O3', 'RHREFHT', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', + 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1', 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', + 'r_OH_O3', 'r_OH_O', 'ROOH', 'RO2', 'RO2_NO_sum', 'RO2_NO3_sum', 'RO2_HO2_sum', 'RO2_RO2_sum', 'RCO2_NO2_sum', + 'S', 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SF6', 'SFbc_a4', 'SFBCARY', + 'SFBENZENE', 'SFBIGALK', 'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO', 'SFCH3CN', + 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH', + 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2', + 'SFnum_a3', 'SFpom_a4', 'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2', + 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1', 'so4_a1SFWET', + 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3', + 'so4_a3DDF', 'so4_a3_sfgaex1', 'so4_a3SFWET', 'so4_c1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_c1SFWET', 'so4_c2', 'so4_c2AQH2SO4', + 'so4_c2AQSO4', 'so4_c2DDF', 'so4_c2SFWET', 'so4_c3', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_c3SFWET', 'SO', 'soa1_a1', + 'soa1_a1_CHML', 'soa1_a1DDF', 'soa1_a1_sfgaex1', 'soa1_a1SFWET', 'soa1_a2', 'soa1_a2_CHML', 'soa1_a2DDF', + 'soa1_a2_sfgaex1', 'soa1_a2SFWET', 'soa1_c1', 'soa1_c1DDF', 'soa1_c1SFWET', 'soa1_c2', 'soa1_c2DDF', 'soa1_c2SFWET', 'soa2_a1', 'soa2_a1_CHML', + 'soa2_a1DDF', 'soa2_a1_sfgaex1', 'soa2_a1SFWET', 'soa2_a2', 'soa2_a2_CHML', 'soa2_a2DDF', 'soa2_a2_sfgaex1', + 'soa2_a2SFWET', 'soa2_c1', 'soa2_c1DDF', 'soa2_c1SFWET', 'soa2_c2', 'soa2_c2DDF', 'soa2_c2SFWET', 'soa3_a1', 'soa3_a1_CHML', + 'soa3_a1DDF', 'soa3_a1_sfgaex1', 'soa3_a1SFWET', 'soa3_a2', 'soa3_a2_CHML', 'soa3_a2DDF', 'soa3_a2_sfgaex1', 'soa3_a2SFWET', + 'soa3_c1', 'soa3_c1DDF', 'soa3_c1SFWET', 'soa3_c2', 'soa3_c2DDF', 'soa3_c2SFWET', 'soa4_a1', 'soa4_a1_CHML', 'soa4_a1DDF', + 'soa4_a1_sfgaex1', 'soa4_a1SFWET', 'soa4_a2', 'soa4_a2_CHML', 'soa4_a2DDF', 'soa4_a2_sfgaex1', 'soa4_a2SFWET', 'soa4_c1', + 'soa4_c1DDF', 'soa4_c1SFWET', 'soa4_c2', 'soa4_c2DDF', 'soa4_c2SFWET', 'soa5_a1', 'soa5_a1_CHML', 'soa5_a1DDF', 'soa5_a1_sfgaex1', + 'soa5_a1SFWET', 'soa5_a2', 'soa5_a2_CHML', 'soa5_a2DDF', 'soa5_a2_sfgaex1', 'soa5_a2SFWET', 'soa5_c1', 'soa5_c1DDF', + 'soa5_c1SFWET', 'soa5_c2', 'soa5_c2DDF', 'soa5_c2SFWET', 'SOAG0', 'SOAG0_CHMP', 'SOAG1', 'SOAG1_CHMP', 'SOAG2', 'SOAG2_CHMP', + 'SOAG3', 'SOAG3_CHMP', 'SOAG4', 'SOAG4_CHMP', 'SOLIN', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST', 'ST80_25', 'SVOC', 'SVOC_CHML', + 'T', 'TAQ', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TBRY', 'TCLY', 'TEPOMUC', 'TERP2O2', 'TERP2OOH', + 'TERPNIT', 'TERPO2', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TGCLDIWP', 'TGCLDLWP', 'THzm', 'TMDMS', 'TMOCS', 'TMQ', 'TMSO2', + 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'TOLO2', 'TOLOOH', 'TOLUENE', 'TOT_CLD_VISTAU', 'TOTH', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TROP_P', + 'TROP_T', 'TROP_Z', 'TS', 'TSMN:M', 'TSMX:X', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO', 'TTGWSPEC', + 'U10', 'U', 'UTGWORO', 'UTGWSPEC', 'UU', 'UVzm', 'UWzm', 'Uzm', 'V', 'VD01', 'VEL_NAT2', 'VTHzm', 'VV', 'Vzm', 'WD_ALKNIT', 'WD_ALKOOH', 'WD_BENZOOH', 'WD_BRONO2', + 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO', 'WD_CH3CN', 'WD_CH3COCH3', 'WD_CH3COCHO', + 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL', 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', + 'WD_HBR', 'WD_HCL', 'WD_HCN', 'WD_HCOOH', 'WD_HF', 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD', 'WD_HYAC', + 'WD_HYDRALD', 'WD_IEPOX', 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC', 'WD_MACR', 'WD_MACROOH', + 'WD_MEKOOH', 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP', 'WD_NOA', 'WD_NTERPOOH', + 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', + 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1', 'WD_TERPROD2', 'WD_TOLOOH', 'WD_XOOH', 'WD_XYLENOOH', 'WD_XYLOLOOH', + 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N', 'Wzm', 'XO2', 'XOOH', 'XYLENES', 'XYLENO2', 'XYLENOOH', 'XYLOL', 'XYLOLO2', + 'XYLOLOOH', 'Z3', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU' + + + + 'ACTNL', 'ACTREL', 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn', 'BUTGWSPEC', + 'CDNUMC', 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLOUD', 'CMFMC', 'CMFMCDZM', 'FCTL', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', + 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FSDS', 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNTOA', 'FSNTOAC', 'LHFLX', 'MASS', 'O3', 'OMEGA', + 'OMEGA500', 'PBLH', 'PDELDRY', 'PM25_SRF', 'PRECC', 'PRECT', 'PS', 'PSL', 'Q', 'QREFHT', 'QSNOW', 'RELHUM', 'RHREFHT', 'SHFLX', + 'SOLIN', 'SOLLD', 'SOLSD', 'T', 'T500', 'T700', 'T850', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', + 'TGCLDIWP', 'TGCLDLWP', 'TMQ', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TS', 'TSMN:M', 'TSMX:X', 'U', 'U10', 'UTGWORO', 'UTGWSPEC', + 'V', 'Z3', 'Z500' + + + 'O3_SRF','TS','PM25_SRF','NO2_SRF' + + + 'MSKtem','PS','PSL','VTHzm','UVzm','UWzm','Uzm','Vzm','THzm','Wzm','PHIS' + + + 'PS', 'PSL', 'U', 'V', 'T', 'Z3', 'PHIS', 'FRONTGF:I', 'OMEGA', 'O3', 'REFF_AERO', 'SAD_AERO', + 'so4_a1', 'so4_a2', 'so4_a3', 'AODVISstdn', 'NITROP_PD', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'QRS_TOT', 'CO2', 'H', 'NO', 'O' + + + + 'O3_Prod = NO_HO2 + CH3O2_NO + PO2_NO + CH3CO3_NO + C2H5O2_NO + .92*ISOPAO2_NO + .92*ISOPBO2_NO + MACRO2_NOa + MCO3_NO + C3H7O2_NO + RO2_NO + XO2_NO + .9*TOLO2_NO +', + '.9*PHENO2_NO + .9*C6H5O2_NO + .9*BENZO2_NO + .9*MALO2_NO + .9*BZOO_NO + .9*ACBZO2_NO + .9*DICARBO2_NO + .9*MDIALO2_NO + .9*XYLOLO2_NO + .9*XYLENO2_NO + TERPO2_NO +', + 'TERP2O2_NO + NTERPO2_NO + ALKO2_NO + ENEO2_NO + EO2_NO + MEKO2_NO + HOCH2OO_NO + jonitr', + 'O3_Loss = O1D_H2O + OH_O3 + HO2_O3 + H_O3 + C3H6_O3 + .9*ISOP_O3 + C2H4_O3 + .8*MVK_O3 + 0.8*MACR_O3 + MTERP_O3 + BCARY_O3', + 'RO2_NO_sum = NO_HO2 + CH3O2_NO + HOCH2OO_NO + EO2_NO + C2H5O2_NO + CH3CO3_NO + C3H7O2_NO + PO2_NO + RO2_NO + ENEO2_NO + ENEO2_NOb + MEKO2_NO + MACRO2_NOa + MACRO2_NOb +', + 'MCO3_NO + ISOPAO2_NO + ISOPBO2_NO + ALKO2_NO + ALKO2_NOb + XO2_NO + TOLO2_NO + PHENO2_NO + C6H5O2_NO + BENZO2_NO + MALO2_NO + BZOO_NO + ACBZO2_NO + DICARBO2_NO +', + 'MDIALO2_NO + XYLOLO2_NO + XYLENO2_NO + TERPO2_NO + TERP2O2_NO + NTERPO2_NO', + 'RO2_NO3_sum = NO3_HO2 + MACRO2_NO3 + MCO3_NO3 + ISOPAO2_NO3 + ISOPBO2_NO3 + XO2_NO3', + 'RO2_HO2_sum = CH3O2_HO2 + HOCH2OO_HO2 + EO2_HO2 + C2H5O2_HO2 + CH3CO3_HO2 + C3H7O2_HO2 + PO2_HO2 + RO2_HO2 + MEKO2_HO2 + MACRO2_HO2 + ISOPAO2_HO2 + ISOPBO2_HO2 + ALKO2_HO2 +', + 'XO2_HO2 + TOLO2_HO2 + PHENO2_HO2 + C6H5O2_HO2 + BENZO2_HO2 + MALO2_HO2 + BZOO_HO2 + ACBZO2_HO2 + DICARBO2_HO2 + MDIALO2_HO2 + XYLOLO2_HO2 + XYLENO2_HO2 + TERPO2_HO2 +', + 'TERP2O2_HO2 + NTERPO2_HO2', + 'RO2_RO2_sum = CH3O2_CH3O2a + CH3O2_CH3O2b + C2H5O2_CH3O2 + C2H5O2_C2H5O2 + CH3CO3_CH3O2 + CH3CO3_CH3CO3 + C3H7O2_CH3O2 + RO2_CH3O2 + MACRO2_CH3O2 + MACRO2_CH3CO3 + MCO3_CH3O2 +', + ' MCO3_CH3CO3 + MCO3_MCO3 + ISOPAO2_CH3O2 + ISOPBO2_CH3O2 + ISOPAO2_CH3CO3 + ISOPBO2_CH3CO3 + XO2_CH3O2 + XO2_CH3CO3', + 'RCO2_NO2_sum = CH3CO3_NO2 + MCO3_NO2', + 'OddOx_Ox_Loss = 2.0*O_O3 + O1D_H2O', + 'OddOx_HOx_Loss = HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3', + 'OddOx_NOx_Loss = 2.0*NO2_O + 2.0*jno3_b', + 'OddOx_CLOxBROx_Loss = 2.0*CLO_O + 2.0*jcl2o2 + 2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2', + 'OddOx_Loss_Tot = 2.0*O_O3 + O1D_H2O + HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3 + 2.0*NO2_O + 2.0*jno3_b + 2.0*CLO_O + 2.0*jcl2o2 + 2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb +', + ' 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2', + 'OddOx_Prod_Tot = 2.0*jo2_a + 2.0*jo2_b' + + + diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index dfbba10270..04d09ddfc0 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -228,6 +228,9 @@ 1850-PD_cam5 + waccm_tsmlt_ssp585_cam6 + waccm_tsmlt_ssp534_cam6 + waccm_tsmlt_ssp126_cam6 2005-2100_cam4_rcp26 2005-2100_cam4_rcp45 2005-2100_cam4_rcp45_bgc @@ -244,7 +247,7 @@ sd_waccmx_ma_cam4 sd_waccm_tsmlt_cam6 sd_waccm_ma_cam6 - sd_waccm_ma_cam6 + sd_waccm_mad_cam6 sd_waccm_ma_cam4 sd_trop_strat_vbs_cam6 sd_cam6 diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index b93b3da8fe..ae84811994 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -385,15 +385,18 @@ 1997-06-18 1979-01-01 + 1950-01-01 2000-01-01 - 1979-01-01 - 1950-01-01 + 2005-01-01 + 1850-01-01 1995-01-01 1995-01-01 1995-01-01 2005-01-01 2005-01-01 2010-01-01 + 1980-01-01 + 1980-01-01 2000-01-01 2004-01-01 @@ -507,6 +510,19 @@ hybrid hybrid + hybrid + hybrid + hybrid + hybrid + hybrid + hybrid + hybrid + hybrid + hybrid + hybrid + hybrid + hybrid + hybrid hybrid @@ -520,6 +536,19 @@ b.e16.B1850_WW3.f09_g16.lang_redi_2hr_frz_chl.003 b.e20.B1850.f09_g16.pi_control.all.123 + f.e21.FW1850.f09_f09_mg17.cesm2.1-exp011.001 + f.e21.FWsc1850.f09_f09_mg17.cesm2.1-exp011.001 + f.e21.FW2000climo.f09_f09_mg17.cesm2.1-exp011.001 + f.e21.FWsc2000climo.f09_f09_mg17.cesm2.1-exp011.001 + f.e21.FW2010climo.f09_f09_mg17.cesm2.1-exp011.001 + f.e21.FWsc2010climo.f09_f09_mg17.cesm2.1-exp011.001 + f.e21.FWHIST.f09_f09_mg17.cesm2.1-exp011.001 + f.e21.FWmaHIST.f09_f09_mg17.cesm2.1-exp011.1975-2015.001 + f.e21.FWmadHIST.f09_f09_mg17.cesm2.1-exp011.001 + f.e21.FWsc1850.f09_f09_mg17.cesm2.1-exp011.001 + c_cesm2.1b01_fswd_1975_cntrl + f.e21.FWmaSD.f09_f09_mg17.cesm2.1-exp011.1978-2015.001 + f.e21.FWmadSD.f09_f09_mg17.cesm2.1-exp011.001 b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.001 @@ -532,6 +561,19 @@ 0010-01-01 0097-01-01 0010-01-01 + 0003-01-01 + 0003-01-01 + 0003-01-01 + 0003-01-01 + 0003-01-01 + 0003-01-01 + 1979-01-01 + 1979-01-01 + 2005-01-01 + 0003-01-01 + 1980-01-01 + 1980-01-01 + 2005-01-01 1950-01-01 @@ -540,10 +582,29 @@ cesm2_init cesm2_init + cesm2_init + cesm2_init + cesm2_init + cesm2_init + cesm2_init + cesm2_init + cesm2_init + cesm2_init + cesm2_init + cesm2_init + cesm2_init + cesm2_init + cesm2_init cesm2_init + + + use_init_interp=.true. + + + 1 diff --git a/doc/ChangeLog b/doc/ChangeLog index 832d032bfc..cabbaeab4a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,91 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_11 +Originator(s): fvitt +Date: 7 Feb 2019 +One-line Summary: WACCM compsets + +Purpose of changes: + + . implement future scenario compsets + . misc changes to WACCM compsets + . WACCM F compsets start from ref cases + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: + +A components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml +A components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml +A components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml + - added for future scenario compsets + +A components/cam/bld/namelist_files/use_cases/sd_waccm_mad_cam6.xml + - needed since FWmadSD has different start date than FWmaSD + +List all existing files that have been modified, and describe the changes: + +M components/cam/bld/namelist_files/use_cases/sd_cam6.xml +M components/cam/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml + - update met files list and solar forcing files + +M components/cam/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml + - update met files list and solar forcing files + - first met file is for 1980-01-01 + - update lbc file + +M components/cam/bld/namelist_files/use_cases/sd_waccm_ma_cam6.xml + - update met files list and solar forcing files + - first met file is for 20005-01-01 + - update lbc file + +M components/cam/bld/namelist_files/use_cases/sd_waccm_ma_cam4.xml + - update met files list and solar irradiance input + +M components/cam/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml + - update lbc file + +M components/cam/bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml +M components/cam/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml +M components/cam/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml +M components/cam/bld/namelist_files/use_cases/waccm_sc_hist_cam6.xml +M components/cam/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml +M components/cam/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml + - update lbc file + +M components/cam/cime_config/config_component.xml + - implement SSP compsets + +M components/cam/cime_config/config_compsets.xml + - WACCM F compsets start from ref cases + - change start dates + +M components/cam/src/chemistry/modal_aero/aero_model.F90 + - corrections to effective radius diagnostics + +M components/cam/src/chemistry/utils/apex.F90 + - log waring only 1 time in future scenario runs + +M components/cam/src/physics/cam/physics_types.F90 + - see cam6_1_012 + physics_state_check - the changes for mmr were causing some of the checks + based on qmin to fail. + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_10 Originator(s): eaton Date: Fri Jan 18 13:11:46 MST 2019 diff --git a/src/chemistry/modal_aero/aero_model.F90 b/src/chemistry/modal_aero/aero_model.F90 index 23fa250357..4c96121b3a 100644 --- a/src/chemistry/modal_aero/aero_model.F90 +++ b/src/chemistry/modal_aero/aero_model.F90 @@ -2033,7 +2033,7 @@ subroutine surf_area_dens( ncol, mmr, pmid, temp, diam, beglev, endlev, sad, ref real(r8),optional, intent(out) :: sfc(:,:,:) ! local vars - real(r8) :: sad_mode(pcols,pver,ntot_amode),radeff(pcols,pver) + real(r8) :: sad_mode(pcols,pver,ntot_amode),sad_mode_correct(pcols,pver,ntot_amode),sad_correct(pcols,pver) real(r8) :: vol(pcols,pver),vol_mode(pcols,pver,ntot_amode) real(r8) :: rho_air integer :: i,k,l,m @@ -2046,6 +2046,8 @@ subroutine surf_area_dens( ncol, mmr, pmid, temp, diam, beglev, endlev, sad, ref sad = 0._r8 sad_mode = 0._r8 + sad_correct = 0._r8 + sad_mode_correct = 0._r8 vol = 0._r8 vol_mode = 0._r8 reff = 0._r8 @@ -2066,22 +2068,32 @@ subroutine surf_area_dens( ncol, mmr, pmid, temp, diam, beglev, endlev, sad, ref chm_mass = chm_mass + mmr(i,k,index_chm_mass(l,m)) end do if ( tot_mass > 0._r8 ) then + ! SAD calculation below is incorrect, but consistent with CMIP6 sad_mode(i,k,l) = (chm_mass/tot_mass)**(2._r8/3._r8) * & mmr(i,k,num_idx(l))*rho_air*pi*diam(i,k,l)**2._r8*& exp(2._r8*alnsg_amode(l)**2._r8) ! m^2/m^3 sad_mode(i,k,l) = 1.e-2_r8 * sad_mode(i,k,l) ! cm^2/cm^3 + + ! Corrected SAD calculation without 2/3 power in chem weighting, for use in effective radius calculation + sad_mode_correct(i,k,l) = chm_mass/tot_mass * & + mmr(i,k,num_idx(l))*rho_air*pi*diam(i,k,l)**2._r8*& + exp(2._r8*alnsg_amode(l)**2._r8) ! m^2/m^3 + sad_mode_correct(i,k,l) = 1.e-2_r8 * sad_mode_correct(i,k,l) ! cm^2/cm^3 + ! Volume calculation, for use in effective radius calculation vol_mode(i,k,l) = chm_mass/tot_mass * & mmr(i,k,num_idx(l))*rho_air*pi/6._r8*diam(i,k,l)**3._r8*& - exp(3._r8*alnsg_amode(l)**2._r8) ! m^3/m^3 = cm^3/cm^3 + exp(4.5_r8*alnsg_amode(l)**2._r8) ! m^3/m^3 = cm^3/cm^3 else sad_mode(i,k,l) = 0._r8 + sad_mode_correct(i,k,l) = 0._r8 vol_mode(i,k,l) = 0._r8 end if end do sad(i,k) = sum(sad_mode(i,k,:)) + sad_correct(i,k) = sum(sad_mode_correct(i,k,:)) vol(i,k) = sum(vol_mode(i,k,:)) - reff(i,k) = 3._r8*vol(i,k)/sad(i,k) + reff(i,k) = 3._r8*vol(i,k)/sad_correct(i,k) enddo enddo diff --git a/src/chemistry/utils/apex.F90 b/src/chemistry/utils/apex.F90 index 6e24ec9dd4..d4b60af9b1 100644 --- a/src/chemistry/utils/apex.F90 +++ b/src/chemistry/utils/apex.F90 @@ -36,6 +36,7 @@ module apex use shr_kind_mod, only : r8 => shr_kind_r8 use cam_logfile, only : iulog use cam_abortutils,only : endrun + use spmd_utils, only : masterproc implicit none @@ -121,6 +122,7 @@ module apex integer, protected :: apex_end_yr logical :: igrf_set = .false. + logical :: first_warning = .false. contains !----------------------------------------------------------------------- @@ -203,9 +205,11 @@ subroutine ggrid(nvert,glatmin,glatmax,glonmin,glonmax,altmin,altmax, & if (gplon(nlon-1) >= glonmax) nlon = nlon-1 gpalt(1) = max(gpalt(1),0._r8) - write(iulog,"('ggrid: nlat=',i4,' gplat=',/,(6f9.2))") nlat,gplat - write(iulog,"('ggrid: nlon=',i4,' gplon=',/,(6f9.2))") nlon,gplon - write(iulog,"('ggrid: nalt=',i4,' gpalt=',/,(6f9.2))") nalt,gpalt + if (masterproc) then + write(iulog,"('ggrid: nlat=',i4,' gplat=',/,(6f9.2))") nlat,gplat + write(iulog,"('ggrid: nlon=',i4,' gplon=',/,(6f9.2))") nlon,gplon + write(iulog,"('ggrid: nalt=',i4,' gpalt=',/,(6f9.2))") nalt,gpalt + endif end subroutine ggrid @@ -1947,10 +1951,13 @@ subroutine cofrm(date) call endrun( 'cofrm' ) endif if (date > apex_end_yr-5) then + if (masterproc .and. .not. first_warning) then write(iulog,"('>>> WARNING cofrm:')") write(iulog,"(/,' This version of IGRF is intended for use up to ')") write(iulog,"(' 2020. Values for ',f9.3,' will be computed but')") date write(iulog,"(' may be of reduced accuracy.',/)") + first_warning=.true. + endif endif ! ! Set gh from g1,g2: diff --git a/src/physics/cam/physics_types.F90 b/src/physics/cam/physics_types.F90 index f08911ad50..2eedc8af05 100644 --- a/src/physics/cam/physics_types.F90 +++ b/src/physics/cam/physics_types.F90 @@ -490,7 +490,7 @@ subroutine physics_state_check(state, name) shr_infnan_posinf, shr_infnan_neginf use shr_assert_mod, only: shr_assert, shr_assert_in_domain use physconst, only: pi - use constituents, only: pcnst, qmin + use constituents, only: pcnst !------------------------------Arguments-------------------------------- ! State to check. @@ -663,7 +663,7 @@ subroutine physics_state_check(state, name) ! 3-D variables do m = 1,pcnst - call shr_assert_in_domain(state%q(:ncol,:,m), lt=posinf_r8, ge=qmin(m), & + call shr_assert_in_domain(state%q(:ncol,:,m), lt=posinf_r8, gt=neginf_r8, & varname="state%q ("//trim(cnst_name(m))//")", msg=msg) end do From d9741594786416eebba032b41904c68fbe12467b Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Wed, 13 Feb 2019 10:12:20 -0700 Subject: [PATCH 014/239] 'mods for co2_cycle Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90604 Committed by Brian Eaton at 2019-02-13 10:12:20 -0700 Original svn commit message: mods for co2_cycle' --- doc/ChangeLog | 46 +++++++++++++++++++++++++++++ src/physics/cam/cam_diagnostics.F90 | 8 +++-- src/physics/cam/co2_cycle.F90 | 13 +++++--- 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index cabbaeab4a..b2ae362aac 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,51 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_12 +Originator(s): klindsay, eaton +Date: Wed Feb 13 10:03:44 MST 2019 +One-line Summary: Add CO2 cycle diagnostic; disable qneg3 on CO2 tracers + +Purpose of changes: + +. Add new history variable, TMac_CO2, the vertical integral of the aircraft + CO2 emissions (ac_CO2). This is helpful for closing tracer budgets. This + history variable is not enabled by default. + +. Disable qneg3 on CO2 tracers. + +Bugs fixed (include bugzilla ID): none + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +components/cam/src/physics/cam/cam_diagnostics.F90 +. add output of TMac_CO2 + +components/cam/src/physics/cam/co2_cycle.F90 +. addfld for TMac_CO2 +. change qmin for CO2 constituents from 1.e-20 to -1.e36. This is to turn + off qneg3 modifications. + +No testing done. + +Summarize any changes to answers: none + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_11 Originator(s): fvitt Date: 7 Feb 2019 diff --git a/src/physics/cam/cam_diagnostics.F90 b/src/physics/cam/cam_diagnostics.F90 index 8b046924d1..bda3b5661b 100644 --- a/src/physics/cam/cam_diagnostics.F90 +++ b/src/physics/cam/cam_diagnostics.F90 @@ -898,7 +898,6 @@ subroutine diag_phys_writeout_dry(state, pbuf, p_surf_t) use time_manager, only: get_nstep use interpolate_data, only: vertinterp use constituent_burden, only: constituent_burden_comp - use co2_cycle, only: c_i, co2_transport use tidal_diag, only: tidal_diag_write !----------------------------------------------------------------------- @@ -1235,7 +1234,7 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t) epsilo, rh2o use interpolate_data, only: vertinterp use constituent_burden, only: constituent_burden_comp - use co2_cycle, only: c_i, co2_transport + use co2_cycle, only: c_i, co2_transport, co2_readFlux_aircraft !----------------------------------------------------------------------- ! ! Arguments @@ -1270,6 +1269,11 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t) do m = 1,4 call outfld(trim(cnst_name(c_i(m)))//'_BOT', state%q(1,pver,c_i(m)), pcols, lchnk) end do + + if (co2_readFlux_aircraft) then + call pbuf_get_field(pbuf, pbuf_get_index('ac_CO2'), ftem_ptr) + call outfld('TMac_CO2', sum(ftem_ptr(:ncol,:), dim=2), pcols, lchnk) + end if end if ! column burdens of all constituents except water vapor diff --git a/src/physics/cam/co2_cycle.F90 b/src/physics/cam/co2_cycle.F90 index ebf2ca3303..2e3b11ce48 100644 --- a/src/physics/cam/co2_cycle.F90 +++ b/src/physics/cam/co2_cycle.F90 @@ -32,6 +32,7 @@ module co2_cycle ! Public data public data_flux_ocn ! data read in for co2 flux from ocn public data_flux_fuel ! data read in for co2 flux from fuel + public co2_readFlux_aircraft ! true => read aircraft co2 flux from data file, namelist variable type(co2_data_flux_type) :: data_flux_ocn type(co2_data_flux_type) :: data_flux_fuel @@ -42,9 +43,9 @@ module co2_cycle ! Namelist variables logical :: co2_flag = .false. ! true => turn on co2 code, namelist variable - logical :: co2_readFlux_ocn = .false. ! true => read ocn co2 flux from date file, namelist variable - logical :: co2_readFlux_fuel = .false. ! true => read fuel co2 flux from date file, namelist variable - logical :: co2_readFlux_aircraft = .false. ! true => read aircraft co2 flux from date file, namelist variable + logical :: co2_readFlux_ocn = .false. ! true => read ocn co2 flux from data file, namelist variable + logical :: co2_readFlux_fuel = .false. ! true => read fuel co2 flux from data file, namelist variable + logical :: co2_readFlux_aircraft = .false. ! true => read aircraft co2 flux from data file, namelist variable character(len=cl) :: co2flux_ocn_file = 'unset' ! co2 flux from ocn character(len=cl) :: co2flux_fuel_file = 'unset' ! co2 flux from fossil fuel @@ -157,7 +158,7 @@ subroutine co2_register c_mw = (/ mwco2, mwco2, mwco2, mwco2 /) c_cp = (/ cpair, cpair, cpair, cpair /) - c_qmin = (/ 1.e-20_r8, 1.e-20_r8, 1.e-20_r8, 1.e-20_r8 /) + c_qmin = (/ -1.e36_r8, -1.e36_r8, -1.e36_r8, -1.e36_r8 /) ! disable qneg3 ! register CO2 constiuents as dry tracers, set indices @@ -324,6 +325,10 @@ subroutine co2_init call co2_data_flux_init ( co2flux_fuel_file, 'CO2_flux', data_flux_fuel ) end if + if (co2_readFlux_aircraft) then + call addfld('TMac_CO2', horiz_only,'A', 'kg/m2/s', 'vertical integral of aircraft emission ac_CO2') + end if + end subroutine co2_init !=============================================================================== From bd382651164c27fe545a8c830b1dc5640bad27b1 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Wed, 27 Feb 2019 16:57:27 -0700 Subject: [PATCH 015/239] 'mods for co2_cycle Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90664 Committed by Brian Eaton at 2019-02-27 16:57:27 -0700 Original svn commit message: mods for co2_cycle' --- doc/ChangeLog | 60 ++++++++++++++++++++++++++ src/physics/cam/clubb_intr.F90 | 7 ++- src/physics/cam/co2_cycle.F90 | 27 ++++++++++++ src/physics/cam/gw_drag.F90 | 9 +++- src/physics/cam/physics_types.F90 | 22 ++++++++-- src/physics/cam/vertical_diffusion.F90 | 10 ++++- 6 files changed, 127 insertions(+), 8 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index b2ae362aac..82187f62ae 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,65 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_13 +Originator(s): klindsay, eaton +Date: Wed Feb 27 16:47:14 MST 2019 +One-line Summary: disable some dry to wet conversions for co2_cycle constituents + +Purpose of changes: + +. Mitigate some problems with advecting nearly constant tracers that were + introduced by the dry to wet mmr conversions that were employed to regain + mass conservation. Omit the dry->wet conversion before CLUBB, gravity + wave, and vertical_diffusion only for co2_cycle tracers. Other + constituents in CESM would not be affected. WACCM results would not + change at all, as co2_cycle tracers are turned off in WACCM runs. + +Bugs fixed (include bugzilla ID): none + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +src/physics/cam/clubb_intr.F90 +src/physics/cam/gw_drag.F90 +src/physics/cam/vertical_diffusion.F90 +. supply optional arg to set_dry_to_wet which avoids doing the dry to wet + conversion on co2_cycle constituents + +src/physics/cam/co2_cycle.F90 +. add subroutine co2_cycle_set_cnst_type which allows setting the cnst_type + of the co2_cycle tracers to specified value. + +src/physics/cam/physics_types.F90 +. add an optional arg to subroutine set_wet_to_dry to all passing the + cnst_type array as an arg rather than using the constituents module + data. + +Testing by Keith: + +. I have an implementation of this counter-proposal, and have verified, using + an F compset with co2_cycle tracers turned on, that introducing this mod + only changes results for co2_cycle tracers, and that it removes the + imprint of water vapor on co2_cycle tracers. That is, constant co2_cycle + tracers are (nearly) preserved. Tracer mass is still conserved. + +Summarize any changes to answers: none except co2_cycle constituents change. + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_12 Originator(s): klindsay, eaton Date: Wed Feb 13 10:03:44 MST 2019 diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index 589e73e873..c03d11881d 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -1033,6 +1033,7 @@ subroutine clubb_tend_cam( & physics_buffer_desc use constituents, only: cnst_get_ind, cnst_type + use co2_cycle, only: co2_cycle_set_cnst_type use camsrfexch, only: cam_in_t use time_manager, only: is_first_step use cam_abortutils, only: endrun @@ -1266,6 +1267,7 @@ subroutine clubb_tend_cam( & type(pdf_parameter), dimension(pverp) :: pdf_params ! PDF parameters [units vary] character(len=200) :: temp1, sub ! Strings needed for CLUBB output + character(len=3) :: cnst_type_loc(pcnst) ! local copy of cnst_type ! --------------- ! ! Pointers ! @@ -1376,7 +1378,10 @@ subroutine clubb_tend_cam( & call physics_state_copy(state, state1) ! constituents are all treated as wet mmr by clubb - call set_dry_to_wet(state1) + ! lie about cnst_type of co2_cycle constituents, so that they don't get converted to wet + cnst_type_loc(:) = cnst_type(:) + call co2_cycle_set_cnst_type(cnst_type_loc, 'wet') + call set_dry_to_wet(state1, cnst_type_loc) if (clubb_do_liqsupersat) then npccn_idx = pbuf_get_index('NPCCN') diff --git a/src/physics/cam/co2_cycle.F90 b/src/physics/cam/co2_cycle.F90 index 2e3b11ce48..12e929313b 100644 --- a/src/physics/cam/co2_cycle.F90 +++ b/src/physics/cam/co2_cycle.F90 @@ -28,6 +28,7 @@ module co2_cycle public co2_time_interp_ocn ! time interpolate co2 flux public co2_time_interp_fuel ! time interpolate co2 flux public co2_cycle_set_ptend ! set tendency from aircraft emissions + public co2_cycle_set_cnst_type ! set cnst_type for co2_cycle tracers ! Public data public data_flux_ocn ! data read in for co2 flux from ocn @@ -429,4 +430,30 @@ end subroutine co2_cycle_set_ptend !=============================================================================== +subroutine co2_cycle_set_cnst_type(cnst_type_array, cnst_type_val) + +!------------------------------------------------------------------------------- +! Purpose: +! set cnst_type for co2_cycle tracers +!------------------------------------------------------------------------------- + + ! Arguments + character(len=*), intent(inout) :: cnst_type_array(:) + character(len=*), intent(in) :: cnst_type_val + + ! Local variables + integer :: m + + !---------------------------------------------------------------------------- + + if (.not. co2_flag) return + + do m = 1, ncnst + cnst_type_array(c_i(m)) = cnst_type_val + end do + +end subroutine co2_cycle_set_cnst_type + +!=============================================================================== + end module co2_cycle diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 7e12a0579d..0aa212c0a1 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -1175,6 +1175,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) use physics_types, only: physics_state_copy, set_dry_to_wet use constituents, only: cnst_type + use co2_cycle, only: co2_cycle_set_cnst_type use physics_buffer, only: physics_buffer_desc, pbuf_get_field use camsrfexch, only: cam_in_t ! Location-dependent cpair @@ -1332,13 +1333,19 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) real(r8) :: piln(state%ncol,pver+1) real(r8) :: zm(state%ncol,pver) real(r8) :: zi(state%ncol,pver+1) + + character(len=3) :: cnst_type_loc(pcnst) ! local copy of cnst_type + !------------------------------------------------------------------------ ! Make local copy of input state. call physics_state_copy(state, state1) ! constituents are all treated as wet mmr - call set_dry_to_wet(state1) + ! lie about cnst_type of co2_cycle constituents, so that they don't get converted to wet + cnst_type_loc(:) = cnst_type(:) + call co2_cycle_set_cnst_type(cnst_type_loc, 'wet') + call set_dry_to_wet(state1, cnst_type_loc) lchnk = state1%lchnk ncol = state1%ncol diff --git a/src/physics/cam/physics_types.F90 b/src/physics/cam/physics_types.F90 index 2eedc8af05..8b31d00cdd 100644 --- a/src/physics/cam/physics_types.F90 +++ b/src/physics/cam/physics_types.F90 @@ -1438,18 +1438,25 @@ end subroutine set_state_pdry !=============================================================================== -subroutine set_wet_to_dry (state) +subroutine set_wet_to_dry (state, cnst_type_in) use constituents, only: pcnst, cnst_type type(physics_state), intent(inout) :: state + character(len=*), optional, intent(in) :: cnst_type_in(:) integer m, ncol + logical l_conv_cnst ! should the dry->wet conversion be applied to this constituent ncol = state%ncol do m = 1,pcnst - if (cnst_type(m).eq.'dry') then + if (present(cnst_type_in)) then + l_conv_cnst = cnst_type_in(m).eq.'dry' + else + l_conv_cnst = cnst_type(m).eq.'dry' + endif + if (l_conv_cnst) then state%q(:ncol,:,m) = state%q(:ncol,:,m)*state%pdel(:ncol,:)/state%pdeldry(:ncol,:) endif end do @@ -1458,18 +1465,25 @@ end subroutine set_wet_to_dry !=============================================================================== -subroutine set_dry_to_wet (state) +subroutine set_dry_to_wet (state, cnst_type_in) use constituents, only: pcnst, cnst_type type(physics_state), intent(inout) :: state + character(len=*), optional, intent(in) :: cnst_type_in(:) integer m, ncol + logical l_conv_cnst ! should the dry->wet conversion be applied to this constituent ncol = state%ncol do m = 1,pcnst - if (cnst_type(m).eq.'dry') then + if (present(cnst_type_in)) then + l_conv_cnst = cnst_type_in(m).eq.'dry' + else + l_conv_cnst = cnst_type(m).eq.'dry' + endif + if (l_conv_cnst) then state%q(:ncol,:,m) = state%q(:ncol,:,m)*state%pdeldry(:ncol,:)/state%pdel(:ncol,:) endif end do diff --git a/src/physics/cam/vertical_diffusion.F90 b/src/physics/cam/vertical_diffusion.F90 index 7fbcf1e79c..aec046cff5 100644 --- a/src/physics/cam/vertical_diffusion.F90 +++ b/src/physics/cam/vertical_diffusion.F90 @@ -651,6 +651,7 @@ subroutine vertical_diffusion_tend( & use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_set_field use physics_types, only : physics_state, physics_ptend, physics_ptend_init use physics_types, only : set_dry_to_wet, set_wet_to_dry + use co2_cycle, only : co2_cycle_set_cnst_type use camsrfexch, only : cam_in_t use cam_history, only : outfld @@ -840,12 +841,17 @@ subroutine vertical_diffusion_tend( & logical :: lq(pcnst) + character(len=3) :: cnst_type_loc(pcnst) ! local copy of cnst_type + ! ----------------------- ! ! Main Computation Begins ! ! ----------------------- ! ! Assume 'wet' mixing ratios in diffusion code. - call set_dry_to_wet(state) + ! lie about cnst_type of co2_cycle constituents, so that they don't get converted to wet + cnst_type_loc(:) = cnst_type(:) + call co2_cycle_set_cnst_type(cnst_type_loc, 'wet') + call set_dry_to_wet(state, cnst_type_loc) rztodt = 1._r8 / ztodt lchnk = state%lchnk @@ -1282,7 +1288,7 @@ subroutine vertical_diffusion_tend( & endif end do ! convert wet mmr back to dry before conservation check - call set_wet_to_dry(state) + call set_wet_to_dry(state, cnst_type_loc) if (.not. do_pbl_diags) then slten(:ncol,:) = ( sl(:ncol,:) - sl_prePBL(:ncol,:) ) * rztodt From 67fde3ab7a2a43afd787bdc999637e81690b89fc Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 28 Feb 2019 08:56:16 -0700 Subject: [PATCH 016/239] 'Updates to WACCM CMIP6 future scenario compsets Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90669 Committed by Francis Vitt at 2019-02-28 08:56:16 -0700 Original svn commit message: Updates to WACCM CMIP6 future scenario compsets M bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml A + bld/namelist_files/use_cases/waccm_tsmlt_ssp245_cam6.xml A + bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml M bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml M bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml M cime_config/config_component.xml M doc/ChangeLog ' --- .../use_cases/waccm_tsmlt_ssp126_cam6.xml | 172 +++++------ .../use_cases/waccm_tsmlt_ssp245_cam6.xml | 292 ++++++++++++++++++ .../use_cases/waccm_tsmlt_ssp370_cam6.xml | 292 ++++++++++++++++++ .../use_cases/waccm_tsmlt_ssp534_cam6.xml | 172 +++++------ .../use_cases/waccm_tsmlt_ssp585_cam6.xml | 172 +++++------ cime_config/config_component.xml | 6 +- doc/ChangeLog | 54 ++++ 7 files changed, 900 insertions(+), 260 deletions(-) create mode 100644 bld/namelist_files/use_cases/waccm_tsmlt_ssp245_cam6.xml create mode 100644 bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml index 0043c2baf8..6263b03b7c 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml @@ -40,102 +40,102 @@ INTERP_MISSING_MONTHS - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', - 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190225.nc', + 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190225.nc', 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190225.nc', 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_ext_1deg_ZeroTrop_c181020.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190225.nc', 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' INTERP_MISSING_MONTHS - 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BENZENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BENZENE_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGALK_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGALK_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGENE_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H2_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H2_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H5OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H5OH_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H6_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H6_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H8_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H8_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH2O_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH2O_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CHO_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CHO_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CN_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CN_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COCH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COCH3_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COCHO_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COOH_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3OH_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CO_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CO_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_CO_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_1750-2100_0.9x1.25_c20170322.nc', - 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_GLYALD_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCN_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCN_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCOOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCOOH_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_ISOP_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_IVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_IVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_MEK_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_MEK_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_MTERP_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NH3_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NO_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NO_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_NO_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_TOLUENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_TOLUENE_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_XYLENES_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_XYLENES_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_DMS_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ene_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc' + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BENZENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BENZENE_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGALK_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGALK_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_BIGENE_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H2_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H2_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H4_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H5OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H5OH_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C2H6_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H6_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H8_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_C3H8_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH2O_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH2O_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CHO_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CHO_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CN_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3CN_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COCH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COCH3_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COCHO_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3COOH_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CH3OH_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CO_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_CO_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_CO_other_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_175001-210101_0.9x1.25_c20190224.nc', + 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_GLYALD_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCN_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCN_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCOOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_HCOOH_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_ISOP_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_IVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_IVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_MEK_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_MEK_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_MTERP_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NH3_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NO_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_NO_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_NO_other_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_TOLUENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_TOLUENE_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_XYLENES_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_XYLENES_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190225.nc' 'noy', 'nhx' diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp245_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp245_cam6.xml new file mode 100644 index 0000000000..5ad0cc0ca3 --- /dev/null +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp245_cam6.xml @@ -0,0 +1,292 @@ + + + + +19900101 + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +'epp_ion_rates' + + +atm/waccm/ic/b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.001.cam.i.2015-01-01-00000.nc + + +SERIAL +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP245_0p5degLat_c180905.nc + + 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', + 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'SF6', 'CFC11eq' + + + +atm/waccm/ub/tgcm_ubc_1850-2100_c100204.nc +'INTERP_MISSING_MONTHS' + + +.true. +.true. +.true. +.false. + + + + +INTERP_MISSING_MONTHS + + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_NO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_ext_1deg_ZeroTrop_c181020.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' + + +INTERP_MISSING_MONTHS + + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_BENZENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_BENZENE_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_BIGALK_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_BIGALK_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_BIGENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_BIGENE_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C2H2_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C2H2_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C2H4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C2H5OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C2H5OH_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C2H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C2H6_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C3H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C3H6_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C3H8_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_C3H8_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH2O_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH2O_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3CHO_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3CHO_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3CN_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3CN_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3COCH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3COCH3_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3COCHO_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3COOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3COOH_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CH3OH_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CO_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_CO_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-SSP_CO_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_175001-210101_0.9x1.25_c20190224.nc', + 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_GLYALD_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_HCN_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_HCN_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_HCOOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_HCOOH_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_ISOP_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_IVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_IVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_MEK_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_MEK_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_MTERP_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_NH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_NH3_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_NO_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_NO_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-SSP_NO_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_TOLUENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_TOLUENE_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_XYLENES_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_XYLENES_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc' + + +'noy', 'nhx' + + + + 1, 5, 20, 40, 120, 240, 365, 73, 365 + 0, -24, -6, -3, -1, 1, -24,-120,-240 +'A', 'A', 'A', 'A', 'I', 'A', 'A', 'A', 'I' + +.true. +.false. +.false. +.false. +.false. +.false. +.true. +.true. +.true. + + 'AOA1SRC', 'AOA2SRC', 'NO2_CMXF' + + + 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2', + 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', + 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn', 'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF', + 'bc_a1SFWET', 'bc_a4', 'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF', + 'bc_c4SFWET', 'BENZENE', 'BENZO2', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALD', 'BIGALK', 'BIGENE', + 'BR', 'BRCL', 'BRO', 'BRONO2', 'BROX', 'BROY', 'BRY', 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', + 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', + 'BURDENSOAdn', 'BUTGWSPEC', 'BZALD', 'BZOO', 'BZOOH', 'C2H2', 'C2H4', 'C2H5O2', 'C2H5OH', 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7O2', + 'C3H7OOH', 'C3H8', 'C6H5O2', 'C6H5OOH', 'CCL4', 'CDNUMC', 'CF2CLBR', 'CF3BR', 'CFC113', 'CFC114', 'CFC115', 'CFC11', 'CFC11STAR', + 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CCL3_CHML', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3CO3', 'CH3COCH3', 'CH3COCHO', + 'CH3COOH', 'CH3COOOH', 'CH3O2', 'CH3OH', 'CH3OOH', 'CH4', 'CH4_CHML', 'CHBR3', 'CL2', 'CL2O2', 'CL', + 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', 'CLOX', 'CLOY', 'CLY', 'CME', 'CMFDQ', 'CMFMC', + 'CMFMCDZM', 'CO2', 'CO2_CHML', 'CO', 'CO_CHML', 'CO_CHMP', 'COF2', 'COFCL', 'CONCLD', 'CRESOL', + 'DCOCHM', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O', + 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH', + 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', + 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', + 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2', 'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', + 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', + 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH', 'DF_XYLENOOH', + 'DF_XYLOLOOH', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'DH2O2CHM', 'DHNO3CHM', 'DICARBO2', 'DMS', 'DO3CHM', 'dry_deposition_NHx_as_N', + 'dry_deposition_NOy_as_N', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'dst_a1', 'dst_a1DDF', 'dst_a1SFWET', 'dst_a2', 'dst_a2DDF', + 'dst_a2SFWET', 'dst_a3', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c1', 'dst_c1DDF', 'dst_c1SFWET', 'dst_c2', 'dst_c2DDF', 'dst_c2SFWET', + 'dst_c3', 'dst_c3DDF', 'dst_c3SFWET', 'DTCORE', 'E90', 'e', 'ENEO2', 'EO2', 'EO', 'EOOH', 'EVAPPREC', + 'EVAPQZM', 'EVAPTZM', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'F', 'FCTL', + 'FLASHFRQ', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FREQI', 'FREQL', 'FREQZM', 'FSDS', + 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'FSNTOAC', 'FSUTOA', 'GLYALD', 'GLYOXAL', + 'GS_SO2', 'H2402', 'H2', 'H2O2', 'H2O', 'H2SO4', 'H2SO4M_C', 'H2SO4_sfnnuc1', 'H', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', 'HCL', + 'HCL_GAS', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS', 'HO2', 'HO2NO2', 'HOBR', 'HOCH2OO', 'HOCL', 'HONITR', + 'HPALD', 'HYAC', 'HYDRALD', 'ICEFRAC', 'IEPOX', 'ISOP', 'ISOPAO2', 'ISOPBO2', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3', + 'ISOPNOOH', 'ISOPOOH', 'IVOC', 'IVOC_CHML', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan', 'KVH_CLUBB', + 'LANDFRAC', 'LHFLX', 'LNO_COL_PROD', 'LNO_PROD', 'MACR', 'MACRO2', 'MACROOH', 'MALO2', 'MASS', 'MCO3', 'MDIALO2', + 'MEG_BCARY', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_C2H4', 'MEG_C2H5OH', 'MEG_C2H6', 'MEG_C3H6', 'MEG_C3H8', 'MEG_CH2O', + 'MEG_CH3CHO', 'MEG_CH3COCH3', 'MEG_CH3COOH', 'MEG_CH3OH', 'MEG_CO', 'MEG_HCN', 'MEG_HCOOH', 'MEG_ISOP', 'MEG_MTERP', 'MEG_TOLUENE', + 'MEK', 'MEKO2', 'MEKOOH', 'MPAN', 'MTERP', 'MVK', 'N2D', 'N2O5', 'N2O', 'N2O_CHML', 'N2p', 'N', 'NC4CH2OH', + 'NC4CHO', 'ncl_a1', 'ncl_a1DDF', 'ncl_a1SFWET', 'ncl_a2', 'ncl_a2DDF', 'ncl_a2SFWET', 'ncl_a3', 'ncl_a3DDF', 'ncl_a3SFWET', 'ncl_c1', + 'ncl_c1DDF', 'ncl_c1SFWET', 'ncl_c2', 'ncl_c2DDF', 'ncl_c2SFWET', 'ncl_c3', 'ncl_c3DDF', 'ncl_c3SFWET', 'NDEP', 'NH3', 'NH4', 'NH_50', + 'NH_5', 'NHDEP', 'NITROP_PD', 'NO2', 'NO2_CLXF', 'NO3', 'NO', 'NOA', 'NOp', 'NOX', 'NOY', 'Np', 'NTERPO2', 'NTERPOOH', + 'num_a1', 'num_a1_CLXF', 'num_a1DDF', 'num_a2', 'num_a2_CLXF', 'num_a2DDF', 'num_a2_sfnnuc1', 'num_a3', 'num_a3DDF', 'num_a4', + 'num_a4DDF', 'num_c1', 'num_c1DDF', 'num_c2', 'num_c2DDF', 'num_c3', 'num_c3DDF', 'num_c4', 'num_c4DDF', 'NUMLIQ', 'O1D', 'O2_1D', + 'O2_1S', 'O2', 'O2p', 'O3', 'O3_CHML', 'O3_CHMP', 'O3_Loss', 'O3_Prod', 'O', 'OCLO', 'OCS', 'OddOx_CLOxBROx_Loss', + 'OddOx_HOx_Loss', 'OddOx_Loss_Tot', 'OddOx_NOx_Loss', 'OddOx_Ox_Loss', 'OddOx_Prod_Tot', 'OH', 'OMEGA', 'OMEGAT', 'ONITR', 'Op', + 'PAN', 'PBLH', 'PBZNIT', 'PDELDRY', 'PHENO2', 'PHENO', 'PHENOL', 'PHENOOH', 'PHIS', 'PM25', 'PO2', 'pom_a1', 'pom_a1DDF', 'pom_a1SFWET', + 'pom_a4', 'pom_a4DDF', 'pom_a4SFWET', 'pom_c1', 'pom_c1DDF', 'pom_c1SFWET', 'pom_c4', 'pom_c4DDF', 'pom_c4SFWET', + 'POOH', 'PRECC', 'PRECT', 'PS', 'PSL', 'PTEQ', 'PTTEND', 'Q', 'QFLX', 'QRAIN', 'QREFHT', 'QRL', 'QRLC', 'QRS', + 'QRSC', 'QSNOW', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RELHUM', 'r_GLYOXAL_aer', + 'r_het10', 'r_het11', 'r_het12', 'r_het13', 'r_het15', 'r_het16', 'r_het17', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', + 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_HO2_O3', 'RHREFHT', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', + 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1', 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', + 'r_OH_O3', 'r_OH_O', 'ROOH', 'RO2', 'RO2_NO_sum', 'RO2_NO3_sum', 'RO2_HO2_sum', 'RO2_RO2_sum', 'RCO2_NO2_sum', + 'S', 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SF6', 'SFbc_a4', 'SFBCARY', + 'SFBENZENE', 'SFBIGALK', 'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO', 'SFCH3CN', + 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH', + 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2', + 'SFnum_a3', 'SFpom_a4', 'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2', + 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1', 'so4_a1SFWET', + 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3', + 'so4_a3DDF', 'so4_a3_sfgaex1', 'so4_a3SFWET', 'so4_c1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_c1SFWET', 'so4_c2', 'so4_c2AQH2SO4', + 'so4_c2AQSO4', 'so4_c2DDF', 'so4_c2SFWET', 'so4_c3', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_c3SFWET', 'SO', 'soa1_a1', + 'soa1_a1_CHML', 'soa1_a1DDF', 'soa1_a1_sfgaex1', 'soa1_a1SFWET', 'soa1_a2', 'soa1_a2_CHML', 'soa1_a2DDF', + 'soa1_a2_sfgaex1', 'soa1_a2SFWET', 'soa1_c1', 'soa1_c1DDF', 'soa1_c1SFWET', 'soa1_c2', 'soa1_c2DDF', 'soa1_c2SFWET', 'soa2_a1', 'soa2_a1_CHML', + 'soa2_a1DDF', 'soa2_a1_sfgaex1', 'soa2_a1SFWET', 'soa2_a2', 'soa2_a2_CHML', 'soa2_a2DDF', 'soa2_a2_sfgaex1', + 'soa2_a2SFWET', 'soa2_c1', 'soa2_c1DDF', 'soa2_c1SFWET', 'soa2_c2', 'soa2_c2DDF', 'soa2_c2SFWET', 'soa3_a1', 'soa3_a1_CHML', + 'soa3_a1DDF', 'soa3_a1_sfgaex1', 'soa3_a1SFWET', 'soa3_a2', 'soa3_a2_CHML', 'soa3_a2DDF', 'soa3_a2_sfgaex1', 'soa3_a2SFWET', + 'soa3_c1', 'soa3_c1DDF', 'soa3_c1SFWET', 'soa3_c2', 'soa3_c2DDF', 'soa3_c2SFWET', 'soa4_a1', 'soa4_a1_CHML', 'soa4_a1DDF', + 'soa4_a1_sfgaex1', 'soa4_a1SFWET', 'soa4_a2', 'soa4_a2_CHML', 'soa4_a2DDF', 'soa4_a2_sfgaex1', 'soa4_a2SFWET', 'soa4_c1', + 'soa4_c1DDF', 'soa4_c1SFWET', 'soa4_c2', 'soa4_c2DDF', 'soa4_c2SFWET', 'soa5_a1', 'soa5_a1_CHML', 'soa5_a1DDF', 'soa5_a1_sfgaex1', + 'soa5_a1SFWET', 'soa5_a2', 'soa5_a2_CHML', 'soa5_a2DDF', 'soa5_a2_sfgaex1', 'soa5_a2SFWET', 'soa5_c1', 'soa5_c1DDF', + 'soa5_c1SFWET', 'soa5_c2', 'soa5_c2DDF', 'soa5_c2SFWET', 'SOAG0', 'SOAG0_CHMP', 'SOAG1', 'SOAG1_CHMP', 'SOAG2', 'SOAG2_CHMP', + 'SOAG3', 'SOAG3_CHMP', 'SOAG4', 'SOAG4_CHMP', 'SOLIN', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST', 'ST80_25', 'SVOC', 'SVOC_CHML', + 'T', 'TAQ', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TBRY', 'TCLY', 'TEPOMUC', 'TERP2O2', 'TERP2OOH', + 'TERPNIT', 'TERPO2', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TGCLDIWP', 'TGCLDLWP', 'THzm', 'TMDMS', 'TMOCS', 'TMQ', 'TMSO2', + 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'TOLO2', 'TOLOOH', 'TOLUENE', 'TOT_CLD_VISTAU', 'TOTH', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TROP_P', + 'TROP_T', 'TROP_Z', 'TS', 'TSMN:M', 'TSMX:X', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO', 'TTGWSPEC', + 'U10', 'U', 'UTGWORO', 'UTGWSPEC', 'UU', 'UVzm', 'UWzm', 'Uzm', 'V', 'VD01', 'VEL_NAT2', 'VTHzm', 'VV', 'Vzm', 'WD_ALKNIT', 'WD_ALKOOH', 'WD_BENZOOH', 'WD_BRONO2', + 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO', 'WD_CH3CN', 'WD_CH3COCH3', 'WD_CH3COCHO', + 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL', 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', + 'WD_HBR', 'WD_HCL', 'WD_HCN', 'WD_HCOOH', 'WD_HF', 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD', 'WD_HYAC', + 'WD_HYDRALD', 'WD_IEPOX', 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC', 'WD_MACR', 'WD_MACROOH', + 'WD_MEKOOH', 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP', 'WD_NOA', 'WD_NTERPOOH', + 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', + 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1', 'WD_TERPROD2', 'WD_TOLOOH', 'WD_XOOH', 'WD_XYLENOOH', 'WD_XYLOLOOH', + 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N', 'Wzm', 'XO2', 'XOOH', 'XYLENES', 'XYLENO2', 'XYLENOOH', 'XYLOL', 'XYLOLO2', + 'XYLOLOOH', 'Z3', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU' + + + + 'ACTNL', 'ACTREL', 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn', 'BUTGWSPEC', + 'CDNUMC', 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLOUD', 'CMFMC', 'CMFMCDZM', 'FCTL', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', + 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FSDS', 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNTOA', 'FSNTOAC', 'LHFLX', 'MASS', 'O3', 'OMEGA', + 'OMEGA500', 'PBLH', 'PDELDRY', 'PM25_SRF', 'PRECC', 'PRECT', 'PS', 'PSL', 'Q', 'QREFHT', 'QSNOW', 'RELHUM', 'RHREFHT', 'SHFLX', + 'SOLIN', 'SOLLD', 'SOLSD', 'T', 'T500', 'T700', 'T850', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', + 'TGCLDIWP', 'TGCLDLWP', 'TMQ', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TS', 'TSMN:M', 'TSMX:X', 'U', 'U10', 'UTGWORO', 'UTGWSPEC', + 'V', 'Z3', 'Z500' + + + 'O3_SRF','TS','PM25_SRF','NO2_SRF' + + + 'MSKtem','PS','PSL','VTHzm','UVzm','UWzm','Uzm','Vzm','THzm','Wzm','PHIS' + + + 'PS', 'PSL', 'U', 'V', 'T', 'Z3', 'PHIS', 'FRONTGF:I', 'OMEGA', 'O3', 'REFF_AERO', 'SAD_AERO', + 'so4_a1', 'so4_a2', 'so4_a3', 'AODVISstdn', 'NITROP_PD', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'QRS_TOT', 'CO2', 'H', 'NO', 'O' + + + + 'O3_Prod = NO_HO2 + CH3O2_NO + PO2_NO + CH3CO3_NO + C2H5O2_NO + .92*ISOPAO2_NO + .92*ISOPBO2_NO + MACRO2_NOa + MCO3_NO + C3H7O2_NO + RO2_NO + XO2_NO + .9*TOLO2_NO +', + '.9*PHENO2_NO + .9*C6H5O2_NO + .9*BENZO2_NO + .9*MALO2_NO + .9*BZOO_NO + .9*ACBZO2_NO + .9*DICARBO2_NO + .9*MDIALO2_NO + .9*XYLOLO2_NO + .9*XYLENO2_NO + TERPO2_NO +', + 'TERP2O2_NO + NTERPO2_NO + ALKO2_NO + ENEO2_NO + EO2_NO + MEKO2_NO + HOCH2OO_NO + jonitr', + 'O3_Loss = O1D_H2O + OH_O3 + HO2_O3 + H_O3 + C3H6_O3 + .9*ISOP_O3 + C2H4_O3 + .8*MVK_O3 + 0.8*MACR_O3 + MTERP_O3 + BCARY_O3', + 'RO2_NO_sum = NO_HO2 + CH3O2_NO + HOCH2OO_NO + EO2_NO + C2H5O2_NO + CH3CO3_NO + C3H7O2_NO + PO2_NO + RO2_NO + ENEO2_NO + ENEO2_NOb + MEKO2_NO + MACRO2_NOa + MACRO2_NOb +', + 'MCO3_NO + ISOPAO2_NO + ISOPBO2_NO + ALKO2_NO + ALKO2_NOb + XO2_NO + TOLO2_NO + PHENO2_NO + C6H5O2_NO + BENZO2_NO + MALO2_NO + BZOO_NO + ACBZO2_NO + DICARBO2_NO +', + 'MDIALO2_NO + XYLOLO2_NO + XYLENO2_NO + TERPO2_NO + TERP2O2_NO + NTERPO2_NO', + 'RO2_NO3_sum = NO3_HO2 + MACRO2_NO3 + MCO3_NO3 + ISOPAO2_NO3 + ISOPBO2_NO3 + XO2_NO3', + 'RO2_HO2_sum = CH3O2_HO2 + HOCH2OO_HO2 + EO2_HO2 + C2H5O2_HO2 + CH3CO3_HO2 + C3H7O2_HO2 + PO2_HO2 + RO2_HO2 + MEKO2_HO2 + MACRO2_HO2 + ISOPAO2_HO2 + ISOPBO2_HO2 + ALKO2_HO2 +', + 'XO2_HO2 + TOLO2_HO2 + PHENO2_HO2 + C6H5O2_HO2 + BENZO2_HO2 + MALO2_HO2 + BZOO_HO2 + ACBZO2_HO2 + DICARBO2_HO2 + MDIALO2_HO2 + XYLOLO2_HO2 + XYLENO2_HO2 + TERPO2_HO2 +', + 'TERP2O2_HO2 + NTERPO2_HO2', + 'RO2_RO2_sum = CH3O2_CH3O2a + CH3O2_CH3O2b + C2H5O2_CH3O2 + C2H5O2_C2H5O2 + CH3CO3_CH3O2 + CH3CO3_CH3CO3 + C3H7O2_CH3O2 + RO2_CH3O2 + MACRO2_CH3O2 + MACRO2_CH3CO3 + MCO3_CH3O2 +', + ' MCO3_CH3CO3 + MCO3_MCO3 + ISOPAO2_CH3O2 + ISOPBO2_CH3O2 + ISOPAO2_CH3CO3 + ISOPBO2_CH3CO3 + XO2_CH3O2 + XO2_CH3CO3', + 'RCO2_NO2_sum = CH3CO3_NO2 + MCO3_NO2', + 'OddOx_Ox_Loss = 2.0*O_O3 + O1D_H2O', + 'OddOx_HOx_Loss = HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3', + 'OddOx_NOx_Loss = 2.0*NO2_O + 2.0*jno3_b', + 'OddOx_CLOxBROx_Loss = 2.0*CLO_O + 2.0*jcl2o2 + 2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2', + 'OddOx_Loss_Tot = 2.0*O_O3 + O1D_H2O + HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3 + 2.0*NO2_O + 2.0*jno3_b + 2.0*CLO_O + 2.0*jcl2o2 + 2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb +', + ' 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2', + 'OddOx_Prod_Tot = 2.0*jo2_a + 2.0*jo2_b' + + + diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml new file mode 100644 index 0000000000..945e950b0a --- /dev/null +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml @@ -0,0 +1,292 @@ + + + + +19900101 + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc +'epp_ion_rates' + + +atm/waccm/ic/b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.001.cam.i.2015-01-01-00000.nc + + +SERIAL +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP370_0p5degLat_c180905.nc + + 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2', + 'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'SF6', 'CFC11eq' + + + +atm/waccm/ub/tgcm_ubc_1850-2100_c100204.nc +'INTERP_MISSING_MONTHS' + + +.true. +.true. +.true. +.false. + + + + +INTERP_MISSING_MONTHS + + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_NO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_ext_1deg_ZeroTrop_c181020.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' + + +INTERP_MISSING_MONTHS + + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_BENZENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_BENZENE_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_BIGALK_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_BIGALK_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_BIGENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_BIGENE_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C2H2_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C2H2_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C2H4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C2H5OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C2H5OH_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C2H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C2H6_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C3H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C3H6_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C3H8_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_C3H8_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH2O_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH2O_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3CHO_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3CHO_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3CN_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3CN_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3COCH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3COCH3_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3COCHO_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3COOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3COOH_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CH3OH_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CO_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_CO_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-SSP_CO_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_175001-210101_0.9x1.25_c20190224.nc', + 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_GLYALD_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_HCN_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_HCN_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_HCOOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_HCOOH_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_ISOP_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_IVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_IVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_MEK_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_MEK_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_MTERP_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_NH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_NH3_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_NO_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_NO_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-SSP_NO_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_TOLUENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_TOLUENE_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_XYLENES_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_XYLENES_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc' + + +'noy', 'nhx' + + + + 1, 5, 20, 40, 120, 240, 365, 73, 365 + 0, -24, -6, -3, -1, 1, -24,-120,-240 +'A', 'A', 'A', 'A', 'I', 'A', 'A', 'A', 'I' + +.true. +.false. +.false. +.false. +.false. +.false. +.true. +.true. +.true. + + 'AOA1SRC', 'AOA2SRC', 'NO2_CMXF' + + + 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2', + 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', + 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn', 'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF', + 'bc_a1SFWET', 'bc_a4', 'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF', + 'bc_c4SFWET', 'BENZENE', 'BENZO2', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALD', 'BIGALK', 'BIGENE', + 'BR', 'BRCL', 'BRO', 'BRONO2', 'BROX', 'BROY', 'BRY', 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', + 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', + 'BURDENSOAdn', 'BUTGWSPEC', 'BZALD', 'BZOO', 'BZOOH', 'C2H2', 'C2H4', 'C2H5O2', 'C2H5OH', 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7O2', + 'C3H7OOH', 'C3H8', 'C6H5O2', 'C6H5OOH', 'CCL4', 'CDNUMC', 'CF2CLBR', 'CF3BR', 'CFC113', 'CFC114', 'CFC115', 'CFC11', 'CFC11STAR', + 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CCL3_CHML', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3CO3', 'CH3COCH3', 'CH3COCHO', + 'CH3COOH', 'CH3COOOH', 'CH3O2', 'CH3OH', 'CH3OOH', 'CH4', 'CH4_CHML', 'CHBR3', 'CL2', 'CL2O2', 'CL', + 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', 'CLOX', 'CLOY', 'CLY', 'CME', 'CMFDQ', 'CMFMC', + 'CMFMCDZM', 'CO2', 'CO2_CHML', 'CO', 'CO_CHML', 'CO_CHMP', 'COF2', 'COFCL', 'CONCLD', 'CRESOL', + 'DCOCHM', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O', + 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH', + 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', + 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', + 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2', 'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', + 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', + 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH', 'DF_XYLENOOH', + 'DF_XYLOLOOH', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'DH2O2CHM', 'DHNO3CHM', 'DICARBO2', 'DMS', 'DO3CHM', 'dry_deposition_NHx_as_N', + 'dry_deposition_NOy_as_N', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'dst_a1', 'dst_a1DDF', 'dst_a1SFWET', 'dst_a2', 'dst_a2DDF', + 'dst_a2SFWET', 'dst_a3', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c1', 'dst_c1DDF', 'dst_c1SFWET', 'dst_c2', 'dst_c2DDF', 'dst_c2SFWET', + 'dst_c3', 'dst_c3DDF', 'dst_c3SFWET', 'DTCORE', 'E90', 'e', 'ENEO2', 'EO2', 'EO', 'EOOH', 'EVAPPREC', + 'EVAPQZM', 'EVAPTZM', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'F', 'FCTL', + 'FLASHFRQ', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FREQI', 'FREQL', 'FREQZM', 'FSDS', + 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'FSNTOAC', 'FSUTOA', 'GLYALD', 'GLYOXAL', + 'GS_SO2', 'H2402', 'H2', 'H2O2', 'H2O', 'H2SO4', 'H2SO4M_C', 'H2SO4_sfnnuc1', 'H', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', 'HCL', + 'HCL_GAS', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS', 'HO2', 'HO2NO2', 'HOBR', 'HOCH2OO', 'HOCL', 'HONITR', + 'HPALD', 'HYAC', 'HYDRALD', 'ICEFRAC', 'IEPOX', 'ISOP', 'ISOPAO2', 'ISOPBO2', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3', + 'ISOPNOOH', 'ISOPOOH', 'IVOC', 'IVOC_CHML', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan', 'KVH_CLUBB', + 'LANDFRAC', 'LHFLX', 'LNO_COL_PROD', 'LNO_PROD', 'MACR', 'MACRO2', 'MACROOH', 'MALO2', 'MASS', 'MCO3', 'MDIALO2', + 'MEG_BCARY', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_C2H4', 'MEG_C2H5OH', 'MEG_C2H6', 'MEG_C3H6', 'MEG_C3H8', 'MEG_CH2O', + 'MEG_CH3CHO', 'MEG_CH3COCH3', 'MEG_CH3COOH', 'MEG_CH3OH', 'MEG_CO', 'MEG_HCN', 'MEG_HCOOH', 'MEG_ISOP', 'MEG_MTERP', 'MEG_TOLUENE', + 'MEK', 'MEKO2', 'MEKOOH', 'MPAN', 'MTERP', 'MVK', 'N2D', 'N2O5', 'N2O', 'N2O_CHML', 'N2p', 'N', 'NC4CH2OH', + 'NC4CHO', 'ncl_a1', 'ncl_a1DDF', 'ncl_a1SFWET', 'ncl_a2', 'ncl_a2DDF', 'ncl_a2SFWET', 'ncl_a3', 'ncl_a3DDF', 'ncl_a3SFWET', 'ncl_c1', + 'ncl_c1DDF', 'ncl_c1SFWET', 'ncl_c2', 'ncl_c2DDF', 'ncl_c2SFWET', 'ncl_c3', 'ncl_c3DDF', 'ncl_c3SFWET', 'NDEP', 'NH3', 'NH4', 'NH_50', + 'NH_5', 'NHDEP', 'NITROP_PD', 'NO2', 'NO2_CLXF', 'NO3', 'NO', 'NOA', 'NOp', 'NOX', 'NOY', 'Np', 'NTERPO2', 'NTERPOOH', + 'num_a1', 'num_a1_CLXF', 'num_a1DDF', 'num_a2', 'num_a2_CLXF', 'num_a2DDF', 'num_a2_sfnnuc1', 'num_a3', 'num_a3DDF', 'num_a4', + 'num_a4DDF', 'num_c1', 'num_c1DDF', 'num_c2', 'num_c2DDF', 'num_c3', 'num_c3DDF', 'num_c4', 'num_c4DDF', 'NUMLIQ', 'O1D', 'O2_1D', + 'O2_1S', 'O2', 'O2p', 'O3', 'O3_CHML', 'O3_CHMP', 'O3_Loss', 'O3_Prod', 'O', 'OCLO', 'OCS', 'OddOx_CLOxBROx_Loss', + 'OddOx_HOx_Loss', 'OddOx_Loss_Tot', 'OddOx_NOx_Loss', 'OddOx_Ox_Loss', 'OddOx_Prod_Tot', 'OH', 'OMEGA', 'OMEGAT', 'ONITR', 'Op', + 'PAN', 'PBLH', 'PBZNIT', 'PDELDRY', 'PHENO2', 'PHENO', 'PHENOL', 'PHENOOH', 'PHIS', 'PM25', 'PO2', 'pom_a1', 'pom_a1DDF', 'pom_a1SFWET', + 'pom_a4', 'pom_a4DDF', 'pom_a4SFWET', 'pom_c1', 'pom_c1DDF', 'pom_c1SFWET', 'pom_c4', 'pom_c4DDF', 'pom_c4SFWET', + 'POOH', 'PRECC', 'PRECT', 'PS', 'PSL', 'PTEQ', 'PTTEND', 'Q', 'QFLX', 'QRAIN', 'QREFHT', 'QRL', 'QRLC', 'QRS', + 'QRSC', 'QSNOW', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RELHUM', 'r_GLYOXAL_aer', + 'r_het10', 'r_het11', 'r_het12', 'r_het13', 'r_het15', 'r_het16', 'r_het17', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', + 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_HO2_O3', 'RHREFHT', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', + 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1', 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', + 'r_OH_O3', 'r_OH_O', 'ROOH', 'RO2', 'RO2_NO_sum', 'RO2_NO3_sum', 'RO2_HO2_sum', 'RO2_RO2_sum', 'RCO2_NO2_sum', + 'S', 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SF6', 'SFbc_a4', 'SFBCARY', + 'SFBENZENE', 'SFBIGALK', 'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO', 'SFCH3CN', + 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH', + 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2', + 'SFnum_a3', 'SFpom_a4', 'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2', + 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1', 'so4_a1SFWET', + 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3', + 'so4_a3DDF', 'so4_a3_sfgaex1', 'so4_a3SFWET', 'so4_c1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_c1SFWET', 'so4_c2', 'so4_c2AQH2SO4', + 'so4_c2AQSO4', 'so4_c2DDF', 'so4_c2SFWET', 'so4_c3', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_c3SFWET', 'SO', 'soa1_a1', + 'soa1_a1_CHML', 'soa1_a1DDF', 'soa1_a1_sfgaex1', 'soa1_a1SFWET', 'soa1_a2', 'soa1_a2_CHML', 'soa1_a2DDF', + 'soa1_a2_sfgaex1', 'soa1_a2SFWET', 'soa1_c1', 'soa1_c1DDF', 'soa1_c1SFWET', 'soa1_c2', 'soa1_c2DDF', 'soa1_c2SFWET', 'soa2_a1', 'soa2_a1_CHML', + 'soa2_a1DDF', 'soa2_a1_sfgaex1', 'soa2_a1SFWET', 'soa2_a2', 'soa2_a2_CHML', 'soa2_a2DDF', 'soa2_a2_sfgaex1', + 'soa2_a2SFWET', 'soa2_c1', 'soa2_c1DDF', 'soa2_c1SFWET', 'soa2_c2', 'soa2_c2DDF', 'soa2_c2SFWET', 'soa3_a1', 'soa3_a1_CHML', + 'soa3_a1DDF', 'soa3_a1_sfgaex1', 'soa3_a1SFWET', 'soa3_a2', 'soa3_a2_CHML', 'soa3_a2DDF', 'soa3_a2_sfgaex1', 'soa3_a2SFWET', + 'soa3_c1', 'soa3_c1DDF', 'soa3_c1SFWET', 'soa3_c2', 'soa3_c2DDF', 'soa3_c2SFWET', 'soa4_a1', 'soa4_a1_CHML', 'soa4_a1DDF', + 'soa4_a1_sfgaex1', 'soa4_a1SFWET', 'soa4_a2', 'soa4_a2_CHML', 'soa4_a2DDF', 'soa4_a2_sfgaex1', 'soa4_a2SFWET', 'soa4_c1', + 'soa4_c1DDF', 'soa4_c1SFWET', 'soa4_c2', 'soa4_c2DDF', 'soa4_c2SFWET', 'soa5_a1', 'soa5_a1_CHML', 'soa5_a1DDF', 'soa5_a1_sfgaex1', + 'soa5_a1SFWET', 'soa5_a2', 'soa5_a2_CHML', 'soa5_a2DDF', 'soa5_a2_sfgaex1', 'soa5_a2SFWET', 'soa5_c1', 'soa5_c1DDF', + 'soa5_c1SFWET', 'soa5_c2', 'soa5_c2DDF', 'soa5_c2SFWET', 'SOAG0', 'SOAG0_CHMP', 'SOAG1', 'SOAG1_CHMP', 'SOAG2', 'SOAG2_CHMP', + 'SOAG3', 'SOAG3_CHMP', 'SOAG4', 'SOAG4_CHMP', 'SOLIN', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST', 'ST80_25', 'SVOC', 'SVOC_CHML', + 'T', 'TAQ', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TBRY', 'TCLY', 'TEPOMUC', 'TERP2O2', 'TERP2OOH', + 'TERPNIT', 'TERPO2', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TGCLDIWP', 'TGCLDLWP', 'THzm', 'TMDMS', 'TMOCS', 'TMQ', 'TMSO2', + 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'TOLO2', 'TOLOOH', 'TOLUENE', 'TOT_CLD_VISTAU', 'TOTH', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TROP_P', + 'TROP_T', 'TROP_Z', 'TS', 'TSMN:M', 'TSMX:X', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO', 'TTGWSPEC', + 'U10', 'U', 'UTGWORO', 'UTGWSPEC', 'UU', 'UVzm', 'UWzm', 'Uzm', 'V', 'VD01', 'VEL_NAT2', 'VTHzm', 'VV', 'Vzm', 'WD_ALKNIT', 'WD_ALKOOH', 'WD_BENZOOH', 'WD_BRONO2', + 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO', 'WD_CH3CN', 'WD_CH3COCH3', 'WD_CH3COCHO', + 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL', 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', + 'WD_HBR', 'WD_HCL', 'WD_HCN', 'WD_HCOOH', 'WD_HF', 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD', 'WD_HYAC', + 'WD_HYDRALD', 'WD_IEPOX', 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC', 'WD_MACR', 'WD_MACROOH', + 'WD_MEKOOH', 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP', 'WD_NOA', 'WD_NTERPOOH', + 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', + 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1', 'WD_TERPROD2', 'WD_TOLOOH', 'WD_XOOH', 'WD_XYLENOOH', 'WD_XYLOLOOH', + 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N', 'Wzm', 'XO2', 'XOOH', 'XYLENES', 'XYLENO2', 'XYLENOOH', 'XYLOL', 'XYLOLO2', + 'XYLOLOOH', 'Z3', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU' + + + + 'ACTNL', 'ACTREL', 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn', 'BUTGWSPEC', + 'CDNUMC', 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLOUD', 'CMFMC', 'CMFMCDZM', 'FCTL', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', + 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FSDS', 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNTOA', 'FSNTOAC', 'LHFLX', 'MASS', 'O3', 'OMEGA', + 'OMEGA500', 'PBLH', 'PDELDRY', 'PM25_SRF', 'PRECC', 'PRECT', 'PS', 'PSL', 'Q', 'QREFHT', 'QSNOW', 'RELHUM', 'RHREFHT', 'SHFLX', + 'SOLIN', 'SOLLD', 'SOLSD', 'T', 'T500', 'T700', 'T850', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', + 'TGCLDIWP', 'TGCLDLWP', 'TMQ', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TS', 'TSMN:M', 'TSMX:X', 'U', 'U10', 'UTGWORO', 'UTGWSPEC', + 'V', 'Z3', 'Z500' + + + 'O3_SRF','TS','PM25_SRF','NO2_SRF' + + + 'MSKtem','PS','PSL','VTHzm','UVzm','UWzm','Uzm','Vzm','THzm','Wzm','PHIS' + + + 'PS', 'PSL', 'U', 'V', 'T', 'Z3', 'PHIS', 'FRONTGF:I', 'OMEGA', 'O3', 'REFF_AERO', 'SAD_AERO', + 'so4_a1', 'so4_a2', 'so4_a3', 'AODVISstdn', 'NITROP_PD', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'QRS_TOT', 'CO2', 'H', 'NO', 'O' + + + + 'O3_Prod = NO_HO2 + CH3O2_NO + PO2_NO + CH3CO3_NO + C2H5O2_NO + .92*ISOPAO2_NO + .92*ISOPBO2_NO + MACRO2_NOa + MCO3_NO + C3H7O2_NO + RO2_NO + XO2_NO + .9*TOLO2_NO +', + '.9*PHENO2_NO + .9*C6H5O2_NO + .9*BENZO2_NO + .9*MALO2_NO + .9*BZOO_NO + .9*ACBZO2_NO + .9*DICARBO2_NO + .9*MDIALO2_NO + .9*XYLOLO2_NO + .9*XYLENO2_NO + TERPO2_NO +', + 'TERP2O2_NO + NTERPO2_NO + ALKO2_NO + ENEO2_NO + EO2_NO + MEKO2_NO + HOCH2OO_NO + jonitr', + 'O3_Loss = O1D_H2O + OH_O3 + HO2_O3 + H_O3 + C3H6_O3 + .9*ISOP_O3 + C2H4_O3 + .8*MVK_O3 + 0.8*MACR_O3 + MTERP_O3 + BCARY_O3', + 'RO2_NO_sum = NO_HO2 + CH3O2_NO + HOCH2OO_NO + EO2_NO + C2H5O2_NO + CH3CO3_NO + C3H7O2_NO + PO2_NO + RO2_NO + ENEO2_NO + ENEO2_NOb + MEKO2_NO + MACRO2_NOa + MACRO2_NOb +', + 'MCO3_NO + ISOPAO2_NO + ISOPBO2_NO + ALKO2_NO + ALKO2_NOb + XO2_NO + TOLO2_NO + PHENO2_NO + C6H5O2_NO + BENZO2_NO + MALO2_NO + BZOO_NO + ACBZO2_NO + DICARBO2_NO +', + 'MDIALO2_NO + XYLOLO2_NO + XYLENO2_NO + TERPO2_NO + TERP2O2_NO + NTERPO2_NO', + 'RO2_NO3_sum = NO3_HO2 + MACRO2_NO3 + MCO3_NO3 + ISOPAO2_NO3 + ISOPBO2_NO3 + XO2_NO3', + 'RO2_HO2_sum = CH3O2_HO2 + HOCH2OO_HO2 + EO2_HO2 + C2H5O2_HO2 + CH3CO3_HO2 + C3H7O2_HO2 + PO2_HO2 + RO2_HO2 + MEKO2_HO2 + MACRO2_HO2 + ISOPAO2_HO2 + ISOPBO2_HO2 + ALKO2_HO2 +', + 'XO2_HO2 + TOLO2_HO2 + PHENO2_HO2 + C6H5O2_HO2 + BENZO2_HO2 + MALO2_HO2 + BZOO_HO2 + ACBZO2_HO2 + DICARBO2_HO2 + MDIALO2_HO2 + XYLOLO2_HO2 + XYLENO2_HO2 + TERPO2_HO2 +', + 'TERP2O2_HO2 + NTERPO2_HO2', + 'RO2_RO2_sum = CH3O2_CH3O2a + CH3O2_CH3O2b + C2H5O2_CH3O2 + C2H5O2_C2H5O2 + CH3CO3_CH3O2 + CH3CO3_CH3CO3 + C3H7O2_CH3O2 + RO2_CH3O2 + MACRO2_CH3O2 + MACRO2_CH3CO3 + MCO3_CH3O2 +', + ' MCO3_CH3CO3 + MCO3_MCO3 + ISOPAO2_CH3O2 + ISOPBO2_CH3O2 + ISOPAO2_CH3CO3 + ISOPBO2_CH3CO3 + XO2_CH3O2 + XO2_CH3CO3', + 'RCO2_NO2_sum = CH3CO3_NO2 + MCO3_NO2', + 'OddOx_Ox_Loss = 2.0*O_O3 + O1D_H2O', + 'OddOx_HOx_Loss = HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3', + 'OddOx_NOx_Loss = 2.0*NO2_O + 2.0*jno3_b', + 'OddOx_CLOxBROx_Loss = 2.0*CLO_O + 2.0*jcl2o2 + 2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2', + 'OddOx_Loss_Tot = 2.0*O_O3 + O1D_H2O + HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3 + 2.0*NO2_O + 2.0*jno3_b + 2.0*CLO_O + 2.0*jcl2o2 + 2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb +', + ' 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2', + 'OddOx_Prod_Tot = 2.0*jo2_a + 2.0*jo2_b' + + + diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml index fffb9d54f9..f660208b57 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml @@ -40,102 +40,102 @@ INTERP_MISSING_MONTHS - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_ext_1deg_ZeroTrop_c181020.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' INTERP_MISSING_MONTHS - 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BENZENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BENZENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGALK_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGALK_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H2_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H2_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H5OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H5OH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H6_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H6_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H8_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H8_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH2O_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH2O_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CHO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CHO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CN_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CN_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COCH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COCH3_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COCHO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COOH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3OH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_CO_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_1750-2100_0.9x1.25_c20170322.nc', - 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_GLYALD_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCN_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCN_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCOOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCOOH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_ISOP_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_IVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_IVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_MEK_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_MEK_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_MTERP_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NH3_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_NO_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_TOLUENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_TOLUENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_XYLENES_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_XYLENES_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_DMS_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_anthro-ene_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc' + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BENZENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BENZENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGALK_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGALK_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_BIGENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H2_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H2_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H5OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H5OH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C2H6_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H6_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H8_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_C3H8_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH2O_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH2O_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CHO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CHO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CN_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3CN_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COCH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COCH3_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COCHO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3COOH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CH3OH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_CO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_CO_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_175001-210101_0.9x1.25_c20190224.nc', + 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_GLYALD_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCN_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCN_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCOOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_HCOOH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_ISOP_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_IVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_IVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_MEK_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_MEK_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_MTERP_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NH3_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_NO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_NO_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_TOLUENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_TOLUENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_XYLENES_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_XYLENES_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp534_over/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp534-over-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc' 'noy', 'nhx' diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml index 9e6df49780..ec68bdbf4b 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml @@ -40,102 +40,102 @@ INTERP_MISSING_MONTHS - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_aircraft_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_ext_1deg_ZeroTrop_c181020.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180831.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' INTERP_MISSING_MONTHS - 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BENZENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BENZENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGALK_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGALK_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H2_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H2_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H5OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H5OH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H6_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H6_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H6_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H8_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H8_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH2O_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH2O_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CHO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CHO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CN_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CN_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCH3_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCHO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COOH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3OH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3OH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_CO_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_1750-2100_0.9x1.25_c20170322.nc', - 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_GLYALD_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCN_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCN_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCOOH_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCOOH_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_ISOP_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_IVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_IVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MEK_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MEK_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MTERP_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NH3_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NH3_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_NO_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SVOC_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SVOC_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_TOLUENE_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_TOLUENE_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_XYLENES_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_XYLENES_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_DMS_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ene_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180831.nc', - 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180831.nc' + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BENZENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BENZENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGALK_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGALK_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H2_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H2_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H5OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H5OH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H6_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H6_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H8_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H8_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH2O_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH2O_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CHO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CHO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CN_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CN_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCH3_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCHO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COOH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3OH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_CO_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_175001-210101_0.9x1.25_c20190224.nc', + 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_GLYALD_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCN_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCN_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCOOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCOOH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_ISOP_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_IVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_IVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MEK_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MEK_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MTERP_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NH3_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_NO_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_TOLUENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_TOLUENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_XYLENES_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_XYLENES_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc' 'noy', 'nhx' diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 04d09ddfc0..20c6617052 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -228,9 +228,11 @@ 1850-PD_cam5 - waccm_tsmlt_ssp585_cam6 - waccm_tsmlt_ssp534_cam6 waccm_tsmlt_ssp126_cam6 + waccm_tsmlt_ssp245_cam6 + waccm_tsmlt_ssp370_cam6 + waccm_tsmlt_ssp534_cam6 + waccm_tsmlt_ssp585_cam6 2005-2100_cam4_rcp26 2005-2100_cam4_rcp45 2005-2100_cam4_rcp45_bgc diff --git a/doc/ChangeLog b/doc/ChangeLog index 82187f62ae..8e5d351c58 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,59 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_14 +Originator(s): mmills, fvitt +Date: 28 Feb 2019 +One-line Summary: Updates to WACCM CMIP6 future scenario compsets + +Purpose of changes: + +Add use case files for CMIP6 future scenario compsets: + BWSSP245cmip6 (SSP2-4.5) + BWSSP370cmip6 (SSP3-7.0) + +Adjust emissions datasets to be able to run through the end of 2100 +in future scenario compsets: + BWSSP126cmip6 (SSP1-2.6) + BWSSP534oscmip6 (SSP5-3.4) + BWSSP585cmip6 (SSP5-8.5) + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: cacraig + +List all files eliminated: + +List all files added and what they do: + +A components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml +A components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp245_cam6.xml + +List all existing files that have been modified, and describe the changes: + +M components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml +M components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp126_cam6.xml +M components/cam/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml +M components/cam/cime_config/config_component.xml +M components/cam/doc/ChangeLog + +Test on cheyenne: + + SMS_D_Ln9.f09_g17.BWSSP126cmip6.cheyenne_intel.allactive-defaultio_min + SMS_D_Ln9.f09_g17.BWSSP245cmip6.cheyenne_intel.allactive-defaultio_min + SMS_D_Ln9.f09_g17.BWSSP370cmip6.cheyenne_intel.allactive-defaultio_min + SMS_D_Ln9.f09_g17.BWSSP534oscmip6.cheyenne_intel.allactive-defaultio_min + SMS_D_Ln9.f09_g17.BWSSP585cmip6.cheyenne_intel.allactive-defaultio_min + +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_13 Originator(s): klindsay, eaton Date: Wed Feb 27 16:47:14 MST 2019 From 728b02b4b09f2613d8815e635f830338f0dfaad1 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 5 Mar 2019 12:51:17 -0700 Subject: [PATCH 017/239] 'Add the CAM hooks for SSP585 Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90679 Committed by Cheryl Craig at 2019-03-05 12:51:17 -0700 Original svn commit message: Add the CAM hooks for SSP585' --- bld/namelist_files/use_cases/ssp585_cam6.xml | 93 ++++++++++++++++++++ cime_config/config_component.xml | 2 + doc/ChangeLog | 39 ++++++++ 3 files changed, 134 insertions(+) create mode 100644 bld/namelist_files/use_cases/ssp585_cam6.xml diff --git a/bld/namelist_files/use_cases/ssp585_cam6.xml b/bld/namelist_files/use_cases/ssp585_cam6.xml new file mode 100644 index 0000000000..f122b3bfdb --- /dev/null +++ b/bld/namelist_files/use_cases/ssp585_cam6.xml @@ -0,0 +1,93 @@ + + + + + + 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2OemissionCH4oxidationx2_3D_L70_2014-2101_CMIP6-SSP5-8.5_c190221.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' + + + + + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SOAGx1.5_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SOAGx1.5_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SOAGx1.5_biogenic_surface_mol_175001-210101_0.9x1.25_c20190226.nc' + + + + + atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + + 'atm/cam/tracer_cnst' + 'tracer_cnst_halons_3D_L70_2014-2101_CMIP6-SSP5-8.5_c190221.nc' + 'O3','OH','NO3','HO2' + 'INTERP_MISSING_MONTHS' + '' + + + 'atm/cam/ozone_strataero' + 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP585_c190221.nc' + 'O3' + 'SERIAL' + + + INTERP_MISSING_MONTHS + INTERP_MISSING_MONTHS + + + 'SERIAL' + 'atm/cam/ozone_strataero' + 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP585_c190221.nc' + .true. + + +.true. +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585_201401-210112_fv_0.9x1.25_c20190207.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585_201401-210112_fv_1.9x2.5_c20190207.nc + + +.true. +SERIAL +atm/cam/ggas +ac_CO2 -> emissions-cmip6_CO2_anthro_ac_MAGPIE-ssp585_201401-210112_fv_0.9x1.25_c20190207.txt +atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585_201401-210112_fv_0.9x1.25_c20190207.nc +ac_CO2 -> emissions-cmip6_CO2_anthro_ac_MAGPIE-ssp585_201401-210112_fv_1.9x2.5_c20190207.txt +emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585_201401-210112_fv_1.9x2.5_c20190207.nc + + 'CHEM_LBC_FILE' + atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SOAGx1.5_biogenic_surface_mol_175001-210101_0.9x1.25_c20190226.nc + 'SERIAL' + 'CO2','CH4','N2O','CFC11eq','CFC12' + + + + 1850-2100 + + + diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 20c6617052..02556d5c18 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -228,6 +228,8 @@ 1850-PD_cam5 + ssp585_cam6 + waccm_tsmlt_ssp126_cam6 waccm_tsmlt_ssp245_cam6 waccm_tsmlt_ssp370_cam6 diff --git a/doc/ChangeLog b/doc/ChangeLog index 8e5d351c58..e6d97cf600 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,44 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_15 +Originator(s): hannay, cacraig +Date: March 5, 2019 +One-line Summary: Add the CAM hooks for SSP585 + +Purpose of changes: + +Add use case files for CMIP6 future scenario compset: SSP585 + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: cacraig + +List all files eliminated: + +List all files added and what they do: +A components/cam/bld/namelist_files/use_cases/ssp585_cam6.xml + - CAM setup for SSP585 - based off documentation provided by Cecile + +List all existing files that have been modified, and describe the changes: +M components/cam/cime_config/config_component.xml + - add use_case information for SSP585 + +This tag is untested as it will be tested in the CESM BSSP585 compset + - any tweeks will be made in a future tag + +Did run case.setup/preview_namelist/check_input_data on cheyenne to verify the setup + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_14 Originator(s): mmills, fvitt Date: 28 Feb 2019 From 1402359933685c7cedecb0d51f8a0856a43dcb31 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Wed, 6 Mar 2019 10:22:52 -0700 Subject: [PATCH 018/239] 'Change compset match string for WACCM SSP compsets Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90684 Committed by Francis Vitt at 2019-03-06 10:22:52 -0700 Original svn commit message: Change compset match string for WACCM SSP compsets' --- .../use_cases/waccm_tsmlt_ssp370_cam6.xml | 2 + .../use_cases/waccm_tsmlt_ssp534_cam6.xml | 2 + .../use_cases/waccm_tsmlt_ssp585_cam6.xml | 2 + cime_config/config_component.xml | 13 +++-- doc/ChangeLog | 50 +++++++++++++++++++ 5 files changed, 62 insertions(+), 7 deletions(-) diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml index 945e950b0a..150a7e2c15 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml @@ -289,4 +289,6 @@ 'OddOx_Prod_Tot = 2.0*jo2_a + 2.0*jo2_b' +.true. + diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml index f660208b57..9e03ccf5ec 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml @@ -289,4 +289,6 @@ 'OddOx_Prod_Tot = 2.0*jo2_a + 2.0*jo2_b' +.true. + diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml index ec68bdbf4b..ea9b6c3dae 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml @@ -289,4 +289,6 @@ 'OddOx_Prod_Tot = 2.0*jo2_a + 2.0*jo2_b' +.true. + diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 02556d5c18..1373748dc8 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -228,13 +228,12 @@ 1850-PD_cam5 - ssp585_cam6 - - waccm_tsmlt_ssp126_cam6 - waccm_tsmlt_ssp245_cam6 - waccm_tsmlt_ssp370_cam6 - waccm_tsmlt_ssp534_cam6 - waccm_tsmlt_ssp585_cam6 + ssp585_cam6 + waccm_tsmlt_ssp126_cam6 + waccm_tsmlt_ssp245_cam6 + waccm_tsmlt_ssp370_cam6 + waccm_tsmlt_ssp534_cam6 + waccm_tsmlt_ssp585_cam6 2005-2100_cam4_rcp26 2005-2100_cam4_rcp45 2005-2100_cam4_rcp45_bgc diff --git a/doc/ChangeLog b/doc/ChangeLog index e6d97cf600..3e05c36566 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,55 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_16 +Originator(s): fvitt +Date: 6 Mar 2019 +One-line Summary: Change compset match string for WACCM SSP compsets + +Purpose of changes: + + The long name of the SSP compsets will no longer include "-" and "." characters. + The compset string match in cime_config/config_component.xml was adjusted + accordingly. + + Some of the future scenarios have CO2 concentrations that exceed the + levels the formichev scheme can handle. So we set nlte_limit_co2=.true. in + these SSP compsets to limit the CO2 concentrations input into formichev. + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: +M cime_config/config_component.xml + - Change compset match string for SSP compsets + +M bld/namelist_files/use_cases/waccm_tsmlt_ssp370_cam6.xml +M bld/namelist_files/use_cases/waccm_tsmlt_ssp534_cam6.xml +M bld/namelist_files/use_cases/waccm_tsmlt_ssp585_cam6.xml + - set nlte_limit_co2=.true. since CO2 concentrations in these scenarios + execeeds the formichev scheme limit + +Tests + SMS_D_Ln9.f09_g17.BWSSP126cmip6.cheyenne_intel.allactive-default + SMS_D_Ln9.f09_g17.BWSSP245cmip6.cheyenne_intel.allactive-default + SMS_D_Ln9.f09_g17.BWSSP370cmip6.cheyenne_intel.allactive-default + SMS_D_Ln9.f09_g17.BWSSP534oscmip6.cheyenne_intel.allactive-default + SMS_D_Ln9.f09_g17.BWSSP585cmip6.cheyenne_intel.allactive-default + +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_15 Originator(s): hannay, cacraig Date: March 5, 2019 From b4e714561787ac7558d0cbffb6b4453856ef325c Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 7 Mar 2019 17:04:19 -0700 Subject: [PATCH 019/239] 'Update files in SSP585 use_case Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90695 Committed by Cheryl Craig at 2019-03-07 17:04:19 -0700 Original svn commit message: Update files in SSP585 use_case' --- Externals.cfg | 2 +- bld/namelist_files/use_cases/ssp585_cam6.xml | 6 ++-- doc/ChangeLog | 37 ++++++++++++++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index ae55b59381..d23a6b889e 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -9,7 +9,7 @@ required = True local_path = components/cice [cime] -tag = cime_cesm2_0_rel_06 +tag = cime5.6.12 protocol = git repo_url = https://github.com/ESMCI/cime required = True diff --git a/bld/namelist_files/use_cases/ssp585_cam6.xml b/bld/namelist_files/use_cases/ssp585_cam6.xml index f122b3bfdb..a9f4e19116 100644 --- a/bld/namelist_files/use_cases/ssp585_cam6.xml +++ b/bld/namelist_files/use_cases/ssp585_cam6.xml @@ -3,7 +3,7 @@ - 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2OemissionCH4oxidationx2_3D_L70_2014-2101_CMIP6-SSP5-8.5_c190221.nc', + 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2OemissionCH4oxidationx2_3D_L70_2014-2101_CMIP6-SSP5-8.5_c190307.nc', 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc', 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', @@ -45,7 +45,7 @@ 'atm/cam/tracer_cnst' - 'tracer_cnst_halons_3D_L70_2014-2101_CMIP6-SSP5-8.5_c190221.nc' + 'tracer_cnst_halons_3D_L70_2014-2101_CMIP6-SSP5-8.5_c190307.nc' 'O3','OH','NO3','HO2' 'INTERP_MISSING_MONTHS' '' @@ -81,7 +81,7 @@ emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585_201401-210112_fv_1.9x2.5_c20190207.nc 'CHEM_LBC_FILE' - atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SOAGx1.5_biogenic_surface_mol_175001-210101_0.9x1.25_c20190226.nc + atm/waccm/lb/LBC_2014-2500_CMIP6_SSP585_0p5degLat_GlobAnnAvg_c190301.nc 'SERIAL' 'CO2','CH4','N2O','CFC11eq','CFC12' diff --git a/doc/ChangeLog b/doc/ChangeLog index 3e05c36566..9e33ecb9be 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,42 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_17 +Originator(s): mmills, cacraig +Date: March 7, 2019 +One-line Summary: Update files in SSP585 use_case + +Purpose of changes: +- Correct files in the SSP585 compset + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: +M Externals.cfg + - update cime to bring in the new cheyenne settings + +M bld/namelist_files/use_cases/ssp585_cam6.xml + - update three files in the SSP585 use_case + +Tested by running the BSSP585cmip6 compset in a copy of Erik's sandbox +Tested by running SSP585_CAM60_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV in the CAM standlone tag + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_16 Originator(s): fvitt Date: 6 Mar 2019 From dded6b82e4c8aff8b688bcf1cfcf4d4121452ea2 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Fri, 15 Mar 2019 17:53:13 -0600 Subject: [PATCH 020/239] 'add mixing_ratio attribute to restart file Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90763 Committed by Brian Eaton at 2019-03-15 17:53:13 -0600 Original svn commit message: add mixing_ratio attribute to restart file' --- doc/ChangeLog | 46 ++++++++++++ src/control/cam_history.F90 | 108 ++++++++++++++++++++++++++-- src/control/cam_history_support.F90 | 2 +- 3 files changed, 149 insertions(+), 7 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 9e33ecb9be..1e0d3e0a66 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,51 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_18 +Originator(s): klindsay, eaton +Date: Fri Mar 15 17:33:15 MDT 2019 +One-line Summary: add mixing_ratio attribute to restart file + +Purpose of changes: + +. The mixing_ratio attribute was not being written to the restart file, and + consequently history files written after a restart had a null string + value which is interpreted by the code as 'wet' + +. Added some fldlst checks for future use by SE (zonal fields and missing + vector components). + +Bugs fixed (include bugzilla ID): see above + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: +components/cam/src/control/cam_history.F90 +. add mixing_ratio attribute to restart file + +components/cam/src/control/cam_history_support.F90 +. change mixing_ratio component of field_info type to be the same size as + long_name and units. + +Testing: did CAM standalone restart test to make sure files written after a +restart contained the correct values for the mixing_ratio attribute. + +Summarize any changes to answers: none + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_17 Originator(s): mmills, cacraig Date: March 7, 2019 diff --git a/src/control/cam_history.F90 b/src/control/cam_history.F90 index b95a9f39d2..f38a3033b8 100644 --- a/src/control/cam_history.F90 +++ b/src/control/cam_history.F90 @@ -108,7 +108,7 @@ module cam_history ! ! The size of these parameters should match the assignments in restart_vars_setnames and restart_dims_setnames below ! - integer, parameter :: restartvarcnt = 38 + integer, parameter :: restartvarcnt = 39 integer, parameter :: restartdimcnt = 10 type(rvar_id) :: restartvars(restartvarcnt) type(rdim_id) :: restartdims(restartdimcnt) @@ -1102,6 +1102,14 @@ subroutine restart_vars_setnames() restartvars(rvindex)%dims(2) = maxnflds_dim_ind restartvars(rvindex)%dims(3) = ptapes_dim_ind + rvindex = rvindex + 1 + restartvars(rvindex)%name = 'mixing_ratio' + restartvars(rvindex)%type = pio_char + restartvars(rvindex)%ndims = 3 + restartvars(rvindex)%dims(1) = max_chars_dim_ind + restartvars(rvindex)%dims(2) = maxnflds_dim_ind + restartvars(rvindex)%dims(3) = ptapes_dim_ind + rvindex = rvindex + 1 restartvars(rvindex)%name = 'xyfill' restartvars(rvindex)%type = pio_int @@ -1330,6 +1338,7 @@ subroutine write_restart_history ( File, & type(var_desc_t), pointer :: cm_desc type(var_desc_t), pointer :: longname_desc type(var_desc_t), pointer :: units_desc + type(var_desc_t), pointer :: mr_desc type(var_desc_t), pointer :: hwrt_prec_desc type(var_desc_t), pointer :: xyfill_desc type(var_desc_t), pointer :: mdims_desc ! mdim name indices @@ -1449,6 +1458,7 @@ subroutine write_restart_history ( File, & cm_desc => restartvar_getdesc('cell_methods') longname_desc => restartvar_getdesc('long_name') units_desc => restartvar_getdesc('units') + mr_desc => restartvar_getdesc('mixing_ratio') avgflag_desc => restartvar_getdesc('avgflag') xyfill_desc => restartvar_getdesc('xyfill') issubcol_desc => restartvar_getdesc('is_subcol') @@ -1488,6 +1498,7 @@ subroutine write_restart_history ( File, & ierr = pio_put_var(File, cm_desc,startc,tape(t)%hlist(f)%field%cell_methods) ierr = pio_put_var(File, longname_desc,startc,tape(t)%hlist(f)%field%long_name) ierr = pio_put_var(File, units_desc,startc,tape(t)%hlist(f)%field%units) + ierr = pio_put_var(File, mr_desc,startc,tape(t)%hlist(f)%field%mixing_ratio) ierr = pio_put_var(File, avgflag_desc,start, tape(t)%hlist(f)%avgflag) ierr = pio_put_var(File, fillval_desc,start, tape(t)%hlist(f)%field%fillvalue) @@ -1593,6 +1604,7 @@ subroutine read_restart_history (File) type(var_desc_t) :: vdesc type(var_desc_t) :: longname_desc type(var_desc_t) :: units_desc + type(var_desc_t) :: mr_desc type(var_desc_t) :: avgflag_desc type(var_desc_t) :: sseq_desc type(var_desc_t) :: cm_desc @@ -1782,6 +1794,7 @@ subroutine read_restart_history (File) ierr = pio_inq_varid(File, 'long_name', longname_desc) ierr = pio_inq_varid(File, 'units', units_desc) + ierr = pio_inq_varid(File, 'mixing_ratio', mr_desc) ierr = pio_inq_varid(File, 'sampling_seq', sseq_desc) ierr = pio_inq_varid(File, 'cell_methods', cm_desc) @@ -1816,6 +1829,7 @@ subroutine read_restart_history (File) ierr = pio_get_var(File,avgflag_desc, (/f,t/), tape(t)%hlist(f)%avgflag) ierr = pio_get_var(File,longname_desc, (/1,f,t/), tape(t)%hlist(f)%field%long_name) ierr = pio_get_var(File,units_desc, (/1,f,t/), tape(t)%hlist(f)%field%units) + ierr = pio_get_var(File,mr_desc, (/1,f,t/), tape(t)%hlist(f)%field%mixing_ratio) tape(t)%hlist(f)%field%sampling_seq(1:max_chars) = ' ' ierr = pio_get_var(File,sseq_desc, (/1,f,t/), tape(t)%hlist(f)%field%sampling_seq) call strip_null(tape(t)%hlist(f)%field%sampling_seq) @@ -2184,7 +2198,8 @@ subroutine fldlst () use cam_grid_support, only: cam_grid_num_grids use spmd_utils, only: mpicom - ! + use dycore, only: dycore_is + !----------------------------------------------------------------------- ! ! Purpose: Define the contents of each history file based on namelist input for initial or branch @@ -2198,6 +2213,7 @@ subroutine fldlst () ! integer t, f ! tape, field indices integer ff ! index into include, exclude and fprec list + integer :: i character(len=fieldname_len) :: name ! field name portion of fincl (i.e. no avgflag separator) character(len=max_fieldname_len) :: mastername ! name from masterlist field character(len=max_chars) :: errormsg ! error output field @@ -2215,17 +2231,53 @@ subroutine fldlst () ! on that grid. integer, allocatable :: gridsontape(:,:) - ! + ! The following list of field names are only valid for the FV dycore. They appear + ! in fincl settings of WACCM use case files which are not restricted to the FV dycore. + ! To avoid duplicating long fincl lists in use case files to provide both FV and non-FV + ! versions this short list of fields is checked for and removed from fincl lists when + ! the dycore is not FV. + integer, parameter :: n_fv_only = 10 + character(len=6) :: fv_only_flds(n_fv_only) = & + [ 'VTHzm ', 'WTHzm ', 'UVzm ', 'UWzm ', 'Uzm ', 'Vzm ', 'Wzm ', & + 'THzm ', 'TH ', 'MSKtem' ] + + integer :: n_vec_comp, add_fincl_idx + integer, parameter :: nvecmax = 50 ! max number of vector components in a fincl list + character(len=2) :: avg_suffix + character(len=fieldname_len) :: vec_comp_names(nvecmax) + character(len=1) :: vec_comp_avgflag(nvecmax) + !-------------------------------------------------------------------------- + ! First ensure contents of fincl, fexcl, and fwrtpr are all valid names ! errors_found = 0 do t=1,ptapes f = 1 - do while (f < pflds .and. fincl(f,t) /= ' ') + n_vec_comp = 0 + vec_comp_names = ' ' + vec_comp_avgflag = ' ' +fincls: do while (f < pflds .and. fincl(f,t) /= ' ') name = getname (fincl(f,t)) + + if (.not. dycore_is('FV')) then + ! filter out fields only provided by FV dycore + do i = 1, n_fv_only + if (name == fv_only_flds(i)) then + write(errormsg,'(3a,2(i0,a))')'FLDLST: ', trim(name), & + ' in fincl(', f,', ',t, ') only available with FV dycore' + if (masterproc) then + write(iulog,*) trim(errormsg) + call shr_sys_flush(iulog) + end if + f = f + 1 + cycle fincls + end if + end do + end if + mastername='' listentry => get_entry_by_name(masterlinkedlist, name) - if(associated(listentry)) mastername = listentry%field%name + if (associated(listentry)) mastername = listentry%field%name if (name /= mastername) then write(errormsg,'(3a,2(i0,a))')'FLDLST: ', trim(name), ' in fincl(', f,', ',t, ') not found' if (masterproc) then @@ -2233,9 +2285,53 @@ subroutine fldlst () call shr_sys_flush(iulog) end if errors_found = errors_found + 1 + else + if (len_trim(mastername)>0 .and. interpolate_output(t)) then + if (n_vec_comp >= nvecmax) call endrun('FLDLST: need to increase nvecmax') + ! If this is a vector component then save the name of the complement + avgflag = getflag(fincl(f,t)) + if (len_trim(listentry%meridional_field) > 0) then + n_vec_comp = n_vec_comp + 1 + vec_comp_names(n_vec_comp) = listentry%meridional_field + vec_comp_avgflag(n_vec_comp) = avgflag + else if (len_trim(listentry%zonal_field) > 0) then + n_vec_comp = n_vec_comp + 1 + vec_comp_names(n_vec_comp) = listentry%meridional_field + vec_comp_avgflag(n_vec_comp) = avgflag + end if + end if end if f = f + 1 - end do + end do fincls + + ! Interpolation of vector components requires that both be present. If the fincl + ! specifier contains any vector components, then the complement was saved in the + ! array vec_comp_names. Next insure (for interpolated output only) that all complements + ! are also present in the fincl array. + + ! The first empty slot in the current fincl array is index f from loop above. + add_fincl_idx = f + if (f > 1 .and. interpolate_output(t)) then + do i = 1, n_vec_comp + call list_index(fincl(:,t), vec_comp_names(i), ff) + if (ff == 0) then + + ! Add vector component to fincl. Don't need to check whether its in the master + ! list since this was done at the time of registering the vector components. + avg_suffix = ' ' + if (len_trim(vec_comp_avgflag(i)) > 0) avg_suffix = ':' // vec_comp_avgflag(i) + fincl(add_fincl_idx,t) = vec_comp_names(i) // avg_suffix + add_fincl_idx = add_fincl_idx + 1 + + write(errormsg,'(3a,1(i0,a))')'FLDLST: ', trim(vec_comp_names(i)), & + ' added to fincl', t, '. Both vector components are required for interpolated output.' + if (masterproc) then + write(iulog,*) trim(errormsg) + call shr_sys_flush(iulog) + end if + end if + end do + end if f = 1 do while (f < pflds .and. fexcl(f,t) /= ' ') diff --git a/src/control/cam_history_support.F90 b/src/control/cam_history_support.F90 index 49c5e77437..7cb3259fc5 100644 --- a/src/control/cam_history_support.F90 +++ b/src/control/cam_history_support.F90 @@ -121,7 +121,7 @@ module cam_history_support character(len=max_fieldname_len) :: name ! field name character(len=max_chars) :: long_name ! long name character(len=max_chars) :: units ! units - character(len=3) :: mixing_ratio ! 'dry' or 'wet' + character(len=max_chars) :: mixing_ratio ! 'dry' or 'wet' character(len=max_chars) :: sampling_seq ! sampling sequence - if not every timestep, how often field is sampled ! (i.e., how often "outfld" is called): every other; only during LW/SW ! radiation calcs; etc. From c343b316c7e3728e6dd08e0b888fd9783c525df3 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Sat, 16 Mar 2019 14:56:13 -0600 Subject: [PATCH 021/239] 'new fix for mixing_ratio attribute Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90769 Committed by Brian Eaton at 2019-03-16 14:56:13 -0600 Original svn commit message: new fix for mixing_ratio attribute' --- doc/ChangeLog | 48 +++++++++++++++++++++++++++++ src/control/cam_history.F90 | 28 ++++++++--------- src/control/cam_history_support.F90 | 2 +- 3 files changed, 62 insertions(+), 16 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 1e0d3e0a66..510949d06a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,53 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_19 +Originator(s): eaton +Date: Sat Mar 16 14:44:14 MDT 2019 +One-line Summary: new fix for mixing_ratio attribute problem + +Purpose of changes: + +. In order to avoid making a change to the CAM restart file which could + have unintended consequences, fix the problem of the wrong mixing_ratio + attribute after a restart by directly setting the mixing_ratio component + in the active field lists. This is done in the same location of + subroutine read_restart_history where the data would have been read from + the restart file. But this information has already been initialized in + the constituents module before the restart file is read. So having it on + the restart file is not necessary. + +Bugs fixed (include bugzilla ID): none + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: +components/cam/src/control/cam_history.F90 +. remove mixing_ratio attribute to restart file +. add code to set mixing_ratio directly in the active field lists. + +components/cam/src/control/cam_history_support.F90 +. change mixing_ratio component of field_info type back to size 3 + +Testing: did CAM standalone restart test to make sure files written after a +restart contained the correct values for the mixing_ratio attribute. + +Summarize any changes to answers: none + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_18 Originator(s): klindsay, eaton Date: Fri Mar 15 17:33:15 MDT 2019 diff --git a/src/control/cam_history.F90 b/src/control/cam_history.F90 index f38a3033b8..647f127883 100644 --- a/src/control/cam_history.F90 +++ b/src/control/cam_history.F90 @@ -108,7 +108,7 @@ module cam_history ! ! The size of these parameters should match the assignments in restart_vars_setnames and restart_dims_setnames below ! - integer, parameter :: restartvarcnt = 39 + integer, parameter :: restartvarcnt = 38 integer, parameter :: restartdimcnt = 10 type(rvar_id) :: restartvars(restartvarcnt) type(rdim_id) :: restartdims(restartdimcnt) @@ -1102,14 +1102,6 @@ subroutine restart_vars_setnames() restartvars(rvindex)%dims(2) = maxnflds_dim_ind restartvars(rvindex)%dims(3) = ptapes_dim_ind - rvindex = rvindex + 1 - restartvars(rvindex)%name = 'mixing_ratio' - restartvars(rvindex)%type = pio_char - restartvars(rvindex)%ndims = 3 - restartvars(rvindex)%dims(1) = max_chars_dim_ind - restartvars(rvindex)%dims(2) = maxnflds_dim_ind - restartvars(rvindex)%dims(3) = ptapes_dim_ind - rvindex = rvindex + 1 restartvars(rvindex)%name = 'xyfill' restartvars(rvindex)%type = pio_int @@ -1338,7 +1330,6 @@ subroutine write_restart_history ( File, & type(var_desc_t), pointer :: cm_desc type(var_desc_t), pointer :: longname_desc type(var_desc_t), pointer :: units_desc - type(var_desc_t), pointer :: mr_desc type(var_desc_t), pointer :: hwrt_prec_desc type(var_desc_t), pointer :: xyfill_desc type(var_desc_t), pointer :: mdims_desc ! mdim name indices @@ -1458,7 +1449,6 @@ subroutine write_restart_history ( File, & cm_desc => restartvar_getdesc('cell_methods') longname_desc => restartvar_getdesc('long_name') units_desc => restartvar_getdesc('units') - mr_desc => restartvar_getdesc('mixing_ratio') avgflag_desc => restartvar_getdesc('avgflag') xyfill_desc => restartvar_getdesc('xyfill') issubcol_desc => restartvar_getdesc('is_subcol') @@ -1498,7 +1488,6 @@ subroutine write_restart_history ( File, & ierr = pio_put_var(File, cm_desc,startc,tape(t)%hlist(f)%field%cell_methods) ierr = pio_put_var(File, longname_desc,startc,tape(t)%hlist(f)%field%long_name) ierr = pio_put_var(File, units_desc,startc,tape(t)%hlist(f)%field%units) - ierr = pio_put_var(File, mr_desc,startc,tape(t)%hlist(f)%field%mixing_ratio) ierr = pio_put_var(File, avgflag_desc,start, tape(t)%hlist(f)%avgflag) ierr = pio_put_var(File, fillval_desc,start, tape(t)%hlist(f)%field%fillvalue) @@ -1568,6 +1557,7 @@ subroutine read_restart_history (File) use sat_hist, only: sat_hist_define, sat_hist_init use cam_grid_support, only: cam_grid_read_dist_array, cam_grid_num_grids use cam_history_support, only: get_hist_coord_index, add_hist_coord + use constituents, only: cnst_get_ind, cnst_get_type_byind use shr_sys_mod, only: shr_sys_getenv use spmd_utils, only: mpicom, mpi_character, masterprocid @@ -1604,7 +1594,6 @@ subroutine read_restart_history (File) type(var_desc_t) :: vdesc type(var_desc_t) :: longname_desc type(var_desc_t) :: units_desc - type(var_desc_t) :: mr_desc type(var_desc_t) :: avgflag_desc type(var_desc_t) :: sseq_desc type(var_desc_t) :: cm_desc @@ -1632,6 +1621,8 @@ subroutine read_restart_history (File) integer :: fdims(3) ! Field dims integer :: nfdims ! 2 or 3 (for 2D,3D) integer :: fdecomp ! Grid ID for field + integer :: idx + character(len=3) :: mixing_ratio ! ! Get users logname and machine hostname @@ -1794,7 +1785,6 @@ subroutine read_restart_history (File) ierr = pio_inq_varid(File, 'long_name', longname_desc) ierr = pio_inq_varid(File, 'units', units_desc) - ierr = pio_inq_varid(File, 'mixing_ratio', mr_desc) ierr = pio_inq_varid(File, 'sampling_seq', sseq_desc) ierr = pio_inq_varid(File, 'cell_methods', cm_desc) @@ -1829,7 +1819,6 @@ subroutine read_restart_history (File) ierr = pio_get_var(File,avgflag_desc, (/f,t/), tape(t)%hlist(f)%avgflag) ierr = pio_get_var(File,longname_desc, (/1,f,t/), tape(t)%hlist(f)%field%long_name) ierr = pio_get_var(File,units_desc, (/1,f,t/), tape(t)%hlist(f)%field%units) - ierr = pio_get_var(File,mr_desc, (/1,f,t/), tape(t)%hlist(f)%field%mixing_ratio) tape(t)%hlist(f)%field%sampling_seq(1:max_chars) = ' ' ierr = pio_get_var(File,sseq_desc, (/1,f,t/), tape(t)%hlist(f)%field%sampling_seq) call strip_null(tape(t)%hlist(f)%field%sampling_seq) @@ -1852,6 +1841,15 @@ subroutine read_restart_history (File) tape(t)%hlist(f)%field%numlev = tmpnumlev(f,t) tape(t)%hlist(f)%hwrt_prec = tmpprec(f,t) + ! If the field is an advected constituent set the mixing_ratio attribute + fname_tmp = strip_suffix(tape(t)%hlist(f)%field%name) + call cnst_get_ind(fname_tmp, idx, abort=.false.) + mixing_ratio = '' + if (idx > 0) then + mixing_ratio = cnst_get_type_byind(idx) + end if + tape(t)%hlist(f)%field%mixing_ratio = mixing_ratio + mdimcnt = count(allmdims(:,f,t) > 0) if(mdimcnt > 0) then allocate(tape(t)%hlist(f)%field%mdims(mdimcnt)) diff --git a/src/control/cam_history_support.F90 b/src/control/cam_history_support.F90 index 7cb3259fc5..49c5e77437 100644 --- a/src/control/cam_history_support.F90 +++ b/src/control/cam_history_support.F90 @@ -121,7 +121,7 @@ module cam_history_support character(len=max_fieldname_len) :: name ! field name character(len=max_chars) :: long_name ! long name character(len=max_chars) :: units ! units - character(len=max_chars) :: mixing_ratio ! 'dry' or 'wet' + character(len=3) :: mixing_ratio ! 'dry' or 'wet' character(len=max_chars) :: sampling_seq ! sampling sequence - if not every timestep, how often field is sampled ! (i.e., how often "outfld" is called): every other; only during LW/SW ! radiation calcs; etc. From 84bac9e844c51f620486e63d2a10b1d61f68c790 Mon Sep 17 00:00:00 2001 From: Chris Fischer Date: Fri, 22 Mar 2019 12:11:16 -0600 Subject: [PATCH 022/239] 'Update REFCASES, and fix character length mismatch. Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90814 Committed by Chris Fischer at 2019-03-22 12:11:16 -0600 Original svn commit message: Update REFCASES, and fix character length mismatch. ' --- cime_config/config_compsets.xml | 66 ++++++++++++++------------------- doc/ChangeLog | 40 ++++++++++++++++++++ src/control/cam_history.F90 | 9 +++-- 3 files changed, 73 insertions(+), 42 deletions(-) diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index ae84811994..32e79eaf05 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -504,12 +504,10 @@ hybrid - hybrid - hybrid - hybrid + hybrid + hybrid + hybrid - hybrid - hybrid hybrid hybrid hybrid @@ -529,38 +527,34 @@ - b.e20.BHIST.f09_g17.20thC.297_01_v2 - b.e20.BHIST.f09_g17.20thC.297_01_v2 - b.e16.B1850_WW3.f09_g16.lang_redi_2hr_frz_chl.003 - b.e20.B1850.f09_g16.pi_control.all.123 - - b.e16.B1850_WW3.f09_g16.lang_redi_2hr_frz_chl.003 - b.e20.B1850.f09_g16.pi_control.all.123 - f.e21.FW1850.f09_f09_mg17.cesm2.1-exp011.001 - f.e21.FWsc1850.f09_f09_mg17.cesm2.1-exp011.001 - f.e21.FW2000climo.f09_f09_mg17.cesm2.1-exp011.001 - f.e21.FWsc2000climo.f09_f09_mg17.cesm2.1-exp011.001 - f.e21.FW2010climo.f09_f09_mg17.cesm2.1-exp011.001 - f.e21.FWsc2010climo.f09_f09_mg17.cesm2.1-exp011.001 - f.e21.FWHIST.f09_f09_mg17.cesm2.1-exp011.001 - f.e21.FWmaHIST.f09_f09_mg17.cesm2.1-exp011.1975-2015.001 - f.e21.FWmadHIST.f09_f09_mg17.cesm2.1-exp011.001 - f.e21.FWsc1850.f09_f09_mg17.cesm2.1-exp011.001 - c_cesm2.1b01_fswd_1975_cntrl - f.e21.FWmaSD.f09_f09_mg17.cesm2.1-exp011.1978-2015.001 - f.e21.FWmadSD.f09_f09_mg17.cesm2.1-exp011.001 - b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.001 + f.e20.FHIST.f09_f09.cesm2_1.001_v2 + f.e20.FHIST.f09_f09.cesm2_1.001_v2 + f.e20.FHIST.f09_f09.cesm2_1.001_v2 + b.e20.BHIST.f09_g17.20thC.297_01_v3 + + f.e21.FW1850.f09_f09_mg17.cesm2.1-exp011.001_v2 + f.e21.FWsc1850.f09_f09_mg17.cesm2.1-exp011.001_v2 + f.e21.FW2000climo.f09_f09_mg17.cesm2.1-exp011.001_v2 + f.e21.FWsc2000climo.f09_f09_mg17.cesm2.1-exp011.001_v2 + f.e21.FW2010climo.f09_f09_mg17.cesm2.1-exp011.001_v2 + f.e21.FWsc2010climo.f09_f09_mg17.cesm2.1-exp011.001_v2 + f.e21.FWHIST.f09_f09_mg17.cesm2.1-exp011.001_v2 + f.e21.FWmaHIST.f09_f09_mg17.cesm2.1-exp011.1975-2015.001_v2 + f.e21.FWmadHIST.f09_f09_mg17.cesm2.1-exp011.001_v2 + f.e21.FWsc1850.f09_f09_mg17.cesm2.1-exp011.001_v3hist + c_cesm2.1b01_fswd_1975_cntrl_v2 + f.e21.FWmaSD.f09_f09_mg17.cesm2.1-exp011.1978-2015.001_v2 + f.e21.FWmadSD.f09_f09_mg17.cesm2.1-exp011.001_v2 + b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.001_v2 1979-01-01 - 2000-01-01 - 0097-01-01 - 0010-01-01 - 0097-01-01 - 0010-01-01 + 2000-01-01 + 2010-01-01 + 1979-01-01 0003-01-01 0003-01-01 0003-01-01 @@ -581,7 +575,9 @@ cesm2_init - cesm2_init + cesm2_init + cesm2_init + cesm2_init cesm2_init cesm2_init cesm2_init @@ -599,12 +595,6 @@ - - - use_init_interp=.true. - - - 1 diff --git a/doc/ChangeLog b/doc/ChangeLog index 510949d06a..b7a881a1da 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,44 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_20 +Originator(s): Chris Fischer +Date: Fri Mar 22 10:58:38 MDT 2019 +One-line Summary: Update REFCASES + +Purpose of changes: +. Update externals to use latest component release tags. +. Update REFCASES to be compatiable with new ctsm tags. +. Fix a character length mismatch between dummy and actual arguments. + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: +M Externals.cfg + - Update externals to latest release tag. +M components/cam/cime_config/config_compsets.xml + - Fix REFCASES to use correct inputs to support updated ctsm tags +M components/cam/src/control/cam_history.F90 + - Fix a character length mismatch between dummy and actual arguments that nag/debug + was reporting. + + +Testing: + +=============================================================== +=============================================================== Tag name: release_tags/cam_cesm2_1_rel_19 Originator(s): eaton diff --git a/src/control/cam_history.F90 b/src/control/cam_history.F90 index 647f127883..ba5cabb44c 100644 --- a/src/control/cam_history.F90 +++ b/src/control/cam_history.F90 @@ -2242,14 +2242,15 @@ subroutine fldlst () integer :: n_vec_comp, add_fincl_idx integer, parameter :: nvecmax = 50 ! max number of vector components in a fincl list character(len=2) :: avg_suffix - character(len=fieldname_len) :: vec_comp_names(nvecmax) - character(len=1) :: vec_comp_avgflag(nvecmax) + character(len=max_fieldname_len) :: vec_comp_names(nvecmax) + character(len=1) :: vec_comp_avgflag(nvecmax) !-------------------------------------------------------------------------- ! First ensure contents of fincl, fexcl, and fwrtpr are all valid names ! errors_found = 0 do t=1,ptapes + f = 1 n_vec_comp = 0 vec_comp_names = ' ' @@ -2272,7 +2273,7 @@ subroutine fldlst () end if end do end if - + mastername='' listentry => get_entry_by_name(masterlinkedlist, name) if (associated(listentry)) mastername = listentry%field%name @@ -2318,7 +2319,7 @@ subroutine fldlst () ! list since this was done at the time of registering the vector components. avg_suffix = ' ' if (len_trim(vec_comp_avgflag(i)) > 0) avg_suffix = ':' // vec_comp_avgflag(i) - fincl(add_fincl_idx,t) = vec_comp_names(i) // avg_suffix + fincl(add_fincl_idx,t) = trim(vec_comp_names(i)) // avg_suffix add_fincl_idx = add_fincl_idx + 1 write(errormsg,'(3a,1(i0,a))')'FLDLST: ', trim(vec_comp_names(i)), & From f48ada66443d8281d24d4228d2a05a080ec6a8b4 Mon Sep 17 00:00:00 2001 From: Chris Fischer Date: Fri, 22 Mar 2019 12:11:37 -0600 Subject: [PATCH 023/239] 'Update externals Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90815 Committed by Chris Fischer at 2019-03-22 12:11:37 -0600 Original svn commit message: Update externals ' --- Externals.cfg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index d23a6b889e..116a6473a2 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -2,21 +2,21 @@ schema_version = 1.0.0 [cice] -tag = cice5_cesm2_0_rel_01 +tag = cice5_20190318 protocol = git repo_url = https://github.com/ESCOMP/CESM_CICE5 required = True local_path = components/cice [cime] -tag = cime5.6.12 +tag = cime5.6.13 protocol = git repo_url = https://github.com/ESMCI/cime required = True local_path = cime [cism] -tag = release-cesm2.0.01 +tag = release-cesm2.0.04 protocol = git repo_url = https://github.com/ESCOMP/cism-wrapper externals = Externals_CISM.cfg @@ -24,7 +24,7 @@ required = True local_path = components/cism [clm] -tag = release-clm5.0.01 +tag = release-clm5.0.20 protocol = git repo_url = https://github.com/ESCOMP/ctsm externals = Externals_CLM.cfg @@ -32,14 +32,14 @@ required = True local_path = components/clm [mosart] -tag = release-cesm2.0.00 +tag = release-cesm2.0.03 protocol = git repo_url = https://github.com/ESCOMP/mosart required = True local_path = components/mosart [rtm] -tag = release-cesm2.0.00 +tag = release-cesm2.0.02 protocol = git repo_url = https://github.com/ESCOMP/rtm required = True From f5e01cda7a4b4340c1d0a661b4599889f2f00606 Mon Sep 17 00:00:00 2001 From: Chris Fischer Date: Fri, 22 Mar 2019 14:02:55 -0600 Subject: [PATCH 024/239] 'Update ChangeLog with testing information Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90818 Committed by Chris Fischer at 2019-03-22 14:02:55 -0600 Original svn commit message: Update ChangeLog with testing information ' --- doc/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index b7a881a1da..4ffb440a8f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -35,7 +35,7 @@ M components/cam/src/control/cam_history.F90 was reporting. -Testing: +Testing: Ran a cesm ERP prealpha test that was failing before. =============================================================== =============================================================== From 87cf60937a0d6d150f60fe7aeb32f771f687caa0 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 29 Mar 2019 12:38:11 -0600 Subject: [PATCH 025/239] 'Create CAM's SSP126 use_case Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90854 Committed by Cheryl Craig at 2019-03-29 12:38:11 -0600 Original svn commit message: Create CAM's SSP126 use_case' --- bld/namelist_files/use_cases/ssp126_cam6.xml | 93 ++++++++++++++++++++ cime_config/config_component.xml | 1 + doc/ChangeLog | 35 ++++++++ 3 files changed, 129 insertions(+) create mode 100644 bld/namelist_files/use_cases/ssp126_cam6.xml diff --git a/bld/namelist_files/use_cases/ssp126_cam6.xml b/bld/namelist_files/use_cases/ssp126_cam6.xml new file mode 100644 index 0000000000..e05e1200be --- /dev/null +++ b/bld/namelist_files/use_cases/ssp126_cam6.xml @@ -0,0 +1,93 @@ + + + + + + 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev//H2OemissionCH4oxidationx2_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190221.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/missions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' + + + + + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_DMS_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ene_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc' + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SOAGx1.5_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SOAGx1.5_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp/emissions-cmip6-SOAGx1.5_biogenic_surface_mol_175001-210101_0.9x1.25_c20190329.nc' + + + + + atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + + 'atm/cam/tracer_cnst' + 'tracer_cnst_halons_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190221.nc' + 'O3','OH','NO3','HO2' + 'INTERP_MISSING_MONTHS' + '' + + + 'atm/cam/ozone_strataero' + 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP126_c190221.nc' + 'O3' + 'SERIAL' + + + INTERP_MISSING_MONTHS + INTERP_MISSING_MONTHS + + + 'SERIAL' + 'atm/cam/ozone_strataero' + 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP126_c190221.nc' + .true. + + +.true. +tm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_0.9x1.25_c20190207.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_1.9x2.5_c20190207.nc + + +.true. +SERIAL +atm/cam/ggas +ac_CO2 -> emissions-cmip6_CO2_anthro_ac_ssp126_201401-210112_fv_0.9x1.25_c20190207.txt +emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_0.9x1.25_c20190207.nc +ac_CO2 -> emissions-cmip6_CO2_anthro_ac_ssp126_201401-210112_fv_1.9x2.5_c20190207.txt +emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_1.9x2.5_c20190207.nc + + 'CHEM_LBC_FILE' + atm/waccm/lb/LBC_2014-2500_CMIP6_SSP126_0p5degLat_GlobAnnAvg_c190301.nc + 'SERIAL' + 'CO2','CH4','N2O','CFC11eq','CFC12' + + + + 1850-2100 + + + diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 1373748dc8..f8a71e6884 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -229,6 +229,7 @@ 1850-PD_cam5 ssp585_cam6 + ssp126_cam6 waccm_tsmlt_ssp126_cam6 waccm_tsmlt_ssp245_cam6 waccm_tsmlt_ssp370_cam6 diff --git a/doc/ChangeLog b/doc/ChangeLog index 4ffb440a8f..1bf7cefe50 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,39 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_21 +Originator(s): cacraig +Date: March 29, 2019 +One-line Summary: Create CAM's SSP126 use_case + +Purpose of changes: +- create the SSP126 use_case and add it to the config_component file + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: +A components/cam/bld/namelist_files/use_cases/ssp126_cam6.xml + - created use_case based on Cecile's google doc + +List all existing files that have been modified, and describe the changes: +M components/cam/cime_config/config_component.xml + - added SSP126 use_case + +Tested by running SSP126_CAM60_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV in the CAM standlone tag + and hand checked the resulting atm_in after running preview_namelists + +=============================================================== +=============================================================== Tag name: release_tags/cam_cesm2_1_rel_20 Originator(s): Chris Fischer Date: Fri Mar 22 10:58:38 MDT 2019 From 5c16e964cf805888fee361aa177b07df62ddabfe Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 29 Mar 2019 14:01:52 -0600 Subject: [PATCH 026/239] 'Fix typos and replace missing file in CAM's SSP126 use_case Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90857 Committed by Cheryl Craig at 2019-03-29 14:01:52 -0600 Original svn commit message: Fix typos and replace missing file in CAM's SSP126 use_case' --- bld/namelist_files/use_cases/ssp126_cam6.xml | 6 ++-- doc/ChangeLog | 32 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/use_cases/ssp126_cam6.xml b/bld/namelist_files/use_cases/ssp126_cam6.xml index e05e1200be..b2cf700c5f 100644 --- a/bld/namelist_files/use_cases/ssp126_cam6.xml +++ b/bld/namelist_files/use_cases/ssp126_cam6.xml @@ -3,8 +3,8 @@ - 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev//H2OemissionCH4oxidationx2_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190221.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/missions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2OemissionCH4oxidationx2_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190221.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', @@ -45,7 +45,7 @@ 'atm/cam/tracer_cnst' - 'tracer_cnst_halons_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190221.nc' + 'tracer_cnst_halons_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190307.nc' 'O3','OH','NO3','HO2' 'INTERP_MISSING_MONTHS' '' diff --git a/doc/ChangeLog b/doc/ChangeLog index 1bf7cefe50..0c8a8eff3a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,36 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_22 +Originator(s): cacraig +Date: March 29, 2019 +One-line Summary: Fix typos and replace missing file in CAM's SSP126 use_case + +Purpose of changes: +- Fix typos and replace the missing tracer_cnst file in CAM's SSP126 use_case + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: +M components/cam/bld/namelist_files/use_cases/ssp126_cam6.xml + - Fix typos and replace the missing tracer_cnst file in CAM's SSP126 use_case + +No testing done as Erik will be testing in the BSSP126 compset + +=============================================================== +=============================================================== Tag name: release_tags/cam_cesm2_1_rel_21 Originator(s): cacraig Date: March 29, 2019 From d433694f47dd7a10beb30b73ef24e37a2a587f0c Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 29 Mar 2019 15:02:54 -0600 Subject: [PATCH 027/239] 'Another typo and filename update Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90860 Committed by Cheryl Craig at 2019-03-29 15:02:54 -0600 Original svn commit message: Another typo and filename update' --- bld/namelist_files/use_cases/ssp126_cam6.xml | 4 +-- doc/ChangeLog | 32 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/use_cases/ssp126_cam6.xml b/bld/namelist_files/use_cases/ssp126_cam6.xml index b2cf700c5f..9d522fab69 100644 --- a/bld/namelist_files/use_cases/ssp126_cam6.xml +++ b/bld/namelist_files/use_cases/ssp126_cam6.xml @@ -3,7 +3,7 @@ - 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2OemissionCH4oxidationx2_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190221.nc', + 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2OemissionCH4oxidationx2_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190307.nc', 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', @@ -68,7 +68,7 @@ .true. -tm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_0.9x1.25_c20190207.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_0.9x1.25_c20190207.nc atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_1.9x2.5_c20190207.nc diff --git a/doc/ChangeLog b/doc/ChangeLog index 0c8a8eff3a..0f1867b047 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,36 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_23 +Originator(s): cacraig +Date: March 29, 2019 +One-line Summary: Another typo and filename update + +Purpose of changes: +- One more typo and another file update + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: +M components/cam/bld/namelist_files/use_cases/ssp126_cam6.xml + - Added a missing "a" and updated the H2O file to a more recent date + +No testing done as Erik will be testing in the BSSP126 compset + +=============================================================== +=============================================================== Tag name: release_tags/cam_cesm2_1_rel_22 Originator(s): cacraig Date: March 29, 2019 From 669ad226b83fd2cead5037d4da39629ae1a03599 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Fri, 29 Mar 2019 16:48:31 -0600 Subject: [PATCH 028/239] 'bug fixes Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90862 Committed by Brian Eaton at 2019-03-29 16:48:31 -0600 Original svn commit message: bug fixes' --- doc/ChangeLog | 45 ++++++++++++++++++++++++++++++++++ src/control/cam_history.F90 | 2 +- src/physics/cam/clubb_intr.F90 | 1 + 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0f1867b047..9bcd6b0ba0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,49 @@ =============================================================== + +Tag name: release_tags/cam_cesm2_1_rel_24 +Originator(s): eaton +Date: Fri Mar 29 16:39:43 MDT 2019 +One-line Summary: bug fixes + +Purpose of changes: + +. Bug fix in code that was added to verify that both vector components are + output when interpolated output is requested. This only impact SE. + +. Bug fix for issue raised on BB about missing outfld call for DP_CLD when + clubb is used. + +Bugs fixed (include bugzilla ID): see above + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: eaton + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: +components/cam/src/control/cam_history.F90 +. fix in code that verifies both vector components are present when + interpolated SE output is requested. + +components/cam/src/physics/cam/clubb_intr.F90 +. add outfld call for DP_CLD from clubb_tend_cam + +Testing: +Ran 1 step FW2000climo with ne30pg3 and interpolated output to +make sure the missing vector components were added. + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_23 Originator(s): cacraig Date: March 29, 2019 diff --git a/src/control/cam_history.F90 b/src/control/cam_history.F90 index ba5cabb44c..56fd7e0f25 100644 --- a/src/control/cam_history.F90 +++ b/src/control/cam_history.F90 @@ -2295,7 +2295,7 @@ subroutine fldlst () vec_comp_avgflag(n_vec_comp) = avgflag else if (len_trim(listentry%zonal_field) > 0) then n_vec_comp = n_vec_comp + 1 - vec_comp_names(n_vec_comp) = listentry%meridional_field + vec_comp_names(n_vec_comp) = listentry%zonal_field vec_comp_avgflag(n_vec_comp) = avgflag end if end if diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index c03d11881d..1d2648d676 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -2669,6 +2669,7 @@ subroutine clubb_tend_cam( & call outfld( 'QT', qt_output, pcols, lchnk ) call outfld( 'SL', sl_output, pcols, lchnk ) call outfld( 'CONCLD', concld, pcols, lchnk ) + call outfld( 'DP_CLD', deepcu, pcols, lchnk ) call outfld( 'CLUBB_GRID_SIZE', grid_dx, pcols, lchnk ) call outfld( 'QSATFAC', qsatfac, pcols, lchnk) From 5ed2d93f40a84df6b9ef91a11f1f0a614bc2dc82 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 11 Apr 2019 08:12:54 -0600 Subject: [PATCH 029/239] 'M components/cam/bld/namelist_files/use_cases/1850_cam6.xml Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@90972 Committed by Francis Vitt at 2019-04-11 08:12:54 -0600 Original svn commit message: M components/cam/bld/namelist_files/use_cases/1850_cam6.xml M components/cam/bld/namelist_files/use_cases/hist_cam6.xml M components/cam/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml M components/cam/bld/namelist_files/use_cases/waccm_ma_hist_cam4.xml M components/cam/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml M components/cam/bld/namelist_files/namelist_defaults_cam.xml M components/cam/doc/ChangeLog ' --- bld/namelist_files/namelist_defaults_cam.xml | 55 +++++++++++++- bld/namelist_files/use_cases/1850_cam6.xml | 51 +++++++++---- bld/namelist_files/use_cases/hist_cam6.xml | 37 ++++++++- .../use_cases/waccm_ma_1850_cam6.xml | 3 +- .../use_cases/waccm_ma_hist_cam4.xml | 2 + .../use_cases/waccm_ma_hist_cam6.xml | 3 +- doc/ChangeLog | 76 +++++++++++++++++++ 7 files changed, 207 insertions(+), 20 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 17ebec5ca6..851bf8725b 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -158,7 +158,7 @@ atm/cam/topo/USGS_gtopo30_0.47x0.63_remap_c061106.nc atm/cam/topo/topo-from-cami_0000-10-01_0.5x0.625_L26_c031204.nc atm/cam/topo/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_sgh30_24km_GRNL_c170103.nc -atm/cam/topo/fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_ZR_061116.nc +atm/cam/topo/fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_ZR_GRNL_031819.nc atm/cam/topo/USGS-gtopo30_2.5x3.33_remap_c100204.nc atm/cam/topo/USGS-gtopo30_4x5_remap_c050520.nc atm/cam/topo/fv_10x15_nc0540_Nsw042_Nrs008_Co060_Fi001_20171220.nc @@ -764,7 +764,55 @@ atm/cam/chem/stratvolc/VolcanEESMv3.11_SO2_850-2016_Mscale_Zreduc_2deg_c180812.nc atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_1deg_ZeroTrop_c180416.nc - + + +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/H2OemissionCH4oxidationx2_3D_L70_1849-2015_CMIP6ensAvg_1.9x2.5_c190308.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_so4_a1_anthro-ene_vertical_1750-2015_1.9x2.5_c20170616.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_1.9x2.5_c20181024.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_1.9x2.5_c20181024.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SO2_contvolcano_vertical_850-5000_1.9x2.5_c20181024.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a1_anthro-ene_vertical_1750-2015_1.9x2.5_c20170616.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_1.9x2.5_c20181024.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_1.9x2.5_c20181024.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SO2_aircraft_vertical_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_bc_a4_aircraft_vertical_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_NO2_aircraft_vertical_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_bc_a4_aircraft_vertical_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_2deg_c190220.nc + + + +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_bc_a4_anthro_surface_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_bc_a4_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_DMS_other_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_DMS_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_so4_a1_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_so4_a1_anthro-ag-ship_surface_1750-2015_1.9x2.5_c20170616.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_so4_a2_anthro-res_surface_1750-2015_1.9x2.5_c20170616.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_pom_a4_anthro_surface_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_bc_a4_anthro_surface_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_bc_a4_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_pom_a4_bb_surface_1750-2015_1.9x2.5_c20170322.nc + +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SO2_anthro-ag-ship-res_surface_1750-2015_1.9x2.5_c20170616.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SO2_anthro-ene_surface_1750-2015_1.9x2.5_c20170616.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SO2_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a1_anthro-ag-ship_surface_1750-2015_1.9x2.5_c20170616.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a1_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a2_anthro-res_surface_1750-2015_1.9x2.5_c20170616.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SOAGx1.5_anthro_surface_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SOAGx1.5_biogenic_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SOAGx1.5_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_pom_a4_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_pom_a4_anthro_surface_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_CH2O_anthro_surface_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_CH2O_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_CO_anthro_surface_1750-2015_1.9x2.5_c20180504.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_CO_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_CO_other_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_NO_anthro_surface_1750-2015_1.9x2.5_c20170608.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_NO_bb_surface_1750-2015_1.9x2.5_c20170322.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_NO_other_surface_1750-2015_1.9x2.5_c20170322.nc @@ -1153,6 +1201,7 @@ 0.35D0 2.2D0 0.308 + 0.280 0.5 0.3 2.4 @@ -1187,6 +1236,7 @@ 0 1 500.D-6 + 200.D-6 max_overlap in_cloud @@ -1303,6 +1353,7 @@ 1.62D0 0.90D0 1.00D0 +1.10D0 1.2D0 diff --git a/bld/namelist_files/use_cases/1850_cam6.xml b/bld/namelist_files/use_cases/1850_cam6.xml index e51456d720..aa9dd0c45e 100644 --- a/bld/namelist_files/use_cases/1850_cam6.xml +++ b/bld/namelist_files/use_cases/1850_cam6.xml @@ -2,6 +2,8 @@ + cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.cam.i.0301-01-01-00000.nc + 'atm/cam/solar/SolarForcingCMIP6piControl_c160921.nc' 18500101 @@ -29,6 +31,8 @@ CYCLICAL 1850 +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/H2O_emission_CH4_oxidationx2_elev_3DmonthlyL70_1850climoCMIP6piControl001_y21-50avg_1.9x2.5_c190308.nc + 1850 'atm/cam/tracer_cnst' @@ -44,18 +48,39 @@ .true. 'CYCLICAL' - - 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2O_emission_CH4_oxidationx2_elev_3DmonthlyL70_1850climoCMIP6piControl001_y21-50avg_c180802.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_so4_a1_anthro-ene_vertical_1750-2015_0.9x1.25_c20170616.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', - 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_anthro-ene_vertical_1750-2015_0.9x1.25_c20170616.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', - 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' - - - - 1850 +atm/cam/chem/emis/elev/H2O_emission_CH4_oxidationx2_elev_3DmonthlyL70_1850climoCMIP6piControl001_y21-50avg_c180802.nc + + + 'dst_a1', 'dst_c1', 'dst_a3', 'dst_c3', 'dst_a1_SRF', 'dst_a3_SRF', 'dst_a1DDF', 'dst_a1SFWET', 'dst_c1DDF', + 'dst_c1SFWET', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c3DDF', 'dst_c3SFWET', 'SSAVIS', 'AODABS', 'AODDUST2', 'bc_a1', + 'bc_a4', 'dst_a1', 'dst_a2', 'dst_a3', 'ncl_a1', 'ncl_a1', 'ncl_a2', 'ncl_a3', 'pom_a1', + 'pom_a4', 'so4_a1', 'so4_a2', 'so4_a3', 'soa_a1', 'soa_a2', 'bc_c1', 'bc_c4', 'dst_c1', + 'dst_c2', 'dst_c3', 'ncl_c1', 'ncl_c1', 'ncl_c2', 'ncl_c3', 'pom_c1', 'pom_c4', 'so4_c1', + 'so4_c2', 'so4_c3', 'soa_c1', 'soa_c2', 'num_a1', 'num_a2', 'num_a4', 'num_c1', 'num_c2', + 'num_c3', 'bc_a1SFWET', 'bc_a4SFWET', 'dst_a1SFWET', 'dst_a2SFWET', 'dst_a3SFWET', 'ncl_a1SFWET', 'ncl_a2SFWET', 'ncl_a3SFWET', + 'pom_a1SFWET', 'pom_a4SFWET', 'so4_a1SFWET', 'so4_a2SFWET', 'so4_a3SFWET', 'soa_a1SFWET', 'soa_a2SFWET', 'bc_c1SFWET', 'bc_c4SFWET', + 'dst_c1SFWET', 'dst_c2SFWET', 'dst_c3SFWET', 'ncl_c1SFWET', 'ncl_c2SFWET', 'ncl_c3SFWET', 'pom_c1SFWET', 'pom_c4SFWET', 'so4_c1SFWET', + 'so4_c2SFWET', 'so4_c3SFWET', 'soa_c1SFWET', 'soa_c2SFWET', 'bc_a1DDF', 'bc_a4DDF', 'dst_a1DDF', 'dst_a2DDF', 'dst_a3DDF', + 'ncl_a1DDF', 'ncl_a2DDF', 'ncl_a3DDF', 'pom_a1DDF', 'pom_a4DDF', 'so4_a1DDF', 'so4_a2DDF', 'so4_a3DDF', 'soa_a1DDF', + 'soa_a2DDF', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', 'dst_c3DDF', 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', + 'pom_c1DDF', 'pom_c4DDF', 'so4_c1DDF', 'so4_c2DDF', 'so4_c3DDF', 'soa_c1DDF', 'soa_c2DDF', 'bc_a4_CLXF', 'pom_a4_CLXF', + 'so4_a1_CLXF', 'so4_a2_CLXF', 'SFbc_a4', 'SFpom_a4', 'SFso4_a1', 'SFso4_a2', 'so4_a1_sfgaex1', 'so4_a2_sfgaex1', 'so4_a3_sfgaex1', + 'soa_a1_sfgaex1', 'soa_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_c1AQH2SO4', 'so4_c2AQH2SO4', 'so4_c3AQH2SO4', 'so4_c1AQSO4', 'so4_c2AQSO4', 'so4_c3AQSO4', + 'ADRAIN', 'ADSNOW', 'ANRAIN', 'ANSNOW', 'AODDUST', 'AODVIS', 'AQRAIN', 'AQSNOW', 'AQSO4_H2O2', + 'AQSO4_O3', 'AREI', 'AREL', 'AWNC', 'AWNI', 'CCN3', 'CDNUMC', 'CLDHGH', 'CLDICE', + 'CLDLIQ', 'CLDLOW', 'CLDMED', 'CLDTOT', 'CLOUD', 'CONCLD', 'DMS', 'FICE', 'FLDS', + 'FLNS', 'FLNS', 'FLNT', 'FLNT', 'FLUT', 'FLUT', 'FREQI', 'FREQL', 'FREQR', + 'FREQS', 'FSDS', 'FSDS', 'FSNS', 'FSNS', 'FSNT', 'FSNT', 'FSNTOA', 'FSNTOA', + 'H2SO4', 'H2SO4_sfgaex1', 'ICEFRAC', 'ICIMR', 'ICWMR', 'IWC', 'LWCF', 'OMEGA', 'OMEGAT', + 'PBLH', 'PRECC', 'PRECL', 'PRECSC', 'PRECSL', 'PS', 'PSL', 'Q', 'QFLX', + 'QRL', 'QRS', 'QT', 'RAINQM', 'RCM_CLUBB', 'RELHUM', 'RELVAR', 'RTP2_CLUBB', 'RTPTHLP_CLUBB', + 'SFDMS', 'SFSOAG', 'SNOWQM', 'SO2', 'SO2_CLXF', 'SOLIN', 'SWCF', 'T', 'TAUBLJX', + 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TGCLDCWP', 'TGCLDIWP', 'TGCLDLWP', 'TMQ', + 'TREFHT', 'TS', 'U', 'U10', 'UP2_CLUBB', 'UPWP_CLUBB', 'UU', 'V', 'VP2_CLUBB', + 'VPWP_CLUBB', 'VQ', 'VU', 'VV', 'WP2_CLUBB', 'WP3_CLUBB', 'WPRCP_CLUBB', 'WPRTP_CLUBB', 'WPTHLP_CLUBB', + 'WPTHVP_CLUBB', 'WSUB', 'Z3', 'bc_a1', 'bc_a1DDF', 'bc_a1SFWET', 'bc_a1_SRF', 'bc_a4', 'bc_a4DDF', + 'bc_a4SFWET', 'bc_a4_SRF', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'num_a2', 'num_a3', 'num_a4', 'so4_a1', + 'so4_a2', 'so4_a3', 'so4_c1', 'O3', 'O3colAbove' + diff --git a/bld/namelist_files/use_cases/hist_cam6.xml b/bld/namelist_files/use_cases/hist_cam6.xml index ccc629f7bf..5cf005c36a 100644 --- a/bld/namelist_files/use_cases/hist_cam6.xml +++ b/bld/namelist_files/use_cases/hist_cam6.xml @@ -1,6 +1,8 @@ + cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.cam.i.0301-01-01-00000.nc + 'atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc' 'atm/cam/tracer_cnst' @@ -27,7 +29,40 @@ 'SERIAL' 'CO2','CH4','N2O','CFC11eq','CFC12' - + + 'dst_a1', 'dst_c1', 'dst_a3', 'dst_c3', 'dst_a1_SRF', 'dst_a3_SRF', 'dst_a1DDF', 'dst_a1SFWET', 'dst_c1DDF', + 'dst_c1SFWET', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c3DDF', 'dst_c3SFWET', 'SSAVIS', 'AODABS', 'AODDUST2', 'bc_a1', + 'bc_a4', 'dst_a1', 'dst_a2', 'dst_a3', 'ncl_a1', 'ncl_a1', 'ncl_a2', 'ncl_a3', 'pom_a1', + 'pom_a4', 'so4_a1', 'so4_a2', 'so4_a3', 'soa_a1', 'soa_a2', 'bc_c1', 'bc_c4', 'dst_c1', + 'dst_c2', 'dst_c3', 'ncl_c1', 'ncl_c1', 'ncl_c2', 'ncl_c3', 'pom_c1', 'pom_c4', 'so4_c1', + 'so4_c2', 'so4_c3', 'soa_c1', 'soa_c2', 'num_a1', 'num_a2', 'num_a4', 'num_c1', 'num_c2', + 'num_c3', 'bc_a1SFWET', 'bc_a4SFWET', 'dst_a1SFWET', 'dst_a2SFWET', 'dst_a3SFWET', 'ncl_a1SFWET', 'ncl_a2SFWET', 'ncl_a3SFWET', + 'pom_a1SFWET', 'pom_a4SFWET', 'so4_a1SFWET', 'so4_a2SFWET', 'so4_a3SFWET', 'soa_a1SFWET', 'soa_a2SFWET', 'bc_c1SFWET', 'bc_c4SFWET', + 'dst_c1SFWET', 'dst_c2SFWET', 'dst_c3SFWET', 'ncl_c1SFWET', 'ncl_c2SFWET', 'ncl_c3SFWET', 'pom_c1SFWET', 'pom_c4SFWET', 'so4_c1SFWET', + 'so4_c2SFWET', 'so4_c3SFWET', 'soa_c1SFWET', 'soa_c2SFWET', 'bc_a1DDF', 'bc_a4DDF', 'dst_a1DDF', 'dst_a2DDF', 'dst_a3DDF', + 'ncl_a1DDF', 'ncl_a2DDF', 'ncl_a3DDF', 'pom_a1DDF', 'pom_a4DDF', 'so4_a1DDF', 'so4_a2DDF', 'so4_a3DDF', 'soa_a1DDF', + 'soa_a2DDF', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', 'dst_c3DDF', 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', + 'pom_c1DDF', 'pom_c4DDF', 'so4_c1DDF', 'so4_c2DDF', 'so4_c3DDF', 'soa_c1DDF', 'soa_c2DDF', 'bc_a4_CLXF', 'pom_a4_CLXF', + 'so4_a1_CLXF', 'so4_a2_CLXF', 'SFbc_a4', 'SFpom_a4', 'SFso4_a1', 'SFso4_a2', 'so4_a1_sfgaex1', 'so4_a2_sfgaex1', 'so4_a3_sfgaex1', + 'soa_a1_sfgaex1', 'soa_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_c1AQH2SO4', 'so4_c2AQH2SO4', 'so4_c3AQH2SO4', 'so4_c1AQSO4', 'so4_c2AQSO4', 'so4_c3AQSO4', + 'ADRAIN', 'ADSNOW', 'ANRAIN', 'ANSNOW', 'AODDUST', 'AODVIS', 'AQRAIN', 'AQSNOW', 'AQSO4_H2O2', + 'AQSO4_O3', 'AREI', 'AREL', 'AWNC', 'AWNI', 'CCN3', 'CDNUMC', 'CLDHGH', 'CLDICE', + 'CLDLIQ', 'CLDLOW', 'CLDMED', 'CLDTOT', 'CLOUD', 'CONCLD', 'DMS', 'FICE', 'FLDS', + 'FLNS', 'FLNS', 'FLNT', 'FLNT', 'FLUT', 'FLUT', 'FREQI', 'FREQL', 'FREQR', + 'FREQS', 'FSDS', 'FSDS', 'FSNS', 'FSNS', 'FSNT', 'FSNT', 'FSNTOA', 'FSNTOA', + 'H2SO4', 'H2SO4_sfgaex1', 'ICEFRAC', 'ICIMR', 'ICWMR', 'IWC', 'LWCF', 'OMEGA', 'OMEGAT', + 'PBLH', 'PRECC', 'PRECL', 'PRECSC', 'PRECSL', 'PS', 'PSL', 'Q', 'QFLX', + 'QRL', 'QRS', 'QT', 'RAINQM', 'RCM_CLUBB', 'RELHUM', 'RELVAR', 'RTP2_CLUBB', 'RTPTHLP_CLUBB', + 'SFDMS', 'SFSOAG', 'SNOWQM', 'SO2', 'SO2_CLXF', 'SOLIN', 'SWCF', 'T', 'TAUBLJX', + 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TGCLDCWP', 'TGCLDIWP', 'TGCLDLWP', 'TMQ', + 'TREFHT', 'TS', 'U', 'U10', 'UP2_CLUBB', 'UPWP_CLUBB', 'UU', 'V', 'VP2_CLUBB', + 'VPWP_CLUBB', 'VQ', 'VU', 'VV', 'WP2_CLUBB', 'WP3_CLUBB', 'WPRCP_CLUBB', 'WPRTP_CLUBB', 'WPTHLP_CLUBB', + 'WPTHVP_CLUBB', 'WSUB', 'Z3', 'bc_a1', 'bc_a1DDF', 'bc_a1SFWET', 'bc_a1_SRF', 'bc_a4', 'bc_a4DDF', + 'bc_a4SFWET', 'bc_a4_SRF', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'num_a2', 'num_a3', 'num_a4', 'so4_a1', + 'so4_a2', 'so4_a3', 'so4_c1', 'O3', 'O3colAbove' + + + 1850-2000 diff --git a/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml b/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml index bb5a471e8c..c9c6a7b498 100644 --- a/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml @@ -8,8 +8,7 @@ cesm2_init/b.e21.BW1850.f09_g17.CMIP6-piControl.001/0056-01-01/b.e21.BW1850.f09_g17.CMIP6-piControl.001.cam.i.0056-01-01-00000.nc -atm/waccm/ic/b.e20.BW1850.f19_g17.alpha07b.002.cam.i.1851-01-01-00000_c170911.nc -atm/waccm/ic/b1850.waccm-mam3_4x5_L70.cam2.i.0156-01-01.c141201.nc +cesm2_init/b.e20.BWma1850.f19_g17.release_cesm2_1_0.020/0289-01-01/b.e20.BWma1850.f19_g17.release_cesm2_1_0.020.cam.i.0289-01-01-00000.nc atm/cam/solar/SolarForcingCMIP6piControl_c160921.nc diff --git a/bld/namelist_files/use_cases/waccm_ma_hist_cam4.xml b/bld/namelist_files/use_cases/waccm_ma_hist_cam4.xml index 2c1df5e57f..f94c271a17 100644 --- a/bld/namelist_files/use_cases/waccm_ma_hist_cam4.xml +++ b/bld/namelist_files/use_cases/waccm_ma_hist_cam4.xml @@ -6,6 +6,8 @@ atm/waccm/ic/f.e11.FWTREFC1.f19_f19.001.cam.i.1955-01-01-00000_c141024.nc +atm/cam/topo/USGS-gtopo30_1.9x2.5_remap_c050602.nc + 1.3 diff --git a/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml b/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml index 5e40e7d871..f1c005989c 100644 --- a/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml @@ -16,8 +16,7 @@ cesm2_init/b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.001/1950-01-01/b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.001.cam.i.1950-01-01-00000.nc -atm/waccm/ic/f.e15.FWmaAMIP.f19_f19.misc08_cam5_4_81.003.cam.i.1980-01-01-00000_c160928.nc -atm/waccm/ic/f2000.waccm-mam3_4x5_L70.cam2.i.0017-01-01.c121113.nc +cesm2_init/b.e20.BWma1850.f19_g17.release_cesm2_1_0.020/0289-01-01/b.e20.BWma1850.f19_g17.release_cesm2_1_0.020.cam.i.0289-01-01-00000.nc diff --git a/doc/ChangeLog b/doc/ChangeLog index 9bcd6b0ba0..2432c55d81 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,81 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_25 +Originator(s): fvitt +Date: 11 Apr 2019 +One-line Summary: Changes for 2-degrees configurations + +Purpose of changes: + - use 2-degrees emissions files + - use climate parameters tuned for 2-degrees + - add reference cases for 2-degrees + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: cacraig + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: +M components/cam/bld/namelist_files/namelist_defaults_cam.xml +M components/cam/bld/namelist_files/use_cases/1850_cam6.xml +M components/cam/bld/namelist_files/use_cases/hist_cam6.xml +M components/cam/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml +M components/cam/bld/namelist_files/use_cases/waccm_ma_hist_cam4.xml +M components/cam/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml + +Testing: + SMS_D_Ld1.f09_g17.B1850cmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + SMS_Ld2.f09_g17.B1850.cheyenne_intel.allactive-defaultio (Overall: PASS) details: + SMS_Ld2.f09_g17.BHIST.cheyenne_intel.allactive-defaultio (Overall: PASS) details: + SMS_Ld2.f19_g17.B1850.cheyenne_intel.allactive-defaultio (Overall: DIFF) details: + SMS_Ld2.f19_g17.BHIST.cheyenne_intel.allactive-defaultio (Overall: DIFF) details: + + ERS_Ld3.f09_g17.BWSSP126cmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + ERS_Ld3.f09_g17.BWSSP245cmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + ERS_Ld3.f09_g17.BWSSP370cmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + ERS_Ld3.f09_g17.BWSSP534oscmip6.cheyenne_intel.allactive-defaultio_min (Overall: FAIL) details: + ERS_Ld3.f09_g17.BWSSP585cmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + SMS_D_Ld1.f09_g17.BWCO2x4cmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + SMS_D_Ln9.f09_g17.BWSSP126cmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + SMS_D_Ln9.f09_g17.BWSSP245cmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + SMS_D_Ln9.f09_g17.BWSSP370cmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + SMS_D_Ln9.f09_g17.BWSSP534oscmip6.cheyenne_intel.allactive-defaultio_min (Overall: FAIL) details: + SMS_D_Ln9.f09_g17.BWSSP585cmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + SMS_Ld1.f09_g17.BW1850.cheyenne_intel.allactive-default (Overall: PASS) details: + SMS_Ld1.f09_g17.BW1PCTcmip6.cheyenne_intel.allactive-defaultio_min (Overall: PASS) details: + SMS_Ld1.f09_g17.BWHIST.cheyenne_intel.allactive-default (Overall: PASS) details: + SMS_Ld1.f09_g17.BWma1850.cheyenne_intel.allactive-default (Overall: PASS) details: + SMS_Ld1.f09_g17.BWmaHIST.cheyenne_intel.allactive-default (Overall: DIFF) details: + SMS_Ld1.f09_g17.BWsc1850.cheyenne_intel.allactive-default (Overall: DIFF) details: + SMS_Ld1.f09_g17.BWscHIST.cheyenne_intel.allactive-default (Overall: PASS) details: + SMS_Ld5.f19_g17.BWma1850.cheyenne_intel.allactive-default (Overall: DIFF) details: + SMS_Ld5.f19_g17.BWmaHIST.cheyenne_intel.allactive-default (Overall: DIFF) details: + +cheyenne/intel/aux_cam: + ERP_D_Ln9.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_D_Ln9.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s NLCOMP + FAIL ERP_D_Ln9.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s BASELINE cesm2.1-alphabranch + ERP_Ln9.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_Ln9.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s NLCOMP + FAIL ERP_Ln9.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s BASELINE cesm2.1-alphabranch + ERS_Ln9.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details: + FAIL ERS_Ln9.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s NLCOMP + + - answer changes to 2-degree configurations + +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_24 Originator(s): eaton Date: Fri Mar 29 16:39:43 MDT 2019 From f8ea453fb75255f017dcdbb95b5c124bb9764913 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 25 Apr 2019 15:54:22 -0600 Subject: [PATCH 030/239] 'Added SSP245 and SSP360 and modified files in SSP126 Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@91083 Committed by Cheryl Craig at 2019-04-25 15:54:22 -0600 Original svn commit message: Added SSP245 and SSP360 and modified files in SSP126' --- bld/namelist_files/use_cases/ssp126_cam6.xml | 95 ++++++++++---------- bld/namelist_files/use_cases/ssp245_cam6.xml | 91 +++++++++++++++++++ bld/namelist_files/use_cases/ssp370_cam6.xml | 90 +++++++++++++++++++ cime_config/config_component.xml | 4 +- doc/ChangeLog | 48 ++++++++++ 5 files changed, 280 insertions(+), 48 deletions(-) create mode 100644 bld/namelist_files/use_cases/ssp245_cam6.xml create mode 100644 bld/namelist_files/use_cases/ssp370_cam6.xml diff --git a/bld/namelist_files/use_cases/ssp126_cam6.xml b/bld/namelist_files/use_cases/ssp126_cam6.xml index 9d522fab69..fbb281f3fd 100644 --- a/bld/namelist_files/use_cases/ssp126_cam6.xml +++ b/bld/namelist_files/use_cases/ssp126_cam6.xml @@ -3,46 +3,45 @@ - 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2OemissionCH4oxidationx2_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190307.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2OemissionCH4oxidationx2_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190307.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190225.nc', 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ene_vertical_mol_175001-210012_0.9x1.25_c20180830.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190225.nc', 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' - - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_DMS_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_anthro_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ene_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_bb_surface_mol_175001-210012_0.9x1.25_c20180830.nc', - 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a2_anthro-res_surface_mol_175001-210012_0.9x1.25_c20180830.nc' - 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SOAGx1.5_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', - 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SOAGx1.5_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', - 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp/emissions-cmip6-SOAGx1.5_biogenic_surface_mol_175001-210101_0.9x1.25_c20190329.nc' + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SOAGx1.5_anthro_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp126/emissions-cmip6-ScenarioMIP_IAMC-IMAGE-ssp126-1-1_SOAGx1.5_bb_surface_mol_175001-210101_0.9x1.25_c20190225.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp/emissions-cmip6-SOAGx1.5_biogenic_surface_mol_175001-210101_0.9x1.25_c20190329.nc' - - + atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + 'atm/cam/tracer_cnst' 'tracer_cnst_halons_3D_L70_2014-2101_CMIP6-SSP1-2.6_c190307.nc' @@ -52,42 +51,44 @@ 'atm/cam/ozone_strataero' - 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP126_c190221.nc' + 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP126_c190221.nc' 'O3' 'SERIAL' - INTERP_MISSING_MONTHS + INTERP_MISSING_MONTHS INTERP_MISSING_MONTHS - 'SERIAL' 'atm/cam/ozone_strataero' - 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP126_c190221.nc' + 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP126_c190221.nc' .true. -.true. -atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_0.9x1.25_c20190207.nc -atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_1.9x2.5_c20190207.nc -.true. -SERIAL -atm/cam/ggas -ac_CO2 -> emissions-cmip6_CO2_anthro_ac_ssp126_201401-210112_fv_0.9x1.25_c20190207.txt -emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_0.9x1.25_c20190207.nc -ac_CO2 -> emissions-cmip6_CO2_anthro_ac_ssp126_201401-210112_fv_1.9x2.5_c20190207.txt -emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_1.9x2.5_c20190207.nc + + .true. + atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_0.9x1.25_c20190207.nc + atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_1.9x2.5_c20190207.nc + + .true. + SERIAL + atm/cam/ggas + ac_CO2 -> emissions-cmip6_CO2_anthro_ac_ssp126_201401-210112_fv_0.9x1.25_c20190207.txt + atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_0.9x1.25_c20190207.nc + ac_CO2 -> emissions-cmip6_CO2_anthro_ac_ssp126_201401-210112_fv_1.9x2.5_c20190207.txt + atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-IMAGE-ssp126_201401-210112_fv_1.9x2.5_c20190207.nc - 'CHEM_LBC_FILE' - atm/waccm/lb/LBC_2014-2500_CMIP6_SSP126_0p5degLat_GlobAnnAvg_c190301.nc - 'SERIAL' - 'CO2','CH4','N2O','CFC11eq','CFC12' + + 'CHEM_LBC_FILE' + atm/waccm/lb/LBC_2014-2500_CMIP6_SSP126_0p5degLat_GlobAnnAvg_c190301.nc + 'SERIAL' + 'CO2','CH4','N2O','CFC11eq','CFC12' - 1850-2100 + 1850-2100 diff --git a/bld/namelist_files/use_cases/ssp245_cam6.xml b/bld/namelist_files/use_cases/ssp245_cam6.xml new file mode 100644 index 0000000000..93d19b279b --- /dev/null +++ b/bld/namelist_files/use_cases/ssp245_cam6.xml @@ -0,0 +1,91 @@ + + + + + + + + + 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2OemissionCH4oxidationx2_3D_L70_1849-2101_CMIP6ensAvg_SSP2-4.5_c190403.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' + + + + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc' + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SOAGx1.5_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp245/emissions-cmip6-ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245-1-1_SOAGx1.5_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp/emissions-cmip6-SOAGx1.5_biogenic_surface_mol_175001-210101_0.9x1.25_c20190329.nc' + + + INTERP_MISSING_MONTHS + INTERP_MISSING_MONTHS + + + atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + + 'atm/cam/tracer_cnst' + 'tracer_cnst_halons_3D_L70_1849-2101_CMIP6ensAvg_SSP2-4.5_c190403.nc' + 'O3','OH','NO3','HO2' + 'INTERP_MISSING_MONTHS' + '' + + 'atm/cam/ozone_strataero' + 'ozone_strataero_WACCM_L70_zm5day_18500101-21010201_CMIP6histEnsAvg_SSP245_c190403.nc' + 'O3' + 'SERIAL' + + 'SERIAL' + 'atm/cam/ozone_strataero' + 'ozone_strataero_WACCM_L70_zm5day_18500101-21010201_CMIP6histEnsAvg_SSP245_c190403.nc' + .true. + + +.true. +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245_201401-210112_fv_0.9x1.25_c20190207.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245_201401-210112_fv_1.9x2.5_c20190207.nc +.true. + + SERIAL + atm/cam/ggas + ac_CO2 -> emissions-cmip6_CO2_anthro_ac_GLOBIOM-ssp245_201401-210112_fv_0.9x1.25_c20190207.txt + atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245_201401-210112_fv_0.9x1.25_c20190207.nc + ac_CO2 -> emissions-cmip6_CO2_anthro_ac_GLOBIOM-ssp245_201401-210112_fv_1.9x2.5_c20190207.txt + atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-MESSAGE-GLOBIOM-ssp245_201401-210112_fv_1.9x2.5_c20190207.nc + + + + + 'CHEM_LBC_FILE' + atm/waccm/lb/LBC_2014-2500_CMIP6_SSP245_0p5degLat_GlobAnnAvg_c190301.nc + 'SERIAL' + 'CO2','CH4','N2O','CFC11eq','CFC12' + + + 1850-2100 + + diff --git a/bld/namelist_files/use_cases/ssp370_cam6.xml b/bld/namelist_files/use_cases/ssp370_cam6.xml new file mode 100644 index 0000000000..e3d6720a91 --- /dev/null +++ b/bld/namelist_files/use_cases/ssp370_cam6.xml @@ -0,0 +1,90 @@ + + + + + + + + + 'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2OemissionCH4oxidationx2_3D_L70_1849-2101_CMIP6ensAvg_SSP3-7.0_c190403.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc' + + + + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-SSP_DMS_other_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc' + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SOAGx1.5_anthro_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_SOAGx1.5_bb_surface_mol_175001-210101_0.9x1.25_c20190222.nc', + 'SOAG -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp/emissions-cmip6-SOAGx1.5_biogenic_surface_mol_175001-210101_0.9x1.25_c20190329.nc' + + + INTERP_MISSING_MONTHS + INTERP_MISSING_MONTHS + + + atm/cam/solar/SolarForcingCMIP6_18491230-22991231_c171031.nc + + + 'atm/cam/tracer_cnst' + 'tracer_cnst_halons_3D_L70_1849-2101_CMIP6ensAvg_SSP3-7.0_c190403.nc' + 'O3','OH','NO3','HO2' + 'INTERP_MISSING_MONTHS' + '' + + 'atm/cam/ozone_strataero' + 'ozone_strataero_WACCM_L70_zm5day_18500101-21010201_CMIP6histEnsAvg_SSP370_c190403.nc' + 'O3' + 'SERIAL' + + 'SERIAL' + 'atm/cam/ozone_strataero' + 'ozone_strataero_WACCM_L70_zm5day_18500101-21010201_CMIP6histEnsAvg_SSP370_c190403.nc' + .true. + + + .true. + atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-AIM-ssp370_201401-210112_fv_0.9x1.25_c20190207.nc + atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_ScenarioMIP_IAMC-AIM-ssp370_201401-210112_fv_1.9x2.5_c20190207.nc + .true. + + SERIAL + atm/cam/ggas + ac_CO2 -> emissions-cmip6_CO2_anthro_ac_ssp370_201401-210112_fv_0.9x1.25_c20190207.txt + atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-AIM-ssp370_201401-210112_fv_0.9x1.25_c20190207.nc + ac_CO2 -> emissions-cmip6_CO2_anthro_ac_ssp370_201401-210112_fv_1.9x2.5_c20190207.txt + atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_ScenarioMIP_IAMC-AIM-ssp370_201401-210112_fv_1.9x2.5_c20190207.nc + + + + 'CHEM_LBC_FILE' + atm/waccm/lb/LBC_2014-2500_CMIP6_SSP370_0p5degLat_GlobAnnAvg_c190301.nc + 'SERIAL' + 'CO2','CH4','N2O','CFC11eq','CFC12' + + + 1850-2100 + + diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index f8a71e6884..df9c1dc019 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -228,8 +228,10 @@ 1850-PD_cam5 - ssp585_cam6 ssp126_cam6 + ssp245_cam6 + ssp370_cam6 + ssp585_cam6 waccm_tsmlt_ssp126_cam6 waccm_tsmlt_ssp245_cam6 waccm_tsmlt_ssp370_cam6 diff --git a/doc/ChangeLog b/doc/ChangeLog index 2432c55d81..97526ee540 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,53 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_26 +Originator(s): cacraig +Date: April 25, 2019 +One-line Summary: Added SSP245 and SSP360 and modified files in SSP126 + +Purpose of changes: + - Added SSP245 and SSP360 + - Modified SSP126 + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: +A components/cam/bld/namelist_files/use_cases/ssp245_cam6.xml +A components/cam/bld/namelist_files/use_cases/ssp370_cam6.xml + - added use_cases for SSP245 and SSP370 (based on google docs) + +List all existing files that have been modified, and describe the changes: + M . +M SVN_EXTERNAL_DIRECTORIES + - update manage_externals + +M components/cam/bld/namelist_files/use_cases/ssp126_cam6.xml + - updated use_case based on the updated google doc + +M components/cam/cime_config/config_component.xml + - add the hooks for SSP245 and SSP370 + +Testing: + Ran create_newcase, case.setup, preview_namelists and check_input_data on + all SSPs and at both 1 and 2 degree resolutions + + Did not perform any actual runs + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_25 Originator(s): fvitt Date: 11 Apr 2019 From ef07dc9274dcdfda52e6bc782d899323b1e6bf73 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Tue, 30 Apr 2019 17:01:53 -0600 Subject: [PATCH 031/239] 'M components/cam/bld/namelist_files/namelist_defaults_cam.xml Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@91107 Committed by Francis Vitt at 2019-04-30 17:01:53 -0600 Original svn commit message: M components/cam/bld/namelist_files/namelist_defaults_cam.xml M components/cam/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml M components/cam/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml M components/cam/cime_config/config_component.xml M components/cam/cime_config/config_compsets.xml M components/cam/cime_config/testdefs/testlist_cam.xml M components/cam/doc/ChangeLog M components/cam/src/chemistry/modal_aero/aero_model.F90 ' --- bld/namelist_files/namelist_defaults_cam.xml | 10 ++-- .../use_cases/waccm_ma_1850_cam6.xml | 2 + .../use_cases/waccm_ma_hist_cam6.xml | 2 + cime_config/config_component.xml | 15 ++--- cime_config/config_compsets.xml | 5 ++ cime_config/testdefs/testlist_cam.xml | 13 +++++ doc/ChangeLog | 55 +++++++++++++++++++ src/chemistry/modal_aero/aero_model.F90 | 30 ++++------ 8 files changed, 100 insertions(+), 32 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 851bf8725b..444e59811b 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -768,12 +768,12 @@ atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/H2OemissionCH4oxidationx2_3D_L70_1849-2015_CMIP6ensAvg_1.9x2.5_c190308.nc atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_so4_a1_anthro-ene_vertical_1750-2015_1.9x2.5_c20170616.nc -atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_1.9x2.5_c20181024.nc -atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_1.9x2.5_c20181024.nc -atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SO2_contvolcano_vertical_850-5000_1.9x2.5_c20181024.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_1.9x2.5_c20190417.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_1.9x2.5_c20190417.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SO2_contvolcano_vertical_850-5000_1.9x2.5_c20190417.nc atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a1_anthro-ene_vertical_1750-2015_1.9x2.5_c20170616.nc -atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_1.9x2.5_c20181024.nc -atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_1.9x2.5_c20181024.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_1.9x2.5_c20190417.nc +atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_1.9x2.5_c20190417.nc atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_SO2_aircraft_vertical_1750-2015_1.9x2.5_c20170608.nc atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_bc_a4_aircraft_vertical_1750-2015_1.9x2.5_c20170608.nc atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_NO2_aircraft_vertical_1750-2015_1.9x2.5_c20170608.nc diff --git a/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml b/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml index c9c6a7b498..56c98308a2 100644 --- a/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml @@ -53,6 +53,8 @@ CYCLICAL 1850 +'noy', 'nhx' + 1, 30, 120, 240, 240, 480, 365, 73, 30 diff --git a/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml b/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml index f1c005989c..d48f59e603 100644 --- a/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml @@ -45,6 +45,8 @@ INTERP_MISSING_MONTHS +'noy', 'nhx' + 1, 30, 120, 240, 240, 480, 365, 73, 30 diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index df9c1dc019..9351093809 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -288,17 +288,18 @@ scenario_ghg='RAMP_CO2_ONLY'ramp_co2_annual_rate=1 co2vmr=1138.8e-6 - flbc_cycle_yr=1 - flbc_file='$DIN_LOC_ROOT/atm/waccm/lb/LBC_CMIP6abrupt4xCO2_cyclicalYear1_0p5degLat_c180929.nc' + flbc_cycle_yr=1 + flbc_file='$DIN_LOC_ROOT/atm/waccm/lb/LBC_CMIP6abrupt4xCO2_cyclicalYear1_0p5degLat_c180929.nc' + nlte_limit_co2=.true. ncdata='$DIN_LOC_ROOT/atm/waccm/ic/b.e21.BW1850.f09_g17.CMIP6-piControl.001.cam.i.0070-01-01.abrupt4xCO2_c181003.nc' - nlte_limit_co2=.true. + ncdata='$DIN_LOC_ROOT/atm/waccm/ic/b.e20.BWma1850.f19_g17.release_cesm2_1_0.020.cam.i.0289-01-01.abrupt4xCO2_c190426.nc' flbc_type='SERIAL' flbc_file='$DIN_LOC_ROOT/atm/waccm/lb/LBC_CMIP6_1pctCO2_y1-165_GlobAnnAvg_0p5degLat_c180929.nc' flbc_list='CO2','CH4','N2O','CFC11eq','CFC12' - flbc_type='SERIAL' - flbc_cycle_yr=-1 - flbc_file='$DIN_LOC_ROOT/atm/waccm/lb/LBC_CMIP6_1pctCO2ramp_y1-165_0p5degLat_c180930.nc' - nlte_limit_co2=.true. + flbc_type='SERIAL' + flbc_cycle_yr=-1 + nlte_limit_co2=.true. + flbc_file='$DIN_LOC_ROOT/atm/waccm/lb/LBC_CMIP6_1pctCO2ramp_y1-165_0p5degLat_c180930.nc' co2_cycle_rad_passive=.true. run_component_cam diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 32e79eaf05..9a1085179d 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -269,6 +269,11 @@ + + FWmaHIST_BGC + HIST_CAM60%WCCM_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV + + FW1850 1850_CAM60%WCTS_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV diff --git a/cime_config/testdefs/testlist_cam.xml b/cime_config/testdefs/testlist_cam.xml index 2f6161b26a..85ddd7235c 100644 --- a/cime_config/testdefs/testlist_cam.xml +++ b/cime_config/testdefs/testlist_cam.xml @@ -525,6 +525,14 @@ + + + + + + + + @@ -663,6 +671,11 @@ + + + + + diff --git a/doc/ChangeLog b/doc/ChangeLog index 97526ee540..01a62f4e2a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,60 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_27 +Originator(s): mmills, fvitt +Date: 30 Apr 2019 +One-line Summary: Corrections to SAD; update for 2-degrees configurations + +Purpose of changes: + + - correct aerosol surface area used in heterogeneous chemistry reactions + - updates for 2-degrees CMIP6 runs + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: cacraig, eaton + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: + +M components/cam/bld/namelist_files/namelist_defaults_cam.xml +M components/cam/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml +M components/cam/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml +M components/cam/cime_config/config_component.xml +M components/cam/cime_config/config_compsets.xml +M components/cam/cime_config/testdefs/testlist_cam.xml + - updates for 2-degrees + +M components/cam/src/chemistry/modal_aero/aero_model.F90 + - corrections to surface area calculation + +Testing: + + SMS_Ld1.f19_g17.B1850.cheyenne_intel.allactive-defaultio + SMS_Ld1.f19_g17.B1PCTcmip6.cheyenne_intel.allactive-defaultio + SMS_Ld1.f19_g17.BCO2x4cmip6.cheyenne_intel.allactive-defaultio + SMS_Ld1.f19_g17.BHIST.cheyenne_intel.allactive-defaultio + + ERP_Ln9.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s + SMS_D_Ln9.f19_f19_mg17.FWmaHIST.cheyenne_intel.cam-outfrq9s + SMS_D_Ln9.f19_f19_mg17.FWsc2010climo.cheyenne_intel.cam-outfrq9s + SMS_D_Ln9.f19_f19_mg17.FWscHIST.cheyenne_intel.cam-outfrq9s + SMS_D_Ln9.f19_g17.BWmaCO2x4cmip6.cheyenne_intel.allactive-default + SMS_Ld1.f19_f19_mg17.FWmaHIST_BGC.cheyenne_intel.cam-reduced_hist1d + +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_26 Originator(s): cacraig Date: April 25, 2019 diff --git a/src/chemistry/modal_aero/aero_model.F90 b/src/chemistry/modal_aero/aero_model.F90 index 4c96121b3a..823cc4b9ff 100644 --- a/src/chemistry/modal_aero/aero_model.F90 +++ b/src/chemistry/modal_aero/aero_model.F90 @@ -2033,7 +2033,7 @@ subroutine surf_area_dens( ncol, mmr, pmid, temp, diam, beglev, endlev, sad, ref real(r8),optional, intent(out) :: sfc(:,:,:) ! local vars - real(r8) :: sad_mode(pcols,pver,ntot_amode),sad_mode_correct(pcols,pver,ntot_amode),sad_correct(pcols,pver) + real(r8) :: sad_mode(pcols,pver,ntot_amode),radeff(pcols,pver) real(r8) :: vol(pcols,pver),vol_mode(pcols,pver,ntot_amode) real(r8) :: rho_air integer :: i,k,l,m @@ -2046,8 +2046,6 @@ subroutine surf_area_dens( ncol, mmr, pmid, temp, diam, beglev, endlev, sad, ref sad = 0._r8 sad_mode = 0._r8 - sad_correct = 0._r8 - sad_mode_correct = 0._r8 vol = 0._r8 vol_mode = 0._r8 reff = 0._r8 @@ -2068,32 +2066,24 @@ subroutine surf_area_dens( ncol, mmr, pmid, temp, diam, beglev, endlev, sad, ref chm_mass = chm_mass + mmr(i,k,index_chm_mass(l,m)) end do if ( tot_mass > 0._r8 ) then - ! SAD calculation below is incorrect, but consistent with CMIP6 - sad_mode(i,k,l) = (chm_mass/tot_mass)**(2._r8/3._r8) * & - mmr(i,k,num_idx(l))*rho_air*pi*diam(i,k,l)**2._r8*& - exp(2._r8*alnsg_amode(l)**2._r8) ! m^2/m^3 + ! surface area density + sad_mode(i,k,l) = chm_mass/tot_mass & + * mmr(i,k,num_idx(l))*rho_air*pi*diam(i,k,l)**2._r8 & + * exp(2._r8*alnsg_amode(l)**2._r8) ! m^2/m^3 sad_mode(i,k,l) = 1.e-2_r8 * sad_mode(i,k,l) ! cm^2/cm^3 - - ! Corrected SAD calculation without 2/3 power in chem weighting, for use in effective radius calculation - sad_mode_correct(i,k,l) = chm_mass/tot_mass * & - mmr(i,k,num_idx(l))*rho_air*pi*diam(i,k,l)**2._r8*& - exp(2._r8*alnsg_amode(l)**2._r8) ! m^2/m^3 - sad_mode_correct(i,k,l) = 1.e-2_r8 * sad_mode_correct(i,k,l) ! cm^2/cm^3 - ! Volume calculation, for use in effective radius calculation - vol_mode(i,k,l) = chm_mass/tot_mass * & - mmr(i,k,num_idx(l))*rho_air*pi/6._r8*diam(i,k,l)**3._r8*& - exp(4.5_r8*alnsg_amode(l)**2._r8) ! m^3/m^3 = cm^3/cm^3 + ! volume calculation, for use in effective radius calculation + vol_mode(i,k,l) = chm_mass/tot_mass & + * mmr(i,k,num_idx(l))*rho_air*pi/6._r8*diam(i,k,l)**3._r8 & + * exp(4.5_r8*alnsg_amode(l)**2._r8) ! m^3/m^3 = cm^3/cm^3 else sad_mode(i,k,l) = 0._r8 - sad_mode_correct(i,k,l) = 0._r8 vol_mode(i,k,l) = 0._r8 end if end do sad(i,k) = sum(sad_mode(i,k,:)) - sad_correct(i,k) = sum(sad_mode_correct(i,k,:)) vol(i,k) = sum(vol_mode(i,k,:)) - reff(i,k) = 3._r8*vol(i,k)/sad_correct(i,k) + reff(i,k) = 3._r8*vol(i,k)/sad(i,k) enddo enddo From 55763b763228ab3a9fa1f0318912d1f57e8719c7 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Wed, 15 May 2019 08:22:16 -0600 Subject: [PATCH 032/239] 'Fix WACCMX temperature bug Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@91163 Committed by Francis Vitt at 2019-05-15 08:22:16 -0600 Original svn commit message: Fix WACCMX temperature bug M components/cam/doc/ChangeLog M components/cam/src/utils/physconst.F90 M components/cam/src/physics/cam/physics_types.F90 M components/cam/src/dynamics/fv/dp_coupling.F90 ' --- doc/ChangeLog | 50 +++++++++++++++++++++++++++++++ src/dynamics/fv/dp_coupling.F90 | 3 +- src/physics/cam/physics_types.F90 | 2 +- src/utils/physconst.F90 | 35 +++++++++++++++++----- 4 files changed, 80 insertions(+), 10 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 01a62f4e2a..abf02862b5 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,55 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_28 +Originator(s): fvitt +Date: 15 May 2019 +One-line Summary: Fix WACCMX temperature bug + +Purpose of changes: + + Correct the formulation of variable gas properties for instances when constituent + mass mixing ratios are dry. Inconsistencies of the calculation of specific + heat of air at different points in the code caused the energy fixer to apply a + bias to the tendencies of dry static energy. + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: cacraig, eaton + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: + +M components/cam/src/dynamics/fv/dp_coupling.F90 + - specify that the mixing ratios are moist when physconst_updates is invoked + +M components/cam/src/physics/cam/physics_types.F90 + - pass pdel and pdeldry to physconst_updates to convert mixing ratios to moist + +M components/cam/src/utils/physconst.F90 + - convert mixing ratios to moist in physconst_updates if needed + +Testing: + +cheyenne/intel/aux_cam: All PASS except expect baseline failures for waccx: + + ERS_Ln9.f19_f19_mg16.FXHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERS_Ln9.f19_f19_mg16.FXHIST.cheyenne_intel.cam-outfrq9s BASELINE cam_cesm2_1_rel_27 + SMS_D_Ln9.f19_f19_mg16.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details: + FAIL SMS_D_Ln9.f19_f19_mg16.FXHIST.cheyenne_intel.cam-outfrq9s_amie BASELINE cam_cesm2_1_rel_27 + +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_27 Originator(s): mmills, fvitt Date: 30 Apr 2019 diff --git a/src/dynamics/fv/dp_coupling.F90 b/src/dynamics/fv/dp_coupling.F90 index 61f2465308..a40afe461f 100644 --- a/src/dynamics/fv/dp_coupling.F90 +++ b/src/dynamics/fv/dp_coupling.F90 @@ -630,7 +630,8 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out) ! and compute molecular viscosity(kmvis) and conductivity(kmcnd) !----------------------------------------------------------------------------- if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then - call physconst_update(phys_state(lchnk)%q, phys_state(lchnk)%t, lchnk, ncol) + call physconst_update(phys_state(lchnk)%q, phys_state(lchnk)%t, lchnk, ncol, & + phys_state(lchnk)%pdel, phys_state(lchnk)%pdeldry, moist=.true.) endif !------------------------------------------------------------------------ diff --git a/src/physics/cam/physics_types.F90 b/src/physics/cam/physics_types.F90 index 8b31d00cdd..548f2f5da3 100644 --- a/src/physics/cam/physics_types.F90 +++ b/src/physics/cam/physics_types.F90 @@ -395,7 +395,7 @@ subroutine physics_update(state, ptend, dt, tend) ! Get indices for molecular weights and call WACCM-X physconst_update !------------------------------------------------------------------------ if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then - call physconst_update(state%q, state%t, state%lchnk, ncol) + call physconst_update(state%q, state%t, state%lchnk, state%ncol, state%pdel, state%pdeldry) endif if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then diff --git a/src/utils/physconst.F90 b/src/utils/physconst.F90 index 7670cd22b4..dda00a8155 100644 --- a/src/utils/physconst.F90 +++ b/src/utils/physconst.F90 @@ -254,7 +254,7 @@ end subroutine physconst_init !=============================================================================== - subroutine physconst_update(mmr, t, lchnk, ncol) + subroutine physconst_update(mmr, t, lchnk, ncol, pdel, pdeldry, moist) !----------------------------------------------------------------------- ! Update the physics "constants" that vary @@ -266,6 +266,9 @@ subroutine physconst_update(mmr, t, lchnk, ncol) real(r8), intent(in) :: t(pcols,pver) ! temperature t array from state structure integer, intent(in) :: lchnk ! Chunk number integer, intent(in) :: ncol ! number of columns + real(r8), intent(in) :: pdel(pcols,pver) + real(r8), intent(in) :: pdeldry(pcols,pver) + logical, optional, intent(in) :: moist ! !---------------------------Local storage------------------------------------------------------------- integer :: i,k ! column,level,constituent indices @@ -275,6 +278,9 @@ subroutine physconst_update(mmr, t, lchnk, ncol) real(r8):: dof1, dof2 ! Degress of freedom for cpairv calculation real(r8):: kv1, kv2, kv3, kv4 ! Coefficients for kmvis calculation real(r8):: kc1, kc2, kc3, kc4 ! Coefficients for kmcnd calculation + logical :: moist_mixtype + real(r8) :: to_moist_fact(ncol,pver) + !-------------------------------------------- ! Set constants needed for updates !-------------------------------------------- @@ -289,6 +295,17 @@ subroutine physconst_update(mmr, t, lchnk, ncol) kc3 = 75.9_r8 kc4 = 0.69_r8 + moist_mixtype = .false. + + if (present(moist)) then + moist_mixtype = moist + end if + if (moist_mixtype) then + to_moist_fact(:ncol,:) = 1._r8 + else + to_moist_fact(:ncol,:) = pdeldry(:ncol,:)/pdel(:ncol,:) + end if + if (o2_ndx<0 .or. o_ndx<0 .or. h_ndx<0) then call endrun('physconst_update: ERROR -- needed constituents are not available') endif @@ -298,9 +315,9 @@ subroutine physconst_update(mmr, t, lchnk, ncol) !-------------------------------------------- do k=1,pver do i=1,ncol - mmro = mmr(i,k, o_ndx) - mmro2 = mmr(i,k, o2_ndx) - mmrh = mmr(i,k, h_ndx) + mmro = mmr(i,k,o_ndx)*to_moist_fact(i,k) ! convert to moist mass mixing ratios + mmro2 = mmr(i,k,o2_ndx)*to_moist_fact(i,k) + mmrh = mmr(i,k,h_ndx)*to_moist_fact(i,k) mmrn2 = 1._r8-mmro-mmro2-mmrh mbarv(i,k,lchnk) = 1._r8/( mmro *o_mwi + & mmro2*o2_mwi + & @@ -319,9 +336,10 @@ subroutine physconst_update(mmr, t, lchnk, ncol) do k=2,pver do i=1,ncol - mmro = .5_r8*(mmr(i,k-1, o_ndx)+mmr(i,k,o_ndx)) - mmro2 = .5_r8*(mmr(i,k-1, o2_ndx)+mmr(i,k,o2_ndx)) - mmrn2 = 1._r8-mmro-mmro2 + mmro = .5_r8*(mmr(i,k-1,o_ndx) *to_moist_fact(i,k-1)+mmr(i,k,o_ndx) *to_moist_fact(i,k)) + mmro2 = .5_r8*(mmr(i,k-1,o2_ndx)*to_moist_fact(i,k-1)+mmr(i,k,o2_ndx)*to_moist_fact(i,k)) + mmrh = .5_r8*(mmr(i,k-1,h_ndx) *to_moist_fact(i,k-1)+mmr(i,k,h_ndx) *to_moist_fact(i,k)) + mmrn2 = 1._r8-mmro-mmro2-mmrh mbarvi = .5_r8*(mbarv(i,k-1,lchnk)+mbarv(i,k,lchnk)) tint = .5_r8*(t(i,k-1)+t(i,k)) @@ -347,7 +365,8 @@ end subroutine physconst_update !=============================================================================== subroutine physconst_calc_kappav( i0,i1,j0,j1,k0,k1,ntotq, tracer, kappav, cpv ) - + ! assumes moist MMRs + ! args integer, intent(in) :: i0,i1,j0,j1,k0,k1, ntotq real(r8), intent(in) :: tracer(i0:i1,j0:j1,k0:k1,ntotq) ! Tracer array From d1d2dd613f217834962f18c8982327c3577d25b0 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Wed, 29 May 2019 14:14:18 -0600 Subject: [PATCH 033/239] 'M bld/namelist_files/use_cases/ssp585_cam6.xml Imported from https://svn-ccsm-models.cgd.ucar.edu/cam1/branches/cam_cesm2_1_rel@91243 Committed by Francis Vitt at 2019-05-29 14:14:18 -0600 Original svn commit message: M bld/namelist_files/use_cases/ssp585_cam6.xml M doc/ChangeLog ' --- bld/namelist_files/use_cases/ssp585_cam6.xml | 4 +-- doc/ChangeLog | 37 ++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/use_cases/ssp585_cam6.xml b/bld/namelist_files/use_cases/ssp585_cam6.xml index a9f4e19116..6d7ffd50fa 100644 --- a/bld/namelist_files/use_cases/ssp585_cam6.xml +++ b/bld/namelist_files/use_cases/ssp585_cam6.xml @@ -52,7 +52,7 @@ 'atm/cam/ozone_strataero' - 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP585_c190221.nc' + 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP585_c190529.nc' 'O3' 'SERIAL' @@ -63,7 +63,7 @@ 'SERIAL' 'atm/cam/ozone_strataero' - 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP585_c190221.nc' + 'ozone_strataero_WACCM_L70_zm5day_2015-2100_SSP585_c190529.nc' .true. diff --git a/doc/ChangeLog b/doc/ChangeLog index abf02862b5..6a5bfc51bb 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,42 @@ =============================================================== +Tag name: release_tags/cam_cesm2_1_rel_29 +Originator(s): fvitt +Date: 29 May 2019 +One-line Summary: Change format of prescribed ozone file to NETCDF-3 + +Purpose of changes: + + Some cray systems cannot hande NETCDF-4 format. + +Bugs fixed (include bugzilla ID): + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: + +M bld/namelist_files/use_cases/ssp585_cam6.xml + - change format of prescribed_ozone_file + +Testing: + + SMS_D_Ln9.f09_g17.BSSP585cmip6.cheyenne_intel (Overall: PASS) details: + +=============================================================== +=============================================================== + Tag name: release_tags/cam_cesm2_1_rel_28 Originator(s): fvitt Date: 15 May 2019 From 7d7639834215ab878b2a554c73853a3c8dd76f1a Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 6 Nov 2019 10:34:36 -0500 Subject: [PATCH 034/239] Feat: Changes to include GEOS-Chem as a chemistry option for CESM (1) This introduces an option to compile GEOS-Chem src files. (2) Interface is inexistant so far (3) CAM still uses the Terminator chem package to satisfy dependencies Reproducing commit from MSL - Jan 19, 2018 --- src/chemistry/pp_geoschem/.exclude | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/chemistry/pp_geoschem/.exclude diff --git a/src/chemistry/pp_geoschem/.exclude b/src/chemistry/pp_geoschem/.exclude new file mode 100644 index 0000000000..2f725c1ef5 --- /dev/null +++ b/src/chemistry/pp_geoschem/.exclude @@ -0,0 +1,53 @@ +regrid_a2a_mod.F90 +transport_mod.F +drydep_mod.F +tpcore_window_mod.F90 +tpcore_bc_mod.F90 +tpcore_fvdas_mod.F90 +olson_landmap_mod.F90 +geosfp_read_mod.F90 +modis_lai_mod.F90 +hco_interp_mod.F90 +merra2_read_mod.F90 +regrid_a2a_mod.F90 +land_mercury_mod.F +hcoio_read_std_mod.F90 +hcoio_dataread_mod.F90 +hco_readlist_mod.F90 +hcox_paranox_mod.F90 +hco_config_mod.F90 +planeflight_mod.F +hco_driver_mod.F90 +hcox_driver_mod.F90 +hcox_lightnox_mod.F90 +hcoi_standalone_mod.F90 +hemco_standalone.F90 +restart_mod.F +pops_mod.F +diag49_mod.F +diag51_mod.F +diag03_mod.F +diag04_mod.F +diag1.F +diag20_mod.F +diag_2pm.F +diag3.F +diag41_mod.F +diag42_mod.F +diag48_mod.F +diag50_mod.F +diag51b_mod.F +diag53_mod.F +diag56_mod.F +diag63_mod.F +emissions_mod.F90 +diag3.F +hcoi_gc_main_mod.F90 +gamap_mod.F +initialize.F +ndxx_setup.F +mixing_mod.F90 +vdiff_mod.F90 +input_mod.F +cleanup.F +main.F From cbcb9fb55679f837e8a3d8bf5e2d4ccc65f07f20 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 15:42:04 -0400 Subject: [PATCH 035/239] Feat: Update config files to include GEOS-Chem option for CAM (1) Update config files in cam/bld/ (2) Update config files in cam/cime_config --- bld/config_files/definition.xml | 2 ++ bld/configure | 27 ++++++++++++++++++++++++++- cime_config/config_component.xml | 3 ++- cime_config/config_compsets.xml | 7 +++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/bld/config_files/definition.xml b/bld/config_files/definition.xml index 656f62f152..dd0d01e5ee 100644 --- a/bld/config_files/definition.xml +++ b/bld/config_files/definition.xml @@ -93,6 +93,8 @@ test_radiative (Radiatively Active Dust), test_swelling (Sea Salt), test_tracers Chemistry package: trop_mam3 trop_mam4 trop_mam7 trop_mozart trop_strat_mam4_vbs trop_strat_mam4_vbsext waccm_ma waccm_mad waccm_mad_mam4 waccm_ma_mam4 waccm_ma_sulfur waccm_sc waccm_sc_mam4 waccm_tsmlt_mam4 terminator none + +Chemistry package: trop_mam3 trop_mam4 trop_mam7 trop_mozart trop_strat_mam4_vbs trop_strat_mam4_vbsext waccm_ma waccm_mad waccm_mad_mam4 waccm_ma_mam4 waccm_ma_sulfur waccm_sc waccm_sc_mam4 waccm_tsmlt_mam4 terminator GEOS-Chem none Prognostic mozart species packages: list of any subset of the following: DST,SSLT,SO4,GHG,OC,BC,CARBON16 diff --git a/bld/configure b/bld/configure index e00e6ae57a..fa1b116aa0 100755 --- a/bld/configure +++ b/bld/configure @@ -124,7 +124,7 @@ OPTIONS [ trop_mam3 | trop_mam4 | trop_mam7 | trop_mozart | trop_strat_mam4_vbs | trop_strat_mam4_vbsext | waccm_ma | waccm_mad | waccm_mad_mam4 | waccm_ma_mam4 | waccm_ma_sulfur | waccm_sc | waccm_sc_mam4 | waccm_tsmlt_mam4 | - terminator | none ]. + terminator | geoschem | none ]. Default: trop_mam4 for cam6 and trop_mam3 for cam5. -[no]clubb_sgs Switch on [off] CLUBB_SGS. Default: on for cam6, otherwise off. -clubb_opts Comma separated list of CLUBB options to turn on/off. By default they are all off. @@ -1428,6 +1428,12 @@ if ($chem_pkg =~ '_mam3') { $chem_cppdefs = ' -DMODAL_AERO -DMODAL_AERO_7MODE '; } +# TMMF - wedge in GEOS-Chem CPP definitions here +if ($chem_pkg =~ 'geoschem') { + $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING'; +} + + # CARMA sectional microphysics # # New CARMA models need to define the number of advected constituents. @@ -2785,6 +2791,16 @@ sub write_filepath } if ($chem_src_dir) { print $fh "$chem_src_dir\n"; + if ($chem_pkg eq 'geoschem') { + print $fh "$chem_src_dir/geoschem_src/GeosCore\n"; + print $fh "$chem_src_dir/geoschem_src/GeosUtil\n"; + print $fh "$chem_src_dir/geoschem_src/Headers\n"; + print $fh "$chem_src_dir/geoschem_src/HEMCO/Core\n"; + print $fh "$chem_src_dir/geoschem_src/HEMCO/Extensions\n"; + print $fh "$chem_src_dir/geoschem_src/HEMCO/Interfaces\n"; + print $fh "$chem_src_dir/geoschem_src/ISOROPIA\n"; + print $fh "$chem_src_dir/geoschem_src/KPP/Standard\n"; + print $fh "$camsrcdir/cam/src/chemistry/pp_terminator\n"; } } if ($chem =~ /_mam/) { print $fh "$camsrcdir/src/chemistry/modal_aero\n"; @@ -2806,6 +2822,15 @@ sub write_filepath print $fh "$camsrcdir/src/chemistry/mozart\n"; print $fh "$camsrcdir/src/chemistry/utils\n"; + # -- Added by MSL - 1/2018 + # -- Updated by TMMF - 11/2019 + if ($chem_pkg ne 'geoschem') { + print $fh "$camsrcdir/cam/src/chemistry/mozart\n"; + } + else { + print $fh "$camsrcdir/cam/src/chemistry/mozart\n"; + } + # -- if ($rad eq 'rrtmg') { print $fh "$camsrcdir/src/physics/rrtmg\n"; diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 9351093809..95a291b677 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -11,7 +11,7 @@ CAM cam6 physics: CAM cam5 physics: CAM cam4 physics: - CAM simplified and non-versioned physics : + CAM simplified and non-versioned physics : diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 9a1085179d..7a1cc01af2 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -382,6 +382,13 @@ HIST_CAM40%WXIED%SDYN_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV + + + + GEOSCHEM + 2000_CAM%GC_SLND_SICE_SOCN_SROF_SGLC_SWAV + + From a7336ca745ef2bfe5d83d7759c9e7eb756c7fb16 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 6 Nov 2019 13:18:52 -0500 Subject: [PATCH 036/239] Feat: Add customized chemistry.F90 for GEOS-Chem Reproducing commit from MSL - Mar 6, 2018 --- src/chemistry/pp_geoschem/chemistry.F90 | 198 ++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 src/chemistry/pp_geoschem/chemistry.F90 diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 new file mode 100644 index 0000000000..ba5689511c --- /dev/null +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -0,0 +1,198 @@ +!================================================================================================ +! This is the "GEOS-Chem" chemistry module. +!================================================================================================ + +module chemistry + use shr_kind_mod, only: r8 => shr_kind_r8 + use physics_types, only: physics_state, physics_ptend, physics_ptend_init + use ppgrid, only: begchunk, endchunk, pcols + use ppgrid, only: pver + use constituents, only: pcnst, cnst_add + use mo_gas_phase_chemdr, only: map2chm + use mo_constants, only: pi + use shr_const_mod, only: molw_dryair=>SHR_CONST_MWDAIR + use mo_chem_utls, only : get_spc_ndx + use chem_mods, only : gas_pcnst, adv_mass + use mo_sim_dat, only: set_sim_dat + implicit none + private + save + ! + ! Public interfaces + ! + public :: chem_is ! identify which chemistry is being used + public :: chem_register ! register consituents + public :: chem_is_active ! returns true if this package is active (ghg_chem=.true.) + public :: chem_implements_cnst ! returns true if consituent is implemented by this package + public :: chem_init_cnst ! initialize mixing ratios if not read from initial file + public :: chem_init ! initialize (history) variables + public :: chem_timestep_tend ! interface to tendency computation + public :: chem_final + public :: chem_write_restart + public :: chem_read_restart + public :: chem_init_restart + public :: chem_readnl ! read chem namelist + public :: chem_reset_fluxes + + interface chem_write_restart + module procedure chem_write_restart_bin + module procedure chem_write_restart_pio + end interface + interface chem_read_restart + module procedure chem_read_restart_bin + module procedure chem_read_restart_pio + end interface + + ! Private data + +!================================================================================================ +contains +!================================================================================================ + + logical function chem_is (name) + + character(len=*), intent(in) :: name + + chem_is = .false. + if (name == 'geoschem' ) then + chem_is = .true. + end if + + end function chem_is + +!================================================================================================ + + subroutine chem_register + !----------------------------------------------------------------------- + ! + ! Purpose: register advected constituents for parameterized greenhouse gas chemistry + ! + !----------------------------------------------------------------------- + + end subroutine chem_register + + subroutine chem_readnl(nlfile) + ! Gonna want to read in input.geos, etc. Somehow. + + ! args + character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input + + end subroutine chem_readnl + +!================================================================================================ + + function chem_is_active() + !----------------------------------------------------------------------- + logical :: chem_is_active + !----------------------------------------------------------------------- + chem_is_active = .true. + end function chem_is_active + +!================================================================================================ + + function chem_implements_cnst(name) + !----------------------------------------------------------------------- + ! + ! Purpose: return true if specified constituent is implemented by this package + ! + ! Author: B. Eaton + ! + !----------------------------------------------------------------------- + implicit none + !-----------------------------Arguments--------------------------------- + + character(len=*), intent(in) :: name ! constituent name + logical :: chem_implements_cnst ! return value + + integer :: i + + chem_implements_cnst = .false. + + do i = 1, nspecies + if (trim(species(i)) .eq. trim(name)) then + chem_implements_cnst = .true. + exit + end if + end do + + end function chem_implements_cnst + +!=============================================================================== + + subroutine chem_init(phys_state, pbuf2d) + !----------------------------------------------------------------------- + ! + ! Purpose: initialize GEOS-Chem parts (state objects, mainly) + ! (and declare history variables) + ! + !----------------------------------------------------------------------- + + ! Can add history output here too with the "addfld" & "add_default" routines + + end subroutine chem_init + +!=============================================================================== + + subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) + + ! Here's where you'll call DO_CHEMISTRY + + return + end subroutine chem_timestep_tend + +!=============================================================================== + subroutine chem_init_cnst(name, latvals, lonvals, mask, q) + + ! Used to initialize tracer fields if desired. + ! Will need a simple mapping structure as well as the CAM tracer registration + ! routines. + + end subroutine chem_init_cnst + +!=============================================================================== + subroutine chem_final + + ! Finalize GEOS-Chem + + return + end subroutine chem_final +!=============================================================================== + subroutine chem_write_restart_bin( nrg ) + implicit none + integer,intent(in) :: nrg ! Unit number + return + end subroutine chem_write_restart_bin +!=============================================================================== + subroutine chem_read_restart_bin( nrg ) + implicit none + integer,intent(in) :: nrg ! Unit number + return + end subroutine chem_read_restart_bin +!=============================================================================== + subroutine chem_write_restart_pio( File ) + use pio, only : file_desc_t + type(file_desc_t) :: File + return + end subroutine chem_write_restart_pio +!=============================================================================== + subroutine chem_read_restart_pio( File ) + use pio, only : file_desc_t + type(file_desc_t) :: File + return + end subroutine chem_read_restart_pio +!=============================================================================== + subroutine chem_init_restart(File) + use pio, only : file_desc_t + type(file_desc_t) :: File + return + end subroutine chem_init_restart +!================================================================================ + subroutine chem_reset_fluxes( fptr, cam_in ) + use camsrfexch, only : cam_in_t + + real(r8), pointer :: fptr(:,:) ! pointer into array data + type(cam_in_t), intent(inout) :: cam_in(begchunk:endchunk) + + end subroutine chem_reset_fluxes + +end module chemistry From d702e463644a45acdcaee7daabfbcddf013c159d Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 16:11:27 -0400 Subject: [PATCH 037/239] Feat: Initial implementation of compilable code (1) The code can now be compiled using a CAM 4.0 + "dummy" GEOS-Chem component set (compset FGC). This is based on the "tropospheric mozart" set. Reproducing commit from SDE - May 17, 2018 --- bld/build-namelist | 6 +- bld/configure | 36 +- bld/namelist_files/namelist_definition.xml | 2 +- bld/namelist_files/use_cases/geoschem.xml | 61 + .../use_cases/geoschem_baro_moist.xml | 22 + cime_config/config_component.xml | 13 +- cime_config/config_compsets.xml | 12 +- src/chemistry/pp_geoschem/aero_model.F90 | 1150 ++++++++++++++++ .../pp_geoschem/charge_neutrality.F90 | 176 +++ src/chemistry/pp_geoschem/chem_mods.F90 | 50 + .../pp_geoschem/chem_prod_loss_diags.F90 | 37 + src/chemistry/pp_geoschem/chemistry.F90 | 276 +++- src/chemistry/pp_geoschem/clybry_fam.F90 | 180 +++ src/chemistry/pp_geoschem/epp_ionization.F90 | 508 +++++++ src/chemistry/pp_geoschem/mo_apex.F90 | 314 +++++ .../pp_geoschem/mo_gas_phase_chemdr.F90 | 1180 +++++++++++++++++ src/chemistry/pp_geoschem/mo_lightning.F90 | 182 +++ src/chemistry/pp_geoschem/rate_diags.F90 | 177 +++ .../pp_geoschem/short_lived_species.F90 | 224 ++++ src/chemistry/pp_geoschem/upper_bc.F90 | 243 ++++ 20 files changed, 4784 insertions(+), 65 deletions(-) create mode 100644 bld/namelist_files/use_cases/geoschem.xml create mode 100644 bld/namelist_files/use_cases/geoschem_baro_moist.xml create mode 100644 src/chemistry/pp_geoschem/aero_model.F90 create mode 100644 src/chemistry/pp_geoschem/charge_neutrality.F90 create mode 100644 src/chemistry/pp_geoschem/chem_mods.F90 create mode 100644 src/chemistry/pp_geoschem/chem_prod_loss_diags.F90 create mode 100644 src/chemistry/pp_geoschem/clybry_fam.F90 create mode 100644 src/chemistry/pp_geoschem/epp_ionization.F90 create mode 100644 src/chemistry/pp_geoschem/mo_apex.F90 create mode 100644 src/chemistry/pp_geoschem/mo_gas_phase_chemdr.F90 create mode 100644 src/chemistry/pp_geoschem/mo_lightning.F90 create mode 100644 src/chemistry/pp_geoschem/rate_diags.F90 create mode 100644 src/chemistry/pp_geoschem/short_lived_species.F90 create mode 100644 src/chemistry/pp_geoschem/upper_bc.F90 diff --git a/bld/build-namelist b/bld/build-namelist index 8cffb24c6f..3d68e73b4f 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -1895,7 +1895,7 @@ my $megan_emis = defined $nl->get_value('megan_specifier'); if ( $megan_emis ) { add_default($nl, 'megan_factors_file'); } # Tropospheric full chemistry options -if (($chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $chem =~ /waccm_tsmlt/) and ($phys !~ /cam6/)) { +if (($chem =~ /geoschem/ or $chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $chem =~ /waccm_tsmlt/) and ($phys !~ /cam6/)) { # Surface emission datasets: my %verhash; @@ -2076,7 +2076,7 @@ if (($chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $chem =~ /waccm_tsmlt/) } } -if ($chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $chem =~ /waccm_tsmlt/) { +if ($chem =~ /geoschem/ or $chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $chem =~ /waccm_tsmlt/) { my $val; @@ -2091,6 +2091,8 @@ if ($chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $chem =~ /waccm_tsmlt/) { if ($chem =~ /_tsmlt_mam/ or $chem =~ /trop_strat/) { $val = "'CCL4','CF2CLBR','CF3BR','CFC11','CFC113','CFC12','CH3BR','CH3CCL3','CH3CL','CH4','CO2'" .",'H2','HCFC22','N2O','CFC114','CFC115','HCFC141B','HCFC142B','CH2BR2','CHBR3','H2402'"; + } elsif ($chem =~ /geoschem/) { + $val = "'CH4','OCS','N2O','CO2','CFC11','CFC12'"; } else { $val = "'CH4','H2','N2O','CO2','CFC11','CFC12'"; } diff --git a/bld/configure b/bld/configure index fa1b116aa0..0c267d4b5b 100755 --- a/bld/configure +++ b/bld/configure @@ -666,10 +666,10 @@ if (defined $opts{'chem'}) { # If the user has specified a simple physics package... if ($simple_phys) { - # the only valid chemistry options are 'none' and 'terminator' - if (($chem_pkg ne 'none') and ($chem_pkg ne 'terminator')) { + # the only valid chemistry options are 'none', 'terminator' and 'geoschem' + if (($chem_pkg ne 'none') and ($chem_pkg ne 'terminator') and ($chem_pkg ne 'geoschem')) { die "configure ERROR: -phys=$phys_pkg -chem=$chem_pkg\n". - " -chem can only be set to 'none' or 'terminator'.\n"; + " -chem can only be set to 'none', 'terminator' or 'geoschem'.\n"; } } elsif ($phys_pkg =~ m/^cam3$|^cam4$|^spcam_sam1mom$/) { @@ -1413,10 +1413,10 @@ if ($customize) { } if ($print>=2) { print "Chem preprocessor compiler: $chemproc_fc $eol"; } ($chem_nadv) = chem_preprocess($cfg_ref,$print,$chemproc_fc); -} elsif ($chem_pkg ne 'none') { +} elsif ($chem_pkg ne 'none' and $chem_pkg !~ 'geoschem') { # copy over chem docs - copy("$chem_src_dir/chem_mech.doc",$cam_bld) or die "copy failed $! \n"; - copy("$chem_src_dir/chem_mech.in" ,$cam_bld) or die "copy failed $! \n"; + copy("$chem_src_dir/chem_mech.doc",$cam_bld) or die "copy of chem_mec.doc failed $! \n"; + copy("$chem_src_dir/chem_mech.in" ,$cam_bld) or die "copy of chem_mech.in failed $! \n"; ($chem_nadv) = chem_number_adv($chem_src_dir); } @@ -1431,6 +1431,8 @@ if ($chem_pkg =~ '_mam3') { # TMMF - wedge in GEOS-Chem CPP definitions here if ($chem_pkg =~ 'geoschem') { $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING'; + # TMMF - Temporary fix + $chem_nadv = 200; } @@ -2799,15 +2801,9 @@ sub write_filepath print $fh "$chem_src_dir/geoschem_src/HEMCO/Extensions\n"; print $fh "$chem_src_dir/geoschem_src/HEMCO/Interfaces\n"; print $fh "$chem_src_dir/geoschem_src/ISOROPIA\n"; - print $fh "$chem_src_dir/geoschem_src/KPP/Standard\n"; - print $fh "$camsrcdir/cam/src/chemistry/pp_terminator\n"; } + print $fh "$chem_src_dir/geoschem_src/KPP/Standard\n"; } +# print $fh "$camsrcdir/cam/src/chemistry/pp_geoschem\n"; } } - if ($chem =~ /_mam/) { - print $fh "$camsrcdir/src/chemistry/modal_aero\n"; - } else { - print $fh "$camsrcdir/src/chemistry/bulk_aero\n"; - } - print $fh "$camsrcdir/src/chemistry/aerosol\n"; if ($waccmx) { print $fh "$camsrcdir/src/physics/waccmx\n"; @@ -2826,9 +2822,15 @@ sub write_filepath # -- Updated by TMMF - 11/2019 if ($chem_pkg ne 'geoschem') { print $fh "$camsrcdir/cam/src/chemistry/mozart\n"; - } - else { - print $fh "$camsrcdir/cam/src/chemistry/mozart\n"; + if ($chem =~ /_mam/) { + print $fh "$camsrcdir/cam/src/chemistry/modal_aero\n"; + } else { + print $fh "$camsrcdir/cam/src/chemistry/bulk_aero\n"; + } + print $fh "$camsrcdir/cam/src/chemistry/aerosol\n"; +# } +# else { +# print $fh "$camsrcdir/cam/src/chemistry/mozart\n"; } # -- diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 8d8acbafa4..72281212de 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -3904,7 +3904,7 @@ Default: set by build-namelist Name of the CAM chemistry package. N.B. this variable may not be set by diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml new file mode 100644 index 0000000000..12c343e218 --- /dev/null +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -0,0 +1,61 @@ + + + + +00010101 + +367.0e-6 + +atm/cam/inic/fv/cami-chem_1990-01-01_1.9x2.5_L26_c080114.nc + + +atm/cam/solar/spectral_irradiance_Lean_1610-2009_ann_c100405.nc +20000101 +FIXED + + +atm/cam/chem/trop_mozart_aero/aero +aero_1.9x2.5_L26_1850-2005_c091112.nc +CYCLICAL +2000 + + +atm/cam/chem/trop_mozart_aero/aero +aerosoldep_monthly_2000_mean_1.9x2.5_c090421.nc +CYCLICAL +2000 + + + atm/cam/ozone + ozone_1.9x2.5_L26_1850-2005_c090803.nc + O3 + CYCLICAL + 2000 + +.true. +'xactive_lnd' + + +2000 + + +2000 +atm/waccm/lb/LBC_1765-2500_1.9x2.5_CMIP5_RCP45_za_c120204.nc +CYCLICAL + + + + +'CYCLICAL' +2000 + + + 1 + 0 + 'A' + + + 'Q', 'U', 'V', 'OMEGA', 'T', 'PS', 'BCPI', + + + diff --git a/bld/namelist_files/use_cases/geoschem_baro_moist.xml b/bld/namelist_files/use_cases/geoschem_baro_moist.xml new file mode 100644 index 0000000000..da938fe300 --- /dev/null +++ b/bld/namelist_files/use_cases/geoschem_baro_moist.xml @@ -0,0 +1,22 @@ + + + + + 10101 + + +.false. + + +0,-6 + + 'U:I','V:I','T:I' + +'baroclinic_wave' + + diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 95a291b677..91dee5f54d 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -10,8 +10,8 @@ --> CAM cam6 physics: CAM cam5 physics: - CAM cam4 physics: - CAM simplified and non-versioned physics : + CAM cam4 physics: + CAM simplified and non-versioned physics : @@ -266,6 +269,10 @@ scam_arm97 + + geoschem + geoschem + geoschem_baro_moist run_component_cam env_run.xml diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 7a1cc01af2..50d44b5217 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -386,7 +386,17 @@ GEOSCHEM - 2000_CAM%GC_SLND_SICE_SOCN_SROF_SGLC_SWAV + 2000_CAM40%GC_SLND_SICE_SOCN_SROF_SGLC_SWAV + + + + GEOSCHEMTEST + 2000_CAM%GCHS_SLND_SICE_SOCN_SROF_SGLC_SWAV + + + + FGC + 2000_CAM40%GC_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV diff --git a/src/chemistry/pp_geoschem/aero_model.F90 b/src/chemistry/pp_geoschem/aero_model.F90 new file mode 100644 index 0000000000..3c9133adf6 --- /dev/null +++ b/src/chemistry/pp_geoschem/aero_model.F90 @@ -0,0 +1,1150 @@ +!=============================================================================== +! Bulk Aerosol Model +!=============================================================================== +module aero_model + use shr_kind_mod, only: r8 => shr_kind_r8 + use constituents, only: pcnst, cnst_name, cnst_get_ind + use ppgrid, only: pcols, pver, pverp + use cam_abortutils, only: endrun + use cam_logfile, only: iulog + use perf_mod, only: t_startf, t_stopf + use camsrfexch, only: cam_in_t, cam_out_t + use physics_types, only: physics_state, physics_ptend, physics_ptend_init + use physics_buffer, only: physics_buffer_desc + use physconst, only: gravit, rair + use spmd_utils, only: masterproc + use physics_buffer, only: pbuf_get_field, pbuf_get_index + use cam_history, only: outfld + use infnan, only: nan, assignment(=) + + implicit none + private + + public :: aero_model_readnl + public :: aero_model_register + public :: aero_model_init + public :: aero_model_gasaerexch ! create, grow, change, and shrink aerosols. + public :: aero_model_drydep ! aerosol dry deposition and sediment + public :: aero_model_wetdep ! aerosol wet removal + public :: aero_model_emissions ! aerosol emissions + public :: aero_model_surfarea ! tropospheric aerosol wet surface area for chemistry + public :: aero_model_strat_surfarea ! stub + + ! Misc private data + + integer :: so4_ndx, cb2_ndx, oc2_ndx, nit_ndx + integer :: soa_ndx, soai_ndx, soam_ndx, soab_ndx, soat_ndx, soax_ndx + + ! Namelist variables + character(len=16) :: wetdep_list(pcnst) = ' ' + character(len=16) :: drydep_list(pcnst) = ' ' + + integer :: ndrydep = 0 + integer,allocatable :: drydep_indices(:) + integer :: nwetdep = 0 + integer,allocatable :: wetdep_indices(:) + logical :: drydep_lq(pcnst) + logical :: wetdep_lq(pcnst) + + integer :: fracis_idx = 0 + + real(r8) :: aer_sol_facti(pcnst) ! in-cloud solubility factor + real(r8) :: aer_sol_factb(pcnst) ! below-cloud solubility factor + real(r8) :: aer_scav_coef(pcnst) + +contains + + !============================================================================= + ! reads aerosol namelist options + !============================================================================= + subroutine aero_model_readnl(nlfile) + + use namelist_utils, only: find_group_name + use units, only: getunit, freeunit + use mpishorthand + + character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input + + ! Local variables + integer :: unitn, ierr + character(len=*), parameter :: subname = 'aero_model_readnl' + + ! Namelist variables + character(len=16) :: aer_wetdep_list(pcnst) = ' ' + character(len=16) :: aer_drydep_list(pcnst) = ' ' + + namelist /aerosol_nl/ aer_wetdep_list, aer_drydep_list + namelist /aerosol_nl/ aer_sol_facti, aer_sol_factb, aer_scav_coef + !----------------------------------------------------------------------------- + !aer_sol_facti = nan + !aer_sol_factb = nan + !aer_scav_coef = nan + + !! Read namelist + !if (masterproc) then + ! unitn = getunit() + ! open( unitn, file=trim(nlfile), status='old' ) + ! call find_group_name(unitn, 'aerosol_nl', status=ierr) + ! if (ierr == 0) then + ! read(unitn, aerosol_nl, iostat=ierr) + ! if (ierr /= 0) then + ! call endrun(subname // ':: ERROR reading namelist') + ! end if + ! end if + ! close(unitn) + ! call freeunit(unitn) + !end if + +#ifdef SPMD + ! Broadcast namelist variables + !call mpibcast(aer_wetdep_list, len(aer_wetdep_list(1))*pcnst, mpichar, 0, mpicom) + !call mpibcast(aer_drydep_list, len(aer_drydep_list(1))*pcnst, mpichar, 0, mpicom) + !call mpibcast(aer_sol_facti, pcnst, mpir8, 0, mpicom) + !call mpibcast(aer_sol_factb, pcnst, mpir8, 0, mpicom) + !call mpibcast(aer_scav_coef, pcnst, mpir8, 0, mpicom) +#endif + + !wetdep_list = aer_wetdep_list + !drydep_list = aer_drydep_list + + end subroutine aero_model_readnl + + !============================================================================= + !============================================================================= + subroutine aero_model_register() + !use mo_setsoa, only : soa_register + + !call soa_register() + end subroutine aero_model_register + + !============================================================================= + !============================================================================= + subroutine aero_model_init( pbuf2d ) + + !use mo_chem_utls, only: get_inv_ndx, get_spc_ndx + use cam_history, only: addfld, add_default, horiz_only + use phys_control, only: phys_getopts + !use mo_aerosols, only: aerosols_inti + !use mo_setsoa, only: soa_inti + !use dust_model, only: dust_init + !use seasalt_model, only: seasalt_init + !use drydep_mod, only: inidrydep + !use wetdep, only: wetdep_init + !use mo_setsox, only: has_sox + + ! args + type(physics_buffer_desc), pointer :: pbuf2d(:,:) + + ! local vars + character(len=12), parameter :: subrname = 'aero_model_init' + integer :: m, id + character(len=20) :: dummy + logical :: history_aerosol ! Output MAM or SECT aerosol tendencies + + !call phys_getopts( history_aerosol_out=history_aerosol ) + !call aerosols_inti() + !call soa_inti(pbuf2d) + !call dust_init() + !call seasalt_init() + !call wetdep_init() + + !fracis_idx = pbuf_get_index('FRACIS') + + !nwetdep = 0 + !ndrydep = 0 + + !count_species: do m = 1,pcnst + ! if ( len_trim(wetdep_list(m)) /= 0 ) then + ! nwetdep = nwetdep+1 + ! endif + ! if ( len_trim(drydep_list(m)) /= 0 ) then + ! ndrydep = ndrydep+1 + ! endif + !enddo count_species + ! + !if (nwetdep>0) & + ! allocate(wetdep_indices(nwetdep)) + !if (ndrydep>0) & + ! allocate(drydep_indices(ndrydep)) + + !do m = 1,ndrydep + ! call cnst_get_ind ( drydep_list(m), id, abort=.false. ) + ! if (id>0) then + ! drydep_indices(m) = id + ! else + ! call endrun(subrname//': invalid drydep species: '//trim(drydep_list(m)) ) + ! endif + + ! if (masterproc) then + ! write(iulog,*) subrname//': '//drydep_list(m)//' will have drydep applied' + ! endif + !enddo + !do m = 1,nwetdep + ! call cnst_get_ind ( wetdep_list(m), id, abort=.false. ) + ! if (id>0) then + ! wetdep_indices(m) = id + ! else + ! call endrun(subrname//': invalid wetdep species: '//trim(wetdep_list(m)) ) + ! endif + ! + ! if (masterproc) then + ! write(iulog,*) subrname//': '//wetdep_list(m)//' will have wet removal' + ! endif + !enddo + ! + !! set flags for drydep tendencies + !drydep_lq(:) = .false. + !do m=1,ndrydep + ! id = drydep_indices(m) + ! drydep_lq(id) = .true. + !enddo + + !! set flags for wetdep tendencies + !wetdep_lq(:) = .false. + !do m=1,nwetdep + ! id = wetdep_indices(m) + ! wetdep_lq(id) = .true. + !enddo + + !do m = 1,ndrydep + ! + ! dummy = trim(drydep_list(m)) // 'TB' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s',trim(drydep_list(m))//' turbulent dry deposition flux') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + ! dummy = trim(drydep_list(m)) // 'GV' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s',trim(drydep_list(m)) //' gravitational dry deposition flux') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + ! dummy = trim(drydep_list(m)) // 'DD' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s',trim(drydep_list(m)) //' dry deposition flux at bottom (grav + turb)') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + ! dummy = trim(drydep_list(m)) // 'DT' + ! call addfld (dummy,(/ 'lev' /), 'A','kg/kg/s',trim(drydep_list(m))//' dry deposition') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + ! dummy = trim(drydep_list(m)) // 'DV' + ! call addfld (dummy,(/ 'lev' /), 'A','m/s',trim(drydep_list(m))//' deposition velocity') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + + !enddo + ! + !if (ndrydep>0) then + + ! call inidrydep(rair, gravit) + + ! dummy = 'RAM1' + ! call addfld (dummy,horiz_only, 'A','frac','RAM1') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + ! dummy = 'airFV' + ! call addfld (dummy,horiz_only, 'A','frac','FV') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + + ! if (sslt_active) then + ! dummy = 'SSTSFDRY' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Sea salt deposition flux at surface') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + ! endif + ! if (dust_active) then + ! dummy = 'DSTSFDRY' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Dust deposition flux at surface') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + ! endif + + !endif + + !do m = 1,nwetdep + + ! call addfld (trim(wetdep_list(m))//'SFWET', horiz_only, 'A','kg/m2/s', & + ! 'Wet deposition flux at surface') + ! call addfld (trim(wetdep_list(m))//'SFSIC', horiz_only, 'A','kg/m2/s', & + ! 'Wet deposition flux (incloud, convective) at surface') + ! call addfld (trim(wetdep_list(m))//'SFSIS', horiz_only, 'A','kg/m2/s', & + ! 'Wet deposition flux (incloud, stratiform) at surface') + ! call addfld (trim(wetdep_list(m))//'SFSBC', horiz_only, 'A','kg/m2/s', & + ! 'Wet deposition flux (belowcloud, convective) at surface') + ! call addfld (trim(wetdep_list(m))//'SFSBS', horiz_only, 'A','kg/m2/s', & + ! 'Wet deposition flux (belowcloud, stratiform) at surface') + ! call addfld (trim(wetdep_list(m))//'WET', (/ 'lev' /), 'A','kg/kg/s', & + ! 'wet deposition tendency') + ! call addfld (trim(wetdep_list(m))//'SIC', (/ 'lev' /), 'A','kg/kg/s', & + ! trim(wetdep_list(m))//' ic wet deposition') + ! call addfld (trim(wetdep_list(m))//'SIS', (/ 'lev' /), 'A','kg/kg/s', & + ! trim(wetdep_list(m))//' is wet deposition') + ! call addfld (trim(wetdep_list(m))//'SBC', (/ 'lev' /), 'A','kg/kg/s', & + ! trim(wetdep_list(m))//' bc wet deposition') + ! call addfld (trim(wetdep_list(m))//'SBS', (/ 'lev' /), 'A','kg/kg/s', & + ! trim(wetdep_list(m))//' bs wet deposition') + !enddo + ! + !if (nwetdep>0) then + ! if (sslt_active) then + ! dummy = 'SSTSFWET' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Sea salt wet deposition flux at surface') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + ! endif + ! if (dust_active) then + ! dummy = 'DSTSFWET' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Dust wet deposition flux at surface') + ! if ( history_aerosol ) then + ! call add_default (dummy, 1, ' ') + ! endif + ! endif + !endif + ! + !if (dust_active) then + ! ! emissions diagnostics .... + + ! do m = 1, dust_nbin + ! dummy = trim(dust_names(m)) // 'SF' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s',trim(dust_names(m))//' dust surface emission') + ! if (history_aerosol) then + ! call add_default (dummy, 1, ' ') + ! endif + ! enddo + + ! dummy = 'DSTSFMBL' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Mobilization flux at surface') + ! if (history_aerosol) then + ! call add_default (dummy, 1, ' ') + ! endif + + ! dummy = 'LND_MBL' + ! call addfld (dummy,horiz_only, 'A','frac','Soil erodibility factor') + ! if (history_aerosol) then + ! call add_default (dummy, 1, ' ') + ! endif + + !endif + ! + !if (sslt_active) then + + ! dummy = 'SSTSFMBL' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Mobilization flux at surface') + ! if (history_aerosol) then + ! call add_default (dummy, 1, ' ') + ! endif + + ! do m = 1, seasalt_nbin + ! dummy = trim(seasalt_names(m)) // 'SF' + ! call addfld (dummy,horiz_only, 'A','kg/m2/s',trim(seasalt_names(m))//' seasalt surface emission') + ! if (history_aerosol) then + ! call add_default (dummy, 1, ' ') + ! endif + ! enddo + + !endif + + !if( has_sox ) then + ! call addfld( 'XPH_LWC',(/ 'lev' /), 'A','kg/kg', 'pH value multiplied by lwc') + + ! if ( history_aerosol ) then + ! call add_default ('XPH_LWC', 1, ' ') + ! endif + !endif + + !so4_ndx = get_spc_ndx( 'SO4' ) + !soa_ndx = get_spc_ndx( 'SOA' ) + !soai_ndx = get_spc_ndx( 'SOAI' ) + !soam_ndx = get_spc_ndx( 'SOAM' ) + !soab_ndx = get_spc_ndx( 'SOAB' ) + !soat_ndx = get_spc_ndx( 'SOAT' ) + !soax_ndx = get_spc_ndx( 'SOAX' ) + !cb2_ndx = get_spc_ndx( 'CB2' ) + !oc2_ndx = get_spc_ndx( 'OC2' ) + !nit_ndx = get_spc_ndx( 'NH4NO3' ) + + end subroutine aero_model_init + + !============================================================================= + !============================================================================= + subroutine aero_model_drydep ( state, pbuf, obklen, ustar, cam_in, dt, cam_out, ptend ) + + !use dust_sediment_mod, only: dust_sediment_tend + !use drydep_mod, only: d3ddflux, calcram + !use dust_model, only: dust_depvel, dust_nbin, dust_names + !use seasalt_model, only: sslt_depvel=>seasalt_depvel, sslt_nbin=>seasalt_nbin, sslt_names=>seasalt_names + + ! args + type(physics_state), intent(in) :: state ! Physics state variables + real(r8), intent(in) :: obklen(:) + real(r8), intent(in) :: ustar(:) ! sfc fric vel + type(cam_in_t), target, intent(in) :: cam_in ! import state + real(r8), intent(in) :: dt ! time step + type(cam_out_t), intent(inout) :: cam_out ! export state + type(physics_ptend), intent(out) :: ptend ! indivdual parameterization tendencies + type(physics_buffer_desc), pointer :: pbuf(:) + + ! local vars + real(r8), pointer :: landfrac(:) ! land fraction + real(r8), pointer :: icefrac(:) ! ice fraction + real(r8), pointer :: ocnfrac(:) ! ocean fraction + real(r8), pointer :: fvin(:) ! + real(r8), pointer :: ram1in(:) ! for dry dep velocities from land model for progseasalts + + real(r8) :: fv(pcols) ! for dry dep velocities, from land modified over ocean & ice + real(r8) :: ram1(pcols) ! for dry dep velocities, from land modified over ocean & ice + + ! local decarations + + !integer, parameter :: naero = sslt_nbin+dust_nbin + !integer, parameter :: begslt = 1 + !integer, parameter :: endslt = sslt_nbin + !integer, parameter :: begdst = sslt_nbin+1 + !integer, parameter :: enddst = sslt_nbin+dust_nbin + + !integer :: ncol, lchnk + + !character(len=6) :: aeronames(naero) ! = (/ sslt_names, dust_names /) + + !real(r8) :: vlc_trb(pcols,naero) !Turbulent deposn velocity (m/s) + !real(r8) :: vlc_grv(pcols,pver,naero) !grav deposn velocity (m/s) + !real(r8) :: vlc_dry(pcols,pver,naero) !dry deposn velocity (m/s) + + !real(r8) :: dep_trb(pcols) !kg/m2/s + !real(r8) :: dep_grv(pcols) !kg/m2/s (total of grav and trb) + + !real(r8) :: tsflx_dst(pcols) + !real(r8) :: tsflx_slt(pcols) + !real(r8) :: pvaeros(pcols,pverp) ! sedimentation velocity in Pa + !real(r8) :: sflx(pcols) + + !real(r8) :: tvs(pcols,pver) + !real(r8) :: rho(pcols,pver) ! air density in kg/m3 + + !integer :: m,mm, i, im + ! + !if (ndrydep<1) return + + !landfrac => cam_in%landfrac(:) + !icefrac => cam_in%icefrac(:) + !ocnfrac => cam_in%ocnfrac(:) + !fvin => cam_in%fv(:) + !ram1in => cam_in%ram1(:) + + !lchnk = state%lchnk + !ncol = state%ncol + + !! calc ram and fv over ocean and sea ice ... + !call calcram( ncol,landfrac,icefrac,ocnfrac,obklen,& + ! ustar,ram1in,ram1,state%t(:,pver),state%pmid(:,pver),& + ! state%pdel(:,pver),fvin,fv) + + !call outfld( 'airFV', fv(:), pcols, lchnk ) + !call outfld( 'RAM1', ram1(:), pcols, lchnk ) + + !! note that tendencies are not only in sfc layer (because of sedimentation) + !! and that ptend is updated within each subroutine for different species + ! + !call physics_ptend_init(ptend, state%psetcols, 'aero_model_drydep', lq=drydep_lq) + + !aeronames(:sslt_nbin) = sslt_names(:) + !aeronames(sslt_nbin+1:) = dust_names(:) + + !lchnk = state%lchnk + !ncol = state%ncol + + !tvs(:ncol,:) = state%t(:ncol,:) + !rho(:ncol,:) = state%pmid(:ncol,:)/(rair*state%t(:ncol,:)) + + !! compute dep velocities for sea salt and dust... + !if (sslt_active) then + ! call sslt_depvel( state%t(:,:), state%pmid(:,:), state%q(:,:,1), ram1, fv, ncol, lchnk, & + ! vlc_dry(:,:,begslt:endslt), vlc_trb(:,begslt:endslt), vlc_grv(:,:,begslt:endslt)) + !endif + !if (dust_active) then + ! call dust_depvel( state%t(:,:), state%pmid(:,:), ram1, fv, ncol, & + ! vlc_dry(:,:,begdst:enddst), vlc_trb(:,begdst:enddst), vlc_grv(:,:,begdst:enddst) ) + !endif + + !tsflx_dst(:)=0._r8 + !tsflx_slt(:)=0._r8 + + !! do drydep for each of the bins of dust and seasalt + !do m=1,ndrydep + + ! mm = drydep_indices(m) + ! findindex: do im = 1,naero + ! if (trim(cnst_name(mm))==trim(aeronames(im))) exit findindex + ! enddo findindex + + ! pvaeros(:ncol,1)=0._r8 + ! pvaeros(:ncol,2:pverp) = vlc_dry(:ncol,:,im) + + ! call outfld( trim(cnst_name(mm))//'DV', pvaeros(:,2:pverp), pcols, lchnk ) + + ! if(.true.) then ! use phil's method + ! ! convert from meters/sec to pascals/sec + ! ! pvaeros(:,1) is assumed zero, use density from layer above in conversion + ! pvaeros(:ncol,2:pverp) = pvaeros(:ncol,2:pverp) * rho(:ncol,:)*gravit + + ! ! calculate the tendencies and sfc fluxes from the above velocities + ! call dust_sediment_tend( & + ! ncol, dt, state%pint(:,:), state%pmid, state%pdel, state%t , & + ! state%q(:,:,mm) , pvaeros , ptend%q(:,:,mm), sflx ) + ! else !use charlie's method + ! call d3ddflux(ncol, vlc_dry(:,:,im), state%q(:,:,mm),state%pmid,state%pdel, tvs,sflx,ptend%q(:,:,mm),dt) + ! endif + ! ! apportion dry deposition into turb and gravitational settling for tapes + ! do i=1,ncol + ! dep_trb(i)=sflx(i)*vlc_trb(i,im)/vlc_dry(i,pver,im) + ! dep_grv(i)=sflx(i)*vlc_grv(i,pver,im)/vlc_dry(i,pver,im) + ! enddo + + ! if ( any( sslt_names(:)==trim(cnst_name(mm)) ) ) & + ! tsflx_slt(:ncol)=tsflx_slt(:ncol)+sflx(:ncol) + ! if ( any( dust_names(:)==trim(cnst_name(mm)) ) ) & + ! tsflx_dst(:ncol)=tsflx_dst(:ncol)+sflx(:ncol) + + ! ! if the user has specified prescribed aerosol dep fluxes then + ! ! do not set cam_out dep fluxes according to the prognostic aerosols + ! if (.not. aerodep_flx_prescribed()) then + ! ! set deposition in export state + ! if (im==begdst) then + ! cam_out%dstdry1(:ncol) = max(sflx(:ncol), 0._r8) + ! elseif(im==begdst+1) then + ! cam_out%dstdry2(:ncol) = max(sflx(:ncol), 0._r8) + ! elseif(im==begdst+2) then + ! cam_out%dstdry3(:ncol) = max(sflx(:ncol), 0._r8) + ! elseif(im==begdst+3) then + ! cam_out%dstdry4(:ncol) = max(sflx(:ncol), 0._r8) + ! endif + ! endif + + ! call outfld( trim(cnst_name(mm))//'DD', sflx, pcols, lchnk) + ! call outfld( trim(cnst_name(mm))//'TB', dep_trb, pcols, lchnk ) + ! call outfld( trim(cnst_name(mm))//'GV', dep_grv, pcols, lchnk ) + ! call outfld( trim(cnst_name(mm))//'DT', ptend%q(:,:,mm), pcols, lchnk) + + !end do + ! + !! output the total dry deposition + !if (sslt_active) then + ! call outfld( 'SSTSFDRY', tsflx_slt, pcols, lchnk) + !endif + !if (dust_active) then + ! call outfld( 'DSTSFDRY', tsflx_dst, pcols, lchnk) + !endif + + endsubroutine aero_model_drydep + + !============================================================================= + !============================================================================= + subroutine aero_model_wetdep( state, dt, dlf, cam_out, ptend, pbuf) + + !use wetdep, only : wetdepa_v1, wetdep_inputs_set, wetdep_inputs_t + !use dust_model, only : dust_names + !use seasalt_model, only : sslt_names=>seasalt_names + + ! args + + type(physics_state), intent(in) :: state ! Physics state variables + real(r8), intent(in) :: dt ! time step + real(r8), intent(in) :: dlf(:,:) ! shallow+deep convective detrainment [kg/kg/s] + type(cam_out_t), intent(inout) :: cam_out ! export state + type(physics_ptend), intent(out) :: ptend ! indivdual parameterization tendencies + type(physics_buffer_desc), pointer :: pbuf(:) + + !! local vars + + !integer :: ncol ! number of atmospheric columns + !integer :: lchnk ! chunk identifier + !integer :: m,mm, i,k + + !real(r8) :: sflx_tot_dst(pcols) + !real(r8) :: sflx_tot_slt(pcols) + + !real(r8) :: iscavt(pcols, pver) + !real(r8) :: scavt(pcols, pver) + !real(r8) :: scavcoef(pcols,pver) ! Dana and Hales coefficient (/mm) (0.1) + !real(r8) :: sflx(pcols) ! deposition flux + + !real(r8) :: icscavt(pcols, pver) + !real(r8) :: isscavt(pcols, pver) + !real(r8) :: bcscavt(pcols, pver) + !real(r8) :: bsscavt(pcols, pver) + + !real(r8) :: sol_factb, sol_facti + + !real(r8) :: rainmr(pcols,pver) ! mixing ratio of rain within cloud volume + !real(r8) :: cldv(pcols,pver) ! cloudy volume undergoing scavenging + !real(r8) :: cldvcu(pcols,pver) ! Convective precipitation area at the top interface of current layer + !real(r8) :: cldvst(pcols,pver) ! Stratiform precipitation area at the top interface of current layer + + !real(r8), pointer :: fracis(:,:,:) ! fraction of transported species that are insoluble + + !type(wetdep_inputs_t) :: dep_inputs ! obj that contains inputs to wetdepa routine + + !if (nwetdep<1) return + + !call pbuf_get_field(pbuf, fracis_idx, fracis, start=(/1,1,1/), kount=(/pcols, pver, pcnst/) ) + + !call physics_ptend_init(ptend, state%psetcols, 'aero_model_wetdep', lq=wetdep_lq) + + !call wetdep_inputs_set( state, pbuf, dep_inputs ) + + !lchnk = state%lchnk + !ncol = state%ncol + + !sflx_tot_dst(:) = 0._r8 + !sflx_tot_slt(:) = 0._r8 + + !do m = 1, nwetdep + + ! mm = wetdep_indices(m) + + ! sol_factb = aer_sol_factb(m) + ! sol_facti = aer_sol_facti(m) + + ! scavcoef(:ncol,:) = aer_scav_coef(m) + + ! call wetdepa_v1( state%t, state%pmid, state%q(:,:,1), state%pdel, & + ! dep_inputs%cldt, dep_inputs%cldcu, dep_inputs%cmfdqr, & + ! dep_inputs%conicw, dep_inputs%prain, dep_inputs%qme, & + ! dep_inputs%evapr, dep_inputs%totcond, state%q(:,:,mm), dt, & + ! scavt, iscavt, dep_inputs%cldv, & + ! fracis(:,:,mm), sol_factb, ncol, & + ! scavcoef, & + ! sol_facti_in=sol_facti, & + ! icscavt=icscavt, isscavt=isscavt, bcscavt=bcscavt, bsscavt=bsscavt ) + + ! ptend%q(:ncol,:,mm)=scavt(:ncol,:) + + ! call outfld( trim(cnst_name(mm))//'WET', ptend%q(:,:,mm), pcols, lchnk) + ! call outfld( trim(cnst_name(mm))//'SIC', icscavt , pcols, lchnk) + ! call outfld( trim(cnst_name(mm))//'SIS', isscavt, pcols, lchnk) + ! call outfld( trim(cnst_name(mm))//'SBC', bcscavt, pcols, lchnk) + ! call outfld( trim(cnst_name(mm))//'SBS', bsscavt, pcols, lchnk) + + ! sflx(:)=0._r8 + + ! do k=1,pver + ! do i=1,ncol + ! sflx(i)=sflx(i)+ptend%q(i,k,mm)*state%pdel(i,k)/gravit + ! enddo + ! enddo + ! call outfld( trim(cnst_name(mm))//'SFWET', sflx, pcols, lchnk) + ! + ! if ( any( sslt_names(:)==trim(cnst_name(mm)) ) ) & + ! sflx_tot_slt(:ncol) = sflx_tot_slt(:ncol) + sflx(:ncol) + ! if ( any( dust_names(:)==trim(cnst_name(mm)) ) ) & + ! sflx_tot_dst(:ncol) = sflx_tot_dst(:ncol) + sflx(:ncol) + + ! ! if the user has specified prescribed aerosol dep fluxes then + ! ! do not set cam_out dep fluxes according to the prognostic aerosols + ! if (.not.aerodep_flx_prescribed()) then + ! ! export deposition fluxes to coupler ??? why "-" sign ??? + ! if (trim(cnst_name(mm))=='CB2') then + ! cam_out%bcphiwet(:) = max(-sflx(:), 0._r8) + ! elseif (trim(cnst_name(mm))=='OC2') then + ! cam_out%ocphiwet(:) = max(-sflx(:), 0._r8) + ! elseif (trim(cnst_name(mm))==trim(dust_names(1))) then + ! cam_out%dstwet1(:) = max(-sflx(:), 0._r8) + ! elseif (trim(cnst_name(mm))==trim(dust_names(2))) then + ! cam_out%dstwet2(:) = max(-sflx(:), 0._r8) + ! elseif (trim(cnst_name(mm))==trim(dust_names(3))) then + ! cam_out%dstwet3(:) = max(-sflx(:), 0._r8) + ! elseif (trim(cnst_name(mm))==trim(dust_names(4))) then + ! cam_out%dstwet4(:) = max(-sflx(:), 0._r8) + ! endif + ! endif + + !enddo + ! + !if (sslt_active) then + ! call outfld( 'SSTSFWET', sflx_tot_slt, pcols, lchnk) + !endif + !if (dust_active) then + ! call outfld( 'DSTSFWET', sflx_tot_dst, pcols, lchnk) + !endif + + endsubroutine aero_model_wetdep + + !------------------------------------------------------------------------- + ! provides aerosol surface area info for sectional aerosols + ! called from mo_usrrxt + !------------------------------------------------------------------------- + subroutine aero_model_surfarea( & + mmr, radmean, relhum, pmid, temp, strato_sad, sulfate, m, ltrop, & + dlat, het1_ndx, pbuf, ncol, sfc, dm_aer, sad_total, reff_trop ) + + !use mo_constants, only : pi, avo => avogadro + + ! dummy args + real(r8), intent(in) :: pmid(:,:) + real(r8), intent(in) :: temp(:,:) + real(r8), intent(in) :: mmr(:,:,:) + real(r8), intent(in) :: radmean ! mean radii in cm + real(r8), intent(in) :: strato_sad(:,:) + integer, intent(in) :: ncol + integer, intent(in) :: ltrop(:) + real(r8), intent(in) :: dlat(:) ! degrees latitude + integer, intent(in) :: het1_ndx + real(r8), intent(in) :: relhum(:,:) + real(r8), intent(in) :: m(:,:) ! total atm density (/cm^3) + real(r8), intent(in) :: sulfate(:,:) + type(physics_buffer_desc), pointer :: pbuf(:) + + real(r8), intent(inout) :: sfc(:,:,:) + real(r8), intent(inout) :: dm_aer(:,:,:) + real(r8), intent(inout) :: sad_total(:,:) + real(r8), intent(out) :: reff_trop(:,:) + + !! local vars + + !integer :: i,k + !real(r8) :: rho_air + !real(r8) :: v, n, n_exp, r_rd, r_sd + !real(r8) :: dm_sulf, dm_sulf_wet, log_sd_sulf, sfc_sulf, sfc_nit + !real(r8) :: dm_orgc, dm_orgc_wet, log_sd_orgc, sfc_oc, sfc_soa + !real(r8) :: sfc_soai, sfc_soam, sfc_soab, sfc_soat, sfc_soax + !real(r8) :: dm_bc, dm_bc_wet, log_sd_bc, sfc_bc + !real(r8) :: rxt_sulf, rxt_nit, rxt_oc, rxt_soa + !real(r8) :: c_n2o5, c_ho2, c_no2, c_no3 + !real(r8) :: s_exp + + !!----------------------------------------------------------------- + !! ... parameters for log-normal distribution by number + !! references: + !! Chin et al., JAS, 59, 461, 2003 + !! Liao et al., JGR, 108(D1), 4001, 2003 + !! Martin et al., JGR, 108(D3), 4097, 2003 + !!----------------------------------------------------------------- + !real(r8), parameter :: rm_sulf = 6.95e-6_r8 ! mean radius of sulfate particles (cm) (Chin) + !real(r8), parameter :: sd_sulf = 2.03_r8 ! standard deviation of radius for sulfate (Chin) + !real(r8), parameter :: rho_sulf = 1.7e3_r8 ! density of sulfate aerosols (kg/m3) (Chin) + + !real(r8), parameter :: rm_orgc = 2.12e-6_r8 ! mean radius of organic carbon particles (cm) (Chin) + !real(r8), parameter :: sd_orgc = 2.20_r8 ! standard deviation of radius for OC (Chin) + !real(r8), parameter :: rho_orgc = 1.8e3_r8 ! density of OC aerosols (kg/m3) (Chin) + + !real(r8), parameter :: rm_bc = 1.18e-6_r8 ! mean radius of soot/BC particles (cm) (Chin) + !real(r8), parameter :: sd_bc = 2.00_r8 ! standard deviation of radius for BC (Chin) + !real(r8), parameter :: rho_bc = 1.0e3_r8 ! density of BC aerosols (kg/m3) (Chin) + + !real(r8), parameter :: mw_so4 = 98.e-3_r8 ! so4 molecular wt (kg/mole) + + !integer :: irh, rh_l, rh_u + !real(r8) :: factor, rfac_sulf, rfac_oc, rfac_bc, rfac_ss + !logical :: zero_aerosols + + !!----------------------------------------------------------------- + !! ... table for hygroscopic growth effect on radius (Chin et al) + !! (no growth effect for mineral dust) + !!----------------------------------------------------------------- + !real(r8), dimension(7) :: table_rh, table_rfac_sulf, table_rfac_bc, table_rfac_oc, table_rfac_ss + + !data table_rh(1:7) / 0.0_r8, 0.5_r8, 0.7_r8, 0.8_r8, 0.9_r8, 0.95_r8, 0.99_r8/ + !data table_rfac_sulf(1:7) / 1.0_r8, 1.4_r8, 1.5_r8, 1.6_r8, 1.8_r8, 1.9_r8, 2.2_r8/ + !data table_rfac_oc(1:7) / 1.0_r8, 1.2_r8, 1.4_r8, 1.5_r8, 1.6_r8, 1.8_r8, 2.2_r8/ + !data table_rfac_bc(1:7) / 1.0_r8, 1.0_r8, 1.0_r8, 1.2_r8, 1.4_r8, 1.5_r8, 1.9_r8/ + !data table_rfac_ss(1:7) / 1.0_r8, 1.6_r8, 1.8_r8, 2.0_r8, 2.4_r8, 2.9_r8, 4.8_r8/ + + !!----------------------------------------------------------------- + !! ... exponent for calculating number density + !!----------------------------------------------------------------- + !n_exp = exp( -4.5_r8*log(sd_sulf)*log(sd_sulf) ) + + !dm_sulf = 2._r8 * rm_sulf + !dm_orgc = 2._r8 * rm_orgc + !dm_bc = 2._r8 * rm_bc + + !log_sd_sulf = log(sd_sulf) + !log_sd_orgc = log(sd_orgc) + !log_sd_bc = log(sd_bc) + + !reff_trop(:,:) = 0._r8 + + !ver_loop: do k = 1,pver + ! col_loop: do i = 1,ncol + ! !------------------------------------------------------------------------- + ! ! ... air density (kg/m3) + ! !------------------------------------------------------------------------- + ! rho_air = pmid(i,k)/(temp(i,k)*287.04_r8) + ! !------------------------------------------------------------------------- + ! ! ... aerosol growth interpolated from M.Chin's table + ! !------------------------------------------------------------------------- + ! if (relhum(i,k) >= table_rh(7)) then + ! rfac_sulf = table_rfac_sulf(7) + ! rfac_oc = table_rfac_oc(7) + ! rfac_bc = table_rfac_bc(7) + ! else + ! do irh = 2,7 + ! if (relhum(i,k) <= table_rh(irh)) then + ! exit + ! end if + ! end do + ! rh_l = irh-1 + ! rh_u = irh + + ! factor = (relhum(i,k) - table_rh(rh_l))/(table_rh(rh_u) - table_rh(rh_l)) + + ! rfac_sulf = table_rfac_sulf(rh_l) + factor*(table_rfac_sulf(rh_u) - table_rfac_sulf(rh_l)) + ! rfac_oc = table_rfac_oc(rh_u) + factor*(table_rfac_oc(rh_u) - table_rfac_oc(rh_l)) + ! rfac_bc = table_rfac_bc(rh_u) + factor*(table_rfac_bc(rh_u) - table_rfac_bc(rh_l)) + ! end if + + ! dm_sulf_wet = dm_sulf * rfac_sulf + ! dm_orgc_wet = dm_orgc * rfac_oc + ! dm_bc_wet = dm_bc * rfac_bc + + ! dm_bc_wet = min(dm_bc_wet ,50.e-6_r8) ! maximum size is 0.5 micron (Chin) + ! dm_orgc_wet = min(dm_orgc_wet,50.e-6_r8) ! maximum size is 0.5 micron (Chin) + + + ! !------------------------------------------------------------------------- + ! ! ... sulfate aerosols + ! !------------------------------------------------------------------------- + ! zero_aerosols = k < ltrop(i) + ! if ( abs( dlat(i) ) > 50._r8 ) then + ! zero_aerosols = pmid(i,k) < 30000._r8 + ! endif + ! !------------------------------------------------------------------------- + ! ! ... use ubvals climatology for stratospheric sulfate surface area density + ! !------------------------------------------------------------------------- + ! if( zero_aerosols ) then + ! sfc_sulf = strato_sad(i,k) + ! if ( het1_ndx > 0 ) then + ! sfc_sulf = 0._r8 ! reaction already taken into account in mo_strato_rates.F90 + ! end if + ! sfc_nit = 0._r8 + ! sfc_soa = 0._r8 + ! sfc_oc = 0._r8 + ! sfc_bc = 0._r8 + ! else + + ! if( so4_ndx > 0 ) then + ! !------------------------------------------------------------------------- + ! ! convert mass mixing ratio of aerosol to cm3/cm3 (cm^3_aerosol/cm^3_air) + ! ! v=volume density (m^3/m^3) + ! ! rho_aer=density of aerosol (kg/m^3) + ! ! v=m*rho_air/rho_aer [kg/kg * (kg/m3)_air/(kg/m3)_aer] + ! !------------------------------------------------------------------------- + ! v = mmr(i,k,so4_ndx) * rho_air/rho_sulf + ! !------------------------------------------------------------------------- + ! ! calculate the number density of aerosol (aerosols/cm3) + ! ! assuming a lognormal distribution + ! ! n = (aerosols/cm3) + ! ! dm = geometric mean diameter + ! ! + ! ! because only the dry mass of the aerosols is known, we + ! ! use the mean dry radius + ! !------------------------------------------------------------------------- + ! n = v * (6._r8/pi)*(1._r8/(dm_sulf**3._r8))*n_exp + ! !------------------------------------------------------------------------- + ! ! find surface area of aerosols using dm_wet, log_sd + ! ! (increase of sd due to RH is negligible) + ! ! and number density calculated above as distribution + ! ! parameters + ! ! sfc = surface area of wet aerosols (cm^2/cm^3) + ! !------------------------------------------------------------------------- + ! s_exp = exp(2._r8*log_sd_sulf*log_sd_sulf) + ! sfc_sulf = n * pi * (dm_sulf_wet**2._r8) * s_exp + + ! else + ! !------------------------------------------------------------------------- + ! ! if so4 not simulated, use off-line sulfate and calculate as above + ! ! convert sulfate vmr to volume density of aerosol (cm^3_aerosol/cm^3_air) + ! !------------------------------------------------------------------------- + ! v = sulfate(i,k) * m(i,k) * mw_so4 / (avo * rho_sulf) *1.e6_r8 + ! n = v * (6._r8/pi)*(1._r8/(dm_sulf**3._r8))*n_exp + ! s_exp = exp(2._r8*log_sd_sulf*log_sd_sulf) + ! sfc_sulf = n * pi * (dm_sulf_wet**2._r8) * s_exp + + ! end if + ! + ! !------------------------------------------------------------------------- + ! ! ammonium nitrate (follow same procedure as sulfate, using size and density of sulfate) + ! !------------------------------------------------------------------------- + ! if( nit_ndx > 0 ) then + ! v = mmr(i,k,nit_ndx) * rho_air/rho_sulf + ! n = v * (6._r8/pi)*(1._r8/(dm_sulf**3._r8))*n_exp + ! s_exp = exp(2._r8*log_sd_sulf*log_sd_sulf) + ! sfc_nit = n * pi * (dm_sulf_wet**2._r8) * s_exp + ! else + ! sfc_nit = 0._r8 + ! end if + + ! !------------------------------------------------------------------------- + ! ! hydrophylic organic carbon (follow same procedure as sulfate) + ! !------------------------------------------------------------------------- + ! if( oc2_ndx > 0 ) then + ! v = mmr(i,k,oc2_ndx) * rho_air/rho_orgc + ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3))*n_exp + ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) + ! sfc_oc = n * pi * (dm_orgc_wet**2._r8) * s_exp + ! else + ! sfc_oc = 0._r8 + ! end if + + ! !------------------------------------------------------------------------- + ! ! secondary organic carbon (follow same procedure as sulfate) + ! !------------------------------------------------------------------------- + ! if( soa_ndx > 0 ) then + ! v = mmr(i,k,soa_ndx) * rho_air/rho_orgc + ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp + ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) + ! sfc_soa = n * pi * (dm_orgc_wet**2._r8) * s_exp + ! else + ! sfc_soa = 0._r8 + ! end if + + ! !------------------------------------------------------------------------- + ! ! black carbon (follow same procedure as sulfate) + ! !------------------------------------------------------------------------- + ! if( cb2_ndx > 0 ) then + ! v = mmr(i,k,cb2_ndx) * rho_air/rho_bc + ! n = v * (6._r8/pi)*(1._r8/(dm_bc**3._r8))*n_exp + ! s_exp = exp(2._r8*log_sd_bc*log_sd_bc) + ! sfc_bc = n * pi * (dm_bc_wet**2._r8) * s_exp + ! else + ! sfc_bc = 0._r8 + ! end if + ! if( soai_ndx > 0 ) then + ! v = mmr(i,k,soai_ndx) * rho_air/rho_orgc + ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp + ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) + ! sfc_soai = n * pi * (dm_orgc_wet**2._r8) * s_exp + ! else + ! sfc_soai = 0._r8 + ! end if + ! if( soam_ndx > 0 ) then + ! v = mmr(i,k,soam_ndx) * rho_air/rho_orgc + ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp + ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) + ! sfc_soam = n * pi * (dm_orgc_wet**2._r8) * s_exp + ! else + ! sfc_soam = 0._r8 + ! end if + ! if( soab_ndx > 0 ) then + ! v = mmr(i,k,soab_ndx) * rho_air/rho_orgc + ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp + ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) + ! sfc_soab = n * pi * (dm_orgc_wet**2._r8) * s_exp + ! else + ! sfc_soab = 0._r8 + ! end if + ! if( soat_ndx > 0 ) then + ! v = mmr(i,k,soat_ndx) * rho_air/rho_orgc + ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp + ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) + ! sfc_soat = n * pi * (dm_orgc_wet**2._r8) * s_exp + ! else + ! sfc_soat = 0._r8 + ! end if + ! if( soax_ndx > 0 ) then + ! v = mmr(i,k,soax_ndx) * rho_air/rho_orgc + ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp + ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) + ! sfc_soax = n * pi * (dm_orgc_wet**2._r8) * s_exp + ! else + ! sfc_soax = 0._r8 + ! end if + ! sfc_soa = sfc_soa + sfc_soai + sfc_soam + sfc_soab + sfc_soat + sfc_soax + + ! end if + + ! sfc(i,k,:) = (/ sfc_sulf, sfc_nit, sfc_oc, sfc_soa, sfc_bc /) + ! dm_aer(i,k,:) = (/ dm_sulf_wet,dm_sulf_wet,dm_orgc_wet,dm_orgc_wet,dm_bc_wet /) + + ! !------------------------------------------------------------------------- + ! ! ... add up total surface area density for output + ! !------------------------------------------------------------------------- + ! sad_total(i,k) = sfc_sulf + sfc_nit + sfc_oc + sfc_soa + sfc_bc + + ! enddo col_loop + !enddo ver_loop + + end subroutine aero_model_surfarea + + !------------------------------------------------------------------------- + ! stub + !------------------------------------------------------------------------- + subroutine aero_model_strat_surfarea( ncol, mmr, pmid, temp, ltrop, pbuf, strato_sad, reff_strat ) + + ! dummy args + integer, intent(in) :: ncol + real(r8), intent(in) :: mmr(:,:,:) + real(r8), intent(in) :: pmid(:,:) + real(r8), intent(in) :: temp(:,:) + integer, intent(in) :: ltrop(:) ! tropopause level indices + type(physics_buffer_desc), pointer :: pbuf(:) + real(r8), intent(out) :: strato_sad(:,:) + real(r8), intent(out) :: reff_strat(:,:) + + strato_sad(:,:) = 0._r8 + reff_strat(:,:) = 0._r8 + + end subroutine aero_model_strat_surfarea + + !============================================================================= + !============================================================================= + subroutine aero_model_gasaerexch( loffset, ncol, lchnk, troplev, delt, reaction_rates, & + tfld, pmid, pdel, mbar, relhum, & + zm, qh2o, cwat, cldfr, cldnum, & + airdens, invariants, del_h2so4_gasprod, & + vmr0, vmr, pbuf ) + + use chem_mods, only : gas_pcnst + !use mo_aerosols, only : aerosols_formation, has_aerosols + !use mo_setsox, only : setsox, has_sox + !use mo_setsoa, only : setsoa, has_soa + + !----------------------------------------------------------------------- + ! ... dummy arguments + !----------------------------------------------------------------------- + integer, intent(in) :: loffset ! offset applied to modal aero "pointers" + integer, intent(in) :: ncol ! number columns in chunk + integer, intent(in) :: lchnk ! chunk index + integer, intent(in) :: troplev(:) + real(r8), intent(in) :: delt ! time step size (sec) + real(r8), intent(in) :: reaction_rates(:,:,:) ! reaction rates + real(r8), intent(in) :: tfld(:,:) ! temperature (K) + real(r8), intent(in) :: pmid(:,:) ! pressure at model levels (Pa) + real(r8), intent(in) :: pdel(:,:) ! pressure thickness of levels (Pa) + real(r8), intent(in) :: mbar(:,:) ! mean wet atmospheric mass ( amu ) + real(r8), intent(in) :: relhum(:,:) ! relative humidity + real(r8), intent(in) :: airdens(:,:) ! total atms density (molec/cm**3) + real(r8), intent(in) :: invariants(:,:,:) + real(r8), intent(in) :: del_h2so4_gasprod(:,:) + real(r8), intent(in) :: zm(:,:) + real(r8), intent(in) :: qh2o(:,:) + real(r8), intent(in) :: cwat(:,:) ! cloud liquid water content (kg/kg) + real(r8), intent(in) :: cldfr(:,:) + real(r8), intent(in) :: cldnum(:,:) ! droplet number concentration (#/kg) + real(r8), intent(in) :: vmr0(:,:,:) ! initial mixing ratios (before gas-phase chem changes) + real(r8), intent(inout) :: vmr(:,:,:) ! mixing ratios ( vmr ) + + type(physics_buffer_desc), pointer :: pbuf(:) + + !! local vars + + !real(r8) :: vmrcw(ncol,pver,gas_pcnst) ! cloud-borne aerosol (vmr) + + !real(r8) :: aqso4(ncol,1) ! aqueous phase chemistry + !real(r8) :: aqh2so4(ncol,1) ! aqueous phase chemistry + !real(r8) :: aqso4_h2o2(ncol) ! SO4 aqueous phase chemistry due to H2O2 + !real(r8) :: aqso4_o3(ncol) ! SO4 aqueous phase chemistry due to O3 + !real(r8) :: xphlwc(ncol,pver) ! pH value multiplied by lwc + + + ! !aqueous chemistry ... + + !if( has_sox ) then + ! call setsox( & + ! ncol, & + ! lchnk, & + ! loffset, & + ! delt, & + ! pmid, & + ! pdel, & + ! tfld, & + ! mbar, & + ! cwat, & + ! cldfr, & + ! cldnum, & + ! airdens, & + ! invariants, & + ! vmrcw, & + ! vmr, & + ! xphlwc, & + ! aqso4, & + ! aqh2so4, & + ! aqso4_h2o2,& + ! aqso4_o3 & + ! ) + ! call outfld( 'XPH_LWC',xphlwc(:ncol,:), ncol , lchnk ) + !endif + + !if( has_soa ) then + ! call setsoa( ncol, lchnk, delt, reaction_rates, tfld, airdens, vmr, pbuf) + !endif + + !if( has_aerosols ) then + ! call aerosols_formation( ncol, lchnk, tfld, relhum, vmr ) + !endif + + + end subroutine aero_model_gasaerexch + + !============================================================================= + !============================================================================= + subroutine aero_model_emissions( state, cam_in ) + !use seasalt_model, only: seasalt_emis, seasalt_indices + !use dust_model, only: dust_emis, dust_indices + use physics_types, only: physics_state + + ! Arguments: + + type(physics_state), intent(in) :: state ! Physics state variables + type(cam_in_t), intent(inout) :: cam_in ! import state + + !! local vars + + !integer :: lchnk, ncol + !integer :: m, mm + !real(r8) :: soil_erod_tmp(pcols) + !real(r8) :: sflx(pcols) ! accumulate over all bins for output + !real(r8) :: u10cubed(pcols) + !real (r8), parameter :: z0=0.0001_r8 ! m roughness length over oceans--from ocean model + + !lchnk = state%lchnk + !ncol = state%ncol + + !if (dust_active) then + + ! call dust_emis( ncol, lchnk, cam_in%dstflx, cam_in%cflx, soil_erod_tmp ) + + ! ! some dust emis diagnostics ... + ! sflx(:)=0._r8 + ! do m=1,dust_nbin + ! mm = dust_indices(m) + ! sflx(:ncol)=sflx(:ncol)+cam_in%cflx(:ncol,mm) + ! call outfld(trim(dust_names(m))//'SF',cam_in%cflx(:,mm),pcols, lchnk) + ! enddo + ! call outfld('DSTSFMBL',sflx(:),pcols,lchnk) + ! call outfld('LND_MBL',soil_erod_tmp(:),pcols, lchnk ) + !endif + + !if (sslt_active) then + ! u10cubed(:ncol)=sqrt(state%u(:ncol,pver)**2+state%v(:ncol,pver)**2) + ! ! move the winds to 10m high from the midpoint of the gridbox: + ! ! follows Tie and Seinfeld and Pandis, p.859 with math. + + ! u10cubed(:ncol)=u10cubed(:ncol)*log(10._r8/z0)/log(state%zm(:ncol,pver)/z0) + + ! ! we need them to the 3.41 power, according to Gong et al., 1997: + ! u10cubed(:ncol)=u10cubed(:ncol)**3.41_r8 + + ! sflx(:)=0._r8 + + ! call seasalt_emis( u10cubed, cam_in%sst, cam_in%ocnfrac, ncol, cam_in%cflx ) + + ! do m=1,seasalt_nbin + ! mm = seasalt_indices(m) + ! sflx(:ncol)=sflx(:ncol)+cam_in%cflx(:ncol,mm) + ! call outfld(trim(seasalt_names(m))//'SF',cam_in%cflx(:,mm),pcols,lchnk) + ! enddo + ! call outfld('SSTSFMBL',sflx(:),pcols,lchnk) + !endif + + end subroutine aero_model_emissions + +end module aero_model diff --git a/src/chemistry/pp_geoschem/charge_neutrality.F90 b/src/chemistry/pp_geoschem/charge_neutrality.F90 new file mode 100644 index 0000000000..92ec519000 --- /dev/null +++ b/src/chemistry/pp_geoschem/charge_neutrality.F90 @@ -0,0 +1,176 @@ +module charge_neutrality + + use shr_kind_mod, only : r8 => shr_kind_r8 + use ppgrid, only : pcols, pver + !use mo_chem_utls, only : get_spc_ndx + + implicit none + + private + public :: charge_balance + + interface charge_balance + module procedure charge_fix_vmr + module procedure charge_fix_mmr ! for fixing charge balance after vertical diffusion + end interface + + !integer, parameter :: pos_ion_n = 22 + !character(len=16), parameter :: pos_ion_names(pos_ion_n) = (/ & + ! 'Np ','N2p ','Op ','O2p ','NOp ', & + ! 'O4p ','O2p_H2O ','Hp_H2O ','Hp_2H2O ','Hp_3H2O ', & + ! 'Hp_4H2O ','Hp_5H2O ','H3Op_OH ','Hp_3N1 ','Hp_4N1 ', & + ! 'NOp_H2O ','NOp_2H2O ','NOp_3H2O ','NOp_CO2 ','NOp_N2 ', & + ! 'Op2P ','Op2D ' /) + + !integer, parameter :: neg_ion_n = 21 + !character(len=16), parameter :: neg_ion_names(neg_ion_n) = (/ & + ! 'Om ','O2m ','O3m ','O4m ','OHm ', & + ! 'CO3m ','CO4m ','NO2m ','NO3m ','HCO3m ', & + ! 'CLm ','CLOm ','CLm_H2O ','CLm_HCL ','CO3m_H2O ', & + ! 'NO3m_H2O ','CO3m2H2O ','NO2m_H2O ','NO3m2H2O ','NO3mHNO3 ', & + ! 'NO3m_HCL ' /) + +contains + + !----------------------------------------------------------------------- + ! ... force ion/electron balance + !----------------------------------------------------------------------- + subroutine charge_fix_vmr( ncol, vmr ) + + !----------------------------------------------------------------------- + ! ... dummy arguments + !----------------------------------------------------------------------- + integer, intent(in) :: ncol + real(r8), intent(inout) :: vmr(:,:,:) ! concentration + + !----------------------------------------------------------------------- + ! ... local variables + !----------------------------------------------------------------------- + integer :: i, n + integer :: elec_ndx + real(r8) :: wrk(ncol,pver) + + !elec_ndx = get_spc_ndx('e') + + !!-------------------------------------------------------------------- + !! If electrons are in the chemistry add up charges to get electrons + !!-------------------------------------------------------------------- + !if( elec_ndx > 0 ) then + ! wrk(:,:) = 0._r8 + + ! do i = 1,pos_ion_n + ! n = get_spc_ndx(pos_ion_names(i)) + ! if (n>0) then + ! wrk(:ncol,:) = wrk(:ncol,:) + vmr(:ncol,:,n) + ! endif + ! enddo + ! do i = 1,neg_ion_n + ! n = get_spc_ndx(neg_ion_names(i)) + ! if (n>0) then + ! wrk(:ncol,:) = wrk(:ncol,:) - vmr(:ncol,:,n) + ! endif + ! enddo + + ! where ( wrk(:,:)<0._r8 ) + ! wrk(:,:)=0._r8 + ! end where + + ! vmr(:ncol,:,elec_ndx) = wrk(:ncol,:) + + !end if + + end subroutine charge_fix_vmr + + !----------------------------------------------------------------------- + ! ... force ion/electron balance + !----------------------------------------------------------------------- + subroutine charge_fix_mmr(state, pbuf) + + use constituents, only : cnst_get_ind + use physconst, only : mbarv ! Constituent dependent mbar + use short_lived_species, only : slvd_index,slvd_pbf_ndx => pbf_idx ! Routines to access short lived species in pbuf + use chem_mods, only : adv_mass + use physics_buffer, only : pbuf_get_field,physics_buffer_desc ! Needed to get variables from physics buffer + use physics_types, only : physics_state + + !----------------------------------------------------------------------- + ! ... dummy arguments + !----------------------------------------------------------------------- + type(physics_state), intent(inout), target :: state + type(physics_buffer_desc), pointer :: pbuf(:) ! physics buffer + + !----------------------------------------------------------------------- + ! ... local variables + !----------------------------------------------------------------------- + !integer :: i, n, ns, nc + !integer :: elec_ndx + !integer :: lchnk !Chunk number from state structure + !integer :: ncol !Number of columns in this chunk from state structure + + !real(r8), dimension(:,:,:), pointer :: q ! model mass mixing ratios + !real(r8), dimension(:,:), pointer :: qs ! Pointer to access fields in pbuf + + !character(len=16) :: name + !real(r8) :: vmr(state%ncol,pver) + !real(r8) :: wrk(state%ncol,pver) + + !!----------------------------------------------------------------------- + !elec_ndx = get_spc_ndx('e') + + !!-------------------------------------------------------------------- + !! If electrons are simulated enforce charge neutrality ... + !!-------------------------------------------------------------------- + !if( elec_ndx > 0 ) then + ! lchnk = state%lchnk + ! ncol = state%ncol + ! q => state%q + ! wrk(:,:) = 0._r8 + + ! do i = 1,pos_ion_n+neg_ion_n + ! if (i .le. pos_ion_n) then + ! name = pos_ion_names(i) + ! else + ! name = neg_ion_names(i-pos_ion_n) + ! endif + ! n = get_spc_ndx(name) + + ! if (n>0) then + ! call cnst_get_ind( name, nc, abort=.false. ) + ! if (nc>0) then + ! vmr(:ncol,:) = mbarv(:ncol,:,lchnk) * q(:ncol,:,nc) / adv_mass(n) + ! else + ! ! not transported + ! ns = slvd_index( name ) + ! if (ns>0) then + ! call pbuf_get_field(pbuf, slvd_pbf_ndx, qs, start=(/1,1,ns/), kount=(/pcols,pver,1/) ) + ! vmr(:ncol,:) = mbarv(:ncol,:,lchnk) * qs(:ncol,:) / adv_mass(n) + ! endif + ! endif + ! if (i .le. pos_ion_n) then + ! wrk(:ncol,:) = wrk(:ncol,:) + vmr(:ncol,:) + ! else + ! wrk(:ncol,:) = wrk(:ncol,:) - vmr(:ncol,:) + ! endif + ! end if + ! end do + + ! where ( wrk(:,:)<0._r8 ) + ! wrk(:,:)=0._r8 + ! end where + + ! call cnst_get_ind( 'e', nc, abort=.false. ) + + ! if (nc>0) then + ! q(:ncol,:,nc) = adv_mass(elec_ndx) * wrk(:ncol,:) / mbarv(:ncol,:,lchnk) + ! else + ! ! not transported + ! ns = slvd_index( 'e' ) + ! call pbuf_get_field(pbuf, slvd_pbf_ndx, qs, start=(/1,1,ns/), kount=(/pcols,pver,1/) ) + ! qs(:ncol,:) = adv_mass(elec_ndx) * wrk(:ncol,:) / mbarv(:ncol,:,lchnk) + ! endif + + !endif + + end subroutine charge_fix_mmr + +end module charge_neutrality diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/pp_geoschem/chem_mods.F90 new file mode 100644 index 0000000000..ac8e66440d --- /dev/null +++ b/src/chemistry/pp_geoschem/chem_mods.F90 @@ -0,0 +1,50 @@ + module chem_mods +!-------------------------------------------------------------- +! ... Basic chemistry parameters and arrays +!-------------------------------------------------------------- + use shr_kind_mod, only : r8 => shr_kind_r8 + implicit none + save + integer, parameter :: phtcnt = 40, & ! number of photolysis reactions + rxntot = 212, & ! number of total reactions + gascnt = 172, & ! number of gas phase reactions + nabscol = 2, & ! number of absorbing column densities + gas_pcnst = 103, & ! number of "gas phase" species + nfs = 4, & ! number of "fixed" species + relcnt = 0, & ! number of relationship species + grpcnt = 0, & ! number of group members + nzcnt = 824, & ! number of non-zero matrix entries + extcnt = 4, & ! number of species with external forcing + clscnt1 = 8, & ! number of species in explicit class + clscnt2 = 0, & ! number of species in hov class + clscnt3 = 0, & ! number of species in ebi class + clscnt4 = 95, & ! number of species in implicit class + clscnt5 = 0, & ! number of species in rodas class + indexm = 1, & ! index of total atm density in invariant array + indexh2o = 4, & ! index of water vapor density + clsze = 1, & ! loop length for implicit chemistry + rxt_tag_cnt = 95, & + enthalpy_cnt = 0, & + nslvd = 0 + integer :: clscnt(5) = 0 + integer :: cls_rxt_cnt(4,5) = 0 + integer :: clsmap(gas_pcnst,5) = 0 + integer :: permute(gas_pcnst,5) = 0 + integer :: diag_map(clscnt4) = 0 + real(r8) :: adv_mass(gas_pcnst) = 0._r8 + real(r8) :: crb_mass(gas_pcnst) = 0._r8 + real(r8) :: fix_mass(max(1,nfs)) + real(r8), allocatable :: cph_enthalpy(:) + integer, allocatable :: cph_rid(:) + integer, allocatable :: num_rnts(:) + integer, allocatable :: rxt_tag_map(:) + real(r8), allocatable :: pht_alias_mult(:,:) + character(len=16), allocatable :: rxt_tag_lst(:) + character(len=16), allocatable :: pht_alias_lst(:,:) + character(len=16) :: inv_lst(max(1,nfs)) + character(len=16) :: extfrc_lst(max(1,extcnt)) + logical :: frc_from_dataset(max(1,extcnt)) + logical :: is_vector + logical :: is_scalar + character(len=16) :: slvd_lst(max(1,nslvd)) + end module chem_mods diff --git a/src/chemistry/pp_geoschem/chem_prod_loss_diags.F90 b/src/chemistry/pp_geoschem/chem_prod_loss_diags.F90 new file mode 100644 index 0000000000..b3eb614cf4 --- /dev/null +++ b/src/chemistry/pp_geoschem/chem_prod_loss_diags.F90 @@ -0,0 +1,37 @@ +module chem_prod_loss_diags + use shr_kind_mod, only : r8 => shr_kind_r8 + use chem_mods, only : clscnt1, clscnt4, gas_pcnst, clsmap, permute + use ppgrid, only : pver + use chem_mods, only : rxntot + use cam_history, only : addfld, outfld, add_default + !use mo_tracname, only : solsym + + implicit none + + private + public :: chem_prod_loss_diags_init + public :: chem_prod_loss_diags_out + +contains + + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + subroutine chem_prod_loss_diags_init + + end subroutine chem_prod_loss_diags_init + + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + subroutine chem_prod_loss_diags_out( ncol, lchnk, base_sol, reaction_rates, prod_in, loss_in, xhnm ) + + integer, intent(in) :: ncol, lchnk + real(r8), intent(in) :: base_sol(ncol,pver,gas_pcnst) + real(r8), intent(in) :: reaction_rates(ncol,pver,max(1,rxntot)) + real(r8), intent(in) :: prod_in(ncol,pver,max(1,clscnt4)) + real(r8), intent(in) :: loss_in(ncol,pver,max(1,clscnt4)) + real(r8), intent(in) :: xhnm(ncol,pver) + + end subroutine chem_prod_loss_diags_out + +end module chem_prod_loss_diags + diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index ba5689511c..34cc32330e 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -8,12 +8,14 @@ module chemistry use ppgrid, only: begchunk, endchunk, pcols use ppgrid, only: pver use constituents, only: pcnst, cnst_add - use mo_gas_phase_chemdr, only: map2chm - use mo_constants, only: pi + !use mo_gas_phase_chemdr, only: map2chm + !use mo_constants, only: pi use shr_const_mod, only: molw_dryair=>SHR_CONST_MWDAIR - use mo_chem_utls, only : get_spc_ndx - use chem_mods, only : gas_pcnst, adv_mass - use mo_sim_dat, only: set_sim_dat + !use mo_chem_utls, only : get_spc_ndx + !use chem_mods, only : gas_pcnst, adv_mass + !use mo_sim_dat, only: set_sim_dat + use spmd_utils, only : masterproc + use cam_logfile, only : iulog implicit none private save @@ -32,18 +34,23 @@ module chemistry public :: chem_read_restart public :: chem_init_restart public :: chem_readnl ! read chem namelist - public :: chem_reset_fluxes - interface chem_write_restart - module procedure chem_write_restart_bin - module procedure chem_write_restart_pio - end interface - interface chem_read_restart - module procedure chem_read_restart_bin - module procedure chem_read_restart_pio - end interface + public :: chem_emissions + public :: chem_timestep_init ! Private data + !===== SDE DEBUG ===== + integer, parameter :: ntracersmax = 200 ! Must be equal to nadv_chem + integer :: ntracers + character(len=255) :: tracernames(ntracersmax) + integer :: indices(ntracersmax) + real(r8) :: adv_mass(ntracersmax) + + ! Short-lived species (i.e. not advected) + integer, parameter :: nslsmax = 500 ! UNadvected species only + integer :: nsls + character(len=255) :: slsnames(nslsmax) + !===== SDE DEBUG ===== !================================================================================================ contains @@ -57,17 +64,95 @@ logical function chem_is (name) if (name == 'geoschem' ) then chem_is = .true. end if + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_IS' end function chem_is !================================================================================================ subroutine chem_register + + use physics_buffer, only : pbuf_add_field, dtype_r8 !----------------------------------------------------------------------- ! - ! Purpose: register advected constituents for parameterized greenhouse gas chemistry + ! Purpose: register advected constituents for chemistry ! !----------------------------------------------------------------------- + integer :: i, n + real(r8) :: cptmp + real(r8) :: qmin + character(len=128) :: mixtype + character(len=128) :: molectype + character(len=128) :: lng_name + logical :: camout + logical :: ic_from_cam2 + logical :: has_fixed_ubc + logical :: has_fixed_ubflx + ! SDE 2018-05-02: This seems to get called before anything else + ! That includes CHEM_INIT + ! At this point, mozart calls SET_SIM_DAT, which is specified by each + ! mechanism separately (ie mozart/chemistry.F90 calls the subroutine + ! set_sim_dat which is in pp_[mechanism]/mo_sim_dat.F90. That sets a lot of + ! data in other places, notably in "chem_mods" + + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_REGISTER' + ! At the moment, we force nadv_chem=200 in the setup file + ntracers = 200 + do i = 1, ntracersmax + ! TODO: Read input.geos in chem_readnl to get tracernames(1:ntracers) + ! TODO: Get all other species properties here from species database + ! Hard-code for now + select case (tracernames(i)) + case ('BCPI') + lng_name = 'Hydrophilic black carbon' + ! Molar mass (g/mol) + adv_mass(i) = 1000.0e+0_r8 * (0.012e+0_r8) + case ('OCS') + lng_name = 'Carbonyl sulfide' + ! Molar mass (g/mol) + adv_mass(i) = 1000.0e+0_r8 * (0.060e+0_r8) + case default + lng_name = tracernames(i) + adv_mass(i) = 1000.0e+0_r8 * (0.001e+0_r8) + end select + ! dummy value for specific heat of constant pressure (Cp) + cptmp = 666._r8 + ! minimum mixing ratio + qmin = 1.e-36_r8 + ! mixing ratio type + mixtype = 'dry' + ! Used for ionospheric WACCM (WACCM-X) + molectype = 'minor' + ! Is an output field (?) + camout = .false. + ! Not true for O2(1-delta) or O2(1-sigma) + ic_from_cam2 = .true. + ! Use a fixed value at the upper boundary + has_fixed_ubc = .false. + ! Use a fixed flux condition at the upper boundary + has_fixed_ubflx = .false. + !write(tracernames(i),'(a,I0.4)') 'GCTRC_', i + ! NOTE: In MOZART, this only gets called for tracers + ! This is the call to add a "constituent" + call cnst_add( trim(tracernames(i)), adv_mass(i), cptmp, qmin, n, & + readiv=ic_from_cam2, mixtype=mixtype, cam_outfld=camout, & + molectype=molectype, fixed_ubc=has_fixed_ubc, & + fixed_ubflx=has_fixed_ubflx, longname=trim(lng_name) ) + ! MOZART uses this for short-lived species. Not certain exactly what it + ! does, but note that the "ShortLivedSpecies" physics buffer already + ! needs to have been initialized, which we haven't done. Physics buffers + ! are fields which are available either across timesteps or for use to + ! modules outside of chemistry + ! More information: + ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html + !call pbuf_add_field('ShortLivedSpecies','global',dtype_r8,(/pcols,pver,nslvd/),pbf_idx) + ! returned values + ! n : mapping in CAM + ! map2chm is a mozart variable + !map2chm(n) = i + !indices(i) = 0 + ! ===== SDE DEBUG ===== + end do end subroutine chem_register @@ -77,6 +162,30 @@ subroutine chem_readnl(nlfile) ! args character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input + ! Local variables + integer :: i + + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_READNL' + + ! TODO: Read in input.geos and get species names + ntracers=2 + do i=1,ntracers + ! TEMPORARY: Hardcode 2 species (BCPI in output, H2 still needed for + ! lower boundary condition) + if (i==1) then + tracernames(i) = 'BCPI' + elseif (i==2) then + tracernames(i) = 'OCS' + else + write(tracernames(i),'(a,I0.4)') 'GCTRC_',i + end if + end do + + ! Assign remaining species dummy names + do i=(ntracers+1),ntracersmax + write(tracernames(i),'(a,I0.4)') 'GCTRC_',i + end do + end subroutine chem_readnl !================================================================================================ @@ -86,6 +195,7 @@ function chem_is_active() logical :: chem_is_active !----------------------------------------------------------------------- chem_is_active = .true. + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_IS_ACTIVE' end function chem_is_active !================================================================================================ @@ -108,13 +218,14 @@ function chem_implements_cnst(name) chem_implements_cnst = .false. - do i = 1, nspecies - if (trim(species(i)) .eq. trim(name)) then + do i = 1, ntracersmax + if (trim(tracernames(i)) .eq. trim(name)) then chem_implements_cnst = .true. exit end if end do + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_IMPLEMENTS_CNST' end function chem_implements_cnst !=============================================================================== @@ -126,73 +237,156 @@ subroutine chem_init(phys_state, pbuf2d) ! (and declare history variables) ! !----------------------------------------------------------------------- + use physics_buffer, only: physics_buffer_desc + use cam_history, only: addfld, add_default, horiz_only + + type(physics_state), intent(in):: phys_state(begchunk:endchunk) + type(physics_buffer_desc), pointer :: pbuf2d(:,:) ! Can add history output here too with the "addfld" & "add_default" routines + call addfld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) + call add_default ( 'BCPI', 1, ' ') + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_INIT' end subroutine chem_init +!=============================================================================== + + subroutine chem_timestep_init(phys_state, pbuf2d) + use physics_buffer, only: physics_buffer_desc + + type(physics_state), intent(in):: phys_state(begchunk:endchunk) + type(physics_buffer_desc), pointer :: pbuf2d(:,:) + + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_INIT' + end subroutine chem_timestep_init + !=============================================================================== subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) + use physics_buffer, only: physics_buffer_desc + use cam_history, only: outfld + use camsrfexch, only: cam_in_t, cam_out_t + + real(r8), intent(in) :: dt ! time step + type(physics_state), intent(in) :: state ! Physics state variables + type(physics_ptend), intent(out) :: ptend ! indivdual parameterization tendencies + type(cam_in_t), intent(inout) :: cam_in + type(cam_out_t), intent(in) :: cam_out + type(physics_buffer_desc), pointer :: pbuf(:) + real(r8), optional, intent(out) :: fh2o(pcols) ! h2o flux to balance source from chemistry + + ! Mapping (?) + logical :: lq(pcnst) + integer :: n, m ! Here's where you'll call DO_CHEMISTRY + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' + lq(:) = .false. + do n=1,pcnst + !m = map2chm(n) + m=0 + if (m > 0) lq(n) = .true. + end do + call physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) + ! ptend%q dimensions: [column, ?, species] + !ptend%q(:ncol,:,:) = 0.0e+0_r8 + !ptend%q(:ncol,:,:) = 0.0e+0_r8 + ptend%q(:,:,:) = 0.0e+0_r8 + if (present(fh2o)) fh2o(:) = 0.0e+0_r8 + return end subroutine chem_timestep_tend !=============================================================================== subroutine chem_init_cnst(name, latvals, lonvals, mask, q) + character(len=*), intent(in) :: name ! constituent name + real(r8), intent(in) :: latvals(:) ! lat in degrees (ncol) + real(r8), intent(in) :: lonvals(:) ! lon in degrees (ncol) + logical, intent(in) :: mask(:) ! Only initialize where .true. + real(r8), intent(out) :: q(:,:) ! kg tracer/kg dry air (ncol, plev ! Used to initialize tracer fields if desired. ! Will need a simple mapping structure as well as the CAM tracer registration ! routines. + integer :: ilev, nlev + + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_INIT_CNST' + + nlev = size(q, 2) + if ( any( tracernames .eq. name ) ) then + do ilev=1,nlev + where(mask) + ! Set to the minimum mixing ratio + q(:,ilev) = 1.0e-38_r8 + end where + end do + end if + end subroutine chem_init_cnst !=============================================================================== subroutine chem_final ! Finalize GEOS-Chem + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_FINAL' return end subroutine chem_final !=============================================================================== - subroutine chem_write_restart_bin( nrg ) - implicit none - integer,intent(in) :: nrg ! Unit number - return - end subroutine chem_write_restart_bin -!=============================================================================== - subroutine chem_read_restart_bin( nrg ) - implicit none - integer,intent(in) :: nrg ! Unit number - return - end subroutine chem_read_restart_bin -!=============================================================================== - subroutine chem_write_restart_pio( File ) + subroutine chem_init_restart(File) use pio, only : file_desc_t type(file_desc_t) :: File + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_INIT_RESTART' return - end subroutine chem_write_restart_pio + end subroutine chem_init_restart !=============================================================================== - subroutine chem_read_restart_pio( File ) + subroutine chem_write_restart( File ) + !use tracer_cnst, only: write_tracer_cnst_restart + !use tracer_srcs, only: write_tracer_srcs_restart + !use linoz_data, only: write_linoz_data_restart use pio, only : file_desc_t + implicit none type(file_desc_t) :: File - return - end subroutine chem_read_restart_pio + + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_WRITE_RESTART' + ! + ! data for offline tracers + ! + !call write_tracer_cnst_restart(File) + !call write_tracer_srcs_restart(File) + !call write_linoz_data_restart(File) + end subroutine chem_write_restart !=============================================================================== - subroutine chem_init_restart(File) + subroutine chem_read_restart( File ) + !use tracer_cnst, only: read_tracer_cnst_restart + !use tracer_srcs, only: read_tracer_srcs_restart + !use linoz_data, only: read_linoz_data_restart + use pio, only : file_desc_t + implicit none type(file_desc_t) :: File - return - end subroutine chem_init_restart + + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_READ_RESTART' + ! + ! data for offline tracers + ! + !call read_tracer_cnst_restart(File) + !call read_tracer_srcs_restart(File) + !call read_linoz_data_restart(File) + end subroutine chem_read_restart !================================================================================ - subroutine chem_reset_fluxes( fptr, cam_in ) + subroutine chem_emissions( state, cam_in ) use camsrfexch, only : cam_in_t - real(r8), pointer :: fptr(:,:) ! pointer into array data - type(cam_in_t), intent(inout) :: cam_in(begchunk:endchunk) + ! Arguments: + + type(physics_state), intent(in) :: state ! Physics state variables + type(cam_in_t), intent(inout) :: cam_in ! import state + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_EMISSIONS' - end subroutine chem_reset_fluxes + end subroutine chem_emissions end module chemistry diff --git a/src/chemistry/pp_geoschem/clybry_fam.F90 b/src/chemistry/pp_geoschem/clybry_fam.F90 new file mode 100644 index 0000000000..d53a32fdf0 --- /dev/null +++ b/src/chemistry/pp_geoschem/clybry_fam.F90 @@ -0,0 +1,180 @@ +!----------------------------------------------------------------------- +! +! Manages the adjustment of ClOy and BrOy family components in response +! to conservation issues resulting from advection. +! +! Created by: Francis Vitt +! Date: 21 May 2008 +! Modified by Stacy Walters +! Date: 13 August 2008 +!----------------------------------------------------------------------- + +module clybry_fam + + use shr_kind_mod, only : r8 => shr_kind_r8 + use ppgrid, only : pcols, pver + use chem_mods, only : gas_pcnst, adv_mass + use constituents, only : pcnst + use short_lived_species,only: set_short_lived_species,get_short_lived_species + + implicit none + + save + + private + public :: clybry_fam_set + public :: clybry_fam_adj + public :: clybry_fam_init + + integer :: id_cly,id_bry + + integer :: id_cl,id_clo,id_hocl,id_cl2,id_cl2o2,id_oclo,id_hcl,id_clono2 + integer :: id_br,id_bro,id_hbr,id_brono2,id_brcl,id_hobr + + logical :: has_clybry + +contains + + !------------------------------------------ + !------------------------------------------ + subroutine clybry_fam_init + + !use mo_chem_utls, only : get_spc_ndx + implicit none + + integer :: ids(16) + + !id_cly = get_spc_ndx('CLY') + !id_bry = get_spc_ndx('BRY') + + !id_cl = get_spc_ndx('CL') + !id_clo = get_spc_ndx('CLO') + !id_hocl = get_spc_ndx('HOCL') + !id_cl2 = get_spc_ndx('CL2') + !id_cl2o2 = get_spc_ndx('CL2O2') + !id_oclo = get_spc_ndx('OCLO') + !id_hcl = get_spc_ndx('HCL') + !id_clono2 = get_spc_ndx('CLONO2') + + !id_br = get_spc_ndx('BR') + !id_bro = get_spc_ndx('BRO') + !id_hbr = get_spc_ndx('HBR') + !id_brono2 = get_spc_ndx('BRONO2') + !id_brcl = get_spc_ndx('BRCL') + !id_hobr = get_spc_ndx('HOBR') + + !ids = (/ id_cly,id_bry, & + ! id_cl,id_clo,id_hocl,id_cl2,id_cl2o2,id_oclo,id_hcl,id_clono2, & + ! id_br,id_bro,id_hbr,id_brono2,id_brcl,id_hobr /) + + !has_clybry = all( ids(:) > 0 ) + + endsubroutine clybry_fam_init + +!-------------------------------------------------------------- +! set the ClOy and BrOy mass mixing ratios +! - this is call before advection +!-------------------------------------------------------------- + subroutine clybry_fam_set( ncol, lchnk, map2chm, q, pbuf ) + + use time_manager, only : get_nstep + use physics_buffer, only : physics_buffer_desc + + implicit none + +!-------------------------------------------------------------- +! ... dummy arguments +!-------------------------------------------------------------- + integer, intent(in) :: ncol, lchnk + integer, intent(in) :: map2chm(pcnst) + real(r8), intent(inout) :: q(pcols,pver,pcnst) + type(physics_buffer_desc), pointer :: pbuf(:) + + !real(r8) :: wrk(ncol,pver,2) + !real(r8) :: mmr(pcols,pver,gas_pcnst) + !integer :: n, m + + if (.not. has_clybry) return + + end subroutine clybry_fam_set + +!-------------------------------------------------------------- +! adjust the ClOy and BrOy individual family members +! - this is call after advection +!-------------------------------------------------------------- + subroutine clybry_fam_adj( ncol, lchnk, map2chm, q, pbuf ) + + use time_manager, only : is_first_step + use physics_buffer, only : physics_buffer_desc + + implicit none + +!-------------------------------------------------------------- +! ... dummy arguments +!-------------------------------------------------------------- + integer, intent(in) :: ncol, lchnk + integer, intent(in) :: map2chm(pcnst) + real(r8), intent(inout) :: q(pcols,pver,pcnst) + type(physics_buffer_desc), pointer :: pbuf(:) + + end subroutine clybry_fam_adj + +!-------------------------------------------------------------- +! private methods +!-------------------------------------------------------------- + +!-------------------------------------------------------------- +! compute the mass mixing retio of ClOy +!-------------------------------------------------------------- + function cloy( q, pcols, ncol ) + +!-------------------------------------------------------------- +! ... dummy arguments +!-------------------------------------------------------------- + integer, intent(in) :: pcols + integer, intent(in) :: ncol + real(r8), intent(in) :: q(pcols,pver,gas_pcnst) + +!-------------------------------------------------------------- +! ... function declaration +!-------------------------------------------------------------- + real(r8) :: cloy(ncol,pver) + +!-------------------------------------------------------------- +! ... local variables +!-------------------------------------------------------------- + real(r8) :: wrk(ncol) + integer :: k + + cloy = 0._r8 + + end function cloy + +!-------------------------------------------------------------- +! compute the mass mixing retio of BrOy +!-------------------------------------------------------------- + function broy( q, pcols, ncol ) + +!-------------------------------------------------------------- +! ... dummy arguments +!-------------------------------------------------------------- + integer, intent(in) :: pcols + integer, intent(in) :: ncol + real(r8), intent(in) :: q(pcols,pver,gas_pcnst) + +!-------------------------------------------------------------- +! ... function declaration +!-------------------------------------------------------------- + real(r8) :: broy(ncol,pver) + +!-------------------------------------------------------------- +! ... local variables +!-------------------------------------------------------------- + real(r8) :: wrk(ncol) + integer :: k + + broy = 0._r8 + + end function broy + +end module clybry_fam diff --git a/src/chemistry/pp_geoschem/epp_ionization.F90 b/src/chemistry/pp_geoschem/epp_ionization.F90 new file mode 100644 index 0000000000..98276cd5f3 --- /dev/null +++ b/src/chemistry/pp_geoschem/epp_ionization.F90 @@ -0,0 +1,508 @@ +!------------------------------------------------------------------------------- +! Energetic Particle Precipitation (EPP) forcings module +! Manages ionization of the atmosphere due to energetic particles, which consists of +! solar protons events (SPE), galactic cosmic rays(GCR), medium energy electrons (MEE) +!------------------------------------------------------------------------------- +module epp_ionization + use shr_kind_mod, only : r8 => shr_kind_r8, cs => shr_kind_cs, cl=> shr_kind_cl + use spmd_utils, only : masterproc + use cam_abortutils, only : endrun + use cam_logfile, only : iulog + use phys_grid, only : pcols, pver, begchunk, endchunk, get_ncols_p + use pio, only : var_desc_t, file_desc_t + use pio, only : pio_get_var, pio_inq_varid, pio_get_att + use pio, only : pio_inq_varndims, pio_inq_vardimid, pio_inq_dimname, pio_inq_dimlen + use pio, only : PIO_NOWRITE + use cam_pio_utils, only : cam_pio_openfile + use ioFileMod, only : getfil + use input_data_utils, only : time_coordinate + + implicit none + private + + public :: epp_ionization_readnl ! read namelist variables + public :: epp_ionization_init ! initialization + public :: epp_ionization_adv ! read and time/space interpolate the data + public :: epp_ionization_ionpairs! ion pairs production rates + public :: epp_ionization_setmag ! update geomagnetic coordinates mapping + public :: epp_ionization_active + + character(len=cl) :: epp_all_filepath = 'NONE' + character(len=cs) :: epp_all_varname = 'epp_ion_rates' + character(len=cl) :: epp_mee_filepath = 'NONE' + character(len=cs) :: epp_mee_varname = 'iprm' + character(len=cl) :: epp_spe_filepath = 'NONE' + character(len=cs) :: epp_spe_varname = 'iprp' + character(len=cl) :: epp_gcr_filepath = 'NONE' + character(len=cs) :: epp_gcr_varname = 'iprg' + + logical, protected :: epp_ionization_active = .false. + + type input_obj_t + type(file_desc_t) :: fid + type(var_desc_t) :: vid + character(len=32) :: units + integer :: nlevs = 0 + integer :: nglats = 0 + real(r8), allocatable :: press(:) + real(r8), allocatable :: glats(:) + real(r8), allocatable :: gwght(:,:) ! (pcol, begchunk:endchunk) + integer, allocatable :: glatn(:,:) ! (pcol, begchunk:endchunk) + real(r8), allocatable :: indata(:,:,:,:) ! (pcol,nlevs,begchunk:endchunk,2) inputs at indexm and indexp + type(time_coordinate) :: time_coord + endtype input_obj_t + + type(input_obj_t), pointer :: epp_in => null() + type(input_obj_t), pointer :: spe_in => null() + type(input_obj_t), pointer :: mee_in => null() + type(input_obj_t), pointer :: gcr_in => null() + +contains + + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + subroutine epp_ionization_readnl(nlfile) + + use namelist_utils, only: find_group_name + use units, only: getunit, freeunit + use spmd_utils, only: mpicom, mpi_character, masterprocid + + character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input + + !! Local variables + !integer :: unitn, ierr + !character(len=*), parameter :: subname = 'epp_ionization_readnl' + + !namelist /epp_ionization_nl/ epp_all_filepath, epp_all_varname, & + ! epp_mee_filepath, epp_mee_varname, epp_spe_filepath, epp_spe_varname, epp_gcr_filepath, epp_gcr_varname + + !! Read namelist + !if (masterproc) then + ! unitn = getunit() + ! open( unitn, file=trim(nlfile), status='old' ) + ! call find_group_name(unitn, 'epp_ionization_nl', status=ierr) + ! if (ierr == 0) then + ! read(unitn, epp_ionization_nl, iostat=ierr) + ! if (ierr /= 0) then + ! call endrun(subname // ':: ERROR reading namelist') + ! end if + ! end if + ! close(unitn) + ! call freeunit(unitn) + !end if + + !! Broadcast namelist variables + !call mpi_bcast(epp_all_filepath, len(epp_all_filepath), mpi_character, masterprocid, mpicom, ierr) + !call mpi_bcast(epp_mee_filepath, len(epp_mee_filepath), mpi_character, masterprocid, mpicom, ierr) + !call mpi_bcast(epp_spe_filepath, len(epp_spe_filepath), mpi_character, masterprocid, mpicom, ierr) + !call mpi_bcast(epp_gcr_filepath, len(epp_gcr_filepath), mpi_character, masterprocid, mpicom, ierr) + + !call mpi_bcast(epp_all_varname, len(epp_all_varname), mpi_character, masterprocid, mpicom, ierr) + !call mpi_bcast(epp_mee_varname, len(epp_mee_varname), mpi_character, masterprocid, mpicom, ierr) + !call mpi_bcast(epp_spe_varname, len(epp_spe_varname), mpi_character, masterprocid, mpicom, ierr) + !call mpi_bcast(epp_gcr_varname, len(epp_gcr_varname), mpi_character, masterprocid, mpicom, ierr) + + !epp_ionization_active = epp_all_filepath /= 'NONE' + !epp_ionization_active = epp_mee_filepath /= 'NONE' .or. epp_ionization_active + !epp_ionization_active = epp_spe_filepath /= 'NONE' .or. epp_ionization_active + !epp_ionization_active = epp_gcr_filepath /= 'NONE' .or. epp_ionization_active + + !if ( epp_ionization_active .and. masterproc ) then + ! write(iulog,*) subname//':: epp_all_filepath = '//trim(epp_all_filepath) + ! write(iulog,*) subname//':: epp_mee_filepath = '//trim(epp_mee_filepath) + ! write(iulog,*) subname//':: epp_spe_filepath = '//trim(epp_spe_filepath) + ! write(iulog,*) subname//':: epp_gcr_filepath = '//trim(epp_gcr_filepath) + !endif + + end subroutine epp_ionization_readnl + + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + subroutine epp_ionization_init() + !use cam_history, only : addfld + + !character(len=32) :: fldunits + !fldunits = '' + ! + !if (epp_all_filepath /= 'NONE') then + ! epp_in => create_input_obj(epp_all_filepath,epp_all_varname) + ! fldunits = trim(epp_in%units) + !else + ! if (epp_mee_filepath /= 'NONE') then + ! mee_in => create_input_obj(epp_mee_filepath,epp_mee_varname) + ! fldunits = trim(mee_in%units) + ! endif + ! if (epp_spe_filepath /= 'NONE') then + ! spe_in => create_input_obj(epp_spe_filepath,epp_spe_varname) + ! fldunits = trim(spe_in%units) + ! endif + ! if (epp_gcr_filepath /= 'NONE') then + ! gcr_in => create_input_obj(epp_gcr_filepath,epp_gcr_varname) + ! fldunits = trim(gcr_in%units) + ! endif + !endif + !call addfld( 'EPPions', (/ 'lev' /), 'A', fldunits, 'EPP ionization data' ) + + end subroutine epp_ionization_init + + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + subroutine epp_ionization_setmag( maglat ) + real(r8), intent(in) :: maglat(pcols,begchunk:endchunk) + + if (.not.epp_ionization_active) return + + !if ( associated(epp_in) ) then + ! call set_wghts(maglat,epp_in) + !else + ! if ( associated(mee_in) ) then + ! call set_wghts(maglat,mee_in) + ! endif + ! if ( associated(spe_in) ) then + ! call set_wghts(maglat,spe_in) + ! endif + ! if ( associated(gcr_in) ) then + ! call set_wghts(maglat,gcr_in) + ! endif + !endif + + end subroutine epp_ionization_setmag + + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + subroutine epp_ionization_adv + + if (.not.epp_ionization_active) return + + !if ( associated(epp_in) ) then + ! call update_input(epp_in) + !else + ! if ( associated(spe_in) ) then + ! call update_input(spe_in) + ! endif + ! if ( associated(gcr_in) ) then + ! call update_input(gcr_in) + ! endif + ! if ( associated(mee_in) ) then + ! call update_input(mee_in) + ! endif + !endif + + end subroutine epp_ionization_adv + + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + subroutine epp_ionization_ionpairs( ncol, lchnk, pmid, temp, ionpairs ) + + integer, intent(in) :: ncol, lchnk + real(r8), intent(in) :: pmid(:,:), temp(:,:) + real(r8), intent(out) :: ionpairs(:,:) ! ion pair production rate + + ionpairs = 0._r8 + if (.not.epp_ionization_active) return + + !if ( associated(epp_in) ) then + ! ionpairs(:ncol,:) = ionpairs(:ncol,:) + interp_ionpairs( ncol, lchnk, pmid, temp, epp_in ) + !else + ! if ( associated(spe_in) ) then + ! ionpairs(:ncol,:) = ionpairs(:ncol,:) + interp_ionpairs( ncol, lchnk, pmid, temp, spe_in ) + ! endif + ! if ( associated(gcr_in) ) then + ! ionpairs(:ncol,:) = ionpairs(:ncol,:) + interp_ionpairs( ncol, lchnk, pmid, temp, gcr_in ) + ! endif + ! if ( associated(mee_in) ) then + ! ionpairs(:ncol,:) = ionpairs(:ncol,:) + interp_ionpairs( ncol, lchnk, pmid, temp, mee_in ) + ! endif + !endif + + end subroutine epp_ionization_ionpairs + + ! private methods + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + subroutine update_input( input ) + type(input_obj_t), pointer :: input + + if ( input%time_coord%read_more() ) then + call input%time_coord%advance() + call read_next_data( input ) + else + call input%time_coord%advance() + endif + + end subroutine update_input + + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + subroutine read_next_data( input ) + type(input_obj_t), pointer :: input + + !! read data corresponding surrounding time indices + !if ( input%nglats > 0 ) then + ! call read_2d_profile( input ) + !else + ! call read_1d_profile( input ) + !endif + + end subroutine read_next_data + + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + function interp_ionpairs( ncol, lchnk, pmid, temp, input ) result( ionpairs ) + use interpolate_data, only : lininterp + use physconst, only : rairv + use cam_history, only : outfld + + integer, intent(in) :: ncol, lchnk + real(r8), intent(in) :: pmid(:,:) ! Pa + real(r8), intent(in) :: temp(:,:) ! K + type(input_obj_t), pointer :: input + real(r8) :: ionpairs(ncol,pver) + + real(r8) :: fctr1, fctr2 + real(r8) :: wrk(ncol,input%nlevs) + real(r8) :: ions_diags(ncol,pver) ! for diagnostics + integer :: i + + !if (input%time_coord%time_interp) then + ! ! time interpolate + ! fctr1 = input%time_coord%wghts(1) + ! fctr2 = input%time_coord%wghts(2) + ! wrk(:ncol,:) = fctr1*input%indata(:ncol,:,lchnk,1) + fctr2*input%indata(:ncol,:,lchnk,2) + !else + ! wrk(:ncol,:) = input%indata(:ncol,:,lchnk,1) + !endif + + !! vertical interpolate ... + !! interpolate to model levels + !do i = 1,ncol + + ! ! interpolate over log pressure + ! call lininterp( wrk(i,:input%nlevs), log(input%press(:input%nlevs)*1.e2_r8), input%nlevs, & + ! ionpairs(i,:pver), log(pmid(i,:pver)), pver ) + ! ions_diags(i,:pver) = ionpairs(i,:pver) + ! + ! if ( index(trim(input%units), 'g^-1') > 0 ) then + ! ! convert to ionpairs/cm3/sec + ! ionpairs(i,:pver) = ionpairs(i,:pver) *(1.e-3_r8*pmid(i,:pver)/(rairv(i,:pver,lchnk)*temp(i,:pver))) + ! endif + !enddo + + !call outfld( 'EPPions', ions_diags(:ncol,:), ncol, lchnk ) + + end function interp_ionpairs + + !----------------------------------------------------------------------------- + ! read 2D profile (geomag-lat vs press) and transfer to geographic grid + !----------------------------------------------------------------------------- + subroutine read_2d_profile( input ) + + type(input_obj_t), pointer :: input + + ! local vars + real(r8) :: wrk2d( input%nglats, input%nlevs, 2 ) + integer :: t, c, i, ntimes, ncols, ierr + real(r8) :: wght1, wght2 + integer :: gndx1, gndx2 + integer :: cnt(3), strt(3) + + !if (input%time_coord%time_interp) then + ! ntimes = 2 + !else + ! ntimes = 1 + !endif + + !cnt(1) = input%nglats + !cnt(2) = input%nlevs + !cnt(3) = ntimes + + !strt(:) = 1 + !strt(3) = input%time_coord%indxs(1) + + !ierr = pio_get_var( input%fid, input%vid, strt, cnt, wrk2d ) + + !do t = 1,ntimes + ! do c=begchunk,endchunk + ! ncols = get_ncols_p(c) + ! do i = 1,ncols + ! gndx1 = input%glatn(i,c) + ! if (gndx1>0) then + ! wght1 = input%gwght(i,c) + ! gndx2 = gndx1+1 + ! if (gndx2.le.input%nglats) then + ! wght2 = 1._r8-wght1 + ! input%indata(i,:,c,t) = wght1*wrk2d(gndx1,:,t) & + ! + wght2*wrk2d(gndx2,:,t) + ! else + ! input%indata(i,:,c,t) = wght1*wrk2d(gndx1,:,t) + ! endif + ! else + ! input%indata(i,:,c,t) = 0._r8 + ! endif + ! end do + ! end do + !end do + + end subroutine read_2d_profile + + !----------------------------------------------------------------------------- + ! read 1D vertical profile and transfer to geographic grid poleward of 60 degrees geomag-lat + !----------------------------------------------------------------------------- + subroutine read_1d_profile( input ) + + type(input_obj_t), pointer :: input + + ! local vars + real(r8) :: wrk( input%nlevs, 2 ) + integer :: t, c, i, ntimes, ncols, ierr + integer :: cnt(2), strt(2) + + !if (input%time_coord%time_interp) then + ! ntimes = 2 + !else + ! ntimes = 1 + !endif + + !cnt(1) = input%nlevs + !cnt(2) = ntimes + + !strt(:) = 1 + !strt(2) = input%time_coord%indxs(1) + + !ierr = pio_get_var( input%fid, input%vid, strt, cnt, wrk ) + + !do t = 1,ntimes + ! do c=begchunk,endchunk + ! ncols = get_ncols_p(c) + ! do i = 1,ncols + ! input%indata(i,:,c,t) = input%gwght(i,c)*wrk(:,t) + ! end do + ! end do + !end do + + end subroutine read_1d_profile + + !----------------------------------------------------------------------------- + !----------------------------------------------------------------------------- + function create_input_obj( path, varname ) result(in_obj) + use infnan, only : nan, assignment(=) + + character(*), intent(in) :: path + character(*), intent(in) :: varname + type(input_obj_t), pointer :: in_obj + + character(len=cl) :: filen + character(len=cl) :: data_units + character(len=cs) :: dimname + integer :: i, ierr + integer, allocatable :: dimids(:) + integer :: pres_did, pres_vid, glat_did, glat_vid, ndims + + if (path .eq. 'NONE') return + + !allocate(in_obj) + + !call in_obj%time_coord%initialize( path ) + + !call getfil( path, filen, 0 ) + !call cam_pio_openfile( in_obj%fid, filen, PIO_NOWRITE ) + + !ierr = pio_inq_varid( in_obj%fid, varname, in_obj%vid ) + + !ierr = pio_get_att( in_obj%fid, in_obj%vid, 'units', data_units) + !in_obj%units = trim(data_units(1:32)) + + !ierr = pio_inq_varndims( in_obj%fid, in_obj%vid, ndims ) + !allocate( dimids(ndims) ) + + !ierr = pio_inq_vardimid( in_obj%fid, in_obj%vid, dimids) + !pres_did = -1 + !glat_did = -1 + !do i = 1,ndims + ! ierr = pio_inq_dimname( in_obj%fid, dimids(i), dimname ) + ! select case( trim(dimname(1:4)) ) + ! case ( 'pres', 'lev', 'plev' ) + ! pres_did = dimids(i) + ! ierr = pio_inq_varid( in_obj%fid, dimname, pres_vid) + ! case ( 'glat' ) + ! glat_did = dimids(i) + ! ierr = pio_inq_varid( in_obj%fid, dimname, glat_vid) + ! case default + ! end select + !end do + + !deallocate( dimids ) + + !if (pres_did>0) then + ! ierr = pio_inq_dimlen( in_obj%fid, pres_did, in_obj%nlevs ) + ! allocate( in_obj%press(in_obj%nlevs) ) + ! ierr = pio_get_var( in_obj%fid, pres_vid, in_obj%press ) + !endif + !if (glat_did>0) then + ! ierr = pio_inq_dimlen( in_obj%fid, glat_did, in_obj%nglats ) + ! allocate( in_obj%glats(in_obj%nglats) ) + ! ierr = pio_get_var( in_obj%fid, glat_vid, in_obj%glats ) + ! allocate( in_obj%glatn(pcols,begchunk:endchunk) ) + !endif + ! + !allocate( in_obj%gwght(pcols,begchunk:endchunk) ) + + !if (in_obj%time_coord%time_interp) then + ! allocate( in_obj%indata(pcols,in_obj%nlevs,begchunk:endchunk,2) ) + !else + ! allocate( in_obj%indata(pcols,in_obj%nlevs,begchunk:endchunk,1) ) + !endif + !in_obj%indata = nan + + end function create_input_obj + + !----------------------------------------------------------------------- + !----------------------------------------------------------------------- + subroutine set_wghts( maglat, input ) + + real(r8), intent(in) :: maglat(pcols,begchunk:endchunk) + type(input_obj_t), pointer :: input + + integer :: i, c, ncols, imag + + !if (input%nglats>1) then ! read in general EPP 2D ionpairs production rates + ! do c = begchunk,endchunk + ! ncols = get_ncols_p(c) + ! col_loop: do i = 1,ncols + ! if ( maglat(i,c) .lt. input%glats(1) ) then + ! input%glatn(i,c) = 1 + ! input%gwght(i,c) = 1._r8 + ! elseif ( maglat(i,c) .gt. input%glats(input%nglats) ) then + ! input%glatn(i,c) = input%nglats + ! input%gwght(i,c) = 1._r8 + ! else + ! mag_loop: do imag = 1,input%nglats-1 + ! if ( maglat(i,c) .ge. input%glats(imag) .and. & + ! maglat(i,c) .lt. input%glats(imag+1) ) then + ! input%gwght(i,c) = (input%glats(imag+1)-maglat(i,c) ) & + ! / (input%glats(imag+1)-input%glats(imag)) + ! input%glatn(i,c) = imag + ! exit mag_loop + ! endif + ! enddo mag_loop + ! endif + ! enddo col_loop + ! enddo + !else ! read in 1D SPE ionpairs profile ... + ! do c = begchunk,endchunk + ! ncols = get_ncols_p(c) + ! do i = 1,ncols + ! if ( abs(maglat(i,c)) .ge. 60._r8 ) then ! poleward of 60 degrees + ! input%gwght(i,c) = 1._r8 + ! else + ! input%gwght(i,c) = 0._r8 + ! endif + ! enddo + ! enddo + !endif + + !call read_next_data( input ) ! update the inputs when wghts are updated + + end subroutine set_wghts + +end module epp_ionization diff --git a/src/chemistry/pp_geoschem/mo_apex.F90 b/src/chemistry/pp_geoschem/mo_apex.F90 new file mode 100644 index 0000000000..0737f7e278 --- /dev/null +++ b/src/chemistry/pp_geoschem/mo_apex.F90 @@ -0,0 +1,314 @@ +module mo_apex + +!------------------------------------------------------------------------------- +! Purpose: +! +! Calculate apex coordinates and magnetic field magnitudes +! at global geographic grid for year of current model run. +! +! Method: +! +! The magnetic field parameters output by this module are time and height +! independent. They are chunked for waccm physics, i.e., allocated as +! (pcols,begchunk:endchunk) +! Interface sub apexmag is called once per run from sub inti. +! Sub apexmag may be called for years 1900 through 2005. +! This module is dependent on routines in apex_subs.F (modified IGRF model). +! Apex_subs has several authors, but has been modified and maintained +! in recent years by Roy Barnes (bozo@ucar.edu). +! Subs apxmka and apxmall are called with the current lat x lon grid +! resolution. +! +! Author: Ben Foster, foster@ucar.edu (Nov, 2003) +!------------------------------------------------------------------------------- + + use shr_kind_mod, only: r8 => shr_kind_r8 + use ppgrid, only: pcols, begchunk, endchunk ! physics grid + use cam_abortutils, only: endrun + use cam_logfile, only: iulog + use spmd_utils, only: masterproc + !use apex, only: apex_mka, apex_mall, apex_dypol, apex_set_igrf + !use apex, only: apex_beg_yr, apex_end_yr + implicit none + + private + public :: mo_apex_readnl + public :: mo_apex_init + public :: mo_apex_init1 + public :: alatm, alonm, bnorth, beast, bdown, bmag + public :: d1vec, d2vec, colatp, elonp + public :: maglon0 ! geographic longitude at the equator where geomagnetic longitude is zero (radians) + + ! year to initialize apex + real(r8), public, protected :: geomag_year = -1._r8 + logical, public, protected :: geomag_year_updated = .true. + + integer :: fixed_geomag_year = -1 + +!------------------------------------------------------------------------------- +! Magnetic field output arrays, chunked for physics: +! (these are allocated (pcols,begchunk:endchunk) by sub allocate_arrays) +!------------------------------------------------------------------------------- + real(r8), protected, allocatable, dimension(:,:) :: & ! (pcols,begchunk:endchunk) + alatm, & ! apex mag latitude at each geographic grid point (radians) + alonm, & ! apex mag longitude at each geographic grid point (radians) + bnorth, & ! northward component of magnetic field + beast, & ! eastward component of magnetic field + bdown, & ! downward component of magnetic field + bmag ! magnitude of magnetic field + real(r8), protected, allocatable, dimension(:,:,:) :: & ! (3,pcols,begchunk:endchunk) + d1vec, & ! base vectors more-or-less magnetic eastward direction + d2vec ! base vectors more-or-less magnetic downward/equatorward direction + real(r8), protected :: & + colatp, & ! geocentric colatitude of geomagnetic dipole north pole (deg) + elonp ! East longitude of geomagnetic dipole north pole (deg) + + real(r8), protected :: maglon0 + + character(len=256) :: igrf_geomag_coefs_file = 'igrf_geomag_coefs_file' + +contains + +!====================================================================== +!====================================================================== +subroutine mo_apex_readnl(nlfile) + + use namelist_utils, only : find_group_name + use units, only : getunit, freeunit + use spmd_utils, only : mpicom, masterprocid, mpi_integer, mpi_character + + character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input + + !! Local variables + !integer :: unitn, ierr + !character(len=*), parameter :: subname = 'mo_apex_readnl' + + !namelist /geomag_nl/ fixed_geomag_year, igrf_geomag_coefs_file + + !! Read namelist + !if (masterproc) then + ! unitn = getunit() + ! open( unitn, file=trim(nlfile), status='old' ) + ! call find_group_name(unitn, 'geomag_nl', status=ierr) + ! if (ierr == 0) then + ! read(unitn, geomag_nl, iostat=ierr) + ! if (ierr /= 0) then + ! call endrun(subname // ':: ERROR reading namelist') + ! end if + ! end if + ! close(unitn) + ! call freeunit(unitn) + !end if + + !! Broadcast namelist variables + !call mpi_bcast(fixed_geomag_year, 1, mpi_integer, masterprocid, mpicom, ierr) + !call mpi_bcast(igrf_geomag_coefs_file, len(igrf_geomag_coefs_file), mpi_character, masterprocid, mpicom, ierr) + +end subroutine mo_apex_readnl + +!====================================================================== +!====================================================================== +subroutine mo_apex_init1() + use time_manager, only: get_curr_date + use dyn_grid, only: get_horiz_grid_dim_d + + +end subroutine mo_apex_init1 + +!====================================================================== +!====================================================================== +subroutine mo_apex_init(phys_state) +!------------------------------------------------------------------------------- +! Driver for apex code to calculate apex magnetic coordinates at +! current geographic spatial resolution for given year. This calls +! routines in apex_subs.F. +! +! This is called once per run from sub inti. +!------------------------------------------------------------------------------- + + use physconst,only : pi + use physics_types, only: physics_state + !use epp_ionization,only: epp_ionization_setmag + + ! Input/output arguments + type(physics_state), intent(in), dimension(begchunk:endchunk) :: phys_state + +!!------------------------------------------------------------------------------- +!! Local variables +!!------------------------------------------------------------------------------- +! real(r8), parameter :: re = 6.378165e8_r8 ! earth radius (cm) +! real(r8), parameter :: h0 = 9.0e6_r8 ! base height (90 km) +! real(r8), parameter :: hs = 1.3e7_r8 +! real(r8), parameter :: eps = 1.e-6_r8 ! epsilon +! real(r8), parameter :: cm2km = 1.e-5_r8 +! +! integer :: c, i, ist ! indices +! integer :: ncol +! +! real(r8) :: alt, hr, alon, alat, & ! apxmall args +! vmp, w, d, be3, sim, xlatqd, f, si, collat, collon +! +!!------------------------------------------------------------------------------- +!! Non-scalar arguments returned by APXMALL: +!!------------------------------------------------------------------------------- +! real(r8) :: bhat(3) +! real(r8) :: d3(3) +! real(r8) :: e1(3), e2(3), e3(3) +! real(r8) :: f1(2), f2(2) +! +! real(r8) :: bg(3), d1g(3), d2g(3), bmg +! +! real(r8) :: rdum +! +! real(r8) :: maglat(pcols,begchunk:endchunk) +! +! real(r8), parameter :: rtd = 180._r8/pi ! radians to degrees +! real(r8), parameter :: dtr = pi/180._r8 ! degrees to radians +! +! call mo_apex_init1() +! if ((.not.geomag_year_updated) .and. (allocated(alatm))) return +! +!!------------------------------------------------------------------------------- +!! Allocate output arrays +!!------------------------------------------------------------------------------- +! call allocate_arrays() +! +! alt = hs*cm2km ! altitude for apxmall (km) +! hr = alt ! reference altitude (km) +! +!!------------------------------------------------------------------------------ +!! Apex coords alon, alat are returned for each geographic grid point: +!! first form global arrays +!!------------------------------------------------------------------------------ +! do c = begchunk, endchunk +! ncol = phys_state(c)%ncol +! do i = 1,ncol +! collat = phys_state(c)%lat(i)*rtd ! latitude of current column (deg) +! collon = phys_state(c)%lon(i)*rtd ! latitude of current column (deg) +! if ( collon < -180._r8 ) collon = collon+360._r8 +! if ( collon > 180._r8 ) collon = collon-360._r8 +! call apex_mall( & +! collat, collon, alt, hr, & ! Inputs +! bg, bhat, bmag(i,c), si, & ! Mag Fld +! alon, alat, & ! Apex lon,lat output +! vmp, w, d, be3, sim, d1vec(:,i,c), d2vec(:,i,c), d3, e1, e2, e3, & ! Mod Apex +! xlatqd, f, f1, f2, ist ) ! Qsi-Dpl +! if( ist /= 0 ) then +! write(iulog,"(/,'>>> mo_apex_init: Error from apxmall: ist=',i4)") ist +! call endrun('mo_apex_init: Error from apxmall') +! end if +! beast (i,c) = bg(1) +! bnorth(i,c) = bg(2) +! bdown (i,c) = -bg(3) +! alonm (i,c) = alon*dtr ! mag lons (radians) +! alatm (i,c) = alat*dtr ! mag lats (radians) +! maglat(i,c) = alat ! mag lats (degrees) +! enddo +! enddo +! +! ! find geograghic latitude ( maglon0 ) where the geomagnetic latitude is zero at the equator +! ! by first extracting the geographic coordinates at zero degrees longitude ... +! collat = 0._r8 +! collon = 0._r8 +! call apex_mall( & +! collat, collon, alt, hr, & ! Inputs +! bg, bhat, bmg, si, & ! Mag Fld +! alon, alat, & ! Apex lon,lat output +! vmp, w, d, be3, sim, d1g, d2g, d3, e1, e2, e3, & ! Mod Apex +! xlatqd, f, f1, f2, ist ) ! Qsi-Dpl +! +! if( ist /= 0 ) then +! write(iulog,"(/,'>>> mo_apex_init: Error from apxmall: ist=',i4)") ist +! call endrun('mo_apex_init: Error from apxmall') +! end if +! +! maglon0 = -alon*dtr ! (radians) geograghic latitude where the geomagnetic latitude is zero +! ! where longitude ranges from -180E to 180E +! +! call apex_dypol( colatp, elonp, rdum ) ! get geomagnetic dipole north pole +! +! if (masterproc) then +! write(iulog, "('mo_apex_init: colatp,elonp ', 2f12.6)") colatp, elonp +! write(iulog, "('mo_apex_init: Calculated apex magnetic coordinates for year AD ',f8.2)") geomag_year +! endif +! +! call epp_ionization_setmag(maglat) + +end subroutine mo_apex_init + +subroutine allocate_arrays +!!------------------------------------------------------------------------------ +!! Allocate module output arrays for chunked physics grid. +!!------------------------------------------------------------------------------ +! +!!------------------------------------------------------------------------------ +!! local variables +!!------------------------------------------------------------------------------ +! integer :: istat ! status of allocate statements +! +! if (.not.allocated(alatm)) then +! allocate(alatm(pcols,begchunk:endchunk),stat=istat) +! if (istat /= 0) then +! write(iulog,"('>>> allocate_arrays: allocate of alatm failed: istat=',i5)") istat +! call endrun +! end if +! end if +! +! if (.not.allocated(alonm)) then +! allocate(alonm(pcols,begchunk:endchunk),stat=istat) +! if (istat /= 0) then +! write(iulog,"('>>> allocate_arrays: allocate of alonm failed: istat=',i5)") istat +! call endrun +! end if +! end if +! +! if (.not.allocated(bnorth)) then +! allocate(bnorth(pcols,begchunk:endchunk),stat=istat) +! if (istat /= 0) then +! write(iulog,"('>>> allocate_arrays: allocate of bnorth failed: istat=',i5)") istat +! call endrun +! end if +! end if +! +! if (.not.allocated(beast)) then +! allocate(beast(pcols,begchunk:endchunk),stat=istat) +! if (istat /= 0) then +! write(iulog,"('>>> allocate_arrays: allocate of beast failed: istat=',i5)") istat +! call endrun +! end if +! end if +! +! if (.not.allocated(bdown)) then +! allocate(bdown(pcols,begchunk:endchunk),stat=istat) +! if (istat /= 0) then +! write(iulog,"('>>> allocate_arrays: allocate of bdown failed: istat=',i5)") istat +! call endrun +! end if +! end if +! +! if (.not.allocated(bmag)) then +! allocate(bmag(pcols,begchunk:endchunk),stat=istat) +! if (istat /= 0) then +! write(iulog,"('>>> allocate_arrays: allocate of bmag failed: istat=',i5)") istat +! call endrun +! end if +! end if +! if (.not.allocated(d1vec)) then +! allocate(d1vec(3,pcols,begchunk:endchunk),stat=istat) +! if (istat /= 0) then +! write(iulog,"('>>> allocate_arrays: allocate of d1vec failed: istat=',i5)") istat +! call endrun +! endif +! endif +! +! if (.not.allocated(d2vec)) then +! allocate(d2vec(3,pcols,begchunk:endchunk),stat=istat) +! if (istat /= 0) then +! write(iulog,"('>>> allocate_arrays: allocate of d2vec failed: istat=',i5)") istat +! call endrun +! endif +! endif +! +end subroutine allocate_arrays + +end module mo_apex diff --git a/src/chemistry/pp_geoschem/mo_gas_phase_chemdr.F90 b/src/chemistry/pp_geoschem/mo_gas_phase_chemdr.F90 new file mode 100644 index 0000000000..a881683024 --- /dev/null +++ b/src/chemistry/pp_geoschem/mo_gas_phase_chemdr.F90 @@ -0,0 +1,1180 @@ +module mo_gas_phase_chemdr + + use shr_kind_mod, only : r8 => shr_kind_r8 + use shr_const_mod, only : pi => shr_const_pi + use constituents, only : pcnst + use cam_history, only : fieldname_len + use chem_mods, only : phtcnt, rxntot, gas_pcnst + use chem_mods, only : rxt_tag_cnt, rxt_tag_lst, rxt_tag_map, extcnt, num_rnts + !use dust_model, only : dust_names, ndust => dust_nbin + use ppgrid, only : pcols, pver + use phys_control, only : phys_getopts + use carma_flags_mod, only : carma_hetchem_feedback + use chem_prod_loss_diags, only: chem_prod_loss_diags_init, chem_prod_loss_diags_out + + implicit none + save + + private + public :: gas_phase_chemdr, gas_phase_chemdr_inti + public :: map2chm + + integer :: map2chm(pcnst) = 0 ! index map to/from chemistry/constituents list + + integer :: synoz_ndx, so4_ndx, h2o_ndx, o2_ndx, o_ndx, hno3_ndx, hcl_ndx, dst_ndx, cldice_ndx, snow_ndx + integer :: o3_ndx, o3s_ndx + integer :: het1_ndx + integer :: ndx_cldfr, ndx_cmfdqr, ndx_nevapr, ndx_cldtop, ndx_prain + integer :: ndx_h2so4 +! +! CCMI +! + integer :: st80_25_ndx + integer :: st80_25_tau_ndx + integer :: aoa_nh_ndx + integer :: aoa_nh_ext_ndx + integer :: nh_5_ndx + integer :: nh_50_ndx + integer :: nh_50w_ndx + integer :: sad_pbf_ndx + integer :: cb1_ndx,cb2_ndx,oc1_ndx,oc2_ndx,dst1_ndx,dst2_ndx,sslt1_ndx,sslt2_ndx + integer :: soa_ndx,soai_ndx,soam_ndx,soat_ndx,soab_ndx,soax_ndx + + character(len=fieldname_len),dimension(rxt_tag_cnt) :: tag_names + character(len=fieldname_len),dimension(extcnt) :: extfrc_name + + logical :: pm25_srf_diag + logical :: pm25_srf_diag_soa + + logical :: convproc_do_aer + integer :: ele_temp_ndx, ion_temp_ndx + +contains + + subroutine gas_phase_chemdr_inti() + + !use mo_chem_utls, only : get_spc_ndx, get_extfrc_ndx, get_rxt_ndx + use cam_history, only : addfld,add_default,horiz_only + !use mo_chm_diags, only : chm_diags_inti + use constituents, only : cnst_get_ind + use physics_buffer, only : pbuf_get_index + use rate_diags, only : rate_diags_init + use cam_abortutils, only : endrun + + implicit none + + character(len=3) :: string + integer :: n, m, err, ii + logical :: history_cesm_forcing + character(len=16) :: unitstr + !----------------------------------------------------------------------- + logical :: history_scwaccm_forcing + + call phys_getopts( history_scwaccm_forcing_out = history_scwaccm_forcing ) + + call phys_getopts( convproc_do_aer_out = convproc_do_aer, history_cesm_forcing_out=history_cesm_forcing ) + + !ndx_h2so4 = get_spc_ndx('H2SO4') +! +! CCMI +! + !st80_25_ndx = get_spc_ndx ('ST80_25') + !st80_25_tau_ndx = get_rxt_ndx ('ST80_25_tau') + !aoa_nh_ndx = get_spc_ndx ('AOA_NH') + !aoa_nh_ext_ndx = get_extfrc_ndx('AOA_NH') + !nh_5_ndx = get_spc_ndx('NH_5') + !nh_50_ndx = get_spc_ndx('NH_50') + !nh_50w_ndx = get_spc_ndx('NH_50W') +! + !cb1_ndx = get_spc_ndx('CB1') + !cb2_ndx = get_spc_ndx('CB2') + !oc1_ndx = get_spc_ndx('OC1') + !oc2_ndx = get_spc_ndx('OC2') + !dst1_ndx = get_spc_ndx('DST01') + !dst2_ndx = get_spc_ndx('DST02') + !sslt1_ndx = get_spc_ndx('SSLT01') + !sslt2_ndx = get_spc_ndx('SSLT02') + !soa_ndx = get_spc_ndx('SOA') + !soam_ndx = get_spc_ndx('SOAM') + !soai_ndx = get_spc_ndx('SOAI') + !soat_ndx = get_spc_ndx('SOAT') + !soab_ndx = get_spc_ndx('SOAB') + !soax_ndx = get_spc_ndx('SOAX') + + !pm25_srf_diag = cb1_ndx>0 .and. cb2_ndx>0 .and. oc1_ndx>0 .and. oc2_ndx>0 & + ! .and. dst1_ndx>0 .and. dst2_ndx>0 .and. sslt1_ndx>0 .and. sslt2_ndx>0 & + ! .and. soa_ndx>0 + + !pm25_srf_diag_soa = cb1_ndx>0 .and. cb2_ndx>0 .and. oc1_ndx>0 .and. oc2_ndx>0 & + ! .and. dst1_ndx>0 .and. dst2_ndx>0 .and. sslt1_ndx>0 .and. sslt2_ndx>0 & + ! .and. soam_ndx>0 .and. soai_ndx>0 .and. soat_ndx>0 .and. soab_ndx>0 .and. soax_ndx>0 + ! + !if ( pm25_srf_diag .or. pm25_srf_diag_soa) then + ! call addfld('PM25_SRF',horiz_only,'I','kg/kg','bottom layer PM2.5 mixing ratio' ) + !endif + !call addfld('U_SRF',horiz_only,'I','m/s','bottom layer wind velocity' ) + !call addfld('V_SRF',horiz_only,'I','m/s','bottom layer wind velocity' ) + !call addfld('Q_SRF',horiz_only,'I','kg/kg','bottom layer specific humidity' ) +! + !het1_ndx= get_rxt_ndx('het1') + !o3_ndx = get_spc_ndx('O3') + !o3s_ndx = get_spc_ndx('O3S') + !o_ndx = get_spc_ndx('O') + !o2_ndx = get_spc_ndx('O2') + !so4_ndx = get_spc_ndx('SO4') + !h2o_ndx = get_spc_ndx('H2O') + !hno3_ndx = get_spc_ndx('HNO3') + !hcl_ndx = get_spc_ndx('HCL') + !dst_ndx = get_spc_ndx( dust_names(1) ) + !synoz_ndx = get_extfrc_ndx( 'SYNOZ' ) + !call cnst_get_ind( 'CLDICE', cldice_ndx ) + !call cnst_get_ind( 'SNOWQM', snow_ndx, abort=.false. ) + + + !do m = 1,extcnt + ! WRITE(UNIT=string, FMT='(I2.2)') m + ! extfrc_name(m) = 'extfrc_'// trim(string) + ! call addfld( extfrc_name(m), (/ 'lev' /), 'I', ' ', 'ext frcing' ) + !end do + + !do n = 1,rxt_tag_cnt + ! tag_names(n) = trim(rxt_tag_lst(n)) + ! if (n<=phtcnt) then + ! call addfld( tag_names(n), (/ 'lev' /), 'I', '/s', 'photolysis rate constant' ) + ! else + ! ii = n-phtcnt + ! select case(num_rnts(ii)) + ! case(1) + ! unitstr='/s' + ! case(2) + ! unitstr='cm3/molecules/s' + ! case(3) + ! unitstr='cm6/molecules2/s' + ! case default + ! call endrun('gas_phase_chemdr_inti: invalid value in num_rnts used to set units in reaction rate constant') + ! end select + ! call addfld( tag_names(n), (/ 'lev' /), 'I', unitstr, 'reaction rate constant' ) + ! endif + ! if (history_scwaccm_forcing) then + ! select case (trim(tag_names(n))) + ! case ('jh2o_a', 'jh2o_b', 'jh2o_c' ) + ! call add_default( tag_names(n), 1, ' ') + ! end select + ! endif + !enddo + + !call addfld( 'DTCBS', horiz_only, 'I', ' ','photolysis diagnostic black carbon OD' ) + !call addfld( 'DTOCS', horiz_only, 'I', ' ','photolysis diagnostic organic carbon OD' ) + !call addfld( 'DTSO4', horiz_only, 'I', ' ','photolysis diagnostic SO4 OD' ) + !call addfld( 'DTSOA', horiz_only, 'I', ' ','photolysis diagnostic SOA OD' ) + !call addfld( 'DTANT', horiz_only, 'I', ' ','photolysis diagnostic NH4SO4 OD' ) + !call addfld( 'DTSAL', horiz_only, 'I', ' ','photolysis diagnostic salt OD' ) + !call addfld( 'DTDUST', horiz_only, 'I', ' ','photolysis diagnostic dust OD' ) + !call addfld( 'DTTOTAL', horiz_only, 'I', ' ','photolysis diagnostic total aerosol OD' ) + !call addfld( 'FRACDAY', horiz_only, 'I', ' ','photolysis diagnostic fraction of day' ) + + !call addfld( 'QDSAD', (/ 'lev' /), 'I', '/s', 'water vapor sad delta' ) + !call addfld( 'SAD_STRAT', (/ 'lev' /), 'I', 'cm2/cm3', 'stratospheric aerosol SAD' ) + !call addfld( 'SAD_SULFC', (/ 'lev' /), 'I', 'cm2/cm3', 'chemical sulfate aerosol SAD' ) + !call addfld( 'SAD_SAGE', (/ 'lev' /), 'I', 'cm2/cm3', 'SAGE sulfate aerosol SAD' ) + !call addfld( 'SAD_LNAT', (/ 'lev' /), 'I', 'cm2/cm3', 'large-mode NAT aerosol SAD' ) + !call addfld( 'SAD_ICE', (/ 'lev' /), 'I', 'cm2/cm3', 'water-ice aerosol SAD' ) + !call addfld( 'RAD_SULFC', (/ 'lev' /), 'I', 'cm', 'chemical sad sulfate' ) + !call addfld( 'RAD_LNAT', (/ 'lev' /), 'I', 'cm', 'large nat radius' ) + !call addfld( 'RAD_ICE', (/ 'lev' /), 'I', 'cm', 'sad ice' ) + !call addfld( 'SAD_TROP', (/ 'lev' /), 'I', 'cm2/cm3', 'tropospheric aerosol SAD' ) + !call addfld( 'SAD_AERO', (/ 'lev' /), 'I', 'cm2/cm3', 'aerosol surface area density' ) + !if (history_cesm_forcing) then + ! call add_default ('SAD_AERO',8,' ') + !endif + !call addfld( 'REFF_AERO', (/ 'lev' /), 'I', 'cm', 'aerosol effective radius' ) + !call addfld( 'SULF_TROP', (/ 'lev' /), 'I', 'mol/mol', 'tropospheric aerosol SAD' ) + !call addfld( 'QDSETT', (/ 'lev' /), 'I', '/s', 'water vapor settling delta' ) + !call addfld( 'QDCHEM', (/ 'lev' /), 'I', '/s', 'water vapor chemistry delta') + !call addfld( 'HNO3_TOTAL', (/ 'lev' /), 'I', 'mol/mol', 'total HNO3' ) + !call addfld( 'HNO3_STS', (/ 'lev' /), 'I', 'mol/mol', 'STS condensed HNO3' ) + !call addfld( 'HNO3_NAT', (/ 'lev' /), 'I', 'mol/mol', 'NAT condensed HNO3' ) + !call addfld( 'HNO3_GAS', (/ 'lev' /), 'I', 'mol/mol', 'gas-phase hno3' ) + !call addfld( 'H2O_GAS', (/ 'lev' /), 'I', 'mol/mol', 'gas-phase h2o' ) + !call addfld( 'HCL_TOTAL', (/ 'lev' /), 'I', 'mol/mol', 'total hcl' ) + !call addfld( 'HCL_GAS', (/ 'lev' /), 'I', 'mol/mol', 'gas-phase hcl' ) + !call addfld( 'HCL_STS', (/ 'lev' /), 'I', 'mol/mol', 'STS condensed HCL' ) + + !if (het1_ndx>0) then + ! call addfld( 'het1_total', (/ 'lev' /), 'I', '/s', 'total N2O5 + H2O het rate constant' ) + !endif + !call addfld( 'SZA', horiz_only, 'I', 'degrees', 'solar zenith angle' ) + + !call chm_diags_inti() + !call rate_diags_init() + +!----------------------------------------------------------------------- +! get pbuf indicies +!----------------------------------------------------------------------- + !ndx_cldfr = pbuf_get_index('CLD') + !ndx_cmfdqr = pbuf_get_index('RPRDTOT') + !ndx_nevapr = pbuf_get_index('NEVAPR') + !ndx_prain = pbuf_get_index('PRAIN') + !ndx_cldtop = pbuf_get_index('CLDTOP') + + !sad_pbf_ndx= pbuf_get_index('VOLC_SAD',errcode=err) ! prescribed strat aerosols (volcanic) + !if (.not.sad_pbf_ndx>0) sad_pbf_ndx = pbuf_get_index('SADSULF',errcode=err) ! CARMA's version of strat aerosols + + !ele_temp_ndx = pbuf_get_index('TElec',errcode=err)! electron temperature index + !ion_temp_ndx = pbuf_get_index('TIon',errcode=err) ! ion temperature index + + !! diagnostics for stratospheric heterogeneous reactions + !call addfld( 'GAMMA_HET1', (/ 'lev' /), 'I', '1', 'Reaction Probability' ) + !call addfld( 'GAMMA_HET2', (/ 'lev' /), 'I', '1', 'Reaction Probability' ) + !call addfld( 'GAMMA_HET3', (/ 'lev' /), 'I', '1', 'Reaction Probability' ) + !call addfld( 'GAMMA_HET4', (/ 'lev' /), 'I', '1', 'Reaction Probability' ) + !call addfld( 'GAMMA_HET5', (/ 'lev' /), 'I', '1', 'Reaction Probability' ) + !call addfld( 'GAMMA_HET6', (/ 'lev' /), 'I', '1', 'Reaction Probability' ) + !call addfld( 'WTPER', (/ 'lev' /), 'I', '%', 'H2SO4 Weight Percent' ) + + !call chem_prod_loss_diags_init + + end subroutine gas_phase_chemdr_inti + + +!----------------------------------------------------------------------- +!----------------------------------------------------------------------- + subroutine gas_phase_chemdr(lchnk, ncol, imozart, q, & + phis, zm, zi, calday, & + tfld, pmid, pdel, pint, & + cldw, troplev, troplevchem, & + ncldwtr, ufld, vfld, & + delt, ps, xactive_prates, & + fsds, ts, asdir, ocnfrac, icefrac, & + precc, precl, snowhland, ghg_chem, latmapback, & + drydepflx, wetdepflx, cflx, fire_sflx, fire_ztop, nhx_nitrogen_flx, noy_nitrogen_flx, qtend, pbuf) + + !----------------------------------------------------------------------- + ! ... Chem_solver advances the volumetric mixing ratio + ! forward one time step via a combination of explicit, + ! ebi, hov, fully implicit, and/or rodas algorithms. + !----------------------------------------------------------------------- + + use chem_mods, only : nabscol, nfs, indexm, clscnt4 + use physconst, only : rga + !use mo_photo, only : set_ub_col, setcol, table_photo, xactive_photo + !use mo_exp_sol, only : exp_sol + !use mo_imp_sol, only : imp_sol + !use mo_setrxt, only : setrxt + !use mo_adjrxt, only : adjrxt + !use mo_phtadj, only : phtadj + !use llnl_O1D_to_2OH_adj,only : O1D_to_2OH_adj + !use mo_usrrxt, only : usrrxt + !use mo_setinv, only : setinv + !use mo_negtrc, only : negtrc + !use mo_sulf, only : sulf_interp + !use mo_setext, only : setext + !use fire_emissions, only : fire_emissions_vrt + !use mo_sethet, only : sethet + !use mo_drydep, only : drydep, set_soilw + !use seq_drydep_mod, only : DD_XLND, DD_XATM, DD_TABL, drydep_method + !use mo_fstrat, only : set_fstrat_vals, set_fstrat_h2o + !use noy_ubc, only : noy_ubc_set + !use mo_flbc, only : flbc_set + !use phys_grid, only : get_rlat_all_p, get_rlon_all_p, get_lat_all_p, get_lon_all_p + !use mo_mean_mass, only : set_mean_mass + !use cam_history, only : outfld + !use wv_saturation, only : qsat + !use constituents, only : cnst_mw + !use mo_drydep, only : has_drydep + !use time_manager, only : get_ref_date + !use mo_ghg_chem, only : ghg_chem_set_rates, ghg_chem_set_flbc + !use mo_sad, only : sad_strat_calc + !use charge_neutrality, only : charge_balance + !use mo_strato_rates, only : ratecon_sfstrat + !use mo_aero_settling, only : strat_aer_settling + !use shr_orb_mod, only : shr_orb_decl + !use cam_control_mod, only : lambm0, eccen, mvelpp, obliqr + !use mo_strato_rates, only : has_strato_chem + !use short_lived_species,only: set_short_lived_species,get_short_lived_species + !use mo_chm_diags, only : chm_diags, het_diags + !use perf_mod, only : t_startf, t_stopf + !use gas_wetdep_opts, only : gas_wetdep_method + use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + !use infnan, only : nan, assignment(=) + !use rate_diags, only : rate_diags_calc + !use mo_mass_xforms, only : mmr2vmr, vmr2mmr, h2o_to_vmr, mmr2vmri + !use orbit, only : zenith +! +! LINOZ +! + !use lin_strat_chem, only : do_lin_strat_chem, lin_strat_chem_solve + !use linoz_data, only : has_linoz_data +! +! for aqueous chemistry and aerosol growth +! + !use aero_model, only : aero_model_gasaerexch + + !use aero_model, only : aero_model_strat_surfarea + + implicit none + + !----------------------------------------------------------------------- + ! ... Dummy arguments + !----------------------------------------------------------------------- + integer, intent(in) :: lchnk ! chunk index + integer, intent(in) :: ncol ! number columns in chunk + integer, intent(in) :: imozart ! gas phase start index in q + real(r8), intent(in) :: delt ! timestep (s) + real(r8), intent(in) :: calday ! day of year + real(r8), intent(in) :: ps(pcols) ! surface pressure + real(r8), intent(in) :: phis(pcols) ! surface geopotential + real(r8),target,intent(in) :: tfld(pcols,pver) ! midpoint temperature (K) + real(r8), intent(in) :: pmid(pcols,pver) ! midpoint pressures (Pa) + real(r8), intent(in) :: pdel(pcols,pver) ! pressure delta about midpoints (Pa) + real(r8), intent(in) :: ufld(pcols,pver) ! zonal velocity (m/s) + real(r8), intent(in) :: vfld(pcols,pver) ! meridional velocity (m/s) + real(r8), intent(in) :: cldw(pcols,pver) ! cloud water (kg/kg) + real(r8), intent(in) :: ncldwtr(pcols,pver) ! droplet number concentration (#/kg) + real(r8), intent(in) :: zm(pcols,pver) ! midpoint geopotential height above the surface (m) + real(r8), intent(in) :: zi(pcols,pver+1) ! interface geopotential height above the surface (m) + real(r8), intent(in) :: pint(pcols,pver+1) ! interface pressures (Pa) + real(r8), intent(in) :: q(pcols,pver,pcnst) ! species concentrations (kg/kg) + real(r8),pointer, intent(in) :: fire_sflx(:,:) ! fire emssions surface flux (kg/m^2/s) + real(r8),pointer, intent(in) :: fire_ztop(:) ! top of vertical distribution of fire emssions (m) + logical, intent(in) :: xactive_prates + real(r8), intent(in) :: fsds(pcols) ! longwave down at sfc + real(r8), intent(in) :: icefrac(pcols) ! sea-ice areal fraction + real(r8), intent(in) :: ocnfrac(pcols) ! ocean areal fraction + real(r8), intent(in) :: asdir(pcols) ! albedo: shortwave, direct + real(r8), intent(in) :: ts(pcols) ! sfc temp (merged w/ocean if coupled) + real(r8), intent(in) :: precc(pcols) ! + real(r8), intent(in) :: precl(pcols) ! + real(r8), intent(in) :: snowhland(pcols) ! + logical, intent(in) :: ghg_chem + integer, intent(in) :: latmapback(pcols) + integer, intent(in) :: troplev(pcols) ! trop/strat separation vertical index + integer, intent(in) :: troplevchem(pcols) ! trop/strat chemistry separation vertical index + real(r8), intent(inout) :: qtend(pcols,pver,pcnst) ! species tendencies (kg/kg/s) + real(r8), intent(inout) :: cflx(pcols,pcnst) ! constituent surface flux (kg/m^2/s) + real(r8), intent(out) :: drydepflx(pcols,pcnst) ! dry deposition flux (kg/m^2/s) + real(r8), intent(in) :: wetdepflx(pcols,pcnst) ! wet deposition flux (kg/m^2/s) + real(r8), intent(out) :: nhx_nitrogen_flx(pcols) + real(r8), intent(out) :: noy_nitrogen_flx(pcols) + + type(physics_buffer_desc), pointer :: pbuf(:) + + !!----------------------------------------------------------------------- + !! ... Local variables + !!----------------------------------------------------------------------- + !real(r8), parameter :: m2km = 1.e-3_r8 + !real(r8), parameter :: Pa2mb = 1.e-2_r8 + + !real(r8), pointer :: prain(:,:) + !real(r8), pointer :: nevapr(:,:) + !real(r8), pointer :: cmfdqr(:,:) + !real(r8), pointer :: cldfr(:,:) + !real(r8), pointer :: cldtop(:) + + !integer :: i, k, m, n + !integer :: tim_ndx + !real(r8) :: delt_inverse + !real(r8) :: esfact + !integer :: latndx(pcols) ! chunk lat indicies + !integer :: lonndx(pcols) ! chunk lon indicies + !real(r8) :: invariants(ncol,pver,nfs) + !real(r8) :: col_dens(ncol,pver,max(1,nabscol)) ! column densities (molecules/cm^2) + !real(r8) :: col_delta(ncol,0:pver,max(1,nabscol)) ! layer column densities (molecules/cm^2) + !real(r8) :: extfrc(ncol,pver,max(1,extcnt)) + !real(r8) :: vmr(ncol,pver,gas_pcnst) ! xported species (vmr) + !real(r8) :: reaction_rates(ncol,pver,max(1,rxntot)) ! reaction rates + !real(r8) :: depvel(ncol,gas_pcnst) ! dry deposition velocity (cm/s) + !real(r8) :: het_rates(ncol,pver,max(1,gas_pcnst)) ! washout rate (1/s) + !real(r8), dimension(ncol,pver) :: & + ! h2ovmr, & ! water vapor volume mixing ratio + ! mbar, & ! mean wet atmospheric mass ( amu ) + ! zmid, & ! midpoint geopotential in km + ! zmidr, & ! midpoint geopotential in km realitive to surf + ! sulfate, & ! trop sulfate aerosols + ! pmb ! pressure at midpoints ( hPa ) + !real(r8), dimension(ncol,pver) :: & + ! cwat, & ! cloud water mass mixing ratio (kg/kg) + ! wrk + !real(r8), dimension(ncol,pver+1) :: & + ! zintr ! interface geopotential in km realitive to surf + !real(r8), dimension(ncol,pver+1) :: & + ! zint ! interface geopotential in km + !real(r8), dimension(ncol) :: & + ! zen_angle, & ! solar zenith angles + ! zsurf, & ! surface height (m) + ! rlats, rlons ! chunk latitudes and longitudes (radians) + !real(r8) :: sza(ncol) ! solar zenith angles (degrees) + !real(r8), parameter :: rad2deg = 180._r8/pi ! radians to degrees conversion factor + !real(r8) :: relhum(ncol,pver) ! relative humidity + !real(r8) :: satv(ncol,pver) ! wrk array for relative humidity + !real(r8) :: satq(ncol,pver) ! wrk array for relative humidity + + !integer :: j + !integer :: ltrop_sol(pcols) ! tropopause vertical index used in chem solvers + !real(r8), pointer :: strato_sad(:,:) ! stratospheric sad (1/cm) + + !real(r8) :: sad_trop(pcols,pver) ! total tropospheric sad (cm^2/cm^3) + !real(r8) :: reff(pcols,pver) ! aerosol effective radius (cm) + !real(r8) :: reff_strat(pcols,pver) ! stratospheric aerosol effective radius (cm) + + !real(r8) :: tvs(pcols) + !integer :: ncdate,yr,mon,day,sec + !real(r8) :: wind_speed(pcols) ! surface wind speed (m/s) + !logical, parameter :: dyn_soilw = .false. + !logical :: table_soilw + !real(r8) :: soilw(pcols) + !real(r8) :: prect(pcols) + !real(r8) :: sflx(pcols,gas_pcnst) + !real(r8) :: wetdepflx_diag(pcols,gas_pcnst) + !real(r8) :: dust_vmr(ncol,pver,ndust) + !real(r8) :: dt_diag(pcols,8) ! od diagnostics + !real(r8) :: fracday(pcols) ! fraction of day + !real(r8) :: o2mmr(ncol,pver) ! o2 concentration (kg/kg) + !real(r8) :: ommr(ncol,pver) ! o concentration (kg/kg) + !real(r8) :: mmr(pcols,pver,gas_pcnst) ! chem working concentrations (kg/kg) + !real(r8) :: mmr_new(pcols,pver,gas_pcnst) ! chem working concentrations (kg/kg) + !real(r8) :: hno3_gas(ncol,pver) ! hno3 gas phase concentration (mol/mol) + !real(r8) :: hno3_cond(ncol,pver,2) ! hno3 condensed phase concentration (mol/mol) + !real(r8) :: hcl_gas(ncol,pver) ! hcl gas phase concentration (mol/mol) + !real(r8) :: hcl_cond(ncol,pver) ! hcl condensed phase concentration (mol/mol) + !real(r8) :: h2o_gas(ncol,pver) ! h2o gas phase concentration (mol/mol) + !real(r8) :: h2o_cond(ncol,pver) ! h2o condensed phase concentration (mol/mol) + !real(r8) :: cldice(pcols,pver) ! cloud water "ice" (kg/kg) + !real(r8) :: radius_strat(ncol,pver,3) ! radius of sulfate, nat, & ice ( cm ) + !real(r8) :: sad_strat(ncol,pver,3) ! surf area density of sulfate, nat, & ice ( cm^2/cm^3 ) + !real(r8) :: mmr_tend(pcols,pver,gas_pcnst) ! chemistry species tendencies (kg/kg/s) + !real(r8) :: qh2o(pcols,pver) ! specific humidity (kg/kg) + !real(r8) :: delta + + ! !for aerosol formation.... + !real(r8) :: del_h2so4_gasprod(ncol,pver) + !real(r8) :: vmr0(ncol,pver,gas_pcnst) + +! +! CCMI +! + !real(r8) :: xlat + !real(r8) :: pm25(ncol) + + !real(r8) :: dlats(ncol) + + !real(r8), dimension(ncol,pver) :: & ! aerosol reaction diagnostics + ! gprob_n2o5, & + ! gprob_cnt_hcl, & + ! gprob_cnt_h2o, & + ! gprob_bnt_h2o, & + ! gprob_hocl_hcl, & + ! gprob_hobr_hcl, & + ! wtper + + !real(r8), pointer :: ele_temp_fld(:,:) ! electron temperature pointer + !real(r8), pointer :: ion_temp_fld(:,:) ! ion temperature pointer + !real(r8) :: prod_out(ncol,pver,max(1,clscnt4)) + !real(r8) :: loss_out(ncol,pver,max(1,clscnt4)) + + !if ( ele_temp_ndx>0 .and. ion_temp_ndx>0 ) then + ! call pbuf_get_field(pbuf, ele_temp_ndx, ele_temp_fld) + ! call pbuf_get_field(pbuf, ion_temp_ndx, ion_temp_fld) + !else + ! ele_temp_fld => tfld + ! ion_temp_fld => tfld + !endif + + !! initialize to NaN to hopefully catch user defined rxts that go unset + !reaction_rates(:,:,:) = nan + + !Dummy output + qtend = 0.0e+0_r8 + cflx = 0.0e+0_r8 + drydepflx = 0.0e+0_r8 + + !delt_inverse = 1._r8 / delt + !!----------------------------------------------------------------------- + !! ... Get chunck latitudes and longitudes + !!----------------------------------------------------------------------- + !call get_lat_all_p( lchnk, ncol, latndx ) + !call get_lon_all_p( lchnk, ncol, lonndx ) + !call get_rlat_all_p( lchnk, ncol, rlats ) + !call get_rlon_all_p( lchnk, ncol, rlons ) + !tim_ndx = pbuf_old_tim_idx() + !call pbuf_get_field(pbuf, ndx_prain, prain, start=(/1,1/), kount=(/ncol,pver/)) + !call pbuf_get_field(pbuf, ndx_cldfr, cldfr, start=(/1,1,tim_ndx/), kount=(/ncol,pver,1/) ) + !call pbuf_get_field(pbuf, ndx_cmfdqr, cmfdqr, start=(/1,1/), kount=(/ncol,pver/)) + !call pbuf_get_field(pbuf, ndx_nevapr, nevapr, start=(/1,1/), kount=(/ncol,pver/)) + !call pbuf_get_field(pbuf, ndx_cldtop, cldtop ) + + !reff_strat(:,:) = 0._r8 + + !dlats(:) = rlats(:)*rad2deg ! convert to degrees + + !!----------------------------------------------------------------------- + !! ... Calculate cosine of zenith angle + !! then cast back to angle (radians) + !!----------------------------------------------------------------------- + !call zenith( calday, rlats, rlons, zen_angle, ncol ) + !zen_angle(:) = acos( zen_angle(:) ) + + !sza(:) = zen_angle(:) * rad2deg + !call outfld( 'SZA', sza, ncol, lchnk ) + + !!----------------------------------------------------------------------- + !! ... Xform geopotential height from m to km + !! and pressure from Pa to mb + !!----------------------------------------------------------------------- + !zsurf(:ncol) = rga * phis(:ncol) + !do k = 1,pver + ! zintr(:ncol,k) = m2km * zi(:ncol,k) + ! zmidr(:ncol,k) = m2km * zm(:ncol,k) + ! zmid(:ncol,k) = m2km * (zm(:ncol,k) + zsurf(:ncol)) + ! zint(:ncol,k) = m2km * (zi(:ncol,k) + zsurf(:ncol)) + ! pmb(:ncol,k) = Pa2mb * pmid(:ncol,k) + !end do + !zint(:ncol,pver+1) = m2km * (zi(:ncol,pver+1) + zsurf(:ncol)) + !zintr(:ncol,pver+1)= m2km * zi(:ncol,pver+1) + + !!----------------------------------------------------------------------- + !! ... map incoming concentrations to working array + !!----------------------------------------------------------------------- + !do m = 1,pcnst + ! n = map2chm(m) + ! if( n > 0 ) then + ! mmr(:ncol,:,n) = q(:ncol,:,m) + ! end if + !end do + + !call get_short_lived_species( mmr, lchnk, ncol, pbuf ) + + !!----------------------------------------------------------------------- + !! ... Set atmosphere mean mass + !!----------------------------------------------------------------------- + !call set_mean_mass( ncol, mmr, mbar ) + + !!----------------------------------------------------------------------- + !! ... Xform from mmr to vmr + !!----------------------------------------------------------------------- + !call mmr2vmr( mmr(:ncol,:,:), vmr(:ncol,:,:), mbar(:ncol,:), ncol ) + +! +! CCMI +! +! reset STE tracer to specific vmr of 200 ppbv +! + !if ( st80_25_ndx > 0 ) then + ! where ( pmid(:ncol,:) < 80.e+2_r8 ) + ! vmr(:ncol,:,st80_25_ndx) = 200.e-9_r8 + ! end where + !end if +! +! reset AOA_NH, NH_5, NH_50, NH_50W surface mixing ratios between 30N and 50N +! + !if ( aoa_nh_ndx>0 ) then + ! do j=1,ncol + ! xlat = dlats(j) + ! if ( xlat >= 30._r8 .and. xlat <= 50._r8 ) then + ! vmr(j,pver,aoa_nh_ndx) = 0._r8 + ! end if + ! end do + !end if + !if ( nh_5_ndx>0 ) then + ! do j=1,ncol + ! xlat = dlats(j) + ! if ( xlat >= 30._r8 .and. xlat <= 50._r8 ) then + ! vmr(j,pver,nh_5_ndx) = 100.e-9_r8 + ! end if + ! end do + !end if + !if ( nh_50_ndx>0 ) then + ! do j=1,ncol + ! xlat = dlats(j) + ! if ( xlat >= 30._r8 .and. xlat <= 50._r8 ) then + ! vmr(j,pver,nh_50_ndx) = 100.e-9_r8 + ! end if + ! end do + !end if + !if ( nh_50w_ndx>0 ) then + ! do j=1,ncol + ! xlat = dlats(j) + ! if ( xlat >= 30._r8 .and. xlat <= 50._r8 ) then + ! vmr(j,pver,nh_50w_ndx) = 100.e-9_r8 + ! end if + ! end do + !end if + + !if (h2o_ndx>0) then + ! !----------------------------------------------------------------------- + ! ! ... store water vapor in wrk variable + ! !----------------------------------------------------------------------- + ! qh2o(:ncol,:) = mmr(:ncol,:,h2o_ndx) + ! h2ovmr(:ncol,:) = vmr(:ncol,:,h2o_ndx) + !else + ! qh2o(:ncol,:) = q(:ncol,:,1) + ! !----------------------------------------------------------------------- + ! ! ... Xform water vapor from mmr to vmr and set upper bndy values + ! !----------------------------------------------------------------------- + ! call h2o_to_vmr( q(:ncol,:,1), h2ovmr(:ncol,:), mbar(:ncol,:), ncol ) + + ! call set_fstrat_h2o( h2ovmr, pmid, troplev, calday, ncol, lchnk ) + + !endif + + !!----------------------------------------------------------------------- + !! ... force ion/electron balance + !!----------------------------------------------------------------------- + !call charge_balance( ncol, vmr ) + + !!----------------------------------------------------------------------- + !! ... Set the "invariants" + !!----------------------------------------------------------------------- + !call setinv( invariants, tfld, h2ovmr, vmr, pmid, ncol, lchnk, pbuf ) + + !!----------------------------------------------------------------------- + !! ... stratosphere aerosol surface area + !!----------------------------------------------------------------------- + !if (sad_pbf_ndx>0) then + ! call pbuf_get_field(pbuf, sad_pbf_ndx, strato_sad) + !else + ! allocate(strato_sad(pcols,pver)) + ! strato_sad(:,:) = 0._r8 + + ! ! Prognostic modal stratospheric sulfate: compute dry strato_sad + ! call aero_model_strat_surfarea( ncol, mmr, pmid, tfld, troplevchem, pbuf, strato_sad, reff_strat ) + + !endif + + !stratochem: if ( has_strato_chem ) then + ! !----------------------------------------------------------------------- + ! ! ... initialize condensed and gas phases; all hno3 to gas + ! !----------------------------------------------------------------------- + ! hcl_cond(:,:) = 0.0_r8 + ! hcl_gas (:,:) = 0.0_r8 + ! do k = 1,pver + ! hno3_gas(:,k) = vmr(:,k,hno3_ndx) + ! h2o_gas(:,k) = h2ovmr(:,k) + ! hcl_gas(:,k) = vmr(:,k,hcl_ndx) + ! wrk(:,k) = h2ovmr(:,k) + ! if (snow_ndx>0) then + ! cldice(:ncol,k) = q(:ncol,k,cldice_ndx) + q(:ncol,k,snow_ndx) + ! else + ! cldice(:ncol,k) = q(:ncol,k,cldice_ndx) + ! endif + ! end do + ! do m = 1,2 + ! do k = 1,pver + ! hno3_cond(:,k,m) = 0._r8 + ! end do + ! end do + + ! call mmr2vmri( cldice(:ncol,:), h2o_cond(:ncol,:), mbar(:ncol,:), cnst_mw(cldice_ndx), ncol ) + + ! !----------------------------------------------------------------------- + ! ! ... call SAD routine + ! !----------------------------------------------------------------------- + ! call sad_strat_calc( lchnk, invariants(:ncol,:,indexm), pmb, tfld, hno3_gas, & + ! hno3_cond, h2o_gas, h2o_cond, hcl_gas, hcl_cond, strato_sad(:ncol,:), radius_strat, & + ! sad_strat, ncol, pbuf ) + +! ! NOTE: output of total HNO3 is before vmr is set to gas-phase. + ! call outfld( 'HNO3_TOTAL', vmr(:ncol,:,hno3_ndx), ncol ,lchnk ) + + + ! do k = 1,pver + ! vmr(:,k,hno3_ndx) = hno3_gas(:,k) + ! h2ovmr(:,k) = h2o_gas(:,k) + ! vmr(:,k,h2o_ndx) = h2o_gas(:,k) + ! wrk(:,k) = (h2ovmr(:,k) - wrk(:,k))*delt_inverse + ! end do + + ! call outfld( 'QDSAD', wrk(:,:), ncol, lchnk ) +! + ! call outfld( 'SAD_STRAT', strato_sad(:ncol,:), ncol, lchnk ) + ! call outfld( 'SAD_SULFC', sad_strat(:,:,1), ncol, lchnk ) + ! call outfld( 'SAD_LNAT', sad_strat(:,:,2), ncol, lchnk ) + ! call outfld( 'SAD_ICE', sad_strat(:,:,3), ncol, lchnk ) +! + ! call outfld( 'RAD_SULFC', radius_strat(:,:,1), ncol, lchnk ) + ! call outfld( 'RAD_LNAT', radius_strat(:,:,2), ncol, lchnk ) + ! call outfld( 'RAD_ICE', radius_strat(:,:,3), ncol, lchnk ) +! + ! call outfld( 'HNO3_GAS', vmr(:ncol,:,hno3_ndx), ncol, lchnk ) + ! call outfld( 'HNO3_STS', hno3_cond(:,:,1), ncol, lchnk ) + ! call outfld( 'HNO3_NAT', hno3_cond(:,:,2), ncol, lchnk ) +! + ! call outfld( 'HCL_TOTAL', vmr(:ncol,:,hcl_ndx), ncol, lchnk ) + ! call outfld( 'HCL_GAS', hcl_gas (:,:), ncol ,lchnk ) + ! call outfld( 'HCL_STS', hcl_cond(:,:), ncol ,lchnk ) + + ! !----------------------------------------------------------------------- + ! ! ... call aerosol reaction rates + ! !----------------------------------------------------------------------- + ! call ratecon_sfstrat( ncol, invariants(:,:,indexm), pmid, tfld, & + ! radius_strat(:,:,1), sad_strat(:,:,1), sad_strat(:,:,2), & + ! sad_strat(:,:,3), h2ovmr, vmr, reaction_rates, & + ! gprob_n2o5, gprob_cnt_hcl, gprob_cnt_h2o, gprob_bnt_h2o, & + ! gprob_hocl_hcl, gprob_hobr_hcl, wtper ) + + ! call outfld( 'GAMMA_HET1', gprob_n2o5 (:ncol,:), ncol, lchnk ) + ! call outfld( 'GAMMA_HET2', gprob_cnt_h2o (:ncol,:), ncol, lchnk ) + ! call outfld( 'GAMMA_HET3', gprob_bnt_h2o (:ncol,:), ncol, lchnk ) + ! call outfld( 'GAMMA_HET4', gprob_cnt_hcl (:ncol,:), ncol, lchnk ) + ! call outfld( 'GAMMA_HET5', gprob_hocl_hcl(:ncol,:), ncol, lchnk ) + ! call outfld( 'GAMMA_HET6', gprob_hobr_hcl(:ncol,:), ncol, lchnk ) + ! call outfld( 'WTPER', wtper (:ncol,:), ncol, lchnk ) + + !endif stratochem + +! ! NOTE: For gas-phase solver only. +! ! ratecon_sfstrat needs total hcl. + !if (hcl_ndx>0) then + ! vmr(:,:,hcl_ndx) = hcl_gas(:,:) + !endif + + !!----------------------------------------------------------------------- + !! ... Set the column densities at the upper boundary + !!----------------------------------------------------------------------- + !call set_ub_col( col_delta, vmr, invariants, pint(:,1), pdel, ncol, lchnk) + + !!----------------------------------------------------------------------- + !! ... Set rates for "tabular" and user specified reactions + !!----------------------------------------------------------------------- + !call setrxt( reaction_rates, tfld, invariants(1,1,indexm), ncol ) + ! + !sulfate(:,:) = 0._r8 + !if ( .not. carma_hetchem_feedback ) then + ! if( so4_ndx < 1 ) then ! get offline so4 field if not prognostic + ! call sulf_interp( ncol, lchnk, sulfate ) + ! else + ! sulfate(:,:) = vmr(:,:,so4_ndx) + ! endif + !endif + ! + !!----------------------------------------------------------------- + !! ... zero out sulfate above tropopause + !!----------------------------------------------------------------- + !do k = 1, pver + ! do i = 1, ncol + ! if (k < troplevchem(i)) then + ! sulfate(i,k) = 0.0_r8 + ! end if + ! end do + !end do + + !call outfld( 'SULF_TROP', sulfate(:ncol,:), ncol, lchnk ) + + !!----------------------------------------------------------------- + !! ... compute the relative humidity + !!----------------------------------------------------------------- + !call qsat(tfld(:ncol,:), pmid(:ncol,:), satv, satq) + + !do k = 1,pver + ! relhum(:,k) = .622_r8 * h2ovmr(:,k) / satq(:,k) + ! relhum(:,k) = max( 0._r8,min( 1._r8,relhum(:,k) ) ) + !end do + ! + !cwat(:ncol,:pver) = cldw(:ncol,:pver) + + !call usrrxt( reaction_rates, tfld, ion_temp_fld, ele_temp_fld, invariants, h2ovmr, & + ! pmid, invariants(:,:,indexm), sulfate, mmr, relhum, strato_sad, & + ! troplevchem, dlats, ncol, sad_trop, reff, cwat, mbar, pbuf ) + + !call outfld( 'SAD_TROP', sad_trop(:ncol,:), ncol, lchnk ) + + !! Add trop/strat components of SAD for output + !sad_trop(:ncol,:)=sad_trop(:ncol,:)+strato_sad(:ncol,:) + !call outfld( 'SAD_AERO', sad_trop(:ncol,:), ncol, lchnk ) + + !! Add trop/strat components of effective radius for output + !reff(:ncol,:)=reff(:ncol,:)+reff_strat(:ncol,:) + !call outfld( 'REFF_AERO', reff(:ncol,:), ncol, lchnk ) + + !if (het1_ndx>0) then + ! call outfld( 'het1_total', reaction_rates(:,:,het1_ndx), ncol, lchnk ) + !endif + + !if (ghg_chem) then + ! call ghg_chem_set_rates( reaction_rates, latmapback, zen_angle, ncol, lchnk ) + !endif + + !do i = phtcnt+1,rxt_tag_cnt + ! call outfld( tag_names(i), reaction_rates(:ncol,:,rxt_tag_map(i)), ncol, lchnk ) + !enddo + + !call adjrxt( reaction_rates, invariants, invariants(1,1,indexm), ncol,pver ) + + !!----------------------------------------------------------------------- + !! ... Compute the photolysis rates at time = t(n+1) + !!----------------------------------------------------------------------- + !!----------------------------------------------------------------------- + !! ... Set the column densities + !!----------------------------------------------------------------------- + !call setcol( col_delta, col_dens, vmr, pdel, ncol ) + + !!----------------------------------------------------------------------- + !! ... Calculate the photodissociation rates + !!----------------------------------------------------------------------- + + !esfact = 1._r8 + !call shr_orb_decl( calday, eccen, mvelpp, lambm0, obliqr , & + ! delta, esfact ) + + + !if ( xactive_prates ) then + ! if ( dst_ndx > 0 ) then + ! dust_vmr(:ncol,:,1:ndust) = vmr(:ncol,:,dst_ndx:dst_ndx+ndust-1) + ! else + ! dust_vmr(:ncol,:,:) = 0._r8 + ! endif + + ! !----------------------------------------------------------------- + ! ! ... compute the photolysis rates + ! !----------------------------------------------------------------- + ! call xactive_photo( reaction_rates, vmr, tfld, cwat, cldfr, & + ! pmid, zmidr, col_dens, zen_angle, asdir, & + ! invariants(1,1,indexm), ps, ts, & + ! esfact, relhum, dust_vmr, dt_diag, fracday, ncol, lchnk ) + + ! call outfld('DTCBS', dt_diag(:ncol,1), ncol, lchnk ) + ! call outfld('DTOCS', dt_diag(:ncol,2), ncol, lchnk ) + ! call outfld('DTSO4', dt_diag(:ncol,3), ncol, lchnk ) + ! call outfld('DTANT', dt_diag(:ncol,4), ncol, lchnk ) + ! call outfld('DTSAL', dt_diag(:ncol,5), ncol, lchnk ) + ! call outfld('DTDUST', dt_diag(:ncol,6), ncol, lchnk ) + ! call outfld('DTSOA', dt_diag(:ncol,7), ncol, lchnk ) + ! call outfld('DTTOTAL', dt_diag(:ncol,8), ncol, lchnk ) + ! call outfld('FRACDAY', fracday(:ncol), ncol, lchnk ) + + !else + ! !----------------------------------------------------------------- + ! ! ... lookup the photolysis rates from table + ! !----------------------------------------------------------------- + ! call table_photo( reaction_rates, pmid, pdel, tfld, zmid, zint, & + ! col_dens, zen_angle, asdir, cwat, cldfr, & + ! esfact, vmr, invariants, ncol, lchnk, pbuf ) + !endif + + !do i = 1,phtcnt + ! call outfld( tag_names(i), reaction_rates(:ncol,:,rxt_tag_map(i)), ncol, lchnk ) + !enddo + + !!----------------------------------------------------------------------- + !! ... Adjust the photodissociation rates + !!----------------------------------------------------------------------- + !call O1D_to_2OH_adj( reaction_rates, invariants, invariants(:,:,indexm), ncol, tfld ) + !call phtadj( reaction_rates, invariants, invariants(:,:,indexm), ncol,pver ) + + !!----------------------------------------------------------------------- + !! ... Compute the extraneous frcing at time = t(n+1) + !!----------------------------------------------------------------------- + !if ( o2_ndx > 0 .and. o_ndx > 0 ) then + ! do k = 1,pver + ! o2mmr(:ncol,k) = mmr(:ncol,k,o2_ndx) + ! ommr(:ncol,k) = mmr(:ncol,k,o_ndx) + ! end do + !endif + !call setext( extfrc, zint, zintr, cldtop, & + ! zmid, lchnk, tfld, o2mmr, ommr, & + ! pmid, mbar, rlats, calday, ncol, rlons, pbuf ) + !! include forcings from fire emissions ... + !call fire_emissions_vrt( ncol, lchnk, zint, fire_sflx, fire_ztop, extfrc ) + + !do m = 1,extcnt + ! if( m /= synoz_ndx .and. m /= aoa_nh_ext_ndx ) then + ! do k = 1,pver + ! extfrc(:ncol,k,m) = extfrc(:ncol,k,m) / invariants(:ncol,k,indexm) + ! end do + ! endif + ! call outfld( extfrc_name(m), extfrc(:ncol,:,m), ncol, lchnk ) + !end do + + !!----------------------------------------------------------------------- + !! ... Form the washout rates + !!----------------------------------------------------------------------- + !if ( gas_wetdep_method=='MOZ' ) then + ! call sethet( het_rates, pmid, zmid, phis, tfld, & + ! cmfdqr, prain, nevapr, delt, invariants(:,:,indexm), & + ! vmr, ncol, lchnk ) + ! if (.not. convproc_do_aer) then + ! call het_diags( het_rates(:ncol,:,:), mmr(:ncol,:,:), pdel(:ncol,:), lchnk, ncol ) + ! endif + !else + ! het_rates = 0._r8 + !end if +! +! CCMI +! +! set loss to below the tropopause only +! + !if ( st80_25_tau_ndx > 0 ) then + ! do i = 1,ncol + ! reaction_rates(i,1:troplev(i),st80_25_tau_ndx) = 0._r8 + ! enddo + !end if + + !if ( has_linoz_data ) then + ! ltrop_sol(:ncol) = troplev(:ncol) + !else + ! ltrop_sol(:ncol) = 0 ! apply solver to all levels + !endif + + !! save h2so4 before gas phase chem (for later new particle nucleation) + !if (ndx_h2so4 > 0) then + ! del_h2so4_gasprod(1:ncol,:) = vmr(1:ncol,:,ndx_h2so4) + !else + ! del_h2so4_gasprod(:,:) = 0.0_r8 + !endif + + !vmr0(:ncol,:,:) = vmr(:ncol,:,:) ! mixing ratios before chemistry changes + + !!======================================================================= + !! ... Call the class solution algorithms + !!======================================================================= + !!----------------------------------------------------------------------- + !! ... Solve for "Explicit" species + !!----------------------------------------------------------------------- + !call exp_sol( vmr, reaction_rates, het_rates, extfrc, delt, invariants(1,1,indexm), ncol, lchnk, ltrop_sol ) + + !!----------------------------------------------------------------------- + !! ... Solve for "Implicit" species + !!----------------------------------------------------------------------- + !if ( has_strato_chem ) wrk(:,:) = vmr(:,:,h2o_ndx) + !call t_startf('imp_sol') + !! + !call imp_sol( vmr, reaction_rates, het_rates, extfrc, delt, & + ! ncol,pver, lchnk, prod_out, loss_out ) + + !call t_stopf('imp_sol') + + !call chem_prod_loss_diags_out( ncol, lchnk, vmr, reaction_rates, prod_out, loss_out, invariants(:ncol,:,indexm) ) + !if( h2o_ndx>0) call outfld( 'H2O_GAS', vmr(1,1,h2o_ndx), ncol ,lchnk ) + + !! reset O3S to O3 in the stratosphere ... + !if ( o3_ndx > 0 .and. o3s_ndx > 0 ) then + ! do i = 1,ncol + ! vmr(i,1:troplev(i),o3s_ndx) = vmr(i,1:troplev(i),o3_ndx) + ! end do + !end if + + !if (convproc_do_aer) then + ! call vmr2mmr( vmr(:ncol,:,:), mmr_new(:ncol,:,:), mbar(:ncol,:), ncol ) + ! ! mmr_new = average of mmr values before and after imp_sol + ! mmr_new(:ncol,:,:) = 0.5_r8*( mmr(:ncol,:,:) + mmr_new(:ncol,:,:) ) + ! call het_diags( het_rates(:ncol,:,:), mmr_new(:ncol,:,:), pdel(:ncol,:), lchnk, ncol ) + !endif + + !! save h2so4 change by gas phase chem (for later new particle nucleation) + !if (ndx_h2so4 > 0) then + ! del_h2so4_gasprod(1:ncol,:) = vmr(1:ncol,:,ndx_h2so4) - del_h2so4_gasprod(1:ncol,:) + !endif + +! +! Aerosol processes ... +! + + !call aero_model_gasaerexch( imozart-1, ncol, lchnk, troplevchem, delt, reaction_rates, & + ! tfld, pmid, pdel, mbar, relhum, & + ! zm, qh2o, cwat, cldfr, ncldwtr, & + ! invariants(:,:,indexm), invariants, del_h2so4_gasprod, & + ! vmr0, vmr, pbuf ) + + !if ( has_strato_chem ) then + + ! wrk(:ncol,:) = (vmr(:ncol,:,h2o_ndx) - wrk(:ncol,:))*delt_inverse + ! call outfld( 'QDCHEM', wrk(:ncol,:), ncol, lchnk ) + ! call outfld( 'HNO3_GAS', vmr(:ncol,:,hno3_ndx), ncol ,lchnk ) + + ! !----------------------------------------------------------------------- + ! ! ... aerosol settling + ! ! first settle hno3(2) using radius ice + ! ! secnd settle hno3(3) using radius large nat + ! !----------------------------------------------------------------------- + ! wrk(:,:) = vmr(:,:,h2o_ndx) +#ifdef ALT_SETTL + ! where( h2o_cond(:,:) > 0._r8 ) + ! settl_rad(:,:) = radius_strat(:,:,3) + ! elsewhere + ! settl_rad(:,:) = 0._r8 + ! endwhere + ! call strat_aer_settling( invariants(1,1,indexm), pmid, delt, zmid, tfld, & + ! hno3_cond(1,1,2), settl_rad, ncol, lchnk, 1 ) + + ! where( h2o_cond(:,:) == 0._r8 ) + ! settl_rad(:,:) = radius_strat(:,:,2) + ! elsewhere + ! settl_rad(:,:) = 0._r8 + ! endwhere + ! call strat_aer_settling( invariants(1,1,indexm), pmid, delt, zmid, tfld, & + ! hno3_cond(1,1,2), settl_rad, ncol, lchnk, 2 ) +#else + ! call strat_aer_settling( invariants(1,1,indexm), pmid, delt, zmid, tfld, & + ! hno3_cond(1,1,2), radius_strat(1,1,2), ncol, lchnk, 2 ) +#endif + + !----------------------------------------------------------------------- + ! ... reform total hno3 and hcl = gas + all condensed + !----------------------------------------------------------------------- +! NOTE: vmr for hcl and hno3 is gas-phase at this point. +! hno3_cond(:,k,1) = STS; hno3_cond(:,k,2) = NAT + + ! do k = 1,pver + ! vmr(:,k,hno3_ndx) = vmr(:,k,hno3_ndx) + hno3_cond(:,k,1) & + ! + hno3_cond(:,k,2) + ! vmr(:,k,hcl_ndx) = vmr(:,k,hcl_ndx) + hcl_cond(:,k) + ! + ! end do + + ! wrk(:,:) = (vmr(:,:,h2o_ndx) - wrk(:,:))*delt_inverse + ! call outfld( 'QDSETT', wrk(:,:), ncol, lchnk ) + + !endif + +! +! LINOZ +! + !if ( do_lin_strat_chem ) then + ! call lin_strat_chem_solve( ncol, lchnk, vmr(:,:,o3_ndx), col_dens(:,:,1), tfld, zen_angle, pmid, delt, rlats, troplev ) + !end if + + !!----------------------------------------------------------------------- + !! ... Check for negative values and reset to zero + !!----------------------------------------------------------------------- + !call negtrc( 'After chemistry ', vmr, ncol ) + + !!----------------------------------------------------------------------- + !! ... Set upper boundary mmr values + !!----------------------------------------------------------------------- + !call set_fstrat_vals( vmr, pmid, pint, troplev, calday, ncol,lchnk ) + + !!----------------------------------------------------------------------- + !! ... Set fixed lower boundary mmr values + !!----------------------------------------------------------------------- + !call flbc_set( vmr, ncol, lchnk, map2chm ) + + !!----------------------------------------------------------------------- + !! set NOy UBC + !!----------------------------------------------------------------------- + !call noy_ubc_set( lchnk, ncol, vmr ) + + !if ( ghg_chem ) then + ! call ghg_chem_set_flbc( vmr, ncol ) + !endif + + !!----------------------------------------------------------------------- + !! force ion/electron balance -- ext forcings likely do not conserve charge + !!----------------------------------------------------------------------- + !call charge_balance( ncol, vmr ) + + !!----------------------------------------------------------------------- + !! ... Xform from vmr to mmr + !!----------------------------------------------------------------------- + !call vmr2mmr( vmr(:ncol,:,:), mmr_tend(:ncol,:,:), mbar(:ncol,:), ncol ) + + !call set_short_lived_species( mmr_tend, lchnk, ncol, pbuf ) + + !!----------------------------------------------------------------------- + !! ... Form the tendencies + !!----------------------------------------------------------------------- + !do m = 1,gas_pcnst + ! mmr_new(:ncol,:,m) = mmr_tend(:ncol,:,m) + ! mmr_tend(:ncol,:,m) = (mmr_tend(:ncol,:,m) - mmr(:ncol,:,m))*delt_inverse + !enddo + + !do m = 1,pcnst + ! n = map2chm(m) + ! if( n > 0 ) then + ! qtend(:ncol,:,m) = qtend(:ncol,:,m) + mmr_tend(:ncol,:,n) + ! end if + !end do + + !tvs(:ncol) = tfld(:ncol,pver) * (1._r8 + qh2o(:ncol,pver)) + + !sflx(:,:) = 0._r8 + !call get_ref_date(yr, mon, day, sec) + !ncdate = yr*10000 + mon*100 + day + !wind_speed(:ncol) = sqrt( ufld(:ncol,pver)*ufld(:ncol,pver) + vfld(:ncol,pver)*vfld(:ncol,pver) ) + !prect(:ncol) = precc(:ncol) + precl(:ncol) + + !if ( drydep_method == DD_XLND ) then + ! soilw = -99 + ! call drydep( ocnfrac, icefrac, ncdate, ts, ps, & + ! wind_speed, qh2o(:,pver), tfld(:,pver), pmid(:,pver), prect, & + ! snowhland, fsds, depvel, sflx, mmr, & + ! tvs, soilw, relhum(:,pver:pver), ncol, lonndx, latndx, lchnk ) + !else if ( drydep_method == DD_XATM ) then + ! table_soilw = has_drydep( 'H2' ) .or. has_drydep( 'CO' ) + ! if( .not. dyn_soilw .and. table_soilw ) then + ! call set_soilw( soilw, lchnk, calday ) + ! end if + ! call drydep( ncdate, ts, ps, & + ! wind_speed, qh2o(:,pver), tfld(:,pver), pmid(:,pver), prect, & + ! snowhland, fsds, depvel, sflx, mmr, & + ! tvs, soilw, relhum(:,pver:pver), ncol, lonndx, latndx, lchnk ) + !else if ( drydep_method == DD_TABL ) then + ! call drydep( calday, ts, zen_angle, & + ! depvel, sflx, mmr, pmid(:,pver), & + ! tvs, ncol, icefrac, ocnfrac, lchnk ) + !endif + + !drydepflx(:,:) = 0._r8 + !do m = 1,pcnst + ! n = map2chm( m ) + ! if ( n > 0 ) then + ! cflx(:ncol,m) = cflx(:ncol,m) - sflx(:ncol,n) + ! drydepflx(:ncol,m) = sflx(:ncol,n) + ! wetdepflx_diag(:ncol,n) = wetdepflx(:ncol,m) + ! endif + !end do + + !call chm_diags( lchnk, ncol, vmr(:ncol,:,:), mmr_new(:ncol,:,:), & + ! reaction_rates(:ncol,:,:), invariants(:ncol,:,:), depvel(:ncol,:), sflx(:ncol,:), & + ! mmr_tend(:ncol,:,:), pdel(:ncol,:), pmid(:ncol,:), troplev(:ncol), wetdepflx_diag(:ncol,:), & + ! nhx_nitrogen_flx(:ncol), noy_nitrogen_flx(:ncol) ) + + !call rate_diags_calc( reaction_rates(:,:,:), vmr(:,:,:), invariants(:,:,indexm), ncol, lchnk ) +! +! jfl +! +! surface vmr +! + !if ( pm25_srf_diag ) then + ! pm25(:ncol) = mmr_new(:ncol,pver,cb1_ndx) & + ! + mmr_new(:ncol,pver,cb2_ndx) & + ! + mmr_new(:ncol,pver,oc1_ndx) & + ! + mmr_new(:ncol,pver,oc2_ndx) & + ! + mmr_new(:ncol,pver,dst1_ndx) & + ! + mmr_new(:ncol,pver,dst2_ndx) & + ! + mmr_new(:ncol,pver,sslt1_ndx) & + ! + mmr_new(:ncol,pver,sslt2_ndx) & + ! + mmr_new(:ncol,pver,soa_ndx) & + ! + mmr_new(:ncol,pver,so4_ndx) + ! call outfld('PM25_SRF',pm25(:ncol) , ncol, lchnk ) + !endif + !if ( pm25_srf_diag_soa ) then + ! pm25(:ncol) = mmr_new(:ncol,pver,cb1_ndx) & + ! + mmr_new(:ncol,pver,cb2_ndx) & + ! + mmr_new(:ncol,pver,oc1_ndx) & + ! + mmr_new(:ncol,pver,oc2_ndx) & + ! + mmr_new(:ncol,pver,dst1_ndx) & + ! + mmr_new(:ncol,pver,dst2_ndx) & + ! + mmr_new(:ncol,pver,sslt1_ndx) & + ! + mmr_new(:ncol,pver,sslt2_ndx) & + ! + mmr_new(:ncol,pver,soam_ndx) & + ! + mmr_new(:ncol,pver,soai_ndx) & + ! + mmr_new(:ncol,pver,soat_ndx) & + ! + mmr_new(:ncol,pver,soab_ndx) & + ! + mmr_new(:ncol,pver,soax_ndx) & + ! + mmr_new(:ncol,pver,so4_ndx) + ! call outfld('PM25_SRF',pm25(:ncol) , ncol, lchnk ) + !endif +! +! + !call outfld('Q_SRF',qh2o(:ncol,pver) , ncol, lchnk ) + !call outfld('U_SRF',ufld(:ncol,pver) , ncol, lchnk ) + !call outfld('V_SRF',vfld(:ncol,pver) , ncol, lchnk ) + +! + !if (.not.sad_pbf_ndx>0) then + ! deallocate(strato_sad) + !endif + + end subroutine gas_phase_chemdr + +end module mo_gas_phase_chemdr diff --git a/src/chemistry/pp_geoschem/mo_lightning.F90 b/src/chemistry/pp_geoschem/mo_lightning.F90 new file mode 100644 index 0000000000..206c1e7fc6 --- /dev/null +++ b/src/chemistry/pp_geoschem/mo_lightning.F90 @@ -0,0 +1,182 @@ +module mo_lightning + !---------------------------------------------------------------------- + ! ... the lightning module + !---------------------------------------------------------------------- + + use shr_kind_mod, only : r8 => shr_kind_r8 + use ppgrid, only : begchunk, endchunk, pcols, pver + use phys_grid, only : ngcols_p + use cam_abortutils, only : endrun + use cam_logfile, only : iulog + use spmd_utils, only : masterproc, mpicom + + implicit none + + private + public :: lightning_inti + public :: lightning_no_prod + public :: prod_no + + save + + real(r8) :: csrf + real(r8) :: factor = 0.1_r8 ! user-controlled scaling factor to achieve arbitrary no prod. + real(r8) :: geo_factor ! grid cell area factor + real(r8) :: vdist(16,3) ! vertical distribution of lightning + real(r8), allocatable :: prod_no(:,:,:) + real(r8), allocatable :: glob_prod_no_col(:,:) + real(r8), allocatable :: flash_freq(:,:) + integer :: no_ndx,xno_ndx + logical :: has_no_lightning_prod = .false. + +contains + + subroutine lightning_inti( lght_no_prd_factor ) + !---------------------------------------------------------------------- + ! ... initialize the lightning module + !---------------------------------------------------------------------- + use mo_constants, only : pi + use ioFileMod, only : getfil + !use mo_chem_utls, only : get_spc_ndx + + use cam_history, only : addfld, add_default, horiz_only + use dyn_grid, only : get_dyn_grid_parm + use phys_control, only : phys_getopts + + implicit none + + !---------------------------------------------------------------------- + ! ... dummy args + !---------------------------------------------------------------------- + real(r8), intent(in) :: lght_no_prd_factor ! lightning no production factor + + !!---------------------------------------------------------------------- + !! ... local variables + !!---------------------------------------------------------------------- + !integer :: astat + !integer :: ncid + !integer :: dimid + !integer :: vid + !integer :: gndx + !integer :: jl, ju + !integer :: nlat, nlon + !integer :: plon, plat + !real(r8), allocatable :: lats(:) + !real(r8), allocatable :: lons(:) + !real(r8), allocatable :: landmask(:,:) + !character(len=256) :: locfn + !logical :: history_cesm_forcing + + !call phys_getopts( history_cesm_forcing_out = history_cesm_forcing ) + + !no_ndx = get_spc_ndx('NO') + !xno_ndx = get_spc_ndx('XNO') + + !has_no_lightning_prod = no_ndx>0 .or. xno_ndx>0 + !if (.not.has_no_lightning_prod) return + + ! + !if( lght_no_prd_factor /= 1._r8 ) then + ! factor = factor*lght_no_prd_factor + !end if + + + !if (masterproc) write(iulog,*) 'lght_inti: lightning no production scaling factor = ',factor + + !!---------------------------------------------------------------------- + !! ... vdist(kk,itype) = % of lightning nox between (kk-1) and (kk) + !! km for profile itype + !!---------------------------------------------------------------------- + !vdist(:,1) = (/ 3.0_r8, 3.0_r8, 3.0_r8, 3.0_r8, 3.4_r8, 3.5_r8, 3.6_r8, 4.0_r8, & ! midlat cont + ! 5.0_r8, 7.0_r8, 9.0_r8, 14.0_r8, 16.0_r8, 14.0_r8, 8.0_r8, 0.5_r8 /) + !vdist(:,2) = (/ 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 6.1_r8, & ! trop marine + ! 17.0_r8, 15.4_r8, 14.5_r8, 13.0_r8, 12.5_r8, 2.8_r8, 0.9_r8, 0.3_r8 /) + !vdist(:,3) = (/ 2.0_r8, 2.0_r8, 2.0_r8, 1.5_r8, 1.5_r8, 1.5_r8, 3.0_r8, 5.8_r8, & ! trop cont + ! 7.6_r8, 9.6_r8, 11.0_r8, 14.0_r8, 14.0_r8, 14.0_r8, 8.2_r8, 2.3_r8 /) + + !allocate( prod_no(pcols,pver,begchunk:endchunk),stat=astat ) + !if( astat /= 0 ) then + ! write(iulog,*) 'lght_inti: failed to allocate prod_no; error = ',astat + ! call endrun + !end if + !allocate( flash_freq(pcols,begchunk:endchunk),stat=astat ) + !if( astat /= 0 ) then + ! write(iulog,*) 'lght_inti: failed to allocate flash_freq; error = ',astat + ! call endrun + !end if + !allocate( glob_prod_no_col(pcols,begchunk:endchunk),stat=astat ) + !if( astat /= 0 ) then + ! write(iulog,*) 'lght_inti: failed to allocate glob_prod_no_col; error = ',astat + ! call endrun + !end if + !prod_no(:,:,:) = 0._r8 + !flash_freq(:,:) = 0._r8 + !geo_factor = ngcols_p/(4._r8*pi) + + + !call addfld( 'LNO_COL_PROD', horiz_only, 'I', 'TG N/YR', 'lighting column NO source' ) + !call addfld( 'LNO_PROD', (/ 'lev' /), 'I', '/cm3/s', 'lighting insitu NO source' ) + !call addfld( 'FLASHFRQ', horiz_only, 'I', '1/MIN', 'lighting flash rate' ) ! flash frequency in grid box per minute (PPP) + !call addfld( 'FLASHENGY', horiz_only, 'I', ' ', 'lighting flash rate' ) ! flash frequency in grid box per minute (PPP) + !call addfld( 'CLDHGT', horiz_only, 'I', 'KM', 'cloud top height' ) ! cloud top height + !call addfld( 'DCHGZONE', horiz_only, 'I', 'KM', 'depth of discharge zone' ) ! depth of discharge zone + !call addfld( 'CGIC', horiz_only, 'I', 'RATIO', 'ratio of cloud-ground/intracloud discharges' ) ! ratio of cloud-ground/intracloud discharges + + !if ( history_cesm_forcing ) then + ! call add_default('LNO_COL_PROD',1,' ') + !endif + + end subroutine lightning_inti + + subroutine lightning_no_prod( state, pbuf2d, cam_in ) + !---------------------------------------------------------------------- + ! ... set no production from lightning + !---------------------------------------------------------------------- + use physics_types, only : physics_state + + use physics_buffer, only : pbuf_get_index, physics_buffer_desc, pbuf_get_field, pbuf_get_chunk + use physconst, only : rga + use phys_grid, only : get_rlat_all_p, get_lat_all_p, get_lon_all_p, get_wght_all_p + use cam_history, only : outfld + use camsrfexch, only : cam_in_t + use shr_reprosum_mod, only : shr_reprosum_calc + !use mo_constants, only : rearth, d2r + implicit none + + !---------------------------------------------------------------------- + ! ... dummy args + !---------------------------------------------------------------------- + type(physics_state), intent(in) :: state(begchunk:endchunk) ! physics state + + type(physics_buffer_desc), pointer :: pbuf2d(:,:) + type(cam_in_t), intent(in) :: cam_in(begchunk:endchunk) ! physics state + + !---------------------------------------------------------------------- + ! ... local variables + !---------------------------------------------------------------------- + + !---------------------------------------------------------------------- + ! ... parameters to determine cg/ic ratio [price and rind, 1993] + !---------------------------------------------------------------------- + + if (.not.has_no_lightning_prod) return + + ! < === INSERT CALCULATION HERE === > + + !!-------------------------------------------------------------------------------- + !! ... output lightning no production to history file + !!-------------------------------------------------------------------------------- + !do c = begchunk,endchunk + ! lchnk = state(c)%lchnk + ! call outfld( 'LNO_PROD', prod_no(:,:,c), pcols, lchnk ) + ! call outfld( 'LNO_COL_PROD', glob_prod_no_col(:,c), pcols, lchnk ) + ! call outfld( 'FLASHFRQ', flash_freq(:,c), pcols, lchnk ) + ! call outfld( 'FLASHENGY', flash_energy(:,c), pcols, lchnk ) + ! call outfld( 'CLDHGT', cldhgt(:,c), pcols, lchnk ) + ! call outfld( 'DCHGZONE', dchgzone(:,c), pcols, lchnk ) + ! call outfld( 'CGIC', cgic(:,c), pcols, lchnk ) + !enddo + + end subroutine lightning_no_prod + +end module mo_lightning diff --git a/src/chemistry/pp_geoschem/rate_diags.F90 b/src/chemistry/pp_geoschem/rate_diags.F90 new file mode 100644 index 0000000000..40b5fa6dde --- /dev/null +++ b/src/chemistry/pp_geoschem/rate_diags.F90 @@ -0,0 +1,177 @@ +!-------------------------------------------------------------------------------- +! Manages writing reaction rates to history +!-------------------------------------------------------------------------------- +module rate_diags + + use shr_kind_mod, only : r8 => shr_kind_r8 + use shr_kind_mod, only : CL => SHR_KIND_CL + use cam_history, only : fieldname_len + use cam_history, only : addfld, add_default + use cam_history, only : outfld + use chem_mods, only : rxt_tag_cnt, rxt_tag_lst, rxt_tag_map + use ppgrid, only : pver + use spmd_utils, only : masterproc + use cam_abortutils, only : endrun +! use sums_utils, only : sums_grp_t, parse_sums + + implicit none + private + public :: rate_diags_init + public :: rate_diags_calc + public :: rate_diags_readnl + + character(len=fieldname_len) :: rate_names(rxt_tag_cnt) + +! integer :: ngrps = 0 +! type(sums_grp_t), allocatable :: grps(:) + + integer, parameter :: maxlines = 200 + character(len=CL), allocatable :: rxn_rate_sums(:) + +contains + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine rate_diags_readnl(nlfile) + + use namelist_utils, only: find_group_name + use units, only: getunit, freeunit + use spmd_utils, only: mpicom, mpi_character, masterprocid + + ! args + character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input + + ! Local variables + integer :: unitn, ierr + + namelist /rxn_rate_diags_nl/ rxn_rate_sums + + allocate( rxn_rate_sums( maxlines ) ) + rxn_rate_sums(:) = ' ' + + !! Read namelist + !if (masterproc) then + ! unitn = getunit() + ! open( unitn, file=trim(nlfile), status='old' ) + ! call find_group_name(unitn, 'rxn_rate_diags_nl', status=ierr) + ! if (ierr == 0) then + ! read(unitn, rxn_rate_diags_nl, iostat=ierr) + ! if (ierr /= 0) then + ! call endrun('rate_diags_readnl:: ERROR reading namelist') + ! end if + ! end if + ! close(unitn) + ! call freeunit(unitn) + !end if + + ! Broadcast namelist variables + call mpi_bcast(rxn_rate_sums,len(rxn_rate_sums(1))*maxlines, mpi_character, masterprocid, mpicom, ierr) + + end subroutine rate_diags_readnl +!-------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------- + subroutine rate_diags_init + use phys_control, only : phys_getopts + + integer :: i, len, pos + character(len=64) :: name + logical :: history_scwaccm_forcing + + call phys_getopts( history_scwaccm_forcing_out = history_scwaccm_forcing ) + + !do i = 1,rxt_tag_cnt + ! pos = 0 + ! pos = index(rxt_tag_lst(i),'tag_') + ! if (pos <= 0) pos = index(rxt_tag_lst(i),'usr_') + ! if (pos <= 0) pos = index(rxt_tag_lst(i),'cph_') + ! if (pos <= 0) pos = index(rxt_tag_lst(i),'ion_') + ! if (pos>0) then + ! name = 'r_'//trim(rxt_tag_lst(i)(5:)) + ! else + ! name = 'r_'//trim(rxt_tag_lst(i)(1:)) + ! endif + ! len = min(fieldname_len,len_trim(name)) + ! rate_names(i) = trim(name(1:len)) + ! call addfld(rate_names(i), (/ 'lev' /),'A', 'molecules/cm3/sec','reaction rate') + ! if (history_scwaccm_forcing .and. rate_names(i) == 'r_O1D_H2O') then + ! call add_default( rate_names(i), 1, ' ') + ! endif + !enddo + + !! parse the terms of the summations + !call parse_sums(rxn_rate_sums, ngrps, grps) + !deallocate( rxn_rate_sums ) + + !do i = 1, ngrps + ! call addfld( grps(i)%name, (/ 'lev' /),'A', 'molecules/cm3/sec','reaction rate group') + !enddo + + end subroutine rate_diags_init + +!-------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------- + subroutine rate_diags_calc( rxt_rates, vmr, m, ncol, lchnk ) + + !use mo_rxt_rates_conv, only: set_rates + + real(r8), intent(inout) :: rxt_rates(:,:,:) ! 'molec/cm3/sec' + real(r8), intent(in) :: vmr(:,:,:) + real(r8), intent(in) :: m(:,:) ! air density (molecules/cm3) + integer, intent(in) :: ncol, lchnk + + !integer :: i, j, ndx + !real(r8) :: group_rate(ncol,pver) + + rxt_rates(:,:,:) = 0.0e+0_r8 + + !call set_rates( rxt_rates, vmr, ncol ) + + !! output individual tagged rates + !do i = 1, rxt_tag_cnt + ! ! convert from vmr/sec to molecules/cm3/sec + ! rxt_rates(:ncol,:,rxt_tag_map(i)) = rxt_rates(:ncol,:,rxt_tag_map(i)) * m(:ncol,:) + ! call outfld( rate_names(i), rxt_rates(:ncol,:,rxt_tag_map(i)), ncol, lchnk ) + !enddo + + !! output rate groups ( or families ) + !do i = 1, ngrps + ! group_rate(:,:) = 0._r8 + ! do j = 1, grps(i)%nmembers + ! ndx = lookup_tag_ndx(grps(i)%term(j)) + ! group_rate(:ncol,:) = group_rate(:ncol,:) + grps(i)%multipler(j)*rxt_rates(:ncol,:,ndx) + ! enddo + ! call outfld( grps(i)%name, group_rate(:ncol,:), ncol, lchnk ) + !end do + + end subroutine rate_diags_calc + +!------------------------------------------------------------------- +! Private routines : +!------------------------------------------------------------------- +!------------------------------------------------------------------- + +!------------------------------------------------------------------- +! finds the index corresponging to a given reacton name +!------------------------------------------------------------------- + function lookup_tag_ndx( name ) result( ndx ) + character(len=*) :: name + integer :: ndx + + integer :: i + + ndx = -1 + + !findloop: do i = 1,rxt_tag_cnt + ! if (trim(name) .eq. trim(rate_names(i)(3:))) then + ! ndx = i + ! return + ! endif + !end do findloop + + !if (ndx<0) then + ! call endrun('rate_diags: not able to find rxn tag name: '//trim(name)) + !endif + + end function lookup_tag_ndx + +end module rate_diags diff --git a/src/chemistry/pp_geoschem/short_lived_species.F90 b/src/chemistry/pp_geoschem/short_lived_species.F90 new file mode 100644 index 0000000000..9e71d6f91c --- /dev/null +++ b/src/chemistry/pp_geoschem/short_lived_species.F90 @@ -0,0 +1,224 @@ +!--------------------------------------------------------------------- +! Manages the storage of non-transported short-lived chemical species +! in the physics buffer. +! +! Created by: Francis Vitt -- 20 Aug 2008 +!--------------------------------------------------------------------- +module short_lived_species + + use shr_kind_mod, only : r8 => shr_kind_r8 + use chem_mods, only : slvd_lst, nslvd, gas_pcnst + use cam_logfile, only : iulog + use ppgrid, only : pcols, pver, begchunk, endchunk + use spmd_utils, only : masterproc + + + implicit none + + save + private + public :: map + public :: register_short_lived_species + public :: short_lived_species_initic + public :: short_lived_species_writeic + public :: initialize_short_lived_species + public :: set_short_lived_species + public :: get_short_lived_species + public :: slvd_index + public :: pbf_idx + + integer :: pbf_idx + integer :: map(nslvd) + + character(len=16), parameter :: pbufname = 'ShortLivedSpecies' + +contains + +!--------------------------------------------------------------------- +!--------------------------------------------------------------------- + subroutine register_short_lived_species + use physics_buffer, only : pbuf_add_field, dtype_r8 + + implicit none + + integer :: m + + if ( nslvd < 1 ) return + + call pbuf_add_field(pbufname,'global',dtype_r8,(/pcols,pver,nslvd/),pbf_idx) + + end subroutine register_short_lived_species + +!--------------------------------------------------------------------- +!--------------------------------------------------------------------- + subroutine short_lived_species_initic +#ifdef WACCMX_IONOS + use cam_history, only : addfld, add_default + + integer :: m + character(len=24) :: varname + + do m=1,nslvd + varname = trim(slvd_lst(m))//'&IC' + call addfld (varname, (/ 'lev' /),'I','kg/kg',trim(varname)//' not-transported species',gridname='physgrid') + call add_default (varname,0, 'I') + enddo +#endif + end subroutine short_lived_species_initic + +!--------------------------------------------------------------------- +!--------------------------------------------------------------------- + subroutine short_lived_species_writeic( lchnk, pbuf ) + use cam_history, only : outfld, write_inithist + use physics_buffer, only : physics_buffer_desc, pbuf_get_field + + integer , intent(in) :: lchnk ! chunk identifier + type(physics_buffer_desc), pointer :: pbuf(:) +#ifdef WACCMX_IONOS + real(r8),pointer :: tmpptr(:,:) + integer :: m + character(len=24) :: varname + + if ( write_inithist() ) then + do m=1,nslvd + varname = trim(slvd_lst(m))//'&IC' + call pbuf_get_field(pbuf, pbf_idx, tmpptr, start=(/1,1,m/), kount=(/ pcols,pver,1 /)) + call outfld(varname, tmpptr, pcols,lchnk) + enddo + endif +#endif + end subroutine short_lived_species_writeic + +!--------------------------------------------------------------------- +!--------------------------------------------------------------------- + subroutine initialize_short_lived_species(ncid_ini, pbuf2d) + use cam_grid_support, only : cam_grid_check, cam_grid_id + use cam_grid_support, only : cam_grid_get_dim_names + use cam_abortutils, only : endrun + !use mo_tracname, only : solsym !TMMF + use ncdio_atm, only : infld + use pio, only : file_desc_t + use physics_buffer, only : physics_buffer_desc, pbuf_set_field, pbuf_get_chunk, pbuf_get_field + + implicit none + + type(file_desc_t), intent(inout) :: ncid_ini + type(physics_buffer_desc), pointer :: pbuf2d(:,:) + + integer :: m,n,lchnk + integer :: grid_id + character(len=8) :: fieldname + character(len=4) :: dim1name, dim2name + logical :: found + real(r8),pointer :: tmpptr(:,:,:) ! temporary pointer + real(r8),pointer :: tmpptr2(:,:,:) ! temporary pointer + character(len=*), parameter :: subname='INITIALIZE_SHORT_LIVED_SPECIES' + + if ( nslvd < 1 ) return + + found = .false. + + grid_id = cam_grid_id('physgrid') + if (.not. cam_grid_check(grid_id)) then + call endrun(trim(subname)//': Internal error, no "physgrid" grid') + end if + call cam_grid_get_dim_names(grid_id, dim1name, dim2name) + + call pbuf_set_field(pbuf2d, pbf_idx, 0._r8) + + allocate(tmpptr(pcols,pver,begchunk:endchunk)) + + do m=1,nslvd + n = map(m) + !fieldname = solsym(n) + write(fieldname,'(a,a)') 'GCSL', m + !write(fieldname,'(a,a)') 'GCSL_',trim(slvd_lst(m)) + call infld( fieldname,ncid_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & + tmpptr, found, gridname='physgrid') + + if (.not.found) then + tmpptr(:,:,:) = 1.e-36_r8 + endif + + call pbuf_set_field(pbuf2d, pbf_idx, tmpptr, start=(/1,1,m/),kount=(/pcols,pver,1/)) + + if (masterproc) write(iulog,*) fieldname, ' is set to short-lived' + + enddo + + deallocate(tmpptr) + + end subroutine initialize_short_lived_species + +!--------------------------------------------------------------------- +!--------------------------------------------------------------------- + subroutine set_short_lived_species( q, lchnk, ncol, pbuf ) + + use physics_buffer, only : physics_buffer_desc, pbuf_set_field + + implicit none + + real(r8), intent(in) :: q(pcols,pver,gas_pcnst) + integer, intent(in) :: lchnk, ncol + type(physics_buffer_desc), pointer :: pbuf(:) + + integer :: m,n + + if ( nslvd < 1 ) return + + do m=1,nslvd + n = map(m) + call pbuf_set_field(pbuf, pbf_idx, q(:,:,n), start=(/1,1,m/),kount=(/pcols,pver,1/)) + enddo + + end subroutine set_short_lived_species + +!--------------------------------------------------------------------- +!--------------------------------------------------------------------- + subroutine get_short_lived_species( q, lchnk, ncol, pbuf ) + use physics_buffer, only : physics_buffer_desc, pbuf_get_field + + implicit none + + real(r8), intent(inout) :: q(pcols,pver,gas_pcnst) + integer, intent(in) :: lchnk, ncol + type(physics_buffer_desc), pointer :: pbuf(:) + real(r8),pointer :: tmpptr(:,:) + + + integer :: m,n + + if ( nslvd < 1 ) return + + do m=1,nslvd + n = map(m) + call pbuf_get_field(pbuf, pbf_idx, tmpptr, start=(/1,1,m/), kount=(/ pcols,pver,1 /)) + q(:ncol,:,n) = tmpptr(:ncol,:) + enddo + + endsubroutine get_short_lived_species + +!--------------------------------------------------------------------- +!--------------------------------------------------------------------- + function slvd_index( name ) + implicit none + + character(len=*) :: name + integer :: slvd_index + + integer :: m + + slvd_index = -1 + + if ( nslvd < 1 ) return + + do m=1,nslvd + if ( name == slvd_lst(m) ) then + slvd_index = m + return + endif + enddo + + endfunction slvd_index + +end module short_lived_species diff --git a/src/chemistry/pp_geoschem/upper_bc.F90 b/src/chemistry/pp_geoschem/upper_bc.F90 new file mode 100644 index 0000000000..61f4dab886 --- /dev/null +++ b/src/chemistry/pp_geoschem/upper_bc.F90 @@ -0,0 +1,243 @@ + +module upper_bc + +!--------------------------------------------------------------------------------- +! Module to compute the upper boundary condition for temperature (dry static energy) +! and trace gases. Uses the MSIS model, and SNOE and TIME GCM data. +! +! original code by Stacy Walters +! adapted by B. A. Boville +!--------------------------------------------------------------------------------- + + use shr_kind_mod, only: r8 => shr_kind_r8 + use shr_const_mod,only: grav => shr_const_g, & ! gravitational constant (m/s^2) + kboltz => shr_const_boltz, & ! Boltzmann constant + pi => shr_const_pi, & ! pi + rEarth => shr_const_rearth ! Earth radius + use ppgrid, only: pcols, pver, pverp + use constituents, only: pcnst + use cam_logfile, only: iulog + use spmd_utils, only: masterproc + use ref_pres, only: ptop_ref + + implicit none + private + save +! +! Public interfaces +! + public :: ubc_defaultopts ! set default values of namelist variables + public :: ubc_setopts ! get namelist input + public :: ubc_init ! global initialization + public :: ubc_timestep_init ! time step initialization + public :: ubc_get_vals ! get ubc values for this step + +! Namelist variables + character(len=256) :: snoe_ubc_file = ' ' + real(r8) :: t_pert_ubc = 0._r8 + real(r8) :: no_xfac_ubc = 1._r8 + + character(len=256) :: tgcm_ubc_file = ' ' + integer :: tgcm_ubc_cycle_yr = 0 + integer :: tgcm_ubc_fixed_ymd = 0 + integer :: tgcm_ubc_fixed_tod = 0 + integer :: f_ndx, hf_ndx + character(len=32) :: tgcm_ubc_data_type = 'CYCLICAL' + + logical :: apply_upper_bc = .true. + +!================================================================================================ +contains +!================================================================================================ + +subroutine ubc_defaultopts(tgcm_ubc_file_out, tgcm_ubc_data_type_out, tgcm_ubc_cycle_yr_out, tgcm_ubc_fixed_ymd_out, & + tgcm_ubc_fixed_tod_out, snoe_ubc_file_out, t_pert_ubc_out, no_xfac_ubc_out) +!----------------------------------------------------------------------- +! Purpose: Return default runtime options +!----------------------------------------------------------------------- + + real(r8), intent(out), optional :: t_pert_ubc_out + real(r8), intent(out), optional :: no_xfac_ubc_out + character(len=*), intent(out), optional :: tgcm_ubc_file_out + character(len=*), intent(out), optional :: snoe_ubc_file_out + integer , intent(out), optional :: tgcm_ubc_cycle_yr_out + integer , intent(out), optional :: tgcm_ubc_fixed_ymd_out + integer , intent(out), optional :: tgcm_ubc_fixed_tod_out + character(len=*), intent(out), optional :: tgcm_ubc_data_type_out + +!----------------------------------------------------------------------- + + if ( present(tgcm_ubc_file_out) ) then + tgcm_ubc_file_out = tgcm_ubc_file + endif + if ( present(tgcm_ubc_data_type_out) ) then + tgcm_ubc_data_type_out = tgcm_ubc_data_type + endif + if ( present(tgcm_ubc_cycle_yr_out) ) then + tgcm_ubc_cycle_yr_out = tgcm_ubc_cycle_yr + endif + if ( present(tgcm_ubc_fixed_ymd_out) ) then + tgcm_ubc_fixed_ymd_out = tgcm_ubc_fixed_ymd + endif + if ( present(tgcm_ubc_fixed_tod_out) ) then + tgcm_ubc_fixed_tod_out = tgcm_ubc_fixed_tod + endif + if ( present(snoe_ubc_file_out) ) then + snoe_ubc_file_out = snoe_ubc_file + endif + if ( present(t_pert_ubc_out) ) then + t_pert_ubc_out = t_pert_ubc + endif + if ( present(no_xfac_ubc_out) ) then + no_xfac_ubc_out = no_xfac_ubc + endif + +end subroutine ubc_defaultopts + +!================================================================================================ + +subroutine ubc_setopts(tgcm_ubc_file_in, tgcm_ubc_data_type_in, tgcm_ubc_cycle_yr_in, tgcm_ubc_fixed_ymd_in, & + tgcm_ubc_fixed_tod_in, snoe_ubc_file_in, t_pert_ubc_in, no_xfac_ubc_in) +!----------------------------------------------------------------------- +! Purpose: Set runtime options +!----------------------------------------------------------------------- + + use cam_abortutils, only : endrun + + real(r8), intent(in), optional :: t_pert_ubc_in + real(r8), intent(in), optional :: no_xfac_ubc_in + character(len=*), intent(in), optional :: tgcm_ubc_file_in + character(len=*), intent(in), optional :: snoe_ubc_file_in + integer , intent(in), optional :: tgcm_ubc_cycle_yr_in + integer , intent(in), optional :: tgcm_ubc_fixed_ymd_in + integer , intent(in), optional :: tgcm_ubc_fixed_tod_in + character(len=*), intent(in), optional :: tgcm_ubc_data_type_in + +!----------------------------------------------------------------------- + + if ( present(tgcm_ubc_file_in) ) then + tgcm_ubc_file = tgcm_ubc_file_in + endif + if ( present(tgcm_ubc_data_type_in) ) then + tgcm_ubc_data_type = tgcm_ubc_data_type_in + endif + if ( present(tgcm_ubc_cycle_yr_in) ) then + tgcm_ubc_cycle_yr = tgcm_ubc_cycle_yr_in + endif + if ( present(tgcm_ubc_fixed_ymd_in) ) then + tgcm_ubc_fixed_ymd = tgcm_ubc_fixed_ymd_in + endif + if ( present(tgcm_ubc_fixed_tod_in) ) then + tgcm_ubc_fixed_tod = tgcm_ubc_fixed_tod_in + endif + if ( present(snoe_ubc_file_in) ) then + snoe_ubc_file = snoe_ubc_file_in + endif + if ( present(t_pert_ubc_in) ) then + t_pert_ubc = t_pert_ubc_in + endif + if ( present(no_xfac_ubc_in) ) then + no_xfac_ubc = no_xfac_ubc_in + if( no_xfac_ubc < 0._r8 ) then + write(iulog,*) 'ubc_setopts: no_xfac_ubc = ',no_xfac_ubc,' must be >= 0' + call endrun + end if + endif + +end subroutine ubc_setopts + +!=============================================================================== + + subroutine ubc_init() +!----------------------------------------------------------------------- +! Initialization of time independent fields for the upper boundary condition +! Calls initialization routine for MSIS, TGCM and SNOE +!----------------------------------------------------------------------- + + ! Assume we are running in a simulation with ptop >= 1 Pa + apply_upper_bc = .false. + + if (.not.apply_upper_bc) return + + end subroutine ubc_init + +!=============================================================================== + + subroutine ubc_timestep_init(pbuf2d, state) +!----------------------------------------------------------------------- +! timestep dependent setting +!----------------------------------------------------------------------- + + use solar_parms_data, only: kp=>solar_parms_kp, ap=>solar_parms_ap, f107=>solar_parms_f107 + use solar_parms_data, only: f107a=>solar_parms_f107a, f107p=>solar_parms_f107p + use physics_types, only: physics_state + use ppgrid, only: begchunk, endchunk + use physics_buffer, only: physics_buffer_desc + + type(physics_state), intent(in) :: state(begchunk:endchunk) + type(physics_buffer_desc), pointer :: pbuf2d(:,:) + + if (.not.apply_upper_bc) return + + end subroutine ubc_timestep_init + +!=============================================================================== + + subroutine ubc_get_vals (lchnk, ncol, pint, zi, t, q, omega, phis, & + msis_temp, ubc_mmr, ubc_flux) + +!----------------------------------------------------------------------- +! interface routine for vertical diffusion and pbl scheme +!----------------------------------------------------------------------- + use cam_abortutils, only: endrun + use physconst, only: avogad, rairv, mbarv, rga ! Avogadro, gas constant, mean mass, universal gas constant + use phys_control, only: waccmx_is + use constituents, only: cnst_get_ind, cnst_mw, cnst_fixed_ubc ! Needed for ubc_flux + +!------------------------------Arguments-------------------------------- + integer, intent(in) :: lchnk ! chunk identifier + integer, intent(in) :: ncol ! number of atmospheric columns + real(r8), intent(in) :: pint(pcols,pverp) ! interface pressures + real(r8), intent(in) :: zi(pcols,pverp) ! interface geoptl height above sfc + real(r8), intent(in) :: t(pcols,pver) ! midpoint temperature + real(r8), intent(in),target :: q(pcols,pver,pcnst) ! contituent mixing ratios (kg/kg) + real(r8), intent(in) :: omega(pcols,pver) ! Vertical pressure velocity (Pa/s) + real(r8), intent(in) :: phis(pcols) ! Surface geopotential (m2/s2) + + real(r8), intent(out) :: msis_temp(pcols) ! upper bndy temperature (K) + real(r8), intent(out) :: ubc_mmr(pcols,pcnst) ! upper bndy mixing ratios (kg/kg) + real(r8), intent(out) :: ubc_flux(pcols,pcnst) ! upper bndy flux (kg/s/m^2) + +!---------------------------Local storage------------------------------- + integer :: m ! constituent index + integer :: ierr ! error flag for allocates + integer :: indx_H ! cnst index for H + integer :: indx_HE ! cnst index for He + integer :: iCol ! column loop counter + + real(r8), parameter :: m2km = 1.e-3_r8 ! meter to km + real(r8) :: rho_top(pcols) ! density at top interface + real(r8) :: z_top(pcols) ! height of top interface (km) + + real(r8), parameter :: hfluxlimitfac = 0.72_r8 ! Hydrogen upper boundary flux limiting factor + + real(r8) :: nmbartop ! Top level density (rho) + real(r8) :: zkt ! Factor for H Jean's escape flux calculation + real(r8) :: nDensHETop ! Helium number density (kg/m3) + real(r8) :: pScaleHeight ! Scale height (m) + real(r8) :: wN2 ! Neutral vertical velocity second level (m/s) + real(r8) :: wN3 ! Neutral vertical velocity at third level (m/s) + real(r8) :: wNTop ! Neutral vertical velocity at top level (m/s) + + real(r8), pointer :: qh_top(:) ! Top level hydrogen mixing ratio (kg/kg) +!----------------------------------------------------------------------- + + ubc_mmr(:,:) = 0._r8 + ubc_flux(:,:) = 0._r8 + msis_temp(:) = 0._r8 + + if (.not. apply_upper_bc) return + + end subroutine ubc_get_vals + +end module upper_bc From 786b329600abb5110e97bf57807b5a7cbe27ba99 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 16:13:50 -0400 Subject: [PATCH 038/239] Feat: Make radiatively-active species into chemical constituants (1) Added N2O, CH4, CFC11, CFC12 --- bld/build-namelist | 2 ++ src/chemistry/pp_geoschem/chemistry.F90 | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bld/build-namelist b/bld/build-namelist index 3d68e73b4f..e0202bee82 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -1024,6 +1024,8 @@ if ((($chem =~ /waccm_ma/) or ($chem =~ /waccm_sc_mam/) or ($chem =~ /waccm_tsml $radval .= ",'A:N2O:N2O','A:CH4:CH4','A:CFC11:CFC11','A:CFC12:CFC12'"; } elsif ($prog_ghg1 and !$prog_ghg2 and !$chem_rad_passive ) { $radval .= ",'A:N2O:N2O','A:CH4:CH4','N:CFC11:CFC11','N:CFC12:CFC12'"; +} elsif ($chem =~ /geoschem/) { + $radval .= ",'A:N2O:N2O','A:CH4:CH4','A:CFC11:CFC11','A:CFC12:CFC12'"; } else { $radval .= ",'N:N2O:N2O','N:CH4:CH4','N:CFC11:CFC11','N:CFC12:CFC12'"; } diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 34cc32330e..e7b617ab28 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -168,7 +168,7 @@ subroutine chem_readnl(nlfile) if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_READNL' ! TODO: Read in input.geos and get species names - ntracers=2 + ntracers=6 do i=1,ntracers ! TEMPORARY: Hardcode 2 species (BCPI in output, H2 still needed for ! lower boundary condition) @@ -176,6 +176,14 @@ subroutine chem_readnl(nlfile) tracernames(i) = 'BCPI' elseif (i==2) then tracernames(i) = 'OCS' + elseif (i==3) then + tracernames(i) = 'N2O' + elseif (i==4) then + tracernames(i) = 'CH4' + elseif (i==5) then + tracernames(i) = 'CFC11' + elseif (i==6) then + tracernames(i) = 'CFC12' else write(tracernames(i),'(a,I0.4)') 'GCTRC_',i end if From 9491db97eb96ee0649f308c728a6cb7d610b95e1 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 16:17:37 -0400 Subject: [PATCH 039/239] Feat: Get tracers and species from input.geos and KPP (1) Tracer lists are now acquired from the input files and from the pre-built KPP mechanism Reproducing commit from SDE - May 19, 2018 --- src/chemistry/pp_geoschem/chemistry.F90 | 129 +++++++++++++++++------- 1 file changed, 90 insertions(+), 39 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index e7b617ab28..745051d72d 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -33,7 +33,7 @@ module chemistry public :: chem_write_restart public :: chem_read_restart public :: chem_init_restart - public :: chem_readnl ! read chem namelist + public :: chem_readnl ! read chem namelist public :: chem_emissions public :: chem_timestep_init @@ -73,10 +73,10 @@ end function chem_is subroutine chem_register use physics_buffer, only : pbuf_add_field, dtype_r8 - !----------------------------------------------------------------------- - ! + !----------------------------------------------------------------------- + ! ! Purpose: register advected constituents for chemistry - ! + ! !----------------------------------------------------------------------- integer :: i, n real(r8) :: cptmp @@ -138,6 +138,8 @@ subroutine chem_register readiv=ic_from_cam2, mixtype=mixtype, cam_outfld=camout, & molectype=molectype, fixed_ubc=has_fixed_ubc, & fixed_ubflx=has_fixed_ubflx, longname=trim(lng_name) ) + end do + ! MOZART uses this for short-lived species. Not certain exactly what it ! does, but note that the "ShortLivedSpecies" physics buffer already ! needs to have been initialized, which we haven't done. Physics buffers @@ -152,48 +154,97 @@ subroutine chem_register !map2chm(n) = i !indices(i) = 0 ! ===== SDE DEBUG ===== - end do end subroutine chem_register subroutine chem_readnl(nlfile) - ! Gonna want to read in input.geos, etc. Somehow. + ! This is the FIRST routine to get called - so it should read in + ! GEOS-Chem options from input.geos without actually doing any + ! initialization + + use cam_abortutils, only : endrun + use units, only : getunit, freeunit + use mpishorthand + use gckpp_Model, only : nspec, spc_names ! args character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input ! Local variables - integer :: i + integer :: i, unitn, ierr + character(len=500) :: line + logical :: menuFound, validSLS + + ! Hard-code for now + character(len=500) :: inputGeosPath + inputGeosPath='/n/scratchlfs/jacob_lab/elundgren/UT/runs/4x5_standard/input.geos.template' if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_READNL' ! TODO: Read in input.geos and get species names - ntracers=6 - do i=1,ntracers - ! TEMPORARY: Hardcode 2 species (BCPI in output, H2 still needed for - ! lower boundary condition) - if (i==1) then - tracernames(i) = 'BCPI' - elseif (i==2) then - tracernames(i) = 'OCS' - elseif (i==3) then - tracernames(i) = 'N2O' - elseif (i==4) then - tracernames(i) = 'CH4' - elseif (i==5) then - tracernames(i) = 'CFC11' - elseif (i==6) then - tracernames(i) = 'CFC12' - else - write(tracernames(i),'(a,I0.4)') 'GCTRC_',i + if (masterproc) then + unitn = getunit() + open( unitn, file=trim(inputGeosPath), status='old', iostat=ierr ) + if (ierr .ne. 0) then + call endrun('chem_readnl: ERROR opening input.geos') + end if + ! Go to ADVECTED SPECIES MENU + menuFound = .False. + Do While (.not.menuFound) + read( unitn, '(a)', iostat=ierr ) line + if (ierr.ne.0) then + call endrun('chem_readnl: ERROR finding advected species menu') + else if (index(line,'ADVECTED SPECIES MENU') > 0) then + menuFound=.True. end if end do - - ! Assign remaining species dummy names + ! Skip first line + read(unitn,'(a)',iostat=ierr) line + ! Read in tracer count + read(unitn,'(26x,I)',iostat=ierr) ntracers + ! Skip divider line + read(unitn,'(a)',iostat=ierr) line + ! Read in each tracer + do i=1,ntracers + read(unitn,'(26x,a)',iostat=ierr) line + tracernames(i) = trim(line) + end do + close(unitn) + call freeunit(unitn) + ! Assign remaining tracers dummy names do i=(ntracers+1),ntracersmax write(tracernames(i),'(a,I0.4)') 'GCTRC_',i end do + ! Now go through the KPP mechanism and add any species not implemented by + ! the tracer list in input.geos + if ( nspec > nslsmax ) then + call endrun('chem_readnl: too many species - increase nslsmax') + end If + nsls = 0 + do i=1,nspec + ! Get the name of the species from KPP + line = adjustl(trim(spc_names(i))) + ! Only add this + validSLS = ( (.not.any(trim(line).eq.tracernames)).and.& + (.not.(line(1:2) == 'RR')) ) + if (validSLS) then + ! Genuine new short-lived species + nsls = nsls + 1 + slsnames(nsls) = trim(line) + write(iulog,'(a,I5,a,a)') ' --> GC species ',nsls, ': ',trim(line) + end if + end do + end if + + ! Broadcast to all processors +#if defined( SPMD ) + call mpibcast(ntracers, 1, mpiint, 0, mpicom ) + call mpibcast(tracernames, len(tracernames(1))*ntracersmax, mpichar, 0, mpicom ) + call mpibcast(nsls, 1, mpiint, 0, mpicom ) + call mpibcast(slsnames, len(slsnames(1))*nslsmax, mpichar, 0, mpicom ) +#endif + end subroutine chem_readnl !================================================================================================ @@ -209,12 +260,12 @@ end function chem_is_active !================================================================================================ function chem_implements_cnst(name) - !----------------------------------------------------------------------- - ! + !----------------------------------------------------------------------- + ! ! Purpose: return true if specified constituent is implemented by this package - ! + ! ! Author: B. Eaton - ! + ! !----------------------------------------------------------------------- implicit none !-----------------------------Arguments--------------------------------- @@ -223,10 +274,10 @@ function chem_implements_cnst(name) logical :: chem_implements_cnst ! return value integer :: i - + chem_implements_cnst = .false. - do i = 1, ntracersmax + do i = 1, ntracers if (trim(tracernames(i)) .eq. trim(name)) then chem_implements_cnst = .true. exit @@ -237,13 +288,13 @@ function chem_implements_cnst(name) end function chem_implements_cnst !=============================================================================== - + subroutine chem_init(phys_state, pbuf2d) - !----------------------------------------------------------------------- - ! + !----------------------------------------------------------------------- + ! ! Purpose: initialize GEOS-Chem parts (state objects, mainly) ! (and declare history variables) - ! + ! !----------------------------------------------------------------------- use physics_buffer, only: physics_buffer_desc use cam_history, only: addfld, add_default, horiz_only @@ -337,7 +388,7 @@ end subroutine chem_init_cnst !=============================================================================== subroutine chem_final - + ! Finalize GEOS-Chem if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_FINAL' @@ -387,7 +438,7 @@ subroutine chem_read_restart( File ) end subroutine chem_read_restart !================================================================================ subroutine chem_emissions( state, cam_in ) - use camsrfexch, only : cam_in_t + use camsrfexch, only : cam_in_t ! Arguments: From 2375e05f63a7d97824f7d182d831b71cfa02e9dc Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 16:19:11 -0400 Subject: [PATCH 040/239] Feat: Add additional flags when compiling GEOS-Chem --- bld/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/configure b/bld/configure index 0c267d4b5b..30ecbefa34 100755 --- a/bld/configure +++ b/bld/configure @@ -1430,7 +1430,7 @@ if ($chem_pkg =~ '_mam3') { # TMMF - wedge in GEOS-Chem CPP definitions here if ($chem_pkg =~ 'geoschem') { - $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING'; + $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DMODEL_CESM -DUCX -DLINUX_IFORT -DUSE_REAL8 '; # TMMF - Temporary fix $chem_nadv = 200; } From 95e2242fd3bcf036b8fb2f8669b3e7bc7a80e6e0 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 16:20:46 -0400 Subject: [PATCH 041/239] Fix: Update folder name following version 12.6.0 --- bld/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/configure b/bld/configure index 30ecbefa34..fe4a7aeb95 100755 --- a/bld/configure +++ b/bld/configure @@ -2800,7 +2800,7 @@ sub write_filepath print $fh "$chem_src_dir/geoschem_src/HEMCO/Core\n"; print $fh "$chem_src_dir/geoschem_src/HEMCO/Extensions\n"; print $fh "$chem_src_dir/geoschem_src/HEMCO/Interfaces\n"; - print $fh "$chem_src_dir/geoschem_src/ISOROPIA\n"; + print $fh "$chem_src_dir/geoschem_src/ISORROPIA\n"; print $fh "$chem_src_dir/geoschem_src/KPP/Standard\n"; } # print $fh "$camsrcdir/cam/src/chemistry/pp_geoschem\n"; } } From 90057ce856108c1d3969620435f5644d47f61d4c Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 18 Nov 2019 15:15:43 -0500 Subject: [PATCH 042/239] Feat: Allocate major state variables (Input, Met, Chem) (1) Allocating GEOS-Chem state variables (2) Setting input.geos path as a module variable Reproducing commit from SDE - May 19, 2018 --- src/chemistry/pp_geoschem/chemistry.F90 | 95 +++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 6 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 745051d72d..4976917724 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -16,6 +16,11 @@ module chemistry !use mo_sim_dat, only: set_sim_dat use spmd_utils, only : masterproc use cam_logfile, only : iulog + + use Input_Opt_Mod, only : OptInput + use State_Met_Mod, only : MetState + use State_Chm_Mod, only : ChmState + implicit none private save @@ -52,6 +57,14 @@ module chemistry character(len=255) :: slsnames(nslsmax) !===== SDE DEBUG ===== + ! Location of valid input.geos + character(len=500) :: inputGeosPath + + ! GEOS-Chem state variables + Type(OptInput),Allocatable :: Input_Opt(:) + Type(MetState),Allocatable :: State_Met(:) + Type(ChmState),Allocatable :: State_Chm(:) + !================================================================================================ contains !================================================================================================ @@ -175,8 +188,6 @@ subroutine chem_readnl(nlfile) character(len=500) :: line logical :: menuFound, validSLS - ! Hard-code for now - character(len=500) :: inputGeosPath inputGeosPath='/n/scratchlfs/jacob_lab/elundgren/UT/runs/4x5_standard/input.geos.template' if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_READNL' @@ -239,10 +250,10 @@ subroutine chem_readnl(nlfile) ! Broadcast to all processors #if defined( SPMD ) - call mpibcast(ntracers, 1, mpiint, 0, mpicom ) - call mpibcast(tracernames, len(tracernames(1))*ntracersmax, mpichar, 0, mpicom ) - call mpibcast(nsls, 1, mpiint, 0, mpicom ) - call mpibcast(slsnames, len(slsnames(1))*nslsmax, mpichar, 0, mpicom ) + CALL MPIBCAST(NTRACERS, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST(TRACERNAMES, LEN(TRACERNAMES(1))*NTRACERSMAX, MPICHAR, 0, MPICOM ) + CALL MPIBCAST(NSLS, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST(SLSNAMES, LEN(SLSNAMES(1))*NSLSMAX, MPICHAR, 0, MPICOM ) #endif end subroutine chem_readnl @@ -299,10 +310,57 @@ subroutine chem_init(phys_state, pbuf2d) use physics_buffer, only: physics_buffer_desc use cam_history, only: addfld, add_default, horiz_only + use Input_Opt_Mod + use State_Met_Mod + use State_Chm_Mod + use GC_Environment_Mod + type(physics_state), intent(in):: phys_state(begchunk:endchunk) type(physics_buffer_desc), pointer :: pbuf2d(:,:) + integer :: lchnk(begchunk:endchunk), ncol(begchunk:endchunk) + integer :: iwait + + integer :: iipar, jjpar, llpar + integer :: nlev, i + + ! lchnk: which chunks we have on this process + lchnk = phys_state%lchnk + ! ncol: number of atmospheric columns for each chunk + ncol = phys_state%ncol + ! nlev: number of vertical levels + nlev = pver + + ! This ensures that each process allocates everything needed for its chunks + if (.not.allocated(Input_Opt)) then + Allocate(Input_Opt(begchunk:endchunk)) + Allocate(State_Met(begchunk:endchunk)) + Allocate(State_Chm(begchunk:endchunk)) + if (masterproc) write(iulog,'(a,3(x,L1))') ' --> ALLOC CHECK : ', Allocated(Input_Opt), Allocated(State_Met), Allocated(State_Chm) + end if + write(iulog,'(a,x,L1,2(x,I6))') ' --> SIZE CHECK : ', masterproc,lbound(Input_Opt),ubound(Input_Opt) + + Do i = begchunk, endchunk + + ! Set some basic flags + Input_Opt(i)%Max_BPCH_Diag = 1000 + Input_Opt(i)%Max_AdvectSpc = 500 + Input_Opt(i)%Max_Families = 250 + + Input_Opt(i)%Linoz_NLevels = 25 + Input_Opt(i)%Linoz_NLat = 18 + Input_Opt(i)%Linoz_NMonths = 12 + Input_Opt(i)%Linoz_NFields = 7 + Input_Opt(i)%RootCPU = ((i.eq.begchunk) .and. MasterProc) + + IIPAR = 1 + JJPAR = ncol(i) + LLPAR = nlev + + end do + ! Can add history output here too with the "addfld" & "add_default" routines + ! Note that constituents are already output by default call addfld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) call add_default ( 'BCPI', 1, ' ') if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_INIT' @@ -318,6 +376,10 @@ subroutine chem_timestep_init(phys_state, pbuf2d) type(physics_buffer_desc), pointer :: pbuf2d(:,:) if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_INIT' + + ! This is when we want to update State_Met and so on + ! Note that here we have been passed MANY chunks + end subroutine chem_timestep_init !=============================================================================== @@ -339,7 +401,24 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) ! Mapping (?) logical :: lq(pcnst) integer :: n, m + + integer :: lchnk, ncol ! Here's where you'll call DO_CHEMISTRY + ! NOTE: State_Met etc are in an ARRAY - so we will want to always pass + ! State_Met%(lchnk) and so on + ! lchnk: which chunk we have on this process + lchnk = state%lchnk + ! ncol: number of atmospheric columns on this chunk + ncol = state%ncol + + ! Need to be super careful that the module arrays are updated and correctly + ! set + + ! 1. Update State_Met etc for this timestep + + !if (masterproc) write(iulog,*) ' --> TEND SIZE: ', size(state%ncol) + !if (masterproc) write(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(state%ncol),ubound(state%ncol) + if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' lq(:) = .false. @@ -391,6 +470,10 @@ subroutine chem_final ! Finalize GEOS-Chem if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_FINAL' + If (allocated(Input_Opt)) Deallocate(Input_Opt) + If (allocated(State_Met)) Deallocate(State_Met) + If (allocated(State_Chm)) Deallocate(State_Chm) + if (masterproc) write(iulog,'(a,3(x,L1))') ' --> DEALLOC CHECK : ', Allocated(Input_Opt), Allocated(State_Met), Allocated(State_Chm) return end subroutine chem_final From 8c381b0ee62c2d2302a71b651ece3e73a2f22da1 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 16:26:46 -0400 Subject: [PATCH 043/239] Chore: Cleanup and capitalization --- src/chemistry/pp_geoschem/chemistry.F90 | 354 +++++++++++++----------- 1 file changed, 194 insertions(+), 160 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 4976917724..14505bf2d0 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -14,16 +14,16 @@ module chemistry !use mo_chem_utls, only : get_spc_ndx !use chem_mods, only : gas_pcnst, adv_mass !use mo_sim_dat, only: set_sim_dat - use spmd_utils, only : masterproc + use spmd_utils, only : MasterProc use cam_logfile, only : iulog use Input_Opt_Mod, only : OptInput use State_Met_Mod, only : MetState use State_Chm_Mod, only : ChmState - implicit none - private - save + IMPLICIT NONE + PRIVATE + SAVE ! ! Public interfaces ! @@ -58,7 +58,7 @@ module chemistry !===== SDE DEBUG ===== ! Location of valid input.geos - character(len=500) :: inputGeosPath + CHARACTER(LEN=500) :: inputGeosPath ! GEOS-Chem state variables Type(OptInput),Allocatable :: Input_Opt(:) @@ -69,15 +69,15 @@ module chemistry contains !================================================================================================ - logical function chem_is (name) + LOGICAL function chem_is (NAME) - character(len=*), intent(in) :: name + CHARACTER(LEN=*), INTENT(IN) :: NAME chem_is = .false. - if (name == 'geoschem' ) then + IF (NAME == 'geoschem' ) THEN chem_is = .true. - end if - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_IS' + ENDIF + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_IS' end function chem_is @@ -91,16 +91,16 @@ subroutine chem_register ! Purpose: register advected constituents for chemistry ! !----------------------------------------------------------------------- - integer :: i, n - real(r8) :: cptmp - real(r8) :: qmin - character(len=128) :: mixtype - character(len=128) :: molectype - character(len=128) :: lng_name - logical :: camout - logical :: ic_from_cam2 - logical :: has_fixed_ubc - logical :: has_fixed_ubflx + INTEGER :: i, n + REAL(r8) :: cptmp + REAL(r8) :: qmin + CHARACTER(LEN=128) :: mixtype + CHARACTER(LEN=128) :: molectype + CHARACTER(LEN=128) :: lng_name + LOGICAL :: camout + LOGICAL :: ic_from_cam2 + LOGICAL :: has_fixed_ubc + LOGICAL :: has_fixed_ubflx ! SDE 2018-05-02: This seems to get called before anything else ! That includes CHEM_INIT ! At this point, mozart calls SET_SIM_DAT, which is specified by each @@ -108,26 +108,26 @@ subroutine chem_register ! set_sim_dat which is in pp_[mechanism]/mo_sim_dat.F90. That sets a lot of ! data in other places, notably in "chem_mods" - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_REGISTER' + if (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_REGISTER' ! At the moment, we force nadv_chem=200 in the setup file - ntracers = 200 - do i = 1, ntracersmax + NTRACERS = 200 + DO I = 1, NTRACERSMAX ! TODO: Read input.geos in chem_readnl to get tracernames(1:ntracers) ! TODO: Get all other species properties here from species database ! Hard-code for now - select case (tracernames(i)) - case ('BCPI') + SELECT CASE (TRACERNAMES(I)) + CASE ('BCPI') lng_name = 'Hydrophilic black carbon' ! Molar mass (g/mol) adv_mass(i) = 1000.0e+0_r8 * (0.012e+0_r8) - case ('OCS') + CASE ('OCS') lng_name = 'Carbonyl sulfide' ! Molar mass (g/mol) adv_mass(i) = 1000.0e+0_r8 * (0.060e+0_r8) - case default + CASE DEFAULT lng_name = tracernames(i) adv_mass(i) = 1000.0e+0_r8 * (0.001e+0_r8) - end select + END SELECT ! dummy value for specific heat of constant pressure (Cp) cptmp = 666._r8 ! minimum mixing ratio @@ -147,11 +147,11 @@ subroutine chem_register !write(tracernames(i),'(a,I0.4)') 'GCTRC_', i ! NOTE: In MOZART, this only gets called for tracers ! This is the call to add a "constituent" - call cnst_add( trim(tracernames(i)), adv_mass(i), cptmp, qmin, n, & + CALL cnst_add( trim(tracernames(i)), adv_mass(i), cptmp, qmin, n, & readiv=ic_from_cam2, mixtype=mixtype, cam_outfld=camout, & molectype=molectype, fixed_ubc=has_fixed_ubc, & fixed_ubflx=has_fixed_ubflx, longname=trim(lng_name) ) - end do + ENDDO ! MOZART uses this for short-lived species. Not certain exactly what it ! does, but note that the "ShortLivedSpecies" physics buffer already @@ -181,72 +181,76 @@ subroutine chem_readnl(nlfile) use gckpp_Model, only : nspec, spc_names ! args - character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input + CHARACTER(LEN=*), INTENT(IN) :: nlfile ! filepath for file containing namelist input ! Local variables - integer :: i, unitn, ierr - character(len=500) :: line + INTEGER :: I, UNITN, IERR + CHARACTER(LEN=500) :: LINE logical :: menuFound, validSLS inputGeosPath='/n/scratchlfs/jacob_lab/elundgren/UT/runs/4x5_standard/input.geos.template' - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_READNL' + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_READNL' ! TODO: Read in input.geos and get species names - if (masterproc) then - unitn = getunit() - open( unitn, file=trim(inputGeosPath), status='old', iostat=ierr ) - if (ierr .ne. 0) then - call endrun('chem_readnl: ERROR opening input.geos') - end if + IF (MasterProc) THEN + UNITN = GETUNIT() + OPEN( UNITN, FILE=TRIM(inputGeosPath), STATUS='old', IOSTAT=IERR ) + IF (IERR .NE. 0) THEN + CALL ENDRUN('chem_readnl: ERROR opening input.geos') + ENDIF + ! Go to ADVECTED SPECIES MENU menuFound = .False. - Do While (.not.menuFound) - read( unitn, '(a)', iostat=ierr ) line - if (ierr.ne.0) then - call endrun('chem_readnl: ERROR finding advected species menu') - else if (index(line,'ADVECTED SPECIES MENU') > 0) then + DO WHILE (.NOT.menuFound) + READ( UNITN, '(a)', IOSTAT=IERR ) LINE + IF (IERR.NE.0) THEN + CALL ENDRUN('chem_readnl: ERROR finding advected species menu') + ELSEIF (INDEX(LINE,'ADVECTED SPECIES MENU') > 0) then menuFound=.True. - end if - end do + ENDIF + ENDDO + ! Skip first line - read(unitn,'(a)',iostat=ierr) line + READ(UNITN,'(a)',IOSTAT=IERR) LINE ! Read in tracer count - read(unitn,'(26x,I)',iostat=ierr) ntracers + READ(UNITN,'(26x,I)',IOSTAT=IERR) NTRACERS ! Skip divider line - read(unitn,'(a)',iostat=ierr) line + READ(UNITN,'(a)',IOSTAT=IERR) LINE ! Read in each tracer - do i=1,ntracers - read(unitn,'(26x,a)',iostat=ierr) line + DO I=1,NTRACERS + READ(UNITN,'(26x,a)',iostat=ierr) line tracernames(i) = trim(line) - end do - close(unitn) - call freeunit(unitn) + ENDDO + CLOSE(UNITN) + CALL FREEUNIT(UNITN) + ! Assign remaining tracers dummy names - do i=(ntracers+1),ntracersmax - write(tracernames(i),'(a,I0.4)') 'GCTRC_',i - end do + DO I=(NTRACERS+1),NTRACERSMAX + WRITE(TRACERNAMES(I),'(a,I0.4)') 'GCTRC_',I + ENDDO ! Now go through the KPP mechanism and add any species not implemented by ! the tracer list in input.geos - if ( nspec > nslsmax ) then - call endrun('chem_readnl: too many species - increase nslsmax') - end If - nsls = 0 - do i=1,nspec + IF ( NSPEC > NSLSMAX ) THEN + CALL ENDRUN('chem_readnl: too many species - increase nslsmax') + ENDIF + + NSLS = 0 + DO I=1,NSPEC ! Get the name of the species from KPP - line = adjustl(trim(spc_names(i))) + LINE = ADJUSTL(TRIM(SPC_NAMES(I))) ! Only add this - validSLS = ( (.not.any(trim(line).eq.tracernames)).and.& - (.not.(line(1:2) == 'RR')) ) - if (validSLS) then + validSLS = ( (.NOT.ANY(TRIM(LINE).EQ.TRACERNAMES)).AND.& + (.NOT.(LINE(1:2) == 'RR')) ) + IF (validSLS) THEN ! Genuine new short-lived species - nsls = nsls + 1 - slsnames(nsls) = trim(line) - write(iulog,'(a,I5,a,a)') ' --> GC species ',nsls, ': ',trim(line) - end if - end do - end if + NSLS = NSLS + 1 + SLSNAMES(NSLS) = TRIM(LINE) + WRITE(iulog,'(a,I5,a,a)') ' --> GC species ',nsls, ': ', TRIM(LINE) + ENDIF + ENDDO + ENDIF ! Broadcast to all processors #if defined( SPMD ) @@ -265,7 +269,9 @@ function chem_is_active() logical :: chem_is_active !----------------------------------------------------------------------- chem_is_active = .true. - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_IS_ACTIVE' + + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_IS_ACTIVE' + end function chem_is_active !================================================================================================ @@ -278,24 +284,25 @@ function chem_implements_cnst(name) ! Author: B. Eaton ! !----------------------------------------------------------------------- - implicit none + IMPLICIT NONE !-----------------------------Arguments--------------------------------- - character(len=*), intent(in) :: name ! constituent name - logical :: chem_implements_cnst ! return value + CHARACTER(LEN=*), INTENT(IN) :: name ! constituent name + LOGICAL :: chem_implements_cnst ! return value - integer :: i + INTEGER :: I chem_implements_cnst = .false. - do i = 1, ntracers - if (trim(tracernames(i)) .eq. trim(name)) then + DO I = 1, NTRACERS + IF (TRIM(TRACERNAMES(I)) .eq. TRIM(NAME)) THEN chem_implements_cnst = .true. - exit - end if - end do + EXIT + ENDIF + ENDDO + + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_IMPLEMENTS_CNST' - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_IMPLEMENTS_CNST' end function chem_implements_cnst !=============================================================================== @@ -315,32 +322,37 @@ subroutine chem_init(phys_state, pbuf2d) use State_Chm_Mod use GC_Environment_Mod - type(physics_state), intent(in):: phys_state(begchunk:endchunk) - type(physics_buffer_desc), pointer :: pbuf2d(:,:) + TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) + TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) + + INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) + INTEGER :: IWAIT - integer :: lchnk(begchunk:endchunk), ncol(begchunk:endchunk) - integer :: iwait + INTEGER :: IIPAR, JJPAR, LLPAR + INTEGER :: NLEV, I, RC - integer :: iipar, jjpar, llpar - integer :: nlev, i + LOGICAL :: am_I_Root ! lchnk: which chunks we have on this process - lchnk = phys_state%lchnk + LCHNK = PHYS_STATE%LCHNK ! ncol: number of atmospheric columns for each chunk - ncol = phys_state%ncol + NCOL = PHYS_STATE%NCOL ! nlev: number of vertical levels - nlev = pver + NLEV = PVER ! This ensures that each process allocates everything needed for its chunks - if (.not.allocated(Input_Opt)) then - Allocate(Input_Opt(begchunk:endchunk)) - Allocate(State_Met(begchunk:endchunk)) - Allocate(State_Chm(begchunk:endchunk)) - if (masterproc) write(iulog,'(a,3(x,L1))') ' --> ALLOC CHECK : ', Allocated(Input_Opt), Allocated(State_Met), Allocated(State_Chm) - end if - write(iulog,'(a,x,L1,2(x,I6))') ' --> SIZE CHECK : ', masterproc,lbound(Input_Opt),ubound(Input_Opt) + IF (.NOT.ALLOCATED(Input_Opt)) THEN + ALLOCATE(Input_Opt(BEGCHUNK:ENDCHUNK)) + ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK)) + ALLOCATE(State_Chm(BEGCHUNK:ENDCHUNK)) + IF (MasterProc) WRITE(iulog,'(a,3(x,L1))') ' --> ALLOC CHECK : ', ALLOCATED(Input_Opt), ALLOCATED(State_Met), ALLOCATED(State_Chm) + ENDIF + WRITE(iulog,'(a,x,L1,2(x,I6))') ' --> SIZE CHECK : ', MasterProc, LBOUND(Input_Opt), UBOUND(Input_Opt) - Do i = begchunk, endchunk + DO I = BEGCHUNK, ENDCHUNK + + ! Only treat the first chunk as the "root" CPU + am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) ! Set some basic flags Input_Opt(i)%Max_BPCH_Diag = 1000 @@ -351,19 +363,20 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt(i)%Linoz_NLat = 18 Input_Opt(i)%Linoz_NMonths = 12 Input_Opt(i)%Linoz_NFields = 7 - Input_Opt(i)%RootCPU = ((i.eq.begchunk) .and. MasterProc) + Input_Opt(i)%RootCPU = am_I_Root IIPAR = 1 - JJPAR = ncol(i) - LLPAR = nlev + JJPAR = NCOL(I) + LLPAR = NLEV - end do + ENDDO ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default - call addfld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) - call add_default ( 'BCPI', 1, ' ') - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_INIT' + CALL addfld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) + CALL add_default ( 'BCPI', 1, ' ') + + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT' end subroutine chem_init @@ -372,10 +385,10 @@ end subroutine chem_init subroutine chem_timestep_init(phys_state, pbuf2d) use physics_buffer, only: physics_buffer_desc - type(physics_state), intent(in):: phys_state(begchunk:endchunk) - type(physics_buffer_desc), pointer :: pbuf2d(:,:) + TYPE(physics_state), INTENT(IN):: phys_state(begchunk:endchunk) + TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_INIT' + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_INIT' ! This is when we want to update State_Met and so on ! Note that here we have been passed MANY chunks @@ -390,13 +403,13 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) use cam_history, only: outfld use camsrfexch, only: cam_in_t, cam_out_t - real(r8), intent(in) :: dt ! time step - type(physics_state), intent(in) :: state ! Physics state variables - type(physics_ptend), intent(out) :: ptend ! indivdual parameterization tendencies - type(cam_in_t), intent(inout) :: cam_in - type(cam_out_t), intent(in) :: cam_out - type(physics_buffer_desc), pointer :: pbuf(:) - real(r8), optional, intent(out) :: fh2o(pcols) ! h2o flux to balance source from chemistry + REAL(r8), INTENT(IN) :: dt ! time step + TYPE(physics_state), INTENT(IN) :: state ! Physics state variables + TYPE(physics_ptend), INTENT(OUT) :: ptend ! indivdual parameterization tendencies + TYPE(cam_in_t), INTENT(INOUT) :: cam_in + TYPE(cam_out_t), INTENT(IN) :: cam_out + TYPE(physics_buffer_desc), POINTER :: pbuf(:) + REAL(r8), OPTIONAL, INTENT(OUT) :: fh2o(pcols) ! h2o flux to balance source from chemistry ! Mapping (?) logical :: lq(pcnst) @@ -416,73 +429,93 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) ! 1. Update State_Met etc for this timestep - !if (masterproc) write(iulog,*) ' --> TEND SIZE: ', size(state%ncol) - !if (masterproc) write(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(state%ncol),ubound(state%ncol) + !if (MasterProc) WRITE(iulog,*) ' --> TEND SIZE: ', size(state%ncol) + !if (MasterProc) WRITE(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(state%ncol),ubound(state%ncol) - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' lq(:) = .false. - do n=1,pcnst + DO n=1,pcnst !m = map2chm(n) m=0 - if (m > 0) lq(n) = .true. - end do - call physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) + IF (m > 0) lq(n) = .true. + ENDDO + + CALL physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) ! ptend%q dimensions: [column, ?, species] !ptend%q(:ncol,:,:) = 0.0e+0_r8 !ptend%q(:ncol,:,:) = 0.0e+0_r8 ptend%q(:,:,:) = 0.0e+0_r8 - if (present(fh2o)) fh2o(:) = 0.0e+0_r8 + IF (present(fh2o)) fh2o(:) = 0.0e+0_r8 + + RETURN - return end subroutine chem_timestep_tend !=============================================================================== subroutine chem_init_cnst(name, latvals, lonvals, mask, q) - character(len=*), intent(in) :: name ! constituent name - real(r8), intent(in) :: latvals(:) ! lat in degrees (ncol) - real(r8), intent(in) :: lonvals(:) ! lon in degrees (ncol) - logical, intent(in) :: mask(:) ! Only initialize where .true. - real(r8), intent(out) :: q(:,:) ! kg tracer/kg dry air (ncol, plev + CHARACTER(LEN=*), INTENT(IN) :: name ! constituent name + REAL(r8), INTENT(IN) :: latvals(:) ! lat in degrees (ncol) + REAL(r8), INTENT(IN) :: lonvals(:) ! lon in degrees (ncol) + LOGICAL, INTENT(IN) :: mask(:) ! Only initialize where .true. + REAL(r8), INTENT(OUT) :: q(:,:) ! kg tracer/kg dry air (ncol, plev ! Used to initialize tracer fields if desired. ! Will need a simple mapping structure as well as the CAM tracer registration ! routines. - integer :: ilev, nlev + INTEGER :: ILEV, NLEV - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_INIT_CNST' + if (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT_CNST' - nlev = size(q, 2) - if ( any( tracernames .eq. name ) ) then - do ilev=1,nlev - where(mask) + NLEV = SIZE(Q, 2) + IF ( ANY( TRACERNAMES .EQ. NAME ) ) THEN + DO ILEV=1,NLEV + WHERE(MASK) ! Set to the minimum mixing ratio - q(:,ilev) = 1.0e-38_r8 - end where - end do - end if + q(:,ILEV) = 1.0e-38_r8 + ENDWHERE + ENDDO + ENDIF end subroutine chem_init_cnst !=============================================================================== subroutine chem_final + USE Input_Opt_Mod, ONLY : CLEANUP_INPUT_OPT + + INTEGER :: I, RC + LOGICAL :: am_I_Root + ! Finalize GEOS-Chem - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_FINAL' - If (allocated(Input_Opt)) Deallocate(Input_Opt) - If (allocated(State_Met)) Deallocate(State_Met) - If (allocated(State_Chm)) Deallocate(State_Chm) - if (masterproc) write(iulog,'(a,3(x,L1))') ' --> DEALLOC CHECK : ', Allocated(Input_Opt), Allocated(State_Met), Allocated(State_Chm) + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_FINAL' + + ! Loop over each chunk + DO I = BEGCHUNK, ENDCHUNK + am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) + CALL CLEANUP_INPUT_OPT( am_I_Root, Input_Opt(i), RC ) + ENDDO + + ! Finally deallocate state variables + IF (ALLOCATED(Input_Opt)) DEALLOCATE(Input_Opt) + IF (ALLOCATED(State_Met)) DEALLOCATE(State_Met) + IF (ALLOCATED(State_Chm)) DEALLOCATE(State_Chm) + + IF (MasterProc) WRITE(iulog,'(a,3(x,L1))') ' --> DEALLOC CHECK : ', ALLOCATED(Input_Opt), ALLOCATED(State_Met), ALLOCATED(State_Chm) + + RETURN - return end subroutine chem_final !=============================================================================== subroutine chem_init_restart(File) use pio, only : file_desc_t - type(file_desc_t) :: File - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_INIT_RESTART' - return + TYPE(file_desc_t) :: File + + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT_RESTART' + + RETURN + end subroutine chem_init_restart !=============================================================================== subroutine chem_write_restart( File ) @@ -490,10 +523,10 @@ subroutine chem_write_restart( File ) !use tracer_srcs, only: write_tracer_srcs_restart !use linoz_data, only: write_linoz_data_restart use pio, only : file_desc_t - implicit none - type(file_desc_t) :: File + IMPLICIT NONE + TYPE(file_desc_t) :: File - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_WRITE_RESTART' + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_WRITE_RESTART' ! ! data for offline tracers ! @@ -508,10 +541,10 @@ subroutine chem_read_restart( File ) !use linoz_data, only: read_linoz_data_restart use pio, only : file_desc_t - implicit none - type(file_desc_t) :: File + IMPLICIT NONE + TYPE(file_desc_t) :: File - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_READ_RESTART' + if (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_READ_RESTART' ! ! data for offline tracers ! @@ -525,9 +558,10 @@ subroutine chem_emissions( state, cam_in ) ! Arguments: - type(physics_state), intent(in) :: state ! Physics state variables - type(cam_in_t), intent(inout) :: cam_in ! import state - if (masterproc) write(iulog,'(a)') 'GCCALL CHEM_EMISSIONS' + TYPE(physics_state), INTENT(IN) :: state ! Physics state variables + TYPE(cam_in_t), INTENT(INOUT) :: cam_in ! import state + + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_EMISSIONS' end subroutine chem_emissions From 46caa465fd874e1f66ce7bfed5b992a3e4b7e7b1 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 19 Nov 2019 12:23:52 -0500 Subject: [PATCH 044/239] Feat: Initialize core GEOS-Chem modules (1) Initializes ChmState, GrdState and MetState objects (2) Grid objects are currently initialized identically. However, they should be chunk-dependent. The grids are set based on the lat/lon edges for now, using GEOS-Chem's SetGridFromCtrEdges subroutine (3) Initializes Input_Opt (4) Added subroutine to update time-steps within GEOS-Chem (5) Added error trapping statements --- src/chemistry/pp_geoschem/chemistry.F90 | 426 ++++++++++++++++++++++-- 1 file changed, 397 insertions(+), 29 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 14505bf2d0..6cc4926d97 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -17,9 +17,20 @@ module chemistry use spmd_utils, only : MasterProc use cam_logfile, only : iulog - use Input_Opt_Mod, only : OptInput - use State_Met_Mod, only : MetState - use State_Chm_Mod, only : ChmState + !-------------------------------------------------------------------- + ! Basic GEOS-Chem modules + !-------------------------------------------------------------------- + USE Input_Opt_Mod, ONLY : OptInput ! Derived type for Input Options + USE State_Chm_Mod, ONLY : ChmState ! Derived type for Chemistry State object + USE State_Grid_Mod, ONLY : GrdState ! Derived type for Grid State object + USE State_Met_Mod, ONLY : MetState ! Derived type for Meteorology State object + USE ErrCode_Mod ! Error codes for success or failure + USE Error_Mod ! For error checking + + !----------------------------------------------------------------- + ! Parameters to define floating-point variables + !----------------------------------------------------------------- + USE PRECISION_MOD, ONLY : fp, f4 ! Flexible precision IMPLICIT NONE PRIVATE @@ -61,9 +72,17 @@ module chemistry CHARACTER(LEN=500) :: inputGeosPath ! GEOS-Chem state variables - Type(OptInput),Allocatable :: Input_Opt(:) - Type(MetState),Allocatable :: State_Met(:) - Type(ChmState),Allocatable :: State_Chm(:) + TYPE(OptInput),ALLOCATABLE :: Input_Opt(:) ! Input Options object + TYPE(ChmState),ALLOCATABLE :: State_Chm(:) ! Chemistry State object + TYPE(GrdState),ALLOCATABLE :: State_Grid(:) ! Grid State object + TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object + + ! Integer + INTEGER :: RC + + ! Strings + CHARACTER(LEN=255) :: ThisLoc + CHARACTER(LEN=255) :: ErrMsg !================================================================================================ contains @@ -317,36 +336,73 @@ subroutine chem_init(phys_state, pbuf2d) use physics_buffer, only: physics_buffer_desc use cam_history, only: addfld, add_default, horiz_only + use cam_abortutils, only : endrun + use Input_Opt_Mod - use State_Met_Mod use State_Chm_Mod + use State_Grid_Mod + use State_Met_Mod use GC_Environment_Mod + use GC_Grid_Mod, only : SetGridFromCtrEdges + + ! Use GEOS-Chem versions of physical constants + use PhysConstants, only : PI, PI_180 + + use Time_Mod, only : Accept_External_Date_Time + !use Time_Mod, only : Set_Begin_Time, Set_End_Time + !use Time_Mod, only : Set_Current_Time, Set_DiagB + use Transfer_Mod, only : Init_Transfer + + !use CMN_O3_Mod + !use CMN_Size_Mod TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) + ! Local variables INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) - INTEGER :: IWAIT + INTEGER :: IWAIT, IERR - INTEGER :: IIPAR, JJPAR, LLPAR - INTEGER :: NLEV, I, RC + INTEGER :: NX, NY, NZ + INTEGER :: NLEV, I, J, L, RC + + ! Grid setup + REAL(fp) :: lonVal, latVal + REAL(fp) :: dLonFix, dLatFix + REAL(f4), ALLOCATABLE :: lonMidArr(:,:), latMidArr(:,:) + REAL(f4), ALLOCATABLE :: lonEdgeArr(:,:), latEdgeArr(:,:) LOGICAL :: am_I_Root - ! lchnk: which chunks we have on this process + ! Assume a successful return until otherwise + RC = GC_SUCCESS + + ! For error trapping + ErrMsg = '' + ThisLoc = ' -> at GEOS-Chem (in chemistry/pp_geoschem/chemistry.F90)' + + ! LCHNK: which chunks we have on this process LCHNK = PHYS_STATE%LCHNK - ! ncol: number of atmospheric columns for each chunk + ! NCOL: number of atmospheric columns for each chunk NCOL = PHYS_STATE%NCOL - ! nlev: number of vertical levels + ! NLEV: number of vertical levels NLEV = PVER + ! The GEOS-Chem grids on every "chunk" will all be the same size, to avoid + ! the possibility of having differently-sized chunks + NX = 1 + NY = MAXVAL(NCOL) + NZ = NLEV + ! This ensures that each process allocates everything needed for its chunks IF (.NOT.ALLOCATED(Input_Opt)) THEN ALLOCATE(Input_Opt(BEGCHUNK:ENDCHUNK)) - ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK)) ALLOCATE(State_Chm(BEGCHUNK:ENDCHUNK)) - IF (MasterProc) WRITE(iulog,'(a,3(x,L1))') ' --> ALLOC CHECK : ', ALLOCATED(Input_Opt), ALLOCATED(State_Met), ALLOCATED(State_Chm) + ALLOCATE(State_Grid(BEGCHUNK:ENDCHUNK)) + ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK)) + IF (MasterProc) WRITE(iulog,'(a,4(x,L1))') ' --> ALLOC CHECK : ', ALLOCATED(Input_Opt), ALLOCATED(State_Chm), ALLOCATED(State_Grid), ALLOCATED(State_Met) ENDIF + WRITE(iulog,'(a,x,L1,2(x,I6))') ' --> SIZE CHECK : ', MasterProc, LBOUND(Input_Opt), UBOUND(Input_Opt) DO I = BEGCHUNK, ENDCHUNK @@ -355,22 +411,290 @@ subroutine chem_init(phys_state, pbuf2d) am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) ! Set some basic flags - Input_Opt(i)%Max_BPCH_Diag = 1000 - Input_Opt(i)%Max_AdvectSpc = 500 - Input_Opt(i)%Max_Families = 250 + Input_Opt(I)%Max_BPCH_Diag = 1000 + Input_Opt(I)%Max_AdvectSpc = 500 + Input_Opt(I)%Max_Families = 250 + + Input_Opt(I)%Linoz_NLevels = 25 + Input_Opt(I)%Linoz_NLat = 18 + Input_Opt(I)%Linoz_NMonths = 12 + Input_Opt(I)%Linoz_NFields = 7 + Input_Opt(I)%RootCPU = am_I_Root + + ! Initialize fields of the Grid State object + CALL Init_State_Grid( am_I_Root = am_I_Root, & + State_Grid = State_Grid(I), & + RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "Init_Grid_State"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + State_Grid(I)%NX = NX + State_Grid(I)%NY = NY + State_Grid(I)%NZ = NZ + ! Initialize GEOS-Chem horizontal grid structure + CALL GC_Init_Grid( am_I_Root = am_I_Root, & + Input_Opt = Input_Opt(I), & + State_Grid = State_Grid(I), & + RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "GC_Init_Grid"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Note - this is called AFTER chem_readnl, after X, and after + ! every constituent has had its initial conditions read. Any + ! constituent which is not found in the CAM restart file will + ! then have already had a call to chem_implements_cnst, and will + ! have then had a call to chem_init_cnst to set a default VMR + ! Call the routine GC_Allocate_All (located in module file + ! GeosCore/gc_environment_mod.F90) to allocate all lat/lon + ! allocatable arrays used by GEOS-Chem. + CALL GC_Allocate_All ( am_I_Root = am_I_Root, & + Input_Opt = Input_Opt(I), & + State_Grid = State_Grid(I), & + value_I_Lo = 1, & + value_J_Lo = 1, & + value_I_Hi = NX, & + value_J_Hi = NY, & + value_IM = NX, & + value_JM = NY, & + value_LM = NZ, & + value_IM_WORLD = NX, & + value_JM_WORLD = NY, & + value_LM_WORLD = NZ, & + value_LLSTRAT = 59, & !TMMF + RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "GC_Allocate_All"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ENDDO + + ! TODO: Mimic GEOS-Chem's reading of input options + DO I = BEGCHUNK, ENDCHUNK + ! Start by setting some dummy timesteps + CALL GC_Update_Timesteps(I,300.0E+0_r8) + ! Simulation menu + ! Ignore the data directories for now + Input_Opt(i)%NYMDb = 20000101 + Input_Opt(i)%NHMSb = 000000 + Input_Opt(i)%NYMDe = 20010101 + Input_Opt(i)%NHMSe = 000000 + ENDDO + + ! Set the times held by "time_mod" + CALL Accept_External_Date_Time( am_I_Root = MasterProc, & + value_NYMDb = Input_Opt(BEGCHUNK)%NYMDb, & + value_NHMSb = Input_Opt(BEGCHUNK)%NHMSb, & + value_NYMDe = Input_Opt(BEGCHUNK)%NYMDe, & + value_NHMSe = Input_Opt(BEGCHUNK)%NHMSe, & + value_NYMD = Input_Opt(BEGCHUNK)%NYMDb, & + value_NHMS = Input_Opt(BEGCHUNK)%NHMSb, & + RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Accept_External_Date_Time"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Note: The following calculations do not setup the gridcell areas. + ! In any case, we will need to be constantly updating this grid + ! to compensate for the "multiple chunks per processor" element + ALLOCATE(lonMidArr(NX,NY), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating lonMidArr') + ALLOCATE(lonEdgeArr(NX+1,NY+1), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating lonEdgeArr') + ALLOCATE(latMidArr(NX,NY), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating latMidArr') + ALLOCATE(latEdgeArr(NX+1,NY+1), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating latEdgeArr') + + ! We could try and get the data from CAM.. but the goal is to make this GC + ! component completely grid independent. So for now, we set to arbitrary + ! values + ! TODO: This needs more refinement. For now, this generates identical + ! State_Grid for all chunks + DO L = BEGCHUNK, ENDCHUNK + lonMidArr = 0.0e+0_f4 + latMidArr = 0.0e+0_f4 + dLonFix = 360.0e+0_fp / REAL(NX,fp) + dLatFix = 180.0e+0_fp / REAL(NY,fp) + DO I = 1,NX + ! Center of box, assuming dateline edge + lonVal = -180.0e+0_fp + (REAL(I-1,fp)*dLonFix) + DO J = 1,NY + ! Center of box, assuming regular cells + latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) + lonMidArr(I,J) = REAL((lonVal + (0.5e+0_fp * dLonFix)) * PI_180, f4) + latMidArr(I,J) = REAL((latVal + (0.5e+0_fp * dLatFix)) * PI_180, f4) + + ! Edges of box, assuming regular cells + lonEdgeArr(I,J) = REAL(lonVal * PI_180, f4) + latEdgeArr(I,J) = REAL(latVal * PI_180, f4) + ENDDO + ! Edges of box, assuming regular cells + lonEdgeArr(I,NY+1) = REAL((lonVal + dLonFix) * PI_180, f4) + latEdgeArr(I,NY+1) = REAL((latVal + dLatFix) * PI_180, f4) + ENDDO + DO J = 1,NY+1 + ! Edges of box, assuming regular cells + latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) + lonEdgeArr(NX+1,J) = REAL((lonVal + dLonFix) * PI_180, f4) + latEdgeArr(NX+1,J) = REAL((latVal) * PI_180, f4) + ENDDO + + CALL SetGridFromCtrEdges( am_I_Root = am_I_Root, & + State_Grid = State_Grid(L), & + lonCtr = lonMidArr, & + latCtr = latMidArr, & + lonEdge = lonEdgeArr, & + latEdge = latEdgeArr, & + RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "SetGridFromCtrEdges"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + CALL Init_Transfer( State_Grid(L), 0, 0 ) + ENDDO + DEALLOCATE(lonMidArr) + DEALLOCATE(latMidArr) + DEALLOCATE(lonEdgeArr) + DEALLOCATE(latEdgeArr) + + + ! Now READ_SIMULATION_MENU + DO I = BEGCHUNK, ENDCHUNK + Input_Opt(I)%ITS_A_CH4_SIM = .False. + Input_Opt(I)%ITS_A_CO2_SIM = .False. + Input_Opt(I)%ITS_A_FULLCHEM_SIM = .True. + Input_Opt(I)%ITS_A_MERCURY_SIM = .False. + Input_Opt(I)%ITS_A_POPS_SIM = .False. + Input_Opt(I)%ITS_A_RnPbBe_SIM = .False. + Input_Opt(I)%ITS_A_TAGO3_SIM = .False. + Input_Opt(I)%ITS_A_TAGCO_SIM = .False. + Input_Opt(I)%ITS_AN_AEROSOL_SIM = .False. + ENDDO + + ! Now READ_ADVECTED_SPECIES_MENU + DO I = BEGCHUNK, ENDCHUNK + Input_Opt(I)%N_Advect = NTracers + IF (Input_Opt(I)%N_Advect.GT.Input_Opt(I)%Max_AdvectSpc) THEN + CALL ENDRUN('Number of tracers exceeds max count') + ENDIF + ! Assign tracer names + DO J = 1, Input_Opt(I)%N_Advect + Input_Opt(I)%AdvectSpc_Name(J) = TRIM(TRACERNAMES(J)) + ENDDO + ! No tagged species + Input_Opt(I)%LSplit = .False. + ENDDO - Input_Opt(i)%Linoz_NLevels = 25 - Input_Opt(i)%Linoz_NLat = 18 - Input_Opt(i)%Linoz_NMonths = 12 - Input_Opt(i)%Linoz_NFields = 7 - Input_Opt(i)%RootCPU = am_I_Root + ! Now READ_TRANSPORT_MENU + DO I = BEGCHUNK, ENDCHUNK + Input_Opt(I)%LTran = .True. + Input_Opt(I)%LFill = .True. + Input_Opt(I)%TPCore_IOrd = 3 + Input_Opt(I)%TPCore_JOrd = 3 + Input_Opt(I)%TPCore_KOrd = 3 + ENDDO - IIPAR = 1 - JJPAR = NCOL(I) - LLPAR = NLEV + ! Now READ_CONVECTION_MENU + ! For now, TMMF + DO I = BEGCHUNK, ENDCHUNK + Input_Opt(I)%LConv = .False. + Input_Opt(I)%LTurb = .False. + Input_Opt(I)%LNLPBL = .False. + ENDDO + + ! Now READ_EMISSIONS_MENU + DO I = BEGCHUNK, ENDCHUNK + Input_Opt(I)%LEmis = .False. + Input_Opt(I)%HCOConfigFile = 'HEMCO_Config.rc' + Input_Opt(I)%LFix_PBL_Bro = .False. + + ! Set surface VMRs - turn this off so that CAM can handle it + Input_Opt(I)%LCH4Emis = .False. + Input_Opt(I)%LCH4SBC = .False. + Input_Opt(I)%LOCSEmis = .False. + Input_Opt(I)%LCFCEmis = .False. + Input_Opt(I)%LClEmis = .False. + Input_Opt(I)%LBrEmis = .False. + Input_Opt(I)%LN2OEmis = .False. + Input_Opt(I)%LBasicEmis = .False. + + ! Set initial conditions + Input_Opt(I)%LSetH2O = .True. + + ! CFC control + Input_Opt(I)%CFCYear = 0 + ENDDO + + ! Now READ_AEROSOL_MENU + DO I = BEGCHUNK, ENDCHUNK + Input_Opt(I)%LSulf = .True. + Input_Opt(I)%LMetalcatSO2 = .True. + Input_Opt(I)%LCarb = .True. + Input_Opt(I)%LBrC = .False. + Input_Opt(I)%LSOA = .True. + Input_Opt(I)%LSVPOA = .False. + Input_Opt(I)%LOMOC = .False. + Input_Opt(I)%LDust = .True. + Input_Opt(I)%LDstUp = .False. + Input_Opt(I)%LSSalt = .True. + Input_Opt(I)%SalA_rEdge_um(1) = 0.01e+0_fp + Input_Opt(I)%SalA_rEdge_um(2) = 0.50e+0_fp + Input_Opt(I)%SalC_rEdge_um(1) = 0.50e+0_fp + Input_Opt(I)%SalC_rEdge_um(2) = 8.00e+0_fp + Input_Opt(I)%LMPOA = .False. + Input_Opt(I)%LGravStrat = .True. + Input_Opt(I)%LSolidPSC = .True. + Input_Opt(I)%LHomNucNAT = .False. + Input_Opt(I)%T_NAT_Supercool = 3.0e+0_fp + Input_Opt(I)%P_Ice_Supersat = 1.2e+0_fp + Input_Opt(I)%LPSCChem = .True. + Input_Opt(I)%LStratOD = .True. + Input_Opt(I)%hvAerNIT = .False. + Input_Opt(I)%hvAerNIT_JNIT = .False. + Input_Opt(I)%hvAerNIT_JNITs = .False. + Input_Opt(I)%JNITChanA = 0e+0_fp + Input_Opt(I)%JNITChanB = 0e+0_fp + ENDDO + + ! Now READ_DEPOSITION_MENU + ! Disable dry/wet dep for now + DO I = BEGCHUNK, ENDCHUNK + Input_Opt(I)%LDryD = .False. + Input_Opt(I)%LWetD = .False. + Input_Opt(I)%CO2_Effect = .False. + Input_Opt(I)%CO2_Level = 390.0_fp + Input_Opt(I)%CO2_Ref = 390.0_fp + ENDDO + ! Now READ_CHEMISTRY_MENU + DO I = BEGCHUNK, ENDCHUNK + Input_Opt(I)%LChem = .True. + Input_Opt(I)%LSChem = .True. + Input_Opt(I)%LLinoz = .True. + Input_Opt(I)%LSynoz = .True. + Input_Opt(I)%LUCX = .True. + Input_Opt(I)%LActiveH2O = .True. + Input_Opt(I)%Use_Online_O3 = .True. + Input_Opt(I)%Use_O3_from_Met = .False. + Input_Opt(I)%Use_TOMS_O3 = .False. + Input_Opt(I)%Gamma_HO2 = 0.2e+0_fp ENDDO + !IF (MasterProc) THEN + ! CALL Read_Input_File( am_I_Root = .True., & + ! Input_Opt = Input_Opt(begchunk), & + ! srcFile = inputGeosPath, & + ! RC = RC ) + !ENDIF + + ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default CALL addfld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) @@ -395,6 +719,46 @@ subroutine chem_timestep_init(phys_state, pbuf2d) end subroutine chem_timestep_init +!=============================================================================== + + subroutine GC_Update_Timesteps(LCHNK,DT) + + use Time_Mod, only : Set_Timesteps + use cam_abortutils, only : endrun + + INTEGER, INTENT(IN) :: LCHNK + REAL(r8), INTENT(IN) :: DT + INTEGER :: DT_MIN + INTEGER, SAVE :: DT_MIN_LAST = -1 + LOGICAL :: am_I_Root + + am_I_Root = (MasterProc .AND. (LCHNK.EQ.BEGCHUNK)) + + DT_MIN = NINT(DT) + + Input_Opt(LCHNK)%TS_CHEM = DT_MIN + Input_Opt(LCHNK)%TS_EMIS = DT_MIN + Input_Opt(LCHNK)%TS_CONV = DT_MIN + Input_Opt(LCHNK)%TS_DYN = DT_MIN + Input_Opt(LCHNK)%TS_RAD = DT_MIN + + ! Only bother updating the module information if there's been a change + IF (DT_MIN .NE. DT_MIN_LAST) THEN + IF (MasterProc) WRITE(iulog,'(a,F7.1,a)') ' --> GC: updating dt to ', DT, ' seconds' + + CALL Set_Timesteps( am_I_Root, & + CHEMISTRY = DT_MIN, & + EMISSION = DT_MIN, & + DYNAMICS = DT_MIN, & + UNIT_CONV = DT_MIN, & + CONVECTION = DT_MIN, & + DIAGNOS = DT_MIN, & + RADIATION = DT_MIN ) + DT_MIN_LAST = DT_MIN + ENDIF + + end subroutine + !=============================================================================== subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) @@ -424,6 +788,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) ! ncol: number of atmospheric columns on this chunk ncol = state%ncol + ! Need to update the timesteps throughout the code + CALL GC_Update_Timesteps(LCHNK,DT) + ! Need to be super careful that the module arrays are updated and correctly ! set @@ -459,7 +826,7 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) REAL(r8), INTENT(IN) :: latvals(:) ! lat in degrees (ncol) REAL(r8), INTENT(IN) :: lonvals(:) ! lon in degrees (ncol) LOGICAL, INTENT(IN) :: mask(:) ! Only initialize where .true. - REAL(r8), INTENT(OUT) :: q(:,:) ! kg tracer/kg dry air (ncol, plev + REAL(r8), INTENT(OUT) :: q(:,:) ! kg tracer/kg dry air (ncol, pver ! Used to initialize tracer fields if desired. ! Will need a simple mapping structure as well as the CAM tracer registration ! routines. @@ -499,10 +866,11 @@ subroutine chem_final ! Finally deallocate state variables IF (ALLOCATED(Input_Opt)) DEALLOCATE(Input_Opt) - IF (ALLOCATED(State_Met)) DEALLOCATE(State_Met) IF (ALLOCATED(State_Chm)) DEALLOCATE(State_Chm) + IF (ALLOCATED(State_Grid)) DEALLOCATE(State_Grid) + IF (ALLOCATED(State_Met)) DEALLOCATE(State_Met) - IF (MasterProc) WRITE(iulog,'(a,3(x,L1))') ' --> DEALLOC CHECK : ', ALLOCATED(Input_Opt), ALLOCATED(State_Met), ALLOCATED(State_Chm) + IF (MasterProc) WRITE(iulog,'(a,4(x,L1))') ' --> DEALLOC CHECK : ', ALLOCATED(Input_Opt), ALLOCATED(State_Chm), ALLOCATED(State_Grid), ALLOCATED(State_Met) RETURN From a039e350196a712edd37f74bf08300f6da585229 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 16:30:14 -0400 Subject: [PATCH 045/239] Feat: Add initialization of Linoz module and passing CHEM_INPUTS (1) Initializing Linoz module (2) Passing CHEM_INPUTS to Input_Opt (3) Remove incorrect overwrite of NTracers --- src/chemistry/pp_geoschem/chemistry.F90 | 201 ++++++++++++++++-------- 1 file changed, 132 insertions(+), 69 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 6cc4926d97..563e5b99e4 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -14,7 +14,7 @@ module chemistry !use mo_chem_utls, only : get_spc_ndx !use chem_mods, only : gas_pcnst, adv_mass !use mo_sim_dat, only: set_sim_dat - use spmd_utils, only : MasterProc + use spmd_utils, only : MasterProc, myCPU=>Iam, nCPUs=>npes use cam_logfile, only : iulog !-------------------------------------------------------------------- @@ -71,6 +71,9 @@ module chemistry ! Location of valid input.geos CHARACTER(LEN=500) :: inputGeosPath + ! Location of chemistry input (for now) + CHARACTER(LEN=500) :: chemInputsDir + ! GEOS-Chem state variables TYPE(OptInput),ALLOCATABLE :: Input_Opt(:) ! Input Options object TYPE(ChmState),ALLOCATABLE :: State_Chm(:) ! Chemistry State object @@ -129,7 +132,6 @@ subroutine chem_register if (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_REGISTER' ! At the moment, we force nadv_chem=200 in the setup file - NTRACERS = 200 DO I = 1, NTRACERSMAX ! TODO: Read input.geos in chem_readnl to get tracernames(1:ntracers) ! TODO: Get all other species properties here from species database @@ -207,7 +209,9 @@ subroutine chem_readnl(nlfile) CHARACTER(LEN=500) :: LINE logical :: menuFound, validSLS + ! Set paths inputGeosPath='/n/scratchlfs/jacob_lab/elundgren/UT/runs/4x5_standard/input.geos.template' + chemInputsDir='/n/holylfs/EXTERNAL_REPOS/GEOS-CHEM/gcgrid/gcdata/ExtData/CHEM_INPUTS/' IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_READNL' @@ -336,6 +340,7 @@ subroutine chem_init(phys_state, pbuf2d) use physics_buffer, only: physics_buffer_desc use cam_history, only: addfld, add_default, horiz_only + use mpishorthand use cam_abortutils, only : endrun use Input_Opt_Mod @@ -352,9 +357,7 @@ subroutine chem_init(phys_state, pbuf2d) !use Time_Mod, only : Set_Begin_Time, Set_End_Time !use Time_Mod, only : Set_Current_Time, Set_DiagB use Transfer_Mod, only : Init_Transfer - - !use CMN_O3_Mod - !use CMN_Size_Mod + use Linoz_Mod, only : Linoz_Read TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) @@ -365,12 +368,14 @@ subroutine chem_init(phys_state, pbuf2d) INTEGER :: NX, NY, NZ INTEGER :: NLEV, I, J, L, RC + INTEGER :: NLINOZ ! Grid setup REAL(fp) :: lonVal, latVal REAL(fp) :: dLonFix, dLatFix REAL(f4), ALLOCATABLE :: lonMidArr(:,:), latMidArr(:,:) REAL(f4), ALLOCATABLE :: lonEdgeArr(:,:), latEdgeArr(:,:) + REAL(r8), ALLOCATABLE :: linozData(:,:,:,:) LOGICAL :: am_I_Root @@ -395,15 +400,14 @@ subroutine chem_init(phys_state, pbuf2d) NZ = NLEV ! This ensures that each process allocates everything needed for its chunks - IF (.NOT.ALLOCATED(Input_Opt)) THEN - ALLOCATE(Input_Opt(BEGCHUNK:ENDCHUNK)) - ALLOCATE(State_Chm(BEGCHUNK:ENDCHUNK)) - ALLOCATE(State_Grid(BEGCHUNK:ENDCHUNK)) - ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK)) - IF (MasterProc) WRITE(iulog,'(a,4(x,L1))') ' --> ALLOC CHECK : ', ALLOCATED(Input_Opt), ALLOCATED(State_Chm), ALLOCATED(State_Grid), ALLOCATED(State_Met) - ENDIF - - WRITE(iulog,'(a,x,L1,2(x,I6))') ' --> SIZE CHECK : ', MasterProc, LBOUND(Input_Opt), UBOUND(Input_Opt) + ALLOCATE(Input_Opt(BEGCHUNK:ENDCHUNK) , STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Input_Opt') + ALLOCATE(State_Chm(BEGCHUNK:ENDCHUNK) , STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Chm') + ALLOCATE(State_Grid(BEGCHUNK:ENDCHUNK), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Grid') + ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK) , STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Met') DO I = BEGCHUNK, ENDCHUNK @@ -443,61 +447,41 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - ! Note - this is called AFTER chem_readnl, after X, and after - ! every constituent has had its initial conditions read. Any - ! constituent which is not found in the CAM restart file will - ! then have already had a call to chem_implements_cnst, and will - ! have then had a call to chem_init_cnst to set a default VMR - ! Call the routine GC_Allocate_All (located in module file - ! GeosCore/gc_environment_mod.F90) to allocate all lat/lon - ! allocatable arrays used by GEOS-Chem. - CALL GC_Allocate_All ( am_I_Root = am_I_Root, & - Input_Opt = Input_Opt(I), & - State_Grid = State_Grid(I), & - value_I_Lo = 1, & - value_J_Lo = 1, & - value_I_Hi = NX, & - value_J_Hi = NY, & - value_IM = NX, & - value_JM = NY, & - value_LM = NZ, & - value_IM_WORLD = NX, & - value_JM_WORLD = NY, & - value_LM_WORLD = NZ, & - value_LLSTRAT = 59, & !TMMF - RC = RC ) + ! Set default values + CALL Set_Input_Opt( am_I_Root, Input_Opt(I), RC ) IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "GC_Allocate_All"!' + ErrMsg = 'Error encountered within call to "Set_Input_Opt"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ! Each Input_Opt object should be indexed independently, but + ! for now, we can just associate all of them with the same CPU + Input_Opt(I)%myCPU = myCPU + ENDDO ! TODO: Mimic GEOS-Chem's reading of input options + !IF (MasterProc) THEN + ! CALL Read_Input_File( am_I_Root = .True., & + ! Input_Opt = Input_Opt(BEGCHUNK), & + ! srcFile = inputGeosPath, & + ! RC = RC ) + !ENDIF + !CALL + + ! For now just hard-code it + ! First setup directories DO I = BEGCHUNK, ENDCHUNK - ! Start by setting some dummy timesteps - CALL GC_Update_Timesteps(I,300.0E+0_r8) - ! Simulation menu - ! Ignore the data directories for now - Input_Opt(i)%NYMDb = 20000101 - Input_Opt(i)%NHMSb = 000000 - Input_Opt(i)%NYMDe = 20010101 - Input_Opt(i)%NHMSe = 000000 + Input_Opt(I)%Chem_Inputs_Dir = TRIM(chemInputsDir) ENDDO - ! Set the times held by "time_mod" - CALL Accept_External_Date_Time( am_I_Root = MasterProc, & - value_NYMDb = Input_Opt(BEGCHUNK)%NYMDb, & - value_NHMSb = Input_Opt(BEGCHUNK)%NHMSb, & - value_NYMDe = Input_Opt(BEGCHUNK)%NYMDe, & - value_NHMSe = Input_Opt(BEGCHUNK)%NHMSe, & - value_NYMD = Input_Opt(BEGCHUNK)%NYMDb, & - value_NHMS = Input_Opt(BEGCHUNK)%NHMSb, & - RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Accept_External_Date_Time"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + DO I = BEGCHUNK, ENDCHUNK + ! Simulation menu + Input_Opt(I)%NYMDb = 20000101 + Input_Opt(I)%NHMSb = 000000 + Input_Opt(I)%NYMDe = 20010101 + Input_Opt(I)%NHMSe = 000000 + ENDDO ! Note: The following calculations do not setup the gridcell areas. ! In any case, we will need to be constantly updating this grid @@ -545,7 +529,7 @@ subroutine chem_init(phys_state, pbuf2d) latEdgeArr(NX+1,J) = REAL((latVal) * PI_180, f4) ENDDO - CALL SetGridFromCtrEdges( am_I_Root = am_I_Root, & + CALL SetGridFromCtrEdges( am_I_Root = MasterProc, & State_Grid = State_Grid(L), & lonCtr = lonMidArr, & latCtr = latMidArr, & @@ -682,18 +666,96 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt(I)%LUCX = .True. Input_Opt(I)%LActiveH2O = .True. Input_Opt(I)%Use_Online_O3 = .True. - Input_Opt(I)%Use_O3_from_Met = .False. + ! Expect to get total overhead ozone, although it shouldn not + ! make too much of a difference since we want to use "full-UCX" + Input_Opt(I)%Use_O3_from_Met = .True. Input_Opt(I)%Use_TOMS_O3 = .False. Input_Opt(I)%Gamma_HO2 = 0.2e+0_fp ENDDO - !IF (MasterProc) THEN - ! CALL Read_Input_File( am_I_Root = .True., & - ! Input_Opt = Input_Opt(begchunk), & - ! srcFile = inputGeosPath, & - ! RC = RC ) - !ENDIF + ! Read in data for Linoz. All CPUs allocate one array to hold the data. Only + ! the root CPU reads in the data; then we copy it out to a temporary array, + ! broadcast to all other CPUs, and finally duplicate the data into every + ! copy of Input_Opt + IF (Input_Opt(BEGCHUNK)%LLinoz) THEN + ! Allocate array for broadcast + nLinoz = Input_Opt(BEGCHUNK)%Linoz_NLevels * & + Input_Opt(BEGCHUNK)%Linoz_NLat * & + Input_Opt(BEGCHUNK)%Linoz_NMonths * & + Input_Opt(BEGCHUNK)%Linoz_NFields + ALLOCATE( linozData( Input_Opt(BEGCHUNK)%Linoz_NLevels, & + Input_Opt(BEGCHUNK)%Linoz_NLat, & + Input_Opt(BEGCHUNK)%Linoz_NMonths, & + Input_Opt(BEGCHUNK)%Linoz_NFields ), STAT=IERR) + IF (IERR.NE.0) CALL ENDRUN('Failure while allocating linozData') + linozData = 0.0e+0_r8 + + IF ( MasterProc ) THEN + ! Read data in to Input_Opt%Linoz_TParm + CALL Linoz_Read( MasterProc, Input_Opt(BEGCHUNK), RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Linoz_Read"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ! Copy the data to a temporary array + linozData = REAL(Input_Opt(BEGCHUNK)%LINOZ_TPARM,r8) + ENDIF +#if defined( SPMD ) + CALL MPIBCAST(linozData, nLinoz, MPIR8, 0, MPICOM ) +#endif + ! Now copy the data to all other Input_Opt copies + DO I=BEGCHUNK,ENDCHUNK + Input_Opt(I)%LINOZ_TPARM = REAL(linozData,fp) + ENDDO + DEALLOCATE(linozData) + ENDIF + + ! Note - this is called AFTER chem_readnl, after X, and after + ! every constituent has had its initial conditions read. Any + ! constituent which is not found in the CAM restart file will + ! then have already had a call to chem_implements_cnst, and will + ! have then had a call to chem_init_cnst to set a default VMR + ! Call the routine GC_Allocate_All (located in module file + ! GeosCore/gc_environment_mod.F90) to allocate all lat/lon + ! allocatable arrays used by GEOS-Chem. + CALL GC_Allocate_All ( am_I_Root = MasterProc, & + Input_Opt = Input_Opt(BEGCHUNK), & + State_Grid = State_Grid(BEGCHUNK), & + value_I_Lo = 1, & + value_J_Lo = 1, & + value_I_Hi = NX, & + value_J_Hi = NY, & + value_IM = NX, & + value_JM = NY, & + value_LM = NZ, & + value_IM_WORLD = NX, & + value_JM_WORLD = NY, & + value_LM_WORLD = NZ, & + value_LLSTRAT = 59, & !TMMF + RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "GC_Allocate_All"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Set the times held by "time_mod" + CALL Accept_External_Date_Time( am_I_Root = MasterProc, & + value_NYMDb = Input_Opt(BEGCHUNK)%NYMDb, & + value_NHMSb = Input_Opt(BEGCHUNK)%NHMSb, & + value_NYMDe = Input_Opt(BEGCHUNK)%NYMDe, & + value_NHMSe = Input_Opt(BEGCHUNK)%NHMSe, & + value_NYMD = Input_Opt(BEGCHUNK)%NYMDb, & + value_NHMS = Input_Opt(BEGCHUNK)%NHMSb, & + RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Accept_External_Date_Time"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + DO I = BEGCHUNK, ENDCHUNK + ! Start by setting some dummy timesteps + CALL GC_Update_Timesteps(I,300.0E+0_r8) + ENDDO ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default @@ -851,6 +913,7 @@ end subroutine chem_init_cnst subroutine chem_final USE Input_Opt_Mod, ONLY : CLEANUP_INPUT_OPT + Use UCX_Mod, ONLY : CLEANUP_UCX INTEGER :: I, RC LOGICAL :: am_I_Root @@ -858,10 +921,10 @@ subroutine chem_final ! Finalize GEOS-Chem IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_FINAL' - ! Loop over each chunk + ! Loop over each chunk and cleanup the independent variables DO I = BEGCHUNK, ENDCHUNK am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) - CALL CLEANUP_INPUT_OPT( am_I_Root, Input_Opt(i), RC ) + CALL CLEANUP_INPUT_OPT( am_I_Root, Input_Opt(I), RC ) ENDDO ! Finally deallocate state variables From de1ef340644afe7ffd3d6cda69756a8843b74e52 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 16:31:56 -0400 Subject: [PATCH 046/239] Feat: Initialize and cleanup State_Chm and State_Met --- src/chemistry/pp_geoschem/chemistry.F90 | 45 ++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 563e5b99e4..896e4087a4 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -423,7 +423,7 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt(I)%Linoz_NLat = 18 Input_Opt(I)%Linoz_NMonths = 12 Input_Opt(I)%Linoz_NFields = 7 - Input_Opt(I)%RootCPU = am_I_Root + Input_Opt(I)%RootCPU = MasterProc ! Initialize fields of the Grid State object CALL Init_State_Grid( am_I_Root = am_I_Root, & @@ -757,6 +757,40 @@ subroutine chem_init(phys_state, pbuf2d) CALL GC_Update_Timesteps(I,300.0E+0_r8) ENDDO + ! Initialize the state objects for each chunk + DO I = BEGCHUNK, ENDCHUNK + ! This reproduces GC_Init_Stateobj without the State_Diag object + am_I_Root = (MasterProc .AND. (I == BEGCHUNK)) + CALL Init_State_Met( am_I_Root, State_Grid(I), State_Met(I), RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_State_Met"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + CALL Init_State_Chm( am_I_Root, Input_Opt(I), & + State_Chm(I), State_Grid(I), & + RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_State_Chm"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Now replicate GC_Init_Extra... + + ! Start with v/v dry (CAM standard) + State_Chm(I)%Spc_Units = 'v/v dry' + ENDDO + ! Init_FJX.. + ! Init_Pressure... + ! Init_PBL_Mix... + ! Init_Chemistry... + ! Init_TOMS... + ! Emissions_Init... + ! Init_UCX... + ! Convert_Spc_Units... + + + ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default CALL addfld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) @@ -792,9 +826,6 @@ subroutine GC_Update_Timesteps(LCHNK,DT) REAL(r8), INTENT(IN) :: DT INTEGER :: DT_MIN INTEGER, SAVE :: DT_MIN_LAST = -1 - LOGICAL :: am_I_Root - - am_I_Root = (MasterProc .AND. (LCHNK.EQ.BEGCHUNK)) DT_MIN = NINT(DT) @@ -808,7 +839,7 @@ subroutine GC_Update_Timesteps(LCHNK,DT) IF (DT_MIN .NE. DT_MIN_LAST) THEN IF (MasterProc) WRITE(iulog,'(a,F7.1,a)') ' --> GC: updating dt to ', DT, ' seconds' - CALL Set_Timesteps( am_I_Root, & + CALL Set_Timesteps( MasterProc, & CHEMISTRY = DT_MIN, & EMISSION = DT_MIN, & DYNAMICS = DT_MIN, & @@ -913,6 +944,8 @@ end subroutine chem_init_cnst subroutine chem_final USE Input_Opt_Mod, ONLY : CLEANUP_INPUT_OPT + USE State_Chm_Mod, ONLY : CLEANUP_STATE_CHM + USE State_Met_Mod, ONLY : CLEANUP_STATE_MET Use UCX_Mod, ONLY : CLEANUP_UCX INTEGER :: I, RC @@ -925,6 +958,8 @@ subroutine chem_final DO I = BEGCHUNK, ENDCHUNK am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) CALL CLEANUP_INPUT_OPT( am_I_Root, Input_Opt(I), RC ) + CALL CLEANUP_STATE_MET( am_I_Root, State_Met(I), RC ) + CALL CLEANUP_STATE_CHM( am_I_Root, State_Chm(I), RC ) ENDDO ! Finally deallocate state variables From 42557e13c15686aea509010a5b43e5aa6ff22176 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 16:34:39 -0400 Subject: [PATCH 047/239] Feat: Initialize Drydep_Mod (1) Initialize Drydep_Mod (2) Update .exclude file to include GeosCore/drydep_mod.F --- src/chemistry/pp_geoschem/.exclude | 1 - src/chemistry/pp_geoschem/chemistry.F90 | 478 ++++++++++++------------ 2 files changed, 231 insertions(+), 248 deletions(-) diff --git a/src/chemistry/pp_geoschem/.exclude b/src/chemistry/pp_geoschem/.exclude index 2f725c1ef5..31b2db522f 100644 --- a/src/chemistry/pp_geoschem/.exclude +++ b/src/chemistry/pp_geoschem/.exclude @@ -1,6 +1,5 @@ regrid_a2a_mod.F90 transport_mod.F -drydep_mod.F tpcore_window_mod.F90 tpcore_bc_mod.F90 tpcore_fvdas_mod.F90 diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 896e4087a4..f8e9f720fc 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -75,7 +75,7 @@ module chemistry CHARACTER(LEN=500) :: chemInputsDir ! GEOS-Chem state variables - TYPE(OptInput),ALLOCATABLE :: Input_Opt(:) ! Input Options object + TYPE(OptInput) :: Input_Opt ! Input Options object TYPE(ChmState),ALLOCATABLE :: State_Chm(:) ! Chemistry State object TYPE(GrdState),ALLOCATABLE :: State_Grid(:) ! Grid State object TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object @@ -359,6 +359,8 @@ subroutine chem_init(phys_state, pbuf2d) use Transfer_Mod, only : Init_Transfer use Linoz_Mod, only : Linoz_Read + use Drydep_Mod, only : Init_Drydep + TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) @@ -393,6 +395,8 @@ subroutine chem_init(phys_state, pbuf2d) ! NLEV: number of vertical levels NLEV = PVER + write(iulog,'(2(a,x,I6,x))') 'chem_init called on PE ', myCPU, ' of ', nCPUs + ! The GEOS-Chem grids on every "chunk" will all be the same size, to avoid ! the possibility of having differently-sized chunks NX = 1 @@ -400,8 +404,6 @@ subroutine chem_init(phys_state, pbuf2d) NZ = NLEV ! This ensures that each process allocates everything needed for its chunks - ALLOCATE(Input_Opt(BEGCHUNK:ENDCHUNK) , STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Input_Opt') ALLOCATE(State_Chm(BEGCHUNK:ENDCHUNK) , STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Chm') ALLOCATE(State_Grid(BEGCHUNK:ENDCHUNK), STAT=IERR) @@ -409,21 +411,23 @@ subroutine chem_init(phys_state, pbuf2d) ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK) , STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Met') - DO I = BEGCHUNK, ENDCHUNK - - ! Only treat the first chunk as the "root" CPU - am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) + am_I_Root = MasterProc ! Set some basic flags - Input_Opt(I)%Max_BPCH_Diag = 1000 - Input_Opt(I)%Max_AdvectSpc = 500 - Input_Opt(I)%Max_Families = 250 + Input_Opt%Max_BPCH_Diag = 1000 + Input_Opt%Max_AdvectSpc = 500 + Input_Opt%Max_Families = 250 + + Input_Opt%Linoz_NLevels = 25 + Input_Opt%Linoz_NLat = 18 + Input_Opt%Linoz_NMonths = 12 + Input_Opt%Linoz_NFields = 7 + Input_Opt%RootCPU = MasterProc - Input_Opt(I)%Linoz_NLevels = 25 - Input_Opt(I)%Linoz_NLat = 18 - Input_Opt(I)%Linoz_NMonths = 12 - Input_Opt(I)%Linoz_NFields = 7 - Input_Opt(I)%RootCPU = MasterProc + DO I = BEGCHUNK, ENDCHUNK + + ! Only treat the first chunk as the "root" + am_I_Root = ((I.EQ.BEGCHUNK) .and. MasterProc) ! Initialize fields of the Grid State object CALL Init_State_Grid( am_I_Root = am_I_Root, & @@ -439,7 +443,7 @@ subroutine chem_init(phys_state, pbuf2d) State_Grid(I)%NZ = NZ ! Initialize GEOS-Chem horizontal grid structure CALL GC_Init_Grid( am_I_Root = am_I_Root, & - Input_Opt = Input_Opt(I), & + Input_Opt = Input_Opt, & State_Grid = State_Grid(I), & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN @@ -447,18 +451,36 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - ! Set default values - CALL Set_Input_Opt( am_I_Root, Input_Opt(I), RC ) + ENDDO + + ! Note - this is called AFTER chem_readnl, after X, and after + ! every constituent has had its initial conditions read. Any + ! constituent which is not found in the CAM restart file will + ! then have already had a call to chem_implements_cnst, and will + ! have then had a call to chem_init_cnst to set a default VMR + ! Call the routine GC_Allocate_All (located in module file + ! GeosCore/gc_environment_mod.F90) to allocate all lat/lon + ! allocatable arrays used by GEOS-Chem. + CALL GC_Allocate_All ( am_I_Root = MasterProc, & + Input_Opt = Input_Opt, & + State_Grid = State_Grid(BEGCHUNK), & + value_I_Lo = 1, & + value_J_Lo = 1, & + value_I_Hi = NX, & + value_J_Hi = NY, & + value_IM = NX, & + value_JM = NY, & + value_LM = NZ, & + value_IM_WORLD = NX, & + value_JM_WORLD = NY, & + value_LM_WORLD = NZ, & + value_LLSTRAT = 59, & !TMMF + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered within call to "Set_Input_Opt"!' + ErrMsg = 'Error encountered in "GC_Allocate_All"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - ! Each Input_Opt object should be indexed independently, but - ! for now, we can just associate all of them with the same CPU - Input_Opt(I)%myCPU = myCPU - - ENDDO ! TODO: Mimic GEOS-Chem's reading of input options !IF (MasterProc) THEN @@ -471,17 +493,158 @@ subroutine chem_init(phys_state, pbuf2d) ! For now just hard-code it ! First setup directories - DO I = BEGCHUNK, ENDCHUNK - Input_Opt(I)%Chem_Inputs_Dir = TRIM(chemInputsDir) - ENDDO + Input_Opt%Chem_Inputs_Dir = TRIM(chemInputsDir) - DO I = BEGCHUNK, ENDCHUNK ! Simulation menu - Input_Opt(I)%NYMDb = 20000101 - Input_Opt(I)%NHMSb = 000000 - Input_Opt(I)%NYMDe = 20010101 - Input_Opt(I)%NHMSe = 000000 + Input_Opt%NYMDb = 20000101 + Input_Opt%NHMSb = 000000 + Input_Opt%NYMDe = 20010101 + Input_Opt%NHMSe = 000000 + + ! Now READ_SIMULATION_MENU + Input_Opt%ITS_A_CH4_SIM = .False. + Input_Opt%ITS_A_CO2_SIM = .False. + Input_Opt%ITS_A_FULLCHEM_SIM = .True. + Input_Opt%ITS_A_MERCURY_SIM = .False. + Input_Opt%ITS_A_POPS_SIM = .False. + Input_Opt%ITS_A_RnPbBe_SIM = .False. + Input_Opt%ITS_A_TAGO3_SIM = .False. + Input_Opt%ITS_A_TAGCO_SIM = .False. + Input_Opt%ITS_AN_AEROSOL_SIM = .False. + + ! Now READ_ADVECTED_SPECIES_MENU + Input_Opt%N_Advect = NTracers + IF (Input_Opt%N_Advect.GT.Input_Opt%Max_AdvectSpc) THEN + CALL ENDRUN('Number of tracers exceeds max count') + ENDIF + ! Assign tracer names + DO J = 1, Input_Opt%N_Advect + Input_Opt%AdvectSpc_Name(J) = TRIM(TRACERNAMES(J)) ENDDO + ! No tagged species + Input_Opt%LSplit = .False. + + ! Now READ_TRANSPORT_MENU + Input_Opt%LTran = .True. + Input_Opt%LFill = .True. + Input_Opt%TPCore_IOrd = 3 + Input_Opt%TPCore_JOrd = 3 + Input_Opt%TPCore_KOrd = 3 + + ! Now READ_CONVECTION_MENU + ! For now, TMMF + Input_Opt%LConv = .False. + Input_Opt%LTurb = .False. + Input_Opt%LNLPBL = .False. + + ! Now READ_EMISSIONS_MENU + Input_Opt%LEmis = .False. + Input_Opt%HCOConfigFile = 'HEMCO_Config.rc' + Input_Opt%LFix_PBL_Bro = .False. + + ! Set surface VMRs - turn this off so that CAM can handle it + Input_Opt%LCH4Emis = .False. + Input_Opt%LCH4SBC = .False. + Input_Opt%LOCSEmis = .False. + Input_Opt%LCFCEmis = .False. + Input_Opt%LClEmis = .False. + Input_Opt%LBrEmis = .False. + Input_Opt%LN2OEmis = .False. + Input_Opt%LBasicEmis = .False. + + ! Set initial conditions + Input_Opt%LSetH2O = .True. + + ! CFC control + Input_Opt%CFCYear = 0 + + ! Now READ_AEROSOL_MENU + Input_Opt%LSulf = .True. + Input_Opt%LMetalcatSO2 = .True. + Input_Opt%LCarb = .True. + Input_Opt%LBrC = .False. + Input_Opt%LSOA = .True. + Input_Opt%LSVPOA = .False. + Input_Opt%LOMOC = .False. + Input_Opt%LDust = .True. + Input_Opt%LDstUp = .False. + Input_Opt%LSSalt = .True. + Input_Opt%SalA_rEdge_um(1) = 0.01e+0_fp + Input_Opt%SalA_rEdge_um(2) = 0.50e+0_fp + Input_Opt%SalC_rEdge_um(1) = 0.50e+0_fp + Input_Opt%SalC_rEdge_um(2) = 8.00e+0_fp + Input_Opt%LMPOA = .False. + Input_Opt%LGravStrat = .True. + Input_Opt%LSolidPSC = .True. + Input_Opt%LHomNucNAT = .False. + Input_Opt%T_NAT_Supercool = 3.0e+0_fp + Input_Opt%P_Ice_Supersat = 1.2e+0_fp + Input_Opt%LPSCChem = .True. + Input_Opt%LStratOD = .True. + Input_Opt%hvAerNIT = .False. + Input_Opt%hvAerNIT_JNIT = .False. + Input_Opt%hvAerNIT_JNITs = .False. + Input_Opt%JNITChanA = 0e+0_fp + Input_Opt%JNITChanB = 0e+0_fp + + ! Now READ_DEPOSITION_MENU + ! Disable dry/wet dep for now + Input_Opt%LDryD = .False. + Input_Opt%LWetD = .False. + Input_Opt%CO2_Effect = .False. + Input_Opt%CO2_Level = 390.0_fp + Input_Opt%CO2_Ref = 390.0_fp + + ! Now READ_CHEMISTRY_MENU + Input_Opt%LChem = .True. + Input_Opt%LSChem = .True. + Input_Opt%LLinoz = .True. + Input_Opt%LSynoz = .True. + Input_Opt%LUCX = .True. + Input_Opt%LActiveH2O = .True. + Input_Opt%Use_Online_O3 = .True. + ! Expect to get total overhead ozone, although it shouldn not + ! make too much of a difference since we want to use "full-UCX" + Input_Opt%Use_O3_from_Met = .True. + Input_Opt%Use_TOMS_O3 = .False. + Input_Opt%Gamma_HO2 = 0.2e+0_fp + + ! Read in data for Linoz. All CPUs allocate one array to hold the data. Only + ! the root CPU reads in the data; then we copy it out to a temporary array, + ! broadcast to all other CPUs, and finally duplicate the data into every + ! copy of Input_Opt + IF (Input_Opt%LLinoz) THEN + ! Allocate array for broadcast + nLinoz = Input_Opt%Linoz_NLevels * & + Input_Opt%Linoz_NLat * & + Input_Opt%Linoz_NMonths * & + Input_Opt%Linoz_NFields + ALLOCATE( linozData( Input_Opt%Linoz_NLevels, & + Input_Opt%Linoz_NLat, & + Input_Opt%Linoz_NMonths, & + Input_Opt%Linoz_NFields ), STAT=IERR) + IF (IERR.NE.0) CALL ENDRUN('Failure while allocating linozData') + linozData = 0.0e+0_r8 + + IF ( MasterProc ) THEN + ! Read data in to Input_Opt%Linoz_TParm + CALL Linoz_Read( MasterProc, Input_Opt, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Linoz_Read"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ! Copy the data to a temporary array + linozData = REAL(Input_Opt%LINOZ_TPARM,r8) + ENDIF +#if defined( SPMD ) + CALL MPIBCAST(linozData, nLinoz, MPIR8, 0, MPICOM ) +#endif + IF ( .NOT. MasterProc ) THEN + Input_Opt%LINOZ_TPARM = REAL(linozData,fp) + ENDIF + DEALLOCATE(linozData) + ENDIF + ! Note: The following calculations do not setup the gridcell areas. ! In any case, we will need to be constantly updating this grid @@ -549,213 +712,22 @@ subroutine chem_init(phys_state, pbuf2d) DEALLOCATE(latEdgeArr) - ! Now READ_SIMULATION_MENU - DO I = BEGCHUNK, ENDCHUNK - Input_Opt(I)%ITS_A_CH4_SIM = .False. - Input_Opt(I)%ITS_A_CO2_SIM = .False. - Input_Opt(I)%ITS_A_FULLCHEM_SIM = .True. - Input_Opt(I)%ITS_A_MERCURY_SIM = .False. - Input_Opt(I)%ITS_A_POPS_SIM = .False. - Input_Opt(I)%ITS_A_RnPbBe_SIM = .False. - Input_Opt(I)%ITS_A_TAGO3_SIM = .False. - Input_Opt(I)%ITS_A_TAGCO_SIM = .False. - Input_Opt(I)%ITS_AN_AEROSOL_SIM = .False. - ENDDO - - ! Now READ_ADVECTED_SPECIES_MENU - DO I = BEGCHUNK, ENDCHUNK - Input_Opt(I)%N_Advect = NTracers - IF (Input_Opt(I)%N_Advect.GT.Input_Opt(I)%Max_AdvectSpc) THEN - CALL ENDRUN('Number of tracers exceeds max count') - ENDIF - ! Assign tracer names - DO J = 1, Input_Opt(I)%N_Advect - Input_Opt(I)%AdvectSpc_Name(J) = TRIM(TRACERNAMES(J)) - ENDDO - ! No tagged species - Input_Opt(I)%LSplit = .False. - ENDDO - - ! Now READ_TRANSPORT_MENU - DO I = BEGCHUNK, ENDCHUNK - Input_Opt(I)%LTran = .True. - Input_Opt(I)%LFill = .True. - Input_Opt(I)%TPCore_IOrd = 3 - Input_Opt(I)%TPCore_JOrd = 3 - Input_Opt(I)%TPCore_KOrd = 3 - ENDDO - - ! Now READ_CONVECTION_MENU - ! For now, TMMF - DO I = BEGCHUNK, ENDCHUNK - Input_Opt(I)%LConv = .False. - Input_Opt(I)%LTurb = .False. - Input_Opt(I)%LNLPBL = .False. - ENDDO - - ! Now READ_EMISSIONS_MENU - DO I = BEGCHUNK, ENDCHUNK - Input_Opt(I)%LEmis = .False. - Input_Opt(I)%HCOConfigFile = 'HEMCO_Config.rc' - Input_Opt(I)%LFix_PBL_Bro = .False. - - ! Set surface VMRs - turn this off so that CAM can handle it - Input_Opt(I)%LCH4Emis = .False. - Input_Opt(I)%LCH4SBC = .False. - Input_Opt(I)%LOCSEmis = .False. - Input_Opt(I)%LCFCEmis = .False. - Input_Opt(I)%LClEmis = .False. - Input_Opt(I)%LBrEmis = .False. - Input_Opt(I)%LN2OEmis = .False. - Input_Opt(I)%LBasicEmis = .False. - - ! Set initial conditions - Input_Opt(I)%LSetH2O = .True. - - ! CFC control - Input_Opt(I)%CFCYear = 0 - ENDDO - - ! Now READ_AEROSOL_MENU - DO I = BEGCHUNK, ENDCHUNK - Input_Opt(I)%LSulf = .True. - Input_Opt(I)%LMetalcatSO2 = .True. - Input_Opt(I)%LCarb = .True. - Input_Opt(I)%LBrC = .False. - Input_Opt(I)%LSOA = .True. - Input_Opt(I)%LSVPOA = .False. - Input_Opt(I)%LOMOC = .False. - Input_Opt(I)%LDust = .True. - Input_Opt(I)%LDstUp = .False. - Input_Opt(I)%LSSalt = .True. - Input_Opt(I)%SalA_rEdge_um(1) = 0.01e+0_fp - Input_Opt(I)%SalA_rEdge_um(2) = 0.50e+0_fp - Input_Opt(I)%SalC_rEdge_um(1) = 0.50e+0_fp - Input_Opt(I)%SalC_rEdge_um(2) = 8.00e+0_fp - Input_Opt(I)%LMPOA = .False. - Input_Opt(I)%LGravStrat = .True. - Input_Opt(I)%LSolidPSC = .True. - Input_Opt(I)%LHomNucNAT = .False. - Input_Opt(I)%T_NAT_Supercool = 3.0e+0_fp - Input_Opt(I)%P_Ice_Supersat = 1.2e+0_fp - Input_Opt(I)%LPSCChem = .True. - Input_Opt(I)%LStratOD = .True. - Input_Opt(I)%hvAerNIT = .False. - Input_Opt(I)%hvAerNIT_JNIT = .False. - Input_Opt(I)%hvAerNIT_JNITs = .False. - Input_Opt(I)%JNITChanA = 0e+0_fp - Input_Opt(I)%JNITChanB = 0e+0_fp - ENDDO - - ! Now READ_DEPOSITION_MENU - ! Disable dry/wet dep for now - DO I = BEGCHUNK, ENDCHUNK - Input_Opt(I)%LDryD = .False. - Input_Opt(I)%LWetD = .False. - Input_Opt(I)%CO2_Effect = .False. - Input_Opt(I)%CO2_Level = 390.0_fp - Input_Opt(I)%CO2_Ref = 390.0_fp - ENDDO - - ! Now READ_CHEMISTRY_MENU - DO I = BEGCHUNK, ENDCHUNK - Input_Opt(I)%LChem = .True. - Input_Opt(I)%LSChem = .True. - Input_Opt(I)%LLinoz = .True. - Input_Opt(I)%LSynoz = .True. - Input_Opt(I)%LUCX = .True. - Input_Opt(I)%LActiveH2O = .True. - Input_Opt(I)%Use_Online_O3 = .True. - ! Expect to get total overhead ozone, although it shouldn not - ! make too much of a difference since we want to use "full-UCX" - Input_Opt(I)%Use_O3_from_Met = .True. - Input_Opt(I)%Use_TOMS_O3 = .False. - Input_Opt(I)%Gamma_HO2 = 0.2e+0_fp - ENDDO - - ! Read in data for Linoz. All CPUs allocate one array to hold the data. Only - ! the root CPU reads in the data; then we copy it out to a temporary array, - ! broadcast to all other CPUs, and finally duplicate the data into every - ! copy of Input_Opt - IF (Input_Opt(BEGCHUNK)%LLinoz) THEN - ! Allocate array for broadcast - nLinoz = Input_Opt(BEGCHUNK)%Linoz_NLevels * & - Input_Opt(BEGCHUNK)%Linoz_NLat * & - Input_Opt(BEGCHUNK)%Linoz_NMonths * & - Input_Opt(BEGCHUNK)%Linoz_NFields - ALLOCATE( linozData( Input_Opt(BEGCHUNK)%Linoz_NLevels, & - Input_Opt(BEGCHUNK)%Linoz_NLat, & - Input_Opt(BEGCHUNK)%Linoz_NMonths, & - Input_Opt(BEGCHUNK)%Linoz_NFields ), STAT=IERR) - IF (IERR.NE.0) CALL ENDRUN('Failure while allocating linozData') - linozData = 0.0e+0_r8 - - IF ( MasterProc ) THEN - ! Read data in to Input_Opt%Linoz_TParm - CALL Linoz_Read( MasterProc, Input_Opt(BEGCHUNK), RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Linoz_Read"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ! Copy the data to a temporary array - linozData = REAL(Input_Opt(BEGCHUNK)%LINOZ_TPARM,r8) - ENDIF -#if defined( SPMD ) - CALL MPIBCAST(linozData, nLinoz, MPIR8, 0, MPICOM ) -#endif - ! Now copy the data to all other Input_Opt copies - DO I=BEGCHUNK,ENDCHUNK - Input_Opt(I)%LINOZ_TPARM = REAL(linozData,fp) - ENDDO - DEALLOCATE(linozData) - ENDIF - - ! Note - this is called AFTER chem_readnl, after X, and after - ! every constituent has had its initial conditions read. Any - ! constituent which is not found in the CAM restart file will - ! then have already had a call to chem_implements_cnst, and will - ! have then had a call to chem_init_cnst to set a default VMR - ! Call the routine GC_Allocate_All (located in module file - ! GeosCore/gc_environment_mod.F90) to allocate all lat/lon - ! allocatable arrays used by GEOS-Chem. - CALL GC_Allocate_All ( am_I_Root = MasterProc, & - Input_Opt = Input_Opt(BEGCHUNK), & - State_Grid = State_Grid(BEGCHUNK), & - value_I_Lo = 1, & - value_J_Lo = 1, & - value_I_Hi = NX, & - value_J_Hi = NY, & - value_IM = NX, & - value_JM = NY, & - value_LM = NZ, & - value_IM_WORLD = NX, & - value_JM_WORLD = NY, & - value_LM_WORLD = NZ, & - value_LLSTRAT = 59, & !TMMF - RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "GC_Allocate_All"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ! Set the times held by "time_mod" CALL Accept_External_Date_Time( am_I_Root = MasterProc, & - value_NYMDb = Input_Opt(BEGCHUNK)%NYMDb, & - value_NHMSb = Input_Opt(BEGCHUNK)%NHMSb, & - value_NYMDe = Input_Opt(BEGCHUNK)%NYMDe, & - value_NHMSe = Input_Opt(BEGCHUNK)%NHMSe, & - value_NYMD = Input_Opt(BEGCHUNK)%NYMDb, & - value_NHMS = Input_Opt(BEGCHUNK)%NHMSb, & + value_NYMDb = Input_Opt%NYMDb, & + value_NHMSb = Input_Opt%NHMSb, & + value_NYMDe = Input_Opt%NYMDe, & + value_NHMSe = Input_Opt%NHMSe, & + value_NYMD = Input_Opt%NYMDb, & + value_NHMS = Input_Opt%NHMSb, & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Accept_External_Date_Time"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - DO I = BEGCHUNK, ENDCHUNK ! Start by setting some dummy timesteps - CALL GC_Update_Timesteps(I,300.0E+0_r8) - ENDDO + CALL GC_Update_Timesteps(300.0E+0_r8) ! Initialize the state objects for each chunk DO I = BEGCHUNK, ENDCHUNK @@ -767,7 +739,7 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - CALL Init_State_Chm( am_I_Root, Input_Opt(I), & + CALL Init_State_Chm( am_I_Root, Input_Opt, & State_Chm(I), State_Grid(I), & RC ) IF ( RC /= GC_SUCCESS ) THEN @@ -775,11 +747,21 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - ! Now replicate GC_Init_Extra... - ! Start with v/v dry (CAM standard) State_Chm(I)%Spc_Units = 'v/v dry' ENDDO + + ! Now replicate GC_Init_Extra + IF ( Input_Opt%LDryD) THEN + CALL Init_Drydep( MasterProc, Input_Opt, & + State_Chm(BEGCHUNK), & + State_Grid(BEGCHUNK), RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Drydep"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF + ! Init_FJX.. ! Init_Pressure... ! Init_PBL_Mix... @@ -817,23 +799,22 @@ end subroutine chem_timestep_init !=============================================================================== - subroutine GC_Update_Timesteps(LCHNK,DT) + subroutine GC_Update_Timesteps(DT) use Time_Mod, only : Set_Timesteps use cam_abortutils, only : endrun - INTEGER, INTENT(IN) :: LCHNK REAL(r8), INTENT(IN) :: DT INTEGER :: DT_MIN INTEGER, SAVE :: DT_MIN_LAST = -1 DT_MIN = NINT(DT) - Input_Opt(LCHNK)%TS_CHEM = DT_MIN - Input_Opt(LCHNK)%TS_EMIS = DT_MIN - Input_Opt(LCHNK)%TS_CONV = DT_MIN - Input_Opt(LCHNK)%TS_DYN = DT_MIN - Input_Opt(LCHNK)%TS_RAD = DT_MIN + Input_Opt%TS_CHEM = DT_MIN + Input_Opt%TS_EMIS = DT_MIN + Input_Opt%TS_CONV = DT_MIN + Input_Opt%TS_DYN = DT_MIN + Input_Opt%TS_RAD = DT_MIN ! Only bother updating the module information if there's been a change IF (DT_MIN .NE. DT_MIN_LAST) THEN @@ -882,18 +863,21 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) ncol = state%ncol ! Need to update the timesteps throughout the code - CALL GC_Update_Timesteps(LCHNK,DT) + CALL GC_Update_Timesteps(DT) ! Need to be super careful that the module arrays are updated and correctly - ! set + ! set. NOTE: First thing - you'll need to flip all the data vertically ! 1. Update State_Met etc for this timestep + ! 2. Copy tracers into State_Chm + !if (MasterProc) WRITE(iulog,*) ' --> TEND SIZE: ', size(state%ncol) !if (MasterProc) WRITE(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(state%ncol),ubound(state%ncol) - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' + + ! NOTE: Re-flip all the arrays vertically or suffer the consequences lq(:) = .false. DO n=1,pcnst !m = map2chm(n) @@ -954,21 +938,21 @@ subroutine chem_final ! Finalize GEOS-Chem IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_FINAL' - ! Loop over each chunk and cleanup the independent variables + ! Loop over each chunk and cleanup the variables DO I = BEGCHUNK, ENDCHUNK am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) - CALL CLEANUP_INPUT_OPT( am_I_Root, Input_Opt(I), RC ) CALL CLEANUP_STATE_MET( am_I_Root, State_Met(I), RC ) CALL CLEANUP_STATE_CHM( am_I_Root, State_Chm(I), RC ) ENDDO + ! Cleanup Input_Opt + CALL CLEANUP_INPUT_OPT( am_I_Root, Input_Opt, RC ) ! Finally deallocate state variables - IF (ALLOCATED(Input_Opt)) DEALLOCATE(Input_Opt) IF (ALLOCATED(State_Chm)) DEALLOCATE(State_Chm) IF (ALLOCATED(State_Grid)) DEALLOCATE(State_Grid) IF (ALLOCATED(State_Met)) DEALLOCATE(State_Met) - IF (MasterProc) WRITE(iulog,'(a,4(x,L1))') ' --> DEALLOC CHECK : ', ALLOCATED(Input_Opt), ALLOCATED(State_Chm), ALLOCATED(State_Grid), ALLOCATED(State_Met) + IF (MasterProc) WRITE(iulog,'(a,3(x,L1))') ' --> DEALLOC CHECK : ', ALLOCATED(State_Chm), ALLOCATED(State_Grid), ALLOCATED(State_Met) RETURN From 7eae3e4636026cf58a0a8156d2539726df15a579 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 19 Nov 2019 18:07:11 -0500 Subject: [PATCH 048/239] Feat: Add Init_Error to chem_init for GEOS-Chem --- src/chemistry/pp_geoschem/chemistry.F90 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index f8e9f720fc..04c11cacf8 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -411,8 +411,6 @@ subroutine chem_init(phys_state, pbuf2d) ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK) , STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Met') - am_I_Root = MasterProc - ! Set some basic flags Input_Opt%Max_BPCH_Diag = 1000 Input_Opt%Max_AdvectSpc = 500 @@ -729,7 +727,13 @@ subroutine chem_init(phys_state, pbuf2d) ! Start by setting some dummy timesteps CALL GC_Update_Timesteps(300.0E+0_r8) - ! Initialize the state objects for each chunk + ! Initialize error module + CALL Init_Error( MasterProc, Input_Opt, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Error"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + DO I = BEGCHUNK, ENDCHUNK ! This reproduces GC_Init_Stateobj without the State_Diag object am_I_Root = (MasterProc .AND. (I == BEGCHUNK)) From eee1ddcae7417bb7938ad67c586a2e6e544b31ef Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 16:49:34 -0400 Subject: [PATCH 049/239] Feat: Initialize and cleanup GEOS-Chem modules (1) Add calls to module initialization and cleanup subroutines (2) Update .exclude file --- src/chemistry/pp_geoschem/.exclude | 2 - src/chemistry/pp_geoschem/chemistry.F90 | 318 ++++++++++++++++++++++-- 2 files changed, 291 insertions(+), 29 deletions(-) diff --git a/src/chemistry/pp_geoschem/.exclude b/src/chemistry/pp_geoschem/.exclude index 31b2db522f..512e2ab3fb 100644 --- a/src/chemistry/pp_geoschem/.exclude +++ b/src/chemistry/pp_geoschem/.exclude @@ -15,7 +15,6 @@ hcoio_dataread_mod.F90 hco_readlist_mod.F90 hcox_paranox_mod.F90 hco_config_mod.F90 -planeflight_mod.F hco_driver_mod.F90 hcox_driver_mod.F90 hcox_lightnox_mod.F90 @@ -44,7 +43,6 @@ diag3.F hcoi_gc_main_mod.F90 gamap_mod.F initialize.F -ndxx_setup.F mixing_mod.F90 vdiff_mod.F90 input_mod.F diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 04c11cacf8..e1fe7536e4 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -20,8 +20,10 @@ module chemistry !-------------------------------------------------------------------- ! Basic GEOS-Chem modules !-------------------------------------------------------------------- + USE DiagList_Mod, ONLY : DgnList ! Derived type for diagnostics list USE Input_Opt_Mod, ONLY : OptInput ! Derived type for Input Options USE State_Chm_Mod, ONLY : ChmState ! Derived type for Chemistry State object + USE State_Diag_Mod, ONLY : DgnState ! Derived type for Diagnostics State object USE State_Grid_Mod, ONLY : GrdState ! Derived type for Grid State object USE State_Met_Mod, ONLY : MetState ! Derived type for Meteorology State object USE ErrCode_Mod ! Error codes for success or failure @@ -74,11 +76,15 @@ module chemistry ! Location of chemistry input (for now) CHARACTER(LEN=500) :: chemInputsDir - ! GEOS-Chem state variables + !----------------------------- + ! Derived type objects + !----------------------------- TYPE(OptInput) :: Input_Opt ! Input Options object TYPE(ChmState),ALLOCATABLE :: State_Chm(:) ! Chemistry State object + TYPE(DgnState),ALLOCATABLE :: State_Diag(:) ! Diagnostics State object TYPE(GrdState),ALLOCATABLE :: State_Grid(:) ! Grid State object TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object + TYPE(DgnList ) :: Diag_List ! Diagnostics list object ! Integer INTEGER :: RC @@ -347,6 +353,7 @@ subroutine chem_init(phys_state, pbuf2d) use State_Chm_Mod use State_Grid_Mod use State_Met_Mod + use DiagList_Mod, only : Init_DiagList, Print_DiagList use GC_Environment_Mod use GC_Grid_Mod, only : SetGridFromCtrEdges @@ -356,22 +363,46 @@ subroutine chem_init(phys_state, pbuf2d) use Time_Mod, only : Accept_External_Date_Time !use Time_Mod, only : Set_Begin_Time, Set_End_Time !use Time_Mod, only : Set_Current_Time, Set_DiagB - use Transfer_Mod, only : Init_Transfer + !use Transfer_Mod, only : Init_Transfer use Linoz_Mod, only : Linoz_Read + use CMN_Size_Mod + use Drydep_Mod, only : Init_Drydep + use Carbon_Mod, only : Init_Carbon + use Dust_Mod, only : Init_Dust + use Seasalt_Mod, only : Init_Seasalt + use Sulfate_Mod, only : Init_Sulfate + use Aerosol_Mod, only : Init_Aerosol + use WetScav_Mod, only : Init_WetScav + use TOMS_Mod, only : Init_TOMS + use Pressure_Mod, only : Init_Pressure TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) ! Local variables + + !---------------------------- + ! Scalars + !---------------------------- + + ! Integers INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) INTEGER :: IWAIT, IERR - INTEGER :: NX, NY, NZ + INTEGER :: IX, IY, IZ INTEGER :: NLEV, I, J, L, RC INTEGER :: NLINOZ + ! Logicals + LOGICAL :: am_I_Root + LOGICAL :: prtDebug + + ! Strings + CHARACTER(LEN=255) :: historyConfigFile + + ! Grid setup REAL(fp) :: lonVal, latVal REAL(fp) :: dLonFix, dLatFix @@ -379,7 +410,6 @@ subroutine chem_init(phys_state, pbuf2d) REAL(f4), ALLOCATABLE :: lonEdgeArr(:,:), latEdgeArr(:,:) REAL(r8), ALLOCATABLE :: linozData(:,:,:,:) - LOGICAL :: am_I_Root ! Assume a successful return until otherwise RC = GC_SUCCESS @@ -406,6 +436,8 @@ subroutine chem_init(phys_state, pbuf2d) ! This ensures that each process allocates everything needed for its chunks ALLOCATE(State_Chm(BEGCHUNK:ENDCHUNK) , STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Chm') + ALLOCATE(State_Diag(BEGCHUNK:ENDCHUNK) , STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Diag') ALLOCATE(State_Grid(BEGCHUNK:ENDCHUNK), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Grid') ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK) , STAT=IERR) @@ -702,7 +734,6 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - CALL Init_Transfer( State_Grid(L), 0, 0 ) ENDDO DEALLOCATE(lonMidArr) DEALLOCATE(latMidArr) @@ -734,38 +765,219 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ! Set a flag to denote if we should print ND70 debug output + prtDebug = ( Input_Opt%LPRT .and. MasterProc ) + + ! Debug output + IF ( prtDebug ) CALL Debug_Msg( '### MAIN: a READ_INPUT_FILE' ) + + historyConfigFile = 'HISTORY.rc' ! InputOpt not yet initialized + CALL Init_DiagList( MasterProc, historyConfigFile, Diag_List, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_State_Met"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + !### Print diagnostic list if needed for debugging + IF ( prtDebug ) CALL Print_DiagList( am_I_Root, Diag_List, RC ) + DO I = BEGCHUNK, ENDCHUNK - ! This reproduces GC_Init_Stateobj without the State_Diag object am_I_Root = (MasterProc .AND. (I == BEGCHUNK)) - CALL Init_State_Met( am_I_Root, State_Grid(I), State_Met(I), RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_State_Met"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - CALL Init_State_Chm( am_I_Root, Input_Opt, & - State_Chm(I), State_Grid(I), & - RC ) + CALL GC_Init_StateObj( am_I_Root = am_I_Root, & ! Root CPU (Y/N)? + & Diag_List = Diag_List, & ! Diagnostic list obj + & Input_Opt = Input_Opt, & ! Input Options + & State_Chm = State_Chm(I), & ! Chemistry State + & State_Diag = State_Diag(I), & ! Diagnostics State + & State_Grid = State_Grid(I), & ! Grid State + & State_Met = State_Met(I), & ! Meteorology State + & RC = RC ) ! Success or failure + + ! Trap potential errors IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_State_Chm"!' + ErrMsg = 'Error encountered in "GC_Init_StateObj"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF ! Start with v/v dry (CAM standard) State_Chm(I)%Spc_Units = 'v/v dry' + ENDDO ! Now replicate GC_Init_Extra IF ( Input_Opt%LDryD) THEN - CALL Init_Drydep( MasterProc, Input_Opt, & - State_Chm(BEGCHUNK), & - State_Grid(BEGCHUNK), RC ) + + ! Setup for dry deposition + CALL Init_Drydep( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Init_Drydep"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF ENDIF + !================================================================= + ! Call setup routines for wet deposition + ! + ! We need to initialize the wetdep module if either wet + ! deposition or convection is turned on, so that we can do the + ! large-scale and convective scavenging. Also initialize the + ! wetdep module if both wetdep and convection are turned off, + ! but chemistry is turned on. The INIT_WETSCAV routine will also + ! allocate the H2O2s and SO2s arrays that are referenced in the + ! convection code. (bmy, 9/23/15) + !================================================================= + IF ( Input_Opt%LConv .OR. & + Input_Opt%LWetD .OR. & + Input_Opt%LChem ) THEN + CALL Init_WetScav( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_WetScav"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF + + !----------------------------------------------------------------- + ! Call SET_VDIFF_VALUES so that we can pass several values from + ! Input_Opt to the vdiff_mod.F90. This replaces the functionality + ! of logical_mod.F and tracer_mod.F.. This has to be called + ! after the input.geos file has been read from disk. + !----------------------------------------------------------------- + !CALL Set_VDiff_Values( am_I_Root = MasterProc, & + !& Input_Opt = Input_Opt, & + !& State_Chm = State_Chm(BEGCHUNK), & + !& RC = RC ) + + !&IF (RC /= GC_SUCCESS) THEN + ! ErrMsg = 'Error encountered in "Set_VDiff_Values"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + !ENDIF + + !----------------------------------------------------------------- + ! Initialize the GET_NDEP_MOD for soil NOx deposition (bmy, 6/17/16) + !----------------------------------------------------------------- + !CALL Init_Get_NDep( am_I_Root = MasterProc, & + !& Input_Opt = Input_Opt, & + !& State_Chm = State_Chm(BEGCHUNK), & + !& State_Diag = State_Diag(BEGCHUNK), & + !& RC = RC ) + ! + !IF (RC /= GC_SUCCESS) THEN + ! ErrMsg = 'Error encountered in "Init_Get_NDep"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + !ENDIF + + !----------------------------------------------------------------- + ! Initialize "carbon_mod.F" + !----------------------------------------------------------------- + IF (Input_Opt%LCarb) THEN + CALL Init_Carbon( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Carbon"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF + + IF (Input_Opt%LDust) THEN + CALL Init_Dust( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Dust"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF + + IF (Input_Opt%LSSalt) THEN + CALL Init_Seasalt( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Seasalt"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF + + IF (Input_Opt%LSulf) THEN + CALL Init_Sulfate( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Sulfate"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF + + IF (Input_Opt%LSulf.OR.Input_Opt%LCarb.OR.Input_Opt%LDust.OR.Input_Opt%LSSalt) THEN + CALL Init_Aerosol( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Aerosol"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF + + CALL Init_Toms( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_TOMS"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! This is a bare subroutine - no module + CALL NDXX_Setup( MasterProc, & + & Input_Opt, & + & State_Chm(BEGCHUNK), & + & State_Grid(BEGCHUNK), & + & RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_NDXX_Setup"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + + + ! Init_FJX.. ! Init_Pressure... ! Init_PBL_Mix... @@ -931,10 +1143,26 @@ end subroutine chem_init_cnst !=============================================================================== subroutine chem_final - USE Input_Opt_Mod, ONLY : CLEANUP_INPUT_OPT - USE State_Chm_Mod, ONLY : CLEANUP_STATE_CHM - USE State_Met_Mod, ONLY : CLEANUP_STATE_MET - Use UCX_Mod, ONLY : CLEANUP_UCX + use Input_Opt_Mod, only : Cleanup_Input_Opt + use State_Chm_Mod, only : Cleanup_State_Chm + use State_Diag_Mod, only : Cleanup_State_Diag + use State_Grid_Mod, only : Cleanup_State_Grid + use State_Met_Mod, only : Cleanup_State_Met + use Error_Mod, only : Cleanup_Error + + use FlexChem_Mod, only : Cleanup_FlexChem + use UCX_Mod, only : Cleanup_UCX + use Drydep_Mod, only : Cleanup_Drydep + use WetScav_Mod, only : Cleanup_Wetscav + use Carbon_Mod, only : Cleanup_Carbon + use Dust_Mod, only : Cleanup_Dust + use Seasalt_Mod, only : Cleanup_Seasalt + use Aerosol_Mod, only : Cleanup_Aerosol + use TOMS_Mod, only : Cleanup_Toms + use Sulfate_Mod, only : Cleanup_Sulfate + + ! Special: cleans up after NDXX_Setup + use Diag_Mod, only : Cleanup_Diag INTEGER :: I, RC LOGICAL :: am_I_Root @@ -942,21 +1170,57 @@ subroutine chem_final ! Finalize GEOS-Chem IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_FINAL' + CALL Cleanup_UCX( MasterProc ) + CALL Cleanup_Aerosol + CALL Cleanup_Carbon + CALL Cleanup_Drydep + CALL Cleanup_Dust + CALL Cleanup_FlexChem( am_I_Root, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Cleanup_FlexChem"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + RETURN + ENDIF + + CALL Cleanup_Seasalt + CALL Cleanup_Sulfate + CALL Cleanup_Toms( MasterProc, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Cleanup_Toms"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + RETURN + ENDIF + + CALL Cleanup_WetScav( MasterProc, RC) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Cleanup_WetScav"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + RETURN + ENDIF + + CALL Cleanup_Diag + + ! Cleanup Input_Opt + CALL Cleanup_Input_Opt( MasterProc, Input_Opt, RC ) + ! Loop over each chunk and cleanup the variables DO I = BEGCHUNK, ENDCHUNK am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) - CALL CLEANUP_STATE_MET( am_I_Root, State_Met(I), RC ) - CALL CLEANUP_STATE_CHM( am_I_Root, State_Chm(I), RC ) + + CALL Cleanup_State_Chm ( am_I_Root, State_Chm(I), RC ) + CALL Cleanup_State_Diag( am_I_Root, State_Diag(I), RC ) + CALL Cleanup_State_Grid( am_I_Root, State_Grid(I), RC ) + CALL Cleanup_State_Met ( am_I_Root, State_Met(I), RC ) ENDDO - ! Cleanup Input_Opt - CALL CLEANUP_INPUT_OPT( am_I_Root, Input_Opt, RC ) + CALL Cleanup_Error ! Finally deallocate state variables IF (ALLOCATED(State_Chm)) DEALLOCATE(State_Chm) + IF (ALLOCATED(State_Diag)) DEALLOCATE(State_Diag) IF (ALLOCATED(State_Grid)) DEALLOCATE(State_Grid) IF (ALLOCATED(State_Met)) DEALLOCATE(State_Met) - IF (MasterProc) WRITE(iulog,'(a,3(x,L1))') ' --> DEALLOC CHECK : ', ALLOCATED(State_Chm), ALLOCATED(State_Grid), ALLOCATED(State_Met) + IF (MasterProc) WRITE(iulog,'(a,4(x,L1))') ' --> DEALLOC CHECK : ', ALLOCATED(State_Chm), ALLOCATED(State_Diag), ALLOCATED(State_Grid), ALLOCATED(State_Met) RETURN From 839766f4239b8bfde5adb33821294e8aabd9f7df Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 20 Nov 2019 13:48:09 -0500 Subject: [PATCH 050/239] Feat: Get grid area and Ap and Bp values from CAM (1) Get grid area from CAM interface (2) Pass CAM's Ap and Bp values to GEOS-Chem's Pressure_Mod (3) Call to Cleanup_Pressure --- src/chemistry/pp_geoschem/chemistry.F90 | 89 +++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 5 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index e1fe7536e4..dedc6a43f8 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -357,8 +357,13 @@ subroutine chem_init(phys_state, pbuf2d) use GC_Environment_Mod use GC_Grid_Mod, only : SetGridFromCtrEdges + ! Use GEOS-Chem versions of physical constants use PhysConstants, only : PI, PI_180 + use PhysConstants, only : Re + + use Phys_Grid, only : get_Area_All_p + use hycoef, only : ps0, hyai, hybi use Time_Mod, only : Accept_External_Date_Time !use Time_Mod, only : Set_Begin_Time, Set_End_Time @@ -376,7 +381,7 @@ subroutine chem_init(phys_state, pbuf2d) use Aerosol_Mod, only : Init_Aerosol use WetScav_Mod, only : Init_WetScav use TOMS_Mod, only : Init_TOMS - use Pressure_Mod, only : Init_Pressure + use Pressure_Mod, only : Init_Pressure, Accept_External_ApBp TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) @@ -410,6 +415,8 @@ subroutine chem_init(phys_state, pbuf2d) REAL(f4), ALLOCATABLE :: lonEdgeArr(:,:), latEdgeArr(:,:) REAL(r8), ALLOCATABLE :: linozData(:,:,:,:) + REAL(r8), ALLOCATABLE :: Col_Area(:) + REAL(fp), ALLOCATABLE :: Ap_CAM_Flip(:), Bp_CAM_Flip(:) ! Assume a successful return until otherwise RC = GC_SUCCESS @@ -976,10 +983,83 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF + ! Set grid-cell area + DO I = BEGCHUNK, ENDCHUNK + ALLOCATE(Col_Area(NCOL(I)), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Col_Area') + + CALL Get_Area_All_p(I, NCOL(I), Col_Area) + + ! Set default value (in case of chunks with fewer columns) + State_Grid(I)%Area_M2 = 1.0e+10_fp + DO iX = 1, NX + DO iY = 1, NCOL(I) + State_Grid(I)%Area_M2(iX,iY) = REAL(Col_Area(iY) * Re**2,fp) + ENDDO + ENDDO + + DEALLOCATE(Col_Area) + + ! Copy to State_Met(I)%Area_M2 + State_Met(I)%Area_M2 = State_Grid(I)%Area_M2 + ENDDO + + + ! Initialize (mostly unused) diagnostic arrays + ! WARNING: This routine likely calls on modules which are currently + ! excluded from the GC-CESM build (eg diag03) + ! CALL Initialize( MasterProc, Input_Opt, 2, RC ) + ! CALL Initialize( Masterproc, Input_Opt, 3, RC ) + + ! Get Ap and Bp from CAM at pressure edges + ALLOCATE(Ap_CAM_Flip(nZ+1), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Ap_CAM_Flip') + ALLOCATE(Bp_CAM_Flip(nZ+1), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Bp_CAM_Flip') + + Ap_CAM_Flip = 0.0e+0_fp + Bp_CAM_Flip = 0.0e+0_fp + DO I = 1, (nZ+1) + Ap_CAM_Flip(I) = hyai(nZ+2-I) * ps0 * 0.01e+0_r8 + Bp_CAM_Flip(I) = hybi(nZ+2-I) + ENDDO + + DO I = BEGCHUNK, ENDCHUNK + + !----------------------------------------------------------------- + ! Initialize the hybrid pressure module. Define Ap and Bp. + !----------------------------------------------------------------- + CALL Init_Pressure( am_I_Root = MasterProc, & ! Root CPU (Y/N)? + & State_Grid = State_Grid(I), & ! Grid State + & RC = RC ) ! Success or failure + + ! Trapping errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Pressure"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + !----------------------------------------------------------------- + ! Pass external Ap and Bp to GEOS-Chem's Pressure_Mod + !----------------------------------------------------------------- + CALL Accept_External_ApBp( am_I_Root = MasterProc, & ! Root CPU (Y/N)? + & State_Grid = State_Grid(I), & ! Grid State + & ApIn = Ap_CAM_Flip, & ! "A" term for hybrid grid + & BpIn = Bp_CAM_Flip, & ! "B" term for hybrid grid + & RC = RC ) ! Success or failure + + ! Trapping errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Accept_External_ApBp"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ENDDO + DEALLOCATE(Ap_CAM_Flip,Bp_CAM_Flip) + ! Init_FJX.. - ! Init_Pressure... ! Init_PBL_Mix... ! Init_Chemistry... ! Init_TOMS... @@ -1160,6 +1240,7 @@ subroutine chem_final use Aerosol_Mod, only : Cleanup_Aerosol use TOMS_Mod, only : Cleanup_Toms use Sulfate_Mod, only : Cleanup_Sulfate + use Pressure_Mod, only : Cleanup_Pressure ! Special: cleans up after NDXX_Setup use Diag_Mod, only : Cleanup_Diag @@ -1179,23 +1260,21 @@ subroutine chem_final IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Cleanup_FlexChem"!' CALL Error_Stop( ErrMsg, ThisLoc ) - RETURN ENDIF + CALL Cleanup_Pressure CALL Cleanup_Seasalt CALL Cleanup_Sulfate CALL Cleanup_Toms( MasterProc, RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Cleanup_Toms"!' CALL Error_Stop( ErrMsg, ThisLoc ) - RETURN ENDIF CALL Cleanup_WetScav( MasterProc, RC) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Cleanup_WetScav"!' CALL Error_Stop( ErrMsg, ThisLoc ) - RETURN ENDIF CALL Cleanup_Diag From a9bdfcadd2a8b7336255ccd839096aa787cee69f Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 20 Nov 2019 15:14:14 -0500 Subject: [PATCH 051/239] Feat: Affect data to State_Chm --- src/chemistry/pp_geoschem/chemistry.F90 | 88 ++++++++++++++++++++----- 1 file changed, 71 insertions(+), 17 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index dedc6a43f8..698da440fb 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -76,6 +76,9 @@ module chemistry ! Location of chemistry input (for now) CHARACTER(LEN=500) :: chemInputsDir + ! Mapping between constituents and GEOS-Chem tracers + INTEGER :: map2GC(pcnst) + !----------------------------- ! Derived type objects !----------------------------- @@ -138,6 +141,9 @@ subroutine chem_register if (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_REGISTER' ! At the moment, we force nadv_chem=200 in the setup file + ! Default + map2GC = -1 + DO I = 1, NTRACERSMAX ! TODO: Read input.geos in chem_readnl to get tracernames(1:ntracers) ! TODO: Get all other species properties here from species database @@ -178,6 +184,11 @@ subroutine chem_register readiv=ic_from_cam2, mixtype=mixtype, cam_outfld=camout, & molectype=molectype, fixed_ubc=has_fixed_ubc, & fixed_ubflx=has_fixed_ubflx, longname=trim(lng_name) ) + + ! Add to GC mapping. When starting a timestep, we will want to update the + ! concentration of State_Chm(x)%Species(1,iCol,iLev,i) with data from + ! constituent n + map2GC(n) = I ENDDO ! MOZART uses this for short-lived species. Not certain exactly what it @@ -1131,13 +1142,13 @@ subroutine GC_Update_Timesteps(DT) !=============================================================================== - subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) + subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use physics_buffer, only: physics_buffer_desc use cam_history, only: outfld use camsrfexch, only: cam_in_t, cam_out_t - REAL(r8), INTENT(IN) :: dt ! time step + REAL(r8), INTENT(IN) :: dT ! Time step TYPE(physics_state), INTENT(IN) :: state ! Physics state variables TYPE(physics_ptend), INTENT(OUT) :: ptend ! indivdual parameterization tendencies TYPE(cam_in_t), INTENT(INOUT) :: cam_in @@ -1145,28 +1156,64 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) TYPE(physics_buffer_desc), POINTER :: pbuf(:) REAL(r8), OPTIONAL, INTENT(OUT) :: fh2o(pcols) ! h2o flux to balance source from chemistry + ! Initial MMR for all species + REAL(r8) :: mmr_beg(pcols,pver,nsls+ntracers) + REAL(r8) :: mmr_end(pcols,pver,nsls+ntracers) + REAL(r8) :: mmr_tend(pcols,pver,nsls+ntracers) + + ! Mapping (?) - logical :: lq(pcnst) - integer :: n, m + LOGICAL :: lq(pcnst) + INTEGER :: I, J, K, N, M + + INTEGER :: LCHNK, NCOL + + INTEGER :: Latndx(pcols) ! Chunk lat indices + INTEGER :: Lonndx(pcols) ! Chunk lon indices + REAL(r8), DIMENSION(pcols) :: & + Zen_angle, & ! Solar zenith angle + Zsurf, & ! Surface height + Rlats, Rlons ! Chunk latitudes and longitudes (radians) - integer :: lchnk, ncol ! Here's where you'll call DO_CHEMISTRY ! NOTE: State_Met etc are in an ARRAY - so we will want to always pass ! State_Met%(lchnk) and so on ! lchnk: which chunk we have on this process - lchnk = state%lchnk + LCHNK = State%LCHNK ! ncol: number of atmospheric columns on this chunk - ncol = state%ncol + NCOL = State%NCOL ! Need to update the timesteps throughout the code - CALL GC_Update_Timesteps(DT) + CALL GC_Update_Timesteps(dT) ! Need to be super careful that the module arrays are updated and correctly ! set. NOTE: First thing - you'll need to flip all the data vertically - ! 1. Update State_Met etc for this timestep + ! Check that the chunk lat/lons haven't changed + !call get_lat_all_p( LCHNK, NCOL, Latndx ) + !call get_lon_all_p( LCHNK, NCOL, Lonndx ) + !call get_rlat_all_p( LCHNK, NCOL, Rlats ) + !call get_rlon_all_p( LCHNK, NCOL, Rlons ) ! 2. Copy tracers into State_Chm + lq(:) = .FALSE. + + mmr_beg = 0.0e+0_r8 + DO N = 1, pcnst + M = map2GC(N) + IF (M > 0) THEN + I = 1 + DO J = 1, NCOL + DO K = 1, pver + ! CURRENTLY KG/KG DRY + mmr_beg(J,K,M) = state%q(J,pver+1-K,N) + State_Chm(LCHNK)%Species(1,J,K,M) = REAL(mmr_beg(J,K,M),fp) + ENDDO + ENDDO + lq(n) = .TRUE. + ENDIF + ENDDO + CALL Physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) !if (MasterProc) WRITE(iulog,*) ' --> TEND SIZE: ', size(state%ncol) !if (MasterProc) WRITE(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(state%ncol),ubound(state%ncol) @@ -1174,18 +1221,25 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' ! NOTE: Re-flip all the arrays vertically or suffer the consequences - lq(:) = .false. - DO n=1,pcnst - !m = map2chm(n) - m=0 - IF (m > 0) lq(n) = .true. - ENDDO - - CALL physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) ! ptend%q dimensions: [column, ?, species] !ptend%q(:ncol,:,:) = 0.0e+0_r8 !ptend%q(:ncol,:,:) = 0.0e+0_r8 ptend%q(:,:,:) = 0.0e+0_r8 + mmr_end = 0.0e+0_r8 + DO N = 1, pcnst + M = map2GC(N) + IF (M > 0) THEN + I = 1 + DO J = 1, NCOL + DO K = 1, pver + ! CURRENTLY KG/KG + mmr_end (J,K,M) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) + mmr_tend(J,K,M) = mmr_end(J,K,M) - mmr_beg(J,K,M) + ptend%q(J,pver+1-K,N) = (mmr_end(J,K,M)-mmr_beg(J,K,M))/dT + ENDDO + ENDDO + ENDIF + ENDDO IF (present(fh2o)) fh2o(:) = 0.0e+0_r8 RETURN From eb7339fc5519ab17d97a96e925d2c716da436c6e Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 20 Nov 2019 15:45:15 -0500 Subject: [PATCH 052/239] Feat: Initialize chemistry, add missing cleanup routines --- src/chemistry/pp_geoschem/chemistry.F90 | 40 ++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 698da440fb..d5ed9a5456 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -393,6 +393,7 @@ subroutine chem_init(phys_state, pbuf2d) use WetScav_Mod, only : Init_WetScav use TOMS_Mod, only : Init_TOMS use Pressure_Mod, only : Init_Pressure, Accept_External_ApBp + use Chemistry_Mod, only : Init_Chemistry TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) @@ -1068,9 +1069,23 @@ subroutine chem_init(phys_state, pbuf2d) ENDDO DEALLOCATE(Ap_CAM_Flip,Bp_CAM_Flip) + IF (Input_Opt%Its_A_FullChem_Sim .OR. & + Input_Opt%Its_An_Aerosol_Sim) THEN + ! This also initializes Fast-JX + CALL Init_Chemistry( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Chemistry"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF - ! Init_FJX.. ! Init_PBL_Mix... ! Init_Chemistry... ! Init_TOMS... @@ -1296,6 +1311,10 @@ subroutine chem_final use Sulfate_Mod, only : Cleanup_Sulfate use Pressure_Mod, only : Cleanup_Pressure + use CMN_Size_Mod, only : Cleanup_CMN_Size + use CMN_O3_Mod, only : Cleanup_CMN_O3 + use CMN_FJX_Mod, only : Cleanup_CMN_FJX + ! Special: cleans up after NDXX_Setup use Diag_Mod, only : Cleanup_Diag @@ -1331,6 +1350,25 @@ subroutine chem_final CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ! Call extra cleanup routines, from modules in Headers/ + CALL Cleanup_CMN_O3( MasterProc, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Cleanup_CMN_O3"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + CALL Cleanup_CMN_SIZE( MasterProc, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Cleanup_CMN_SIZE"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + CALL Cleanup_CMN_FJX( MasterProc, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Cleanup_CMN_FJX"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + CALL Cleanup_Diag ! Cleanup Input_Opt From 0675aaeec1076e1e695c3b0839f8862aa3ba0a29 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 20 Nov 2019 15:49:23 -0500 Subject: [PATCH 053/239] Feat: Initialize pressure transfer --- src/chemistry/pp_geoschem/chemistry.F90 | 29 ++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index d5ed9a5456..eab7b51e66 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -1163,8 +1163,12 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use cam_history, only: outfld use camsrfexch, only: cam_in_t, cam_out_t + use Dao_Mod, only: Set_Dry_Surface_Pressure + use Dao_Mod, only: Airqnt + use Pressure_Mod, only: Set_Floating_Pressures + REAL(r8), INTENT(IN) :: dT ! Time step - TYPE(physics_state), INTENT(IN) :: state ! Physics state variables + TYPE(physics_state), INTENT(IN) :: State ! Physics State variables TYPE(physics_ptend), INTENT(OUT) :: ptend ! indivdual parameterization tendencies TYPE(cam_in_t), INTENT(INOUT) :: cam_in TYPE(cam_out_t), INTENT(IN) :: cam_out @@ -1221,17 +1225,32 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO J = 1, NCOL DO K = 1, pver ! CURRENTLY KG/KG DRY - mmr_beg(J,K,M) = state%q(J,pver+1-K,N) + mmr_beg(J,K,M) = State%q(J,pver+1-K,N) State_Chm(LCHNK)%Species(1,J,K,M) = REAL(mmr_beg(J,K,M),fp) ENDDO ENDDO lq(n) = .TRUE. ENDIF ENDDO - CALL Physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) + CALL Physics_ptend_init(ptend, State%psetcols, 'chemistry', lq=lq) + + ! 1. Update State_Met etc for this timestep + !State_Met(LCHNK)%PS1_WET = 1013.25e+0_fp + !CALL Set_Dry_Surface_Pressure(State_Met(LCHNK), 1) + + !! Set surface pressures to match those in input + !State_Met(LCHNK)%PSC2_WET = State_Met(LCHNK)%PS1_WET + !State_Met(LCHNK)%PSC2_DRY = State_Met(LCHNK)%PS1_DRY + !CALL Set_Floating_Pressures( MasterProc, State_Met(LCHNK), RC ) + + !! Set quantities of interest but do not change VMRs + !Call AirQnt( MasterProc, Input_Opt, State_Met(LCHNK), & + ! State_Chm(LCHNK), RC, update_mixing_ratio=.False. ) + + - !if (MasterProc) WRITE(iulog,*) ' --> TEND SIZE: ', size(state%ncol) - !if (MasterProc) WRITE(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(state%ncol),ubound(state%ncol) + !IF (MasterProc) WRITE(iulog,*) ' --> TEND SIZE: ', size(State%ncol) + !IF (MasterProc) WRITE(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(State%ncol),ubound(State%ncol) IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' From 9287ca8359231a0b5d1919902d51246c9249baea Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 20 Nov 2019 17:34:22 -0500 Subject: [PATCH 054/239] Feat: Add first call to chemistry --- src/chemistry/pp_geoschem/chemistry.F90 | 173 +++++++++++++++++++++--- 1 file changed, 155 insertions(+), 18 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index eab7b51e66..dc5ef7221d 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -89,8 +89,8 @@ module chemistry TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object TYPE(DgnList ) :: Diag_List ! Diagnostics list object - ! Integer - INTEGER :: RC + ! Indices of critical species + INTEGER :: iH2O ! Strings CHARACTER(LEN=255) :: ThisLoc @@ -367,7 +367,7 @@ subroutine chem_init(phys_state, pbuf2d) use DiagList_Mod, only : Init_DiagList, Print_DiagList use GC_Environment_Mod use GC_Grid_Mod, only : SetGridFromCtrEdges - +!Check GC_Grid TMMF ! Use GEOS-Chem versions of physical constants use PhysConstants, only : PI, PI_180 @@ -394,6 +394,7 @@ subroutine chem_init(phys_state, pbuf2d) use TOMS_Mod, only : Init_TOMS use Pressure_Mod, only : Init_Pressure, Accept_External_ApBp use Chemistry_Mod, only : Init_Chemistry + use UCX_Mod, only : Init_UCX TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) @@ -970,6 +971,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDIF + IF (Input_Opt%LChem) THEN CALL Init_Toms( am_I_Root = MasterProc, & & Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & @@ -981,6 +983,7 @@ subroutine chem_init(phys_state, pbuf2d) ErrMsg = 'Error encountered in "Init_TOMS"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ENDIF ! This is a bare subroutine - no module CALL NDXX_Setup( MasterProc, & @@ -1085,12 +1088,20 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDIF + ! Initialize HEMCO? + !CALL EMISSIONS_INIT ( am_I_Root, Input_Opt, State_Met, State_Chm, RC, & + ! HcoConfig=HcoConfig ) + !ASSERT_(RC==GC_SUCCESS) + + IF (Input_Opt%LChem.and.Input_Opt%LUCX) THEN + CALL Init_UCX( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK) ) + ENDIF ! Init_PBL_Mix... - ! Init_Chemistry... - ! Init_TOMS... - ! Emissions_Init... - ! Init_UCX... ! Convert_Spc_Units... @@ -1166,6 +1177,12 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Dao_Mod, only: Set_Dry_Surface_Pressure use Dao_Mod, only: Airqnt use Pressure_Mod, only: Set_Floating_Pressures + use Pressure_Mod, only: Accept_External_Pedge + use Time_Mod, only: Accept_External_Date_Time + use Strat_chem_Mod, only: Init_Strat_Chem + use Toms_Mod, only: Compute_Overhead_O3 + use Chemistry_Mod, only: Do_Chemistry + use Wetscav_Mod, only: Setup_Wetscav REAL(r8), INTENT(IN) :: dT ! Time step TYPE(physics_state), INTENT(IN) :: State ! Physics State variables @@ -1194,6 +1211,12 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Zsurf, & ! Surface height Rlats, Rlons ! Chunk latitudes and longitudes (radians) + LOGICAL :: rootChunk + INTEGER :: RC + + ! Because of strat chem + LOGICAL, SAVE :: SCHEM_READY = .FALSE. + ! Here's where you'll call DO_CHEMISTRY ! NOTE: State_Met etc are in an ARRAY - so we will want to always pass ! State_Met%(lchnk) and so on @@ -1202,6 +1225,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ncol: number of atmospheric columns on this chunk NCOL = State%NCOL + ! Am I the first chunk on the first CPU? + rootChunk = ( MasterProc.and.(LCHNK==BEGCHUNK) ) + ! Need to update the timesteps throughout the code CALL GC_Update_Timesteps(dT) @@ -1215,6 +1241,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !call get_rlon_all_p( LCHNK, NCOL, Rlons ) ! 2. Copy tracers into State_Chm + ! Data was received in kg/kg dry + State_Chm(LCHNK)%Spc_Units = 'kg/kg dry' + lq(:) = .FALSE. mmr_beg = 0.0e+0_r8 @@ -1234,18 +1263,120 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO CALL Physics_ptend_init(ptend, State%psetcols, 'chemistry', lq=lq) - ! 1. Update State_Met etc for this timestep - !State_Met(LCHNK)%PS1_WET = 1013.25e+0_fp + ! Eventually initialize/reset wetdep + IF ( Input_Opt%LConv .OR. Input_Opt%LChem .OR. Input_Opt%LWetD ) THEN + CALL Setup_WetScav( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Failed to set up wet scavenging!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF + + ! Pass time values obtained from the ESMF environment to GEOS-Chem + CALL Accept_External_Date_Time( am_I_Root = rootChunk, & + value_NYMD = 20000101, & + value_NHMS = 0000, & + value_YEAR = 2000, & + value_MONTH = 01, & + value_DAY = 01, & + value_DAYOFYR = 001, & + value_HOUR = 00, & + value_MINUTE = 00, & + value_HELAPSED = 0.0e+0_f4, & + value_UTC = 0.0e+0_f4, & + RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Failed to update time in GEOS-Chem!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + CALL Accept_External_PEdge( am_I_Root = rootChunk, & + State_Met = State_Met(LCHNK), & + RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Failed to update pressure edges!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Calculate State_Met etc for this timestep + ! Use the CAM psdry fields instead of using the GC calculation !CALL Set_Dry_Surface_Pressure(State_Met(LCHNK), 1) + State_Met(LCHNK)%PS1_DRY (1,:) = state%psdry(:) + State_Met(LCHNK)%PS2_DRY (1,:) = state%psdry(:) + + ! Set surface pressures to match those in input + State_Met(LCHNK)%PSC2_WET = State_Met(LCHNK)%PS1_WET + State_Met(LCHNK)%PSC2_DRY = State_Met(LCHNK)%PS1_DRY + CALL Set_Floating_Pressures( am_I_Root = rootChunk, & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) - !! Set surface pressures to match those in input - !State_Met(LCHNK)%PSC2_WET = State_Met(LCHNK)%PS1_WET - !State_Met(LCHNK)%PSC2_DRY = State_Met(LCHNK)%PS1_DRY - !CALL Set_Floating_Pressures( MasterProc, State_Met(LCHNK), RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Failed to set floating pressures!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Set quantities of interest but do not change VMRs + CALL AirQnt( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC, & + Update_Mixing_Ratio = .False. ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Failed to calculate air properties!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + + ! Initialize strat chem if not already done. This has to be done here because + ! it needs to have non-zero values in State_Chm%AD, which only happens after + ! the first call to AirQnt + IF ( (.not.schem_ready) .and. Input_Opt%LSCHEM ) THEN + CALL Init_Strat_Chem( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Met = State_Met(LCHNK), & + State_Grid = State_Grid(LCHNK), & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Could not initialize strat-chem!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + schem_ready = .True. + ENDIF - !! Set quantities of interest but do not change VMRs - !Call AirQnt( MasterProc, Input_Opt, State_Met(LCHNK), & - ! State_Chm(LCHNK), RC, update_mixing_ratio=.False. ) + ! Run chemistry + IF (Input_Opt%LChem) THEN + CALL Compute_Overhead_O3( am_I_Root = rootChunk, & + State_Grid = State_Grid(LCHNK), & + DAY = 1, & + USE_O3_FROM_MET = Input_Opt%Use_O3_From_Met, & + TO3 = State_Met(LCHNK)%TO3 ) + + CALL Do_Chemistry( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Chemistry failed!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF @@ -1254,10 +1385,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' + ! Make sure State_Chm(lchnk) is back in kg/kg dry! + + ! Reset H2O MMR to the initial value (no chemistry tendency in H2O just + ! yet) + State_Chm(LCHNK)%Species(1,:,:,iH2O) = mmr_beg(:,:,iH2O) + ! NOTE: Re-flip all the arrays vertically or suffer the consequences ! ptend%q dimensions: [column, ?, species] - !ptend%q(:ncol,:,:) = 0.0e+0_r8 - !ptend%q(:ncol,:,:) = 0.0e+0_r8 ptend%q(:,:,:) = 0.0e+0_r8 mmr_end = 0.0e+0_r8 DO N = 1, pcnst @@ -1329,6 +1464,7 @@ subroutine chem_final use TOMS_Mod, only : Cleanup_Toms use Sulfate_Mod, only : Cleanup_Sulfate use Pressure_Mod, only : Cleanup_Pressure + use Strat_Chem_Mod, only : Cleanup_Strat_Chem use CMN_Size_Mod, only : Cleanup_CMN_Size use CMN_O3_Mod, only : Cleanup_CMN_O3 @@ -1357,6 +1493,7 @@ subroutine chem_final CALL Cleanup_Pressure CALL Cleanup_Seasalt CALL Cleanup_Sulfate + CALL Cleanup_Strat_Chem CALL Cleanup_Toms( MasterProc, RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Cleanup_Toms"!' From 4ab75d3ccaffe9139c01a4e43219c53805831dad Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 10:44:41 -0500 Subject: [PATCH 055/239] Feat: Register all tracers using species database (1) Register species (2) Initial step towards the update of State_Met --- src/chemistry/pp_geoschem/chemistry.F90 | 265 ++++++++++++++++++++---- 1 file changed, 227 insertions(+), 38 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index dc5ef7221d..1332348fe3 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -34,6 +34,9 @@ module chemistry !----------------------------------------------------------------- USE PRECISION_MOD, ONLY : fp, f4 ! Flexible precision + ! Exit routine in CAM + use cam_abortutils, only : endrun + IMPLICIT NONE PRIVATE SAVE @@ -117,11 +120,24 @@ end function chem_is subroutine chem_register use physics_buffer, only : pbuf_add_field, dtype_r8 + + use State_Grid_Mod, only : Init_State_Grid, Cleanup_State_Grid + use State_Chm_Mod, only : Init_State_Chm, Cleanup_State_Chm + use State_Chm_Mod, only : Ind_ + use Input_Opt_Mod, only : Set_Input_Opt, Cleanup_Input_Opt + USE Species_Mod, only : Species + !----------------------------------------------------------------------- ! ! Purpose: register advected constituents for chemistry ! !----------------------------------------------------------------------- + ! Need to generate a temporary species database - therefore temp State_Chm + Type(ChmState) :: SC + Type(GrdState) :: SG + Type(OptInput) :: IO + TYPE(Species), POINTER :: ThisSpc + INTEGER :: i, n REAL(r8) :: cptmp REAL(r8) :: qmin @@ -132,6 +148,8 @@ subroutine chem_register LOGICAL :: ic_from_cam2 LOGICAL :: has_fixed_ubc LOGICAL :: has_fixed_ubflx + + INTEGER :: RC ! SDE 2018-05-02: This seems to get called before anything else ! That includes CHEM_INIT ! At this point, mozart calls SET_SIM_DAT, which is specified by each @@ -139,28 +157,93 @@ subroutine chem_register ! set_sim_dat which is in pp_[mechanism]/mo_sim_dat.F90. That sets a lot of ! data in other places, notably in "chem_mods" - if (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_REGISTER' + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_REGISTER' + + ! Generate fake state_chm + IO%Max_BPCH_Diag = 1000 + IO%Max_AdvectSpc = 500 + IO%Max_Families = 250 + + IO%RootCPU = .False. + + CALL Set_Input_Opt( am_I_Root = .False., & + Input_Opt = IO, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Could not generate reference input options object!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Options needed by Init_State_Chm + IO%ITS_A_FULLCHEM_SIM = .True. + IO%LLinoz = .True. + IO%LUCX = .True. + IO%LPRT = .False. + IO%N_Advect = nTracers + DO I = 1, nTracers + IO%AdvectSpc_Name(I) = TRIM(tracernames(I)) + ENDDO + IO%SalA_rEdge_um(1) = 0.01e+0_fp + IO%SalA_rEdge_um(2) = 0.50e+0_fp + IO%SalC_rEdge_um(1) = 0.50e+0_fp + IO%SalC_rEdge_um(2) = 8.00e+0_fp + + ! Prevent reporting + IO%rootCPU = .False. + Input_Opt%myCPU = myCPU + + CALL Init_State_Grid( am_I_Root = .False., & + State_Grid = State_Grid(I), & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "Init_State_Grid"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + State_Grid(I)%NX = 1 + State_Grid(I)%NY = 1 + State_Grid(I)%NZ = 1 + + CALL Init_State_Chm( am_I_Root = .False., & + Input_Opt = IO, & + State_Chm = SC, & + State_Grid = SG, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "Init_State_Chm"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ! At the moment, we force nadv_chem=200 in the setup file ! Default map2GC = -1 DO I = 1, NTRACERSMAX - ! TODO: Read input.geos in chem_readnl to get tracernames(1:ntracers) - ! TODO: Get all other species properties here from species database - ! Hard-code for now - SELECT CASE (TRACERNAMES(I)) - CASE ('BCPI') - lng_name = 'Hydrophilic black carbon' - ! Molar mass (g/mol) - adv_mass(i) = 1000.0e+0_r8 * (0.012e+0_r8) - CASE ('OCS') - lng_name = 'Carbonyl sulfide' - ! Molar mass (g/mol) - adv_mass(i) = 1000.0e+0_r8 * (0.060e+0_r8) - CASE DEFAULT - lng_name = tracernames(i) - adv_mass(i) = 1000.0e+0_r8 * (0.001e+0_r8) - END SELECT + IF (I.LE.NTRACERS) THEN + N = Ind_(TRACERNAMES(I)) + ThisSpc => SC%SpcData(N)%Info + lng_name = TRIM(ThisSpc%FullName) + adv_mass(I) = REAL(ThisSpc%MW_g,r8) + ELSE + lng_name = TRIM(TRACERNAMES(I)) + adv_mass(I) = 1000.0e+0_r8 * (0.001e+0_r8) + ENDIF + !SELECT CASE (TRACERNAMES(I)) + ! CASE ('BCPI') + ! lng_name = 'Hydrophilic black carbon' + ! ! Molar mass (g/mol) + ! adv_mass(i) = 1000.0e+0_r8 * (0.012e+0_r8) + ! CASE ('OCS') + ! lng_name = 'Carbonyl sulfide' + ! ! Molar mass (g/mol) + ! adv_mass(i) = 1000.0e+0_r8 * (0.060e+0_r8) + ! CASE DEFAULT + ! lng_name = tracernames(i) + ! adv_mass(i) = 1000.0e+0_r8 * (0.001e+0_r8) + !END SELECT ! dummy value for specific heat of constant pressure (Cp) cptmp = 666._r8 ! minimum mixing ratio @@ -189,6 +272,8 @@ subroutine chem_register ! concentration of State_Chm(x)%Species(1,iCol,iLev,i) with data from ! constituent n map2GC(n) = I + ! Nullify pointer + ThisSpc => NULL() ENDDO ! MOZART uses this for short-lived species. Not certain exactly what it @@ -206,6 +291,11 @@ subroutine chem_register !indices(i) = 0 ! ===== SDE DEBUG ===== + ! Clean up + Call Cleanup_State_Chm ( .False., SC, RC ) + Call Cleanup_State_Grid( .False., SG, RC ) + Call Cleanup_Input_Opt ( .False., IO, RC ) + end subroutine chem_register subroutine chem_readnl(nlfile) @@ -310,8 +400,6 @@ function chem_is_active() !----------------------------------------------------------------------- chem_is_active = .true. - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_IS_ACTIVE' - end function chem_is_active !================================================================================================ @@ -414,7 +502,7 @@ subroutine chem_init(phys_state, pbuf2d) INTEGER :: NLINOZ ! Logicals - LOGICAL :: am_I_Root + LOGICAL :: am_I_Root, rootChunk LOGICAL :: prtDebug ! Strings @@ -468,11 +556,15 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%Max_AdvectSpc = 500 Input_Opt%Max_Families = 250 - Input_Opt%Linoz_NLevels = 25 - Input_Opt%Linoz_NLat = 18 - Input_Opt%Linoz_NMonths = 12 - Input_Opt%Linoz_NFields = 7 - Input_Opt%RootCPU = MasterProc + ! Initialize fields of the Input Options object + CALL Set_Input_Opt( am_I_Root = MasterProc, & + Input_Opt = Input_Opt, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "Set_Input_Opt"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF DO I = BEGCHUNK, ENDCHUNK @@ -483,8 +575,9 @@ subroutine chem_init(phys_state, pbuf2d) CALL Init_State_Grid( am_I_Root = am_I_Root, & State_Grid = State_Grid(I), & RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered within call to "Init_Grid_State"!' + ErrMsg = 'Error encountered within call to "Init_State_Grid"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF @@ -531,6 +624,9 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + Input_Opt%myCPU = myCPU + Input_Opt%rootCPU = MasterProc + ! TODO: Mimic GEOS-Chem's reading of input options !IF (MasterProc) THEN @@ -1135,7 +1231,6 @@ end subroutine chem_timestep_init subroutine GC_Update_Timesteps(DT) use Time_Mod, only : Set_Timesteps - use cam_abortutils, only : endrun REAL(r8), INTENT(IN) :: DT INTEGER :: DT_MIN @@ -1174,8 +1269,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use cam_history, only: outfld use camsrfexch, only: cam_in_t, cam_out_t + use phys_grid, only: get_ncols_p, get_rlat_all_p, get_rlon_all_p + use Dao_Mod, only: Set_Dry_Surface_Pressure use Dao_Mod, only: Airqnt + use GC_Grid_Mod, only: SetGridFromCtr use Pressure_Mod, only: Set_Floating_Pressures use Pressure_Mod, only: Accept_External_Pedge use Time_Mod, only: Accept_External_Date_Time @@ -1201,25 +1299,30 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Mapping (?) LOGICAL :: lq(pcnst) INTEGER :: I, J, K, N, M + INTEGER :: NX, NY INTEGER :: LCHNK, NCOL INTEGER :: Latndx(pcols) ! Chunk lat indices INTEGER :: Lonndx(pcols) ! Chunk lon indices - REAL(r8), DIMENSION(pcols) :: & + REAL(r8), DIMENSION(State%NCOL) :: & Zen_angle, & ! Solar zenith angle Zsurf, & ! Surface height Rlats, Rlons ! Chunk latitudes and longitudes (radians) - LOGICAL :: rootChunk - INTEGER :: RC - ! Because of strat chem LOGICAL, SAVE :: SCHEM_READY = .FALSE. + REAL(f4) :: lonMidArr(1,pcols), latMidArr(1,pcols) + INTEGER :: imaxloc(1) + + LOGICAL :: rootChunk + INTEGER :: RC + ! Here's where you'll call DO_CHEMISTRY ! NOTE: State_Met etc are in an ARRAY - so we will want to always pass ! State_Met%(lchnk) and so on + ! lchnk: which chunk we have on this process LCHNK = State%LCHNK ! ncol: number of atmospheric columns on this chunk @@ -1234,11 +1337,35 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Need to be super careful that the module arrays are updated and correctly ! set. NOTE: First thing - you'll need to flip all the data vertically - ! Check that the chunk lat/lons haven't changed - !call get_lat_all_p( LCHNK, NCOL, Latndx ) - !call get_lon_all_p( LCHNK, NCOL, Lonndx ) - !call get_rlat_all_p( LCHNK, NCOL, Rlats ) - !call get_rlon_all_p( LCHNK, NCOL, Rlons ) + NX = 1 + NY = NCOL + + ! Update the grid lat/lons since they are module variables + ! Assume (!) that area hasn't changed for now, as GEOS-Chem will + ! retrieve this from State_Met which is chunked + CALL get_rlat_all_p( LCHNK, NCOL, Rlats ) + CALL get_rlon_all_p( LCHNK, NCOL, Rlons ) + + lonMidArr = 0.0e+0_f4 + latMidArr = 0.0e+0_f4 + DO I = 1, NX + DO J = 1, NY + lonMidArr(I,J) = Rlons(J) + latMidArr(I,J) = Rlats(J) + ENDDO + ENDDO + + ! Update the grid + Call SetGridFromCtr( am_I_Root = rootChunk, & + State_Grid = State_Grid(LCHNK), & + lonCtr = lonMidArr, & + latCtr = latMidArr, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "SetGridFromCtr"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ! 2. Copy tracers into State_Chm ! Data was received in kg/kg dry @@ -1263,6 +1390,57 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO CALL Physics_ptend_init(ptend, State%psetcols, 'chemistry', lq=lq) + State_Met(LCHNK)%ALBD = 0.0e+0_fp + State_Met(LCHNK)%CLDFRC = 0.0e+0_fp + State_Met(LCHNK)%EFLUX = 0.0e+0_fp + State_Met(LCHNK)%HFLUX = 0.0e+0_fp + State_Met(LCHNK)%FRCLND = 0.0e+0_fp + State_Met(LCHNK)%FRLAND = 0.0e+0_fp + State_Met(LCHNK)%FROCEAN = 0.0e+0_fp + State_Met(LCHNK)%FRLAKE = 0.0e+0_fp + State_Met(LCHNK)%FRLANDIC = 0.0e+0_fp + State_Met(LCHNK)%PHIS = 0.0e+0_fp + State_Met(LCHNK)%GWETROOT = 0.0e+0_fp + State_Met(LCHNK)%GWETTOP = 0.0e+0_fp + State_Met(LCHNK)%LAI = 0.0e+0_fp + State_Met(LCHNK)%PARDR = 0.0e+0_fp + State_Met(LCHNK)%PARDF = 0.0e+0_fp + State_Met(LCHNK)%PBLH = 0.0e+0_fp + State_Met(LCHNK)%PRECANV = 0.0e+0_fp + State_Met(LCHNK)%PRECCON = 0.0e+0_fp + State_Met(LCHNK)%PRECLSC = 0.0e+0_fp + State_Met(LCHNK)%PRECTOT = 0.0e+0_fp + State_Met(LCHNK)%TROPP = 0.0e+0_fp + State_Met(LCHNK)%PS1_WET = 0.0e+0_fp + State_Met(LCHNK)%PS2_WET = 0.0e+0_fp + State_Met(LCHNK)%SLP = 0.0e+0_fp + State_Met(LCHNK)%TS = 0.0e+0_fp + State_Met(LCHNK)%TSKIN = 0.0e+0_fp + State_Met(LCHNK)%SWGDN = 0.0e+0_fp + State_Met(LCHNK)%TO3 = 0.0e+0_fp + State_Met(LCHNK)%SNODP = 0.0e+0_fp + State_Met(LCHNK)%SNOMAS = 0.0e+0_fp + State_Met(LCHNK)%SUNCOS = 0.0e+0_fp + State_Met(LCHNK)%SUNCOSmid = 0.0e+0_fp + State_Met(LCHNK)%U10M = 0.0e+0_fp + State_Met(LCHNK)%USTAR = 0.0e+0_fp + State_Met(LCHNK)%V10M = 0.0e+0_fp + State_Met(LCHNK)%Z0 = 0.0e+0_fp + + DO J = 1, NY + DO I = 1, NX + IMAXLOC = MAXLOC( (/ State_Met%FRLAND(I,J) + & + State_Met%FRLANDIC(I,J) + & + State_Met%FRLAKE(I,J), & + State_Met%FRSEAICE(I,J), & + State_Met%FROCEAN(I,J) - & + State_Met%FRSEAICE(I,J) /) ) + IF ( IMAXLOC(1) == 3 ) IMAXLOC(1) = 0 + ! reset ocean to 0 + State_Met%LWI(I,J) = FLOAT( IMAXLOC(1) ) + ENDDO + ENDDO + ! Eventually initialize/reset wetdep IF ( Input_Opt%LConv .OR. Input_Opt%LChem .OR. Input_Opt%LWetD ) THEN CALL Setup_WetScav( am_I_Root = rootChunk, & @@ -1291,6 +1469,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) value_HELAPSED = 0.0e+0_f4, & value_UTC = 0.0e+0_f4, & RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Failed to update time in GEOS-Chem!' CALL Error_Stop( ErrMsg, ThisLoc ) @@ -1299,6 +1478,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Accept_External_PEdge( am_I_Root = rootChunk, & State_Met = State_Met(LCHNK), & RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Failed to update pressure edges!' CALL Error_Stop( ErrMsg, ThisLoc ) @@ -1383,7 +1563,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !IF (MasterProc) WRITE(iulog,*) ' --> TEND SIZE: ', size(State%ncol) !IF (MasterProc) WRITE(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(State%ncol),ubound(State%ncol) - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' + IF ( rootChunk ) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' ! Make sure State_Chm(lchnk) is back in kg/kg dry! @@ -1606,7 +1786,16 @@ subroutine chem_emissions( state, cam_in ) TYPE(physics_state), INTENT(IN) :: state ! Physics state variables TYPE(cam_in_t), INTENT(INOUT) :: cam_in ! import state - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_EMISSIONS' + INTEGER :: LCHNK, NCOL + LOGICAL :: rootChunk + + ! LCHNK: which chunk we have on this process + LCHNK = State%LCHNK + ! NCOL: number of atmospheric columns on this chunk + NCOL = State%NCOL + rootChunk = ( MasterProc.and.(LCHNK.EQ.BEGCHUNK) ) + + IF (rootChunk) WRITE(iulog,'(a)') 'GCCALL CHEM_EMISSIONS' end subroutine chem_emissions From 67f2c426399ba6fcb1610c4f1b57f66c1568bf01 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 11:21:35 -0500 Subject: [PATCH 056/239] Feat: Fill key variables in State_Met --- src/chemistry/pp_geoschem/chemistry.F90 | 219 ++++++++++++++++++------ 1 file changed, 163 insertions(+), 56 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 1332348fe3..5379774d04 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -1200,7 +1200,8 @@ subroutine chem_init(phys_state, pbuf2d) ! Init_PBL_Mix... ! Convert_Spc_Units... - + ! Get the index of H2O + iH2O = Ind_('H2O') ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default @@ -1272,7 +1273,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use phys_grid, only: get_ncols_p, get_rlat_all_p, get_rlon_all_p use Dao_Mod, only: Set_Dry_Surface_Pressure - use Dao_Mod, only: Airqnt + use Dao_Mod, only: AirQnt use GC_Grid_Mod, only: SetGridFromCtr use Pressure_Mod, only: Set_Floating_Pressures use Pressure_Mod, only: Accept_External_Pedge @@ -1282,6 +1283,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Chemistry_Mod, only: Do_Chemistry use Wetscav_Mod, only: Setup_Wetscav + ! For calculating SZA + use Orbit, only: zenith + use Time_Manager, only: Get_Curr_Calday + + ! Calculating relative humidity + use WV_Saturation, only: QSat + use PhysConst, only: MWDry + REAL(r8), INTENT(IN) :: dT ! Time step TYPE(physics_state), INTENT(IN) :: State ! Physics State variables TYPE(physics_ptend), INTENT(OUT) :: ptend ! indivdual parameterization tendencies @@ -1298,23 +1307,32 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Mapping (?) LOGICAL :: lq(pcnst) - INTEGER :: I, J, K, N, M - INTEGER :: NX, NY + + ! Indexing + INTEGER :: I, J, K, L, N, M + INTEGER :: NX, NY, NZ INTEGER :: LCHNK, NCOL - INTEGER :: Latndx(pcols) ! Chunk lat indices - INTEGER :: Lonndx(pcols) ! Chunk lon indices REAL(r8), DIMENSION(State%NCOL) :: & - Zen_angle, & ! Solar zenith angle + CSZA, & ! Cosine of solar zenith angle Zsurf, & ! Surface height Rlats, Rlons ! Chunk latitudes and longitudes (radians) + REAL(r8) :: RelHum(State%NCOL, pver) ! Relative humidity [0-1] + REAL(r8) :: SatV (State%NCOL, pver) ! Work arrays + REAL(r8) :: SatQ (State%NCOL, pver) ! Work arrays + REAL(r8) :: QH2O (State%NCOL, pver) ! Specific humidity [kg/kg] + REAL(r8) :: H2Ovmr(State%NCOL, pver) ! H2O volume mixing ratio + ! Because of strat chem LOGICAL, SAVE :: SCHEM_READY = .FALSE. REAL(f4) :: lonMidArr(1,pcols), latMidArr(1,pcols) - INTEGER :: imaxloc(1) + INTEGER :: iMaxLoc(1) + + ! Calculating SZA + REAL(r8) :: Calday LOGICAL :: rootChunk INTEGER :: RC @@ -1343,8 +1361,10 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Update the grid lat/lons since they are module variables ! Assume (!) that area hasn't changed for now, as GEOS-Chem will ! retrieve this from State_Met which is chunked - CALL get_rlat_all_p( LCHNK, NCOL, Rlats ) - CALL get_rlon_all_p( LCHNK, NCOL, Rlons ) + !CALL get_rlat_all_p( LCHNK, NCOL, Rlats ) + !CALL get_rlon_all_p( LCHNK, NCOL, Rlons ) + Rlats(1:NCOL) = State%Lat(1:NCOL) + Rlons(1:NCOL) = State%Lon(1:NCOL) lonMidArr = 0.0e+0_f4 latMidArr = 0.0e+0_f4 @@ -1390,57 +1410,144 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO CALL Physics_ptend_init(ptend, State%psetcols, 'chemistry', lq=lq) - State_Met(LCHNK)%ALBD = 0.0e+0_fp - State_Met(LCHNK)%CLDFRC = 0.0e+0_fp - State_Met(LCHNK)%EFLUX = 0.0e+0_fp - State_Met(LCHNK)%HFLUX = 0.0e+0_fp - State_Met(LCHNK)%FRCLND = 0.0e+0_fp - State_Met(LCHNK)%FRLAND = 0.0e+0_fp - State_Met(LCHNK)%FROCEAN = 0.0e+0_fp - State_Met(LCHNK)%FRLAKE = 0.0e+0_fp - State_Met(LCHNK)%FRLANDIC = 0.0e+0_fp - State_Met(LCHNK)%PHIS = 0.0e+0_fp - State_Met(LCHNK)%GWETROOT = 0.0e+0_fp - State_Met(LCHNK)%GWETTOP = 0.0e+0_fp - State_Met(LCHNK)%LAI = 0.0e+0_fp - State_Met(LCHNK)%PARDR = 0.0e+0_fp - State_Met(LCHNK)%PARDF = 0.0e+0_fp - State_Met(LCHNK)%PBLH = 0.0e+0_fp - State_Met(LCHNK)%PRECANV = 0.0e+0_fp - State_Met(LCHNK)%PRECCON = 0.0e+0_fp - State_Met(LCHNK)%PRECLSC = 0.0e+0_fp - State_Met(LCHNK)%PRECTOT = 0.0e+0_fp - State_Met(LCHNK)%TROPP = 0.0e+0_fp - State_Met(LCHNK)%PS1_WET = 0.0e+0_fp - State_Met(LCHNK)%PS2_WET = 0.0e+0_fp - State_Met(LCHNK)%SLP = 0.0e+0_fp - State_Met(LCHNK)%TS = 0.0e+0_fp - State_Met(LCHNK)%TSKIN = 0.0e+0_fp - State_Met(LCHNK)%SWGDN = 0.0e+0_fp - State_Met(LCHNK)%TO3 = 0.0e+0_fp - State_Met(LCHNK)%SNODP = 0.0e+0_fp - State_Met(LCHNK)%SNOMAS = 0.0e+0_fp - State_Met(LCHNK)%SUNCOS = 0.0e+0_fp - State_Met(LCHNK)%SUNCOSmid = 0.0e+0_fp - State_Met(LCHNK)%U10M = 0.0e+0_fp - State_Met(LCHNK)%USTAR = 0.0e+0_fp - State_Met(LCHNK)%V10M = 0.0e+0_fp - State_Met(LCHNK)%Z0 = 0.0e+0_fp + ! Calculate COS(SZA) + Calday = Get_Curr_Calday( ) + CALL Zenith( Calday, Rlats, Rlons, CSZA, NCOL ) + !CALL Outfld( 'SZA', SZA, NCOL, LCHNK ) + + ! Get VMR and MMR of H2O + H2Ovmr = 0.0e0_fp + QH2O = 0.0e0_fp + ! Note MWDRY = 28.966 g/mol + + DO J = 1, NY + DO L = 1, NZ + QH2O(J,L) = State_Chm(LCHNK)%Species(1,J,K,iH2O) + H2Ovmr(J,L) = QH2O(J,L) * MWDry / 18.016e+0_fp + ENDDO + ENDDO + + ! Calculate RH (range 0-1, note still level 1 = TOA) + RELHUM(:,:) = 0.0e+0_r8 + CALL QSat(State%T(:NCOL,:), State%Pmid(:NCOL,:), SatV, SatQ) + DO J = 1, NY + DO L = 1, NZ + RELHUM(J,L) = 0.622e+0_r8 * H2Ovmr(J,L) / SatQ(J,L) + RELHUM(J,L) = MAX( 0.0e+0_r8, MIN( 1.0e+0_r8, RELHUM(J,L) ) ) + ENDDO + ENDDO + + State_Met(LCHNK)%ALBD (1,:) = Cam_in%Asdir(:) + State_Met(LCHNK)%CLDFRC (1,:) = 0.0e+0_fp + State_Met(LCHNK)%EFLUX (1,:) = 0.0e+0_fp + State_Met(LCHNK)%HFLUX (1,:) = 0.0e+0_fp + State_Met(LCHNK)%FRCLND (1,:) = 0.0e+0_fp + State_Met(LCHNK)%FRLAND (1,:) = 1.0e+0_fp - cam_in%OcnFrac(:) + State_Met(LCHNK)%FROCEAN (1,:) = Cam_in%OcnFrac(:) + State_Met(LCHNK)%FRLAKE (1,:) = 0.0e+0_fp + State_Met(LCHNK)%FRLANDIC (1,:) = 0.0e+0_fp + State_Met(LCHNK)%GWETROOT (1,:) = 0.0e+0_fp + State_Met(LCHNK)%GWETTOP (1,:) = 0.0e+0_fp + State_Met(LCHNK)%LAI (1,:) = 0.0e+0_fp + State_Met(LCHNK)%PARDR (1,:) = 0.0e+0_fp + State_Met(LCHNK)%PARDF (1,:) = 0.0e+0_fp + State_Met(LCHNK)%PBLH (1,:) = 0.0e+0_fp + State_Met(LCHNK)%PHIS (1,:) = State%Phis(:) + State_Met(LCHNK)%PRECANV (1,:) = 0.0e+0_fp + State_Met(LCHNK)%PRECCON (1,:) = 0.0e+0_fp + State_Met(LCHNK)%PRECLSC (1,:) = 0.0e+0_fp + State_Met(LCHNK)%PRECTOT (1,:) = 0.0e+0_fp + State_Met(LCHNK)%TROPP (1,:) = 150.0e+0_fp + State_Met(LCHNK)%PS1_WET (1,:) = State%ps(:)*0.01e+0_fp + State_Met(LCHNK)%PS2_WET (1,:) = State%ps(:)*0.01e+0_fp + State_Met(LCHNK)%SLP (1,:) = State%ps(:)*0.01e+0_fp + State_Met(LCHNK)%TS (1,:) = Cam_in%TS(:) + State_Met(LCHNK)%TSKIN (1,:) = Cam_in%TS(:) + State_Met(LCHNK)%SWGDN (1,:) = 0.0e+0_fp + State_Met(LCHNK)%TO3 (1,:) = 300.0e+0_fp ! Dummy + State_Met(LCHNK)%SNODP (1,:) = 0.0e+0_fp + State_Met(LCHNK)%SNOMAS (1,:) = 0.0e+0_fp + State_Met(LCHNK)%SUNCOS (1,:) = CSZA(:) + State_Met(LCHNK)%SUNCOSmid (1,:) = CSZA(:) + State_Met(LCHNK)%U10M (1,:) = State%U(:,NZ) + State_Met(LCHNK)%USTAR (1,:) = 0.0e+0_fp + State_Met(LCHNK)%V10M (1,:) = State%V(:,NZ) + State_Met(LCHNK)%Z0 (1,:) = 0.0e+0_fp DO J = 1, NY DO I = 1, NX - IMAXLOC = MAXLOC( (/ State_Met%FRLAND(I,J) + & - State_Met%FRLANDIC(I,J) + & - State_Met%FRLAKE(I,J), & - State_Met%FRSEAICE(I,J), & - State_Met%FROCEAN(I,J) - & - State_Met%FRSEAICE(I,J) /) ) - IF ( IMAXLOC(1) == 3 ) IMAXLOC(1) = 0 + iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(I,J) + & + State_Met(LCHNK)%FRLANDIC(I,J) + & + State_Met(LCHNK)%FRLAKE(I,J), & + State_Met(LCHNK)%FRSEAICE(I,J), & + State_Met(LCHNK)%FROCEAN(I,J) - & + State_Met(LCHNK)%FRSEAICE(I,J) /) ) + IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 ! reset ocean to 0 - State_Met%LWI(I,J) = FLOAT( IMAXLOC(1) ) + State_Met(LCHNK)%LWI(I,J) = FLOAT( iMaxLoc(1) ) ENDDO ENDDO + ! Three-dimensional fields on level edges + DO J = 1, NY + DO L = 1, NZ+1 + State_Met(LCHNK)%CMFMC (1,J,L) = 0.0e+0_fp + State_Met(LCHNK)%PFICU (1,J,L) = 0.0e+0_fp + State_Met(LCHNK)%PFILSAN (1,J,L) = 0.0e+0_fp + State_Met(LCHNK)%PFLCU (1,J,L) = 0.0e+0_fp + State_Met(LCHNK)%PFLLSAN (1,J,L) = 0.0e+0_fp + State_Met(LCHNK)%PEDGE (1,J,L) = State%Pint(J,NZ+2-L)*0.01e+0_fp + ENDDO + ENDDO + + ! These are set later + State_Met(LCHNK)%PS1_DRY (:,:) = 0.0e+0_fp + State_Met(LCHNK)%PS2_DRY (:,:) = 0.0e+0_fp + + + ! Calculate CLDTOPS (highest location of CMFMC in the column) + I = 1 + DO J = 1, NY + State_Met(lchnk)%CldTops(I,J) = 1 + DO L = NZ, 1, -1 + IF ( State_Met(LCHNK)%CMFMC(I,J,L) > 0.0e+0_fp ) THEN + State_Met(LCHNK)%CLDTOPS(I,J) = L + 1 + EXIT + ENDIF + ENDDO + ENDDO + + ! Three-dimensional fields on level centers + DO J = 1, NY + DO L = 1, NZ + State_Met(lchnk)%U (1,J,L) = State%U(J,NZ+1-L) + State_Met(lchnk)%V (1,J,L) = State%V(J,NZ+1-L) + !State_Met(lchnk)%OMEGA (1,J,L) = State%Omega(J,NZ+1-L) + State_Met(lchnk)%CLDF (1,J,L) = 0.0e+0_fp + State_Met(lchnk)%DTRAIN (1,J,L) = 0.0e+0_fp + State_Met(lchnk)%DQRCU (1,J,L) = 0.0e+0_fp + State_Met(lchnk)%DQRLSAN (1,J,L) = 0.0e+0_fp + State_Met(lchnk)%QI (1,J,L) = 0.0e+0_fp + State_Met(lchnk)%QL (1,J,L) = 0.0e+0_fp + State_Met(lchnk)%RH (1,J,L) = RelHum(J,NZ+1-L) * 100.0e+0_fp + State_Met(lchnk)%TAUCLI (1,J,L) = 0.0e+0_fp + State_Met(lchnk)%TAUCLW (1,J,L) = 0.0e+0_fp + State_Met(lchnk)%REEVAPCN (1,J,L) = 0.0e+0_fp + State_Met(lchnk)%REEVAPLS (1,J,L) = 0.0e+0_fp + State_Met(lchnk)%SPHU1 (1,J,L) = QH2O(J,NZ+1-L) * 1.0e+3_fp ! g/kg + State_Met(lchnk)%SPHU2 (1,J,L) = QH2O(J,NZ+1-L) * 1.0e+3_fp ! g/kg + State_Met(lchnk)%TMPU1 (1,J,L) = State%T(J,NZ+1-L) + State_Met(lchnk)%TMPU2 (1,J,L) = State%T(J,NZ+1-L) + ENDDO + ENDDO + + ! Derived fields + State_Met(lchnk)%T = (State_Met(lchnk)%TMPU1 + State_Met(lchnk)%TMPU2)*0.5e+0_fp + State_Met(lchnk)%SPHU = (State_Met(lchnk)%SPHU1 + State_Met(lchnk)%SPHU2)*0.5e+0_fp + + ! Calculate total OD as liquid cloud OD + ice cloud OD + State_Met(lchnk)%OPTD = State_Met(lchnk)%TAUCLI + State_Met(lchnk)%TAUCLW + ! Eventually initialize/reset wetdep IF ( Input_Opt%LConv .OR. Input_Opt%LChem .OR. Input_Opt%LWetD ) THEN CALL Setup_WetScav( am_I_Root = rootChunk, & @@ -1487,8 +1594,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Calculate State_Met etc for this timestep ! Use the CAM psdry fields instead of using the GC calculation !CALL Set_Dry_Surface_Pressure(State_Met(LCHNK), 1) - State_Met(LCHNK)%PS1_DRY (1,:) = state%psdry(:) - State_Met(LCHNK)%PS2_DRY (1,:) = state%psdry(:) + State_Met(LCHNK)%PS1_DRY (1,:) = State%PSDry(:) * 0.01e+0_fp + State_Met(LCHNK)%PS2_DRY (1,:) = State%PSDry(:) * 0.01e+0_fp ! Set surface pressures to match those in input State_Met(LCHNK)%PSC2_WET = State_Met(LCHNK)%PS1_WET From 646f1580276d2c14e3ffab614243bf0f625e3635 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 11:40:55 -0500 Subject: [PATCH 057/239] Feat: Add PBL height transfer capability (1) Enforce lat/lonMidArr to be R4 not FP --- src/chemistry/pp_geoschem/chemistry.F90 | 36 ++++++++++++++++++++----- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 5379774d04..a1a2ae27c7 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -95,6 +95,9 @@ module chemistry ! Indices of critical species INTEGER :: iH2O + ! Indices in the physics buffer + INTEGER :: NDX_PBLH + ! Strings CHARACTER(LEN=255) :: ThisLoc CHARACTER(LEN=255) :: ErrMsg @@ -442,7 +445,7 @@ subroutine chem_init(phys_state, pbuf2d) ! (and declare history variables) ! !----------------------------------------------------------------------- - use physics_buffer, only: physics_buffer_desc + use physics_buffer, only: physics_buffer_desc, pbuf_get_index use cam_history, only: addfld, add_default, horiz_only use mpishorthand @@ -455,7 +458,6 @@ subroutine chem_init(phys_state, pbuf2d) use DiagList_Mod, only : Init_DiagList, Print_DiagList use GC_Environment_Mod use GC_Grid_Mod, only : SetGridFromCtrEdges -!Check GC_Grid TMMF ! Use GEOS-Chem versions of physical constants use PhysConstants, only : PI, PI_180 @@ -484,6 +486,8 @@ subroutine chem_init(phys_state, pbuf2d) use Chemistry_Mod, only : Init_Chemistry use UCX_Mod, only : Init_UCX + use PBL_Mix_Mod, only : Init_PBL_Mix + TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) @@ -1093,6 +1097,14 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + CALL Init_PBL_Mix( am_I_Root = MasterProc, & + State_Grid = State_Grid(BEGCHUNK), & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_PBL_Mix"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ! Set grid-cell area DO I = BEGCHUNK, ENDCHUNK @@ -1203,6 +1215,9 @@ subroutine chem_init(phys_state, pbuf2d) ! Get the index of H2O iH2O = Ind_('H2O') + ! Get indices for physical fields in physics buffer + NDX_PBLH = pbuf_get_index('PBLH') + ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default CALL addfld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) @@ -1266,7 +1281,7 @@ subroutine GC_Update_Timesteps(DT) subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) - use physics_buffer, only: physics_buffer_desc + use physics_buffer, only: physics_buffer_desc, pbuf_get_field use cam_history, only: outfld use camsrfexch, only: cam_in_t, cam_out_t @@ -1319,6 +1334,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Zsurf, & ! Surface height Rlats, Rlons ! Chunk latitudes and longitudes (radians) + REAL(r8), POINTER :: PBLH(:) ! PBL height on each chunk REAL(r8) :: RelHum(State%NCOL, pver) ! Relative humidity [0-1] REAL(r8) :: SatV (State%NCOL, pver) ! Work arrays REAL(r8) :: SatQ (State%NCOL, pver) ! Work arrays @@ -1370,8 +1386,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) latMidArr = 0.0e+0_f4 DO I = 1, NX DO J = 1, NY - lonMidArr(I,J) = Rlons(J) - latMidArr(I,J) = Rlats(J) + lonMidArr(I,J) = REAL(Rlons(J), f4) + latMidArr(I,J) = REAL(Rlats(J), f4) ENDDO ENDDO @@ -1415,6 +1431,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Zenith( Calday, Rlats, Rlons, CSZA, NCOL ) !CALL Outfld( 'SZA', SZA, NCOL, LCHNK ) + ! Get PBL height (m) + CALL pbuf_get_field(pbuf, NDX_PBLH, PBLH) + ! Get VMR and MMR of H2O H2Ovmr = 0.0e0_fp QH2O = 0.0e0_fp @@ -1451,7 +1470,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%LAI (1,:) = 0.0e+0_fp State_Met(LCHNK)%PARDR (1,:) = 0.0e+0_fp State_Met(LCHNK)%PARDF (1,:) = 0.0e+0_fp - State_Met(LCHNK)%PBLH (1,:) = 0.0e+0_fp + State_Met(LCHNK)%PBLH (1,:) = PBLH(:NCOL) State_Met(LCHNK)%PHIS (1,:) = State%Phis(:) State_Met(LCHNK)%PRECANV (1,:) = 0.0e+0_fp State_Met(LCHNK)%PRECCON (1,:) = 0.0e+0_fp @@ -1548,6 +1567,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Calculate total OD as liquid cloud OD + ice cloud OD State_Met(lchnk)%OPTD = State_Met(lchnk)%TAUCLI + State_Met(lchnk)%TAUCLW + ! Nullify all pointers + NULLIFY(PBLH) + ! Eventually initialize/reset wetdep IF ( Input_Opt%LConv .OR. Input_Opt%LChem .OR. Input_Opt%LWetD ) THEN CALL Setup_WetScav( am_I_Root = rootChunk, & @@ -1752,6 +1774,7 @@ subroutine chem_final use Sulfate_Mod, only : Cleanup_Sulfate use Pressure_Mod, only : Cleanup_Pressure use Strat_Chem_Mod, only : Cleanup_Strat_Chem + use PBL_Mix_Mod, only : Cleanup_PBL_Mix use CMN_Size_Mod, only : Cleanup_CMN_Size use CMN_O3_Mod, only : Cleanup_CMN_O3 @@ -1777,6 +1800,7 @@ subroutine chem_final CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + CALL Cleanup_PBL_Mix CALL Cleanup_Pressure CALL Cleanup_Seasalt CALL Cleanup_Sulfate From 0f3eb89ee9c9a7f413e0107a11ad07afd9bc9f73 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 11:50:56 -0500 Subject: [PATCH 058/239] Feat: Enforce correct tracer registration --- src/chemistry/pp_geoschem/chemistry.F90 | 31 ++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index a1a2ae27c7..54b06cbd62 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -66,6 +66,7 @@ module chemistry character(len=255) :: tracernames(ntracersmax) integer :: indices(ntracersmax) real(r8) :: adv_mass(ntracersmax) + real(r8) :: ref_mmr(ntracersmax) ! Short-lived species (i.e. not advected) integer, parameter :: nslsmax = 500 ! UNadvected species only @@ -123,12 +124,13 @@ end function chem_is subroutine chem_register use physics_buffer, only : pbuf_add_field, dtype_r8 + use PhysConst, only : MWDry use State_Grid_Mod, only : Init_State_Grid, Cleanup_State_Grid use State_Chm_Mod, only : Init_State_Chm, Cleanup_State_Chm use State_Chm_Mod, only : Ind_ use Input_Opt_Mod, only : Set_Input_Opt, Cleanup_Input_Opt - USE Species_Mod, only : Species + use Species_Mod, only : Species !----------------------------------------------------------------------- ! @@ -144,6 +146,7 @@ subroutine chem_register INTEGER :: i, n REAL(r8) :: cptmp REAL(r8) :: qmin + REAL(r8) :: ref_vmr CHARACTER(LEN=128) :: mixtype CHARACTER(LEN=128) :: molectype CHARACTER(LEN=128) :: lng_name @@ -230,27 +233,17 @@ subroutine chem_register ThisSpc => SC%SpcData(N)%Info lng_name = TRIM(ThisSpc%FullName) adv_mass(I) = REAL(ThisSpc%MW_g,r8) + ref_vmr = REAL(ThisSpc%BackgroundVV,r8) + ref_mmr(I) = ref_vmr / (MWDry / adv_mass(I)) ELSE lng_name = TRIM(TRACERNAMES(I)) adv_mass(I) = 1000.0e+0_r8 * (0.001e+0_r8) + ref_mmr(I) = 1.0e-38_r8 ENDIF - !SELECT CASE (TRACERNAMES(I)) - ! CASE ('BCPI') - ! lng_name = 'Hydrophilic black carbon' - ! ! Molar mass (g/mol) - ! adv_mass(i) = 1000.0e+0_r8 * (0.012e+0_r8) - ! CASE ('OCS') - ! lng_name = 'Carbonyl sulfide' - ! ! Molar mass (g/mol) - ! adv_mass(i) = 1000.0e+0_r8 * (0.060e+0_r8) - ! CASE DEFAULT - ! lng_name = tracernames(i) - ! adv_mass(i) = 1000.0e+0_r8 * (0.001e+0_r8) - !END SELECT ! dummy value for specific heat of constant pressure (Cp) cptmp = 666._r8 ! minimum mixing ratio - qmin = 1.e-36_r8 + qmin = 1.e-38_r8 ! mixing ratio type mixtype = 'dry' ! Used for ionospheric WACCM (WACCM-X) @@ -274,7 +267,7 @@ subroutine chem_register ! Add to GC mapping. When starting a timestep, we will want to update the ! concentration of State_Chm(x)%Species(1,iCol,iLev,i) with data from ! constituent n - map2GC(n) = I + IF (I.LE.NTRACERS) map2GC(n) = I ! Nullify pointer ThisSpc => NULL() ENDDO @@ -1297,6 +1290,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Toms_Mod, only: Compute_Overhead_O3 use Chemistry_Mod, only: Do_Chemistry use Wetscav_Mod, only: Setup_Wetscav + use CMN_Size_Mod, only: PTop ! For calculating SZA use Orbit, only: zenith @@ -1368,6 +1362,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Need to update the timesteps throughout the code CALL GC_Update_Timesteps(dT) + ! For safety's sake + PTop = State%Pint(1,1)*0.01e+0_fp + ! Need to be super careful that the module arrays are updated and correctly ! set. NOTE: First thing - you'll need to flip all the data vertically @@ -1737,11 +1734,13 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) ! routines. INTEGER :: ILEV, NLEV + REAL(r8) :: QTemp if (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT_CNST' NLEV = SIZE(Q, 2) IF ( ANY( TRACERNAMES .EQ. NAME ) ) THEN + ! Retrieve a "background value" for this from the database DO ILEV=1,NLEV WHERE(MASK) ! Set to the minimum mixing ratio From 29887b6a69fb854c0674acc8295689ef26d51840 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 11:58:43 -0500 Subject: [PATCH 059/239] Feat: Add initialization of short-lived species --- src/chemistry/pp_geoschem/chemistry.F90 | 34 ++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 54b06cbd62..0dbacd5cae 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -72,6 +72,7 @@ module chemistry integer, parameter :: nslsmax = 500 ! UNadvected species only integer :: nsls character(len=255) :: slsnames(nslsmax) + real(r8) :: sls_ref_mmr(nslsmax) !===== SDE DEBUG ===== ! Location of valid input.geos @@ -82,6 +83,7 @@ module chemistry ! Mapping between constituents and GEOS-Chem tracers INTEGER :: map2GC(pcnst) + INTEGER :: map2GC_sls(nslsmax) !----------------------------- ! Derived type objects @@ -145,6 +147,7 @@ subroutine chem_register INTEGER :: i, n REAL(r8) :: cptmp + REAL(r8) :: mwtmp REAL(r8) :: qmin REAL(r8) :: ref_vmr CHARACTER(LEN=128) :: mixtype @@ -232,9 +235,10 @@ subroutine chem_register N = Ind_(TRACERNAMES(I)) ThisSpc => SC%SpcData(N)%Info lng_name = TRIM(ThisSpc%FullName) - adv_mass(I) = REAL(ThisSpc%MW_g,r8) + mwtmp = REAL(ThisSpc%MW_g,r8) ref_vmr = REAL(ThisSpc%BackgroundVV,r8) - ref_mmr(I) = ref_vmr / (MWDry / adv_mass(I)) + adv_mass(I) = mwtmp + ref_mmr(I) = ref_vmr / (MWDry / mwtmp) ELSE lng_name = TRIM(TRACERNAMES(I)) adv_mass(I) = 1000.0e+0_r8 * (0.001e+0_r8) @@ -272,6 +276,19 @@ subroutine chem_register ThisSpc => NULL() ENDDO + map2gc_sls = 0 + DO I = 1, nsls + N = Ind_(slsnames(I)) + IF (N.GT.0) THEN + ThisSpc => SC%SpcData(N)%Info + mwtmp = REAL(ThisSpc%MW_g,r8) + ref_vmr = REAL(ThisSpc%BackgroundVV,r8) + sls_ref_mmr(I) = ref_vmr / (mwdry / mwtmp) + map2gc_sls(I) = N + ThisSpc => NULL() + ENDIF + ENDDO + ! MOZART uses this for short-lived species. Not certain exactly what it ! does, but note that the "ShortLivedSpecies" physics buffer already ! needs to have been initialized, which we haven't done. Physics buffers @@ -1403,6 +1420,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! 2. Copy tracers into State_Chm ! Data was received in kg/kg dry State_Chm(LCHNK)%Spc_Units = 'kg/kg dry' + ! Initialize ALL State_Chm species data to zero, not just tracers + State_Chm(LCHNK)%Species = 0.0e+0_fp lq(:) = .FALSE. @@ -1418,9 +1437,18 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Chm(LCHNK)%Species(1,J,K,M) = REAL(mmr_beg(J,K,M),fp) ENDDO ENDDO - lq(n) = .TRUE. + lq(N) = .TRUE. ENDIF ENDDO + + ! TEMPORARY: initalize all unadvected species to background values + DO N = 1, nsls + M = map2gc_sls(N) + IF (M > 0) THEN + State_Chm(LCHNK)%Species(:,:,:,M) = REAL(sls_ref_mmr(N),fp) + ENDIF + ENDDO + CALL Physics_ptend_init(ptend, State%psetcols, 'chemistry', lq=lq) ! Calculate COS(SZA) From b1a536f2a5949000e5ac0a33d076129c0652fcef Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 12:11:12 -0500 Subject: [PATCH 060/239] Feat: Update surface area during chemistry loop --- src/chemistry/pp_geoschem/chemistry.F90 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 0dbacd5cae..75c8763311 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -1317,6 +1317,13 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use WV_Saturation, only: QSat use PhysConst, only: MWDry + ! Grid area + use PhysConstants, only: Re + use Phys_Grid, only: get_area_all_p + + ! Use GEOS-Chem versions of physical constants + use PhysConstants, only: PI, PI_180 + REAL(r8), INTENT(IN) :: dT ! Time step TYPE(physics_state), INTENT(IN) :: State ! Physics State variables TYPE(physics_ptend), INTENT(OUT) :: ptend ! indivdual parameterization tendencies @@ -1358,6 +1365,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(f4) :: lonMidArr(1,pcols), latMidArr(1,pcols) INTEGER :: iMaxLoc(1) + REAL(r8) :: Col_Area(State%NCOL) + ! Calculating SZA REAL(r8) :: Calday @@ -1417,6 +1426,16 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ! Set area + CALL Get_Area_All_p( LCHNK, NCOL, Col_Area ) + ! Set default value (in case of chunks with fewer columns) + State_Grid(LCHNK)%Area_M2 = 1.0e+10_fp + DO J = 1, NCOL + State_Grid(LCHNK)%Area_M2(1,J) = REAL(Col_Area(J) * Re**2,fp) + ENDDO + State_Met(LCHNK)%Area_M2 = State_Grid(LCHNK)%Area_M2 + + ! 2. Copy tracers into State_Chm ! Data was received in kg/kg dry State_Chm(LCHNK)%Spc_Units = 'kg/kg dry' From 387ffcbae437ec8425db8fb9bb6af6fbde21abbd Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 17:16:10 -0400 Subject: [PATCH 061/239] Feat: Use reference MMRs when queried for ICs (1) Zero reference MMRs at initialization (2) Use reference MMRs when queried for initial conditions --- src/chemistry/pp_geoschem/chemistry.F90 | 35 +++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 75c8763311..f108376d20 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -229,6 +229,7 @@ subroutine chem_register ! At the moment, we force nadv_chem=200 in the setup file ! Default map2GC = -1 + ref_mmr(:) = 0.0e+0_r8 DO I = 1, NTRACERSMAX IF (I.LE.NTRACERS) THEN @@ -277,6 +278,7 @@ subroutine chem_register ENDDO map2gc_sls = 0 + sls_ref_mmr(:) = 0.0e+0_r8 DO I = 1, nsls N = Ind_(slsnames(I)) IF (N.GT.0) THEN @@ -1736,8 +1738,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !IF (MasterProc) WRITE(iulog,*) ' --> TEND SIZE: ', size(State%ncol) !IF (MasterProc) WRITE(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(State%ncol),ubound(State%ncol) - IF ( rootChunk ) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_TEND' - ! Make sure State_Chm(lchnk) is back in kg/kg dry! ! Reset H2O MMR to the initial value (no chemistry tendency in H2O just @@ -1764,6 +1764,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO IF (present(fh2o)) fh2o(:) = 0.0e+0_r8 + IF (rootChunk) WRITE(iulog,'(a)') ' GEOS-Chem chemistry step completed' RETURN end subroutine chem_timestep_tend @@ -1780,21 +1781,27 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) ! Will need a simple mapping structure as well as the CAM tracer registration ! routines. - INTEGER :: ILEV, NLEV - REAL(r8) :: QTemp + INTEGER :: ILEV, NLEV, I + REAL(r8) :: QTemp, Min_MMR - if (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT_CNST' + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT_CNST' NLEV = SIZE(Q, 2) - IF ( ANY( TRACERNAMES .EQ. NAME ) ) THEN - ! Retrieve a "background value" for this from the database - DO ILEV=1,NLEV - WHERE(MASK) - ! Set to the minimum mixing ratio - q(:,ILEV) = 1.0e-38_r8 - ENDWHERE - ENDDO - ENDIF + ! Retrieve a "background value" for this from the database + Min_MMR = 1.0e-38_r8 + DO I = 1, NTracers + IF (TRIM(TracerNames(I)).eq.TRIM(name)) THEN + Min_MMR = Ref_MMR(i) + EXIT + ENDIF + ENDDO + + DO ILEV=1,NLEV + WHERE(MASK) + ! Set to the minimum mixing ratio + Q(:,ILEV) = Min_MMR + ENDWHERE + ENDDO end subroutine chem_init_cnst From 6929131353419078d9aaa8bb79d1683ccf1b3d09 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 12:31:56 -0500 Subject: [PATCH 062/239] Feat: Groundwork for correctly reporing H2O tendencies (1) Add indices to key species --- src/chemistry/pp_geoschem/chemistry.F90 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index f108376d20..9beafa9a4e 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -96,7 +96,7 @@ module chemistry TYPE(DgnList ) :: Diag_List ! Diagnostics list object ! Indices of critical species - INTEGER :: iH2O + INTEGER :: iH2O, iO3, iCH4, iCO ! Indices in the physics buffer INTEGER :: NDX_PBLH @@ -1226,6 +1226,9 @@ subroutine chem_init(phys_state, pbuf2d) ! Get the index of H2O iH2O = Ind_('H2O') + iO3 = Ind_('O3') + iCH4 = Ind_('CH4') + iCO = Ind_('CO') ! Get indices for physical fields in physics buffer NDX_PBLH = pbuf_get_index('PBLH') @@ -1320,6 +1323,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use PhysConst, only: MWDry ! Grid area + use PhysConst, only: Gravit use PhysConstants, only: Re use Phys_Grid, only: get_area_all_p @@ -1762,7 +1766,13 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDIF ENDDO - IF (present(fh2o)) fh2o(:) = 0.0e+0_r8 + + IF (PRESENT(fh2o)) THEN + fh2o(:NCOL) = 0.0e+0_r8 + !DO K = 1, pver + ! fh2o(:NCOL) = fh2o(:NCOL) + Ptend%Q(:NCOL,K,iH2O)*State%Pdel(:NCOL,K)/Gravit + !ENDDO + ENDIF IF (rootChunk) WRITE(iulog,'(a)') ' GEOS-Chem chemistry step completed' RETURN From bad9b4d67c9ef85f559993b9cfeb941ed96eb984 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 17:26:16 -0400 Subject: [PATCH 063/239] Feat: Add all advected species to output (1) Add advected species to output (2) Force precision of H2O to be r8 (3) Fixed capitalization of variables --- bld/namelist_files/use_cases/geoschem.xml | 12 +- src/chemistry/pp_geoschem/chemistry.F90 | 263 ++++++++++++++-------- 2 files changed, 174 insertions(+), 101 deletions(-) diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 12c343e218..3278d1f96e 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -50,12 +50,16 @@ 2000 - 1 - 0 - 'A' + 1, 24 + 0, -1 + 'A', 'A' - 'Q', 'U', 'V', 'OMEGA', 'T', 'PS', 'BCPI', + 'Q', 'U', 'V', 'OMEGA', 'T', 'PS', + + 'O3', 'NO', 'NO2', 'CO', 'HNO3', 'CH4', + + diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 9beafa9a4e..f29899425a 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -61,18 +61,22 @@ module chemistry ! Private data !===== SDE DEBUG ===== - integer, parameter :: ntracersmax = 200 ! Must be equal to nadv_chem - integer :: ntracers - character(len=255) :: tracernames(ntracersmax) - integer :: indices(ntracersmax) - real(r8) :: adv_mass(ntracersmax) - real(r8) :: ref_mmr(ntracersmax) + integer, parameter :: NTracersMax = 200 ! Must be equal to nadv_chem + integer :: NTracers + character(len=255) :: TracerNames(NTracersMax) + character(len=255) :: TracerLongNames(NTracersMax) + integer :: Indices(NTracersMax) + real(r8) :: Adv_Mass(NTracersMax) + real(r8) :: MWRatio(NTracersMax) + real(r8) :: Ref_MMR(NTracersMax) ! Short-lived species (i.e. not advected) - integer, parameter :: nslsmax = 500 ! UNadvected species only - integer :: nsls - character(len=255) :: slsnames(nslsmax) - real(r8) :: sls_ref_mmr(nslsmax) + integer, parameter :: NSlsMax = 500 ! UNadvected species only + integer :: NSls + character(len=255) :: SlsNames(NSlsMax) + character(len=255) :: SlsLongNames(NSlsMax) + real(r8) :: Sls_Ref_MMR(NSlsMax) + real(r8) :: SLSMWRatio(NSlsMax) !===== SDE DEBUG ===== ! Location of valid input.geos @@ -82,8 +86,11 @@ module chemistry CHARACTER(LEN=500) :: chemInputsDir ! Mapping between constituents and GEOS-Chem tracers - INTEGER :: map2GC(pcnst) - INTEGER :: map2GC_sls(nslsmax) + INTEGER :: Map2GC(pcnst) + INTEGER :: Map2GC_Sls(NSlsMax) + + ! Mapping from constituents to raw index + INTEGER :: Map2Idx(pcnst) !----------------------------- ! Derived type objects @@ -145,14 +152,14 @@ subroutine chem_register Type(OptInput) :: IO TYPE(Species), POINTER :: ThisSpc - INTEGER :: i, n + INTEGER :: I, N, M REAL(r8) :: cptmp REAL(r8) :: mwtmp REAL(r8) :: qmin - REAL(r8) :: ref_vmr + REAL(r8) :: Ref_VMR CHARACTER(LEN=128) :: mixtype CHARACTER(LEN=128) :: molectype - CHARACTER(LEN=128) :: lng_name + CHARACTER(LEN=128) :: Lng_Name LOGICAL :: camout LOGICAL :: ic_from_cam2 LOGICAL :: has_fixed_ubc @@ -228,23 +235,29 @@ subroutine chem_register ! At the moment, we force nadv_chem=200 in the setup file ! Default - map2GC = -1 - ref_mmr(:) = 0.0e+0_r8 + Map2GC = -1 + Ref_MMR(:) = 0.0e+0_r8 + MWRatio(:) = 1.0e+0_r8 + TracerLongNames = '' DO I = 1, NTRACERSMAX IF (I.LE.NTRACERS) THEN - N = Ind_(TRACERNAMES(I)) + N = Ind_(TracerNames(I)) ThisSpc => SC%SpcData(N)%Info - lng_name = TRIM(ThisSpc%FullName) - mwtmp = REAL(ThisSpc%MW_g,r8) - ref_vmr = REAL(ThisSpc%BackgroundVV,r8) - adv_mass(I) = mwtmp - ref_mmr(I) = ref_vmr / (MWDry / mwtmp) + Lng_Name = TRIM(ThisSpc%FullName) + MWTmp = REAL(ThisSpc%MW_g,r8) + Ref_VMR = REAL(ThisSpc%BackgroundVV,r8) + Adv_Mass(I) = MWTmp + Ref_MMR(I) = Ref_VMR / (MWDry / MWTmp) ELSE - lng_name = TRIM(TRACERNAMES(I)) - adv_mass(I) = 1000.0e+0_r8 * (0.001e+0_r8) - ref_mmr(I) = 1.0e-38_r8 + Lng_Name = TRIM(TracerNames(I)) + MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) + Adv_Mass(I) = MWTmp + Ref_MMR(I) = 1.0e-38_r8 ENDIF + MWRatio(I) = MWDry/MWTmp + TracerLongNames(I) = TRIM(Lng_Name) + ! dummy value for specific heat of constant pressure (Cp) cptmp = 666._r8 ! minimum mixing ratio @@ -270,23 +283,32 @@ subroutine chem_register fixed_ubflx=has_fixed_ubflx, longname=trim(lng_name) ) ! Add to GC mapping. When starting a timestep, we will want to update the - ! concentration of State_Chm(x)%Species(1,iCol,iLev,i) with data from + ! concentration of State_Chm(x)%Species(1,iCol,iLev,m) with data from ! constituent n - IF (I.LE.NTRACERS) map2GC(n) = I + M = Ind_(TRIM(TracerNames(I))) + IF ( M > 0 ) THEN + Map2GC(N) = M + Map2Idx(N) = I + ENDIF ! Nullify pointer ThisSpc => NULL() ENDDO - map2gc_sls = 0 - sls_ref_mmr(:) = 0.0e+0_r8 - DO I = 1, nsls - N = Ind_(slsnames(I)) + Map2GC_Sls = 0 + Sls_Ref_MMR(:) = 0.0e+0_r8 + SlsMWRatio(:) = -1.0e+0_r8 + SlsLongNames = '' + DO I = 1, NSls + N = Ind_(SlsNames(I)) IF (N.GT.0) THEN ThisSpc => SC%SpcData(N)%Info - mwtmp = REAL(ThisSpc%MW_g,r8) - ref_vmr = REAL(ThisSpc%BackgroundVV,r8) - sls_ref_mmr(I) = ref_vmr / (mwdry / mwtmp) - map2gc_sls(I) = N + MWTmp = REAL(ThisSpc%MW_g,r8) + Ref_VMR = REAL(ThisSpc%BackgroundVV,r8) + Lng_Name = TRIM(ThisSpc%FullName) + SlsLongNames(I) = Lng_Name + Sls_Ref_MMR(I) = Ref_VMR / (MWDry / MWTmp) + SlsMWRatio(I) = MWDry / MWTmp + Map2GC_Sls(I) = N ThisSpc => NULL() ENDIF ENDDO @@ -298,7 +320,7 @@ subroutine chem_register ! modules outside of chemistry ! More information: ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html - !call pbuf_add_field('ShortLivedSpecies','global',dtype_r8,(/pcols,pver,nslvd/),pbf_idx) + !call pbuf_add_field('ShortLivedSpecies','global',dtype_r8,(/PCOLS,PVER,NSlvd/),pbf_idx) ! returned values ! n : mapping in CAM ! map2chm is a mozart variable @@ -377,11 +399,11 @@ subroutine chem_readnl(nlfile) ! Now go through the KPP mechanism and add any species not implemented by ! the tracer list in input.geos - IF ( NSPEC > NSLSMAX ) THEN - CALL ENDRUN('chem_readnl: too many species - increase nslsmax') + IF ( NSPEC > NSlsMax ) THEN + CALL ENDRUN('chem_readnl: too many species - increase NSlsmax') ENDIF - NSLS = 0 + NSls = 0 DO I=1,NSPEC ! Get the name of the species from KPP LINE = ADJUSTL(TRIM(SPC_NAMES(I))) @@ -390,19 +412,19 @@ subroutine chem_readnl(nlfile) (.NOT.(LINE(1:2) == 'RR')) ) IF (validSLS) THEN ! Genuine new short-lived species - NSLS = NSLS + 1 - SLSNAMES(NSLS) = TRIM(LINE) - WRITE(iulog,'(a,I5,a,a)') ' --> GC species ',nsls, ': ', TRIM(LINE) + NSls = NSls + 1 + SLSNAMES(NSls) = TRIM(LINE) + WRITE(iulog,'(a,I5,a,a)') ' --> GC species ', NSls, ': ', TRIM(LINE) ENDIF ENDDO ENDIF ! Broadcast to all processors #if defined( SPMD ) - CALL MPIBCAST(NTRACERS, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(TRACERNAMES, LEN(TRACERNAMES(1))*NTRACERSMAX, MPICHAR, 0, MPICOM ) - CALL MPIBCAST(NSLS, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(SLSNAMES, LEN(SLSNAMES(1))*NSLSMAX, MPICHAR, 0, MPICOM ) + CALL MPIBCAST(NTracers, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST(TracerNames, LEN(TracerNames(1))*NTracersMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST(NSls, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST(SlsNames, LEN(SlsNames(1))*NSlsMax, MPICHAR, 0, MPICOM ) #endif end subroutine chem_readnl @@ -523,7 +545,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Strings CHARACTER(LEN=255) :: historyConfigFile - + CHARACTER(LEN=255) :: SpcName ! Grid setup REAL(fp) :: lonVal, latVal @@ -1221,9 +1243,6 @@ subroutine chem_init(phys_state, pbuf2d) & State_Grid = State_Grid(BEGCHUNK) ) ENDIF - ! Init_PBL_Mix... - ! Convert_Spc_Units... - ! Get the index of H2O iH2O = Ind_('H2O') iO3 = Ind_('O3') @@ -1235,8 +1254,21 @@ subroutine chem_init(phys_state, pbuf2d) ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default - CALL addfld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) - CALL add_default ( 'BCPI', 1, ' ') + ! Add all species as output fields if desired + DO I = 1, NTracers + SpcName = TRIM(TracerNames(I)) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(TracerLongNames(I))//' concentration') + IF (TRIM(SpcName) == 'O3') THEN + CALL Add_Default ( TRIM(SpcName), 1, ' ') + ENDIF + ENDDO + DO I =1, NSls + SpcName = TRIM(SlsNames(I)) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(SlsLongNames(I))//' concentration') + !CALL Add_Default(TRIM(SpcName), 1, '') + ENDDO + !CALL AddFld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) + !CALL Add_Default ( 'BCPI', 1, ' ') IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT' @@ -1336,12 +1368,12 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) TYPE(cam_in_t), INTENT(INOUT) :: cam_in TYPE(cam_out_t), INTENT(IN) :: cam_out TYPE(physics_buffer_desc), POINTER :: pbuf(:) - REAL(r8), OPTIONAL, INTENT(OUT) :: fh2o(pcols) ! h2o flux to balance source from chemistry + REAL(r8), OPTIONAL, INTENT(OUT) :: fh2o(PCOLS) ! h2o flux to balance source from chemistry ! Initial MMR for all species - REAL(r8) :: mmr_beg(pcols,pver,nsls+ntracers) - REAL(r8) :: mmr_end(pcols,pver,nsls+ntracers) - REAL(r8) :: mmr_tend(pcols,pver,nsls+ntracers) + REAL(r8) :: MMR_Beg(PCOLS,PVER,NSls+NTracers) + REAL(r8) :: MMR_End(PCOLS,PVER,NSls+NTracers) + REAL(r8) :: MMR_TEnd(PCOLS,PVER,NSls+NTracers) ! Mapping (?) @@ -1359,16 +1391,16 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Rlats, Rlons ! Chunk latitudes and longitudes (radians) REAL(r8), POINTER :: PBLH(:) ! PBL height on each chunk - REAL(r8) :: RelHum(State%NCOL, pver) ! Relative humidity [0-1] - REAL(r8) :: SatV (State%NCOL, pver) ! Work arrays - REAL(r8) :: SatQ (State%NCOL, pver) ! Work arrays - REAL(r8) :: QH2O (State%NCOL, pver) ! Specific humidity [kg/kg] - REAL(r8) :: H2Ovmr(State%NCOL, pver) ! H2O volume mixing ratio + REAL(r8) :: RelHum(State%NCOL, PVER) ! Relative humidity [0-1] + REAL(r8) :: SatV (State%NCOL, PVER) ! Work arrays + REAL(r8) :: SatQ (State%NCOL, PVER) ! Work arrays + REAL(r8) :: QH2O (State%NCOL, PVER) ! Specific humidity [kg/kg] + REAL(r8) :: H2OVMR(State%NCOL, PVER) ! H2O volume mixing ratio ! Because of strat chem LOGICAL, SAVE :: SCHEM_READY = .FALSE. - REAL(f4) :: lonMidArr(1,pcols), latMidArr(1,pcols) + REAL(f4) :: lonMidArr(1,PCOLS), latMidArr(1,PCOLS) INTEGER :: iMaxLoc(1) REAL(r8) :: Col_Area(State%NCOL) @@ -1376,16 +1408,17 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Calculating SZA REAL(r8) :: Calday + ! For archiving + CHARACTER(LEN=255) :: SpcName + REAL(r8) :: VMR(State%NCOL,PVER) + REAL(r8) :: MMR0, MMR1, Mass0, Mass1, AirMass, Mass10r, Mass10a + LOGICAL :: rootChunk INTEGER :: RC - ! Here's where you'll call DO_CHEMISTRY - ! NOTE: State_Met etc are in an ARRAY - so we will want to always pass - ! State_Met%(lchnk) and so on - - ! lchnk: which chunk we have on this process + ! LCHNK: which chunk we have on this process LCHNK = State%LCHNK - ! ncol: number of atmospheric columns on this chunk + ! NCOL: number of atmospheric columns on this chunk NCOL = State%NCOL ! Am I the first chunk on the first CPU? @@ -1450,16 +1483,16 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) lq(:) = .FALSE. - mmr_beg = 0.0e+0_r8 + MMR_Beg = 0.0e+0_r8 DO N = 1, pcnst - M = map2GC(N) + M = Map2GC(N) IF (M > 0) THEN I = 1 DO J = 1, NCOL - DO K = 1, pver + DO K = 1, PVER ! CURRENTLY KG/KG DRY - mmr_beg(J,K,M) = State%q(J,pver+1-K,N) - State_Chm(LCHNK)%Species(1,J,K,M) = REAL(mmr_beg(J,K,M),fp) + MMR_Beg(J,K,M) = State%q(J,PVER+1-K,N) + State_Chm(LCHNK)%Species(1,J,K,M) = REAL(MMR_Beg(J,K,M),fp) ENDDO ENDDO lq(N) = .TRUE. @@ -1467,10 +1500,10 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ! TEMPORARY: initalize all unadvected species to background values - DO N = 1, nsls - M = map2gc_sls(N) + DO N = 1, NSls + M = Map2GC_Sls(N) IF (M > 0) THEN - State_Chm(LCHNK)%Species(:,:,:,M) = REAL(sls_ref_mmr(N),fp) + State_Chm(LCHNK)%Species(:,:,:,M) = REAL(Sls_Ref_MMR(N),fp) ENDIF ENDDO @@ -1485,14 +1518,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL pbuf_get_field(pbuf, NDX_PBLH, PBLH) ! Get VMR and MMR of H2O - H2Ovmr = 0.0e0_fp + H2OVMR = 0.0e0_fp QH2O = 0.0e0_fp ! Note MWDRY = 28.966 g/mol DO J = 1, NY DO L = 1, NZ - QH2O(J,L) = State_Chm(LCHNK)%Species(1,J,K,iH2O) - H2Ovmr(J,L) = QH2O(J,L) * MWDry / 18.016e+0_fp + QH2O(J,L) = REAL(State_Chm(LCHNK)%Species(1,J,K,iH2O),r8) + H2OVMR(J,L) = QH2O(J,L) * MWDry / 18.016e+0_fp ENDDO ENDDO @@ -1501,7 +1534,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL QSat(State%T(:NCOL,:), State%Pmid(:NCOL,:), SatV, SatQ) DO J = 1, NY DO L = 1, NZ - RELHUM(J,L) = 0.622e+0_r8 * H2Ovmr(J,L) / SatQ(J,L) + RELHUM(J,L) = 0.622e+0_r8 * H2OVMR(J,L) / SatQ(J,L) RELHUM(J,L) = MAX( 0.0e+0_r8, MIN( 1.0e+0_r8, RELHUM(J,L) ) ) ENDDO ENDDO @@ -1700,7 +1733,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Initialize strat chem if not already done. This has to be done here because ! it needs to have non-zero values in State_Chm%AD, which only happens after ! the first call to AirQnt - IF ( (.not.schem_ready) .and. Input_Opt%LSCHEM ) THEN + IF ( (.not.SCHEM_READY) .and. Input_Opt%LSCHEM ) THEN CALL Init_Strat_Chem( am_I_Root = rootChunk, & Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & @@ -1712,7 +1745,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ErrMsg = 'Could not initialize strat-chem!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - schem_ready = .True. + SCHEM_READY = .True. ENDIF ! Run chemistry @@ -1739,29 +1772,65 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) - !IF (MasterProc) WRITE(iulog,*) ' --> TEND SIZE: ', size(State%ncol) - !IF (MasterProc) WRITE(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(State%ncol),ubound(State%ncol) + !IF (MasterProc) WRITE(iulog,*) ' --> TEND SIZE: ', size(State%NCOL) + !IF (MasterProc) WRITE(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(State%NCOL),ubound(State%NCOL) ! Make sure State_Chm(lchnk) is back in kg/kg dry! ! Reset H2O MMR to the initial value (no chemistry tendency in H2O just ! yet) - State_Chm(LCHNK)%Species(1,:,:,iH2O) = mmr_beg(:,:,iH2O) + State_Chm(LCHNK)%Species(1,:,:,iH2O) = MMR_Beg(:,:,iH2O) + + ! Write diagnostic output + DO N=1, pcnst + M = Map2GC(N) + I = Map2IDX(N) + IF ( M > 0 ) THEN + SpcName = TracerNames(I) + VMR = 0.0e+0_r8 + Mass0 = 0.0e+0_r8 + Mass1 = 0.0e+0_r8 + DO J = 1, NCOL + DO K = 1, PVER + AirMass = REAL(State_Met(LCHNK)%AD(1,J,K),r8) + MMR0 = MMR_Beg(J,K,M) + MMR1 = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) + VMR(J,PVER+1-K) = MMR1 * MWRatio(I) + Mass0 = Mass0 + (MMR0*AirMass) + Mass1 = Mass1 + (MMR1*AirMass) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), VMR(:NCOL,:), NCOL, LCHNK ) + ENDIF + ENDDO + DO N = 1, NSls + SpcName = SlsNames(n) + VMR = 0.0e+0_r8 + M = Map2GC_Sls(n) + IF ( M > 0 ) THEN + DO J = 1, NCOL + DO K = 1, PVER + VMR(J,PVER+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * SLSMWratio(N) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), VMR(:NCOL,:), NCOL, LCHNK ) + ENDIF + ENDDO ! NOTE: Re-flip all the arrays vertically or suffer the consequences ! ptend%q dimensions: [column, ?, species] - ptend%q(:,:,:) = 0.0e+0_r8 - mmr_end = 0.0e+0_r8 + Ptend%Q(:,:,:) = 0.0e+0_r8 + MMR_End = 0.0e+0_r8 DO N = 1, pcnst - M = map2GC(N) + M = Map2GC(N) IF (M > 0) THEN I = 1 DO J = 1, NCOL - DO K = 1, pver + DO K = 1, PVER ! CURRENTLY KG/KG - mmr_end (J,K,M) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) - mmr_tend(J,K,M) = mmr_end(J,K,M) - mmr_beg(J,K,M) - ptend%q(J,pver+1-K,N) = (mmr_end(J,K,M)-mmr_beg(J,K,M))/dT + MMR_End (J,K,M) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) + MMR_TEnd(J,K,M) = MMR_End(J,K,M) - MMR_Beg(J,K,M) + ptend%q(J,PVER+1-K,N) = (MMR_End(J,K,M)-MMR_Beg(J,K,M))/dT ENDDO ENDDO ENDIF @@ -1769,7 +1838,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF (PRESENT(fh2o)) THEN fh2o(:NCOL) = 0.0e+0_r8 - !DO K = 1, pver + !DO K = 1, PVER ! fh2o(:NCOL) = fh2o(:NCOL) + Ptend%Q(:NCOL,K,iH2O)*State%Pdel(:NCOL,K)/Gravit !ENDDO ENDIF @@ -1783,10 +1852,10 @@ end subroutine chem_timestep_tend subroutine chem_init_cnst(name, latvals, lonvals, mask, q) CHARACTER(LEN=*), INTENT(IN) :: name ! constituent name - REAL(r8), INTENT(IN) :: latvals(:) ! lat in degrees (ncol) - REAL(r8), INTENT(IN) :: lonvals(:) ! lon in degrees (ncol) + REAL(r8), INTENT(IN) :: latvals(:) ! lat in degrees (NCOL) + REAL(r8), INTENT(IN) :: lonvals(:) ! lon in degrees (NCOL) LOGICAL, INTENT(IN) :: mask(:) ! Only initialize where .true. - REAL(r8), INTENT(OUT) :: q(:,:) ! kg tracer/kg dry air (ncol, pver + REAL(r8), INTENT(OUT) :: q(:,:) ! kg tracer/kg dry air (NCOL, PVER ! Used to initialize tracer fields if desired. ! Will need a simple mapping structure as well as the CAM tracer registration ! routines. From e7995cac1c232ee893c165e87b191c1e6add25d6 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 14:46:02 -0500 Subject: [PATCH 064/239] Feat: Make short-lived species persist between time steps --- src/chemistry/pp_geoschem/chem_mods.F90 | 9 +- src/chemistry/pp_geoschem/chemistry.F90 | 83 +++++++++++++++---- .../pp_geoschem/short_lived_species.F90 | 36 ++++---- 3 files changed, 95 insertions(+), 33 deletions(-) diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/pp_geoschem/chem_mods.F90 index ac8e66440d..b9d2b15dd6 100644 --- a/src/chemistry/pp_geoschem/chem_mods.F90 +++ b/src/chemistry/pp_geoschem/chem_mods.F90 @@ -24,8 +24,8 @@ module chem_mods indexh2o = 4, & ! index of water vapor density clsze = 1, & ! loop length for implicit chemistry rxt_tag_cnt = 95, & - enthalpy_cnt = 0, & - nslvd = 0 + enthalpy_cnt = 0 +! nslvd = 0 integer :: clscnt(5) = 0 integer :: cls_rxt_cnt(4,5) = 0 integer :: clsmap(gas_pcnst,5) = 0 @@ -46,5 +46,8 @@ module chem_mods logical :: frc_from_dataset(max(1,extcnt)) logical :: is_vector logical :: is_scalar - character(len=16) :: slvd_lst(max(1,nslvd)) +! character(len=16) :: slvd_lst(max(1,nslvd)) + integer :: nslvd + character(len=255), allocatable :: slvd_lst(:) + real(r8), allocatable :: slvd_ref_mmr(:) end module chem_mods diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index f29899425a..8620a6b61c 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -34,6 +34,8 @@ module chemistry !----------------------------------------------------------------- USE PRECISION_MOD, ONLY : fp, f4 ! Flexible precision + use Chem_Mods, only : NSlvd, Slvd_Lst, Slvd_Ref_MMR + ! Exit routine in CAM use cam_abortutils, only : endrun @@ -135,6 +137,8 @@ subroutine chem_register use physics_buffer, only : pbuf_add_field, dtype_r8 use PhysConst, only : MWDry + use Short_Lived_Species, only : Register_Short_Lived_Species + use State_Grid_Mod, only : Init_State_Grid, Cleanup_State_Grid use State_Chm_Mod, only : Init_State_Chm, Cleanup_State_Chm use State_Chm_Mod, only : Ind_ @@ -294,6 +298,7 @@ subroutine chem_register ThisSpc => NULL() ENDDO + ! Now unadvected species Map2GC_Sls = 0 Sls_Ref_MMR(:) = 0.0e+0_r8 SlsMWRatio(:) = -1.0e+0_r8 @@ -313,20 +318,11 @@ subroutine chem_register ENDIF ENDDO - ! MOZART uses this for short-lived species. Not certain exactly what it - ! does, but note that the "ShortLivedSpecies" physics buffer already - ! needs to have been initialized, which we haven't done. Physics buffers - ! are fields which are available either across timesteps or for use to - ! modules outside of chemistry + ! Pass information to "short_lived_species" module + Slvd_Ref_MMR(1:NSls) = Sls_Ref_MMR(1:NSls) + CALL Register_Short_Lived_Species() ! More information: ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html - !call pbuf_add_field('ShortLivedSpecies','global',dtype_r8,(/PCOLS,PVER,NSlvd/),pbf_idx) - ! returned values - ! n : mapping in CAM - ! map2chm is a mozart variable - !map2chm(n) = i - !indices(i) = 0 - ! ===== SDE DEBUG ===== ! Clean up Call Cleanup_State_Chm ( .False., SC, RC ) @@ -427,6 +423,16 @@ subroutine chem_readnl(nlfile) CALL MPIBCAST(SlsNames, LEN(SlsNames(1))*NSlsMax, MPICHAR, 0, MPICOM ) #endif + ! Update "short_lived_species" arrays - will eventually unify these + NSlvd = NSls + ALLOCATE(Slvd_Lst(NSlvd), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Slvd_Lst') + ALLOCATE(Slvd_Ref_MMR(NSlvd), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Slvd_Ref_MMR') + DO I=1,NSls + Slvd_Lst(I) = TRIM(SlsNames(I)) + ENDDO + end subroutine chem_readnl !================================================================================================ @@ -557,6 +563,8 @@ subroutine chem_init(phys_state, pbuf2d) REAL(r8), ALLOCATABLE :: Col_Area(:) REAL(fp), ALLOCATABLE :: Ap_CAM_Flip(:), Bp_CAM_Flip(:) + REAL(r8), POINTER :: SlsPtr(:,:,:) + ! Assume a successful return until otherwise RC = GC_SUCCESS @@ -579,6 +587,18 @@ subroutine chem_init(phys_state, pbuf2d) NY = MAXVAL(NCOL) NZ = NLEV + !! Add short lived speies to buffers + !CALL Pbuf_add_field(Trim(SLSBuffer),'global',dtype_r8,(/PCOLS,PVER,NSls/),Sls_Pbf_Idx) + !! Initialize + !ALLOCATE(SlsPtr(PCOLS,PVER,BEGCHUNK:ENDCHUNK), STAT=IERR) + !IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating SlsPtr') + !SlsPtr(:,:,:) = 0.0e+0_r8 + !DO I=1,NSls + ! SlsPtr(:,:,:) = Sls_Ref_MMR(I) + ! CALL pbuf_set_field(pbuf2d,Sls_Pbf_Idx,SlsPtr,start=(/1,1,i/),kount=(/PCOLS,PVER,1/)) + !ENDDO + !DEALLOCATE(SlsPtr) + ! This ensures that each process allocates everything needed for its chunks ALLOCATE(State_Chm(BEGCHUNK:ENDCHUNK) , STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Chm') @@ -1359,6 +1379,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use PhysConstants, only: Re use Phys_Grid, only: get_area_all_p + use Short_Lived_Species, only : Get_Short_Lived_Species + use Short_Lived_Species, only : Set_Short_Lived_Species + ! Use GEOS-Chem versions of physical constants use PhysConstants, only: PI, PI_180 @@ -1412,6 +1435,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CHARACTER(LEN=255) :: SpcName REAL(r8) :: VMR(State%NCOL,PVER) REAL(r8) :: MMR0, MMR1, Mass0, Mass1, AirMass, Mass10r, Mass10a + REAL(r8) :: MMR_Min, MMR_Max + + REAL(r8) :: SlsData(State%NCOL, PVER, NSls) LOGICAL :: rootChunk INTEGER :: RC @@ -1499,14 +1525,23 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDDO - ! TEMPORARY: initalize all unadvected species to background values + ! Retrieve previous value of species data + SlsData(:,:,:) = 0.0e+0_r8 + CALL Get_Short_Lived_Species( SlsData, LCHNK, NCOL, Pbuf ) + + ! Remap and flip them DO N = 1, NSls M = Map2GC_Sls(N) IF (M > 0) THEN - State_Chm(LCHNK)%Species(:,:,:,M) = REAL(Sls_Ref_MMR(N),fp) + DO J = 1, NCOL + DO K = 1, PVER + State_Chm(LCHNK)%Species(1,J,K,M) = REAL(SlsData(J,PVER+1-K,N),fp) + ENDDO + ENDDO ENDIF ENDDO + ! Initialize tendency array CALL Physics_ptend_init(ptend, State%psetcols, 'chemistry', lq=lq) ! Calculate COS(SZA) @@ -1781,6 +1816,23 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! yet) State_Chm(LCHNK)%Species(1,:,:,iH2O) = MMR_Beg(:,:,iH2O) + ! Store unadvected species data + SlsData = 0.0e+0_r8 + DO N = 1, NSls + M = MAP2GC_Sls(N) + IF ( M > 0 ) THEN + Mass1 = 0.0e+0_r8 + MMR_Min = 1.0e+9_r8 + MMR_Max = 0.0e+0_r8 + DO J = 1, NCOL + DO K = 1, PVER + SlsData(J,PVER+1-K,N) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) + ENDDO + ENDDO + ENDIF + ENDDO + CALL Set_Short_Lived_Species( SlsData, LCHNK, NCOL, Pbuf ) + ! Write diagnostic output DO N=1, pcnst M = Map2GC(N) @@ -1990,7 +2042,8 @@ subroutine chem_final IF (ALLOCATED(State_Grid)) DEALLOCATE(State_Grid) IF (ALLOCATED(State_Met)) DEALLOCATE(State_Met) - IF (MasterProc) WRITE(iulog,'(a,4(x,L1))') ' --> DEALLOC CHECK : ', ALLOCATED(State_Chm), ALLOCATED(State_Diag), ALLOCATED(State_Grid), ALLOCATED(State_Met) + IF (ALLOCATED(Slvd_Lst )) DEALLOCATE(Slvd_Lst) + IF (ALLOCATED(Slvd_Ref_MMR)) DEALLOCATE(Slvd_Ref_MMR) RETURN diff --git a/src/chemistry/pp_geoschem/short_lived_species.F90 b/src/chemistry/pp_geoschem/short_lived_species.F90 index 9e71d6f91c..0b1d3c1078 100644 --- a/src/chemistry/pp_geoschem/short_lived_species.F90 +++ b/src/chemistry/pp_geoschem/short_lived_species.F90 @@ -7,7 +7,7 @@ module short_lived_species use shr_kind_mod, only : r8 => shr_kind_r8 - use chem_mods, only : slvd_lst, nslvd, gas_pcnst + use chem_mods, only : slvd_lst, nslvd, gas_pcnst, slvd_ref_mmr use cam_logfile, only : iulog use ppgrid, only : pcols, pver, begchunk, endchunk use spmd_utils, only : masterproc @@ -17,7 +17,7 @@ module short_lived_species save private - public :: map + !public :: map public :: register_short_lived_species public :: short_lived_species_initic public :: short_lived_species_writeic @@ -28,7 +28,7 @@ module short_lived_species public :: pbf_idx integer :: pbf_idx - integer :: map(nslvd) + !integer :: map(nslvd) character(len=16), parameter :: pbufname = 'ShortLivedSpecies' @@ -107,7 +107,7 @@ subroutine initialize_short_lived_species(ncid_ini, pbuf2d) integer :: m,n,lchnk integer :: grid_id - character(len=8) :: fieldname + character(len=255) :: fieldname character(len=4) :: dim1name, dim2name logical :: found real(r8),pointer :: tmpptr(:,:,:) ! temporary pointer @@ -129,20 +129,24 @@ subroutine initialize_short_lived_species(ncid_ini, pbuf2d) allocate(tmpptr(pcols,pver,begchunk:endchunk)) do m=1,nslvd - n = map(m) + !n = map(m) !fieldname = solsym(n) - write(fieldname,'(a,a)') 'GCSL', m - !write(fieldname,'(a,a)') 'GCSL_',trim(slvd_lst(m)) + !write(fieldname,'(a,a)') 'GCSL', m + write(fieldname,'(a,a)') 'GCSL_', trim(slvd_lst(m)) call infld( fieldname,ncid_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tmpptr, found, gridname='physgrid') if (.not.found) then - tmpptr(:,:,:) = 1.e-36_r8 + !tmpptr(:,:,:) = 1.e-36_r8 + tmpptr(:,:,:) = slvd_ref_mmr(m) endif call pbuf_set_field(pbuf2d, pbf_idx, tmpptr, start=(/1,1,m/),kount=(/pcols,pver,1/)) - if (masterproc) write(iulog,*) fieldname, ' is set to short-lived' + if (MasterProc) write(iulog,'(a20,a)') TRIM(fieldname), ' is set to short-lived' + ! DEBUG: remove as this will be confusing to most due to the negative + ! dummy MW which was used to calculate the reference MMR + if (MasterProc) write(iulog,'(a, E16.5E4)') ' --> reference MMR: ', slvd_ref_mmr(m) enddo @@ -158,7 +162,7 @@ subroutine set_short_lived_species( q, lchnk, ncol, pbuf ) implicit none - real(r8), intent(in) :: q(pcols,pver,gas_pcnst) + real(r8), intent(in) :: q(pcols,pver,nslvd) integer, intent(in) :: lchnk, ncol type(physics_buffer_desc), pointer :: pbuf(:) @@ -167,8 +171,9 @@ subroutine set_short_lived_species( q, lchnk, ncol, pbuf ) if ( nslvd < 1 ) return do m=1,nslvd - n = map(m) - call pbuf_set_field(pbuf, pbf_idx, q(:,:,n), start=(/1,1,m/),kount=(/pcols,pver,1/)) + !n = map(m) + !call pbuf_set_field(pbuf, pbf_idx, q(:,:,m), start=(/1,1,n/),kount=(/pcols,pver,1/)) + call pbuf_set_field(pbuf, pbf_idx, q(:,:,m), start=(/1,1,m/),kount=(/pcols,pver,1/)) enddo end subroutine set_short_lived_species @@ -180,7 +185,7 @@ subroutine get_short_lived_species( q, lchnk, ncol, pbuf ) implicit none - real(r8), intent(inout) :: q(pcols,pver,gas_pcnst) + real(r8), intent(inout) :: q(pcols,pver,nslvd) integer, intent(in) :: lchnk, ncol type(physics_buffer_desc), pointer :: pbuf(:) real(r8),pointer :: tmpptr(:,:) @@ -191,9 +196,10 @@ subroutine get_short_lived_species( q, lchnk, ncol, pbuf ) if ( nslvd < 1 ) return do m=1,nslvd - n = map(m) + !n = map(m) call pbuf_get_field(pbuf, pbf_idx, tmpptr, start=(/1,1,m/), kount=(/ pcols,pver,1 /)) - q(:ncol,:,n) = tmpptr(:ncol,:) + !q(:ncol,:,n) = tmpptr(:ncol,:) + q(:ncol,:,m) = tmpptr(:ncol,:) enddo endsubroutine get_short_lived_species From bc3e21e053f9e17342d4166dc24cde6e42f75a3b Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 14:57:10 -0500 Subject: [PATCH 065/239] Feat: Set GEOS-Chem data from CAM (1) Date information is now propagated to GEOS-Chem. Algorithm needs tweaking (seems to give a date 1 minute earlier than it should). Also currently force the year to be 2000 as the default CAM year is 0000. --- src/chemistry/pp_geoschem/chemistry.F90 | 46 +++++++++++++++++++------ 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 8620a6b61c..865b44a219 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -1368,7 +1368,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! For calculating SZA use Orbit, only: zenith - use Time_Manager, only: Get_Curr_Calday + use Time_Manager, only: Get_Curr_Calday, Get_Curr_Date ! Calculating relative humidity use WV_Saturation, only: QSat @@ -1439,6 +1439,10 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: SlsData(State%NCOL, PVER, NSls) + INTEGER :: CurrYr, CurrMo, CurrDy, CurrTOD + INTEGER :: CurrYMD, CurrHMS, CurrHr, CurrMn, CurrSc + REAL(f4) :: CurrUTC + LOGICAL :: rootChunk INTEGER :: RC @@ -1703,18 +1707,40 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF + ! Determine current date and time + CALL Get_Curr_Date(CurrYr,CurrMo,CurrDy,CurrTOD) + ! For now, force year to be 2000 + CurrYr = 2000 + CurrYMD = (CurrYr*1000) + (CurrMo*100) + (CurrDy) + ! Deal with subdaily + CurrUTC = REAL(CurrTOD,f4)/3600.0e+0_f4 + CurrSc = 0 + CurrMn = 0 + CurrHr = 0 + DO WHILE (CurrTOD > 3600) + CurrTOD = CurrTOD - 3600 + CurrHr = CurrHr + 1 + ENDDO + DO WHILE (CurrTOD > 60) + CurrTOD = CurrTOD - 60 + CurrMn = CurrMn + 1 + ENDDO + CurrSc = CurrTOD + CurrHMS = (CurrHr*1000) + (CurrMn*100) + (CurrSc) + + ! Pass time values obtained from the ESMF environment to GEOS-Chem CALL Accept_External_Date_Time( am_I_Root = rootChunk, & - value_NYMD = 20000101, & - value_NHMS = 0000, & - value_YEAR = 2000, & - value_MONTH = 01, & - value_DAY = 01, & - value_DAYOFYR = 001, & - value_HOUR = 00, & - value_MINUTE = 00, & + value_NYMD = CurrYMD, & + value_NHMS = CurrHMS, & + value_YEAR = CurrYr, & + value_MONTH = CurrMo, & + value_DAY = CurrDy, & + value_DAYOFYR = INT(FLOOR(Calday)), & + value_HOUR = CurrHr, & + value_MINUTE = CurrMn, & value_HELAPSED = 0.0e+0_f4, & - value_UTC = 0.0e+0_f4, & + value_UTC = CurrUTC, & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN From 53943adbf4160390ae33de06fc743f59c01744de Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 14:58:41 -0500 Subject: [PATCH 066/239] Feat: Disable stratospheric aerosols in GEOS-Chem --- src/chemistry/pp_geoschem/chemistry.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 865b44a219..f8db495c85 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -778,8 +778,11 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%SalC_rEdge_um(1) = 0.50e+0_fp Input_Opt%SalC_rEdge_um(2) = 8.00e+0_fp Input_Opt%LMPOA = .False. - Input_Opt%LGravStrat = .True. - Input_Opt%LSolidPSC = .True. + ! For now, disable solid PSCs and strat aerosol settling + ! Our treatment of the stratosphere isn't really sophisticated + ! enough to warrant it yet + Input_Opt%LGravStrat = .False. + Input_Opt%LSolidPSC = .False. Input_Opt%LHomNucNAT = .False. Input_Opt%T_NAT_Supercool = 3.0e+0_fp Input_Opt%P_Ice_Supersat = 1.2e+0_fp From 21a05c7df2c679ab94accbb15499cc532a5b62e6 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 15:19:14 -0500 Subject: [PATCH 067/239] Feat: Progate more met fields to State_Met using CAM data --- src/chemistry/pp_geoschem/chemistry.F90 | 106 +++++++++++++++++++----- 1 file changed, 85 insertions(+), 21 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index f8db495c85..bc854fcee4 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -108,7 +108,11 @@ module chemistry INTEGER :: iH2O, iO3, iCH4, iCO ! Indices in the physics buffer - INTEGER :: NDX_PBLH + INTEGER :: NDX_PBLH ! PBL height [m] + INTEGER :: NDX_FSDS ! Downward shortwave flux at surface [W/m2] + INTEGER :: NDX_CLDTOP ! Cloud top height [?] + INTEGER :: NDX_CLDFRC ! Cloud fraction [?] + INTEGER :: NDX_PRAIN ! Rain production rate [?] ! Strings CHARACTER(LEN=255) :: ThisLoc @@ -1273,7 +1277,11 @@ subroutine chem_init(phys_state, pbuf2d) iCO = Ind_('CO') ! Get indices for physical fields in physics buffer - NDX_PBLH = pbuf_get_index('PBLH') + NDX_PBLH = Pbuf_Get_Index('PblH' ) + NDX_FSDS = Pbuf_Get_Index('Fsds' ) + NDX_CLDTOP = Pbuf_Get_Index('CldTop') + NDX_CLDFRC = Pbuf_Get_Index('Cld' ) + NDX_PRAIN = Pbuf_Get_Index('PRain' ) ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default @@ -1369,6 +1377,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Wetscav_Mod, only: Setup_Wetscav use CMN_Size_Mod, only: PTop + use Tropopause, only: Tropopause_findChemTrop, Tropopause_Find + ! For calculating SZA use Orbit, only: zenith use Time_Manager, only: Get_Curr_Calday, Get_Curr_Date @@ -1416,7 +1426,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Zsurf, & ! Surface height Rlats, Rlons ! Chunk latitudes and longitudes (radians) - REAL(r8), POINTER :: PBLH(:) ! PBL height on each chunk + REAL(r8), POINTER :: PblH(:) ! PBL height on each chunk [m] + REAL(r8), POINTER :: CldTop(:) ! Cloud top height + REAL(r8), POINTER :: CldFrc(:) ! Cloud fraction + REAL(r8), POINTER :: Fsds(:) ! Downward shortwave flux at surface [W/m2] + REAL(r8), POINTER :: PRain(:) ! Rain production rate REAL(r8) :: RelHum(State%NCOL, PVER) ! Relative humidity [0-1] REAL(r8) :: SatV (State%NCOL, PVER) ! Work arrays REAL(r8) :: SatQ (State%NCOL, PVER) ! Work arrays @@ -1431,6 +1445,15 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: Col_Area(State%NCOL) + ! Intermediate arrays + INTEGER :: Trop_Lev(PCOLS) + REAL(r8) :: Trop_P( PCOLS) + REAL(r8) :: Trop_T( PCOLS) + REAL(r8) :: Trop_Ht( PCOLS) + REAL(r8) :: SnowDepth(PCOLS) + REAL(r8) :: Z0(PCOLS) + REAL(r8) :: Sd_Ice, Sd_Lnd, Sd_Avg, Frc_Ice + ! Calculating SZA REAL(r8) :: Calday @@ -1556,8 +1579,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Zenith( Calday, Rlats, Rlons, CSZA, NCOL ) !CALL Outfld( 'SZA', SZA, NCOL, LCHNK ) - ! Get PBL height (m) - CALL pbuf_get_field(pbuf, NDX_PBLH, PBLH) + CALL Pbuf_Get_Field( Pbuf, NDX_PBLH, PblH ) + CALL Pbuf_Get_Field( Pbuf, NDX_PRAIN, PRain ) + CALL Pbuf_Get_Field( Pbuf, NDX_FSDS, Fsds ) + CALL Pbuf_Get_Field( Pbuf, NDX_CLDTOP, CldTop ) + CALL Pbuf_Get_Field( Pbuf, NDX_CLDFRC, CldFrc ) ! Get VMR and MMR of H2O H2OVMR = 0.0e0_fp @@ -1581,13 +1607,47 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDDO + ! Estimate roughness height VERY roughly + Z0 = 0.0e+0_r8 + DO I = 1, NCOL + IF (Cam_in%LandFrac(I).GE.0.5e+0_r8) THEN + Z0(I) = 0.035e+0_r8 + ELSE + Z0(I) = 0.0001e+0_r8 + ENDIF + ENDDO + + ! Retrieve tropopause level + Trop_Lev = 0.0e+0_r8 + CALL Tropopause_FindChemTrop(State, Trop_Lev) + ! Back out the pressure + Trop_P = 1000.0e+0_r8 + DO I = 1, NCOL + Trop_P(I) = State%PMid(I,Trop_Lev(I)) * 0.01e+0_r8 + ENDDO + + ! Calculate snow depth + SnowDepth = 0.0e+0_r8 + DO I = 1, NCOL + Sd_Ice = MAX(0.0e+0_r8,Cam_in%Snowhice(I)) + Sd_Lnd = MAX(0.0e+0_r8,Cam_in%Snowhland(I)) + Frc_Ice = MAX(0.0e+0_r8,Cam_in%Icefrac(I)) + IF (Frc_Ice > 0.0e+0_r8) THEN + Sd_Avg = (Sd_Lnd*(1.0e+0_r8 - Frc_Ice)) + (Sd_Ice * Frc_Ice) + ELSE + Sd_Avg = Sd_Lnd + ENDIF + SnowDepth(I) = Sd_Avg + ENDDO + State_Met(LCHNK)%ALBD (1,:) = Cam_in%Asdir(:) State_Met(LCHNK)%CLDFRC (1,:) = 0.0e+0_fp - State_Met(LCHNK)%EFLUX (1,:) = 0.0e+0_fp - State_Met(LCHNK)%HFLUX (1,:) = 0.0e+0_fp - State_Met(LCHNK)%FRCLND (1,:) = 0.0e+0_fp - State_Met(LCHNK)%FRLAND (1,:) = 1.0e+0_fp - cam_in%OcnFrac(:) - State_Met(LCHNK)%FROCEAN (1,:) = Cam_in%OcnFrac(:) + State_Met(LCHNK)%EFLUX (1,:) = Cam_in%Lhf(:) + State_Met(LCHNK)%HFLUX (1,:) = Cam_in%Shf(:) + State_Met(LCHNK)%FRCLND (1,:) = 0.0e+0_fp ! Olson land fraction + State_Met(LCHNK)%FRLAND (1,:) = Cam_in%LandFrac(:) + State_Met(LCHNK)%FROCEAN (1,:) = Cam_in%OcnFrac(:) + Cam_in%IceFrac(:) + State_Met(LCHNK)%FRSEAICE (1,:) = Cam_in%IceFrac(:) State_Met(LCHNK)%FRLAKE (1,:) = 0.0e+0_fp State_Met(LCHNK)%FRLANDIC (1,:) = 0.0e+0_fp State_Met(LCHNK)%GWETROOT (1,:) = 0.0e+0_fp @@ -1595,26 +1655,26 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%LAI (1,:) = 0.0e+0_fp State_Met(LCHNK)%PARDR (1,:) = 0.0e+0_fp State_Met(LCHNK)%PARDF (1,:) = 0.0e+0_fp - State_Met(LCHNK)%PBLH (1,:) = PBLH(:NCOL) + State_Met(LCHNK)%PBLH (1,:) = PblH(:NCOL) State_Met(LCHNK)%PHIS (1,:) = State%Phis(:) - State_Met(LCHNK)%PRECANV (1,:) = 0.0e+0_fp - State_Met(LCHNK)%PRECCON (1,:) = 0.0e+0_fp - State_Met(LCHNK)%PRECLSC (1,:) = 0.0e+0_fp - State_Met(LCHNK)%PRECTOT (1,:) = 0.0e+0_fp - State_Met(LCHNK)%TROPP (1,:) = 150.0e+0_fp + State_Met(LCHNK)%PRECANV (1,:) = 0.0e+0_fp ! Not used + State_Met(LCHNK)%PRECCON (1,:) = Cam_Out%Precc(:) ! Convective precip + State_Met(LCHNK)%PRECLSC (1,:) = Cam_Out%Precl(:) ! "Stratiform" precip + State_Met(LCHNK)%PRECTOT (1,:) = Cam_Out%Precc(:) + Cam_Out%Precl(:) ! All precip + State_Met(LCHNK)%TROPP (1,:) = Trop_P(:) State_Met(LCHNK)%PS1_WET (1,:) = State%ps(:)*0.01e+0_fp State_Met(LCHNK)%PS2_WET (1,:) = State%ps(:)*0.01e+0_fp State_Met(LCHNK)%SLP (1,:) = State%ps(:)*0.01e+0_fp State_Met(LCHNK)%TS (1,:) = Cam_in%TS(:) State_Met(LCHNK)%TSKIN (1,:) = Cam_in%TS(:) - State_Met(LCHNK)%SWGDN (1,:) = 0.0e+0_fp + State_Met(LCHNK)%SWGDN (1,:) = fsds(:) State_Met(LCHNK)%TO3 (1,:) = 300.0e+0_fp ! Dummy - State_Met(LCHNK)%SNODP (1,:) = 0.0e+0_fp - State_Met(LCHNK)%SNOMAS (1,:) = 0.0e+0_fp + State_Met(LCHNK)%SNODP (1,:) = snowdepth(:) + State_Met(LCHNK)%SNOMAS (1,:) = snowdepth(:) * 1000.0e+0_r8 ! m -> kg/m2 for ice w/rho ~ 1000 kg/m3 State_Met(LCHNK)%SUNCOS (1,:) = CSZA(:) State_Met(LCHNK)%SUNCOSmid (1,:) = CSZA(:) State_Met(LCHNK)%U10M (1,:) = State%U(:,NZ) - State_Met(LCHNK)%USTAR (1,:) = 0.0e+0_fp + State_Met(LCHNK)%USTAR (1,:) = Cam_In%UStar(:) State_Met(LCHNK)%V10M (1,:) = State%V(:,NZ) State_Met(LCHNK)%Z0 (1,:) = 0.0e+0_fp @@ -1693,7 +1753,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(lchnk)%OPTD = State_Met(lchnk)%TAUCLI + State_Met(lchnk)%TAUCLW ! Nullify all pointers - NULLIFY(PBLH) + NULLIFY(PblH ) + NULLIFY(Fsds ) + NULLIFY(PRain ) + NULLIFY(CldTop ) + NULLIFY(CldFrc ) ! Eventually initialize/reset wetdep IF ( Input_Opt%LConv .OR. Input_Opt%LChem .OR. Input_Opt%LWetD ) THEN From 4323a2dd9179a3eb7bda495a4ad707b9e8e8fda1 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 15:21:42 -0500 Subject: [PATCH 068/239] Feat: Change NY to PCOLS for consistency and add step count tracking --- src/chemistry/pp_geoschem/chemistry.F90 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index bc854fcee4..9d8dade51e 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -588,7 +588,8 @@ subroutine chem_init(phys_state, pbuf2d) ! The GEOS-Chem grids on every "chunk" will all be the same size, to avoid ! the possibility of having differently-sized chunks NX = 1 - NY = MAXVAL(NCOL) + !NY = MAXVAL(NCOL) + NY = PCOLS NZ = NLEV !! Add short lived speies to buffers @@ -1469,6 +1470,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) INTEGER :: CurrYMD, CurrHMS, CurrHr, CurrMn, CurrSc REAL(f4) :: CurrUTC + INTEGER, SAVE :: iStep = 0 LOGICAL :: rootChunk INTEGER :: RC @@ -1480,6 +1482,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Am I the first chunk on the first CPU? rootChunk = ( MasterProc.and.(LCHNK==BEGCHUNK) ) + ! Count the number of steps which have passed + IF (LCHNK.EQ.BEGCHUNK) iStep = iStep + 1 + ! Need to update the timesteps throughout the code CALL GC_Update_Timesteps(dT) From b0a3f8dbbb9d9e05df485b7913cfd3f9de50ce79 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Nov 2019 15:24:10 -0500 Subject: [PATCH 069/239] Feat: Increased default list of diagnostics for GEOS-Chem --- bld/namelist_files/use_cases/geoschem.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 3278d1f96e..054b32e1a7 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -59,7 +59,7 @@ - 'O3', 'NO', 'NO2', 'CO', 'HNO3', 'CH4', + 'O3', 'NO', 'NO2', 'CO', 'HNO3', 'CH4', 'NIT', 'NH4', 'NH3', 'SO4', 'SO2', 'OH', From 314cbbd4597fc52d26b88baf646299206edba039 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 17:36:18 -0400 Subject: [PATCH 070/239] Feat: Implement GEOS-Chem wet deposition + Estimate of 2D cloudiness (1) Implemented GEOS-Chem wet deposition (2) CAM does not provide an estimate of 2D cloud cover, so we use an estimate (maximum 3D cloudiness in vertical column). This matches the technique originally used for GCAP in GEOS-Chem. (3) Fix Z0 not being assigned --- src/chemistry/pp_geoschem/chemistry.F90 | 181 +++++++++++++++++------- 1 file changed, 127 insertions(+), 54 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 9d8dade51e..4553f63f21 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -6,8 +6,8 @@ module chemistry use shr_kind_mod, only: r8 => shr_kind_r8 use physics_types, only: physics_state, physics_ptend, physics_ptend_init use ppgrid, only: begchunk, endchunk, pcols - use ppgrid, only: pver - use constituents, only: pcnst, cnst_add + use ppgrid, only: pver, pverp + use constituents, only: pcnst, cnst_add, cnst_get_ind !use mo_gas_phase_chemdr, only: map2chm !use mo_constants, only: pi use shr_const_mod, only: molw_dryair=>SHR_CONST_MWDAIR @@ -108,11 +108,19 @@ module chemistry INTEGER :: iH2O, iO3, iCH4, iCO ! Indices in the physics buffer - INTEGER :: NDX_PBLH ! PBL height [m] - INTEGER :: NDX_FSDS ! Downward shortwave flux at surface [W/m2] - INTEGER :: NDX_CLDTOP ! Cloud top height [?] - INTEGER :: NDX_CLDFRC ! Cloud fraction [?] - INTEGER :: NDX_PRAIN ! Rain production rate [?] + INTEGER :: NDX_PBLH ! PBL height [m] + INTEGER :: NDX_FSDS ! Downward shortwave flux at surface [W/m2] + INTEGER :: NDX_CLDTOP ! Cloud top height [index] + INTEGER :: NDX_CLDFRC ! Cloud fraction [-] + INTEGER :: NDX_PRAIN ! Rain production rate [kg/kg/s] + INTEGER :: NDX_NEVAPR ! Total rate of precipitation evaporation [kg/kg/s] + INTEGER :: NDX_RPRDTOT ! Convective total precip. production rate [kg/kg/s] + INTEGER :: NDX_LSFLXPRC ! Large-scale precip. at interface (liq + snw) [kg/m2/s] + INTEGER :: NDX_LSFLXSNW ! Large-scale precip. at interface (snow only) [kg/m2/s] + + ! Get constituent indices + INTEGER :: ixCldLiq + INTEGER :: ixCldIce ! Strings CHARACTER(LEN=255) :: ThisLoc @@ -800,9 +808,9 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%JNITChanB = 0e+0_fp ! Now READ_DEPOSITION_MENU - ! Disable dry/wet dep for now + ! Disable dry dep for now Input_Opt%LDryD = .False. - Input_Opt%LWetD = .False. + Input_Opt%LWetD = .True. Input_Opt%CO2_Effect = .False. Input_Opt%CO2_Level = 390.0_fp Input_Opt%CO2_Ref = 390.0_fp @@ -1283,6 +1291,14 @@ subroutine chem_init(phys_state, pbuf2d) NDX_CLDTOP = Pbuf_Get_Index('CldTop') NDX_CLDFRC = Pbuf_Get_Index('Cld' ) NDX_PRAIN = Pbuf_Get_Index('PRain' ) + NDX_NEVAPR = Pbuf_Get_Index('NEVAPR' ) + NDX_RPRDTOT = Pbuf_Get_Index('RPRDTOT' ) + NDX_LSFLXPRC = Pbuf_Get_Index('LS_FLXPRC') + NDX_LSFLXSNW = Pbuf_Get_Index('LS_FLXSNW') + + ! Get cloud water indices + CALL Cnst_Get_Ind('CLDLIQ', ixCldLiq) + CALL Cnst_Get_Ind('CLDICE', ixCldIce) ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default @@ -1360,7 +1376,7 @@ subroutine GC_Update_Timesteps(DT) subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) - use physics_buffer, only: physics_buffer_desc, pbuf_get_field + use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx use cam_history, only: outfld use camsrfexch, only: cam_in_t, cam_out_t @@ -1397,7 +1413,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Short_Lived_Species, only : Set_Short_Lived_Species ! Use GEOS-Chem versions of physical constants - use PhysConstants, only: PI, PI_180 + use PhysConstants, only: PI, PI_180, g0 REAL(r8), INTENT(IN) :: dT ! Time step TYPE(physics_state), INTENT(IN) :: State ! Physics State variables @@ -1428,10 +1444,15 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Rlats, Rlons ! Chunk latitudes and longitudes (radians) REAL(r8), POINTER :: PblH(:) ! PBL height on each chunk [m] - REAL(r8), POINTER :: CldTop(:) ! Cloud top height - REAL(r8), POINTER :: CldFrc(:) ! Cloud fraction + REAL(r8), POINTER :: CldTop(:) ! Cloud top height [?] + REAL(r8), POINTER :: CldFrc(:,:) ! Cloud fraction [-] REAL(r8), POINTER :: Fsds(:) ! Downward shortwave flux at surface [W/m2] - REAL(r8), POINTER :: PRain(:) ! Rain production rate + REAL(r8), POINTER :: PRain(:,:) ! Total stratiform precip. prod. (rain + snow) [kg/kg/s] + REAL(r8), POINTER :: RprdTot(:,:) ! Total convective precip. prod. (rain + snow) [kg/kg/s] + REAL(r8), POINTER :: NEvapr(:,:) ! Evaporation of total precipitation (rain + snow) [kg/kg/s] + REAL(r8), POINTER :: LsFlxPrc(:,:) ! Large-scale downward precip. flux at interface (rain + snow) [kg/m2/s] + REAL(r8), POINTER :: LsFlxSnw(:,:) ! Large-scale downward precip. flux at interface (snow only) [kg/m2/s] + REAL(r8) :: RelHum(State%NCOL, PVER) ! Relative humidity [0-1] REAL(r8) :: SatV (State%NCOL, PVER) ! Work arrays REAL(r8) :: SatQ (State%NCOL, PVER) ! Work arrays @@ -1452,9 +1473,21 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: Trop_T( PCOLS) REAL(r8) :: Trop_Ht( PCOLS) REAL(r8) :: SnowDepth(PCOLS) + REAL(r8) :: Cld2D (PCOLS) REAL(r8) :: Z0(PCOLS) REAL(r8) :: Sd_Ice, Sd_Lnd, Sd_Avg, Frc_Ice + ! Estimating cloud optical depth + REAL(r8) :: LWC(PCOLS,PVER) + REAL(r8) :: IWC(PCOLS,PVER) + REAL(r8) :: LWP(PCOLS,PVER) + REAL(r8) :: IWP(PCOLS,PVER) + REAL(r8) :: CldLiq(PCOLS,PVER) + REAL(r8) :: CldIce(PCOLS,PVER) + REAL(r8) :: TauCli(PCOLS,PVER) + REAL(r8) :: TauClw(PCOLS,PVER) + REAL(r8) :: LocalMult + ! Calculating SZA REAL(r8) :: Calday @@ -1470,6 +1503,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) INTEGER :: CurrYMD, CurrHMS, CurrHr, CurrMn, CurrSc REAL(f4) :: CurrUTC + INTEGER :: TIM_NDX + INTEGER, SAVE :: iStep = 0 LOGICAL :: rootChunk INTEGER :: RC @@ -1584,11 +1619,17 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Zenith( Calday, Rlats, Rlons, CSZA, NCOL ) !CALL Outfld( 'SZA', SZA, NCOL, LCHNK ) + ! Get all required data from physics buffer + TIM_NDX = Pbuf_Old_Tim_Idx() CALL Pbuf_Get_Field( Pbuf, NDX_PBLH, PblH ) - CALL Pbuf_Get_Field( Pbuf, NDX_PRAIN, PRain ) CALL Pbuf_Get_Field( Pbuf, NDX_FSDS, Fsds ) CALL Pbuf_Get_Field( Pbuf, NDX_CLDTOP, CldTop ) - CALL Pbuf_Get_Field( Pbuf, NDX_CLDFRC, CldFrc ) + CALL Pbuf_Get_Field( Pbuf, NDX_CLDFRC, CldFrc, START=(/1,1,TIM_NDX/), KOUNT=(/NCOL,PVER,1/) ) + CALL Pbuf_Get_Field( Pbuf, NDX_NEVAPR, NEvapr, START=(/1,1/), KOUNT=(/NCOL,PVER/)) + CALL Pbuf_Get_Field( Pbuf, NDX_PRAIN, PRain, START=(/1,1/), KOUNT=(/NCOL,PVER/)) + CALL Pbuf_Get_Field( Pbuf, NDX_RPRDTOT, RprdTot, START=(/1,1/), KOUNT=(/NCOL,PVER/)) + CALL Pbuf_Get_Field( Pbuf, NDX_LSFLXPRC, LsFlxPrc, START=(/1,1/), KOUNT=(/NCOL,PVERP/)) + CALL Pbuf_Get_Field( Pbuf, NDX_LSFLXSNW, LsFlxSnw, START=(/1,1/), KOUNT=(/NCOL,PVERP/)) ! Get VMR and MMR of H2O H2OVMR = 0.0e0_fp @@ -1622,6 +1663,34 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDDO + ! Estimate cloud liquid water content and OD + CldLiq = 0.0e+0_r8 + CldIce = 0.0e+0_r8 + TauCli = 0.0e+0_r8 + TauClw = 0.0e+0_r8 + LWC = 0.0e+0_r8 + IWC = 0.0e+0_r8 + LWP = 0.0e+0_r8 + IWP = 0.0e+0_r8 + ! Note: all using CAM vertical convention (1 = TOA) + ! Calculation is based on that done for MOZART + DO I = 1, NCOL + DO K = NZ, 1, -1 + ! In-cloud water content (kg/kg) + CldLiq(I,K) = State%Q(I,K,ixCldLiq) + CldIce(I,K) = State%Q(I,K,ixCldIce) + ! Conversion to "cloud water" ! (g/?) + LWC(I,K) = (CldLiq(I,K) * State%PMid(I,K)/(State%T(I,J)*287.0e+0_r8)) * 1000.0e+0_r8 + IWC(I,K) = (CldIce(I,K) * State%PMid(I,K)/(State%T(I,J)*287.0e+0_r8)) * 1000.0e+0_r8 + ! Liquid water path/ice water path + LocalMult = (State%Pint(I,K+1)-State%Pint(I,K))*1.0e+3_r8/(CldFrc(I,K)*g0) + LWP(I,K) = LWC(I,K)*localMult + IWP(I,K) = IWC(I,K)*localMult + TauClw(I,K) = LWP(I,K) * 0.155e+0_r8 * (CldFrc(I,K)**2) + TauCli(I,K) = IWP(I,K) * 0.155e+0_r8 * (CldFrc(I,K)**2) + ENDDO + ENDDO + ! Retrieve tropopause level Trop_Lev = 0.0e+0_r8 CALL Tropopause_FindChemTrop(State, Trop_Lev) @@ -1645,8 +1714,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) SnowDepth(I) = Sd_Avg ENDDO + ! Estimate 2D cloud fraction (pessimistic assumption) + Cld2D = 0.0e+0_r8 + DO I = 1, NCOL + Cld2D(I) = MAXVAL(CldFrc(I,:)) + ENDDO + State_Met(LCHNK)%ALBD (1,:) = Cam_in%Asdir(:) - State_Met(LCHNK)%CLDFRC (1,:) = 0.0e+0_fp + State_Met(LCHNK)%CLDFRC (1,:) = CLD2D(:) State_Met(LCHNK)%EFLUX (1,:) = Cam_in%Lhf(:) State_Met(LCHNK)%HFLUX (1,:) = Cam_in%Shf(:) State_Met(LCHNK)%FRCLND (1,:) = 0.0e+0_fp ! Olson land fraction @@ -1681,7 +1756,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%U10M (1,:) = State%U(:,NZ) State_Met(LCHNK)%USTAR (1,:) = Cam_In%UStar(:) State_Met(LCHNK)%V10M (1,:) = State%V(:,NZ) - State_Met(LCHNK)%Z0 (1,:) = 0.0e+0_fp + State_Met(LCHNK)%Z0 (1,:) = Z0(:) DO J = 1, NY DO I = 1, NX @@ -1700,11 +1775,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Three-dimensional fields on level edges DO J = 1, NY DO L = 1, NZ+1 - State_Met(LCHNK)%CMFMC (1,J,L) = 0.0e+0_fp - State_Met(LCHNK)%PFICU (1,J,L) = 0.0e+0_fp - State_Met(LCHNK)%PFILSAN (1,J,L) = 0.0e+0_fp - State_Met(LCHNK)%PFLCU (1,J,L) = 0.0e+0_fp - State_Met(LCHNK)%PFLLSAN (1,J,L) = 0.0e+0_fp + State_Met(LCHNK)%CMFMC (1,J,L) = 0.0e+0_fp ! Needed for convection only + State_Met(LCHNK)%PFICU (1,J,L) = 0.0e+0_fp ! Needed for convection only + State_Met(LCHNK)%PFILSAN (1,J,L) = 0.0e+0_fp ! Needed for convection only + State_Met(LCHNK)%PFLCU (1,J,L) = LsFlxSnw(j,NZ+2-L) ! kg/m2/s + State_Met(LCHNK)%PFLLSAN (1,J,L) = MAX(0.0e+0_fp,LsFlxPrc(J,NZ+2-L) - LsFlxSnw(J,NZ+2-L)) ! kg/m2/s State_Met(LCHNK)%PEDGE (1,J,L) = State%Pint(J,NZ+2-L)*0.01e+0_fp ENDDO ENDDO @@ -1714,55 +1789,53 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%PS2_DRY (:,:) = 0.0e+0_fp - ! Calculate CLDTOPS (highest location of CMFMC in the column) + ! Convert cldtop from real to integer I = 1 DO J = 1, NY - State_Met(lchnk)%CldTops(I,J) = 1 - DO L = NZ, 1, -1 - IF ( State_Met(LCHNK)%CMFMC(I,J,L) > 0.0e+0_fp ) THEN - State_Met(LCHNK)%CLDTOPS(I,J) = L + 1 - EXIT - ENDIF - ENDDO + State_Met(LCHNK)%CldTops(1,J) = NZ + 1 - NINT(CldTop(J)) ENDDO ! Three-dimensional fields on level centers DO J = 1, NY DO L = 1, NZ - State_Met(lchnk)%U (1,J,L) = State%U(J,NZ+1-L) - State_Met(lchnk)%V (1,J,L) = State%V(J,NZ+1-L) - !State_Met(lchnk)%OMEGA (1,J,L) = State%Omega(J,NZ+1-L) - State_Met(lchnk)%CLDF (1,J,L) = 0.0e+0_fp - State_Met(lchnk)%DTRAIN (1,J,L) = 0.0e+0_fp - State_Met(lchnk)%DQRCU (1,J,L) = 0.0e+0_fp - State_Met(lchnk)%DQRLSAN (1,J,L) = 0.0e+0_fp - State_Met(lchnk)%QI (1,J,L) = 0.0e+0_fp - State_Met(lchnk)%QL (1,J,L) = 0.0e+0_fp - State_Met(lchnk)%RH (1,J,L) = RelHum(J,NZ+1-L) * 100.0e+0_fp - State_Met(lchnk)%TAUCLI (1,J,L) = 0.0e+0_fp - State_Met(lchnk)%TAUCLW (1,J,L) = 0.0e+0_fp - State_Met(lchnk)%REEVAPCN (1,J,L) = 0.0e+0_fp - State_Met(lchnk)%REEVAPLS (1,J,L) = 0.0e+0_fp - State_Met(lchnk)%SPHU1 (1,J,L) = QH2O(J,NZ+1-L) * 1.0e+3_fp ! g/kg - State_Met(lchnk)%SPHU2 (1,J,L) = QH2O(J,NZ+1-L) * 1.0e+3_fp ! g/kg - State_Met(lchnk)%TMPU1 (1,J,L) = State%T(J,NZ+1-L) - State_Met(lchnk)%TMPU2 (1,J,L) = State%T(J,NZ+1-L) + State_Met(LCHNK)%U (1,J,L) = State%U(J,NZ+1-L) + State_Met(LCHNK)%V (1,J,L) = State%V(J,NZ+1-L) + !State_Met(LCHNK)%OMEGA (1,J,L) = State%Omega(J,NZ+1-L) + State_Met(LCHNK)%CLDF (1,J,L) = CldFrc(j,nZ+1-l) + State_Met(LCHNK)%DTRAIN (1,J,L) = 0.0e+0_fp ! Used in convection + State_Met(LCHNK)%DQRCU (1,J,L) = 0.0e+0_fp ! Used in convection + State_Met(LCHNK)%DQRLSAN (1,J,L) = PRain(J,NZ+1-L) ! kg/kg/s + State_Met(LCHNK)%QI (1,J,L) = CldIce(J,NZ+1-L) ! kg ice / kg dry air + State_Met(LCHNK)%QL (1,J,L) = CldLiq(J,NZ+1-L) ! kg water / kg dry air + State_Met(LCHNK)%RH (1,J,L) = RelHum(J,NZ+1-L) * 100.0e+0_fp + State_Met(LCHNK)%TAUCLI (1,J,L) = TauCli(J,NZ+1-L) + State_Met(LCHNK)%TAUCLW (1,J,L) = TauClw(J,NZ+1-L) + State_Met(LCHNK)%REEVAPCN (1,J,L) = 0.0e+0_fp ! Used in convection + State_Met(LCHNK)%REEVAPLS (1,J,L) = NEvapr(J,NZ+1-L) ! kg/kg/s + State_Met(LCHNK)%SPHU1 (1,J,L) = QH2O(J,NZ+1-L) * 1.0e+3_fp ! g/kg + State_Met(LCHNK)%SPHU2 (1,J,L) = QH2O(J,NZ+1-L) * 1.0e+3_fp ! g/kg + State_Met(LCHNK)%TMPU1 (1,J,L) = State%T(J,NZ+1-L) + State_Met(LCHNK)%TMPU2 (1,J,L) = State%T(J,NZ+1-L) ENDDO ENDDO ! Derived fields - State_Met(lchnk)%T = (State_Met(lchnk)%TMPU1 + State_Met(lchnk)%TMPU2)*0.5e+0_fp - State_Met(lchnk)%SPHU = (State_Met(lchnk)%SPHU1 + State_Met(lchnk)%SPHU2)*0.5e+0_fp + State_Met(LCHNK)%T = (State_Met(LCHNK)%TMPU1 + State_Met(LCHNK)%TMPU2)*0.5e+0_fp + State_Met(LCHNK)%SPHU = (State_Met(LCHNK)%SPHU1 + State_Met(LCHNK)%SPHU2)*0.5e+0_fp ! Calculate total OD as liquid cloud OD + ice cloud OD - State_Met(lchnk)%OPTD = State_Met(lchnk)%TAUCLI + State_Met(lchnk)%TAUCLW + State_Met(LCHNK)%OPTD = State_Met(LCHNK)%TAUCLI + State_Met(LCHNK)%TAUCLW ! Nullify all pointers NULLIFY(PblH ) NULLIFY(Fsds ) NULLIFY(PRain ) - NULLIFY(CldTop ) - NULLIFY(CldFrc ) + Nullify(LsFlxSnw) + Nullify(LsFlxPrc) + Nullify(CldTop ) + Nullify(CldFrc ) + Nullify(NEvapr ) + Nullify(RprdTot ) ! Eventually initialize/reset wetdep IF ( Input_Opt%LConv .OR. Input_Opt%LChem .OR. Input_Opt%LWetD ) THEN From df6779fdb5973859feeb52ad863791d551424535 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 17:40:11 -0400 Subject: [PATCH 071/239] Feat: Move SLS information to chem_mods + Emission module (1) Move tracer and SLS information out to chem_mods (2) Added temporary NO source to provide useful output (3) Initial code stub for an emissions module --- src/chemistry/pp_geoschem/chem_mods.F90 | 29 ++++++- src/chemistry/pp_geoschem/chemistry.F90 | 94 +++++++++++++++------- src/chemistry/pp_geoschem/gc_emissions.F90 | 76 +++++++++++++++++ 3 files changed, 167 insertions(+), 32 deletions(-) create mode 100644 src/chemistry/pp_geoschem/gc_emissions.F90 diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/pp_geoschem/chem_mods.F90 index b9d2b15dd6..e4b9013937 100644 --- a/src/chemistry/pp_geoschem/chem_mods.F90 +++ b/src/chemistry/pp_geoschem/chem_mods.F90 @@ -3,9 +3,34 @@ module chem_mods ! ... Basic chemistry parameters and arrays !-------------------------------------------------------------- use shr_kind_mod, only : r8 => shr_kind_r8 + use constituents, only : pcnst implicit none save - integer, parameter :: phtcnt = 40, & ! number of photolysis reactions + + INTEGER, PARAMETER :: NTracersMax = 200 ! Must be equal to nadv_chem + INTEGER :: NTracers + CHARACTER(LEN=255) :: TracerNames(NTracersMax) + CHARACTER(LEN=255) :: TracerLongNames(NTracersMax) + REAL(r8) :: Adv_Mass(NTracersMax) + REAL(r8) :: MWRatio(NTracersMax) + REAL(r8) :: Ref_MMR(NTracersMax) + + ! Short-lived species (i.e. not advected) + INTEGER, PARAMETER :: NSlsMax = 500 ! UNadvected species only + INTEGER :: NSls + CHARACTER(LEN=255) :: SlsNames(NSlsMax) + CHARACTER(LEN=255) :: SlsLongnames(NSlsMax) + REAL(r8) :: Sls_Ref_MMR(NSlsMax) + REAL(r8) :: SlsMWRatio(NSlsMax) + + ! Mapping between constituents and GEOS-Chem tracers + INTEGER :: Map2GC(pcnst) + INTEGER :: Map2GC_Sls(NSlsMax) + + ! Mapping from constituents to raw index + INTEGER :: Map2Idx(pcnst) + + INTEGER, PARAMETER :: phtcnt = 40, & ! number of photolysis reactions rxntot = 212, & ! number of total reactions gascnt = 172, & ! number of gas phase reactions nabscol = 2, & ! number of absorbing column densities @@ -31,7 +56,7 @@ module chem_mods integer :: clsmap(gas_pcnst,5) = 0 integer :: permute(gas_pcnst,5) = 0 integer :: diag_map(clscnt4) = 0 - real(r8) :: adv_mass(gas_pcnst) = 0._r8 + !real(r8) :: adv_mass(gas_pcnst) = 0._r8 real(r8) :: crb_mass(gas_pcnst) = 0._r8 real(r8) :: fix_mass(max(1,nfs)) real(r8), allocatable :: cph_enthalpy(:) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 4553f63f21..33de899d0e 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -39,6 +39,23 @@ module chemistry ! Exit routine in CAM use cam_abortutils, only : endrun + use chem_mods, only : ntracersmax + use chem_mods, only : ntracers + use chem_mods, only : tracernames + use chem_mods, only : tracerlongnames + use chem_mods, only : adv_mass + use chem_mods, only : mwratio + use chem_mods, only : ref_mmr + use chem_mods, only : nslsmax + use chem_mods, only : nsls + use chem_mods, only : slsnames + use chem_mods, only : slslongnames + use chem_mods, only : sls_ref_mmr + use chem_mods, only : slsmwratio + use chem_mods, only : map2gc + use chem_mods, only : map2gc_sls + use chem_mods, only : map2idx + IMPLICIT NONE PRIVATE SAVE @@ -61,39 +78,12 @@ module chemistry public :: chem_emissions public :: chem_timestep_init - ! Private data - !===== SDE DEBUG ===== - integer, parameter :: NTracersMax = 200 ! Must be equal to nadv_chem - integer :: NTracers - character(len=255) :: TracerNames(NTracersMax) - character(len=255) :: TracerLongNames(NTracersMax) - integer :: Indices(NTracersMax) - real(r8) :: Adv_Mass(NTracersMax) - real(r8) :: MWRatio(NTracersMax) - real(r8) :: Ref_MMR(NTracersMax) - - ! Short-lived species (i.e. not advected) - integer, parameter :: NSlsMax = 500 ! UNadvected species only - integer :: NSls - character(len=255) :: SlsNames(NSlsMax) - character(len=255) :: SlsLongNames(NSlsMax) - real(r8) :: Sls_Ref_MMR(NSlsMax) - real(r8) :: SLSMWRatio(NSlsMax) - !===== SDE DEBUG ===== - ! Location of valid input.geos CHARACTER(LEN=500) :: inputGeosPath ! Location of chemistry input (for now) CHARACTER(LEN=500) :: chemInputsDir - ! Mapping between constituents and GEOS-Chem tracers - INTEGER :: Map2GC(pcnst) - INTEGER :: Map2GC_Sls(NSlsMax) - - ! Mapping from constituents to raw index - INTEGER :: Map2Idx(pcnst) - !----------------------------- ! Derived type objects !----------------------------- @@ -105,7 +95,7 @@ module chemistry TYPE(DgnList ) :: Diag_List ! Diagnostics list object ! Indices of critical species - INTEGER :: iH2O, iO3, iCH4, iCO + INTEGER :: iH2O, iO3, iCH4, iCO, iNO ! Indices in the physics buffer INTEGER :: NDX_PBLH ! PBL height [m] @@ -540,6 +530,8 @@ subroutine chem_init(phys_state, pbuf2d) use PBL_Mix_Mod, only : Init_PBL_Mix + use GC_Emissions_Mod, only : GC_Emissions_Init + TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) @@ -1284,6 +1276,7 @@ subroutine chem_init(phys_state, pbuf2d) iO3 = Ind_('O3') iCH4 = Ind_('CH4') iCO = Ind_('CO') + iNO = Ind_('NO') ! Get indices for physical fields in physics buffer NDX_PBLH = Pbuf_Get_Index('PblH' ) @@ -1315,6 +1308,10 @@ subroutine chem_init(phys_state, pbuf2d) CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(SlsLongNames(I))//' concentration') !CALL Add_Default(TRIM(SpcName), 1, '') ENDDO + + ! Initialize emissions interface (this will eventually handle HEMCO) + CALL GC_Emissions_Init + !CALL AddFld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) !CALL Add_Default ( 'BCPI', 1, ' ') @@ -1332,8 +1329,7 @@ subroutine chem_timestep_init(phys_state, pbuf2d) IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_INIT' - ! This is when we want to update State_Met and so on - ! Note that here we have been passed MANY chunks + ! Not sure what we would realistically do here rather than in tend end subroutine chem_timestep_init @@ -2138,6 +2134,8 @@ subroutine chem_final ! Special: cleans up after NDXX_Setup use Diag_Mod, only : Cleanup_Diag + use GC_Emissions_Mod, only: GC_Emissions_Final + INTEGER :: I, RC LOGICAL :: am_I_Root @@ -2172,6 +2170,8 @@ subroutine chem_final CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + CALL GC_Emissions_Final + ! Call extra cleanup routines, from modules in Headers/ CALL Cleanup_CMN_O3( MasterProc, RC ) IF ( RC /= GC_SUCCESS ) THEN @@ -2268,20 +2268,54 @@ end subroutine chem_read_restart subroutine chem_emissions( state, cam_in ) use camsrfexch, only : cam_in_t + use PhysConstants, only: PI, PI_180 + ! Arguments: TYPE(physics_state), INTENT(IN) :: state ! Physics state variables TYPE(cam_in_t), INTENT(INOUT) :: cam_in ! import state + REAL(r8) :: Rlats(State%NCOL) + REAL(r8) :: Rlons(State%NCOL) + REAL(r8) :: Dlat, Dlon + REAL(r8) :: SFlx(State%NCOL,NTracers) + + INTEGER :: M, N, I INTEGER :: LCHNK, NCOL LOGICAL :: rootChunk + LOGICAL, SAVE :: FIRST = .TRUE. + ! LCHNK: which chunk we have on this process LCHNK = State%LCHNK ! NCOL: number of atmospheric columns on this chunk NCOL = State%NCOL rootChunk = ( MasterProc.and.(LCHNK.EQ.BEGCHUNK) ) + SFlx(:,:) = 0.0e+0_r8 + Rlats(1:ncol) = State%Lat(1:NCOL) + Rlons(1:ncol) = State%Lon(1:NCOL) + + IF (FIRST) THEN + ENDIF + + !TMMF + ! Test: emit 1e-10 kg/m2/s of NO in a square around Europe + DO M = 1, PCNST + N = Map2GC(M) + IF ((N>0).and.(N==iNO)) THEN + SFlx(:,N) = 0.0e+0_r8 + DO I = 1, NCOL + Dlat = Rlats(i) / REAL(PI_180,r8) + Dlon = Rlons(i) / REAL(PI_180,r8) + IF ((Dlat > 50.0e+0_r8).and.(Dlat < 60.0e+0_r8).and.(Dlon > -15.0e+0_r8).and.(Dlon < 5.0e+0_r8)) THEN + SFlx(I,N) = SFlx(I,N) + 1.0e-10_r8 + ENDIF + ENDDO + Cam_in%CFlx(:NCOL,M) = Cam_in%CFlx(:NCOL,M) + SFlx(:NCOL,N) + ENDIF + ENDDO + IF (rootChunk) WRITE(iulog,'(a)') 'GCCALL CHEM_EMISSIONS' end subroutine chem_emissions diff --git a/src/chemistry/pp_geoschem/gc_emissions.F90 b/src/chemistry/pp_geoschem/gc_emissions.F90 new file mode 100644 index 0000000000..05841a9e66 --- /dev/null +++ b/src/chemistry/pp_geoschem/gc_emissions.F90 @@ -0,0 +1,76 @@ +!================================================================================================ +! This is the "GEOS-Chem" chemistry emissions interface +!================================================================================================ +module GC_Emissions_Mod + + use Shr_kind_mod, only : r8 => shr_kind_r8 + use Spmd_utils, only : MasterProc, myCPU=>iam, nCPUs=>npes + use Cam_logfile, only : iulog + use Cam_abortutils, only : endrun + + use Chem_mods, only : NTracers + use Chem_mods, only : TracerNames + use Chem_mods, only : Map2GC + + use Tracer_data, only : trfld,trfile + + IMPLICIT NONE + + TYPE :: Emission + INTEGER :: Spc_Ndx + REAL(r8) :: MW + REAL(r8) :: Scalefactor + CHARACTER(LEN=256) :: Filename + CHARACTER(LEN=16) :: Species + CHARACTER(LEN=8) :: Units + INTEGER :: Nsectors + CHARACTER(LEN=32), POINTER :: Sectors(:) + TYPE(trfld), POINTER :: Fields(:) + TYPE(trfile) :: File + ENDTYPE Emission + + PRIVATE + + PUBLIC :: GC_Emissions_Init + PUBLIC :: GC_Emissions_Calc + PUBLIC :: GC_Emissions_Final + + ! Stand-in: emissions + TYPE(Emission), ALLOCATABLE :: Emissions(:) + INTEGER :: N_Emis_Files + +!================================================================================================ +contains +!================================================================================================ + + subroutine GC_Emissions_Init + + INTEGER :: Ierr + + N_Emis_Files=1 + ALLOCATE(Emissions(N_Emis_Files), STAT=IERR) + IF (IERR.NE.0) CALL ENDRUN('Could not allocate GC emissions') + + end subroutine GC_Emissions_Init + + subroutine GC_Emissions_Calc(Eflx) + + ! Emissions in kg/m2/s + ! Dimensions: [N columns x K levels x C constituents ] + REAL(r8), INTENT(OUT) :: EFlx(:,:,:) + INTEGER :: I_Trc, I_Emis + + EFlx(:,:,:) = 0.0e+0_r8 + DO I_Emis = 1, N_Emis_Files + ! Read emissions file + DO I_Trc = 1, NTracers + ENDDO + ENDDO + + end subroutine GC_Emissions_Calc + + subroutine GC_Emissions_Final + IF (ALLOCATED(Emissions)) DEALLOCATE(Emissions) + end subroutine GC_Emissions_Final + + end module GC_Emissions_Mod From 10a45e8b2c6a20f6bd381ad1da8699d3d9b6c0bb Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 17:47:21 -0400 Subject: [PATCH 072/239] Fix: Fix reading of tracers in input.geos (1) Tracers in input.geos (2) Fix indentation --- src/chemistry/pp_geoschem/chemistry.F90 | 220 +++++++++++++----------- 1 file changed, 116 insertions(+), 104 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 33de899d0e..d484f27f64 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -39,22 +39,22 @@ module chemistry ! Exit routine in CAM use cam_abortutils, only : endrun - use chem_mods, only : ntracersmax - use chem_mods, only : ntracers - use chem_mods, only : tracernames - use chem_mods, only : tracerlongnames - use chem_mods, only : adv_mass - use chem_mods, only : mwratio + use chem_mods, only : nTracersMax + use chem_mods, only : nTracers + use chem_mods, only : tracerNames + use chem_mods, only : tracerLongNames + use chem_mods, only : adv_Mass + use chem_mods, only : mwRatio use chem_mods, only : ref_mmr - use chem_mods, only : nslsmax - use chem_mods, only : nsls - use chem_mods, only : slsnames - use chem_mods, only : slslongnames + use chem_mods, only : nSlsMax + use chem_mods, only : nSls + use chem_mods, only : slsNames + use chem_mods, only : slsLongNames use chem_mods, only : sls_ref_mmr - use chem_mods, only : slsmwratio - use chem_mods, only : map2gc - use chem_mods, only : map2gc_sls - use chem_mods, only : map2idx + use chem_mods, only : slsmwRatio + use chem_mods, only : map2GC + use chem_mods, only : map2GC_Sls + use chem_mods, only : map2Idx IMPLICIT NONE PRIVATE @@ -172,8 +172,9 @@ subroutine chem_register LOGICAL :: has_fixed_ubflx INTEGER :: RC + ! SDE 2018-05-02: This seems to get called before anything else - ! That includes CHEM_INIT + ! that includes CHEM_INIT ! At this point, mozart calls SET_SIM_DAT, which is specified by each ! mechanism separately (ie mozart/chemistry.F90 calls the subroutine ! set_sim_dat which is in pp_[mechanism]/mo_sim_dat.F90. That sets a lot of @@ -204,7 +205,7 @@ subroutine chem_register IO%LPRT = .False. IO%N_Advect = nTracers DO I = 1, nTracers - IO%AdvectSpc_Name(I) = TRIM(tracernames(I)) + IO%AdvectSpc_Name(I) = TRIM(tracerNames(I)) ENDDO IO%SalA_rEdge_um(1) = 0.01e+0_fp IO%SalA_rEdge_um(2) = 0.50e+0_fp @@ -216,7 +217,7 @@ subroutine chem_register Input_Opt%myCPU = myCPU CALL Init_State_Grid( am_I_Root = .False., & - State_Grid = State_Grid(I), & + State_Grid = SG , & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN @@ -224,9 +225,9 @@ subroutine chem_register CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - State_Grid(I)%NX = 1 - State_Grid(I)%NY = 1 - State_Grid(I)%NZ = 1 + SG%NX = 1 + SG%NY = 1 + SG%NZ = 1 CALL Init_State_Chm( am_I_Root = .False., & Input_Opt = IO, & @@ -246,8 +247,8 @@ subroutine chem_register MWRatio(:) = 1.0e+0_r8 TracerLongNames = '' - DO I = 1, NTRACERSMAX - IF (I.LE.NTRACERS) THEN + DO I = 1, nTracersMax + IF (I.LE.nTracers) THEN N = Ind_(TracerNames(I)) ThisSpc => SC%SpcData(N)%Info Lng_Name = TRIM(ThisSpc%FullName) @@ -283,10 +284,10 @@ subroutine chem_register !write(tracernames(i),'(a,I0.4)') 'GCTRC_', i ! NOTE: In MOZART, this only gets called for tracers ! This is the call to add a "constituent" - CALL cnst_add( trim(tracernames(i)), adv_mass(i), cptmp, qmin, n, & + CALL cnst_add( TRIM(tracerNames(I)), adv_Mass(I), cptmp, qmin, N, & readiv=ic_from_cam2, mixtype=mixtype, cam_outfld=camout, & molectype=molectype, fixed_ubc=has_fixed_ubc, & - fixed_ubflx=has_fixed_ubflx, longname=trim(lng_name) ) + fixed_ubflx=has_fixed_ubflx, longname=TRIM(Lng_Name) ) ! Add to GC mapping. When starting a timestep, we will want to update the ! concentration of State_Chm(x)%Species(1,iCol,iLev,m) with data from @@ -341,7 +342,7 @@ subroutine chem_readnl(nlfile) use cam_abortutils, only : endrun use units, only : getunit, freeunit use mpishorthand - use gckpp_Model, only : nspec, spc_names + use gckpp_Model, only : NSPEC, SPC_NAMES ! args CHARACTER(LEN=*), INTENT(IN) :: nlfile ! filepath for file containing namelist input @@ -352,15 +353,17 @@ subroutine chem_readnl(nlfile) logical :: menuFound, validSLS ! Set paths - inputGeosPath='/n/scratchlfs/jacob_lab/elundgren/UT/runs/4x5_standard/input.geos.template' + inputGeosPath='/n/home10/tfritz/UT/runs/4x5_standard/input.geos.template' chemInputsDir='/n/holylfs/EXTERNAL_REPOS/GEOS-CHEM/gcgrid/gcdata/ExtData/CHEM_INPUTS/' + inputGeosPath='/home/fritzt/input.geos.template' + chemInputsDir='/net/d06/data/GCdata/ExtData/CHEM_INPUTS/' IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_READNL' ! TODO: Read in input.geos and get species names IF (MasterProc) THEN UNITN = GETUNIT() - OPEN( UNITN, FILE=TRIM(inputGeosPath), STATUS='old', IOSTAT=IERR ) + OPEN( UNITN, FILE=TRIM(inputGeosPath), STATUS='OLD', IOSTAT=IERR ) IF (IERR .NE. 0) THEN CALL ENDRUN('chem_readnl: ERROR opening input.geos') ENDIF @@ -376,60 +379,60 @@ subroutine chem_readnl(nlfile) ENDIF ENDDO - ! Skip first line - READ(UNITN,'(a)',IOSTAT=IERR) LINE - ! Read in tracer count - READ(UNITN,'(26x,I)',IOSTAT=IERR) NTRACERS - ! Skip divider line - READ(UNITN,'(a)',IOSTAT=IERR) LINE - ! Read in each tracer - DO I=1,NTRACERS - READ(UNITN,'(26x,a)',iostat=ierr) line - tracernames(i) = trim(line) + DO + ! Read line + READ(UNITN,'(26x,a)', IOSTAT=IERR) LINE + + IF ( INDEX( TRIM(LINE), '---' ) > 0 ) EXIT + + nTracers = nTracers + 1 + tracerNames(nTracers) = TRIM(LINE) + + WRITE(iulog,'(a,I5,a,a)') ' --> GC Tracer ', nTracers, ': ', TRIM(LINE) ENDDO CLOSE(UNITN) CALL FREEUNIT(UNITN) ! Assign remaining tracers dummy names - DO I=(NTRACERS+1),NTRACERSMAX - WRITE(TRACERNAMES(I),'(a,I0.4)') 'GCTRC_',I + DO I = (nTracers+1), nTracersMax + WRITE(tracerNames(I),'(a,I0.4)') 'GCTRC_', I ENDDO ! Now go through the KPP mechanism and add any species not implemented by ! the tracer list in input.geos - IF ( NSPEC > NSlsMax ) THEN + IF ( NSPEC > nSlsMax ) THEN CALL ENDRUN('chem_readnl: too many species - increase NSlsmax') ENDIF - NSls = 0 + nSls = 0 DO I=1,NSPEC ! Get the name of the species from KPP LINE = ADJUSTL(TRIM(SPC_NAMES(I))) ! Only add this - validSLS = ( (.NOT.ANY(TRIM(LINE).EQ.TRACERNAMES)).AND.& + validSLS = ( (.NOT.ANY(TRIM(LINE).EQ.tracerNames)).AND.& (.NOT.(LINE(1:2) == 'RR')) ) IF (validSLS) THEN ! Genuine new short-lived species - NSls = NSls + 1 - SLSNAMES(NSls) = TRIM(LINE) - WRITE(iulog,'(a,I5,a,a)') ' --> GC species ', NSls, ': ', TRIM(LINE) + nSls = nSls + 1 + slsNames(nSls) = TRIM(LINE) + WRITE(iulog,'(a,I5,a,a)') ' --> GC species ', nSls, ': ', TRIM(LINE) ENDIF ENDDO ENDIF ! Broadcast to all processors #if defined( SPMD ) - CALL MPIBCAST(NTracers, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(TracerNames, LEN(TracerNames(1))*NTracersMax, MPICHAR, 0, MPICOM ) - CALL MPIBCAST(NSls, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(SlsNames, LEN(SlsNames(1))*NSlsMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST(nTracers, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST(tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST(nSls, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST(slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) #endif ! Update "short_lived_species" arrays - will eventually unify these - NSlvd = NSls - ALLOCATE(Slvd_Lst(NSlvd), STAT=IERR) + nSlvd = nSls + ALLOCATE(slvd_Lst(nSlvd), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Slvd_Lst') - ALLOCATE(Slvd_Ref_MMR(NSlvd), STAT=IERR) + ALLOCATE(slvd_Ref_MMR(nSlvd), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Slvd_Ref_MMR') DO I=1,NSls Slvd_Lst(I) = TRIM(SlsNames(I)) @@ -467,8 +470,8 @@ function chem_implements_cnst(name) chem_implements_cnst = .false. - DO I = 1, NTRACERS - IF (TRIM(TRACERNAMES(I)) .eq. TRIM(NAME)) THEN + DO I = 1, nTracers + IF (TRIM(tracerNames(I)) .eq. TRIM(NAME)) THEN chem_implements_cnst = .true. EXIT ENDIF @@ -614,16 +617,14 @@ subroutine chem_init(phys_state, pbuf2d) ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK) , STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Met') - ! Set some basic flags - Input_Opt%Max_BPCH_Diag = 1000 - Input_Opt%Max_AdvectSpc = 500 - Input_Opt%Max_Families = 250 - ! Initialize fields of the Input Options object CALL Set_Input_Opt( am_I_Root = MasterProc, & Input_Opt = Input_Opt, & RC = RC ) + ! Set some basic flags + Input_Opt%LUCX = .True. + IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered within call to "Set_Input_Opt"!' CALL Error_Stop( ErrMsg, ThisLoc ) @@ -690,7 +691,6 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%myCPU = myCPU Input_Opt%rootCPU = MasterProc - ! TODO: Mimic GEOS-Chem's reading of input options !IF (MasterProc) THEN ! CALL Read_Input_File( am_I_Root = .True., & @@ -722,13 +722,13 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%ITS_AN_AEROSOL_SIM = .False. ! Now READ_ADVECTED_SPECIES_MENU - Input_Opt%N_Advect = NTracers + Input_Opt%N_Advect = nTracers IF (Input_Opt%N_Advect.GT.Input_Opt%Max_AdvectSpc) THEN CALL ENDRUN('Number of tracers exceeds max count') ENDIF ! Assign tracer names DO J = 1, Input_Opt%N_Advect - Input_Opt%AdvectSpc_Name(J) = TRIM(TRACERNAMES(J)) + Input_Opt%AdvectSpc_Name(J) = TRIM(tracerNames(J)) ENDDO ! No tagged species Input_Opt%LSplit = .False. @@ -954,14 +954,15 @@ subroutine chem_init(phys_state, pbuf2d) IF ( prtDebug ) CALL Debug_Msg( '### MAIN: a READ_INPUT_FILE' ) historyConfigFile = 'HISTORY.rc' ! InputOpt not yet initialized - CALL Init_DiagList( MasterProc, historyConfigFile, Diag_List, RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_State_Met"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + !TMMF need to pass input.geos path + !CALL Init_DiagList( MasterProc, historyConfigFile, Diag_List, RC ) + !IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in "Init_DiagList"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + !ENDIF - !### Print diagnostic list if needed for debugging - IF ( prtDebug ) CALL Print_DiagList( am_I_Root, Diag_List, RC ) + !!### Print diagnostic list if needed for debugging + !IF ( prtDebug ) CALL Print_DiagList( am_I_Root, Diag_List, RC ) DO I = BEGCHUNK, ENDCHUNK am_I_Root = (MasterProc .AND. (I == BEGCHUNK)) @@ -1119,7 +1120,10 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDIF - IF (Input_Opt%LSulf.OR.Input_Opt%LCarb.OR.Input_Opt%LDust.OR.Input_Opt%LSSalt) THEN + IF ( Input_Opt%LSulf .OR. & + Input_Opt%LCarb .OR. & + Input_Opt%LDust .OR. & + Input_Opt%LSSalt ) THEN CALL Init_Aerosol( am_I_Root = MasterProc, & & Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & @@ -1209,37 +1213,44 @@ subroutine chem_init(phys_state, pbuf2d) Bp_CAM_Flip(I) = hybi(nZ+2-I) ENDDO - DO I = BEGCHUNK, ENDCHUNK - - !----------------------------------------------------------------- - ! Initialize the hybrid pressure module. Define Ap and Bp. - !----------------------------------------------------------------- - CALL Init_Pressure( am_I_Root = MasterProc, & ! Root CPU (Y/N)? - & State_Grid = State_Grid(I), & ! Grid State - & RC = RC ) ! Success or failure - - ! Trapping errors - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Pressure"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + !----------------------------------------------------------------- + ! Initialize the hybrid pressure module. Define Ap and Bp. + !----------------------------------------------------------------- + CALL Init_Pressure( am_I_Root = MasterProc, & ! Root CPU (Y/N)? + State_Grid = State_Grid(BEGCHUNK), & ! Grid State + RC = RC ) ! Success or failure - !----------------------------------------------------------------- - ! Pass external Ap and Bp to GEOS-Chem's Pressure_Mod - !----------------------------------------------------------------- - CALL Accept_External_ApBp( am_I_Root = MasterProc, & ! Root CPU (Y/N)? - & State_Grid = State_Grid(I), & ! Grid State - & ApIn = Ap_CAM_Flip, & ! "A" term for hybrid grid - & BpIn = Bp_CAM_Flip, & ! "B" term for hybrid grid - & RC = RC ) ! Success or failure + ! Trapping errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Pressure"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF - ! Trapping errors - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Accept_External_ApBp"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + !----------------------------------------------------------------- + ! Pass external Ap and Bp to GEOS-Chem's Pressure_Mod + !----------------------------------------------------------------- + CALL Accept_External_ApBp( am_I_Root = MasterProc, & ! Root CPU (Y/N)? + State_Grid = State_Grid(BEGCHUNK), & ! Grid State + ApIn = Ap_CAM_Flip, & ! "A" term for hybrid grid + BpIn = Bp_CAM_Flip, & ! "B" term for hybrid grid + RC = RC ) ! Success or failure + + ! Print vertical coordinates + IF ( MasterProc ) THEN + WRITE( 6, '(a)' ) REPEAT( '=', 79 ) + WRITE( 6, '(a,/)' ) 'V E R T I C A L G R I D S E T U P' + WRITE( 6, '( ''Ap '', /, 6(f11.6,1x) )' ) Ap_CAM_Flip(1:State_Grid(BEGCHUNK)%NZ+1) + WRITE( 6, '(a)' ) + WRITE( 6, '( ''Bp '', /, 6(f11.6,1x) )' ) Bp_CAM_Flip(1:State_Grid(BEGCHUNK)%NZ+1) + WRITE( 6, '(a)' ) REPEAT( '=', 79 ) + ENDIF + + ! Trapping errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Accept_External_ApBp"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF - ENDDO DEALLOCATE(Ap_CAM_Flip,Bp_CAM_Flip) IF (Input_Opt%Its_A_FullChem_Sim .OR. & @@ -1263,7 +1274,8 @@ subroutine chem_init(phys_state, pbuf2d) ! HcoConfig=HcoConfig ) !ASSERT_(RC==GC_SUCCESS) - IF (Input_Opt%LChem.and.Input_Opt%LUCX) THEN + IF ( Input_Opt%LChem .AND. & + Input_Opt%LUCX ) THEN CALL Init_UCX( am_I_Root = MasterProc, & & Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & @@ -1279,11 +1291,11 @@ subroutine chem_init(phys_state, pbuf2d) iNO = Ind_('NO') ! Get indices for physical fields in physics buffer - NDX_PBLH = Pbuf_Get_Index('PblH' ) - NDX_FSDS = Pbuf_Get_Index('Fsds' ) - NDX_CLDTOP = Pbuf_Get_Index('CldTop') - NDX_CLDFRC = Pbuf_Get_Index('Cld' ) - NDX_PRAIN = Pbuf_Get_Index('PRain' ) + NDX_PBLH = Pbuf_Get_Index('pblh' ) + NDX_FSDS = Pbuf_Get_Index('FSDS' ) + NDX_CLDTOP = Pbuf_Get_Index('CLDTOP' ) + NDX_CLDFRC = Pbuf_Get_Index('CLD' ) + NDX_PRAIN = Pbuf_Get_Index('PRAIN' ) NDX_NEVAPR = Pbuf_Get_Index('NEVAPR' ) NDX_RPRDTOT = Pbuf_Get_Index('RPRDTOT' ) NDX_LSFLXPRC = Pbuf_Get_Index('LS_FLXPRC') From a1956e0ea913e7140d1f29f5502f48c4ed233c00 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 17:48:32 -0400 Subject: [PATCH 073/239] Chore: Now compiling GEOS-Chem with -DMODEL_ --- bld/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/configure b/bld/configure index fe4a7aeb95..1cce493f5e 100755 --- a/bld/configure +++ b/bld/configure @@ -1430,7 +1430,7 @@ if ($chem_pkg =~ '_mam3') { # TMMF - wedge in GEOS-Chem CPP definitions here if ($chem_pkg =~ 'geoschem') { - $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DMODEL_CESM -DUCX -DLINUX_IFORT -DUSE_REAL8 '; + $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DMODEL_ -DMODEL_CESM -DUCX -DLINUX_IFORT -DUSE_REAL8 '; # TMMF - Temporary fix $chem_nadv = 200; } From 0625671888dc5fcdd494eec1f18e770e222453c7 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 18:05:37 -0400 Subject: [PATCH 074/239] Feat: Added wet/(dry) deposition. See more comments below! (01) Added definition of MaxTropLev, MaxStratLev and MaxChemLev. This will require some additional thought (02) As of right now, Linoz is turned off as the current grid doesn't extend past 30 km, causing segmentation when running with Linoz turned on (03) Added code that's commented out right now for future development (HEMCO, Olson landmap, convection, ...) (04) Added field descrition and unit of State_Met variables when converted from CESM to State_Met (05) Updated compution of cloud optical depth. Following what MOZART does. (06) Now correctly initializing InChemGrid to .True. everywhere (07) Added newDay, newMonth variables (08) Added wet deposition (09) Added dry deposition. However, it is purely a software right now, as it runs without initializing land types (10) Uniformization of variables --- src/chemistry/pp_geoschem/chemistry.F90 | 1366 +++++++++++++++++------ 1 file changed, 1035 insertions(+), 331 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index d484f27f64..4a353fb8f0 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -34,7 +34,7 @@ module chemistry !----------------------------------------------------------------- USE PRECISION_MOD, ONLY : fp, f4 ! Flexible precision - use Chem_Mods, only : NSlvd, Slvd_Lst, Slvd_Ref_MMR + use Chem_Mods, only : nSlvd, slvd_Lst, slvd_ref_MMR ! Exit routine in CAM use cam_abortutils, only : endrun @@ -50,7 +50,7 @@ module chemistry use chem_mods, only : nSls use chem_mods, only : slsNames use chem_mods, only : slsLongNames - use chem_mods, only : sls_ref_mmr + use chem_mods, only : sls_ref_MMR use chem_mods, only : slsmwRatio use chem_mods, only : map2GC use chem_mods, only : map2GC_Sls @@ -162,10 +162,10 @@ subroutine chem_register REAL(r8) :: cptmp REAL(r8) :: mwtmp REAL(r8) :: qmin - REAL(r8) :: Ref_VMR + REAL(r8) :: ref_VMR CHARACTER(LEN=128) :: mixtype CHARACTER(LEN=128) :: molectype - CHARACTER(LEN=128) :: Lng_Name + CHARACTER(LEN=128) :: lng_Name LOGICAL :: camout LOGICAL :: ic_from_cam2 LOGICAL :: has_fixed_ubc @@ -214,7 +214,7 @@ subroutine chem_register ! Prevent reporting IO%rootCPU = .False. - Input_Opt%myCPU = myCPU + IO%myCPU = myCPU CALL Init_State_Grid( am_I_Root = .False., & State_Grid = SG , & @@ -242,28 +242,28 @@ subroutine chem_register ! At the moment, we force nadv_chem=200 in the setup file ! Default - Map2GC = -1 - Ref_MMR(:) = 0.0e+0_r8 + map2GC = -1 + ref_MMR(:) = 0.0e+0_r8 MWRatio(:) = 1.0e+0_r8 - TracerLongNames = '' + tracerLongNames = '' DO I = 1, nTracersMax IF (I.LE.nTracers) THEN - N = Ind_(TracerNames(I)) + N = Ind_(tracerNames(I)) ThisSpc => SC%SpcData(N)%Info - Lng_Name = TRIM(ThisSpc%FullName) + lng_Name = TRIM(ThisSpc%FullName) MWTmp = REAL(ThisSpc%MW_g,r8) - Ref_VMR = REAL(ThisSpc%BackgroundVV,r8) - Adv_Mass(I) = MWTmp - Ref_MMR(I) = Ref_VMR / (MWDry / MWTmp) + ref_VMR = REAL(ThisSpc%BackgroundVV,r8) + adv_Mass(I) = MWTmp + ref_MMR(I) = ref_VMR / (MWDry / MWTmp) ELSE - Lng_Name = TRIM(TracerNames(I)) + lng_Name = TRIM(tracerNames(I)) MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) - Adv_Mass(I) = MWTmp - Ref_MMR(I) = 1.0e-38_r8 + adv_Mass(I) = MWTmp + ref_MMR(I) = 1.0e-38_r8 ENDIF MWRatio(I) = MWDry/MWTmp - TracerLongNames(I) = TRIM(Lng_Name) + tracerLongNames(I) = TRIM(lng_Name) ! dummy value for specific heat of constant pressure (Cp) cptmp = 666._r8 @@ -287,42 +287,42 @@ subroutine chem_register CALL cnst_add( TRIM(tracerNames(I)), adv_Mass(I), cptmp, qmin, N, & readiv=ic_from_cam2, mixtype=mixtype, cam_outfld=camout, & molectype=molectype, fixed_ubc=has_fixed_ubc, & - fixed_ubflx=has_fixed_ubflx, longname=TRIM(Lng_Name) ) + fixed_ubflx=has_fixed_ubflx, longname=TRIM(lng_Name) ) ! Add to GC mapping. When starting a timestep, we will want to update the ! concentration of State_Chm(x)%Species(1,iCol,iLev,m) with data from ! constituent n - M = Ind_(TRIM(TracerNames(I))) + M = Ind_(TRIM(tracerNames(I))) IF ( M > 0 ) THEN - Map2GC(N) = M - Map2Idx(N) = I + map2GC(N) = M + map2Idx(N) = I ENDIF ! Nullify pointer ThisSpc => NULL() ENDDO ! Now unadvected species - Map2GC_Sls = 0 - Sls_Ref_MMR(:) = 0.0e+0_r8 + map2GC_Sls = 0 + sls_ref_MMR(:) = 0.0e+0_r8 SlsMWRatio(:) = -1.0e+0_r8 - SlsLongNames = '' - DO I = 1, NSls - N = Ind_(SlsNames(I)) + slsLongNames = '' + DO I = 1, nSls + N = Ind_(slsNames(I)) IF (N.GT.0) THEN ThisSpc => SC%SpcData(N)%Info MWTmp = REAL(ThisSpc%MW_g,r8) - Ref_VMR = REAL(ThisSpc%BackgroundVV,r8) - Lng_Name = TRIM(ThisSpc%FullName) - SlsLongNames(I) = Lng_Name - Sls_Ref_MMR(I) = Ref_VMR / (MWDry / MWTmp) + ref_VMR = REAL(ThisSpc%BackgroundVV,r8) + lng_Name = TRIM(ThisSpc%FullName) + slsLongNames(I) = lng_Name + sls_ref_MMR(I) = ref_VMR / (MWDry / MWTmp) SlsMWRatio(I) = MWDry / MWTmp - Map2GC_Sls(I) = N + map2GC_Sls(I) = N ThisSpc => NULL() ENDIF ENDDO ! Pass information to "short_lived_species" module - Slvd_Ref_MMR(1:NSls) = Sls_Ref_MMR(1:NSls) + slvd_ref_MMR(1:nSls) = sls_ref_MMR(1:nSls) CALL Register_Short_Lived_Species() ! More information: ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html @@ -401,7 +401,7 @@ subroutine chem_readnl(nlfile) ! Now go through the KPP mechanism and add any species not implemented by ! the tracer list in input.geos IF ( NSPEC > nSlsMax ) THEN - CALL ENDRUN('chem_readnl: too many species - increase NSlsmax') + CALL ENDRUN('chem_readnl: too many species - increase nSlsmax') ENDIF nSls = 0 @@ -431,11 +431,11 @@ subroutine chem_readnl(nlfile) ! Update "short_lived_species" arrays - will eventually unify these nSlvd = nSls ALLOCATE(slvd_Lst(nSlvd), STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Slvd_Lst') - ALLOCATE(slvd_Ref_MMR(nSlvd), STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Slvd_Ref_MMR') - DO I=1,NSls - Slvd_Lst(I) = TRIM(SlsNames(I)) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating slvd_Lst') + ALLOCATE(slvd_ref_MMR(nSlvd), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating slvd_ref_MMR') + DO I = 1, nSls + slvd_Lst(I) = TRIM(slsNames(I)) ENDDO end subroutine chem_readnl @@ -547,9 +547,9 @@ subroutine chem_init(phys_state, pbuf2d) ! Integers INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) INTEGER :: IWAIT, IERR - INTEGER :: NX, NY, NZ - INTEGER :: IX, IY, IZ - INTEGER :: NLEV, I, J, L, RC + INTEGER :: nX, nY, nZ + INTEGER :: iX, jY + INTEGER :: I, J, L, RC INTEGER :: NLINOZ ! Logicals @@ -583,26 +583,24 @@ subroutine chem_init(phys_state, pbuf2d) LCHNK = PHYS_STATE%LCHNK ! NCOL: number of atmospheric columns for each chunk NCOL = PHYS_STATE%NCOL - ! NLEV: number of vertical levels - NLEV = PVER write(iulog,'(2(a,x,I6,x))') 'chem_init called on PE ', myCPU, ' of ', nCPUs ! The GEOS-Chem grids on every "chunk" will all be the same size, to avoid ! the possibility of having differently-sized chunks - NX = 1 - !NY = MAXVAL(NCOL) - NY = PCOLS - NZ = NLEV + nX = 1 + !nY = MAXVAL(NCOL) + nY = PCOLS + nZ = PVER !! Add short lived speies to buffers - !CALL Pbuf_add_field(Trim(SLSBuffer),'global',dtype_r8,(/PCOLS,PVER,NSls/),Sls_Pbf_Idx) + !CALL Pbuf_add_field(Trim(SLSBuffer),'global',dtype_r8,(/PCOLS,PVER,nSls/),Sls_Pbf_Idx) !! Initialize !ALLOCATE(SlsPtr(PCOLS,PVER,BEGCHUNK:ENDCHUNK), STAT=IERR) !IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating SlsPtr') !SlsPtr(:,:,:) = 0.0e+0_r8 - !DO I=1,NSls - ! SlsPtr(:,:,:) = Sls_Ref_MMR(I) + !DO I=1,nSls + ! SlsPtr(:,:,:) = sls_ref_MMR(I) ! CALL pbuf_set_field(pbuf2d,Sls_Pbf_Idx,SlsPtr,start=(/1,1,i/),kount=(/PCOLS,PVER,1/)) !ENDDO !DEALLOCATE(SlsPtr) @@ -645,19 +643,33 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - State_Grid(I)%NX = NX - State_Grid(I)%NY = NY - State_Grid(I)%NZ = NZ + State_Grid(I)%NX = nX + State_Grid(I)%NY = nY + State_Grid(I)%NZ = nZ + ! Initialize GEOS-Chem horizontal grid structure CALL GC_Init_Grid( am_I_Root = am_I_Root, & Input_Opt = Input_Opt, & State_Grid = State_Grid(I), & RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered within call to "GC_Init_Grid"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ! Define more variables for State_Grid + ! TMMF, might need tweaking + State_Grid(I)%MaxTropLev = MIN(40, nZ) + State_Grid(I)%MaxStratLev = MIN(59, nZ) + + ! Set maximum number of levels in the chemistry grid + IF ( Input_Opt%LUCX ) THEN + State_Grid(I)%MaxChemLev = State_Grid(I)%MaxStratLev + ELSE + State_Grid(I)%MaxChemLev = State_Grid(I)%MaxTropLev + ENDIF + ENDDO ! Note - this is called AFTER chem_readnl, after X, and after @@ -673,14 +685,14 @@ subroutine chem_init(phys_state, pbuf2d) State_Grid = State_Grid(BEGCHUNK), & value_I_Lo = 1, & value_J_Lo = 1, & - value_I_Hi = NX, & - value_J_Hi = NY, & - value_IM = NX, & - value_JM = NY, & - value_LM = NZ, & - value_IM_WORLD = NX, & - value_JM_WORLD = NY, & - value_LM_WORLD = NZ, & + value_I_Hi = nX, & + value_J_Hi = nY, & + value_IM = nX, & + value_JM = nY, & + value_LM = nZ, & + value_IM_WORLD = nX, & + value_JM_WORLD = nY, & + value_LM_WORLD = nZ, & value_LLSTRAT = 59, & !TMMF RC = RC ) IF ( RC /= GC_SUCCESS ) THEN @@ -801,7 +813,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Now READ_DEPOSITION_MENU ! Disable dry dep for now - Input_Opt%LDryD = .False. + Input_Opt%LDryD = .True. Input_Opt%LWetD = .True. Input_Opt%CO2_Effect = .False. Input_Opt%CO2_Level = 390.0_fp @@ -809,7 +821,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Now READ_CHEMISTRY_MENU Input_Opt%LChem = .True. - Input_Opt%LSChem = .True. + Input_Opt%LSChem = .False. ! .True. !TMMF Input_Opt%LLinoz = .True. Input_Opt%LSynoz = .True. Input_Opt%LUCX = .True. @@ -821,6 +833,8 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%Use_TOMS_O3 = .False. Input_Opt%Gamma_HO2 = 0.2e+0_fp + Input_Opt%LPRT = .False. + ! Read in data for Linoz. All CPUs allocate one array to hold the data. Only ! the root CPU reads in the data; then we copy it out to a temporary array, ! broadcast to all other CPUs, and finally duplicate the data into every @@ -861,13 +875,13 @@ subroutine chem_init(phys_state, pbuf2d) ! Note: The following calculations do not setup the gridcell areas. ! In any case, we will need to be constantly updating this grid ! to compensate for the "multiple chunks per processor" element - ALLOCATE(lonMidArr(NX,NY), STAT=IERR) + ALLOCATE(lonMidArr(nX,nY), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating lonMidArr') - ALLOCATE(lonEdgeArr(NX+1,NY+1), STAT=IERR) + ALLOCATE(lonEdgeArr(nX+1,nY+1), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating lonEdgeArr') - ALLOCATE(latMidArr(NX,NY), STAT=IERR) + ALLOCATE(latMidArr(nX,nY), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating latMidArr') - ALLOCATE(latEdgeArr(NX+1,NY+1), STAT=IERR) + ALLOCATE(latEdgeArr(nX+1,nY+1), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating latEdgeArr') ! We could try and get the data from CAM.. but the goal is to make this GC @@ -878,12 +892,12 @@ subroutine chem_init(phys_state, pbuf2d) DO L = BEGCHUNK, ENDCHUNK lonMidArr = 0.0e+0_f4 latMidArr = 0.0e+0_f4 - dLonFix = 360.0e+0_fp / REAL(NX,fp) - dLatFix = 180.0e+0_fp / REAL(NY,fp) - DO I = 1,NX + dLonFix = 360.0e+0_fp / REAL(nX,fp) + dLatFix = 180.0e+0_fp / REAL(nY,fp) + DO I = 1, nX ! Center of box, assuming dateline edge lonVal = -180.0e+0_fp + (REAL(I-1,fp)*dLonFix) - DO J = 1,NY + DO J = 1, nY ! Center of box, assuming regular cells latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) lonMidArr(I,J) = REAL((lonVal + (0.5e+0_fp * dLonFix)) * PI_180, f4) @@ -894,14 +908,14 @@ subroutine chem_init(phys_state, pbuf2d) latEdgeArr(I,J) = REAL(latVal * PI_180, f4) ENDDO ! Edges of box, assuming regular cells - lonEdgeArr(I,NY+1) = REAL((lonVal + dLonFix) * PI_180, f4) - latEdgeArr(I,NY+1) = REAL((latVal + dLatFix) * PI_180, f4) + lonEdgeArr(I,nY+1) = REAL((lonVal + dLonFix) * PI_180, f4) + latEdgeArr(I,nY+1) = REAL((latVal + dLatFix) * PI_180, f4) ENDDO - DO J = 1,NY+1 + DO J = 1, nY+1 ! Edges of box, assuming regular cells latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) - lonEdgeArr(NX+1,J) = REAL((lonVal + dLonFix) * PI_180, f4) - latEdgeArr(NX+1,J) = REAL((latVal) * PI_180, f4) + lonEdgeArr(nX+1,J) = REAL((lonVal + dLonFix) * PI_180, f4) + latEdgeArr(nX+1,J) = REAL((latVal) * PI_180, f4) ENDDO CALL SetGridFromCtrEdges( am_I_Root = MasterProc, & @@ -911,6 +925,7 @@ subroutine chem_init(phys_state, pbuf2d) lonEdge = lonEdgeArr, & latEdge = latEdgeArr, & RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "SetGridFromCtrEdges"!' CALL Error_Stop( ErrMsg, ThisLoc ) @@ -1181,9 +1196,9 @@ subroutine chem_init(phys_state, pbuf2d) ! Set default value (in case of chunks with fewer columns) State_Grid(I)%Area_M2 = 1.0e+10_fp - DO iX = 1, NX - DO iY = 1, NCOL(I) - State_Grid(I)%Area_M2(iX,iY) = REAL(Col_Area(iY) * Re**2,fp) + DO iX = 1, nX + DO jY = 1, NCOL(I) + State_Grid(I)%Area_M2(iX,jY) = REAL(Col_Area(jY) * Re**2,fp) ENDDO ENDDO @@ -1253,6 +1268,62 @@ subroutine chem_init(phys_state, pbuf2d) DEALLOCATE(Ap_CAM_Flip,Bp_CAM_Flip) + !! Initialize HEMCO? + !CALL Emissions_Init ( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! State_Met = State_Met, & + ! State_Chm = State_Chm, & + ! State_Grid = State_Grid, & + ! State_Met = State_Met, & + ! RC = RC, & + ! HcoConfig = HcoConfig ) + ! + !IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in "Emissions_Init"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + !ENDIF + ! + + !! Populate the State_Met%LandTypeFrac field with data from HEMCO + !CALL Init_LandTypeFrac( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! State_Met = State_Met(BEGCHUNK), & + ! RC = RC ) + ! + !IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in "Init_LandTypeFrac"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + !ENDIF + + !! Compute the Olson landmap fields of State_Met + !! (e.g. State_Met%IREG, State_Met%ILAND, etc.) + !CALL Compute_Olson_Landmap( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! State_Grid = State_Grid(BEGCHUNK), & + ! State_Met = State_Met(BEGCHUNK), & + ! RC = RC ) + ! + !IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in "Compute_Olson_Landmap"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + !ENDIF + + ! Initialize PBL quantities but do not do mixing + ! Add option for non-local PBL (Lin, 03/31/09) + !CALL Init_Mixing ( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! State_Chm = State_Chm(BEGCHUNK), & + ! State_Diag = State_Diag(BEGCHUNK), & + ! State_Grid = State_Grid(BEGCHUNK), & + ! State_Met = State_Met(BEGCHUNK), & + ! RC = RC ) + ! + !! Trap potential errors + !IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in Init_Mixing!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + !ENDIF + IF (Input_Opt%Its_A_FullChem_Sim .OR. & Input_Opt%Its_An_Aerosol_Sim) THEN ! This also initializes Fast-JX @@ -1269,11 +1340,6 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDIF - ! Initialize HEMCO? - !CALL EMISSIONS_INIT ( am_I_Root, Input_Opt, State_Met, State_Chm, RC, & - ! HcoConfig=HcoConfig ) - !ASSERT_(RC==GC_SUCCESS) - IF ( Input_Opt%LChem .AND. & Input_Opt%LUCX ) THEN CALL Init_UCX( am_I_Root = MasterProc, & @@ -1308,16 +1374,16 @@ subroutine chem_init(phys_state, pbuf2d) ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default ! Add all species as output fields if desired - DO I = 1, NTracers - SpcName = TRIM(TracerNames(I)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(TracerLongNames(I))//' concentration') + DO I = 1, nTracers + SpcName = TRIM(tracerNames(I)) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(tracerLongNames(I))//' concentration') IF (TRIM(SpcName) == 'O3') THEN CALL Add_Default ( TRIM(SpcName), 1, ' ') ENDIF ENDDO - DO I =1, NSls - SpcName = TRIM(SlsNames(I)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(SlsLongNames(I))//' concentration') + DO I =1, nSls + SpcName = TRIM(slsNames(I)) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(slsLongNames(I))//' concentration') !CALL Add_Default(TRIM(SpcName), 1, '') ENDDO @@ -1339,8 +1405,6 @@ subroutine chem_timestep_init(phys_state, pbuf2d) TYPE(physics_state), INTENT(IN):: phys_state(begchunk:endchunk) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_TIMESTEP_INIT' - ! Not sure what we would realistically do here rather than in tend end subroutine chem_timestep_init @@ -1399,8 +1463,10 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Strat_chem_Mod, only: Init_Strat_Chem use Toms_Mod, only: Compute_Overhead_O3 use Chemistry_Mod, only: Do_Chemistry - use Wetscav_Mod, only: Setup_Wetscav + use Wetscav_Mod, only: Setup_Wetscav, Do_WetDep use CMN_Size_Mod, only: PTop + use PBL_Mix_Mod, only: Compute_PBL_Height + use Drydep_Mod, only : Do_Drydep use Tropopause, only: Tropopause_findChemTrop, Tropopause_Find @@ -1432,9 +1498,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8), OPTIONAL, INTENT(OUT) :: fh2o(PCOLS) ! h2o flux to balance source from chemistry ! Initial MMR for all species - REAL(r8) :: MMR_Beg(PCOLS,PVER,NSls+NTracers) - REAL(r8) :: MMR_End(PCOLS,PVER,NSls+NTracers) - REAL(r8) :: MMR_TEnd(PCOLS,PVER,NSls+NTracers) + REAL(r8) :: MMR_Beg(PCOLS,PVER,nSls+nTracers) + REAL(r8) :: MMR_End(PCOLS,PVER,nSls+nTracers) + REAL(r8) :: MMR_TEnd(PCOLS,PVER,nSls+nTracers) ! Mapping (?) @@ -1442,7 +1508,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Indexing INTEGER :: I, J, K, L, N, M - INTEGER :: NX, NY, NZ + INTEGER :: nX, nY, nZ INTEGER :: LCHNK, NCOL @@ -1452,8 +1518,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Rlats, Rlons ! Chunk latitudes and longitudes (radians) REAL(r8), POINTER :: PblH(:) ! PBL height on each chunk [m] - REAL(r8), POINTER :: CldTop(:) ! Cloud top height [?] - REAL(r8), POINTER :: CldFrc(:,:) ! Cloud fraction [-] + REAL(r8), POINTER :: cldTop(:) ! Cloud top height [?] + REAL(r8), POINTER :: cldFrc(:,:) ! Cloud fraction [-] REAL(r8), POINTER :: Fsds(:) ! Downward shortwave flux at surface [W/m2] REAL(r8), POINTER :: PRain(:,:) ! Total stratiform precip. prod. (rain + snow) [kg/kg/s] REAL(r8), POINTER :: RprdTot(:,:) ! Total convective precip. prod. (rain + snow) [kg/kg/s] @@ -1481,20 +1547,24 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: Trop_T( PCOLS) REAL(r8) :: Trop_Ht( PCOLS) REAL(r8) :: SnowDepth(PCOLS) - REAL(r8) :: Cld2D (PCOLS) + REAL(r8) :: cld2D (PCOLS) REAL(r8) :: Z0(PCOLS) REAL(r8) :: Sd_Ice, Sd_Lnd, Sd_Avg, Frc_Ice ! Estimating cloud optical depth - REAL(r8) :: LWC(PCOLS,PVER) - REAL(r8) :: IWC(PCOLS,PVER) - REAL(r8) :: LWP(PCOLS,PVER) - REAL(r8) :: IWP(PCOLS,PVER) - REAL(r8) :: CldLiq(PCOLS,PVER) - REAL(r8) :: CldIce(PCOLS,PVER) + !REAL(r8) :: LWC(PCOLS,PVER) + !REAL(r8) :: IWC(PCOLS,PVER) + !REAL(r8) :: LWP(PCOLS,PVER) + !REAL(r8) :: IWP(PCOLS,PVER) + !REAL(r8) :: CldLiq(PCOLS,PVER) + !REAL(r8) :: CldIce(PCOLS,PVER) + REAL(r8) :: cld(PCOLS,PVER) REAL(r8) :: TauCli(PCOLS,PVER) REAL(r8) :: TauClw(PCOLS,PVER) - REAL(r8) :: LocalMult + !REAL(r8) :: localMult + REAL(r8), PARAMETER :: re_m = 1.0e-05_r8 ! Cloud drop radius in m + REAL(r8), PARAMETER :: cldMin = 1.0e-02_r8 ! Minimum cloud cover + REAL(r8), PARAMETER :: cnst = 1.5e+00_r8 / (re_m * 1.0e+03_r8 * g0) ! Calculating SZA REAL(r8) :: Calday @@ -1502,14 +1572,17 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! For archiving CHARACTER(LEN=255) :: SpcName REAL(r8) :: VMR(State%NCOL,PVER) - REAL(r8) :: MMR0, MMR1, Mass0, Mass1, AirMass, Mass10r, Mass10a + REAL(r8) :: MMR0, MMR1, Mass0, Mass1, AirMass REAL(r8) :: MMR_Min, MMR_Max - REAL(r8) :: SlsData(State%NCOL, PVER, NSls) + REAL(r8) :: SlsData(State%NCOL, PVER, nSls) - INTEGER :: CurrYr, CurrMo, CurrDy, CurrTOD - INTEGER :: CurrYMD, CurrHMS, CurrHr, CurrMn, CurrSc - REAL(f4) :: CurrUTC + INTEGER :: currYr, currMo, currDy, currTOD + INTEGER :: currYMD, currHMS, currHr, currMn, currSc + REAL(f4) :: currUTC + LOGICAL :: firstDay = .True. + LOGICAL :: newDay = .False. + LOGICAL :: newMonth = .False. INTEGER :: TIM_NDX @@ -1537,8 +1610,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Need to be super careful that the module arrays are updated and correctly ! set. NOTE: First thing - you'll need to flip all the data vertically - NX = 1 - NY = NCOL + nX = 1 + nY = NCOL + nZ = PVER ! Update the grid lat/lons since they are module variables ! Assume (!) that area hasn't changed for now, as GEOS-Chem will @@ -1550,8 +1624,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) lonMidArr = 0.0e+0_f4 latMidArr = 0.0e+0_f4 - DO I = 1, NX - DO J = 1, NY + DO I = 1, nX + DO J = 1, nY lonMidArr(I,J) = REAL(Rlons(J), f4) latMidArr(I,J) = REAL(Rlats(J), f4) ENDDO @@ -1571,9 +1645,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Set area CALL Get_Area_All_p( LCHNK, NCOL, Col_Area ) - ! Set default value (in case of chunks with fewer columns) + + ! Field : AREA_M2 + ! Description: Grid box surface area + ! Unit : - + ! Dimensions : nX, nY + ! Note : Set default value (in case of chunks with fewer columns) State_Grid(LCHNK)%Area_M2 = 1.0e+10_fp - DO J = 1, NCOL + DO J = 1, nY State_Grid(LCHNK)%Area_M2(1,J) = REAL(Col_Area(J) * Re**2,fp) ENDDO State_Met(LCHNK)%Area_M2 = State_Grid(LCHNK)%Area_M2 @@ -1589,13 +1668,13 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) MMR_Beg = 0.0e+0_r8 DO N = 1, pcnst - M = Map2GC(N) + M = map2GC(N) IF (M > 0) THEN I = 1 - DO J = 1, NCOL - DO K = 1, PVER + DO J = 1, nY + DO K = 1, nZ ! CURRENTLY KG/KG DRY - MMR_Beg(J,K,M) = State%q(J,PVER+1-K,N) + MMR_Beg(J,K,M) = State%q(J,nZ+1-K,N) State_Chm(LCHNK)%Species(1,J,K,M) = REAL(MMR_Beg(J,K,M),fp) ENDDO ENDDO @@ -1608,12 +1687,12 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Get_Short_Lived_Species( SlsData, LCHNK, NCOL, Pbuf ) ! Remap and flip them - DO N = 1, NSls - M = Map2GC_Sls(N) + DO N = 1, nSls + M = map2GC_Sls(N) IF (M > 0) THEN - DO J = 1, NCOL - DO K = 1, PVER - State_Chm(LCHNK)%Species(1,J,K,M) = REAL(SlsData(J,PVER+1-K,N),fp) + DO J = 1, nY + DO K = 1, nZ + State_Chm(LCHNK)%Species(1,J,K,M) = REAL(SlsData(J,nZ+1-K,N),fp) ENDDO ENDDO ENDIF @@ -1631,8 +1710,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) TIM_NDX = Pbuf_Old_Tim_Idx() CALL Pbuf_Get_Field( Pbuf, NDX_PBLH, PblH ) CALL Pbuf_Get_Field( Pbuf, NDX_FSDS, Fsds ) - CALL Pbuf_Get_Field( Pbuf, NDX_CLDTOP, CldTop ) - CALL Pbuf_Get_Field( Pbuf, NDX_CLDFRC, CldFrc, START=(/1,1,TIM_NDX/), KOUNT=(/NCOL,PVER,1/) ) + CALL Pbuf_Get_Field( Pbuf, NDX_CLDTOP, cldTop ) + CALL Pbuf_Get_Field( Pbuf, NDX_CLDFRC, cldFrc, START=(/1,1,TIM_NDX/), KOUNT=(/NCOL,PVER,1/) ) CALL Pbuf_Get_Field( Pbuf, NDX_NEVAPR, NEvapr, START=(/1,1/), KOUNT=(/NCOL,PVER/)) CALL Pbuf_Get_Field( Pbuf, NDX_PRAIN, PRain, START=(/1,1/), KOUNT=(/NCOL,PVER/)) CALL Pbuf_Get_Field( Pbuf, NDX_RPRDTOT, RprdTot, START=(/1,1/), KOUNT=(/NCOL,PVER/)) @@ -1643,10 +1722,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) H2OVMR = 0.0e0_fp QH2O = 0.0e0_fp ! Note MWDRY = 28.966 g/mol - - DO J = 1, NY - DO L = 1, NZ - QH2O(J,L) = REAL(State_Chm(LCHNK)%Species(1,J,K,iH2O),r8) + DO J = 1, nY + DO L = 1, nZ + QH2O(J,L) = REAL(State_Chm(LCHNK)%Species(1,J,L,iH2O),r8) H2OVMR(J,L) = QH2O(J,L) * MWDry / 18.016e+0_fp ENDDO ENDDO @@ -1654,8 +1732,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Calculate RH (range 0-1, note still level 1 = TOA) RELHUM(:,:) = 0.0e+0_r8 CALL QSat(State%T(:NCOL,:), State%Pmid(:NCOL,:), SatV, SatQ) - DO J = 1, NY - DO L = 1, NZ + DO J = 1, nY + DO L = 1, nZ RELHUM(J,L) = 0.622e+0_r8 * H2OVMR(J,L) / SatQ(J,L) RELHUM(J,L) = MAX( 0.0e+0_r8, MIN( 1.0e+0_r8, RELHUM(J,L) ) ) ENDDO @@ -1663,111 +1741,257 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Estimate roughness height VERY roughly Z0 = 0.0e+0_r8 - DO I = 1, NCOL - IF (Cam_in%LandFrac(I).GE.0.5e+0_r8) THEN - Z0(I) = 0.035e+0_r8 + DO J = 1, nY + IF (Cam_in%LandFrac(J).GE.0.5e+0_r8) THEN + Z0(J) = 0.035e+0_r8 ELSE - Z0(I) = 0.0001e+0_r8 + Z0(J) = 0.0001e+0_r8 ENDIF ENDDO ! Estimate cloud liquid water content and OD - CldLiq = 0.0e+0_r8 - CldIce = 0.0e+0_r8 TauCli = 0.0e+0_r8 TauClw = 0.0e+0_r8 - LWC = 0.0e+0_r8 - IWC = 0.0e+0_r8 - LWP = 0.0e+0_r8 - IWP = 0.0e+0_r8 + ! Note: all using CAM vertical convention (1 = TOA) ! Calculation is based on that done for MOZART - DO I = 1, NCOL - DO K = NZ, 1, -1 - ! In-cloud water content (kg/kg) - CldLiq(I,K) = State%Q(I,K,ixCldLiq) - CldIce(I,K) = State%Q(I,K,ixCldIce) - ! Conversion to "cloud water" ! (g/?) - LWC(I,K) = (CldLiq(I,K) * State%PMid(I,K)/(State%T(I,J)*287.0e+0_r8)) * 1000.0e+0_r8 - IWC(I,K) = (CldIce(I,K) * State%PMid(I,K)/(State%T(I,J)*287.0e+0_r8)) * 1000.0e+0_r8 - ! Liquid water path/ice water path - LocalMult = (State%Pint(I,K+1)-State%Pint(I,K))*1.0e+3_r8/(CldFrc(I,K)*g0) - LWP(I,K) = LWC(I,K)*localMult - IWP(I,K) = IWC(I,K)*localMult - TauClw(I,K) = LWP(I,K) * 0.155e+0_r8 * (CldFrc(I,K)**2) - TauCli(I,K) = IWP(I,K) * 0.155e+0_r8 * (CldFrc(I,K)**2) + DO J = 1, nY + DO L = nZ, 1, -1 + ! Convert water mixing ratio [kg/kg] to water content [g/m^3] + IF ( ( State%Q(J,L,ixCldLiq) + State%Q(J,L,ixCldIce) ) * & + State%PMid(J,L) / (State%T(J,L) * 287.0e+00_r8) * 1.0e+03_r8 <= 0.01_r8 .AND. & + cldFrc(J,L) /= 0.0e+00_r8 ) THEN + cld(J,L) = 0.0e+00_r8 + ELSE + cld(J,L) = cldFrc(J,L) + ENDIF ENDDO ENDDO + DO J = 1, nY + IF ( COUNT( cld(J,:nZ) > cldMin ) > 0 ) THEN + DO L = nZ, 1, -1 + ! ================================================================= + ! =========== Compute cloud optical depth based on ============ + ! =========== Liao et al. JGR, 104, 23697, 1999 ============ + ! ================================================================= + ! + ! Tau = 3/2 * LWC * dZ / ( \rho_w * r_e ) + ! dZ = - dP / ( \rho_air * g ) + ! since Pint is ascending, we can neglect the minus sign + ! + ! Tau = 3/2 * LWC * dP / ( \rho_air * r_e * \rho_w * g ) + ! LWC / \rho_air = Q + ! + ! Tau = 3/2 * Q * dP / ( r_e * rho_w * g ) + ! Tau(K) = 3/2 * Q(K) * (Pint(K+1) - Pint(K)) / (re * rho_w * g ) + ! Tau(K) = Q(K) * (Pint(K+1) - Pint(K)) * Cnst + ! + ! Unit check: | + ! Q : [kg H2O/kg air] | + ! Pint : [Pa]=[kg air/m/s^2] | + ! re : [m] | = 1.0e-5 + ! rho_w: [kg H2O/m^3] | = 1.0e+3 + ! g : [m/s^2] | = 9.81 + ! + TauClw(J,L) = State%Q(J,L,ixCldLiq) & + * (State%Pint(J,L+1)-State%Pint(J,L)) & + * cnst + TauClw(J,L) = MAX(TauClw(J,L), 0.0e+00_r8) + TauCli(J,L) = State%Q(J,L,ixCldIce) & + * (State%Pint(J,L+1)-State%Pint(J,L)) & + * cnst + TauCli(J,L) = MAX(TauCli(J,L), 0.0e+00_r8) + + ENDDO + ENDIF + ENDDO + ! Retrieve tropopause level Trop_Lev = 0.0e+0_r8 CALL Tropopause_FindChemTrop(State, Trop_Lev) ! Back out the pressure Trop_P = 1000.0e+0_r8 - DO I = 1, NCOL - Trop_P(I) = State%PMid(I,Trop_Lev(I)) * 0.01e+0_r8 + DO J = 1, nY + Trop_P(J) = State%PMid(J,Trop_Lev(J)) * 0.01e+0_r8 ENDDO ! Calculate snow depth - SnowDepth = 0.0e+0_r8 - DO I = 1, NCOL - Sd_Ice = MAX(0.0e+0_r8,Cam_in%Snowhice(I)) - Sd_Lnd = MAX(0.0e+0_r8,Cam_in%Snowhland(I)) - Frc_Ice = MAX(0.0e+0_r8,Cam_in%Icefrac(I)) + snowDepth = 0.0e+0_r8 + DO J = 1, nY + Sd_Ice = MAX(0.0e+0_r8,Cam_in%Snowhice(J)) + Sd_Lnd = MAX(0.0e+0_r8,Cam_in%Snowhland(J)) + Frc_Ice = MAX(0.0e+0_r8,Cam_in%Icefrac(J)) IF (Frc_Ice > 0.0e+0_r8) THEN Sd_Avg = (Sd_Lnd*(1.0e+0_r8 - Frc_Ice)) + (Sd_Ice * Frc_Ice) ELSE Sd_Avg = Sd_Lnd ENDIF - SnowDepth(I) = Sd_Avg + snowDepth(J) = Sd_Avg ENDDO - ! Estimate 2D cloud fraction (pessimistic assumption) - Cld2D = 0.0e+0_r8 - DO I = 1, NCOL - Cld2D(I) = MAXVAL(CldFrc(I,:)) + ! Field : ALBD + ! Description: Visible surface albedo + ! Unit : - + ! Dimensions : nX, nY + State_Met(LCHNK)%ALBD (1,:) = Cam_in%Asdir(:) + + ! Field : CLDFRC + ! Description: Column cloud fraction + ! Unit : - + ! Dimensions : nX, nY + ! Note : Estimate column cloud fraction as the maximum cloud + ! fraction in the column (pessimistic assumption) + DO J = 1, nY + State_Met(LCHNK)%CLDFRC(1,J) = MAXVAL(cldFrc(J,:)) ENDDO - State_Met(LCHNK)%ALBD (1,:) = Cam_in%Asdir(:) - State_Met(LCHNK)%CLDFRC (1,:) = CLD2D(:) + ! Field : EFLUX, HFLUX + ! Description: Latent heat flux, sensible heat flux + ! Unit : W/m^2 + ! Dimensions : nX, nY State_Met(LCHNK)%EFLUX (1,:) = Cam_in%Lhf(:) State_Met(LCHNK)%HFLUX (1,:) = Cam_in%Shf(:) + + ! Field : FRCLND, FRLAND, FROCEAN, FRSEAICE, FRLAKE, FRLANDIC + ! Description: Olson land fraction + ! Fraction of land + ! Fraction of ocean + ! Fraction of sea ice + ! Fraction of lake + ! Fraction of land ice + ! Fraction of snow + ! Unit : - + ! Dimensions : nX, nY State_Met(LCHNK)%FRCLND (1,:) = 0.0e+0_fp ! Olson land fraction State_Met(LCHNK)%FRLAND (1,:) = Cam_in%LandFrac(:) State_Met(LCHNK)%FROCEAN (1,:) = Cam_in%OcnFrac(:) + Cam_in%IceFrac(:) State_Met(LCHNK)%FRSEAICE (1,:) = Cam_in%IceFrac(:) State_Met(LCHNK)%FRLAKE (1,:) = 0.0e+0_fp State_Met(LCHNK)%FRLANDIC (1,:) = 0.0e+0_fp + State_Met(LCHNK)%FRSNO (1,:) = 0.0e+0_fp + + ! Field : GWETROOT, GWETTOP + ! Description: Root and top soil moisture + ! Unit : - + ! Dimensions : nX, nY State_Met(LCHNK)%GWETROOT (1,:) = 0.0e+0_fp State_Met(LCHNK)%GWETTOP (1,:) = 0.0e+0_fp + + ! Field : LAI + ! Description: Leaf area index + ! Unit : m^2/m^2 + ! Dimensions : nX, nY State_Met(LCHNK)%LAI (1,:) = 0.0e+0_fp + + ! Field : PARDR, PARDF + ! Description: Direct and diffuse photsynthetically active radiation + ! Unit : W/m^2 + ! Dimensions : nX, nY State_Met(LCHNK)%PARDR (1,:) = 0.0e+0_fp State_Met(LCHNK)%PARDF (1,:) = 0.0e+0_fp - State_Met(LCHNK)%PBLH (1,:) = PblH(:NCOL) + + ! Field : PBLH + ! Description: PBL height + ! Unit : m + ! Dimensions : nX, nY + State_Met(LCHNK)%PBLH (1,:) = PblH(:nY) + + ! Field : PHIS + ! Description: Surface geopotential height + ! Unit : m + ! Dimensions : nX, nY State_Met(LCHNK)%PHIS (1,:) = State%Phis(:) - State_Met(LCHNK)%PRECANV (1,:) = 0.0e+0_fp ! Not used - State_Met(LCHNK)%PRECCON (1,:) = Cam_Out%Precc(:) ! Convective precip - State_Met(LCHNK)%PRECLSC (1,:) = Cam_Out%Precl(:) ! "Stratiform" precip - State_Met(LCHNK)%PRECTOT (1,:) = Cam_Out%Precc(:) + Cam_Out%Precl(:) ! All precip + + ! Field : PRECANV, PRECCON, PRECLSC, PRECTOT + ! Description: Anvil precipitation @ ground + ! Convective precipitation @ ground + ! Large-scale precipitation @ ground + ! Total precipitation @ ground + ! Unit : kg/m^2/s + ! Dimensions : nX, nY + State_Met(LCHNK)%PRECANV (1,:) = 0.0e+0_fp + State_Met(LCHNK)%PRECCON (1,:) = Cam_Out%Precc(:) + State_Met(LCHNK)%PRECLSC (1,:) = Cam_Out%Precl(:) + State_Met(LCHNK)%PRECTOT (1,:) = Cam_Out%Precc(:) + Cam_Out%Precl(:) + + ! Field : TROPP + ! Description: Tropopause pressure + ! Unit : hPa + ! Dimensions : nX, nY State_Met(LCHNK)%TROPP (1,:) = Trop_P(:) + + ! Field : PS1_WET, PS2_WET + ! Description: Wet surface pressure at start and end of timestep + ! Unit : hPa + ! Dimensions : nX, nY State_Met(LCHNK)%PS1_WET (1,:) = State%ps(:)*0.01e+0_fp State_Met(LCHNK)%PS2_WET (1,:) = State%ps(:)*0.01e+0_fp + + ! Field : SLP + ! Description: Sea level pressure + ! Unit : hPa + ! Dimensions : nX, nY State_Met(LCHNK)%SLP (1,:) = State%ps(:)*0.01e+0_fp + + ! Field : TS, TSKIN + ! Description: Surface temperature, surface skin temperature + ! Unit : K + ! Dimensions : nX, nY State_Met(LCHNK)%TS (1,:) = Cam_in%TS(:) State_Met(LCHNK)%TSKIN (1,:) = Cam_in%TS(:) + + ! Field : SWGDN + ! Description: Incident radiation @ ground + ! Unit : W/m^2 + ! Dimensions : nX, nY State_Met(LCHNK)%SWGDN (1,:) = fsds(:) - State_Met(LCHNK)%TO3 (1,:) = 300.0e+0_fp ! Dummy - State_Met(LCHNK)%SNODP (1,:) = snowdepth(:) - State_Met(LCHNK)%SNOMAS (1,:) = snowdepth(:) * 1000.0e+0_r8 ! m -> kg/m2 for ice w/rho ~ 1000 kg/m3 + + ! Field : TO3 + ! Description: Total overhead ozone column + ! Unit : DU + ! Dimensions : nX, nY + State_Met(LCHNK)%TO3 (1,:) = 300.0e+0_fp ! TMMF + + ! Field : SNODP, SNOMAS + ! Description: Snow depth, snow mass + ! Unit : m, kg/m^2 + ! Dimensions : nX, nY + ! Note : Conversion from m to kg/m^2 + ! \rho_{ice} = 916.7 kg/m^3 + State_Met(LCHNK)%SNODP (1,:) = snowDepth(:) + State_Met(LCHNK)%SNOMAS (1,:) = snowDepth(:) * 916.7e+0_r8 + + ! Field : SUNCOS, SUNCOSmid + ! Description: COS(solar zenith angle) at current time and midpoint + ! of chemistry timestep + ! Unit : - + ! Dimensions : nX, nY + ! Note : Compute tendency in -/s (tmmf, 1/13/20) ? State_Met(LCHNK)%SUNCOS (1,:) = CSZA(:) State_Met(LCHNK)%SUNCOSmid (1,:) = CSZA(:) - State_Met(LCHNK)%U10M (1,:) = State%U(:,NZ) + + ! Field : U10M, V10M + ! Description: E/W and N/S wind speed @ 10m height + ! Unit : m/s + ! Dimensions : nX, nY + State_Met(LCHNK)%U10M (1,:) = State%U(:,nZ) + State_Met(LCHNK)%V10M (1,:) = State%V(:,nZ) + + ! Field : USTAR + ! Description: Friction velocity + ! Unit : m/s + ! Dimensions : nX, nY State_Met(LCHNK)%USTAR (1,:) = Cam_In%UStar(:) - State_Met(LCHNK)%V10M (1,:) = State%V(:,NZ) + + ! Field : Z0 + ! Description: Surface roughness length + ! Unit : m + ! Dimensions : nX, nY State_Met(LCHNK)%Z0 (1,:) = Z0(:) - DO J = 1, NY - DO I = 1, NX + DO J = 1, nY + DO I = 1, nX iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(I,J) + & State_Met(LCHNK)%FRLANDIC(I,J) + & State_Met(LCHNK)%FRLAKE(I,J), & @@ -1776,124 +2000,253 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%FRSEAICE(I,J) /) ) IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 ! reset ocean to 0 + + ! Field : LWI + ! Description: Land/water indices + ! Unit : - + ! Dimensions : nX, nY State_Met(LCHNK)%LWI(I,J) = FLOAT( iMaxLoc(1) ) ENDDO ENDDO ! Three-dimensional fields on level edges - DO J = 1, NY - DO L = 1, NZ+1 - State_Met(LCHNK)%CMFMC (1,J,L) = 0.0e+0_fp ! Needed for convection only - State_Met(LCHNK)%PFICU (1,J,L) = 0.0e+0_fp ! Needed for convection only - State_Met(LCHNK)%PFILSAN (1,J,L) = 0.0e+0_fp ! Needed for convection only - State_Met(LCHNK)%PFLCU (1,J,L) = LsFlxSnw(j,NZ+2-L) ! kg/m2/s - State_Met(LCHNK)%PFLLSAN (1,J,L) = MAX(0.0e+0_fp,LsFlxPrc(J,NZ+2-L) - LsFlxSnw(J,NZ+2-L)) ! kg/m2/s - State_Met(LCHNK)%PEDGE (1,J,L) = State%Pint(J,NZ+2-L)*0.01e+0_fp + DO J = 1, nY + DO L = 1, nZ+1 + ! Field : PEDGE + ! Description: Wet air pressure at (vertical) level edges + ! Unit : hPa + ! Dimensions : nX, nY, nZ+1 + State_Met(LCHNK)%PEDGE (1,J,L) = State%Pint(J,nZ+2-L)*0.01e+0_fp + + ! Field : CMFMC + ! Description: Upward moist convective mass flux + ! Unit : kg/m^2/s + ! Dimensions : nX, nY, nZ+1 + State_Met(LCHNK)%CMFMC (1,J,L) = 0.0e+0_fp + + ! Field : PFICU, PFLCU + ! Description: Downward flux of ice/liquid precipitation (convective) + ! Unit : kg/m^2/s + ! Dimensions : nX, nY, nZ+1 + State_Met(LCHNK)%PFICU (1,J,L) = 0.0e+0_fp + State_Met(LCHNK)%PFLCU (1,J,L) = 0.0e+0_fp + + ! Field : PFILSAN, PFLLSAN + ! Description: Downward flux of ice/liquid precipitation (Large-scale & anvil) + ! Unit : kg/m^2/s + ! Dimensions : nX, nY, nZ+1 + State_Met(LCHNK)%PFILSAN (1,J,L) = LsFlxSnw(j,nZ+2-L) ! kg/m2/s + State_Met(LCHNK)%PFLLSAN (1,J,L) = MAX(0.0e+0_fp,LsFlxPrc(J,nZ+2-L) - LsFlxSnw(J,nZ+2-L)) ! kg/m2/s ENDDO ENDDO - ! These are set later - State_Met(LCHNK)%PS1_DRY (:,:) = 0.0e+0_fp - State_Met(LCHNK)%PS2_DRY (:,:) = 0.0e+0_fp - - - ! Convert cldtop from real to integer - I = 1 - DO J = 1, NY - State_Met(LCHNK)%CldTops(1,J) = NZ + 1 - NINT(CldTop(J)) + DO J = 1, nY + ! Field : U, V + ! Description: Max cloud top height + ! Unit : level + ! Dimensions : nX, nY + State_Met(LCHNK)%cldTops(1,J) = nZ + 1 - NINT(cldTop(J)) ENDDO ! Three-dimensional fields on level centers - DO J = 1, NY - DO L = 1, NZ - State_Met(LCHNK)%U (1,J,L) = State%U(J,NZ+1-L) - State_Met(LCHNK)%V (1,J,L) = State%V(J,NZ+1-L) - !State_Met(LCHNK)%OMEGA (1,J,L) = State%Omega(J,NZ+1-L) - State_Met(LCHNK)%CLDF (1,J,L) = CldFrc(j,nZ+1-l) + DO J = 1, nY + DO L = 1, nZ + + ! Field : U, V + ! Description: E/W and N/S component of wind + ! Unit : m/s + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%U (1,J,L) = State%U(J,nZ+1-L) + State_Met(LCHNK)%V (1,J,L) = State%V(J,nZ+1-L) + + ! Field : OMEGA + ! Description: Updraft velocity + ! Unit : Pa/s + ! Dimensions : nX, nY, nZ + !State_Met(LCHNK)%OMEGA (1,J,L) = State%Omega(J,nZ+1-L) + + ! Field : CLDF + ! Description: 3-D cloud fraction + ! Unit : - + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%CLDF (1,J,L) = cldFrc(j,nZ+1-l) + + ! Field : DTRAIN + ! Description: Detrainment flux + ! Unit : kg/m^2/s + ! Dimensions : nX, nY, nZ State_Met(LCHNK)%DTRAIN (1,J,L) = 0.0e+0_fp ! Used in convection + + ! Field : DQRCU + ! Description: Convective precipitation production rate + ! Unit : kg/kg dry air/s + ! Dimensions : nX, nY, nZ State_Met(LCHNK)%DQRCU (1,J,L) = 0.0e+0_fp ! Used in convection - State_Met(LCHNK)%DQRLSAN (1,J,L) = PRain(J,NZ+1-L) ! kg/kg/s - State_Met(LCHNK)%QI (1,J,L) = CldIce(J,NZ+1-L) ! kg ice / kg dry air - State_Met(LCHNK)%QL (1,J,L) = CldLiq(J,NZ+1-L) ! kg water / kg dry air - State_Met(LCHNK)%RH (1,J,L) = RelHum(J,NZ+1-L) * 100.0e+0_fp - State_Met(LCHNK)%TAUCLI (1,J,L) = TauCli(J,NZ+1-L) - State_Met(LCHNK)%TAUCLW (1,J,L) = TauClw(J,NZ+1-L) - State_Met(LCHNK)%REEVAPCN (1,J,L) = 0.0e+0_fp ! Used in convection - State_Met(LCHNK)%REEVAPLS (1,J,L) = NEvapr(J,NZ+1-L) ! kg/kg/s - State_Met(LCHNK)%SPHU1 (1,J,L) = QH2O(J,NZ+1-L) * 1.0e+3_fp ! g/kg - State_Met(LCHNK)%SPHU2 (1,J,L) = QH2O(J,NZ+1-L) * 1.0e+3_fp ! g/kg - State_Met(LCHNK)%TMPU1 (1,J,L) = State%T(J,NZ+1-L) - State_Met(LCHNK)%TMPU2 (1,J,L) = State%T(J,NZ+1-L) + + ! Field : DQRLSAN + ! Description: Large-scale precipitation production rate + ! Unit : kg/kg dry air/s + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%DQRLSAN (1,J,L) = PRain(J,nZ+1-L) ! kg/kg/s + + ! Field : QI, QL + ! Description: Cloud ice/water mixing ratio + ! Unit : kg/kg dry air + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%QI (1,J,L) = State%Q(J,nZ+1-L,ixCldIce) ! kg ice / kg dry air + State_Met(LCHNK)%QL (1,J,L) = State%Q(J,nZ+1-L,ixCldLiq) ! kg water / kg dry air + + ! Field : RH + ! Description: Relative humidity + ! Unit : % + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%RH (1,J,L) = RelHum(J,nZ+1-L) * 100.0e+0_fp + + ! Field : TAUCLI, TAUCLW + ! Description: Optical depth of ice/H2O clouds + ! Unit : - + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%TAUCLI (1,J,L) = TauCli(J,nZ+1-L) + State_Met(LCHNK)%TAUCLW (1,J,L) = TauClw(J,nZ+1-L) + + ! Field : REEVAPCN + ! Description: Evaporation of convective precipitation + ! (w/r/t dry air) + ! Unit : kg + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%REEVAPCN (1,J,L) = 0.0e+0_fp + + ! Field : REEVAPLS + ! Description: Evaporation of large-scale + anvil precipitation + ! (w/r/t dry air) + ! Unit : kg + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%REEVAPLS (1,J,L) = NEvapr(J,nZ+1-L) ! kg/kg/s + + ! Field : SPHU1, SPHU2 + ! Description: Specific humidity at current and next timestep + ! Unit : g H2O/ kg air + ! Dimensions : nX, nY, nZ + ! Note : Since we are using online meteorology, we do not have + ! access to the data at the next time step + ! Compute tendency in g H2O/kg air/s (tmmf, 1/13/20) ? + State_Met(LCHNK)%SPHU1 (1,J,L) = QH2O(J,nZ+1-L) * 1.0e+3_fp ! g/kg + State_Met(LCHNK)%SPHU2 (1,J,L) = QH2O(J,nZ+1-L) * 1.0e+3_fp ! g/kg + + ! Field : TMPU1, TMPU2 + ! Description: Temperature at current and next timestep + ! Unit : K + ! Dimensions : nX, nY, nZ + ! Note : Since we are using online meteorology, we do not have + ! access to the data at the next time step + ! Compute tendency in K/s (tmmf, 1/13/20) ? + State_Met(LCHNK)%TMPU1 (1,J,L) = State%T(J,nZ+1-L) + State_Met(LCHNK)%TMPU2 (1,J,L) = State%T(J,nZ+1-L) ENDDO ENDDO - ! Derived fields + ! Field : T + ! Description: Temperature at current time + ! Unit : K + ! Dimensions : nX, nY, nZ + ! Note : Since we are using online meteorology, we do not have + ! access to the data at the next time step + ! Compute tendency in K/s (tmmf, 1/13/20) ? State_Met(LCHNK)%T = (State_Met(LCHNK)%TMPU1 + State_Met(LCHNK)%TMPU2)*0.5e+0_fp + + ! Field : SPHU + ! Description: Specific humidity at current time + ! Unit : g H2O/ kg air + ! Dimensions : nX, nY, nZ + ! Note : Since we are using online meteorology, we do not have + ! access to the data at the next time step + ! Compute tendency in g H2O/kg air/s (tmmf, 1/13/20) ? State_Met(LCHNK)%SPHU = (State_Met(LCHNK)%SPHU1 + State_Met(LCHNK)%SPHU2)*0.5e+0_fp - ! Calculate total OD as liquid cloud OD + ice cloud OD + ! Field : OPTD + ! Description: Total in-cloud optical depth (visible band) + ! Unit : - + ! Dimensions : nX, nY, nZ State_Met(LCHNK)%OPTD = State_Met(LCHNK)%TAUCLI + State_Met(LCHNK)%TAUCLW ! Nullify all pointers - NULLIFY(PblH ) - NULLIFY(Fsds ) - NULLIFY(PRain ) + Nullify(PblH ) + Nullify(Fsds ) + Nullify(PRain ) Nullify(LsFlxSnw) Nullify(LsFlxPrc) - Nullify(CldTop ) - Nullify(CldFrc ) + Nullify(cldTop ) + Nullify(cldFrc ) Nullify(NEvapr ) Nullify(RprdTot ) - ! Eventually initialize/reset wetdep - IF ( Input_Opt%LConv .OR. Input_Opt%LChem .OR. Input_Opt%LWetD ) THEN - CALL Setup_WetScav( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & - State_Chm = State_Chm(LCHNK), & - State_Grid = State_Grid(LCHNK), & - State_Met = State_Met(LCHNK), & - RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Failed to set up wet scavenging!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ENDIF + ! Field : InChemGrid + ! Description: Are we in the chemistry grid? + ! Unit : - + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%InChemGrid(:,:,:) = .True. ! Determine current date and time - CALL Get_Curr_Date(CurrYr,CurrMo,CurrDy,CurrTOD) + CALL Get_Curr_Date( yr = currYr, & + mon = currMo, & + day = currDy, & + tod = currTOD ) + ! For now, force year to be 2000 - CurrYr = 2000 - CurrYMD = (CurrYr*1000) + (CurrMo*100) + (CurrDy) + currYr = 2000 + currYMD = (currYr*1000) + (currMo*100) + (currDy) ! Deal with subdaily - CurrUTC = REAL(CurrTOD,f4)/3600.0e+0_f4 - CurrSc = 0 - CurrMn = 0 - CurrHr = 0 - DO WHILE (CurrTOD > 3600) - CurrTOD = CurrTOD - 3600 - CurrHr = CurrHr + 1 + currUTC = REAL(currTOD,f4)/3600.0e+0_f4 + currSc = 0 + currMn = 0 + currHr = 0 + DO WHILE (currTOD > 3600) + currTOD = currTOD - 3600 + currHr = currHr + 1 ENDDO - DO WHILE (CurrTOD > 60) - CurrTOD = CurrTOD - 60 - CurrMn = CurrMn + 1 + DO WHILE (currTOD > 60) + currTOD = currTOD - 60 + currMn = currMn + 1 ENDDO - CurrSc = CurrTOD - CurrHMS = (CurrHr*1000) + (CurrMn*100) + (CurrSc) - + currSc = currTOD + currHMS = (currHr*1000) + (currMn*100) + (currSc) + + IF ( firstDay ) THEN + newDay = .True. + newMonth = .True. + firstDay = .False. + ELSE IF ( currHMS < dT ) THEN + newDay = .True. + IF ( currDy == 1 ) THEN + newMonth = .True. + ELSE + newMonth = .False. + ENDIF + ELSE + newDay = .False. + newMonth = .False. + ENDIF + !TMMF, DEBUG + IF ( rootChunk ) THEN + Write(6,*) " firstDay = ", firstDay + Write(6,*) " newDay = ", newDay + Write(6,*) " newMonth = ", newMonth + Write(6,*) " Current Day is = ", currDy + Write(6,*) " Current Month is = ", currMo + ENDIF ! Pass time values obtained from the ESMF environment to GEOS-Chem CALL Accept_External_Date_Time( am_I_Root = rootChunk, & - value_NYMD = CurrYMD, & - value_NHMS = CurrHMS, & - value_YEAR = CurrYr, & - value_MONTH = CurrMo, & - value_DAY = CurrDy, & + value_NYMD = currYMD, & + value_NHMS = currHMS, & + value_YEAR = currYr, & + value_MONTH = currMo, & + value_DAY = currDy, & value_DAYOFYR = INT(FLOOR(Calday)), & - value_HOUR = CurrHr, & - value_MINUTE = CurrMn, & + value_HOUR = currHr, & + value_MINUTE = currMn, & value_HELAPSED = 0.0e+0_f4, & - value_UTC = CurrUTC, & + value_UTC = currUTC, & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN @@ -1910,15 +2263,29 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - ! Calculate State_Met etc for this timestep - ! Use the CAM psdry fields instead of using the GC calculation - !CALL Set_Dry_Surface_Pressure(State_Met(LCHNK), 1) + ! Field : PS1_DRY, PS2_DRY + ! Description: Dry surface pressure at current and next timestep + ! Unit : hPa + ! Dimensions : nX, nY, nZ+1 + ! Note : 1. Use the CAM PSDry fields instead of using the + ! GEOS-Chem calculation + ! 2. As we are using online meteorology, we do not + ! have access to the fields at the next time step + ! Compute Pa/s tendency? (tmmf, 1/13/20) State_Met(LCHNK)%PS1_DRY (1,:) = State%PSDry(:) * 0.01e+0_fp State_Met(LCHNK)%PS2_DRY (1,:) = State%PSDry(:) * 0.01e+0_fp - ! Set surface pressures to match those in input + ! Field : PSC2_WET, PSC2_DRY + ! Description: Interpolated wet and dry surface pressure at the + ! current time + ! Unit : hPa + ! Dimensions : nX, nY, nZ+1 + ! Note : As we are using online meteorology, we do not + ! have access to the fields at the next time step + ! Compute Pa/s tendency? (tmmf, 1/13/20) State_Met(LCHNK)%PSC2_WET = State_Met(LCHNK)%PS1_WET State_Met(LCHNK)%PSC2_DRY = State_Met(LCHNK)%PS1_DRY + CALL Set_Floating_Pressures( am_I_Root = rootChunk, & State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & @@ -1930,6 +2297,28 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ! Set quantities of interest but do not change VMRs + ! This function updates: + ! ==================================================================== + ! (1) PEDGE : Moist air pressure at grid box bottom [hPa] + ! (2) PEDGE_DRY : Dry air partial pressure at box bottom [hPa] + ! (3) PMID : Moist air pressure at grid box centroid [hPa] + ! (4) PMID_DRY : Dry air partial pressure at box centroid [hPa] + ! (5) PMEAN : Altitude-weighted mean moist air pressure [hPa] + ! (6) PMEAN_DRY : Alt-weighted mean dry air partial pressure [hPa] + ! (7) DELP : Delta-P extent of grid box [hPa] + ! (Same for both moist and dry air since we + ! assume constant water vapor pressure + ! across box) + ! (8) AIRDEN : Mean grid box dry air density [kg/m^3] + ! (defined as total dry air mass/box vol) + ! (9) MAIRDEN : Mean grid box moist air density [kg/m^3] + ! (defined as total moist air mass/box vol) + ! (10) AD : Total dry air mass in grid box [kg] + ! (11) ADMOIST : Total moist air mass in grid box [kg] + ! (12) BXHEIGHT : Vertical height of grid box [m] + ! (13) AIRVOL : Volume of grid box [m^3] + ! (14) MOISTMW : Molecular weight of moist air in box [g/mol] + ! ==================================================================== CALL AirQnt( am_I_Root = rootChunk, & Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & @@ -1947,7 +2336,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Initialize strat chem if not already done. This has to be done here because ! it needs to have non-zero values in State_Chm%AD, which only happens after ! the first call to AirQnt - IF ( (.not.SCHEM_READY) .and. Input_Opt%LSCHEM ) THEN + !IF ( (.not.SCHEM_READY) .and. Input_Opt%LSCHEM ) THEN + IF ( (.not.SCHEM_READY) .and. .True. ) THEN !TMMF CALL Init_Strat_Chem( am_I_Root = rootChunk, & Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & @@ -1956,56 +2346,372 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) RC = RC ) IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Could not initialize strat-chem!' + ErrMsg = 'Error encountered in "Init_Strat_Chem"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF SCHEM_READY = .True. ENDIF - ! Run chemistry - IF (Input_Opt%LChem) THEN - CALL Compute_Overhead_O3( am_I_Root = rootChunk, & - State_Grid = State_Grid(LCHNK), & - DAY = 1, & - USE_O3_FROM_MET = Input_Opt%Use_O3_From_Met, & - TO3 = State_Met(LCHNK)%TO3 ) - - CALL Do_Chemistry( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & - State_Chm = State_Chm(LCHNK), & - State_Diag = State_Diag(LCHNK), & - State_Grid = State_Grid(LCHNK), & - State_Met = State_Met(LCHNK), & - RC = RC ) + !============================================================== + ! ***** R U N H E M C O P H A S E 1 ***** + ! + ! Phase 1 updates the HEMCO clock and the content of the + ! HEMCO data list. This should be done before writing the + ! diagnostics organized in the HEMCO diagnostics structure, + ! and before using any of the HEMCO data list fields. + ! (ckeller, 4/1/15) + !============================================================== + ! Run HEMCO Phase 1 + !CALL Emissions_Run ( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! State_Chm = State_Chm(LCHNK), & + ! State_Diag = State_Diag(LCHNK), & + ! State_Grid = State_Grid(LCHNK), & + ! State_Met = State_Met(LCHNK), & + ! EmisTime = EmisTime, & + ! Phase = 1, & + ! RC = RC ) + ! + !! Trap potential errors + !IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in "Emissions_Run"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + !ENDIF + + !============================================================== + ! ***** L E A F A R E A I N D I C E S ***** + !============================================================== + !IF ( newDay ) THEN + ! + ! ! Initialize the State_Met%XLAI_NATIVE field from HEMCO + ! CALL Get_XlaiNative_from_HEMCO( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! State_Met = State_Met(LCHNK), & + ! RC = RC ) + ! + ! ! Trap potential errors + ! IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = + ! 'Error encountered in "Get_XlaiNative_from_HEMCO"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + ! ENDIF + ! + ! ! Compute State_Met%XLAI (for drydep) and State_Met%MODISLAI, + ! ! which is the average LAI per grid box (for soil NOx emissions) + ! CALL Compute_Xlai( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! State_Grid = State_Grid(LCHNK), & + ! State_Met = State_Met(LCHNK), & + ! RC = RC ) + ! + ! ! Trap potential errors + ! IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in "Compute_Xlai"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + ! ENDIF + !ENDIF + + !---------------------------------------------------------- + ! %%% GET SOME NON-EMISSIONS DATA FIELDS VIA HEMCO %%% + ! + ! HEMCO can track non-emission data fields for chemistry + ! simulations. Put these subroutine calls after the + ! call to EMISSIONS_RUN, so that the HEMCO data structure + ! will be initialized. (bmy, 3/20/15) + ! + ! HEMCO data list is now updated further above, so can + ! take these calls out of the emissions sequence. + ! (ckeller, 4/01/15) + !---------------------------------------------------------- + !IF ( LCHEM .and. newMonth ) THEN + ! + ! ! The following only apply when photolysis is used, + ! ! that is for fullchem or aerosol simulations. + ! IF ( ITS_A_FULLCHEM_SIM .or. ITS_AN_AEROSOL_SIM ) THEN + ! + ! ! Copy UV Albedo data (for photolysis) into the + ! ! State_Met%UVALBEDO field. (bmy, 3/20/15) + ! CALL Get_UvAlbedo( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! State_Met = State_Met(LCHNK), & + ! RC = RC ) + ! + ! ! Trap potential errors + ! IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in "Get_UvAlbedo"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + ! ENDIF + ! + ! IF ( Input_Opt%USE_TOMS_O3 ) THEN + ! ! Get TOMS overhead O3 columns for photolysis from + ! ! the HEMCO data structure (bmy, 3/20/15) + ! CALL Read_TOMS( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! RC = RC ) + ! + ! ! Trap potential errors + ! IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in "Read_TOMS"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + ! ENDIF + ! ENDIF + ! + ! ENDIF + ! + ! ! Read data required for Hg2 gas-particle partitioning + ! ! (H Amos, 25 Oct 2011) + ! IF ( ITS_A_MERCURY_SIM ) THEN + ! CALL Read_Hg2_Partitioning( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! State_Grid = State_Grid(LCHNK), & + ! State_Met = State_Met(LCHNK), & + ! MONTH = 1, & !TMMF + ! RC = RC ) + ! + ! ! Trap potential errors + ! IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = + ! 'Error encountered in "Read_Hg2_Partitioning"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + ! ENDIF + ! + ! ENDIF + !ENDIF + + !! Prescribe methane surface concentrations throughout PBL + !IF ( ITS_A_FULLCHEM_SIM .and. id_CH4 > 0 ) THEN + ! + ! ! Set CH4 concentrations + ! CALL SET_CH4( am_I_Root = MasterProc, & + ! Input_Opt = Input_Opt, & + ! State_Chm = State_Chm(LCHNK), & + ! State_Diag = State_Diag(LCHNK), & + ! State_Grid = State_Grid(LCHNK), & + ! State_Met = State_Met(LCHNK), & + ! RC = RC ) + ! + ! ! Trap potential errors + ! IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in call to "SET_CH4"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + ! ENDIF + !ENDIF + + ! Eventually initialize/reset wetdep + IF ( Input_Opt%LConv .OR. Input_Opt%LChem .OR. Input_Opt%LWetD ) THEN + CALL Setup_WetScav( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Chemistry failed!' + ErrMsg = 'Error encountered in "Setup_WetScav"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF ENDIF + !============================================================== + ! ***** C O M P U T E P B L H E I G H T etc. ***** + !============================================================== + ! Move this call from the PBL mixing routines because the PBL + ! height is used by drydep and some of the emissions routines. + ! (ckeller, 3/5/15) + CALL Compute_PBL_Height( am_I_Root = rootChunk, & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Compute_PBL_Height"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + !-------------------------------------------------------------- + ! Test for emission timestep + ! Now always do emissions here, even for full-mixing + ! (ckeller, 3/5/15) + !-------------------------------------------------------------- + !=========================================================== + ! ***** D R Y D E P O S I T I O N ***** + !=========================================================== + IF ( Input_Opt%LDryD ) THEN + + ! Compute drydep velocities + CALL Do_Drydep( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Do_Drydep!"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF - !IF (MasterProc) WRITE(iulog,*) ' --> TEND SIZE: ', size(State%NCOL) - !IF (MasterProc) WRITE(iulog,'(a,2(x,I6))') ' --> TEND SIDE: ', lbound(State%NCOL),ubound(State%NCOL) + !!=========================================================== + !! ***** E M I S S I O N S ***** + !! + !! NOTE: For a complete description of how emissions from + !! HEMCO are added into GEOS-Chem (and how they are mixed + !! into the boundary layer), please see the wiki page: + !! + !! http://wiki-geos-chem.org/Distributing_emissions_in_the_PBL + !!=========================================================== + ! + !! EMISSIONS_RUN will call HEMCO run phase 2. HEMCO run phase + !! only calculates emissions. All data has been read to disk + !! in phase 1 at the beginning of the time step. + !! (ckeller, 4/1/15) + !CALL Emissions_Run( am_I_Root = rootChunk, & + ! Input_Opt = Input_Opt, & + ! State_Chm = State_Chmk(LCHNK), & + ! State_Diag = State_Diag(LCHNK), & + ! State_Grid = State_Grid(LCHNK), & + ! State_Met = State_Met(LCHNK), & + ! TimeForEmis = TimeForEmis, & + ! Phase = 2, & + ! RC = RC ) + ! + !! Trap potential errors + !IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = + ! 'Error encountered in "Emissions_Run"! after drydep!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + !ENDIF - ! Make sure State_Chm(lchnk) is back in kg/kg dry! + !!=========================================================== + !! ***** M I X E D L A Y E R M I X I N G ***** + !!=========================================================== + ! + !! Note: mixing routine expects tracers in v/v + !! DO_MIXING applies the tracer tendencies (dry deposition, + !! emission rates) to the tracer arrays and performs PBL + !! mixing. + !! In the non-local PBL scheme, dry deposition and emission + !! fluxes below the PBL are handled within the PBL mixing + !! routine. Otherwise, tracer concentrations are first updated + !! and the full-mixing is then applied. + !! (ckeller, 3/5/15) + !! NOTE: Tracer concentration units are converted locally + !! to [v/v dry air] for mixing. Eventually mixing should + !! be updated to use [kg/kg total air] (ewl, 9/18/15) + !CALL Do_Mixing( am_I_Root = rootChunk, & + ! Input_Opt = Input_Opt, & + ! State_Chm = State_Chm(LCHNK), & + ! State_Diag = State_Diag(LCHNK), & + ! State_Grid = State_Grid(LCHNK), & + ! State_Met = State_Met(LCHNK), & + ! RC = RC ) + ! + !! Trap potential errors + !IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in "Do_Mixing"!' + ! CALL ERror_Stop( ErrMsg, ThisLoc ) + !ENDIF + ! + !!=========================================================== + !! ***** C L O U D C O N V E C T I O N ***** + !!=========================================================== + !IF ( LCONV ) THEN + ! + ! ! Call the appropriate convection routine + ! ! NOTE: Tracer concentration units are converted locally + ! ! to [kg/kg total air] for convection (ewl, 9/18/15) + ! CALL Do_Convection( am_I_Root = rootChunk, & + ! Input_Opt = Input_Opt, & + ! State_Chm = State_Chm(LCHNK), & + ! State_Diag = State_Diag(LCHNK), & + ! State_Grid = State_Grid(LCHNK), & + ! State_Met = State_Met(LCHNK), & + ! RC = RC ) + ! + ! ! Trap potential errors + ! IF ( RC /= GC_SUCCESS ) THEN + ! ErrMsg = 'Error encountered in "Do_Convection"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) + ! ENDIF + !ENDIF + + !============================================================== + ! ***** C H E M I S T R Y ***** + !============================================================== + ! Get the overhead column O3 for use with FAST-J + IF ( Input_Opt%Its_A_FullChem_Sim .OR. & + Input_Opt%Its_An_Aerosol_Sim ) THEN + + IF (Input_Opt%LChem) THEN + CALL Compute_Overhead_O3( am_I_Root = rootChunk, & + State_Grid = State_Grid(LCHNK), & + DAY = 1, & + DAY = currDy, & + USE_O3_FROM_MET = Input_Opt%Use_O3_From_Met, & + TO3 = State_Met(LCHNK)%TO3 ) + ENDIF + ENDIF - ! Reset H2O MMR to the initial value (no chemistry tendency in H2O just - ! yet) + CALL Do_Chemistry( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + myCPU = myCPU, & + LCHNK = LCHNK, & + iO3 = iO3, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Do_Chemistry"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + !============================================================== + ! ***** W E T D E P O S I T I O N (rainout + washout) ***** + !============================================================== + IF ( Input_Opt%LWetD ) THEN + + ! Do wet deposition + ! NOTE: Tracer concentration units are converted locally + ! to [kg/m2] in wet deposition to enable calculations + ! along the column (ewl, 9/18/15) + CALL Do_WetDep( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Do_WetDep"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ENDIF + + ! Make sure State_Chm(lchnk) is back in kg/kg dry! + ! Reset H2O MMR to the initial value (no chemistry tendency in H2O just yet) State_Chm(LCHNK)%Species(1,:,:,iH2O) = MMR_Beg(:,:,iH2O) ! Store unadvected species data SlsData = 0.0e+0_r8 - DO N = 1, NSls - M = MAP2GC_Sls(N) + DO N = 1, nSls + M = map2GC_Sls(N) IF ( M > 0 ) THEN Mass1 = 0.0e+0_r8 MMR_Min = 1.0e+9_r8 MMR_Max = 0.0e+0_r8 - DO J = 1, NCOL - DO K = 1, PVER - SlsData(J,PVER+1-K,N) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) + DO J = 1, nY + DO K = 1, nZ + SlsData(J,nZ+1-K,N) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) ENDDO ENDDO ENDIF @@ -2014,34 +2720,35 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Write diagnostic output DO N=1, pcnst - M = Map2GC(N) - I = Map2IDX(N) + M = map2GC(N) + I = map2Idx(N) IF ( M > 0 ) THEN - SpcName = TracerNames(I) + SpcName = tracerNames(I) VMR = 0.0e+0_r8 Mass0 = 0.0e+0_r8 Mass1 = 0.0e+0_r8 - DO J = 1, NCOL - DO K = 1, PVER - AirMass = REAL(State_Met(LCHNK)%AD(1,J,K),r8) - MMR0 = MMR_Beg(J,K,M) - MMR1 = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) - VMR(J,PVER+1-K) = MMR1 * MWRatio(I) - Mass0 = Mass0 + (MMR0*AirMass) - Mass1 = Mass1 + (MMR1*AirMass) + DO J = 1, nY + DO K = 1, nZ + AirMass = REAL(State_Met(LCHNK)%AD(1,J,K),r8) + MMR0 = MMR_Beg(J,K,M) + MMR1 = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) + VMR(J,nZ+1-K) = MMR1 * MWRatio(I) + Mass0 = Mass0 + (MMR0*AirMass) + Mass1 = Mass1 + (MMR1*AirMass) ENDDO ENDDO CALL OutFld( TRIM(SpcName), VMR(:NCOL,:), NCOL, LCHNK ) ENDIF ENDDO - DO N = 1, NSls - SpcName = SlsNames(n) + + DO N = 1, nSls + SpcName = slsNames(n) VMR = 0.0e+0_r8 - M = Map2GC_Sls(n) + M = map2GC_Sls(n) IF ( M > 0 ) THEN - DO J = 1, NCOL - DO K = 1, PVER - VMR(J,PVER+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * SLSMWratio(N) + DO J = 1, nY + DO K = 1, nZ + VMR(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * SLSMWratio(N) ENDDO ENDDO CALL OutFld( TRIM(SpcName), VMR(:NCOL,:), NCOL, LCHNK ) @@ -2053,29 +2760,28 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Ptend%Q(:,:,:) = 0.0e+0_r8 MMR_End = 0.0e+0_r8 DO N = 1, pcnst - M = Map2GC(N) + M = map2GC(N) IF (M > 0) THEN I = 1 - DO J = 1, NCOL - DO K = 1, PVER + DO J = 1, nY + DO K = 1, nZ ! CURRENTLY KG/KG MMR_End (J,K,M) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) MMR_TEnd(J,K,M) = MMR_End(J,K,M) - MMR_Beg(J,K,M) - ptend%q(J,PVER+1-K,N) = (MMR_End(J,K,M)-MMR_Beg(J,K,M))/dT + ptend%q(J,nZ+1-K,N) = (MMR_End(J,K,M)-MMR_Beg(J,K,M))/dT ENDDO ENDDO ENDIF ENDDO IF (PRESENT(fh2o)) THEN - fh2o(:NCOL) = 0.0e+0_r8 - !DO K = 1, PVER - ! fh2o(:NCOL) = fh2o(:NCOL) + Ptend%Q(:NCOL,K,iH2O)*State%Pdel(:NCOL,K)/Gravit + fh2o(:nY) = 0.0e+0_r8 + !DO K = 1, nZ + ! fh2o(:nY) = fh2o(:nY) + Ptend%Q(:nY,K,iH2O)*State%Pdel(:nY,K)/Gravit !ENDDO ENDIF IF (rootChunk) WRITE(iulog,'(a)') ' GEOS-Chem chemistry step completed' - RETURN end subroutine chem_timestep_tend @@ -2099,9 +2805,9 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) NLEV = SIZE(Q, 2) ! Retrieve a "background value" for this from the database Min_MMR = 1.0e-38_r8 - DO I = 1, NTracers - IF (TRIM(TracerNames(I)).eq.TRIM(name)) THEN - Min_MMR = Ref_MMR(i) + DO I = 1, nTracers + IF (TRIM(tracerNames(I)).eq.TRIM(name)) THEN + Min_MMR = ref_MMR(i) EXIT ENDIF ENDDO @@ -2225,8 +2931,8 @@ subroutine chem_final IF (ALLOCATED(State_Grid)) DEALLOCATE(State_Grid) IF (ALLOCATED(State_Met)) DEALLOCATE(State_Met) - IF (ALLOCATED(Slvd_Lst )) DEALLOCATE(Slvd_Lst) - IF (ALLOCATED(Slvd_Ref_MMR)) DEALLOCATE(Slvd_Ref_MMR) + IF (ALLOCATED(slvd_Lst )) DEALLOCATE(slvd_Lst) + IF (ALLOCATED(slvd_ref_MMR)) DEALLOCATE(slvd_ref_MMR) RETURN @@ -2290,7 +2996,7 @@ subroutine chem_emissions( state, cam_in ) REAL(r8) :: Rlats(State%NCOL) REAL(r8) :: Rlons(State%NCOL) REAL(r8) :: Dlat, Dlon - REAL(r8) :: SFlx(State%NCOL,NTracers) + REAL(r8) :: SFlx(State%NCOL,nTracers) INTEGER :: M, N, I INTEGER :: LCHNK, NCOL @@ -2314,7 +3020,7 @@ subroutine chem_emissions( state, cam_in ) !TMMF ! Test: emit 1e-10 kg/m2/s of NO in a square around Europe DO M = 1, PCNST - N = Map2GC(M) + N = map2GC(M) IF ((N>0).and.(N==iNO)) THEN SFlx(:,N) = 0.0e+0_r8 DO I = 1, NCOL @@ -2328,8 +3034,6 @@ subroutine chem_emissions( state, cam_in ) ENDIF ENDDO - IF (rootChunk) WRITE(iulog,'(a)') 'GCCALL CHEM_EMISSIONS' - end subroutine chem_emissions end module chemistry From 641ef228eceff3ac38c67c3557ed7f1eb94c724a Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 15 Jan 2020 14:12:20 -0500 Subject: [PATCH 075/239] Chore: Remove debug --- src/chemistry/pp_geoschem/chemistry.F90 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 4a353fb8f0..f8ace92c22 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -2226,14 +2226,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) newDay = .False. newMonth = .False. ENDIF - !TMMF, DEBUG - IF ( rootChunk ) THEN - Write(6,*) " firstDay = ", firstDay - Write(6,*) " newDay = ", newDay - Write(6,*) " newMonth = ", newMonth - Write(6,*) " Current Day is = ", currDy - Write(6,*) " Current Month is = ", currMo - ENDIF ! Pass time values obtained from the ESMF environment to GEOS-Chem CALL Accept_External_Date_Time( am_I_Root = rootChunk, & From 82fa185b5b671c875d6c5f53848a3e542426851c Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 10 Mar 2020 12:05:24 -0400 Subject: [PATCH 076/239] Feat: Deal with compile-time definition of GEOS-Chem dry dep. species (1) Update ChemNamelist to be able to read deposition species from .xml files and filtering these with the species list from mo_sim_dat.F90. This last file lists all GEOS-Chem species and is only read at compile time and is not compiled since GEOS-Chem tracers and species are defined at run time from input.geos and KPP files. (2) Update geoschem.xml to now list dry and wet deposition species --- bld/namelist_files/use_cases/geoschem.xml | 17 + bld/perl5lib/Build/ChemNamelist.pm | 46 ++ src/chemistry/pp_geoschem/.exclude | 1 + src/chemistry/pp_geoschem/mo_sim_dat.F90 | 839 ++++++++++++++++++++++ 4 files changed, 903 insertions(+) create mode 100644 src/chemistry/pp_geoschem/mo_sim_dat.F90 diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 054b32e1a7..14e8f7a9ba 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -62,4 +62,21 @@ 'O3', 'NO', 'NO2', 'CO', 'HNO3', 'CH4', 'NIT', 'NH4', 'NH3', 'SO4', 'SO2', 'OH', + + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','BR2','BRNO3','CH2O','HCHO','CLNO3','DHDN','EOH','ETHLN','GLYC','GLYX','H2O2','HAC','HBR','HC187','HCL','HCOOH','HNO3','HOBR','HOCL','HONIT','HPALD','IEPOXA','IEPOXB','IEPOXD','IMAE','IPMN','ISN1','ISN1OG','ISOPNB','ISOPND','LIMO','LVOC','MACR','MACRN','MAP','MGLY','MONITS','MONITU','MTPA','MTPO','MVK','MVKN','N2O5','NH3','NO2','NPMN','O3','OPOG1','OPOG2','PAN','POG1','POG2','PPN','PROPNN','R4N2','RIPA','RIPB','RIPD','SO2','HOI','I2','IBR','ICL','HI','IONO','IONO2','I2O2','I2O3','I2O4','H2SO4','TSOG0','TSOG1','TSOG2','TSOG3' + + + + 'ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','DST1','DSTAL1','NITD1','SO4D1','DST2','DSTAL2','NITD2','SO4D2','DST3','DSTAL3','NITD3','SO4D3','DST4','DSTAL4','NITD4','SO4D4','INDIOL','IONITA','ISN1OA','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITS','OCPI','OCPO','OPOA1','OPOA2','PFE','POA1','POA2','SALA','SALC','SO4','SO4S','SOAIE','SOAGX','SOAME','SOAMG','SOAS','TSOA0','TSOA1','TSOA2','TSOA3','BRSALA','BRSALC','ISALA','ISALC','AERI' + + + + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','BR2','CH2O','HCHO','DHDN','EOH','ETHLN','GLYC','GLYX','H2O2','HAC','HBR','HCL','HCOOH','HNO3','HOBR','HOCL','HONIT','IEPOXA','IEPOXB','IEPOXD','IMAE','ISN1','ISN1OG','ISOPNB','ISOPND','LIMO','LVOC','MACRN','MAP','MGLY','MOBA','MONITS','MONITU','MP','CH3OOH','MTPA','MTPO','MVKN','NH3','OPOG1','OPOG2','POG1','POG2','PROPNN','RIPA','RIPB','RIPD','SO2','TSOG0','TSOG1','TSOG2','TSOG3','HOI','I2','IBR','ICL','HI','IONO','IONO2','I2O2','I2O3','I2O4','H2SO4' + + + + 'ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','DST1','DSTAL1','NITD1','SO4D1','DST2','DSTAL2','NITD2','SO4D2','DST3','DSTAL3','NITD3','SO4D3','DST4','DSTAL4','NITD4','SO4D4','INDIOL','IONITA','ISN1OA','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITS','OCPI','OCPO','OPOA1','OPOA2','PFE','POA1','POA2','SALA','SALC','SO4','SO4S','SOAIE','SOAGX','SOAME','SOAMG','SOAS','TSOA0','TSOA1','TSOA2','TSOA3','BRSALA','BRSALC','ISALA','ISALC','AERI' + + + diff --git a/bld/perl5lib/Build/ChemNamelist.pm b/bld/perl5lib/Build/ChemNamelist.pm index 3584b98be0..0cf0114337 100644 --- a/bld/perl5lib/Build/ChemNamelist.pm +++ b/bld/perl5lib/Build/ChemNamelist.pm @@ -65,13 +65,33 @@ sub set_dep_lists } if ($print_lvl>=2) {print "Chemistry species : @species_list \n" ;} + if (!defined $nl->get_value('gas_wetdep_list')) { $gas_wetdep_list = get_gas_wetdep_list( $cfgdir, $print_lvl, @species_list ); + } else { + $gas_wetdep_list = $nl->get_value('gas_wetdep_list'); + $gas_wetdep_list = filter_dep_list( $gas_wetdep_list, $print_lvl, @species_list ); + } + if (!defined $nl->get_value('aer_wetdep_list')) { $aer_wetdep_list = get_aer_wetdep_list( $cfgdir, $print_lvl, @species_list ); + } else { + $aer_wetdep_list = $nl->get_value('aer_wetdep_list'); + $aer_wetdep_list = filter_dep_list( $aer_wetdep_list, $print_lvl, @species_list ); + } + if (!defined $nl->get_value('drydep_list')) { $gas_drydep_list = get_gas_drydep_list( $cfgdir, $print_lvl, @species_list ); + } else { + $gas_drydep_list = $nl->get_value('drydep_list'); + $gas_drydep_list = filter_dep_list( $gas_drydep_list, $print_lvl, @species_list ); + } + if (!defined $nl->get_value('aer_drydep_list')) { $aer_drydep_list = get_aer_drydep_list( $cfgdir, $print_lvl, @species_list ); + } else { + $aer_drydep_list = $nl->get_value('aer_drydep_list'); + $aer_drydep_list = filter_dep_list( $aer_drydep_list, $print_lvl, @species_list ); + } # set solubility factors for aerosols if (length($aer_wetdep_list)>2){ @@ -276,6 +296,32 @@ sub get_dep_list return ($list); } +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +sub filter_dep_list +{ + my ( $input_list, $print_lvl, @species_list ) = @_; + + my @master_list = split( ('\s+|\s*,+\s*'), $input_list); + + my $list = ''; + my $first = 1; my $pre = ""; + foreach my $name (sort @species_list) { + foreach my $item (@master_list) { + $item =~ s/['"]//g; #"' + if ($name eq $item) { + $list .= $pre . quote_string($name) ; + if ($first) { $pre = ","; $first = 0; } + } + } + } + + if ( length($list)<1 ) {$list = quote_string(' ') ;} + + return ($list); + +} + #------------------------------------------------------------------------------- sub read_master_list_file { diff --git a/src/chemistry/pp_geoschem/.exclude b/src/chemistry/pp_geoschem/.exclude index 512e2ab3fb..3b9f25f37e 100644 --- a/src/chemistry/pp_geoschem/.exclude +++ b/src/chemistry/pp_geoschem/.exclude @@ -48,3 +48,4 @@ vdiff_mod.F90 input_mod.F cleanup.F main.F +mo_sim_dat.F90 diff --git a/src/chemistry/pp_geoschem/mo_sim_dat.F90 b/src/chemistry/pp_geoschem/mo_sim_dat.F90 new file mode 100644 index 0000000000..38b193b66b --- /dev/null +++ b/src/chemistry/pp_geoschem/mo_sim_dat.F90 @@ -0,0 +1,839 @@ + + module mo_sim_dat + + private + public :: set_sim_dat + + contains + + subroutine set_sim_dat + + use chem_mods, only : clscnt, cls_rxt_cnt, clsmap, permute, adv_mass, fix_mass, crb_mass + use chem_mods, only : diag_map + use chem_mods, only : phtcnt, rxt_tag_cnt, rxt_tag_lst, rxt_tag_map + use chem_mods, only : pht_alias_lst, pht_alias_mult + use chem_mods, only : extfrc_lst, inv_lst, slvd_lst + use chem_mods, only : enthalpy_cnt, cph_enthalpy, cph_rid, num_rnts, rxntot + use cam_abortutils,only : endrun + use mo_tracname, only : solsym + use chem_mods, only : frc_from_dataset + use chem_mods, only : is_scalar, is_vector + use shr_kind_mod, only : r8 => shr_kind_r8 + use cam_logfile, only : iulog + + implicit none + +!-------------------------------------------------------------- +! ... local variables +!-------------------------------------------------------------- + integer :: ios + + is_scalar = .false. + is_vector = .true. + + clscnt(:) = (/ 30, 0, 0, 191, 0 /) + + cls_rxt_cnt(:,1) = (/ 37, 61, 0, 30 /) + cls_rxt_cnt(:,4) = (/ 23, 174, 326, 191 /) + + solsym(:273) = (/ 'CH2I2 ','CH2ICL ','CH2IBR ', & + 'NITs ','NIT ','AERI ', & + 'CO2 ','INDIOL ','ISALA ', & + 'ISALC ','ISN1OA ','ISN1OG ', & + 'LBRO2H ','LBRO2N ','LISOPOH ', & + 'LISOPNO3 ','LTRO2H ','LTRO2N ', & + 'LVOCOA ','LVOC ','LXRO2H ', & + 'LXRO2N ','MSA ','PYAC ', & + 'SO4H1 ','SO4H2 ','SOAGX ', & + 'SOAIE ','SOAME ','IMAE ', & + 'SOAMG ','POx ','LOx ', & + 'PCO ','LCO ','PSO4 ', & + 'LCH4 ','PH2O2 ','I2O4 ', & + 'DHDN ','DHDC ','I2O2 ', & + 'MONITA ','BENZ ','CH3CCL3 ', & + 'H1301 ','H2402 ','I2O3 ', & + 'PMNN ','PPN ','TOLU ', & + 'BRNO2 ','CCL4 ','CFC11 ', & + 'CFC12 ','CFC113 ','CFC114 ', & + 'CFC115 ','CH3I ','H1211 ', & + 'IBR ','IEPOXD ','INO ', & + 'N2O ','TRO2 ','BRO2 ', & + 'IEPOXA ','IEPOXB ','IONITA ', & + 'N ','OCS ','XRO2 ', & + 'HI ','MAP ','ICL ', & + 'IMAO3 ','MPN ','CHBR3 ', & + 'CHCL3 ','CL2O2 ','CH2BR2 ', & + 'CH2CL2 ','HCFC141b ','HCFC142b ', & + 'IONO ','HCFC123 ','HCFC22 ', & + 'OIO ','RA3P ','RB3P ', & + 'XYLE ','DMS ','CLNO2 ', & + 'ETP ','CH3BR ','CH3CL ', & + 'HNO4 ','CLOO ','OCLO ', & + 'PAN ','RP ','HNO2 ', & + 'ALK4 ','PP ','PRPN ', & + 'SO4 ','BRCL ','PIP ', & + 'R4P ','HPALD ','C3H8 ', & + 'DHPCARP ','HOI ','HC187 ', & + 'HPC52O2 ','VRP ','ATOOH ', & + 'BR2 ','IAP ','MOBA ', & + 'HONIT ','DHMOB ','RIPB ', & + 'MP ','ISNP ','BRSALA ', & + 'BRSALC ','MAOP ','MRP ', & + 'RIPA ','RIPD ','EOH ', & + 'ETHLN ','N2O5 ','INPN ', & + 'MTPA ','MTPO ','NPMN ', & + 'C2H6 ','IONO2 ','MOBAOO ', & + 'DIBOO ','LIMO ','IPMN ', & + 'H ','MACRNO2 ','BRNO3 ', & + 'ROH ','MONITS ','CL2 ', & + 'I2 ','ISOPNB ','ISNOHOO ', & + 'CH4 ','MVKOO ','ISNOOB ', & + 'GAOO ','CH3CHOO ','MGLYOO ', & + 'IEPOXOO ','GLYX ','MVKN ', & + 'MGLOO ','PRN1 ','MONITU ', & + 'A3O2 ','PROPNN ','ISNOOA ', & + 'MAN2 ','PO2 ','ISOPNDO2 ', & + 'HCOOH ','B3O2 ','MACROO ', & + 'R4N1 ','MAOPO2 ','ISOP ', & + 'H2O2 ','ATO2 ','I ', & + 'RCO3 ','OLNN ','OLND ', & + 'LIMO2 ','MACRN ','IO ', & + 'KO2 ','HOBR ','ISOPNBO2 ', & + 'HC5OO ','PIO2 ','HNO3 ', & + 'ISOPND ','NMAO3 ','ACTA ', & + 'HOCL ','VRO2 ','ISN1 ', & + 'CH2OO ','GLYC ','CLNO3 ', & + 'MGLY ','ACET ','HC5 ', & + 'RIO2 ','INO2 ','R4O2 ', & + 'ETO2 ','R4N2 ','HAC ', & + 'MRO2 ','BRO ','PRPE ', & + 'RCHO ','MEK ','MACR ', & + 'CH2O ','ALD2 ','MVK ', & + 'MCO3 ','SO2 ','HCL ', & + 'HBR ','H2O ','CLO ', & + 'HO2 ','OH ','BR ', & + 'O ','NO2 ','MO2 ', & + 'NO3 ','NO ','O3 ', & + 'CL ','CO ','O1D ', & + 'H2 ','MOH ','N2 ', & + 'O2 ','RCOOH ','SO4s ', & + 'NH3 ','NH4 ','BCPI ', & + 'OCPI ','BCPO ','OCPO ', & + 'DST1 ','DST2 ','DST3 ', & + 'DST4 ','SALA ','SALC ', & + 'TSOG1 ','TSOG2 ','TSOG3 ', & + 'TSOG0 ','TSOA1 ','TSOA2 ', & + 'TSOA3 ','TSOA0 ','ASOG1 ', & + 'ASOG2 ','ASOG3 ','ASOAN ', & + 'ASOA1 ','ASOA2 ','ASOA3 ', & + 'SOAP ','SOAS ','PFE ' /) + + adv_mass(:221) = (/ 133.141340_r8, 104.142600_r8, 28.010400_r8, 12.011000_r8, 12.011000_r8, & + 204.342600_r8, 78.110400_r8, 160.122200_r8, 126.108600_r8, 98.098200_r8, & + 84.072400_r8, 98.098200_r8, 98.098200_r8, 112.124000_r8, 72.143800_r8, & + 56.103200_r8, 79.904000_r8, 115.356700_r8, 95.903400_r8, 141.908940_r8, & + 99.716850_r8, 106.120800_r8, 124.135000_r8, 26.036800_r8, 28.051600_r8, & + 46.065800_r8, 62.065200_r8, 30.066400_r8, 42.077400_r8, 76.091000_r8, & + 44.092200_r8, 110.109200_r8, 153.821800_r8, 165.364506_r8, 148.910210_r8, & + 137.367503_r8, 187.375310_r8, 170.921013_r8, 154.466716_r8, 120.913206_r8, & + 173.833800_r8, 30.025200_r8, 94.937200_r8, 133.402300_r8, 44.051000_r8, & + 50.485900_r8, 41.050940_r8, 58.076800_r8, 72.061400_r8, 60.050400_r8, & + 76.049800_r8, 32.040000_r8, 48.039400_r8, 16.040600_r8, 252.730400_r8, & + 35.452700_r8, 70.905400_r8, 102.904200_r8, 51.452100_r8, 97.457640_r8, & + 100.916850_r8, 28.010400_r8, 44.009800_r8, 66.007206_r8, 82.461503_r8, & + 108.135600_r8, 62.132400_r8, 135.064039_r8, 135.064039_r8, 135.064039_r8, & + 28.010400_r8, 78.064600_r8, 18.998403_r8, 60.050400_r8, 58.035600_r8, & + 1.007400_r8, 2.014800_r8, 259.823613_r8, 34.013600_r8, 98.078400_r8, & + 80.911400_r8, 116.948003_r8, 100.493706_r8, 86.467906_r8, 36.460100_r8, & + 27.025140_r8, 46.024600_r8, 20.005803_r8, 63.012340_r8, 79.011740_r8, & + 96.910800_r8, 52.459500_r8, 135.114940_r8, 116.112400_r8, 74.076200_r8, & + 100.113000_r8, 118.127200_r8, 68.114200_r8, 147.125940_r8, 147.125940_r8, & + 162.117940_r8, 163.125340_r8, 118.127200_r8, 184.350200_r8, 70.087800_r8, & + 120.100800_r8, 72.102600_r8, 104.101400_r8, 147.084740_r8, 136.228400_r8, & + 70.087800_r8, 14.006740_r8, 44.012880_r8, 108.010480_r8, 147.125940_r8, & + 145.111140_r8, 58.442468_r8, 58.442468_r8, 58.442468_r8, 17.028940_r8, & + 18.036340_r8, 28.010400_r8, 28.010400_r8, 30.006140_r8, 46.005540_r8, & + 62.004940_r8, 119.074340_r8, 231.239540_r8, 1.007400_r8, 1.007400_r8, & + 1.007400_r8, 1.007400_r8, 15.999400_r8, 47.998200_r8, 67.451500_r8, & + 60.076400_r8, 133.100140_r8, 121.047940_r8, 183.117740_r8, 93.102400_r8, & + 94.109800_r8, 176.121600_r8, 12.011000_r8, 12.011000_r8, 92.090400_r8, & + 90.075600_r8, 32.066000_r8, 146.056419_r8, 48.065400_r8, 64.064800_r8, & + 80.064200_r8, 115.107340_r8, 115.107340_r8, 115.107340_r8, 250.445000_r8, & + 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & + 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & + 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 28.010400_r8, & + 310.582400_r8, 140.134400_r8, 186.241400_r8, 215.240140_r8, 186.241400_r8, & + 168.227200_r8, 154.201400_r8, 174.148000_r8, 92.136200_r8, 150.126000_r8, & + 106.162000_r8, 188.173800_r8, 122.161400_r8, 204.173200_r8, 14.006740_r8, & + 14.006740_r8, 137.112200_r8, 103.135200_r8, 159.114800_r8, 123.127600_r8, & + 61.057800_r8, 75.083600_r8, 109.101800_r8, 75.042400_r8, 47.032000_r8, & + 129.089600_r8, 105.108800_r8, 61.057800_r8, 77.057200_r8, 33.006200_r8, & + 63.031400_r8, 117.119800_r8, 117.119800_r8, 119.093400_r8, 115.063800_r8, & + 101.079200_r8, 117.078600_r8, 103.094000_r8, 230.232140_r8, 15.999400_r8, & + 17.006800_r8, 175.114200_r8, 91.083000_r8, 89.068200_r8, 199.218600_r8, & + 185.234000_r8, 173.140600_r8, 149.118600_r8, 187.166400_r8, 203.165800_r8, & + 18.014200_r8 /) + + crb_mass(:221) = (/ 60.055000_r8, 60.055000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & + 180.165000_r8, 72.066000_r8, 72.066000_r8, 72.066000_r8, 60.055000_r8, & + 48.044000_r8, 60.055000_r8, 60.055000_r8, 72.066000_r8, 60.055000_r8, & + 48.044000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + 0.000000_r8, 84.077000_r8, 84.077000_r8, 24.022000_r8, 24.022000_r8, & + 24.022000_r8, 24.022000_r8, 24.022000_r8, 36.033000_r8, 36.033000_r8, & + 36.033000_r8, 72.066000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & + 12.011000_r8, 24.022000_r8, 24.022000_r8, 24.022000_r8, 12.011000_r8, & + 12.011000_r8, 12.011000_r8, 12.011000_r8, 24.022000_r8, 24.022000_r8, & + 12.011000_r8, 24.022000_r8, 36.033000_r8, 36.033000_r8, 24.022000_r8, & + 24.022000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & + 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & + 84.077000_r8, 24.022000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + 12.011000_r8, 24.022000_r8, 0.000000_r8, 24.022000_r8, 24.022000_r8, & + 0.000000_r8, 0.000000_r8, 24.022000_r8, 0.000000_r8, 0.000000_r8, & + 0.000000_r8, 24.022000_r8, 24.022000_r8, 12.011000_r8, 0.000000_r8, & + 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + 0.000000_r8, 0.000000_r8, 48.044000_r8, 60.055000_r8, 36.033000_r8, & + 60.055000_r8, 60.055000_r8, 60.055000_r8, 60.055000_r8, 60.055000_r8, & + 60.055000_r8, 60.055000_r8, 60.055000_r8, 156.143000_r8, 48.044000_r8, & + 48.044000_r8, 48.044000_r8, 48.044000_r8, 48.044000_r8, 120.110000_r8, & + 48.044000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 60.055000_r8, & + 60.055000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + 0.000000_r8, 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, & + 0.000000_r8, 36.033000_r8, 120.110000_r8, 0.000000_r8, 0.000000_r8, & + 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + 12.011000_r8, 48.044000_r8, 24.022000_r8, 84.077000_r8, 72.066000_r8, & + 72.066000_r8, 72.066000_r8, 12.011000_r8, 12.011000_r8, 36.033000_r8, & + 36.033000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 180.165000_r8, & + 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, & + 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, & + 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, 12.011000_r8, & + 264.242000_r8, 84.077000_r8, 120.110000_r8, 120.110000_r8, 120.110000_r8, & + 120.110000_r8, 108.099000_r8, 84.077000_r8, 84.077000_r8, 60.055000_r8, & + 96.088000_r8, 96.088000_r8, 96.088000_r8, 96.088000_r8, 0.000000_r8, & + 0.000000_r8, 84.077000_r8, 60.055000_r8, 72.066000_r8, 84.077000_r8, & + 24.022000_r8, 36.033000_r8, 72.066000_r8, 24.022000_r8, 12.011000_r8, & + 60.055000_r8, 48.044000_r8, 24.022000_r8, 24.022000_r8, 0.000000_r8, & + 12.011000_r8, 60.055000_r8, 60.055000_r8, 48.044000_r8, 48.044000_r8, & + 48.044000_r8, 48.044000_r8, 48.044000_r8, 120.110000_r8, 0.000000_r8, & + 0.000000_r8, 72.066000_r8, 36.033000_r8, 36.033000_r8, 120.110000_r8, & + 120.110000_r8, 84.077000_r8, 60.055000_r8, 96.088000_r8, 96.088000_r8, & + 0.000000_r8 /) + + fix_mass(: 3) = (/ 0.00000000_r8, 28.0134800_r8, 31.9988000_r8 /) + + clsmap(: 30,1) = (/ 3, 21, 33, 34, 35, 36, 37, 38, 39, 40, & + 41, 43, 44, 46, 54, 55, 61, 63, 71, 78, & + 82, 83, 84, 113, 122, 123, 148, 170, 185, 186 /) + clsmap(:191,4) = (/ 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, & + 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, & + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, & + 42, 45, 47, 48, 49, 50, 51, 52, 53, 56, & + 57, 58, 59, 60, 62, 64, 65, 66, 67, 68, & + 69, 70, 72, 73, 74, 75, 76, 77, 79, 80, & + 81, 85, 86, 87, 88, 89, 90, 91, 92, 93, & + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, & + 104, 105, 106, 107, 108, 109, 110, 111, 112, 114, & + 115, 116, 117, 118, 119, 120, 121, 124, 125, 126, & + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, & + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, & + 147, 149, 150, 151, 152, 153, 154, 155, 156, 157, & + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, & + 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, & + 179, 180, 181, 182, 183, 184, 187, 188, 189, 190, & + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, & + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, & + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, & + 221 /) + + permute(:191,4) = (/ 121, 120, 1, 2, 144, 46, 85, 47, 86, 96, & + 68, 117, 75, 60, 81, 174, 61, 187, 110, 62, & + 78, 70, 111, 64, 79, 71, 149, 90, 39, 65, & + 189, 161, 38, 147, 166, 108, 102, 134, 91, 184, & + 45, 36, 183, 148, 155, 40, 50, 52, 69, 3, & + 4, 5, 41, 132, 151, 142, 176, 162, 114, 42, & + 138, 177, 49, 133, 57, 175, 83, 131, 136, 154, & + 58, 156, 72, 43, 139, 113, 107, 164, 89, 123, & + 34, 165, 73, 104, 74, 106, 145, 169, 82, 67, & + 84, 152, 6, 7, 8, 37, 9, 190, 185, 179, & + 141, 87, 10, 11, 12, 13, 188, 186, 76, 80, & + 59, 97, 44, 98, 48, 77, 14, 15, 109, 88, & + 103, 167, 140, 63, 16, 17, 18, 19, 20, 21, & + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, & + 32, 33, 35, 53, 115, 118, 99, 150, 153, 116, & + 51, 54, 55, 124, 56, 92, 105, 146, 100, 93, & + 137, 135, 119, 173, 182, 129, 112, 66, 125, 178, & + 94, 168, 171, 170, 126, 172, 143, 122, 159, 180, & + 181, 95, 130, 160, 158, 157, 127, 163, 128, 101, & + 191 /) + + diag_map(:191) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, & + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, & + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, & + 31, 32, 33, 39, 45, 46, 49, 52, 55, 59, & + 62, 65, 68, 71, 74, 81, 87, 91, 96, 100, & + 109, 116, 121, 125, 134, 142, 147, 150, 155, 158, & + 161, 164, 168, 172, 176, 180, 184, 190, 193, 199, & + 205, 211, 214, 219, 224, 229, 234, 240, 245, 250, & + 258, 266, 272, 278, 284, 290, 296, 302, 308, 314, & + 320, 326, 334, 340, 347, 353, 356, 363, 367, 376, & + 384, 391, 397, 403, 409, 415, 423, 431, 435, 443, & + 451, 459, 467, 476, 483, 494, 503, 507, 515, 522, & + 533, 544, 552, 563, 576, 583, 594, 610, 621, 630, & + 640, 649, 657, 661, 666, 677, 687, 695, 709, 726, & + 732, 739, 744, 761, 787, 809, 819, 827, 841, 856, & + 865, 874, 886, 898, 911, 915, 928, 950, 969, 985, & + 996,1007,1024,1044,1060,1072,1083,1108,1130,1153, & + 1186,1205,1236,1250,1263,1276,1296,1390,1448,1473, & + 1621,1672,1699,1734,1776,1837,1862,1893,1917,1996, & + 2022 /) + + extfrc_lst(: 17) = (/ 'so4_a2 ','NO ','NO2 ','SO2 ','SVOC ', & + 'pom_a1 ','pom_a4 ','so4_a1 ','CO ','bc_a1 ', & + 'bc_a4 ','num_a1 ','num_a2 ','num_a4 ','OH ', & + 'N ','AOA_NH ' /) + + frc_from_dataset(: 17) = (/ .true., .true., .true., .true., .true., & + .true., .true., .true., .true., .true., & + .true., .true., .true., .true., .false., & + .false., .false. /) + + inv_lst(: 3) = (/ 'M ', 'N2 ', 'O2 ' /) + + slvd_lst(: 34) = (/ 'ACBZO2 ', 'ALKO2 ', 'BENZO2 ', 'BZOO ', 'C2H5O2 ', & + 'C3H7O2 ', 'C6H5O2 ', 'CH3CO3 ', 'CH3O2 ', 'DICARBO2 ', & + 'ENEO2 ', 'EO ', 'EO2 ', 'HO2 ', 'HOCH2OO ', & + 'ISOPAO2 ', 'ISOPBO2 ', 'MACRO2 ', 'MALO2 ', 'MCO3 ', & + 'MDIALO2 ', 'MEKO2 ', 'NTERPO2 ', 'O1D ', 'OH ', & + 'PHENO2 ', 'PO2 ', 'RO2 ', 'TERP2O2 ', 'TERPO2 ', & + 'TOLO2 ', 'XO2 ', 'XYLENO2 ', 'XYLOLO2 ' /) + + if( allocated( rxt_tag_lst ) ) then + deallocate( rxt_tag_lst ) + end if + allocate( rxt_tag_lst(rxt_tag_cnt),stat=ios ) + if( ios /= 0 ) then + write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_lst; error = ',ios + call endrun + end if + if( allocated( rxt_tag_map ) ) then + deallocate( rxt_tag_map ) + end if + allocate( rxt_tag_map(rxt_tag_cnt),stat=ios ) + if( ios /= 0 ) then + write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_map; error = ',ios + call endrun + end if + rxt_tag_lst( 1: 200) = (/ 'jh2o_b ', 'jh2o_a ', & + 'jh2o_c ', 'jh2o2 ', & + 'jo2_a ', 'jo2_b ', & + 'jo3_a ', 'jo3_b ', & + 'jhno3 ', 'jho2no2_a ', & + 'jho2no2_b ', 'jn2o ', & + 'jn2o5_a ', 'jn2o5_b ', & + 'jno ', 'jno2 ', & + 'jno3_b ', 'jno3_a ', & + 'jalknit ', 'jalkooh ', & + 'jbenzooh ', 'jbepomuc ', & + 'jbigald ', 'jbigald1 ', & + 'jbigald2 ', 'jbigald3 ', & + 'jbigald4 ', 'jbzooh ', & + 'jc2h5ooh ', 'jc3h7ooh ', & + 'jc6h5ooh ', 'jch2o_a ', & + 'jch2o_b ', 'jch3cho ', & + 'jacet ', 'jmgly ', & + 'jch3co3h ', 'jch3ooh ', & + 'jch4_a ', 'jch4_b ', & + 'jco2 ', 'jeooh ', & + 'jglyald ', 'jglyoxal ', & + 'jhonitr ', 'jhpald ', & + 'jhyac ', 'jisopnooh ', & + 'jisopooh ', 'jmacr_a ', & + 'jmacr_b ', 'jmek ', & + 'jmekooh ', 'jmpan ', & + 'jmvk ', 'jnc4cho ', & + 'jnoa ', 'jnterpooh ', & + 'jonitr ', 'jpan ', & + 'jphenooh ', 'jpooh ', & + 'jrooh ', 'jtepomuc ', & + 'jterp2ooh ', 'jterpnit ', & + 'jterpooh ', 'jterprd1 ', & + 'jterprd2 ', 'jtolooh ', & + 'jxooh ', 'jxylenooh ', & + 'jxylolooh ', 'jbrcl ', & + 'jbro ', 'jbrono2_b ', & + 'jbrono2_a ', 'jccl4 ', & + 'jcf2clbr ', 'jcf3br ', & + 'jcfcl3 ', 'jcfc113 ', & + 'jcfc114 ', 'jcfc115 ', & + 'jcf2cl2 ', 'jch2br2 ', & + 'jch3br ', 'jch3ccl3 ', & + 'jch3cl ', 'jchbr3 ', & + 'jcl2 ', 'jcl2o2 ', & + 'jclo ', 'jclono2_a ', & + 'jclono2_b ', 'jcof2 ', & + 'jcofcl ', 'jh2402 ', & + 'jhbr ', 'jhcfc141b ', & + 'jhcfc142b ', 'jhcfc22 ', & + 'jhcl ', 'jhf ', & + 'jhobr ', 'jhocl ', & + 'joclo ', 'jsf6 ', & + 'jh2so4 ', 'jocs ', & + 'jso ', 'jso2 ', & + 'jso3 ', 'jsoa1_a1 ', & + 'jsoa1_a2 ', 'jsoa2_a1 ', & + 'jsoa2_a2 ', 'jsoa3_a1 ', & + 'jsoa3_a2 ', 'jsoa4_a1 ', & + 'jsoa4_a2 ', 'jsoa5_a1 ', & + 'jsoa5_a2 ', 'O1D_H2 ', & + 'O1D_H2O ', 'O1D_N2 ', & + 'O1D_O2ab ', 'O1D_O3 ', & + 'O_O3 ', 'usr_O_O ', & + 'usr_O_O2 ', 'H2_O ', & + 'H2O2_O ', 'H_HO2 ', & + 'H_HO2a ', 'H_HO2b ', & + 'H_O2 ', 'HO2_O ', & + 'HO2_O3 ', 'H_O3 ', & + 'OH_H2 ', 'OH_H2O2 ', & + 'OH_HO2 ', 'OH_O ', & + 'OH_O3 ', 'OH_OH ', & + 'OH_OH_M ', 'usr_HO2_HO2 ', & + 'HO2NO2_OH ', 'N_NO ', & + 'N_NO2a ', 'N_NO2b ', & + 'N_NO2c ', 'N_O2 ', & + 'NO2_O ', 'NO2_O3 ', & + 'NO2_O_M ', 'NO3_HO2 ', & + 'NO3_NO ', 'NO3_O ', & + 'NO3_OH ', 'N_OH ', & + 'NO_HO2 ', 'NO_O3 ', & + 'NO_O_M ', 'O1D_N2Oa ', & + 'O1D_N2Ob ', 'tag_NO2_HO2 ', & + 'tag_NO2_NO3 ', 'tag_NO2_OH ', & + 'usr_HNO3_OH ', 'usr_HO2NO2_M ', & + 'usr_N2O5_M ', 'CL_CH2O ', & + 'CL_CH4 ', 'CL_H2 ', & + 'CL_H2O2 ', 'CL_HO2a ', & + 'CL_HO2b ', 'CL_O3 ', & + 'CLO_CH3O2 ', 'CLO_CLOa ', & + 'CLO_CLOb ', 'CLO_CLOc ', & + 'CLO_HO2 ', 'CLO_NO ', & + 'CLONO2_CL ', 'CLO_NO2_M ', & + 'CLONO2_O ', 'CLONO2_OH ', & + 'CLO_O ', 'CLO_OHa ', & + 'CLO_OHb ', 'HCL_O ', & + 'HCL_OH ', 'HOCL_CL ', & + 'HOCL_O ', 'HOCL_OH ', & + 'O1D_CCL4 ', 'O1D_CF2CLBR ' /) + rxt_tag_lst( 201: 400) = (/ 'O1D_CFC11 ', 'O1D_CFC113 ', & + 'O1D_CFC114 ', 'O1D_CFC115 ', & + 'O1D_CFC12 ', 'O1D_HCLa ', & + 'O1D_HCLb ', 'tag_CLO_CLO_M ', & + 'usr_CL2O2_M ', 'BR_CH2O ', & + 'BR_HO2 ', 'BR_O3 ', & + 'BRO_BRO ', 'BRO_CLOa ', & + 'BRO_CLOb ', 'BRO_CLOc ', & + 'BRO_HO2 ', 'BRO_NO ', & + 'BRO_NO2_M ', 'BRONO2_O ', & + 'BRO_O ', 'BRO_OH ', & + 'HBR_O ', 'HBR_OH ', & + 'HOBR_O ', 'O1D_CF3BR ', & + 'O1D_CHBR3 ', 'O1D_H2402 ', & + 'O1D_HBRa ', 'O1D_HBRb ', & + 'F_CH4 ', 'F_H2 ', & + 'F_H2O ', 'F_HNO3 ', & + 'O1D_COF2 ', 'O1D_COFCL ', & + 'CH2BR2_CL ', 'CH2BR2_OH ', & + 'CH3BR_CL ', 'CH3BR_OH ', & + 'CH3CCL3_OH ', 'CH3CL_CL ', & + 'CH3CL_OH ', 'CHBR3_CL ', & + 'CHBR3_OH ', 'HCFC141B_OH ', & + 'HCFC142B_OH ', 'HCFC22_OH ', & + 'O1D_CH2BR2 ', 'O1D_CH3BR ', & + 'O1D_HCFC141B ', 'O1D_HCFC142B ', & + 'O1D_HCFC22 ', 'CH2O_HO2 ', & + 'CH2O_NO3 ', 'CH2O_O ', & + 'CH2O_OH ', 'CH3O2_CH3O2a ', & + 'CH3O2_CH3O2b ', 'CH3O2_HO2 ', & + 'CH3O2_NO ', 'CH3OH_OH ', & + 'CH3OOH_OH ', 'CH4_OH ', & + 'CO_OH_M ', 'HCN_OH ', & + 'HCOOH_OH ', 'HOCH2OO_HO2 ', & + 'HOCH2OO_M ', 'HOCH2OO_NO ', & + 'O1D_CH4a ', 'O1D_CH4b ', & + 'O1D_CH4c ', 'O1D_HCN ', & + 'usr_CO_OH_b ', 'C2H2_CL_M ', & + 'C2H2_OH_M ', 'C2H4_CL_M ', & + 'C2H4_O3 ', 'C2H5O2_C2H5O2 ', & + 'C2H5O2_CH3O2 ', 'C2H5O2_HO2 ', & + 'C2H5O2_NO ', 'C2H5OH_OH ', & + 'C2H5OOH_OH ', 'C2H6_CL ', & + 'C2H6_OH ', 'CH3CHO_NO3 ', & + 'CH3CHO_OH ', 'CH3CN_OH ', & + 'CH3CO3_CH3CO3 ', 'CH3CO3_CH3O2 ', & + 'CH3CO3_HO2 ', 'CH3CO3_NO ', & + 'CH3COOH_OH ', 'CH3COOOH_OH ', & + 'EO2_HO2 ', 'EO2_NO ', & + 'EO_M ', 'EO_O2 ', & + 'GLYALD_OH ', 'GLYOXAL_OH ', & + 'PAN_OH ', 'tag_C2H4_OH ', & + 'tag_CH3CO3_NO2 ', 'usr_PAN_M ', & + 'C3H6_NO3 ', 'C3H6_O3 ', & + 'C3H7O2_CH3O2 ', 'C3H7O2_HO2 ', & + 'C3H7O2_NO ', 'C3H7OOH_OH ', & + 'C3H8_OH ', 'CH3COCHO_NO3 ', & + 'CH3COCHO_OH ', 'HYAC_OH ', & + 'NOA_OH ', 'PO2_HO2 ', & + 'PO2_NO ', 'POOH_OH ', & + 'RO2_CH3O2 ', 'RO2_HO2 ', & + 'RO2_NO ', 'ROOH_OH ', & + 'tag_C3H6_OH ', 'usr_CH3COCH3_OH ', & + 'BIGENE_NO3 ', 'BIGENE_OH ', & + 'ENEO2_NO ', 'ENEO2_NOb ', & + 'HONITR_OH ', 'MACRO2_CH3CO3 ', & + 'MACRO2_CH3O2 ', 'MACRO2_HO2 ', & + 'MACRO2_NO3 ', 'MACRO2_NOa ', & + 'MACRO2_NOb ', 'MACR_O3 ', & + 'MACR_OH ', 'MACROOH_OH ', & + 'MCO3_CH3CO3 ', 'MCO3_CH3O2 ', & + 'MCO3_HO2 ', 'MCO3_MCO3 ', & + 'MCO3_NO ', 'MCO3_NO3 ', & + 'MEKO2_HO2 ', 'MEKO2_NO ', & + 'MEK_OH ', 'MEKOOH_OH ', & + 'MPAN_OH_M ', 'MVK_O3 ', & + 'MVK_OH ', 'usr_MCO3_NO2 ', & + 'usr_MPAN_M ', 'ALKNIT_OH ', & + 'ALKO2_HO2 ', 'ALKO2_NO ', & + 'ALKO2_NOb ', 'ALKOOH_OH ', & + 'BIGALK_OH ', 'HPALD_OH ', & + 'HYDRALD_OH ', 'IEPOX_OH ', & + 'ISOPAO2_CH3CO3 ', 'ISOPAO2_CH3O2 ', & + 'ISOPAO2_HO2 ', 'ISOPAO2_NO ', & + 'ISOPAO2_NO3 ', 'ISOPBO2_CH3CO3 ', & + 'ISOPBO2_CH3O2 ', 'ISOPBO2_HO2 ', & + 'ISOPBO2_M ', 'ISOPBO2_NO ', & + 'ISOPBO2_NO3 ', 'ISOPNITA_OH ', & + 'ISOPNITB_OH ', 'ISOP_NO3 ', & + 'ISOPNO3_CH3CO3 ', 'ISOPNO3_CH3O2 ', & + 'ISOPNO3_HO2 ', 'ISOPNO3_NO ', & + 'ISOPNO3_NO3 ', 'ISOPNOOH_OH ', & + 'ISOP_O3 ', 'ISOP_OH ', & + 'ISOPOOH_OH ', 'NC4CH2OH_OH ', & + 'NC4CHO_OH ', 'XO2_CH3CO3 ', & + 'XO2_CH3O2 ', 'XO2_HO2 ', & + 'XO2_NO ', 'XO2_NO3 ', & + 'XOOH_OH ', 'ACBZO2_HO2 ', & + 'ACBZO2_NO ', 'BENZENE_OH ', & + 'BENZO2_HO2 ', 'BENZO2_NO ' /) + rxt_tag_lst( 401: 528) = (/ 'BENZOOH_OH ', 'BZALD_OH ', & + 'BZOO_HO2 ', 'BZOOH_OH ', & + 'BZOO_NO ', 'C6H5O2_HO2 ', & + 'C6H5O2_NO ', 'C6H5OOH_OH ', & + 'CRESOL_OH ', 'DICARBO2_HO2 ', & + 'DICARBO2_NO ', 'DICARBO2_NO2 ', & + 'MALO2_HO2 ', 'MALO2_NO ', & + 'MALO2_NO2 ', 'MDIALO2_HO2 ', & + 'MDIALO2_NO ', 'MDIALO2_NO2 ', & + 'PHENO2_HO2 ', 'PHENO2_NO ', & + 'PHENOL_OH ', 'PHENO_NO2 ', & + 'PHENO_O3 ', 'PHENOOH_OH ', & + 'tag_ACBZO2_NO2 ', 'TOLO2_HO2 ', & + 'TOLO2_NO ', 'TOLOOH_OH ', & + 'TOLUENE_OH ', 'usr_PBZNIT_M ', & + 'XYLENES_OH ', 'XYLENO2_HO2 ', & + 'XYLENO2_NO ', 'XYLENOOH_OH ', & + 'XYLOLO2_HO2 ', 'XYLOLO2_NO ', & + 'XYLOL_OH ', 'XYLOLOOH_OH ', & + 'BCARY_NO3 ', 'BCARY_O3 ', & + 'BCARY_OH ', 'MTERP_NO3 ', & + 'MTERP_O3 ', 'MTERP_OH ', & + 'NTERPO2_CH3O2 ', 'NTERPO2_HO2 ', & + 'NTERPO2_NO ', 'NTERPO2_NO3 ', & + 'NTERPOOH_OH ', 'TERP2O2_CH3O2 ', & + 'TERP2O2_HO2 ', 'TERP2O2_NO ', & + 'TERP2OOH_OH ', 'TERPNIT_OH ', & + 'TERPO2_CH3O2 ', 'TERPO2_HO2 ', & + 'TERPO2_NO ', 'TERPOOH_OH ', & + 'TERPROD1_NO3 ', 'TERPROD1_OH ', & + 'TERPROD2_OH ', 'OCS_O ', & + 'OCS_OH ', 'S_O2 ', & + 'S_O3 ', 'SO_BRO ', & + 'SO_CLO ', 'S_OH ', & + 'SO_NO2 ', 'SO_O2 ', & + 'SO_O3 ', 'SO_OCLO ', & + 'SO_OH ', 'usr_SO2_OH ', & + 'usr_SO3_H2O ', 'DMS_NO3 ', & + 'DMS_OHa ', 'NH3_OH ', & + 'usr_DMS_OH ', 'usr_GLYOXAL_aer ', & + 'usr_HO2_aer ', 'usr_HONITR_aer ', & + 'usr_ISOPNITA_aer ', 'usr_ISOPNITB_aer ', & + 'usr_N2O5_aer ', 'usr_NC4CH2OH_aer ', & + 'usr_NC4CHO_aer ', 'usr_NH4_strat_tau ', & + 'usr_NO2_aer ', 'usr_NO3_aer ', & + 'usr_NTERPOOH_aer ', 'usr_ONITR_aer ', & + 'usr_TERPNIT_aer ', 'BCARY_NO3_vbs ', & + 'BCARY_O3_vbs ', 'BCARY_OH_vbs ', & + 'BENZENE_OH_vbs ', 'ISOP_NO3_vbs ', & + 'ISOP_O3_vbs ', 'ISOP_OH_vbs ', & + 'IVOC_OH ', 'MTERP_NO3_vbs ', & + 'MTERP_O3_vbs ', 'MTERP_OH_vbs ', & + 'SVOC_OH ', 'TOLUENE_OH_vbs ', & + 'XYLENES_OH_vbs ', 'het1 ', & + 'het10 ', 'het11 ', & + 'het12 ', 'het13 ', & + 'het14 ', 'het15 ', & + 'het16 ', 'het17 ', & + 'het2 ', 'het3 ', & + 'het4 ', 'het5 ', & + 'het6 ', 'het7 ', & + 'het8 ', 'het9 ', & + 'E90_tau ', 'NH_50_tau ', & + 'NH_5_tau ', 'ST80_25_tau ' /) + rxt_tag_map(:rxt_tag_cnt) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, & + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, & + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, & + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, & + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, & + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, & + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, & + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, & + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, & + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, & + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, & + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, & + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, & + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, & + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, & + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, & + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, & + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, & + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, & + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, & + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, & + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, & + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, & + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, & + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, & + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, & + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, & + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, & + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, & + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, & + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, & + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, & + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, & + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, & + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, & + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, & + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, & + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, & + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, & + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, & + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, & + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, & + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, & + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, & + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, & + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, & + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, & + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, & + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, & + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, & + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, & + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, & + 521, 522, 523, 524, 525, 526, 527, 528 /) + if( allocated( pht_alias_lst ) ) then + deallocate( pht_alias_lst ) + end if + allocate( pht_alias_lst(phtcnt,2),stat=ios ) + if( ios /= 0 ) then + write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_lst; error = ',ios + call endrun + end if + if( allocated( pht_alias_mult ) ) then + deallocate( pht_alias_mult ) + end if + allocate( pht_alias_mult(phtcnt,2),stat=ios ) + if( ios /= 0 ) then + write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_mult; error = ',ios + call endrun + end if + pht_alias_lst(:,1) = (/ ' ', ' ', ' ', ' ', & + 'userdefined ', 'userdefined ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', 'userdefined ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ' /) + pht_alias_lst(:,2) = (/ ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', 'jch3ooh ', 'jch3ooh ', & + 'jch3ooh ', 'jno2 ', 'jno2 ', 'jno2 ', & + 'jno2 ', 'jno2 ', 'jno2 ', 'jch3ooh ', & + 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', ' ', & + ' ', ' ', ' ', ' ', & + 'jh2o2 ', ' ', ' ', ' ', & + ' ', 'jch3ooh ', ' ', 'jmgly ', & + 'jch2o_a ', 'jno2 ', ' ', 'jch3ooh ', & + 'jch3ooh ', ' ', ' ', 'jacet ', & + 'jch3ooh ', 'jpan ', ' ', 'jch2o_a ', & + 'jch2o_a ', 'jch3ooh ', 'jch3cho ', ' ', & + 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', 'jno2 ', & + 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', 'jch3cho ', & + 'jch3cho ', 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', & + 'jch3ooh ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', ' ', ' ', ' ', & + ' ', 'jno2 ', 'jno2 ', 'jno2 ', & + 'jno2 ', 'jno2 ', 'jno2 ', 'jno2 ', & + 'jno2 ', 'jno2 ', 'jno2 ' /) + pht_alias_mult(:,1) = (/ 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8 /) + pht_alias_mult(:,2) = (/ 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, .10_r8, 0.2_r8, .14_r8, .20_r8, & + .20_r8, .006_r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 0.28_r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + .006_r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, .10_r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + 1._r8, 1._r8, 1._r8, .0004_r8, .0004_r8, & + .0004_r8, .0004_r8, .0004_r8, .0004_r8, .0004_r8, & + .0004_r8, .0004_r8, .0004_r8 /) + allocate( cph_enthalpy(enthalpy_cnt),stat=ios ) + if( ios /= 0 ) then + write(iulog,*) 'set_sim_dat: failed to allocate cph_enthalpy; error = ',ios + call endrun + end if + allocate( cph_rid(enthalpy_cnt),stat=ios ) + if( ios /= 0 ) then + write(iulog,*) 'set_sim_dat: failed to allocate cph_rid; error = ',ios + call endrun + end if + cph_rid(:) = (/ 126, 129, 130, 131, 134, & + 137, 138, 139, 140, 143, & + 144, 145, 148, 150, 154, & + 155, 163, 164 /) + cph_enthalpy(:) = (/ 189.810000_r8, 392.190000_r8, 493.580000_r8, 101.390000_r8, 232.590000_r8, & + 203.400000_r8, 226.580000_r8, 120.100000_r8, 194.710000_r8, 293.620000_r8, & + 67.670000_r8, 165.300000_r8, 165.510000_r8, 313.750000_r8, 133.750000_r8, & + 193.020000_r8, 34.470000_r8, 199.170000_r8 /) + allocate( num_rnts(rxntot-phtcnt),stat=ios ) + if( ios /= 0 ) then + write(iulog,*) 'set_sim_dat: failed to allocate num_rnts; error = ',ios + call endrun + end if + num_rnts(:) = (/ 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, & + 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & + 2, 3, 2, 2, 3, 3, 3, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 3, 3, 2, 2, 1, 2, 2, 2, 2, & + 2, 2, 3, 3, 3, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, & + 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, & + 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, & + 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, & + 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, & + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, & + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, & + 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, & + 2, 1, 1, 1, 1 /) + + end subroutine set_sim_dat + + end module mo_sim_dat From 784bf468f121471c7c91fd44308129367a541767 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 18:12:22 -0400 Subject: [PATCH 077/239] Feat: Implement dry deposition in CESM/GC (1) Different options are available to compute dry deposition velocities: 1. All deposition velocities are computed from GEOS-Chem using data from HEMCO 2. CLM passes dry deposition velocities over land and ocean and ice velocities are computed from GEOS-Chem using data from HEMCO 3. CLM passes dry deposition velocities over land and ocean and ice velocities are computed in a similar way as MOZART --- src/chemistry/pp_geoschem/chem_mods.F90 | 45 +- src/chemistry/pp_geoschem/chemistry.F90 | 596 +++++++++++++++++++----- 2 files changed, 513 insertions(+), 128 deletions(-) diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/pp_geoschem/chem_mods.F90 index e4b9013937..0b220f886b 100644 --- a/src/chemistry/pp_geoschem/chem_mods.F90 +++ b/src/chemistry/pp_geoschem/chem_mods.F90 @@ -7,28 +7,41 @@ module chem_mods implicit none save - INTEGER, PARAMETER :: NTracersMax = 200 ! Must be equal to nadv_chem - INTEGER :: NTracers - CHARACTER(LEN=255) :: TracerNames(NTracersMax) - CHARACTER(LEN=255) :: TracerLongNames(NTracersMax) - REAL(r8) :: Adv_Mass(NTracersMax) - REAL(r8) :: MWRatio(NTracersMax) - REAL(r8) :: Ref_MMR(NTracersMax) + INTEGER, PARAMETER :: nTracersMax = 200 ! Must be equal to nadv_chem + INTEGER :: nTracers + CHARACTER(LEN=255) :: tracerNames(nTracersMax) + CHARACTER(LEN=255) :: tracerLongNames(nTracersMax) + REAL(r8) :: adv_Mass(nTracersMax) + REAL(r8) :: MWRatio(nTracersMax) + REAL(r8) :: ref_MMR(nTracersMax) ! Short-lived species (i.e. not advected) - INTEGER, PARAMETER :: NSlsMax = 500 ! UNadvected species only - INTEGER :: NSls - CHARACTER(LEN=255) :: SlsNames(NSlsMax) - CHARACTER(LEN=255) :: SlsLongnames(NSlsMax) - REAL(r8) :: Sls_Ref_MMR(NSlsMax) - REAL(r8) :: SlsMWRatio(NSlsMax) + INTEGER, PARAMETER :: nSlsMax = 500 ! UNadvected species only + INTEGER :: nSls + CHARACTER(LEN=255) :: slsNames(nSlsMax) + CHARACTER(LEN=255) :: slsLongnames(nSlsMax) + REAL(r8) :: sls_Ref_MMR(nSlsMax) + REAL(r8) :: slsMWRatio(nSlsMax) ! Mapping between constituents and GEOS-Chem tracers - INTEGER :: Map2GC(pcnst) - INTEGER :: Map2GC_Sls(NSlsMax) + INTEGER :: map2GC(pcnst) + INTEGER :: map2GC_Sls(nSlsMax) + + !----------------------------- + ! Dry deposition index mapping + !----------------------------- + ! drySpc_ndx maps drydep_list onto tracerNames such that + ! tracerNames(drySpc_ndx(:)) = drydep_list(:) + INTEGER, ALLOCATABLE :: drySpc_ndx(:) + + ! map2GC_dryDep maps drydep_list onto the GEOS-Chem dry deposition + ! velocity arrays such that + ! State_Chm%DryDepVel(1,:,map2GC_dryDep(:)) = cam_in%depVel(:,:) + INTEGER, ALLOCATABLE :: map2GC_dryDep(:) + ! Mapping from constituents to raw index - INTEGER :: Map2Idx(pcnst) + INTEGER :: map2Idx(pcnst) INTEGER, PARAMETER :: phtcnt = 40, & ! number of photolysis reactions rxntot = 212, & ! number of total reactions diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index f8ace92c22..34c95cd106 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -11,11 +11,12 @@ module chemistry !use mo_gas_phase_chemdr, only: map2chm !use mo_constants, only: pi use shr_const_mod, only: molw_dryair=>SHR_CONST_MWDAIR - !use mo_chem_utls, only : get_spc_ndx !use chem_mods, only : gas_pcnst, adv_mass !use mo_sim_dat, only: set_sim_dat + use seq_drydep_mod, only : nddvels => n_drydep, drydep_list use spmd_utils, only : MasterProc, myCPU=>Iam, nCPUs=>npes use cam_logfile, only : iulog + use string_utils, only : to_upper !-------------------------------------------------------------------- ! Basic GEOS-Chem modules @@ -116,6 +117,17 @@ module chemistry CHARACTER(LEN=255) :: ThisLoc CHARACTER(LEN=255) :: ErrMsg +#define ALLDDVEL_GEOSCHEM 0 +#define OCNDDVEL_GEOSCHEM 0 +#define OCNDDVEL_MOZART 1 + +#if ( OCNDDVEL_MOZART ) + ! Filenames to compute dry deposition velocities similarly to MOZART + CHARACTER(LEN=255) :: MOZART_depvel_lnd_file = 'depvel_lnd_file' + CHARACTER(LEN=255) :: MOZART_clim_soilw_file = 'clim_soilw_file' + CHARACTER(LEN=255) :: MOZART_season_wes_file = 'season_wes_file' +#endif + !================================================================================================ contains !================================================================================================ @@ -342,27 +354,84 @@ subroutine chem_readnl(nlfile) use cam_abortutils, only : endrun use units, only : getunit, freeunit use mpishorthand - use gckpp_Model, only : NSPEC, SPC_NAMES + use gckpp_Model, only : nSpec, Spc_Names + use mo_chem_utls, only : get_spc_ndx + use chem_mods, only : drySpc_ndx ! args CHARACTER(LEN=*), INTENT(IN) :: nlfile ! filepath for file containing namelist input ! Local variables - INTEGER :: I, UNITN, IERR - CHARACTER(LEN=500) :: LINE - logical :: menuFound, validSLS + INTEGER :: I, N, nIgnored + INTEGER :: UNITN, IERR + CHARACTER(LEN=500) :: line + LOGICAL :: menuFound + LOGICAL :: validSLS + +#if ( OCNDDVEL_MOZART ) + namelist /chem_inparm/ MOZART_depvel_lnd_file, & + MOZART_clim_soilw_file, & + MOZART_season_wes_file +#endif + + nIgnored = 0 ! Set paths - inputGeosPath='/n/home10/tfritz/UT/runs/4x5_standard/input.geos.template' - chemInputsDir='/n/holylfs/EXTERNAL_REPOS/GEOS-CHEM/gcgrid/gcdata/ExtData/CHEM_INPUTS/' inputGeosPath='/home/fritzt/input.geos.template' chemInputsDir='/net/d06/data/GCdata/ExtData/CHEM_INPUTS/' - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_READNL' +#if ( ALLDDVEL_GEOSCHEM + OCNDDVEL_GEOSCHEM + OCNDDVEL_MOZART != 1 ) + IF (MasterProc) THEN + Write(iulog,'(/,a)') REPEAT( "=", 79 ) + Write(iulog,'(a)') " Preprocessor flags are not set correctly in chemistry.F90" + Write(iulog,'(a)') " The user needs to decide how to compute dry deposition velocities" + Write(iulog,'(a)') " Three options appear: " + Write(iulog,'(a)') " + Let GEOS-Chem calculate all dry deposition velocities." + Write(iulog,'(a)') " Required setup:" + Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 1" + Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 0" + Write(iulog,'(a)') " OCNDDVEL_MOZART == 0" + Write(iulog,'(a)') " + Let CLM compute dry deposition velocities over land and let" + Write(iulog,'(a)') " GEOS-Chem compute velocities over ocean and ice" + Write(iulog,'(a)') " Required setup:" + Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 0" + Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 1" + Write(iulog,'(a)') " OCNDDVEL_MOZART == 0" + Write(iulog,'(a)') " + Let CLM compute dry deposition velocities over land and" + Write(iulog,'(a)') " compute velocities over ocean and ice in a similar way as" + Write(iulog,'(a)') " MOZART" + Write(iulog,'(a)') " Required setup:" + Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 0" + Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 0" + Write(iulog,'(a)') " OCNDDVEL_MOZART == 1" + Write(iulog,'(a)') REPEAT( "=", 79 ) + CALL ENDRUN('Incorrect definitions for dry deposition velocities') + ENDIF +#endif + + ALLOCATE(drySpc_ndx(nddvels), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate drySpc_ndx') - ! TODO: Read in input.geos and get species names IF (MasterProc) THEN + + Write(iulog,'(/,a)') REPEAT( '=', 50 ) + Write(iulog,'(a)') REPEAT( '=', 50 ) + Write(iulog,'(a)') 'This is the GEOS-CHEM / CESM interface' + Write(iulog,'(a)') REPEAT( '=', 50 ) + Write(iulog,'(a)') ' + Routines written by Thibaud M. Fritz' + Write(iulog,'(a)') ' + Laboratory for Aviation and the Environment,' + Write(iulog,'(a)') ' + Department of Aeronautics and Astronautics,' + Write(iulog,'(a)') ' + Massachusetts Institute of Technology' + Write(iulog,'(a)') REPEAT( '=', 50 ) + + Write(iulog,'(/,/, a)') 'Now defining GEOS-Chem tracers and dry deposition mapping...' + UNITN = GETUNIT() + + !============================================================== + ! Opening input.geos and go to ADVECTED SPECIES MENU + !============================================================== + OPEN( UNITN, FILE=TRIM(inputGeosPath), STATUS='OLD', IOSTAT=IERR ) IF (IERR .NE. 0) THEN CALL ENDRUN('chem_readnl: ERROR opening input.geos') @@ -371,25 +440,29 @@ subroutine chem_readnl(nlfile) ! Go to ADVECTED SPECIES MENU menuFound = .False. DO WHILE (.NOT.menuFound) - READ( UNITN, '(a)', IOSTAT=IERR ) LINE + READ( UNITN, '(a)', IOSTAT=IERR ) line IF (IERR.NE.0) THEN CALL ENDRUN('chem_readnl: ERROR finding advected species menu') - ELSEIF (INDEX(LINE,'ADVECTED SPECIES MENU') > 0) then + ELSEIF (INDEX(line,'ADVECTED SPECIES MENU') > 0) then menuFound=.True. ENDIF ENDDO + !============================================================== + ! Read list of GEOS-Chem tracers + !============================================================== + DO ! Read line - READ(UNITN,'(26x,a)', IOSTAT=IERR) LINE + READ(UNITN,'(26x,a)', IOSTAT=IERR) line - IF ( INDEX( TRIM(LINE), '---' ) > 0 ) EXIT + IF ( INDEX( TRIM(line), '---' ) > 0 ) EXIT nTracers = nTracers + 1 - tracerNames(nTracers) = TRIM(LINE) + tracerNames(nTracers) = TRIM(line) - WRITE(iulog,'(a,I5,a,a)') ' --> GC Tracer ', nTracers, ': ', TRIM(LINE) ENDDO + CLOSE(UNITN) CALL FREEUNIT(UNITN) @@ -398,34 +471,100 @@ subroutine chem_readnl(nlfile) WRITE(tracerNames(I),'(a,I0.4)') 'GCTRC_', I ENDDO - ! Now go through the KPP mechanism and add any species not implemented by - ! the tracer list in input.geos - IF ( NSPEC > nSlsMax ) THEN + !============================================================== + ! Now go through the KPP mechanism and add any species not + ! implemented by the tracer list in input.geos + !============================================================== + + IF ( nSpec > nSlsMax ) THEN CALL ENDRUN('chem_readnl: too many species - increase nSlsmax') ENDIF nSls = 0 - DO I=1,NSPEC + DO I = 1, nSpec ! Get the name of the species from KPP - LINE = ADJUSTL(TRIM(SPC_NAMES(I))) + line = ADJUSTL(TRIM(Spc_Names(I))) ! Only add this - validSLS = ( (.NOT.ANY(TRIM(LINE).EQ.tracerNames)).AND.& - (.NOT.(LINE(1:2) == 'RR')) ) + validSLS = ( .NOT. ANY(TRIM(line) .EQ. tracerNames) ) IF (validSLS) THEN ! Genuine new short-lived species nSls = nSls + 1 - slsNames(nSls) = TRIM(LINE) - WRITE(iulog,'(a,I5,a,a)') ' --> GC species ', nSls, ': ', TRIM(LINE) + slsNames(nSls) = TRIM(line) ENDIF ENDDO + + !============================================================== + ! Get mapping between dry deposition species and species set + !============================================================== + + DO N = 1, nddvels + + ! The species names need to be convert to upper case as, + ! for instance, BR2 != Br2 + drySpc_ndx(N) = get_spc_ndx( to_upper(drydep_list(N)) ) + + IF ( drySpc_ndx(N) < 0 ) THEN + Write(iulog,'(a,a)') ' ## Ignoring dry deposition of ', & + TRIM(drydep_list(N)) + nIgnored = nIgnored + 1 + ENDIF + ENDDO + + IF ( nIgnored > 0 ) THEN + Write(iulog,'(a,a)') ' The species listed above have dry', & + ' deposition turned off for one of the following reasons:' + Write(iulog,'(a)') ' - They are not present in the GEOS-Chem tracer list.' + Write(iulog,'(a)') ' - They have a synonym (e.g. CH2O and HCHO).' + ENDIF + + !============================================================== + ! Print summary + !============================================================== + + Write(iulog,'(/, a)') '### Summary of GEOS-Chem species: ' + Write(iulog,'( a)') REPEAT( '-', 50 ) + Write(iulog,'( a)') '+ List of advected species: ' + Write(iulog,100) 'ID', 'Tracer', 'Dry deposition (T/F)' + DO N = 1, nTracers + WRITE(iulog,110) N, TRIM(tracerNames(N)), any(drySpc_ndx .eq. N) + ENDDO + + Write(iulog,'(/, a)') '+ List of short-lived species: ' + DO N = 1, nSls + WRITE(iulog,120) N, TRIM(slsNames(N)) + ENDDO + + 100 FORMAT( 1x, A3, 3x, A10, 1x, A25 ) + 110 FORMAT( 1x, I3, 3x, A10, 1x, L15 ) + 120 FORMAT( 1x, I3, 3x, A10 ) + + !============================================================== + ENDIF + !================================================================== ! Broadcast to all processors + !================================================================== + #if defined( SPMD ) CALL MPIBCAST(nTracers, 1, MPIINT, 0, MPICOM ) CALL MPIBCAST(tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) CALL MPIBCAST(nSls, 1, MPIINT, 0, MPICOM ) CALL MPIBCAST(slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST(drySpc_ndx, nddvels, MPIINT, 0, MPICOM ) + +#if ( OCNDDVEL_MOZART ) + !============================================================== + ! The following lines should only be called if we compute + ! velocities over the ocean and ice in a MOZART-like way. + ! Thibaud M. Fritz - 26 Feb 2020 + !============================================================== + + CALL MPIBCAST(MOZART_depvel_lnd_file, LEN(MOZART_depvel_lnd_file), MPICHAR, 0, MPICOM) + CALL MPIBCAST(MOZART_clim_soilw_file, LEN(MOZART_clim_soilw_file), MPICHAR, 0, MPICOM) + CALL MPIBCAST(MOZART_season_wes_file, LEN(MOZART_season_wes_file), MPICHAR, 0, MPICOM) +#endif + #endif ! Update "short_lived_species" arrays - will eventually unify these @@ -492,6 +631,7 @@ subroutine chem_init(phys_state, pbuf2d) !----------------------------------------------------------------------- use physics_buffer, only: physics_buffer_desc, pbuf_get_index use cam_history, only: addfld, add_default, horiz_only + use chem_mods, only: map2GC_dryDep, drySpc_ndx use mpishorthand use cam_abortutils, only : endrun @@ -517,9 +657,14 @@ subroutine chem_init(phys_state, pbuf2d) !use Transfer_Mod, only : Init_Transfer use Linoz_Mod, only : Linoz_Read +#if ( OCNDDVEL_MOZART ) + use seq_drydep_mod, only: drydep_method, DD_XLND + use mo_drydep, only: drydep_inti +#endif + use CMN_Size_Mod - use Drydep_Mod, only : Init_Drydep + use Drydep_Mod, only : Init_Drydep, DepName, nDVZind use Carbon_Mod, only : Init_Carbon use Dust_Mod, only : Init_Dust use Seasalt_Mod, only : Init_Seasalt @@ -549,7 +694,8 @@ subroutine chem_init(phys_state, pbuf2d) INTEGER :: IWAIT, IERR INTEGER :: nX, nY, nZ INTEGER :: iX, jY - INTEGER :: I, J, L, RC + INTEGER :: I, J, L, N + INTEGER :: RC INTEGER :: NLINOZ ! Logicals @@ -572,6 +718,7 @@ subroutine chem_init(phys_state, pbuf2d) REAL(r8), POINTER :: SlsPtr(:,:,:) + ! Assume a successful return until otherwise RC = GC_SUCCESS @@ -812,8 +959,20 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%JNITChanB = 0e+0_fp ! Now READ_DEPOSITION_MENU - ! Disable dry dep for now Input_Opt%LDryD = .True. + !================================================================== + ! Add the following options: + ! + GEOS-Chem computes ALL dry-deposition velocities + ! + CLM computes land velocities. Velocities over ocean and ice are + ! computed in a MOZART-like way + ! + CLM computes land velocities. Velocities over ocean and ice are + ! computed from GEOS-Chem + ! + ! Note: What to do about aerosols? Who should compute the dry + ! deposition velocities + ! + ! Thibaud M. Fritz - 26 Feb 2020 + !================================================================== Input_Opt%LWetD = .True. Input_Opt%CO2_Effect = .False. Input_Opt%CO2_Level = 390.0_fp @@ -1017,6 +1176,56 @@ subroutine chem_init(phys_state, pbuf2d) ErrMsg = 'Error encountered in "Init_Drydep"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + + !============================================================== + ! Get mapping between CESM dry deposited species and the + ! indices of State_Chm%DryDepVel. This needs to be done after + ! Init_Drydep + ! Thibaud M. Fritz - 04 Mar 2020 + !============================================================== + + ALLOCATE(map2GC_dryDep(nddvels), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate map2GC_dryDep') + + DO N = 1, nddvels + + ! Initialize index to -1 + map2GC_dryDep(N) = -1 + + IF ( drySpc_ndx(N) > 0 ) THEN + + ! Convert to upper case + SpcName = to_upper(drydep_list(N)) + + DO I = 1, State_Chm(BEGCHUNK)%nDryDep + IF ( TRIM( SpcName ) == TRIM( to_upper(depName(I)) ) ) THEN + map2GC_dryDep(N) = nDVZind(I) + EXIT + ENDIF + ENDDO + + ENDIF + + ENDDO + +#if ( OCNDDVEL_MOZART ) + !============================================================== + ! The following line should only be called if we compute + ! velocities over the ocean and ice in a MOZART-like way. + ! Thibaud M. Fritz - 26 Feb 2020 + !============================================================== + + IF ( drydep_method == DD_XLND ) THEN + CALL drydep_inti( MOZART_depvel_lnd_file, & + MOZART_clim_soilw_file, & + MOZART_season_wes_file ) + ELSE + Write(iulog,'(a,a)') ' drydep_method is set to: ', TRIM(drydep_method) + CALL ENDRUN('drydep_method must be DD_XLND to compute dry deposition' // & + ' velocities similarly to MOZART over ocean and ice!') + ENDIF +#endif + ENDIF !================================================================= @@ -1284,6 +1493,7 @@ subroutine chem_init(phys_state, pbuf2d) !ENDIF ! +#if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) !! Populate the State_Met%LandTypeFrac field with data from HEMCO !CALL Init_LandTypeFrac( am_I_Root = MasterProc, & ! Input_Opt = Input_Opt, & @@ -1307,6 +1517,7 @@ subroutine chem_init(phys_state, pbuf2d) ! ErrMsg = 'Error encountered in "Compute_Olson_Landmap"!' ! CALL Error_Stop( ErrMsg, ThisLoc ) !ENDIF +#endif ! Initialize PBL quantities but do not do mixing ! Add option for non-local PBL (Lin, 03/31/09) @@ -1454,6 +1665,15 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use phys_grid, only: get_ncols_p, get_rlat_all_p, get_rlon_all_p + use chem_mods, only: drySpc_ndx, map2GC_dryDep +#if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) + use Drydep_Mod, only: Do_Drydep +#elif ( OCNDDVEL_MOZART ) + use mo_drydep, only: drydep_update, drydep_fromlnd +#endif + use Drydep_Mod, only: DEPNAME !TMMF, this is just needed for debug + use Drydep_Mod, only: Update_DryDepSav + use Dao_Mod, only: Set_Dry_Surface_Pressure use Dao_Mod, only: AirQnt use GC_Grid_Mod, only: SetGridFromCtr @@ -1466,7 +1686,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Wetscav_Mod, only: Setup_Wetscav, Do_WetDep use CMN_Size_Mod, only: PTop use PBL_Mix_Mod, only: Compute_PBL_Height - use Drydep_Mod, only : Do_Drydep use Tropopause, only: Tropopause_findChemTrop, Tropopause_Find @@ -1481,7 +1700,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Grid area use PhysConst, only: Gravit use PhysConstants, only: Re - use Phys_Grid, only: get_area_all_p + use Phys_Grid, only: get_area_all_p, get_lat_all_p, get_lon_all_p use Short_Lived_Species, only : Get_Short_Lived_Species use Short_Lived_Species, only : Set_Short_Lived_Species @@ -1530,8 +1749,21 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: RelHum(State%NCOL, PVER) ! Relative humidity [0-1] REAL(r8) :: SatV (State%NCOL, PVER) ! Work arrays REAL(r8) :: SatQ (State%NCOL, PVER) ! Work arrays - REAL(r8) :: QH2O (State%NCOL, PVER) ! Specific humidity [kg/kg] + REAL(r8) :: qH2O (State%NCOL, PVER) ! Specific humidity [kg/kg] REAL(r8) :: H2OVMR(State%NCOL, PVER) ! H2O volume mixing ratio +#if ( OCNDDVEL_MOZART ) + REAL(r8) :: windSpeed(State%NCOL) ! Wind speed at ground level [m/s] + REAL(r8) :: potT(State%NCOL) ! Potential temperature [K] + + INTEGER :: latndx(PCOLS) + INTEGER :: lonndx(PCOLS) + + ! For MOZART's dry deposition over ocean and ice + ! Deposition velocity (cm/s) + REAL(r8) :: MOZART_depVel(State%NCOL, nTracersMax) + ! Deposition flux (/cm^2/s) + REAL(r8) :: MOZART_depFlx(State%NCOL, nTracersMax) +#endif ! Because of strat chem LOGICAL, SAVE :: SCHEM_READY = .FALSE. @@ -1552,16 +1784,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: Sd_Ice, Sd_Lnd, Sd_Avg, Frc_Ice ! Estimating cloud optical depth - !REAL(r8) :: LWC(PCOLS,PVER) - !REAL(r8) :: IWC(PCOLS,PVER) - !REAL(r8) :: LWP(PCOLS,PVER) - !REAL(r8) :: IWP(PCOLS,PVER) - !REAL(r8) :: CldLiq(PCOLS,PVER) - !REAL(r8) :: CldIce(PCOLS,PVER) REAL(r8) :: cld(PCOLS,PVER) REAL(r8) :: TauCli(PCOLS,PVER) REAL(r8) :: TauClw(PCOLS,PVER) - !REAL(r8) :: localMult REAL(r8), PARAMETER :: re_m = 1.0e-05_r8 ! Cloud drop radius in m REAL(r8), PARAMETER :: cldMin = 1.0e-02_r8 ! Minimum cloud cover REAL(r8), PARAMETER :: cnst = 1.5e+00_r8 / (re_m * 1.0e+03_r8 * g0) @@ -1619,8 +1844,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! retrieve this from State_Met which is chunked !CALL get_rlat_all_p( LCHNK, NCOL, Rlats ) !CALL get_rlon_all_p( LCHNK, NCOL, Rlons ) - Rlats(1:NCOL) = State%Lat(1:NCOL) - Rlons(1:NCOL) = State%Lon(1:NCOL) + Rlats(1:nY) = State%Lat(1:nY) + Rlons(1:nY) = State%Lon(1:nY) lonMidArr = 0.0e+0_f4 latMidArr = 0.0e+0_f4 @@ -1644,7 +1869,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ! Set area - CALL Get_Area_All_p( LCHNK, NCOL, Col_Area ) + CALL Get_Area_All_p( LCHNK, nY, Col_Area ) ! Field : AREA_M2 ! Description: Grid box surface area @@ -1684,7 +1909,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Retrieve previous value of species data SlsData(:,:,:) = 0.0e+0_r8 - CALL Get_Short_Lived_Species( SlsData, LCHNK, NCOL, Pbuf ) + CALL Get_Short_Lived_Species( SlsData, LCHNK, nY, Pbuf ) ! Remap and flip them DO N = 1, nSls @@ -1703,8 +1928,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Calculate COS(SZA) Calday = Get_Curr_Calday( ) - CALL Zenith( Calday, Rlats, Rlons, CSZA, NCOL ) - !CALL Outfld( 'SZA', SZA, NCOL, LCHNK ) + CALL Zenith( Calday, Rlats, Rlons, CSZA, nY ) ! Get all required data from physics buffer TIM_NDX = Pbuf_Old_Tim_Idx() @@ -1720,29 +1944,29 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Get VMR and MMR of H2O H2OVMR = 0.0e0_fp - QH2O = 0.0e0_fp + qH2O = 0.0e0_fp ! Note MWDRY = 28.966 g/mol DO J = 1, nY DO L = 1, nZ - QH2O(J,L) = REAL(State_Chm(LCHNK)%Species(1,J,L,iH2O),r8) - H2OVMR(J,L) = QH2O(J,L) * MWDry / 18.016e+0_fp + qH2O(J,L) = REAL(State_Chm(LCHNK)%Species(1,J,L,iH2O),r8) + H2OVMR(J,L) = qH2O(J,L) * MWDry / 18.016e+0_fp ENDDO ENDDO ! Calculate RH (range 0-1, note still level 1 = TOA) - RELHUM(:,:) = 0.0e+0_r8 - CALL QSat(State%T(:NCOL,:), State%Pmid(:NCOL,:), SatV, SatQ) + relHum(:,:) = 0.0e+0_r8 + CALL QSat(State%T(:nY,:), State%Pmid(:nY,:), SatV, SatQ) DO J = 1, nY DO L = 1, nZ - RELHUM(J,L) = 0.622e+0_r8 * H2OVMR(J,L) / SatQ(J,L) - RELHUM(J,L) = MAX( 0.0e+0_r8, MIN( 1.0e+0_r8, RELHUM(J,L) ) ) + relHum(J,L) = 0.622e+0_r8 * H2OVMR(J,L) / SatQ(J,L) + relHum(J,L) = MAX( 0.0e+0_r8, MIN( 1.0e+0_r8, relHum(J,L) ) ) ENDDO ENDDO ! Estimate roughness height VERY roughly Z0 = 0.0e+0_r8 DO J = 1, nY - IF (Cam_in%LandFrac(J).GE.0.5e+0_r8) THEN + IF (cam_in%LandFrac(J).GE.0.5e+0_r8) THEN Z0(J) = 0.035e+0_r8 ELSE Z0(J) = 0.0001e+0_r8 @@ -1819,9 +2043,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Calculate snow depth snowDepth = 0.0e+0_r8 DO J = 1, nY - Sd_Ice = MAX(0.0e+0_r8,Cam_in%Snowhice(J)) - Sd_Lnd = MAX(0.0e+0_r8,Cam_in%Snowhland(J)) - Frc_Ice = MAX(0.0e+0_r8,Cam_in%Icefrac(J)) + Sd_Ice = MAX(0.0e+0_r8,cam_in%Snowhice(J)) + Sd_Lnd = MAX(0.0e+0_r8,cam_in%Snowhland(J)) + Frc_Ice = MAX(0.0e+0_r8,cam_in%Icefrac(J)) IF (Frc_Ice > 0.0e+0_r8) THEN Sd_Avg = (Sd_Lnd*(1.0e+0_r8 - Frc_Ice)) + (Sd_Ice * Frc_Ice) ELSE @@ -1834,7 +2058,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Visible surface albedo ! Unit : - ! Dimensions : nX, nY - State_Met(LCHNK)%ALBD (1,:) = Cam_in%Asdir(:) + State_Met(LCHNK)%ALBD (1,:) = cam_in%Asdir(:) ! Field : CLDFRC ! Description: Column cloud fraction @@ -1850,8 +2074,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Latent heat flux, sensible heat flux ! Unit : W/m^2 ! Dimensions : nX, nY - State_Met(LCHNK)%EFLUX (1,:) = Cam_in%Lhf(:) - State_Met(LCHNK)%HFLUX (1,:) = Cam_in%Shf(:) + State_Met(LCHNK)%EFLUX (1,:) = cam_in%Lhf(:) + State_Met(LCHNK)%HFLUX (1,:) = cam_in%Shf(:) ! Field : FRCLND, FRLAND, FROCEAN, FRSEAICE, FRLAKE, FRLANDIC ! Description: Olson land fraction @@ -1864,9 +2088,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Unit : - ! Dimensions : nX, nY State_Met(LCHNK)%FRCLND (1,:) = 0.0e+0_fp ! Olson land fraction - State_Met(LCHNK)%FRLAND (1,:) = Cam_in%LandFrac(:) - State_Met(LCHNK)%FROCEAN (1,:) = Cam_in%OcnFrac(:) + Cam_in%IceFrac(:) - State_Met(LCHNK)%FRSEAICE (1,:) = Cam_in%IceFrac(:) + State_Met(LCHNK)%FRLAND (1,:) = cam_in%LandFrac(:) + State_Met(LCHNK)%FROCEAN (1,:) = cam_in%OcnFrac(:) + cam_in%IceFrac(:) + State_Met(LCHNK)%FRSEAICE (1,:) = cam_in%IceFrac(:) State_Met(LCHNK)%FRLAKE (1,:) = 0.0e+0_fp State_Met(LCHNK)%FRLANDIC (1,:) = 0.0e+0_fp State_Met(LCHNK)%FRSNO (1,:) = 0.0e+0_fp @@ -1911,9 +2135,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Unit : kg/m^2/s ! Dimensions : nX, nY State_Met(LCHNK)%PRECANV (1,:) = 0.0e+0_fp - State_Met(LCHNK)%PRECCON (1,:) = Cam_Out%Precc(:) - State_Met(LCHNK)%PRECLSC (1,:) = Cam_Out%Precl(:) - State_Met(LCHNK)%PRECTOT (1,:) = Cam_Out%Precc(:) + Cam_Out%Precl(:) + State_Met(LCHNK)%PRECCON (1,:) = cam_out%Precc(:) + State_Met(LCHNK)%PRECLSC (1,:) = cam_out%Precl(:) + State_Met(LCHNK)%PRECTOT (1,:) = cam_out%Precc(:) + cam_out%Precl(:) ! Field : TROPP ! Description: Tropopause pressure @@ -1938,8 +2162,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Surface temperature, surface skin temperature ! Unit : K ! Dimensions : nX, nY - State_Met(LCHNK)%TS (1,:) = Cam_in%TS(:) - State_Met(LCHNK)%TSKIN (1,:) = Cam_in%TS(:) + State_Met(LCHNK)%TS (1,:) = cam_in%TS(:) + State_Met(LCHNK)%TSKIN (1,:) = cam_in%TS(:) ! Field : SWGDN ! Description: Incident radiation @ ground @@ -1982,7 +2206,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Friction velocity ! Unit : m/s ! Dimensions : nX, nY - State_Met(LCHNK)%USTAR (1,:) = Cam_In%UStar(:) + State_Met(LCHNK)%USTAR (1,:) = cam_in%UStar(:) ! Field : Z0 ! Description: Surface roughness length @@ -2130,8 +2354,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Note : Since we are using online meteorology, we do not have ! access to the data at the next time step ! Compute tendency in g H2O/kg air/s (tmmf, 1/13/20) ? - State_Met(LCHNK)%SPHU1 (1,J,L) = QH2O(J,nZ+1-L) * 1.0e+3_fp ! g/kg - State_Met(LCHNK)%SPHU2 (1,J,L) = QH2O(J,nZ+1-L) * 1.0e+3_fp ! g/kg + State_Met(LCHNK)%SPHU1 (1,J,L) = qH2O(J,nZ+1-L) * 1.0e+3_fp ! g/kg + State_Met(LCHNK)%SPHU2 (1,J,L) = qH2O(J,nZ+1-L) * 1.0e+3_fp ! g/kg ! Field : TMPU1, TMPU2 ! Description: Temperature at current and next timestep @@ -2324,7 +2548,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - ! Initialize strat chem if not already done. This has to be done here because ! it needs to have non-zero values in State_Chm%AD, which only happens after ! the first call to AirQnt @@ -2370,39 +2593,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! CALL Error_Stop( ErrMsg, ThisLoc ) !ENDIF - !============================================================== - ! ***** L E A F A R E A I N D I C E S ***** - !============================================================== - !IF ( newDay ) THEN - ! - ! ! Initialize the State_Met%XLAI_NATIVE field from HEMCO - ! CALL Get_XlaiNative_from_HEMCO( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & - ! State_Met = State_Met(LCHNK), & - ! RC = RC ) - ! - ! ! Trap potential errors - ! IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = - ! 'Error encountered in "Get_XlaiNative_from_HEMCO"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - ! ENDIF - ! - ! ! Compute State_Met%XLAI (for drydep) and State_Met%MODISLAI, - ! ! which is the average LAI per grid box (for soil NOx emissions) - ! CALL Compute_Xlai( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & - ! State_Grid = State_Grid(LCHNK), & - ! State_Met = State_Met(LCHNK), & - ! RC = RC ) - ! - ! ! Trap potential errors - ! IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = 'Error encountered in "Compute_Xlai"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - ! ENDIF - !ENDIF - !---------------------------------------------------------- ! %%% GET SOME NON-EMISSIONS DATA FIELDS VIA HEMCO %%% ! @@ -2510,6 +2700,17 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Move this call from the PBL mixing routines because the PBL ! height is used by drydep and some of the emissions routines. ! (ckeller, 3/5/15) + ! This function updates: + ! ==================================================================== + ! (1) InPbl : Logical indicating if we are in the PBL [-] + ! (2) PBL_TOP_L : Number of layers in the PBL [-] + ! (3) PBL_TOP_hPa: Pressure at the top of the PBL [hPa] + ! (4) PBL_TOP_m : PBL height [m] + ! (5) PBL_THICK : PBL thickness [hPa] + ! (6) F_OF_PBL : Fraction of grid box within the PBL [-] + ! (7) F_UNDER_PBLTOP: Fraction of grid box underneath the PBL top [-] + ! (8) PBL_MAX_L : Model level where PBL top occurs [-] + ! ==================================================================== CALL Compute_PBL_Height( am_I_Root = rootChunk, & State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & @@ -2526,12 +2727,48 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Now always do emissions here, even for full-mixing ! (ckeller, 3/5/15) !-------------------------------------------------------------- - !=========================================================== + !================================================================== ! ***** D R Y D E P O S I T I O N ***** - !=========================================================== + !================================================================== + !================================================================== + ! Compute dry deposition velocities + ! + ! CLM computes dry deposition velocities over land. + ! We need to merge the land component passed through cam_in and + ! the ocn/ice dry deposition velocities. + ! + ! If using the CLM velocities, two options show up: + ! 1. Compute dry deposition velocities over ocean and ice similarly + ! to the way MOZART does it (OCNDDVEL_MOZART) + ! 2. Use GEOS-Chem's dry deposition module to compute velocities + ! and then scale them with the ocean fraction (OCNDDVEL_GEOSCHEM) + ! + ! A third option would be to let GEOS-Chem compute dry deposition + ! velocity (ALLDDVEL_GEOSCHEM), even though this would not be ideal. + ! + ! drydep_method must be DD_XLND if we want a MOZART-like to compute + ! dry deposition velocities over ocean and ice. + ! + ! The following options are currently supported: + ! - ALLDDVEL_GEOSCHEM + ! - OCNDDVEL_GEOSCHEM + ! + !================================================================== + ! + ! State_Chm expects dry deposition velocities in m/s, whereas + ! CLM returns land deposition velocities in cm/s! + ! + ! For now, dry deposition velocities are only computed for gases + ! (which is what CLM deals with). Dry deposition for aerosols is + ! work in progress. + ! + ! Thibaud M. Fritz - 27 Feb 2020 + !================================================================== + IF ( Input_Opt%LDryD ) THEN +#if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) - ! Compute drydep velocities + ! Compute drydep velocities and update State_Chm%DryDepVel CALL Do_Drydep( am_I_Root = rootChunk, & Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & @@ -2545,6 +2782,144 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ErrMsg = 'Error encountered in "Do_Drydep!"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + +#if ( OCNDDVEL_GEOSCHEM ) + + DO N = 1, nddvels + + ! Print debug + IF ( rootChunk .AND. 0 ) THEN + IF ( N == 1 ) THEN + Write(iulog,*) "Number of GC dry deposition species = ", & + SIZE(State_Chm(LCHNK)%DryDepVel(:,:,:),3) + Write(iulog,*) "Number of CESM dry deposition species = ", & + nddvels + ENDIF + Write(iulog,*) "N = ", N + Write(iulog,*) "drySpc_ndx = ", drySpc_ndx(N) + Write(iulog,*) "GC index = ", map2GC_dryDep(N) + IF ( map2GC_dryDep(N) > 0 ) THEN + Write(iulog,*) "GC name = ", TRIM(DEPNAME(map2GC_dryDep(N))) + ENDIF + Write(iulog,*) "dry Species= ", TRIM(drydep_list(N)) + IF ( drySpc_ndx(N) > 0 ) THEN + Write(iulog,*) "tracerName = ", TRIM(tracerNames(drySpc_ndx(N))) + ENDIF + Write(iulog,*) "CLM-depVel = ", & + MAXVAL(cam_in%depvel(:nY,N)) * 1.0e-02_fp, " [m/s]" + IF ( map2GC_dryDep(N) > 0 ) THEN + Write(iulog,*) "GC-depVel = ", & + MAXVAL(State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N))), " [m/s]" + ENDIF + ENDIF + + IF ( map2GC_dryDep(N) > 0 ) THEN + ! State_Chm%DryDepVel is in m/s + State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N)) = & + ! This first bit corresponds to the dry deposition + ! velocities over land as computed from CLM and + ! converted to m/s. This is scaled by the fraction + ! of land. + cam_in%depVel(:nY,N) * 1.0e-02_fp & + * MAX(0._fp, 1.0_fp - State_Met(LCHNK)%FROCEAN(1,:nY)) & + ! This second bit corresponds to the dry deposition + ! velocities over ocean and sea ice as computed from + ! GEOS-Chem. This is scaled by the fraction of ocean + ! and sea ice. + + State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N)) & + * State_Met(LCHNK)%FROCEAN(1,:nY) + ENDIF + ENDDO + +#endif + +#elif ( OCNDDVEL_MOZART ) + ! This routine updates the deposition velocities from CLM in the + ! pointer lnd(LCHNK)%dvel as long as drydep_method == DD_XLND is + ! True. + CALL drydep_update( State, cam_in ) + + windSpeed(:nY) = SQRT( State%U(:nY,nZ)*State%U(:nY,nZ) + & + State%V(:nY,nZ)*State%V(:nY,nZ) ) + potT(:nY) = State%T(:nY,nZ) * (1._fp + qH2O(:nY,nZ)) + + CALL get_lat_all_p( LCHNK, nY, latndx ) + CALL get_lon_all_p( LCHNK, nY, lonndx ) + + CALL drydep_fromlnd( ocnfrac = cam_in%ocnfrac(:), & + icefrac = cam_in%icefrac(:), & + ncdate = currYMD, & + sfc_temp = cam_in%TS(:), & + pressure_sfc = State%PS(:), & + wind_speed = windSpeed(:), & + spec_hum = qH2O(:,nZ), & + air_temp = State%T(:,nZ), & + pressure_10m = State%PMid(:,nZ), & + rain = State_Met(LCHNK)%PRECTOT(1,:), & + snow = cam_in%Snowhland(:), & + solar_flux = State_Met(LCHNK)%SWGDN(1,:), & + dvelocity = MOZART_depVel(:,:), & + dflx = MOZART_depFlx(:,:), & + State_Chm = State_Chm(LCHNK), & + tv = potT(:), & + soilw = -99._fp, & + rh = relHum(:,nZ), & + ncol = nY, & + lonndx = lonndx(:), & + latndx = latndx(:), & + lchnk = LCHNK ) + + DO N = 1, nddvels + + ! Print debug + IF ( rootChunk .AND. 1 ) THEN + IF ( N == 1 ) THEN + Write(iulog,*) "Number of GC dry deposition species = ", & + SIZE(State_Chm(LCHNK)%DryDepVel(:,:,:),3) + Write(iulog,*) "Number of CESM dry deposition species = ", & + nddvels + ENDIF + Write(iulog,*) "N = ", N + Write(iulog,*) "drySpc_ndx = ", drySpc_ndx(N) + Write(iulog,*) "GC index = ", map2GC_dryDep(N) + IF ( map2GC_dryDep(N) > 0 ) THEN + Write(iulog,*) "GC name = ", TRIM(DEPNAME(map2GC_dryDep(N))) + ENDIF + Write(iulog,*) "dry Species= ", TRIM(drydep_list(N)) + IF ( drySpc_ndx(N) > 0 ) THEN + Write(iulog,*) "tracerName = ", TRIM(tracerNames(drySpc_ndx(N))) + ENDIF + Write(iulog,*) "CLM-depVel = ", & + MAXVAL(cam_in%depvel(:nY,N)) * 1.0e-02_fp, " [m/s]", LCHNK + IF ( drySpc_ndx(N) > 0 ) THEN + Write(iulog,*) "Merged depVel = ", & + MAXVAL(MOZART_depVel(:nY,drySpc_ndx(N))) * 1.0e-02_fp, " [m/s]", LCHNK + ENDIF + ENDIF + + IF ( ( map2GC_dryDep(N) > 0 ) .AND. ( drySpc_ndx(N) > 0 ) ) THEN + ! State_Chm%DryDepVel is in m/s + State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N)) = & + MOZART_depVel(:nY,drySpc_ndx(N)) * 1.0e-02_fp + ENDIF + + ENDDO + +#else + ! We should be in one of the cases above as any exceptions should be + ! caught when running chem_readnl, but just for safety's safe: + CALL ENDRUN('Incorrect definitions for dry deposition velocities') +#endif + + CALL Update_DryDepSav( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + !CALL ENDRUN('Exit on purpose') ENDIF !!=========================================================== @@ -2654,9 +3029,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Diag = State_Diag(LCHNK), & State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & - myCPU = myCPU, & - LCHNK = LCHNK, & - iO3 = iO3, & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN @@ -2708,7 +3080,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDIF ENDDO - CALL Set_Short_Lived_Species( SlsData, LCHNK, NCOL, Pbuf ) + CALL Set_Short_Lived_Species( SlsData, LCHNK, nY, Pbuf ) ! Write diagnostic output DO N=1, pcnst @@ -2729,7 +3101,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Mass1 = Mass1 + (MMR1*AirMass) ENDDO ENDDO - CALL OutFld( TRIM(SpcName), VMR(:NCOL,:), NCOL, LCHNK ) + CALL OutFld( TRIM(SpcName), VMR(:nY,:), nY, LCHNK ) ENDIF ENDDO @@ -2743,7 +3115,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) VMR(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * SLSMWratio(N) ENDDO ENDDO - CALL OutFld( TRIM(SpcName), VMR(:NCOL,:), NCOL, LCHNK ) + CALL OutFld( TRIM(SpcName), VMR(:nY,:), nY, LCHNK ) ENDIF ENDDO @@ -3022,7 +3394,7 @@ subroutine chem_emissions( state, cam_in ) SFlx(I,N) = SFlx(I,N) + 1.0e-10_r8 ENDIF ENDDO - Cam_in%CFlx(:NCOL,M) = Cam_in%CFlx(:NCOL,M) + SFlx(:NCOL,N) + cam_in%CFlx(:NCOL,M) = cam_in%CFlx(:NCOL,M) + SFlx(:NCOL,N) ENDIF ENDDO From 0b5ce676d54bdfc32d1895581defb163a35d8e7c Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 10 Mar 2020 12:21:47 -0400 Subject: [PATCH 078/239] Feat: Add missing file from last commit to replicate MOZART's dry dep. calculations --- src/chemistry/pp_geoschem/mo_drydep.F90 | 3303 +++++++++++++++++++++++ 1 file changed, 3303 insertions(+) create mode 100644 src/chemistry/pp_geoschem/mo_drydep.F90 diff --git a/src/chemistry/pp_geoschem/mo_drydep.F90 b/src/chemistry/pp_geoschem/mo_drydep.F90 new file mode 100644 index 0000000000..50656ef30b --- /dev/null +++ b/src/chemistry/pp_geoschem/mo_drydep.F90 @@ -0,0 +1,3303 @@ +module mo_drydep + + !--------------------------------------------------------------------- + ! ... Dry deposition velocity input data and code for netcdf input + !--------------------------------------------------------------------- + +!LKE (10/11/2010): added HCN, CH3CN, HCOOH +!LKE (7/30/2015): added new TS1 species (phenooh, iepox, noa, etc.) + + use shr_kind_mod, only : r8 => shr_kind_r8, shr_kind_cl + !use chem_mods, only : gas_pcnst !This needs to be replaced by nTracersMax + use pmgrid, only : plev, plevp + use spmd_utils, only : masterproc, iam + use ppgrid, only : pcols, begchunk, endchunk + !use mo_tracname, only : solsym !This is replaced by tracerNames + use chem_mods, only : tracerNames, nTracersMax, nTracers, drySpc_ndx + use cam_abortutils, only : endrun + use ioFileMod, only : getfil + use pio + use cam_pio_utils, only : cam_pio_openfile, cam_pio_closefile + use cam_logfile, only : iulog + use dyn_grid, only : get_dyn_grid_parm, get_horiz_grid_d + use scamMod, only : single_column + + use seq_drydep_mod, only : nddvels => n_drydep, drydep_list, mapping + use physconst, only : karman + + use State_Chm_Mod, only : ChmState ! Derived type for Chemistry State object + + implicit none + + save + + interface drydep_inti + module procedure dvel_inti_table + module procedure dvel_inti_xactive + module procedure dvel_inti_fromlnd + end interface + + interface drydep + !module procedure drydep_table + module procedure drydep_xactive + module procedure drydep_fromlnd + end interface + + private + public :: drydep_inti, drydep, set_soilw, chk_soilw, has_drydep + public :: drydep_update + public :: drydep_fromlnd + public :: n_land_type, fraction_landuse, drydep_srf_file + + real(r8) :: dels + real(r8), allocatable :: days(:) ! day of year for soilw + real(r8), allocatable :: dvel(:,:,:,:) ! depvel array interpolated to model grid + real(r8), allocatable :: dvel_interp(:,:,:) ! depvel array interpolated to grid and time + integer :: last, next ! day indicies + integer :: ndays ! # of days in soilw file + !integer :: map(gas_pcnst) ! indices for drydep species + integer :: map(nTracersMax) ! indices for drydep species + integer :: nspecies ! number of depvel species in input file + + integer :: pan_ndx, mpan_ndx, no2_ndx, hno3_ndx, o3_ndx, & + h2o2_ndx, onit_ndx, onitr_ndx, ch4_ndx, ch2o_ndx, & + ch3ooh_ndx, pooh_ndx, ch3coooh_ndx, c2h5ooh_ndx, eooh_ndx, & + c3h7ooh_ndx, rooh_ndx, ch3cocho_ndx, co_ndx, ch3coch3_ndx, & + no_ndx, ho2no2_ndx, glyald_ndx, hyac_ndx, ch3oh_ndx, c2h5oh_ndx, & + hydrald_ndx, h2_ndx, Pb_ndx, o3s_ndx, o3inert_ndx, macrooh_ndx, & + xooh_ndx, ch3cho_ndx, isopooh_ndx + integer :: alkooh_ndx, mekooh_ndx, tolooh_ndx, terpooh_ndx, ch3cooh_ndx + integer :: soa_ndx, so4_ndx, cb1_ndx, cb2_ndx, oc1_ndx, oc2_ndx, nh3_ndx, nh4no3_ndx, & + sa1_ndx, sa2_ndx, sa3_ndx, sa4_ndx, nh4_ndx + integer :: soam_ndx, soai_ndx, soat_ndx, soab_ndx, soax_ndx, & + sogm_ndx, sogi_ndx, sogt_ndx, sogb_ndx, sogx_ndx + + logical :: alkooh_dd, mekooh_dd, tolooh_dd, terpooh_dd, ch3cooh_dd + logical :: soa_dd, so4_dd, cb1_dd, cb2_dd, oc1_dd, oc2_dd, nh3_dd, nh4no3_dd, & + sa1_dd, sa2_dd, sa3_dd, sa4_dd, nh4_dd + logical :: soam_dd, soai_dd, soat_dd, soab_dd, soax_dd, & + sogm_dd, sogi_dd, sogt_dd, sogb_dd, sogx_dd + + logical :: pan_dd, mpan_dd, no2_dd, hno3_dd, o3_dd, isopooh_dd, ch4_dd,& + h2o2_dd, onit_dd, onitr_dd, ch2o_dd, macrooh_dd, xooh_dd, & + ch3ooh_dd, pooh_dd, ch3coooh_dd, c2h5ooh_dd, eooh_dd, ch3cho_dd, c2h5oh_dd, & + c3h7ooh_dd, rooh_dd, ch3cocho_dd, co_dd, ch3coch3_dd, & + glyald_dd, hyac_dd, ch3oh_dd, hydrald_dd, h2_dd, Pb_dd, o3s_dd, o3inert_dd + + integer :: so2_ndx + integer :: ch3cn_ndx, hcn_ndx, hcooh_ndx + logical :: ch3cn_dd, hcn_dd, hcooh_dd + + integer :: o3a_ndx,xpan_ndx,xmpan_ndx,xno2_ndx,xhno3_ndx,xonit_ndx,xonitr_ndx,xno_ndx,xho2no2_ndx,xnh4no3_ndx + logical :: o3a_dd, xpan_dd, xmpan_dd, xno2_dd, xhno3_dd, xonit_dd, xonitr_dd, xno_dd, xho2no2_dd, xnh4no3_dd + +!lke-TS1 + integer :: phenooh_ndx, benzooh_ndx, c6h5ooh_ndx, bzooh_ndx, xylolooh_ndx, xylenooh_ndx + integer :: terp2ooh_ndx, terprod1_ndx, terprod2_ndx, hmprop_ndx, mboooh_ndx, hpald_ndx, iepox_ndx + integer :: noa_ndx, alknit_ndx, isopnita_ndx, isopnitb_ndx, honitr_ndx, isopnooh_ndx + integer :: nc4cho_ndx, nc4ch2oh_ndx, terpnit_ndx, nterpooh_ndx + logical :: phenooh_dd, benzooh_dd, c6h5ooh_dd, bzooh_dd, xylolooh_dd, xylenooh_dd + logical :: terp2ooh_dd, terprod1_dd, terprod2_dd, hmprop_dd, mboooh_dd, hpald_dd, iepox_dd + logical :: noa_dd, alknit_dd, isopnita_dd, isopnitb_dd, honitr_dd, isopnooh_dd + logical :: nc4cho_dd, nc4ch2oh_dd, terpnit_dd, nterpooh_dd + + integer :: cohc_ndx=-1, come_ndx=-1 + integer, parameter :: NTAGS = 50 + integer :: cotag_ndx(NTAGS) + integer :: tag_cnt + + integer :: & + o3_tab_ndx = -1, & + h2o2_tab_ndx = -1, & + ch3ooh_tab_ndx = -1, & + co_tab_ndx = -1, & + ch3cho_tab_ndx = -1 + logical :: & + o3_in_tab = .false., & + h2o2_in_tab = .false., & + ch3ooh_in_tab = .false., & + co_in_tab = .false., & + ch3cho_in_tab = .false. + + real(r8), parameter :: small_value = 1.e-36_r8 + real(r8), parameter :: large_value = 1.e36_r8 + real(r8), parameter :: diffm = 1.789e-5_r8 + real(r8), parameter :: diffk = 1.461e-5_r8 + real(r8), parameter :: difft = 2.060e-5_r8 + real(r8), parameter :: vonkar = karman + real(r8), parameter :: ric = 0.2_r8 + real(r8), parameter :: r = 287.04_r8 + real(r8), parameter :: cp = 1004._r8 + real(r8), parameter :: grav = 9.81_r8 + real(r8), parameter :: p00 = 100000._r8 + real(r8), parameter :: wh2o = 18.0153_r8 + real(r8), parameter :: ph = 1.e-5_r8 + real(r8), parameter :: ph_inv = 1._r8/ph + real(r8), parameter :: rovcp = r/cp + + integer, pointer :: index_season_lai(:,:) + + !logical, public :: has_dvel(gas_pcnst) = .false. + !integer :: map_dvel(gas_pcnst) = 0 + logical, public :: has_dvel(nTracersMax) = .false. + integer :: map_dvel(nTracersMax) = 0 + real(r8) , allocatable :: soilw_3d(:,:,:) + + logical, parameter :: dyn_soilw = .false. + + real(r8), allocatable :: fraction_landuse(:,:,:) + real(r8), allocatable, dimension(:,:,:) :: dep_ra ! [s/m] aerodynamic resistance + real(r8), allocatable, dimension(:,:,:) :: dep_rb ! [s/m] resistance across sublayer + integer, parameter :: n_land_type = 11 + + real(r8), public :: crb + + type lnd_dvel_type + real(r8), pointer :: dvel(:,:) ! deposition velocity over land (cm/s) + end type lnd_dvel_type + + type(lnd_dvel_type), allocatable :: lnd(:) + character(len=SHR_KIND_CL) :: drydep_srf_file + +contains + + !--------------------------------------------------------------------------- + !--------------------------------------------------------------------------- + subroutine dvel_inti_fromlnd + use cam_abortutils, only : endrun + use seq_drydep_mod, only : dfoxd + + implicit none + + allocate( lnd(begchunk:endchunk) ) + + crb = (difft/diffm)**(2._r8/3._r8) !.666666_r8 + + endsubroutine dvel_inti_fromlnd + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + subroutine drydep_update( state, cam_in ) + use physics_types, only : physics_state + use camsrfexch, only : cam_in_t + use seq_drydep_mod, only : drydep_method, DD_XLND + + type(physics_state), intent(in) :: state ! Physics state variables + type(cam_in_t), intent(in) :: cam_in + integer :: ispec + + if (nddvels<1) return + if (drydep_method /= DD_XLND) return + + lnd(state%lchnk)%dvel => cam_in%depvel + + end subroutine drydep_update + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + subroutine drydep_fromlnd( ocnfrac, icefrac, ncdate, sfc_temp, pressure_sfc, & + wind_speed, spec_hum, air_temp, pressure_10m, rain, & + snow, solar_flux, dvelocity, dflx, State_Chm, & + tv, soilw, rh, ncol, lonndx, latndx, lchnk ) + + !------------------------------------------------------------------------------------- + ! combines the deposition velocities provided by the land model with deposition + ! velocities over ocean and sea ice + !------------------------------------------------------------------------------------- + + use ppgrid, only : pcols + +#if (defined OFFLINE_DYN) + use metdata, only: get_met_fields +#endif + + implicit none + + !------------------------------------------------------------------------------------- + ! ... dummy arguments + !------------------------------------------------------------------------------------- + + real(r8), intent(in) :: icefrac(pcols) + real(r8), intent(in) :: ocnfrac(pcols) + + integer, intent(in) :: ncol + integer, intent(in) :: ncdate ! present date (yyyymmdd) + real(r8), intent(in) :: sfc_temp(pcols) ! surface temperature (K) + real(r8), intent(in) :: pressure_sfc(pcols) ! surface pressure (Pa) + real(r8), intent(in) :: wind_speed(pcols) ! 10 meter wind speed (m/s) + real(r8), intent(in) :: spec_hum(pcols) ! specific humidity (kg/kg) + real(r8), intent(in) :: rh(ncol,1) ! relative humidity + real(r8), intent(in) :: air_temp(pcols) ! surface air temperature (K) + real(r8), intent(in) :: pressure_10m(pcols) ! 10 meter pressure (Pa) + real(r8), intent(in) :: rain(pcols) + real(r8), intent(in) :: snow(pcols) ! snow height (m) + real(r8), intent(in) :: soilw(pcols) ! soil moisture fraction + real(r8), intent(in) :: solar_flux(pcols) ! direct shortwave radiation at surface (W/m^2) + real(r8), intent(in) :: tv(pcols) ! potential temperature + type(ChmState), intent(in):: State_Chm ! GEOS-Chem State Chem + real(r8), intent(out) :: dvelocity(ncol,nTracersMax) ! deposition velocity (cm/s) + real(r8), intent(inout) :: dflx(pcols,nTracersMax) ! deposition flux (/cm^2/s) + + integer, intent(in) :: latndx(pcols) ! chunk latitude indicies + integer, intent(in) :: lonndx(pcols) ! chunk longitude indicies + integer, intent(in) :: lchnk ! chunk number + + !------------------------------------------------------------------------------------- + ! ... local variables + !------------------------------------------------------------------------------------- + real(r8) :: ocnice_dvel(ncol,nTracersMax) + real(r8) :: ocnice_dflx(pcols,nTracersMax) + + real(r8), dimension(ncol) :: term ! work array + integer :: ispec + real(r8) :: lndfrac(pcols) +#if (defined OFFLINE_DYN) + real(r8) :: met_ocnfrac(pcols) + real(r8) :: met_icefrac(pcols) +#endif + integer :: i + + lndfrac(:ncol) = 1._r8 - ocnfrac(:ncol) - icefrac(:ncol) + + where( lndfrac(:ncol) < 0._r8 ) + lndfrac(:ncol) = 0._r8 + endwhere + +#if (defined OFFLINE_DYN) + call get_met_fields(lndfrac, met_ocnfrac, met_icefrac, lchnk, ncol) +#endif + + !------------------------------------------------------------------------------------- + ! ... initialize + !------------------------------------------------------------------------------------- + dvelocity(:,:) = 0._r8 + + !------------------------------------------------------------------------------------- + ! ... compute the dep velocities over ocean and sea ice + ! land type 7 is used for ocean + ! land type 8 is used for sea ice + !------------------------------------------------------------------------------------- + call drydep_xactive( ncdate, sfc_temp, pressure_sfc, & + wind_speed, spec_hum, air_temp, pressure_10m, rain, & + snow, solar_flux, ocnice_dvel, ocnice_dflx, & + State_Chm, tv, soilw, & + rh, ncol, lonndx, latndx, lchnk, & +#if (defined OFFLINE_DYN) + ocnfrc=met_ocnfrac,icefrc=met_icefrac, beglandtype=7, endlandtype=8 ) +#else + ocnfrc=ocnfrac,icefrc=icefrac, beglandtype=7, endlandtype=8 ) +#endif + term(:ncol) = 1.e-2_r8 * pressure_10m(:ncol) / (r*tv(:ncol)) + + do ispec = 1, nddvels + !------------------------------------------------------------------------------------- + ! ... merge the land component with the non-land component + ! ocn and ice already have fractions factored in + !------------------------------------------------------------------------------------- + if ( drySpc_ndx(ispec) > 0 ) then + !Write(6,*) " Spec = ", drydep_list(iSpec), lchnk + !Write(6,*) " lndfrac = ", MAXVAL(lndfrac(:)), lchnk + !Write(6,*) " lndfrac = ", MINVAL(lndfrac(:)), lchnk + !Write(6,*) " lndvel = ", MAXVAL(lnd(lchnk)%dvel(:,iSpec)), " [cm/s]", lchnk + !Write(6,*) " ocnvel = ", MAXVAL(ocnice_dvel(:,drySpc_ndx(iSpec))), " [cm/s]", lchnk + dvelocity(:ncol,drySpc_ndx(ispec)) = lnd(lchnk)%dvel(:ncol,ispec)*lndfrac(:ncol) & + + ocnice_dvel(:ncol,drySpc_ndx(ispec)) + !Write(6,*) " dvel = ", MAXVAL(dvelocity(:,drySpc_ndx(iSpec))), " [cm/s]", lchnk + endif + enddo + + !------------------------------------------------------------------------------------- + ! ... special adjustments + !------------------------------------------------------------------------------------- + if( mpan_ndx>0 ) then + dvelocity(:ncol,mpan_ndx) = dvelocity(:ncol,mpan_ndx)/3._r8 + endif + if( xmpan_ndx>0 ) then + dvelocity(:ncol,xmpan_ndx) = dvelocity(:ncol,xmpan_ndx)/3._r8 + endif + if( hcn_ndx>0 ) then + dvelocity(:ncol,hcn_ndx) = ocnice_dvel(:ncol,hcn_ndx) ! should be zero over land + endif + if( ch3cn_ndx>0 ) then + dvelocity(:ncol,ch3cn_ndx) = ocnice_dvel(:ncol,ch3cn_ndx) ! should be zero over land + endif + + ! HCOOH, use CH3COOH dep.vel + if( hcooh_ndx > 0 .and. ch3cooh_ndx > 0 ) then + if( has_dvel(hcooh_ndx) ) then + dvelocity(:ncol,hcooh_ndx) = dvelocity(:ncol,ch3cooh_ndx) + end if + end if + + !------------------------------------------------------------------------------------- + ! ... assign CO tags to CO + ! put this kludge in for now ... + ! -- should be able to set all these via the table mapping in seq_drydep_mod + !------------------------------------------------------------------------------------- + if( cohc_ndx>0 .and. co_ndx>0 ) then + dvelocity(:ncol,cohc_ndx) = dvelocity(:ncol,co_ndx) + dflx(:ncol,cohc_ndx) = dvelocity(:ncol,co_ndx) * term(:ncol) * State_Chm%Species(1,:ncol,plev,cohc_ndx) + endif + if( come_ndx>0 .and. co_ndx>0 ) then + dvelocity(:ncol,come_ndx) = dvelocity(:ncol,co_ndx) + dflx(:ncol,come_ndx) = dvelocity(:ncol,co_ndx) * term(:ncol) * State_Chm%Species(1,:ncol,plev,come_ndx) + endif + + if ( co_ndx>0 ) then + do i=1,tag_cnt + dvelocity(:ncol,cotag_ndx(i)) = dvelocity(:ncol,co_ndx) + dflx(:ncol,cotag_ndx(i)) = dvelocity(:ncol,co_ndx) * term(:ncol) * State_Chm%Species(1,:ncol,plev,cotag_ndx(i)) + enddo + endif + + do ispec = 1,nddvels + !------------------------------------------------------------------------------------- + ! ... compute the deposition flux + !------------------------------------------------------------------------------------- + if ( drySpc_ndx(ispec) > 0 ) then + dflx(:ncol,drySpc_ndx(ispec)) = dvelocity(:ncol,drySpc_ndx(ispec)) * term(:ncol) * State_Chm%Species(1,:ncol,plev,drySpc_ndx(ispec)) + endif + end do + + end subroutine drydep_fromlnd + + !--------------------------------------------------------------------------- + !--------------------------------------------------------------------------- + subroutine dvel_inti_table( depvel_file ) + !--------------------------------------------------------------------------- + ! ... Initialize module, depvel arrays, and a few other variables. + ! The depvel fields will be linearly interpolated to the correct time + !--------------------------------------------------------------------------- + + use mo_constants, only : d2r, r2d + use ioFileMod, only : getfil + use string_utils, only : to_lower, GLC + use mo_chem_utls, only : get_spc_ndx + use constituents, only : pcnst + use chem_mods, only : drySpc_ndx + use interpolate_data, only : lininterp_init, lininterp, lininterp_finish,interp_type + use mo_constants, only : pi + use phys_grid, only : get_ncols_p, get_rlat_all_p, get_rlon_all_p + + implicit none + + character(len=*), intent(in) :: depvel_file + + !--------------------------------------------------------------------------- + ! ... Local variables + !--------------------------------------------------------------------------- + integer :: nlat, nlon, nmonth, ndims + integer :: dimid_lat, dimid_lon, dimid_species, dimid_time + integer :: dimid(4), count(4), start(4) + integer :: m, ispecies, nchar, ierr + real(r8) :: scale_factor + + real(r8), allocatable :: dvel_lats(:), dvel_lons(:) + real(r8), allocatable :: dvel_in(:,:,:,:) ! input depvel array + character(len=50) :: units + character(len=20), allocatable :: species_names(:) ! names of depvel species + logical :: found + type(file_desc_t) :: piofile + type(var_desc_t) :: vid, vid_dvel + + character(len=shr_kind_cl) :: locfn + integer :: mm,n + + integer :: i, c, ncols + real(r8) :: to_lats(pcols), to_lons(pcols) + type(interp_type) :: lon_wgts, lat_wgts + real(r8), parameter :: zero=0._r8, twopi=2._r8*pi + + mm = 1 + do m = 1,pcnst + if ( len_trim(drydep_list(m))==0 ) exit + n = drySpc_ndx(m) + !n = get_spc_ndx(drydep_list(m)) + if ( n < 1 ) then + write(iulog,*) 'drydep_inti: '//drydep_list(m)//' is not included in species set' + call endrun('drydep_init: invalid dry deposition species') + endif + enddo + + if( masterproc ) then + write(iulog,*) 'drydep_inti: following species have dry deposition' + do i=1,nddvels + if( len_trim(drydep_list(i)) > 0 ) then + write(iulog,*) 'drydep_inti: '//trim(drydep_list(i))//' is requested to have dry dep' + endif + enddo + write(iulog,*) 'drydep_inti:' + endif + + if ( nddvels < 1 ) return + + !--------------------------------------------------------------------------- + ! ... Setup species maps + !--------------------------------------------------------------------------- + o3a_ndx = get_spc_ndx( 'O3A') + xpan_ndx = get_spc_ndx( 'XPAN') + xmpan_ndx = get_spc_ndx( 'XMPAN') + xno2_ndx = get_spc_ndx( 'XNO2') + xhno3_ndx = get_spc_ndx( 'XHNO3') + xonit_ndx = get_spc_ndx( 'XONIT') + xonitr_ndx = get_spc_ndx( 'XONITR') + xno_ndx = get_spc_ndx( 'XNO') + xho2no2_ndx = get_spc_ndx( 'XHO2NO2') + o3a_dd = has_drydep( 'O3A') + xpan_dd = has_drydep( 'XPAN') + xmpan_dd = has_drydep( 'XMPAN') + xno2_dd = has_drydep( 'XNO2') + xhno3_dd = has_drydep( 'XHNO3') + xonit_dd = has_drydep( 'XONIT') + xonitr_dd = has_drydep( 'XONITR') + xno_dd = has_drydep( 'XNO') + xho2no2_dd = has_drydep( 'XHO2NO2') + + pan_ndx = get_spc_ndx( 'PAN') + mpan_ndx = get_spc_ndx( 'MPAN') + no2_ndx = get_spc_ndx( 'NO2') + hno3_ndx = get_spc_ndx( 'HNO3') + co_ndx = get_spc_ndx( 'CO') + o3_ndx = get_spc_ndx( 'O3') + if( o3_ndx < 1 ) then + o3_ndx = get_spc_ndx( 'OX') + end if + h2o2_ndx = get_spc_ndx( 'H2O2') + onit_ndx = get_spc_ndx( 'ONIT') + onitr_ndx = get_spc_ndx( 'ONITR') + ch4_ndx = get_spc_ndx( 'CH4') + ch2o_ndx = get_spc_ndx( 'CH2O') + ch3ooh_ndx = get_spc_ndx( 'CH3OOH') + ch3cho_ndx = get_spc_ndx( 'CH3CHO') + ch3cocho_ndx = get_spc_ndx( 'CH3COCHO') + pooh_ndx = get_spc_ndx( 'POOH') + ch3coooh_ndx = get_spc_ndx( 'CH3COOOH') + c2h5ooh_ndx = get_spc_ndx( 'C2H5OOH') + eooh_ndx = get_spc_ndx( 'EOOH') + c3h7ooh_ndx = get_spc_ndx( 'C3H7OOH') + rooh_ndx = get_spc_ndx( 'ROOH') + ch3coch3_ndx = get_spc_ndx( 'CH3COCH3') + no_ndx = get_spc_ndx( 'NO') + ho2no2_ndx = get_spc_ndx( 'HO2NO2') + glyald_ndx = get_spc_ndx( 'GLYALD') + hyac_ndx = get_spc_ndx( 'HYAC') + ch3oh_ndx = get_spc_ndx( 'CH3OH') + c2h5oh_ndx = get_spc_ndx( 'C2H5OH') + macrooh_ndx = get_spc_ndx( 'MACROOH') + isopooh_ndx = get_spc_ndx( 'ISOPOOH') + xooh_ndx = get_spc_ndx( 'XOOH') + hydrald_ndx = get_spc_ndx( 'HYDRALD') + h2_ndx = get_spc_ndx( 'H2') + Pb_ndx = get_spc_ndx( 'Pb') + o3s_ndx = get_spc_ndx( 'O3S') + o3inert_ndx = get_spc_ndx( 'O3INERT') + alkooh_ndx = get_spc_ndx( 'ALKOOH') + mekooh_ndx = get_spc_ndx( 'MEKOOH') + tolooh_ndx = get_spc_ndx( 'TOLOOH') + terpooh_ndx = get_spc_ndx( 'TERPOOH') + ch3cooh_ndx = get_spc_ndx( 'CH3COOH') + soam_ndx = get_spc_ndx( 'SOAM' ) + soai_ndx = get_spc_ndx( 'SOAI' ) + soat_ndx = get_spc_ndx( 'SOAT' ) + soab_ndx = get_spc_ndx( 'SOAB' ) + soax_ndx = get_spc_ndx( 'SOAX' ) + sogm_ndx = get_spc_ndx( 'SOGM' ) + sogi_ndx = get_spc_ndx( 'SOGI' ) + sogt_ndx = get_spc_ndx( 'SOGT' ) + sogb_ndx = get_spc_ndx( 'SOGB' ) + sogx_ndx = get_spc_ndx( 'SOGX' ) + soa_ndx = get_spc_ndx( 'SOA' ) + so4_ndx = get_spc_ndx( 'SO4' ) + cb1_ndx = get_spc_ndx( 'CB1' ) + cb2_ndx = get_spc_ndx( 'CB2' ) + oc1_ndx = get_spc_ndx( 'OC1' ) + oc2_ndx = get_spc_ndx( 'OC2' ) + nh3_ndx = get_spc_ndx( 'NH3' ) + nh4no3_ndx = get_spc_ndx( 'NH4NO3' ) + xnh4no3_ndx = get_spc_ndx( 'XNH4NO3' ) + sa1_ndx = get_spc_ndx( 'SA1' ) + sa2_ndx = get_spc_ndx( 'SA2' ) + sa3_ndx = get_spc_ndx( 'SA3' ) + sa4_ndx = get_spc_ndx( 'SA4' ) + nh4_ndx = get_spc_ndx( 'NH4' ) + alkooh_dd = has_drydep( 'ALKOOH') + mekooh_dd = has_drydep( 'MEKOOH') + tolooh_dd = has_drydep( 'TOLOOH') + terpooh_dd = has_drydep( 'TERPOOH') + ch3cooh_dd = has_drydep( 'CH3COOH') + soam_dd = has_drydep( 'SOAM' ) + soai_dd = has_drydep( 'SOAI' ) + soat_dd = has_drydep( 'SOAT' ) + soab_dd = has_drydep( 'SOAB' ) + soax_dd = has_drydep( 'SOAX' ) + sogm_dd = has_drydep( 'SOGM' ) + sogi_dd = has_drydep( 'SOGI' ) + sogt_dd = has_drydep( 'SOGT' ) + sogb_dd = has_drydep( 'SOGB' ) + sogx_dd = has_drydep( 'SOGX' ) + soa_dd = has_drydep( 'SOA' ) + so4_dd = has_drydep( 'SO4' ) + cb1_dd = has_drydep( 'CB1' ) + cb2_dd = has_drydep( 'CB2' ) + oc1_dd = has_drydep( 'OC1' ) + oc2_dd = has_drydep( 'OC2' ) + nh3_dd = has_drydep( 'NH3' ) + nh4no3_dd = has_drydep( 'NH4NO3' ) + xnh4no3_dd = has_drydep( 'XNH4NO3' ) + sa1_dd = has_drydep( 'SA1' ) + sa2_dd = has_drydep( 'SA2' ) + sa3_dd = has_drydep( 'SA3' ) + sa4_dd = has_drydep( 'SA4' ) + nh4_dd = has_drydep( 'NH4' ) + pan_dd = has_drydep( 'PAN') + mpan_dd = has_drydep( 'MPAN') + no2_dd = has_drydep( 'NO2') + hno3_dd = has_drydep( 'HNO3') + co_dd = has_drydep( 'CO') + o3_dd = has_drydep( 'O3') + if( .not. o3_dd ) then + o3_dd = has_drydep( 'OX') + end if + h2o2_dd = has_drydep( 'H2O2') + onit_dd = has_drydep( 'ONIT') + onitr_dd = has_drydep( 'ONITR') + ch4_dd = has_drydep( 'CH4') + ch2o_dd = has_drydep( 'CH2O') + ch3ooh_dd = has_drydep( 'CH3OOH') + ch3cho_dd = has_drydep( 'CH3CHO') + c2h5oh_dd = has_drydep( 'C2H5OH') + eooh_dd = has_drydep( 'EOOH') + ch3cocho_dd = has_drydep( 'CH3COCHO') + pooh_dd = has_drydep( 'POOH') + ch3coooh_dd = has_drydep( 'CH3COOOH') + c2h5ooh_dd = has_drydep( 'C2H5OOH') + c3h7ooh_dd = has_drydep( 'C3H7OOH') + rooh_dd = has_drydep( 'ROOH') + ch3coch3_dd = has_drydep( 'CH3COCH3') + glyald_dd = has_drydep( 'GLYALD') + hyac_dd = has_drydep( 'HYAC') + ch3oh_dd = has_drydep( 'CH3OH') + macrooh_dd = has_drydep( 'MACROOH') + isopooh_dd = has_drydep( 'ISOPOOH') + xooh_dd = has_drydep( 'XOOH') + hydrald_dd = has_drydep( 'HYDRALD') + h2_dd = has_drydep( 'H2') + Pb_dd = has_drydep( 'Pb') + o3s_dd = has_drydep( 'O3S') + o3inert_dd = has_drydep( 'O3INERT') + ch3cn_dd = has_drydep( 'CH3CN') + hcn_dd = has_drydep( 'HCN') + hcooh_dd = has_drydep( 'HCOOH') + ch3cn_ndx = get_spc_ndx( 'CH3CN') + hcn_ndx = get_spc_ndx( 'HCN') + hcooh_ndx = get_spc_ndx( 'HCOOH' ) + + if( masterproc ) then + write(iulog,*) 'dvel_inti: diagnostics' + write(iulog,'(10i5)') pan_ndx, mpan_ndx, no2_ndx, hno3_ndx, o3_ndx, & + h2o2_ndx, onit_ndx, onitr_ndx, ch4_ndx, ch2o_ndx, & + ch3ooh_ndx, pooh_ndx, ch3coooh_ndx, c2h5ooh_ndx, eooh_ndx, & + c3h7ooh_ndx, rooh_ndx, ch3cocho_ndx, co_ndx, ch3coch3_ndx, & + no_ndx, ho2no2_ndx, glyald_ndx, hyac_ndx, ch3oh_ndx, c2h5oh_ndx, & + hydrald_ndx, h2_ndx, Pb_ndx, o3s_ndx, o3inert_ndx, macrooh_ndx, & + xooh_ndx, ch3cho_ndx, isopooh_ndx, noa_ndx, alknit_ndx, isopnita_ndx, & + honitr_ndx, isopnooh_ndx, nc4cho_ndx, nc4ch2oh_ndx, terpnit_ndx, nterpooh_ndx + write(iulog,*) pan_dd, mpan_dd, no2_dd, hno3_dd, o3_dd, isopooh_dd, ch4_dd,& + h2o2_dd, onit_dd, onitr_dd, ch2o_dd, macrooh_dd, xooh_dd, & + ch3ooh_dd, pooh_dd, ch3coooh_dd, c2h5ooh_dd, eooh_dd, ch3cho_dd, c2h5oh_dd, & + c3h7ooh_dd, rooh_dd, ch3cocho_dd, co_dd, ch3coch3_dd, & + glyald_dd, hyac_dd, ch3oh_dd, hydrald_dd, h2_dd, Pb_dd, o3s_dd, o3inert_dd, & + noa_dd, alknit_dd, isopnita_dd, & + honitr_dd, isopnooh_dd, nc4cho_dd, nc4ch2oh_dd, terpnit_dd, nterpooh_dd + endif + !--------------------------------------------------------------------------- + ! ... Open NetCDF file + !--------------------------------------------------------------------------- + call getfil (depvel_file, locfn, 0) + call cam_pio_openfile (piofile, trim(locfn), PIO_NOWRITE) + + !--------------------------------------------------------------------------- + ! ... Get variable ID for dep vel array + !--------------------------------------------------------------------------- + ierr = pio_inq_varid( piofile, 'dvel', vid_dvel ) + + !--------------------------------------------------------------------------- + ! ... Inquire about dimensions + !--------------------------------------------------------------------------- + ierr = pio_inq_dimid( piofile, 'lon', dimid_lon ) + ierr = pio_inq_dimlen( piofile, dimid_lon, nlon ) + ierr = pio_inq_dimid( piofile, 'lat', dimid_lat ) + ierr = pio_inq_dimlen( piofile, dimid_lat, nlat ) + ierr = pio_inq_dimid( piofile, 'species', dimid_species ) + ierr = pio_inq_dimlen( piofile, dimid_species, nspecies ) + ierr = pio_inq_dimid( piofile, 'time', dimid_time ) + ierr = pio_inq_dimlen( piofile, dimid_time, nmonth ) + if(masterproc) write(iulog,*) 'dvel_inti: dimensions (nlon,nlat,nspecies,nmonth) = ',nlon,nlat,nspecies,nmonth + + !--------------------------------------------------------------------------- + ! ... Check dimensions of dvel variable. Must be (lon, lat, species, month). + !--------------------------------------------------------------------------- + ierr = pio_inq_varndims( piofile, vid_dvel, ndims ) + + if( masterproc .and. ndims /= 4 ) then + write(iulog,*) 'dvel_inti: dvel has ',ndims,' dimensions. Expecting 4.' + call endrun + end if + ierr = pio_inq_vardimid( piofile, vid_dvel, dimid ) + + if( dimid(1) /= dimid_lon .or. dimid(2) /= dimid_lat .or. & + dimid(3) /= dimid_species .or. dimid(4) /= dimid_time ) then + write(iulog,*) 'dvel_inti: Dimensions in wrong order for dvel' + write(iulog,*) '... Expecting (lon, lat, species, month)' + call endrun + end if + + !--------------------------------------------------------------------------- + ! ... Allocate depvel lats, lons and read + !--------------------------------------------------------------------------- + allocate( dvel_lats(nlat), stat=ierr ) + if( ierr /= 0 ) then + write(iulog,*) 'dvel_inti: Failed to allocate dvel_lats vector' + call endrun + end if + allocate( dvel_lons(nlon), stat=ierr ) + if( ierr /= 0 ) then + write(iulog,*) 'dvel_inti: Failed to allocate dvel_lons vector' + call endrun + end if + + ierr = pio_inq_varid( piofile, 'lat', vid ) + ierr = pio_get_var( piofile, vid, dvel_lats ) + ierr = pio_inq_varid( piofile, 'lon', vid ) + ierr = pio_get_var( piofile, vid, dvel_lons ) + + !--------------------------------------------------------------------------- + ! ... Set the transform from inputs lats to simulation lats + !--------------------------------------------------------------------------- + dvel_lats(:nlat) = d2r * dvel_lats(:nlat) + dvel_lons(:nlon) = d2r * dvel_lons(:nlon) + + !--------------------------------------------------------------------------- + ! ... Allocate dvel and read data from file + !--------------------------------------------------------------------------- + allocate( dvel_in(nlon, nlat ,nspecies, nmonth), stat=ierr ) + if( ierr /= 0 ) then + write(iulog,*) 'dvel_inti: Failed to allocate dvel_in' + call endrun + end if + start = (/ 1, 1, 1, 1 /) + count = (/ nlon, nlat, nspecies, nmonth /) + + ierr = pio_get_var( piofile, vid_dvel, start, count, dvel_in ) + + + !--------------------------------------------------------------------------- + ! ... Check units of deposition velocity. If necessary, convert to cm/s. + !--------------------------------------------------------------------------- + units(:) = ' ' + ierr = pio_get_att( piofile, vid_dvel, 'units', units ) + if( to_lower(trim(units(:GLC(units)))) == 'm/s' ) then +#ifdef DEBUG + if(masterproc) write(iulog,*) 'dvel_inti: depvel units = m/s. Converting to cm/s' +#endif + scale_factor = 100._r8 + elseif( to_lower(trim(units(:GLC(units)))) == 'cm/s' ) then +#ifdef DEBUG + if(masterproc) write(iulog,*) 'dvel_inti: depvel units = cm/s' +#endif + scale_factor = 1._r8 + else +#ifdef DEBUG + if(masterproc) then + write(iulog,*) 'dvel_inti: Warning! depvel units unknown = ', to_lower(trim(units)) + write(iulog,*) ' ... proceeding with scale_factor=1' + end if +#endif + scale_factor = 1._r8 + end if + + dvel_in(:,:,:,:) = scale_factor*dvel_in(:,:,:,:) + + !--------------------------------------------------------------------------- + ! ... Regrid deposition velocities + !--------------------------------------------------------------------------- + allocate( dvel(pcols,begchunk:endchunk,nspecies,nmonth),stat=ierr ) + if( ierr /= 0 ) then + write(iulog,*) 'dvel_inti: Failed to allocate dvel' + call endrun + end if + + do c=begchunk,endchunk + ncols = get_ncols_p(c) + call get_rlat_all_p(c, pcols, to_lats) + call get_rlon_all_p(c, pcols, to_lons) + call lininterp_init(dvel_lons, nlon, to_lons, ncols, 2, lon_wgts, zero, twopi) + call lininterp_init(dvel_lats, nlat, to_lats, ncols, 1, lat_wgts) + + do ispecies = 1,nspecies + do m = 1,12 + call lininterp( dvel_in( :,:,ispecies,m ), nlon, nlat, dvel(:,c,ispecies,m), ncols,lon_wgts,lat_wgts) + end do + end do + + call lininterp_finish(lat_wgts) + call lininterp_finish(lon_wgts) + end do + + deallocate( dvel_in ) + deallocate( dvel_lats, dvel_lons ) + + !--------------------------------------------------------------------------- + ! ... Read in species names and determine mapping to tracer numbers + !--------------------------------------------------------------------------- + allocate( species_names(nspecies), stat=ierr ) + if( ierr /= 0 ) then + write(iulog,*) 'dvel_inti: species_names allocation error = ',ierr + call endrun + end if + ierr = pio_inq_varid( piofile, 'species_name', vid ) + ierr = pio_inq_varndims( piofile, vid, ndims ) + + ierr = pio_inq_vardimid( piofile, vid, dimid ) + + ierr = pio_inq_dimlen( piofile, dimid(1), nchar ) + map(:) = 0 + do ispecies = 1,nspecies + start(:2) = (/ 1, ispecies /) + count(:2) = (/ nchar, 1 /) + species_names(ispecies)(:) = ' ' + ierr = pio_get_var( piofile, vid, start(1:2), count(1:2), species_names(ispecies:ispecies) ) + if( species_names(ispecies) == 'O3' ) then + o3_in_tab = .true. + o3_tab_ndx = ispecies + else if( species_names(ispecies) == 'H2O2' ) then + h2o2_in_tab = .true. + h2o2_tab_ndx = ispecies + else if( species_names(ispecies) == 'CH3OOH' ) then + ch3ooh_in_tab = .true. + ch3ooh_tab_ndx = ispecies + else if( species_names(ispecies) == 'CO' ) then + co_in_tab = .true. + co_tab_ndx = ispecies + else if( species_names(ispecies) == 'CH3CHO' ) then + ch3cho_in_tab = .true. + ch3cho_tab_ndx = ispecies + end if + found = .false. + do m = 1, nTracers + if( species_names(ispecies) == tracerNames(m) .or. & + (species_names(ispecies) == 'O3' .and. tracerNames(m) == 'OX') .or. & + (species_names(ispecies) == 'HNO4' .and. tracerNames(m) == 'HO2NO2') ) then + if ( has_drydep( tracerNames(m) ) ) then + map(m) = ispecies + found = .true. +#ifdef DEBUG + if( masterproc ) then + write(iulog,*) 'dvel_inti: ispecies, m, tracnam = ',ispecies,m,trim(tracerNames(m)) + end if +#endif + exit + end if + end if + end do + if( .not. found ) then + write(iulog,*) 'dvel_inti: Warning! DVEL species ',trim(species_names(ispecies)),' not found' + endif + end do + deallocate( species_names ) + + call cam_pio_closefile( piofile ) + + !--------------------------------------------------------------------------- + ! ... Allocate dvel_interp array + !--------------------------------------------------------------------------- + allocate( dvel_interp(pcols,begchunk:endchunk,nspecies),stat=ierr ) + if( ierr /= 0 ) then + write(iulog,*) 'dvel_inti: Failed to allocate dvel_interp; error = ',ierr + call endrun + end if + + end subroutine dvel_inti_table + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + subroutine interpdvel( calday, ncol, lchnk ) + !--------------------------------------------------------------------------- + ! ... Interpolate the fields whose values are required at the + ! begining of a timestep. + !--------------------------------------------------------------------------- + + use time_manager, only : get_calday + + implicit none + + !--------------------------------------------------------------------------- + ! ... Dummy arguments + !--------------------------------------------------------------------------- + real(r8), intent(in) :: calday ! Interpolate the input data to calday + integer, intent(in) :: ncol, lchnk + + !--------------------------------------------------------------------------- + ! ... Local variables + !--------------------------------------------------------------------------- + integer :: m, last, next + integer :: dates(12) = (/ 116, 214, 316, 415, 516, 615, & + 716, 816, 915, 1016, 1115, 1216 /) + real(r8) :: calday_loc, last_days, next_days + real(r8), save :: dys(12) + logical, save :: entered = .false. + + if( .not. entered ) then + do m = 1,12 + dys(m) = get_calday( dates(m), 0 ) + end do + entered = .true. + end if + + if( calday < dys(1) ) then + next = 1 + last = 12 + else if( calday >= dys(12) ) then + next = 1 + last = 12 + else + do m = 11,1,-1 + if( calday >= dys(m) ) then + exit + end if + end do + last = m + next = m + 1 + end if + + last_days = dys( last ) + next_days = dys( next ) + calday_loc = calday + + if( next_days < last_days ) then + next_days = next_days + 365._r8 + end if + if( calday_loc < last_days ) then + calday_loc = calday_loc + 365._r8 + end if + + do m = 1,nspecies + call intp2d( last_days, next_days, calday_loc, ncol, lchnk, & + dvel(:,lchnk,m,last), & + dvel(:,lchnk,m,next), & + dvel_interp(:,lchnk,m) ) + end do + + end subroutine interpdvel + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + subroutine intp2d( t1, t2, tint, ncol, lchnk, f1, f2, fint ) + !----------------------------------------------------------------------- + ! ... Linearly interpolate between f1(t1) and f2(t2) to fint(tint). + !----------------------------------------------------------------------- + + implicit none + + !----------------------------------------------------------------------- + ! ... Dummy arguments + !----------------------------------------------------------------------- + real(r8), intent(in) :: & + t1, & ! time level of f1 + t2, & ! time level of f2 + tint ! interpolant time + real(r8), dimension(pcols), intent(in) :: & + f1, & ! field at time t1 + f2 ! field at time t2 + + integer, intent(in) :: ncol, lchnk + + real(r8), intent(out) :: & + fint(pcols) ! field at time tint + + + !----------------------------------------------------------------------- + ! ... Local variables + !----------------------------------------------------------------------- + real(r8) :: factor + + factor = (tint - t1)/(t2 - t1) + + fint(:ncol) = f1(:ncol) + (f2(:ncol) - f1(:ncol))*factor + + end subroutine intp2d + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + !subroutine drydep_table( calday, tsurf, zen_angle, & + ! depvel, dflx, q, p, & + ! tv, ncol, icefrac, ocnfrac, lchnk ) + ! !-------------------------------------------------------- + ! ! ... Form the deposition velocities for this + ! ! latitude slice + ! !-------------------------------------------------------- + + ! use physconst, only : rair,pi + ! use dycore, only : dycore_is + + ! implicit none + + ! !-------------------------------------------------------- + ! ! ... Dummy arguments + ! !-------------------------------------------------------- + ! integer, intent(in) :: ncol ! columns in chunk + ! real(r8), intent(in) :: q(pcols,plev,gas_pcnst) ! tracer mmr (kg/kg) + ! real(r8), intent(in) :: p(pcols) ! midpoint pressure in surface layer (Pa) + ! real(r8), intent(in) :: tv(pcols) ! virtual temperature in surface layer (K) + ! real(r8), intent(in) :: calday ! time of year in days + ! real(r8), intent(in) :: tsurf(pcols) ! surface temperature (K) + ! real(r8), intent(in) :: zen_angle(ncol) ! zenith angle (radians) + ! real(r8), intent(inout) :: dflx(pcols,gas_pcnst) ! flux due to dry deposition (kg/m^2/sec) + ! real(r8), intent(out) :: depvel(ncol,gas_pcnst) ! deposition vel (cm/s) + + ! real(r8), intent(in) :: icefrac(pcols) ! sea-ice areal fraction + ! real(r8), intent(in) :: ocnfrac(pcols) ! ocean areal fraction + ! + ! integer, intent(in) :: lchnk + ! !----------------------------------------------------------------------- + ! ! ... Local variables + ! !----------------------------------------------------------------------- + ! integer :: m, i + ! real(r8), dimension(ncol) :: vel, glace, temp_fac, wrk, tmp + ! real(r8), dimension(ncol) :: o3_tab_dvel + ! real(r8), dimension(ncol) :: ocean + + ! real(r8), parameter :: pid2 = .5_r8 * pi + + ! if(dycore_is('UNSTRUCTURED')) then + ! call endrun( 'Option not supported for unstructured atmosphere grids ') + ! end if + + ! !----------------------------------------------------------------------- + ! ! ... Note the factor 1.e-2 in the wrk array calculation is + ! ! to transform the incoming dep vel from cm/s to m/s + ! !----------------------------------------------------------------------- + ! wrk(:ncol) = 1.e-2_r8 * p(:ncol) / (rair * tv(:ncol)) + + ! !-------------------------------------------------------- + ! ! ... Initialize all deposition velocities to zero + ! !-------------------------------------------------------- + ! depvel(:,:) = 0._r8 + + ! !-------------------------------------------------------- + ! ! ... Time interpolate primary depvel array + ! ! (also seaice and npp) + ! !-------------------------------------------------------- + ! call interpdvel( calday, ncol, lchnk ) + + ! if( o3_in_tab ) then + ! do i=1,ncol + ! o3_tab_dvel(i) = dvel_interp(i,lchnk,o3_tab_ndx) + ! enddo + ! end if + + ! !-------------------------------------------------------- + ! ! ... Set deposition velocities + ! !-------------------------------------------------------- + ! do m = 1,gas_pcnst + ! if( map(m) /= 0 ) then + ! do i = 1,ncol + ! depvel(i,m) = dvel_interp(i,lchnk,map(m)) + ! dflx(i,m) = wrk(i) * depvel(i,m) * q(i,plev,m) + ! enddo + ! end if + ! end do + + ! !-------------------------------------------------------- + ! ! ... Set some variables needed for some dvel calculations + ! !-------------------------------------------------------- + ! temp_fac(:ncol) = min( 1._r8, max( 0._r8, (tsurf(:ncol) - 268._r8) / 5._r8 ) ) + ! ocean(:ncol) = icefrac(:ncol)+ocnfrac(:ncol) + ! glace(:ncol) = icefrac(:ncol) + (1._r8 - ocean(:ncol)) * (1._r8 - temp_fac(:ncol)) + ! glace(:ncol) = min( 1._r8,glace(:ncol) ) + + ! !-------------------------------------------------------- + ! ! ... Set pan & mpan + ! !-------------------------------------------------------- + ! if( o3_in_tab ) then + ! tmp(:ncol) = o3_tab_dvel(:ncol) / 3._r8 + ! else + ! tmp(:) = 0._r8 + ! end if + ! if( pan_dd ) then + ! if( map(pan_ndx) == 0 ) then + ! depvel(:ncol,pan_ndx) = tmp(:ncol) + ! dflx(:ncol,pan_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,pan_ndx) + ! end if + ! end if + ! if( mpan_dd ) then + ! if( map(mpan_ndx) == 0 ) then + ! depvel(:ncol,mpan_ndx) = tmp(:ncol) + ! dflx(:ncol,mpan_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,mpan_ndx) + ! end if + ! end if + + ! !-------------------------------------------------------- + ! ! ... Set no2 dvel + ! !-------------------------------------------------------- + ! if( no2_dd ) then + ! if( map(no2_ndx) == 0 .and. o3_in_tab ) then + ! depvel(:ncol,no2_ndx) = (.6_r8*o3_tab_dvel(:ncol) + .055_r8*ocean(:ncol)) * .9_r8 + ! dflx(:ncol,no2_ndx) = wrk(:) * depvel(:ncol,no2_ndx) * q(:ncol,plev,no2_ndx) + ! end if + ! end if + + ! !-------------------------------------------------------- + ! ! ... Set hno3 dvel + ! !-------------------------------------------------------- + ! tmp(:ncol) = (2._r8 - ocnfrac(:ncol)) * (1._r8 - glace(:ncol)) + .05_r8 * glace(:ncol) + ! if( hno3_dd ) then + ! if( map(hno3_ndx) == 0 ) then + ! depvel(:ncol,hno3_ndx) = tmp(:ncol) + ! dflx(:ncol,hno3_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,hno3_ndx) + ! else + ! tmp(:ncol) = depvel(:ncol,hno3_ndx) + ! end if + ! end if + ! if( onitr_dd ) then + ! if( map(onitr_ndx) == 0 ) then + ! depvel(:ncol,onitr_ndx) = tmp(:ncol) + ! dflx(:ncol,onitr_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,onitr_ndx) + ! end if + ! end if + ! if( isopooh_dd ) then + ! if( map(isopooh_ndx) == 0 ) then + ! depvel(:ncol,isopooh_ndx) = tmp(:ncol) + ! dflx(:ncol,isopooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,isopooh_ndx) + ! end if + ! end if + + ! !-------------------------------------------------------- + ! ! ... Set h2o2 dvel + ! !-------------------------------------------------------- + ! if( .not. h2o2_in_tab ) then + ! if( o3_in_tab ) then + ! tmp(:ncol) = .05_r8*glace(:ncol) + ocean(:ncol) - icefrac(:ncol) & + ! + (1._r8 - (glace(:) + ocean(:ncol)) + icefrac(:ncol)) & + ! *max( 1._r8,1._r8/(.5_r8 + 1._r8/(6._r8*o3_tab_dvel(:ncol))) ) + ! else + ! tmp(:ncol) = 0._r8 + ! end if + ! else + ! do i=1,ncol + ! tmp(i) = dvel_interp(i,lchnk,h2o2_tab_ndx) + ! enddo + ! end if + ! if( h2o2_dd ) then + ! if( map(h2o2_ndx) == 0 ) then + ! depvel(:ncol,h2o2_ndx) = tmp(:ncol) + ! dflx(:ncol,h2o2_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,h2o2_ndx) + ! end if + ! end if + ! !-------------------------------------------------------- + ! ! ... Set hcn dvel + ! !-------------------------------------------------------- + ! if( hcn_dd ) then + ! if( map(hcn_ndx) == 0 ) then + ! depvel(:ncol,hcn_ndx) = ocnfrac(:ncol)*0.2_r8 + ! endif + ! endif + ! !-------------------------------------------------------- + ! ! ... Set ch3cn dvel + ! !-------------------------------------------------------- + ! if( ch3cn_dd ) then + ! if( map(ch3cn_ndx) == 0 ) then + ! depvel(:,ch3cn_ndx) = ocnfrac(:ncol)*0.2_r8 + ! endif + ! endif + ! !-------------------------------------------------------- + ! ! ... Set onit + ! !-------------------------------------------------------- + ! if( onit_dd ) then + ! if( map(onit_ndx) == 0 ) then + ! depvel(:ncol,onit_ndx) = tmp(:ncol) + ! dflx(:ncol,onit_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,onit_ndx) + ! end if + ! end if + ! if( ch3cocho_dd ) then + ! if( map(ch3cocho_ndx) == 0 ) then + ! depvel(:ncol,ch3cocho_ndx) = tmp(:ncol) + ! dflx(:ncol,ch3cocho_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch3cocho_ndx) + ! end if + ! end if + ! if( ch3ooh_in_tab ) then + ! do i=1,ncol + ! tmp(i) = dvel_interp(i,lchnk,ch3ooh_tab_ndx) + ! enddo + ! else + ! tmp(:ncol) = .5_r8 * tmp(:ncol) + ! end if + ! if( ch3ooh_dd ) then + ! if( map(ch3ooh_ndx) == 0 ) then + ! depvel(:ncol,ch3ooh_ndx) = tmp(:ncol) + ! dflx(:ncol,ch3ooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch3ooh_ndx) + ! end if + ! end if + ! if( pooh_dd ) then + ! if( map(pooh_ndx) == 0 ) then + ! depvel(:ncol,pooh_ndx) = tmp(:ncol) + ! dflx(:ncol,pooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,pooh_ndx) + ! end if + ! end if + ! if( ch3coooh_dd ) then + ! if( map(ch3coooh_ndx) == 0 ) then + ! depvel(:ncol,ch3coooh_ndx) = tmp(:ncol) + ! dflx(:ncol,ch3coooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch3coooh_ndx) + ! end if + ! end if + ! if( c2h5ooh_dd ) then + ! if( map(c2h5ooh_ndx) == 0 ) then + ! depvel(:ncol,c2h5ooh_ndx) = tmp(:ncol) + ! dflx(:ncol,c2h5ooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,c2h5ooh_ndx) + ! end if + ! end if + ! if( c3h7ooh_dd ) then + ! if( map(c3h7ooh_ndx) == 0 ) then + ! depvel(:ncol,c3h7ooh_ndx) = tmp(:ncol) + ! dflx(:ncol,c3h7ooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,c3h7ooh_ndx) + ! end if + ! end if + ! if( rooh_dd ) then + ! if( map(rooh_ndx) == 0 ) then + ! depvel(:ncol,rooh_ndx) = tmp(:ncol) + ! dflx(:ncol,rooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,rooh_ndx) + ! end if + ! end if + ! if( macrooh_dd ) then + ! if( map(macrooh_ndx) == 0 ) then + ! depvel(:ncol,macrooh_ndx) = tmp(:ncol) + ! dflx(:ncol,macrooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,macrooh_ndx) + ! end if + ! end if + ! if( xooh_dd ) then + ! if( map(xooh_ndx) == 0 ) then + ! depvel(:ncol,xooh_ndx) = tmp(:ncol) + ! dflx(:ncol,xooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,xooh_ndx) + ! end if + ! end if + ! if( ch3oh_dd ) then + ! if( map(ch3oh_ndx) == 0 ) then + ! depvel(:ncol,ch3oh_ndx) = tmp(:ncol) + ! dflx(:ncol,ch3oh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch3oh_ndx) + ! end if + ! end if + ! if( c2h5oh_dd ) then + ! if( map(c2h5oh_ndx) == 0 ) then + ! depvel(:ncol,c2h5oh_ndx) = tmp(:ncol) + ! dflx(:ncol,c2h5oh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,c2h5oh_ndx) + ! end if + ! end if + ! if( alkooh_dd ) then + ! if( map(alkooh_ndx) == 0 ) then + ! depvel(:ncol,alkooh_ndx) = tmp(:ncol) + ! dflx(:ncol,alkooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,alkooh_ndx) + ! end if + ! end if + ! if( mekooh_dd ) then + ! if( map(mekooh_ndx) == 0 ) then + ! depvel(:ncol,mekooh_ndx) = tmp(:ncol) + ! dflx(:ncol,mekooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,mekooh_ndx) + ! end if + ! end if + ! if( tolooh_dd ) then + ! if( map(tolooh_ndx) == 0 ) then + ! depvel(:ncol,tolooh_ndx) = tmp(:ncol) + ! dflx(:ncol,tolooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,tolooh_ndx) + ! end if + ! end if + ! if( o3_in_tab ) then + ! tmp(:ncol) = o3_tab_dvel(:ncol) + ! else + ! tmp(:ncol) = 0._r8 + ! end if + ! if( ch2o_dd ) then + ! if( map(ch2o_ndx) == 0 ) then + ! depvel(:ncol,ch2o_ndx) = tmp(:ncol) + ! dflx(:ncol,ch2o_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch2o_ndx) + ! end if + ! end if + + ! if( hydrald_dd ) then + ! if( map(hydrald_ndx) == 0 ) then + ! depvel(:ncol,hydrald_ndx) = tmp(:ncol) + ! dflx(:ncol,hydrald_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,hydrald_ndx) + ! end if + ! end if + ! if( ch3cooh_dd ) then + ! if( map(ch3cooh_ndx) == 0 ) then + ! depvel(:ncol,ch3cooh_ndx) = depvel(:ncol,ch2o_ndx) + ! dflx(:ncol,ch3cooh_ndx) = wrk(:ncol) * depvel(:ncol,ch3cooh_ndx) * q(:ncol,plev,ch3cooh_ndx) + ! end if + ! end if + ! if( eooh_dd ) then + ! if( map(eooh_ndx) == 0 ) then + ! depvel(:ncol,eooh_ndx) = depvel(:ncol,ch2o_ndx) + ! dflx(:ncol,eooh_ndx) = wrk(:ncol) * depvel(:ncol,eooh_ndx) * q(:ncol,plev,eooh_ndx) + ! end if + ! end if + ! ! HCOOH - set to CH3COOH + ! if( hcooh_dd ) then + ! if( map(hcooh_ndx) == 0 ) then + ! depvel(:ncol,hcooh_ndx) = depvel(:ncol,ch2o_ndx) + ! dflx(:ncol,hcooh_ndx) = wrk(:ncol) * depvel(:ncol,hcooh_ndx) * q(:ncol,plev,hcooh_ndx) + ! end if + ! end if + + ! !-------------------------------------------------------- + ! ! ... Set co and related species dep vel + ! !-------------------------------------------------------- + ! if( co_in_tab ) then + ! do i=1,ncol + ! tmp(i) = dvel_interp(i,lchnk,co_tab_ndx) + ! enddo + ! else + ! tmp(:) = 0._r8 + ! end if + ! if( co_dd ) then + ! if( map(co_ndx) == 0 ) then + ! depvel(:ncol,co_ndx) = tmp(:ncol) + ! dflx(:ncol,co_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,co_ndx) + ! end if + ! end if + ! if( ch3coch3_dd ) then + ! if( map(ch3coch3_ndx) == 0 ) then + ! depvel(:ncol,ch3coch3_ndx) = tmp(:ncol) + ! dflx(:ncol,ch3coch3_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch3coch3_ndx) + ! end if + ! end if + ! if( hyac_dd ) then + ! if( map(hyac_ndx) == 0 ) then + ! depvel(:ncol,hyac_ndx) = tmp(:ncol) + ! dflx(:ncol,hyac_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,hyac_ndx) + ! end if + ! end if + ! if( h2_dd ) then + ! if( map(h2_ndx) == 0 ) then + ! depvel(:ncol,h2_ndx) = tmp(:ncol) * 1.5_r8 ! Hough(1991) + ! dflx(:ncol,h2_ndx) = wrk(:ncol) * depvel(:ncol,h2_ndx) * q(:ncol,plev,h2_ndx) + ! end if + ! end if + + ! !-------------------------------------------------------- + ! ! ... Set glyald + ! !-------------------------------------------------------- + ! if( glyald_dd ) then + ! if( map(glyald_ndx) == 0 ) then + ! if( ch3cho_dd ) then + ! depvel(:ncol,glyald_ndx) = depvel(:ncol,ch3cho_ndx) + ! else if( ch3cho_in_tab ) then + ! do i=1,ncol + ! depvel(i,glyald_ndx) = dvel_interp(i,lchnk,ch3cho_tab_ndx) + ! enddo + ! else + ! depvel(:ncol,glyald_ndx) = 0._r8 + ! end if + ! dflx(:ncol,glyald_ndx) = wrk(:ncol) * depvel(:ncol,glyald_ndx) * q(:ncol,plev,glyald_ndx) + ! end if + ! end if + + ! !-------------------------------------------------------- + ! ! ... Lead deposition + ! !-------------------------------------------------------- + ! if( Pb_dd ) then + ! if( map(Pb_ndx) == 0 ) then + ! depvel(:ncol,Pb_ndx) = ocean(:ncol) * .05_r8 + (1._r8 - ocean(:ncol)) * .2_r8 + ! dflx(:ncol,Pb_ndx) = wrk(:ncol) * depvel(:ncol,Pb_ndx) * q(:ncol,plev,Pb_ndx) + ! end if + ! end if + + ! !-------------------------------------------------------- + ! ! ... diurnal dependence for OX dvel + ! !-------------------------------------------------------- + ! if( o3_dd .or. o3s_dd .or. o3inert_dd ) then + ! if( o3_dd .or. o3_in_tab ) then + ! if( o3_dd ) then + ! tmp(:ncol) = max( 1._r8,sqrt( (depvel(:ncol,o3_ndx) - .2_r8)**3/.27_r8 + 4._r8*depvel(:ncol,o3_ndx) + .67_r8 ) ) + ! vel(:ncol) = depvel(:ncol,o3_ndx) + ! else if( o3_in_tab ) then + ! tmp(:ncol) = max( 1._r8,sqrt( (o3_tab_dvel(:ncol) - .2_r8)**3/.27_r8 + 4._r8*o3_tab_dvel(:ncol) + .67_r8 ) ) + ! vel(:ncol) = o3_tab_dvel(:ncol) + ! end if + ! where( abs( zen_angle(:) ) > pid2 ) + ! vel(:) = vel(:) / tmp(:) + ! elsewhere + ! vel(:) = vel(:) * tmp(:) + ! endwhere + + ! else + ! vel(:ncol) = 0._r8 + ! end if + ! if( o3_dd ) then + ! depvel(:ncol,o3_ndx) = vel(:ncol) + ! dflx(:ncol,o3_ndx) = wrk(:ncol) * vel(:ncol) * q(:ncol,plev,o3_ndx) + ! end if + ! !-------------------------------------------------------- + ! ! ... Set stratospheric O3 deposition + ! !-------------------------------------------------------- + ! if( o3s_dd ) then + ! depvel(:ncol,o3s_ndx) = vel(:ncol) + ! dflx(:ncol,o3s_ndx) = wrk(:ncol) * vel(:ncol) * q(:ncol,plev,o3s_ndx) + ! end if + ! if( o3inert_dd ) then + ! depvel(:ncol,o3inert_ndx) = vel(:ncol) + ! dflx(:ncol,o3inert_ndx) = wrk(:ncol) * vel(:ncol) * q(:ncol,plev,o3inert_ndx) + ! end if + ! end if + + ! if( xno2_dd ) then + ! if( map(xno2_ndx) == 0 ) then + ! depvel(:ncol,xno2_ndx) = depvel(:ncol,no2_ndx) + ! dflx(:ncol,xno2_ndx) = wrk(:ncol) * depvel(:ncol,xno2_ndx) * q(:ncol,plev,xno2_ndx) + ! end if + ! endif + ! if( o3a_dd ) then + ! if( map(o3a_ndx) == 0 ) then + ! depvel(:ncol,o3a_ndx) = depvel(:ncol,o3_ndx) + ! dflx(:ncol,o3a_ndx) = wrk(:ncol) * depvel(:ncol,o3a_ndx) * q(:ncol,plev,o3a_ndx) + ! end if + ! endif + ! if( xhno3_dd ) then + ! if( map(xhno3_ndx) == 0 ) then + ! depvel(:ncol,xhno3_ndx) = depvel(:ncol,hno3_ndx) + ! dflx(:ncol,xhno3_ndx) = wrk(:ncol) * depvel(:ncol,xhno3_ndx) * q(:ncol,plev,xhno3_ndx) + ! end if + ! endif + ! if( xnh4no3_dd ) then + ! if( map(xnh4no3_ndx) == 0 ) then + ! depvel(:ncol,xnh4no3_ndx) = depvel(:ncol,nh4no3_ndx) + ! dflx(:ncol,xnh4no3_ndx) = wrk(:ncol) * depvel(:ncol,xnh4no3_ndx) * q(:ncol,plev,xnh4no3_ndx) + ! end if + ! endif + ! if( xpan_dd ) then + ! if( map(xpan_ndx) == 0 ) then + ! depvel(:ncol,xpan_ndx) = depvel(:ncol,pan_ndx) + ! dflx(:ncol,xpan_ndx) = wrk(:ncol) * depvel(:ncol,xpan_ndx) * q(:ncol,plev,xpan_ndx) + ! end if + ! endif + ! if( xmpan_dd ) then + ! if( map(xmpan_ndx) == 0 ) then + ! depvel(:ncol,xmpan_ndx) = depvel(:ncol,mpan_ndx) + ! dflx(:ncol,xmpan_ndx) = wrk(:ncol) * depvel(:ncol,xmpan_ndx) * q(:ncol,plev,xmpan_ndx) + ! end if + ! endif + ! if( xonit_dd ) then + ! if( map(xonit_ndx) == 0 ) then + ! depvel(:ncol,xonit_ndx) = depvel(:ncol,onit_ndx) + ! dflx(:ncol,xonit_ndx) = wrk(:ncol) * depvel(:ncol,xonit_ndx) * q(:ncol,plev,xonit_ndx) + ! end if + ! endif + ! if( xonitr_dd ) then + ! if( map(xonitr_ndx) == 0 ) then + ! depvel(:ncol,xonitr_ndx) = depvel(:ncol,onitr_ndx) + ! dflx(:ncol,xonitr_ndx) = wrk(:ncol) * depvel(:ncol,xonitr_ndx) * q(:ncol,plev,xonitr_ndx) + ! end if + ! endif + ! if( xno_dd ) then + ! if( map(xno_ndx) == 0 ) then + ! depvel(:ncol,xno_ndx) = depvel(:ncol,no_ndx) + ! dflx(:ncol,xno_ndx) = wrk(:ncol) * depvel(:ncol,xno_ndx) * q(:ncol,plev,xno_ndx) + ! end if + ! endif + ! if( xho2no2_dd ) then + ! if( map(xho2no2_ndx) == 0 ) then + ! depvel(:ncol,xho2no2_ndx) = depvel(:ncol,ho2no2_ndx) + ! dflx(:ncol,xho2no2_ndx) = wrk(:ncol) * depvel(:ncol,xho2no2_ndx) * q(:ncol,plev,xho2no2_ndx) + ! end if + ! endif + ! !lke-TS1 + ! if( phenooh_dd ) then + ! if( map(phenooh_ndx) == 0 ) then + ! depvel(:ncol,phenooh_ndx) = depvel(:ncol,ch3ooh_ndx) + ! dflx(:ncol,phenooh_ndx) = wrk(:ncol) * depvel(:ncol,phenooh_ndx) * q(:ncol,plev,phenooh_ndx) + ! end if + ! endif + ! if( benzooh_dd ) then + ! if( map(benzooh_ndx) == 0 ) then + ! depvel(:ncol,benzooh_ndx) = depvel(:ncol,ch3ooh_ndx) + ! dflx(:ncol,benzooh_ndx) = wrk(:ncol) * depvel(:ncol,benzooh_ndx) * q(:ncol,plev,benzooh_ndx) + ! end if + ! endif + ! if( c6h5ooh_dd ) then + ! if( map(c6h5ooh_ndx) == 0 ) then + ! depvel(:ncol,c6h5ooh_ndx) = depvel(:ncol,ch3ooh_ndx) + ! dflx(:ncol,c6h5ooh_ndx) = wrk(:ncol) * depvel(:ncol,c6h5ooh_ndx) * q(:ncol,plev,c6h5ooh_ndx) + ! end if + ! endif + ! if( bzooh_dd ) then + ! if( map(bzooh_ndx) == 0 ) then + ! depvel(:ncol,bzooh_ndx) = depvel(:ncol,ch3ooh_ndx) + ! dflx(:ncol,bzooh_ndx) = wrk(:ncol) * depvel(:ncol,bzooh_ndx) * q(:ncol,plev,bzooh_ndx) + ! end if + ! endif + ! if( xylolooh_dd ) then + ! if( map(xylolooh_ndx) == 0 ) then + ! depvel(:ncol,xylolooh_ndx) = depvel(:ncol,ch3ooh_ndx) + ! dflx(:ncol,xylolooh_ndx) = wrk(:ncol) * depvel(:ncol,xylolooh_ndx) * q(:ncol,plev,xylolooh_ndx) + ! end if + ! endif + ! if( xylenooh_dd ) then + ! if( map(xylenooh_ndx) == 0 ) then + ! depvel(:ncol,xylenooh_ndx) = depvel(:ncol,ch3ooh_ndx) + ! dflx(:ncol,xylenooh_ndx) = wrk(:ncol) * depvel(:ncol,xylenooh_ndx) * q(:ncol,plev,xylenooh_ndx) + ! end if + ! endif + ! if( terpooh_dd ) then + ! if( map(terpooh_ndx) == 0 ) then + ! depvel(:ncol,terpooh_ndx) = depvel(:ncol,isopooh_ndx) + ! dflx(:ncol,terpooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,terpooh_ndx) + ! end if + ! end if + ! if( terp2ooh_dd ) then + ! if( map(terp2ooh_ndx) == 0 ) then + ! depvel(:ncol,terp2ooh_ndx) = depvel(:ncol,isopooh_ndx) + ! dflx(:ncol,terp2ooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,terp2ooh_ndx) + ! end if + ! end if + ! if( terprod1_dd ) then + ! if( map(terprod1_ndx) == 0 ) then + ! depvel(:ncol,terprod1_ndx) = depvel(:ncol,hyac_ndx) + ! dflx(:ncol,terprod1_ndx) = wrk(:ncol) * depvel(:ncol,terprod1_ndx) * q(:ncol,plev,terprod1_ndx) + ! end if + ! endif + ! if( terprod2_dd ) then + ! if( map(terprod2_ndx) == 0 ) then + ! depvel(:ncol,terprod2_ndx) = depvel(:ncol,hyac_ndx) + ! dflx(:ncol,terprod2_ndx) = wrk(:ncol) * depvel(:ncol,terprod2_ndx) * q(:ncol,plev,terprod2_ndx) + ! end if + ! endif + ! if( hmprop_dd ) then + ! if( map(hmprop_ndx) == 0 ) then + ! depvel(:ncol,hmprop_ndx) = depvel(:ncol,glyald_ndx) + ! dflx(:ncol,hmprop_ndx) = wrk(:ncol) * depvel(:ncol,hmprop_ndx) * q(:ncol,plev,hmprop_ndx) + ! end if + ! endif + ! if( mboooh_dd ) then + ! if( map(mboooh_ndx) == 0 ) then + ! depvel(:ncol,mboooh_ndx) = depvel(:ncol,isopooh_ndx) + ! dflx(:ncol,mboooh_ndx) = wrk(:ncol) * depvel(:ncol,mboooh_ndx) * q(:ncol,plev,mboooh_ndx) + ! end if + ! endif + ! if( hpald_dd ) then + ! if( map(hpald_ndx) == 0 ) then + ! depvel(:ncol,hpald_ndx) = depvel(:ncol,ch3ooh_ndx) + ! dflx(:ncol,hpald_ndx) = wrk(:ncol) * depvel(:ncol,hpald_ndx) * q(:ncol,plev,hpald_ndx) + ! end if + ! endif + ! if( iepox_dd ) then + ! if( map(iepox_ndx) == 0 ) then + ! depvel(:ncol,iepox_ndx) = depvel(:ncol,hyac_ndx) + ! dflx(:ncol,iepox_ndx) = wrk(:ncol) * depvel(:ncol,iepox_ndx) * q(:ncol,plev,iepox_ndx) + ! end if + ! endif + ! if( noa_dd ) then + ! if( map(noa_ndx) == 0 ) then + ! depvel(:ncol,noa_ndx) = depvel(:ncol,h2o2_ndx) + ! dflx(:ncol,noa_ndx) = wrk(:ncol) * depvel(:ncol,noa_ndx) * q(:ncol,plev,noa_ndx) + ! end if + ! endif + ! if( alknit_dd ) then + ! if( map(alknit_ndx) == 0 ) then + ! depvel(:ncol,alknit_ndx) = depvel(:ncol,h2o2_ndx) + ! dflx(:ncol,alknit_ndx) = wrk(:ncol) * depvel(:ncol,alknit_ndx) * q(:ncol,plev,alknit_ndx) + ! end if + ! endif + ! if( isopnita_dd ) then + ! if( map(isopnita_ndx) == 0 ) then + ! depvel(:ncol,isopnita_ndx) = depvel(:ncol,h2o2_ndx) + ! dflx(:ncol,isopnita_ndx) = wrk(:ncol) * depvel(:ncol,isopnita_ndx) * q(:ncol,plev,isopnita_ndx) + ! end if + ! endif + ! if( isopnitb_dd ) then + ! if( map(isopnitb_ndx) == 0 ) then + ! depvel(:ncol,isopnitb_ndx) = depvel(:ncol,h2o2_ndx) + ! dflx(:ncol,isopnitb_ndx) = wrk(:ncol) * depvel(:ncol,isopnitb_ndx) * q(:ncol,plev,isopnitb_ndx) + ! end if + ! endif + ! if( honitr_dd ) then + ! if( map(honitr_ndx) == 0 ) then + ! depvel(:ncol,honitr_ndx) = depvel(:ncol,h2o2_ndx) + ! dflx(:ncol,honitr_ndx) = wrk(:ncol) * depvel(:ncol,honitr_ndx) * q(:ncol,plev,honitr_ndx) + ! end if + ! endif + ! if( isopnooh_dd ) then + ! if( map(isopnooh_ndx) == 0 ) then + ! depvel(:ncol,isopnooh_ndx) = depvel(:ncol,h2o2_ndx) + ! dflx(:ncol,isopnooh_ndx) = wrk(:ncol) * depvel(:ncol,isopnooh_ndx) * q(:ncol,plev,isopnooh_ndx) + ! end if + ! endif + ! if( nc4cho_dd ) then + ! if( map(nc4cho_ndx) == 0 ) then + ! depvel(:ncol,nc4cho_ndx) = depvel(:ncol,h2o2_ndx) + ! dflx(:ncol,nc4cho_ndx) = wrk(:ncol) * depvel(:ncol,nc4cho_ndx) * q(:ncol,plev,nc4cho_ndx) + ! end if + ! endif + ! if( nc4ch2oh_dd ) then + ! if( map(nc4ch2oh_ndx) == 0 ) then + ! depvel(:ncol,nc4ch2oh_ndx) = depvel(:ncol,h2o2_ndx) + ! dflx(:ncol,nc4ch2oh_ndx) = wrk(:ncol) * depvel(:ncol,nc4ch2oh_ndx) * q(:ncol,plev,nc4ch2oh_ndx) + ! end if + ! endif + ! if( terpnit_dd ) then + ! if( map(terpnit_ndx) == 0 ) then + ! depvel(:ncol,terpnit_ndx) = depvel(:ncol,h2o2_ndx) + ! dflx(:ncol,terpnit_ndx) = wrk(:ncol) * depvel(:ncol,terpnit_ndx) * q(:ncol,plev,terpnit_ndx) + ! end if + ! endif + ! if( nterpooh_dd ) then + ! if( map(nterpooh_ndx) == 0 ) then + ! depvel(:ncol,nterpooh_ndx) = depvel(:ncol,h2o2_ndx) + ! dflx(:ncol,nterpooh_ndx) = wrk(:ncol) * depvel(:ncol,nterpooh_ndx) * q(:ncol,plev,nterpooh_ndx) + ! end if + ! endif + + + !end subroutine drydep_table + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + subroutine dvel_inti_xactive( depvel_lnd_file, clim_soilw_file, season_wes_file ) + !------------------------------------------------------------------------------------- + ! ... intialize interactive drydep + !------------------------------------------------------------------------------------- + use dycore, only : dycore_is + use mo_constants, only : r2d + use chem_mods, only : adv_mass + use mo_chem_utls, only : get_spc_ndx ! Replaced, TMMF + use seq_drydep_mod,only : drydep_method, DD_XATM, DD_XLND + use phys_control, only : phys_getopts + + implicit none + + !------------------------------------------------------------------------------------- + ! ... dummy arguments + !------------------------------------------------------------------------------------- + character(len=*), intent(in) :: depvel_lnd_file, clim_soilw_file, season_wes_file + + !------------------------------------------------------------------------------------- + ! ... local variables + !------------------------------------------------------------------------------------- + integer :: i, j, ii, jj, jl, ju + integer :: nlon_veg, nlat_veg, npft_veg + integer :: nlat_lai, npft_lai, pos_min, imin + integer :: dimid + integer :: m, n, l, id + integer :: length1, astat + integer, allocatable :: wk_lai(:,:,:) + integer, allocatable :: index_season_lai_j(:,:) + integer :: k, num_max, k_max + integer :: num_seas(5) + integer :: plon, plat + integer :: ierr, ndx + + real(r8) :: spc_mass + real(r8) :: diff_min, target_lat + real(r8), allocatable :: vegetation_map(:,:,:) + real(r8), pointer :: soilw_map(:,:,:) + real(r8), allocatable :: work(:,:) + real(r8), allocatable :: landmask(:,:) + real(r8), allocatable :: urban(:,:) + real(r8), allocatable :: lake(:,:) + real(r8), allocatable :: wetland(:,:) + real(r8), allocatable :: lon_veg(:) + real(r8), allocatable :: lon_veg_edge(:) + real(r8), allocatable :: lat_veg(:) + real(r8), allocatable :: lat_veg_edge(:) + real(r8), allocatable :: lat_lai(:) + real(r8), allocatable :: clat(:) + character(len=32) :: test_name + character(len=4) :: tag_name + type(file_desc_t) :: piofile + type(var_desc_t) :: vid + logical :: do_soilw + + character(len=shr_kind_cl) :: locfn + logical :: prog_modal_aero + + ! determine if modal aerosols are active so that fraction_landuse array is initialized for modal aerosal dry dep + call phys_getopts(prog_modal_aero_out=prog_modal_aero) + + call dvel_inti_fromlnd() + + if( masterproc ) then + write(iulog,*) 'drydep_inti: following species have dry deposition' + do i=1,nddvels + if( len_trim(drydep_list(i)) > 0 ) then + write(iulog,*) 'drydep_inti: '//trim(drydep_list(i))//' is requested to have dry dep' + endif + enddo + write(iulog,*) 'drydep_inti:' + endif + + !------------------------------------------------------------------------------------- + ! ... get species indices + !------------------------------------------------------------------------------------- + xpan_ndx = get_spc_ndx( 'XPAN' ) + xmpan_ndx = get_spc_ndx( 'XMPAN' ) + o3a_ndx = get_spc_ndx( 'O3A' ) + + ch4_ndx = get_spc_ndx( 'CH4' ) + h2_ndx = get_spc_ndx( 'H2' ) + co_ndx = get_spc_ndx( 'CO' ) + Pb_ndx = get_spc_ndx( 'Pb' ) + pan_ndx = get_spc_ndx( 'PAN' ) + mpan_ndx = get_spc_ndx( 'MPAN' ) + o3_ndx = get_spc_ndx( 'OX' ) + if( o3_ndx < 0 ) then + o3_ndx = get_spc_ndx( 'O3' ) + end if + so2_ndx = get_spc_ndx( 'SO2' ) + alkooh_ndx = get_spc_ndx( 'ALKOOH') + mekooh_ndx = get_spc_ndx( 'MEKOOH') + tolooh_ndx = get_spc_ndx( 'TOLOOH') + terpooh_ndx = get_spc_ndx( 'TERPOOH') + ch3cooh_ndx = get_spc_ndx( 'CH3COOH') + soa_ndx = get_spc_ndx( 'SOA' ) + so4_ndx = get_spc_ndx( 'SO4' ) + cb1_ndx = get_spc_ndx( 'CB1' ) + cb2_ndx = get_spc_ndx( 'CB2' ) + oc1_ndx = get_spc_ndx( 'OC1' ) + oc2_ndx = get_spc_ndx( 'OC2' ) + nh3_ndx = get_spc_ndx( 'NH3' ) + nh4no3_ndx = get_spc_ndx( 'NH4NO3' ) + sa1_ndx = get_spc_ndx( 'SA1' ) + sa2_ndx = get_spc_ndx( 'SA2' ) + sa3_ndx = get_spc_ndx( 'SA3' ) + sa4_ndx = get_spc_ndx( 'SA4' ) + nh4_ndx = get_spc_ndx( 'NH4' ) + alkooh_dd = has_drydep( 'ALKOOH') + mekooh_dd = has_drydep( 'MEKOOH') + tolooh_dd = has_drydep( 'TOLOOH') + terpooh_dd = has_drydep( 'TERPOOH') + ch3cooh_dd = has_drydep( 'CH3COOH') + soa_dd = has_drydep( 'SOA' ) + so4_dd = has_drydep( 'SO4' ) + cb1_dd = has_drydep( 'CB1' ) + cb2_dd = has_drydep( 'CB2' ) + oc1_dd = has_drydep( 'OC1' ) + oc2_dd = has_drydep( 'OC2' ) + nh3_dd = has_drydep( 'NH3' ) + nh4no3_dd = has_drydep( 'NH4NO3' ) + sa1_dd = has_drydep( 'SA1' ) + sa2_dd = has_drydep( 'SA2' ) + sa3_dd = has_drydep( 'SA3' ) + sa4_dd = has_drydep( 'SA4' ) + nh4_dd = has_drydep( 'NH4' ) +! + soam_ndx = get_spc_ndx( 'SOAM' ) + soai_ndx = get_spc_ndx( 'SOAI' ) + soat_ndx = get_spc_ndx( 'SOAT' ) + soab_ndx = get_spc_ndx( 'SOAB' ) + soax_ndx = get_spc_ndx( 'SOAX' ) + sogm_ndx = get_spc_ndx( 'SOGM' ) + sogi_ndx = get_spc_ndx( 'SOGI' ) + sogt_ndx = get_spc_ndx( 'SOGT' ) + sogb_ndx = get_spc_ndx( 'SOGB' ) + sogx_ndx = get_spc_ndx( 'SOGX' ) + soam_dd = has_drydep ( 'SOAM' ) + soai_dd = has_drydep ( 'SOAI' ) + soat_dd = has_drydep ( 'SOAT' ) + soab_dd = has_drydep ( 'SOAB' ) + soax_dd = has_drydep ( 'SOAX' ) + sogm_dd = has_drydep ( 'SOGM' ) + sogi_dd = has_drydep ( 'SOGI' ) + sogt_dd = has_drydep ( 'SOGT' ) + sogb_dd = has_drydep ( 'SOGB' ) + sogx_dd = has_drydep ( 'SOGX' ) +! + hcn_ndx = get_spc_ndx( 'HCN') + ch3cn_ndx = get_spc_ndx( 'CH3CN') + +!lke-TS1 + phenooh_ndx = get_spc_ndx( 'PHENOOH') + benzooh_ndx = get_spc_ndx( 'BENZOOH') + c6h5ooh_ndx = get_spc_ndx( 'C6H5OOH') + bzooh_ndx = get_spc_ndx( 'BZOOH') + xylolooh_ndx = get_spc_ndx( 'XYLOLOOH') + xylenooh_ndx = get_spc_ndx( 'XYLENOOH') + terp2ooh_ndx = get_spc_ndx( 'TERP2OOH') + terprod1_ndx = get_spc_ndx( 'TERPROD1') + terprod2_ndx = get_spc_ndx( 'TERPROD2') + hmprop_ndx = get_spc_ndx( 'HMPROP') + mboooh_ndx = get_spc_ndx( 'MBOOOH') + hpald_ndx = get_spc_ndx( 'HPALD') + iepox_ndx = get_spc_ndx( 'IEPOX') + noa_ndx = get_spc_ndx( 'NOA') + alknit_ndx = get_spc_ndx( 'ALKNIT') + isopnita_ndx = get_spc_ndx( 'ISOPNITA') + isopnitb_ndx = get_spc_ndx( 'ISOPNITB') + honitr_ndx = get_spc_ndx( 'HONITR') + isopnooh_ndx = get_spc_ndx( 'ISOPNOOH') + nc4cho_ndx = get_spc_ndx( 'NC4CHO') + nc4ch2oh_ndx = get_spc_ndx( 'NC4CH2OH') + terpnit_ndx = get_spc_ndx( 'TERPNIT') + nterpooh_ndx = get_spc_ndx( 'NTERPOOH') + phenooh_dd = has_drydep( 'PHENOOH') + benzooh_dd = has_drydep( 'BENZOOH') + c6h5ooh_dd = has_drydep( 'C6H5OOH') + bzooh_dd = has_drydep( 'BZOOH') + xylolooh_dd = has_drydep( 'XYLOLOOH') + xylenooh_dd = has_drydep( 'XYLENOOH') + terp2ooh_dd = has_drydep( 'TERP2OOH') + terprod1_dd = has_drydep( 'TERPROD1') + terprod2_dd = has_drydep( 'TERPROD2') + hmprop_dd = has_drydep( 'HMPROP') + mboooh_dd = has_drydep( 'MBOOOH') + hpald_dd = has_drydep( 'HPALD') + iepox_dd = has_drydep( 'IEPOX') + noa_dd = has_drydep( 'NOA') + alknit_dd = has_drydep( 'ALKNIT') + isopnita_dd = has_drydep( 'ISOPNITA') + isopnitb_dd = has_drydep( 'ISOPNITB') + honitr_dd = has_drydep( 'HONITR') + isopnooh_dd = has_drydep( 'ISOPNOOH') + nc4cho_dd = has_drydep( 'NC4CHO') + nc4ch2oh_dd = has_drydep( 'NC4CH2OH') + terpnit_dd = has_drydep( 'TERPNIT') + nterpooh_dd = has_drydep( 'NTERPOOH') +! + cohc_ndx = get_spc_ndx( 'COhc' ) + come_ndx = get_spc_ndx( 'COme' ) + + tag_cnt=0 + cotag_ndx(:)=-1 + do i = 1,NTAGS + write(tag_name,'(a2,i2.2)') 'CO',i + ndx = get_spc_ndx(tag_name) + if (ndx>0) then + tag_cnt = tag_cnt+1 + cotag_ndx(tag_cnt) = ndx + endif + enddo + + o3s_ndx = get_spc_ndx( 'O3S' ) + + do i=1,nddvels + if ( ( mapping(i) > 0 ) .and. ( drySpc_ndx(i) > 0 ) ) then + m = drySpc_ndx(i) + has_dvel(m) = .true. + map_dvel(m) = i + endif + enddo + + if( all( .not. has_dvel(:) ) ) then + return + end if + + !--------------------------------------------------------------------------- + ! ... allocate module variables + !--------------------------------------------------------------------------- + allocate( dep_ra(pcols,n_land_type,begchunk:endchunk),stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate dep_ra; error = ',astat + call endrun + end if + allocate( dep_rb(pcols,n_land_type,begchunk:endchunk),stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate dep_rb; error = ',astat + call endrun + end if + + if (drydep_method == DD_XLND .and. (.not.prog_modal_aero)) then + return + endif + + do_soilw = .not. dyn_soilw .and. (has_drydep( 'H2' ) .or. has_drydep( 'CO' )) + allocate( fraction_landuse(pcols,n_land_type, begchunk:endchunk),stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate fraction_landuse; error = ',astat + call endrun + end if + if(do_soilw) then + allocate(soilw_3d(pcols,12,begchunk:endchunk),stat=astat) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate soilw_3d error = ',astat + call endrun + end if + end if + + plon = get_dyn_grid_parm('plon') + plat = get_dyn_grid_parm('plat') + allocate( index_season_lai_j(n_land_type,12),stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate index_season_lai_j; error = ',astat + call endrun + end if + if(dycore_is('UNSTRUCTURED') ) then + call get_landuse_and_soilw_from_file(do_soilw) + allocate( index_season_lai(plon,12),stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate index_season_lai; error = ',astat + call endrun + end if + else + allocate( index_season_lai(plat,12),stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate index_season_lai; error = ',astat + call endrun + end if + !--------------------------------------------------------------------------- + ! ... read landuse map + !--------------------------------------------------------------------------- + call getfil (depvel_lnd_file, locfn, 0) + call cam_pio_openfile (piofile, trim(locfn), PIO_NOWRITE) + !--------------------------------------------------------------------------- + ! ... get the dimensions + !--------------------------------------------------------------------------- + ierr = pio_inq_dimid( piofile, 'lon', dimid ) + ierr = pio_inq_dimlen( piofile, dimid, nlon_veg ) + ierr = pio_inq_dimid( piofile, 'lat', dimid ) + ierr = pio_inq_dimlen( piofile, dimid, nlat_veg ) + ierr = pio_inq_dimid( piofile, 'pft', dimid ) + ierr = pio_inq_dimlen( piofile, dimid, npft_veg ) + !--------------------------------------------------------------------------- + ! ... allocate arrays + !--------------------------------------------------------------------------- + allocate( vegetation_map(nlon_veg,nlat_veg,npft_veg), work(nlon_veg,nlat_veg), stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate vegation_map; error = ',astat + call endrun + end if + allocate( urban(nlon_veg,nlat_veg), lake(nlon_veg,nlat_veg), & + landmask(nlon_veg,nlat_veg), wetland(nlon_veg,nlat_veg), stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate vegation_map; error = ',astat + call endrun + end if + allocate( lon_veg(nlon_veg), lat_veg(nlat_veg), & + lon_veg_edge(nlon_veg+1), lat_veg_edge(nlat_veg+1), stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate vegation lon, lat arrays; error = ',astat + call endrun + end if + !--------------------------------------------------------------------------- + ! ... read the vegetation map and landmask + !--------------------------------------------------------------------------- + ierr = pio_inq_varid( piofile, 'PCT_PFT', vid ) + ierr = pio_get_var( piofile, vid, vegetation_map ) + + ierr = pio_inq_varid( piofile, 'LANDMASK', vid ) + ierr = pio_get_var( piofile, vid, landmask ) + + ierr = pio_inq_varid( piofile, 'PCT_URBAN', vid ) + ierr = pio_get_var( piofile, vid, urban ) + + ierr = pio_inq_varid( piofile, 'PCT_LAKE', vid ) + ierr = pio_get_var( piofile, vid, lake ) + + ierr = pio_inq_varid( piofile, 'PCT_WETLAND', vid ) + ierr = pio_get_var( piofile, vid, wetland ) + + call cam_pio_closefile( piofile ) + + !--------------------------------------------------------------------------- + ! scale vegetation, urban, lake, and wetland to fraction + !--------------------------------------------------------------------------- + vegetation_map(:,:,:) = .01_r8 * vegetation_map(:,:,:) + wetland(:,:) = .01_r8 * wetland(:,:) + lake(:,:) = .01_r8 * lake(:,:) + urban(:,:) = .01_r8 * urban(:,:) +#ifdef DEBUG + if(masterproc) then + write(iulog,*) 'minmax vegetation_map ',minval(vegetation_map),maxval(vegetation_map) + write(iulog,*) 'minmax wetland ',minval(wetland),maxval(wetland) + write(iulog,*) 'minmax landmask ',minval(landmask),maxval(landmask) + end if +#endif + !--------------------------------------------------------------------------- + ! ... define lat-lon of vegetation map (1x1) + !--------------------------------------------------------------------------- + lat_veg(:) = (/ (-89.5_r8 + (i-1),i=1,nlat_veg ) /) + lon_veg(:) = (/ ( 0.5_r8 + (i-1),i=1,nlon_veg ) /) + lat_veg_edge(:) = (/ (-90.0_r8 + (i-1),i=1,nlat_veg+1) /) + lon_veg_edge(:) = (/ ( 0.0_r8 + (i-1),i=1,nlon_veg+1) /) + !--------------------------------------------------------------------------- + ! ... read soilw table if necessary + !--------------------------------------------------------------------------- + + if( do_soilw ) then + call soilw_inti( clim_soilw_file, nlon_veg, nlat_veg, soilw_map ) + end if + + !--------------------------------------------------------------------------- + ! ... regrid to model grid + !--------------------------------------------------------------------------- + + call interp_map( plon, plat, nlon_veg, nlat_veg, npft_veg, lat_veg, lat_veg_edge, & + lon_veg, lon_veg_edge, landmask, urban, lake, & + wetland, vegetation_map, soilw_map, do_soilw ) + + deallocate( vegetation_map, work, stat=astat ) + deallocate( lon_veg, lat_veg, lon_veg_edge, lat_veg_edge, stat=astat ) + deallocate( landmask, urban, lake, wetland, stat=astat ) + if( do_soilw ) then + deallocate( soilw_map, stat=astat ) + end if + endif ! Unstructured grid + + if (drydep_method == DD_XLND) then + return + endif + + !--------------------------------------------------------------------------- + ! ... read LAI based season indeces + !--------------------------------------------------------------------------- + call getfil (season_wes_file, locfn, 0) + call cam_pio_openfile (piofile, trim(locfn), PIO_NOWRITE) + !--------------------------------------------------------------------------- + ! ... get the dimensions + !--------------------------------------------------------------------------- + ierr = pio_inq_dimid( piofile, 'lat', dimid ) + ierr = pio_inq_dimlen( piofile, dimid, nlat_lai ) + ierr = pio_inq_dimid( piofile, 'pft', dimid ) + ierr = pio_inq_dimlen( piofile, dimid, npft_lai ) + !--------------------------------------------------------------------------- + ! ... allocate arrays + !--------------------------------------------------------------------------- + allocate( lat_lai(nlat_lai), wk_lai(nlat_lai,npft_lai,12), stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate vegation_map; error = ',astat + call endrun + end if + !--------------------------------------------------------------------------- + ! ... read the latitude and the season indicies + !--------------------------------------------------------------------------- + ierr = pio_inq_varid( piofile, 'lat', vid ) + ierr = pio_get_var( piofile, vid, lat_lai ) + + ierr = pio_inq_varid( piofile, 'season_wes', vid ) + ierr = pio_get_var( piofile, vid, wk_lai ) + + call cam_pio_closefile( piofile ) + + + if(dycore_is('UNSTRUCTURED') ) then + ! For unstructured grids plon is the 1d horizontal grid size and plat=1 + allocate(clat(plon)) + call get_horiz_grid_d(plon, clat_d_out=clat) + jl = 1 + ju = plon + else + allocate(clat(plat)) + call get_horiz_grid_d(plat, clat_d_out=clat) + jl = 1 + ju = plat + end if + imin = 1 + do j = 1,ju + diff_min = 10._r8 + pos_min = -99 + target_lat = clat(j)*r2d + do i = imin,nlat_lai + if( abs(lat_lai(i) - target_lat) < diff_min ) then + diff_min = abs(lat_lai(i) - target_lat) + pos_min = i + end if + end do + if( pos_min < 0 ) then + write(iulog,*) 'dvel_inti: cannot find ',target_lat,' at j,pos_min,diff_min = ',j,pos_min,diff_min + write(iulog,*) 'dvel_inti: imin,nlat_lai = ',imin,nlat_lai + write(iulog,*) 'dvel_inti: lat_lai' + write(iulog,'(1p,10g12.5)') lat_lai(:) + call endrun + end if + if(dycore_is('UNSTRUCTURED') ) then + imin=1 + else + imin = pos_min + end if + index_season_lai_j(:,:) = wk_lai(pos_min,:,:) + + !--------------------------------------------------------------------------- + ! specify the season as the most frequent in the 11 vegetation classes + ! this was done to remove a banding problem in dvel (JFL Oct 04) + !--------------------------------------------------------------------------- + do m = 1,12 + num_seas = 0 + do l = 1,11 + do k = 1,5 + if( index_season_lai_j(l,m) == k ) then + num_seas(k) = num_seas(k) + 1 + exit + end if + end do + end do + + num_max = -1 + do k = 1,5 + if( num_seas(k) > num_max ) then + num_max = num_seas(k) + k_max = k + endif + end do + + index_season_lai(j,m) = k_max + end do + end do + + deallocate( lat_lai, wk_lai, clat, index_season_lai_j) + + end subroutine dvel_inti_xactive + + !------------------------------------------------------------------------------------- + subroutine get_landuse_and_soilw_from_file(do_soilw) + use ncdio_atm, only : infld + logical, intent(in) :: do_soilw + logical :: readvar + + type(file_desc_t) :: piofile + character(len=shr_kind_cl) :: locfn + logical :: lexist + + call getfil (drydep_srf_file, locfn, 1, lexist) + if(lexist) then + call cam_pio_openfile(piofile, locfn, PIO_NOWRITE) + + call infld('fraction_landuse', piofile, 'ncol','class',1,pcols,1,n_land_type, begchunk,endchunk, & + fraction_landuse, readvar, gridname='physgrid') + if (.not. readvar) then + write(iulog,*)'**************************************' + write(iulog,*)'get_landuse_and_soilw_from_file: INFO:' + write(iulog,*)' fraction_landuse not read from file: ' + write(iulog,*)' ', trim(locfn) + write(iulog,*)' setting all values to zero' + write(iulog,*)'**************************************' + fraction_landuse = 0._r8 + end if + + if(do_soilw) then + call infld('soilw', piofile, 'ncol','month',1,pcols,1,12, begchunk,endchunk, & + soilw_3d, readvar, gridname='physgrid') + end if + + call cam_pio_closefile(piofile) + else + call endrun('Unstructured grids require drydep_srf_file ') + end if + + + end subroutine get_landuse_and_soilw_from_file + + !------------------------------------------------------------------------------------- + subroutine interp_map( plon, plat, nlon_veg, nlat_veg, npft_veg, lat_veg, lat_veg_edge, & + lon_veg, lon_veg_edge, landmask, urban, lake, & + wetland, vegetation_map, soilw_map, do_soilw ) + + use mo_constants, only : r2d + use scamMod, only : latiop,loniop,scmlat,scmlon,scm_cambfb_mode + use shr_scam_mod , only: shr_scam_getCloseLatLon ! Standardized system subroutines + use cam_initfiles, only: initial_file_get_id + use dycore, only : dycore_is + use phys_grid, only : scatter_field_to_chunk + implicit none + + !------------------------------------------------------------------------------------- + ! ... dummy arguments + !------------------------------------------------------------------------------------- + integer, intent(in) :: plon, plat, nlon_veg, nlat_veg, npft_veg + real(r8), pointer :: soilw_map(:,:,:) + real(r8), intent(in) :: landmask(nlon_veg,nlat_veg) + real(r8), intent(in) :: urban(nlon_veg,nlat_veg) + real(r8), intent(in) :: lake(nlon_veg,nlat_veg) + real(r8), intent(in) :: wetland(nlon_veg,nlat_veg) + real(r8), intent(in) :: vegetation_map(nlon_veg,nlat_veg,npft_veg) + real(r8), intent(in) :: lon_veg(nlon_veg) + real(r8), intent(in) :: lon_veg_edge(nlon_veg+1) + real(r8), intent(in) :: lat_veg(nlat_veg) + real(r8), intent(in) :: lat_veg_edge(nlat_veg+1) + logical, intent(in) :: do_soilw + + !------------------------------------------------------------------------------------- + ! ... local variables + !------------------------------------------------------------------------------------- + real(r8) :: closelat,closelon + integer :: latidx,lonidx + + integer, parameter :: veg_ext = 20 + type(file_desc_t), pointer :: piofile + integer :: i, j, ii, jj, jl, ju, i_ndx, n + integer, dimension(plon+1) :: ind_lon + integer, dimension(plat+1) :: ind_lat + real(r8) :: total_land + real(r8), dimension(plon+1) :: lon_edge + real(r8), dimension(plat+1) :: lat_edge + real(r8) :: lat1, lat2, lon1, lon2 + real(r8) :: x1, x2, y1, y2, dx, dy + real(r8) :: area, total_area + real(r8), dimension(npft_veg+3) :: fraction + real(r8) :: total_soilw_area + real(r8) :: fraction_soilw + real(r8) :: total_soilw(12) + + real(r8), dimension(-veg_ext:nlon_veg+veg_ext) :: lon_veg_edge_ext + integer, dimension(-veg_ext:nlon_veg+veg_ext) :: mapping_ext + + real(r8), allocatable :: lam(:), phi(:), garea(:) + + logical, parameter :: has_npole = .true. + integer :: ploniop,platiop + real(r8) :: tmp_frac_lu(plon,n_land_type,plat), tmp_soilw_3d(plon,12,plat) + + if(dycore_is('UNSTRUCTURED') ) then + ! For unstructured grids plon is the 1d horizontal grid size and plat=1 + allocate(lam(plon), phi(plon)) + call get_horiz_grid_d(plon, clat_d_out=phi) + else + allocate(lam(plon), phi(plat)) + call get_horiz_grid_d(plat, clat_d_out=phi) + endif + call get_horiz_grid_d(plon, clon_d_out=lam) + + + jl = 1 + ju = plon + + if (single_column) then + if (scm_cambfb_mode) then + piofile => initial_file_get_id() + call shr_scam_getCloseLatLon(piofile%fh,scmlat,scmlon,closelat,closelon,latidx,lonidx) + ploniop=size(loniop) + platiop=size(latiop) + else + latidx=1 + lonidx=1 + ploniop=1 + platiop=1 + end if + + lon_edge(1) = loniop(lonidx) * r2d - .5_r8*(loniop(2) - loniop(1)) * r2d + + if (lonidx.lt.ploniop) then + lon_edge(2) = loniop(lonidx+1) * r2d - .5_r8*(loniop(2) - loniop(1)) * r2d + else + lon_edge(2) = lon_edge(1) + (loniop(2) - loniop(1)) * r2d + end if + + lat_edge(1) = latiop(latidx) * r2d - .5_r8*(latiop(2) - latiop(1)) * r2d + + if (latidx.lt.platiop) then + lat_edge(2) = latiop(latidx+1) * r2d - .5_r8*(latiop(2) - latiop(1)) * r2d + else + lat_edge(2) = lat_edge(1) + (latiop(2) - latiop(1)) * r2d + end if + else + do i = 1,plon + lon_edge(i) = lam(i) * r2d - .5_r8*(lam(2) - lam(1)) * r2d + end do + lon_edge(plon+1) = lon_edge(plon) + (lam(2) - lam(1)) * r2d + if( .not. has_npole ) then + do j = 1,plat+1 + lat_edge(j) = phi(j) * r2d - .5_r8*(phi(2) - phi(1)) * r2d + end do + else + do j = 1,plat + lat_edge(j) = phi(j) * r2d - .5_r8*(phi(2) - phi(1)) * r2d + end do + lat_edge(plat+1) = lat_edge(plat) + (phi(2) - phi(1)) * r2d + end if + end if + do j = 1,plat+1 + lat_edge(j) = min( lat_edge(j), 90._r8 ) + lat_edge(j) = max( lat_edge(j),-90._r8 ) + end do + + !------------------------------------------------------------------------------------- + ! wrap around the longitudes + !------------------------------------------------------------------------------------- + do i = -veg_ext,0 + lon_veg_edge_ext(i) = lon_veg_edge(nlon_veg+i) - 360._r8 + mapping_ext (i) = nlon_veg+i + end do + do i = 1,nlon_veg + lon_veg_edge_ext(i) = lon_veg_edge(i) + mapping_ext (i) = i + end do + do i = nlon_veg+1,nlon_veg+veg_ext + lon_veg_edge_ext(i) = lon_veg_edge(i-nlon_veg) + 360._r8 + mapping_ext (i) = i-nlon_veg + end do +#ifdef DEBUG + write(iulog,*) 'interp_map : lon_edge ',lon_edge + write(iulog,*) 'interp_map : lat_edge ',lat_edge + write(iulog,*) 'interp_map : mapping_ext ',mapping_ext +#endif + do j = 1,plon+1 + lon1 = lon_edge(j) + do i = -veg_ext,nlon_veg+veg_ext + dx = lon_veg_edge_ext(i ) - lon1 + dy = lon_veg_edge_ext(i+1) - lon1 + if( dx*dy <= 0._r8 ) then + ind_lon(j) = i + exit + end if + end do + end do + + do j = 1,plat+1 + lat1 = lat_edge(j) + do i = 1,nlat_veg + dx = lat_veg_edge(i ) - lat1 + dy = lat_veg_edge(i+1) - lat1 + if( dx*dy <= 0._r8 ) then + ind_lat(j) = i + exit + end if + end do + end do +#ifdef DEBUG + write(iulog,*) 'interp_map : ind_lon ',ind_lon + write(iulog,*) 'interp_map : ind_lat ',ind_lat +#endif + lat_loop : do j = 1,plat + lon_loop : do i = 1,plon + total_area = 0._r8 + fraction = 0._r8 + total_soilw(:) = 0._r8 + total_soilw_area = 0._r8 + do jj = ind_lat(j),ind_lat(j+1) + y1 = max( lat_edge(j),lat_veg_edge(jj) ) + y2 = min( lat_edge(j+1),lat_veg_edge(jj+1) ) + dy = (y2 - y1)/(lat_veg_edge(jj+1) - lat_veg_edge(jj)) + do ii =ind_lon(i),ind_lon(i+1) + i_ndx = mapping_ext(ii) + x1 = max( lon_edge(i),lon_veg_edge_ext(ii) ) + x2 = min( lon_edge(i+1),lon_veg_edge_ext(ii+1) ) + dx = (x2 - x1)/(lon_veg_edge_ext(ii+1) - lon_veg_edge_ext(ii)) + area = dx * dy + total_area = total_area + area + !----------------------------------------------------------------- + ! ... special case for ocean grid point + !----------------------------------------------------------------- + if( nint(landmask(i_ndx,jj)) == 0 ) then + fraction(npft_veg+1) = fraction(npft_veg+1) + area + else + do n = 1,npft_veg + fraction(n) = fraction(n) + vegetation_map(i_ndx,jj,n) * area + end do + fraction(npft_veg+1) = fraction(npft_veg+1) + area * lake (i_ndx,jj) + fraction(npft_veg+2) = fraction(npft_veg+2) + area * wetland(i_ndx,jj) + fraction(npft_veg+3) = fraction(npft_veg+3) + area * urban (i_ndx,jj) + !----------------------------------------------------------------- + ! ... check if land accounts for the whole area. + ! If not, the remaining area is in the ocean + !----------------------------------------------------------------- + total_land = sum(vegetation_map(i_ndx,jj,:)) & + + urban (i_ndx,jj) & + + lake (i_ndx,jj) & + + wetland(i_ndx,jj) + if( total_land < 1._r8 ) then + fraction(npft_veg+1) = fraction(npft_veg+1) + (1._r8 - total_land) * area + end if + !------------------------------------------------------------------------------------- + ! ... compute weighted average of soilw over grid (non-water only) + !------------------------------------------------------------------------------------- + if( do_soilw ) then + fraction_soilw = total_land - (lake(i_ndx,jj) + wetland(i_ndx,jj)) + total_soilw_area = total_soilw_area + fraction_soilw * area + total_soilw(:) = total_soilw(:) + fraction_soilw * area * soilw_map(i_ndx,jj,:) + end if + end if + end do + end do + !------------------------------------------------------------------------------------- + ! ... divide by total area of grid box + !------------------------------------------------------------------------------------- + fraction(:) = fraction(:)/total_area + !------------------------------------------------------------------------------------- + ! ... make sure we don't have too much or too little + !------------------------------------------------------------------------------------- + if( abs( sum(fraction) - 1._r8) > .001_r8 ) then + fraction(:) = fraction(:)/sum(fraction) + end if + !------------------------------------------------------------------------------------- + ! ... map to Wesely land classification + !------------------------------------------------------------------------------------- + + + + + tmp_frac_lu(i, 1, j) = fraction(20) ! Urban + tmp_frac_lu(i, 2, j) = sum(fraction(16:17)) ! + tmp_frac_lu(i, 3, j) = sum(fraction(13:15)) ! + tmp_frac_lu(i, 4, j) = sum(fraction( 5: 9)) ! + tmp_frac_lu(i, 5, j) = sum(fraction( 2: 4)) ! + tmp_frac_lu(i, 6, j) = fraction(19) ! Wetland + tmp_frac_lu(i, 7, j) = fraction(18) ! Lake + tmp_frac_lu(i, 8, j) = fraction( 1) ! + tmp_frac_lu(i, 9, j) = 0._r8 + tmp_frac_lu(i,10, j) = 0._r8 + tmp_frac_lu(i,11, j) = sum(fraction(10:12)) ! + if( do_soilw ) then + if( total_soilw_area > 0._r8 ) then + tmp_soilw_3d(i,:,j) = total_soilw(:)/total_soilw_area + else + tmp_soilw_3d(i,:,j) = -99._r8 + end if + end if + end do lon_loop + end do lat_loop + !------------------------------------------------------------------------------------- + ! ... reshape according to lat-lon blocks + !------------------------------------------------------------------------------------- + call scatter_field_to_chunk(1,n_land_type,1,plon,tmp_frac_lu,fraction_landuse) + if(do_soilw) call scatter_field_to_chunk(1,12,1,plon,tmp_soilw_3d,soilw_3d) + !------------------------------------------------------------------------------------- + ! ... make sure there are no out of range values + !------------------------------------------------------------------------------------- + where (fraction_landuse < 0._r8) fraction_landuse = 0._r8 + where (fraction_landuse > 1._r8) fraction_landuse = 1._r8 + + end subroutine interp_map + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + subroutine drydep_xactive( ncdate, sfc_temp, pressure_sfc, & + wind_speed, spec_hum, air_temp, pressure_10m, rain, & + snow, solar_flux, dvel, dflx, State_Chm, & + tv, soilw, rh, ncol, lonndx, latndx, lchnk, & + ocnfrc, icefrc, beglandtype, endlandtype ) + !------------------------------------------------------------------------------------- + ! code based on wesely (atmospheric environment, 1989, vol 23, p. 1293-1304) for + ! calculation of r_c, and on walcek et. al. (atmospheric enviroment, 1986, + ! vol. 20, p. 949-964) for calculation of r_a and r_b + ! + ! as suggested in walcek (u_i)(u*_i) = (u_a)(u*_a) + ! is kept constant where i represents a subgrid environment and a the + ! grid average environment. thus the calculation proceeds as follows: + ! va the grid averaged wind is calculated on dots + ! z0(i) the grid averaged roughness coefficient is calculated + ! ri(i) the grid averaged richardson number is calculated + ! --> the grid averaged (u_a)(u*_a) is calculated + ! --> subgrid scale u*_i is calculated assuming (u_i) given as above + ! --> final deposotion velocity is weighted average of subgrid scale velocities + ! + ! code written by P. Hess, rewritten in fortran 90 by JFL (August 2000) + ! modified by JFL to be used in MOZART-2 (October 2002) + !------------------------------------------------------------------------------------- + + use seq_drydep_mod, only: z0, rgso, rgss, h2_a, h2_b, h2_c, ri, rclo, rcls, rlu, rac + use seq_drydep_mod, only: seq_drydep_setHCoeff, foxd, drat + use physconst, only: tmelt + use seq_drydep_mod, only: drydep_method, DD_XLND + + implicit none + + !------------------------------------------------------------------------------------- + ! ... dummy arguments + !------------------------------------------------------------------------------------- + integer, intent(in) :: ncol + integer, intent(in) :: ncdate ! present date (yyyymmdd) + real(r8), intent(in) :: sfc_temp(pcols) ! surface temperature (K) + real(r8), intent(in) :: pressure_sfc(pcols) ! surface pressure (Pa) + real(r8), intent(in) :: wind_speed(pcols) ! 10 meter wind speed (m/s) + real(r8), intent(in) :: spec_hum(pcols) ! specific humidity (kg/kg) + real(r8), intent(in) :: rh(ncol,1) ! relative humidity + real(r8), intent(in) :: air_temp(pcols) ! surface air temperature (K) + real(r8), intent(in) :: pressure_10m(pcols) ! 10 meter pressure (Pa) + real(r8), intent(in) :: rain(pcols) + real(r8), intent(in) :: snow(pcols) ! snow height (m) + real(r8), intent(in) :: soilw(pcols) ! soil moisture fraction + real(r8), intent(in) :: solar_flux(pcols) ! direct shortwave radiation at surface (W/m^2) + real(r8), intent(in) :: tv(pcols) ! potential temperature + type(ChmState), intent(in):: State_Chm ! GEOS-Chem State Chem + real(r8), intent(out) :: dvel(ncol,nTracersMax) ! deposition velocity (cm/s) + real(r8), intent(inout) :: dflx(pcols,nTracersMax) ! deposition flux (/cm^2/s) + + integer, intent(in) :: latndx(pcols) ! chunk latitude indicies + integer, intent(in) :: lonndx(pcols) ! chunk longitude indicies + integer, intent(in) :: lchnk ! chunk number + + integer, intent(in), optional :: beglandtype + integer, intent(in), optional :: endlandtype + + real(r8), intent(in), optional :: ocnfrc(pcols) + real(r8), intent(in), optional :: icefrc(pcols) + + !------------------------------------------------------------------------------------- + ! ... local variables + !------------------------------------------------------------------------------------- + real(r8), parameter :: scaling_to_cm_per_s = 100._r8 + real(r8), parameter :: rain_threshold = 1.e-7_r8 ! of the order of 1cm/day expressed in m/s + + integer :: i, ispec, lt, m + integer :: sndx + integer :: month + + real(r8) :: slope = 0._r8 + real(r8) :: z0water ! revised z0 over water + real(r8) :: p ! pressure at midpoint first layer + real(r8) :: pg ! surface pressure + real(r8) :: es ! saturation vapor pressure + real(r8) :: ws ! saturation mixing ratio + real(r8) :: hvar ! constant to compute xmol + real(r8) :: h ! constant to compute xmol + real(r8) :: psih ! stability correction factor + real(r8) :: rs ! constant for calculating rsmx + real(r8) :: rmx ! resistance by vegetation + real(r8) :: zovl ! ratio of z to m-o length + real(r8) :: cvarb ! cvar averaged over landtypes + real(r8) :: bb ! b averaged over landtypes + real(r8) :: ustarb ! ustar averaged over landtypes + real(r8) :: tc(ncol) ! temperature in celsius + real(r8) :: cts(ncol) ! correction to rlu rcl and rgs for frost + + !------------------------------------------------------------------------------------- + ! local arrays: dependent on location and species + !------------------------------------------------------------------------------------- + real(r8), dimension(ncol,nddvels) :: heff + + !------------------------------------------------------------------------------------- + ! local arrays: dependent on location only + !------------------------------------------------------------------------------------- + integer :: index_season(ncol,n_land_type) + real(r8), dimension(ncol) :: tha ! atmospheric virtual potential temperature + real(r8), dimension(ncol) :: thg ! ground virtual potential temperature + real(r8), dimension(ncol) :: z ! height of lowest level + real(r8), dimension(ncol) :: va ! magnitude of v on cross points + real(r8), dimension(ncol) :: ribn ! richardson number + real(r8), dimension(ncol) :: qs ! saturation specific humidity + real(r8), dimension(ncol) :: crs ! multiplier to calculate crs + real(r8), dimension(ncol) :: rdc ! part of lower canopy resistance + real(r8), dimension(ncol) :: uustar ! u*ustar (assumed constant over grid) + real(r8), dimension(ncol) :: z0b ! average roughness length over grid + real(r8), dimension(ncol) :: wrk ! work array + real(r8), dimension(ncol) :: term ! work array + real(r8), dimension(ncol) :: resc ! work array + real(r8), dimension(ncol) :: lnd_frc ! work array + logical, dimension(ncol) :: unstable + logical, dimension(ncol) :: has_rain + logical, dimension(ncol) :: has_dew + + !------------------------------------------------------------------------------------- + ! local arrays: dependent on location and landtype + !------------------------------------------------------------------------------------- + real(r8), dimension(ncol,n_land_type) :: rds ! resistance for deposition of sulfate + real(r8), dimension(ncol,n_land_type) :: b ! buoyancy parameter for unstable conditions + real(r8), dimension(ncol,n_land_type) :: cvar ! height parameter + real(r8), dimension(ncol,n_land_type) :: ustar ! friction velocity + real(r8), dimension(ncol,n_land_type) :: xmol ! monin-obukhov length + + !------------------------------------------------------------------------------------- + ! local arrays: dependent on location, landtype and species + !------------------------------------------------------------------------------------- + real(r8), dimension(ncol,n_land_type,nTracersMax) :: rsmx ! vegetative resistance (plant mesophyll) + real(r8), dimension(ncol,n_land_type,nTracersMax) :: rclx ! lower canopy resistance + real(r8), dimension(ncol,n_land_type,nTracersMax) :: rlux ! vegetative resistance (upper canopy) + real(r8), dimension(ncol,n_land_type) :: rlux_o3 ! vegetative resistance (upper canopy) + real(r8), dimension(ncol,n_land_type,nTracersMax) :: rgsx ! ground resistance + real(r8) :: pmid(ncol,1) ! for seasalt aerosols + real(r8) :: tfld(ncol,1) ! for seasalt aerosols + real(r8) :: fact, vds + real(r8) :: rc ! combined surface resistance + real(r8) :: var_soilw, dv_soil_h2, fact_h2 ! h2 dvel wrking variables + logical :: fr_lnduse(ncol,n_land_type) ! wrking array + real(r8) :: dewm ! multiplier for rs when dew occurs + + real(r8) :: lcl_frc_landuse(ncol,n_land_type) + + integer :: beglt, endlt + + !------------------------------------------------------------------------------------- + ! jfl : mods for PAN + !------------------------------------------------------------------------------------- + real(r8) :: dv_pan + real(r8) :: c0_pan(11) = (/ 0.000_r8, 0.006_r8, 0.002_r8, 0.009_r8, 0.015_r8, & + 0.006_r8, 0.000_r8, 0.000_r8, 0.000_r8, 0.002_r8, 0.002_r8 /) + real(r8) :: k_pan (11) = (/ 0.000_r8, 0.010_r8, 0.005_r8, 0.004_r8, 0.003_r8, & + 0.005_r8, 0.000_r8, 0.000_r8, 0.000_r8, 0.075_r8, 0.002_r8 /) + + if (present( beglandtype)) then + beglt = beglandtype + else + beglt = 1 + endif + if (present( endlandtype)) then + endlt = endlandtype + else + endlt = n_land_type + endif + + !------------------------------------------------------------------------------------- + ! initialize + !------------------------------------------------------------------------------------- + do m = 1,nTracersMax + dvel(:,m) = 0._r8 + end do + + if( all( .not. has_dvel(:) ) ) then + return + end if + + !------------------------------------------------------------------------------------- + ! define species-dependent parameters (temperature dependent) + !------------------------------------------------------------------------------------- + call seq_drydep_setHCoeff( ncol, sfc_temp, heff ) + + do lt = 1,n_land_type + dep_ra (:,lt,lchnk) = 0._r8 + dep_rb (:,lt,lchnk) = 0._r8 + rds(:,lt) = 0._r8 + end do + + !------------------------------------------------------------------------------------- + ! ... set month + !------------------------------------------------------------------------------------- + month = mod( ncdate,10000 )/100 + + !------------------------------------------------------------------------------------- + ! define which season (relative to Northern hemisphere climate) + !------------------------------------------------------------------------------------- + + !------------------------------------------------------------------------------------- + ! define season index based on fixed LAI + !------------------------------------------------------------------------------------- + if ( drydep_method == DD_XLND ) then + index_season = 4 + else + do i = 1,ncol + index_season(i,:) = index_season_lai(latndx(i),month) + end do + endif + !------------------------------------------------------------------------------------- + ! special case for snow covered terrain + !------------------------------------------------------------------------------------- + do i = 1,ncol + if( snow(i) > .01_r8 ) then + index_season(i,:) = 4 + end if + end do + !------------------------------------------------------------------------------------- + ! scale rain and define logical arrays + !------------------------------------------------------------------------------------- + has_rain(:ncol) = rain(:ncol) > rain_threshold + + !------------------------------------------------------------------------------------- + ! loop over longitude points + !------------------------------------------------------------------------------------- + col_loop : do i = 1,ncol + p = pressure_10m(i) + pg = pressure_sfc(i) + !------------------------------------------------------------------------------------- + ! potential temperature + !------------------------------------------------------------------------------------- + tha(i) = air_temp(i) * (p00/p )**rovcp * (1._r8 + .61_r8*spec_hum(i)) + thg(i) = sfc_temp(i) * (p00/pg)**rovcp * (1._r8 + .61_r8*spec_hum(i)) + !------------------------------------------------------------------------------------- + ! height of 1st level + !------------------------------------------------------------------------------------- + z(i) = - r/grav * air_temp(i) * (1._r8 + .61_r8*spec_hum(i)) * log(p/pg) + !------------------------------------------------------------------------------------- + ! wind speed + !------------------------------------------------------------------------------------- + va(i) = max( .01_r8,wind_speed(i) ) + !------------------------------------------------------------------------------------- + ! Richardson number + !------------------------------------------------------------------------------------- + ribn(i) = z(i) * grav * (tha(i) - thg(i))/thg(i) / (va(i)*va(i)) + ribn(i) = min( ribn(i),ric ) + unstable(i) = ribn(i) < 0._r8 + !------------------------------------------------------------------------------------- + ! saturation vapor pressure (Pascals) + ! saturation mixing ratio + ! saturation specific humidity + !------------------------------------------------------------------------------------- + es = 611._r8*exp( 5414.77_r8*(sfc_temp(i) - tmelt)/(tmelt*sfc_temp(i)) ) + ws = .622_r8*es/(pg - es) + qs(i) = ws/(1._r8 + ws) + has_dew(i) = .false. + if( qs(i) <= spec_hum(i) ) then + has_dew(i) = .true. + end if + if( sfc_temp(i) < tmelt ) then + has_dew(i) = .false. + end if + !------------------------------------------------------------------------------------- + ! constant in determining rs + !------------------------------------------------------------------------------------- + tc(i) = sfc_temp(i) - tmelt + if( sfc_temp(i) > tmelt .and. sfc_temp(i) < 313.15_r8 ) then + crs(i) = (1._r8 + (200._r8/(solar_flux(i) + .1_r8))**2) * (400._r8/(tc(i)*(40._r8 - tc(i)))) + else + crs(i) = large_value + end if + !------------------------------------------------------------------------------------- + ! rdc (lower canopy res) + !------------------------------------------------------------------------------------- + rdc(i) = 100._r8*(1._r8 + 1000._r8/(solar_flux(i) + 10._r8))/(1._r8 + 1000._r8*slope) + end do col_loop + + !------------------------------------------------------------------------------------- + ! ... form working arrays + !------------------------------------------------------------------------------------- + do lt = 1,n_land_type + do i=1,ncol + if ( drydep_method == DD_XLND ) then + lcl_frc_landuse(i,lt) = 0._r8 + else + lcl_frc_landuse(i,lt) = fraction_landuse(i,lt,lchnk) + endif + enddo + end do + if ( present(ocnfrc) .and. present(icefrc) ) then + do i=1,ncol + ! land type 7 is used for ocean + ! land type 8 is used for sea ice + lcl_frc_landuse(i,7) = ocnfrc(i) + lcl_frc_landuse(i,8) = icefrc(i) + enddo + endif + do lt = 1,n_land_type + do i=1,ncol + fr_lnduse(i,lt) = lcl_frc_landuse(i,lt) > 0._r8 + enddo + end do + + !------------------------------------------------------------------------------------- + ! find grid averaged z0: z0bar (the roughness length) z_o=exp[S(f_i*ln(z_oi))] + ! this is calculated so as to find u_i, assuming u*u=u_i*u_i + !------------------------------------------------------------------------------------- + z0b(:) = 0._r8 + do lt = 1,n_land_type + do i = 1,ncol + if( fr_lnduse(i,lt) ) then + z0b(i) = z0b(i) + lcl_frc_landuse(i,lt) * log( z0(index_season(i,lt),lt) ) + end if + end do + end do + + !------------------------------------------------------------------------------------- + ! find the constant velocity uu*=(u_i)(u*_i) + !------------------------------------------------------------------------------------- + do i = 1,ncol + z0b(i) = exp( z0b(i) ) + cvarb = vonkar/log( z(i)/z0b(i) ) + !------------------------------------------------------------------------------------- + ! unstable and stable cases + !------------------------------------------------------------------------------------- + if( unstable(i) ) then + bb = 9.4_r8*(cvarb**2)*sqrt( abs(ribn(i))*z(i)/z0b(i) ) + ustarb = cvarb * va(i) * sqrt( 1._r8 - (9.4_r8*ribn(i)/(1._r8 + 7.4_r8*bb)) ) + else + ustarb = cvarb * va(i)/(1._r8 + 4.7_r8*ribn(i)) + end if + uustar(i) = va(i)*ustarb + end do + + !------------------------------------------------------------------------------------- + ! calculate the friction velocity for each land type u_i=uustar/u*_i + !------------------------------------------------------------------------------------- + do lt = beglt,endlt + do i = 1,ncol + if( fr_lnduse(i,lt) ) then + if( unstable(i) ) then + cvar(i,lt) = vonkar/log( z(i)/z0(index_season(i,lt),lt) ) + b(i,lt) = 9.4_r8*(cvar(i,lt)**2)* sqrt( abs(ribn(i))*z(i)/z0(index_season(i,lt),lt) ) + ustar(i,lt) = sqrt( cvar(i,lt)*uustar(i)*sqrt( 1._r8 - (9.4_r8*ribn(i)/(1._r8 + 7.4_r8*b(i,lt))) ) ) + else + cvar(i,lt) = vonkar/log( z(i)/z0(index_season(i,lt),lt) ) + ustar(i,lt) = sqrt( cvar(i,lt)*uustar(i)/(1._r8 + 4.7_r8*ribn(i)) ) + end if + end if + end do + end do + + !------------------------------------------------------------------------------------- + ! revise calculation of friction velocity and z0 over water + !------------------------------------------------------------------------------------- + lt = 7 + do i = 1,ncol + if( fr_lnduse(i,lt) ) then + if( unstable(i) ) then + z0water = (.016_r8*(ustar(i,lt)**2)/grav) + diffk/(9.1_r8*ustar(i,lt)) + cvar(i,lt) = vonkar/(log( z(i)/z0water )) + b(i,lt) = 9.4_r8*(cvar(i,lt)**2)*sqrt( abs(ribn(i))*z(i)/z0water ) + ustar(i,lt) = sqrt( cvar(i,lt)*uustar(i)* sqrt( 1._r8 - (9.4_r8*ribn(i)/(1._r8+ 7.4_r8*b(i,lt))) ) ) + else + z0water = (.016_r8*(ustar(i,lt)**2)/grav) + diffk/(9.1_r8*ustar(i,lt)) + cvar(i,lt) = vonkar/(log(z(i)/z0water)) + ustar(i,lt) = sqrt( cvar(i,lt)*uustar(i)/(1._r8 + 4.7_r8*ribn(i)) ) + end if + end if + end do + + !------------------------------------------------------------------------------------- + ! compute monin-obukhov length for unstable and stable conditions/ sublayer resistance + !------------------------------------------------------------------------------------- + do lt = beglt,endlt + do i = 1,ncol + if( fr_lnduse(i,lt) ) then + hvar = (va(i)/0.74_r8) * (tha(i) - thg(i)) * (cvar(i,lt)**2) + if( unstable(i) ) then ! unstable + h = hvar*(1._r8 - (9.4_r8*ribn(i)/(1._r8 + 5.3_r8*b(i,lt)))) + else + h = hvar/((1._r8+4.7_r8*ribn(i))**2) + end if + xmol(i,lt) = thg(i) * ustar(i,lt) * ustar(i,lt) / (vonkar * grav * h) + end if + end do + end do + + !------------------------------------------------------------------------------------- + ! psih + !------------------------------------------------------------------------------------- + do lt = beglt,endlt + do i = 1,ncol + if( fr_lnduse(i,lt) ) then + if( xmol(i,lt) < 0._r8 ) then + zovl = z(i)/xmol(i,lt) + zovl = max( -1._r8,zovl ) + psih = exp( .598_r8 + .39_r8*log( -zovl ) - .09_r8*(log( -zovl ))**2 ) + vds = 2.e-3_r8*ustar(i,lt) * (1._r8 + (300/(-xmol(i,lt)))**0.666_r8) + else + zovl = z(i)/xmol(i,lt) + zovl = min( 1._r8,zovl ) + psih = -5._r8 * zovl + vds = 2.e-3_r8*ustar(i,lt) + end if + dep_ra (i,lt,lchnk) = (vonkar - psih*cvar(i,lt))/(ustar(i,lt)*vonkar*cvar(i,lt)) + dep_rb (i,lt,lchnk) = (2._r8/(vonkar*ustar(i,lt))) * crb + rds(i,lt) = 1._r8/vds + end if + end do + end do + + !------------------------------------------------------------------------------------- + ! surface resistance : depends on both land type and species + ! land types are computed seperately, then resistance is computed as average of values + ! following wesely rc=(1/(rs+rm) + 1/rlu +1/(rdc+rcl) + 1/(rac+rgs))**-1 + ! + ! compute rsmx = 1/(rs+rm) : multiply by 3 if surface is wet + !------------------------------------------------------------------------------------- + species_loop1 : do ispec = 1,nTracersMax + if( has_dvel(ispec) ) then + m = map_dvel(ispec) + do lt = beglt,endlt + do i = 1,ncol + if( fr_lnduse(i,lt) ) then + sndx = index_season(i,lt) + if( ispec == o3_ndx .or. ispec == o3a_ndx .or. ispec == so2_ndx ) then + rmx = 0._r8 + else + rmx = 1._r8/(heff(i,m)/3000._r8 + 100._r8*foxd(m)) + end if + cts(i) = 1000._r8*exp( - tc(i) - 4._r8 ) ! correction for frost + rgsx(i,lt,ispec) = cts(i) + 1._r8/((heff(i,m)/(1.e5_r8*rgss(sndx,lt))) + (foxd(m)/rgso(sndx,lt))) + !------------------------------------------------------------------------------------- + ! special case for H2 and CO;; CH4 is set ot a fraction of dv(H2) + !------------------------------------------------------------------------------------- + if( ispec == h2_ndx .or. ispec == co_ndx .or. ispec == ch4_ndx ) then + if( ispec == co_ndx ) then + fact_h2 = 1.0_r8 + elseif ( ispec == h2_ndx ) then + fact_h2 = 0.5_r8 + elseif ( ispec == ch4_ndx ) then + fact_h2 = 50.0_r8 + end if + !------------------------------------------------------------------------------------- + ! no deposition on snow, ice, desert, and water + !------------------------------------------------------------------------------------- + if( lt == 1 .or. lt == 7 .or. lt == 8 .or. sndx == 4 ) then + rgsx(i,lt,ispec) = large_value + else + var_soilw = max( .1_r8,min( soilw(i),.3_r8 ) ) + if( lt == 3 ) then + var_soilw = log( var_soilw ) + end if + dv_soil_h2 = h2_c(lt) + var_soilw*(h2_b(lt) + var_soilw*h2_a(lt)) + if( dv_soil_h2 > 0._r8 ) then + rgsx(i,lt,ispec) = fact_h2/(dv_soil_h2*1.e-4_r8) + end if + end if + end if + if( lt == 7 ) then + rclx(i,lt,ispec) = large_value + rsmx(i,lt,ispec) = large_value + rlux(i,lt,ispec) = large_value + else + rs = ri(sndx,lt)*crs(i) + if ( has_dew(i) .or. has_rain(i) ) then + dewm = 3._r8 + else + dewm = 1._r8 + end if + rsmx(i,lt,ispec) = (dewm*rs*drat(m) + rmx) + !------------------------------------------------------------------------------------- + ! jfl : special case for PAN + !------------------------------------------------------------------------------------- + if( ispec == pan_ndx .or. ispec == xpan_ndx ) then + dv_pan = c0_pan(lt) * (1._r8 - exp( -k_pan(lt)*(dewm*rs*drat(m))*1.e-2_r8 )) + if( dv_pan > 0._r8 .and. sndx /= 4 ) then + rsmx(i,lt,ispec) = ( 1._r8/dv_pan ) + end if + end if + rclx(i,lt,ispec) = cts(i) + 1._r8/((heff(i,m)/(1.e5_r8*rcls(sndx,lt))) + (foxd(m)/rclo(sndx,lt))) + rlux(i,lt,ispec) = cts(i) + rlu(sndx,lt)/(1.e-5_r8*heff(i,m) + foxd(m)) + end if + end if + end do + end do + end if + end do species_loop1 + + do lt = beglt,endlt + if( lt /= 7 ) then + do i = 1,ncol + if( fr_lnduse(i,lt) ) then + sndx = index_season(i,lt) + !------------------------------------------------------------------------------------- + ! ... no effect if sfc_temp < O C + !------------------------------------------------------------------------------------- + if( sfc_temp(i) > tmelt ) then + if( has_dew(i) ) then + rlux_o3(i,lt) = 3000._r8*rlu(sndx,lt)/(1000._r8 + rlu(sndx,lt)) + if( o3_ndx > 0 ) then + rlux(i,lt,o3_ndx) = rlux_o3(i,lt) + endif + if( o3a_ndx > 0 ) then + rlux(i,lt,o3a_ndx) = rlux_o3(i,lt) + endif + end if + if( has_rain(i) ) then + ! rlux(i,lt,o3_ndx) = 1./(1.e-3 + (1./(3.*rlu(sndx,lt)))) + rlux_o3(i,lt) = 3000._r8*rlu(sndx,lt)/(1000._r8 + 3._r8*rlu(sndx,lt)) + if( o3_ndx > 0 ) then + rlux(i,lt,o3_ndx) = rlux_o3(i,lt) + endif + if( o3a_ndx > 0 ) then + rlux(i,lt,o3a_ndx) = rlux_o3(i,lt) + endif + end if + end if + + if ( o3_ndx > 0 ) then + rclx(i,lt,o3_ndx) = cts(i) + rclo(index_season(i,lt),lt) + rlux(i,lt,o3_ndx) = cts(i) + rlux(i,lt,o3_ndx) + end if + if ( o3a_ndx > 0 ) then + rclx(i,lt,o3a_ndx) = cts(i) + rclo(index_season(i,lt),lt) + rlux(i,lt,o3a_ndx) = cts(i) + rlux(i,lt,o3a_ndx) + end if + + end if + end do + end if + end do + + species_loop2 : do ispec = 1,nTracersMax + m = map_dvel(ispec) + if( has_dvel(ispec) ) then + if( ispec /= o3_ndx .and. ispec /= o3a_ndx .and. ispec /= so2_ndx ) then + do lt = beglt,endlt + if( lt /= 7 ) then + do i = 1,ncol + if( fr_lnduse(i,lt) ) then + !------------------------------------------------------------------------------------- + ! no effect if sfc_temp < O C + !------------------------------------------------------------------------------------- + if( sfc_temp(i) > tmelt ) then + if( has_dew(i) ) then + rlux(i,lt,ispec) = 1._r8/((1._r8/(3._r8*rlux(i,lt,ispec))) & + + 1.e-7_r8*heff(i,m) + foxd(m)/rlux_o3(i,lt)) + end if + end if + + end if + end do + end if + end do + else if( ispec == so2_ndx ) then + do lt = beglt,endlt + if( lt /= 7 ) then + do i = 1,ncol + if( fr_lnduse(i,lt) ) then + !------------------------------------------------------------------------------------- + ! no effect if sfc_temp < O C + !------------------------------------------------------------------------------------- + if( sfc_temp(i) > tmelt ) then + if( qs(i) <= spec_hum(i) ) then + rlux(i,lt,ispec) = 100._r8 + end if + if( has_rain(i) ) then + ! rlux(i,lt,ispec) = 1./(2.e-4 + (1./(3.*rlu(index_season(i,lt),lt)))) + rlux(i,lt,ispec) = 15._r8*rlu(index_season(i,lt),lt)/(5._r8 + 3.e-3_r8*rlu(index_season(i,lt),lt)) + end if + end if + rclx(i,lt,ispec) = cts(i) + rcls(index_season(i,lt),lt) + rlux(i,lt,ispec) = cts(i) + rlux(i,lt,ispec) + + end if + end do + end if + end do + do i = 1,ncol + if( fr_lnduse(i,1) .and. (has_dew(i) .or. has_rain(i)) ) then + rlux(i,1,ispec) = 50._r8 + end if + end do + end if + end if + end do species_loop2 + + !------------------------------------------------------------------------------------- + ! compute rc + !------------------------------------------------------------------------------------- + term(:ncol) = 1.e-2_r8 * pressure_10m(:ncol) / (r*tv(:ncol)) + species_loop3 : do ispec = 1,nTracersMax + if( has_dvel(ispec) ) then + wrk(:) = 0._r8 + lt_loop: do lt = beglt,endlt + do i = 1,ncol + if (fr_lnduse(i,lt)) then + resc(i) = 1._r8/( 1._r8/rsmx(i,lt,ispec) + 1._r8/rlux(i,lt,ispec) & + + 1._r8/(rdc(i) + rclx(i,lt,ispec)) & + + 1._r8/(rac(index_season(i,lt),lt) + rgsx(i,lt,ispec))) + + resc(i) = max( 10._r8,resc(i) ) + + lnd_frc(i) = lcl_frc_landuse(i,lt) + endif + enddo + !------------------------------------------------------------------------------------- + ! ... compute average deposition velocity + !------------------------------------------------------------------------------------- + select case( tracerNames(ispec) ) + case( 'SO2' ) + if( lt == 7 ) then + where( fr_lnduse(:ncol,lt) ) + ! assume no surface resistance for SO2 over water` + wrk(:) = wrk(:) + lnd_frc(:)/(dep_ra(:ncol,lt,lchnk) + dep_rb(:ncol,lt,lchnk)) + endwhere + else + where( fr_lnduse(:ncol,lt) ) + wrk(:) = wrk(:) + lnd_frc(:)/(dep_ra(:ncol,lt,lchnk) + dep_rb(:ncol,lt,lchnk) + resc(:)) + endwhere + end if + + ! JFL - increase in dry deposition of SO2 to improve bias over US/Europe + wrk(:) = wrk(:) * 2._r8 + + case( 'SO4' ) + where( fr_lnduse(:ncol,lt) ) + wrk(:) = wrk(:) + lnd_frc(:)/(dep_ra(:ncol,lt,lchnk) + rds(:,lt)) + endwhere + case( 'NH4', 'NH4NO3', 'XNH4NO3' ) + where( fr_lnduse(:ncol,lt) ) + wrk(:) = wrk(:) + lnd_frc(:)/(dep_ra(:ncol,lt,lchnk) + 0.5_r8*rds(:,lt)) + endwhere + + !------------------------------------------------------------------------------------- + ! ... special case for Pb (for consistency with offline code) + !------------------------------------------------------------------------------------- + case( 'Pb' ) + if( lt == 7 ) then + where( fr_lnduse(:ncol,lt) ) + wrk(:) = wrk(:) + lnd_frc(:) * 0.05e-2_r8 + endwhere + else + where( fr_lnduse(:ncol,lt) ) + wrk(:ncol) = wrk(:ncol) + lnd_frc(:ncol) * 0.2e-2_r8 + endwhere + end if + + !------------------------------------------------------------------------------------- + ! ... special case for carbon aerosols + !------------------------------------------------------------------------------------- + case( 'CB1', 'CB2', 'OC1', 'OC2', 'SOAM', 'SOAI', 'SOAT', 'SOAB','SOAX' ) + if ( drydep_method == DD_XLND ) then + where( fr_lnduse(:ncol,lt) ) + wrk(:ncol) = wrk(:ncol) + lnd_frc(:ncol) * 0.10e-2_r8 + endwhere + else + wrk(:ncol) = 0.10e-2_r8 + endif + + !------------------------------------------------------------------------------------- + ! deposition over ocean for HCN, CH3CN + ! velocity estimated from aircraft measurements (E.Apel, INTEX-B) + !------------------------------------------------------------------------------------- + case( 'HCN','CH3CN' ) + if( lt == 7 ) then ! over ocean only + where( fr_lnduse(:ncol,lt) .and. snow(:ncol) < 0.01_r8 ) + wrk(:ncol) = wrk(:ncol) + lnd_frc(:ncol) * 0.2e-2_r8 + endwhere + end if + case default + where( fr_lnduse(:ncol,lt) ) + wrk(:ncol) = wrk(:ncol) + lnd_frc(:ncol)/(dep_ra(:ncol,lt,lchnk) + dep_rb(:ncol,lt,lchnk) + resc(:ncol)) + endwhere + end select + end do lt_loop + dvel(:ncol,ispec) = wrk(:ncol) * scaling_to_cm_per_s + dflx(:ncol,ispec) = term(:ncol) * dvel(:ncol,ispec) * State_Chm%Species(1,:ncol,plev,ispec) + end if + + end do species_loop3 + + if ( beglt > 1 ) return + + !------------------------------------------------------------------------------------- + ! ... special adjustments + !------------------------------------------------------------------------------------- + if( mpan_ndx > 0 ) then + if( has_dvel(mpan_ndx) ) then + dvel(:ncol,mpan_ndx) = dvel(:ncol,mpan_ndx)/3._r8 + dflx(:ncol,mpan_ndx) = term(:ncol) * dvel(:ncol,mpan_ndx) * State_Chm%Species(1,:ncol,plev,mpan_ndx) + end if + end if + if( xmpan_ndx > 0 ) then + if( has_dvel(xmpan_ndx) ) then + dvel(:ncol,xmpan_ndx) = dvel(:ncol,xmpan_ndx)/3._r8 + dflx(:ncol,xmpan_ndx) = term(:ncol) * dvel(:ncol,xmpan_ndx) * State_Chm%Species(1,:ncol,plev,xmpan_ndx) + end if + end if + + ! HCOOH, use CH3COOH dep.vel + if( hcooh_ndx > 0) then + if( has_dvel(hcooh_ndx) ) then + dvel(:ncol,hcooh_ndx) = dvel(:ncol,ch3cooh_ndx) + dflx(:ncol,hcooh_ndx) = term(:ncol) * dvel(:ncol,hcooh_ndx) * State_Chm%Species(1,:ncol,plev,hcooh_ndx) + end if + end if +! +! SOG species +! + if( sogm_ndx > 0) then + if( has_dvel(sogm_ndx) ) then + dvel(:ncol,sogm_ndx) = dvel(:ncol,ch3cooh_ndx) + dflx(:ncol,sogm_ndx) = term(:ncol) * dvel(:ncol,sogm_ndx) * State_Chm%Species(1,:ncol,plev,sogm_ndx) + end if + end if + if( sogi_ndx > 0) then + if( has_dvel(sogi_ndx) ) then + dvel(:ncol,sogi_ndx) = dvel(:ncol,ch3cooh_ndx) + dflx(:ncol,sogi_ndx) = term(:ncol) * dvel(:ncol,sogi_ndx) * State_Chm%Species(1,:ncol,plev,sogi_ndx) + end if + end if + if( sogt_ndx > 0) then + if( has_dvel(sogt_ndx) ) then + dvel(:ncol,sogt_ndx) = dvel(:ncol,ch3cooh_ndx) + dflx(:ncol,sogt_ndx) = term(:ncol) * dvel(:ncol,sogt_ndx) * State_Chm%Species(1,:ncol,plev,sogt_ndx) + end if + end if + if( sogb_ndx > 0) then + if( has_dvel(sogb_ndx) ) then + dvel(:ncol,sogb_ndx) = dvel(:ncol,ch3cooh_ndx) + dflx(:ncol,sogb_ndx) = term(:ncol) * dvel(:ncol,sogb_ndx) * State_Chm%Species(1,:ncol,plev,sogb_ndx) + end if + end if + if( sogx_ndx > 0) then + if( has_dvel(sogx_ndx) ) then + dvel(:ncol,sogx_ndx) = dvel(:ncol,ch3cooh_ndx) + dflx(:ncol,sogx_ndx) = term(:ncol) * dvel(:ncol,sogx_ndx) * State_Chm%Species(1,:ncol,plev,sogx_ndx) + end if + end if +! + end subroutine drydep_xactive + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + subroutine soilw_inti( ncfile, nlon_veg, nlat_veg, soilw_map ) + !------------------------------------------------------------------ + ! ... read primary soil moisture table + !------------------------------------------------------------------ + + use time_manager, only : get_calday + + implicit none + + !------------------------------------------------------------------ + ! ... dummy args + !------------------------------------------------------------------ + integer, intent(in) :: & + nlon_veg, & + nlat_veg + real(r8), pointer :: soilw_map(:,:,:) + character(len=*), intent(in) :: ncfile ! file name of netcdf file containing data + + !------------------------------------------------------------------ + ! ... local variables + !------------------------------------------------------------------ + integer :: gndx = 0 + integer :: nlat, & ! # of lats in soilw file + nlon ! # of lons in soilw file + integer :: i, ip, k, m + integer :: j, jl, ju + integer :: lev, day, ierr + type(file_desc_t) :: piofile + type(var_desc_t) :: vid + + integer :: dimid_lat, dimid_lon, dimid_time + integer :: dates(12) = (/ 116, 214, 316, 415, 516, 615, & + 716, 816, 915, 1016, 1115, 1216 /) + + character(len=shr_kind_cl) :: locfn + + !----------------------------------------------------------------------- + ! ... open netcdf file + !----------------------------------------------------------------------- + call getfil (ncfile, locfn, 0) + call cam_pio_openfile (piofile, trim(locfn), PIO_NOWRITE) + + !----------------------------------------------------------------------- + ! ... get longitudes + !----------------------------------------------------------------------- + ierr = pio_inq_dimid( piofile, 'lon', dimid_lon ) + ierr = pio_inq_dimlen( piofile, dimid_lon, nlon ) + if( nlon /= nlon_veg ) then + write(iulog,*) 'soilw_inti: soil and vegetation lons differ; ',nlon, nlon_veg + call endrun + end if + !----------------------------------------------------------------------- + ! ... get latitudes + !----------------------------------------------------------------------- + ierr = pio_inq_dimid( piofile, 'lat', dimid_lat ) + ierr = pio_inq_dimlen( piofile, dimid_lat, nlat ) + if( nlat /= nlat_veg ) then + write(iulog,*) 'soilw_inti: soil and vegetation lats differ; ',nlat, nlat_veg + call endrun + end if + !----------------------------------------------------------------------- + ! ... set times (days of year) + !----------------------------------------------------------------------- + ierr = pio_inq_dimid( piofile, 'time', dimid_time ) + ierr = pio_inq_dimlen( piofile, dimid_time, ndays ) + if( ndays /= 12 ) then + write(iulog,*) 'soilw_inti: dataset not a cyclical year' + call endrun + end if + allocate( days(ndays),stat=ierr ) + if( ierr /= 0 ) then + write(iulog,*) 'soilw_inti: days allocation error = ',ierr + call endrun + end if + do m = 1,min(12,ndays) + days(m) = get_calday( dates(m), 0 ) + end do + + !------------------------------------------------------------------ + ! ... allocate arrays + !------------------------------------------------------------------ + allocate( soilw_map(nlon,nlat,ndays), stat=ierr ) + if( ierr /= 0 ) then + write(iulog,*) 'soilw_inti: soilw_map allocation error = ',ierr + call endrun + end if + + !------------------------------------------------------------------ + ! ... read in the soil moisture + !------------------------------------------------------------------ + ierr = pio_inq_varid( piofile, 'SOILW', vid ) + ierr = pio_get_var( piofile, vid, soilw_map ) + !------------------------------------------------------------------ + ! ... close file + !------------------------------------------------------------------ + call cam_pio_closefile( piofile ) + + end subroutine soilw_inti + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + subroutine chk_soilw( calday ) + !-------------------------------------------------------------------- + ! ... check timing for ub values + !-------------------------------------------------------------------- + + use mo_constants, only : dayspy + + implicit none + + !-------------------------------------------------------------------- + ! ... dummy args + !-------------------------------------------------------------------- + real(r8), intent(in) :: calday + + !-------------------------------------------------------------------- + ! ... local variables + !-------------------------------------------------------------------- + integer :: m, upper + real(r8) :: numer, denom + + !-------------------------------------------------------- + ! ... setup the time interpolation + !-------------------------------------------------------- + if( calday < days(1) ) then + next = 1 + last = ndays + else + if( days(ndays) < dayspy ) then + upper = ndays + else + upper = ndays - 1 + end if + do m = upper,1,-1 + if( calday >= days(m) ) then + exit + end if + end do + last = m + next = mod( m,ndays ) + 1 + end if + numer = calday - days(last) + denom = days(next) - days(last) + if( numer < 0._r8 ) then + numer = dayspy + numer + end if + if( denom < 0._r8 ) then + denom = dayspy + denom + end if + dels = max( min( 1._r8,numer/denom ),0._r8 ) + + end subroutine chk_soilw + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + subroutine set_soilw( soilw, lchnk, calday ) + !-------------------------------------------------------------------- + ! ... set the soil moisture + !-------------------------------------------------------------------- + + implicit none + + !-------------------------------------------------------------------- + ! ... dummy args + !-------------------------------------------------------------------- + real(r8), intent(inout) :: soilw(pcols) + integer, intent(in) :: lchnk ! chunk indice + real(r8), intent(in) :: calday + + + integer :: i, ilon,ilat + + call chk_soilw( calday ) + + soilw(:) = soilw_3d(:,last,lchnk) + dels *( soilw_3d(:,next,lchnk) - soilw_3d(:,last,lchnk)) + + end subroutine set_soilw + + !------------------------------------------------------------------------------------- + !------------------------------------------------------------------------------------- + function has_drydep( name ) + + implicit none + + character(len=*), intent(in) :: name + + logical :: has_drydep + integer :: i + + has_drydep = .false. + + do i=1,nddvels + if ( trim(name) == trim(drydep_list(i)) ) then + has_drydep = .true. + exit + endif + enddo + + endfunction has_drydep + +end module mo_drydep From 16c3bca49e54a588af9186f9c2165ef96df5e43c Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 18:13:48 -0400 Subject: [PATCH 079/239] Feat: Add Externals to download GEOS-Chem source code --- Externals_CAM.cfg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 3e0e721533..06fd94e697 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -26,6 +26,13 @@ repo_url = https://github.com/CFMIP/COSPv2.0/tags/ tag = v2.0.3cesm/src required = True +[geoschem] +local_path = src/chemistry/pp_geoschem/geoschem_src +protocol = git +tag = CESM +repo_url = https://github.com/fritzt/CESM2-GC_Src +required = True + [externals_description] schema_version = 1.0.0 From cf62332013ff39809484eb9c25dd27ef8f7f741c Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 24 Apr 2020 18:03:54 -0400 Subject: [PATCH 080/239] Feat: Add mo_chem_utils.F90 required for mo_drydep_mod --- src/chemistry/pp_geoschem/mo_chem_utls.F90 | 162 +++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 src/chemistry/pp_geoschem/mo_chem_utls.F90 diff --git a/src/chemistry/pp_geoschem/mo_chem_utls.F90 b/src/chemistry/pp_geoschem/mo_chem_utls.F90 new file mode 100644 index 0000000000..1d709c09dc --- /dev/null +++ b/src/chemistry/pp_geoschem/mo_chem_utls.F90 @@ -0,0 +1,162 @@ + +module mo_chem_utls + + private + public :: get_spc_ndx!, get_het_ndx, get_extfrc_ndx, get_rxt_ndx, get_inv_ndx + + save + +contains + + integer function get_spc_ndx( spc_name ) + !----------------------------------------------------------------------- + ! ... return overall species index associated with spc_name + !----------------------------------------------------------------------- + + use chem_mods, only : nTracers, tracnam => tracerNames + use string_utils, only : to_upper + + implicit none + + !----------------------------------------------------------------------- + ! ... dummy arguments + !----------------------------------------------------------------------- + character(len=*), intent(in) :: spc_name + + !----------------------------------------------------------------------- + ! ... local variables + !----------------------------------------------------------------------- + integer :: m + + get_spc_ndx = -1 + do m = 1, nTracers + if( trim( spc_name ) == trim( to_upper( tracnam(m) ) ) ) then + get_spc_ndx = m + exit + end if + end do + + end function get_spc_ndx + +! integer function get_inv_ndx( invariant ) +! !----------------------------------------------------------------------- +! ! ... return overall external frcing index associated with spc_name +! !----------------------------------------------------------------------- +! +! use chem_mods, only : nfs, inv_lst +! +! implicit none +! +! !----------------------------------------------------------------------- +! ! ... dummy arguments +! !----------------------------------------------------------------------- +! character(len=*), intent(in) :: invariant +! +! !----------------------------------------------------------------------- +! ! ... local variables +! !----------------------------------------------------------------------- +! integer :: m +! +! get_inv_ndx = -1 +! do m = 1,nfs +! if( trim( invariant ) == trim( inv_lst(m) ) ) then +! get_inv_ndx = m +! exit +! end if +! end do +! +! end function get_inv_ndx +! +! integer function get_het_ndx( het_name ) +! !----------------------------------------------------------------------- +! ! ... return overall het process index associated with spc_name +! !----------------------------------------------------------------------- +! +! use gas_wetdep_opts,only : gas_wetdep_method, gas_wetdep_list, gas_wetdep_cnt +! +! implicit none +! +! !----------------------------------------------------------------------- +! ! ... dummy arguments +! !----------------------------------------------------------------------- +! character(len=*), intent(in) :: het_name +! +! !----------------------------------------------------------------------- +! ! ... local variables +! !----------------------------------------------------------------------- +! integer :: m +! +! get_het_ndx=-1 +! +! do m=1,gas_wetdep_cnt +! +! if( trim( het_name ) == trim( gas_wetdep_list(m) ) ) then +! get_het_ndx = get_spc_ndx( gas_wetdep_list(m) ) +! return +! endif +! +! enddo +! +! end function get_het_ndx +! +! integer function get_extfrc_ndx( frc_name ) +! !----------------------------------------------------------------------- +! ! ... return overall external frcing index associated with spc_name +! !----------------------------------------------------------------------- +! +! use chem_mods, only : extcnt, extfrc_lst +! +! implicit none +! +! !----------------------------------------------------------------------- +! ! ... dummy arguments +! !----------------------------------------------------------------------- +! character(len=*), intent(in) :: frc_name +! +! !----------------------------------------------------------------------- +! ! ... local variables +! !----------------------------------------------------------------------- +! integer :: m +! +! get_extfrc_ndx = -1 +! if( extcnt > 0 ) then +! do m = 1,max(1,extcnt) +! if( trim( frc_name ) == trim( extfrc_lst(m) ) ) then +! get_extfrc_ndx = m +! exit +! end if +! end do +! end if +! +! end function get_extfrc_ndx +! +! integer function get_rxt_ndx( rxt_tag ) +! !----------------------------------------------------------------------- +! ! ... return overall external frcing index associated with spc_name +! !----------------------------------------------------------------------- +! +! use chem_mods, only : rxt_tag_cnt, rxt_tag_lst, rxt_tag_map +! +! implicit none +! +! !----------------------------------------------------------------------- +! ! ... dummy arguments +! !----------------------------------------------------------------------- +! character(len=*), intent(in) :: rxt_tag +! +! !----------------------------------------------------------------------- +! ! ... local variables +! !----------------------------------------------------------------------- +! integer :: m +! +! get_rxt_ndx = -1 +! do m = 1,rxt_tag_cnt +! if( trim( rxt_tag ) == trim( rxt_tag_lst(m) ) ) then +! get_rxt_ndx = rxt_tag_map(m) +! exit +! end if +! end do +! +! end function get_rxt_ndx + +end module mo_chem_utls From b91156fd1b410893f37382636a8f2a31bf97b5d2 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 7 May 2020 14:07:34 -0400 Subject: [PATCH 081/239] Feat: Update .exclude --- src/chemistry/pp_geoschem/.exclude | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/chemistry/pp_geoschem/.exclude b/src/chemistry/pp_geoschem/.exclude index 3b9f25f37e..ade57b11d1 100644 --- a/src/chemistry/pp_geoschem/.exclude +++ b/src/chemistry/pp_geoschem/.exclude @@ -3,13 +3,13 @@ transport_mod.F tpcore_window_mod.F90 tpcore_bc_mod.F90 tpcore_fvdas_mod.F90 -olson_landmap_mod.F90 +flexgrid_read_mod.F90 geosfp_read_mod.F90 +get_met_mod.F90 modis_lai_mod.F90 hco_interp_mod.F90 merra2_read_mod.F90 regrid_a2a_mod.F90 -land_mercury_mod.F hcoio_read_std_mod.F90 hcoio_dataread_mod.F90 hco_readlist_mod.F90 @@ -43,8 +43,6 @@ diag3.F hcoi_gc_main_mod.F90 gamap_mod.F initialize.F -mixing_mod.F90 -vdiff_mod.F90 input_mod.F cleanup.F main.F From 5a00847e54212b0dfe51203575b2ae9bc7a5cc56 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 18:25:06 -0400 Subject: [PATCH 082/239] Feat: Import CLM4.0/4.5/5.0 data and use it for GEOS-Chem (1) Import data from CLM (2) Add compset to run GEOS-Chem with CLM4.5/5.0 (3) Add routine getLandTypes to convert CLM to OlsonLandMaps. More work is needed to convert CLM4.5 land types (4) CAM's building procedure has been modified to include the right version of CLM (5) Modify .exclude --- bld/configure | 17 +- cime_config/buildcpp | 9 + cime_config/config_compsets.xml | 10 + src/chemistry/pp_geoschem/.exclude | 1 - src/chemistry/pp_geoschem/chemistry.F90 | 1128 +++++++++++++++++--- src/chemistry/pp_geoschem/getLandTypes.F90 | 218 ++++ src/control/camsrfexch.F90 | 31 +- src/cpl/atm_import_export.F90 | 20 +- src/cpl/cam_cpl_indices.F90 | 15 +- 9 files changed, 1292 insertions(+), 157 deletions(-) create mode 100644 src/chemistry/pp_geoschem/getLandTypes.F90 diff --git a/bld/configure b/bld/configure index 1cce493f5e..1a3096f0ca 100755 --- a/bld/configure +++ b/bld/configure @@ -126,6 +126,9 @@ OPTIONS waccm_ma_sulfur | waccm_sc | waccm_sc_mam4 | waccm_tsmlt_mam4 | terminator | geoschem | none ]. Default: trop_mam4 for cam6 and trop_mam3 for cam5. + -clm_vers Version of land model to use. This option is only used when chem + is set to 'geoschem'. + [ 4.0 | 4.5 | 5.0 ] -[no]clubb_sgs Switch on [off] CLUBB_SGS. Default: on for cam6, otherwise off. -clubb_opts Comma separated list of CLUBB options to turn on/off. By default they are all off. Current option is: clubb_do_adv (Advect CLUBB moments) @@ -303,6 +306,7 @@ GetOptions( "ccsm_seq" => \$opts{'ccsm_seq'}, "cflags=s" => \$opts{'cflags'}, "chem=s" => \$opts{'chem'}, + "clm_vers=s" => \$opts{'clm_vers'}, "clubb_sgs!" => \$opts{'clubb_sgs'}, "clubb_opts=s" => \$opts{'clubb_opts'}, "co2_cycle" => \$opts{'co2_cycle'}, @@ -1430,9 +1434,20 @@ if ($chem_pkg =~ '_mam3') { # TMMF - wedge in GEOS-Chem CPP definitions here if ($chem_pkg =~ 'geoschem') { - $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DMODEL_ -DMODEL_CESM -DUCX -DLINUX_IFORT -DUSE_REAL8 '; + $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DLINUX_IFORT -DUSE_REAL8 -DMODEL_ -DMODEL_CESM'; # TMMF - Temporary fix $chem_nadv = 200; + if (defined $opts{'clm_vers'}) { + if ($opts{'clm_vers'} =~ 'CLM4.0') { + $chem_cppdefs .= ' -DCLM40' + } + elsif ($opts{'clm_vers'} =~ 'CLM4.5') { + $chem_cppdefs .= ' -DCLM45' + } + elsif ($opts{'clm_vers'} =~ 'CLM5.0') { + $chem_cppdefs .= ' -DCLM50' + } + } } diff --git a/cime_config/buildcpp b/cime_config/buildcpp index 7b8f9a8d53..eeb0ab57ad 100644 --- a/cime_config/buildcpp +++ b/cime_config/buildcpp @@ -40,6 +40,7 @@ def buildcpp(case): compiler = case.get_value("COMPILER") # for chem preprocessor nthrds_atm = case.get_value("NTHRDS_ATM") cam_config_opts = case.get_value("CAM_CONFIG_OPTS") + clm_config_opts = case.get_value("CLM_CONFIG_OPTS") # level information for CAM is part of the atm grid name - and must be stripped out nlev = '' @@ -93,6 +94,14 @@ def buildcpp(case): else: config_opts += ["-ocn", comp_ocn] + if '-chem geoschem' in cam_config_opts: + if 'clm4_0' in clm_config_opts: + config_opts += ["-clm_vers", "CLM4.0"] + elif 'clm4_5' in clm_config_opts: + config_opts += ["-clm_vers", "CLM4.5"] + elif 'clm5_0' in clm_config_opts: + config_opts += ["-clm_vers", "CLM5.0"] + # Add user options. config_opts += cam_config_opts.split(" ") diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 50d44b5217..47af3d288a 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -399,6 +399,16 @@ 2000_CAM40%GC_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV + + FGC_CLM45 + 2000_CAM40%GC_CLM45%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV + + + + FGC_CLM50 + 2000_CAM40%GC_CLM50%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV + + diff --git a/src/chemistry/pp_geoschem/.exclude b/src/chemistry/pp_geoschem/.exclude index ade57b11d1..48f78ec307 100644 --- a/src/chemistry/pp_geoschem/.exclude +++ b/src/chemistry/pp_geoschem/.exclude @@ -6,7 +6,6 @@ tpcore_fvdas_mod.F90 flexgrid_read_mod.F90 geosfp_read_mod.F90 get_met_mod.F90 -modis_lai_mod.F90 hco_interp_mod.F90 merra2_read_mod.F90 regrid_a2a_mod.F90 diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 34c95cd106..c5275ff2ed 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -117,9 +117,13 @@ module chemistry CHARACTER(LEN=255) :: ThisLoc CHARACTER(LEN=255) :: ErrMsg -#define ALLDDVEL_GEOSCHEM 0 +#define ALLDDVEL_GEOSCHEM 1 #define OCNDDVEL_GEOSCHEM 0 -#define OCNDDVEL_MOZART 1 +#define OCNDDVEL_MOZART 0 + +! The following flags are only used if ALLDDVEL_GEOSCHEM is on +#define LANDTYPE_HEMCO 0 +#define LANDTYPE_CLM 1 #if ( OCNDDVEL_MOZART ) ! Filenames to compute dry deposition velocities similarly to MOZART @@ -377,8 +381,13 @@ subroutine chem_readnl(nlfile) nIgnored = 0 ! Set paths - inputGeosPath='/home/fritzt/input.geos.template' - chemInputsDir='/net/d06/data/GCdata/ExtData/CHEM_INPUTS/' + ! MIT path + !inputGeosPath='/home/fritzt/input.geos.template' + !chemInputsDir='/net/d06/data/GCdata/ExtData/CHEM_INPUTS/' + ! Cheyenne path + inputGeosPath='/glade/u/home/fritzt/input.geos.template' + chemInputsDir='/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/' + #if ( ALLDDVEL_GEOSCHEM + OCNDDVEL_GEOSCHEM + OCNDDVEL_MOZART != 1 ) IF (MasterProc) THEN @@ -408,6 +417,16 @@ subroutine chem_readnl(nlfile) CALL ENDRUN('Incorrect definitions for dry deposition velocities') ENDIF #endif +#if ( ALLDDVEL_GEOSCHEM && ( LANDTYPE_HEMCO + LANDTYPE_CLM != 1 ) ) + IF (MasterProc) THEN + Write(iulog,'(/,a)') REPEAT( "=", 79 ) + Write(iulog,'(a)') REPEAT( "=", 79 ) + Write(iulog,'(a)') " Preprocessor flags are not set correctly in chemistry.F90" + Write(iulog,'(a)') " Dry-deposition velocities are computed by GEOS-Chem" + Write(iulog,'(a)') " The user needs to decide if land types should be from CLM or from HEMCO" + CALL ENDRUN('Incorrect definitions for source of land type data') + ENDIF +#endif ALLOCATE(drySpc_ndx(nddvels), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate drySpc_ndx') @@ -675,6 +694,10 @@ subroutine chem_init(phys_state, pbuf2d) use Pressure_Mod, only : Init_Pressure, Accept_External_ApBp use Chemistry_Mod, only : Init_Chemistry use UCX_Mod, only : Init_UCX +#if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) + use Olson_Landmap_Mod +#endif + use Mixing_Mod use PBL_Mix_Mod, only : Init_PBL_Mix @@ -902,8 +925,8 @@ subroutine chem_init(phys_state, pbuf2d) ! Now READ_CONVECTION_MENU ! For now, TMMF Input_Opt%LConv = .False. - Input_Opt%LTurb = .False. - Input_Opt%LNLPBL = .False. + Input_Opt%LTurb = .True. + Input_Opt%LNLPBL = .True. ! Now READ_EMISSIONS_MENU Input_Opt%LEmis = .False. @@ -1493,47 +1516,47 @@ subroutine chem_init(phys_state, pbuf2d) !ENDIF ! -#if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) - !! Populate the State_Met%LandTypeFrac field with data from HEMCO - !CALL Init_LandTypeFrac( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & - ! State_Met = State_Met(BEGCHUNK), & - ! RC = RC ) - ! - !IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = 'Error encountered in "Init_LandTypeFrac"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - !ENDIF +#if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) + ! Populate the State_Met%LandTypeFrac field with data from HEMCO + CALL Init_LandTypeFrac( am_I_Root = MasterProc, & + Input_Opt = Input_Opt, & + State_Met = State_Met(BEGCHUNK), & + RC = RC ) - !! Compute the Olson landmap fields of State_Met - !! (e.g. State_Met%IREG, State_Met%ILAND, etc.) - !CALL Compute_Olson_Landmap( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & - ! State_Grid = State_Grid(BEGCHUNK), & - ! State_Met = State_Met(BEGCHUNK), & - ! RC = RC ) - ! - !IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = 'Error encountered in "Compute_Olson_Landmap"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - !ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_LandTypeFrac"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Compute the Olson landmap fields of State_Met + ! (e.g. State_Met%IREG, State_Met%ILAND, etc.) + CALL Compute_Olson_Landmap( am_I_Root = MasterProc, & + Input_Opt = Input_Opt, & + State_Grid = State_Grid(BEGCHUNK), & + State_Met = State_Met(BEGCHUNK), & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Compute_Olson_Landmap"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF #endif ! Initialize PBL quantities but do not do mixing ! Add option for non-local PBL (Lin, 03/31/09) - !CALL Init_Mixing ( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & - ! State_Chm = State_Chm(BEGCHUNK), & - ! State_Diag = State_Diag(BEGCHUNK), & - ! State_Grid = State_Grid(BEGCHUNK), & - ! State_Met = State_Met(BEGCHUNK), & - ! RC = RC ) - ! - !! Trap potential errors - !IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = 'Error encountered in Init_Mixing!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - !ENDIF + CALL Init_Mixing ( am_I_Root = MasterProc, & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(BEGCHUNK), & + State_Diag = State_Diag(BEGCHUNK), & + State_Grid = State_Grid(BEGCHUNK), & + State_Met = State_Met(BEGCHUNK), & + RC = RC ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in Init_Mixing!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF IF (Input_Opt%Its_A_FullChem_Sim .OR. & Input_Opt%Its_An_Aerosol_Sim) THEN @@ -1604,6 +1627,376 @@ subroutine chem_init(phys_state, pbuf2d) !CALL AddFld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) !CALL Add_Default ( 'BCPI', 1, ' ') +#if defined( CLM40 ) + SpcName = 'lu_soil' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_landice' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_deeplake' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_shallowlake' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_wetland' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_urban' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_icemec' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_crop' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') +#elif defined( CLM45 ) || defined( CLM50 ) + SpcName = 'lu_soil' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_crop' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_landice' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_deeplake' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_wetland' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'lu_urban' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') +#endif + SpcName = 'p_notveg' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_needle_eg_temp' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_needle_eg_bor' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_needle_dd_bor' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_broad_eg_trop' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_broad_eg_temp' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_broad_dd_trop' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_broad_dd_temp' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_broad_dd_bor' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_broad_eg_sh' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_broad_dd_temp_sh' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_broad_dd_bor_sh' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_c3_arctic_grass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_c3_narctic_grass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_c4_grass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_c3_crop' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_c3_irrigated' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') +#if defined( CLM40 ) + SpcName = 'p_c3_corn' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_spring_cereal' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_winter_cereal' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_soybean' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') +#elif defined( CLM45 ) || defined( CLM50 ) + SpcName = 'p_temp_corn' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_temp_corn' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_spring_wheat' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_spring_wheat' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_winter_wheat' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_winter_wheat' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_temp_soybean' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_temp_soybean' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_barley' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_barley' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_winter_barley' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_winter_barley' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_rye' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_rye' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_winter_rye' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_winter_rye' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_cassava' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_cassava' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_citrus' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_citrus' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_cocoa' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_cocoa' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_coffee' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_coffee' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_cotton' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_cotton' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_datepalm' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_datepalm' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_foddergrass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_foddergrass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_grapes' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_grapes' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_groundnuts' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_groundnuts' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_millet' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_millet' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_oilpalm' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_oilpalm' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_potatoes' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_potatoes' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_pulses' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_pulses' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_rapeseed' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_rapessed' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_rice' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_rice' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_sorghum' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_sorghum' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_sugarbeet' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_sugarbeet' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_sugarcane' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_sugarcane' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_sunflower' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_sunflower' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_miscanthus' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_miscanthus' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_switchgrass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_switchgrass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_trop_corn' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_trop_corn' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_trop_soybean' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'p_irr_trop_soybean' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') +#endif + SpcName = 'pla_notveg' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_needle_eg_temp' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_needle_eg_bor' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_needle_dd_bor' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_broad_eg_trop' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_broad_eg_temp' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_broad_dd_trop' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_broad_dd_temp' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_broad_dd_bor' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_broad_eg_sh' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_broad_dd_temp_sh' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_broad_dd_bor_sh' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_c3_arctic_grass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_c3_narctic_grass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_c4_grass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_c3_crop' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_c3_irrigated' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') +#if defined( CLM40 ) + SpcName = 'pla_c3_corn' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_spring_cereal' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_winter_cereal' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_soybean' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') +#elif defined( CLM45 ) || defined( CLM50 ) + SpcName = 'pla_temp_corn' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_temp_corn' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_spring_wheat' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_spring_wheat' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_winter_wheat' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_winter_wheat' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_temp_soybean' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_temp_soybean' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_barley' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_barley' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_winter_barley' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_winter_barley' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_rye' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_rye' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_winter_rye' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_winter_rye' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_cassava' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_cassava' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_citrus' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_citrus' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_cocoa' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_cocoa' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_coffee' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_coffee' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_cotton' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_cotton' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_datepalm' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_datepalm' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_foddergrass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_foddergrass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_grapes' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_grapes' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_groundnuts' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_groundnuts' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_millet' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_millet' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_oilpalm' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_oilpalm' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_potatoes' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_potatoes' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_pulses' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_pulses' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_rapeseed' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_rapessed' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_rice' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_rice' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_sorghum' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_sorghum' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_sugarbeet' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_sugarbeet' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_sugarcane' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_sugarcane' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_sunflower' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_sunflower' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_miscanthus' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_miscanthus' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_switchgrass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_switchgrass' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_trop_corn' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_trop_corn' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_trop_soybean' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') + SpcName = 'pla_irr_trop_soybean' + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') +#endif + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT' end subroutine chem_init @@ -1666,6 +2059,10 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use phys_grid, only: get_ncols_p, get_rlat_all_p, get_rlon_all_p use chem_mods, only: drySpc_ndx, map2GC_dryDep +#if ( LANDTYPE_CLM ) + use Olson_Landmap_Mod, only: Compute_Olson_Landmap + use Modis_LAI_Mod, only: Compute_XLAI +#endif #if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) use Drydep_Mod, only: Do_Drydep #elif ( OCNDDVEL_MOZART ) @@ -1673,6 +2070,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) #endif use Drydep_Mod, only: DEPNAME !TMMF, this is just needed for debug use Drydep_Mod, only: Update_DryDepSav + use Mixing_Mod use Dao_Mod, only: Set_Dry_Surface_Pressure use Dao_Mod, only: AirQnt @@ -1764,6 +2162,10 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Deposition flux (/cm^2/s) REAL(r8) :: MOZART_depFlx(State%NCOL, nTracersMax) #endif + REAL(r8), PARAMETER :: zlnd = 0.01_r8 ! Roughness length for soil [m] + REAL(r8), PARAMETER :: zslnd = 0.0024_r8 ! Roughness length for snow [m] + REAL(r8), PARAMETER :: zsice = 0.0400_r8 ! Roughness length for sea ice [m] + REAL(r8), PARAMETER :: zocn = 0.0001_r8 ! Roughness length for oean [m] ! Because of strat chem LOGICAL, SAVE :: SCHEM_READY = .FALSE. @@ -1797,8 +2199,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! For archiving CHARACTER(LEN=255) :: SpcName REAL(r8) :: VMR(State%NCOL,PVER) - REAL(r8) :: MMR0, MMR1, Mass0, Mass1, AirMass - REAL(r8) :: MMR_Min, MMR_Max REAL(r8) :: SlsData(State%NCOL, PVER, nSls) @@ -1829,6 +2229,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Need to update the timesteps throughout the code CALL GC_Update_Timesteps(dT) + ! For safety's sake PTop = State%Pint(1,1)*0.01e+0_fp @@ -1882,7 +2283,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO State_Met(LCHNK)%Area_M2 = State_Grid(LCHNK)%Area_M2 - ! 2. Copy tracers into State_Chm ! Data was received in kg/kg dry State_Chm(LCHNK)%Spc_Units = 'kg/kg dry' @@ -1963,13 +2363,15 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDDO - ! Estimate roughness height VERY roughly Z0 = 0.0e+0_r8 DO J = 1, nY - IF (cam_in%LandFrac(J).GE.0.5e+0_r8) THEN - Z0(J) = 0.035e+0_r8 - ELSE - Z0(J) = 0.0001e+0_r8 + Z0(J) = cam_in%landFrac(J) * zlnd & + + cam_in%iceFrac(J) * zsice & + + cam_in%ocnFrac(J) * zocn + IF (( cam_in%snowhLand(J) > 0.01_r8 ) .OR. & + ( cam_in%snowhIce(J) > 0.01_r8 )) THEN + ! Land is covered in snow + Z0(J) = zslnd ENDIF ENDDO @@ -2043,9 +2445,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Calculate snow depth snowDepth = 0.0e+0_r8 DO J = 1, nY - Sd_Ice = MAX(0.0e+0_r8,cam_in%Snowhice(J)) - Sd_Lnd = MAX(0.0e+0_r8,cam_in%Snowhland(J)) - Frc_Ice = MAX(0.0e+0_r8,cam_in%Icefrac(J)) + Sd_Ice = MAX(0.0e+0_r8,cam_in%snowhIce(J)) + Sd_Lnd = MAX(0.0e+0_r8,cam_in%snowhLand(J)) + Frc_Ice = MAX(0.0e+0_r8,cam_in%iceFrac(J)) IF (Frc_Ice > 0.0e+0_r8) THEN Sd_Avg = (Sd_Lnd*(1.0e+0_r8 - Frc_Ice)) + (Sd_Ice * Frc_Ice) ELSE @@ -2077,6 +2479,22 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%EFLUX (1,:) = cam_in%Lhf(:) State_Met(LCHNK)%HFLUX (1,:) = cam_in%Shf(:) + ! Field : LandTypeFrac + ! Description: Olson fraction per type + ! Unit : - (between 0 and 1) + ! Dimensions : nX, nY, NSURFTYPE + ! Note : Index 1 is water +#if ( LANDTYPE_CLM ) + ! Fill in water + State_Met(LCHNK)%LandTypeFrac(1,:, 1) = cam_in%ocnFrac(:) & + + cam_in%iceFrac(:) +#if ( ALLDDVEL_GEOSCHEM ) + CALL getLandTypes( cam_in, & + nY, & + State_Met(LCHNK) ) +#endif +#endif + ! Field : FRCLND, FRLAND, FROCEAN, FRSEAICE, FRLAKE, FRLANDIC ! Description: Olson land fraction ! Fraction of land @@ -2087,13 +2505,21 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Fraction of snow ! Unit : - ! Dimensions : nX, nY - State_Met(LCHNK)%FRCLND (1,:) = 0.0e+0_fp ! Olson land fraction - State_Met(LCHNK)%FRLAND (1,:) = cam_in%LandFrac(:) - State_Met(LCHNK)%FROCEAN (1,:) = cam_in%OcnFrac(:) + cam_in%IceFrac(:) - State_Met(LCHNK)%FRSEAICE (1,:) = cam_in%IceFrac(:) + State_Met(LCHNK)%FRCLND (1,:) = 1.e+0_fp - & + State_Met(LCHNK)%LandTypeFrac(1,:,1) ! Olson Land Fraction + State_Met(LCHNK)%FRLAND (1,:) = cam_in%landFrac(:) + State_Met(LCHNK)%FROCEAN (1,:) = cam_in%ocnFrac(:) + cam_in%iceFrac(:) + State_Met(LCHNK)%FRSEAICE (1,:) = cam_in%iceFrac(:) +#if ( LANDTYPE_CLM ) + State_Met(LCHNK)%FRLAKE (1,:) = cam_in%lwtgcell(:,3) + & + cam_in%lwtgcell(:,4) + State_Met(LCHNK)%FRLANDIC (1,:) = cam_in%lwtgcell(:,2) + State_Met(LCHNK)%FRSNO (1,:) = 0.0e+0_fp +#else State_Met(LCHNK)%FRLAKE (1,:) = 0.0e+0_fp State_Met(LCHNK)%FRLANDIC (1,:) = 0.0e+0_fp State_Met(LCHNK)%FRSNO (1,:) = 0.0e+0_fp +#endif ! Field : GWETROOT, GWETTOP ! Description: Root and top soil moisture @@ -2109,7 +2535,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%LAI (1,:) = 0.0e+0_fp ! Field : PARDR, PARDF - ! Description: Direct and diffuse photsynthetically active radiation + ! Description: Direct and diffuse photosynthetically active radiation ! Unit : W/m^2 ! Dimensions : nX, nY State_Met(LCHNK)%PARDR (1,:) = 0.0e+0_fp @@ -2206,7 +2632,13 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Friction velocity ! Unit : m/s ! Dimensions : nX, nY - State_Met(LCHNK)%USTAR (1,:) = cam_in%UStar(:) + ! Note : We here combine the land friction velocity (fv) with + ! the ocean friction velocity (ustar) + DO J = 1, nY + State_Met(LCHNK)%USTAR (1,J) = & + cam_in%fv(J) * ( cam_in%landFrac(J)) & + + cam_in%uStar(J) * ( 1.0e+0_fp - cam_in%landFrac(J)) + ENDDO ! Field : Z0 ! Description: Surface roughness length @@ -2215,13 +2647,12 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%Z0 (1,:) = Z0(:) DO J = 1, nY - DO I = 1, nX - iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(I,J) + & - State_Met(LCHNK)%FRLANDIC(I,J) + & - State_Met(LCHNK)%FRLAKE(I,J), & - State_Met(LCHNK)%FRSEAICE(I,J), & - State_Met(LCHNK)%FROCEAN(I,J) - & - State_Met(LCHNK)%FRSEAICE(I,J) /) ) + iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(1,J) + & + State_Met(LCHNK)%FRLANDIC(1,J) + & + State_Met(LCHNK)%FRLAKE(1,J), & + State_Met(LCHNK)%FRSEAICE(1,J), & + State_Met(LCHNK)%FROCEAN(1,J) - & + State_Met(LCHNK)%FRSEAICE(1,J) /) ) IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 ! reset ocean to 0 @@ -2229,8 +2660,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Land/water indices ! Unit : - ! Dimensions : nX, nY - State_Met(LCHNK)%LWI(I,J) = FLOAT( iMaxLoc(1) ) - ENDDO + State_Met(LCHNK)%LWI(1,J) = FLOAT( iMaxLoc(1) ) ENDDO ! Three-dimensional fields on level edges @@ -2744,15 +3174,17 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! and then scale them with the ocean fraction (OCNDDVEL_GEOSCHEM) ! ! A third option would be to let GEOS-Chem compute dry deposition - ! velocity (ALLDDVEL_GEOSCHEM), even though this would not be ideal. + ! velocity (ALLDDVEL_GEOSCHEM), thus overwriting the input from CLM ! - ! drydep_method must be DD_XLND if we want a MOZART-like to compute - ! dry deposition velocities over ocean and ice. + ! drydep_method must be set to DD_XLND. ! ! The following options are currently supported: ! - ALLDDVEL_GEOSCHEM ! - OCNDDVEL_GEOSCHEM + ! - OCNDDVEL_MOZART ! + ! The ALLDDVEL_GEOSCHEM coupled with LANDTYPE_CLM requires that CLM + ! passes land type information (land type and leaf area index). !================================================================== ! ! State_Chm expects dry deposition velocities in m/s, whereas @@ -2766,6 +3198,36 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !================================================================== IF ( Input_Opt%LDryD ) THEN +#if ( LANDTYPE_CLM ) + ! Compute the Olson landmap fields of State_Met + ! (e.g. State_Met%IREG, State_Met%ILAND, etc.) + CALL Compute_Olson_Landmap( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Compute_Olson_Landmap"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Compute State_Met%XLAI (for drydep) and State_Met%MODISLAI, + ! which is the average LAI per grid box (for soil NOx emissions) + CALL Compute_Xlai( am_I_Root = rootChunk, & + Input_Opt = Input_Opt, & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Compute_Xlai"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF +#endif + #if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) ! Compute drydep velocities and update State_Chm%DryDepVel @@ -2779,7 +3241,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Trap potential errors IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Do_Drydep!"!' + ErrMsg = 'Error encountered in "Do_Drydep"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF @@ -2787,31 +3249,31 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO N = 1, nddvels - ! Print debug - IF ( rootChunk .AND. 0 ) THEN - IF ( N == 1 ) THEN - Write(iulog,*) "Number of GC dry deposition species = ", & - SIZE(State_Chm(LCHNK)%DryDepVel(:,:,:),3) - Write(iulog,*) "Number of CESM dry deposition species = ", & - nddvels - ENDIF - Write(iulog,*) "N = ", N - Write(iulog,*) "drySpc_ndx = ", drySpc_ndx(N) - Write(iulog,*) "GC index = ", map2GC_dryDep(N) - IF ( map2GC_dryDep(N) > 0 ) THEN - Write(iulog,*) "GC name = ", TRIM(DEPNAME(map2GC_dryDep(N))) - ENDIF - Write(iulog,*) "dry Species= ", TRIM(drydep_list(N)) - IF ( drySpc_ndx(N) > 0 ) THEN - Write(iulog,*) "tracerName = ", TRIM(tracerNames(drySpc_ndx(N))) - ENDIF - Write(iulog,*) "CLM-depVel = ", & - MAXVAL(cam_in%depvel(:nY,N)) * 1.0e-02_fp, " [m/s]" - IF ( map2GC_dryDep(N) > 0 ) THEN - Write(iulog,*) "GC-depVel = ", & - MAXVAL(State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N))), " [m/s]" - ENDIF - ENDIF + !! Print debug + !IF ( rootChunk ) THEN + ! IF ( N == 1 ) THEN + ! Write(iulog,*) "Number of GC dry deposition species = ", & + ! SIZE(State_Chm(LCHNK)%DryDepVel(:,:,:),3) + ! Write(iulog,*) "Number of CESM dry deposition species = ", & + ! nddvels + ! ENDIF + ! Write(iulog,*) "N = ", N + ! Write(iulog,*) "drySpc_ndx = ", drySpc_ndx(N) + ! Write(iulog,*) "GC index = ", map2GC_dryDep(N) + ! IF ( map2GC_dryDep(N) > 0 ) THEN + ! Write(iulog,*) "GC name = ", TRIM(DEPNAME(map2GC_dryDep(N))) + ! ENDIF + ! Write(iulog,*) "dry Species= ", TRIM(drydep_list(N)) + ! IF ( drySpc_ndx(N) > 0 ) THEN + ! Write(iulog,*) "tracerName = ", TRIM(tracerNames(drySpc_ndx(N))) + ! ENDIF + ! Write(iulog,*) "CLM-depVel = ", & + ! MAXVAL(cam_in%depvel(:nY,N)) * 1.0e-02_fp, " [m/s]" + ! IF ( map2GC_dryDep(N) > 0 ) THEN + ! Write(iulog,*) "GC-depVel = ", & + ! MAXVAL(State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N))), " [m/s]" + ! ENDIF + !ENDIF IF ( map2GC_dryDep(N) > 0 ) THEN ! State_Chm%DryDepVel is in m/s @@ -2871,31 +3333,31 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO N = 1, nddvels - ! Print debug - IF ( rootChunk .AND. 1 ) THEN - IF ( N == 1 ) THEN - Write(iulog,*) "Number of GC dry deposition species = ", & - SIZE(State_Chm(LCHNK)%DryDepVel(:,:,:),3) - Write(iulog,*) "Number of CESM dry deposition species = ", & - nddvels - ENDIF - Write(iulog,*) "N = ", N - Write(iulog,*) "drySpc_ndx = ", drySpc_ndx(N) - Write(iulog,*) "GC index = ", map2GC_dryDep(N) - IF ( map2GC_dryDep(N) > 0 ) THEN - Write(iulog,*) "GC name = ", TRIM(DEPNAME(map2GC_dryDep(N))) - ENDIF - Write(iulog,*) "dry Species= ", TRIM(drydep_list(N)) - IF ( drySpc_ndx(N) > 0 ) THEN - Write(iulog,*) "tracerName = ", TRIM(tracerNames(drySpc_ndx(N))) - ENDIF - Write(iulog,*) "CLM-depVel = ", & - MAXVAL(cam_in%depvel(:nY,N)) * 1.0e-02_fp, " [m/s]", LCHNK - IF ( drySpc_ndx(N) > 0 ) THEN - Write(iulog,*) "Merged depVel = ", & - MAXVAL(MOZART_depVel(:nY,drySpc_ndx(N))) * 1.0e-02_fp, " [m/s]", LCHNK - ENDIF - ENDIF + !! Print debug + !IF ( rootChunk ) THEN + ! IF ( N == 1 ) THEN + ! Write(iulog,*) "Number of GC dry deposition species = ", & + ! SIZE(State_Chm(LCHNK)%DryDepVel(:,:,:),3) + ! Write(iulog,*) "Number of CESM dry deposition species = ", & + ! nddvels + ! ENDIF + ! Write(iulog,*) "N = ", N + ! Write(iulog,*) "drySpc_ndx = ", drySpc_ndx(N) + ! Write(iulog,*) "GC index = ", map2GC_dryDep(N) + ! IF ( map2GC_dryDep(N) > 0 ) THEN + ! Write(iulog,*) "GC name = ", TRIM(DEPNAME(map2GC_dryDep(N))) + ! ENDIF + ! Write(iulog,*) "dry Species= ", TRIM(drydep_list(N)) + ! IF ( drySpc_ndx(N) > 0 ) THEN + ! Write(iulog,*) "tracerName = ", TRIM(tracerNames(drySpc_ndx(N))) + ! ENDIF + ! Write(iulog,*) "CLM-depVel = ", & + ! MAXVAL(cam_in%depvel(:nY,N)) * 1.0e-02_fp, " [m/s]", LCHNK + ! IF ( drySpc_ndx(N) > 0 ) THEN + ! Write(iulog,*) "Merged depVel = ", & + ! MAXVAL(MOZART_depVel(:nY,drySpc_ndx(N))) * 1.0e-02_fp, " [m/s]", LCHNK + ! ENDIF + !ENDIF IF ( ( map2GC_dryDep(N) > 0 ) .AND. ( drySpc_ndx(N) > 0 ) ) THEN ! State_Chm%DryDepVel is in m/s @@ -2919,7 +3381,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met = State_Met(LCHNK), & RC = RC ) - !CALL ENDRUN('Exit on purpose') ENDIF !!=========================================================== @@ -2953,22 +3414,25 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! CALL Error_Stop( ErrMsg, ThisLoc ) !ENDIF - !!=========================================================== - !! ***** M I X E D L A Y E R M I X I N G ***** - !!=========================================================== + !=========================================================== + ! ***** M I X E D L A Y E R M I X I N G ***** + !=========================================================== + + ! Note: mixing routine expects tracers in v/v + ! DO_MIXING applies the tracer tendencies (dry deposition, + ! emission rates) to the tracer arrays and performs PBL + ! mixing. + ! In the non-local PBL scheme, dry deposition and emission + ! fluxes below the PBL are handled within the PBL mixing + ! routine. Otherwise, tracer concentrations are first updated + ! and the full-mixing is then applied. + ! (ckeller, 3/5/15) + ! NOTE: Tracer concentration units are converted locally + ! to [v/v dry air] for mixing. Eventually mixing should + ! be updated to use [kg/kg total air] (ewl, 9/18/15) ! - !! Note: mixing routine expects tracers in v/v - !! DO_MIXING applies the tracer tendencies (dry deposition, - !! emission rates) to the tracer arrays and performs PBL - !! mixing. - !! In the non-local PBL scheme, dry deposition and emission - !! fluxes below the PBL are handled within the PBL mixing - !! routine. Otherwise, tracer concentrations are first updated - !! and the full-mixing is then applied. - !! (ckeller, 3/5/15) - !! NOTE: Tracer concentration units are converted locally - !! to [v/v dry air] for mixing. Eventually mixing should - !! be updated to use [kg/kg total air] (ewl, 9/18/15) + ! This requires HEMCO. For now comment out. + ! Thibaud M. Fritz - 05/07/20 !CALL Do_Mixing( am_I_Root = rootChunk, & ! Input_Opt = Input_Opt, & ! State_Chm = State_Chm(LCHNK), & @@ -2980,9 +3444,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !! Trap potential errors !IF ( RC /= GC_SUCCESS ) THEN ! ErrMsg = 'Error encountered in "Do_Mixing"!' - ! CALL ERror_Stop( ErrMsg, ThisLoc ) + ! CALL Error_Stop( ErrMsg, ThisLoc ) !ENDIF - ! + !!=========================================================== !! ***** C L O U D C O N V E C T I O N ***** !!=========================================================== @@ -3070,9 +3534,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO N = 1, nSls M = map2GC_Sls(N) IF ( M > 0 ) THEN - Mass1 = 0.0e+0_r8 - MMR_Min = 1.0e+9_r8 - MMR_Max = 0.0e+0_r8 DO J = 1, nY DO K = 1, nZ SlsData(J,nZ+1-K,N) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) @@ -3089,22 +3550,387 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( M > 0 ) THEN SpcName = tracerNames(I) VMR = 0.0e+0_r8 - Mass0 = 0.0e+0_r8 - Mass1 = 0.0e+0_r8 DO J = 1, nY DO K = 1, nZ - AirMass = REAL(State_Met(LCHNK)%AD(1,J,K),r8) - MMR0 = MMR_Beg(J,K,M) - MMR1 = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) - VMR(J,nZ+1-K) = MMR1 * MWRatio(I) - Mass0 = Mass0 + (MMR0*AirMass) - Mass1 = Mass1 + (MMR1*AirMass) + VMR(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * MWRatio(I) ENDDO ENDDO CALL OutFld( TRIM(SpcName), VMR(:nY,:), nY, LCHNK ) ENDIF ENDDO +#if defined( CLM40 ) + Write(6,*) "This is CLM40" + SpcName = 'lu_soil' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,1), nY, LCHNK ) + SpcName = 'lu_landice' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,2), nY, LCHNK ) + SpcName = 'lu_deeplake' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,3), nY, LCHNK ) + SpcName = 'lu_shallowlake' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,4), nY, LCHNK ) + SpcName = 'lu_wetland' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,5), nY, LCHNK ) + SpcName = 'lu_urban' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,6), nY, LCHNK ) + SpcName = 'lu_icemec' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,7), nY, LCHNK ) + SpcName = 'lu_crop' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,8), nY, LCHNK ) +#elif defined( CLM45 ) || defined( CLM50 ) + Write(6,*) "This is CLM45" + SpcName = 'lu_soil' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,1), nY, LCHNK ) + SpcName = 'lu_crop' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,2), nY, LCHNK ) + SpcName = 'lu_landice' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,4), nY, LCHNK ) + SpcName = 'lu_deeplake' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,5), nY, LCHNK ) + SpcName = 'lu_wetland' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,6), nY, LCHNK ) + SpcName = 'lu_urban' + CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,7) & + + cam_in%lwtgcell(:,8) & + + cam_in%lwtgcell(:,9), nY, LCHNK ) +#endif + SpcName = 'p_notveg' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,1), nY, LCHNK ) + SpcName = 'p_needle_eg_temp' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,2), nY, LCHNK ) + SpcName = 'p_needle_eg_bor' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,3), nY, LCHNK ) + SpcName = 'p_needle_dd_bor' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,4), nY, LCHNK ) + SpcName = 'p_broad_eg_trop' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,5), nY, LCHNK ) + SpcName = 'p_broad_eg_temp' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,6), nY, LCHNK ) + SpcName = 'p_broad_dd_trop' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,7), nY, LCHNK ) + SpcName = 'p_broad_dd_temp' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,8), nY, LCHNK ) + SpcName = 'p_broad_dd_bor' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,9), nY, LCHNK ) + SpcName = 'p_broad_eg_sh' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,10), nY, LCHNK ) + SpcName = 'p_broad_dd_temp_sh' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,11), nY, LCHNK ) + SpcName = 'p_broad_dd_bor_sh' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,12), nY, LCHNK ) + SpcName = 'p_c3_arctic_grass' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,13), nY, LCHNK ) + SpcName = 'p_c3_narctic_grass' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,14), nY, LCHNK ) + SpcName = 'p_c4_grass' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,15), nY, LCHNK ) + SpcName = 'p_c3_crop' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,16), nY, LCHNK ) + SpcName = 'p_c3_irrigated' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,17), nY, LCHNK ) +#if defined( CLM40 ) + SpcName = 'p_c3_corn' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,18), nY, LCHNK ) + SpcName = 'p_spring_cereal' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,19), nY, LCHNK ) + SpcName = 'p_winter_cereal' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,20), nY, LCHNK ) + SpcName = 'p_soybean' +#elif defined( CLM45 ) || defined( CLM50 ) + SpcName = 'p_temp_corn' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,18), nY, LCHNK ) + SpcName = 'p_irr_temp_corn' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,19), nY, LCHNK ) + SpcName = 'p_spring_wheat' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,20), nY, LCHNK ) + SpcName = 'p_irr_spring_wheat' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,21), nY, LCHNK ) + SpcName = 'p_winter_wheat' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,22), nY, LCHNK ) + SpcName = 'p_irr_winter_wheat' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,23), nY, LCHNK ) + SpcName = 'p_temp_soybean' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,24), nY, LCHNK ) + SpcName = 'p_irr_temp_soybean' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,25), nY, LCHNK ) + SpcName = 'p_barley' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,26), nY, LCHNK ) + SpcName = 'p_irr_barley' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,27), nY, LCHNK ) + SpcName = 'p_winter_barley' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,28), nY, LCHNK ) + SpcName = 'p_irr_winter_barley' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,29), nY, LCHNK ) + SpcName = 'p_rye' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,30), nY, LCHNK ) + SpcName = 'p_irr_rye' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,31), nY, LCHNK ) + SpcName = 'p_winter_rye' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,32), nY, LCHNK ) + SpcName = 'p_irr_winter_rye' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,33), nY, LCHNK ) + SpcName = 'p_cassava' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,34), nY, LCHNK ) + SpcName = 'p_irr_cassava' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,35), nY, LCHNK ) + SpcName = 'p_citrus' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,36), nY, LCHNK ) + SpcName = 'p_irr_citrus' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,37), nY, LCHNK ) + SpcName = 'p_cocoa' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,38), nY, LCHNK ) + SpcName = 'p_irr_cocoa' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,39), nY, LCHNK ) + SpcName = 'p_coffee' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,40), nY, LCHNK ) + SpcName = 'p_irr_coffee' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,41), nY, LCHNK ) + SpcName = 'p_cotton' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,42), nY, LCHNK ) + SpcName = 'p_irr_cotton' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,43), nY, LCHNK ) + SpcName = 'p_datepalm' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,44), nY, LCHNK ) + SpcName = 'p_irr_datepalm' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,45), nY, LCHNK ) + SpcName = 'p_foddergrass' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,46), nY, LCHNK ) + SpcName = 'p_irr_foddergrass' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,47), nY, LCHNK ) + SpcName = 'p_grapes' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,48), nY, LCHNK ) + SpcName = 'p_irr_grapes' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,49), nY, LCHNK ) + SpcName = 'p_groundnuts' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,50), nY, LCHNK ) + SpcName = 'p_irr_groundnuts' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,51), nY, LCHNK ) + SpcName = 'p_millet' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,52), nY, LCHNK ) + SpcName = 'p_irr_millet' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,53), nY, LCHNK ) + SpcName = 'p_oilpalm' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,54), nY, LCHNK ) + SpcName = 'p_irr_oilpalm' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,55), nY, LCHNK ) + SpcName = 'p_potatoes' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,56), nY, LCHNK ) + SpcName = 'p_irr_potatoes' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,57), nY, LCHNK ) + SpcName = 'p_pulses' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,58), nY, LCHNK ) + SpcName = 'p_irr_pulses' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,59), nY, LCHNK ) + SpcName = 'p_rapeseed' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,60), nY, LCHNK ) + SpcName = 'p_irr_rapessed' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,61), nY, LCHNK ) + SpcName = 'p_rice' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,62), nY, LCHNK ) + SpcName = 'p_irr_rice' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,63), nY, LCHNK ) + SpcName = 'p_sorghum' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,64), nY, LCHNK ) + SpcName = 'p_irr_sorghum' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,65), nY, LCHNK ) + SpcName = 'p_sugarbeet' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,66), nY, LCHNK ) + SpcName = 'p_irr_sugarbeet' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,67), nY, LCHNK ) + SpcName = 'p_sugarcane' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,68), nY, LCHNK ) + SpcName = 'p_irr_sugarcane' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,69), nY, LCHNK ) + SpcName = 'p_sunflower' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,70), nY, LCHNK ) + SpcName = 'p_irr_sunflower' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,71), nY, LCHNK ) + SpcName = 'p_miscanthus' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,72), nY, LCHNK ) + SpcName = 'p_irr_miscanthus' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,73), nY, LCHNK ) + SpcName = 'p_switchgrass' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,74), nY, LCHNK ) + SpcName = 'p_irr_switchgrass' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,75), nY, LCHNK ) + SpcName = 'p_trop_corn' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,76), nY, LCHNK ) + SpcName = 'p_irr_trop_corn' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,77), nY, LCHNK ) + SpcName = 'p_trop_soybean' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,78), nY, LCHNK ) + SpcName = 'p_irr_trop_soybean' + CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,79), nY, LCHNK ) +#endif + SpcName = 'pla_notveg' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,1), nY, LCHNK ) + SpcName = 'pla_needle_eg_temp' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,2), nY, LCHNK ) + SpcName = 'pla_needle_eg_bor' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,3), nY, LCHNK ) + SpcName = 'pla_needle_dd_bor' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,4), nY, LCHNK ) + SpcName = 'pla_broad_eg_trop' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,5), nY, LCHNK ) + SpcName = 'pla_broad_eg_temp' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,6), nY, LCHNK ) + SpcName = 'pla_broad_dd_trop' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,7), nY, LCHNK ) + SpcName = 'pla_broad_dd_temp' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,8), nY, LCHNK ) + SpcName = 'pla_broad_dd_bor' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,9), nY, LCHNK ) + SpcName = 'pla_broad_eg_sh' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,10), nY, LCHNK ) + SpcName = 'pla_broad_dd_temp_sh' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,11), nY, LCHNK ) + SpcName = 'pla_broad_dd_bor_sh' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,12), nY, LCHNK ) + SpcName = 'pla_c3_arctic_grass' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,13), nY, LCHNK ) + SpcName = 'pla_c3_narctic_grass' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,14), nY, LCHNK ) + SpcName = 'pla_c4_grass' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,15), nY, LCHNK ) + SpcName = 'pla_c3_crop' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,16), nY, LCHNK ) + SpcName = 'pla_c3_irrigated' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,17), nY, LCHNK ) +#if defined( CLM40 ) + SpcName = 'pla_c3_corn' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,18), nY, LCHNK ) + SpcName = 'pla_spring_cereal' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,19), nY, LCHNK ) + SpcName = 'pla_winter_cereal' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,20), nY, LCHNK ) + SpcName = 'pla_soybean' +#elif defined( CLM45 ) || defined( CLM50 ) + SpcName = 'pla_temp_corn' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,18), nY, LCHNK ) + SpcName = 'pla_irr_temp_corn' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,19), nY, LCHNK ) + SpcName = 'pla_spring_wheat' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,20), nY, LCHNK ) + SpcName = 'pla_irr_spring_wheat' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,21), nY, LCHNK ) + SpcName = 'pla_winter_wheat' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,22), nY, LCHNK ) + SpcName = 'pla_irr_winter_wheat' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,23), nY, LCHNK ) + SpcName = 'pla_temp_soybean' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,24), nY, LCHNK ) + SpcName = 'pla_irr_temp_soybean' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,25), nY, LCHNK ) + SpcName = 'pla_barley' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,26), nY, LCHNK ) + SpcName = 'pla_irr_barley' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,27), nY, LCHNK ) + SpcName = 'pla_winter_barley' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,28), nY, LCHNK ) + SpcName = 'pla_irr_winter_barley' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,29), nY, LCHNK ) + SpcName = 'pla_rye' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,30), nY, LCHNK ) + SpcName = 'pla_irr_rye' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,31), nY, LCHNK ) + SpcName = 'pla_winter_rye' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,32), nY, LCHNK ) + SpcName = 'pla_irr_winter_rye' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,33), nY, LCHNK ) + SpcName = 'pla_cassava' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,34), nY, LCHNK ) + SpcName = 'pla_irr_cassava' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,35), nY, LCHNK ) + SpcName = 'pla_citrus' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,36), nY, LCHNK ) + SpcName = 'pla_irr_citrus' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,37), nY, LCHNK ) + SpcName = 'pla_cocoa' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,38), nY, LCHNK ) + SpcName = 'pla_irr_cocoa' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,39), nY, LCHNK ) + SpcName = 'pla_coffee' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,40), nY, LCHNK ) + SpcName = 'pla_irr_coffee' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,41), nY, LCHNK ) + SpcName = 'pla_cotton' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,42), nY, LCHNK ) + SpcName = 'pla_irr_cotton' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,43), nY, LCHNK ) + SpcName = 'pla_datepalm' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,44), nY, LCHNK ) + SpcName = 'pla_irr_datepalm' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,45), nY, LCHNK ) + SpcName = 'pla_foddergrass' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,46), nY, LCHNK ) + SpcName = 'pla_irr_foddergrass' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,47), nY, LCHNK ) + SpcName = 'pla_grapes' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,48), nY, LCHNK ) + SpcName = 'pla_irr_grapes' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,49), nY, LCHNK ) + SpcName = 'pla_groundnuts' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,50), nY, LCHNK ) + SpcName = 'pla_irr_groundnuts' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,51), nY, LCHNK ) + SpcName = 'pla_millet' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,52), nY, LCHNK ) + SpcName = 'pla_irr_millet' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,53), nY, LCHNK ) + SpcName = 'pla_oilpalm' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,54), nY, LCHNK ) + SpcName = 'pla_irr_oilpalm' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,55), nY, LCHNK ) + SpcName = 'pla_potatoes' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,56), nY, LCHNK ) + SpcName = 'pla_irr_potatoes' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,57), nY, LCHNK ) + SpcName = 'pla_pulses' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,58), nY, LCHNK ) + SpcName = 'pla_irr_pulses' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,59), nY, LCHNK ) + SpcName = 'pla_rapeseed' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,60), nY, LCHNK ) + SpcName = 'pla_irr_rapessed' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,61), nY, LCHNK ) + SpcName = 'pla_rice' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,62), nY, LCHNK ) + SpcName = 'pla_irr_rice' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,63), nY, LCHNK ) + SpcName = 'pla_sorghum' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,64), nY, LCHNK ) + SpcName = 'pla_irr_sorghum' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,65), nY, LCHNK ) + SpcName = 'pla_sugarbeet' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,66), nY, LCHNK ) + SpcName = 'pla_irr_sugarbeet' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,67), nY, LCHNK ) + SpcName = 'pla_sugarcane' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,68), nY, LCHNK ) + SpcName = 'pla_irr_sugarcane' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,69), nY, LCHNK ) + SpcName = 'pla_sunflower' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,70), nY, LCHNK ) + SpcName = 'pla_irr_sunflower' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,71), nY, LCHNK ) + SpcName = 'pla_miscanthus' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,72), nY, LCHNK ) + SpcName = 'pla_irr_miscanthus' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,73), nY, LCHNK ) + SpcName = 'pla_switchgrass' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,74), nY, LCHNK ) + SpcName = 'pla_irr_switchgrass' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,75), nY, LCHNK ) + SpcName = 'pla_trop_corn' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,76), nY, LCHNK ) + SpcName = 'pla_irr_trop_corn' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,77), nY, LCHNK ) + SpcName = 'pla_trop_soybean' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,78), nY, LCHNK ) + SpcName = 'pla_irr_trop_soybean' + CALL OutFld( TRIM(SpcName), cam_in%lai(:,79), nY, LCHNK ) +#endif + DO N = 1, nSls SpcName = slsNames(n) VMR = 0.0e+0_r8 diff --git a/src/chemistry/pp_geoschem/getLandTypes.F90 b/src/chemistry/pp_geoschem/getLandTypes.F90 new file mode 100644 index 0000000000..9852d706f5 --- /dev/null +++ b/src/chemistry/pp_geoschem/getLandTypes.F90 @@ -0,0 +1,218 @@ +!------------------------------------------------------------------------------ +!BOP +! +! !ROUTINE: getLandTypes.F90 +! +! !DESCRIPTION: Subroutine getLandTypes converts the land types and leaf +! area indices from the land model to the LandTypeFrac and XLAI_NATIVE +! arrays in GEOS-Chem. +! +! !INTERFACE: +! + SUBROUTINE getLandTypes( cam_in, nY, State_Met ) +! +! !USES: +! + USE camsrfexch, ONLY : cam_in_t + USE State_Met_Mod, ONLY : MetState + USE seq_drydep_mod, ONLY : NPatch + USE shr_kind_mod, ONLY : r8 => shr_kind_r8 + USE PRECISION_MOD, ONLY : fp, f4 ! Flexible precision + USE CMN_SIZE_Mod, ONLY : NSURFTYPE + USE cam_abortutils, ONLY : endrun + IMPLICIT NONE +! +! !INPUT PARAMETERS: +! + TYPE(cam_in_t), INTENT(IN ) :: cam_in ! CAM + INTEGER, INTENT(IN ) :: nY ! Number of grid cells on chunk +! +! !INPUT/OUTPUT PARAMETERS: +! + TYPE(MetState), INTENT(INOUT) :: State_Met +! +! !REVISION HISTORY: +! 8 May 2020 - Thibaud M. Fritz - Initial version +!EOP +!------------------------------------------------------------------------------ +!BOC +! +! !LOCAL VARIABLES: +! + INTEGER :: J, T + REAL(r8) :: waterFrac, landFrac + +#if defined( CLM40 ) + + ! Mapping for CLM4.0 + ! -----------------------------------|-------------------------------------- + ! Olson land type | CLM land type + ! -----------------------------------|-------------------------------------- + ! Inland/sea water (ID = 1) | Ocean fraction + ! | Deeplake & Shallowlake (LUID =3/4) + ! Urban (ID = 2) | Urban - Not Applied (LUID = 6) + ! Low Sparse Grassland (ID = 3) | + ! Coniferous Forest (ID = 4) | + ! Deciduous Conifer Forest (ID = 5) | Needleleaf Deciduous Bor. (PAID = 3) + ! Deciduous Broadleaf For. (ID = 6) | + ! Evergreen Broadleaf For. (ID = 7) | + ! Tall Grasses and Shrubs (ID = 8) | + ! Bare Desert (ID = 9) | Not veg. \ Ice (PAID = 0\LUID = 2) + ! Upland Tundra (ID = 10) | Broadleaf Deciduous Bore. (PAID = 11) + ! Irrigated Grassland (ID = 11) | C3 Irrigated (PAID = 16) + ! Semi Desert (ID = 12) | + ! Glacier ice (ID = 13) | Land ice (LUID = 2) + ! Wooded Wet Swamp (ID = 14) | + ! - (ID = 15) | + ! - (ID = 16) | + ! Shrub Evergreen (ID = 17) | + ! - (ID = 18) | + ! Shrub Deciduous (ID = 19) | + ! Evergreen Forest and Fi. (ID = 20) | + ! Cool Rain Forest (ID = 21) | + ! Conifer Boreal Forest (ID = 22) | Needleleaf Evergreen Bor. (PAID = 2) + ! Cool Conifer Forest (ID = 23) | + ! Cool Mixed Forest (ID = 24) | Broadleaf Deciduous Bore. (PAID = 8) + ! Mixed Forest (ID = 25) | + ! Cool Broadleaf Forest (ID = 26) | Broadleaf Deciduous Temp. (PAID = 7) + ! Deciduous Broadleaf For. (ID = 27) | + ! Conifer Forest (ID = 28) | Needleleaf Evergreen Tem. (PAID = 1) + ! Montane Tropical Forests (ID = 29) | + ! Seasonal Tropical Fores. (ID = 30) | + ! Cool Crops and Towns (ID = 31) | Winter Temp. Cereal (PAID = 19) + ! Crops and Town (ID = 32) | C3 Crop (PAID = 15) + ! | Spring Temp. Cereal (PAID = 18) + ! Dry Tropical Woods (ID = 33) | + ! Tropical Rainforest (ID = 34) | Broadleaf Evergreen Trop. (PAID = 4) + ! Tropical Degraded Forest (ID = 35) | + ! Corn and Beans Cropland (ID = 36) | Corn (PAID = 17) + ! | Soybean (PAID = 20) + ! Rice Paddy and Field (ID = 37) | + ! Hot Irrigated Cropland (ID = 38) | + ! Cool Irrigated Cropland (ID = 39) | + ! - (ID = 40) | + ! Cool Grasses and Shrubs (ID = 41) | + ! Hot and Mild Grasses and (ID = 42) | C3 Non-Arctic Grass (PAID = 13) + ! Cold Grassland (ID = 43) | C3 Arctic Grass (PAID = 12) + ! Savanna (Woods) (ID = 44) | Broadleaf Deciduous Trop. (PAID = 6) + ! | C4 Grass (PAID = 14) + ! Mire, Bog, Fen (ID = 45) | Wetland - Not Applied (LUID = 5) + ! Marsh Wetland (ID = 46) | + ! Mediterranean Scrub (ID = 47) | Broadleaf Evergreen Shru. (PAID = 9) + ! Dry Woody Scrub (ID = 48) | + ! - (ID = 49) | + ! - (ID = 50) | + ! - (ID = 51) | + ! Semi Desert Shrubs (ID = 52) | Broadleaf Deciduous Temp. (PAID = 10) + ! Semi Desert Sage (ID = 53) | + ! Barren Tundra (ID = 54) | + ! Cool Southern Hemisphere (ID = 55) | Broadleaf Evergreen Temp. (PAID = 5) + ! Cool Fields and Woods (ID = 56) | + ! Forest and Field (ID = 57) | + ! Cool Forest and Field (ID = 58) | + ! Fields and Woody Savanna (ID = 59) | + ! Succulent and Thorn Scr. (ID = 60) | + ! Small Leaf Mixed Woods (ID = 61) | + ! Deciduous and Mixed Bor. (ID = 62) | + ! Narrow Conifers (ID = 63) | + ! Wooded Tundra (ID = 64) | + ! Heath Scrub (ID = 65) | + ! - (ID = 66) | + ! - (ID = 67) | + ! - (ID = 68) | + ! - (ID = 69) | + ! Polar and Alpine Desert (ID = 70) | + ! - (ID = 71) | + ! - (ID = 72) | + ! Mangrove (ID = 73) | + + !================================================================== + ! The urban and wetland land unit types seem to be already + ! accounted for in patches, as it introduces total land fractions + ! (summed over all types) greater than 100%. + ! Thibaud M. Fritz - 06 May 2020 + !================================================================== + + DO J = 1, nY + waterFrac = cam_in%ocnFrac(J) + cam_in%iceFrac(J) & + + cam_in%lwtgcell(J,3) + cam_in%lwtgcell(J,4) + landFrac = 1.0e+0_fp - waterFrac + + ! Initialize fraction land for this grid cell + State_Met%LandTypeFrac(1,J, 1) = waterFrac + !State_Met%LandTypeFrac(1,J, 2) = cam_in%lwtgcell(J, 6) + State_Met%LandTypeFrac(1,J, 9) = cam_in%pwtgcell(J, 1) & + - cam_in%lwtgcell(J, 2) + State_Met%LandTypeFrac(1,J,10) = cam_in%pwtgcell(J,12) + State_Met%LandTypeFrac(1,J,13) = cam_in%lwtgcell(J, 2) + State_Met%LandTypeFrac(1,J,24) = cam_in%pwtgcell(J, 9) + State_Met%LandTypeFrac(1,J,26) = cam_in%pwtgcell(J, 8) + !State_Met%LandTypeFrac(1,J,45) = cam_in%lwtgcell(J, 5) + State_Met%LandTypeFrac(1,J,52) = cam_in%pwtgcell(J,11) + State_Met%LandTypeFrac(1,J,47) = cam_in%pwtgcell(J,10) + State_Met%LandTypeFrac(1,J,55) = cam_in%pwtgcell(J, 6) + State_Met%LandTypeFrac(1,J,34) = cam_in%pwtgcell(J, 5) + State_Met%LandTypeFrac(1,J,43) = cam_in%pwtgcell(J,13) + State_Met%LandTypeFrac(1,J,42) = cam_in%pwtgcell(J,14) + State_Met%LandTypeFrac(1,J,32) = cam_in%pwtgcell(J,16) + State_Met%LandTypeFrac(1,J,44) = cam_in%pwtgcell(J,15) + State_Met%LandTypeFrac(1,J, 5) = cam_in%pwtgcell(J, 4) + State_Met%LandTypeFrac(1,J,22) = cam_in%pwtgcell(J, 3) + State_Met%LandTypeFrac(1,J,28) = cam_in%pwtgcell(J, 2) + State_Met%LandTypeFrac(1,J,44) = & + State_Met%LandTypeFrac(1,J,44) + cam_in%pwtgcell(J, 7) + State_Met%LandTypeFrac(1,J,11) = cam_in%pwtgcell(J,17) + State_Met%LandTypeFrac(1,J,36) = cam_in%pwtgcell(J,18) + State_Met%LandTypeFrac(1,J,31) = cam_in%pwtgcell(J,20) + State_Met%LandTypeFrac(1,J,32) = & + State_Met%LandTypeFrac(1,J,32) + cam_in%pwtgcell(J,19) + State_Met%LandTypeFrac(1,J,36) = & + State_Met%LandTypeFrac(1,J,36) + cam_in%pwtgcell(J,21) + + State_Met%XLAI_NATIVE(1,J,10) = cam_in%lai(J,12) + State_Met%XLAI_NATIVE(1,J,24) = cam_in%lai(J, 9) + State_Met%XLAI_NATIVE(1,J,26) = cam_in%lai(J, 8) + State_Met%XLAI_NATIVE(1,J,52) = cam_in%lai(J,11) + State_Met%XLAI_NATIVE(1,J,47) = cam_in%lai(J,10) + State_Met%XLAI_NATIVE(1,J,55) = cam_in%lai(J, 6) + State_Met%XLAI_NATIVE(1,J,34) = cam_in%lai(J, 5) + State_Met%XLAI_NATIVE(1,J,43) = cam_in%lai(J,13) + State_Met%XLAI_NATIVE(1,J,42) = cam_in%lai(J,14) + State_Met%XLAI_NATIVE(1,J,32) = cam_in%lai(J,16) + State_Met%XLAI_NATIVE(1,J,44) = cam_in%lai(J,15) + State_Met%XLAI_NATIVE(1,J, 5) = cam_in%lai(J, 4) + State_Met%XLAI_NATIVE(1,J,22) = cam_in%lai(J, 3) + State_Met%XLAI_NATIVE(1,J,28) = cam_in%lai(J, 2) + State_Met%XLAI_NATIVE(1,J,44) = & + State_Met%XLAI_NATIVE(1,J,44) + cam_in%lai(J, 7) + State_Met%XLAI_NATIVE(1,J,11) = cam_in%lai(J,17) + State_Met%XLAI_NATIVE(1,J,36) = cam_in%lai(J,18) + State_Met%XLAI_NATIVE(1,J,31) = cam_in%lai(J,20) + State_Met%XLAI_NATIVE(1,J,32) = & + State_Met%XLAI_NATIVE(1,J,32) + cam_in%lai(J,19) + State_Met%XLAI_NATIVE(1,J,36) = & + State_Met%XLAI_NATIVE(1,J,36) + cam_in%lai(J,21) + + DO T = 2, NSURFTYPE + State_Met%LandTypeFrac(1,J,T) = & + State_Met%LandTypeFrac(1,J,T) * landFrac + + State_Met%XLAI_NATIVE(1,J,T) = & + State_Met%XLAI_NATIVE(1,J,T) * landFrac + + ! Make sure that the land type fractions do not exceed 1 + IF ( State_Met%LandTypeFrac(1,J,T) > 1.0e+0_fp ) THEN + State_Met%LandTypeFrac(1,J,T) = 1.0e+0_fp + ELSEIF ( State_Met%LandTypeFrac(1,J,T) < 0.0e+0_fp ) THEN + State_Met%LandTypeFrac(1,J,T) = 0.0e+0_fp + ENDIF + ENDDO + + ENDDO +#elif defined( CLM45 ) || defined( CLM50 ) +#else + CALL endrun('Cannot figure out which version of CLM') +#endif + + END SUBROUTINE getLandTypes +!EOC diff --git a/src/control/camsrfexch.F90 b/src/control/camsrfexch.F90 index d48e42b433..fae49a18ab 100644 --- a/src/control/camsrfexch.F90 +++ b/src/control/camsrfexch.F90 @@ -120,6 +120,9 @@ module camsrfexch real(r8) :: re(pcols) ! atm/ocn saved version of re real(r8) :: ssq(pcols) ! atm/ocn saved version of ssq real(r8), pointer, dimension(:,:) :: depvel ! deposition velocities + real(r8), pointer, dimension(:,:) :: lwtgcell ! landunit areas + real(r8), pointer, dimension(:,:) :: pwtgcell ! patch areas + real(r8), pointer, dimension(:,:) :: lai ! leaf area indices real(r8), pointer, dimension(:,:) :: dstflx ! dust fluxes real(r8), pointer, dimension(:,:) :: meganflx ! MEGAN fluxes real(r8), pointer, dimension(:,:) :: fireflx ! wild fire emissions @@ -146,7 +149,7 @@ module camsrfexch ! !INTERFACE ! subroutine hub2atm_alloc( cam_in ) - use seq_drydep_mod, only: lnd_drydep, n_drydep + use seq_drydep_mod, only: lnd_drydep, n_drydep, NLUse, NPatch use cam_cpl_indices, only: index_x2a_Sl_ram1, index_x2a_Sl_fv, index_x2a_Sl_soilw, index_x2a_Fall_flxdst1 use cam_cpl_indices, only: index_x2a_Fall_flxvoc use shr_megan_mod, only: shr_megan_mechcomps_n @@ -177,6 +180,9 @@ subroutine hub2atm_alloc( cam_in ) nullify(cam_in(c)%fv) nullify(cam_in(c)%soilw) nullify(cam_in(c)%depvel) + nullify(cam_in(c)%lwtgcell) + nullify(cam_in(c)%pwtgcell) + nullify(cam_in(c)%lai) nullify(cam_in(c)%dstflx) nullify(cam_in(c)%meganflx) nullify(cam_in(c)%fireflx) @@ -210,6 +216,12 @@ subroutine hub2atm_alloc( cam_in ) do c = begchunk,endchunk allocate (cam_in(c)%depvel(pcols,n_drydep), stat=ierror) if ( ierror /= 0 ) call endrun('HUB2ATM_ALLOC error: allocation error depvel') + allocate (cam_in(c)%lwtgcell(pcols,NLUse), stat=ierror) + if ( ierror /= 0 ) call endrun('HUB2ATM_ALLOC error: allocation error lwtgcell') + allocate (cam_in(c)%pwtgcell(pcols,NPatch), stat=ierror) + if ( ierror /= 0 ) call endrun('HUB2ATM_ALLOC error: allocation error pwtgcell') + allocate (cam_in(c)%lai(pcols,NPatch), stat=ierror) + if ( ierror /= 0 ) call endrun('HUB2ATM_ALLOC error: allocation error lai') end do endif @@ -266,6 +278,11 @@ subroutine hub2atm_alloc( cam_in ) if (lnd_drydep .and. n_drydep>0) then cam_in(c)%depvel (:,:) = 0._r8 endif + if (lnd_drydep) then + cam_in(c)%lwtgcell (:,:) = 0._r8 + cam_in(c)%pwtgcell (:,:) = 0._r8 + cam_in(c)%lai (:,:) = 0._r8 + endif if ( index_x2a_Fall_flxfire>0 .and. shr_fire_emis_mechcomps_n>0 ) then cam_in(c)%fireflx(:,:) = 0._r8 cam_in(c)%fireztop(:) = 0._r8 @@ -411,6 +428,18 @@ subroutine hub2atm_deallocate(cam_in) deallocate(cam_in(c)%depvel) nullify(cam_in(c)%depvel) end if + if(associated(cam_in(c)%lwtgcell)) then + deallocate(cam_in(c)%lwtgcell) + nullify(cam_in(c)%lwtgcell) + end if + if(associated(cam_in(c)%pwtgcell)) then + deallocate(cam_in(c)%pwtgcell) + nullify(cam_in(c)%pwtgcell) + end if + if(associated(cam_in(c)%lai)) then + deallocate(cam_in(c)%lai) + nullify(cam_in(c)%lai) + end if enddo diff --git a/src/cpl/atm_import_export.F90 b/src/cpl/atm_import_export.F90 index 8ff1839da6..31e8d803e5 100644 --- a/src/cpl/atm_import_export.F90 +++ b/src/cpl/atm_import_export.F90 @@ -13,7 +13,7 @@ subroutine atm_import( x2a, cam_in, restart_init ) use phys_grid , only: get_ncols_p use ppgrid , only: begchunk, endchunk use shr_const_mod, only: shr_const_stebol - use seq_drydep_mod, only: n_drydep + use seq_drydep_mod, only: n_drydep, NLUse, NPatch use shr_fire_emis_mod, only: shr_fire_emis_mechcomps_n use co2_cycle , only: c_i, co2_readFlux_ocn, co2_readFlux_fuel use co2_cycle , only: co2_transport, co2_time_interp_ocn, co2_time_interp_fuel @@ -101,6 +101,24 @@ subroutine atm_import( x2a, cam_in, restart_init ) cam_in(c)%depvel(i,:n_drydep) = & x2a(index_x2a_Sl_ddvel:index_x2a_Sl_ddvel+n_drydep-1, ig) endif + + ! for landunit weights + if (index_x2a_Sl_lwtgcell /= 0 ) then + cam_in(c)%lwtgcell(i,:NLUse) = & + x2a(index_x2a_Sl_lwtgcell:index_x2a_Sl_lwtgcell+NLUse-1, ig) + end if + + ! for patch weights + if (index_x2a_Sl_pwtgcell /= 0 ) then + cam_in(c)%pwtgcell(i,:NPatch) = & + x2a(index_x2a_Sl_pwtgcell:index_x2a_Sl_pwtgcell+NPatch-1, ig) + end if + + ! for leaf area indices + if (index_x2a_Sl_lai /= 0 ) then + cam_in(c)%lai(i,:NPatch) = & + x2a(index_x2a_Sl_lai:index_x2a_Sl_lai+NPatch-1, ig) + end if ! ! fields needed to calculate water isotopes to ocean evaporation processes ! diff --git a/src/cpl/cam_cpl_indices.F90 b/src/cpl/cam_cpl_indices.F90 index ec6d7a1546..acc02abe8f 100644 --- a/src/cpl/cam_cpl_indices.F90 +++ b/src/cpl/cam_cpl_indices.F90 @@ -3,6 +3,8 @@ module cam_cpl_indices use seq_flds_mod use mct_mod use seq_drydep_mod, only: drydep_fields_token, lnd_drydep + use seq_drydep_mod, only: luse_fields_token, patch_fields_token + use seq_drydep_mod, only: lai_fields_token use shr_megan_mod, only: shr_megan_fields_token, shr_megan_mechcomps_n use shr_fire_emis_mod, only: shr_fire_emis_fields_token, shr_fire_emis_ztop_token, shr_fire_emis_mechcomps_n @@ -86,6 +88,9 @@ module cam_cpl_indices integer :: index_x2a_So_re ! square of atm/ocn exch. coeff integer :: index_x2a_So_ssq ! surface saturation specific humidity in ocean integer :: index_x2a_Sl_ddvel ! dry deposition velocities from land + integer :: index_x2a_Sl_lwtgcell ! landunit area weights + integer :: index_x2a_Sl_pwtgcell ! patch area weights + integer :: index_x2a_Sl_lai ! leaf area indices integer :: index_x2a_Sx_u10 ! 10m wind contains @@ -157,9 +162,15 @@ subroutine cam_cpl_indices_set( ) endif if ( lnd_drydep )then - index_x2a_Sl_ddvel = mct_avect_indexra(x2a, trim(drydep_fields_token)) + index_x2a_Sl_ddvel = mct_avect_indexra(x2a, trim(drydep_fields_token)) + index_x2a_Sl_lwtgcell = mct_avect_indexra(x2a, trim(luse_fields_token)) + index_x2a_Sl_pwtgcell = mct_avect_indexra(x2a, trim(patch_fields_token)) + index_x2a_Sl_lai = mct_avect_indexra(x2a, trim(lai_fields_token)) else - index_x2a_Sl_ddvel = 0 + index_x2a_Sl_ddvel = 0 + index_x2a_Sl_lwtgcell = 0 + index_x2a_Sl_pwtgcell = 0 + index_x2a_Sl_lai = 0 end if index_a2x_Sa_z = mct_avect_indexra(a2x,'Sa_z') From faeb911b35ec502b8b43f9bd48aafc573395b459 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 14 May 2020 22:35:08 -0400 Subject: [PATCH 083/239] Style: Fix typos that got introduced when converting commits to fork --- bld/configure | 3 +- src/chemistry/pp_geoschem/chem_mods.F90 | 4 +- src/chemistry/pp_geoschem/chemistry.F90 | 330 +++++++++--------- .../pp_geoschem/short_lived_species.F90 | 15 +- 4 files changed, 173 insertions(+), 179 deletions(-) diff --git a/bld/configure b/bld/configure index 1a3096f0ca..26f74450c2 100755 --- a/bld/configure +++ b/bld/configure @@ -2831,8 +2831,6 @@ sub write_filepath } print $fh "$camsrcdir/src/ionosphere\n"; - print $fh "$camsrcdir/src/chemistry/mozart\n"; - print $fh "$camsrcdir/src/chemistry/utils\n"; # -- Added by MSL - 1/2018 # -- Updated by TMMF - 11/2019 if ($chem_pkg ne 'geoschem') { @@ -2848,6 +2846,7 @@ sub write_filepath # print $fh "$camsrcdir/cam/src/chemistry/mozart\n"; } # -- + print $fh "$camsrcdir/src/chemistry/utils\n"; if ($rad eq 'rrtmg') { print $fh "$camsrcdir/src/physics/rrtmg\n"; diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/pp_geoschem/chem_mods.F90 index 0b220f886b..af430ac0ca 100644 --- a/src/chemistry/pp_geoschem/chem_mods.F90 +++ b/src/chemistry/pp_geoschem/chem_mods.F90 @@ -2,8 +2,8 @@ module chem_mods !-------------------------------------------------------------- ! ... Basic chemistry parameters and arrays !-------------------------------------------------------------- - use shr_kind_mod, only : r8 => shr_kind_r8 - use constituents, only : pcnst + use shr_kind_mod, only : r8 => shr_kind_r8 + use constituents, only : pcnst implicit none save diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index c5275ff2ed..6393a2e1b5 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -48,7 +48,7 @@ module chemistry use chem_mods, only : mwRatio use chem_mods, only : ref_mmr use chem_mods, only : nSlsMax - use chem_mods, only : nSls + use chem_mods, only : nSls use chem_mods, only : slsNames use chem_mods, only : slsLongNames use chem_mods, only : sls_ref_MMR @@ -88,19 +88,19 @@ module chemistry !----------------------------- ! Derived type objects !----------------------------- - TYPE(OptInput) :: Input_Opt ! Input Options object - TYPE(ChmState),ALLOCATABLE :: State_Chm(:) ! Chemistry State object - TYPE(DgnState),ALLOCATABLE :: State_Diag(:) ! Diagnostics State object - TYPE(GrdState),ALLOCATABLE :: State_Grid(:) ! Grid State object - TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object - TYPE(DgnList ) :: Diag_List ! Diagnostics list object + TYPE(OptInput) :: Input_Opt ! Input Options object + TYPE(ChmState),ALLOCATABLE :: State_Chm(:) ! Chemistry State object + TYPE(DgnState),ALLOCATABLE :: State_Diag(:) ! Diagnostics State object + TYPE(GrdState),ALLOCATABLE :: State_Grid(:) ! Grid State object + TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object + TYPE(DgnList ) :: Diag_List ! Diagnostics list object ! Indices of critical species INTEGER :: iH2O, iO3, iCH4, iCO, iNO ! Indices in the physics buffer - INTEGER :: NDX_PBLH ! PBL height [m] - INTEGER :: NDX_FSDS ! Downward shortwave flux at surface [W/m2] + INTEGER :: NDX_PBLH ! PBL height [m] + INTEGER :: NDX_FSDS ! Downward shortwave flux at surface [W/m2] INTEGER :: NDX_CLDTOP ! Cloud top height [index] INTEGER :: NDX_CLDFRC ! Cloud fraction [-] INTEGER :: NDX_PRAIN ! Rain production rate [kg/kg/s] @@ -152,42 +152,42 @@ end function chem_is subroutine chem_register - use physics_buffer, only : pbuf_add_field, dtype_r8 - use PhysConst, only : MWDry + use physics_buffer, only : pbuf_add_field, dtype_r8 + use PhysConst, only : MWDry use Short_Lived_Species, only : Register_Short_Lived_Species - use State_Grid_Mod, only : Init_State_Grid, Cleanup_State_Grid - use State_Chm_Mod, only : Init_State_Chm, Cleanup_State_Chm - use State_Chm_Mod, only : Ind_ - use Input_Opt_Mod, only : Set_Input_Opt, Cleanup_Input_Opt - use Species_Mod, only : Species + use State_Grid_Mod, only : Init_State_Grid, Cleanup_State_Grid + use State_Chm_Mod, only : Init_State_Chm, Cleanup_State_Chm + use State_Chm_Mod, only : Ind_ + use Input_Opt_Mod, only : Set_Input_Opt, Cleanup_Input_Opt + use Species_Mod, only : Species !----------------------------------------------------------------------- ! ! Purpose: register advected constituents for chemistry ! !----------------------------------------------------------------------- - ! Need to generate a temporary species database - therefore temp State_Chm + ! Need to generate a temporary species database Type(ChmState) :: SC Type(GrdState) :: SG Type(OptInput) :: IO TYPE(Species), POINTER :: ThisSpc - INTEGER :: I, N, M - REAL(r8) :: cptmp - REAL(r8) :: mwtmp - REAL(r8) :: qmin - REAL(r8) :: ref_VMR - CHARACTER(LEN=128) :: mixtype - CHARACTER(LEN=128) :: molectype - CHARACTER(LEN=128) :: lng_Name - LOGICAL :: camout - LOGICAL :: ic_from_cam2 - LOGICAL :: has_fixed_ubc - LOGICAL :: has_fixed_ubflx - - INTEGER :: RC + INTEGER :: I, N, M + REAL(r8) :: cptmp + REAL(r8) :: mwtmp + REAL(r8) :: qmin + REAL(r8) :: ref_VMR + CHARACTER(LEN=128) :: mixtype + CHARACTER(LEN=128) :: molectype + CHARACTER(LEN=128) :: lng_Name + LOGICAL :: camout + LOGICAL :: ic_from_cam2 + LOGICAL :: has_fixed_ubc + LOGICAL :: has_fixed_ubflx + + INTEGER :: RC ! SDE 2018-05-02: This seems to get called before anything else ! that includes CHEM_INIT @@ -232,9 +232,9 @@ subroutine chem_register IO%rootCPU = .False. IO%myCPU = myCPU - CALL Init_State_Grid( am_I_Root = .False., & + CALL Init_State_Grid( am_I_Root = .False., & State_Grid = SG , & - RC = RC ) + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered within call to "Init_State_Grid"!' @@ -266,7 +266,7 @@ subroutine chem_register DO I = 1, nTracersMax IF (I.LE.nTracers) THEN N = Ind_(tracerNames(I)) - ThisSpc => SC%SpcData(N)%Info + ThisSpc => SC%SpcData(N)%Info lng_Name = TRIM(ThisSpc%FullName) MWTmp = REAL(ThisSpc%MW_g,r8) ref_VMR = REAL(ThisSpc%BackgroundVV,r8) @@ -324,8 +324,8 @@ subroutine chem_register slsLongNames = '' DO I = 1, nSls N = Ind_(slsNames(I)) - IF (N.GT.0) THEN - ThisSpc => SC%SpcData(N)%Info + IF ( N .GT. 0 ) THEN + ThisSpc => SC%SpcData(N)%Info MWTmp = REAL(ThisSpc%MW_g,r8) ref_VMR = REAL(ThisSpc%BackgroundVV,r8) lng_Name = TRIM(ThisSpc%FullName) @@ -333,15 +333,15 @@ subroutine chem_register sls_ref_MMR(I) = ref_VMR / (MWDry / MWTmp) SlsMWRatio(I) = MWDry / MWTmp map2GC_Sls(I) = N - ThisSpc => NULL() + ThisSpc => NULL() ENDIF ENDDO ! Pass information to "short_lived_species" module slvd_ref_MMR(1:nSls) = sls_ref_MMR(1:nSls) CALL Register_Short_Lived_Species() - ! More information: - ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html + ! More information: + ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html ! Clean up Call Cleanup_State_Chm ( .False., SC, RC ) @@ -458,12 +458,12 @@ subroutine chem_readnl(nlfile) ! Go to ADVECTED SPECIES MENU menuFound = .False. - DO WHILE (.NOT.menuFound) + DO WHILE ( .NOT. menuFound ) READ( UNITN, '(a)', IOSTAT=IERR ) line - IF (IERR.NE.0) THEN + IF ( IERR .NE. 0 ) THEN CALL ENDRUN('chem_readnl: ERROR finding advected species menu') - ELSEIF (INDEX(line,'ADVECTED SPECIES MENU') > 0) then - menuFound=.True. + ELSEIF ( INDEX(line, 'ADVECTED SPECIES MENU') > 0 ) THEN + menuFound = .True. ENDIF ENDDO @@ -518,7 +518,7 @@ subroutine chem_readnl(nlfile) DO N = 1, nddvels - ! The species names need to be convert to upper case as, + ! The species names need to be convert to upper case as, ! for instance, BR2 != Br2 drySpc_ndx(N) = get_spc_ndx( to_upper(drydep_list(N)) ) @@ -526,7 +526,7 @@ subroutine chem_readnl(nlfile) Write(iulog,'(a,a)') ' ## Ignoring dry deposition of ', & TRIM(drydep_list(N)) nIgnored = nIgnored + 1 - ENDIF + ENDIF ENDDO IF ( nIgnored > 0 ) THEN @@ -566,10 +566,10 @@ subroutine chem_readnl(nlfile) !================================================================== #if defined( SPMD ) - CALL MPIBCAST(nTracers, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) - CALL MPIBCAST(nSls, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST(nTracers, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST(tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST(nSls, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST(slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) CALL MPIBCAST(drySpc_ndx, nddvels, MPIINT, 0, MPICOM ) #if ( OCNDDVEL_MOZART ) @@ -677,7 +677,7 @@ subroutine chem_init(phys_state, pbuf2d) use Linoz_Mod, only : Linoz_Read #if ( OCNDDVEL_MOZART ) - use seq_drydep_mod, only: drydep_method, DD_XLND + use seq_drydep_mod, only: drydep_method, DD_XLND use mo_drydep, only: drydep_inti #endif @@ -713,7 +713,7 @@ subroutine chem_init(phys_state, pbuf2d) !---------------------------- ! Integers - INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) + INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) INTEGER :: IWAIT, IERR INTEGER :: nX, nY, nZ INTEGER :: iX, jY @@ -726,7 +726,7 @@ subroutine chem_init(phys_state, pbuf2d) LOGICAL :: prtDebug ! Strings - CHARACTER(LEN=255) :: historyConfigFile + CHARACTER(LEN=255) :: historyConfigFile CHARACTER(LEN=255) :: SpcName ! Grid setup @@ -773,7 +773,7 @@ subroutine chem_init(phys_state, pbuf2d) ! SlsPtr(:,:,:) = sls_ref_MMR(I) ! CALL pbuf_set_field(pbuf2d,Sls_Pbf_Idx,SlsPtr,start=(/1,1,i/),kount=(/PCOLS,PVER,1/)) !ENDDO - !DEALLOCATE(SlsPtr) + !DEALLOCATE(SlsPtr) ! This ensures that each process allocates everything needed for its chunks ALLOCATE(State_Chm(BEGCHUNK:ENDCHUNK) , STAT=IERR) @@ -865,10 +865,10 @@ subroutine chem_init(phys_state, pbuf2d) value_LM_WORLD = nZ, & value_LLSTRAT = 59, & !TMMF RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN + IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "GC_Allocate_All"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF Input_Opt%myCPU = myCPU Input_Opt%rootCPU = MasterProc @@ -886,7 +886,7 @@ subroutine chem_init(phys_state, pbuf2d) ! First setup directories Input_Opt%Chem_Inputs_Dir = TRIM(chemInputsDir) - ! Simulation menu + ! Simulation menu Input_Opt%NYMDb = 20000101 Input_Opt%NHMSb = 000000 Input_Opt%NYMDe = 20010101 @@ -1021,7 +1021,7 @@ subroutine chem_init(phys_state, pbuf2d) ! the root CPU reads in the data; then we copy it out to a temporary array, ! broadcast to all other CPUs, and finally duplicate the data into every ! copy of Input_Opt - IF (Input_Opt%LLinoz) THEN + IF ( Input_Opt%LLinoz ) THEN ! Allocate array for broadcast nLinoz = Input_Opt%Linoz_NLevels * & Input_Opt%Linoz_NLat * & @@ -1045,7 +1045,7 @@ subroutine chem_init(phys_state, pbuf2d) linozData = REAL(Input_Opt%LINOZ_TPARM,r8) ENDIF #if defined( SPMD ) - CALL MPIBCAST(linozData, nLinoz, MPIR8, 0, MPICOM ) + CALL MPIBCAST( linozData, nLinoz, MPIR8, 0, MPICOM ) #endif IF ( .NOT. MasterProc ) THEN Input_Opt%LINOZ_TPARM = REAL(linozData,fp) @@ -1098,7 +1098,7 @@ subroutine chem_init(phys_state, pbuf2d) latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) lonEdgeArr(nX+1,J) = REAL((lonVal + dLonFix) * PI_180, f4) latEdgeArr(nX+1,J) = REAL((latVal) * PI_180, f4) - ENDDO + ENDDO CALL SetGridFromCtrEdges( am_I_Root = MasterProc, & State_Grid = State_Grid(L), & @@ -1121,7 +1121,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Set the times held by "time_mod" - CALL Accept_External_Date_Time( am_I_Root = MasterProc, & + CALL Accept_External_Date_Time( am_I_Root = MasterProc, & value_NYMDb = Input_Opt%NYMDb, & value_NHMSb = Input_Opt%NHMSb, & value_NYMDe = Input_Opt%NYMDe, & @@ -1134,7 +1134,7 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - ! Start by setting some dummy timesteps + ! Start by setting some dummy timesteps CALL GC_Update_Timesteps(300.0E+0_r8) ! Initialize error module @@ -1185,12 +1185,12 @@ subroutine chem_init(phys_state, pbuf2d) ENDDO ! Now replicate GC_Init_Extra - IF ( Input_Opt%LDryD) THEN + IF ( Input_Opt%LDryD ) THEN ! Setup for dry deposition - CALL Init_Drydep( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & + CALL Init_Drydep( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & & State_Diag = State_Diag(BEGCHUNK), & & State_Grid = State_Grid(BEGCHUNK), & & RC = RC ) @@ -1201,7 +1201,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF !============================================================== - ! Get mapping between CESM dry deposited species and the + ! Get mapping between CESM dry deposited species and the ! indices of State_Chm%DryDepVel. This needs to be done after ! Init_Drydep ! Thibaud M. Fritz - 04 Mar 2020 @@ -1311,7 +1311,7 @@ subroutine chem_init(phys_state, pbuf2d) !----------------------------------------------------------------- ! Initialize "carbon_mod.F" !----------------------------------------------------------------- - IF (Input_Opt%LCarb) THEN + IF ( Input_Opt%LCarb ) THEN CALL Init_Carbon( am_I_Root = MasterProc, & & Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & @@ -1325,7 +1325,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDIF - IF (Input_Opt%LDust) THEN + IF ( Input_Opt%LDust ) THEN CALL Init_Dust( am_I_Root = MasterProc, & & Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & @@ -1339,7 +1339,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDIF - IF (Input_Opt%LSSalt) THEN + IF ( Input_Opt%LSSalt ) THEN CALL Init_Seasalt( am_I_Root = MasterProc, & & Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & @@ -1353,7 +1353,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDIF - IF (Input_Opt%LSulf) THEN + IF ( Input_Opt%LSulf ) THEN CALL Init_Sulfate( am_I_Root = MasterProc, & & Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & @@ -1384,18 +1384,18 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDIF - IF (Input_Opt%LChem) THEN - CALL Init_Toms( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + IF ( Input_Opt%LChem ) THEN + CALL Init_Toms( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_TOMS"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_TOMS"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDIF ! This is a bare subroutine - no module @@ -1425,7 +1425,7 @@ subroutine chem_init(phys_state, pbuf2d) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Col_Area') CALL Get_Area_All_p(I, NCOL(I), Col_Area) - + ! Set default value (in case of chunks with fewer columns) State_Grid(I)%Area_M2 = 1.0e+10_fp DO iX = 1, nX @@ -1435,7 +1435,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDDO DEALLOCATE(Col_Area) - + ! Copy to State_Met(I)%Area_M2 State_Met(I)%Area_M2 = State_Grid(I)%Area_M2 ENDDO @@ -1476,7 +1476,7 @@ subroutine chem_init(phys_state, pbuf2d) !----------------------------------------------------------------- ! Pass external Ap and Bp to GEOS-Chem's Pressure_Mod !----------------------------------------------------------------- - CALL Accept_External_ApBp( am_I_Root = MasterProc, & ! Root CPU (Y/N)? + CALL Accept_External_ApBp( am_I_Root = MasterProc, & ! Root CPU (Y/N)? State_Grid = State_Grid(BEGCHUNK), & ! Grid State ApIn = Ap_CAM_Flip, & ! "A" term for hybrid grid BpIn = Bp_CAM_Flip, & ! "B" term for hybrid grid @@ -1558,8 +1558,8 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - IF (Input_Opt%Its_A_FullChem_Sim .OR. & - Input_Opt%Its_An_Aerosol_Sim) THEN + IF ( Input_Opt%Its_A_FullChem_Sim .OR. & + Input_Opt%Its_An_Aerosol_Sim ) THEN ! This also initializes Fast-JX CALL Init_Chemistry( am_I_Root = MasterProc, & & Input_Opt = Input_Opt, & @@ -2053,10 +2053,10 @@ subroutine GC_Update_Timesteps(DT) subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx - use cam_history, only: outfld - use camsrfexch, only: cam_in_t, cam_out_t + use cam_history, only: outfld + use camsrfexch, only: cam_in_t, cam_out_t - use phys_grid, only: get_ncols_p, get_rlat_all_p, get_rlon_all_p + use phys_grid, only: get_ncols_p, get_rlat_all_p, get_rlon_all_p use chem_mods, only: drySpc_ndx, map2GC_dryDep #if ( LANDTYPE_CLM ) @@ -2072,32 +2072,32 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Drydep_Mod, only: Update_DryDepSav use Mixing_Mod - use Dao_Mod, only: Set_Dry_Surface_Pressure - use Dao_Mod, only: AirQnt - use GC_Grid_Mod, only: SetGridFromCtr - use Pressure_Mod, only: Set_Floating_Pressures - use Pressure_Mod, only: Accept_External_Pedge - use Time_Mod, only: Accept_External_Date_Time - use Strat_chem_Mod, only: Init_Strat_Chem - use Toms_Mod, only: Compute_Overhead_O3 - use Chemistry_Mod, only: Do_Chemistry + use Dao_Mod, only: Set_Dry_Surface_Pressure + use Dao_Mod, only: AirQnt + use GC_Grid_Mod, only: SetGridFromCtr + use Pressure_Mod, only: Set_Floating_Pressures + use Pressure_Mod, only: Accept_External_Pedge + use Time_Mod, only: Accept_External_Date_Time + use Strat_chem_Mod, only: Init_Strat_Chem + use Toms_Mod, only: Compute_Overhead_O3 + use Chemistry_Mod, only: Do_Chemistry use Wetscav_Mod, only: Setup_Wetscav, Do_WetDep - use CMN_Size_Mod, only: PTop + use CMN_Size_Mod, only: PTop use PBL_Mix_Mod, only: Compute_PBL_Height use Tropopause, only: Tropopause_findChemTrop, Tropopause_Find ! For calculating SZA - use Orbit, only: zenith + use Orbit, only: zenith use Time_Manager, only: Get_Curr_Calday, Get_Curr_Date ! Calculating relative humidity - use WV_Saturation, only: QSat - use PhysConst, only: MWDry + use WV_Saturation, only: QSat + use PhysConst, only: MWDry ! Grid area - use PhysConst, only: Gravit - use PhysConstants, only: Re + use PhysConst, only: Gravit + use PhysConstants, only: Re use Phys_Grid, only: get_area_all_p, get_lat_all_p, get_lon_all_p use Short_Lived_Species, only : Get_Short_Lived_Species @@ -2130,9 +2130,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) INTEGER :: LCHNK, NCOL REAL(r8), DIMENSION(State%NCOL) :: & - CSZA, & ! Cosine of solar zenith angle - Zsurf, & ! Surface height - Rlats, Rlons ! Chunk latitudes and longitudes (radians) + CSZA, & ! Cosine of solar zenith angle + Zsurf, & ! Surface height + Rlats, Rlons ! Chunk latitudes and longitudes (radians) REAL(r8), POINTER :: PblH(:) ! PBL height on each chunk [m] REAL(r8), POINTER :: cldTop(:) ! Cloud top height [?] @@ -2176,13 +2176,13 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: Col_Area(State%NCOL) ! Intermediate arrays - INTEGER :: Trop_Lev(PCOLS) - REAL(r8) :: Trop_P( PCOLS) - REAL(r8) :: Trop_T( PCOLS) - REAL(r8) :: Trop_Ht( PCOLS) + INTEGER :: Trop_Lev (PCOLS) + REAL(r8) :: Trop_P (PCOLS) + REAL(r8) :: Trop_T (PCOLS) + REAL(r8) :: Trop_Ht (PCOLS) REAL(r8) :: SnowDepth(PCOLS) REAL(r8) :: cld2D (PCOLS) - REAL(r8) :: Z0(PCOLS) + REAL(r8) :: Z0 (PCOLS) REAL(r8) :: Sd_Ice, Sd_Lnd, Sd_Avg, Frc_Ice ! Estimating cloud optical depth @@ -2191,7 +2191,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: TauClw(PCOLS,PVER) REAL(r8), PARAMETER :: re_m = 1.0e-05_r8 ! Cloud drop radius in m REAL(r8), PARAMETER :: cldMin = 1.0e-02_r8 ! Minimum cloud cover - REAL(r8), PARAMETER :: cnst = 1.5e+00_r8 / (re_m * 1.0e+03_r8 * g0) + REAL(r8), PARAMETER :: cnst = 1.5e+00_r8 / (re_m * 1.0e+03_r8 * g0) ! Calculating SZA REAL(r8) :: Calday @@ -2211,9 +2211,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) INTEGER :: TIM_NDX - INTEGER, SAVE :: iStep = 0 - LOGICAL :: rootChunk - INTEGER :: RC + INTEGER, SAVE :: iStep = 0 + LOGICAL :: rootChunk + INTEGER :: RC ! LCHNK: which chunk we have on this process LCHNK = State%LCHNK @@ -2226,7 +2226,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Count the number of steps which have passed IF (LCHNK.EQ.BEGCHUNK) iStep = iStep + 1 - ! Need to update the timesteps throughout the code + ! Need to update the timesteps throughout the code CALL GC_Update_Timesteps(dT) @@ -2442,19 +2442,19 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Trop_P(J) = State%PMid(J,Trop_Lev(J)) * 0.01e+0_r8 ENDDO - ! Calculate snow depth + ! Calculate snow depth snowDepth = 0.0e+0_r8 DO J = 1, nY Sd_Ice = MAX(0.0e+0_r8,cam_in%snowhIce(J)) Sd_Lnd = MAX(0.0e+0_r8,cam_in%snowhLand(J)) Frc_Ice = MAX(0.0e+0_r8,cam_in%iceFrac(J)) - IF (Frc_Ice > 0.0e+0_r8) THEN - Sd_Avg = (Sd_Lnd*(1.0e+0_r8 - Frc_Ice)) + (Sd_Ice * Frc_Ice) - ELSE - Sd_Avg = Sd_Lnd - ENDIF + IF (Frc_Ice > 0.0e+0_r8) THEN + Sd_Avg = (Sd_Lnd*(1.0e+0_r8 - Frc_Ice)) + (Sd_Ice * Frc_Ice) + ELSE + Sd_Avg = Sd_Lnd + ENDIF snowDepth(J) = Sd_Avg - ENDDO + ENDDO ! Field : ALBD ! Description: Visible surface albedo @@ -2653,13 +2653,13 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%FRSEAICE(1,J), & State_Met(LCHNK)%FROCEAN(1,J) - & State_Met(LCHNK)%FRSEAICE(1,J) /) ) - IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 - ! reset ocean to 0 + IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 + ! reset ocean to 0 - ! Field : LWI - ! Description: Land/water indices - ! Unit : - - ! Dimensions : nX, nY + ! Field : LWI + ! Description: Land/water indices + ! Unit : - + ! Dimensions : nX, nY State_Met(LCHNK)%LWI(1,J) = FLOAT( iMaxLoc(1) ) ENDDO @@ -2882,7 +2882,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ! Pass time values obtained from the ESMF environment to GEOS-Chem - CALL Accept_External_Date_Time( am_I_Root = rootChunk, & + CALL Accept_External_Date_Time( am_I_Root = rootChunk, & value_NYMD = currYMD, & value_NHMS = currHMS, & value_YEAR = currYr, & @@ -2891,7 +2891,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) value_DAYOFYR = INT(FLOOR(Calday)), & value_HOUR = currHr, & value_MINUTE = currMn, & - value_HELAPSED = 0.0e+0_f4, & + value_HELAPSED = 0.0e+0_f4, & value_UTC = currUTC, & RC = RC ) @@ -2913,7 +2913,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Dry surface pressure at current and next timestep ! Unit : hPa ! Dimensions : nX, nY, nZ+1 - ! Note : 1. Use the CAM PSDry fields instead of using the + ! Note : 1. Use the CAM PSDry fields instead of using the ! GEOS-Chem calculation ! 2. As we are using online meteorology, we do not ! have access to the fields at the next time step @@ -2953,15 +2953,15 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! (6) PMEAN_DRY : Alt-weighted mean dry air partial pressure [hPa] ! (7) DELP : Delta-P extent of grid box [hPa] ! (Same for both moist and dry air since we - ! assume constant water vapor pressure - ! across box) + ! assume constant water vapor pressure + ! across box) ! (8) AIRDEN : Mean grid box dry air density [kg/m^3] ! (defined as total dry air mass/box vol) ! (9) MAIRDEN : Mean grid box moist air density [kg/m^3] ! (defined as total moist air mass/box vol) ! (10) AD : Total dry air mass in grid box [kg] ! (11) ADMOIST : Total moist air mass in grid box [kg] - ! (12) BXHEIGHT : Vertical height of grid box [m] + ! (12) BXHEIGHT : Vertical height of grid box [m] ! (13) AIRVOL : Volume of grid box [m^3] ! (14) MOISTMW : Molecular weight of moist air in box [g/mol] ! ==================================================================== @@ -2999,8 +2999,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !============================================================== ! ***** R U N H E M C O P H A S E 1 ***** - ! - ! Phase 1 updates the HEMCO clock and the content of the + ! + ! Phase 1 updates the HEMCO clock and the content of the ! HEMCO data list. This should be done before writing the ! diagnostics organized in the HEMCO diagnostics structure, ! and before using any of the HEMCO data list fields. @@ -3027,16 +3027,16 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! %%% GET SOME NON-EMISSIONS DATA FIELDS VIA HEMCO %%% ! ! HEMCO can track non-emission data fields for chemistry - ! simulations. Put these subroutine calls after the + ! simulations. Put these subroutine calls after the ! call to EMISSIONS_RUN, so that the HEMCO data structure ! will be initialized. (bmy, 3/20/15) ! ! HEMCO data list is now updated further above, so can ! take these calls out of the emissions sequence. - ! (ckeller, 4/01/15) + ! (ckeller, 4/01/15) !---------------------------------------------------------- !IF ( LCHEM .and. newMonth ) THEN - ! + ! ! ! The following only apply when photolysis is used, ! ! that is for fullchem or aerosol simulations. ! IF ( ITS_A_FULLCHEM_SIM .or. ITS_AN_AEROSOL_SIM ) THEN @@ -3070,9 +3070,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ! ENDIF ! - ! ! Read data required for Hg2 gas-particle partitioning + ! ! Read data required for Hg2 gas-particle partitioning ! ! (H Amos, 25 Oct 2011) - ! IF ( ITS_A_MERCURY_SIM ) THEN + ! IF ( ITS_A_MERCURY_SIM ) THEN ! CALL Read_Hg2_Partitioning( am_I_Root = MasterProc, & ! Input_Opt = Input_Opt, & ! State_Grid = State_Grid(LCHNK), & @@ -3082,7 +3082,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ! ! Trap potential errors ! IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = + ! ErrMsg = ! 'Error encountered in "Read_Hg2_Partitioning"!' ! CALL Error_Stop( ErrMsg, ThisLoc ) ! ENDIF @@ -3129,7 +3129,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !============================================================== ! Move this call from the PBL mixing routines because the PBL ! height is used by drydep and some of the emissions routines. - ! (ckeller, 3/5/15) + ! (ckeller, 3/5/15) ! This function updates: ! ==================================================================== ! (1) InPbl : Logical indicating if we are in the PBL [-] @@ -3190,7 +3190,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! State_Chm expects dry deposition velocities in m/s, whereas ! CLM returns land deposition velocities in cm/s! ! - ! For now, dry deposition velocities are only computed for gases + ! For now, dry deposition velocities are only computed for gases ! (which is what CLM deals with). Dry deposition for aerosols is ! work in progress. ! @@ -3395,7 +3395,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! !! EMISSIONS_RUN will call HEMCO run phase 2. HEMCO run phase !! only calculates emissions. All data has been read to disk - !! in phase 1 at the beginning of the time step. + !! in phase 1 at the beginning of the time step. !! (ckeller, 4/1/15) !CALL Emissions_Run( am_I_Root = rootChunk, & ! Input_Opt = Input_Opt, & @@ -3409,7 +3409,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! !! Trap potential errors !IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = + ! ErrMsg = ! 'Error encountered in "Emissions_Run"! after drydep!' ! CALL Error_Stop( ErrMsg, ThisLoc ) !ENDIF @@ -3468,22 +3468,21 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ErrMsg = 'Error encountered in "Do_Convection"!' ! CALL Error_Stop( ErrMsg, ThisLoc ) ! ENDIF - !ENDIF + !ENDIF !============================================================== ! ***** C H E M I S T R Y ***** - !============================================================== + !============================================================== ! Get the overhead column O3 for use with FAST-J IF ( Input_Opt%Its_A_FullChem_Sim .OR. & Input_Opt%Its_An_Aerosol_Sim ) THEN - IF (Input_Opt%LChem) THEN + IF ( Input_Opt%LChem ) THEN CALL Compute_Overhead_O3( am_I_Root = rootChunk, & State_Grid = State_Grid(LCHNK), & - DAY = 1, & DAY = currDy, & USE_O3_FROM_MET = Input_Opt%Use_O3_From_Met, & - TO3 = State_Met(LCHNK)%TO3 ) + TO3 = State_Met(LCHNK)%TO3 ) ENDIF ENDIF @@ -3493,7 +3492,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Diag = State_Diag(LCHNK), & State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & - RC = RC ) + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Do_Chemistry"!' @@ -3517,7 +3516,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met = State_Met(LCHNK), & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Do_WetDep"!' CALL Error_Stop( ErrMsg, ThisLoc ) @@ -3544,7 +3542,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Set_Short_Lived_Species( SlsData, LCHNK, nY, Pbuf ) ! Write diagnostic output - DO N=1, pcnst + DO N = 1, pcnst M = map2GC(N) I = map2Idx(N) IF ( M > 0 ) THEN @@ -3560,7 +3558,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO #if defined( CLM40 ) - Write(6,*) "This is CLM40" SpcName = 'lu_soil' CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,1), nY, LCHNK ) SpcName = 'lu_landice' @@ -3578,7 +3575,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) SpcName = 'lu_crop' CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,8), nY, LCHNK ) #elif defined( CLM45 ) || defined( CLM50 ) - Write(6,*) "This is CLM45" SpcName = 'lu_soil' CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,1), nY, LCHNK ) SpcName = 'lu_crop' @@ -4002,11 +3998,11 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) ENDIF ENDDO - DO ILEV=1,NLEV - WHERE(MASK) - ! Set to the minimum mixing ratio - Q(:,ILEV) = Min_MMR - ENDWHERE + DO ILEV = 1, NLEV + WHERE(MASK) + ! Set to the minimum mixing ratio + Q(:,ILEV) = Min_MMR + END WHERE ENDDO end subroutine chem_init_cnst @@ -4049,7 +4045,7 @@ subroutine chem_final ! Finalize GEOS-Chem IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_FINAL' - + CALL Cleanup_UCX( MasterProc ) CALL Cleanup_Aerosol CALL Cleanup_Carbon @@ -4131,7 +4127,7 @@ end subroutine chem_final subroutine chem_init_restart(File) use pio, only : file_desc_t TYPE(file_desc_t) :: File - + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT_RESTART' RETURN @@ -4174,7 +4170,7 @@ subroutine chem_read_restart( File ) end subroutine chem_read_restart !================================================================================ subroutine chem_emissions( state, cam_in ) - use camsrfexch, only : cam_in_t + use camsrfexch, only: cam_in_t use PhysConstants, only: PI, PI_180 diff --git a/src/chemistry/pp_geoschem/short_lived_species.F90 b/src/chemistry/pp_geoschem/short_lived_species.F90 index 0b1d3c1078..b4dc6d55ff 100644 --- a/src/chemistry/pp_geoschem/short_lived_species.F90 +++ b/src/chemistry/pp_geoschem/short_lived_species.F90 @@ -105,13 +105,13 @@ subroutine initialize_short_lived_species(ncid_ini, pbuf2d) type(file_desc_t), intent(inout) :: ncid_ini type(physics_buffer_desc), pointer :: pbuf2d(:,:) - integer :: m,n,lchnk - integer :: grid_id + integer :: m,n,lchnk + integer :: grid_id character(len=255) :: fieldname - character(len=4) :: dim1name, dim2name - logical :: found - real(r8),pointer :: tmpptr(:,:,:) ! temporary pointer - real(r8),pointer :: tmpptr2(:,:,:) ! temporary pointer + character(len=4) :: dim1name, dim2name + logical :: found + real(r8),pointer :: tmpptr(:,:,:) ! temporary pointer + real(r8),pointer :: tmpptr2(:,:,:) ! temporary pointer character(len=*), parameter :: subname='INITIALIZE_SHORT_LIVED_SPECIES' if ( nslvd < 1 ) return @@ -131,8 +131,7 @@ subroutine initialize_short_lived_species(ncid_ini, pbuf2d) do m=1,nslvd !n = map(m) !fieldname = solsym(n) - !write(fieldname,'(a,a)') 'GCSL', m - write(fieldname,'(a,a)') 'GCSL_', trim(slvd_lst(m)) + write(fieldname,'(a,a)') trim(slvd_lst(m)) call infld( fieldname,ncid_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tmpptr, found, gridname='physgrid') From 904fbf14172f74819a727f11b931d6e00ee1f51f Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 15 May 2020 10:49:45 -0400 Subject: [PATCH 084/239] Feat: Modify Externals_CAM.cfg to download GEOS-Chem code --- Externals_CAM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 06fd94e697..06215a12fc 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -27,7 +27,7 @@ tag = v2.0.3cesm/src required = True [geoschem] -local_path = src/chemistry/pp_geoschem/geoschem_src +local_path = src/chemistry/geoschem protocol = git tag = CESM repo_url = https://github.com/fritzt/CESM2-GC_Src From 00f4f950df990c6ade8ab6997de5d5b1e11e2131 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 15 May 2020 10:57:51 -0400 Subject: [PATCH 085/239] Revert "Feat: Modify Externals_CAM.cfg to download GEOS-Chem code" This reverts commit 904fbf14172f74819a727f11b931d6e00ee1f51f. --- Externals_CAM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 06215a12fc..06fd94e697 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -27,7 +27,7 @@ tag = v2.0.3cesm/src required = True [geoschem] -local_path = src/chemistry/geoschem +local_path = src/chemistry/pp_geoschem/geoschem_src protocol = git tag = CESM repo_url = https://github.com/fritzt/CESM2-GC_Src From 1d8a052cfe1016bc68f6ba8c744b5fb72b666c99 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 15 May 2020 15:38:53 -0400 Subject: [PATCH 086/239] Feat: Update .gitignore to ignore GEOS-Chem repo --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 18ee78968c..5cc0bde57c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ src/physics/carma/base src/physics/clubb src/physics/cosp2/src src/physics/silhs - +src/chemistry/pp_geoschem/geoschem_src # Ignore compiled python buildnmlc From e176067e40d3befafd638435f1e904fb77445393 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Fri, 15 May 2020 21:20:43 -0400 Subject: [PATCH 087/239] Feat: Implement HEMCO_CESM within CESM-GC (Initial attempt in syncing CAM sources) --- .gitignore | 1 + Externals_CAM.cfg | 8 +++++ bld/config_files/definition.xml | 4 +++ bld/configure | 38 ++++++++++++++++++++ bld/namelist_files/namelist_definition.xml | 17 +++++++++ src/control/cam_comp.F90 | 42 ++++++++++++++++++++++ src/control/runtime_opts.F90 | 7 ++++ src/physics/cam/phys_control.F90 | 8 +++-- 8 files changed, 123 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5cc0bde57c..fcb95837b8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ src/physics/clubb src/physics/cosp2/src src/physics/silhs src/chemistry/pp_geoschem/geoschem_src +src/hemco # Ignore compiled python buildnmlc diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 06fd94e697..1e39d10358 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -33,6 +33,14 @@ tag = CESM repo_url = https://github.com/fritzt/CESM2-GC_Src required = True +[hemco] +local_path = src/hemco +protocol = git +branch = development +repo_url = https://github.com/jimmielin/HEMCO_CESM.git +required = True +externals = Externals_HCO.cfg + [externals_description] schema_version = 1.0.0 diff --git a/bld/config_files/definition.xml b/bld/config_files/definition.xml index dd0d01e5ee..e6a6055002 100644 --- a/bld/config_files/definition.xml +++ b/bld/config_files/definition.xml @@ -52,6 +52,10 @@ Option to turn on waccmx thermosphere/ionosphere extension: 0 => no, 1 => yes Ionosphere model used in WACCMX. + +Switch to turn on Harmonized Emissions Component (HEMCO): 0 => no, 1 => yes. +WARNING THIS IS ON BY DEFAULT FOR DEVELOPMENT - DO NOT SUBMIT THIS TO PRODUCTION CODE + Physics package: cam3, cam4, cam5, cam6, held_suarez, adiabatic, kessler, tj2016, spcam_sam1mom, spcam_m2005. diff --git a/bld/configure b/bld/configure index 26f74450c2..2ecc1b0ae7 100755 --- a/bld/configure +++ b/bld/configure @@ -139,6 +139,7 @@ OPTIONS Makefile defaults. E.g. -cppdefs '-DVAR1 -DVAR2' -dyn Dynamical core option: [eul | fv | se]. Default: fv. -edit_chem_mech Invokes CAMCHEM_EDITOR to allow the user to edit the chemistry mechanism file + -hemco Switch enables the use of the Harmonized Emissions Component. -hgrid Specify horizontal grid. Use nlatxnlon for spectral grids; dlatxdlon for fv grids (dlat and dlon are the grid cell size in degrees for latitude and longitude respectively); nexnp for @@ -324,6 +325,7 @@ GetOptions( "fopt=s" => \$opts{'fopt'}, "gmake=s" => \$opts{'gmake'}, "h|help" => \$opts{'help'}, + "hemco" => \$opts{'hemco'}, "hgrid=s" => \$opts{'hgrid'}, "ionosphere=s" => \$opts{'ionosphere'}, "lapack_libdir=s" => \$opts{'lapack_libdir'}, @@ -1608,6 +1610,14 @@ else { $nadv = $cfg_ref->get('nadv'); if ($print>=2) { print "Total advected constituents: $nadv$eol"; } +#----------------------------------------------------------------------------------------------- + +# Harmonized Emissions Component (HEMCO) +if (defined $opts{'hemco'}) { + $cfg_ref->set('hemco', $opts{'hemco'}); +} +my $hemco = $cfg_ref->get('hemco'); + #----------------------------------------------------------------------------------------------- # Makefile configuration ####################################################################### #----------------------------------------------------------------------------------------------- @@ -1994,6 +2004,13 @@ $cfg_cppdefs .= ' -DHAVE_VPRINTF -DHAVE_TIMES -DHAVE_GETTIMEOFDAY -DHAVE_COMM_F2 unless ($target_os eq 'aix' or $target_os =~ 'bg' or $target_os eq 'darwin') { $cfg_cppdefs .= ' -DHAVE_NANOTIME -DBIT64 -DHAVE_SLASHPROC'; } + +# Harmonized Emissions Component (HEMCO) +if ($hemco) { + $cfg_cppdefs .= ' -DMODEL_ -DMODEL_CESM -DHEMCO_CESM -DUSE_REAL8 '; + print "Compiling highly-experimental HEMCO with CESM.$eol"; +} + #----------------------------------------------------------------------------------------------- # External libraries ########################################################################### #----------------------------------------------------------------------------------------------- @@ -2753,6 +2770,7 @@ sub write_filepath my $waccm_phys = $cfg_ref->get('waccm_phys'); my $waccmx = $cfg_ref->get('waccmx'); my $ionos = $cfg_ref->get('ionosphere'); + my $hemco = $cfg_ref->get('hemco'); my $carma = $cfg_ref->get('carma'); my $rad = $cfg_ref->get('rad'); my $dyn = $cfg_ref->get('dyn'); @@ -2831,6 +2849,26 @@ sub write_filepath } print $fh "$camsrcdir/src/ionosphere\n"; + # -- Added by hplin - 5/2020 + if ($hemco) { + print $fh "$camsrcdir/src/hemco\n"; + + # if not compiling with GEOS-Chem; coordinate this with tfritz later + # we may eventually remove all this + print $fh "$camsrcdir/src/hemco/HEMCO/src/Shared\n"; + + # to remove - need to use pio + print $fh "$camsrcdir/src/hemco/HEMCO/src/Shared/Headers\n"; + print $fh "$camsrcdir/src/hemco/HEMCO/src/Shared/GeosUtil\n"; + print $fh "$camsrcdir/src/hemco/HEMCO/src/Shared/NcdfUtil\n"; + + # hplin 2/16/20: temporarily add hemco src code directories manually + # until we figure out a better compile routine. + print $fh "$camsrcdir/src/hemco/HEMCO/src/Core\n"; + print $fh "$camsrcdir/src/hemco/HEMCO/src/Extensions\n"; + print $fh "$camsrcdir/src/hemco/HEMCO/src/Interfaces\n"; + } + # -- Added by MSL - 1/2018 # -- Updated by TMMF - 11/2019 if ($chem_pkg ne 'geoschem') { diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 72281212de..34256e1f88 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -3913,6 +3913,15 @@ cache file to be consistent with how CAM was built. Default: set by build-namelist + +Full pathname to CAM physics grid ESMF mesh file. +N.B. this variable may not be set by the user. +It is set by build-namelist via information in the configure +cache file to be consistent with how CAM was built. +Default: set by build-namelist + + Runtime options of upper thermosphere WACCM-X. 'ionosphere' for @@ -4000,6 +4009,14 @@ Full pathname of AMIE inputs for southern hemisphere. Default: NONE. + + +Full pathname of dataset for coefficient data used in Weimer05 +high latitude electric potential model. +Default: set by build-namelist. + + smooth surface fluxes, 0 otherwise logical :: use_subcol_microp = .false. ! if .true. then use sub-columns in microphysics @@ -126,7 +127,7 @@ subroutine phys_ctl_readnl(nlfile) history_cesm_forcing, history_scwaccm_forcing, history_chemspecies_srf, & do_clubb_sgs, state_debug_checks, use_hetfrz_classnuc, use_gw_oro, use_gw_front, & use_gw_front_igw, use_gw_convect_dp, use_gw_convect_sh, cld_macmic_num_steps, & - offline_driver, convproc_do_aer + offline_driver, convproc_do_aer, cam_physics_mesh !----------------------------------------------------------------------------- if (masterproc) then @@ -184,6 +185,7 @@ subroutine phys_ctl_readnl(nlfile) call mpi_bcast(cld_macmic_num_steps, 1, mpi_integer, masterprocid, mpicom, ierr) call mpi_bcast(offline_driver, 1, mpi_logical, masterprocid, mpicom, ierr) call mpi_bcast(convproc_do_aer, 1, mpi_logical, masterprocid, mpicom, ierr) + call mpi_bcast(cam_physics_mesh, len(cam_physics_mesh), mpi_character, masterprocid, mpicom, ierr) use_spcam = ( cam_physpkg_is('spcam_sam1mom') & .or. cam_physpkg_is('spcam_m2005')) @@ -280,7 +282,7 @@ subroutine phys_getopts(deep_scheme_out, shallow_scheme_out, eddy_scheme_out, mi history_cesm_forcing_out, history_scwaccm_forcing_out, history_chemspecies_srf_out, & cam_chempkg_out, prog_modal_aero_out, macrop_scheme_out, & do_clubb_sgs_out, use_spcam_out, state_debug_checks_out, cld_macmic_num_steps_out, & - offline_driver_out, convproc_do_aer_out) + offline_driver_out, convproc_do_aer_out, physics_grid_out) !----------------------------------------------------------------------- ! Purpose: Return runtime settings ! deep_scheme_out : deep convection scheme @@ -323,6 +325,7 @@ subroutine phys_getopts(deep_scheme_out, shallow_scheme_out, eddy_scheme_out, mi integer, intent(out), optional :: cld_macmic_num_steps_out logical, intent(out), optional :: offline_driver_out logical, intent(out), optional :: convproc_do_aer_out + character(len=256), intent(out), optional :: physics_grid_out if ( present(deep_scheme_out ) ) deep_scheme_out = deep_scheme if ( present(shallow_scheme_out ) ) shallow_scheme_out = shallow_scheme @@ -357,6 +360,7 @@ subroutine phys_getopts(deep_scheme_out, shallow_scheme_out, eddy_scheme_out, mi if ( present(cld_macmic_num_steps_out) ) cld_macmic_num_steps_out = cld_macmic_num_steps if ( present(offline_driver_out ) ) offline_driver_out = offline_driver if ( present(convproc_do_aer_out ) ) convproc_do_aer_out = convproc_do_aer + if ( present(physics_grid_out ) ) physics_grid_out = cam_physics_mesh end subroutine phys_getopts From 1eba02fc3df6d5cf01a0a9da06c26a828c402d39 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Fri, 15 May 2020 23:43:47 -0400 Subject: [PATCH 088/239] Feat: HEMCO_CESM code integration (full). Add mo_sim_dat and mo_tracname --- bld/configure | 9 +++++---- src/chemistry/pp_geoschem/.exclude | 15 +++------------ src/chemistry/pp_geoschem/mo_tracname.F90 | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 src/chemistry/pp_geoschem/mo_tracname.F90 diff --git a/bld/configure b/bld/configure index 2ecc1b0ae7..b5b5ead7c9 100755 --- a/bld/configure +++ b/bld/configure @@ -2830,9 +2830,6 @@ sub write_filepath print $fh "$chem_src_dir/geoschem_src/GeosCore\n"; print $fh "$chem_src_dir/geoschem_src/GeosUtil\n"; print $fh "$chem_src_dir/geoschem_src/Headers\n"; - print $fh "$chem_src_dir/geoschem_src/HEMCO/Core\n"; - print $fh "$chem_src_dir/geoschem_src/HEMCO/Extensions\n"; - print $fh "$chem_src_dir/geoschem_src/HEMCO/Interfaces\n"; print $fh "$chem_src_dir/geoschem_src/ISORROPIA\n"; print $fh "$chem_src_dir/geoschem_src/KPP/Standard\n"; } # print $fh "$camsrcdir/cam/src/chemistry/pp_geoschem\n"; } @@ -2857,9 +2854,13 @@ sub write_filepath # we may eventually remove all this print $fh "$camsrcdir/src/hemco/HEMCO/src/Shared\n"; - # to remove - need to use pio + # right now shared files have been renamed for no-conflict + # if ($chem_pkg ne 'geoschem') { print $fh "$camsrcdir/src/hemco/HEMCO/src/Shared/Headers\n"; print $fh "$camsrcdir/src/hemco/HEMCO/src/Shared/GeosUtil\n"; + # } + + # to remove - need to use pio print $fh "$camsrcdir/src/hemco/HEMCO/src/Shared/NcdfUtil\n"; # hplin 2/16/20: temporarily add hemco src code directories manually diff --git a/src/chemistry/pp_geoschem/.exclude b/src/chemistry/pp_geoschem/.exclude index 48f78ec307..674cabfdd2 100644 --- a/src/chemistry/pp_geoschem/.exclude +++ b/src/chemistry/pp_geoschem/.exclude @@ -6,19 +6,8 @@ tpcore_fvdas_mod.F90 flexgrid_read_mod.F90 geosfp_read_mod.F90 get_met_mod.F90 -hco_interp_mod.F90 merra2_read_mod.F90 regrid_a2a_mod.F90 -hcoio_read_std_mod.F90 -hcoio_dataread_mod.F90 -hco_readlist_mod.F90 -hcox_paranox_mod.F90 -hco_config_mod.F90 -hco_driver_mod.F90 -hcox_driver_mod.F90 -hcox_lightnox_mod.F90 -hcoi_standalone_mod.F90 -hemco_standalone.F90 restart_mod.F pops_mod.F diag49_mod.F @@ -45,4 +34,6 @@ initialize.F input_mod.F cleanup.F main.F -mo_sim_dat.F90 +hcoi_gc_diagn_include.H +hcoi_gc_diagn_mod.F90 +hcoi_gc_main_mod.F90 \ No newline at end of file diff --git a/src/chemistry/pp_geoschem/mo_tracname.F90 b/src/chemistry/pp_geoschem/mo_tracname.F90 new file mode 100644 index 0000000000..c8b4aabfdb --- /dev/null +++ b/src/chemistry/pp_geoschem/mo_tracname.F90 @@ -0,0 +1,14 @@ + + module mo_tracname +!----------------------------------------------------------- +! ... List of advected and non-advected trace species, and +! surface fluxes for the advected species. +!----------------------------------------------------------- + + use chem_mods, only : grpcnt, gas_pcnst + + implicit none + + character(len=16) :: solsym(gas_pcnst) ! species names + + end module mo_tracname From 4fdb78a5d2934e907937fabef9529c3e5de8650e Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Sat, 16 May 2020 15:07:54 -0400 Subject: [PATCH 089/239] Fix: Call set_sim_dat from chemistry.F90 to pass solsym to HEMCO_CESM. Fix: Do not assign other variables within mo_sim_dat -- to discuss --- src/chemistry/pp_geoschem/chemistry.F90 | 9 + src/chemistry/pp_geoschem/mo_sim_dat.F90 | 1390 +++++++++++----------- 2 files changed, 704 insertions(+), 695 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 6393a2e1b5..f99181f1cd 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -163,6 +163,8 @@ subroutine chem_register use Input_Opt_Mod, only : Set_Input_Opt, Cleanup_Input_Opt use Species_Mod, only : Species + use mo_sim_dat, only : set_sim_dat + !----------------------------------------------------------------------- ! ! Purpose: register advected constituents for chemistry @@ -198,6 +200,11 @@ subroutine chem_register IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_REGISTER' + ! hplin 2020-05-16: Call set_sim_dat to populate chemistry constituent information + ! from mo_sim_dat.F90 in other places. This is needed for HEMCO_CESM. + call set_sim_dat() + if(masterproc) write(iulog,*) 'GCCALL after set_sim_dat' + ! Generate fake state_chm IO%Max_BPCH_Diag = 1000 IO%Max_AdvectSpc = 500 @@ -209,6 +216,8 @@ subroutine chem_register Input_Opt = IO, & RC = RC ) + if(masterproc) write(iulog,*) 'GCCALL after Set_Input_Opt' + IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Could not generate reference input options object!' CALL Error_Stop( ErrMsg, ThisLoc ) diff --git a/src/chemistry/pp_geoschem/mo_sim_dat.F90 b/src/chemistry/pp_geoschem/mo_sim_dat.F90 index 38b193b66b..854432d9d9 100644 --- a/src/chemistry/pp_geoschem/mo_sim_dat.F90 +++ b/src/chemistry/pp_geoschem/mo_sim_dat.F90 @@ -128,711 +128,711 @@ subroutine set_sim_dat 'ASOA1 ','ASOA2 ','ASOA3 ', & 'SOAP ','SOAS ','PFE ' /) - adv_mass(:221) = (/ 133.141340_r8, 104.142600_r8, 28.010400_r8, 12.011000_r8, 12.011000_r8, & - 204.342600_r8, 78.110400_r8, 160.122200_r8, 126.108600_r8, 98.098200_r8, & - 84.072400_r8, 98.098200_r8, 98.098200_r8, 112.124000_r8, 72.143800_r8, & - 56.103200_r8, 79.904000_r8, 115.356700_r8, 95.903400_r8, 141.908940_r8, & - 99.716850_r8, 106.120800_r8, 124.135000_r8, 26.036800_r8, 28.051600_r8, & - 46.065800_r8, 62.065200_r8, 30.066400_r8, 42.077400_r8, 76.091000_r8, & - 44.092200_r8, 110.109200_r8, 153.821800_r8, 165.364506_r8, 148.910210_r8, & - 137.367503_r8, 187.375310_r8, 170.921013_r8, 154.466716_r8, 120.913206_r8, & - 173.833800_r8, 30.025200_r8, 94.937200_r8, 133.402300_r8, 44.051000_r8, & - 50.485900_r8, 41.050940_r8, 58.076800_r8, 72.061400_r8, 60.050400_r8, & - 76.049800_r8, 32.040000_r8, 48.039400_r8, 16.040600_r8, 252.730400_r8, & - 35.452700_r8, 70.905400_r8, 102.904200_r8, 51.452100_r8, 97.457640_r8, & - 100.916850_r8, 28.010400_r8, 44.009800_r8, 66.007206_r8, 82.461503_r8, & - 108.135600_r8, 62.132400_r8, 135.064039_r8, 135.064039_r8, 135.064039_r8, & - 28.010400_r8, 78.064600_r8, 18.998403_r8, 60.050400_r8, 58.035600_r8, & - 1.007400_r8, 2.014800_r8, 259.823613_r8, 34.013600_r8, 98.078400_r8, & - 80.911400_r8, 116.948003_r8, 100.493706_r8, 86.467906_r8, 36.460100_r8, & - 27.025140_r8, 46.024600_r8, 20.005803_r8, 63.012340_r8, 79.011740_r8, & - 96.910800_r8, 52.459500_r8, 135.114940_r8, 116.112400_r8, 74.076200_r8, & - 100.113000_r8, 118.127200_r8, 68.114200_r8, 147.125940_r8, 147.125940_r8, & - 162.117940_r8, 163.125340_r8, 118.127200_r8, 184.350200_r8, 70.087800_r8, & - 120.100800_r8, 72.102600_r8, 104.101400_r8, 147.084740_r8, 136.228400_r8, & - 70.087800_r8, 14.006740_r8, 44.012880_r8, 108.010480_r8, 147.125940_r8, & - 145.111140_r8, 58.442468_r8, 58.442468_r8, 58.442468_r8, 17.028940_r8, & - 18.036340_r8, 28.010400_r8, 28.010400_r8, 30.006140_r8, 46.005540_r8, & - 62.004940_r8, 119.074340_r8, 231.239540_r8, 1.007400_r8, 1.007400_r8, & - 1.007400_r8, 1.007400_r8, 15.999400_r8, 47.998200_r8, 67.451500_r8, & - 60.076400_r8, 133.100140_r8, 121.047940_r8, 183.117740_r8, 93.102400_r8, & - 94.109800_r8, 176.121600_r8, 12.011000_r8, 12.011000_r8, 92.090400_r8, & - 90.075600_r8, 32.066000_r8, 146.056419_r8, 48.065400_r8, 64.064800_r8, & - 80.064200_r8, 115.107340_r8, 115.107340_r8, 115.107340_r8, 250.445000_r8, & - 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & - 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & - 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 28.010400_r8, & - 310.582400_r8, 140.134400_r8, 186.241400_r8, 215.240140_r8, 186.241400_r8, & - 168.227200_r8, 154.201400_r8, 174.148000_r8, 92.136200_r8, 150.126000_r8, & - 106.162000_r8, 188.173800_r8, 122.161400_r8, 204.173200_r8, 14.006740_r8, & - 14.006740_r8, 137.112200_r8, 103.135200_r8, 159.114800_r8, 123.127600_r8, & - 61.057800_r8, 75.083600_r8, 109.101800_r8, 75.042400_r8, 47.032000_r8, & - 129.089600_r8, 105.108800_r8, 61.057800_r8, 77.057200_r8, 33.006200_r8, & - 63.031400_r8, 117.119800_r8, 117.119800_r8, 119.093400_r8, 115.063800_r8, & - 101.079200_r8, 117.078600_r8, 103.094000_r8, 230.232140_r8, 15.999400_r8, & - 17.006800_r8, 175.114200_r8, 91.083000_r8, 89.068200_r8, 199.218600_r8, & - 185.234000_r8, 173.140600_r8, 149.118600_r8, 187.166400_r8, 203.165800_r8, & - 18.014200_r8 /) + ! adv_mass(:221) = (/ 133.141340_r8, 104.142600_r8, 28.010400_r8, 12.011000_r8, 12.011000_r8, & + ! 204.342600_r8, 78.110400_r8, 160.122200_r8, 126.108600_r8, 98.098200_r8, & + ! 84.072400_r8, 98.098200_r8, 98.098200_r8, 112.124000_r8, 72.143800_r8, & + ! 56.103200_r8, 79.904000_r8, 115.356700_r8, 95.903400_r8, 141.908940_r8, & + ! 99.716850_r8, 106.120800_r8, 124.135000_r8, 26.036800_r8, 28.051600_r8, & + ! 46.065800_r8, 62.065200_r8, 30.066400_r8, 42.077400_r8, 76.091000_r8, & + ! 44.092200_r8, 110.109200_r8, 153.821800_r8, 165.364506_r8, 148.910210_r8, & + ! 137.367503_r8, 187.375310_r8, 170.921013_r8, 154.466716_r8, 120.913206_r8, & + ! 173.833800_r8, 30.025200_r8, 94.937200_r8, 133.402300_r8, 44.051000_r8, & + ! 50.485900_r8, 41.050940_r8, 58.076800_r8, 72.061400_r8, 60.050400_r8, & + ! 76.049800_r8, 32.040000_r8, 48.039400_r8, 16.040600_r8, 252.730400_r8, & + ! 35.452700_r8, 70.905400_r8, 102.904200_r8, 51.452100_r8, 97.457640_r8, & + ! 100.916850_r8, 28.010400_r8, 44.009800_r8, 66.007206_r8, 82.461503_r8, & + ! 108.135600_r8, 62.132400_r8, 135.064039_r8, 135.064039_r8, 135.064039_r8, & + ! 28.010400_r8, 78.064600_r8, 18.998403_r8, 60.050400_r8, 58.035600_r8, & + ! 1.007400_r8, 2.014800_r8, 259.823613_r8, 34.013600_r8, 98.078400_r8, & + ! 80.911400_r8, 116.948003_r8, 100.493706_r8, 86.467906_r8, 36.460100_r8, & + ! 27.025140_r8, 46.024600_r8, 20.005803_r8, 63.012340_r8, 79.011740_r8, & + ! 96.910800_r8, 52.459500_r8, 135.114940_r8, 116.112400_r8, 74.076200_r8, & + ! 100.113000_r8, 118.127200_r8, 68.114200_r8, 147.125940_r8, 147.125940_r8, & + ! 162.117940_r8, 163.125340_r8, 118.127200_r8, 184.350200_r8, 70.087800_r8, & + ! 120.100800_r8, 72.102600_r8, 104.101400_r8, 147.084740_r8, 136.228400_r8, & + ! 70.087800_r8, 14.006740_r8, 44.012880_r8, 108.010480_r8, 147.125940_r8, & + ! 145.111140_r8, 58.442468_r8, 58.442468_r8, 58.442468_r8, 17.028940_r8, & + ! 18.036340_r8, 28.010400_r8, 28.010400_r8, 30.006140_r8, 46.005540_r8, & + ! 62.004940_r8, 119.074340_r8, 231.239540_r8, 1.007400_r8, 1.007400_r8, & + ! 1.007400_r8, 1.007400_r8, 15.999400_r8, 47.998200_r8, 67.451500_r8, & + ! 60.076400_r8, 133.100140_r8, 121.047940_r8, 183.117740_r8, 93.102400_r8, & + ! 94.109800_r8, 176.121600_r8, 12.011000_r8, 12.011000_r8, 92.090400_r8, & + ! 90.075600_r8, 32.066000_r8, 146.056419_r8, 48.065400_r8, 64.064800_r8, & + ! 80.064200_r8, 115.107340_r8, 115.107340_r8, 115.107340_r8, 250.445000_r8, & + ! 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & + ! 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & + ! 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 28.010400_r8, & + ! 310.582400_r8, 140.134400_r8, 186.241400_r8, 215.240140_r8, 186.241400_r8, & + ! 168.227200_r8, 154.201400_r8, 174.148000_r8, 92.136200_r8, 150.126000_r8, & + ! 106.162000_r8, 188.173800_r8, 122.161400_r8, 204.173200_r8, 14.006740_r8, & + ! 14.006740_r8, 137.112200_r8, 103.135200_r8, 159.114800_r8, 123.127600_r8, & + ! 61.057800_r8, 75.083600_r8, 109.101800_r8, 75.042400_r8, 47.032000_r8, & + ! 129.089600_r8, 105.108800_r8, 61.057800_r8, 77.057200_r8, 33.006200_r8, & + ! 63.031400_r8, 117.119800_r8, 117.119800_r8, 119.093400_r8, 115.063800_r8, & + ! 101.079200_r8, 117.078600_r8, 103.094000_r8, 230.232140_r8, 15.999400_r8, & + ! 17.006800_r8, 175.114200_r8, 91.083000_r8, 89.068200_r8, 199.218600_r8, & + ! 185.234000_r8, 173.140600_r8, 149.118600_r8, 187.166400_r8, 203.165800_r8, & + ! 18.014200_r8 /) - crb_mass(:221) = (/ 60.055000_r8, 60.055000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & - 180.165000_r8, 72.066000_r8, 72.066000_r8, 72.066000_r8, 60.055000_r8, & - 48.044000_r8, 60.055000_r8, 60.055000_r8, 72.066000_r8, 60.055000_r8, & - 48.044000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & - 0.000000_r8, 84.077000_r8, 84.077000_r8, 24.022000_r8, 24.022000_r8, & - 24.022000_r8, 24.022000_r8, 24.022000_r8, 36.033000_r8, 36.033000_r8, & - 36.033000_r8, 72.066000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & - 12.011000_r8, 24.022000_r8, 24.022000_r8, 24.022000_r8, 12.011000_r8, & - 12.011000_r8, 12.011000_r8, 12.011000_r8, 24.022000_r8, 24.022000_r8, & - 12.011000_r8, 24.022000_r8, 36.033000_r8, 36.033000_r8, 24.022000_r8, & - 24.022000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & - 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & - 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & - 84.077000_r8, 24.022000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & - 12.011000_r8, 24.022000_r8, 0.000000_r8, 24.022000_r8, 24.022000_r8, & - 0.000000_r8, 0.000000_r8, 24.022000_r8, 0.000000_r8, 0.000000_r8, & - 0.000000_r8, 24.022000_r8, 24.022000_r8, 12.011000_r8, 0.000000_r8, & - 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & - 0.000000_r8, 0.000000_r8, 48.044000_r8, 60.055000_r8, 36.033000_r8, & - 60.055000_r8, 60.055000_r8, 60.055000_r8, 60.055000_r8, 60.055000_r8, & - 60.055000_r8, 60.055000_r8, 60.055000_r8, 156.143000_r8, 48.044000_r8, & - 48.044000_r8, 48.044000_r8, 48.044000_r8, 48.044000_r8, 120.110000_r8, & - 48.044000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 60.055000_r8, & - 60.055000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & - 0.000000_r8, 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, & - 0.000000_r8, 36.033000_r8, 120.110000_r8, 0.000000_r8, 0.000000_r8, & - 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & - 12.011000_r8, 48.044000_r8, 24.022000_r8, 84.077000_r8, 72.066000_r8, & - 72.066000_r8, 72.066000_r8, 12.011000_r8, 12.011000_r8, 36.033000_r8, & - 36.033000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & - 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 180.165000_r8, & - 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, & - 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, & - 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, 12.011000_r8, & - 264.242000_r8, 84.077000_r8, 120.110000_r8, 120.110000_r8, 120.110000_r8, & - 120.110000_r8, 108.099000_r8, 84.077000_r8, 84.077000_r8, 60.055000_r8, & - 96.088000_r8, 96.088000_r8, 96.088000_r8, 96.088000_r8, 0.000000_r8, & - 0.000000_r8, 84.077000_r8, 60.055000_r8, 72.066000_r8, 84.077000_r8, & - 24.022000_r8, 36.033000_r8, 72.066000_r8, 24.022000_r8, 12.011000_r8, & - 60.055000_r8, 48.044000_r8, 24.022000_r8, 24.022000_r8, 0.000000_r8, & - 12.011000_r8, 60.055000_r8, 60.055000_r8, 48.044000_r8, 48.044000_r8, & - 48.044000_r8, 48.044000_r8, 48.044000_r8, 120.110000_r8, 0.000000_r8, & - 0.000000_r8, 72.066000_r8, 36.033000_r8, 36.033000_r8, 120.110000_r8, & - 120.110000_r8, 84.077000_r8, 60.055000_r8, 96.088000_r8, 96.088000_r8, & - 0.000000_r8 /) + ! crb_mass(:221) = (/ 60.055000_r8, 60.055000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & + ! 180.165000_r8, 72.066000_r8, 72.066000_r8, 72.066000_r8, 60.055000_r8, & + ! 48.044000_r8, 60.055000_r8, 60.055000_r8, 72.066000_r8, 60.055000_r8, & + ! 48.044000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + ! 0.000000_r8, 84.077000_r8, 84.077000_r8, 24.022000_r8, 24.022000_r8, & + ! 24.022000_r8, 24.022000_r8, 24.022000_r8, 36.033000_r8, 36.033000_r8, & + ! 36.033000_r8, 72.066000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & + ! 12.011000_r8, 24.022000_r8, 24.022000_r8, 24.022000_r8, 12.011000_r8, & + ! 12.011000_r8, 12.011000_r8, 12.011000_r8, 24.022000_r8, 24.022000_r8, & + ! 12.011000_r8, 24.022000_r8, 36.033000_r8, 36.033000_r8, 24.022000_r8, & + ! 24.022000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & + ! 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + ! 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & + ! 84.077000_r8, 24.022000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + ! 12.011000_r8, 24.022000_r8, 0.000000_r8, 24.022000_r8, 24.022000_r8, & + ! 0.000000_r8, 0.000000_r8, 24.022000_r8, 0.000000_r8, 0.000000_r8, & + ! 0.000000_r8, 24.022000_r8, 24.022000_r8, 12.011000_r8, 0.000000_r8, & + ! 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + ! 0.000000_r8, 0.000000_r8, 48.044000_r8, 60.055000_r8, 36.033000_r8, & + ! 60.055000_r8, 60.055000_r8, 60.055000_r8, 60.055000_r8, 60.055000_r8, & + ! 60.055000_r8, 60.055000_r8, 60.055000_r8, 156.143000_r8, 48.044000_r8, & + ! 48.044000_r8, 48.044000_r8, 48.044000_r8, 48.044000_r8, 120.110000_r8, & + ! 48.044000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 60.055000_r8, & + ! 60.055000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + ! 0.000000_r8, 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, & + ! 0.000000_r8, 36.033000_r8, 120.110000_r8, 0.000000_r8, 0.000000_r8, & + ! 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + ! 12.011000_r8, 48.044000_r8, 24.022000_r8, 84.077000_r8, 72.066000_r8, & + ! 72.066000_r8, 72.066000_r8, 12.011000_r8, 12.011000_r8, 36.033000_r8, & + ! 36.033000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, & + ! 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 180.165000_r8, & + ! 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, & + ! 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, & + ! 180.165000_r8, 180.165000_r8, 180.165000_r8, 180.165000_r8, 12.011000_r8, & + ! 264.242000_r8, 84.077000_r8, 120.110000_r8, 120.110000_r8, 120.110000_r8, & + ! 120.110000_r8, 108.099000_r8, 84.077000_r8, 84.077000_r8, 60.055000_r8, & + ! 96.088000_r8, 96.088000_r8, 96.088000_r8, 96.088000_r8, 0.000000_r8, & + ! 0.000000_r8, 84.077000_r8, 60.055000_r8, 72.066000_r8, 84.077000_r8, & + ! 24.022000_r8, 36.033000_r8, 72.066000_r8, 24.022000_r8, 12.011000_r8, & + ! 60.055000_r8, 48.044000_r8, 24.022000_r8, 24.022000_r8, 0.000000_r8, & + ! 12.011000_r8, 60.055000_r8, 60.055000_r8, 48.044000_r8, 48.044000_r8, & + ! 48.044000_r8, 48.044000_r8, 48.044000_r8, 120.110000_r8, 0.000000_r8, & + ! 0.000000_r8, 72.066000_r8, 36.033000_r8, 36.033000_r8, 120.110000_r8, & + ! 120.110000_r8, 84.077000_r8, 60.055000_r8, 96.088000_r8, 96.088000_r8, & + ! 0.000000_r8 /) - fix_mass(: 3) = (/ 0.00000000_r8, 28.0134800_r8, 31.9988000_r8 /) + ! fix_mass(: 3) = (/ 0.00000000_r8, 28.0134800_r8, 31.9988000_r8 /) - clsmap(: 30,1) = (/ 3, 21, 33, 34, 35, 36, 37, 38, 39, 40, & - 41, 43, 44, 46, 54, 55, 61, 63, 71, 78, & - 82, 83, 84, 113, 122, 123, 148, 170, 185, 186 /) - clsmap(:191,4) = (/ 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, & - 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, & - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, & - 42, 45, 47, 48, 49, 50, 51, 52, 53, 56, & - 57, 58, 59, 60, 62, 64, 65, 66, 67, 68, & - 69, 70, 72, 73, 74, 75, 76, 77, 79, 80, & - 81, 85, 86, 87, 88, 89, 90, 91, 92, 93, & - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, & - 104, 105, 106, 107, 108, 109, 110, 111, 112, 114, & - 115, 116, 117, 118, 119, 120, 121, 124, 125, 126, & - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, & - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, & - 147, 149, 150, 151, 152, 153, 154, 155, 156, 157, & - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, & - 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, & - 179, 180, 181, 182, 183, 184, 187, 188, 189, 190, & - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, & - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, & - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, & - 221 /) + ! clsmap(: 30,1) = (/ 3, 21, 33, 34, 35, 36, 37, 38, 39, 40, & + ! 41, 43, 44, 46, 54, 55, 61, 63, 71, 78, & + ! 82, 83, 84, 113, 122, 123, 148, 170, 185, 186 /) + ! clsmap(:191,4) = (/ 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, & + ! 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, & + ! 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, & + ! 42, 45, 47, 48, 49, 50, 51, 52, 53, 56, & + ! 57, 58, 59, 60, 62, 64, 65, 66, 67, 68, & + ! 69, 70, 72, 73, 74, 75, 76, 77, 79, 80, & + ! 81, 85, 86, 87, 88, 89, 90, 91, 92, 93, & + ! 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, & + ! 104, 105, 106, 107, 108, 109, 110, 111, 112, 114, & + ! 115, 116, 117, 118, 119, 120, 121, 124, 125, 126, & + ! 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, & + ! 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, & + ! 147, 149, 150, 151, 152, 153, 154, 155, 156, 157, & + ! 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, & + ! 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, & + ! 179, 180, 181, 182, 183, 184, 187, 188, 189, 190, & + ! 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, & + ! 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, & + ! 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, & + ! 221 /) - permute(:191,4) = (/ 121, 120, 1, 2, 144, 46, 85, 47, 86, 96, & - 68, 117, 75, 60, 81, 174, 61, 187, 110, 62, & - 78, 70, 111, 64, 79, 71, 149, 90, 39, 65, & - 189, 161, 38, 147, 166, 108, 102, 134, 91, 184, & - 45, 36, 183, 148, 155, 40, 50, 52, 69, 3, & - 4, 5, 41, 132, 151, 142, 176, 162, 114, 42, & - 138, 177, 49, 133, 57, 175, 83, 131, 136, 154, & - 58, 156, 72, 43, 139, 113, 107, 164, 89, 123, & - 34, 165, 73, 104, 74, 106, 145, 169, 82, 67, & - 84, 152, 6, 7, 8, 37, 9, 190, 185, 179, & - 141, 87, 10, 11, 12, 13, 188, 186, 76, 80, & - 59, 97, 44, 98, 48, 77, 14, 15, 109, 88, & - 103, 167, 140, 63, 16, 17, 18, 19, 20, 21, & - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, & - 32, 33, 35, 53, 115, 118, 99, 150, 153, 116, & - 51, 54, 55, 124, 56, 92, 105, 146, 100, 93, & - 137, 135, 119, 173, 182, 129, 112, 66, 125, 178, & - 94, 168, 171, 170, 126, 172, 143, 122, 159, 180, & - 181, 95, 130, 160, 158, 157, 127, 163, 128, 101, & - 191 /) + ! permute(:191,4) = (/ 121, 120, 1, 2, 144, 46, 85, 47, 86, 96, & + ! 68, 117, 75, 60, 81, 174, 61, 187, 110, 62, & + ! 78, 70, 111, 64, 79, 71, 149, 90, 39, 65, & + ! 189, 161, 38, 147, 166, 108, 102, 134, 91, 184, & + ! 45, 36, 183, 148, 155, 40, 50, 52, 69, 3, & + ! 4, 5, 41, 132, 151, 142, 176, 162, 114, 42, & + ! 138, 177, 49, 133, 57, 175, 83, 131, 136, 154, & + ! 58, 156, 72, 43, 139, 113, 107, 164, 89, 123, & + ! 34, 165, 73, 104, 74, 106, 145, 169, 82, 67, & + ! 84, 152, 6, 7, 8, 37, 9, 190, 185, 179, & + ! 141, 87, 10, 11, 12, 13, 188, 186, 76, 80, & + ! 59, 97, 44, 98, 48, 77, 14, 15, 109, 88, & + ! 103, 167, 140, 63, 16, 17, 18, 19, 20, 21, & + ! 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, & + ! 32, 33, 35, 53, 115, 118, 99, 150, 153, 116, & + ! 51, 54, 55, 124, 56, 92, 105, 146, 100, 93, & + ! 137, 135, 119, 173, 182, 129, 112, 66, 125, 178, & + ! 94, 168, 171, 170, 126, 172, 143, 122, 159, 180, & + ! 181, 95, 130, 160, 158, 157, 127, 163, 128, 101, & + ! 191 /) - diag_map(:191) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, & - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, & - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, & - 31, 32, 33, 39, 45, 46, 49, 52, 55, 59, & - 62, 65, 68, 71, 74, 81, 87, 91, 96, 100, & - 109, 116, 121, 125, 134, 142, 147, 150, 155, 158, & - 161, 164, 168, 172, 176, 180, 184, 190, 193, 199, & - 205, 211, 214, 219, 224, 229, 234, 240, 245, 250, & - 258, 266, 272, 278, 284, 290, 296, 302, 308, 314, & - 320, 326, 334, 340, 347, 353, 356, 363, 367, 376, & - 384, 391, 397, 403, 409, 415, 423, 431, 435, 443, & - 451, 459, 467, 476, 483, 494, 503, 507, 515, 522, & - 533, 544, 552, 563, 576, 583, 594, 610, 621, 630, & - 640, 649, 657, 661, 666, 677, 687, 695, 709, 726, & - 732, 739, 744, 761, 787, 809, 819, 827, 841, 856, & - 865, 874, 886, 898, 911, 915, 928, 950, 969, 985, & - 996,1007,1024,1044,1060,1072,1083,1108,1130,1153, & - 1186,1205,1236,1250,1263,1276,1296,1390,1448,1473, & - 1621,1672,1699,1734,1776,1837,1862,1893,1917,1996, & - 2022 /) + ! diag_map(:191) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, & + ! 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, & + ! 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, & + ! 31, 32, 33, 39, 45, 46, 49, 52, 55, 59, & + ! 62, 65, 68, 71, 74, 81, 87, 91, 96, 100, & + ! 109, 116, 121, 125, 134, 142, 147, 150, 155, 158, & + ! 161, 164, 168, 172, 176, 180, 184, 190, 193, 199, & + ! 205, 211, 214, 219, 224, 229, 234, 240, 245, 250, & + ! 258, 266, 272, 278, 284, 290, 296, 302, 308, 314, & + ! 320, 326, 334, 340, 347, 353, 356, 363, 367, 376, & + ! 384, 391, 397, 403, 409, 415, 423, 431, 435, 443, & + ! 451, 459, 467, 476, 483, 494, 503, 507, 515, 522, & + ! 533, 544, 552, 563, 576, 583, 594, 610, 621, 630, & + ! 640, 649, 657, 661, 666, 677, 687, 695, 709, 726, & + ! 732, 739, 744, 761, 787, 809, 819, 827, 841, 856, & + ! 865, 874, 886, 898, 911, 915, 928, 950, 969, 985, & + ! 996,1007,1024,1044,1060,1072,1083,1108,1130,1153, & + ! 1186,1205,1236,1250,1263,1276,1296,1390,1448,1473, & + ! 1621,1672,1699,1734,1776,1837,1862,1893,1917,1996, & + ! 2022 /) - extfrc_lst(: 17) = (/ 'so4_a2 ','NO ','NO2 ','SO2 ','SVOC ', & - 'pom_a1 ','pom_a4 ','so4_a1 ','CO ','bc_a1 ', & - 'bc_a4 ','num_a1 ','num_a2 ','num_a4 ','OH ', & - 'N ','AOA_NH ' /) + ! extfrc_lst(: 17) = (/ 'so4_a2 ','NO ','NO2 ','SO2 ','SVOC ', & + ! 'pom_a1 ','pom_a4 ','so4_a1 ','CO ','bc_a1 ', & + ! 'bc_a4 ','num_a1 ','num_a2 ','num_a4 ','OH ', & + ! 'N ','AOA_NH ' /) - frc_from_dataset(: 17) = (/ .true., .true., .true., .true., .true., & - .true., .true., .true., .true., .true., & - .true., .true., .true., .true., .false., & - .false., .false. /) + ! frc_from_dataset(: 17) = (/ .true., .true., .true., .true., .true., & + ! .true., .true., .true., .true., .true., & + ! .true., .true., .true., .true., .false., & + ! .false., .false. /) - inv_lst(: 3) = (/ 'M ', 'N2 ', 'O2 ' /) + ! inv_lst(: 3) = (/ 'M ', 'N2 ', 'O2 ' /) - slvd_lst(: 34) = (/ 'ACBZO2 ', 'ALKO2 ', 'BENZO2 ', 'BZOO ', 'C2H5O2 ', & - 'C3H7O2 ', 'C6H5O2 ', 'CH3CO3 ', 'CH3O2 ', 'DICARBO2 ', & - 'ENEO2 ', 'EO ', 'EO2 ', 'HO2 ', 'HOCH2OO ', & - 'ISOPAO2 ', 'ISOPBO2 ', 'MACRO2 ', 'MALO2 ', 'MCO3 ', & - 'MDIALO2 ', 'MEKO2 ', 'NTERPO2 ', 'O1D ', 'OH ', & - 'PHENO2 ', 'PO2 ', 'RO2 ', 'TERP2O2 ', 'TERPO2 ', & - 'TOLO2 ', 'XO2 ', 'XYLENO2 ', 'XYLOLO2 ' /) + ! slvd_lst(: 34) = (/ 'ACBZO2 ', 'ALKO2 ', 'BENZO2 ', 'BZOO ', 'C2H5O2 ', & + ! 'C3H7O2 ', 'C6H5O2 ', 'CH3CO3 ', 'CH3O2 ', 'DICARBO2 ', & + ! 'ENEO2 ', 'EO ', 'EO2 ', 'HO2 ', 'HOCH2OO ', & + ! 'ISOPAO2 ', 'ISOPBO2 ', 'MACRO2 ', 'MALO2 ', 'MCO3 ', & + ! 'MDIALO2 ', 'MEKO2 ', 'NTERPO2 ', 'O1D ', 'OH ', & + ! 'PHENO2 ', 'PO2 ', 'RO2 ', 'TERP2O2 ', 'TERPO2 ', & + ! 'TOLO2 ', 'XO2 ', 'XYLENO2 ', 'XYLOLO2 ' /) - if( allocated( rxt_tag_lst ) ) then - deallocate( rxt_tag_lst ) - end if - allocate( rxt_tag_lst(rxt_tag_cnt),stat=ios ) - if( ios /= 0 ) then - write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_lst; error = ',ios - call endrun - end if - if( allocated( rxt_tag_map ) ) then - deallocate( rxt_tag_map ) - end if - allocate( rxt_tag_map(rxt_tag_cnt),stat=ios ) - if( ios /= 0 ) then - write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_map; error = ',ios - call endrun - end if - rxt_tag_lst( 1: 200) = (/ 'jh2o_b ', 'jh2o_a ', & - 'jh2o_c ', 'jh2o2 ', & - 'jo2_a ', 'jo2_b ', & - 'jo3_a ', 'jo3_b ', & - 'jhno3 ', 'jho2no2_a ', & - 'jho2no2_b ', 'jn2o ', & - 'jn2o5_a ', 'jn2o5_b ', & - 'jno ', 'jno2 ', & - 'jno3_b ', 'jno3_a ', & - 'jalknit ', 'jalkooh ', & - 'jbenzooh ', 'jbepomuc ', & - 'jbigald ', 'jbigald1 ', & - 'jbigald2 ', 'jbigald3 ', & - 'jbigald4 ', 'jbzooh ', & - 'jc2h5ooh ', 'jc3h7ooh ', & - 'jc6h5ooh ', 'jch2o_a ', & - 'jch2o_b ', 'jch3cho ', & - 'jacet ', 'jmgly ', & - 'jch3co3h ', 'jch3ooh ', & - 'jch4_a ', 'jch4_b ', & - 'jco2 ', 'jeooh ', & - 'jglyald ', 'jglyoxal ', & - 'jhonitr ', 'jhpald ', & - 'jhyac ', 'jisopnooh ', & - 'jisopooh ', 'jmacr_a ', & - 'jmacr_b ', 'jmek ', & - 'jmekooh ', 'jmpan ', & - 'jmvk ', 'jnc4cho ', & - 'jnoa ', 'jnterpooh ', & - 'jonitr ', 'jpan ', & - 'jphenooh ', 'jpooh ', & - 'jrooh ', 'jtepomuc ', & - 'jterp2ooh ', 'jterpnit ', & - 'jterpooh ', 'jterprd1 ', & - 'jterprd2 ', 'jtolooh ', & - 'jxooh ', 'jxylenooh ', & - 'jxylolooh ', 'jbrcl ', & - 'jbro ', 'jbrono2_b ', & - 'jbrono2_a ', 'jccl4 ', & - 'jcf2clbr ', 'jcf3br ', & - 'jcfcl3 ', 'jcfc113 ', & - 'jcfc114 ', 'jcfc115 ', & - 'jcf2cl2 ', 'jch2br2 ', & - 'jch3br ', 'jch3ccl3 ', & - 'jch3cl ', 'jchbr3 ', & - 'jcl2 ', 'jcl2o2 ', & - 'jclo ', 'jclono2_a ', & - 'jclono2_b ', 'jcof2 ', & - 'jcofcl ', 'jh2402 ', & - 'jhbr ', 'jhcfc141b ', & - 'jhcfc142b ', 'jhcfc22 ', & - 'jhcl ', 'jhf ', & - 'jhobr ', 'jhocl ', & - 'joclo ', 'jsf6 ', & - 'jh2so4 ', 'jocs ', & - 'jso ', 'jso2 ', & - 'jso3 ', 'jsoa1_a1 ', & - 'jsoa1_a2 ', 'jsoa2_a1 ', & - 'jsoa2_a2 ', 'jsoa3_a1 ', & - 'jsoa3_a2 ', 'jsoa4_a1 ', & - 'jsoa4_a2 ', 'jsoa5_a1 ', & - 'jsoa5_a2 ', 'O1D_H2 ', & - 'O1D_H2O ', 'O1D_N2 ', & - 'O1D_O2ab ', 'O1D_O3 ', & - 'O_O3 ', 'usr_O_O ', & - 'usr_O_O2 ', 'H2_O ', & - 'H2O2_O ', 'H_HO2 ', & - 'H_HO2a ', 'H_HO2b ', & - 'H_O2 ', 'HO2_O ', & - 'HO2_O3 ', 'H_O3 ', & - 'OH_H2 ', 'OH_H2O2 ', & - 'OH_HO2 ', 'OH_O ', & - 'OH_O3 ', 'OH_OH ', & - 'OH_OH_M ', 'usr_HO2_HO2 ', & - 'HO2NO2_OH ', 'N_NO ', & - 'N_NO2a ', 'N_NO2b ', & - 'N_NO2c ', 'N_O2 ', & - 'NO2_O ', 'NO2_O3 ', & - 'NO2_O_M ', 'NO3_HO2 ', & - 'NO3_NO ', 'NO3_O ', & - 'NO3_OH ', 'N_OH ', & - 'NO_HO2 ', 'NO_O3 ', & - 'NO_O_M ', 'O1D_N2Oa ', & - 'O1D_N2Ob ', 'tag_NO2_HO2 ', & - 'tag_NO2_NO3 ', 'tag_NO2_OH ', & - 'usr_HNO3_OH ', 'usr_HO2NO2_M ', & - 'usr_N2O5_M ', 'CL_CH2O ', & - 'CL_CH4 ', 'CL_H2 ', & - 'CL_H2O2 ', 'CL_HO2a ', & - 'CL_HO2b ', 'CL_O3 ', & - 'CLO_CH3O2 ', 'CLO_CLOa ', & - 'CLO_CLOb ', 'CLO_CLOc ', & - 'CLO_HO2 ', 'CLO_NO ', & - 'CLONO2_CL ', 'CLO_NO2_M ', & - 'CLONO2_O ', 'CLONO2_OH ', & - 'CLO_O ', 'CLO_OHa ', & - 'CLO_OHb ', 'HCL_O ', & - 'HCL_OH ', 'HOCL_CL ', & - 'HOCL_O ', 'HOCL_OH ', & - 'O1D_CCL4 ', 'O1D_CF2CLBR ' /) - rxt_tag_lst( 201: 400) = (/ 'O1D_CFC11 ', 'O1D_CFC113 ', & - 'O1D_CFC114 ', 'O1D_CFC115 ', & - 'O1D_CFC12 ', 'O1D_HCLa ', & - 'O1D_HCLb ', 'tag_CLO_CLO_M ', & - 'usr_CL2O2_M ', 'BR_CH2O ', & - 'BR_HO2 ', 'BR_O3 ', & - 'BRO_BRO ', 'BRO_CLOa ', & - 'BRO_CLOb ', 'BRO_CLOc ', & - 'BRO_HO2 ', 'BRO_NO ', & - 'BRO_NO2_M ', 'BRONO2_O ', & - 'BRO_O ', 'BRO_OH ', & - 'HBR_O ', 'HBR_OH ', & - 'HOBR_O ', 'O1D_CF3BR ', & - 'O1D_CHBR3 ', 'O1D_H2402 ', & - 'O1D_HBRa ', 'O1D_HBRb ', & - 'F_CH4 ', 'F_H2 ', & - 'F_H2O ', 'F_HNO3 ', & - 'O1D_COF2 ', 'O1D_COFCL ', & - 'CH2BR2_CL ', 'CH2BR2_OH ', & - 'CH3BR_CL ', 'CH3BR_OH ', & - 'CH3CCL3_OH ', 'CH3CL_CL ', & - 'CH3CL_OH ', 'CHBR3_CL ', & - 'CHBR3_OH ', 'HCFC141B_OH ', & - 'HCFC142B_OH ', 'HCFC22_OH ', & - 'O1D_CH2BR2 ', 'O1D_CH3BR ', & - 'O1D_HCFC141B ', 'O1D_HCFC142B ', & - 'O1D_HCFC22 ', 'CH2O_HO2 ', & - 'CH2O_NO3 ', 'CH2O_O ', & - 'CH2O_OH ', 'CH3O2_CH3O2a ', & - 'CH3O2_CH3O2b ', 'CH3O2_HO2 ', & - 'CH3O2_NO ', 'CH3OH_OH ', & - 'CH3OOH_OH ', 'CH4_OH ', & - 'CO_OH_M ', 'HCN_OH ', & - 'HCOOH_OH ', 'HOCH2OO_HO2 ', & - 'HOCH2OO_M ', 'HOCH2OO_NO ', & - 'O1D_CH4a ', 'O1D_CH4b ', & - 'O1D_CH4c ', 'O1D_HCN ', & - 'usr_CO_OH_b ', 'C2H2_CL_M ', & - 'C2H2_OH_M ', 'C2H4_CL_M ', & - 'C2H4_O3 ', 'C2H5O2_C2H5O2 ', & - 'C2H5O2_CH3O2 ', 'C2H5O2_HO2 ', & - 'C2H5O2_NO ', 'C2H5OH_OH ', & - 'C2H5OOH_OH ', 'C2H6_CL ', & - 'C2H6_OH ', 'CH3CHO_NO3 ', & - 'CH3CHO_OH ', 'CH3CN_OH ', & - 'CH3CO3_CH3CO3 ', 'CH3CO3_CH3O2 ', & - 'CH3CO3_HO2 ', 'CH3CO3_NO ', & - 'CH3COOH_OH ', 'CH3COOOH_OH ', & - 'EO2_HO2 ', 'EO2_NO ', & - 'EO_M ', 'EO_O2 ', & - 'GLYALD_OH ', 'GLYOXAL_OH ', & - 'PAN_OH ', 'tag_C2H4_OH ', & - 'tag_CH3CO3_NO2 ', 'usr_PAN_M ', & - 'C3H6_NO3 ', 'C3H6_O3 ', & - 'C3H7O2_CH3O2 ', 'C3H7O2_HO2 ', & - 'C3H7O2_NO ', 'C3H7OOH_OH ', & - 'C3H8_OH ', 'CH3COCHO_NO3 ', & - 'CH3COCHO_OH ', 'HYAC_OH ', & - 'NOA_OH ', 'PO2_HO2 ', & - 'PO2_NO ', 'POOH_OH ', & - 'RO2_CH3O2 ', 'RO2_HO2 ', & - 'RO2_NO ', 'ROOH_OH ', & - 'tag_C3H6_OH ', 'usr_CH3COCH3_OH ', & - 'BIGENE_NO3 ', 'BIGENE_OH ', & - 'ENEO2_NO ', 'ENEO2_NOb ', & - 'HONITR_OH ', 'MACRO2_CH3CO3 ', & - 'MACRO2_CH3O2 ', 'MACRO2_HO2 ', & - 'MACRO2_NO3 ', 'MACRO2_NOa ', & - 'MACRO2_NOb ', 'MACR_O3 ', & - 'MACR_OH ', 'MACROOH_OH ', & - 'MCO3_CH3CO3 ', 'MCO3_CH3O2 ', & - 'MCO3_HO2 ', 'MCO3_MCO3 ', & - 'MCO3_NO ', 'MCO3_NO3 ', & - 'MEKO2_HO2 ', 'MEKO2_NO ', & - 'MEK_OH ', 'MEKOOH_OH ', & - 'MPAN_OH_M ', 'MVK_O3 ', & - 'MVK_OH ', 'usr_MCO3_NO2 ', & - 'usr_MPAN_M ', 'ALKNIT_OH ', & - 'ALKO2_HO2 ', 'ALKO2_NO ', & - 'ALKO2_NOb ', 'ALKOOH_OH ', & - 'BIGALK_OH ', 'HPALD_OH ', & - 'HYDRALD_OH ', 'IEPOX_OH ', & - 'ISOPAO2_CH3CO3 ', 'ISOPAO2_CH3O2 ', & - 'ISOPAO2_HO2 ', 'ISOPAO2_NO ', & - 'ISOPAO2_NO3 ', 'ISOPBO2_CH3CO3 ', & - 'ISOPBO2_CH3O2 ', 'ISOPBO2_HO2 ', & - 'ISOPBO2_M ', 'ISOPBO2_NO ', & - 'ISOPBO2_NO3 ', 'ISOPNITA_OH ', & - 'ISOPNITB_OH ', 'ISOP_NO3 ', & - 'ISOPNO3_CH3CO3 ', 'ISOPNO3_CH3O2 ', & - 'ISOPNO3_HO2 ', 'ISOPNO3_NO ', & - 'ISOPNO3_NO3 ', 'ISOPNOOH_OH ', & - 'ISOP_O3 ', 'ISOP_OH ', & - 'ISOPOOH_OH ', 'NC4CH2OH_OH ', & - 'NC4CHO_OH ', 'XO2_CH3CO3 ', & - 'XO2_CH3O2 ', 'XO2_HO2 ', & - 'XO2_NO ', 'XO2_NO3 ', & - 'XOOH_OH ', 'ACBZO2_HO2 ', & - 'ACBZO2_NO ', 'BENZENE_OH ', & - 'BENZO2_HO2 ', 'BENZO2_NO ' /) - rxt_tag_lst( 401: 528) = (/ 'BENZOOH_OH ', 'BZALD_OH ', & - 'BZOO_HO2 ', 'BZOOH_OH ', & - 'BZOO_NO ', 'C6H5O2_HO2 ', & - 'C6H5O2_NO ', 'C6H5OOH_OH ', & - 'CRESOL_OH ', 'DICARBO2_HO2 ', & - 'DICARBO2_NO ', 'DICARBO2_NO2 ', & - 'MALO2_HO2 ', 'MALO2_NO ', & - 'MALO2_NO2 ', 'MDIALO2_HO2 ', & - 'MDIALO2_NO ', 'MDIALO2_NO2 ', & - 'PHENO2_HO2 ', 'PHENO2_NO ', & - 'PHENOL_OH ', 'PHENO_NO2 ', & - 'PHENO_O3 ', 'PHENOOH_OH ', & - 'tag_ACBZO2_NO2 ', 'TOLO2_HO2 ', & - 'TOLO2_NO ', 'TOLOOH_OH ', & - 'TOLUENE_OH ', 'usr_PBZNIT_M ', & - 'XYLENES_OH ', 'XYLENO2_HO2 ', & - 'XYLENO2_NO ', 'XYLENOOH_OH ', & - 'XYLOLO2_HO2 ', 'XYLOLO2_NO ', & - 'XYLOL_OH ', 'XYLOLOOH_OH ', & - 'BCARY_NO3 ', 'BCARY_O3 ', & - 'BCARY_OH ', 'MTERP_NO3 ', & - 'MTERP_O3 ', 'MTERP_OH ', & - 'NTERPO2_CH3O2 ', 'NTERPO2_HO2 ', & - 'NTERPO2_NO ', 'NTERPO2_NO3 ', & - 'NTERPOOH_OH ', 'TERP2O2_CH3O2 ', & - 'TERP2O2_HO2 ', 'TERP2O2_NO ', & - 'TERP2OOH_OH ', 'TERPNIT_OH ', & - 'TERPO2_CH3O2 ', 'TERPO2_HO2 ', & - 'TERPO2_NO ', 'TERPOOH_OH ', & - 'TERPROD1_NO3 ', 'TERPROD1_OH ', & - 'TERPROD2_OH ', 'OCS_O ', & - 'OCS_OH ', 'S_O2 ', & - 'S_O3 ', 'SO_BRO ', & - 'SO_CLO ', 'S_OH ', & - 'SO_NO2 ', 'SO_O2 ', & - 'SO_O3 ', 'SO_OCLO ', & - 'SO_OH ', 'usr_SO2_OH ', & - 'usr_SO3_H2O ', 'DMS_NO3 ', & - 'DMS_OHa ', 'NH3_OH ', & - 'usr_DMS_OH ', 'usr_GLYOXAL_aer ', & - 'usr_HO2_aer ', 'usr_HONITR_aer ', & - 'usr_ISOPNITA_aer ', 'usr_ISOPNITB_aer ', & - 'usr_N2O5_aer ', 'usr_NC4CH2OH_aer ', & - 'usr_NC4CHO_aer ', 'usr_NH4_strat_tau ', & - 'usr_NO2_aer ', 'usr_NO3_aer ', & - 'usr_NTERPOOH_aer ', 'usr_ONITR_aer ', & - 'usr_TERPNIT_aer ', 'BCARY_NO3_vbs ', & - 'BCARY_O3_vbs ', 'BCARY_OH_vbs ', & - 'BENZENE_OH_vbs ', 'ISOP_NO3_vbs ', & - 'ISOP_O3_vbs ', 'ISOP_OH_vbs ', & - 'IVOC_OH ', 'MTERP_NO3_vbs ', & - 'MTERP_O3_vbs ', 'MTERP_OH_vbs ', & - 'SVOC_OH ', 'TOLUENE_OH_vbs ', & - 'XYLENES_OH_vbs ', 'het1 ', & - 'het10 ', 'het11 ', & - 'het12 ', 'het13 ', & - 'het14 ', 'het15 ', & - 'het16 ', 'het17 ', & - 'het2 ', 'het3 ', & - 'het4 ', 'het5 ', & - 'het6 ', 'het7 ', & - 'het8 ', 'het9 ', & - 'E90_tau ', 'NH_50_tau ', & - 'NH_5_tau ', 'ST80_25_tau ' /) - rxt_tag_map(:rxt_tag_cnt) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, & - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, & - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, & - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, & - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, & - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, & - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, & - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, & - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, & - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, & - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, & - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, & - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, & - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, & - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, & - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, & - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, & - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, & - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, & - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, & - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, & - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, & - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, & - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, & - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, & - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, & - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, & - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, & - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, & - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, & - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, & - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, & - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, & - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, & - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, & - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, & - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, & - 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, & - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, & - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, & - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, & - 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, & - 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, & - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, & - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, & - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, & - 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, & - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, & - 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, & - 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, & - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, & - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, & - 521, 522, 523, 524, 525, 526, 527, 528 /) - if( allocated( pht_alias_lst ) ) then - deallocate( pht_alias_lst ) - end if - allocate( pht_alias_lst(phtcnt,2),stat=ios ) - if( ios /= 0 ) then - write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_lst; error = ',ios - call endrun - end if - if( allocated( pht_alias_mult ) ) then - deallocate( pht_alias_mult ) - end if - allocate( pht_alias_mult(phtcnt,2),stat=ios ) - if( ios /= 0 ) then - write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_mult; error = ',ios - call endrun - end if - pht_alias_lst(:,1) = (/ ' ', ' ', ' ', ' ', & - 'userdefined ', 'userdefined ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', 'userdefined ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ' /) - pht_alias_lst(:,2) = (/ ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', 'jch3ooh ', 'jch3ooh ', & - 'jch3ooh ', 'jno2 ', 'jno2 ', 'jno2 ', & - 'jno2 ', 'jno2 ', 'jno2 ', 'jch3ooh ', & - 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', ' ', & - ' ', ' ', ' ', ' ', & - 'jh2o2 ', ' ', ' ', ' ', & - ' ', 'jch3ooh ', ' ', 'jmgly ', & - 'jch2o_a ', 'jno2 ', ' ', 'jch3ooh ', & - 'jch3ooh ', ' ', ' ', 'jacet ', & - 'jch3ooh ', 'jpan ', ' ', 'jch2o_a ', & - 'jch2o_a ', 'jch3ooh ', 'jch3cho ', ' ', & - 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', 'jno2 ', & - 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', 'jch3cho ', & - 'jch3cho ', 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', & - 'jch3ooh ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', ' ', ' ', ' ', & - ' ', 'jno2 ', 'jno2 ', 'jno2 ', & - 'jno2 ', 'jno2 ', 'jno2 ', 'jno2 ', & - 'jno2 ', 'jno2 ', 'jno2 ' /) - pht_alias_mult(:,1) = (/ 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8 /) - pht_alias_mult(:,2) = (/ 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, .10_r8, 0.2_r8, .14_r8, .20_r8, & - .20_r8, .006_r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 0.28_r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - .006_r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, .10_r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - 1._r8, 1._r8, 1._r8, .0004_r8, .0004_r8, & - .0004_r8, .0004_r8, .0004_r8, .0004_r8, .0004_r8, & - .0004_r8, .0004_r8, .0004_r8 /) - allocate( cph_enthalpy(enthalpy_cnt),stat=ios ) - if( ios /= 0 ) then - write(iulog,*) 'set_sim_dat: failed to allocate cph_enthalpy; error = ',ios - call endrun - end if - allocate( cph_rid(enthalpy_cnt),stat=ios ) - if( ios /= 0 ) then - write(iulog,*) 'set_sim_dat: failed to allocate cph_rid; error = ',ios - call endrun - end if - cph_rid(:) = (/ 126, 129, 130, 131, 134, & - 137, 138, 139, 140, 143, & - 144, 145, 148, 150, 154, & - 155, 163, 164 /) - cph_enthalpy(:) = (/ 189.810000_r8, 392.190000_r8, 493.580000_r8, 101.390000_r8, 232.590000_r8, & - 203.400000_r8, 226.580000_r8, 120.100000_r8, 194.710000_r8, 293.620000_r8, & - 67.670000_r8, 165.300000_r8, 165.510000_r8, 313.750000_r8, 133.750000_r8, & - 193.020000_r8, 34.470000_r8, 199.170000_r8 /) - allocate( num_rnts(rxntot-phtcnt),stat=ios ) - if( ios /= 0 ) then - write(iulog,*) 'set_sim_dat: failed to allocate num_rnts; error = ',ios - call endrun - end if - num_rnts(:) = (/ 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, & - 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & - 2, 3, 2, 2, 3, 3, 3, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 3, 3, 2, 2, 1, 2, 2, 2, 2, & - 2, 2, 3, 3, 3, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, & - 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, & - 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, & - 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, & - 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, & - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, & - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, & - 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, & - 2, 1, 1, 1, 1 /) + ! if( allocated( rxt_tag_lst ) ) then + ! deallocate( rxt_tag_lst ) + ! end if + ! allocate( rxt_tag_lst(rxt_tag_cnt),stat=ios ) + ! if( ios /= 0 ) then + ! write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_lst; error = ',ios + ! call endrun + ! end if + ! if( allocated( rxt_tag_map ) ) then + ! deallocate( rxt_tag_map ) + ! end if + ! allocate( rxt_tag_map(rxt_tag_cnt),stat=ios ) + ! if( ios /= 0 ) then + ! write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_map; error = ',ios + ! call endrun + ! end if + ! rxt_tag_lst( 1: 200) = (/ 'jh2o_b ', 'jh2o_a ', & + ! 'jh2o_c ', 'jh2o2 ', & + ! 'jo2_a ', 'jo2_b ', & + ! 'jo3_a ', 'jo3_b ', & + ! 'jhno3 ', 'jho2no2_a ', & + ! 'jho2no2_b ', 'jn2o ', & + ! 'jn2o5_a ', 'jn2o5_b ', & + ! 'jno ', 'jno2 ', & + ! 'jno3_b ', 'jno3_a ', & + ! 'jalknit ', 'jalkooh ', & + ! 'jbenzooh ', 'jbepomuc ', & + ! 'jbigald ', 'jbigald1 ', & + ! 'jbigald2 ', 'jbigald3 ', & + ! 'jbigald4 ', 'jbzooh ', & + ! 'jc2h5ooh ', 'jc3h7ooh ', & + ! 'jc6h5ooh ', 'jch2o_a ', & + ! 'jch2o_b ', 'jch3cho ', & + ! 'jacet ', 'jmgly ', & + ! 'jch3co3h ', 'jch3ooh ', & + ! 'jch4_a ', 'jch4_b ', & + ! 'jco2 ', 'jeooh ', & + ! 'jglyald ', 'jglyoxal ', & + ! 'jhonitr ', 'jhpald ', & + ! 'jhyac ', 'jisopnooh ', & + ! 'jisopooh ', 'jmacr_a ', & + ! 'jmacr_b ', 'jmek ', & + ! 'jmekooh ', 'jmpan ', & + ! 'jmvk ', 'jnc4cho ', & + ! 'jnoa ', 'jnterpooh ', & + ! 'jonitr ', 'jpan ', & + ! 'jphenooh ', 'jpooh ', & + ! 'jrooh ', 'jtepomuc ', & + ! 'jterp2ooh ', 'jterpnit ', & + ! 'jterpooh ', 'jterprd1 ', & + ! 'jterprd2 ', 'jtolooh ', & + ! 'jxooh ', 'jxylenooh ', & + ! 'jxylolooh ', 'jbrcl ', & + ! 'jbro ', 'jbrono2_b ', & + ! 'jbrono2_a ', 'jccl4 ', & + ! 'jcf2clbr ', 'jcf3br ', & + ! 'jcfcl3 ', 'jcfc113 ', & + ! 'jcfc114 ', 'jcfc115 ', & + ! 'jcf2cl2 ', 'jch2br2 ', & + ! 'jch3br ', 'jch3ccl3 ', & + ! 'jch3cl ', 'jchbr3 ', & + ! 'jcl2 ', 'jcl2o2 ', & + ! 'jclo ', 'jclono2_a ', & + ! 'jclono2_b ', 'jcof2 ', & + ! 'jcofcl ', 'jh2402 ', & + ! 'jhbr ', 'jhcfc141b ', & + ! 'jhcfc142b ', 'jhcfc22 ', & + ! 'jhcl ', 'jhf ', & + ! 'jhobr ', 'jhocl ', & + ! 'joclo ', 'jsf6 ', & + ! 'jh2so4 ', 'jocs ', & + ! 'jso ', 'jso2 ', & + ! 'jso3 ', 'jsoa1_a1 ', & + ! 'jsoa1_a2 ', 'jsoa2_a1 ', & + ! 'jsoa2_a2 ', 'jsoa3_a1 ', & + ! 'jsoa3_a2 ', 'jsoa4_a1 ', & + ! 'jsoa4_a2 ', 'jsoa5_a1 ', & + ! 'jsoa5_a2 ', 'O1D_H2 ', & + ! 'O1D_H2O ', 'O1D_N2 ', & + ! 'O1D_O2ab ', 'O1D_O3 ', & + ! 'O_O3 ', 'usr_O_O ', & + ! 'usr_O_O2 ', 'H2_O ', & + ! 'H2O2_O ', 'H_HO2 ', & + ! 'H_HO2a ', 'H_HO2b ', & + ! 'H_O2 ', 'HO2_O ', & + ! 'HO2_O3 ', 'H_O3 ', & + ! 'OH_H2 ', 'OH_H2O2 ', & + ! 'OH_HO2 ', 'OH_O ', & + ! 'OH_O3 ', 'OH_OH ', & + ! 'OH_OH_M ', 'usr_HO2_HO2 ', & + ! 'HO2NO2_OH ', 'N_NO ', & + ! 'N_NO2a ', 'N_NO2b ', & + ! 'N_NO2c ', 'N_O2 ', & + ! 'NO2_O ', 'NO2_O3 ', & + ! 'NO2_O_M ', 'NO3_HO2 ', & + ! 'NO3_NO ', 'NO3_O ', & + ! 'NO3_OH ', 'N_OH ', & + ! 'NO_HO2 ', 'NO_O3 ', & + ! 'NO_O_M ', 'O1D_N2Oa ', & + ! 'O1D_N2Ob ', 'tag_NO2_HO2 ', & + ! 'tag_NO2_NO3 ', 'tag_NO2_OH ', & + ! 'usr_HNO3_OH ', 'usr_HO2NO2_M ', & + ! 'usr_N2O5_M ', 'CL_CH2O ', & + ! 'CL_CH4 ', 'CL_H2 ', & + ! 'CL_H2O2 ', 'CL_HO2a ', & + ! 'CL_HO2b ', 'CL_O3 ', & + ! 'CLO_CH3O2 ', 'CLO_CLOa ', & + ! 'CLO_CLOb ', 'CLO_CLOc ', & + ! 'CLO_HO2 ', 'CLO_NO ', & + ! 'CLONO2_CL ', 'CLO_NO2_M ', & + ! 'CLONO2_O ', 'CLONO2_OH ', & + ! 'CLO_O ', 'CLO_OHa ', & + ! 'CLO_OHb ', 'HCL_O ', & + ! 'HCL_OH ', 'HOCL_CL ', & + ! 'HOCL_O ', 'HOCL_OH ', & + ! 'O1D_CCL4 ', 'O1D_CF2CLBR ' /) + ! rxt_tag_lst( 201: 400) = (/ 'O1D_CFC11 ', 'O1D_CFC113 ', & + ! 'O1D_CFC114 ', 'O1D_CFC115 ', & + ! 'O1D_CFC12 ', 'O1D_HCLa ', & + ! 'O1D_HCLb ', 'tag_CLO_CLO_M ', & + ! 'usr_CL2O2_M ', 'BR_CH2O ', & + ! 'BR_HO2 ', 'BR_O3 ', & + ! 'BRO_BRO ', 'BRO_CLOa ', & + ! 'BRO_CLOb ', 'BRO_CLOc ', & + ! 'BRO_HO2 ', 'BRO_NO ', & + ! 'BRO_NO2_M ', 'BRONO2_O ', & + ! 'BRO_O ', 'BRO_OH ', & + ! 'HBR_O ', 'HBR_OH ', & + ! 'HOBR_O ', 'O1D_CF3BR ', & + ! 'O1D_CHBR3 ', 'O1D_H2402 ', & + ! 'O1D_HBRa ', 'O1D_HBRb ', & + ! 'F_CH4 ', 'F_H2 ', & + ! 'F_H2O ', 'F_HNO3 ', & + ! 'O1D_COF2 ', 'O1D_COFCL ', & + ! 'CH2BR2_CL ', 'CH2BR2_OH ', & + ! 'CH3BR_CL ', 'CH3BR_OH ', & + ! 'CH3CCL3_OH ', 'CH3CL_CL ', & + ! 'CH3CL_OH ', 'CHBR3_CL ', & + ! 'CHBR3_OH ', 'HCFC141B_OH ', & + ! 'HCFC142B_OH ', 'HCFC22_OH ', & + ! 'O1D_CH2BR2 ', 'O1D_CH3BR ', & + ! 'O1D_HCFC141B ', 'O1D_HCFC142B ', & + ! 'O1D_HCFC22 ', 'CH2O_HO2 ', & + ! 'CH2O_NO3 ', 'CH2O_O ', & + ! 'CH2O_OH ', 'CH3O2_CH3O2a ', & + ! 'CH3O2_CH3O2b ', 'CH3O2_HO2 ', & + ! 'CH3O2_NO ', 'CH3OH_OH ', & + ! 'CH3OOH_OH ', 'CH4_OH ', & + ! 'CO_OH_M ', 'HCN_OH ', & + ! 'HCOOH_OH ', 'HOCH2OO_HO2 ', & + ! 'HOCH2OO_M ', 'HOCH2OO_NO ', & + ! 'O1D_CH4a ', 'O1D_CH4b ', & + ! 'O1D_CH4c ', 'O1D_HCN ', & + ! 'usr_CO_OH_b ', 'C2H2_CL_M ', & + ! 'C2H2_OH_M ', 'C2H4_CL_M ', & + ! 'C2H4_O3 ', 'C2H5O2_C2H5O2 ', & + ! 'C2H5O2_CH3O2 ', 'C2H5O2_HO2 ', & + ! 'C2H5O2_NO ', 'C2H5OH_OH ', & + ! 'C2H5OOH_OH ', 'C2H6_CL ', & + ! 'C2H6_OH ', 'CH3CHO_NO3 ', & + ! 'CH3CHO_OH ', 'CH3CN_OH ', & + ! 'CH3CO3_CH3CO3 ', 'CH3CO3_CH3O2 ', & + ! 'CH3CO3_HO2 ', 'CH3CO3_NO ', & + ! 'CH3COOH_OH ', 'CH3COOOH_OH ', & + ! 'EO2_HO2 ', 'EO2_NO ', & + ! 'EO_M ', 'EO_O2 ', & + ! 'GLYALD_OH ', 'GLYOXAL_OH ', & + ! 'PAN_OH ', 'tag_C2H4_OH ', & + ! 'tag_CH3CO3_NO2 ', 'usr_PAN_M ', & + ! 'C3H6_NO3 ', 'C3H6_O3 ', & + ! 'C3H7O2_CH3O2 ', 'C3H7O2_HO2 ', & + ! 'C3H7O2_NO ', 'C3H7OOH_OH ', & + ! 'C3H8_OH ', 'CH3COCHO_NO3 ', & + ! 'CH3COCHO_OH ', 'HYAC_OH ', & + ! 'NOA_OH ', 'PO2_HO2 ', & + ! 'PO2_NO ', 'POOH_OH ', & + ! 'RO2_CH3O2 ', 'RO2_HO2 ', & + ! 'RO2_NO ', 'ROOH_OH ', & + ! 'tag_C3H6_OH ', 'usr_CH3COCH3_OH ', & + ! 'BIGENE_NO3 ', 'BIGENE_OH ', & + ! 'ENEO2_NO ', 'ENEO2_NOb ', & + ! 'HONITR_OH ', 'MACRO2_CH3CO3 ', & + ! 'MACRO2_CH3O2 ', 'MACRO2_HO2 ', & + ! 'MACRO2_NO3 ', 'MACRO2_NOa ', & + ! 'MACRO2_NOb ', 'MACR_O3 ', & + ! 'MACR_OH ', 'MACROOH_OH ', & + ! 'MCO3_CH3CO3 ', 'MCO3_CH3O2 ', & + ! 'MCO3_HO2 ', 'MCO3_MCO3 ', & + ! 'MCO3_NO ', 'MCO3_NO3 ', & + ! 'MEKO2_HO2 ', 'MEKO2_NO ', & + ! 'MEK_OH ', 'MEKOOH_OH ', & + ! 'MPAN_OH_M ', 'MVK_O3 ', & + ! 'MVK_OH ', 'usr_MCO3_NO2 ', & + ! 'usr_MPAN_M ', 'ALKNIT_OH ', & + ! 'ALKO2_HO2 ', 'ALKO2_NO ', & + ! 'ALKO2_NOb ', 'ALKOOH_OH ', & + ! 'BIGALK_OH ', 'HPALD_OH ', & + ! 'HYDRALD_OH ', 'IEPOX_OH ', & + ! 'ISOPAO2_CH3CO3 ', 'ISOPAO2_CH3O2 ', & + ! 'ISOPAO2_HO2 ', 'ISOPAO2_NO ', & + ! 'ISOPAO2_NO3 ', 'ISOPBO2_CH3CO3 ', & + ! 'ISOPBO2_CH3O2 ', 'ISOPBO2_HO2 ', & + ! 'ISOPBO2_M ', 'ISOPBO2_NO ', & + ! 'ISOPBO2_NO3 ', 'ISOPNITA_OH ', & + ! 'ISOPNITB_OH ', 'ISOP_NO3 ', & + ! 'ISOPNO3_CH3CO3 ', 'ISOPNO3_CH3O2 ', & + ! 'ISOPNO3_HO2 ', 'ISOPNO3_NO ', & + ! 'ISOPNO3_NO3 ', 'ISOPNOOH_OH ', & + ! 'ISOP_O3 ', 'ISOP_OH ', & + ! 'ISOPOOH_OH ', 'NC4CH2OH_OH ', & + ! 'NC4CHO_OH ', 'XO2_CH3CO3 ', & + ! 'XO2_CH3O2 ', 'XO2_HO2 ', & + ! 'XO2_NO ', 'XO2_NO3 ', & + ! 'XOOH_OH ', 'ACBZO2_HO2 ', & + ! 'ACBZO2_NO ', 'BENZENE_OH ', & + ! 'BENZO2_HO2 ', 'BENZO2_NO ' /) + ! rxt_tag_lst( 401: 528) = (/ 'BENZOOH_OH ', 'BZALD_OH ', & + ! 'BZOO_HO2 ', 'BZOOH_OH ', & + ! 'BZOO_NO ', 'C6H5O2_HO2 ', & + ! 'C6H5O2_NO ', 'C6H5OOH_OH ', & + ! 'CRESOL_OH ', 'DICARBO2_HO2 ', & + ! 'DICARBO2_NO ', 'DICARBO2_NO2 ', & + ! 'MALO2_HO2 ', 'MALO2_NO ', & + ! 'MALO2_NO2 ', 'MDIALO2_HO2 ', & + ! 'MDIALO2_NO ', 'MDIALO2_NO2 ', & + ! 'PHENO2_HO2 ', 'PHENO2_NO ', & + ! 'PHENOL_OH ', 'PHENO_NO2 ', & + ! 'PHENO_O3 ', 'PHENOOH_OH ', & + ! 'tag_ACBZO2_NO2 ', 'TOLO2_HO2 ', & + ! 'TOLO2_NO ', 'TOLOOH_OH ', & + ! 'TOLUENE_OH ', 'usr_PBZNIT_M ', & + ! 'XYLENES_OH ', 'XYLENO2_HO2 ', & + ! 'XYLENO2_NO ', 'XYLENOOH_OH ', & + ! 'XYLOLO2_HO2 ', 'XYLOLO2_NO ', & + ! 'XYLOL_OH ', 'XYLOLOOH_OH ', & + ! 'BCARY_NO3 ', 'BCARY_O3 ', & + ! 'BCARY_OH ', 'MTERP_NO3 ', & + ! 'MTERP_O3 ', 'MTERP_OH ', & + ! 'NTERPO2_CH3O2 ', 'NTERPO2_HO2 ', & + ! 'NTERPO2_NO ', 'NTERPO2_NO3 ', & + ! 'NTERPOOH_OH ', 'TERP2O2_CH3O2 ', & + ! 'TERP2O2_HO2 ', 'TERP2O2_NO ', & + ! 'TERP2OOH_OH ', 'TERPNIT_OH ', & + ! 'TERPO2_CH3O2 ', 'TERPO2_HO2 ', & + ! 'TERPO2_NO ', 'TERPOOH_OH ', & + ! 'TERPROD1_NO3 ', 'TERPROD1_OH ', & + ! 'TERPROD2_OH ', 'OCS_O ', & + ! 'OCS_OH ', 'S_O2 ', & + ! 'S_O3 ', 'SO_BRO ', & + ! 'SO_CLO ', 'S_OH ', & + ! 'SO_NO2 ', 'SO_O2 ', & + ! 'SO_O3 ', 'SO_OCLO ', & + ! 'SO_OH ', 'usr_SO2_OH ', & + ! 'usr_SO3_H2O ', 'DMS_NO3 ', & + ! 'DMS_OHa ', 'NH3_OH ', & + ! 'usr_DMS_OH ', 'usr_GLYOXAL_aer ', & + ! 'usr_HO2_aer ', 'usr_HONITR_aer ', & + ! 'usr_ISOPNITA_aer ', 'usr_ISOPNITB_aer ', & + ! 'usr_N2O5_aer ', 'usr_NC4CH2OH_aer ', & + ! 'usr_NC4CHO_aer ', 'usr_NH4_strat_tau ', & + ! 'usr_NO2_aer ', 'usr_NO3_aer ', & + ! 'usr_NTERPOOH_aer ', 'usr_ONITR_aer ', & + ! 'usr_TERPNIT_aer ', 'BCARY_NO3_vbs ', & + ! 'BCARY_O3_vbs ', 'BCARY_OH_vbs ', & + ! 'BENZENE_OH_vbs ', 'ISOP_NO3_vbs ', & + ! 'ISOP_O3_vbs ', 'ISOP_OH_vbs ', & + ! 'IVOC_OH ', 'MTERP_NO3_vbs ', & + ! 'MTERP_O3_vbs ', 'MTERP_OH_vbs ', & + ! 'SVOC_OH ', 'TOLUENE_OH_vbs ', & + ! 'XYLENES_OH_vbs ', 'het1 ', & + ! 'het10 ', 'het11 ', & + ! 'het12 ', 'het13 ', & + ! 'het14 ', 'het15 ', & + ! 'het16 ', 'het17 ', & + ! 'het2 ', 'het3 ', & + ! 'het4 ', 'het5 ', & + ! 'het6 ', 'het7 ', & + ! 'het8 ', 'het9 ', & + ! 'E90_tau ', 'NH_50_tau ', & + ! 'NH_5_tau ', 'ST80_25_tau ' /) + ! rxt_tag_map(:rxt_tag_cnt) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, & + ! 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, & + ! 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, & + ! 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, & + ! 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, & + ! 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, & + ! 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, & + ! 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, & + ! 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, & + ! 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, & + ! 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, & + ! 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, & + ! 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, & + ! 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, & + ! 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, & + ! 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, & + ! 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, & + ! 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, & + ! 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, & + ! 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, & + ! 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, & + ! 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, & + ! 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, & + ! 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, & + ! 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, & + ! 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, & + ! 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, & + ! 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, & + ! 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, & + ! 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, & + ! 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, & + ! 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, & + ! 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, & + ! 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, & + ! 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, & + ! 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, & + ! 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, & + ! 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, & + ! 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, & + ! 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, & + ! 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, & + ! 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, & + ! 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, & + ! 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, & + ! 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, & + ! 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, & + ! 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, & + ! 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, & + ! 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, & + ! 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, & + ! 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, & + ! 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, & + ! 521, 522, 523, 524, 525, 526, 527, 528 /) + ! if( allocated( pht_alias_lst ) ) then + ! deallocate( pht_alias_lst ) + ! end if + ! allocate( pht_alias_lst(phtcnt,2),stat=ios ) + ! if( ios /= 0 ) then + ! write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_lst; error = ',ios + ! call endrun + ! end if + ! if( allocated( pht_alias_mult ) ) then + ! deallocate( pht_alias_mult ) + ! end if + ! allocate( pht_alias_mult(phtcnt,2),stat=ios ) + ! if( ios /= 0 ) then + ! write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_mult; error = ',ios + ! call endrun + ! end if + ! pht_alias_lst(:,1) = (/ ' ', ' ', ' ', ' ', & + ! 'userdefined ', 'userdefined ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', 'userdefined ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ' /) + ! pht_alias_lst(:,2) = (/ ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', 'jch3ooh ', 'jch3ooh ', & + ! 'jch3ooh ', 'jno2 ', 'jno2 ', 'jno2 ', & + ! 'jno2 ', 'jno2 ', 'jno2 ', 'jch3ooh ', & + ! 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! 'jh2o2 ', ' ', ' ', ' ', & + ! ' ', 'jch3ooh ', ' ', 'jmgly ', & + ! 'jch2o_a ', 'jno2 ', ' ', 'jch3ooh ', & + ! 'jch3ooh ', ' ', ' ', 'jacet ', & + ! 'jch3ooh ', 'jpan ', ' ', 'jch2o_a ', & + ! 'jch2o_a ', 'jch3ooh ', 'jch3cho ', ' ', & + ! 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', 'jno2 ', & + ! 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', 'jch3cho ', & + ! 'jch3cho ', 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', & + ! 'jch3ooh ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', ' ', ' ', ' ', & + ! ' ', 'jno2 ', 'jno2 ', 'jno2 ', & + ! 'jno2 ', 'jno2 ', 'jno2 ', 'jno2 ', & + ! 'jno2 ', 'jno2 ', 'jno2 ' /) + ! pht_alias_mult(:,1) = (/ 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8 /) + ! pht_alias_mult(:,2) = (/ 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, .10_r8, 0.2_r8, .14_r8, .20_r8, & + ! .20_r8, .006_r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 0.28_r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! .006_r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, .10_r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & + ! 1._r8, 1._r8, 1._r8, .0004_r8, .0004_r8, & + ! .0004_r8, .0004_r8, .0004_r8, .0004_r8, .0004_r8, & + ! .0004_r8, .0004_r8, .0004_r8 /) + ! allocate( cph_enthalpy(enthalpy_cnt),stat=ios ) + ! if( ios /= 0 ) then + ! write(iulog,*) 'set_sim_dat: failed to allocate cph_enthalpy; error = ',ios + ! call endrun + ! end if + ! allocate( cph_rid(enthalpy_cnt),stat=ios ) + ! if( ios /= 0 ) then + ! write(iulog,*) 'set_sim_dat: failed to allocate cph_rid; error = ',ios + ! call endrun + ! end if + ! cph_rid(:) = (/ 126, 129, 130, 131, 134, & + ! 137, 138, 139, 140, 143, & + ! 144, 145, 148, 150, 154, & + ! 155, 163, 164 /) + ! cph_enthalpy(:) = (/ 189.810000_r8, 392.190000_r8, 493.580000_r8, 101.390000_r8, 232.590000_r8, & + ! 203.400000_r8, 226.580000_r8, 120.100000_r8, 194.710000_r8, 293.620000_r8, & + ! 67.670000_r8, 165.300000_r8, 165.510000_r8, 313.750000_r8, 133.750000_r8, & + ! 193.020000_r8, 34.470000_r8, 199.170000_r8 /) + ! allocate( num_rnts(rxntot-phtcnt),stat=ios ) + ! if( ios /= 0 ) then + ! write(iulog,*) 'set_sim_dat: failed to allocate num_rnts; error = ',ios + ! call endrun + ! end if + ! num_rnts(:) = (/ 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, & + ! 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & + ! 2, 3, 2, 2, 3, 3, 3, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 3, 3, 2, 2, 1, 2, 2, 2, 2, & + ! 2, 2, 3, 3, 3, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, & + ! 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, & + ! 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, & + ! 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, & + ! 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, & + ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, & + ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & + ! 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, & + ! 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, & + ! 2, 1, 1, 1, 1 /) end subroutine set_sim_dat From 6d03b3cfaae8d73683ca50009e708e8396b65019 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Mon, 18 May 2020 13:26:15 -0400 Subject: [PATCH 090/239] Fix: Comment out mo_sim_dat except solsym, expand solsym size to nTracersMax This might not be needed after all as HEMCO_CESM now reads tracer names from chem_mods. But fixing this so it doesn't infinite loop. --- src/chemistry/pp_geoschem/mo_sim_dat.F90 | 10 +++++----- src/chemistry/pp_geoschem/mo_tracname.F90 | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/chemistry/pp_geoschem/mo_sim_dat.F90 b/src/chemistry/pp_geoschem/mo_sim_dat.F90 index 854432d9d9..1e9005c437 100644 --- a/src/chemistry/pp_geoschem/mo_sim_dat.F90 +++ b/src/chemistry/pp_geoschem/mo_sim_dat.F90 @@ -28,13 +28,13 @@ subroutine set_sim_dat !-------------------------------------------------------------- integer :: ios - is_scalar = .false. - is_vector = .true. + ! is_scalar = .false. + ! is_vector = .true. - clscnt(:) = (/ 30, 0, 0, 191, 0 /) + ! clscnt(:) = (/ 30, 0, 0, 191, 0 /) - cls_rxt_cnt(:,1) = (/ 37, 61, 0, 30 /) - cls_rxt_cnt(:,4) = (/ 23, 174, 326, 191 /) + ! cls_rxt_cnt(:,1) = (/ 37, 61, 0, 30 /) + ! cls_rxt_cnt(:,4) = (/ 23, 174, 326, 191 /) solsym(:273) = (/ 'CH2I2 ','CH2ICL ','CH2IBR ', & 'NITs ','NIT ','AERI ', & diff --git a/src/chemistry/pp_geoschem/mo_tracname.F90 b/src/chemistry/pp_geoschem/mo_tracname.F90 index c8b4aabfdb..5d470483d1 100644 --- a/src/chemistry/pp_geoschem/mo_tracname.F90 +++ b/src/chemistry/pp_geoschem/mo_tracname.F90 @@ -5,10 +5,13 @@ module mo_tracname ! surface fluxes for the advected species. !----------------------------------------------------------- - use chem_mods, only : grpcnt, gas_pcnst + use chem_mods, only : nTracersMax implicit none - character(len=16) :: solsym(gas_pcnst) ! species names +! modified to an arbitrary high #, was gas_pcnst. this would cause a memory +! overflow overwrite in mo_sim_dat, which allocates :273 larger than +! the default specified gas_pcnst (hplin, 5/16/20) + character(len=16) :: solsym(273) ! species names end module mo_tracname From 3db5060a26b6486edecf22f0c236632092277ae0 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 19 May 2020 11:26:36 -0400 Subject: [PATCH 091/239] Feat: Add Olson / CLM land type mapping for CLM4.5/5.0 --- src/chemistry/pp_geoschem/getLandTypes.F90 | 416 ++++++++++++++++++--- 1 file changed, 374 insertions(+), 42 deletions(-) diff --git a/src/chemistry/pp_geoschem/getLandTypes.F90 b/src/chemistry/pp_geoschem/getLandTypes.F90 index 9852d706f5..2a7ef31932 100644 --- a/src/chemistry/pp_geoschem/getLandTypes.F90 +++ b/src/chemistry/pp_geoschem/getLandTypes.F90 @@ -20,6 +20,7 @@ SUBROUTINE getLandTypes( cam_in, nY, State_Met ) USE PRECISION_MOD, ONLY : fp, f4 ! Flexible precision USE CMN_SIZE_Mod, ONLY : NSURFTYPE USE cam_abortutils, ONLY : endrun + IMPLICIT NONE ! ! !INPUT PARAMETERS: @@ -55,17 +56,17 @@ SUBROUTINE getLandTypes( cam_in, nY, State_Met ) ! Coniferous Forest (ID = 4) | ! Deciduous Conifer Forest (ID = 5) | Needleleaf Deciduous Bor. (PAID = 3) ! Deciduous Broadleaf For. (ID = 6) | - ! Evergreen Broadleaf For. (ID = 7) | + ! Evergreen Broadleaf For. (ID = 7) | Broadleaf Evergreen Temp. (PAID = 5) ! Tall Grasses and Shrubs (ID = 8) | ! Bare Desert (ID = 9) | Not veg. \ Ice (PAID = 0\LUID = 2) ! Upland Tundra (ID = 10) | Broadleaf Deciduous Bore. (PAID = 11) - ! Irrigated Grassland (ID = 11) | C3 Irrigated (PAID = 16) + ! Irrigated Grassland (ID = 11) | ! Semi Desert (ID = 12) | ! Glacier ice (ID = 13) | Land ice (LUID = 2) ! Wooded Wet Swamp (ID = 14) | ! - (ID = 15) | ! - (ID = 16) | - ! Shrub Evergreen (ID = 17) | + ! Shrub Evergreen (ID = 17) | Broadleaf Evergreen Shru. (PAID = 9) ! - (ID = 18) | ! Shrub Deciduous (ID = 19) | ! Evergreen Forest and Fi. (ID = 20) | @@ -81,6 +82,7 @@ SUBROUTINE getLandTypes( cam_in, nY, State_Met ) ! Seasonal Tropical Fores. (ID = 30) | ! Cool Crops and Towns (ID = 31) | Winter Temp. Cereal (PAID = 19) ! Crops and Town (ID = 32) | C3 Crop (PAID = 15) + ! | C3 Irrigated (PAID = 16) ! | Spring Temp. Cereal (PAID = 18) ! Dry Tropical Woods (ID = 33) | ! Tropical Rainforest (ID = 34) | Broadleaf Evergreen Trop. (PAID = 4) @@ -98,15 +100,15 @@ SUBROUTINE getLandTypes( cam_in, nY, State_Met ) ! | C4 Grass (PAID = 14) ! Mire, Bog, Fen (ID = 45) | Wetland - Not Applied (LUID = 5) ! Marsh Wetland (ID = 46) | - ! Mediterranean Scrub (ID = 47) | Broadleaf Evergreen Shru. (PAID = 9) - ! Dry Woody Scrub (ID = 48) | + ! Mediterranean Scrub (ID = 47) | + ! Dry Woody Scrub (ID = 48) | Broadleaf Deciduous Temp. (PAID = 10) ! - (ID = 49) | ! - (ID = 50) | ! - (ID = 51) | - ! Semi Desert Shrubs (ID = 52) | Broadleaf Deciduous Temp. (PAID = 10) + ! Semi Desert Shrubs (ID = 52) | ! Semi Desert Sage (ID = 53) | ! Barren Tundra (ID = 54) | - ! Cool Southern Hemisphere (ID = 55) | Broadleaf Evergreen Temp. (PAID = 5) + ! Cool Southern Hemisphere (ID = 55) | ! Cool Fields and Woods (ID = 56) | ! Forest and Field (ID = 57) | ! Cool Forest and Field (ID = 58) | @@ -141,57 +143,387 @@ SUBROUTINE getLandTypes( cam_in, nY, State_Met ) ! Initialize fraction land for this grid cell State_Met%LandTypeFrac(1,J, 1) = waterFrac !State_Met%LandTypeFrac(1,J, 2) = cam_in%lwtgcell(J, 6) + State_Met%LandTypeFrac(1,J, 5) = cam_in%pwtgcell(J, 4) + State_Met%LandTypeFrac(1,J, 7) = cam_in%pwtgcell(J, 6) State_Met%LandTypeFrac(1,J, 9) = cam_in%pwtgcell(J, 1) & - cam_in%lwtgcell(J, 2) State_Met%LandTypeFrac(1,J,10) = cam_in%pwtgcell(J,12) State_Met%LandTypeFrac(1,J,13) = cam_in%lwtgcell(J, 2) + State_Met%LandTypeFrac(1,J,17) = cam_in%pwtgcell(J,10) + State_Met%LandTypeFrac(1,J,22) = cam_in%pwtgcell(J, 3) State_Met%LandTypeFrac(1,J,24) = cam_in%pwtgcell(J, 9) State_Met%LandTypeFrac(1,J,26) = cam_in%pwtgcell(J, 8) - !State_Met%LandTypeFrac(1,J,45) = cam_in%lwtgcell(J, 5) - State_Met%LandTypeFrac(1,J,52) = cam_in%pwtgcell(J,11) - State_Met%LandTypeFrac(1,J,47) = cam_in%pwtgcell(J,10) - State_Met%LandTypeFrac(1,J,55) = cam_in%pwtgcell(J, 6) - State_Met%LandTypeFrac(1,J,34) = cam_in%pwtgcell(J, 5) - State_Met%LandTypeFrac(1,J,43) = cam_in%pwtgcell(J,13) - State_Met%LandTypeFrac(1,J,42) = cam_in%pwtgcell(J,14) - State_Met%LandTypeFrac(1,J,32) = cam_in%pwtgcell(J,16) - State_Met%LandTypeFrac(1,J,44) = cam_in%pwtgcell(J,15) - State_Met%LandTypeFrac(1,J, 5) = cam_in%pwtgcell(J, 4) - State_Met%LandTypeFrac(1,J,22) = cam_in%pwtgcell(J, 3) State_Met%LandTypeFrac(1,J,28) = cam_in%pwtgcell(J, 2) - State_Met%LandTypeFrac(1,J,44) = & - State_Met%LandTypeFrac(1,J,44) + cam_in%pwtgcell(J, 7) - State_Met%LandTypeFrac(1,J,11) = cam_in%pwtgcell(J,17) - State_Met%LandTypeFrac(1,J,36) = cam_in%pwtgcell(J,18) State_Met%LandTypeFrac(1,J,31) = cam_in%pwtgcell(J,20) - State_Met%LandTypeFrac(1,J,32) = & - State_Met%LandTypeFrac(1,J,32) + cam_in%pwtgcell(J,19) - State_Met%LandTypeFrac(1,J,36) = & - State_Met%LandTypeFrac(1,J,36) + cam_in%pwtgcell(J,21) + State_Met%LandTypeFrac(1,J,32) = cam_in%pwtgcell(J,16) & + + cam_in%pwtgcell(J,17) & + + cam_in%pwtgcell(J,19) + State_Met%LandTypeFrac(1,J,34) = cam_in%pwtgcell(J, 5) + State_Met%LandTypeFrac(1,J,36) = cam_in%pwtgcell(J,18) & + + cam_in%pwtgcell(J,21) + State_Met%LandTypeFrac(1,J,42) = cam_in%pwtgcell(J,14) + State_Met%LandTypeFrac(1,J,43) = cam_in%pwtgcell(J,13) + State_Met%LandTypeFrac(1,J,44) = cam_in%pwtgcell(J, 7) & + + cam_in%pwtgcell(J,15) + !State_Met%LandTypeFrac(1,J,45) = cam_in%lwtgcell(J, 5) + State_Met%LandTypeFrac(1,J,48) = cam_in%pwtgcell(J,11) + State_Met%XLAI_NATIVE(1,J, 5) = cam_in%lai(J, 4) + State_Met%XLAI_NATIVE(1,J, 7) = cam_in%lai(J, 6) State_Met%XLAI_NATIVE(1,J,10) = cam_in%lai(J,12) + State_Met%XLAI_NATIVE(1,J,17) = cam_in%lai(J,10) + State_Met%XLAI_NATIVE(1,J,22) = cam_in%lai(J, 3) State_Met%XLAI_NATIVE(1,J,24) = cam_in%lai(J, 9) State_Met%XLAI_NATIVE(1,J,26) = cam_in%lai(J, 8) - State_Met%XLAI_NATIVE(1,J,52) = cam_in%lai(J,11) - State_Met%XLAI_NATIVE(1,J,47) = cam_in%lai(J,10) - State_Met%XLAI_NATIVE(1,J,55) = cam_in%lai(J, 6) + State_Met%XLAI_NATIVE(1,J,28) = cam_in%lai(J, 2) + State_Met%XLAI_NATIVE(1,J,31) = cam_in%lai(J,20) + State_Met%XLAI_NATIVE(1,J,32) = cam_in%lai(J,16) & + + cam_in%lai(J,17) & + + cam_in%lai(J,19) State_Met%XLAI_NATIVE(1,J,34) = cam_in%lai(J, 5) - State_Met%XLAI_NATIVE(1,J,43) = cam_in%lai(J,13) + State_Met%XLAI_NATIVE(1,J,36) = cam_in%lai(J,18) & + + cam_in%lai(J,21) State_Met%XLAI_NATIVE(1,J,42) = cam_in%lai(J,14) - State_Met%XLAI_NATIVE(1,J,32) = cam_in%lai(J,16) - State_Met%XLAI_NATIVE(1,J,44) = cam_in%lai(J,15) + State_Met%XLAI_NATIVE(1,J,43) = cam_in%lai(J,13) + State_Met%XLAI_NATIVE(1,J,44) = cam_in%lai(J, 7) & + + cam_in%lai(J,15) + State_Met%XLAI_NATIVE(1,J,48) = cam_in%lai(J,11) + + DO T = 2, NSURFTYPE + State_Met%LandTypeFrac(1,J,T) = & + State_Met%LandTypeFrac(1,J,T) * landFrac + + State_Met%XLAI_NATIVE(1,J,T) = & + State_Met%XLAI_NATIVE(1,J,T) * landFrac + + ! Make sure that the land type fractions do not exceed 1 + IF ( State_Met%LandTypeFrac(1,J,T) > 1.0e+0_fp ) THEN + State_Met%LandTypeFrac(1,J,T) = 1.0e+0_fp + ELSEIF ( State_Met%LandTypeFrac(1,J,T) < 0.0e+0_fp ) THEN + State_Met%LandTypeFrac(1,J,T) = 0.0e+0_fp + ENDIF + ENDDO + + ENDDO + +#elif defined( CLM45 ) || defined( CLM50 ) + + ! Mapping for CLM4.5/CLM5.0 + ! -----------------------------------|-------------------------------------- + ! Olson land type | CLM land type + ! -----------------------------------|-------------------------------------- + ! Inland/sea water (ID = 1) | Ocean fraction + ! | Deeplake (LUID = 5) + ! Urban (ID = 2) | Urban - Not Applied (LUID =7-9) + ! Low Sparse Grassland (ID = 3) | + ! Coniferous Forest (ID = 4) | + ! Deciduous Conifer Forest (ID = 5) | Needleleaf Deciduous Bor. (PAID = 3) + ! Deciduous Broadleaf For. (ID = 6) | + ! Evergreen Broadleaf For. (ID = 7) | Broadleaf Evergreen Temp. (PAID = 5) + ! Tall Grasses and Shrubs (ID = 8) | + ! Bare Desert (ID = 9) | Not veg. \ Ice (PAID = 0\LUID = 4) + ! Upland Tundra (ID = 10) | Broadleaf Deciduous Bore. (PAID = 11) + ! Irrigated Grassland (ID = 11) | + ! Semi Desert (ID = 12) | + ! Glacier ice (ID = 13) | Land ice (LUID = 4) + ! Wooded Wet Swamp (ID = 14) | + ! - (ID = 15) | + ! - (ID = 16) | + ! Shrub Evergreen (ID = 17) | Broadleaf Evergreen Shru. (PAID = 9) + ! - (ID = 18) | + ! Shrub Deciduous (ID = 19) | + ! Evergreen Forest and Fi. (ID = 20) | + ! Cool Rain Forest (ID = 21) | + ! Conifer Boreal Forest (ID = 22) | Needleleaf Evergreen Bor. (PAID = 2) + ! Cool Conifer Forest (ID = 23) | + ! Cool Mixed Forest (ID = 24) | Broadleaf Deciduous Bore. (PAID = 8) + ! Mixed Forest (ID = 25) | + ! Cool Broadleaf Forest (ID = 26) | Broadleaf Deciduous Temp. (PAID = 7) + ! Deciduous Broadleaf For. (ID = 27) | + ! Conifer Forest (ID = 28) | Needleleaf Evergreen Tem. (PAID = 1) + ! Montane Tropical Forests (ID = 29) | + ! Seasonal Tropical Fores. (ID = 30) | + ! Cool Crops and Towns (ID = 31) | + ! Crops and Town (ID = 32) | C3 Crop (PAID = 15) + ! | C3 Irrigated (PAID = 16) + ! Dry Tropical Woods (ID = 33) | + ! Tropical Rainforest (ID = 34) | Broadleaf Evergreen Trop. (PAID = 4) + ! Tropical Degraded Forest (ID = 35) | + ! Corn and Beans Cropland (ID = 36) | Corn (PAID = 17) + ! | Irrigated Temperate Corn (PAID = 18) + ! | Spring Wheat (PAID = 19) + ! | Irrigated Spring Wheat (PAID = 20) + ! | Winter Wheat (PAID = 21) + ! | Irrigated Winter Wheat (PAID = 22) + ! | Temperated Soybean (PAID = 23) + ! | Irrigated Temperate Soyb. (PAID = 24) + ! | Barley (PAID = 25) + ! | Irrigated Barley (PAID = 26) + ! | Winter Barley (PAID = 27) + ! | Irrigated Winter Barley (PAID = 28) + ! | Rye (PAID = 29) + ! | Irrigated Rye (PAID = 30) + ! | Winter Rye (PAID = 31) + ! | Irrigated Winter Rye (PAID = 32) + ! | Cassava (PAID = 33) + ! | Irrigated Cassava (PAID = 34) + ! | Citrus (PAID = 35) + ! | Irrigated Citrus (PAID = 36) + ! | Cocoa (PAID = 37) + ! | Irrigated Cocoa (PAID = 38) + ! | Coffee (PAID = 39) + ! | Irrigated Coffee (PAID = 40) + ! | Cotton (PAID = 41) + ! | Irrigated Cotton (PAID = 42) + ! | Datepalm (PAID = 43) + ! | Irrigated Datepalm (PAID = 44) + ! | Foddergrass (PAID = 45) + ! | Irrigated Foddergrass (PAID = 46) + ! | Grapes (PAID = 47) + ! | Irrigated Grapes (PAID = 48) + ! | Groundnuts (PAID = 49) + ! | Irrigated Groundnuts (PAID = 50) + ! | Millet (PAID = 51) + ! | Irrigated Millet (PAID = 52) + ! | Oilpalm (PAID = 53) + ! | Irrigated Oilpalm (PAID = 54) + ! | Potatoes (PAID = 55) + ! | Irrigated Potatoes (PAID = 56) + ! | Pulses (PAID = 57) + ! | Irrigated Pulses (PAID = 58) + ! | Rapeseed (PAID = 59) + ! | Irrigated Rapeseed (PAID = 60) + ! | Rice (PAID = 61) + ! | Irrigated Rice (PAID = 62) + ! | Sorghum (PAID = 63) + ! | Irrigated Sorghum (PAID = 64) + ! | Sugarbeet (PAID = 65) + ! | Irrigated Sugarbeet (PAID = 66) + ! | Sugarcane (PAID = 67) + ! | Irrigated Sugarcane (PAID = 68) + ! | Sunflower (PAID = 69) + ! | Irrigated Sunflower (PAID = 70) + ! | Miscanthus (PAID = 71) + ! | Irrigated Miscanthus (PAID = 72) + ! | Switchgrass (PAID = 73) + ! | Irrigated Switchgrass (PAID = 74) + ! | Tropical Corn (PAID = 75) + ! | Irrigated Tropical Corn (PAID = 76) + ! | Tropical Soybean (PAID = 77) + ! | Irrigated Tropical Soybe. (PAID = 78) + ! Rice Paddy and Field (ID = 37) | + ! Hot Irrigated Cropland (ID = 38) | + ! Cool Irrigated Cropland (ID = 39) | + ! - (ID = 40) | + ! Cool Grasses and Shrubs (ID = 41) | + ! Hot and Mild Grasses and (ID = 42) | C3 Non-Arctic Grass (PAID = 13) + ! Cold Grassland (ID = 43) | C3 Arctic Grass (PAID = 12) + ! Savanna (Woods) (ID = 44) | Broadleaf Deciduous Trop. (PAID = 6) + ! | C4 Grass (PAID = 14) + ! Mire, Bog, Fen (ID = 45) | Wetland - Not Applied (LUID = 6) + ! Marsh Wetland (ID = 46) | + ! Mediterranean Scrub (ID = 47) | + ! Dry Woody Scrub (ID = 48) | Broadleaf Deciduous Temp. (PAID = 10) + ! - (ID = 49) | + ! - (ID = 50) | + ! - (ID = 51) | + ! Semi Desert Shrubs (ID = 52) | + ! Semi Desert Sage (ID = 53) | + ! Barren Tundra (ID = 54) | + ! Cool Southern Hemisphere (ID = 55) | + ! Cool Fields and Woods (ID = 56) | + ! Forest and Field (ID = 57) | + ! Cool Forest and Field (ID = 58) | + ! Fields and Woody Savanna (ID = 59) | + ! Succulent and Thorn Scr. (ID = 60) | + ! Small Leaf Mixed Woods (ID = 61) | + ! Deciduous and Mixed Bor. (ID = 62) | + ! Narrow Conifers (ID = 63) | + ! Wooded Tundra (ID = 64) | + ! Heath Scrub (ID = 65) | + ! - (ID = 66) | + ! - (ID = 67) | + ! - (ID = 68) | + ! - (ID = 69) | + ! Polar and Alpine Desert (ID = 70) | + ! - (ID = 71) | + ! - (ID = 72) | + ! Mangrove (ID = 73) | + + State_Met%LandTypeFrac(:,:,:) = 0.0e+0_fp + State_Met%XLAI_NATIVE(:,:,:) = 0.0e+0_fp + + DO J = 1, nY + waterFrac = cam_in%ocnFrac(J) + cam_in%iceFrac(J) & + + cam_in%lwtgcell(J,5) + landFrac = 1.0e+0_fp - waterFrac + + ! Initialize fraction land for this grid cell + State_Met%LandTypeFrac(1,J, 1) = waterFrac + !State_Met%LandTypeFrac(1,J, 2) = cam_in%lwtgcell(J, 7) & + ! + cam_in%lwtgcell(J, 8) & + ! + cam_in%lwtgcell(J, 9) + State_Met%LandTypeFrac(1,J, 5) = cam_in%pwtgcell(J, 4) + State_Met%LandTypeFrac(1,J, 7) = cam_in%pwtgcell(J, 6) + State_Met%LandTypeFrac(1,J, 9) = cam_in%pwtgcell(J, 1) & + * ( 1.0e+0_fp - cam_in%lwtgcell(J, 4) ) + State_Met%LandTypeFrac(1,J,10) = cam_in%pwtgcell(J,12) + State_Met%LandTypeFrac(1,J,13) = cam_in%lwtgcell(J, 4) + State_Met%LandTypeFrac(1,J,17) = cam_in%pwtgcell(J,10) + State_Met%LandTypeFrac(1,J,22) = cam_in%pwtgcell(J, 3) + State_Met%LandTypeFrac(1,J,24) = cam_in%pwtgcell(J, 9) + State_Met%LandTypeFrac(1,J,26) = cam_in%pwtgcell(J, 8) + State_Met%LandTypeFrac(1,J,28) = cam_in%pwtgcell(J, 2) + State_Met%LandTypeFrac(1,J,32) = cam_in%pwtgcell(J,16) & + + cam_in%pwtgcell(J,17) + State_Met%LandTypeFrac(1,J,34) = cam_in%pwtgcell(J, 5) + State_Met%LandTypeFrac(1,J,36) = cam_in%pwtgcell(J,18) & + + cam_in%pwtgcell(J,19) & + + cam_in%pwtgcell(J,20) & + + cam_in%pwtgcell(J,21) & + + cam_in%pwtgcell(J,22) & + + cam_in%pwtgcell(J,23) & + + cam_in%pwtgcell(J,24) & + + cam_in%pwtgcell(J,25) & + + cam_in%pwtgcell(J,26) & + + cam_in%pwtgcell(J,27) & + + cam_in%pwtgcell(J,28) & + + cam_in%pwtgcell(J,29) & + + cam_in%pwtgcell(J,30) & + + cam_in%pwtgcell(J,31) & + + cam_in%pwtgcell(J,32) & + + cam_in%pwtgcell(J,33) & + + cam_in%pwtgcell(J,34) & + + cam_in%pwtgcell(J,35) & + + cam_in%pwtgcell(J,36) & + + cam_in%pwtgcell(J,37) & + + cam_in%pwtgcell(J,38) & + + cam_in%pwtgcell(J,39) & + + cam_in%pwtgcell(J,40) & + + cam_in%pwtgcell(J,41) & + + cam_in%pwtgcell(J,42) & + + cam_in%pwtgcell(J,43) & + + cam_in%pwtgcell(J,44) & + + cam_in%pwtgcell(J,45) & + + cam_in%pwtgcell(J,46) & + + cam_in%pwtgcell(J,47) & + + cam_in%pwtgcell(J,48) & + + cam_in%pwtgcell(J,49) & + + cam_in%pwtgcell(J,50) & + + cam_in%pwtgcell(J,51) & + + cam_in%pwtgcell(J,52) & + + cam_in%pwtgcell(J,53) & + + cam_in%pwtgcell(J,54) & + + cam_in%pwtgcell(J,55) & + + cam_in%pwtgcell(J,56) & + + cam_in%pwtgcell(J,57) & + + cam_in%pwtgcell(J,58) & + + cam_in%pwtgcell(J,59) & + + cam_in%pwtgcell(J,60) & + + cam_in%pwtgcell(J,61) & + + cam_in%pwtgcell(J,62) & + + cam_in%pwtgcell(J,63) & + + cam_in%pwtgcell(J,64) & + + cam_in%pwtgcell(J,65) & + + cam_in%pwtgcell(J,66) & + + cam_in%pwtgcell(J,67) & + + cam_in%pwtgcell(J,68) & + + cam_in%pwtgcell(J,69) & + + cam_in%pwtgcell(J,70) & + + cam_in%pwtgcell(J,71) & + + cam_in%pwtgcell(J,72) & + + cam_in%pwtgcell(J,73) & + + cam_in%pwtgcell(J,74) & + + cam_in%pwtgcell(J,75) & + + cam_in%pwtgcell(J,76) & + + cam_in%pwtgcell(J,77) & + + cam_in%pwtgcell(J,78) & + + cam_in%pwtgcell(J,79) + State_Met%LandTypeFrac(1,J,42) = cam_in%pwtgcell(J,14) + State_Met%LandTypeFrac(1,J,43) = cam_in%pwtgcell(J,13) + State_Met%LandTypeFrac(1,J,44) = cam_in%pwtgcell(J, 7) & + + cam_in%pwtgcell(J,15) + !State_Met%LandTypeFrac(1,J,45) = cam_in%lwtgcell(J, 6) + State_Met%LandTypeFrac(1,J,48) = cam_in%pwtgcell(J,11) + State_Met%XLAI_NATIVE(1,J, 5) = cam_in%lai(J, 4) + State_Met%XLAI_NATIVE(1,J, 7) = cam_in%lai(J, 6) + State_Met%XLAI_NATIVE(1,J,10) = cam_in%lai(J,12) + State_Met%XLAI_NATIVE(1,J,17) = cam_in%lai(J,10) State_Met%XLAI_NATIVE(1,J,22) = cam_in%lai(J, 3) + State_Met%XLAI_NATIVE(1,J,24) = cam_in%lai(J, 9) + State_Met%XLAI_NATIVE(1,J,26) = cam_in%lai(J, 8) State_Met%XLAI_NATIVE(1,J,28) = cam_in%lai(J, 2) - State_Met%XLAI_NATIVE(1,J,44) = & - State_Met%XLAI_NATIVE(1,J,44) + cam_in%lai(J, 7) - State_Met%XLAI_NATIVE(1,J,11) = cam_in%lai(J,17) - State_Met%XLAI_NATIVE(1,J,36) = cam_in%lai(J,18) - State_Met%XLAI_NATIVE(1,J,31) = cam_in%lai(J,20) - State_Met%XLAI_NATIVE(1,J,32) = & - State_Met%XLAI_NATIVE(1,J,32) + cam_in%lai(J,19) - State_Met%XLAI_NATIVE(1,J,36) = & - State_Met%XLAI_NATIVE(1,J,36) + cam_in%lai(J,21) + State_Met%XLAI_NATIVE(1,J,32) = cam_in%lai(J,16) & + + cam_in%lai(J,17) + State_Met%XLAI_NATIVE(1,J,34) = cam_in%lai(J, 5) + State_Met%XLAI_NATIVE(1,J,36) = cam_in%lai(J,18) & + + cam_in%lai(J,19) & + + cam_in%lai(J,20) & + + cam_in%lai(J,21) & + + cam_in%lai(J,22) & + + cam_in%lai(J,23) & + + cam_in%lai(J,24) & + + cam_in%lai(J,25) & + + cam_in%lai(J,26) & + + cam_in%lai(J,27) & + + cam_in%lai(J,28) & + + cam_in%lai(J,29) & + + cam_in%lai(J,30) & + + cam_in%lai(J,31) & + + cam_in%lai(J,32) & + + cam_in%lai(J,33) & + + cam_in%lai(J,34) & + + cam_in%lai(J,35) & + + cam_in%lai(J,36) & + + cam_in%lai(J,37) & + + cam_in%lai(J,38) & + + cam_in%lai(J,39) & + + cam_in%lai(J,40) & + + cam_in%lai(J,41) & + + cam_in%lai(J,42) & + + cam_in%lai(J,43) & + + cam_in%lai(J,44) & + + cam_in%lai(J,45) & + + cam_in%lai(J,46) & + + cam_in%lai(J,47) & + + cam_in%lai(J,48) & + + cam_in%lai(J,49) & + + cam_in%lai(J,50) & + + cam_in%lai(J,51) & + + cam_in%lai(J,52) & + + cam_in%lai(J,53) & + + cam_in%lai(J,54) & + + cam_in%lai(J,55) & + + cam_in%lai(J,56) & + + cam_in%lai(J,57) & + + cam_in%lai(J,58) & + + cam_in%lai(J,59) & + + cam_in%lai(J,60) & + + cam_in%lai(J,61) & + + cam_in%lai(J,62) & + + cam_in%lai(J,63) & + + cam_in%lai(J,64) & + + cam_in%lai(J,65) & + + cam_in%lai(J,66) & + + cam_in%lai(J,67) & + + cam_in%lai(J,68) & + + cam_in%lai(J,69) & + + cam_in%lai(J,70) & + + cam_in%lai(J,71) & + + cam_in%lai(J,72) & + + cam_in%lai(J,73) & + + cam_in%lai(J,74) & + + cam_in%lai(J,75) & + + cam_in%lai(J,76) & + + cam_in%lai(J,77) & + + cam_in%lai(J,78) & + + cam_in%lai(J,79) + State_Met%XLAI_NATIVE(1,J,42) = cam_in%lai(J,14) + State_Met%XLAI_NATIVE(1,J,43) = cam_in%lai(J,13) + State_Met%XLAI_NATIVE(1,J,44) = cam_in%lai(J, 7) & + + cam_in%lai(J,15) + State_Met%XLAI_NATIVE(1,J,48) = cam_in%lai(J,11) DO T = 2, NSURFTYPE State_Met%LandTypeFrac(1,J,T) = & @@ -209,7 +541,7 @@ SUBROUTINE getLandTypes( cam_in, nY, State_Met ) ENDDO ENDDO -#elif defined( CLM45 ) || defined( CLM50 ) + #else CALL endrun('Cannot figure out which version of CLM') #endif From 2a4d61d94e8f59d0aa18311f7c160e7905357b20 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 19 May 2020 18:02:41 -0400 Subject: [PATCH 092/239] Feat: Kludge gaseous species names to match CESM restart file (1) Bromine, chlorine, iodine and lumped species are not in CESM restart file. We can choose to load these from a GEOS-Chem restart file but this is future work. --- src/chemistry/pp_geoschem/chemistry.F90 | 77 +++++++++++++++++++------ 1 file changed, 58 insertions(+), 19 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index f99181f1cd..18806d3e17 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -184,6 +184,7 @@ subroutine chem_register CHARACTER(LEN=128) :: mixtype CHARACTER(LEN=128) :: molectype CHARACTER(LEN=128) :: lng_Name + CHARACTER(LEN=64) :: cnstName LOGICAL :: camout LOGICAL :: ic_from_cam2 LOGICAL :: has_fixed_ubc @@ -273,14 +274,14 @@ subroutine chem_register tracerLongNames = '' DO I = 1, nTracersMax - IF (I.LE.nTracers) THEN - N = Ind_(tracerNames(I)) - ThisSpc => SC%SpcData(N)%Info - lng_Name = TRIM(ThisSpc%FullName) - MWTmp = REAL(ThisSpc%MW_g,r8) - ref_VMR = REAL(ThisSpc%BackgroundVV,r8) - adv_Mass(I) = MWTmp - ref_MMR(I) = ref_VMR / (MWDry / MWTmp) + IF (I.LE.nTracers) THEN + N = Ind_(tracerNames(I)) + ThisSpc => SC%SpcData(N)%Info + lng_Name = TRIM(ThisSpc%FullName) + MWTmp = REAL(ThisSpc%MW_g,r8) + ref_VMR = REAL(ThisSpc%BackgroundVV,r8) + adv_Mass(I) = MWTmp + ref_MMR(I) = ref_VMR / (MWDry / MWTmp) ELSE lng_Name = TRIM(tracerNames(I)) MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) @@ -306,13 +307,53 @@ subroutine chem_register has_fixed_ubc = .false. ! Use a fixed flux condition at the upper boundary has_fixed_ubflx = .false. - !write(tracernames(i),'(a,I0.4)') 'GCTRC_', i ! NOTE: In MOZART, this only gets called for tracers ! This is the call to add a "constituent" - CALL cnst_add( TRIM(tracerNames(I)), adv_Mass(I), cptmp, qmin, N, & - readiv=ic_from_cam2, mixtype=mixtype, cam_outfld=camout, & - molectype=molectype, fixed_ubc=has_fixed_ubc, & - fixed_ubflx=has_fixed_ubflx, longname=TRIM(lng_Name) ) + cnstName = TRIM(tracerNames(I)) + ! Special handlings + IF ( cnstName == 'ACET' ) THEN + cnstName = 'CH3COCH3' + ELSEIF ( cnstName == 'ALD2' ) THEN + cnstName = 'CH3CHO' + ELSEIF ( cnstName == 'PRPE' ) THEN + cnstName = 'C3H6' + ELSEIF ( cnstName == 'HNO4' ) THEN + cnstName = 'HO2NO2' + ELSEIF ( cnstName == 'HNO2' ) THEN + cnstName = 'HONO' + ELSEIF ( cnstName == 'MP' ) THEN + cnstName = 'CH3OOH' + ELSEIF ( cnstName == 'HAC' ) THEN + cnstName = 'HYAC' + ELSEIF ( cnstName == 'GLYC' ) THEN + cnstName = 'GLYALD' + ELSEIF ( cnstName == 'MAP' ) THEN + cnstName = 'CH3COOOH' + ELSEIF ( cnstName == 'EOH' ) THEN + cnstName = 'C2H5OH' + ELSEIF ( cnstName == 'MGLY' ) THEN + cnstName = 'CH3COCHO' + ELSEIF ( cnstName == 'GLYX' ) THEN + cnstName = 'GLYOXAL' + ELSEIF ( cnstName == 'ACTA' ) THEN + cnstName = 'CH3COOH' + ELSEIF ( cnstName == 'TOLU' ) THEN + cnstName = 'TOLUENE' + ELSEIF ( cnstName == 'HCHO' ) THEN + cnstName = 'CH2O' + ENDIF + ! GEOS-Chem lumped species are not on restart file. + ! Bromine, chlorine, iodine and halons species are missing + ! from CESM restart file. + ! These species will just be uniformily set to some low + ! concentration. + ! TMMF - 05/19/2020 + CALL cnst_add( cnstName, adv_Mass(I), cptmp, qmin, N, & + readiv=ic_from_cam2, mixtype=mixtype, & + cam_outfld=camout, molectype=molectype, & + fixed_ubc=has_fixed_ubc, & + fixed_ubflx=has_fixed_ubflx, & + longname=TRIM(lng_Name) ) ! Add to GC mapping. When starting a timestep, we will want to update the ! concentration of State_Chm(x)%Species(1,iCol,iLev,m) with data from @@ -638,14 +679,12 @@ function chem_implements_cnst(name) chem_implements_cnst = .false. DO I = 1, nTracers - IF (TRIM(tracerNames(I)) .eq. TRIM(NAME)) THEN + IF (TRIM(tracerNames(I)) .eq. TRIM(name)) THEN chem_implements_cnst = .true. EXIT ENDIF ENDDO - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_IMPLEMENTS_CNST' - end function chem_implements_cnst !=============================================================================== @@ -3997,7 +4036,7 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT_CNST' - NLEV = SIZE(Q, 2) + NLEV = SIZE(q, 2) ! Retrieve a "background value" for this from the database Min_MMR = 1.0e-38_r8 DO I = 1, nTracers @@ -4008,9 +4047,9 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) ENDDO DO ILEV = 1, NLEV - WHERE(MASK) + WHERE(mask) ! Set to the minimum mixing ratio - Q(:,ILEV) = Min_MMR + q(:,ILEV) = Min_MMR END WHERE ENDDO From e9a7c334bb4c9a5898201ce7eddd6f2428fc77e4 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 28 May 2020 15:40:13 -0400 Subject: [PATCH 093/239] Feat: Add FAST_JX_DIR in Input_Opt. Remove hard-wired paths in fast_jx --- src/chemistry/pp_geoschem/chemistry.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index f99181f1cd..caea37321e 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -931,6 +931,10 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%TPCore_JOrd = 3 Input_Opt%TPCore_KOrd = 3 + ! Now READ_PHOTOLYSIS_MENU + Input_Opt%FAST_JX_DIR ='/glade/p/univ/umit0034/ExtData/' // & + 'CHEM_INPUTS/FAST_JX/v2019-06/' + ! Now READ_CONVECTION_MENU ! For now, TMMF Input_Opt%LConv = .False. From 009c70b1229d1e1331c713c6dff79ac000f2d7c3 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 5 Jun 2020 15:43:35 -0400 Subject: [PATCH 094/239] Feat: Rename CAM's drydep_mod to aer_drydep_mod --- .../{drydep_mod.F90 => aer_drydep_mod.F90} | 4 ++-- src/chemistry/bulk_aero/aero_model.F90 | 22 +++++++++---------- src/chemistry/modal_aero/aero_model.F90 | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) rename src/chemistry/aerosol/{drydep_mod.F90 => aer_drydep_mod.F90} (99%) diff --git a/src/chemistry/aerosol/drydep_mod.F90 b/src/chemistry/aerosol/aer_drydep_mod.F90 similarity index 99% rename from src/chemistry/aerosol/drydep_mod.F90 rename to src/chemistry/aerosol/aer_drydep_mod.F90 index 1e83641d71..512a8bdc5b 100644 --- a/src/chemistry/aerosol/drydep_mod.F90 +++ b/src/chemistry/aerosol/aer_drydep_mod.F90 @@ -1,4 +1,4 @@ -module drydep_mod +module aer_drydep_mod use shr_kind_mod, only: r8 => shr_kind_r8 use ppgrid @@ -265,4 +265,4 @@ end subroutine calcram !############################################################################## -end module drydep_mod +end module aer_drydep_mod diff --git a/src/chemistry/bulk_aero/aero_model.F90 b/src/chemistry/bulk_aero/aero_model.F90 index 4c3d0ab80e..c5c25abc74 100644 --- a/src/chemistry/bulk_aero/aero_model.F90 +++ b/src/chemistry/bulk_aero/aero_model.F90 @@ -124,16 +124,16 @@ end subroutine aero_model_register !============================================================================= subroutine aero_model_init( pbuf2d ) - use mo_chem_utls, only: get_inv_ndx, get_spc_ndx - use cam_history, only: addfld, add_default, horiz_only - use phys_control, only: phys_getopts - use mo_aerosols, only: aerosols_inti - use mo_setsoa, only: soa_inti - use dust_model, only: dust_init - use seasalt_model, only: seasalt_init - use drydep_mod, only: inidrydep - use wetdep, only: wetdep_init - use mo_setsox, only: has_sox + use mo_chem_utls, only: get_inv_ndx, get_spc_ndx + use cam_history, only: addfld, add_default, horiz_only + use phys_control, only: phys_getopts + use mo_aerosols, only: aerosols_inti + use mo_setsoa, only: soa_inti + use dust_model, only: dust_init + use seasalt_model, only: seasalt_init + use aer_drydep_mod, only: inidrydep + use wetdep, only: wetdep_init + use mo_setsox, only: has_sox ! args type(physics_buffer_desc), pointer :: pbuf2d(:,:) @@ -384,7 +384,7 @@ end subroutine aero_model_init subroutine aero_model_drydep ( state, pbuf, obklen, ustar, cam_in, dt, cam_out, ptend ) use dust_sediment_mod, only: dust_sediment_tend - use drydep_mod, only: d3ddflux, calcram + use aer_drydep_mod, only: d3ddflux, calcram use dust_model, only: dust_depvel, dust_nbin, dust_names use seasalt_model, only: sslt_depvel=>seasalt_depvel, sslt_nbin=>seasalt_nbin, sslt_names=>seasalt_names diff --git a/src/chemistry/modal_aero/aero_model.F90 b/src/chemistry/modal_aero/aero_model.F90 index 823cc4b9ff..44adeee77c 100644 --- a/src/chemistry/modal_aero/aero_model.F90 +++ b/src/chemistry/modal_aero/aero_model.F90 @@ -185,7 +185,7 @@ subroutine aero_model_init( pbuf2d ) use rad_constituents,only: rad_cnst_get_info use dust_model, only: dust_init, dust_names, dust_active, dust_nbin, dust_nnum use seasalt_model, only: seasalt_init, seasalt_names, seasalt_active,seasalt_nbin - use drydep_mod, only: inidrydep + use aer_drydep_mod, only: inidrydep use wetdep, only: wetdep_init use modal_aero_calcsize, only: modal_aero_calcsize_init @@ -666,7 +666,7 @@ end subroutine aero_model_init subroutine aero_model_drydep ( state, pbuf, obklen, ustar, cam_in, dt, cam_out, ptend ) use dust_sediment_mod, only: dust_sediment_tend - use drydep_mod, only: d3ddflux, calcram + use aer_drydep_mod, only: d3ddflux, calcram use modal_aero_data, only: qqcw_get_field use modal_aero_data, only: cnst_name_cw use modal_aero_data, only: alnsg_amode From 3ac393af1a5f5efa3c94db3cc4b81bc8e3b1a72d Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 5 Jun 2020 16:45:34 -0400 Subject: [PATCH 095/239] Feat: Print dep. lists when getting from namelist --- bld/perl5lib/Build/ChemNamelist.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bld/perl5lib/Build/ChemNamelist.pm b/bld/perl5lib/Build/ChemNamelist.pm index 0cf0114337..5f95ad9f2f 100644 --- a/bld/perl5lib/Build/ChemNamelist.pm +++ b/bld/perl5lib/Build/ChemNamelist.pm @@ -66,31 +66,35 @@ sub set_dep_lists if ($print_lvl>=2) {print "Chemistry species : @species_list \n" ;} if (!defined $nl->get_value('gas_wetdep_list')) { - $gas_wetdep_list = get_gas_wetdep_list( $cfgdir, $print_lvl, @species_list ); + $gas_wetdep_list = get_gas_wetdep_list( $cfgdir, $print_lvl, @species_list ); } else { $gas_wetdep_list = $nl->get_value('gas_wetdep_list'); $gas_wetdep_list = filter_dep_list( $gas_wetdep_list, $print_lvl, @species_list ); + if ($print_lvl>=2) {print " gas wet dep list : $gas_wetdep_list \n" ;} } if (!defined $nl->get_value('aer_wetdep_list')) { - $aer_wetdep_list = get_aer_wetdep_list( $cfgdir, $print_lvl, @species_list ); + $aer_wetdep_list = get_aer_wetdep_list( $cfgdir, $print_lvl, @species_list ); } else { $aer_wetdep_list = $nl->get_value('aer_wetdep_list'); $aer_wetdep_list = filter_dep_list( $aer_wetdep_list, $print_lvl, @species_list ); + if ($print_lvl>=2) {print " aer wet dep list : $aer_wetdep_list \n" ;} } if (!defined $nl->get_value('drydep_list')) { - $gas_drydep_list = get_gas_drydep_list( $cfgdir, $print_lvl, @species_list ); + $gas_drydep_list = get_gas_drydep_list( $cfgdir, $print_lvl, @species_list ); } else { $gas_drydep_list = $nl->get_value('drydep_list'); $gas_drydep_list = filter_dep_list( $gas_drydep_list, $print_lvl, @species_list ); + if ($print_lvl>=2) {print " dry dep list : $gas_drydep_list \n" ;} } if (!defined $nl->get_value('aer_drydep_list')) { - $aer_drydep_list = get_aer_drydep_list( $cfgdir, $print_lvl, @species_list ); + $aer_drydep_list = get_aer_drydep_list( $cfgdir, $print_lvl, @species_list ); } else { $aer_drydep_list = $nl->get_value('aer_drydep_list'); $aer_drydep_list = filter_dep_list( $aer_drydep_list, $print_lvl, @species_list ); + if ($print_lvl>=2) {print " aer dry dep list : $aer_drydep_list \n" ;} } # set solubility factors for aerosols From 8618f2e849a20126f2a07dec6507d8df350e456a Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 28 May 2020 15:40:13 -0400 Subject: [PATCH 096/239] Feat: Add FAST_JX_DIR in Input_Opt. Remove hard-wired paths in fast_jx --- src/chemistry/pp_geoschem/chemistry.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 18806d3e17..cea6529edf 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -970,6 +970,10 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%TPCore_JOrd = 3 Input_Opt%TPCore_KOrd = 3 + ! Now READ_PHOTOLYSIS_MENU + Input_Opt%FAST_JX_DIR ='/glade/p/univ/umit0034/ExtData/' // & + 'CHEM_INPUTS/FAST_JX/v2019-06/' + ! Now READ_CONVECTION_MENU ! For now, TMMF Input_Opt%LConv = .False. From a140e4090652e023ee42e06d4535c2b8144d8330 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 11 Jun 2020 13:10:09 -0400 Subject: [PATCH 097/239] Feat: Allow MAM to compile with CESM-GC --- bld/build-namelist | 4 +++ bld/config_files/definition.xml | 2 +- bld/configure | 35 +++++++++++++---------- bld/namelist_files/use_cases/geoschem.xml | 8 +----- cime_config/config_component.xml | 8 ++++-- cime_config/config_compsets.xml | 6 ++-- 6 files changed, 34 insertions(+), 29 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index e0202bee82..f4a9feee51 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -716,6 +716,10 @@ if ( ($chem ne 'none') or ( $prog_species ) ){ $prescribe_aerosols = $FALSE; } + if ($chem =~ /geoschem/) { + $prescribe_aerosols = $FALSE; + } + add_default($nl, 'aer_wetdep_list', 'val'=>$aer_wetdep_list ); if (!($chem =~ /_mam/)) { diff --git a/bld/config_files/definition.xml b/bld/config_files/definition.xml index e6a6055002..e9d8c38697 100644 --- a/bld/config_files/definition.xml +++ b/bld/config_files/definition.xml @@ -97,7 +97,7 @@ test_radiative (Radiatively Active Dust), test_swelling (Sea Salt), test_tracers Chemistry package: trop_mam3 trop_mam4 trop_mam7 trop_mozart trop_strat_mam4_vbs trop_strat_mam4_vbsext waccm_ma waccm_mad waccm_mad_mam4 waccm_ma_mam4 waccm_ma_sulfur waccm_sc waccm_sc_mam4 waccm_tsmlt_mam4 terminator none - + Chemistry package: trop_mam3 trop_mam4 trop_mam7 trop_mozart trop_strat_mam4_vbs trop_strat_mam4_vbsext waccm_ma waccm_mad waccm_mad_mam4 waccm_ma_mam4 waccm_ma_sulfur waccm_sc waccm_sc_mam4 waccm_tsmlt_mam4 terminator GEOS-Chem none diff --git a/bld/configure b/bld/configure index b5b5ead7c9..3340d1fb96 100755 --- a/bld/configure +++ b/bld/configure @@ -124,7 +124,7 @@ OPTIONS [ trop_mam3 | trop_mam4 | trop_mam7 | trop_mozart | trop_strat_mam4_vbs | trop_strat_mam4_vbsext | waccm_ma | waccm_mad | waccm_mad_mam4 | waccm_ma_mam4 | waccm_ma_sulfur | waccm_sc | waccm_sc_mam4 | waccm_tsmlt_mam4 | - terminator | geoschem | none ]. + terminator | geoschem | geoschem_mam4 | none ]. Default: trop_mam4 for cam6 and trop_mam3 for cam5. -clm_vers Version of land model to use. This option is only used when chem is set to 'geoschem'. @@ -673,7 +673,7 @@ if (defined $opts{'chem'}) { # If the user has specified a simple physics package... if ($simple_phys) { # the only valid chemistry options are 'none', 'terminator' and 'geoschem' - if (($chem_pkg ne 'none') and ($chem_pkg ne 'terminator') and ($chem_pkg ne 'geoschem')) { + if (($chem_pkg ne 'none') and ($chem_pkg ne 'terminator') and !($chem_pkg =~ 'geoschem')) { die "configure ERROR: -phys=$phys_pkg -chem=$chem_pkg\n". " -chem can only be set to 'none', 'terminator' or 'geoschem'.\n"; } @@ -1392,7 +1392,11 @@ my $chem_cppdefs = ''; my $chem_src_dir = ''; if (!$prog_species) { - $chem_src_dir = "$cam_dir/src/chemistry/pp_$chem_pkg"; + if ($chem_pkg =~ 'geoschem') { + $chem_src_dir = "$cam_dir/src/chemistry/pp_geoschem"; + } else { + $chem_src_dir = "$cam_dir/src/chemistry/pp_$chem_pkg"; + } $cfg_ref->set('chem_src_dir', $chem_src_dir); } @@ -1438,7 +1442,7 @@ if ($chem_pkg =~ '_mam3') { if ($chem_pkg =~ 'geoschem') { $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DLINUX_IFORT -DUSE_REAL8 -DMODEL_ -DMODEL_CESM'; # TMMF - Temporary fix - $chem_nadv = 200; + $chem_nadv = 220; if (defined $opts{'clm_vers'}) { if ($opts{'clm_vers'} =~ 'CLM4.0') { $chem_cppdefs .= ' -DCLM40' @@ -2826,13 +2830,17 @@ sub write_filepath } if ($chem_src_dir) { print $fh "$chem_src_dir\n"; - if ($chem_pkg eq 'geoschem') { + if ($chem_pkg =~ 'geoschem') { print $fh "$chem_src_dir/geoschem_src/GeosCore\n"; print $fh "$chem_src_dir/geoschem_src/GeosUtil\n"; print $fh "$chem_src_dir/geoschem_src/Headers\n"; print $fh "$chem_src_dir/geoschem_src/ISORROPIA\n"; - print $fh "$chem_src_dir/geoschem_src/KPP/Standard\n"; } -# print $fh "$camsrcdir/cam/src/chemistry/pp_geoschem\n"; } + print $fh "$chem_src_dir/geoschem_src/KPP/Standard\n"; + if ($chem =~ /_mam/) { + print $fh "$camsrcdir/src/chemistry/modal_aero\n"; + print $fh "$camsrcdir/src/chemistry/aerosol\n"; + } + } } if ($waccmx) { @@ -2872,17 +2880,14 @@ sub write_filepath # -- Added by MSL - 1/2018 # -- Updated by TMMF - 11/2019 - if ($chem_pkg ne 'geoschem') { - print $fh "$camsrcdir/cam/src/chemistry/mozart\n"; + if (!($chem_pkg =~ 'geoschem')) { + print $fh "$camsrcdir/src/chemistry/mozart\n"; if ($chem =~ /_mam/) { - print $fh "$camsrcdir/cam/src/chemistry/modal_aero\n"; + print $fh "$camsrcdir/src/chemistry/modal_aero\n"; } else { - print $fh "$camsrcdir/cam/src/chemistry/bulk_aero\n"; + print $fh "$camsrcdir/src/chemistry/bulk_aero\n"; } - print $fh "$camsrcdir/cam/src/chemistry/aerosol\n"; -# } -# else { -# print $fh "$camsrcdir/cam/src/chemistry/mozart\n"; + print $fh "$camsrcdir/src/chemistry/aerosol\n"; } # -- print $fh "$camsrcdir/src/chemistry/utils\n"; diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 14e8f7a9ba..e3091fa827 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -6,19 +6,13 @@ 367.0e-6 -atm/cam/inic/fv/cami-chem_1990-01-01_1.9x2.5_L26_c080114.nc +atm/cam/inic/fv/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc atm/cam/solar/spectral_irradiance_Lean_1610-2009_ann_c100405.nc 20000101 FIXED - -atm/cam/chem/trop_mozart_aero/aero -aero_1.9x2.5_L26_1850-2005_c091112.nc -CYCLICAL -2000 - atm/cam/chem/trop_mozart_aero/aero aerosoldep_monthly_2000_mean_1.9x2.5_c090421.nc diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 91dee5f54d..4f7c657938 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -8,9 +8,9 @@ CAM =============== --> - CAM cam6 physics: - CAM cam5 physics: - CAM cam4 physics: + CAM cam6 physics: + CAM cam5 physics: + CAM cam4 physics: CAM simplified and non-versioned physics : From 608efff226d85b469b596257fff6c47cbade1795 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 11 Jun 2020 13:40:18 -0400 Subject: [PATCH 098/239] Feat: Remove unused use statement --- src/chemistry/modal_aero/aero_model.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chemistry/modal_aero/aero_model.F90 b/src/chemistry/modal_aero/aero_model.F90 index 44adeee77c..56c3f22b58 100644 --- a/src/chemistry/modal_aero/aero_model.F90 +++ b/src/chemistry/modal_aero/aero_model.F90 @@ -179,7 +179,7 @@ subroutine aero_model_init( pbuf2d ) use mo_chem_utls, only: get_inv_ndx use cam_history, only: addfld, add_default, horiz_only - use mo_chem_utls, only: get_rxt_ndx, get_spc_ndx + use mo_chem_utls, only: get_spc_ndx use modal_aero_data, only: cnst_name_cw use modal_aero_data, only: modal_aero_data_init use rad_constituents,only: rad_cnst_get_info From 1e982b32360f989c4c2e1e419fd5c017f6f8b072 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 20 Jul 2020 12:19:37 -0400 Subject: [PATCH 099/239] Feat: Updates to make MAM4 interchange data with CESM-GC Compile time changes: (1) prescribe_aerosols is set to FALSE when $chem contains geoschem (2) Replace aerosol deposition species with MAM4 aerosols in nml files (3) Remove pp_geoschem/aero_model. Currently, GEOS-Chem only works with MAM(4) turned on. If MAM is to be switched off in the future, then the compiler should choose to compile pp_geoschem/aero_model (which is just a dummy, almost empty file) over modal_aero/aero_model.F90 Code changes: (1) Make xname_massptr a public and protected variable. It is used to establish a mapping between MAM4 and GEOS-Chem aerosols (2) Add map2MAM4(:,:) in chem_mods and set number of fixed species to 6 rather than 4 (3) Add dummy constituents for GEOS-Chem aerosols. Ideally, aerosols that are inherited from MAM should not need to be defined as a constituent. For instance, BCPI is inherited from bc_a* whereas NIT is not included and needs to be defined as a constituent (in order to be advected) (4) Establish mapping between MAM4 and GEOS-Chem aerosols. Currently, POM and SOA are not mapped. More work is needed here to figure out which GEOS-Chem aerosols should be used to map those. (5) Reverse mapping (aka from GEOS-Chem back to MAM) is not established yet. (6) Clip QI and QL to 1.0E-05 as low values (I have found values as low as 1.0E-141) can make GEOS-Chem blow up in sulfate_mod. (7) Add empty m_spc_id.F90, required by MAM4 (8) In mo_chem_utils, replace tracerNames by tracname. This is required as MAM aerosols are not in tracerNames (which only includes GEOS-Chem species). Add get_inv_ndx. I believe that this change temporarily breaks dry deposition as performed by MOZART. More investigation is needed here. (9) Add subroutine in mo_drydep to load in land types which is required for MAM4 to perform its own dry deposition (10) Add MAM4 aerosols to solsym and define inv_lst (list of fixed species) ---- TODOs: (1) Establish reverse mappings (GEOS-Chem -> MAM4) (2) Check MOZART's dry deposition routines. (3) As of right now, MAM4 performs dry deposition. Would it be possible to let GEOS-Chem perform dry deposition of aerosols? (4) What to do regarding pure GEOS-Chem aerosols (e.g. NIT)? --- bld/build-namelist | 48 +- bld/namelist_files/use_cases/geoschem.xml | 5 +- src/chemistry/modal_aero/modal_aero_data.F90 | 2 +- src/chemistry/pp_geoschem/aero_model.F90 | 1150 ---------------- src/chemistry/pp_geoschem/chem_mods.F90 | 49 +- src/chemistry/pp_geoschem/chemistry.F90 | 1276 ++++++------------ src/chemistry/pp_geoschem/m_spc_id.F90 | 3 + src/chemistry/pp_geoschem/mo_chem_utls.F90 | 67 +- src/chemistry/pp_geoschem/mo_drydep.F90 | 191 +++ src/chemistry/pp_geoschem/mo_sim_dat.F90 | 18 +- src/chemistry/pp_geoschem/mo_tracname.F90 | 2 +- 11 files changed, 736 insertions(+), 2075 deletions(-) delete mode 100644 src/chemistry/pp_geoschem/aero_model.F90 create mode 100644 src/chemistry/pp_geoschem/m_spc_id.F90 diff --git a/bld/build-namelist b/bld/build-namelist index f4a9feee51..e2c845d020 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -707,6 +707,11 @@ if ( ($chem ne 'none') or ( $prog_species ) ){ add_default($nl, 'gas_wetdep_method' ); add_default($nl, 'gas_wetdep_list', 'val'=>$gas_wetdep_list ); } + + if ($chem =~ /geoschem/) { + $prescribe_aerosols = $FALSE; + } + if (length($aer_wetdep_list)>2){ # determine if prescribed aerosols are not needed ... if ($aer_wetdep_list =~ /so4/i && @@ -716,10 +721,6 @@ if ( ($chem ne 'none') or ( $prog_species ) ){ $prescribe_aerosols = $FALSE; } - if ($chem =~ /geoschem/) { - $prescribe_aerosols = $FALSE; - } - add_default($nl, 'aer_wetdep_list', 'val'=>$aer_wetdep_list ); if (!($chem =~ /_mam/)) { @@ -744,6 +745,8 @@ if ( ($chem ne 'none') or ( $prog_species ) ){ if (length($aer_drydep_list)>2){ add_default($nl, 'aer_drydep_list', 'val'=>$aer_drydep_list ); } + $nl->set_variable_value('aerosol_nl', 'aer_drydep_list', $aer_drydep_list); + $nl->set_variable_value('aerosol_nl', 'aer_wetdep_list', $aer_wetdep_list); } if ($chem) { # Dry Deposition -- The responsibility for dry deposition is shared between CAM and CLM. @@ -2082,7 +2085,38 @@ if (($chem =~ /geoschem/ or $chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $ } } -if ($chem =~ /geoschem/ or $chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $chem =~ /waccm_tsmlt/) { +if ($chem =~ /geoschem/) { + + my $val; + + # Species with fixed lower boundary + $val = "'CH4','OCS','N2O','CO2','CFC11','CFC12'"; + + if ($chem_has_ocs) { + $val .= ",'OCS'"; + } + if (chem_has_species($cfg, 'SF6')) { + $val .= ",'SF6'"; + } + add_default($nl, 'flbc_list', 'val'=>$val); + unless (defined $nl->get_value('flbc_type')) { + add_default($nl, 'flbc_type', 'val'=>'CYCLICAL'); + add_default($nl, 'flbc_cycle_yr', 'val'=>'2000'); + } + + my @files; + # Datasets + #@files = ( 'soil_erod_file', 'flbc_file', + # 'xs_coef_file','xs_short_file', + # 'xs_long_file', 'rsf_file', + # 'exo_coldens_file', 'sulf_file' ); + @files = ( 'soil_erod_file', 'flbc_file' ); + foreach my $file (@files) { + add_default($nl, $file); + } +} + +if ($chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $chem =~ /waccm_tsmlt/) { my $val; @@ -2097,8 +2131,6 @@ if ($chem =~ /geoschem/ or $chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $c if ($chem =~ /_tsmlt_mam/ or $chem =~ /trop_strat/) { $val = "'CCL4','CF2CLBR','CF3BR','CFC11','CFC113','CFC12','CH3BR','CH3CCL3','CH3CL','CH4','CO2'" .",'H2','HCFC22','N2O','CFC114','CFC115','HCFC141B','HCFC142B','CH2BR2','CHBR3','H2402'"; - } elsif ($chem =~ /geoschem/) { - $val = "'CH4','OCS','N2O','CO2','CFC11','CFC12'"; } else { $val = "'CH4','H2','N2O','CO2','CFC11','CFC12'"; } @@ -2875,7 +2907,7 @@ if (!$simple_phys) { } # tropopause level used in gas-phase / aerosol processes -if (($chem ne 'none') and ($chem ne 'terminator')) { +if (($chem ne 'none') and ($chem ne 'terminator') and !($chem =~ /geoschem/)) { add_default($nl, 'chem_use_chemtrop'); } diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index e3091fa827..f5236364dc 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -26,7 +26,6 @@ CYCLICAL 2000 -.true. 'xactive_lnd' @@ -61,7 +60,7 @@ - 'ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','DST1','DSTAL1','NITD1','SO4D1','DST2','DSTAL2','NITD2','SO4D2','DST3','DSTAL3','NITD3','SO4D3','DST4','DSTAL4','NITD4','SO4D4','INDIOL','IONITA','ISN1OA','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITS','OCPI','OCPO','OPOA1','OPOA2','PFE','POA1','POA2','SALA','SALC','SO4','SO4S','SOAIE','SOAGX','SOAME','SOAMG','SOAS','TSOA0','TSOA1','TSOA2','TSOA3','BRSALA','BRSALC','ISALA','ISALC','AERI' +'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' @@ -69,7 +68,7 @@ - 'ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','DST1','DSTAL1','NITD1','SO4D1','DST2','DSTAL2','NITD2','SO4D2','DST3','DSTAL3','NITD3','SO4D3','DST4','DSTAL4','NITD4','SO4D4','INDIOL','IONITA','ISN1OA','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITS','OCPI','OCPO','OPOA1','OPOA2','PFE','POA1','POA2','SALA','SALC','SO4','SO4S','SOAIE','SOAGX','SOAME','SOAMG','SOAS','TSOA0','TSOA1','TSOA2','TSOA3','BRSALA','BRSALC','ISALA','ISALC','AERI' + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' diff --git a/src/chemistry/modal_aero/modal_aero_data.F90 b/src/chemistry/modal_aero/modal_aero_data.F90 index e45d254dcc..2db8a73750 100644 --- a/src/chemistry/modal_aero/modal_aero_data.F90 +++ b/src/chemistry/modal_aero/modal_aero_data.F90 @@ -110,7 +110,7 @@ module modal_aero_data logical, public, protected :: soa_multi_species = .false. - character(len=16), allocatable :: xname_massptr(:,:) ! names of species in each mode + character(len=16), public, protected, allocatable :: xname_massptr(:,:) ! names of species in each mode character(len=16), allocatable :: xname_massptrcw(:,:) ! names of cloud-borne species in each mode complex(r8), allocatable :: & diff --git a/src/chemistry/pp_geoschem/aero_model.F90 b/src/chemistry/pp_geoschem/aero_model.F90 deleted file mode 100644 index 3c9133adf6..0000000000 --- a/src/chemistry/pp_geoschem/aero_model.F90 +++ /dev/null @@ -1,1150 +0,0 @@ -!=============================================================================== -! Bulk Aerosol Model -!=============================================================================== -module aero_model - use shr_kind_mod, only: r8 => shr_kind_r8 - use constituents, only: pcnst, cnst_name, cnst_get_ind - use ppgrid, only: pcols, pver, pverp - use cam_abortutils, only: endrun - use cam_logfile, only: iulog - use perf_mod, only: t_startf, t_stopf - use camsrfexch, only: cam_in_t, cam_out_t - use physics_types, only: physics_state, physics_ptend, physics_ptend_init - use physics_buffer, only: physics_buffer_desc - use physconst, only: gravit, rair - use spmd_utils, only: masterproc - use physics_buffer, only: pbuf_get_field, pbuf_get_index - use cam_history, only: outfld - use infnan, only: nan, assignment(=) - - implicit none - private - - public :: aero_model_readnl - public :: aero_model_register - public :: aero_model_init - public :: aero_model_gasaerexch ! create, grow, change, and shrink aerosols. - public :: aero_model_drydep ! aerosol dry deposition and sediment - public :: aero_model_wetdep ! aerosol wet removal - public :: aero_model_emissions ! aerosol emissions - public :: aero_model_surfarea ! tropospheric aerosol wet surface area for chemistry - public :: aero_model_strat_surfarea ! stub - - ! Misc private data - - integer :: so4_ndx, cb2_ndx, oc2_ndx, nit_ndx - integer :: soa_ndx, soai_ndx, soam_ndx, soab_ndx, soat_ndx, soax_ndx - - ! Namelist variables - character(len=16) :: wetdep_list(pcnst) = ' ' - character(len=16) :: drydep_list(pcnst) = ' ' - - integer :: ndrydep = 0 - integer,allocatable :: drydep_indices(:) - integer :: nwetdep = 0 - integer,allocatable :: wetdep_indices(:) - logical :: drydep_lq(pcnst) - logical :: wetdep_lq(pcnst) - - integer :: fracis_idx = 0 - - real(r8) :: aer_sol_facti(pcnst) ! in-cloud solubility factor - real(r8) :: aer_sol_factb(pcnst) ! below-cloud solubility factor - real(r8) :: aer_scav_coef(pcnst) - -contains - - !============================================================================= - ! reads aerosol namelist options - !============================================================================= - subroutine aero_model_readnl(nlfile) - - use namelist_utils, only: find_group_name - use units, only: getunit, freeunit - use mpishorthand - - character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input - - ! Local variables - integer :: unitn, ierr - character(len=*), parameter :: subname = 'aero_model_readnl' - - ! Namelist variables - character(len=16) :: aer_wetdep_list(pcnst) = ' ' - character(len=16) :: aer_drydep_list(pcnst) = ' ' - - namelist /aerosol_nl/ aer_wetdep_list, aer_drydep_list - namelist /aerosol_nl/ aer_sol_facti, aer_sol_factb, aer_scav_coef - !----------------------------------------------------------------------------- - !aer_sol_facti = nan - !aer_sol_factb = nan - !aer_scav_coef = nan - - !! Read namelist - !if (masterproc) then - ! unitn = getunit() - ! open( unitn, file=trim(nlfile), status='old' ) - ! call find_group_name(unitn, 'aerosol_nl', status=ierr) - ! if (ierr == 0) then - ! read(unitn, aerosol_nl, iostat=ierr) - ! if (ierr /= 0) then - ! call endrun(subname // ':: ERROR reading namelist') - ! end if - ! end if - ! close(unitn) - ! call freeunit(unitn) - !end if - -#ifdef SPMD - ! Broadcast namelist variables - !call mpibcast(aer_wetdep_list, len(aer_wetdep_list(1))*pcnst, mpichar, 0, mpicom) - !call mpibcast(aer_drydep_list, len(aer_drydep_list(1))*pcnst, mpichar, 0, mpicom) - !call mpibcast(aer_sol_facti, pcnst, mpir8, 0, mpicom) - !call mpibcast(aer_sol_factb, pcnst, mpir8, 0, mpicom) - !call mpibcast(aer_scav_coef, pcnst, mpir8, 0, mpicom) -#endif - - !wetdep_list = aer_wetdep_list - !drydep_list = aer_drydep_list - - end subroutine aero_model_readnl - - !============================================================================= - !============================================================================= - subroutine aero_model_register() - !use mo_setsoa, only : soa_register - - !call soa_register() - end subroutine aero_model_register - - !============================================================================= - !============================================================================= - subroutine aero_model_init( pbuf2d ) - - !use mo_chem_utls, only: get_inv_ndx, get_spc_ndx - use cam_history, only: addfld, add_default, horiz_only - use phys_control, only: phys_getopts - !use mo_aerosols, only: aerosols_inti - !use mo_setsoa, only: soa_inti - !use dust_model, only: dust_init - !use seasalt_model, only: seasalt_init - !use drydep_mod, only: inidrydep - !use wetdep, only: wetdep_init - !use mo_setsox, only: has_sox - - ! args - type(physics_buffer_desc), pointer :: pbuf2d(:,:) - - ! local vars - character(len=12), parameter :: subrname = 'aero_model_init' - integer :: m, id - character(len=20) :: dummy - logical :: history_aerosol ! Output MAM or SECT aerosol tendencies - - !call phys_getopts( history_aerosol_out=history_aerosol ) - !call aerosols_inti() - !call soa_inti(pbuf2d) - !call dust_init() - !call seasalt_init() - !call wetdep_init() - - !fracis_idx = pbuf_get_index('FRACIS') - - !nwetdep = 0 - !ndrydep = 0 - - !count_species: do m = 1,pcnst - ! if ( len_trim(wetdep_list(m)) /= 0 ) then - ! nwetdep = nwetdep+1 - ! endif - ! if ( len_trim(drydep_list(m)) /= 0 ) then - ! ndrydep = ndrydep+1 - ! endif - !enddo count_species - ! - !if (nwetdep>0) & - ! allocate(wetdep_indices(nwetdep)) - !if (ndrydep>0) & - ! allocate(drydep_indices(ndrydep)) - - !do m = 1,ndrydep - ! call cnst_get_ind ( drydep_list(m), id, abort=.false. ) - ! if (id>0) then - ! drydep_indices(m) = id - ! else - ! call endrun(subrname//': invalid drydep species: '//trim(drydep_list(m)) ) - ! endif - - ! if (masterproc) then - ! write(iulog,*) subrname//': '//drydep_list(m)//' will have drydep applied' - ! endif - !enddo - !do m = 1,nwetdep - ! call cnst_get_ind ( wetdep_list(m), id, abort=.false. ) - ! if (id>0) then - ! wetdep_indices(m) = id - ! else - ! call endrun(subrname//': invalid wetdep species: '//trim(wetdep_list(m)) ) - ! endif - ! - ! if (masterproc) then - ! write(iulog,*) subrname//': '//wetdep_list(m)//' will have wet removal' - ! endif - !enddo - ! - !! set flags for drydep tendencies - !drydep_lq(:) = .false. - !do m=1,ndrydep - ! id = drydep_indices(m) - ! drydep_lq(id) = .true. - !enddo - - !! set flags for wetdep tendencies - !wetdep_lq(:) = .false. - !do m=1,nwetdep - ! id = wetdep_indices(m) - ! wetdep_lq(id) = .true. - !enddo - - !do m = 1,ndrydep - ! - ! dummy = trim(drydep_list(m)) // 'TB' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s',trim(drydep_list(m))//' turbulent dry deposition flux') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - ! dummy = trim(drydep_list(m)) // 'GV' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s',trim(drydep_list(m)) //' gravitational dry deposition flux') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - ! dummy = trim(drydep_list(m)) // 'DD' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s',trim(drydep_list(m)) //' dry deposition flux at bottom (grav + turb)') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - ! dummy = trim(drydep_list(m)) // 'DT' - ! call addfld (dummy,(/ 'lev' /), 'A','kg/kg/s',trim(drydep_list(m))//' dry deposition') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - ! dummy = trim(drydep_list(m)) // 'DV' - ! call addfld (dummy,(/ 'lev' /), 'A','m/s',trim(drydep_list(m))//' deposition velocity') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - - !enddo - ! - !if (ndrydep>0) then - - ! call inidrydep(rair, gravit) - - ! dummy = 'RAM1' - ! call addfld (dummy,horiz_only, 'A','frac','RAM1') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - ! dummy = 'airFV' - ! call addfld (dummy,horiz_only, 'A','frac','FV') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - - ! if (sslt_active) then - ! dummy = 'SSTSFDRY' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Sea salt deposition flux at surface') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - ! endif - ! if (dust_active) then - ! dummy = 'DSTSFDRY' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Dust deposition flux at surface') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - ! endif - - !endif - - !do m = 1,nwetdep - - ! call addfld (trim(wetdep_list(m))//'SFWET', horiz_only, 'A','kg/m2/s', & - ! 'Wet deposition flux at surface') - ! call addfld (trim(wetdep_list(m))//'SFSIC', horiz_only, 'A','kg/m2/s', & - ! 'Wet deposition flux (incloud, convective) at surface') - ! call addfld (trim(wetdep_list(m))//'SFSIS', horiz_only, 'A','kg/m2/s', & - ! 'Wet deposition flux (incloud, stratiform) at surface') - ! call addfld (trim(wetdep_list(m))//'SFSBC', horiz_only, 'A','kg/m2/s', & - ! 'Wet deposition flux (belowcloud, convective) at surface') - ! call addfld (trim(wetdep_list(m))//'SFSBS', horiz_only, 'A','kg/m2/s', & - ! 'Wet deposition flux (belowcloud, stratiform) at surface') - ! call addfld (trim(wetdep_list(m))//'WET', (/ 'lev' /), 'A','kg/kg/s', & - ! 'wet deposition tendency') - ! call addfld (trim(wetdep_list(m))//'SIC', (/ 'lev' /), 'A','kg/kg/s', & - ! trim(wetdep_list(m))//' ic wet deposition') - ! call addfld (trim(wetdep_list(m))//'SIS', (/ 'lev' /), 'A','kg/kg/s', & - ! trim(wetdep_list(m))//' is wet deposition') - ! call addfld (trim(wetdep_list(m))//'SBC', (/ 'lev' /), 'A','kg/kg/s', & - ! trim(wetdep_list(m))//' bc wet deposition') - ! call addfld (trim(wetdep_list(m))//'SBS', (/ 'lev' /), 'A','kg/kg/s', & - ! trim(wetdep_list(m))//' bs wet deposition') - !enddo - ! - !if (nwetdep>0) then - ! if (sslt_active) then - ! dummy = 'SSTSFWET' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Sea salt wet deposition flux at surface') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - ! endif - ! if (dust_active) then - ! dummy = 'DSTSFWET' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Dust wet deposition flux at surface') - ! if ( history_aerosol ) then - ! call add_default (dummy, 1, ' ') - ! endif - ! endif - !endif - ! - !if (dust_active) then - ! ! emissions diagnostics .... - - ! do m = 1, dust_nbin - ! dummy = trim(dust_names(m)) // 'SF' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s',trim(dust_names(m))//' dust surface emission') - ! if (history_aerosol) then - ! call add_default (dummy, 1, ' ') - ! endif - ! enddo - - ! dummy = 'DSTSFMBL' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Mobilization flux at surface') - ! if (history_aerosol) then - ! call add_default (dummy, 1, ' ') - ! endif - - ! dummy = 'LND_MBL' - ! call addfld (dummy,horiz_only, 'A','frac','Soil erodibility factor') - ! if (history_aerosol) then - ! call add_default (dummy, 1, ' ') - ! endif - - !endif - ! - !if (sslt_active) then - - ! dummy = 'SSTSFMBL' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s','Mobilization flux at surface') - ! if (history_aerosol) then - ! call add_default (dummy, 1, ' ') - ! endif - - ! do m = 1, seasalt_nbin - ! dummy = trim(seasalt_names(m)) // 'SF' - ! call addfld (dummy,horiz_only, 'A','kg/m2/s',trim(seasalt_names(m))//' seasalt surface emission') - ! if (history_aerosol) then - ! call add_default (dummy, 1, ' ') - ! endif - ! enddo - - !endif - - !if( has_sox ) then - ! call addfld( 'XPH_LWC',(/ 'lev' /), 'A','kg/kg', 'pH value multiplied by lwc') - - ! if ( history_aerosol ) then - ! call add_default ('XPH_LWC', 1, ' ') - ! endif - !endif - - !so4_ndx = get_spc_ndx( 'SO4' ) - !soa_ndx = get_spc_ndx( 'SOA' ) - !soai_ndx = get_spc_ndx( 'SOAI' ) - !soam_ndx = get_spc_ndx( 'SOAM' ) - !soab_ndx = get_spc_ndx( 'SOAB' ) - !soat_ndx = get_spc_ndx( 'SOAT' ) - !soax_ndx = get_spc_ndx( 'SOAX' ) - !cb2_ndx = get_spc_ndx( 'CB2' ) - !oc2_ndx = get_spc_ndx( 'OC2' ) - !nit_ndx = get_spc_ndx( 'NH4NO3' ) - - end subroutine aero_model_init - - !============================================================================= - !============================================================================= - subroutine aero_model_drydep ( state, pbuf, obklen, ustar, cam_in, dt, cam_out, ptend ) - - !use dust_sediment_mod, only: dust_sediment_tend - !use drydep_mod, only: d3ddflux, calcram - !use dust_model, only: dust_depvel, dust_nbin, dust_names - !use seasalt_model, only: sslt_depvel=>seasalt_depvel, sslt_nbin=>seasalt_nbin, sslt_names=>seasalt_names - - ! args - type(physics_state), intent(in) :: state ! Physics state variables - real(r8), intent(in) :: obklen(:) - real(r8), intent(in) :: ustar(:) ! sfc fric vel - type(cam_in_t), target, intent(in) :: cam_in ! import state - real(r8), intent(in) :: dt ! time step - type(cam_out_t), intent(inout) :: cam_out ! export state - type(physics_ptend), intent(out) :: ptend ! indivdual parameterization tendencies - type(physics_buffer_desc), pointer :: pbuf(:) - - ! local vars - real(r8), pointer :: landfrac(:) ! land fraction - real(r8), pointer :: icefrac(:) ! ice fraction - real(r8), pointer :: ocnfrac(:) ! ocean fraction - real(r8), pointer :: fvin(:) ! - real(r8), pointer :: ram1in(:) ! for dry dep velocities from land model for progseasalts - - real(r8) :: fv(pcols) ! for dry dep velocities, from land modified over ocean & ice - real(r8) :: ram1(pcols) ! for dry dep velocities, from land modified over ocean & ice - - ! local decarations - - !integer, parameter :: naero = sslt_nbin+dust_nbin - !integer, parameter :: begslt = 1 - !integer, parameter :: endslt = sslt_nbin - !integer, parameter :: begdst = sslt_nbin+1 - !integer, parameter :: enddst = sslt_nbin+dust_nbin - - !integer :: ncol, lchnk - - !character(len=6) :: aeronames(naero) ! = (/ sslt_names, dust_names /) - - !real(r8) :: vlc_trb(pcols,naero) !Turbulent deposn velocity (m/s) - !real(r8) :: vlc_grv(pcols,pver,naero) !grav deposn velocity (m/s) - !real(r8) :: vlc_dry(pcols,pver,naero) !dry deposn velocity (m/s) - - !real(r8) :: dep_trb(pcols) !kg/m2/s - !real(r8) :: dep_grv(pcols) !kg/m2/s (total of grav and trb) - - !real(r8) :: tsflx_dst(pcols) - !real(r8) :: tsflx_slt(pcols) - !real(r8) :: pvaeros(pcols,pverp) ! sedimentation velocity in Pa - !real(r8) :: sflx(pcols) - - !real(r8) :: tvs(pcols,pver) - !real(r8) :: rho(pcols,pver) ! air density in kg/m3 - - !integer :: m,mm, i, im - ! - !if (ndrydep<1) return - - !landfrac => cam_in%landfrac(:) - !icefrac => cam_in%icefrac(:) - !ocnfrac => cam_in%ocnfrac(:) - !fvin => cam_in%fv(:) - !ram1in => cam_in%ram1(:) - - !lchnk = state%lchnk - !ncol = state%ncol - - !! calc ram and fv over ocean and sea ice ... - !call calcram( ncol,landfrac,icefrac,ocnfrac,obklen,& - ! ustar,ram1in,ram1,state%t(:,pver),state%pmid(:,pver),& - ! state%pdel(:,pver),fvin,fv) - - !call outfld( 'airFV', fv(:), pcols, lchnk ) - !call outfld( 'RAM1', ram1(:), pcols, lchnk ) - - !! note that tendencies are not only in sfc layer (because of sedimentation) - !! and that ptend is updated within each subroutine for different species - ! - !call physics_ptend_init(ptend, state%psetcols, 'aero_model_drydep', lq=drydep_lq) - - !aeronames(:sslt_nbin) = sslt_names(:) - !aeronames(sslt_nbin+1:) = dust_names(:) - - !lchnk = state%lchnk - !ncol = state%ncol - - !tvs(:ncol,:) = state%t(:ncol,:) - !rho(:ncol,:) = state%pmid(:ncol,:)/(rair*state%t(:ncol,:)) - - !! compute dep velocities for sea salt and dust... - !if (sslt_active) then - ! call sslt_depvel( state%t(:,:), state%pmid(:,:), state%q(:,:,1), ram1, fv, ncol, lchnk, & - ! vlc_dry(:,:,begslt:endslt), vlc_trb(:,begslt:endslt), vlc_grv(:,:,begslt:endslt)) - !endif - !if (dust_active) then - ! call dust_depvel( state%t(:,:), state%pmid(:,:), ram1, fv, ncol, & - ! vlc_dry(:,:,begdst:enddst), vlc_trb(:,begdst:enddst), vlc_grv(:,:,begdst:enddst) ) - !endif - - !tsflx_dst(:)=0._r8 - !tsflx_slt(:)=0._r8 - - !! do drydep for each of the bins of dust and seasalt - !do m=1,ndrydep - - ! mm = drydep_indices(m) - ! findindex: do im = 1,naero - ! if (trim(cnst_name(mm))==trim(aeronames(im))) exit findindex - ! enddo findindex - - ! pvaeros(:ncol,1)=0._r8 - ! pvaeros(:ncol,2:pverp) = vlc_dry(:ncol,:,im) - - ! call outfld( trim(cnst_name(mm))//'DV', pvaeros(:,2:pverp), pcols, lchnk ) - - ! if(.true.) then ! use phil's method - ! ! convert from meters/sec to pascals/sec - ! ! pvaeros(:,1) is assumed zero, use density from layer above in conversion - ! pvaeros(:ncol,2:pverp) = pvaeros(:ncol,2:pverp) * rho(:ncol,:)*gravit - - ! ! calculate the tendencies and sfc fluxes from the above velocities - ! call dust_sediment_tend( & - ! ncol, dt, state%pint(:,:), state%pmid, state%pdel, state%t , & - ! state%q(:,:,mm) , pvaeros , ptend%q(:,:,mm), sflx ) - ! else !use charlie's method - ! call d3ddflux(ncol, vlc_dry(:,:,im), state%q(:,:,mm),state%pmid,state%pdel, tvs,sflx,ptend%q(:,:,mm),dt) - ! endif - ! ! apportion dry deposition into turb and gravitational settling for tapes - ! do i=1,ncol - ! dep_trb(i)=sflx(i)*vlc_trb(i,im)/vlc_dry(i,pver,im) - ! dep_grv(i)=sflx(i)*vlc_grv(i,pver,im)/vlc_dry(i,pver,im) - ! enddo - - ! if ( any( sslt_names(:)==trim(cnst_name(mm)) ) ) & - ! tsflx_slt(:ncol)=tsflx_slt(:ncol)+sflx(:ncol) - ! if ( any( dust_names(:)==trim(cnst_name(mm)) ) ) & - ! tsflx_dst(:ncol)=tsflx_dst(:ncol)+sflx(:ncol) - - ! ! if the user has specified prescribed aerosol dep fluxes then - ! ! do not set cam_out dep fluxes according to the prognostic aerosols - ! if (.not. aerodep_flx_prescribed()) then - ! ! set deposition in export state - ! if (im==begdst) then - ! cam_out%dstdry1(:ncol) = max(sflx(:ncol), 0._r8) - ! elseif(im==begdst+1) then - ! cam_out%dstdry2(:ncol) = max(sflx(:ncol), 0._r8) - ! elseif(im==begdst+2) then - ! cam_out%dstdry3(:ncol) = max(sflx(:ncol), 0._r8) - ! elseif(im==begdst+3) then - ! cam_out%dstdry4(:ncol) = max(sflx(:ncol), 0._r8) - ! endif - ! endif - - ! call outfld( trim(cnst_name(mm))//'DD', sflx, pcols, lchnk) - ! call outfld( trim(cnst_name(mm))//'TB', dep_trb, pcols, lchnk ) - ! call outfld( trim(cnst_name(mm))//'GV', dep_grv, pcols, lchnk ) - ! call outfld( trim(cnst_name(mm))//'DT', ptend%q(:,:,mm), pcols, lchnk) - - !end do - ! - !! output the total dry deposition - !if (sslt_active) then - ! call outfld( 'SSTSFDRY', tsflx_slt, pcols, lchnk) - !endif - !if (dust_active) then - ! call outfld( 'DSTSFDRY', tsflx_dst, pcols, lchnk) - !endif - - endsubroutine aero_model_drydep - - !============================================================================= - !============================================================================= - subroutine aero_model_wetdep( state, dt, dlf, cam_out, ptend, pbuf) - - !use wetdep, only : wetdepa_v1, wetdep_inputs_set, wetdep_inputs_t - !use dust_model, only : dust_names - !use seasalt_model, only : sslt_names=>seasalt_names - - ! args - - type(physics_state), intent(in) :: state ! Physics state variables - real(r8), intent(in) :: dt ! time step - real(r8), intent(in) :: dlf(:,:) ! shallow+deep convective detrainment [kg/kg/s] - type(cam_out_t), intent(inout) :: cam_out ! export state - type(physics_ptend), intent(out) :: ptend ! indivdual parameterization tendencies - type(physics_buffer_desc), pointer :: pbuf(:) - - !! local vars - - !integer :: ncol ! number of atmospheric columns - !integer :: lchnk ! chunk identifier - !integer :: m,mm, i,k - - !real(r8) :: sflx_tot_dst(pcols) - !real(r8) :: sflx_tot_slt(pcols) - - !real(r8) :: iscavt(pcols, pver) - !real(r8) :: scavt(pcols, pver) - !real(r8) :: scavcoef(pcols,pver) ! Dana and Hales coefficient (/mm) (0.1) - !real(r8) :: sflx(pcols) ! deposition flux - - !real(r8) :: icscavt(pcols, pver) - !real(r8) :: isscavt(pcols, pver) - !real(r8) :: bcscavt(pcols, pver) - !real(r8) :: bsscavt(pcols, pver) - - !real(r8) :: sol_factb, sol_facti - - !real(r8) :: rainmr(pcols,pver) ! mixing ratio of rain within cloud volume - !real(r8) :: cldv(pcols,pver) ! cloudy volume undergoing scavenging - !real(r8) :: cldvcu(pcols,pver) ! Convective precipitation area at the top interface of current layer - !real(r8) :: cldvst(pcols,pver) ! Stratiform precipitation area at the top interface of current layer - - !real(r8), pointer :: fracis(:,:,:) ! fraction of transported species that are insoluble - - !type(wetdep_inputs_t) :: dep_inputs ! obj that contains inputs to wetdepa routine - - !if (nwetdep<1) return - - !call pbuf_get_field(pbuf, fracis_idx, fracis, start=(/1,1,1/), kount=(/pcols, pver, pcnst/) ) - - !call physics_ptend_init(ptend, state%psetcols, 'aero_model_wetdep', lq=wetdep_lq) - - !call wetdep_inputs_set( state, pbuf, dep_inputs ) - - !lchnk = state%lchnk - !ncol = state%ncol - - !sflx_tot_dst(:) = 0._r8 - !sflx_tot_slt(:) = 0._r8 - - !do m = 1, nwetdep - - ! mm = wetdep_indices(m) - - ! sol_factb = aer_sol_factb(m) - ! sol_facti = aer_sol_facti(m) - - ! scavcoef(:ncol,:) = aer_scav_coef(m) - - ! call wetdepa_v1( state%t, state%pmid, state%q(:,:,1), state%pdel, & - ! dep_inputs%cldt, dep_inputs%cldcu, dep_inputs%cmfdqr, & - ! dep_inputs%conicw, dep_inputs%prain, dep_inputs%qme, & - ! dep_inputs%evapr, dep_inputs%totcond, state%q(:,:,mm), dt, & - ! scavt, iscavt, dep_inputs%cldv, & - ! fracis(:,:,mm), sol_factb, ncol, & - ! scavcoef, & - ! sol_facti_in=sol_facti, & - ! icscavt=icscavt, isscavt=isscavt, bcscavt=bcscavt, bsscavt=bsscavt ) - - ! ptend%q(:ncol,:,mm)=scavt(:ncol,:) - - ! call outfld( trim(cnst_name(mm))//'WET', ptend%q(:,:,mm), pcols, lchnk) - ! call outfld( trim(cnst_name(mm))//'SIC', icscavt , pcols, lchnk) - ! call outfld( trim(cnst_name(mm))//'SIS', isscavt, pcols, lchnk) - ! call outfld( trim(cnst_name(mm))//'SBC', bcscavt, pcols, lchnk) - ! call outfld( trim(cnst_name(mm))//'SBS', bsscavt, pcols, lchnk) - - ! sflx(:)=0._r8 - - ! do k=1,pver - ! do i=1,ncol - ! sflx(i)=sflx(i)+ptend%q(i,k,mm)*state%pdel(i,k)/gravit - ! enddo - ! enddo - ! call outfld( trim(cnst_name(mm))//'SFWET', sflx, pcols, lchnk) - ! - ! if ( any( sslt_names(:)==trim(cnst_name(mm)) ) ) & - ! sflx_tot_slt(:ncol) = sflx_tot_slt(:ncol) + sflx(:ncol) - ! if ( any( dust_names(:)==trim(cnst_name(mm)) ) ) & - ! sflx_tot_dst(:ncol) = sflx_tot_dst(:ncol) + sflx(:ncol) - - ! ! if the user has specified prescribed aerosol dep fluxes then - ! ! do not set cam_out dep fluxes according to the prognostic aerosols - ! if (.not.aerodep_flx_prescribed()) then - ! ! export deposition fluxes to coupler ??? why "-" sign ??? - ! if (trim(cnst_name(mm))=='CB2') then - ! cam_out%bcphiwet(:) = max(-sflx(:), 0._r8) - ! elseif (trim(cnst_name(mm))=='OC2') then - ! cam_out%ocphiwet(:) = max(-sflx(:), 0._r8) - ! elseif (trim(cnst_name(mm))==trim(dust_names(1))) then - ! cam_out%dstwet1(:) = max(-sflx(:), 0._r8) - ! elseif (trim(cnst_name(mm))==trim(dust_names(2))) then - ! cam_out%dstwet2(:) = max(-sflx(:), 0._r8) - ! elseif (trim(cnst_name(mm))==trim(dust_names(3))) then - ! cam_out%dstwet3(:) = max(-sflx(:), 0._r8) - ! elseif (trim(cnst_name(mm))==trim(dust_names(4))) then - ! cam_out%dstwet4(:) = max(-sflx(:), 0._r8) - ! endif - ! endif - - !enddo - ! - !if (sslt_active) then - ! call outfld( 'SSTSFWET', sflx_tot_slt, pcols, lchnk) - !endif - !if (dust_active) then - ! call outfld( 'DSTSFWET', sflx_tot_dst, pcols, lchnk) - !endif - - endsubroutine aero_model_wetdep - - !------------------------------------------------------------------------- - ! provides aerosol surface area info for sectional aerosols - ! called from mo_usrrxt - !------------------------------------------------------------------------- - subroutine aero_model_surfarea( & - mmr, radmean, relhum, pmid, temp, strato_sad, sulfate, m, ltrop, & - dlat, het1_ndx, pbuf, ncol, sfc, dm_aer, sad_total, reff_trop ) - - !use mo_constants, only : pi, avo => avogadro - - ! dummy args - real(r8), intent(in) :: pmid(:,:) - real(r8), intent(in) :: temp(:,:) - real(r8), intent(in) :: mmr(:,:,:) - real(r8), intent(in) :: radmean ! mean radii in cm - real(r8), intent(in) :: strato_sad(:,:) - integer, intent(in) :: ncol - integer, intent(in) :: ltrop(:) - real(r8), intent(in) :: dlat(:) ! degrees latitude - integer, intent(in) :: het1_ndx - real(r8), intent(in) :: relhum(:,:) - real(r8), intent(in) :: m(:,:) ! total atm density (/cm^3) - real(r8), intent(in) :: sulfate(:,:) - type(physics_buffer_desc), pointer :: pbuf(:) - - real(r8), intent(inout) :: sfc(:,:,:) - real(r8), intent(inout) :: dm_aer(:,:,:) - real(r8), intent(inout) :: sad_total(:,:) - real(r8), intent(out) :: reff_trop(:,:) - - !! local vars - - !integer :: i,k - !real(r8) :: rho_air - !real(r8) :: v, n, n_exp, r_rd, r_sd - !real(r8) :: dm_sulf, dm_sulf_wet, log_sd_sulf, sfc_sulf, sfc_nit - !real(r8) :: dm_orgc, dm_orgc_wet, log_sd_orgc, sfc_oc, sfc_soa - !real(r8) :: sfc_soai, sfc_soam, sfc_soab, sfc_soat, sfc_soax - !real(r8) :: dm_bc, dm_bc_wet, log_sd_bc, sfc_bc - !real(r8) :: rxt_sulf, rxt_nit, rxt_oc, rxt_soa - !real(r8) :: c_n2o5, c_ho2, c_no2, c_no3 - !real(r8) :: s_exp - - !!----------------------------------------------------------------- - !! ... parameters for log-normal distribution by number - !! references: - !! Chin et al., JAS, 59, 461, 2003 - !! Liao et al., JGR, 108(D1), 4001, 2003 - !! Martin et al., JGR, 108(D3), 4097, 2003 - !!----------------------------------------------------------------- - !real(r8), parameter :: rm_sulf = 6.95e-6_r8 ! mean radius of sulfate particles (cm) (Chin) - !real(r8), parameter :: sd_sulf = 2.03_r8 ! standard deviation of radius for sulfate (Chin) - !real(r8), parameter :: rho_sulf = 1.7e3_r8 ! density of sulfate aerosols (kg/m3) (Chin) - - !real(r8), parameter :: rm_orgc = 2.12e-6_r8 ! mean radius of organic carbon particles (cm) (Chin) - !real(r8), parameter :: sd_orgc = 2.20_r8 ! standard deviation of radius for OC (Chin) - !real(r8), parameter :: rho_orgc = 1.8e3_r8 ! density of OC aerosols (kg/m3) (Chin) - - !real(r8), parameter :: rm_bc = 1.18e-6_r8 ! mean radius of soot/BC particles (cm) (Chin) - !real(r8), parameter :: sd_bc = 2.00_r8 ! standard deviation of radius for BC (Chin) - !real(r8), parameter :: rho_bc = 1.0e3_r8 ! density of BC aerosols (kg/m3) (Chin) - - !real(r8), parameter :: mw_so4 = 98.e-3_r8 ! so4 molecular wt (kg/mole) - - !integer :: irh, rh_l, rh_u - !real(r8) :: factor, rfac_sulf, rfac_oc, rfac_bc, rfac_ss - !logical :: zero_aerosols - - !!----------------------------------------------------------------- - !! ... table for hygroscopic growth effect on radius (Chin et al) - !! (no growth effect for mineral dust) - !!----------------------------------------------------------------- - !real(r8), dimension(7) :: table_rh, table_rfac_sulf, table_rfac_bc, table_rfac_oc, table_rfac_ss - - !data table_rh(1:7) / 0.0_r8, 0.5_r8, 0.7_r8, 0.8_r8, 0.9_r8, 0.95_r8, 0.99_r8/ - !data table_rfac_sulf(1:7) / 1.0_r8, 1.4_r8, 1.5_r8, 1.6_r8, 1.8_r8, 1.9_r8, 2.2_r8/ - !data table_rfac_oc(1:7) / 1.0_r8, 1.2_r8, 1.4_r8, 1.5_r8, 1.6_r8, 1.8_r8, 2.2_r8/ - !data table_rfac_bc(1:7) / 1.0_r8, 1.0_r8, 1.0_r8, 1.2_r8, 1.4_r8, 1.5_r8, 1.9_r8/ - !data table_rfac_ss(1:7) / 1.0_r8, 1.6_r8, 1.8_r8, 2.0_r8, 2.4_r8, 2.9_r8, 4.8_r8/ - - !!----------------------------------------------------------------- - !! ... exponent for calculating number density - !!----------------------------------------------------------------- - !n_exp = exp( -4.5_r8*log(sd_sulf)*log(sd_sulf) ) - - !dm_sulf = 2._r8 * rm_sulf - !dm_orgc = 2._r8 * rm_orgc - !dm_bc = 2._r8 * rm_bc - - !log_sd_sulf = log(sd_sulf) - !log_sd_orgc = log(sd_orgc) - !log_sd_bc = log(sd_bc) - - !reff_trop(:,:) = 0._r8 - - !ver_loop: do k = 1,pver - ! col_loop: do i = 1,ncol - ! !------------------------------------------------------------------------- - ! ! ... air density (kg/m3) - ! !------------------------------------------------------------------------- - ! rho_air = pmid(i,k)/(temp(i,k)*287.04_r8) - ! !------------------------------------------------------------------------- - ! ! ... aerosol growth interpolated from M.Chin's table - ! !------------------------------------------------------------------------- - ! if (relhum(i,k) >= table_rh(7)) then - ! rfac_sulf = table_rfac_sulf(7) - ! rfac_oc = table_rfac_oc(7) - ! rfac_bc = table_rfac_bc(7) - ! else - ! do irh = 2,7 - ! if (relhum(i,k) <= table_rh(irh)) then - ! exit - ! end if - ! end do - ! rh_l = irh-1 - ! rh_u = irh - - ! factor = (relhum(i,k) - table_rh(rh_l))/(table_rh(rh_u) - table_rh(rh_l)) - - ! rfac_sulf = table_rfac_sulf(rh_l) + factor*(table_rfac_sulf(rh_u) - table_rfac_sulf(rh_l)) - ! rfac_oc = table_rfac_oc(rh_u) + factor*(table_rfac_oc(rh_u) - table_rfac_oc(rh_l)) - ! rfac_bc = table_rfac_bc(rh_u) + factor*(table_rfac_bc(rh_u) - table_rfac_bc(rh_l)) - ! end if - - ! dm_sulf_wet = dm_sulf * rfac_sulf - ! dm_orgc_wet = dm_orgc * rfac_oc - ! dm_bc_wet = dm_bc * rfac_bc - - ! dm_bc_wet = min(dm_bc_wet ,50.e-6_r8) ! maximum size is 0.5 micron (Chin) - ! dm_orgc_wet = min(dm_orgc_wet,50.e-6_r8) ! maximum size is 0.5 micron (Chin) - - - ! !------------------------------------------------------------------------- - ! ! ... sulfate aerosols - ! !------------------------------------------------------------------------- - ! zero_aerosols = k < ltrop(i) - ! if ( abs( dlat(i) ) > 50._r8 ) then - ! zero_aerosols = pmid(i,k) < 30000._r8 - ! endif - ! !------------------------------------------------------------------------- - ! ! ... use ubvals climatology for stratospheric sulfate surface area density - ! !------------------------------------------------------------------------- - ! if( zero_aerosols ) then - ! sfc_sulf = strato_sad(i,k) - ! if ( het1_ndx > 0 ) then - ! sfc_sulf = 0._r8 ! reaction already taken into account in mo_strato_rates.F90 - ! end if - ! sfc_nit = 0._r8 - ! sfc_soa = 0._r8 - ! sfc_oc = 0._r8 - ! sfc_bc = 0._r8 - ! else - - ! if( so4_ndx > 0 ) then - ! !------------------------------------------------------------------------- - ! ! convert mass mixing ratio of aerosol to cm3/cm3 (cm^3_aerosol/cm^3_air) - ! ! v=volume density (m^3/m^3) - ! ! rho_aer=density of aerosol (kg/m^3) - ! ! v=m*rho_air/rho_aer [kg/kg * (kg/m3)_air/(kg/m3)_aer] - ! !------------------------------------------------------------------------- - ! v = mmr(i,k,so4_ndx) * rho_air/rho_sulf - ! !------------------------------------------------------------------------- - ! ! calculate the number density of aerosol (aerosols/cm3) - ! ! assuming a lognormal distribution - ! ! n = (aerosols/cm3) - ! ! dm = geometric mean diameter - ! ! - ! ! because only the dry mass of the aerosols is known, we - ! ! use the mean dry radius - ! !------------------------------------------------------------------------- - ! n = v * (6._r8/pi)*(1._r8/(dm_sulf**3._r8))*n_exp - ! !------------------------------------------------------------------------- - ! ! find surface area of aerosols using dm_wet, log_sd - ! ! (increase of sd due to RH is negligible) - ! ! and number density calculated above as distribution - ! ! parameters - ! ! sfc = surface area of wet aerosols (cm^2/cm^3) - ! !------------------------------------------------------------------------- - ! s_exp = exp(2._r8*log_sd_sulf*log_sd_sulf) - ! sfc_sulf = n * pi * (dm_sulf_wet**2._r8) * s_exp - - ! else - ! !------------------------------------------------------------------------- - ! ! if so4 not simulated, use off-line sulfate and calculate as above - ! ! convert sulfate vmr to volume density of aerosol (cm^3_aerosol/cm^3_air) - ! !------------------------------------------------------------------------- - ! v = sulfate(i,k) * m(i,k) * mw_so4 / (avo * rho_sulf) *1.e6_r8 - ! n = v * (6._r8/pi)*(1._r8/(dm_sulf**3._r8))*n_exp - ! s_exp = exp(2._r8*log_sd_sulf*log_sd_sulf) - ! sfc_sulf = n * pi * (dm_sulf_wet**2._r8) * s_exp - - ! end if - ! - ! !------------------------------------------------------------------------- - ! ! ammonium nitrate (follow same procedure as sulfate, using size and density of sulfate) - ! !------------------------------------------------------------------------- - ! if( nit_ndx > 0 ) then - ! v = mmr(i,k,nit_ndx) * rho_air/rho_sulf - ! n = v * (6._r8/pi)*(1._r8/(dm_sulf**3._r8))*n_exp - ! s_exp = exp(2._r8*log_sd_sulf*log_sd_sulf) - ! sfc_nit = n * pi * (dm_sulf_wet**2._r8) * s_exp - ! else - ! sfc_nit = 0._r8 - ! end if - - ! !------------------------------------------------------------------------- - ! ! hydrophylic organic carbon (follow same procedure as sulfate) - ! !------------------------------------------------------------------------- - ! if( oc2_ndx > 0 ) then - ! v = mmr(i,k,oc2_ndx) * rho_air/rho_orgc - ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3))*n_exp - ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) - ! sfc_oc = n * pi * (dm_orgc_wet**2._r8) * s_exp - ! else - ! sfc_oc = 0._r8 - ! end if - - ! !------------------------------------------------------------------------- - ! ! secondary organic carbon (follow same procedure as sulfate) - ! !------------------------------------------------------------------------- - ! if( soa_ndx > 0 ) then - ! v = mmr(i,k,soa_ndx) * rho_air/rho_orgc - ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp - ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) - ! sfc_soa = n * pi * (dm_orgc_wet**2._r8) * s_exp - ! else - ! sfc_soa = 0._r8 - ! end if - - ! !------------------------------------------------------------------------- - ! ! black carbon (follow same procedure as sulfate) - ! !------------------------------------------------------------------------- - ! if( cb2_ndx > 0 ) then - ! v = mmr(i,k,cb2_ndx) * rho_air/rho_bc - ! n = v * (6._r8/pi)*(1._r8/(dm_bc**3._r8))*n_exp - ! s_exp = exp(2._r8*log_sd_bc*log_sd_bc) - ! sfc_bc = n * pi * (dm_bc_wet**2._r8) * s_exp - ! else - ! sfc_bc = 0._r8 - ! end if - ! if( soai_ndx > 0 ) then - ! v = mmr(i,k,soai_ndx) * rho_air/rho_orgc - ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp - ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) - ! sfc_soai = n * pi * (dm_orgc_wet**2._r8) * s_exp - ! else - ! sfc_soai = 0._r8 - ! end if - ! if( soam_ndx > 0 ) then - ! v = mmr(i,k,soam_ndx) * rho_air/rho_orgc - ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp - ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) - ! sfc_soam = n * pi * (dm_orgc_wet**2._r8) * s_exp - ! else - ! sfc_soam = 0._r8 - ! end if - ! if( soab_ndx > 0 ) then - ! v = mmr(i,k,soab_ndx) * rho_air/rho_orgc - ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp - ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) - ! sfc_soab = n * pi * (dm_orgc_wet**2._r8) * s_exp - ! else - ! sfc_soab = 0._r8 - ! end if - ! if( soat_ndx > 0 ) then - ! v = mmr(i,k,soat_ndx) * rho_air/rho_orgc - ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp - ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) - ! sfc_soat = n * pi * (dm_orgc_wet**2._r8) * s_exp - ! else - ! sfc_soat = 0._r8 - ! end if - ! if( soax_ndx > 0 ) then - ! v = mmr(i,k,soax_ndx) * rho_air/rho_orgc - ! n = v * (6._r8/pi)*(1._r8/(dm_orgc**3._r8))*n_exp - ! s_exp = exp(2._r8*log_sd_orgc*log_sd_orgc) - ! sfc_soax = n * pi * (dm_orgc_wet**2._r8) * s_exp - ! else - ! sfc_soax = 0._r8 - ! end if - ! sfc_soa = sfc_soa + sfc_soai + sfc_soam + sfc_soab + sfc_soat + sfc_soax - - ! end if - - ! sfc(i,k,:) = (/ sfc_sulf, sfc_nit, sfc_oc, sfc_soa, sfc_bc /) - ! dm_aer(i,k,:) = (/ dm_sulf_wet,dm_sulf_wet,dm_orgc_wet,dm_orgc_wet,dm_bc_wet /) - - ! !------------------------------------------------------------------------- - ! ! ... add up total surface area density for output - ! !------------------------------------------------------------------------- - ! sad_total(i,k) = sfc_sulf + sfc_nit + sfc_oc + sfc_soa + sfc_bc - - ! enddo col_loop - !enddo ver_loop - - end subroutine aero_model_surfarea - - !------------------------------------------------------------------------- - ! stub - !------------------------------------------------------------------------- - subroutine aero_model_strat_surfarea( ncol, mmr, pmid, temp, ltrop, pbuf, strato_sad, reff_strat ) - - ! dummy args - integer, intent(in) :: ncol - real(r8), intent(in) :: mmr(:,:,:) - real(r8), intent(in) :: pmid(:,:) - real(r8), intent(in) :: temp(:,:) - integer, intent(in) :: ltrop(:) ! tropopause level indices - type(physics_buffer_desc), pointer :: pbuf(:) - real(r8), intent(out) :: strato_sad(:,:) - real(r8), intent(out) :: reff_strat(:,:) - - strato_sad(:,:) = 0._r8 - reff_strat(:,:) = 0._r8 - - end subroutine aero_model_strat_surfarea - - !============================================================================= - !============================================================================= - subroutine aero_model_gasaerexch( loffset, ncol, lchnk, troplev, delt, reaction_rates, & - tfld, pmid, pdel, mbar, relhum, & - zm, qh2o, cwat, cldfr, cldnum, & - airdens, invariants, del_h2so4_gasprod, & - vmr0, vmr, pbuf ) - - use chem_mods, only : gas_pcnst - !use mo_aerosols, only : aerosols_formation, has_aerosols - !use mo_setsox, only : setsox, has_sox - !use mo_setsoa, only : setsoa, has_soa - - !----------------------------------------------------------------------- - ! ... dummy arguments - !----------------------------------------------------------------------- - integer, intent(in) :: loffset ! offset applied to modal aero "pointers" - integer, intent(in) :: ncol ! number columns in chunk - integer, intent(in) :: lchnk ! chunk index - integer, intent(in) :: troplev(:) - real(r8), intent(in) :: delt ! time step size (sec) - real(r8), intent(in) :: reaction_rates(:,:,:) ! reaction rates - real(r8), intent(in) :: tfld(:,:) ! temperature (K) - real(r8), intent(in) :: pmid(:,:) ! pressure at model levels (Pa) - real(r8), intent(in) :: pdel(:,:) ! pressure thickness of levels (Pa) - real(r8), intent(in) :: mbar(:,:) ! mean wet atmospheric mass ( amu ) - real(r8), intent(in) :: relhum(:,:) ! relative humidity - real(r8), intent(in) :: airdens(:,:) ! total atms density (molec/cm**3) - real(r8), intent(in) :: invariants(:,:,:) - real(r8), intent(in) :: del_h2so4_gasprod(:,:) - real(r8), intent(in) :: zm(:,:) - real(r8), intent(in) :: qh2o(:,:) - real(r8), intent(in) :: cwat(:,:) ! cloud liquid water content (kg/kg) - real(r8), intent(in) :: cldfr(:,:) - real(r8), intent(in) :: cldnum(:,:) ! droplet number concentration (#/kg) - real(r8), intent(in) :: vmr0(:,:,:) ! initial mixing ratios (before gas-phase chem changes) - real(r8), intent(inout) :: vmr(:,:,:) ! mixing ratios ( vmr ) - - type(physics_buffer_desc), pointer :: pbuf(:) - - !! local vars - - !real(r8) :: vmrcw(ncol,pver,gas_pcnst) ! cloud-borne aerosol (vmr) - - !real(r8) :: aqso4(ncol,1) ! aqueous phase chemistry - !real(r8) :: aqh2so4(ncol,1) ! aqueous phase chemistry - !real(r8) :: aqso4_h2o2(ncol) ! SO4 aqueous phase chemistry due to H2O2 - !real(r8) :: aqso4_o3(ncol) ! SO4 aqueous phase chemistry due to O3 - !real(r8) :: xphlwc(ncol,pver) ! pH value multiplied by lwc - - - ! !aqueous chemistry ... - - !if( has_sox ) then - ! call setsox( & - ! ncol, & - ! lchnk, & - ! loffset, & - ! delt, & - ! pmid, & - ! pdel, & - ! tfld, & - ! mbar, & - ! cwat, & - ! cldfr, & - ! cldnum, & - ! airdens, & - ! invariants, & - ! vmrcw, & - ! vmr, & - ! xphlwc, & - ! aqso4, & - ! aqh2so4, & - ! aqso4_h2o2,& - ! aqso4_o3 & - ! ) - ! call outfld( 'XPH_LWC',xphlwc(:ncol,:), ncol , lchnk ) - !endif - - !if( has_soa ) then - ! call setsoa( ncol, lchnk, delt, reaction_rates, tfld, airdens, vmr, pbuf) - !endif - - !if( has_aerosols ) then - ! call aerosols_formation( ncol, lchnk, tfld, relhum, vmr ) - !endif - - - end subroutine aero_model_gasaerexch - - !============================================================================= - !============================================================================= - subroutine aero_model_emissions( state, cam_in ) - !use seasalt_model, only: seasalt_emis, seasalt_indices - !use dust_model, only: dust_emis, dust_indices - use physics_types, only: physics_state - - ! Arguments: - - type(physics_state), intent(in) :: state ! Physics state variables - type(cam_in_t), intent(inout) :: cam_in ! import state - - !! local vars - - !integer :: lchnk, ncol - !integer :: m, mm - !real(r8) :: soil_erod_tmp(pcols) - !real(r8) :: sflx(pcols) ! accumulate over all bins for output - !real(r8) :: u10cubed(pcols) - !real (r8), parameter :: z0=0.0001_r8 ! m roughness length over oceans--from ocean model - - !lchnk = state%lchnk - !ncol = state%ncol - - !if (dust_active) then - - ! call dust_emis( ncol, lchnk, cam_in%dstflx, cam_in%cflx, soil_erod_tmp ) - - ! ! some dust emis diagnostics ... - ! sflx(:)=0._r8 - ! do m=1,dust_nbin - ! mm = dust_indices(m) - ! sflx(:ncol)=sflx(:ncol)+cam_in%cflx(:ncol,mm) - ! call outfld(trim(dust_names(m))//'SF',cam_in%cflx(:,mm),pcols, lchnk) - ! enddo - ! call outfld('DSTSFMBL',sflx(:),pcols,lchnk) - ! call outfld('LND_MBL',soil_erod_tmp(:),pcols, lchnk ) - !endif - - !if (sslt_active) then - ! u10cubed(:ncol)=sqrt(state%u(:ncol,pver)**2+state%v(:ncol,pver)**2) - ! ! move the winds to 10m high from the midpoint of the gridbox: - ! ! follows Tie and Seinfeld and Pandis, p.859 with math. - - ! u10cubed(:ncol)=u10cubed(:ncol)*log(10._r8/z0)/log(state%zm(:ncol,pver)/z0) - - ! ! we need them to the 3.41 power, according to Gong et al., 1997: - ! u10cubed(:ncol)=u10cubed(:ncol)**3.41_r8 - - ! sflx(:)=0._r8 - - ! call seasalt_emis( u10cubed, cam_in%sst, cam_in%ocnfrac, ncol, cam_in%cflx ) - - ! do m=1,seasalt_nbin - ! mm = seasalt_indices(m) - ! sflx(:ncol)=sflx(:ncol)+cam_in%cflx(:ncol,mm) - ! call outfld(trim(seasalt_names(m))//'SF',cam_in%cflx(:,mm),pcols,lchnk) - ! enddo - ! call outfld('SSTSFMBL',sflx(:),pcols,lchnk) - !endif - - end subroutine aero_model_emissions - -end module aero_model diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/pp_geoschem/chem_mods.F90 index af430ac0ca..f43e2d1fa6 100644 --- a/src/chemistry/pp_geoschem/chem_mods.F90 +++ b/src/chemistry/pp_geoschem/chem_mods.F90 @@ -7,26 +7,43 @@ module chem_mods implicit none save - INTEGER, PARAMETER :: nTracersMax = 200 ! Must be equal to nadv_chem - INTEGER :: nTracers - CHARACTER(LEN=255) :: tracerNames(nTracersMax) - CHARACTER(LEN=255) :: tracerLongNames(nTracersMax) - REAL(r8) :: adv_Mass(nTracersMax) - REAL(r8) :: MWRatio(nTracersMax) - REAL(r8) :: ref_MMR(nTracersMax) + INTEGER, PARAMETER :: nTracersMax = 220 ! Must be equal to chem_nadv + INTEGER :: nTracers + CHARACTER(LEN=255) :: tracerNames(nTracersMax) + CHARACTER(LEN=255) :: tracerLongNames(nTracersMax) + REAL(r8) :: adv_Mass(nTracersMax) + REAL(r8) :: MWRatio(nTracersMax) + REAL(r8) :: ref_MMR(nTracersMax) ! Short-lived species (i.e. not advected) - INTEGER, PARAMETER :: nSlsMax = 500 ! UNadvected species only - INTEGER :: nSls - CHARACTER(LEN=255) :: slsNames(nSlsMax) - CHARACTER(LEN=255) :: slsLongnames(nSlsMax) - REAL(r8) :: sls_Ref_MMR(nSlsMax) - REAL(r8) :: slsMWRatio(nSlsMax) + INTEGER, PARAMETER :: nSlsMax = 500 ! UNadvected species only + INTEGER :: nSls + CHARACTER(LEN=255) :: slsNames(nSlsMax) + CHARACTER(LEN=255) :: slsLongnames(nSlsMax) + REAL(r8) :: sls_Ref_MMR(nSlsMax) + REAL(r8) :: slsMWRatio(nSlsMax) ! Mapping between constituents and GEOS-Chem tracers INTEGER :: map2GC(pcnst) INTEGER :: map2GC_Sls(nSlsMax) + ! Mapping from constituents to raw index + INTEGER :: map2Idx(pcnst) + + ! Aerosols + INTEGER, PARAMETER :: nAerMax = 35 + INTEGER :: nAer + CHARACTER(LEN=16) :: aerNames(nAerMax) + REAL(r8) :: aerAdvMass(nAerMax) + + !----------------------------- + ! Aerosol index mapping + !----------------------------- + ! map2MAM4 maps aerNames onto the GEOS-Chem Species array such + ! that + ! State_Chm%Species(1,:,:,map2MAM4(:,:)) = state%q(:,:,MAM4_Indices) + INTEGER, ALLOCATABLE :: map2MAM4(:,:) + !----------------------------- ! Dry deposition index mapping !----------------------------- @@ -39,16 +56,12 @@ module chem_mods ! State_Chm%DryDepVel(1,:,map2GC_dryDep(:)) = cam_in%depVel(:,:) INTEGER, ALLOCATABLE :: map2GC_dryDep(:) - - ! Mapping from constituents to raw index - INTEGER :: map2Idx(pcnst) - INTEGER, PARAMETER :: phtcnt = 40, & ! number of photolysis reactions rxntot = 212, & ! number of total reactions gascnt = 172, & ! number of gas phase reactions nabscol = 2, & ! number of absorbing column densities gas_pcnst = 103, & ! number of "gas phase" species - nfs = 4, & ! number of "fixed" species + nfs = 6, & ! number of "fixed" species relcnt = 0, & ! number of relationship species grpcnt = 0, & ! number of group members nzcnt = 824, & ! number of non-zero matrix entries diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index cea6529edf..4843ca6c15 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -3,7 +3,7 @@ !================================================================================================ module chemistry - use shr_kind_mod, only: r8 => shr_kind_r8 + use shr_kind_mod, only: r8 => shr_kind_r8, shr_kind_cl use physics_types, only: physics_state, physics_ptend, physics_ptend_init use ppgrid, only: begchunk, endchunk, pcols use ppgrid, only: pver, pverp @@ -35,7 +35,7 @@ module chemistry !----------------------------------------------------------------- USE PRECISION_MOD, ONLY : fp, f4 ! Flexible precision - use Chem_Mods, only : nSlvd, slvd_Lst, slvd_ref_MMR + use chem_mods, only : nSlvd, slvd_Lst, slvd_ref_MMR ! Exit routine in CAM use cam_abortutils, only : endrun @@ -46,16 +46,21 @@ module chemistry use chem_mods, only : tracerLongNames use chem_mods, only : adv_Mass use chem_mods, only : mwRatio - use chem_mods, only : ref_mmr + use chem_mods, only : ref_MMR use chem_mods, only : nSlsMax use chem_mods, only : nSls use chem_mods, only : slsNames use chem_mods, only : slsLongNames use chem_mods, only : sls_ref_MMR use chem_mods, only : slsmwRatio + use chem_mods, only : nAerMax + use chem_mods, only : nAer + use chem_mods, only : aerNames + use chem_mods, only : aerAdvMass use chem_mods, only : map2GC use chem_mods, only : map2GC_Sls use chem_mods, only : map2Idx + use chem_mods, only : map2MAM4 IMPLICIT NONE PRIVATE @@ -125,12 +130,24 @@ module chemistry #define LANDTYPE_HEMCO 0 #define LANDTYPE_CLM 1 -#if ( OCNDDVEL_MOZART ) ! Filenames to compute dry deposition velocities similarly to MOZART - CHARACTER(LEN=255) :: MOZART_depvel_lnd_file = 'depvel_lnd_file' - CHARACTER(LEN=255) :: MOZART_clim_soilw_file = 'clim_soilw_file' - CHARACTER(LEN=255) :: MOZART_season_wes_file = 'season_wes_file' -#endif + character(len=shr_kind_cl) :: clim_soilw_file = 'clim_soilw_file' + character(len=shr_kind_cl) :: depvel_file = '' + character(len=shr_kind_cl) :: depvel_lnd_file = 'depvel_lnd_file' + character(len=shr_kind_cl) :: season_wes_file = 'season_wes_file' + + character(len=shr_kind_cl) :: srf_emis_specifier(pcnst) = '' + character(len=shr_kind_cl) :: ext_frc_specifier(pcnst) = '' + + character(len=24) :: srf_emis_type = 'CYCLICAL' ! 'CYCLICAL' | 'SERIAL' | 'INTERP_MISSING_MONTHS' + integer :: srf_emis_cycle_yr = 0 + integer :: srf_emis_fixed_ymd = 0 + integer :: srf_emis_fixed_tod = 0 + + character(len=24) :: ext_frc_type = 'CYCLICAL' ! 'CYCLICAL' | 'SERIAL' | 'INTERP_MISSING_MONTHS' + integer :: ext_frc_cycle_yr = 0 + integer :: ext_frc_fixed_ymd = 0 + integer :: ext_frc_fixed_tod = 0 !================================================================================================ contains @@ -164,6 +181,12 @@ subroutine chem_register use Species_Mod, only : Species use mo_sim_dat, only : set_sim_dat +#if defined( MODAL_AERO_4MODE ) + use aero_model, only : aero_model_register + use modal_aero_data, only : nspec_max + use modal_aero_data, only : ntot_amode, nspec_amode + use modal_aero_data, only : xname_massptr +#endif !----------------------------------------------------------------------- ! @@ -171,26 +194,26 @@ subroutine chem_register ! !----------------------------------------------------------------------- ! Need to generate a temporary species database - Type(ChmState) :: SC - Type(GrdState) :: SG - Type(OptInput) :: IO - TYPE(Species), POINTER :: ThisSpc - - INTEGER :: I, N, M - REAL(r8) :: cptmp - REAL(r8) :: mwtmp - REAL(r8) :: qmin - REAL(r8) :: ref_VMR - CHARACTER(LEN=128) :: mixtype - CHARACTER(LEN=128) :: molectype - CHARACTER(LEN=128) :: lng_Name - CHARACTER(LEN=64) :: cnstName - LOGICAL :: camout - LOGICAL :: ic_from_cam2 - LOGICAL :: has_fixed_ubc - LOGICAL :: has_fixed_ubflx - - INTEGER :: RC + Type(ChmState) :: SC + Type(GrdState) :: SG + Type(OptInput) :: IO + TYPE(Species), POINTER :: ThisSpc + + INTEGER :: I, N, M, L + REAL(r8) :: cptmp + REAL(r8) :: MWTmp + REAL(r8) :: qmin + REAL(r8) :: ref_VMR + CHARACTER(LEN=128) :: mixtype + CHARACTER(LEN=128) :: molectype + CHARACTER(LEN=128) :: lngName + CHARACTER(LEN=64) :: cnstName + LOGICAL :: camout + LOGICAL :: ic_from_cam2 + LOGICAL :: has_fixed_ubc + LOGICAL :: has_fixed_ubflx + + INTEGER :: RC, IERR ! SDE 2018-05-02: This seems to get called before anything else ! that includes CHEM_INIT @@ -199,12 +222,12 @@ subroutine chem_register ! set_sim_dat which is in pp_[mechanism]/mo_sim_dat.F90. That sets a lot of ! data in other places, notably in "chem_mods" - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_REGISTER' + IF ( MasterProc ) Write(iulog,'(a)') 'GCCALL CHEM_REGISTER' ! hplin 2020-05-16: Call set_sim_dat to populate chemistry constituent information ! from mo_sim_dat.F90 in other places. This is needed for HEMCO_CESM. - call set_sim_dat() - if(masterproc) write(iulog,*) 'GCCALL after set_sim_dat' + CALL Set_sim_dat() + IF ( MasterProc ) Write(iulog,*) 'GCCALL after set_sim_dat' ! Generate fake state_chm IO%Max_BPCH_Diag = 1000 @@ -266,7 +289,8 @@ subroutine chem_register CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - ! At the moment, we force nadv_chem=200 in the setup file + + ! At the moment, we force chem_nadv=220 in the setup file ! Default map2GC = -1 ref_MMR(:) = 0.0e+0_r8 @@ -274,22 +298,73 @@ subroutine chem_register tracerLongNames = '' DO I = 1, nTracersMax - IF (I.LE.nTracers) THEN - N = Ind_(tracerNames(I)) + IF ( I .LE. nTracers ) THEN + cnstName = TRIM(tracerNames(I)) + N = Ind_(cnstName) ThisSpc => SC%SpcData(N)%Info - lng_Name = TRIM(ThisSpc%FullName) + lngName = TRIM(ThisSpc%FullName) MWTmp = REAL(ThisSpc%MW_g,r8) ref_VMR = REAL(ThisSpc%BackgroundVV,r8) adv_Mass(I) = MWTmp ref_MMR(I) = ref_VMR / (MWDry / MWTmp) + IF ( ThisSpc%Is_Gas == .FALSE. ) THEN + Write(cnstName, "(a,a)") 'GC_AER_', TRIM(tracerNames(I)) + ! Aerosols that inherited from MAM do not need to be defined as a + ! constituent + ! For instance, + ! - SOAGX is inherited from SOAG[0-4], + ! + ! List of GEOS-Chem aerosols: + ! DMS + ! SO4 + ! SO4s + ! MSA + ! NH4 + ! NIT + ! NITs + ! BCPI + ! OCPI + ! BCPO + ! OCPO + ! DST[1-4] + ! SALA + ! SALC + ! TSOA[0-3] + ! ASOAN + ! ASOA[1-3] + ! SOAS + ! SOAIE + ! SOAME + ! SOAGX + ! SOAMG + ! LVOCOA + ! ISN1OA + ! IONITA + ! MONITA + ! INDIOL + ! BrSALA + ! BrSALC + ! ISALA + ! ISALC + ! AERI + ! pFe + ENDIF + ELSEIF ( I .LE. (nTracers + nAer)) THEN + ! Add MAM4 aerosols + cnstName = TRIM(aerNames(I - nTracers)) + lngName = cnstName + MWTmp = aerAdvMass(I - nTracers) + adv_Mass(I) = MWTmp + ref_MMR(I) = 1.0e-38_r8 ELSE - lng_Name = TRIM(tracerNames(I)) + cnstName = TRIM(tracerNames(I)) + lngName = cnstName MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) adv_Mass(I) = MWTmp ref_MMR(I) = 1.0e-38_r8 ENDIF MWRatio(I) = MWDry/MWTmp - tracerLongNames(I) = TRIM(lng_Name) + tracerLongNames(I) = TRIM(lngName) ! dummy value for specific heat of constant pressure (Cp) cptmp = 666._r8 @@ -309,7 +384,6 @@ subroutine chem_register has_fixed_ubflx = .false. ! NOTE: In MOZART, this only gets called for tracers ! This is the call to add a "constituent" - cnstName = TRIM(tracerNames(I)) ! Special handlings IF ( cnstName == 'ACET' ) THEN cnstName = 'CH3COCH3' @@ -342,6 +416,7 @@ subroutine chem_register ELSEIF ( cnstName == 'HCHO' ) THEN cnstName = 'CH2O' ENDIF + If ( MasterProc ) Write(iulog,*) " Species = ", TRIM(cnstName) ! GEOS-Chem lumped species are not on restart file. ! Bromine, chlorine, iodine and halons species are missing ! from CESM restart file. @@ -353,7 +428,7 @@ subroutine chem_register cam_outfld=camout, molectype=molectype, & fixed_ubc=has_fixed_ubc, & fixed_ubflx=has_fixed_ubflx, & - longname=TRIM(lng_Name) ) + longname=TRIM(lngName) ) ! Add to GC mapping. When starting a timestep, we will want to update the ! concentration of State_Chm(x)%Species(1,iCol,iLev,m) with data from @@ -378,8 +453,8 @@ subroutine chem_register ThisSpc => SC%SpcData(N)%Info MWTmp = REAL(ThisSpc%MW_g,r8) ref_VMR = REAL(ThisSpc%BackgroundVV,r8) - lng_Name = TRIM(ThisSpc%FullName) - slsLongNames(I) = lng_Name + lngName = TRIM(ThisSpc%FullName) + slsLongNames(I) = lngName sls_ref_MMR(I) = ref_VMR / (MWDry / MWTmp) SlsMWRatio(I) = MWDry / MWTmp map2GC_Sls(I) = N @@ -393,6 +468,109 @@ subroutine chem_register ! More information: ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html +#if defined( MODAL_AERO_4MODE ) + ! add fields to pbuf needed by aerosol models + CALL aero_model_register() + + ! Mode | \sigma_g | Dry diameter (micrometers) + ! -----------------------|----------|-------------------------- + ! a2 - Aitken mode | 1.6 | 0.015 - 0.053 + ! a1 - Accumulation mode | 1.8 | 0.058 - 0.27 + ! a3 - Coarse mode | 1.8 | 0.80 - 3.65 + ! a4 - Primary carbon | 1.6 | 0.039 - 0.13 + ! -----------------------|----------|-------------------------- + ! Ref: Liu, Xiaohong, et al. "Toward a minimal representation of aerosols in + ! climate models: Description and evaluation in the Community Atmosphere + ! Model CAM5." Geoscientific Model Development 5.3 (2012): 709. + + ALLOCATE(map2MAM4(nspec_max,ntot_amode), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate map2MAM4') + + ! Initialize indices + map2MAM4(:,:) = -1 + + DO M = 1, ntot_amode + DO L = 1, nspec_amode(M) + SELECT CASE ( to_upper(xname_massptr(L,M)(:3)) ) + CASE ( 'BC_' ) + map2MAM4(L,M) = Ind_('BCPI') + CASE ( 'DST' ) + SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) ) + ! DST1 - Dust aerosol, Reff = 0.7 micrometers + ! DST2 - Dust aerosol, Reff = 1.4 micrometers + ! DST3 - Dust aerosol, Reff = 2.4 micrometers + ! DST4 - Dust aerosol, Reff = 4.5 micrometers + CASE ( 'A1' ) + map2MAM4(L,M) = Ind_('DST1') + CASE ( 'A2' ) + map2MAM4(L,M) = Ind_('DST1') + CASE ( 'A3' ) + map2MAM4(L,M) = Ind_('DST4') + END SELECT + CASE ( 'SOA' ) + SELECT CASE ( to_upper(xname_massptr(L,M)(4:4)) ) + CASE ( '1' ) + SELECT CASE ( to_upper(xname_massptr(L,M)(6:7)) ) + CASE ( 'A1' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + CASE ( 'A2' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + END SELECT + CASE ( '2' ) + SELECT CASE ( to_upper(xname_massptr(L,M)(6:7)) ) + CASE ( 'A1' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + CASE ( 'A2' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + END SELECT + CASE ( '3' ) + SELECT CASE ( to_upper(xname_massptr(L,M)(6:7)) ) + CASE ( 'A1' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + CASE ( 'A2' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + END SELECT + CASE ( '4' ) + SELECT CASE ( to_upper(xname_massptr(L,M)(6:7)) ) + CASE ( 'A1' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + CASE ( 'A2' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + END SELECT + CASE ( '5' ) + SELECT CASE ( to_upper(xname_massptr(L,M)(6:7)) ) + CASE ( 'A1' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + CASE ( 'A2' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + END SELECT + END SELECT + CASE ( 'SO4' ) + map2MAM4(L,M) = Ind_('SO4') + CASE ( 'NCL' ) + SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) ) + ! SALA - Fine (0.01-0.05 micros) sea salt aerosol + ! SALC - Coarse (0.5-8 micros) sea salt aerosol + CASE ( 'A1' ) + map2MAM4(L,M) = Ind_('SALA') + CASE ( 'A2' ) + map2MAM4(L,M) = Ind_('SALA') + CASE ( 'A3' ) + map2MAM4(L,M) = Ind_('SALC') + END SELECT + CASE ( 'POM' ) + SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) ) + CASE ( 'A1' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + CASE ( 'A4' ) + map2MAM4(L,M) = -1 !TMMF, Fill in + END SELECT + END SELECT + ENDDO + ENDDO + +#endif + ! Clean up Call Cleanup_State_Chm ( .False., SC, RC ) Call Cleanup_State_Grid( .False., SG, RC ) @@ -407,6 +585,11 @@ subroutine chem_readnl(nlfile) use cam_abortutils, only : endrun use units, only : getunit, freeunit + use namelist_utils, only : find_group_name +#if defined( MODAL_AERO_4MODE ) + use aero_model, only : aero_model_readnl + use dust_model, only : dust_readnl +#endif use mpishorthand use gckpp_Model, only : nSpec, Spc_Names use mo_chem_utls, only : get_spc_ndx @@ -422,11 +605,18 @@ subroutine chem_readnl(nlfile) LOGICAL :: menuFound LOGICAL :: validSLS -#if ( OCNDDVEL_MOZART ) - namelist /chem_inparm/ MOZART_depvel_lnd_file, & - MOZART_clim_soilw_file, & - MOZART_season_wes_file -#endif + ! The following files are required to compute land maps, required to perform + ! aerosol dry deposition + namelist /chem_inparm/ clim_soilw_file, & + depvel_file, & + depvel_lnd_file, & + ext_frc_cycle_yr, & + ext_frc_specifier, & + ext_frc_type, & + season_wes_file, & + srf_emis_cycle_yr, & + srf_emis_specifier, & + srf_emis_type nIgnored = 0 @@ -440,7 +630,7 @@ subroutine chem_readnl(nlfile) #if ( ALLDDVEL_GEOSCHEM + OCNDDVEL_GEOSCHEM + OCNDDVEL_MOZART != 1 ) - IF (MasterProc) THEN + IF ( MasterProc ) THEN Write(iulog,'(/,a)') REPEAT( "=", 79 ) Write(iulog,'(a)') " Preprocessor flags are not set correctly in chemistry.F90" Write(iulog,'(a)') " The user needs to decide how to compute dry deposition velocities" @@ -468,7 +658,7 @@ subroutine chem_readnl(nlfile) ENDIF #endif #if ( ALLDDVEL_GEOSCHEM && ( LANDTYPE_HEMCO + LANDTYPE_CLM != 1 ) ) - IF (MasterProc) THEN + IF ( MasterProc ) THEN Write(iulog,'(/,a)') REPEAT( "=", 79 ) Write(iulog,'(a)') REPEAT( "=", 79 ) Write(iulog,'(a)') " Preprocessor flags are not set correctly in chemistry.F90" @@ -481,7 +671,47 @@ subroutine chem_readnl(nlfile) ALLOCATE(drySpc_ndx(nddvels), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate drySpc_ndx') - IF (MasterProc) THEN +#if defined( MODAL_AERO_4MODE ) + !============================================================== + ! Get names and molar weights of aerosols in MAM4 + !============================================================== + + nAer = 33 + + aerNames(:nAer) = (/ 'bc_a1 ','bc_a4 ','dst_a1 ', & + 'dst_a2 ','dst_a3 ','ncl_a1 ', & + 'ncl_a2 ','ncl_a3 ','num_a1 ', & + 'num_a2 ','num_a3 ','num_a4 ', & + 'pom_a1 ','pom_a4 ','so4_a1 ', & + 'so4_a2 ','so4_a3 ','soa1_a1 ', & + 'soa1_a2 ','soa2_a1 ','soa2_a2 ', & + 'soa3_a1 ','soa3_a2 ','soa4_a1 ', & + 'soa4_a2 ','soa5_a1 ','soa5_a2 ', & + 'H2SO4 ','SOAG0 ','SOAG1 ', & + 'SOAG2 ','SOAG3 ','SOAG4 ' /) + + aerAdvMass(:nAer) = (/ 12.011000_r8, 12.011000_r8, 135.064039_r8, & + 135.064039_r8, 135.064039_r8, 58.442468_r8, & + 58.442468_r8, 58.442468_r8, 1.007400_r8, & + 1.007400_r8, 1.007400_r8, 1.007400_r8, & + 12.011000_r8, 12.011000_r8, 115.107340_r8, & + 115.107340_r8, 115.107340_r8, 250.445000_r8, & + 250.445000_r8, 250.445000_r8, 250.445000_r8, & + 250.445000_r8, 250.445000_r8, 250.445000_r8, & + 250.445000_r8, 250.445000_r8, 250.445000_r8, & + 98.078400_r8, 250.445000_r8, 250.445000_r8, & + 250.445000_r8, 250.445000_r8, 250.445000_r8 /) + + CALL aero_model_readnl(nlfile) + CALL dust_readnl(nlfile) +#endif + + DO I = (nAer+1), nAerMax + aerNames(I) = 'EMPTY_AER ' + aerAdvMass(I) = -1.00_r8 + ENDDO + + IF ( MasterProc ) THEN Write(iulog,'(/,a)') REPEAT( '=', 50 ) Write(iulog,'(a)') REPEAT( '=', 50 ) @@ -495,13 +725,13 @@ subroutine chem_readnl(nlfile) Write(iulog,'(/,/, a)') 'Now defining GEOS-Chem tracers and dry deposition mapping...' - UNITN = GETUNIT() + unitn = getunit() !============================================================== ! Opening input.geos and go to ADVECTED SPECIES MENU !============================================================== - OPEN( UNITN, FILE=TRIM(inputGeosPath), STATUS='OLD', IOSTAT=IERR ) + OPEN( unitn, FILE=TRIM(inputGeosPath), STATUS='OLD', IOSTAT=IERR ) IF (IERR .NE. 0) THEN CALL ENDRUN('chem_readnl: ERROR opening input.geos') ENDIF @@ -509,7 +739,7 @@ subroutine chem_readnl(nlfile) ! Go to ADVECTED SPECIES MENU menuFound = .False. DO WHILE ( .NOT. menuFound ) - READ( UNITN, '(a)', IOSTAT=IERR ) line + READ( unitn, '(a)', IOSTAT=IERR ) line IF ( IERR .NE. 0 ) THEN CALL ENDRUN('chem_readnl: ERROR finding advected species menu') ELSEIF ( INDEX(line, 'ADVECTED SPECIES MENU') > 0 ) THEN @@ -523,7 +753,7 @@ subroutine chem_readnl(nlfile) DO ! Read line - READ(UNITN,'(26x,a)', IOSTAT=IERR) line + READ(unitn,'(26x,a)', IOSTAT=IERR) line IF ( INDEX( TRIM(line), '---' ) > 0 ) EXIT @@ -532,8 +762,8 @@ subroutine chem_readnl(nlfile) ENDDO - CLOSE(UNITN) - CALL FREEUNIT(UNITN) + CLOSE(unitn) + CALL freeunit(unitn) ! Assign remaining tracers dummy names DO I = (nTracers+1), nTracersMax @@ -595,20 +825,39 @@ subroutine chem_readnl(nlfile) Write(iulog,'( a)') '+ List of advected species: ' Write(iulog,100) 'ID', 'Tracer', 'Dry deposition (T/F)' DO N = 1, nTracers - WRITE(iulog,110) N, TRIM(tracerNames(N)), any(drySpc_ndx .eq. N) + Write(iulog,120) N, TRIM(tracerNames(N)), ANY(drySpc_ndx .eq. N) ENDDO - + IF ( nAer > 0 ) THEN + Write(iulog,'(/, a)') '+ List of aerosols: ' + Write(iulog,110) 'ID', 'MAM4 Aerosol' + DO N = 1, nAer + Write(iulog,130) N, TRIM(aerNames(N)) + ENDDO + ENDIF Write(iulog,'(/, a)') '+ List of short-lived species: ' DO N = 1, nSls - WRITE(iulog,120) N, TRIM(slsNames(N)) + Write(iulog,130) N, TRIM(slsNames(N)) ENDDO 100 FORMAT( 1x, A3, 3x, A10, 1x, A25 ) - 110 FORMAT( 1x, I3, 3x, A10, 1x, L15 ) - 120 FORMAT( 1x, I3, 3x, A10 ) + 110 FORMAT( 1x, A3, 3x, A15 ) + 120 FORMAT( 1x, I3, 3x, A10, 1x, L15 ) + 130 FORMAT( 1x, I3, 3x, A10 ) !============================================================== + unitn = getunit() + OPEN( unitn, FILE=TRIM(nlfile), STATUS='old' ) + CALL find_group_name(unitn, 'chem_inparm', STATUS=IERR) + IF (IERR == 0) THEN + READ(unitn, chem_inparm, IOSTAT=IERR) + IF (IERR /= 0) THEN + CALL endrun('chem_readnl: ERROR reading namelist') + ENDIF + ENDIF + CLOSE(unitn) + CALL freeunit(unitn) + ENDIF !================================================================== @@ -616,23 +865,17 @@ subroutine chem_readnl(nlfile) !================================================================== #if defined( SPMD ) - CALL MPIBCAST(nTracers, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) - CALL MPIBCAST(nSls, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) - CALL MPIBCAST(drySpc_ndx, nddvels, MPIINT, 0, MPICOM ) - -#if ( OCNDDVEL_MOZART ) - !============================================================== - ! The following lines should only be called if we compute - ! velocities over the ocean and ice in a MOZART-like way. - ! Thibaud M. Fritz - 26 Feb 2020 - !============================================================== - - CALL MPIBCAST(MOZART_depvel_lnd_file, LEN(MOZART_depvel_lnd_file), MPICHAR, 0, MPICOM) - CALL MPIBCAST(MOZART_clim_soilw_file, LEN(MOZART_clim_soilw_file), MPICHAR, 0, MPICOM) - CALL MPIBCAST(MOZART_season_wes_file, LEN(MOZART_season_wes_file), MPICHAR, 0, MPICOM) -#endif + CALL MPIBCAST( nTracers, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST( tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST( nSls, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST( slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST( drySpc_ndx, nddvels, MPIINT, 0, MPICOM ) + + ! The following files are required to compute land maps, required to perform + ! aerosol dry deposition + CALL MPIBCAST(depvel_lnd_file, LEN(depvel_lnd_file), MPICHAR, 0, MPICOM) + CALL MPIBCAST(clim_soilw_file, LEN(clim_soilw_file), MPICHAR, 0, MPICOM) + CALL MPIBCAST(season_wes_file, LEN(season_wes_file), MPICHAR, 0, MPICOM) #endif @@ -696,13 +939,28 @@ subroutine chem_init(phys_state, pbuf2d) ! (and declare history variables) ! !----------------------------------------------------------------------- - use physics_buffer, only: physics_buffer_desc, pbuf_get_index - use cam_history, only: addfld, add_default, horiz_only - use chem_mods, only: map2GC_dryDep, drySpc_ndx + use physics_buffer, only : physics_buffer_desc, pbuf_get_index + use cam_history, only : addfld, add_default, horiz_only + use chem_mods, only : map2GC_dryDep, drySpc_ndx use mpishorthand use cam_abortutils, only : endrun + use Phys_Grid, only : get_Area_All_p + use hycoef, only : ps0, hyai, hybi + + use seq_drydep_mod, only : drydep_method, DD_XLND +#if ( OCNDDVEL_MOZART ) + use mo_drydep, only : drydep_inti +#endif + +#if defined( MODAL_AERO_4MODE ) + use aero_model, only : aero_model_init + use mo_drydep, only : drydep_inti_landuse + use modal_aero_data,only : ntot_amode, nspec_amode + use modal_aero_data,only : xname_massptr +#endif + use Input_Opt_Mod use State_Chm_Mod use State_Grid_Mod @@ -712,11 +970,7 @@ subroutine chem_init(phys_state, pbuf2d) use GC_Grid_Mod, only : SetGridFromCtrEdges ! Use GEOS-Chem versions of physical constants - use PhysConstants, only : PI, PI_180 - use PhysConstants, only : Re - - use Phys_Grid, only : get_Area_All_p - use hycoef, only : ps0, hyai, hybi + use PhysConstants, only : PI, PI_180, Re use Time_Mod, only : Accept_External_Date_Time !use Time_Mod, only : Set_Begin_Time, Set_End_Time @@ -724,11 +978,6 @@ subroutine chem_init(phys_state, pbuf2d) !use Transfer_Mod, only : Init_Transfer use Linoz_Mod, only : Linoz_Read -#if ( OCNDDVEL_MOZART ) - use seq_drydep_mod, only: drydep_method, DD_XLND - use mo_drydep, only: drydep_inti -#endif - use CMN_Size_Mod use Drydep_Mod, only : Init_Drydep, DepName, nDVZind @@ -746,7 +995,6 @@ subroutine chem_init(phys_state, pbuf2d) use Olson_Landmap_Mod #endif use Mixing_Mod - use PBL_Mix_Mod, only : Init_PBL_Mix use GC_Emissions_Mod, only : GC_Emissions_Init @@ -767,7 +1015,7 @@ subroutine chem_init(phys_state, pbuf2d) INTEGER :: iX, jY INTEGER :: I, J, L, N INTEGER :: RC - INTEGER :: NLINOZ + INTEGER :: nLinoz ! Logicals LOGICAL :: am_I_Root, rootChunk @@ -1094,7 +1342,7 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF ! Copy the data to a temporary array - linozData = REAL(Input_Opt%LINOZ_TPARM,r8) + linozData = REAL(Input_Opt%LINOZ_TPARM, r8) ENDIF #if defined( SPMD ) CALL MPIBCAST( linozData, nLinoz, MPIR8, 0, MPICOM ) @@ -1291,9 +1539,9 @@ subroutine chem_init(phys_state, pbuf2d) !============================================================== IF ( drydep_method == DD_XLND ) THEN - CALL drydep_inti( MOZART_depvel_lnd_file, & - MOZART_clim_soilw_file, & - MOZART_season_wes_file ) + CALL drydep_inti( depvel_lnd_file, & + clim_soilw_file, & + season_wes_file ) ELSE Write(iulog,'(a,a)') ' drydep_method is set to: ', TRIM(drydep_method) CALL ENDRUN('drydep_method must be DD_XLND to compute dry deposition' // & @@ -1303,6 +1551,21 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF +#if defined( MODAL_AERO_4MODE ) + ! Initialize aerosols + CALL aero_model_init( pbuf2d ) + + ! Initialize land maps for aerosol dry deposition + IF ( drydep_method == DD_XLND ) THEN + CALL drydep_inti_landuse( depvel_lnd_file, & + clim_soilw_file ) + ELSE + Write(iulog,'(a,a)') ' drydep_method is set to: ', TRIM(drydep_method) + CALL ENDRUN('drydep_method must be DD_XLND to compute land maps for aerosol' // & + ' dry deposition!') + ENDIF +#endif + !================================================================= ! Call setup routines for wet deposition ! @@ -1654,8 +1917,8 @@ subroutine chem_init(phys_state, pbuf2d) NDX_LSFLXSNW = Pbuf_Get_Index('LS_FLXSNW') ! Get cloud water indices - CALL Cnst_Get_Ind('CLDLIQ', ixCldLiq) - CALL Cnst_Get_Ind('CLDICE', ixCldIce) + CALL cnst_get_ind('CLDLIQ', ixCldLiq) + CALL cnst_get_ind('CLDICE', ixCldIce) ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default @@ -1667,6 +1930,7 @@ subroutine chem_init(phys_state, pbuf2d) CALL Add_Default ( TRIM(SpcName), 1, ' ') ENDIF ENDDO + DO I =1, nSls SpcName = TRIM(slsNames(I)) CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(slsLongNames(I))//' concentration') @@ -1679,376 +1943,6 @@ subroutine chem_init(phys_state, pbuf2d) !CALL AddFld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) !CALL Add_Default ( 'BCPI', 1, ' ') -#if defined( CLM40 ) - SpcName = 'lu_soil' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_landice' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_deeplake' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_shallowlake' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_wetland' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_urban' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_icemec' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_crop' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') -#elif defined( CLM45 ) || defined( CLM50 ) - SpcName = 'lu_soil' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_crop' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_landice' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_deeplake' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_wetland' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'lu_urban' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') -#endif - SpcName = 'p_notveg' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_needle_eg_temp' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_needle_eg_bor' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_needle_dd_bor' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_broad_eg_trop' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_broad_eg_temp' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_broad_dd_trop' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_broad_dd_temp' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_broad_dd_bor' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_broad_eg_sh' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_broad_dd_temp_sh' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_broad_dd_bor_sh' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_c3_arctic_grass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_c3_narctic_grass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_c4_grass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_c3_crop' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_c3_irrigated' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') -#if defined( CLM40 ) - SpcName = 'p_c3_corn' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_spring_cereal' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_winter_cereal' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_soybean' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') -#elif defined( CLM45 ) || defined( CLM50 ) - SpcName = 'p_temp_corn' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_temp_corn' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_spring_wheat' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_spring_wheat' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_winter_wheat' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_winter_wheat' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_temp_soybean' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_temp_soybean' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_barley' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_barley' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_winter_barley' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_winter_barley' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_rye' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_rye' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_winter_rye' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_winter_rye' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_cassava' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_cassava' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_citrus' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_citrus' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_cocoa' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_cocoa' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_coffee' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_coffee' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_cotton' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_cotton' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_datepalm' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_datepalm' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_foddergrass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_foddergrass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_grapes' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_grapes' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_groundnuts' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_groundnuts' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_millet' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_millet' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_oilpalm' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_oilpalm' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_potatoes' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_potatoes' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_pulses' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_pulses' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_rapeseed' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_rapessed' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_rice' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_rice' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_sorghum' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_sorghum' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_sugarbeet' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_sugarbeet' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_sugarcane' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_sugarcane' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_sunflower' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_sunflower' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_miscanthus' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_miscanthus' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_switchgrass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_switchgrass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_trop_corn' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_trop_corn' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_trop_soybean' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'p_irr_trop_soybean' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') -#endif - SpcName = 'pla_notveg' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_needle_eg_temp' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_needle_eg_bor' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_needle_dd_bor' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_broad_eg_trop' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_broad_eg_temp' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_broad_dd_trop' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_broad_dd_temp' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_broad_dd_bor' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_broad_eg_sh' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_broad_dd_temp_sh' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_broad_dd_bor_sh' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_c3_arctic_grass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_c3_narctic_grass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_c4_grass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_c3_crop' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_c3_irrigated' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') -#if defined( CLM40 ) - SpcName = 'pla_c3_corn' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_spring_cereal' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_winter_cereal' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_soybean' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') -#elif defined( CLM45 ) || defined( CLM50 ) - SpcName = 'pla_temp_corn' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_temp_corn' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_spring_wheat' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_spring_wheat' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_winter_wheat' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_winter_wheat' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_temp_soybean' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_temp_soybean' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_barley' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_barley' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_winter_barley' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_winter_barley' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_rye' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_rye' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_winter_rye' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_winter_rye' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_cassava' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_cassava' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_citrus' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_citrus' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_cocoa' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_cocoa' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_coffee' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_coffee' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_cotton' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_cotton' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_datepalm' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_datepalm' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_foddergrass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_foddergrass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_grapes' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_grapes' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_groundnuts' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_groundnuts' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_millet' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_millet' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_oilpalm' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_oilpalm' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_potatoes' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_potatoes' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_pulses' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_pulses' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_rapeseed' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_rapessed' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_rice' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_rice' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_sorghum' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_sorghum' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_sugarbeet' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_sugarbeet' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_sugarcane' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_sugarcane' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_sunflower' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_sunflower' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_miscanthus' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_miscanthus' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_switchgrass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_switchgrass' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_trop_corn' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_trop_corn' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_trop_soybean' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') - SpcName = 'pla_irr_trop_soybean' - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') -#endif - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT' end subroutine chem_init @@ -2111,6 +2005,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use phys_grid, only: get_ncols_p, get_rlat_all_p, get_rlon_all_p use chem_mods, only: drySpc_ndx, map2GC_dryDep +#if defined( MODAL_AERO_4MODE ) + use modal_aero_data, only : ntot_amode, nspec_amode + use modal_aero_data, only : lmassptr_amode +#endif + #if ( LANDTYPE_CLM ) use Olson_Landmap_Mod, only: Compute_Olson_Landmap use Modis_LAI_Mod, only: Compute_XLAI @@ -2152,12 +2051,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use PhysConstants, only: Re use Phys_Grid, only: get_area_all_p, get_lat_all_p, get_lon_all_p - use Short_Lived_Species, only : Get_Short_Lived_Species - use Short_Lived_Species, only : Set_Short_Lived_Species + use short_lived_species, only : get_short_lived_species + use short_lived_species, only : set_short_lived_species ! Use GEOS-Chem versions of physical constants use PhysConstants, only: PI, PI_180, g0 + use rad_constituents, only: rad_cnst_get_info + REAL(r8), INTENT(IN) :: dT ! Time step TYPE(physics_state), INTENT(IN) :: State ! Physics State variables TYPE(physics_ptend), INTENT(OUT) :: ptend ! indivdual parameterization tendencies @@ -2171,12 +2072,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: MMR_End(PCOLS,PVER,nSls+nTracers) REAL(r8) :: MMR_TEnd(PCOLS,PVER,nSls+nTracers) - - ! Mapping (?) + ! Logical to apply tendencies to mixing ratios LOGICAL :: lq(pcnst) ! Indexing - INTEGER :: I, J, K, L, N, M + INTEGER :: I, J, K, L, N, M, P INTEGER :: nX, nY, nZ INTEGER :: LCHNK, NCOL @@ -2267,6 +2167,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) LOGICAL :: rootChunk INTEGER :: RC + INTEGER :: nmodes + character(len=32) :: spec_name + character(len=32) :: spec_type + character(len=32) :: mode_type + integer :: nspec ! LCHNK: which chunk we have on this process LCHNK = State%LCHNK ! NCOL: number of atmospheric columns on this chunk @@ -2343,6 +2248,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) lq(:) = .FALSE. + ! Map and flip gaseous species MMR_Beg = 0.0e+0_r8 DO N = 1, pcnst M = map2GC(N) @@ -2361,9 +2267,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Retrieve previous value of species data SlsData(:,:,:) = 0.0e+0_r8 - CALL Get_Short_Lived_Species( SlsData, LCHNK, nY, Pbuf ) + CALL get_short_lived_species( SlsData, LCHNK, nY, pbuf ) - ! Remap and flip them + ! Map and flip gaseous short-lived species DO N = 1, nSls M = map2GC_Sls(N) IF (M > 0) THEN @@ -2375,6 +2281,25 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDDO +#if defined( MODAL_AERO_4MODE ) + ! Map and flip aerosols + DO M = 1, ntot_amode + DO L = 1, nspec_amode(M) + P = map2MAM4(L,M) + N = lmassptr_amode(L,M) + ! Multiple MAM4 bins are mapped to same GEOS-Chem species + IF ( P > 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + State_Chm(LCHNK)%Species(1,J,K,P) = State_Chm(LCHNK)%Species(1,J,K,P) & + + REAL(State%q(J,nZ+1-K,N),fp) + ENDDO + ENDDO + ENDIF + ENDDO + ENDDO +#endif + ! Initialize tendency array CALL Physics_ptend_init(ptend, State%psetcols, 'chemistry', lq=lq) @@ -2383,16 +2308,16 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Zenith( Calday, Rlats, Rlons, CSZA, nY ) ! Get all required data from physics buffer - TIM_NDX = Pbuf_Old_Tim_Idx() - CALL Pbuf_Get_Field( Pbuf, NDX_PBLH, PblH ) - CALL Pbuf_Get_Field( Pbuf, NDX_FSDS, Fsds ) - CALL Pbuf_Get_Field( Pbuf, NDX_CLDTOP, cldTop ) - CALL Pbuf_Get_Field( Pbuf, NDX_CLDFRC, cldFrc, START=(/1,1,TIM_NDX/), KOUNT=(/NCOL,PVER,1/) ) - CALL Pbuf_Get_Field( Pbuf, NDX_NEVAPR, NEvapr, START=(/1,1/), KOUNT=(/NCOL,PVER/)) - CALL Pbuf_Get_Field( Pbuf, NDX_PRAIN, PRain, START=(/1,1/), KOUNT=(/NCOL,PVER/)) - CALL Pbuf_Get_Field( Pbuf, NDX_RPRDTOT, RprdTot, START=(/1,1/), KOUNT=(/NCOL,PVER/)) - CALL Pbuf_Get_Field( Pbuf, NDX_LSFLXPRC, LsFlxPrc, START=(/1,1/), KOUNT=(/NCOL,PVERP/)) - CALL Pbuf_Get_Field( Pbuf, NDX_LSFLXSNW, LsFlxSnw, START=(/1,1/), KOUNT=(/NCOL,PVERP/)) + TIM_NDX = pbuf_old_tim_idx() + CALL pbuf_get_field( pbuf, NDX_PBLH, PblH ) + CALL pbuf_get_field( pbuf, NDX_FSDS, Fsds ) + CALL pbuf_get_field( pbuf, NDX_CLDTOP, cldTop ) + CALL pbuf_get_field( pbuf, NDX_CLDFRC, cldFrc, START=(/1,1,TIM_NDX/), KOUNT=(/NCOL,PVER,1/) ) + CALL pbuf_get_field( pbuf, NDX_NEVAPR, NEvapr, START=(/1,1/), KOUNT=(/NCOL,PVER/)) + CALL pbuf_get_field( pbuf, NDX_PRAIN, PRain, START=(/1,1/), KOUNT=(/NCOL,PVER/)) + CALL pbuf_get_field( pbuf, NDX_RPRDTOT, RprdTot, START=(/1,1/), KOUNT=(/NCOL,PVER/)) + CALL pbuf_get_field( pbuf, NDX_LSFLXPRC, LsFlxPrc, START=(/1,1/), KOUNT=(/NCOL,PVERP/)) + CALL pbuf_get_field( pbuf, NDX_LSFLXSNW, LsFlxSnw, START=(/1,1/), KOUNT=(/NCOL,PVERP/)) ! Get VMR and MMR of H2O H2OVMR = 0.0e0_fp @@ -2799,8 +2724,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Cloud ice/water mixing ratio ! Unit : kg/kg dry air ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%QI (1,J,L) = State%Q(J,nZ+1-L,ixCldIce) ! kg ice / kg dry air - State_Met(LCHNK)%QL (1,J,L) = State%Q(J,nZ+1-L,ixCldLiq) ! kg water / kg dry air + State_Met(LCHNK)%QI (1,J,L) = MAX(1.0e-05_fp, State%Q(J,nZ+1-L,ixCldIce)) ! kg ice / kg dry air + State_Met(LCHNK)%QL (1,J,L) = MAX(1.0e-05_fp, State%Q(J,nZ+1-L,ixCldLiq)) ! kg water / kg dry air ! Field : RH ! Description: Relative humidity @@ -3226,7 +3151,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! and then scale them with the ocean fraction (OCNDDVEL_GEOSCHEM) ! ! A third option would be to let GEOS-Chem compute dry deposition - ! velocity (ALLDDVEL_GEOSCHEM), thus overwriting the input from CLM + ! velocity (ALLDDVEL_GEOSCHEM), thus overwriting the input from CLM ! ! drydep_method must be set to DD_XLND. ! @@ -3591,7 +3516,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDIF ENDDO - CALL Set_Short_Lived_Species( SlsData, LCHNK, nY, Pbuf ) + CALL set_short_lived_species( SlsData, LCHNK, nY, pbuf ) ! Write diagnostic output DO N = 1, pcnst @@ -3609,376 +3534,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDDO -#if defined( CLM40 ) - SpcName = 'lu_soil' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,1), nY, LCHNK ) - SpcName = 'lu_landice' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,2), nY, LCHNK ) - SpcName = 'lu_deeplake' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,3), nY, LCHNK ) - SpcName = 'lu_shallowlake' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,4), nY, LCHNK ) - SpcName = 'lu_wetland' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,5), nY, LCHNK ) - SpcName = 'lu_urban' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,6), nY, LCHNK ) - SpcName = 'lu_icemec' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,7), nY, LCHNK ) - SpcName = 'lu_crop' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,8), nY, LCHNK ) -#elif defined( CLM45 ) || defined( CLM50 ) - SpcName = 'lu_soil' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,1), nY, LCHNK ) - SpcName = 'lu_crop' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,2), nY, LCHNK ) - SpcName = 'lu_landice' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,4), nY, LCHNK ) - SpcName = 'lu_deeplake' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,5), nY, LCHNK ) - SpcName = 'lu_wetland' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,6), nY, LCHNK ) - SpcName = 'lu_urban' - CALL OutFld( TRIM(SpcName), cam_in%lwtgcell(:,7) & - + cam_in%lwtgcell(:,8) & - + cam_in%lwtgcell(:,9), nY, LCHNK ) -#endif - SpcName = 'p_notveg' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,1), nY, LCHNK ) - SpcName = 'p_needle_eg_temp' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,2), nY, LCHNK ) - SpcName = 'p_needle_eg_bor' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,3), nY, LCHNK ) - SpcName = 'p_needle_dd_bor' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,4), nY, LCHNK ) - SpcName = 'p_broad_eg_trop' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,5), nY, LCHNK ) - SpcName = 'p_broad_eg_temp' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,6), nY, LCHNK ) - SpcName = 'p_broad_dd_trop' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,7), nY, LCHNK ) - SpcName = 'p_broad_dd_temp' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,8), nY, LCHNK ) - SpcName = 'p_broad_dd_bor' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,9), nY, LCHNK ) - SpcName = 'p_broad_eg_sh' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,10), nY, LCHNK ) - SpcName = 'p_broad_dd_temp_sh' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,11), nY, LCHNK ) - SpcName = 'p_broad_dd_bor_sh' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,12), nY, LCHNK ) - SpcName = 'p_c3_arctic_grass' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,13), nY, LCHNK ) - SpcName = 'p_c3_narctic_grass' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,14), nY, LCHNK ) - SpcName = 'p_c4_grass' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,15), nY, LCHNK ) - SpcName = 'p_c3_crop' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,16), nY, LCHNK ) - SpcName = 'p_c3_irrigated' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,17), nY, LCHNK ) -#if defined( CLM40 ) - SpcName = 'p_c3_corn' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,18), nY, LCHNK ) - SpcName = 'p_spring_cereal' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,19), nY, LCHNK ) - SpcName = 'p_winter_cereal' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,20), nY, LCHNK ) - SpcName = 'p_soybean' -#elif defined( CLM45 ) || defined( CLM50 ) - SpcName = 'p_temp_corn' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,18), nY, LCHNK ) - SpcName = 'p_irr_temp_corn' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,19), nY, LCHNK ) - SpcName = 'p_spring_wheat' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,20), nY, LCHNK ) - SpcName = 'p_irr_spring_wheat' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,21), nY, LCHNK ) - SpcName = 'p_winter_wheat' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,22), nY, LCHNK ) - SpcName = 'p_irr_winter_wheat' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,23), nY, LCHNK ) - SpcName = 'p_temp_soybean' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,24), nY, LCHNK ) - SpcName = 'p_irr_temp_soybean' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,25), nY, LCHNK ) - SpcName = 'p_barley' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,26), nY, LCHNK ) - SpcName = 'p_irr_barley' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,27), nY, LCHNK ) - SpcName = 'p_winter_barley' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,28), nY, LCHNK ) - SpcName = 'p_irr_winter_barley' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,29), nY, LCHNK ) - SpcName = 'p_rye' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,30), nY, LCHNK ) - SpcName = 'p_irr_rye' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,31), nY, LCHNK ) - SpcName = 'p_winter_rye' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,32), nY, LCHNK ) - SpcName = 'p_irr_winter_rye' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,33), nY, LCHNK ) - SpcName = 'p_cassava' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,34), nY, LCHNK ) - SpcName = 'p_irr_cassava' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,35), nY, LCHNK ) - SpcName = 'p_citrus' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,36), nY, LCHNK ) - SpcName = 'p_irr_citrus' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,37), nY, LCHNK ) - SpcName = 'p_cocoa' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,38), nY, LCHNK ) - SpcName = 'p_irr_cocoa' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,39), nY, LCHNK ) - SpcName = 'p_coffee' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,40), nY, LCHNK ) - SpcName = 'p_irr_coffee' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,41), nY, LCHNK ) - SpcName = 'p_cotton' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,42), nY, LCHNK ) - SpcName = 'p_irr_cotton' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,43), nY, LCHNK ) - SpcName = 'p_datepalm' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,44), nY, LCHNK ) - SpcName = 'p_irr_datepalm' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,45), nY, LCHNK ) - SpcName = 'p_foddergrass' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,46), nY, LCHNK ) - SpcName = 'p_irr_foddergrass' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,47), nY, LCHNK ) - SpcName = 'p_grapes' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,48), nY, LCHNK ) - SpcName = 'p_irr_grapes' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,49), nY, LCHNK ) - SpcName = 'p_groundnuts' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,50), nY, LCHNK ) - SpcName = 'p_irr_groundnuts' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,51), nY, LCHNK ) - SpcName = 'p_millet' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,52), nY, LCHNK ) - SpcName = 'p_irr_millet' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,53), nY, LCHNK ) - SpcName = 'p_oilpalm' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,54), nY, LCHNK ) - SpcName = 'p_irr_oilpalm' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,55), nY, LCHNK ) - SpcName = 'p_potatoes' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,56), nY, LCHNK ) - SpcName = 'p_irr_potatoes' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,57), nY, LCHNK ) - SpcName = 'p_pulses' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,58), nY, LCHNK ) - SpcName = 'p_irr_pulses' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,59), nY, LCHNK ) - SpcName = 'p_rapeseed' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,60), nY, LCHNK ) - SpcName = 'p_irr_rapessed' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,61), nY, LCHNK ) - SpcName = 'p_rice' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,62), nY, LCHNK ) - SpcName = 'p_irr_rice' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,63), nY, LCHNK ) - SpcName = 'p_sorghum' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,64), nY, LCHNK ) - SpcName = 'p_irr_sorghum' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,65), nY, LCHNK ) - SpcName = 'p_sugarbeet' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,66), nY, LCHNK ) - SpcName = 'p_irr_sugarbeet' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,67), nY, LCHNK ) - SpcName = 'p_sugarcane' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,68), nY, LCHNK ) - SpcName = 'p_irr_sugarcane' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,69), nY, LCHNK ) - SpcName = 'p_sunflower' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,70), nY, LCHNK ) - SpcName = 'p_irr_sunflower' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,71), nY, LCHNK ) - SpcName = 'p_miscanthus' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,72), nY, LCHNK ) - SpcName = 'p_irr_miscanthus' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,73), nY, LCHNK ) - SpcName = 'p_switchgrass' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,74), nY, LCHNK ) - SpcName = 'p_irr_switchgrass' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,75), nY, LCHNK ) - SpcName = 'p_trop_corn' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,76), nY, LCHNK ) - SpcName = 'p_irr_trop_corn' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,77), nY, LCHNK ) - SpcName = 'p_trop_soybean' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,78), nY, LCHNK ) - SpcName = 'p_irr_trop_soybean' - CALL OutFld( TRIM(SpcName), cam_in%pwtgcell(:,79), nY, LCHNK ) -#endif - SpcName = 'pla_notveg' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,1), nY, LCHNK ) - SpcName = 'pla_needle_eg_temp' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,2), nY, LCHNK ) - SpcName = 'pla_needle_eg_bor' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,3), nY, LCHNK ) - SpcName = 'pla_needle_dd_bor' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,4), nY, LCHNK ) - SpcName = 'pla_broad_eg_trop' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,5), nY, LCHNK ) - SpcName = 'pla_broad_eg_temp' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,6), nY, LCHNK ) - SpcName = 'pla_broad_dd_trop' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,7), nY, LCHNK ) - SpcName = 'pla_broad_dd_temp' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,8), nY, LCHNK ) - SpcName = 'pla_broad_dd_bor' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,9), nY, LCHNK ) - SpcName = 'pla_broad_eg_sh' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,10), nY, LCHNK ) - SpcName = 'pla_broad_dd_temp_sh' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,11), nY, LCHNK ) - SpcName = 'pla_broad_dd_bor_sh' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,12), nY, LCHNK ) - SpcName = 'pla_c3_arctic_grass' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,13), nY, LCHNK ) - SpcName = 'pla_c3_narctic_grass' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,14), nY, LCHNK ) - SpcName = 'pla_c4_grass' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,15), nY, LCHNK ) - SpcName = 'pla_c3_crop' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,16), nY, LCHNK ) - SpcName = 'pla_c3_irrigated' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,17), nY, LCHNK ) -#if defined( CLM40 ) - SpcName = 'pla_c3_corn' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,18), nY, LCHNK ) - SpcName = 'pla_spring_cereal' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,19), nY, LCHNK ) - SpcName = 'pla_winter_cereal' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,20), nY, LCHNK ) - SpcName = 'pla_soybean' -#elif defined( CLM45 ) || defined( CLM50 ) - SpcName = 'pla_temp_corn' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,18), nY, LCHNK ) - SpcName = 'pla_irr_temp_corn' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,19), nY, LCHNK ) - SpcName = 'pla_spring_wheat' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,20), nY, LCHNK ) - SpcName = 'pla_irr_spring_wheat' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,21), nY, LCHNK ) - SpcName = 'pla_winter_wheat' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,22), nY, LCHNK ) - SpcName = 'pla_irr_winter_wheat' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,23), nY, LCHNK ) - SpcName = 'pla_temp_soybean' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,24), nY, LCHNK ) - SpcName = 'pla_irr_temp_soybean' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,25), nY, LCHNK ) - SpcName = 'pla_barley' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,26), nY, LCHNK ) - SpcName = 'pla_irr_barley' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,27), nY, LCHNK ) - SpcName = 'pla_winter_barley' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,28), nY, LCHNK ) - SpcName = 'pla_irr_winter_barley' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,29), nY, LCHNK ) - SpcName = 'pla_rye' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,30), nY, LCHNK ) - SpcName = 'pla_irr_rye' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,31), nY, LCHNK ) - SpcName = 'pla_winter_rye' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,32), nY, LCHNK ) - SpcName = 'pla_irr_winter_rye' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,33), nY, LCHNK ) - SpcName = 'pla_cassava' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,34), nY, LCHNK ) - SpcName = 'pla_irr_cassava' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,35), nY, LCHNK ) - SpcName = 'pla_citrus' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,36), nY, LCHNK ) - SpcName = 'pla_irr_citrus' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,37), nY, LCHNK ) - SpcName = 'pla_cocoa' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,38), nY, LCHNK ) - SpcName = 'pla_irr_cocoa' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,39), nY, LCHNK ) - SpcName = 'pla_coffee' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,40), nY, LCHNK ) - SpcName = 'pla_irr_coffee' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,41), nY, LCHNK ) - SpcName = 'pla_cotton' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,42), nY, LCHNK ) - SpcName = 'pla_irr_cotton' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,43), nY, LCHNK ) - SpcName = 'pla_datepalm' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,44), nY, LCHNK ) - SpcName = 'pla_irr_datepalm' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,45), nY, LCHNK ) - SpcName = 'pla_foddergrass' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,46), nY, LCHNK ) - SpcName = 'pla_irr_foddergrass' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,47), nY, LCHNK ) - SpcName = 'pla_grapes' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,48), nY, LCHNK ) - SpcName = 'pla_irr_grapes' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,49), nY, LCHNK ) - SpcName = 'pla_groundnuts' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,50), nY, LCHNK ) - SpcName = 'pla_irr_groundnuts' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,51), nY, LCHNK ) - SpcName = 'pla_millet' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,52), nY, LCHNK ) - SpcName = 'pla_irr_millet' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,53), nY, LCHNK ) - SpcName = 'pla_oilpalm' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,54), nY, LCHNK ) - SpcName = 'pla_irr_oilpalm' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,55), nY, LCHNK ) - SpcName = 'pla_potatoes' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,56), nY, LCHNK ) - SpcName = 'pla_irr_potatoes' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,57), nY, LCHNK ) - SpcName = 'pla_pulses' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,58), nY, LCHNK ) - SpcName = 'pla_irr_pulses' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,59), nY, LCHNK ) - SpcName = 'pla_rapeseed' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,60), nY, LCHNK ) - SpcName = 'pla_irr_rapessed' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,61), nY, LCHNK ) - SpcName = 'pla_rice' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,62), nY, LCHNK ) - SpcName = 'pla_irr_rice' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,63), nY, LCHNK ) - SpcName = 'pla_sorghum' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,64), nY, LCHNK ) - SpcName = 'pla_irr_sorghum' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,65), nY, LCHNK ) - SpcName = 'pla_sugarbeet' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,66), nY, LCHNK ) - SpcName = 'pla_irr_sugarbeet' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,67), nY, LCHNK ) - SpcName = 'pla_sugarcane' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,68), nY, LCHNK ) - SpcName = 'pla_irr_sugarcane' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,69), nY, LCHNK ) - SpcName = 'pla_sunflower' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,70), nY, LCHNK ) - SpcName = 'pla_irr_sunflower' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,71), nY, LCHNK ) - SpcName = 'pla_miscanthus' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,72), nY, LCHNK ) - SpcName = 'pla_irr_miscanthus' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,73), nY, LCHNK ) - SpcName = 'pla_switchgrass' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,74), nY, LCHNK ) - SpcName = 'pla_irr_switchgrass' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,75), nY, LCHNK ) - SpcName = 'pla_trop_corn' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,76), nY, LCHNK ) - SpcName = 'pla_irr_trop_corn' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,77), nY, LCHNK ) - SpcName = 'pla_trop_soybean' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,78), nY, LCHNK ) - SpcName = 'pla_irr_trop_soybean' - CALL OutFld( TRIM(SpcName), cam_in%lai(:,79), nY, LCHNK ) -#endif - DO N = 1, nSls SpcName = slsNames(n) VMR = 0.0e+0_r8 @@ -3995,7 +3550,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! NOTE: Re-flip all the arrays vertically or suffer the consequences ! ptend%q dimensions: [column, ?, species] - Ptend%Q(:,:,:) = 0.0e+0_r8 + ptend%q(:,:,:) = 0.0e+0_r8 MMR_End = 0.0e+0_r8 DO N = 1, pcnst M = map2GC(N) @@ -4172,6 +3727,7 @@ subroutine chem_final IF (ALLOCATED(slvd_Lst )) DEALLOCATE(slvd_Lst) IF (ALLOCATED(slvd_ref_MMR)) DEALLOCATE(slvd_ref_MMR) + RETURN end subroutine chem_final diff --git a/src/chemistry/pp_geoschem/m_spc_id.F90 b/src/chemistry/pp_geoschem/m_spc_id.F90 new file mode 100644 index 0000000000..14a949048d --- /dev/null +++ b/src/chemistry/pp_geoschem/m_spc_id.F90 @@ -0,0 +1,3 @@ + module m_spc_id + implicit none + end module m_spc_id diff --git a/src/chemistry/pp_geoschem/mo_chem_utls.F90 b/src/chemistry/pp_geoschem/mo_chem_utls.F90 index 1d709c09dc..7ef4f09393 100644 --- a/src/chemistry/pp_geoschem/mo_chem_utls.F90 +++ b/src/chemistry/pp_geoschem/mo_chem_utls.F90 @@ -2,7 +2,9 @@ module mo_chem_utls private - public :: get_spc_ndx!, get_het_ndx, get_extfrc_ndx, get_rxt_ndx, get_inv_ndx + public :: get_spc_ndx + public :: get_inv_ndx + !, get_het_ndx, get_extfrc_ndx, get_rxt_ndx save @@ -13,7 +15,8 @@ integer function get_spc_ndx( spc_name ) ! ... return overall species index associated with spc_name !----------------------------------------------------------------------- - use chem_mods, only : nTracers, tracnam => tracerNames + !use chem_mods, only : nTracers + use mo_tracname, only : tracnam => solsym use string_utils, only : to_upper implicit none @@ -29,8 +32,8 @@ integer function get_spc_ndx( spc_name ) integer :: m get_spc_ndx = -1 - do m = 1, nTracers - if( trim( spc_name ) == trim( to_upper( tracnam(m) ) ) ) then + do m = 1, 306 + if( trim( to_upper( spc_name ) ) == trim( to_upper( tracnam(m) ) ) ) then get_spc_ndx = m exit end if @@ -38,34 +41,34 @@ integer function get_spc_ndx( spc_name ) end function get_spc_ndx -! integer function get_inv_ndx( invariant ) -! !----------------------------------------------------------------------- -! ! ... return overall external frcing index associated with spc_name -! !----------------------------------------------------------------------- -! -! use chem_mods, only : nfs, inv_lst -! -! implicit none -! -! !----------------------------------------------------------------------- -! ! ... dummy arguments -! !----------------------------------------------------------------------- -! character(len=*), intent(in) :: invariant -! -! !----------------------------------------------------------------------- -! ! ... local variables -! !----------------------------------------------------------------------- -! integer :: m -! -! get_inv_ndx = -1 -! do m = 1,nfs -! if( trim( invariant ) == trim( inv_lst(m) ) ) then -! get_inv_ndx = m -! exit -! end if -! end do -! -! end function get_inv_ndx + integer function get_inv_ndx( invariant ) + !----------------------------------------------------------------------- + ! ... return overall external frcing index associated with spc_name + !----------------------------------------------------------------------- + + use chem_mods, only : nfs, inv_lst + + implicit none + + !----------------------------------------------------------------------- + ! ... dummy arguments + !----------------------------------------------------------------------- + character(len=*), intent(in) :: invariant + + !----------------------------------------------------------------------- + ! ... local variables + !----------------------------------------------------------------------- + integer :: m + + get_inv_ndx = -1 + do m = 1,nfs + if( trim( invariant ) == trim( inv_lst(m) ) ) then + get_inv_ndx = m + exit + end if + end do + + end function get_inv_ndx ! ! integer function get_het_ndx( het_name ) ! !----------------------------------------------------------------------- diff --git a/src/chemistry/pp_geoschem/mo_drydep.F90 b/src/chemistry/pp_geoschem/mo_drydep.F90 index 50656ef30b..66f4b122f0 100644 --- a/src/chemistry/pp_geoschem/mo_drydep.F90 +++ b/src/chemistry/pp_geoschem/mo_drydep.F90 @@ -37,6 +37,10 @@ module mo_drydep module procedure dvel_inti_fromlnd end interface + interface drydep_inti_landuse + module procedure dvel_inti_xactive_landuse + end interface + interface drydep !module procedure drydep_table module procedure drydep_xactive @@ -45,6 +49,7 @@ module mo_drydep private public :: drydep_inti, drydep, set_soilw, chk_soilw, has_drydep + public :: drydep_inti_landuse public :: drydep_update public :: drydep_fromlnd public :: n_land_type, fraction_landuse, drydep_srf_file @@ -2043,6 +2048,192 @@ subroutine dvel_inti_xactive( depvel_lnd_file, clim_soilw_file, season_wes_file end subroutine dvel_inti_xactive + subroutine dvel_inti_xactive_landuse( depvel_lnd_file, clim_soilw_file ) + !------------------------------------------------------------------------------------- + ! ... intialize interactive drydep + !------------------------------------------------------------------------------------- + use dycore, only : dycore_is + use mo_constants, only : r2d + use chem_mods, only : adv_mass + use mo_chem_utls, only : get_spc_ndx ! Replaced, TMMF + use seq_drydep_mod,only : drydep_method, DD_XATM, DD_XLND + use phys_control, only : phys_getopts + + implicit none + + !------------------------------------------------------------------------------------- + ! ... dummy arguments + !------------------------------------------------------------------------------------- + character(len=*), intent(in) :: depvel_lnd_file, clim_soilw_file + + !------------------------------------------------------------------------------------- + ! ... local variables + !------------------------------------------------------------------------------------- + integer :: i, j, ii, jj, jl, ju + integer :: nlon_veg, nlat_veg, npft_veg + integer :: nlat_lai, npft_lai, pos_min, imin + integer :: dimid + integer :: m, n, l, id + integer :: length1, astat + integer :: k, num_max, k_max + integer :: num_seas(5) + integer :: plon, plat + integer :: ierr, ndx + + real(r8) :: spc_mass + real(r8) :: diff_min, target_lat + real(r8), allocatable :: vegetation_map(:,:,:) + real(r8), pointer :: soilw_map(:,:,:) + real(r8), allocatable :: work(:,:) + real(r8), allocatable :: landmask(:,:) + real(r8), allocatable :: urban(:,:) + real(r8), allocatable :: lake(:,:) + real(r8), allocatable :: wetland(:,:) + real(r8), allocatable :: lon_veg(:) + real(r8), allocatable :: lon_veg_edge(:) + real(r8), allocatable :: lat_veg(:) + real(r8), allocatable :: lat_veg_edge(:) + character(len=32) :: test_name + character(len=4) :: tag_name + type(file_desc_t) :: piofile + type(var_desc_t) :: vid + logical :: do_soilw + + character(len=shr_kind_cl) :: locfn + logical :: prog_modal_aero + + ! determine if modal aerosols are active so that fraction_landuse array is initialized for modal aerosal dry dep + call phys_getopts(prog_modal_aero_out=prog_modal_aero) + + call dvel_inti_fromlnd() + + !--------------------------------------------------------------------------- + ! ... allocate module variables + !--------------------------------------------------------------------------- + if (drydep_method == DD_XLND .and. (.not.prog_modal_aero)) then + return + endif + + do_soilw = .not. dyn_soilw + allocate( fraction_landuse(pcols,n_land_type, begchunk:endchunk),stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate fraction_landuse; error = ',astat + call endrun + end if + if(do_soilw) then + allocate(soilw_3d(pcols,12,begchunk:endchunk),stat=astat) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate soilw_3d error = ',astat + call endrun + end if + end if + + plon = get_dyn_grid_parm('plon') + plat = get_dyn_grid_parm('plat') + if(dycore_is('UNSTRUCTURED') ) then + call get_landuse_and_soilw_from_file(do_soilw) + else + !--------------------------------------------------------------------------- + ! ... read landuse map + !--------------------------------------------------------------------------- + call getfil (depvel_lnd_file, locfn, 0) + call cam_pio_openfile (piofile, trim(locfn), PIO_NOWRITE) + !--------------------------------------------------------------------------- + ! ... get the dimensions + !--------------------------------------------------------------------------- + ierr = pio_inq_dimid( piofile, 'lon', dimid ) + ierr = pio_inq_dimlen( piofile, dimid, nlon_veg ) + ierr = pio_inq_dimid( piofile, 'lat', dimid ) + ierr = pio_inq_dimlen( piofile, dimid, nlat_veg ) + ierr = pio_inq_dimid( piofile, 'pft', dimid ) + ierr = pio_inq_dimlen( piofile, dimid, npft_veg ) + !--------------------------------------------------------------------------- + ! ... allocate arrays + !--------------------------------------------------------------------------- + allocate( vegetation_map(nlon_veg,nlat_veg,npft_veg), work(nlon_veg,nlat_veg), stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate vegation_map; error = ',astat + call endrun + end if + allocate( urban(nlon_veg,nlat_veg), lake(nlon_veg,nlat_veg), & + landmask(nlon_veg,nlat_veg), wetland(nlon_veg,nlat_veg), stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate vegation_map; error = ',astat + call endrun + end if + allocate( lon_veg(nlon_veg), lat_veg(nlat_veg), & + lon_veg_edge(nlon_veg+1), lat_veg_edge(nlat_veg+1), stat=astat ) + if( astat /= 0 ) then + write(iulog,*) 'dvel_inti: failed to allocate vegation lon, lat arrays; error = ',astat + call endrun + end if + !--------------------------------------------------------------------------- + ! ... read the vegetation map and landmask + !--------------------------------------------------------------------------- + ierr = pio_inq_varid( piofile, 'PCT_PFT', vid ) + ierr = pio_get_var( piofile, vid, vegetation_map ) + + ierr = pio_inq_varid( piofile, 'LANDMASK', vid ) + ierr = pio_get_var( piofile, vid, landmask ) + + ierr = pio_inq_varid( piofile, 'PCT_URBAN', vid ) + ierr = pio_get_var( piofile, vid, urban ) + + ierr = pio_inq_varid( piofile, 'PCT_LAKE', vid ) + ierr = pio_get_var( piofile, vid, lake ) + + ierr = pio_inq_varid( piofile, 'PCT_WETLAND', vid ) + ierr = pio_get_var( piofile, vid, wetland ) + + call cam_pio_closefile( piofile ) + + !--------------------------------------------------------------------------- + ! scale vegetation, urban, lake, and wetland to fraction + !--------------------------------------------------------------------------- + vegetation_map(:,:,:) = .01_r8 * vegetation_map(:,:,:) + wetland(:,:) = .01_r8 * wetland(:,:) + lake(:,:) = .01_r8 * lake(:,:) + urban(:,:) = .01_r8 * urban(:,:) +#ifdef DEBUG + if(masterproc) then + write(iulog,*) 'minmax vegetation_map ',minval(vegetation_map),maxval(vegetation_map) + write(iulog,*) 'minmax wetland ',minval(wetland),maxval(wetland) + write(iulog,*) 'minmax landmask ',minval(landmask),maxval(landmask) + end if +#endif + !--------------------------------------------------------------------------- + ! ... define lat-lon of vegetation map (1x1) + !--------------------------------------------------------------------------- + lat_veg(:) = (/ (-89.5_r8 + (i-1),i=1,nlat_veg ) /) + lon_veg(:) = (/ ( 0.5_r8 + (i-1),i=1,nlon_veg ) /) + lat_veg_edge(:) = (/ (-90.0_r8 + (i-1),i=1,nlat_veg+1) /) + lon_veg_edge(:) = (/ ( 0.0_r8 + (i-1),i=1,nlon_veg+1) /) + !--------------------------------------------------------------------------- + ! ... read soilw table if necessary + !--------------------------------------------------------------------------- + + if( do_soilw ) then + call soilw_inti( clim_soilw_file, nlon_veg, nlat_veg, soilw_map ) + end if + + !--------------------------------------------------------------------------- + ! ... regrid to model grid + !--------------------------------------------------------------------------- + + call interp_map( plon, plat, nlon_veg, nlat_veg, npft_veg, lat_veg, lat_veg_edge, & + lon_veg, lon_veg_edge, landmask, urban, lake, & + wetland, vegetation_map, soilw_map, do_soilw ) + + deallocate( vegetation_map, work, stat=astat ) + deallocate( lon_veg, lat_veg, lon_veg_edge, lat_veg_edge, stat=astat ) + deallocate( landmask, urban, lake, wetland, stat=astat ) + if( do_soilw ) then + deallocate( soilw_map, stat=astat ) + end if + endif ! Unstructured grid + + end subroutine dvel_inti_xactive_landuse + !------------------------------------------------------------------------------------- subroutine get_landuse_and_soilw_from_file(do_soilw) use ncdio_atm, only : infld diff --git a/src/chemistry/pp_geoschem/mo_sim_dat.F90 b/src/chemistry/pp_geoschem/mo_sim_dat.F90 index 1e9005c437..b82e91731d 100644 --- a/src/chemistry/pp_geoschem/mo_sim_dat.F90 +++ b/src/chemistry/pp_geoschem/mo_sim_dat.F90 @@ -36,7 +36,7 @@ subroutine set_sim_dat ! cls_rxt_cnt(:,1) = (/ 37, 61, 0, 30 /) ! cls_rxt_cnt(:,4) = (/ 23, 174, 326, 191 /) - solsym(:273) = (/ 'CH2I2 ','CH2ICL ','CH2IBR ', & + solsym(:306) = (/ 'CH2I2 ','CH2ICL ','CH2IBR ', & 'NITs ','NIT ','AERI ', & 'CO2 ','INDIOL ','ISALA ', & 'ISALC ','ISN1OA ','ISN1OG ', & @@ -126,7 +126,21 @@ subroutine set_sim_dat 'TSOA3 ','TSOA0 ','ASOG1 ', & 'ASOG2 ','ASOG3 ','ASOAN ', & 'ASOA1 ','ASOA2 ','ASOA3 ', & - 'SOAP ','SOAS ','PFE ' /) + 'SOAP ','SOAS ','PFE ', & + 'bc_a1 ','bc_a4 ','dst_a1 ', & + 'dst_a2 ','dst_a3 ','ncl_a1 ', & + 'ncl_a2 ','ncl_a3 ','num_a1 ', & + 'num_a2 ','num_a3 ','num_a4 ', & + 'pom_a1 ','pom_a4 ','so4_a1 ', & + 'so4_a2 ','so4_a3 ','soa1_a1 ', & + 'soa1_a2 ','soa2_a1 ','soa2_a2 ', & + 'soa3_a1 ','soa3_a2 ','soa4_a1 ', & + 'soa4_a2 ','soa5_a1 ','soa5_a2 ', & + 'H2SO4 ','SOAG0 ','SOAG1 ', & + 'SOAG2 ','SOAG3 ','SOAG4 ' /) + + inv_lst(: 6) = (/ 'M ', 'N2 ', 'O2 ', & + 'H2 ', 'MOH ', 'RCOOH ' /) ! adv_mass(:221) = (/ 133.141340_r8, 104.142600_r8, 28.010400_r8, 12.011000_r8, 12.011000_r8, & ! 204.342600_r8, 78.110400_r8, 160.122200_r8, 126.108600_r8, 98.098200_r8, & diff --git a/src/chemistry/pp_geoschem/mo_tracname.F90 b/src/chemistry/pp_geoschem/mo_tracname.F90 index 5d470483d1..631426a81c 100644 --- a/src/chemistry/pp_geoschem/mo_tracname.F90 +++ b/src/chemistry/pp_geoschem/mo_tracname.F90 @@ -12,6 +12,6 @@ module mo_tracname ! modified to an arbitrary high #, was gas_pcnst. this would cause a memory ! overflow overwrite in mo_sim_dat, which allocates :273 larger than ! the default specified gas_pcnst (hplin, 5/16/20) - character(len=16) :: solsym(273) ! species names + character(len=16) :: solsym(306) ! species names end module mo_tracname From 95740b50e99c96d8c36da35a2600bf607d6caffc Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 20 Jul 2020 17:23:30 -0400 Subject: [PATCH 100/239] Chore: Fix indentation + capitalization --- src/chemistry/pp_geoschem/chemistry.F90 | 1544 +++++++++++------------ 1 file changed, 769 insertions(+), 775 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 4843ca6c15..da95a21c4b 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -153,15 +153,14 @@ module chemistry contains !================================================================================================ - LOGICAL function chem_is (NAME) + LOGICAL function chem_is (name) - CHARACTER(LEN=*), INTENT(IN) :: NAME + CHARACTER(LEN=*), INTENT(IN) :: name chem_is = .false. - IF (NAME == 'geoschem' ) THEN + IF ( to_upper(name) == 'GEOSCHEM' ) THEN chem_is = .true. ENDIF - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_IS' end function chem_is @@ -254,7 +253,7 @@ subroutine chem_register IO%LPRT = .False. IO%N_Advect = nTracers DO I = 1, nTracers - IO%AdvectSpc_Name(I) = TRIM(tracerNames(I)) + IO%AdvectSpc_Name(I) = TRIM(tracerNames(I)) ENDDO IO%SalA_rEdge_um(1) = 0.01e+0_fp IO%SalA_rEdge_um(2) = 0.50e+0_fp @@ -435,8 +434,8 @@ subroutine chem_register ! constituent n M = Ind_(TRIM(tracerNames(I))) IF ( M > 0 ) THEN - map2GC(N) = M - map2Idx(N) = I + map2GC(N) = M + map2Idx(N) = I ENDIF ! Nullify pointer ThisSpc => NULL() @@ -448,18 +447,18 @@ subroutine chem_register SlsMWRatio(:) = -1.0e+0_r8 slsLongNames = '' DO I = 1, nSls - N = Ind_(slsNames(I)) - IF ( N .GT. 0 ) THEN - ThisSpc => SC%SpcData(N)%Info - MWTmp = REAL(ThisSpc%MW_g,r8) - ref_VMR = REAL(ThisSpc%BackgroundVV,r8) - lngName = TRIM(ThisSpc%FullName) - slsLongNames(I) = lngName - sls_ref_MMR(I) = ref_VMR / (MWDry / MWTmp) - SlsMWRatio(I) = MWDry / MWTmp - map2GC_Sls(I) = N - ThisSpc => NULL() - ENDIF + N = Ind_(slsNames(I)) + IF ( N .GT. 0 ) THEN + ThisSpc => SC%SpcData(N)%Info + MWTmp = REAL(ThisSpc%MW_g,r8) + ref_VMR = REAL(ThisSpc%BackgroundVV,r8) + lngName = TRIM(ThisSpc%FullName) + slsLongNames(I) = lngName + sls_ref_MMR(I) = ref_VMR / (MWDry / MWTmp) + SlsMWRatio(I) = MWDry / MWTmp + map2GC_Sls(I) = N + ThisSpc => NULL() + ENDIF ENDDO ! Pass information to "short_lived_species" module @@ -707,156 +706,156 @@ subroutine chem_readnl(nlfile) #endif DO I = (nAer+1), nAerMax - aerNames(I) = 'EMPTY_AER ' - aerAdvMass(I) = -1.00_r8 + aerNames(I) = 'EMPTY_AER ' + aerAdvMass(I) = -1.00_r8 ENDDO IF ( MasterProc ) THEN - Write(iulog,'(/,a)') REPEAT( '=', 50 ) - Write(iulog,'(a)') REPEAT( '=', 50 ) - Write(iulog,'(a)') 'This is the GEOS-CHEM / CESM interface' - Write(iulog,'(a)') REPEAT( '=', 50 ) - Write(iulog,'(a)') ' + Routines written by Thibaud M. Fritz' - Write(iulog,'(a)') ' + Laboratory for Aviation and the Environment,' - Write(iulog,'(a)') ' + Department of Aeronautics and Astronautics,' - Write(iulog,'(a)') ' + Massachusetts Institute of Technology' - Write(iulog,'(a)') REPEAT( '=', 50 ) + Write(iulog,'(/,a)') REPEAT( '=', 50 ) + Write(iulog,'(a)') REPEAT( '=', 50 ) + Write(iulog,'(a)') 'This is the GEOS-CHEM / CESM interface' + Write(iulog,'(a)') REPEAT( '=', 50 ) + Write(iulog,'(a)') ' + Routines written by Thibaud M. Fritz' + Write(iulog,'(a)') ' + Laboratory for Aviation and the Environment,' + Write(iulog,'(a)') ' + Department of Aeronautics and Astronautics,' + Write(iulog,'(a)') ' + Massachusetts Institute of Technology' + Write(iulog,'(a)') REPEAT( '=', 50 ) - Write(iulog,'(/,/, a)') 'Now defining GEOS-Chem tracers and dry deposition mapping...' + Write(iulog,'(/,/, a)') 'Now defining GEOS-Chem tracers and dry deposition mapping...' - unitn = getunit() + unitn = getunit() - !============================================================== - ! Opening input.geos and go to ADVECTED SPECIES MENU - !============================================================== + !============================================================== + ! Opening input.geos and go to ADVECTED SPECIES MENU + !============================================================== - OPEN( unitn, FILE=TRIM(inputGeosPath), STATUS='OLD', IOSTAT=IERR ) - IF (IERR .NE. 0) THEN - CALL ENDRUN('chem_readnl: ERROR opening input.geos') - ENDIF + OPEN( unitn, FILE=TRIM(inputGeosPath), STATUS='OLD', IOSTAT=IERR ) + IF (IERR .NE. 0) THEN + CALL ENDRUN('chem_readnl: ERROR opening input.geos') + ENDIF - ! Go to ADVECTED SPECIES MENU - menuFound = .False. - DO WHILE ( .NOT. menuFound ) - READ( unitn, '(a)', IOSTAT=IERR ) line - IF ( IERR .NE. 0 ) THEN - CALL ENDRUN('chem_readnl: ERROR finding advected species menu') - ELSEIF ( INDEX(line, 'ADVECTED SPECIES MENU') > 0 ) THEN - menuFound = .True. - ENDIF - ENDDO + ! Go to ADVECTED SPECIES MENU + menuFound = .False. + DO WHILE ( .NOT. menuFound ) + READ( unitn, '(a)', IOSTAT=IERR ) line + IF ( IERR .NE. 0 ) THEN + CALL ENDRUN('chem_readnl: ERROR finding advected species menu') + ELSEIF ( INDEX(line, 'ADVECTED SPECIES MENU') > 0 ) THEN + menuFound = .True. + ENDIF + ENDDO - !============================================================== - ! Read list of GEOS-Chem tracers - !============================================================== + !============================================================== + ! Read list of GEOS-Chem tracers + !============================================================== - DO - ! Read line - READ(unitn,'(26x,a)', IOSTAT=IERR) line + DO + ! Read line + READ(unitn,'(26x,a)', IOSTAT=IERR) line - IF ( INDEX( TRIM(line), '---' ) > 0 ) EXIT + IF ( INDEX( TRIM(line), '---' ) > 0 ) EXIT - nTracers = nTracers + 1 - tracerNames(nTracers) = TRIM(line) + nTracers = nTracers + 1 + tracerNames(nTracers) = TRIM(line) - ENDDO + ENDDO - CLOSE(unitn) - CALL freeunit(unitn) + CLOSE(unitn) + CALL freeunit(unitn) - ! Assign remaining tracers dummy names - DO I = (nTracers+1), nTracersMax - WRITE(tracerNames(I),'(a,I0.4)') 'GCTRC_', I - ENDDO + ! Assign remaining tracers dummy names + DO I = (nTracers+1), nTracersMax + WRITE(tracerNames(I),'(a,I0.4)') 'GCTRC_', I + ENDDO - !============================================================== - ! Now go through the KPP mechanism and add any species not - ! implemented by the tracer list in input.geos - !============================================================== + !============================================================== + ! Now go through the KPP mechanism and add any species not + ! implemented by the tracer list in input.geos + !============================================================== - IF ( nSpec > nSlsMax ) THEN - CALL ENDRUN('chem_readnl: too many species - increase nSlsmax') - ENDIF + IF ( nSpec > nSlsMax ) THEN + CALL ENDRUN('chem_readnl: too many species - increase nSlsmax') + ENDIF - nSls = 0 - DO I = 1, nSpec - ! Get the name of the species from KPP - line = ADJUSTL(TRIM(Spc_Names(I))) - ! Only add this - validSLS = ( .NOT. ANY(TRIM(line) .EQ. tracerNames) ) - IF (validSLS) THEN - ! Genuine new short-lived species - nSls = nSls + 1 - slsNames(nSls) = TRIM(line) - ENDIF - ENDDO - - !============================================================== - ! Get mapping between dry deposition species and species set - !============================================================== - - DO N = 1, nddvels - - ! The species names need to be convert to upper case as, - ! for instance, BR2 != Br2 - drySpc_ndx(N) = get_spc_ndx( to_upper(drydep_list(N)) ) - - IF ( drySpc_ndx(N) < 0 ) THEN - Write(iulog,'(a,a)') ' ## Ignoring dry deposition of ', & - TRIM(drydep_list(N)) - nIgnored = nIgnored + 1 - ENDIF - ENDDO + nSls = 0 + DO I = 1, nSpec + ! Get the name of the species from KPP + line = ADJUSTL(TRIM(Spc_Names(I))) + ! Only add this + validSLS = ( .NOT. ANY(TRIM(line) .EQ. tracerNames) ) + IF (validSLS) THEN + ! Genuine new short-lived species + nSls = nSls + 1 + slsNames(nSls) = TRIM(line) + ENDIF + ENDDO - IF ( nIgnored > 0 ) THEN - Write(iulog,'(a,a)') ' The species listed above have dry', & - ' deposition turned off for one of the following reasons:' - Write(iulog,'(a)') ' - They are not present in the GEOS-Chem tracer list.' - Write(iulog,'(a)') ' - They have a synonym (e.g. CH2O and HCHO).' - ENDIF + !============================================================== + ! Get mapping between dry deposition species and species set + !============================================================== - !============================================================== - ! Print summary - !============================================================== - - Write(iulog,'(/, a)') '### Summary of GEOS-Chem species: ' - Write(iulog,'( a)') REPEAT( '-', 50 ) - Write(iulog,'( a)') '+ List of advected species: ' - Write(iulog,100) 'ID', 'Tracer', 'Dry deposition (T/F)' - DO N = 1, nTracers - Write(iulog,120) N, TRIM(tracerNames(N)), ANY(drySpc_ndx .eq. N) - ENDDO - IF ( nAer > 0 ) THEN - Write(iulog,'(/, a)') '+ List of aerosols: ' - Write(iulog,110) 'ID', 'MAM4 Aerosol' - DO N = 1, nAer - Write(iulog,130) N, TRIM(aerNames(N)) - ENDDO - ENDIF - Write(iulog,'(/, a)') '+ List of short-lived species: ' - DO N = 1, nSls - Write(iulog,130) N, TRIM(slsNames(N)) - ENDDO - - 100 FORMAT( 1x, A3, 3x, A10, 1x, A25 ) - 110 FORMAT( 1x, A3, 3x, A15 ) - 120 FORMAT( 1x, I3, 3x, A10, 1x, L15 ) - 130 FORMAT( 1x, I3, 3x, A10 ) - - !============================================================== - - unitn = getunit() - OPEN( unitn, FILE=TRIM(nlfile), STATUS='old' ) - CALL find_group_name(unitn, 'chem_inparm', STATUS=IERR) - IF (IERR == 0) THEN - READ(unitn, chem_inparm, IOSTAT=IERR) - IF (IERR /= 0) THEN - CALL endrun('chem_readnl: ERROR reading namelist') - ENDIF - ENDIF - CLOSE(unitn) - CALL freeunit(unitn) + DO N = 1, nddvels + + ! The species names need to be convert to upper case as, + ! for instance, BR2 != Br2 + drySpc_ndx(N) = get_spc_ndx( to_upper(drydep_list(N)) ) + + IF ( drySpc_ndx(N) < 0 ) THEN + Write(iulog,'(a,a)') ' ## Ignoring dry deposition of ', & + TRIM(drydep_list(N)) + nIgnored = nIgnored + 1 + ENDIF + ENDDO + + IF ( nIgnored > 0 ) THEN + Write(iulog,'(a,a)') ' The species listed above have dry', & + ' deposition turned off for one of the following reasons:' + Write(iulog,'(a)') ' - They are not present in the GEOS-Chem tracer list.' + Write(iulog,'(a)') ' - They have a synonym (e.g. CH2O and HCHO).' + ENDIF + + !============================================================== + ! Print summary + !============================================================== + + Write(iulog,'(/, a)') '### Summary of GEOS-Chem species: ' + Write(iulog,'( a)') REPEAT( '-', 50 ) + Write(iulog,'( a)') '+ List of advected species: ' + Write(iulog,100) 'ID', 'Tracer', 'Dry deposition (T/F)' + DO N = 1, nTracers + Write(iulog,120) N, TRIM(tracerNames(N)), ANY(drySpc_ndx .eq. N) + ENDDO + IF ( nAer > 0 ) THEN + Write(iulog,'(/, a)') '+ List of aerosols: ' + Write(iulog,110) 'ID', 'MAM4 Aerosol' + DO N = 1, nAer + Write(iulog,130) N, TRIM(aerNames(N)) + ENDDO + ENDIF + Write(iulog,'(/, a)') '+ List of short-lived species: ' + DO N = 1, nSls + Write(iulog,130) N, TRIM(slsNames(N)) + ENDDO + + 100 FORMAT( 1x, A3, 3x, A10, 1x, A25 ) + 110 FORMAT( 1x, A3, 3x, A15 ) + 120 FORMAT( 1x, I3, 3x, A10, 1x, L15 ) + 130 FORMAT( 1x, I3, 3x, A10 ) + + !============================================================== + + unitn = getunit() + OPEN( unitn, FILE=TRIM(nlfile), STATUS='old' ) + CALL find_group_name(unitn, 'chem_inparm', STATUS=IERR) + IF (IERR == 0) THEN + READ(unitn, chem_inparm, IOSTAT=IERR) + IF (IERR /= 0) THEN + CALL endrun('chem_readnl: ERROR reading namelist') + ENDIF + ENDIF + CLOSE(unitn) + CALL freeunit(unitn) ENDIF @@ -886,7 +885,7 @@ subroutine chem_readnl(nlfile) ALLOCATE(slvd_ref_MMR(nSlvd), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating slvd_ref_MMR') DO I = 1, nSls - slvd_Lst(I) = TRIM(slsNames(I)) + slvd_Lst(I) = TRIM(slsNames(I)) ENDDO end subroutine chem_readnl @@ -1090,51 +1089,51 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%LUCX = .True. IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered within call to "Set_Input_Opt"!' - CALL Error_Stop( ErrMsg, ThisLoc ) + ErrMsg = 'Error encountered within call to "Set_Input_Opt"!' + CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF DO I = BEGCHUNK, ENDCHUNK - ! Only treat the first chunk as the "root" - am_I_Root = ((I.EQ.BEGCHUNK) .and. MasterProc) + ! Only treat the first chunk as the "root" + am_I_Root = ((I.EQ.BEGCHUNK) .and. MasterProc) - ! Initialize fields of the Grid State object - CALL Init_State_Grid( am_I_Root = am_I_Root, & - State_Grid = State_Grid(I), & - RC = RC ) + ! Initialize fields of the Grid State object + CALL Init_State_Grid( am_I_Root = am_I_Root, & + State_Grid = State_Grid(I), & + RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered within call to "Init_State_Grid"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "Init_State_Grid"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF - State_Grid(I)%NX = nX - State_Grid(I)%NY = nY - State_Grid(I)%NZ = nZ + State_Grid(I)%NX = nX + State_Grid(I)%NY = nY + State_Grid(I)%NZ = nZ - ! Initialize GEOS-Chem horizontal grid structure - CALL GC_Init_Grid( am_I_Root = am_I_Root, & - Input_Opt = Input_Opt, & - State_Grid = State_Grid(I), & - RC = RC ) + ! Initialize GEOS-Chem horizontal grid structure + CALL GC_Init_Grid( am_I_Root = am_I_Root, & + Input_Opt = Input_Opt, & + State_Grid = State_Grid(I), & + RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered within call to "GC_Init_Grid"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "GC_Init_Grid"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF - ! Define more variables for State_Grid - ! TMMF, might need tweaking - State_Grid(I)%MaxTropLev = MIN(40, nZ) - State_Grid(I)%MaxStratLev = MIN(59, nZ) + ! Define more variables for State_Grid + ! TMMF, might need tweaking + State_Grid(I)%MaxTropLev = MIN(40, nZ) + State_Grid(I)%MaxStratLev = MIN(59, nZ) - ! Set maximum number of levels in the chemistry grid - IF ( Input_Opt%LUCX ) THEN - State_Grid(I)%MaxChemLev = State_Grid(I)%MaxStratLev - ELSE - State_Grid(I)%MaxChemLev = State_Grid(I)%MaxTropLev - ENDIF + ! Set maximum number of levels in the chemistry grid + IF ( Input_Opt%LUCX ) THEN + State_Grid(I)%MaxChemLev = State_Grid(I)%MaxStratLev + ELSE + State_Grid(I)%MaxChemLev = State_Grid(I)%MaxTropLev + ENDIF ENDDO @@ -1202,11 +1201,11 @@ subroutine chem_init(phys_state, pbuf2d) ! Now READ_ADVECTED_SPECIES_MENU Input_Opt%N_Advect = nTracers IF (Input_Opt%N_Advect.GT.Input_Opt%Max_AdvectSpc) THEN - CALL ENDRUN('Number of tracers exceeds max count') + CALL ENDRUN('Number of tracers exceeds max count') ENDIF ! Assign tracer names DO J = 1, Input_Opt%N_Advect - Input_Opt%AdvectSpc_Name(J) = TRIM(tracerNames(J)) + Input_Opt%AdvectSpc_Name(J) = TRIM(tracerNames(J)) ENDDO ! No tagged species Input_Opt%LSplit = .False. @@ -1322,35 +1321,35 @@ subroutine chem_init(phys_state, pbuf2d) ! broadcast to all other CPUs, and finally duplicate the data into every ! copy of Input_Opt IF ( Input_Opt%LLinoz ) THEN - ! Allocate array for broadcast - nLinoz = Input_Opt%Linoz_NLevels * & - Input_Opt%Linoz_NLat * & - Input_Opt%Linoz_NMonths * & - Input_Opt%Linoz_NFields - ALLOCATE( linozData( Input_Opt%Linoz_NLevels, & - Input_Opt%Linoz_NLat, & - Input_Opt%Linoz_NMonths, & - Input_Opt%Linoz_NFields ), STAT=IERR) - IF (IERR.NE.0) CALL ENDRUN('Failure while allocating linozData') - linozData = 0.0e+0_r8 - - IF ( MasterProc ) THEN - ! Read data in to Input_Opt%Linoz_TParm - CALL Linoz_Read( MasterProc, Input_Opt, RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Linoz_Read"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ! Copy the data to a temporary array - linozData = REAL(Input_Opt%LINOZ_TPARM, r8) - ENDIF + ! Allocate array for broadcast + nLinoz = Input_Opt%Linoz_NLevels * & + Input_Opt%Linoz_NLat * & + Input_Opt%Linoz_NMonths * & + Input_Opt%Linoz_NFields + ALLOCATE( linozData( Input_Opt%Linoz_NLevels, & + Input_Opt%Linoz_NLat, & + Input_Opt%Linoz_NMonths, & + Input_Opt%Linoz_NFields ), STAT=IERR) + IF (IERR.NE.0) CALL ENDRUN('Failure while allocating linozData') + linozData = 0.0e+0_r8 + + IF ( MasterProc ) THEN + ! Read data in to Input_Opt%Linoz_TParm + CALL Linoz_Read( MasterProc, Input_Opt, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Linoz_Read"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ! Copy the data to a temporary array + linozData = REAL(Input_Opt%LINOZ_TPARM, r8) + ENDIF #if defined( SPMD ) - CALL MPIBCAST( linozData, nLinoz, MPIR8, 0, MPICOM ) + CALL MPIBCAST( linozData, nLinoz, MPIR8, 0, MPICOM ) #endif - IF ( .NOT. MasterProc ) THEN - Input_Opt%LINOZ_TPARM = REAL(linozData,fp) - ENDIF - DEALLOCATE(linozData) + IF ( .NOT. MasterProc ) THEN + Input_Opt%LINOZ_TPARM = REAL(linozData,fp) + ENDIF + DEALLOCATE(linozData) ENDIF @@ -1372,46 +1371,46 @@ subroutine chem_init(phys_state, pbuf2d) ! TODO: This needs more refinement. For now, this generates identical ! State_Grid for all chunks DO L = BEGCHUNK, ENDCHUNK - lonMidArr = 0.0e+0_f4 - latMidArr = 0.0e+0_f4 - dLonFix = 360.0e+0_fp / REAL(nX,fp) - dLatFix = 180.0e+0_fp / REAL(nY,fp) - DO I = 1, nX - ! Center of box, assuming dateline edge - lonVal = -180.0e+0_fp + (REAL(I-1,fp)*dLonFix) - DO J = 1, nY - ! Center of box, assuming regular cells - latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) - lonMidArr(I,J) = REAL((lonVal + (0.5e+0_fp * dLonFix)) * PI_180, f4) - latMidArr(I,J) = REAL((latVal + (0.5e+0_fp * dLatFix)) * PI_180, f4) - - ! Edges of box, assuming regular cells - lonEdgeArr(I,J) = REAL(lonVal * PI_180, f4) - latEdgeArr(I,J) = REAL(latVal * PI_180, f4) - ENDDO - ! Edges of box, assuming regular cells - lonEdgeArr(I,nY+1) = REAL((lonVal + dLonFix) * PI_180, f4) - latEdgeArr(I,nY+1) = REAL((latVal + dLatFix) * PI_180, f4) - ENDDO - DO J = 1, nY+1 - ! Edges of box, assuming regular cells - latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) - lonEdgeArr(nX+1,J) = REAL((lonVal + dLonFix) * PI_180, f4) - latEdgeArr(nX+1,J) = REAL((latVal) * PI_180, f4) - ENDDO - - CALL SetGridFromCtrEdges( am_I_Root = MasterProc, & - State_Grid = State_Grid(L), & - lonCtr = lonMidArr, & - latCtr = latMidArr, & - lonEdge = lonEdgeArr, & - latEdge = latEdgeArr, & - RC = RC ) + lonMidArr = 0.0e+0_f4 + latMidArr = 0.0e+0_f4 + dLonFix = 360.0e+0_fp / REAL(nX,fp) + dLatFix = 180.0e+0_fp / REAL(nY,fp) + DO I = 1, nX + ! Center of box, assuming dateline edge + lonVal = -180.0e+0_fp + (REAL(I-1,fp)*dLonFix) + DO J = 1, nY + ! Center of box, assuming regular cells + latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) + lonMidArr(I,J) = REAL((lonVal + (0.5e+0_fp * dLonFix)) * PI_180, f4) + latMidArr(I,J) = REAL((latVal + (0.5e+0_fp * dLatFix)) * PI_180, f4) + + ! Edges of box, assuming regular cells + lonEdgeArr(I,J) = REAL(lonVal * PI_180, f4) + latEdgeArr(I,J) = REAL(latVal * PI_180, f4) + ENDDO + ! Edges of box, assuming regular cells + lonEdgeArr(I,nY+1) = REAL((lonVal + dLonFix) * PI_180, f4) + latEdgeArr(I,nY+1) = REAL((latVal + dLatFix) * PI_180, f4) + ENDDO + DO J = 1, nY+1 + ! Edges of box, assuming regular cells + latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) + lonEdgeArr(nX+1,J) = REAL((lonVal + dLonFix) * PI_180, f4) + latEdgeArr(nX+1,J) = REAL((latVal) * PI_180, f4) + ENDDO - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "SetGridFromCtrEdges"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + CALL SetGridFromCtrEdges( am_I_Root = MasterProc, & + State_Grid = State_Grid(L), & + lonCtr = lonMidArr, & + latCtr = latMidArr, & + lonEdge = lonEdgeArr, & + latEdge = latEdgeArr, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "SetGridFromCtrEdges"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDDO DEALLOCATE(lonMidArr) @@ -1462,91 +1461,91 @@ subroutine chem_init(phys_state, pbuf2d) !IF ( prtDebug ) CALL Print_DiagList( am_I_Root, Diag_List, RC ) DO I = BEGCHUNK, ENDCHUNK - am_I_Root = (MasterProc .AND. (I == BEGCHUNK)) - - CALL GC_Init_StateObj( am_I_Root = am_I_Root, & ! Root CPU (Y/N)? - & Diag_List = Diag_List, & ! Diagnostic list obj - & Input_Opt = Input_Opt, & ! Input Options - & State_Chm = State_Chm(I), & ! Chemistry State - & State_Diag = State_Diag(I), & ! Diagnostics State - & State_Grid = State_Grid(I), & ! Grid State - & State_Met = State_Met(I), & ! Meteorology State - & RC = RC ) ! Success or failure - - ! Trap potential errors - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "GC_Init_StateObj"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + am_I_Root = (MasterProc .AND. (I == BEGCHUNK)) + + CALL GC_Init_StateObj( am_I_Root = am_I_Root, & ! Root CPU (Y/N)? + & Diag_List = Diag_List, & ! Diagnostic list obj + & Input_Opt = Input_Opt, & ! Input Options + & State_Chm = State_Chm(I), & ! Chemistry State + & State_Diag = State_Diag(I), & ! Diagnostics State + & State_Grid = State_Grid(I), & ! Grid State + & State_Met = State_Met(I), & ! Meteorology State + & RC = RC ) ! Success or failure - ! Start with v/v dry (CAM standard) - State_Chm(I)%Spc_Units = 'v/v dry' + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "GC_Init_StateObj"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Start with v/v dry (CAM standard) + State_Chm(I)%Spc_Units = 'v/v dry' ENDDO ! Now replicate GC_Init_Extra IF ( Input_Opt%LDryD ) THEN - ! Setup for dry deposition - CALL Init_Drydep( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + ! Setup for dry deposition + CALL Init_Drydep( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Drydep"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Drydep"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF - !============================================================== - ! Get mapping between CESM dry deposited species and the - ! indices of State_Chm%DryDepVel. This needs to be done after - ! Init_Drydep - ! Thibaud M. Fritz - 04 Mar 2020 - !============================================================== + !============================================================== + ! Get mapping between CESM dry deposited species and the + ! indices of State_Chm%DryDepVel. This needs to be done after + ! Init_Drydep + ! Thibaud M. Fritz - 04 Mar 2020 + !============================================================== - ALLOCATE(map2GC_dryDep(nddvels), STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate map2GC_dryDep') + ALLOCATE(map2GC_dryDep(nddvels), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate map2GC_dryDep') - DO N = 1, nddvels + DO N = 1, nddvels - ! Initialize index to -1 - map2GC_dryDep(N) = -1 + ! Initialize index to -1 + map2GC_dryDep(N) = -1 - IF ( drySpc_ndx(N) > 0 ) THEN + IF ( drySpc_ndx(N) > 0 ) THEN - ! Convert to upper case - SpcName = to_upper(drydep_list(N)) + ! Convert to upper case + SpcName = to_upper(drydep_list(N)) - DO I = 1, State_Chm(BEGCHUNK)%nDryDep - IF ( TRIM( SpcName ) == TRIM( to_upper(depName(I)) ) ) THEN - map2GC_dryDep(N) = nDVZind(I) - EXIT - ENDIF - ENDDO + DO I = 1, State_Chm(BEGCHUNK)%nDryDep + IF ( TRIM( SpcName ) == TRIM( to_upper(depName(I)) ) ) THEN + map2GC_dryDep(N) = nDVZind(I) + EXIT + ENDIF + ENDDO - ENDIF + ENDIF - ENDDO + ENDDO #if ( OCNDDVEL_MOZART ) - !============================================================== - ! The following line should only be called if we compute - ! velocities over the ocean and ice in a MOZART-like way. - ! Thibaud M. Fritz - 26 Feb 2020 - !============================================================== - - IF ( drydep_method == DD_XLND ) THEN - CALL drydep_inti( depvel_lnd_file, & - clim_soilw_file, & - season_wes_file ) - ELSE - Write(iulog,'(a,a)') ' drydep_method is set to: ', TRIM(drydep_method) - CALL ENDRUN('drydep_method must be DD_XLND to compute dry deposition' // & - ' velocities similarly to MOZART over ocean and ice!') - ENDIF + !============================================================== + ! The following line should only be called if we compute + ! velocities over the ocean and ice in a MOZART-like way. + ! Thibaud M. Fritz - 26 Feb 2020 + !============================================================== + + IF ( drydep_method == DD_XLND ) THEN + CALL drydep_inti( depvel_lnd_file, & + clim_soilw_file, & + season_wes_file ) + ELSE + Write(iulog,'(a,a)') ' drydep_method is set to: ', TRIM(drydep_method) + CALL ENDRUN('drydep_method must be DD_XLND to compute dry deposition' // & + ' velocities similarly to MOZART over ocean and ice!') + ENDIF #endif ENDIF @@ -1557,12 +1556,12 @@ subroutine chem_init(phys_state, pbuf2d) ! Initialize land maps for aerosol dry deposition IF ( drydep_method == DD_XLND ) THEN - CALL drydep_inti_landuse( depvel_lnd_file, & - clim_soilw_file ) + CALL drydep_inti_landuse( depvel_lnd_file, & + clim_soilw_file ) ELSE - Write(iulog,'(a,a)') ' drydep_method is set to: ', TRIM(drydep_method) - CALL ENDRUN('drydep_method must be DD_XLND to compute land maps for aerosol' // & - ' dry deposition!') + Write(iulog,'(a,a)') ' drydep_method is set to: ', TRIM(drydep_method) + CALL ENDRUN('drydep_method must be DD_XLND to compute land maps for aerosol' // & + ' dry deposition!') ENDIF #endif @@ -1580,17 +1579,17 @@ subroutine chem_init(phys_state, pbuf2d) IF ( Input_Opt%LConv .OR. & Input_Opt%LWetD .OR. & Input_Opt%LChem ) THEN - CALL Init_WetScav( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + CALL Init_WetScav( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_WetScav"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_WetScav"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDIF !----------------------------------------------------------------- @@ -1619,98 +1618,98 @@ subroutine chem_init(phys_state, pbuf2d) !& RC = RC ) ! !IF (RC /= GC_SUCCESS) THEN - ! ErrMsg = 'Error encountered in "Init_Get_NDep"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) + ! ErrMsg = 'Error encountered in "Init_Get_NDep"!' + ! CALL Error_Stop( ErrMsg, ThisLoc ) !ENDIF !----------------------------------------------------------------- ! Initialize "carbon_mod.F" !----------------------------------------------------------------- IF ( Input_Opt%LCarb ) THEN - CALL Init_Carbon( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + CALL Init_Carbon( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Carbon"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Carbon"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDIF IF ( Input_Opt%LDust ) THEN - CALL Init_Dust( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + CALL Init_Dust( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Dust"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Dust"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDIF IF ( Input_Opt%LSSalt ) THEN - CALL Init_Seasalt( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + CALL Init_Seasalt( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Seasalt"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Seasalt"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDIF IF ( Input_Opt%LSulf ) THEN - CALL Init_Sulfate( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + CALL Init_Sulfate( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Sulfate"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Sulfate"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDIF IF ( Input_Opt%LSulf .OR. & Input_Opt%LCarb .OR. & Input_Opt%LDust .OR. & Input_Opt%LSSalt ) THEN - CALL Init_Aerosol( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + CALL Init_Aerosol( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Aerosol"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Aerosol"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDIF IF ( Input_Opt%LChem ) THEN - CALL Init_Toms( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + CALL Init_Toms( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_TOMS"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_TOMS"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDIF ! This is a bare subroutine - no module @@ -1721,8 +1720,8 @@ subroutine chem_init(phys_state, pbuf2d) & RC ) IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_NDXX_Setup"!' - CALL Error_Stop( ErrMsg, ThisLoc ) + ErrMsg = 'Error encountered in "Init_NDXX_Setup"!' + CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF CALL Init_PBL_Mix( am_I_Root = MasterProc, & @@ -1730,32 +1729,31 @@ subroutine chem_init(phys_state, pbuf2d) RC = RC ) IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_PBL_Mix"!' - CALL Error_Stop( ErrMsg, ThisLoc ) + ErrMsg = 'Error encountered in "Init_PBL_Mix"!' + CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF ! Set grid-cell area DO I = BEGCHUNK, ENDCHUNK - ALLOCATE(Col_Area(NCOL(I)), STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Col_Area') + ALLOCATE(Col_Area(NCOL(I)), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Col_Area') - CALL Get_Area_All_p(I, NCOL(I), Col_Area) + CALL Get_Area_All_p(I, NCOL(I), Col_Area) - ! Set default value (in case of chunks with fewer columns) - State_Grid(I)%Area_M2 = 1.0e+10_fp - DO iX = 1, nX - DO jY = 1, NCOL(I) - State_Grid(I)%Area_M2(iX,jY) = REAL(Col_Area(jY) * Re**2,fp) - ENDDO - ENDDO + ! Set default value (in case of chunks with fewer columns) + State_Grid(I)%Area_M2 = 1.0e+10_fp + DO iX = 1, nX + DO jY = 1, NCOL(I) + State_Grid(I)%Area_M2(iX,jY) = REAL(Col_Area(jY) * Re**2,fp) + ENDDO + ENDDO - DEALLOCATE(Col_Area) + DEALLOCATE(Col_Area) - ! Copy to State_Met(I)%Area_M2 - State_Met(I)%Area_M2 = State_Grid(I)%Area_M2 + ! Copy to State_Met(I)%Area_M2 + State_Met(I)%Area_M2 = State_Grid(I)%Area_M2 ENDDO - ! Initialize (mostly unused) diagnostic arrays ! WARNING: This routine likely calls on modules which are currently ! excluded from the GC-CESM build (eg diag03) @@ -1770,7 +1768,7 @@ subroutine chem_init(phys_state, pbuf2d) Ap_CAM_Flip = 0.0e+0_fp Bp_CAM_Flip = 0.0e+0_fp - DO I = 1, (nZ+1) + DO I = 1, nZ+1 Ap_CAM_Flip(I) = hyai(nZ+2-I) * ps0 * 0.01e+0_r8 Bp_CAM_Flip(I) = hybi(nZ+2-I) ENDDO @@ -1799,12 +1797,12 @@ subroutine chem_init(phys_state, pbuf2d) ! Print vertical coordinates IF ( MasterProc ) THEN - WRITE( 6, '(a)' ) REPEAT( '=', 79 ) - WRITE( 6, '(a,/)' ) 'V E R T I C A L G R I D S E T U P' - WRITE( 6, '( ''Ap '', /, 6(f11.6,1x) )' ) Ap_CAM_Flip(1:State_Grid(BEGCHUNK)%NZ+1) - WRITE( 6, '(a)' ) - WRITE( 6, '( ''Bp '', /, 6(f11.6,1x) )' ) Bp_CAM_Flip(1:State_Grid(BEGCHUNK)%NZ+1) - WRITE( 6, '(a)' ) REPEAT( '=', 79 ) + WRITE( 6, '(a)' ) REPEAT( '=', 79 ) + WRITE( 6, '(a,/)' ) 'V E R T I C A L G R I D S E T U P' + WRITE( 6, '( ''Ap '', /, 6(f11.6,1x) )' ) Ap_CAM_Flip(1:State_Grid(BEGCHUNK)%NZ+1) + WRITE( 6, '(a)' ) + WRITE( 6, '( ''Bp '', /, 6(f11.6,1x) )' ) Bp_CAM_Flip(1:State_Grid(BEGCHUNK)%NZ+1) + WRITE( 6, '(a)' ) REPEAT( '=', 79 ) ENDIF ! Trapping errors @@ -1876,26 +1874,26 @@ subroutine chem_init(phys_state, pbuf2d) IF ( Input_Opt%Its_A_FullChem_Sim .OR. & Input_Opt%Its_An_Aerosol_Sim ) THEN ! This also initializes Fast-JX - CALL Init_Chemistry( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + CALL Init_Chemistry( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK), & + & RC = RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Chemistry"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Chemistry"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDIF IF ( Input_Opt%LChem .AND. & Input_Opt%LUCX ) THEN - CALL Init_UCX( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK) ) + CALL Init_UCX( am_I_Root = MasterProc, & + & Input_Opt = Input_Opt, & + & State_Chm = State_Chm(BEGCHUNK), & + & State_Diag = State_Diag(BEGCHUNK), & + & State_Grid = State_Grid(BEGCHUNK) ) ENDIF ! Get the index of H2O @@ -1924,17 +1922,17 @@ subroutine chem_init(phys_state, pbuf2d) ! Note that constituents are already output by default ! Add all species as output fields if desired DO I = 1, nTracers - SpcName = TRIM(tracerNames(I)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(tracerLongNames(I))//' concentration') - IF (TRIM(SpcName) == 'O3') THEN - CALL Add_Default ( TRIM(SpcName), 1, ' ') - ENDIF + SpcName = TRIM(tracerNames(I)) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(tracerLongNames(I))//' concentration') + IF (TRIM(SpcName) == 'O3') THEN + CALL Add_Default ( TRIM(SpcName), 1, ' ') + ENDIF ENDDO DO I =1, nSls - SpcName = TRIM(slsNames(I)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(slsLongNames(I))//' concentration') - !CALL Add_Default(TRIM(SpcName), 1, '') + SpcName = TRIM(slsNames(I)) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(slsLongNames(I))//' concentration') + !CALL Add_Default(TRIM(SpcName), 1, '') ENDDO ! Initialize emissions interface (this will eventually handle HEMCO) @@ -2208,10 +2206,10 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) lonMidArr = 0.0e+0_f4 latMidArr = 0.0e+0_f4 DO I = 1, nX - DO J = 1, nY - lonMidArr(I,J) = REAL(Rlons(J), f4) - latMidArr(I,J) = REAL(Rlats(J), f4) - ENDDO + DO J = 1, nY + lonMidArr(I,J) = REAL(Rlons(J), f4) + latMidArr(I,J) = REAL(Rlats(J), f4) + ENDDO ENDDO ! Update the grid @@ -2222,8 +2220,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) RC = RC ) IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered within call to "SetGridFromCtr"!' - CALL Error_Stop( ErrMsg, ThisLoc ) + ErrMsg = 'Error encountered within call to "SetGridFromCtr"!' + CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF ! Set area @@ -2236,7 +2234,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Note : Set default value (in case of chunks with fewer columns) State_Grid(LCHNK)%Area_M2 = 1.0e+10_fp DO J = 1, nY - State_Grid(LCHNK)%Area_M2(1,J) = REAL(Col_Area(J) * Re**2,fp) + State_Grid(LCHNK)%Area_M2(1,J) = REAL(Col_Area(J) * Re**2,fp) ENDDO State_Met(LCHNK)%Area_M2 = State_Grid(LCHNK)%Area_M2 @@ -2251,18 +2249,16 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Map and flip gaseous species MMR_Beg = 0.0e+0_r8 DO N = 1, pcnst - M = map2GC(N) - IF (M > 0) THEN - I = 1 - DO J = 1, nY - DO K = 1, nZ - ! CURRENTLY KG/KG DRY - MMR_Beg(J,K,M) = State%q(J,nZ+1-K,N) - State_Chm(LCHNK)%Species(1,J,K,M) = REAL(MMR_Beg(J,K,M),fp) - ENDDO - ENDDO - lq(N) = .TRUE. - ENDIF + M = map2GC(N) + IF (M > 0) THEN + DO J = 1, nY + DO K = 1, nZ + MMR_Beg(J,K,M) = State%q(J,nZ+1-K,N) + State_Chm(LCHNK)%Species(1,J,K,M) = REAL(MMR_Beg(J,K,M),fp) + ENDDO + ENDDO + lq(N) = .TRUE. + ENDIF ENDDO ! Retrieve previous value of species data @@ -2271,14 +2267,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Map and flip gaseous short-lived species DO N = 1, nSls - M = map2GC_Sls(N) - IF (M > 0) THEN - DO J = 1, nY - DO K = 1, nZ - State_Chm(LCHNK)%Species(1,J,K,M) = REAL(SlsData(J,nZ+1-K,N),fp) - ENDDO - ENDDO - ENDIF + M = map2GC_Sls(N) + IF (M > 0) THEN + DO J = 1, nY + DO K = 1, nZ + State_Chm(LCHNK)%Species(1,J,K,M) = REAL(SlsData(J,nZ+1-K,N),fp) + ENDDO + ENDDO + ENDIF ENDDO #if defined( MODAL_AERO_4MODE ) @@ -2290,10 +2286,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Multiple MAM4 bins are mapped to same GEOS-Chem species IF ( P > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - State_Chm(LCHNK)%Species(1,J,K,P) = State_Chm(LCHNK)%Species(1,J,K,P) & - + REAL(State%q(J,nZ+1-K,N),fp) - ENDDO + DO K = 1, nZ + MMR_Beg(J,K,M) = State%q(J,nZ+1-K,N) + State_Chm(LCHNK)%Species(1,J,K,P) = State_Chm(LCHNK)%Species(1,J,K,P) & + + REAL(State%q(J,nZ+1-K,N),fp) + ENDDO ENDDO ENDIF ENDDO @@ -2324,32 +2321,32 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) qH2O = 0.0e0_fp ! Note MWDRY = 28.966 g/mol DO J = 1, nY - DO L = 1, nZ - qH2O(J,L) = REAL(State_Chm(LCHNK)%Species(1,J,L,iH2O),r8) - H2OVMR(J,L) = qH2O(J,L) * MWDry / 18.016e+0_fp - ENDDO + DO L = 1, nZ + qH2O(J,L) = REAL(State_Chm(LCHNK)%Species(1,J,L,iH2O),r8) + H2OVMR(J,L) = qH2O(J,L) * MWDry / 18.016e+0_fp + ENDDO ENDDO ! Calculate RH (range 0-1, note still level 1 = TOA) relHum(:,:) = 0.0e+0_r8 CALL QSat(State%T(:nY,:), State%Pmid(:nY,:), SatV, SatQ) DO J = 1, nY - DO L = 1, nZ - relHum(J,L) = 0.622e+0_r8 * H2OVMR(J,L) / SatQ(J,L) - relHum(J,L) = MAX( 0.0e+0_r8, MIN( 1.0e+0_r8, relHum(J,L) ) ) - ENDDO + DO L = 1, nZ + relHum(J,L) = 0.622e+0_r8 * H2OVMR(J,L) / SatQ(J,L) + relHum(J,L) = MAX( 0.0e+0_r8, MIN( 1.0e+0_r8, relHum(J,L) ) ) + ENDDO ENDDO Z0 = 0.0e+0_r8 DO J = 1, nY - Z0(J) = cam_in%landFrac(J) * zlnd & - + cam_in%iceFrac(J) * zsice & - + cam_in%ocnFrac(J) * zocn - IF (( cam_in%snowhLand(J) > 0.01_r8 ) .OR. & - ( cam_in%snowhIce(J) > 0.01_r8 )) THEN - ! Land is covered in snow - Z0(J) = zslnd - ENDIF + Z0(J) = cam_in%landFrac(J) * zlnd & + + cam_in%iceFrac(J) * zsice & + + cam_in%ocnFrac(J) * zocn + IF (( cam_in%snowhLand(J) > 0.01_r8 ) .OR. & + ( cam_in%snowhIce(J) > 0.01_r8 )) THEN + ! Land is covered in snow + Z0(J) = zslnd + ENDIF ENDDO ! Estimate cloud liquid water content and OD @@ -2359,55 +2356,55 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Note: all using CAM vertical convention (1 = TOA) ! Calculation is based on that done for MOZART DO J = 1, nY - DO L = nZ, 1, -1 - ! Convert water mixing ratio [kg/kg] to water content [g/m^3] - IF ( ( State%Q(J,L,ixCldLiq) + State%Q(J,L,ixCldIce) ) * & - State%PMid(J,L) / (State%T(J,L) * 287.0e+00_r8) * 1.0e+03_r8 <= 0.01_r8 .AND. & - cldFrc(J,L) /= 0.0e+00_r8 ) THEN - cld(J,L) = 0.0e+00_r8 - ELSE - cld(J,L) = cldFrc(J,L) - ENDIF - ENDDO + DO L = nZ, 1, -1 + ! Convert water mixing ratio [kg/kg] to water content [g/m^3] + IF ( ( State%Q(J,L,ixCldLiq) + State%Q(J,L,ixCldIce) ) * & + State%PMid(J,L) / (State%T(J,L) * 287.0e+00_r8) * 1.0e+03_r8 <= 0.01_r8 .AND. & + cldFrc(J,L) /= 0.0e+00_r8 ) THEN + cld(J,L) = 0.0e+00_r8 + ELSE + cld(J,L) = cldFrc(J,L) + ENDIF + ENDDO ENDDO DO J = 1, nY - IF ( COUNT( cld(J,:nZ) > cldMin ) > 0 ) THEN - DO L = nZ, 1, -1 - ! ================================================================= - ! =========== Compute cloud optical depth based on ============ - ! =========== Liao et al. JGR, 104, 23697, 1999 ============ - ! ================================================================= - ! - ! Tau = 3/2 * LWC * dZ / ( \rho_w * r_e ) - ! dZ = - dP / ( \rho_air * g ) - ! since Pint is ascending, we can neglect the minus sign - ! - ! Tau = 3/2 * LWC * dP / ( \rho_air * r_e * \rho_w * g ) - ! LWC / \rho_air = Q - ! - ! Tau = 3/2 * Q * dP / ( r_e * rho_w * g ) - ! Tau(K) = 3/2 * Q(K) * (Pint(K+1) - Pint(K)) / (re * rho_w * g ) - ! Tau(K) = Q(K) * (Pint(K+1) - Pint(K)) * Cnst - ! - ! Unit check: | - ! Q : [kg H2O/kg air] | - ! Pint : [Pa]=[kg air/m/s^2] | - ! re : [m] | = 1.0e-5 - ! rho_w: [kg H2O/m^3] | = 1.0e+3 - ! g : [m/s^2] | = 9.81 - ! - TauClw(J,L) = State%Q(J,L,ixCldLiq) & - * (State%Pint(J,L+1)-State%Pint(J,L)) & - * cnst - TauClw(J,L) = MAX(TauClw(J,L), 0.0e+00_r8) - TauCli(J,L) = State%Q(J,L,ixCldIce) & - * (State%Pint(J,L+1)-State%Pint(J,L)) & - * cnst - TauCli(J,L) = MAX(TauCli(J,L), 0.0e+00_r8) - - ENDDO - ENDIF + IF ( COUNT( cld(J,:nZ) > cldMin ) > 0 ) THEN + DO L = nZ, 1, -1 + ! ================================================================= + ! =========== Compute cloud optical depth based on ============ + ! =========== Liao et al. JGR, 104, 23697, 1999 ============ + ! ================================================================= + ! + ! Tau = 3/2 * LWC * dZ / ( \rho_w * r_e ) + ! dZ = - dP / ( \rho_air * g ) + ! since Pint is ascending, we can neglect the minus sign + ! + ! Tau = 3/2 * LWC * dP / ( \rho_air * r_e * \rho_w * g ) + ! LWC / \rho_air = Q + ! + ! Tau = 3/2 * Q * dP / ( r_e * rho_w * g ) + ! Tau(K) = 3/2 * Q(K) * (Pint(K+1) - Pint(K)) / (re * rho_w * g ) + ! Tau(K) = Q(K) * (Pint(K+1) - Pint(K)) * Cnst + ! + ! Unit check: | + ! Q : [kg H2O/kg air] | + ! Pint : [Pa]=[kg air/m/s^2] | + ! re : [m] | = 1.0e-5 + ! rho_w: [kg H2O/m^3] | = 1.0e+3 + ! g : [m/s^2] | = 9.81 + ! + TauClw(J,L) = State%Q(J,L,ixCldLiq) & + * (State%Pint(J,L+1)-State%Pint(J,L)) & + * cnst + TauClw(J,L) = MAX(TauClw(J,L), 0.0e+00_r8) + TauCli(J,L) = State%Q(J,L,ixCldIce) & + * (State%Pint(J,L+1)-State%Pint(J,L)) & + * cnst + TauCli(J,L) = MAX(TauCli(J,L), 0.0e+00_r8) + + ENDDO + ENDIF ENDDO ! Retrieve tropopause level @@ -2416,21 +2413,21 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Back out the pressure Trop_P = 1000.0e+0_r8 DO J = 1, nY - Trop_P(J) = State%PMid(J,Trop_Lev(J)) * 0.01e+0_r8 + Trop_P(J) = State%PMid(J,Trop_Lev(J)) * 0.01e+0_r8 ENDDO ! Calculate snow depth snowDepth = 0.0e+0_r8 DO J = 1, nY - Sd_Ice = MAX(0.0e+0_r8,cam_in%snowhIce(J)) - Sd_Lnd = MAX(0.0e+0_r8,cam_in%snowhLand(J)) - Frc_Ice = MAX(0.0e+0_r8,cam_in%iceFrac(J)) - IF (Frc_Ice > 0.0e+0_r8) THEN - Sd_Avg = (Sd_Lnd*(1.0e+0_r8 - Frc_Ice)) + (Sd_Ice * Frc_Ice) - ELSE - Sd_Avg = Sd_Lnd - ENDIF - snowDepth(J) = Sd_Avg + Sd_Ice = MAX(0.0e+0_r8,cam_in%snowhIce(J)) + Sd_Lnd = MAX(0.0e+0_r8,cam_in%snowhLand(J)) + Frc_Ice = MAX(0.0e+0_r8,cam_in%iceFrac(J)) + IF (Frc_Ice > 0.0e+0_r8) THEN + Sd_Avg = (Sd_Lnd*(1.0e+0_r8 - Frc_Ice)) + (Sd_Ice * Frc_Ice) + ELSE + Sd_Avg = Sd_Lnd + ENDIF + snowDepth(J) = Sd_Avg ENDDO ! Field : ALBD @@ -2446,7 +2443,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Note : Estimate column cloud fraction as the maximum cloud ! fraction in the column (pessimistic assumption) DO J = 1, nY - State_Met(LCHNK)%CLDFRC(1,J) = MAXVAL(cldFrc(J,:)) + State_Met(LCHNK)%CLDFRC(1,J) = MAXVAL(cldFrc(J,:)) ENDDO ! Field : EFLUX, HFLUX @@ -2612,9 +2609,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Note : We here combine the land friction velocity (fv) with ! the ocean friction velocity (ustar) DO J = 1, nY - State_Met(LCHNK)%USTAR (1,J) = & - cam_in%fv(J) * ( cam_in%landFrac(J)) & - + cam_in%uStar(J) * ( 1.0e+0_fp - cam_in%landFrac(J)) + State_Met(LCHNK)%USTAR (1,J) = & + cam_in%fv(J) * ( cam_in%landFrac(J)) & + + cam_in%uStar(J) * ( 1.0e+0_fp - cam_in%landFrac(J)) ENDDO ! Field : Z0 @@ -2624,156 +2621,155 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%Z0 (1,:) = Z0(:) DO J = 1, nY - iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(1,J) + & - State_Met(LCHNK)%FRLANDIC(1,J) + & - State_Met(LCHNK)%FRLAKE(1,J), & - State_Met(LCHNK)%FRSEAICE(1,J), & - State_Met(LCHNK)%FROCEAN(1,J) - & - State_Met(LCHNK)%FRSEAICE(1,J) /) ) - IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 - ! reset ocean to 0 - - ! Field : LWI - ! Description: Land/water indices - ! Unit : - - ! Dimensions : nX, nY - State_Met(LCHNK)%LWI(1,J) = FLOAT( iMaxLoc(1) ) + iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(1,J) + & + State_Met(LCHNK)%FRLANDIC(1,J) + & + State_Met(LCHNK)%FRLAKE(1,J), & + State_Met(LCHNK)%FRSEAICE(1,J), & + State_Met(LCHNK)%FROCEAN(1,J) - & + State_Met(LCHNK)%FRSEAICE(1,J) /) ) + IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 + ! reset ocean to 0 + + ! Field : LWI + ! Description: Land/water indices + ! Unit : - + ! Dimensions : nX, nY + State_Met(LCHNK)%LWI(1,J) = FLOAT( iMaxLoc(1) ) ENDDO ! Three-dimensional fields on level edges DO J = 1, nY - DO L = 1, nZ+1 - ! Field : PEDGE - ! Description: Wet air pressure at (vertical) level edges - ! Unit : hPa - ! Dimensions : nX, nY, nZ+1 - State_Met(LCHNK)%PEDGE (1,J,L) = State%Pint(J,nZ+2-L)*0.01e+0_fp - - ! Field : CMFMC - ! Description: Upward moist convective mass flux - ! Unit : kg/m^2/s - ! Dimensions : nX, nY, nZ+1 - State_Met(LCHNK)%CMFMC (1,J,L) = 0.0e+0_fp - - ! Field : PFICU, PFLCU - ! Description: Downward flux of ice/liquid precipitation (convective) - ! Unit : kg/m^2/s - ! Dimensions : nX, nY, nZ+1 - State_Met(LCHNK)%PFICU (1,J,L) = 0.0e+0_fp - State_Met(LCHNK)%PFLCU (1,J,L) = 0.0e+0_fp - - ! Field : PFILSAN, PFLLSAN - ! Description: Downward flux of ice/liquid precipitation (Large-scale & anvil) - ! Unit : kg/m^2/s - ! Dimensions : nX, nY, nZ+1 - State_Met(LCHNK)%PFILSAN (1,J,L) = LsFlxSnw(j,nZ+2-L) ! kg/m2/s - State_Met(LCHNK)%PFLLSAN (1,J,L) = MAX(0.0e+0_fp,LsFlxPrc(J,nZ+2-L) - LsFlxSnw(J,nZ+2-L)) ! kg/m2/s - ENDDO + DO L = 1, nZ+1 + ! Field : PEDGE + ! Description: Wet air pressure at (vertical) level edges + ! Unit : hPa + ! Dimensions : nX, nY, nZ+1 + State_Met(LCHNK)%PEDGE (1,J,L) = State%Pint(J,nZ+2-L)*0.01e+0_fp + + ! Field : CMFMC + ! Description: Upward moist convective mass flux + ! Unit : kg/m^2/s + ! Dimensions : nX, nY, nZ+1 + State_Met(LCHNK)%CMFMC (1,J,L) = 0.0e+0_fp + + ! Field : PFICU, PFLCU + ! Description: Downward flux of ice/liquid precipitation (convective) + ! Unit : kg/m^2/s + ! Dimensions : nX, nY, nZ+1 + State_Met(LCHNK)%PFICU (1,J,L) = 0.0e+0_fp + State_Met(LCHNK)%PFLCU (1,J,L) = 0.0e+0_fp + + ! Field : PFILSAN, PFLLSAN + ! Description: Downward flux of ice/liquid precipitation (Large-scale & anvil) + ! Unit : kg/m^2/s + ! Dimensions : nX, nY, nZ+1 + State_Met(LCHNK)%PFILSAN (1,J,L) = LsFlxSnw(j,nZ+2-L) ! kg/m2/s + State_Met(LCHNK)%PFLLSAN (1,J,L) = MAX(0.0e+0_fp,LsFlxPrc(J,nZ+2-L) - LsFlxSnw(J,nZ+2-L)) ! kg/m2/s + ENDDO ENDDO DO J = 1, nY - ! Field : U, V - ! Description: Max cloud top height - ! Unit : level - ! Dimensions : nX, nY - State_Met(LCHNK)%cldTops(1,J) = nZ + 1 - NINT(cldTop(J)) + ! Field : U, V + ! Description: Max cloud top height + ! Unit : level + ! Dimensions : nX, nY + State_Met(LCHNK)%cldTops(1,J) = nZ + 1 - NINT(cldTop(J)) ENDDO ! Three-dimensional fields on level centers DO J = 1, nY - DO L = 1, nZ - - ! Field : U, V - ! Description: E/W and N/S component of wind - ! Unit : m/s - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%U (1,J,L) = State%U(J,nZ+1-L) - State_Met(LCHNK)%V (1,J,L) = State%V(J,nZ+1-L) - - ! Field : OMEGA - ! Description: Updraft velocity - ! Unit : Pa/s - ! Dimensions : nX, nY, nZ - !State_Met(LCHNK)%OMEGA (1,J,L) = State%Omega(J,nZ+1-L) - - ! Field : CLDF - ! Description: 3-D cloud fraction - ! Unit : - - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%CLDF (1,J,L) = cldFrc(j,nZ+1-l) - - ! Field : DTRAIN - ! Description: Detrainment flux - ! Unit : kg/m^2/s - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%DTRAIN (1,J,L) = 0.0e+0_fp ! Used in convection - - ! Field : DQRCU - ! Description: Convective precipitation production rate - ! Unit : kg/kg dry air/s - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%DQRCU (1,J,L) = 0.0e+0_fp ! Used in convection - - ! Field : DQRLSAN - ! Description: Large-scale precipitation production rate - ! Unit : kg/kg dry air/s - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%DQRLSAN (1,J,L) = PRain(J,nZ+1-L) ! kg/kg/s - - ! Field : QI, QL - ! Description: Cloud ice/water mixing ratio - ! Unit : kg/kg dry air - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%QI (1,J,L) = MAX(1.0e-05_fp, State%Q(J,nZ+1-L,ixCldIce)) ! kg ice / kg dry air - State_Met(LCHNK)%QL (1,J,L) = MAX(1.0e-05_fp, State%Q(J,nZ+1-L,ixCldLiq)) ! kg water / kg dry air - - ! Field : RH - ! Description: Relative humidity - ! Unit : % - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%RH (1,J,L) = RelHum(J,nZ+1-L) * 100.0e+0_fp - - ! Field : TAUCLI, TAUCLW - ! Description: Optical depth of ice/H2O clouds - ! Unit : - - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%TAUCLI (1,J,L) = TauCli(J,nZ+1-L) - State_Met(LCHNK)%TAUCLW (1,J,L) = TauClw(J,nZ+1-L) - - ! Field : REEVAPCN - ! Description: Evaporation of convective precipitation - ! (w/r/t dry air) - ! Unit : kg - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%REEVAPCN (1,J,L) = 0.0e+0_fp - - ! Field : REEVAPLS - ! Description: Evaporation of large-scale + anvil precipitation - ! (w/r/t dry air) - ! Unit : kg - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%REEVAPLS (1,J,L) = NEvapr(J,nZ+1-L) ! kg/kg/s - - ! Field : SPHU1, SPHU2 - ! Description: Specific humidity at current and next timestep - ! Unit : g H2O/ kg air - ! Dimensions : nX, nY, nZ - ! Note : Since we are using online meteorology, we do not have - ! access to the data at the next time step - ! Compute tendency in g H2O/kg air/s (tmmf, 1/13/20) ? - State_Met(LCHNK)%SPHU1 (1,J,L) = qH2O(J,nZ+1-L) * 1.0e+3_fp ! g/kg - State_Met(LCHNK)%SPHU2 (1,J,L) = qH2O(J,nZ+1-L) * 1.0e+3_fp ! g/kg - - ! Field : TMPU1, TMPU2 - ! Description: Temperature at current and next timestep - ! Unit : K - ! Dimensions : nX, nY, nZ - ! Note : Since we are using online meteorology, we do not have - ! access to the data at the next time step - ! Compute tendency in K/s (tmmf, 1/13/20) ? - State_Met(LCHNK)%TMPU1 (1,J,L) = State%T(J,nZ+1-L) - State_Met(LCHNK)%TMPU2 (1,J,L) = State%T(J,nZ+1-L) - ENDDO + DO L = 1, nZ + ! Field : U, V + ! Description: E/W and N/S component of wind + ! Unit : m/s + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%U (1,J,L) = State%U(J,nZ+1-L) + State_Met(LCHNK)%V (1,J,L) = State%V(J,nZ+1-L) + + ! Field : OMEGA + ! Description: Updraft velocity + ! Unit : Pa/s + ! Dimensions : nX, nY, nZ + !State_Met(LCHNK)%OMEGA (1,J,L) = State%Omega(J,nZ+1-L) + + ! Field : CLDF + ! Description: 3-D cloud fraction + ! Unit : - + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%CLDF (1,J,L) = cldFrc(j,nZ+1-l) + + ! Field : DTRAIN + ! Description: Detrainment flux + ! Unit : kg/m^2/s + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%DTRAIN (1,J,L) = 0.0e+0_fp ! Used in convection + + ! Field : DQRCU + ! Description: Convective precipitation production rate + ! Unit : kg/kg dry air/s + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%DQRCU (1,J,L) = 0.0e+0_fp ! Used in convection + + ! Field : DQRLSAN + ! Description: Large-scale precipitation production rate + ! Unit : kg/kg dry air/s + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%DQRLSAN (1,J,L) = PRain(J,nZ+1-L) ! kg/kg/s + + ! Field : QI, QL + ! Description: Cloud ice/water mixing ratio + ! Unit : kg/kg dry air + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%QI (1,J,L) = MAX(1.0e-05_fp, State%Q(J,nZ+1-L,ixCldIce)) ! kg ice / kg dry air + State_Met(LCHNK)%QL (1,J,L) = MAX(1.0e-05_fp, State%Q(J,nZ+1-L,ixCldLiq)) ! kg water / kg dry air + + ! Field : RH + ! Description: Relative humidity + ! Unit : % + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%RH (1,J,L) = RelHum(J,nZ+1-L) * 100.0e+0_fp + + ! Field : TAUCLI, TAUCLW + ! Description: Optical depth of ice/H2O clouds + ! Unit : - + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%TAUCLI (1,J,L) = TauCli(J,nZ+1-L) + State_Met(LCHNK)%TAUCLW (1,J,L) = TauClw(J,nZ+1-L) + + ! Field : REEVAPCN + ! Description: Evaporation of convective precipitation + ! (w/r/t dry air) + ! Unit : kg + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%REEVAPCN (1,J,L) = 0.0e+0_fp + + ! Field : REEVAPLS + ! Description: Evaporation of large-scale + anvil precipitation + ! (w/r/t dry air) + ! Unit : kg + ! Dimensions : nX, nY, nZ + State_Met(LCHNK)%REEVAPLS (1,J,L) = NEvapr(J,nZ+1-L) ! kg/kg/s + + ! Field : SPHU1, SPHU2 + ! Description: Specific humidity at current and next timestep + ! Unit : g H2O/ kg air + ! Dimensions : nX, nY, nZ + ! Note : Since we are using online meteorology, we do not have + ! access to the data at the next time step + ! Compute tendency in g H2O/kg air/s (tmmf, 1/13/20) ? + State_Met(LCHNK)%SPHU1 (1,J,L) = qH2O(J,nZ+1-L) * 1.0e+3_fp ! g/kg + State_Met(LCHNK)%SPHU2 (1,J,L) = qH2O(J,nZ+1-L) * 1.0e+3_fp ! g/kg + + ! Field : TMPU1, TMPU2 + ! Description: Temperature at current and next timestep + ! Unit : K + ! Dimensions : nX, nY, nZ + ! Note : Since we are using online meteorology, we do not have + ! access to the data at the next time step + ! Compute tendency in K/s (tmmf, 1/13/20) ? + State_Met(LCHNK)%TMPU1 (1,J,L) = State%T(J,nZ+1-L) + State_Met(LCHNK)%TMPU2 (1,J,L) = State%T(J,nZ+1-L) + ENDDO ENDDO ! Field : T @@ -2832,30 +2828,30 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) currMn = 0 currHr = 0 DO WHILE (currTOD > 3600) - currTOD = currTOD - 3600 - currHr = currHr + 1 + currTOD = currTOD - 3600 + currHr = currHr + 1 ENDDO DO WHILE (currTOD > 60) - currTOD = currTOD - 60 - currMn = currMn + 1 + currTOD = currTOD - 60 + currMn = currMn + 1 ENDDO currSc = currTOD currHMS = (currHr*1000) + (currMn*100) + (currSc) IF ( firstDay ) THEN - newDay = .True. - newMonth = .True. - firstDay = .False. + newDay = .True. + newMonth = .True. + firstDay = .False. ELSE IF ( currHMS < dT ) THEN - newDay = .True. - IF ( currDy == 1 ) THEN - newMonth = .True. - ELSE - newMonth = .False. - ENDIF + newDay = .True. + IF ( currDy == 1 ) THEN + newMonth = .True. + ELSE + newMonth = .False. + ENDIF ELSE - newDay = .False. - newMonth = .False. + newDay = .False. + newMonth = .False. ENDIF ! Pass time values obtained from the ESMF environment to GEOS-Chem @@ -3507,45 +3503,45 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Store unadvected species data SlsData = 0.0e+0_r8 DO N = 1, nSls - M = map2GC_Sls(N) - IF ( M > 0 ) THEN - DO J = 1, nY - DO K = 1, nZ - SlsData(J,nZ+1-K,N) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) - ENDDO - ENDDO - ENDIF + M = map2GC_Sls(N) + IF ( M > 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + SlsData(J,nZ+1-K,N) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) + ENDDO + ENDDO + ENDIF ENDDO CALL set_short_lived_species( SlsData, LCHNK, nY, pbuf ) ! Write diagnostic output DO N = 1, pcnst - M = map2GC(N) - I = map2Idx(N) - IF ( M > 0 ) THEN - SpcName = tracerNames(I) - VMR = 0.0e+0_r8 - DO J = 1, nY - DO K = 1, nZ - VMR(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * MWRatio(I) - ENDDO - ENDDO - CALL OutFld( TRIM(SpcName), VMR(:nY,:), nY, LCHNK ) - ENDIF + M = map2GC(N) + I = map2Idx(N) + IF ( M > 0 ) THEN + SpcName = tracerNames(I) + VMR = 0.0e+0_r8 + DO J = 1, nY + DO K = 1, nZ + VMR(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * MWRatio(I) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), VMR(:nY,:), nY, LCHNK ) + ENDIF ENDDO DO N = 1, nSls - SpcName = slsNames(n) - VMR = 0.0e+0_r8 - M = map2GC_Sls(n) - IF ( M > 0 ) THEN - DO J = 1, nY - DO K = 1, nZ - VMR(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * SLSMWratio(N) - ENDDO - ENDDO - CALL OutFld( TRIM(SpcName), VMR(:nY,:), nY, LCHNK ) - ENDIF + SpcName = slsNames(n) + VMR = 0.0e+0_r8 + M = map2GC_Sls(n) + IF ( M > 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + VMR(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * SLSMWratio(N) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), VMR(:nY,:), nY, LCHNK ) + ENDIF ENDDO ! NOTE: Re-flip all the arrays vertically or suffer the consequences @@ -3553,25 +3549,23 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ptend%q(:,:,:) = 0.0e+0_r8 MMR_End = 0.0e+0_r8 DO N = 1, pcnst - M = map2GC(N) - IF (M > 0) THEN - I = 1 - DO J = 1, nY - DO K = 1, nZ - ! CURRENTLY KG/KG - MMR_End (J,K,M) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) - MMR_TEnd(J,K,M) = MMR_End(J,K,M) - MMR_Beg(J,K,M) - ptend%q(J,nZ+1-K,N) = (MMR_End(J,K,M)-MMR_Beg(J,K,M))/dT - ENDDO - ENDDO - ENDIF + M = map2GC(N) + IF (M > 0) THEN + DO J = 1, nY + DO K = 1, nZ + MMR_End (J,K,M) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) + MMR_TEnd(J,K,M) = MMR_End(J,K,M) - MMR_Beg(J,K,M) + ptend%q(J,nZ+1-K,N) = (MMR_End(J,K,M)-MMR_Beg(J,K,M))/dT + ENDDO + ENDDO + ENDIF ENDDO IF (PRESENT(fh2o)) THEN - fh2o(:nY) = 0.0e+0_r8 - !DO K = 1, nZ - ! fh2o(:nY) = fh2o(:nY) + Ptend%Q(:nY,K,iH2O)*State%Pdel(:nY,K)/Gravit - !ENDDO + fh2o(:nY) = 0.0e+0_r8 + !DO K = 1, nZ + ! fh2o(:nY) = fh2o(:nY) + Ptend%Q(:nY,K,iH2O)*State%Pdel(:nY,K)/Gravit + !ENDDO ENDIF IF (rootChunk) WRITE(iulog,'(a)') ' GEOS-Chem chemistry step completed' @@ -3599,17 +3593,17 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) ! Retrieve a "background value" for this from the database Min_MMR = 1.0e-38_r8 DO I = 1, nTracers - IF (TRIM(tracerNames(I)).eq.TRIM(name)) THEN - Min_MMR = ref_MMR(i) - EXIT - ENDIF + IF (TRIM(tracerNames(I)).eq.TRIM(name)) THEN + Min_MMR = ref_MMR(i) + EXIT + ENDIF ENDDO DO ILEV = 1, NLEV - WHERE(mask) - ! Set to the minimum mixing ratio - q(:,ILEV) = Min_MMR - END WHERE + WHERE(mask) + ! Set to the minimum mixing ratio + q(:,ILEV) = Min_MMR + END WHERE ENDDO end subroutine chem_init_cnst @@ -3709,12 +3703,12 @@ subroutine chem_final ! Loop over each chunk and cleanup the variables DO I = BEGCHUNK, ENDCHUNK - am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) + am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) - CALL Cleanup_State_Chm ( am_I_Root, State_Chm(I), RC ) - CALL Cleanup_State_Diag( am_I_Root, State_Diag(I), RC ) - CALL Cleanup_State_Grid( am_I_Root, State_Grid(I), RC ) - CALL Cleanup_State_Met ( am_I_Root, State_Met(I), RC ) + CALL Cleanup_State_Chm ( am_I_Root, State_Chm(I), RC ) + CALL Cleanup_State_Diag( am_I_Root, State_Diag(I), RC ) + CALL Cleanup_State_Grid( am_I_Root, State_Grid(I), RC ) + CALL Cleanup_State_Met ( am_I_Root, State_Met(I), RC ) ENDDO CALL Cleanup_Error @@ -3814,18 +3808,18 @@ subroutine chem_emissions( state, cam_in ) !TMMF ! Test: emit 1e-10 kg/m2/s of NO in a square around Europe DO M = 1, PCNST - N = map2GC(M) - IF ((N>0).and.(N==iNO)) THEN - SFlx(:,N) = 0.0e+0_r8 - DO I = 1, NCOL - Dlat = Rlats(i) / REAL(PI_180,r8) - Dlon = Rlons(i) / REAL(PI_180,r8) - IF ((Dlat > 50.0e+0_r8).and.(Dlat < 60.0e+0_r8).and.(Dlon > -15.0e+0_r8).and.(Dlon < 5.0e+0_r8)) THEN - SFlx(I,N) = SFlx(I,N) + 1.0e-10_r8 - ENDIF - ENDDO - cam_in%CFlx(:NCOL,M) = cam_in%CFlx(:NCOL,M) + SFlx(:NCOL,N) - ENDIF + N = map2GC(M) + IF ((N>0).and.(N==iNO)) THEN + SFlx(:,N) = 0.0e+0_r8 + DO I = 1, NCOL + Dlat = Rlats(i) / REAL(PI_180,r8) + Dlon = Rlons(i) / REAL(PI_180,r8) + IF ((Dlat > 50.0e+0_r8).and.(Dlat < 60.0e+0_r8).and.(Dlon > -15.0e+0_r8).and.(Dlon < 5.0e+0_r8)) THEN + SFlx(I,N) = SFlx(I,N) + 1.0e-10_r8 + ENDIF + ENDDO + cam_in%CFlx(:NCOL,M) = cam_in%CFlx(:NCOL,M) + SFlx(:NCOL,N) + ENDIF ENDDO end subroutine chem_emissions From fcf0d678afa75ca25458be712e4808da3b677b49 Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Tue, 21 Jul 2020 10:19:46 -0600 Subject: [PATCH 101/239] Change GEOS-Chem source to CESM-GC GitHub organization and branch name Signed-off-by: Lizzie Lundgren --- Externals_CAM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 1e39d10358..5e28f996d3 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -29,8 +29,8 @@ required = True [geoschem] local_path = src/chemistry/pp_geoschem/geoschem_src protocol = git -tag = CESM -repo_url = https://github.com/fritzt/CESM2-GC_Src +branch = feature/ewl/GC_13.0.0 +repo_url = https://github.com/CESM-GC/geos-chem required = True [hemco] From aea26cd4265ff9b65368f0972c95654047bda154 Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Tue, 21 Jul 2020 11:12:29 -0600 Subject: [PATCH 102/239] Use GEOS-Chem branch feature/13.0.0+CESM Signed-off-by: Lizzie Lundgren --- Externals_CAM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 5e28f996d3..2c92a0df6c 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -29,7 +29,7 @@ required = True [geoschem] local_path = src/chemistry/pp_geoschem/geoschem_src protocol = git -branch = feature/ewl/GC_13.0.0 +branch = feature/13.0.0+CESM repo_url = https://github.com/CESM-GC/geos-chem required = True From 7ad8ea2a47ce8a981b155de535c0a847c8373c71 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 21 Jul 2020 14:31:53 -0400 Subject: [PATCH 103/239] Fix: Change HEMCO Interface path --- bld/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/configure b/bld/configure index 3340d1fb96..5c57213c49 100755 --- a/bld/configure +++ b/bld/configure @@ -2875,7 +2875,7 @@ sub write_filepath # until we figure out a better compile routine. print $fh "$camsrcdir/src/hemco/HEMCO/src/Core\n"; print $fh "$camsrcdir/src/hemco/HEMCO/src/Extensions\n"; - print $fh "$camsrcdir/src/hemco/HEMCO/src/Interfaces\n"; + print $fh "$camsrcdir/src/hemco/HEMCO/src/Interfaces/Shared\n"; } # -- Added by MSL - 1/2018 From a774fd3596f252856fe242372daffff2e09b396e Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 21 Jul 2020 14:32:28 -0400 Subject: [PATCH 104/239] Feat: Add option to get land types from HEMCO --- src/chemistry/pp_geoschem/chemistry.F90 | 231 ++++++++++++++---------- 1 file changed, 139 insertions(+), 92 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index da95a21c4b..9e473fdee2 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -180,6 +180,8 @@ subroutine chem_register use Species_Mod, only : Species use mo_sim_dat, only : set_sim_dat + use mo_chem_utls, only : get_spc_ndx + use chem_mods, only : drySpc_ndx #if defined( MODAL_AERO_4MODE ) use aero_model, only : aero_model_register use modal_aero_data, only : nspec_max @@ -199,6 +201,7 @@ subroutine chem_register TYPE(Species), POINTER :: ThisSpc INTEGER :: I, N, M, L + INTEGER :: nIgnored REAL(r8) :: cptmp REAL(r8) :: MWTmp REAL(r8) :: qmin @@ -467,6 +470,32 @@ subroutine chem_register ! More information: ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html + !============================================================== + ! Get mapping between dry deposition species and species set + !============================================================== + + nIgnored = 0 + + DO N = 1, nddvels + + ! The species names need to be convert to upper case as, + ! for instance, BR2 != Br2 + drySpc_ndx(N) = get_spc_ndx( to_upper(drydep_list(N)) ) + + IF ( MasterProc .AND. ( drySpc_ndx(N) < 0 ) ) THEN + Write(iulog,'(a,a)') ' ## Ignoring dry deposition of ', & + TRIM(drydep_list(N)) + nIgnored = nIgnored + 1 + ENDIF + ENDDO + + IF ( MasterProc .AND. ( nIgnored > 0 ) ) THEN + Write(iulog,'(a,a)') ' The species listed above have dry', & + ' deposition turned off for one of the following reasons:' + Write(iulog,'(a)') ' - They are not present in the GEOS-Chem tracer list.' + Write(iulog,'(a)') ' - They have a synonym (e.g. CH2O and HCHO).' + ENDIF + #if defined( MODAL_AERO_4MODE ) ! add fields to pbuf needed by aerosol models CALL aero_model_register() @@ -570,6 +599,37 @@ subroutine chem_register #endif + !============================================================== + ! Print summary + !============================================================== + + IF ( MasterProc ) THEN + Write(iulog,'(/, a)') '### Summary of GEOS-Chem species: ' + Write(iulog,'( a)') REPEAT( '-', 50 ) + Write(iulog,'( a)') '+ List of advected species: ' + Write(iulog,100) 'ID', 'Tracer', ''!'Dry deposition (T/F)' + DO N = 1, nTracers + Write(iulog,120) N, TRIM(tracerNames(N))!, ANY(drySpc_ndx .eq. N) + ENDDO + IF ( nAer > 0 ) THEN + Write(iulog,'(/, a)') '+ List of aerosols: ' + Write(iulog,110) 'ID', 'MAM4 Aerosol' + DO N = 1, nAer + Write(iulog,130) N, TRIM(aerNames(N)) + ENDDO + ENDIF + Write(iulog,'(/, a)') '+ List of short-lived species: ' + DO N = 1, nSls + Write(iulog,130) N, TRIM(slsNames(N)) + ENDDO + ENDIF + +100 FORMAT( 1x, A3, 3x, A10, 1x, A25 ) +110 FORMAT( 1x, A3, 3x, A15 ) +!120 FORMAT( 1x, I3, 3x, A10, 1x, L15 ) +120 FORMAT( 1x, I3, 3x, A10 ) +130 FORMAT( 1x, I3, 3x, A10 ) + ! Clean up Call Cleanup_State_Chm ( .False., SC, RC ) Call Cleanup_State_Grid( .False., SG, RC ) @@ -591,14 +651,13 @@ subroutine chem_readnl(nlfile) #endif use mpishorthand use gckpp_Model, only : nSpec, Spc_Names - use mo_chem_utls, only : get_spc_ndx use chem_mods, only : drySpc_ndx ! args CHARACTER(LEN=*), INTENT(IN) :: nlfile ! filepath for file containing namelist input ! Local variables - INTEGER :: I, N, nIgnored + INTEGER :: I, N INTEGER :: UNITN, IERR CHARACTER(LEN=500) :: line LOGICAL :: menuFound @@ -617,8 +676,6 @@ subroutine chem_readnl(nlfile) srf_emis_specifier, & srf_emis_type - nIgnored = 0 - ! Set paths ! MIT path !inputGeosPath='/home/fritzt/input.geos.template' @@ -791,58 +848,6 @@ subroutine chem_readnl(nlfile) ENDIF ENDDO - !============================================================== - ! Get mapping between dry deposition species and species set - !============================================================== - - DO N = 1, nddvels - - ! The species names need to be convert to upper case as, - ! for instance, BR2 != Br2 - drySpc_ndx(N) = get_spc_ndx( to_upper(drydep_list(N)) ) - - IF ( drySpc_ndx(N) < 0 ) THEN - Write(iulog,'(a,a)') ' ## Ignoring dry deposition of ', & - TRIM(drydep_list(N)) - nIgnored = nIgnored + 1 - ENDIF - ENDDO - - IF ( nIgnored > 0 ) THEN - Write(iulog,'(a,a)') ' The species listed above have dry', & - ' deposition turned off for one of the following reasons:' - Write(iulog,'(a)') ' - They are not present in the GEOS-Chem tracer list.' - Write(iulog,'(a)') ' - They have a synonym (e.g. CH2O and HCHO).' - ENDIF - - !============================================================== - ! Print summary - !============================================================== - - Write(iulog,'(/, a)') '### Summary of GEOS-Chem species: ' - Write(iulog,'( a)') REPEAT( '-', 50 ) - Write(iulog,'( a)') '+ List of advected species: ' - Write(iulog,100) 'ID', 'Tracer', 'Dry deposition (T/F)' - DO N = 1, nTracers - Write(iulog,120) N, TRIM(tracerNames(N)), ANY(drySpc_ndx .eq. N) - ENDDO - IF ( nAer > 0 ) THEN - Write(iulog,'(/, a)') '+ List of aerosols: ' - Write(iulog,110) 'ID', 'MAM4 Aerosol' - DO N = 1, nAer - Write(iulog,130) N, TRIM(aerNames(N)) - ENDDO - ENDIF - Write(iulog,'(/, a)') '+ List of short-lived species: ' - DO N = 1, nSls - Write(iulog,130) N, TRIM(slsNames(N)) - ENDDO - - 100 FORMAT( 1x, A3, 3x, A10, 1x, A25 ) - 110 FORMAT( 1x, A3, 3x, A15 ) - 120 FORMAT( 1x, I3, 3x, A10, 1x, L15 ) - 130 FORMAT( 1x, I3, 3x, A10 ) - !============================================================== unitn = getunit() @@ -868,7 +873,6 @@ subroutine chem_readnl(nlfile) CALL MPIBCAST( tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) CALL MPIBCAST( nSls, 1, MPIINT, 0, MPICOM ) CALL MPIBCAST( slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) - CALL MPIBCAST( drySpc_ndx, nddvels, MPIINT, 0, MPICOM ) ! The following files are required to compute land maps, required to perform ! aerosol dry deposition @@ -1526,6 +1530,16 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDDO + ! Print out debug information + IF ( N == 1 ) Write(iulog,*) " ++ GEOS-Chem Dry deposition ++ " + IF ( map2GC_dryDep(N) > 0 ) THEN + Write(iulog,*) " CESM species: ", TRIM(drydep_list(N)), & + ' is matched with ', depName(map2GC_dryDep(N)) + ELSE + Write(iulog,*) " CESM species: ", TRIM(drydep_list(N)), & + ' has no match' + ENDIF + ENDIF ENDDO @@ -1829,31 +1843,31 @@ subroutine chem_init(phys_state, pbuf2d) !ENDIF ! -#if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) - ! Populate the State_Met%LandTypeFrac field with data from HEMCO - CALL Init_LandTypeFrac( am_I_Root = MasterProc, & - Input_Opt = Input_Opt, & - State_Met = State_Met(BEGCHUNK), & - RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_LandTypeFrac"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - - ! Compute the Olson landmap fields of State_Met - ! (e.g. State_Met%IREG, State_Met%ILAND, etc.) - CALL Compute_Olson_Landmap( am_I_Root = MasterProc, & - Input_Opt = Input_Opt, & - State_Grid = State_Grid(BEGCHUNK), & - State_Met = State_Met(BEGCHUNK), & - RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Compute_Olson_Landmap"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF -#endif +!#if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) +! ! Populate the State_Met%LandTypeFrac field with data from HEMCO +! CALL Init_LandTypeFrac( am_I_Root = MasterProc, & +! Input_Opt = Input_Opt, & +! State_Met = State_Met(BEGCHUNK), & +! RC = RC ) +! +! IF ( RC /= GC_SUCCESS ) THEN +! ErrMsg = 'Error encountered in "Init_LandTypeFrac"!' +! CALL Error_Stop( ErrMsg, ThisLoc ) +! ENDIF +! +! ! Compute the Olson landmap fields of State_Met +! ! (e.g. State_Met%IREG, State_Met%ILAND, etc.) +! CALL Compute_Olson_Landmap( am_I_Root = MasterProc, & +! Input_Opt = Input_Opt, & +! State_Grid = State_Grid(BEGCHUNK), & +! State_Met = State_Met(BEGCHUNK), & +! RC = RC ) +! +! IF ( RC /= GC_SUCCESS ) THEN +! ErrMsg = 'Error encountered in "Compute_Olson_Landmap"!' +! CALL Error_Stop( ErrMsg, ThisLoc ) +! ENDIF +!#endif ! Initialize PBL quantities but do not do mixing ! Add option for non-local PBL (Lin, 03/31/09) @@ -1997,6 +2011,7 @@ subroutine GC_Update_Timesteps(DT) subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: pbuf_get_index use cam_history, only: outfld use camsrfexch, only: cam_in_t, cam_out_t @@ -2008,16 +2023,15 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use modal_aero_data, only : lmassptr_amode #endif -#if ( LANDTYPE_CLM ) use Olson_Landmap_Mod, only: Compute_Olson_Landmap use Modis_LAI_Mod, only: Compute_XLAI -#endif + use CMN_Size_Mod, only: NSURFTYPE #if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) use Drydep_Mod, only: Do_Drydep #elif ( OCNDDVEL_MOZART ) use mo_drydep, only: drydep_update, drydep_fromlnd #endif - use Drydep_Mod, only: DEPNAME !TMMF, this is just needed for debug + use Drydep_Mod, only: DEPNAME use Drydep_Mod, only: Update_DryDepSav use Mixing_Mod @@ -2165,11 +2179,12 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) LOGICAL :: rootChunk INTEGER :: RC - INTEGER :: nmodes - character(len=32) :: spec_name - character(len=32) :: spec_type - character(len=32) :: mode_type - integer :: nspec +#if ( LANDTYPE_HEMCO ) + INTEGER :: tmpIdx + character(len=255) :: name + real(r8), pointer :: pbuf_ik(:,:) ! Pointer to pbuf data (/pcols,pver/) +#endif + ! LCHNK: which chunk we have on this process LCHNK = State%LCHNK ! NCOL: number of atmospheric columns on this chunk @@ -2467,6 +2482,40 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) nY, & State_Met(LCHNK) ) #endif +#elif ( LANDTYPE_HEMCO ) + DO N = 1, NSURFTYPE + Write(name, '(a,i2.2)') 'HCO_LANDTYPE', N-1 + If ( MasterProc ) Write(iulog,*) " Getting ", TRIM(name) + + tmpIdx = pbuf_get_index(name, rc) + IF( tmpIdx < 0 ) THEN + ! there is an error here and the field was not found + Write(iulog,*) " Did not find field ", TRIM(name), " in HEMCO!" + ELSE + CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) + DO J = 1, nY + State_Met(LCHNK)%LandTypeFrac(1,J,N) = pbuf_ik(J,nZ) + ! 2-D data is stored in the 1st level of a + ! 3-D array due to laziness + ENDDO + ENDIF + + Write(name, '(a,i2.2)') 'HCO_XLAI', N-1 + If ( MasterProc ) Write(iulog,*) " Getting ", TRIM(name) + + tmpIdx = pbuf_get_index(name, rc) + IF( tmpIdx < 0 ) THEN + ! there is an error here and the field was not found + Write(iulog,*) " Did not find field ", TRIM(name), " in HEMCO!" + ELSE + CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) + DO J = 1, nY + State_Met(LCHNK)%XLAI_NATIVE(1,J,N) = pbuf_ik(J,nZ) + ! 2-D data is stored in the 1st level of a + ! 3-D array due to laziness + ENDDO + ENDIF + ENDDO #endif ! Field : FRCLND, FRLAND, FROCEAN, FRSEAICE, FRLAKE, FRLANDIC @@ -3171,7 +3220,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !================================================================== IF ( Input_Opt%LDryD ) THEN -#if ( LANDTYPE_CLM ) ! Compute the Olson landmap fields of State_Met ! (e.g. State_Met%IREG, State_Met%ILAND, etc.) CALL Compute_Olson_Landmap( am_I_Root = rootChunk, & @@ -3199,7 +3247,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ErrMsg = 'Error encountered in "Compute_Xlai"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF -#endif #if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) From fd12a6999239cc5dd6d3187a624f40a94888e977 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 21 Jul 2020 17:10:25 -0400 Subject: [PATCH 105/239] Fix: Aerosol mapping requires more indices in MMR_Beg. --- src/chemistry/pp_geoschem/chemistry.F90 | 28 +++++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 9e473fdee2..5c80fc0911 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -1531,13 +1531,15 @@ subroutine chem_init(phys_state, pbuf2d) ENDDO ! Print out debug information - IF ( N == 1 ) Write(iulog,*) " ++ GEOS-Chem Dry deposition ++ " - IF ( map2GC_dryDep(N) > 0 ) THEN - Write(iulog,*) " CESM species: ", TRIM(drydep_list(N)), & - ' is matched with ', depName(map2GC_dryDep(N)) - ELSE - Write(iulog,*) " CESM species: ", TRIM(drydep_list(N)), & - ' has no match' + IF ( masterProc ) THEN + IF ( N == 1 ) Write(iulog,*) " ++ GEOS-Chem Dry deposition ++ " + IF ( map2GC_dryDep(N) > 0 ) THEN + Write(iulog,*) " CESM species: ", TRIM(drydep_list(N)), & + ' is matched with ', depName(map2GC_dryDep(N)) + ELSE + Write(iulog,*) " CESM species: ", TRIM(drydep_list(N)), & + ' has no match' + ENDIF ENDIF ENDIF @@ -2293,6 +2295,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO #if defined( MODAL_AERO_4MODE ) + ! TMMF - This needs more indices to MMR_Beg and MMR_End ! Map and flip aerosols DO M = 1, ntot_amode DO L = 1, nspec_amode(M) @@ -2302,9 +2305,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( P > 0 ) THEN DO J = 1, nY DO K = 1, nZ - MMR_Beg(J,K,M) = State%q(J,nZ+1-K,N) + !MMR_Beg(J,K,M) = State%q(J,nZ+1-K,N) State_Chm(LCHNK)%Species(1,J,K,P) = State_Chm(LCHNK)%Species(1,J,K,P) & - + REAL(State%q(J,nZ+1-K,N),fp) + + REAL(state%q(J,nZ+1-K,N),fp) ENDDO ENDDO ENDIF @@ -3608,6 +3611,13 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDDO + ! Debug statements + ! Ozone tendencies + IF ( rootChunk ) THEN + Write(iulog,*) " MMR_Beg = ", MMR_Beg(1,:,2) + Write(iulog,*) " MMR_End = ", MMR_End(1,:,2) + ENDIF + IF (PRESENT(fh2o)) THEN fh2o(:nY) = 0.0e+0_r8 !DO K = 1, nZ From 21a38b08f71d1d6d81981d80211fbe289bfb0362 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 21 Jul 2020 18:14:35 -0400 Subject: [PATCH 106/239] Remove custom emissions --- src/chemistry/pp_geoschem/chemistry.F90 | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 5c80fc0911..3712e7ce99 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -3600,7 +3600,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) MMR_End = 0.0e+0_r8 DO N = 1, pcnst M = map2GC(N) - IF (M > 0) THEN + IF ( M > 0 ) THEN DO J = 1, nY DO K = 1, nZ MMR_End (J,K,M) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) @@ -3862,22 +3862,22 @@ subroutine chem_emissions( state, cam_in ) IF (FIRST) THEN ENDIF - !TMMF - ! Test: emit 1e-10 kg/m2/s of NO in a square around Europe - DO M = 1, PCNST - N = map2GC(M) - IF ((N>0).and.(N==iNO)) THEN - SFlx(:,N) = 0.0e+0_r8 - DO I = 1, NCOL - Dlat = Rlats(i) / REAL(PI_180,r8) - Dlon = Rlons(i) / REAL(PI_180,r8) - IF ((Dlat > 50.0e+0_r8).and.(Dlat < 60.0e+0_r8).and.(Dlon > -15.0e+0_r8).and.(Dlon < 5.0e+0_r8)) THEN - SFlx(I,N) = SFlx(I,N) + 1.0e-10_r8 - ENDIF - ENDDO - cam_in%CFlx(:NCOL,M) = cam_in%CFlx(:NCOL,M) + SFlx(:NCOL,N) - ENDIF - ENDDO + !!TMMF + !! Test: emit 1e-10 kg/m2/s of NO in a square around Europe + !DO M = 1, PCNST + ! N = map2GC(M) + ! IF ((N>0).and.(N==iNO)) THEN + ! SFlx(:,N) = 0.0e+0_r8 + ! DO I = 1, NCOL + ! Dlat = Rlats(i) / REAL(PI_180,r8) + ! Dlon = Rlons(i) / REAL(PI_180,r8) + ! IF ((Dlat > 50.0e+0_r8).and.(Dlat < 60.0e+0_r8).and.(Dlon > -15.0e+0_r8).and.(Dlon < 5.0e+0_r8)) THEN + ! SFlx(I,N) = SFlx(I,N) + 1.0e-10_r8 + ! ENDIF + ! ENDDO + ! cam_in%CFlx(:NCOL,M) = cam_in%CFlx(:NCOL,M) + SFlx(:NCOL,N) + ! ENDIF + !ENDDO end subroutine chem_emissions From 5708bb6ad7eb98be1be3aaa6331492d608fced82 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 22 Jul 2020 16:18:21 -0400 Subject: [PATCH 107/239] Feat: Add emissions to CESM-GC --- src/chemistry/pp_geoschem/chemistry.F90 | 85 ++++++++++++++++--------- 1 file changed, 54 insertions(+), 31 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 3712e7ce99..6f2bd0ca3d 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -5,14 +5,11 @@ module chemistry use shr_kind_mod, only: r8 => shr_kind_r8, shr_kind_cl use physics_types, only: physics_state, physics_ptend, physics_ptend_init + use physics_buffer, only: physics_buffer_desc use ppgrid, only: begchunk, endchunk, pcols use ppgrid, only: pver, pverp use constituents, only: pcnst, cnst_add, cnst_get_ind - !use mo_gas_phase_chemdr, only: map2chm - !use mo_constants, only: pi use shr_const_mod, only: molw_dryair=>SHR_CONST_MWDAIR - !use chem_mods, only : gas_pcnst, adv_mass - !use mo_sim_dat, only: set_sim_dat use seq_drydep_mod, only : nddvels => n_drydep, drydep_list use spmd_utils, only : MasterProc, myCPU=>Iam, nCPUs=>npes use cam_logfile, only : iulog @@ -100,6 +97,8 @@ module chemistry TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object TYPE(DgnList ) :: Diag_List ! Diagnostics list object + type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! ptr to 2d pbuf + ! Indices of critical species INTEGER :: iH2O, iO3, iCH4, iCO, iNO @@ -1957,6 +1956,10 @@ subroutine chem_init(phys_state, pbuf2d) !CALL AddFld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) !CALL Add_Default ( 'BCPI', 1, ' ') + hco_pbuf2d => pbuf2d + + If ( MasterProc ) Write(iulog,*) "hco_pbuf2d now points to pbuf2d" + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT' end subroutine chem_init @@ -3830,7 +3833,12 @@ end subroutine chem_read_restart !================================================================================ subroutine chem_emissions( state, cam_in ) use camsrfexch, only: cam_in_t + use physics_buffer, only : pbuf_get_chunk, pbuf_get_field, pbuf_get_index + use ppgrid, only : pver ! for vertical + use constituents, only: cnst_name + use mo_chem_utls, only : get_spc_ndx + use chem_mods, only : tracerNames, nTracers use PhysConstants, only: PI, PI_180 ! Arguments: @@ -3838,16 +3846,16 @@ subroutine chem_emissions( state, cam_in ) TYPE(physics_state), INTENT(IN) :: state ! Physics state variables TYPE(cam_in_t), INTENT(INOUT) :: cam_in ! import state - REAL(r8) :: Rlats(State%NCOL) - REAL(r8) :: Rlons(State%NCOL) - REAL(r8) :: Dlat, Dlon - REAL(r8) :: SFlx(State%NCOL,nTracers) - INTEGER :: M, N, I INTEGER :: LCHNK, NCOL LOGICAL :: rootChunk - LOGICAL, SAVE :: FIRST = .TRUE. + REAL(r8) :: sflx(State%NCOL,nTracers) + type(physics_buffer_desc), pointer :: pbuf_chnk(:) ! slice of pbuf in chnk + real(r8), pointer :: pbuf_ik(:,:) ! ptr to pbuf data (/pcols,pver/) + integer :: tmpIdx ! pbuf field id + character(len=255) :: fldname_ns ! field name HCO_NH3 + integer :: RC ! return code ! LCHNK: which chunk we have on this process LCHNK = State%LCHNK @@ -3855,29 +3863,44 @@ subroutine chem_emissions( state, cam_in ) NCOL = State%NCOL rootChunk = ( MasterProc.and.(LCHNK.EQ.BEGCHUNK) ) - SFlx(:,:) = 0.0e+0_r8 - Rlats(1:ncol) = State%Lat(1:NCOL) - Rlons(1:ncol) = State%Lon(1:NCOL) + sflx(:,:) = 0.0e+0_r8 - IF (FIRST) THEN - ENDIF + DO N = 1, nTracers - !!TMMF - !! Test: emit 1e-10 kg/m2/s of NO in a square around Europe - !DO M = 1, PCNST - ! N = map2GC(M) - ! IF ((N>0).and.(N==iNO)) THEN - ! SFlx(:,N) = 0.0e+0_r8 - ! DO I = 1, NCOL - ! Dlat = Rlats(i) / REAL(PI_180,r8) - ! Dlon = Rlons(i) / REAL(PI_180,r8) - ! IF ((Dlat > 50.0e+0_r8).and.(Dlat < 60.0e+0_r8).and.(Dlon > -15.0e+0_r8).and.(Dlon < 5.0e+0_r8)) THEN - ! SFlx(I,N) = SFlx(I,N) + 1.0e-10_r8 - ! ENDIF - ! ENDDO - ! cam_in%CFlx(:NCOL,M) = cam_in%CFlx(:NCOL,M) + SFlx(:NCOL,N) - ! ENDIF - !ENDDO + fldname_ns = 'HCO_' // TRIM(tracerNames(N)) + tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_emissions hemco: Field not found ", TRIM(fldname_ns) + ELSE + ! This is already in chunk, retrieve it + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + + IF ( .NOT. ASSOCIATED(pbuf_ik) ) THEN ! Sanity check + CALL ENDRUN("chem_emissions: FATAL - tmpIdx > 0 but pbuf_ik not associated") + ENDIF + + ! For each column retrieve data from pbuf_ik(I,K) + sflx(1:ncol,N) = pbuf_ik(1:ncol,pver) ! Only surface emissions for now, + + !TMMF, Replace this in chem_init + M = -1 + DO I = 1, nTracers + IF( TRIM( to_upper( TRIM(tracerNames(N)) ) ) == TRIM( to_upper( cnst_name(I)) ) ) THEN + M = I + EXIT + ENDIF + ENDDO + + IF ( M <= 0 ) CYCLE + + If ( rootChunk .And. (MAXVAL(sflx(1:ncol,N)) > 0.0e+0_fp) ) & + Write(iulog,*) "chem_emissions: debug added emiss for ", & + TRIM(cnst_name(M)), MAXVAL(sflx(1:ncol,N)), " from ", TRIM(fldname_ns) + + cam_in%cflx(1:ncol,M) = cam_in%cflx(1:ncol,M) + sflx(1:ncol,N) + ENDIF + ENDDO end subroutine chem_emissions From 22a81eed7c3b50527ee48b328f4bb288023d2663 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 23 Jul 2020 22:46:26 -0400 Subject: [PATCH 108/239] Fix: Prevent emissions from adding up in CESM-GC. Reset cam_in%cflx --- src/chemistry/pp_geoschem/chemistry.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 6f2bd0ca3d..0693554a92 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -3894,11 +3894,11 @@ subroutine chem_emissions( state, cam_in ) IF ( M <= 0 ) CYCLE - If ( rootChunk .And. (MAXVAL(sflx(1:ncol,N)) > 0.0e+0_fp) ) & + cam_in%cflx(1:ncol,M) = sflx(1:ncol,N) + If ( MAXVAL(sflx(1:ncol,N)) > 0.0e+0_fp ) & Write(iulog,*) "chem_emissions: debug added emiss for ", & - TRIM(cnst_name(M)), MAXVAL(sflx(1:ncol,N)), " from ", TRIM(fldname_ns) - - cam_in%cflx(1:ncol,M) = cam_in%cflx(1:ncol,M) + sflx(1:ncol,N) + TRIM(cnst_name(M)), MAXVAL(sflx(1:ncol,N)), " from ", TRIM(fldname_ns), & + ". Total emission flux is: ", MAXVAL(cam_in%cflx(1:ncol,M)) ENDIF ENDDO From 4c72b328b0df3208761b830108c9efbc5ea29877 Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Fri, 24 Jul 2020 14:53:14 -0600 Subject: [PATCH 109/239] Update HEMCO interfaces directory name in configure Signed-off-by: Lizzie Lundgren --- bld/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/configure b/bld/configure index b5b5ead7c9..126cbb7fb9 100755 --- a/bld/configure +++ b/bld/configure @@ -2867,7 +2867,7 @@ sub write_filepath # until we figure out a better compile routine. print $fh "$camsrcdir/src/hemco/HEMCO/src/Core\n"; print $fh "$camsrcdir/src/hemco/HEMCO/src/Extensions\n"; - print $fh "$camsrcdir/src/hemco/HEMCO/src/Interfaces\n"; + print $fh "$camsrcdir/src/hemco/HEMCO/src/Interfaces/Shared\n"; } # -- Added by MSL - 1/2018 From 7fa4e17b7e786bd22e9578ceea713d778d2be389 Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Fri, 24 Jul 2020 14:53:43 -0600 Subject: [PATCH 110/239] Partial updates to enable GEOS-Chem dev/13.0.0 to build in CESM Signed-off-by: Lizzie Lundgren --- src/chemistry/pp_geoschem/.exclude | 46 +- src/chemistry/pp_geoschem/chemistry.F90 | 1024 +++++++++++------------ 2 files changed, 488 insertions(+), 582 deletions(-) diff --git a/src/chemistry/pp_geoschem/.exclude b/src/chemistry/pp_geoschem/.exclude index 674cabfdd2..313c41158c 100644 --- a/src/chemistry/pp_geoschem/.exclude +++ b/src/chemistry/pp_geoschem/.exclude @@ -1,39 +1,23 @@ regrid_a2a_mod.F90 -transport_mod.F +transport_mod.F90 tpcore_window_mod.F90 -tpcore_bc_mod.F90 tpcore_fvdas_mod.F90 flexgrid_read_mod.F90 -geosfp_read_mod.F90 get_met_mod.F90 -merra2_read_mod.F90 -regrid_a2a_mod.F90 -restart_mod.F -pops_mod.F -diag49_mod.F -diag51_mod.F -diag03_mod.F -diag04_mod.F -diag1.F -diag20_mod.F -diag_2pm.F -diag3.F -diag41_mod.F -diag42_mod.F -diag48_mod.F -diag50_mod.F -diag51b_mod.F -diag53_mod.F -diag56_mod.F -diag63_mod.F +pops_mod.F90 +planeflight_mod.F90 +diag51_mod.F90 +diag1.F90 +diag03_mod.F90 +diag3.F90 +diag51b_mod.F90 +diag53_mod.F90 emissions_mod.F90 -diag3.F -hcoi_gc_main_mod.F90 -gamap_mod.F -initialize.F -input_mod.F -cleanup.F -main.F +gamap_mod.F90 +initialize.F90 +input_mod.F90 +cleanup.F90 +main.F90 hcoi_gc_diagn_include.H hcoi_gc_diagn_mod.F90 -hcoi_gc_main_mod.F90 \ No newline at end of file +hco_interface_gc_mod.F90 \ No newline at end of file diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index caea37321e..2914f1ae38 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -212,591 +212,588 @@ subroutine chem_register IO%RootCPU = .False. - CALL Set_Input_Opt( am_I_Root = .False., & - Input_Opt = IO, & + CALL Set_Input_Opt( Am_I_Root = MasterProc, & + INPUT_OPT = IO, & RC = RC ) - if(masterproc) write(iulog,*) 'GCCALL after Set_Input_Opt' + IF(MASTERPROC) WRITE(IULOG,*) 'GCCALL AFTER SET_INPUT_OPT' IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Could not generate reference input options object!' - CALL Error_Stop( ErrMsg, ThisLoc ) + ERRMSG = 'COULD NOT GENERATE REFERENCE INPUT OPTIONS OBJECT!' + CALL ERROR_STOP( ERRMSG, THISLOC ) ENDIF - ! Options needed by Init_State_Chm - IO%ITS_A_FULLCHEM_SIM = .True. - IO%LLinoz = .True. - IO%LUCX = .True. - IO%LPRT = .False. - IO%N_Advect = nTracers - DO I = 1, nTracers - IO%AdvectSpc_Name(I) = TRIM(tracerNames(I)) + ! OPTIONS NEEDED BY INIT_STATE_CHM + IO%ITS_A_FULLCHEM_SIM = .TRUE. + IO%LLINOZ = .TRUE. + IO%LUCX = .TRUE. + IO%LPRT = .FALSE. + IO%N_ADVECT = NTRACERS + DO I = 1, NTRACERS + IO%ADVECTSPC_NAME(I) = TRIM(TRACERNAMES(I)) ENDDO - IO%SalA_rEdge_um(1) = 0.01e+0_fp - IO%SalA_rEdge_um(2) = 0.50e+0_fp - IO%SalC_rEdge_um(1) = 0.50e+0_fp - IO%SalC_rEdge_um(2) = 8.00e+0_fp + IO%SALA_REDGE_UM(1) = 0.01E+0_FP + IO%SALA_REDGE_UM(2) = 0.50E+0_FP + IO%SALC_REDGE_UM(1) = 0.50E+0_FP + IO%SALC_REDGE_UM(2) = 8.00E+0_FP - ! Prevent reporting - IO%rootCPU = .False. - IO%myCPU = myCPU + ! PREVENT REPORTING + IO%ROOTCPU = .FALSE. + IO%MYCPU = MYCPU - CALL Init_State_Grid( am_I_Root = .False., & - State_Grid = SG , & + CALL INIT_STATE_GRID( STATE_GRID = SG , & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered within call to "Init_State_Grid"!' - CALL Error_Stop( ErrMsg, ThisLoc ) + ERRMSG = 'ERROR ENCOUNTERED WITHIN CALL TO "INIT_STATE_GRID"!' + CALL ERROR_STOP( ERRMSG, THISLOC ) ENDIF SG%NX = 1 SG%NY = 1 SG%NZ = 1 - CALL Init_State_Chm( am_I_Root = .False., & - Input_Opt = IO, & - State_Chm = SC, & - State_Grid = SG, & + CALL INIT_STATE_CHM( INPUT_OPT = IO, & + STATE_CHM = SC, & + STATE_GRID = SG, & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered within call to "Init_State_Chm"!' - CALL Error_Stop( ErrMsg, ThisLoc ) + ERRMSG = 'ERROR ENCOUNTERED WITHIN CALL TO "INIT_STATE_CHM"!' + CALL ERROR_STOP( ERRMSG, THISLOC ) ENDIF - ! At the moment, we force nadv_chem=200 in the setup file - ! Default - map2GC = -1 - ref_MMR(:) = 0.0e+0_r8 - MWRatio(:) = 1.0e+0_r8 - tracerLongNames = '' - - DO I = 1, nTracersMax - IF (I.LE.nTracers) THEN - N = Ind_(tracerNames(I)) - ThisSpc => SC%SpcData(N)%Info - lng_Name = TRIM(ThisSpc%FullName) - MWTmp = REAL(ThisSpc%MW_g,r8) - ref_VMR = REAL(ThisSpc%BackgroundVV,r8) - adv_Mass(I) = MWTmp - ref_MMR(I) = ref_VMR / (MWDry / MWTmp) + ! AT THE MOMENT, WE FORCE NADV_CHEM=200 IN THE SETUP FILE + ! DEFAULT + MAP2GC = -1 + REF_MMR(:) = 0.0E+0_R8 + MWRATIO(:) = 1.0E+0_R8 + TRACERLONGNAMES = '' + + DO I = 1, NTRACERSMAX + IF (I.LE.NTRACERS) THEN + N = IND_(TRACERNAMES(I)) + THISSPC => SC%SPCDATA(N)%INFO + LNG_NAME = TRIM(THISSPC%FULLNAME) + MWTMP = REAL(THISSPC%MW_G,R8) + REF_VMR = REAL(THISSPC%BACKGROUNDVV,R8) + ADV_MASS(I) = MWTMP + REF_MMR(I) = REF_VMR / (MWDRY / MWTMP) ELSE - lng_Name = TRIM(tracerNames(I)) - MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) - adv_Mass(I) = MWTmp - ref_MMR(I) = 1.0e-38_r8 + LNG_NAME = TRIM(TRACERNAMES(I)) + MWTMP = 1000.0E+0_R8 * (0.001E+0_R8) + ADV_MASS(I) = MWTMP + REF_MMR(I) = 1.0E-38_R8 ENDIF - MWRatio(I) = MWDry/MWTmp - tracerLongNames(I) = TRIM(lng_Name) - - ! dummy value for specific heat of constant pressure (Cp) - cptmp = 666._r8 - ! minimum mixing ratio - qmin = 1.e-38_r8 - ! mixing ratio type - mixtype = 'dry' - ! Used for ionospheric WACCM (WACCM-X) - molectype = 'minor' - ! Is an output field (?) - camout = .false. - ! Not true for O2(1-delta) or O2(1-sigma) - ic_from_cam2 = .true. - ! Use a fixed value at the upper boundary - has_fixed_ubc = .false. - ! Use a fixed flux condition at the upper boundary - has_fixed_ubflx = .false. - !write(tracernames(i),'(a,I0.4)') 'GCTRC_', i - ! NOTE: In MOZART, this only gets called for tracers - ! This is the call to add a "constituent" - CALL cnst_add( TRIM(tracerNames(I)), adv_Mass(I), cptmp, qmin, N, & - readiv=ic_from_cam2, mixtype=mixtype, cam_outfld=camout, & - molectype=molectype, fixed_ubc=has_fixed_ubc, & - fixed_ubflx=has_fixed_ubflx, longname=TRIM(lng_Name) ) - - ! Add to GC mapping. When starting a timestep, we will want to update the - ! concentration of State_Chm(x)%Species(1,iCol,iLev,m) with data from - ! constituent n - M = Ind_(TRIM(tracerNames(I))) + MWRATIO(I) = MWDRY/MWTMP + TRACERLONGNAMES(I) = TRIM(LNG_NAME) + + ! DUMMY VALUE FOR SPECIFIC HEAT OF CONSTANT PRESSURE (CP) + CPTMP = 666._R8 + ! MINIMUM MIXING RATIO + QMIN = 1.E-38_R8 + ! MIXING RATIO TYPE + MIXTYPE = 'DRY' + ! USED FOR IONOSPHERIC WACCM (WACCM-X) + MOLECTYPE = 'MINOR' + ! IS AN OUTPUT FIELD (?) + CAMOUT = .FALSE. + ! NOT TRUE FOR O2(1-DELTA) OR O2(1-SIGMA) + IC_FROM_CAM2 = .TRUE. + ! USE A FIXED VALUE AT THE UPPER BOUNDARY + HAS_FIXED_UBC = .FALSE. + ! USE A FIXED FLUX CONDITION AT THE UPPER BOUNDARY + HAS_FIXED_UBFLX = .FALSE. + !WRITE(TRACERNAMES(I),'(A,I0.4)') 'GCTRC_', I + ! NOTE: IN MOZART, THIS ONLY GETS CALLED FOR TRACERS + ! THIS IS THE CALL TO ADD A "CONSTITUENT" + CALL CNST_ADD( TRIM(TRACERNAMES(I)), ADV_MASS(I), CPTMP, QMIN, N, & + READIV=IC_FROM_CAM2, MIXTYPE=MIXTYPE, CAM_OUTFLD=CAMOUT, & + MOLECTYPE=MOLECTYPE, FIXED_UBC=HAS_FIXED_UBC, & + FIXED_UBFLX=HAS_FIXED_UBFLX, LONGNAME=TRIM(LNG_NAME) ) + + ! ADD TO GC MAPPING. WHEN STARTING A TIMESTEP, WE WILL WANT TO UPDATE THE + ! CONCENTRATION OF STATE_CHM(X)%SPECIES(1,ICOL,ILEV,M) WITH DATA FROM + ! CONSTITUENT N + M = IND_(TRIM(TRACERNAMES(I))) IF ( M > 0 ) THEN - map2GC(N) = M - map2Idx(N) = I + MAP2GC(N) = M + MAP2IDX(N) = I ENDIF - ! Nullify pointer - ThisSpc => NULL() + ! NULLIFY POINTER + THISSPC => NULL() ENDDO - ! Now unadvected species - map2GC_Sls = 0 - sls_ref_MMR(:) = 0.0e+0_r8 - SlsMWRatio(:) = -1.0e+0_r8 - slsLongNames = '' - DO I = 1, nSls - N = Ind_(slsNames(I)) + ! NOW UNADVECTED SPECIES + MAP2GC_SLS = 0 + SLS_REF_MMR(:) = 0.0E+0_R8 + SLSMWRATIO(:) = -1.0E+0_R8 + SLSLONGNAMES = '' + DO I = 1, NSLS + N = IND_(SLSNAMES(I)) IF ( N .GT. 0 ) THEN - ThisSpc => SC%SpcData(N)%Info - MWTmp = REAL(ThisSpc%MW_g,r8) - ref_VMR = REAL(ThisSpc%BackgroundVV,r8) - lng_Name = TRIM(ThisSpc%FullName) - slsLongNames(I) = lng_Name - sls_ref_MMR(I) = ref_VMR / (MWDry / MWTmp) - SlsMWRatio(I) = MWDry / MWTmp - map2GC_Sls(I) = N - ThisSpc => NULL() + THISSPC => SC%SPCDATA(N)%INFO + MWTMP = REAL(THISSPC%MW_G,R8) + REF_VMR = REAL(THISSPC%BACKGROUNDVV,R8) + LNG_NAME = TRIM(THISSPC%FULLNAME) + SLSLONGNAMES(I) = LNG_NAME + SLS_REF_MMR(I) = REF_VMR / (MWDRY / MWTMP) + SLSMWRATIO(I) = MWDRY / MWTMP + MAP2GC_SLS(I) = N + THISSPC => NULL() ENDIF ENDDO - ! Pass information to "short_lived_species" module - slvd_ref_MMR(1:nSls) = sls_ref_MMR(1:nSls) - CALL Register_Short_Lived_Species() - ! More information: - ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html + ! PASS INFORMATION TO "SHORT_LIVED_SPECIES" MODULE + SLVD_REF_MMR(1:NSLS) = SLS_REF_MMR(1:NSLS) + CALL REGISTER_SHORT_LIVED_SPECIES() + ! MORE INFORMATION: + ! HTTP://WWW.CESM.UCAR.EDU/MODELS/ATM-CAM/DOCS/PHYS-INTERFACE/NODE5.HTML - ! Clean up - Call Cleanup_State_Chm ( .False., SC, RC ) - Call Cleanup_State_Grid( .False., SG, RC ) - Call Cleanup_Input_Opt ( .False., IO, RC ) + ! CLEAN UP + CALL CLEANUP_STATE_CHM ( .FALSE., SC, RC ) + CALL CLEANUP_STATE_GRID( .FALSE., SG, RC ) + CALL CLEANUP_INPUT_OPT ( .FALSE., IO, RC ) - end subroutine chem_register + END SUBROUTINE CHEM_REGISTER - subroutine chem_readnl(nlfile) - ! This is the FIRST routine to get called - so it should read in - ! GEOS-Chem options from input.geos without actually doing any - ! initialization + SUBROUTINE CHEM_READNL(NLFILE) + ! THIS IS THE FIRST ROUTINE TO GET CALLED - SO IT SHOULD READ IN + ! GEOS-CHEM OPTIONS FROM INPUT.GEOS WITHOUT ACTUALLY DOING ANY + ! INITIALIZATION - use cam_abortutils, only : endrun - use units, only : getunit, freeunit - use mpishorthand - use gckpp_Model, only : nSpec, Spc_Names - use mo_chem_utls, only : get_spc_ndx - use chem_mods, only : drySpc_ndx + USE CAM_ABORTUTILS, ONLY : ENDRUN + USE UNITS, ONLY : GETUNIT, FREEUNIT + USE MPISHORTHAND + USE GCKPP_MODEL, ONLY : NSPEC, SPC_NAMES + USE MO_CHEM_UTLS, ONLY : GET_SPC_NDX + USE CHEM_MODS, ONLY : DRYSPC_NDX - ! args - CHARACTER(LEN=*), INTENT(IN) :: nlfile ! filepath for file containing namelist input + ! ARGS + CHARACTER(LEN=*), INTENT(IN) :: NLFILE ! FILEPATH FOR FILE CONTAINING NAMELIST INPUT - ! Local variables - INTEGER :: I, N, nIgnored + ! LOCAL VARIABLES + INTEGER :: I, N, NIGNORED INTEGER :: UNITN, IERR - CHARACTER(LEN=500) :: line - LOGICAL :: menuFound - LOGICAL :: validSLS - -#if ( OCNDDVEL_MOZART ) - namelist /chem_inparm/ MOZART_depvel_lnd_file, & - MOZART_clim_soilw_file, & - MOZART_season_wes_file -#endif - - nIgnored = 0 - - ! Set paths - ! MIT path - !inputGeosPath='/home/fritzt/input.geos.template' - !chemInputsDir='/net/d06/data/GCdata/ExtData/CHEM_INPUTS/' - ! Cheyenne path - inputGeosPath='/glade/u/home/fritzt/input.geos.template' - chemInputsDir='/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/' - - -#if ( ALLDDVEL_GEOSCHEM + OCNDDVEL_GEOSCHEM + OCNDDVEL_MOZART != 1 ) - IF (MasterProc) THEN - Write(iulog,'(/,a)') REPEAT( "=", 79 ) - Write(iulog,'(a)') " Preprocessor flags are not set correctly in chemistry.F90" - Write(iulog,'(a)') " The user needs to decide how to compute dry deposition velocities" - Write(iulog,'(a)') " Three options appear: " - Write(iulog,'(a)') " + Let GEOS-Chem calculate all dry deposition velocities." - Write(iulog,'(a)') " Required setup:" - Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 1" - Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 0" - Write(iulog,'(a)') " OCNDDVEL_MOZART == 0" - Write(iulog,'(a)') " + Let CLM compute dry deposition velocities over land and let" - Write(iulog,'(a)') " GEOS-Chem compute velocities over ocean and ice" - Write(iulog,'(a)') " Required setup:" - Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 0" - Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 1" - Write(iulog,'(a)') " OCNDDVEL_MOZART == 0" - Write(iulog,'(a)') " + Let CLM compute dry deposition velocities over land and" - Write(iulog,'(a)') " compute velocities over ocean and ice in a similar way as" - Write(iulog,'(a)') " MOZART" - Write(iulog,'(a)') " Required setup:" - Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 0" - Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 0" - Write(iulog,'(a)') " OCNDDVEL_MOZART == 1" - Write(iulog,'(a)') REPEAT( "=", 79 ) - CALL ENDRUN('Incorrect definitions for dry deposition velocities') + CHARACTER(LEN=500) :: LINE + LOGICAL :: MENUFOUND + LOGICAL :: VALIDSLS + +#IF ( OCNDDVEL_MOZART ) + NAMELIST /CHEM_INPARM/ MOZART_DEPVEL_LND_FILE, & + MOZART_CLIM_SOILW_FILE, & + MOZART_SEASON_WES_FILE +#ENDIF + + NIGNORED = 0 + + ! SET PATHS + ! MIT PATH + !INPUTGEOSPATH='/HOME/FRITZT/INPUT.GEOS.TEMPLATE' + !CHEMINPUTSDIR='/NET/D06/DATA/GCDATA/EXTDATA/CHEM_INPUTS/' + ! CHEYENNE PATH + INPUTGEOSPATH='/GLADE/U/HOME/FRITZT/INPUT.GEOS.TEMPLATE' + CHEMINPUTSDIR='/GLADE/P/UNIV/UMIT0034/EXTDATA/CHEM_INPUTS/' + + +#IF ( ALLDDVEL_GEOSCHEM + OCNDDVEL_GEOSCHEM + OCNDDVEL_MOZART != 1 ) + IF (MASTERPROC) THEN + WRITE(IULOG,'(/,A)') REPEAT( "=", 79 ) + WRITE(IULOG,'(A)') " PREPROCESSOR FLAGS ARE NOT SET CORRECTLY IN CHEMISTRY.F90" + WRITE(IULOG,'(A)') " THE USER NEEDS TO DECIDE HOW TO COMPUTE DRY DEPOSITION VELOCITIES" + WRITE(IULOG,'(A)') " THREE OPTIONS APPEAR: " + WRITE(IULOG,'(A)') " + LET GEOS-CHEM CALCULATE ALL DRY DEPOSITION VELOCITIES." + WRITE(IULOG,'(A)') " REQUIRED SETUP:" + WRITE(IULOG,'(A)') " ALLDDVEL_GEOSCHEM == 1" + WRITE(IULOG,'(A)') " OCNDDVEL_GEOSCHEM == 0" + WRITE(IULOG,'(A)') " OCNDDVEL_MOZART == 0" + WRITE(IULOG,'(A)') " + LET CLM COMPUTE DRY DEPOSITION VELOCITIES OVER LAND AND LET" + WRITE(IULOG,'(A)') " GEOS-CHEM COMPUTE VELOCITIES OVER OCEAN AND ICE" + WRITE(IULOG,'(A)') " REQUIRED SETUP:" + WRITE(IULOG,'(A)') " ALLDDVEL_GEOSCHEM == 0" + WRITE(IULOG,'(A)') " OCNDDVEL_GEOSCHEM == 1" + WRITE(IULOG,'(A)') " OCNDDVEL_MOZART == 0" + WRITE(IULOG,'(A)') " + LET CLM COMPUTE DRY DEPOSITION VELOCITIES OVER LAND AND" + WRITE(IULOG,'(A)') " COMPUTE VELOCITIES OVER OCEAN AND ICE IN A SIMILAR WAY AS" + WRITE(IULOG,'(A)') " MOZART" + WRITE(IULOG,'(A)') " REQUIRED SETUP:" + WRITE(IULOG,'(A)') " ALLDDVEL_GEOSCHEM == 0" + WRITE(IULOG,'(A)') " OCNDDVEL_GEOSCHEM == 0" + WRITE(IULOG,'(A)') " OCNDDVEL_MOZART == 1" + WRITE(IULOG,'(A)') REPEAT( "=", 79 ) + CALL ENDRUN('INCORRECT DEFINITIONS FOR DRY DEPOSITION VELOCITIES') ENDIF -#endif -#if ( ALLDDVEL_GEOSCHEM && ( LANDTYPE_HEMCO + LANDTYPE_CLM != 1 ) ) - IF (MasterProc) THEN - Write(iulog,'(/,a)') REPEAT( "=", 79 ) - Write(iulog,'(a)') REPEAT( "=", 79 ) - Write(iulog,'(a)') " Preprocessor flags are not set correctly in chemistry.F90" - Write(iulog,'(a)') " Dry-deposition velocities are computed by GEOS-Chem" - Write(iulog,'(a)') " The user needs to decide if land types should be from CLM or from HEMCO" - CALL ENDRUN('Incorrect definitions for source of land type data') +#ENDIF +#IF ( ALLDDVEL_GEOSCHEM && ( LANDTYPE_HEMCO + LANDTYPE_CLM != 1 ) ) + IF (MASTERPROC) THEN + WRITE(IULOG,'(/,A)') REPEAT( "=", 79 ) + WRITE(IULOG,'(A)') REPEAT( "=", 79 ) + WRITE(IULOG,'(A)') " PREPROCESSOR FLAGS ARE NOT SET CORRECTLY IN CHEMISTRY.F90" + WRITE(IULOG,'(A)') " DRY-DEPOSITION VELOCITIES ARE COMPUTED BY GEOS-CHEM" + WRITE(IULOG,'(A)') " THE USER NEEDS TO DECIDE IF LAND TYPES SHOULD BE FROM CLM OR FROM HEMCO" + CALL ENDRUN('INCORRECT DEFINITIONS FOR SOURCE OF LAND TYPE DATA') ENDIF -#endif +#ENDIF - ALLOCATE(drySpc_ndx(nddvels), STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate drySpc_ndx') + ALLOCATE(DRYSPC_NDX(NDDVELS), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('FAILED TO ALLOCATE DRYSPC_NDX') - IF (MasterProc) THEN + IF (MASTERPROC) THEN - Write(iulog,'(/,a)') REPEAT( '=', 50 ) - Write(iulog,'(a)') REPEAT( '=', 50 ) - Write(iulog,'(a)') 'This is the GEOS-CHEM / CESM interface' - Write(iulog,'(a)') REPEAT( '=', 50 ) - Write(iulog,'(a)') ' + Routines written by Thibaud M. Fritz' - Write(iulog,'(a)') ' + Laboratory for Aviation and the Environment,' - Write(iulog,'(a)') ' + Department of Aeronautics and Astronautics,' - Write(iulog,'(a)') ' + Massachusetts Institute of Technology' - Write(iulog,'(a)') REPEAT( '=', 50 ) + WRITE(IULOG,'(/,A)') REPEAT( '=', 50 ) + WRITE(IULOG,'(A)') REPEAT( '=', 50 ) + WRITE(IULOG,'(A)') 'THIS IS THE GEOS-CHEM / CESM INTERFACE' + WRITE(IULOG,'(A)') REPEAT( '=', 50 ) + WRITE(IULOG,'(A)') ' + ROUTINES WRITTEN BY THIBAUD M. FRITZ' + WRITE(IULOG,'(A)') ' + LABORATORY FOR AVIATION AND THE ENVIRONMENT,' + WRITE(IULOG,'(A)') ' + DEPARTMENT OF AERONAUTICS AND ASTRONAUTICS,' + WRITE(IULOG,'(A)') ' + MASSACHUSETTS INSTITUTE OF TECHNOLOGY' + WRITE(IULOG,'(A)') REPEAT( '=', 50 ) - Write(iulog,'(/,/, a)') 'Now defining GEOS-Chem tracers and dry deposition mapping...' + WRITE(IULOG,'(/,/, A)') 'NOW DEFINING GEOS-CHEM TRACERS AND DRY DEPOSITION MAPPING...' UNITN = GETUNIT() !============================================================== - ! Opening input.geos and go to ADVECTED SPECIES MENU + ! OPENING INPUT.GEOS AND GO TO ADVECTED SPECIES MENU !============================================================== - OPEN( UNITN, FILE=TRIM(inputGeosPath), STATUS='OLD', IOSTAT=IERR ) + OPEN( UNITN, FILE=TRIM(INPUTGEOSPATH), STATUS='OLD', IOSTAT=IERR ) IF (IERR .NE. 0) THEN - CALL ENDRUN('chem_readnl: ERROR opening input.geos') + CALL ENDRUN('CHEM_READNL: ERROR OPENING INPUT.GEOS') ENDIF - ! Go to ADVECTED SPECIES MENU - menuFound = .False. - DO WHILE ( .NOT. menuFound ) - READ( UNITN, '(a)', IOSTAT=IERR ) line + ! GO TO ADVECTED SPECIES MENU + MENUFOUND = .FALSE. + DO WHILE ( .NOT. MENUFOUND ) + READ( UNITN, '(A)', IOSTAT=IERR ) LINE IF ( IERR .NE. 0 ) THEN - CALL ENDRUN('chem_readnl: ERROR finding advected species menu') - ELSEIF ( INDEX(line, 'ADVECTED SPECIES MENU') > 0 ) THEN - menuFound = .True. + CALL ENDRUN('CHEM_READNL: ERROR FINDING ADVECTED SPECIES MENU') + ELSEIF ( INDEX(LINE, 'ADVECTED SPECIES MENU') > 0 ) THEN + MENUFOUND = .TRUE. ENDIF ENDDO !============================================================== - ! Read list of GEOS-Chem tracers + ! READ LIST OF GEOS-CHEM TRACERS !============================================================== DO - ! Read line - READ(UNITN,'(26x,a)', IOSTAT=IERR) line + ! READ LINE + READ(UNITN,'(26X,A)', IOSTAT=IERR) LINE - IF ( INDEX( TRIM(line), '---' ) > 0 ) EXIT + IF ( INDEX( TRIM(LINE), '---' ) > 0 ) EXIT - nTracers = nTracers + 1 - tracerNames(nTracers) = TRIM(line) + NTRACERS = NTRACERS + 1 + TRACERNAMES(NTRACERS) = TRIM(LINE) ENDDO CLOSE(UNITN) CALL FREEUNIT(UNITN) - ! Assign remaining tracers dummy names - DO I = (nTracers+1), nTracersMax - WRITE(tracerNames(I),'(a,I0.4)') 'GCTRC_', I + ! ASSIGN REMAINING TRACERS DUMMY NAMES + DO I = (NTRACERS+1), NTRACERSMAX + WRITE(TRACERNAMES(I),'(A,I0.4)') 'GCTRC_', I ENDDO !============================================================== - ! Now go through the KPP mechanism and add any species not - ! implemented by the tracer list in input.geos + ! NOW GO THROUGH THE KPP MECHANISM AND ADD ANY SPECIES NOT + ! IMPLEMENTED BY THE TRACER LIST IN INPUT.GEOS !============================================================== - IF ( nSpec > nSlsMax ) THEN - CALL ENDRUN('chem_readnl: too many species - increase nSlsmax') + IF ( NSPEC > NSLSMAX ) THEN + CALL ENDRUN('CHEM_READNL: TOO MANY SPECIES - INCREASE NSLSMAX') ENDIF - nSls = 0 - DO I = 1, nSpec - ! Get the name of the species from KPP - line = ADJUSTL(TRIM(Spc_Names(I))) - ! Only add this - validSLS = ( .NOT. ANY(TRIM(line) .EQ. tracerNames) ) - IF (validSLS) THEN - ! Genuine new short-lived species - nSls = nSls + 1 - slsNames(nSls) = TRIM(line) + NSLS = 0 + DO I = 1, NSPEC + ! GET THE NAME OF THE SPECIES FROM KPP + LINE = ADJUSTL(TRIM(SPC_NAMES(I))) + ! ONLY ADD THIS + VALIDSLS = ( .NOT. ANY(TRIM(LINE) .EQ. TRACERNAMES) ) + IF (VALIDSLS) THEN + ! GENUINE NEW SHORT-LIVED SPECIES + NSLS = NSLS + 1 + SLSNAMES(NSLS) = TRIM(LINE) ENDIF ENDDO !============================================================== - ! Get mapping between dry deposition species and species set + ! GET MAPPING BETWEEN DRY DEPOSITION SPECIES AND SPECIES SET !============================================================== - DO N = 1, nddvels + DO N = 1, NDDVELS - ! The species names need to be convert to upper case as, - ! for instance, BR2 != Br2 - drySpc_ndx(N) = get_spc_ndx( to_upper(drydep_list(N)) ) + ! THE SPECIES NAMES NEED TO BE CONVERT TO UPPER CASE AS, + ! FOR INSTANCE, BR2 != BR2 + DRYSPC_NDX(N) = GET_SPC_NDX( TO_UPPER(DRYDEP_LIST(N)) ) - IF ( drySpc_ndx(N) < 0 ) THEN - Write(iulog,'(a,a)') ' ## Ignoring dry deposition of ', & - TRIM(drydep_list(N)) - nIgnored = nIgnored + 1 + IF ( DRYSPC_NDX(N) < 0 ) THEN + WRITE(IULOG,'(A,A)') ' ## IGNORING DRY DEPOSITION OF ', & + TRIM(DRYDEP_LIST(N)) + NIGNORED = NIGNORED + 1 ENDIF ENDDO - IF ( nIgnored > 0 ) THEN - Write(iulog,'(a,a)') ' The species listed above have dry', & - ' deposition turned off for one of the following reasons:' - Write(iulog,'(a)') ' - They are not present in the GEOS-Chem tracer list.' - Write(iulog,'(a)') ' - They have a synonym (e.g. CH2O and HCHO).' + IF ( NIGNORED > 0 ) THEN + WRITE(IULOG,'(A,A)') ' THE SPECIES LISTED ABOVE HAVE DRY', & + ' DEPOSITION TURNED OFF FOR ONE OF THE FOLLOWING REASONS:' + WRITE(IULOG,'(A)') ' - THEY ARE NOT PRESENT IN THE GEOS-CHEM TRACER LIST.' + WRITE(IULOG,'(A)') ' - THEY HAVE A SYNONYM (E.G. CH2O AND HCHO).' ENDIF !============================================================== - ! Print summary + ! PRINT SUMMARY !============================================================== - Write(iulog,'(/, a)') '### Summary of GEOS-Chem species: ' - Write(iulog,'( a)') REPEAT( '-', 50 ) - Write(iulog,'( a)') '+ List of advected species: ' - Write(iulog,100) 'ID', 'Tracer', 'Dry deposition (T/F)' - DO N = 1, nTracers - WRITE(iulog,110) N, TRIM(tracerNames(N)), any(drySpc_ndx .eq. N) + WRITE(IULOG,'(/, A)') '### SUMMARY OF GEOS-CHEM SPECIES: ' + WRITE(IULOG,'( A)') REPEAT( '-', 50 ) + WRITE(IULOG,'( A)') '+ LIST OF ADVECTED SPECIES: ' + WRITE(IULOG,100) 'ID', 'TRACER', 'DRY DEPOSITION (T/F)' + DO N = 1, NTRACERS + WRITE(IULOG,110) N, TRIM(TRACERNAMES(N)), ANY(DRYSPC_NDX .EQ. N) ENDDO - Write(iulog,'(/, a)') '+ List of short-lived species: ' - DO N = 1, nSls - WRITE(iulog,120) N, TRIM(slsNames(N)) + WRITE(IULOG,'(/, A)') '+ LIST OF SHORT-LIVED SPECIES: ' + DO N = 1, NSLS + WRITE(IULOG,120) N, TRIM(SLSNAMES(N)) ENDDO - 100 FORMAT( 1x, A3, 3x, A10, 1x, A25 ) - 110 FORMAT( 1x, I3, 3x, A10, 1x, L15 ) - 120 FORMAT( 1x, I3, 3x, A10 ) + 100 FORMAT( 1X, A3, 3X, A10, 1X, A25 ) + 110 FORMAT( 1X, I3, 3X, A10, 1X, L15 ) + 120 FORMAT( 1X, I3, 3X, A10 ) !============================================================== ENDIF !================================================================== - ! Broadcast to all processors + ! BROADCAST TO ALL PROCESSORS !================================================================== -#if defined( SPMD ) - CALL MPIBCAST(nTracers, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) - CALL MPIBCAST(nSls, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) - CALL MPIBCAST(drySpc_ndx, nddvels, MPIINT, 0, MPICOM ) +#IF DEFINED( SPMD ) + CALL MPIBCAST(NTRACERS, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST(TRACERNAMES, LEN(TRACERNAMES(1))*NTRACERSMAX, MPICHAR, 0, MPICOM ) + CALL MPIBCAST(NSLS, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST(SLSNAMES, LEN(SLSNAMES(1))*NSLSMAX, MPICHAR, 0, MPICOM ) + CALL MPIBCAST(DRYSPC_NDX, NDDVELS, MPIINT, 0, MPICOM ) -#if ( OCNDDVEL_MOZART ) +#IF ( OCNDDVEL_MOZART ) !============================================================== - ! The following lines should only be called if we compute - ! velocities over the ocean and ice in a MOZART-like way. - ! Thibaud M. Fritz - 26 Feb 2020 + ! THE FOLLOWING LINES SHOULD ONLY BE CALLED IF WE COMPUTE + ! VELOCITIES OVER THE OCEAN AND ICE IN A MOZART-LIKE WAY. + ! THIBAUD M. FRITZ - 26 FEB 2020 !============================================================== - CALL MPIBCAST(MOZART_depvel_lnd_file, LEN(MOZART_depvel_lnd_file), MPICHAR, 0, MPICOM) - CALL MPIBCAST(MOZART_clim_soilw_file, LEN(MOZART_clim_soilw_file), MPICHAR, 0, MPICOM) - CALL MPIBCAST(MOZART_season_wes_file, LEN(MOZART_season_wes_file), MPICHAR, 0, MPICOM) -#endif - -#endif - - ! Update "short_lived_species" arrays - will eventually unify these - nSlvd = nSls - ALLOCATE(slvd_Lst(nSlvd), STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating slvd_Lst') - ALLOCATE(slvd_ref_MMR(nSlvd), STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating slvd_ref_MMR') - DO I = 1, nSls - slvd_Lst(I) = TRIM(slsNames(I)) + CALL MPIBCAST(MOZART_DEPVEL_LND_FILE, LEN(MOZART_DEPVEL_LND_FILE), MPICHAR, 0, MPICOM) + CALL MPIBCAST(MOZART_CLIM_SOILW_FILE, LEN(MOZART_CLIM_SOILW_FILE), MPICHAR, 0, MPICOM) + CALL MPIBCAST(MOZART_SEASON_WES_FILE, LEN(MOZART_SEASON_WES_FILE), MPICHAR, 0, MPICOM) +#ENDIF + +#ENDIF + + ! UPDATE "SHORT_LIVED_SPECIES" ARRAYS - WILL EVENTUALLY UNIFY THESE + NSLVD = NSLS + ALLOCATE(SLVD_LST(NSLVD), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING SLVD_LST') + ALLOCATE(SLVD_REF_MMR(NSLVD), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING SLVD_REF_MMR') + DO I = 1, NSLS + SLVD_LST(I) = TRIM(SLSNAMES(I)) ENDDO - end subroutine chem_readnl + END SUBROUTINE CHEM_READNL !================================================================================================ - function chem_is_active() + FUNCTION CHEM_IS_ACTIVE() !----------------------------------------------------------------------- - logical :: chem_is_active + LOGICAL :: CHEM_IS_ACTIVE !----------------------------------------------------------------------- - chem_is_active = .true. + CHEM_IS_ACTIVE = .TRUE. - end function chem_is_active + END FUNCTION CHEM_IS_ACTIVE !================================================================================================ - function chem_implements_cnst(name) + FUNCTION CHEM_IMPLEMENTS_CNST(NAME) !----------------------------------------------------------------------- ! - ! Purpose: return true if specified constituent is implemented by this package + ! PURPOSE: RETURN TRUE IF SPECIFIED CONSTITUENT IS IMPLEMENTED BY THIS PACKAGE ! - ! Author: B. Eaton + ! AUTHOR: B. EATON ! !----------------------------------------------------------------------- IMPLICIT NONE - !-----------------------------Arguments--------------------------------- + !-----------------------------ARGUMENTS--------------------------------- - CHARACTER(LEN=*), INTENT(IN) :: name ! constituent name - LOGICAL :: chem_implements_cnst ! return value + CHARACTER(LEN=*), INTENT(IN) :: NAME ! CONSTITUENT NAME + LOGICAL :: CHEM_IMPLEMENTS_CNST ! RETURN VALUE INTEGER :: I - chem_implements_cnst = .false. + CHEM_IMPLEMENTS_CNST = .FALSE. - DO I = 1, nTracers - IF (TRIM(tracerNames(I)) .eq. TRIM(NAME)) THEN - chem_implements_cnst = .true. + DO I = 1, NTRACERS + IF (TRIM(TRACERNAMES(I)) .EQ. TRIM(NAME)) THEN + CHEM_IMPLEMENTS_CNST = .TRUE. EXIT ENDIF ENDDO - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_IMPLEMENTS_CNST' + IF (MASTERPROC) WRITE(IULOG,'(A)') 'GCCALL CHEM_IMPLEMENTS_CNST' - end function chem_implements_cnst + END FUNCTION CHEM_IMPLEMENTS_CNST !=============================================================================== - subroutine chem_init(phys_state, pbuf2d) + SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) !----------------------------------------------------------------------- ! - ! Purpose: initialize GEOS-Chem parts (state objects, mainly) - ! (and declare history variables) + ! PURPOSE: INITIALIZE GEOS-CHEM PARTS (STATE OBJECTS, MAINLY) + ! (AND DECLARE HISTORY VARIABLES) ! !----------------------------------------------------------------------- - use physics_buffer, only: physics_buffer_desc, pbuf_get_index - use cam_history, only: addfld, add_default, horiz_only - use chem_mods, only: map2GC_dryDep, drySpc_ndx - - use mpishorthand - use cam_abortutils, only : endrun - - use Input_Opt_Mod - use State_Chm_Mod - use State_Grid_Mod - use State_Met_Mod - use DiagList_Mod, only : Init_DiagList, Print_DiagList - use GC_Environment_Mod - use GC_Grid_Mod, only : SetGridFromCtrEdges - - ! Use GEOS-Chem versions of physical constants - use PhysConstants, only : PI, PI_180 - use PhysConstants, only : Re - - use Phys_Grid, only : get_Area_All_p - use hycoef, only : ps0, hyai, hybi - - use Time_Mod, only : Accept_External_Date_Time - !use Time_Mod, only : Set_Begin_Time, Set_End_Time - !use Time_Mod, only : Set_Current_Time, Set_DiagB - !use Transfer_Mod, only : Init_Transfer - use Linoz_Mod, only : Linoz_Read - -#if ( OCNDDVEL_MOZART ) - use seq_drydep_mod, only: drydep_method, DD_XLND - use mo_drydep, only: drydep_inti -#endif - - use CMN_Size_Mod - - use Drydep_Mod, only : Init_Drydep, DepName, nDVZind - use Carbon_Mod, only : Init_Carbon - use Dust_Mod, only : Init_Dust - use Seasalt_Mod, only : Init_Seasalt - use Sulfate_Mod, only : Init_Sulfate - use Aerosol_Mod, only : Init_Aerosol - use WetScav_Mod, only : Init_WetScav - use TOMS_Mod, only : Init_TOMS - use Pressure_Mod, only : Init_Pressure, Accept_External_ApBp - use Chemistry_Mod, only : Init_Chemistry - use UCX_Mod, only : Init_UCX -#if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) - use Olson_Landmap_Mod -#endif - use Mixing_Mod - - use PBL_Mix_Mod, only : Init_PBL_Mix - - use GC_Emissions_Mod, only : GC_Emissions_Init - - TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) - TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) - - ! Local variables + USE PHYSICS_BUFFER, ONLY: PHYSICS_BUFFER_DESC, PBUF_GET_INDEX + USE CAM_HISTORY, ONLY: ADDFLD, ADD_DEFAULT, HORIZ_ONLY + USE CHEM_MODS, ONLY: MAP2GC_DRYDEP, DRYSPC_NDX + + USE MPISHORTHAND + USE CAM_ABORTUTILS, ONLY : ENDRUN + + USE INPUT_OPT_MOD + USE STATE_CHM_MOD + USE STATE_GRID_MOD + USE STATE_MET_MOD + USE DIAGLIST_MOD, ONLY : INIT_DIAGLIST, PRINT_DIAGLIST + USE GC_ENVIRONMENT_MOD + USE GC_GRID_MOD, ONLY : SETGRIDFROMCTREDGES + + ! USE GEOS-CHEM VERSIONS OF PHYSICAL CONSTANTS + USE PHYSCONSTANTS, ONLY : PI, PI_180 + USE PHYSCONSTANTS, ONLY : RE + + USE PHYS_GRID, ONLY : GET_AREA_ALL_P + USE HYCOEF, ONLY : PS0, HYAI, HYBI + + USE TIME_MOD, ONLY : ACCEPT_EXTERNAL_DATE_TIME + !USE TIME_MOD, ONLY : SET_BEGIN_TIME, SET_END_TIME + !USE TIME_MOD, ONLY : SET_CURRENT_TIME, SET_DIAGB + !USE TRANSFER_MOD, ONLY : INIT_TRANSFER + USE LINOZ_MOD, ONLY : LINOZ_READ + +#IF ( OCNDDVEL_MOZART ) + USE SEQ_DRYDEP_MOD, ONLY: DRYDEP_METHOD, DD_XLND + USE MO_DRYDEP, ONLY: DRYDEP_INTI +#ENDIF + + USE CMN_SIZE_MOD + + USE DRYDEP_MOD, ONLY : INIT_DRYDEP, DEPNAME, NDVZIND + USE CARBON_MOD, ONLY : INIT_CARBON + USE DUST_MOD, ONLY : INIT_DUST + USE SEASALT_MOD, ONLY : INIT_SEASALT + USE SULFATE_MOD, ONLY : INIT_SULFATE + USE AEROSOL_MOD, ONLY : INIT_AEROSOL + USE WETSCAV_MOD, ONLY : INIT_WETSCAV + USE PRESSURE_MOD, ONLY : INIT_PRESSURE, ACCEPT_EXTERNAL_APBP + USE CHEMISTRY_MOD, ONLY : INIT_CHEMISTRY + USE UCX_MOD, ONLY : INIT_UCX +#IF ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) + USE OLSON_LANDMAP_MOD +#ENDIF + USE MIXING_MOD + + USE PBL_MIX_MOD, ONLY : INIT_PBL_MIX + + USE GC_EMISSIONS_MOD, ONLY : GC_EMISSIONS_INIT + + TYPE(PHYSICS_STATE), INTENT(IN):: PHYS_STATE(BEGCHUNK:ENDCHUNK) + TYPE(PHYSICS_BUFFER_DESC), POINTER :: PBUF2D(:,:) + + ! LOCAL VARIABLES !---------------------------- - ! Scalars + ! SCALARS !---------------------------- - ! Integers + ! INTEGERS INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) INTEGER :: IWAIT, IERR - INTEGER :: nX, nY, nZ - INTEGER :: iX, jY + INTEGER :: NX, NY, NZ + INTEGER :: IX, JY INTEGER :: I, J, L, N INTEGER :: RC INTEGER :: NLINOZ - ! Logicals - LOGICAL :: am_I_Root, rootChunk - LOGICAL :: prtDebug + ! LOGICALS + LOGICAL :: ROOTCHUNK + LOGICAL :: PRTDEBUG - ! Strings - CHARACTER(LEN=255) :: historyConfigFile - CHARACTER(LEN=255) :: SpcName + ! STRINGS + CHARACTER(LEN=255) :: HISTORYCONFIGFILE + CHARACTER(LEN=255) :: SPCNAME - ! Grid setup - REAL(fp) :: lonVal, latVal - REAL(fp) :: dLonFix, dLatFix - REAL(f4), ALLOCATABLE :: lonMidArr(:,:), latMidArr(:,:) - REAL(f4), ALLOCATABLE :: lonEdgeArr(:,:), latEdgeArr(:,:) - REAL(r8), ALLOCATABLE :: linozData(:,:,:,:) + ! GRID SETUP + REAL(FP) :: LONVAL, LATVAL + REAL(FP) :: DLONFIX, DLATFIX + REAL(F4), ALLOCATABLE :: LONMIDARR(:,:), LATMIDARR(:,:) + REAL(F4), ALLOCATABLE :: LONEDGEARR(:,:), LATEDGEARR(:,:) + REAL(R8), ALLOCATABLE :: LINOZDATA(:,:,:,:) - REAL(r8), ALLOCATABLE :: Col_Area(:) - REAL(fp), ALLOCATABLE :: Ap_CAM_Flip(:), Bp_CAM_Flip(:) + REAL(R8), ALLOCATABLE :: COL_AREA(:) + REAL(FP), ALLOCATABLE :: AP_CAM_FLIP(:), BP_CAM_FLIP(:) - REAL(r8), POINTER :: SlsPtr(:,:,:) + REAL(R8), POINTER :: SLSPTR(:,:,:) - ! Assume a successful return until otherwise + ! ASSUME A SUCCESSFUL RETURN UNTIL OTHERWISE RC = GC_SUCCESS - ! For error trapping - ErrMsg = '' - ThisLoc = ' -> at GEOS-Chem (in chemistry/pp_geoschem/chemistry.F90)' + ! FOR ERROR TRAPPING + ERRMSG = '' + THISLOC = ' -> AT GEOS-CHEM (IN CHEMISTRY/PP_GEOSCHEM/CHEMISTRY.F90)' - ! LCHNK: which chunks we have on this process + ! LCHNK: WHICH CHUNKS WE HAVE ON THIS PROCESS LCHNK = PHYS_STATE%LCHNK - ! NCOL: number of atmospheric columns for each chunk + ! NCOL: NUMBER OF ATMOSPHERIC COLUMNS FOR EACH CHUNK NCOL = PHYS_STATE%NCOL - write(iulog,'(2(a,x,I6,x))') 'chem_init called on PE ', myCPU, ' of ', nCPUs - - ! The GEOS-Chem grids on every "chunk" will all be the same size, to avoid - ! the possibility of having differently-sized chunks - nX = 1 - !nY = MAXVAL(NCOL) - nY = PCOLS - nZ = PVER - - !! Add short lived speies to buffers - !CALL Pbuf_add_field(Trim(SLSBuffer),'global',dtype_r8,(/PCOLS,PVER,nSls/),Sls_Pbf_Idx) - !! Initialize - !ALLOCATE(SlsPtr(PCOLS,PVER,BEGCHUNK:ENDCHUNK), STAT=IERR) - !IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating SlsPtr') - !SlsPtr(:,:,:) = 0.0e+0_r8 - !DO I=1,nSls - ! SlsPtr(:,:,:) = sls_ref_MMR(I) - ! CALL pbuf_set_field(pbuf2d,Sls_Pbf_Idx,SlsPtr,start=(/1,1,i/),kount=(/PCOLS,PVER,1/)) + WRITE(IULOG,'(2(A,X,I6,X))') 'CHEM_INIT CALLED ON PE ', MYCPU, ' OF ', NCPUS + + ! THE GEOS-CHEM GRIDS ON EVERY "CHUNK" WILL ALL BE THE SAME SIZE, TO AVOID + ! THE POSSIBILITY OF HAVING DIFFERENTLY-SIZED CHUNKS + NX = 1 + !NY = MAXVAL(NCOL) + NY = PCOLS + NZ = PVER + + !! ADD SHORT LIVED SPEIES TO BUFFERS + !CALL PBUF_ADD_FIELD(TRIM(SLSBUFFER),'GLOBAL',DTYPE_R8,(/PCOLS,PVER,NSLS/),SLS_PBF_IDX) + !! INITIALIZE + !ALLOCATE(SLSPTR(PCOLS,PVER,BEGCHUNK:ENDCHUNK), STAT=IERR) + !IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING SLSPTR') + !SLSPTR(:,:,:) = 0.0E+0_R8 + !DO I=1,NSLS + ! SLSPTR(:,:,:) = SLS_REF_MMR(I) + ! CALL PBUF_SET_FIELD(PBUF2D,SLS_PBF_IDX,SLSPTR,START=(/1,1,I/),KOUNT=(/PCOLS,PVER,1/)) !ENDDO - !DEALLOCATE(SlsPtr) - - ! This ensures that each process allocates everything needed for its chunks - ALLOCATE(State_Chm(BEGCHUNK:ENDCHUNK) , STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Chm') - ALLOCATE(State_Diag(BEGCHUNK:ENDCHUNK) , STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Diag') - ALLOCATE(State_Grid(BEGCHUNK:ENDCHUNK), STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Grid') - ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK) , STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Met') - - ! Initialize fields of the Input Options object - CALL Set_Input_Opt( am_I_Root = MasterProc, & - Input_Opt = Input_Opt, & + !DEALLOCATE(SLSPTR) + + ! THIS ENSURES THAT EACH PROCESS ALLOCATES EVERYTHING NEEDED FOR ITS CHUNKS + ALLOCATE(STATE_CHM(BEGCHUNK:ENDCHUNK) , STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING STATE_CHM') + ALLOCATE(STATE_DIAG(BEGCHUNK:ENDCHUNK) , STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING STATE_DIAG') + ALLOCATE(STATE_GRID(BEGCHUNK:ENDCHUNK), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING STATE_GRID') + ALLOCATE(STATE_MET(BEGCHUNK:ENDCHUNK) , STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING STATE_MET') + + ! INITIALIZE FIELDS OF THE INPUT OPTIONS OBJECT + CALL SET_INPUT_OPT( AM_I_ROOT = MASTERPROC, & + INPUT_OPT = INPUT_OPT, & RC = RC ) ! Set some basic flags @@ -809,12 +806,8 @@ subroutine chem_init(phys_state, pbuf2d) DO I = BEGCHUNK, ENDCHUNK - ! Only treat the first chunk as the "root" - am_I_Root = ((I.EQ.BEGCHUNK) .and. MasterProc) - ! Initialize fields of the Grid State object - CALL Init_State_Grid( am_I_Root = am_I_Root, & - State_Grid = State_Grid(I), & + CALL Init_State_Grid( State_Grid = State_Grid(I), & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN @@ -827,8 +820,7 @@ subroutine chem_init(phys_state, pbuf2d) State_Grid(I)%NZ = nZ ! Initialize GEOS-Chem horizontal grid structure - CALL GC_Init_Grid( am_I_Root = am_I_Root, & - Input_Opt = Input_Opt, & + CALL GC_Init_Grid( Input_Opt = Input_Opt, & State_Grid = State_Grid(I), & RC = RC ) @@ -859,8 +851,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Call the routine GC_Allocate_All (located in module file ! GeosCore/gc_environment_mod.F90) to allocate all lat/lon ! allocatable arrays used by GEOS-Chem. - CALL GC_Allocate_All ( am_I_Root = MasterProc, & - Input_Opt = Input_Opt, & + CALL GC_Allocate_All ( Input_Opt = Input_Opt, & State_Grid = State_Grid(BEGCHUNK), & value_I_Lo = 1, & value_J_Lo = 1, & @@ -884,8 +875,7 @@ subroutine chem_init(phys_state, pbuf2d) ! TODO: Mimic GEOS-Chem's reading of input options !IF (MasterProc) THEN - ! CALL Read_Input_File( am_I_Root = .True., & - ! Input_Opt = Input_Opt(BEGCHUNK), & + ! CALL Read_Input_File( Input_Opt = Input_Opt(BEGCHUNK), & ! srcFile = inputGeosPath, & ! RC = RC ) !ENDIF @@ -1113,8 +1103,7 @@ subroutine chem_init(phys_state, pbuf2d) latEdgeArr(nX+1,J) = REAL((latVal) * PI_180, f4) ENDDO - CALL SetGridFromCtrEdges( am_I_Root = MasterProc, & - State_Grid = State_Grid(L), & + CALL SetGridFromCtrEdges( State_Grid = State_Grid(L), & lonCtr = lonMidArr, & latCtr = latMidArr, & lonEdge = lonEdgeArr, & @@ -1134,8 +1123,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Set the times held by "time_mod" - CALL Accept_External_Date_Time( am_I_Root = MasterProc, & - value_NYMDb = Input_Opt%NYMDb, & + CALL Accept_External_Date_Time( value_NYMDb = Input_Opt%NYMDb, & value_NHMSb = Input_Opt%NHMSb, & value_NYMDe = Input_Opt%NYMDe, & value_NHMSe = Input_Opt%NHMSe, & @@ -1172,13 +1160,11 @@ subroutine chem_init(phys_state, pbuf2d) !ENDIF !!### Print diagnostic list if needed for debugging - !IF ( prtDebug ) CALL Print_DiagList( am_I_Root, Diag_List, RC ) + !IF ( prtDebug ) CALL Print_DiagList( Diag_List, RC ) DO I = BEGCHUNK, ENDCHUNK - am_I_Root = (MasterProc .AND. (I == BEGCHUNK)) - CALL GC_Init_StateObj( am_I_Root = am_I_Root, & ! Root CPU (Y/N)? - & Diag_List = Diag_List, & ! Diagnostic list obj + CALL GC_Init_StateObj( Diag_List = Diag_List, & ! Diagnostic list obj & Input_Opt = Input_Opt, & ! Input Options & State_Chm = State_Chm(I), & ! Chemistry State & State_Diag = State_Diag(I), & ! Diagnostics State @@ -1201,8 +1187,7 @@ subroutine chem_init(phys_state, pbuf2d) IF ( Input_Opt%LDryD ) THEN ! Setup for dry deposition - CALL Init_Drydep( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & + CALL Init_Drydep( Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & & State_Diag = State_Diag(BEGCHUNK), & & State_Grid = State_Grid(BEGCHUNK), & @@ -1278,8 +1263,7 @@ subroutine chem_init(phys_state, pbuf2d) IF ( Input_Opt%LConv .OR. & Input_Opt%LWetD .OR. & Input_Opt%LChem ) THEN - CALL Init_WetScav( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & + CALL Init_WetScav( Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & & State_Diag = State_Diag(BEGCHUNK), & & State_Grid = State_Grid(BEGCHUNK), & @@ -1297,8 +1281,7 @@ subroutine chem_init(phys_state, pbuf2d) ! of logical_mod.F and tracer_mod.F.. This has to be called ! after the input.geos file has been read from disk. !----------------------------------------------------------------- - !CALL Set_VDiff_Values( am_I_Root = MasterProc, & - !& Input_Opt = Input_Opt, & + !CALL Set_VDiff_Values( Input_Opt = Input_Opt, & !& State_Chm = State_Chm(BEGCHUNK), & !& RC = RC ) @@ -1310,8 +1293,7 @@ subroutine chem_init(phys_state, pbuf2d) !----------------------------------------------------------------- ! Initialize the GET_NDEP_MOD for soil NOx deposition (bmy, 6/17/16) !----------------------------------------------------------------- - !CALL Init_Get_NDep( am_I_Root = MasterProc, & - !& Input_Opt = Input_Opt, & + !CALL Init_Get_NDep( Input_Opt = Input_Opt, & !& State_Chm = State_Chm(BEGCHUNK), & !& State_Diag = State_Diag(BEGCHUNK), & !& RC = RC ) @@ -1325,8 +1307,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Initialize "carbon_mod.F" !----------------------------------------------------------------- IF ( Input_Opt%LCarb ) THEN - CALL Init_Carbon( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & + CALL Init_Carbon( Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & & State_Diag = State_Diag(BEGCHUNK), & & State_Grid = State_Grid(BEGCHUNK), & @@ -1339,8 +1320,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF IF ( Input_Opt%LDust ) THEN - CALL Init_Dust( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & + CALL Init_Dust( Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & & State_Diag = State_Diag(BEGCHUNK), & & State_Grid = State_Grid(BEGCHUNK), & @@ -1353,8 +1333,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF IF ( Input_Opt%LSSalt ) THEN - CALL Init_Seasalt( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & + CALL Init_Seasalt( Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & & State_Diag = State_Diag(BEGCHUNK), & & State_Grid = State_Grid(BEGCHUNK), & @@ -1367,8 +1346,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF IF ( Input_Opt%LSulf ) THEN - CALL Init_Sulfate( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & + CALL Init_Sulfate( Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & & State_Diag = State_Diag(BEGCHUNK), & & State_Grid = State_Grid(BEGCHUNK), & @@ -1384,8 +1362,7 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%LCarb .OR. & Input_Opt%LDust .OR. & Input_Opt%LSSalt ) THEN - CALL Init_Aerosol( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & + CALL Init_Aerosol( Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & & State_Diag = State_Diag(BEGCHUNK), & & State_Grid = State_Grid(BEGCHUNK), & @@ -1397,23 +1374,8 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDIF - IF ( Input_Opt%LChem ) THEN - CALL Init_Toms( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_TOMS"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ENDIF - ! This is a bare subroutine - no module - CALL NDXX_Setup( MasterProc, & - & Input_Opt, & + CALL NDXX_Setup( Input_Opt, & & State_Chm(BEGCHUNK), & & State_Grid(BEGCHUNK), & & RC ) @@ -1423,8 +1385,7 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - CALL Init_PBL_Mix( am_I_Root = MasterProc, & - State_Grid = State_Grid(BEGCHUNK), & + CALL Init_PBL_Mix( State_Grid = State_Grid(BEGCHUNK), & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN @@ -1476,8 +1437,7 @@ subroutine chem_init(phys_state, pbuf2d) !----------------------------------------------------------------- ! Initialize the hybrid pressure module. Define Ap and Bp. !----------------------------------------------------------------- - CALL Init_Pressure( am_I_Root = MasterProc, & ! Root CPU (Y/N)? - State_Grid = State_Grid(BEGCHUNK), & ! Grid State + CALL Init_Pressure( State_Grid = State_Grid(BEGCHUNK), & ! Grid State RC = RC ) ! Success or failure ! Trapping errors @@ -1489,8 +1449,7 @@ subroutine chem_init(phys_state, pbuf2d) !----------------------------------------------------------------- ! Pass external Ap and Bp to GEOS-Chem's Pressure_Mod !----------------------------------------------------------------- - CALL Accept_External_ApBp( am_I_Root = MasterProc, & ! Root CPU (Y/N)? - State_Grid = State_Grid(BEGCHUNK), & ! Grid State + CALL Accept_External_ApBp( State_Grid = State_Grid(BEGCHUNK), & ! Grid State ApIn = Ap_CAM_Flip, & ! "A" term for hybrid grid BpIn = Bp_CAM_Flip, & ! "B" term for hybrid grid RC = RC ) ! Success or failure @@ -1514,8 +1473,7 @@ subroutine chem_init(phys_state, pbuf2d) DEALLOCATE(Ap_CAM_Flip,Bp_CAM_Flip) !! Initialize HEMCO? - !CALL Emissions_Init ( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & + !CALL Emissions_Init ( Input_Opt = Input_Opt, & ! State_Met = State_Met, & ! State_Chm = State_Chm, & ! State_Grid = State_Grid, & @@ -1531,8 +1489,7 @@ subroutine chem_init(phys_state, pbuf2d) #if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) ! Populate the State_Met%LandTypeFrac field with data from HEMCO - CALL Init_LandTypeFrac( am_I_Root = MasterProc, & - Input_Opt = Input_Opt, & + CALL Init_LandTypeFrac( Input_Opt = Input_Opt, & State_Met = State_Met(BEGCHUNK), & RC = RC ) @@ -1543,8 +1500,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Compute the Olson landmap fields of State_Met ! (e.g. State_Met%IREG, State_Met%ILAND, etc.) - CALL Compute_Olson_Landmap( am_I_Root = MasterProc, & - Input_Opt = Input_Opt, & + CALL Compute_Olson_Landmap( Input_Opt = Input_Opt, & State_Grid = State_Grid(BEGCHUNK), & State_Met = State_Met(BEGCHUNK), & RC = RC ) @@ -1557,8 +1513,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Initialize PBL quantities but do not do mixing ! Add option for non-local PBL (Lin, 03/31/09) - CALL Init_Mixing ( am_I_Root = MasterProc, & - Input_Opt = Input_Opt, & + CALL Init_Mixing ( Input_Opt = Input_Opt, & State_Chm = State_Chm(BEGCHUNK), & State_Diag = State_Diag(BEGCHUNK), & State_Grid = State_Grid(BEGCHUNK), & @@ -1574,8 +1529,7 @@ subroutine chem_init(phys_state, pbuf2d) IF ( Input_Opt%Its_A_FullChem_Sim .OR. & Input_Opt%Its_An_Aerosol_Sim ) THEN ! This also initializes Fast-JX - CALL Init_Chemistry( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & + CALL Init_Chemistry( Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & & State_Diag = State_Diag(BEGCHUNK), & & State_Grid = State_Grid(BEGCHUNK), & @@ -1589,8 +1543,7 @@ subroutine chem_init(phys_state, pbuf2d) IF ( Input_Opt%LChem .AND. & Input_Opt%LUCX ) THEN - CALL Init_UCX( am_I_Root = MasterProc, & - & Input_Opt = Input_Opt, & + CALL Init_UCX( Input_Opt = Input_Opt, & & State_Chm = State_Chm(BEGCHUNK), & & State_Diag = State_Diag(BEGCHUNK), & & State_Grid = State_Grid(BEGCHUNK) ) @@ -2085,8 +2038,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Drydep_Mod, only: Update_DryDepSav use Mixing_Mod - use Dao_Mod, only: Set_Dry_Surface_Pressure - use Dao_Mod, only: AirQnt + use Calc_Met_Mod, only: Set_Dry_Surface_Pressure + use Calc_Met_Mod, only: AirQnt use GC_Grid_Mod, only: SetGridFromCtr use Pressure_Mod, only: Set_Floating_Pressures use Pressure_Mod, only: Accept_External_Pedge @@ -2271,8 +2224,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ! Update the grid - Call SetGridFromCtr( am_I_Root = rootChunk, & - State_Grid = State_Grid(LCHNK), & + Call SetGridFromCtr( State_Grid = State_Grid(LCHNK), & lonCtr = lonMidArr, & latCtr = latMidArr, & RC = RC ) @@ -2895,8 +2847,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ! Pass time values obtained from the ESMF environment to GEOS-Chem - CALL Accept_External_Date_Time( am_I_Root = rootChunk, & - value_NYMD = currYMD, & + CALL Accept_External_Date_Time( value_NYMD = currYMD, & value_NHMS = currHMS, & value_YEAR = currYr, & value_MONTH = currMo, & @@ -2913,8 +2864,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - CALL Accept_External_PEdge( am_I_Root = rootChunk, & - State_Met = State_Met(LCHNK), & + CALL Accept_External_PEdge( State_Met = State_Met(LCHNK), & RC = RC ) IF ( RC /= GC_SUCCESS ) THEN @@ -2945,8 +2895,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%PSC2_WET = State_Met(LCHNK)%PS1_WET State_Met(LCHNK)%PSC2_DRY = State_Met(LCHNK)%PS1_DRY - CALL Set_Floating_Pressures( am_I_Root = rootChunk, & - State_Grid = State_Grid(LCHNK), & + CALL Set_Floating_Pressures( State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & RC = RC ) @@ -2978,8 +2927,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! (13) AIRVOL : Volume of grid box [m^3] ! (14) MOISTMW : Molecular weight of moist air in box [g/mol] ! ==================================================================== - CALL AirQnt( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & + CALL AirQnt( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & @@ -2996,8 +2944,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! the first call to AirQnt !IF ( (.not.SCHEM_READY) .and. Input_Opt%LSCHEM ) THEN IF ( (.not.SCHEM_READY) .and. .True. ) THEN !TMMF - CALL Init_Strat_Chem( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & + CALL Init_Strat_Chem( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Met = State_Met(LCHNK), & State_Grid = State_Grid(LCHNK), & @@ -3020,8 +2967,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! (ckeller, 4/1/15) !============================================================== ! Run HEMCO Phase 1 - !CALL Emissions_Run ( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & + !CALL Emissions_Run ( Input_Opt = Input_Opt, & ! State_Chm = State_Chm(LCHNK), & ! State_Diag = State_Diag(LCHNK), & ! State_Grid = State_Grid(LCHNK), & @@ -3056,8 +3002,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ! ! Copy UV Albedo data (for photolysis) into the ! ! State_Met%UVALBEDO field. (bmy, 3/20/15) - ! CALL Get_UvAlbedo( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & + ! CALL Get_UvAlbedo( Input_Opt = Input_Opt, & ! State_Met = State_Met(LCHNK), & ! RC = RC ) ! @@ -3070,8 +3015,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! IF ( Input_Opt%USE_TOMS_O3 ) THEN ! ! Get TOMS overhead O3 columns for photolysis from ! ! the HEMCO data structure (bmy, 3/20/15) - ! CALL Read_TOMS( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & + ! CALL Read_TOMS( Input_Opt = Input_Opt, & ! RC = RC ) ! ! ! Trap potential errors @@ -3086,8 +3030,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ! Read data required for Hg2 gas-particle partitioning ! ! (H Amos, 25 Oct 2011) ! IF ( ITS_A_MERCURY_SIM ) THEN - ! CALL Read_Hg2_Partitioning( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & + ! CALL Read_Hg2_Partitioning( Input_Opt = Input_Opt, & ! State_Grid = State_Grid(LCHNK), & ! State_Met = State_Met(LCHNK), & ! MONTH = 1, & !TMMF @@ -3107,8 +3050,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !IF ( ITS_A_FULLCHEM_SIM .and. id_CH4 > 0 ) THEN ! ! ! Set CH4 concentrations - ! CALL SET_CH4( am_I_Root = MasterProc, & - ! Input_Opt = Input_Opt, & + ! CALL SET_CH4( Input_Opt = Input_Opt, & ! State_Chm = State_Chm(LCHNK), & ! State_Diag = State_Diag(LCHNK), & ! State_Grid = State_Grid(LCHNK), & @@ -3124,8 +3066,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Eventually initialize/reset wetdep IF ( Input_Opt%LConv .OR. Input_Opt%LChem .OR. Input_Opt%LWetD ) THEN - CALL Setup_WetScav( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & + CALL Setup_WetScav( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & @@ -3154,8 +3095,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! (7) F_UNDER_PBLTOP: Fraction of grid box underneath the PBL top [-] ! (8) PBL_MAX_L : Model level where PBL top occurs [-] ! ==================================================================== - CALL Compute_PBL_Height( am_I_Root = rootChunk, & - State_Grid = State_Grid(LCHNK), & + CALL Compute_PBL_Height( State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & RC = RC ) @@ -3214,8 +3154,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) #if ( LANDTYPE_CLM ) ! Compute the Olson landmap fields of State_Met ! (e.g. State_Met%IREG, State_Met%ILAND, etc.) - CALL Compute_Olson_Landmap( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & + CALL Compute_Olson_Landmap( Input_Opt = Input_Opt, & State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & RC = RC ) @@ -3228,8 +3167,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Compute State_Met%XLAI (for drydep) and State_Met%MODISLAI, ! which is the average LAI per grid box (for soil NOx emissions) - CALL Compute_Xlai( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & + CALL Compute_Xlai( Input_Opt = Input_Opt, & State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & RC = RC ) @@ -3244,8 +3182,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) #if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) ! Compute drydep velocities and update State_Chm%DryDepVel - CALL Do_Drydep( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & + CALL Do_Drydep( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & State_Grid = State_Grid(LCHNK), & @@ -3386,8 +3323,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL ENDRUN('Incorrect definitions for dry deposition velocities') #endif - CALL Update_DryDepSav( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & + CALL Update_DryDepSav( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & State_Grid = State_Grid(LCHNK), & @@ -3410,8 +3346,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !! only calculates emissions. All data has been read to disk !! in phase 1 at the beginning of the time step. !! (ckeller, 4/1/15) - !CALL Emissions_Run( am_I_Root = rootChunk, & - ! Input_Opt = Input_Opt, & + !CALL Emissions_Run( Input_Opt = Input_Opt, & ! State_Chm = State_Chmk(LCHNK), & ! State_Diag = State_Diag(LCHNK), & ! State_Grid = State_Grid(LCHNK), & @@ -3446,8 +3381,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ! This requires HEMCO. For now comment out. ! Thibaud M. Fritz - 05/07/20 - !CALL Do_Mixing( am_I_Root = rootChunk, & - ! Input_Opt = Input_Opt, & + !CALL Do_Mixing( Input_Opt = Input_Opt, & ! State_Chm = State_Chm(LCHNK), & ! State_Diag = State_Diag(LCHNK), & ! State_Grid = State_Grid(LCHNK), & @@ -3468,8 +3402,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ! Call the appropriate convection routine ! ! NOTE: Tracer concentration units are converted locally ! ! to [kg/kg total air] for convection (ewl, 9/18/15) - ! CALL Do_Convection( am_I_Root = rootChunk, & - ! Input_Opt = Input_Opt, & + ! CALL Do_Convection( Input_Opt = Input_Opt, & ! State_Chm = State_Chm(LCHNK), & ! State_Diag = State_Diag(LCHNK), & ! State_Grid = State_Grid(LCHNK), & @@ -3491,16 +3424,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Input_Opt%Its_An_Aerosol_Sim ) THEN IF ( Input_Opt%LChem ) THEN - CALL Compute_Overhead_O3( am_I_Root = rootChunk, & - State_Grid = State_Grid(LCHNK), & + CALL Compute_Overhead_O3( State_Grid = State_Grid(LCHNK), & DAY = currDy, & USE_O3_FROM_MET = Input_Opt%Use_O3_From_Met, & TO3 = State_Met(LCHNK)%TO3 ) ENDIF ENDIF - CALL Do_Chemistry( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & + CALL Do_Chemistry( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & State_Grid = State_Grid(LCHNK), & @@ -3521,8 +3452,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! NOTE: Tracer concentration units are converted locally ! to [kg/m2] in wet deposition to enable calculations ! along the column (ewl, 9/18/15) - CALL Do_WetDep( am_I_Root = rootChunk, & - Input_Opt = Input_Opt, & + CALL Do_WetDep( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & State_Grid = State_Grid(LCHNK), & @@ -4038,7 +3968,6 @@ subroutine chem_final use Dust_Mod, only : Cleanup_Dust use Seasalt_Mod, only : Cleanup_Seasalt use Aerosol_Mod, only : Cleanup_Aerosol - use TOMS_Mod, only : Cleanup_Toms use Sulfate_Mod, only : Cleanup_Sulfate use Pressure_Mod, only : Cleanup_Pressure use Strat_Chem_Mod, only : Cleanup_Strat_Chem @@ -4054,7 +3983,6 @@ subroutine chem_final use GC_Emissions_Mod, only: GC_Emissions_Final INTEGER :: I, RC - LOGICAL :: am_I_Root ! Finalize GEOS-Chem IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_FINAL' @@ -4064,7 +3992,7 @@ subroutine chem_final CALL Cleanup_Carbon CALL Cleanup_Drydep CALL Cleanup_Dust - CALL Cleanup_FlexChem( am_I_Root, RC ) + CALL Cleanup_FlexChem( RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Cleanup_FlexChem"!' CALL Error_Stop( ErrMsg, ThisLoc ) @@ -4075,13 +4003,8 @@ subroutine chem_final CALL Cleanup_Seasalt CALL Cleanup_Sulfate CALL Cleanup_Strat_Chem - CALL Cleanup_Toms( MasterProc, RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Cleanup_Toms"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - CALL Cleanup_WetScav( MasterProc, RC) + CALL Cleanup_WetScav( RC) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Cleanup_WetScav"!' CALL Error_Stop( ErrMsg, ThisLoc ) @@ -4115,12 +4038,11 @@ subroutine chem_final ! Loop over each chunk and cleanup the variables DO I = BEGCHUNK, ENDCHUNK - am_I_Root = ((I.eq.BEGCHUNK) .and. MasterProc) - CALL Cleanup_State_Chm ( am_I_Root, State_Chm(I), RC ) - CALL Cleanup_State_Diag( am_I_Root, State_Diag(I), RC ) - CALL Cleanup_State_Grid( am_I_Root, State_Grid(I), RC ) - CALL Cleanup_State_Met ( am_I_Root, State_Met(I), RC ) + CALL Cleanup_State_Chm ( State_Chm(I), RC ) + CALL Cleanup_State_Diag( State_Diag(I), RC ) + CALL Cleanup_State_Grid( State_Grid(I), RC ) + CALL Cleanup_State_Met ( State_Met(I), RC ) ENDDO CALL Cleanup_Error From d6dcd12f01ce0123b96f51a2486abd8a565e88f6 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 31 Jul 2020 18:56:26 -0400 Subject: [PATCH 111/239] Feat: Increase nchem_adv --- bld/configure | 2 +- src/chemistry/pp_geoschem/chem_mods.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/configure b/bld/configure index 126cbb7fb9..0e91b66925 100755 --- a/bld/configure +++ b/bld/configure @@ -1438,7 +1438,7 @@ if ($chem_pkg =~ '_mam3') { if ($chem_pkg =~ 'geoschem') { $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DLINUX_IFORT -DUSE_REAL8 -DMODEL_ -DMODEL_CESM'; # TMMF - Temporary fix - $chem_nadv = 200; + $chem_nadv = 250; if (defined $opts{'clm_vers'}) { if ($opts{'clm_vers'} =~ 'CLM4.0') { $chem_cppdefs .= ' -DCLM40' diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/pp_geoschem/chem_mods.F90 index af430ac0ca..c3cf91a7f4 100644 --- a/src/chemistry/pp_geoschem/chem_mods.F90 +++ b/src/chemistry/pp_geoschem/chem_mods.F90 @@ -7,7 +7,7 @@ module chem_mods implicit none save - INTEGER, PARAMETER :: nTracersMax = 200 ! Must be equal to nadv_chem + INTEGER, PARAMETER :: nTracersMax = 250 ! Must be equal to nadv_chem INTEGER :: nTracers CHARACTER(LEN=255) :: tracerNames(nTracersMax) CHARACTER(LEN=255) :: tracerLongNames(nTracersMax) From e78a93b6a0c9cdeb5f805f906d7a327294a01eb6 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 31 Jul 2020 18:57:01 -0400 Subject: [PATCH 112/239] Feat: Define GEOS-Chem deposition species in geoschem.xml --- bld/build-namelist | 4 +++ bld/namelist_files/use_cases/geoschem.xml | 34 +++++++++++------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index e0202bee82..d92eff17b6 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -740,6 +740,10 @@ if ( ($chem ne 'none') or ( $prog_species ) ){ if (length($aer_drydep_list)>2){ add_default($nl, 'aer_drydep_list', 'val'=>$aer_drydep_list ); } + $nl->set_variable_value('aerosol_nl', 'aer_drydep_list', $aer_drydep_list); + $nl->set_variable_value('aerosol_nl', 'aer_wetdep_list', $aer_wetdep_list); + $nl->set_variable_value('drydep_inparm', 'drydep_list', $gas_drydep_list); + $nl->set_variable_value('wetdep_inparm', 'gas_wetdep_list', $gas_wetdep_list); } if ($chem) { # Dry Deposition -- The responsibility for dry deposition is shared between CAM and CLM. diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 14e8f7a9ba..50339ae93e 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -1,31 +1,30 @@ - - + 00010101 367.0e-6 -atm/cam/inic/fv/cami-chem_1990-01-01_1.9x2.5_L26_c080114.nc +atm/cam/inic/fv/cami-chem_1990-01-01_1.9x2.5_L26_c080114.nc - +>&gt; Solar constant from Lean (via Caspar Ammann) &lt;/!</! atm/cam/solar/spectral_irradiance_Lean_1610-2009_ann_c100405.nc 20000101 FIXED - +>&gt; Prescribed BAM data is from Jean-Francois Lamarque &lt;/!</! atm/cam/chem/trop_mozart_aero/aero aero_1.9x2.5_L26_1850-2005_c091112.nc CYCLICAL 2000 - +>&gt; aerosol deposition &lt;/!</! atm/cam/chem/trop_mozart_aero/aero aerosoldep_monthly_2000_mean_1.9x2.5_c090421.nc CYCLICAL 2000 - +>&gt; Prescribed ozone data is from Jean-Francois Lamarque &lt;/!</! atm/cam/ozone ozone_1.9x2.5_L26_1850-2005_c090803.nc O3 @@ -35,20 +34,20 @@ .true. 'xactive_lnd' - +>&gt; sim_year used for CLM datasets &lt;/!</! 2000 - +>&gt; fixed lower boundary data &lt;/!</! 2000 atm/waccm/lb/LBC_1765-2500_1.9x2.5_CMIP5_RCP45_za_c120204.nc CYCLICAL - +>&gt; emissions timing &lt;/!</! - +>&gt; &amp;lt;ext_frc_type&amp;gt;'SERIAL'&amp;lt;/ext_frc_type&amp;gt; &lt;/!</! 'CYCLICAL' 2000 - +>&gt; History Files &lt;/!</! 1, 24 0, -1 @@ -63,20 +62,19 @@ - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','BR2','BRNO3','CH2O','HCHO','CLNO3','DHDN','EOH','ETHLN','GLYC','GLYX','H2O2','HAC','HBR','HC187','HCL','HCOOH','HNO3','HOBR','HOCL','HONIT','HPALD','IEPOXA','IEPOXB','IEPOXD','IMAE','IPMN','ISN1','ISN1OG','ISOPNB','ISOPND','LIMO','LVOC','MACR','MACRN','MAP','MGLY','MONITS','MONITU','MTPA','MTPO','MVK','MVKN','N2O5','NH3','NO2','NPMN','O3','OPOG1','OPOG2','PAN','POG1','POG2','PPN','PROPNN','R4N2','RIPA','RIPB','RIPD','SO2','HOI','I2','IBR','ICL','HI','IONO','IONO2','I2O2','I2O3','I2O4','H2SO4','TSOG0','TSOG1','TSOG2','TSOG3' + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', - 'ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','DST1','DSTAL1','NITD1','SO4D1','DST2','DSTAL2','NITD2','SO4D2','DST3','DSTAL3','NITD3','SO4D3','DST4','DSTAL4','NITD4','SO4D4','INDIOL','IONITA','ISN1OA','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITS','OCPI','OCPO','OPOA1','OPOA2','PFE','POA1','POA2','SALA','SALC','SO4','SO4S','SOAIE','SOAGX','SOAME','SOAMG','SOAS','TSOA0','TSOA1','TSOA2','TSOA3','BRSALA','BRSALC','ISALA','ISALC','AERI' + 'AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','BR2','CH2O','HCHO','DHDN','EOH','ETHLN','GLYC','GLYX','H2O2','HAC','HBR','HCL','HCOOH','HNO3','HOBR','HOCL','HONIT','IEPOXA','IEPOXB','IEPOXD','IMAE','ISN1','ISN1OG','ISOPNB','ISOPND','LIMO','LVOC','MACRN','MAP','MGLY','MOBA','MONITS','MONITU','MP','CH3OOH','MTPA','MTPO','MVKN','NH3','OPOG1','OPOG2','POG1','POG2','PROPNN','RIPA','RIPB','RIPD','SO2','TSOG0','TSOG1','TSOG2','TSOG3','HOI','I2','IBR','ICL','HI','IONO','IONO2','I2O2','I2O3','I2O4','H2SO4' + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', - 'ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','DST1','DSTAL1','NITD1','SO4D1','DST2','DSTAL2','NITD2','SO4D2','DST3','DSTAL3','NITD3','SO4D3','DST4','DSTAL4','NITD4','SO4D4','INDIOL','IONITA','ISN1OA','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITS','OCPI','OCPO','OPOA1','OPOA2','PFE','POA1','POA2','SALA','SALC','SO4','SO4S','SOAIE','SOAGX','SOAME','SOAMG','SOAS','TSOA0','TSOA1','TSOA2','TSOA3','BRSALA','BRSALC','ISALA','ISALC','AERI' + 'AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - - + \ No newline at end of file From 24a44ff7529a7aeeeafbd9a78ce4dc3f60ae92dd Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 31 Jul 2020 18:57:29 -0400 Subject: [PATCH 113/239] Feat: Update solsym based on gckpp_Monitor (1) solsym needs to be defined explicitely, as it is parsed at compile time. --- src/chemistry/pp_geoschem/mo_sim_dat.F90 | 186 +++++++++++----------- src/chemistry/pp_geoschem/mo_tracname.F90 | 2 +- 2 files changed, 96 insertions(+), 92 deletions(-) diff --git a/src/chemistry/pp_geoschem/mo_sim_dat.F90 b/src/chemistry/pp_geoschem/mo_sim_dat.F90 index 1e9005c437..b30e047ae3 100644 --- a/src/chemistry/pp_geoschem/mo_sim_dat.F90 +++ b/src/chemistry/pp_geoschem/mo_sim_dat.F90 @@ -36,97 +36,101 @@ subroutine set_sim_dat ! cls_rxt_cnt(:,1) = (/ 37, 61, 0, 30 /) ! cls_rxt_cnt(:,4) = (/ 23, 174, 326, 191 /) - solsym(:273) = (/ 'CH2I2 ','CH2ICL ','CH2IBR ', & - 'NITs ','NIT ','AERI ', & - 'CO2 ','INDIOL ','ISALA ', & - 'ISALC ','ISN1OA ','ISN1OG ', & - 'LBRO2H ','LBRO2N ','LISOPOH ', & - 'LISOPNO3 ','LTRO2H ','LTRO2N ', & - 'LVOCOA ','LVOC ','LXRO2H ', & - 'LXRO2N ','MSA ','PYAC ', & - 'SO4H1 ','SO4H2 ','SOAGX ', & - 'SOAIE ','SOAME ','IMAE ', & - 'SOAMG ','POx ','LOx ', & - 'PCO ','LCO ','PSO4 ', & - 'LCH4 ','PH2O2 ','I2O4 ', & - 'DHDN ','DHDC ','I2O2 ', & - 'MONITA ','BENZ ','CH3CCL3 ', & - 'H1301 ','H2402 ','I2O3 ', & - 'PMNN ','PPN ','TOLU ', & - 'BRNO2 ','CCL4 ','CFC11 ', & - 'CFC12 ','CFC113 ','CFC114 ', & - 'CFC115 ','CH3I ','H1211 ', & - 'IBR ','IEPOXD ','INO ', & - 'N2O ','TRO2 ','BRO2 ', & - 'IEPOXA ','IEPOXB ','IONITA ', & - 'N ','OCS ','XRO2 ', & - 'HI ','MAP ','ICL ', & - 'IMAO3 ','MPN ','CHBR3 ', & - 'CHCL3 ','CL2O2 ','CH2BR2 ', & - 'CH2CL2 ','HCFC141b ','HCFC142b ', & - 'IONO ','HCFC123 ','HCFC22 ', & - 'OIO ','RA3P ','RB3P ', & - 'XYLE ','DMS ','CLNO2 ', & - 'ETP ','CH3BR ','CH3CL ', & - 'HNO4 ','CLOO ','OCLO ', & - 'PAN ','RP ','HNO2 ', & - 'ALK4 ','PP ','PRPN ', & - 'SO4 ','BRCL ','PIP ', & - 'R4P ','HPALD ','C3H8 ', & - 'DHPCARP ','HOI ','HC187 ', & - 'HPC52O2 ','VRP ','ATOOH ', & - 'BR2 ','IAP ','MOBA ', & - 'HONIT ','DHMOB ','RIPB ', & - 'MP ','ISNP ','BRSALA ', & - 'BRSALC ','MAOP ','MRP ', & - 'RIPA ','RIPD ','EOH ', & - 'ETHLN ','N2O5 ','INPN ', & - 'MTPA ','MTPO ','NPMN ', & - 'C2H6 ','IONO2 ','MOBAOO ', & - 'DIBOO ','LIMO ','IPMN ', & - 'H ','MACRNO2 ','BRNO3 ', & - 'ROH ','MONITS ','CL2 ', & - 'I2 ','ISOPNB ','ISNOHOO ', & - 'CH4 ','MVKOO ','ISNOOB ', & - 'GAOO ','CH3CHOO ','MGLYOO ', & - 'IEPOXOO ','GLYX ','MVKN ', & - 'MGLOO ','PRN1 ','MONITU ', & - 'A3O2 ','PROPNN ','ISNOOA ', & - 'MAN2 ','PO2 ','ISOPNDO2 ', & - 'HCOOH ','B3O2 ','MACROO ', & - 'R4N1 ','MAOPO2 ','ISOP ', & - 'H2O2 ','ATO2 ','I ', & - 'RCO3 ','OLNN ','OLND ', & - 'LIMO2 ','MACRN ','IO ', & - 'KO2 ','HOBR ','ISOPNBO2 ', & - 'HC5OO ','PIO2 ','HNO3 ', & - 'ISOPND ','NMAO3 ','ACTA ', & - 'HOCL ','VRO2 ','ISN1 ', & - 'CH2OO ','GLYC ','CLNO3 ', & - 'MGLY ','ACET ','HC5 ', & - 'RIO2 ','INO2 ','R4O2 ', & - 'ETO2 ','R4N2 ','HAC ', & - 'MRO2 ','BRO ','PRPE ', & - 'RCHO ','MEK ','MACR ', & - 'CH2O ','ALD2 ','MVK ', & - 'MCO3 ','SO2 ','HCL ', & - 'HBR ','H2O ','CLO ', & - 'HO2 ','OH ','BR ', & - 'O ','NO2 ','MO2 ', & - 'NO3 ','NO ','O3 ', & - 'CL ','CO ','O1D ', & - 'H2 ','MOH ','N2 ', & - 'O2 ','RCOOH ','SO4s ', & - 'NH3 ','NH4 ','BCPI ', & - 'OCPI ','BCPO ','OCPO ', & - 'DST1 ','DST2 ','DST3 ', & - 'DST4 ','SALA ','SALC ', & - 'TSOG1 ','TSOG2 ','TSOG3 ', & - 'TSOG0 ','TSOA1 ','TSOA2 ', & - 'TSOA3 ','TSOA0 ','ASOG1 ', & - 'ASOG2 ','ASOG3 ','ASOAN ', & - 'ASOA1 ','ASOA2 ','ASOA3 ', & - 'SOAP ','SOAS ','PFE ' /) + solsym(:284) = (/ 'CH2I2 ','CH2IBr ','CH2ICl ', & + 'AERI ','CO2 ','INDIOL ', & + 'ISALA ','ISALC ','LBRO2H ', & + 'LBRO2N ','LISOPOH ','LISOPNO3 ', & + 'LTRO2H ','LTRO2N ','LVOCOA ', & + 'LVOC ','LXRO2H ','LXRO2N ', & + 'MSA ','SO4H1 ','SO4H2 ', & + 'SO4H3 ','SO4H4 ','SOAGX ', & + 'SOAIE ','POx ','LOx ', & + 'PCO ','LCO ','PSO4 ', & + 'LCH4 ','PH2O2 ','I2O4 ', & + 'NIT ','NITs ','CH3CCl3 ', & + 'I2O2 ','MONITA ','BENZ ', & + 'CH3I ','H1301 ','H2402 ', & + 'I2O3 ','PPN ','TOLU ', & + 'BrNO2 ','CCl4 ','CFC11 ', & + 'CFC12 ','CFC113 ','CFC114 ', & + 'CFC115 ','H1211 ','INO ', & + 'BRO2 ','N2O ','TRO2 ', & + 'N ','OCS ','PAN ', & + 'SO4 ','XRO2 ','HI ', & + 'MAP ','CHBr3 ','CHCl3 ', & + 'IBr ','MPN ','Cl2O2 ', & + 'CH2Br2 ','CH2Cl2 ','HCFC22 ', & + 'HMHP ','HMML ','IPRNO3 ', & + 'ETNO3 ','MENO3 ','NPRNO3 ', & + 'OIO ','R4P ','RA3P ', & + 'RB3P ','RP ','XYLE ', & + 'HCFC123 ','DMS ','HCFC141b ', & + 'HCFC142b ','IONITA ','CH3Br ', & + 'ICl ','CH3Cl ','PYAC ', & + 'HNO4 ','ClOO ','IDC ', & + 'OClO ','ETP ','PP ', & + 'PRPN ','ALK4 ','IEPOXD ', & + 'HPALD2OO ','MVKDH ','PIP ', & + 'HPALD1OO ','C3H8 ','INA ', & + 'HPALD4 ','Br2 ','HPALD3 ', & + 'IDCHP ','IEPOXA ','IEPOXB ', & + 'MCRDH ','EOH ','HONIT ', & + 'BrCl ','MACR1OOH ','MP ', & + 'IHN3 ','IHN2 ','I2 ', & + 'SO2 ','IDHDP ','C4HVP1 ', & + 'C4HVP2 ','IDNOO ','ICNOO ', & + 'INPD ','ISOPNOO2 ','MPAN ', & + 'MTPA ','MTPO ','MVKPC ', & + 'RIPA ','ROH ','C2H6 ', & + 'RIPB ','MCRENOL ','IDHPE ', & + 'RIPD ','HNO2 ','ISOPNOO1 ', & + 'IDHNDOO1 ','IDHNDOO2 ','LIMO ', & + 'MVKHC ','RIPC ','HPETHNL ', & + 'N2O5 ','ICHE ','MCRHNB ', & + 'H ','BrNO3 ','MONITS ', & + 'INPB ','IHPOO2 ','IHPOO1 ', & + 'MVKHCB ','IHPOO3 ','CH4 ', & + 'IHPNDOO ','HPALD1 ','HPALD2 ', & + 'HC5A ','H2O2 ','ICHOO ', & + 'Cl2 ','ATOOH ','PROPNN ', & + 'MCRHN ','MONITU ','R4N1 ', & + 'PRN1 ','IONO ','MVKOHOO ', & + 'MCROHOO ','ICPDH ','MACR1OO ', & + 'ETHLN ','PO2 ','ACTA ', & + 'HCOOH ','GLYX ','IHN4 ', & + 'ITCN ','ACET ','OLNN ', & + 'OLND ','ETO2 ','MOH ', & + 'IHN1 ','IHPNBOO ','RCO3 ', & + 'HOI ','ISOP ','LIMO2 ', & + 'KO2 ','IONO2 ','IEPOXAOO ', & + 'IEPOXBOO ','MCRHP ','MVKHP ', & + 'CH3CHOO ','PIO2 ','IDHNBOO ', & + 'MGLY ','A3O2 ','GLYC ', & + 'HNO3 ','HOCl ','ClNO2 ', & + 'ICN ','MVKN ','ITHN ', & + 'IDN ','IHOO4 ','IHOO1 ', & + 'INO2D ','INO2B ','MACR ', & + 'MACRNO2 ','HAC ','MVK ', & + 'HOBr ','ATO2 ','MEK ', & + 'OTHRO2 ','R4N2 ','R4O2 ', & + 'B3O2 ','PRPE ','RCHO ', & + 'ClNO3 ','CH2OO ','MCO3 ', & + 'CO ','ALD2 ','I ', & + 'CH2O ','MO2 ','IO ', & + 'O1D ','SALACL ','BrO ', & + 'BrSALA ','BrSALC ','SALCCL ', & + 'O3 ','NO2 ','HCl ', & + 'Cl ','HBr ','ClO ', & + 'OH ','Br ','H2O ', & + 'HO2 ','NO3 ','O ', & + 'NO ','H2 ','N2 ', & + 'O2 ','RCOOH ','BCPI ', & + 'BCPO ','DST1 ','DST2 ', & + 'DST3 ','DST4 ','NH3 ', & + 'NH4 ','OCPI ','OCPO ', & + 'PFE ','SALA ','SALAAL ', & + 'SALC ','SALCAL ','SO4s ', & + 'SOAP ','SOAS ' /) ! adv_mass(:221) = (/ 133.141340_r8, 104.142600_r8, 28.010400_r8, 12.011000_r8, 12.011000_r8, & ! 204.342600_r8, 78.110400_r8, 160.122200_r8, 126.108600_r8, 98.098200_r8, & diff --git a/src/chemistry/pp_geoschem/mo_tracname.F90 b/src/chemistry/pp_geoschem/mo_tracname.F90 index 5d470483d1..d96d063922 100644 --- a/src/chemistry/pp_geoschem/mo_tracname.F90 +++ b/src/chemistry/pp_geoschem/mo_tracname.F90 @@ -12,6 +12,6 @@ module mo_tracname ! modified to an arbitrary high #, was gas_pcnst. this would cause a memory ! overflow overwrite in mo_sim_dat, which allocates :273 larger than ! the default specified gas_pcnst (hplin, 5/16/20) - character(len=16) :: solsym(273) ! species names + character(len=16) :: solsym(284) ! species names end module mo_tracname From 0b4bcad8ac9c69e443cb3cf82796b56ba09ec96a Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 31 Jul 2020 19:06:03 -0400 Subject: [PATCH 114/239] Feat: Update .exclude to now include input_mod and pops_mod.F90 --- src/chemistry/pp_geoschem/.exclude | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/chemistry/pp_geoschem/.exclude b/src/chemistry/pp_geoschem/.exclude index 313c41158c..7a64f3ddff 100644 --- a/src/chemistry/pp_geoschem/.exclude +++ b/src/chemistry/pp_geoschem/.exclude @@ -4,7 +4,6 @@ tpcore_window_mod.F90 tpcore_fvdas_mod.F90 flexgrid_read_mod.F90 get_met_mod.F90 -pops_mod.F90 planeflight_mod.F90 diag51_mod.F90 diag1.F90 @@ -15,9 +14,8 @@ diag53_mod.F90 emissions_mod.F90 gamap_mod.F90 initialize.F90 -input_mod.F90 cleanup.F90 main.F90 hcoi_gc_diagn_include.H hcoi_gc_diagn_mod.F90 -hco_interface_gc_mod.F90 \ No newline at end of file +hco_interface_gc_mod.F90 From 66f265e91b5098fc821bb1b8cbec9018ff699ea0 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 31 Jul 2020 19:07:00 -0400 Subject: [PATCH 115/239] Feat: Changes required to make GEOS-Chem 13.0 work with CESM --- src/chemistry/pp_geoschem/chemistry.F90 | 1113 +++++++++-------------- 1 file changed, 452 insertions(+), 661 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 2914f1ae38..2efb5e1445 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -46,7 +46,7 @@ module chemistry use chem_mods, only : tracerLongNames use chem_mods, only : adv_Mass use chem_mods, only : mwRatio - use chem_mods, only : ref_mmr + use chem_mods, only : ref_MMR use chem_mods, only : nSlsMax use chem_mods, only : nSls use chem_mods, only : slsNames @@ -82,6 +82,9 @@ module chemistry ! Location of valid input.geos CHARACTER(LEN=500) :: inputGeosPath + ! Location of valid species_database.yml + CHARACTER(LEN=500) :: speciesDBPath + ! Location of chemistry input (for now) CHARACTER(LEN=500) :: chemInputsDir @@ -136,15 +139,14 @@ module chemistry contains !================================================================================================ - LOGICAL function chem_is (NAME) + LOGICAL function chem_is (name) - CHARACTER(LEN=*), INTENT(IN) :: NAME + CHARACTER(LEN=*), INTENT(IN) :: name chem_is = .false. - IF (NAME == 'geoschem' ) THEN + IF ( to_upper(name) == 'GEOSCHEM' ) THEN chem_is = .true. ENDIF - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_IS' end function chem_is @@ -178,12 +180,13 @@ subroutine chem_register INTEGER :: I, N, M REAL(r8) :: cptmp - REAL(r8) :: mwtmp + REAL(r8) :: MWTmp REAL(r8) :: qmin REAL(r8) :: ref_VMR CHARACTER(LEN=128) :: mixtype CHARACTER(LEN=128) :: molectype - CHARACTER(LEN=128) :: lng_Name + CHARACTER(LEN=128) :: lngName + CHARACTER(LEN=64) :: cnstName LOGICAL :: camout LOGICAL :: ic_from_cam2 LOGICAL :: has_fixed_ubc @@ -191,193 +194,182 @@ subroutine chem_register INTEGER :: RC - ! SDE 2018-05-02: This seems to get called before anything else - ! that includes CHEM_INIT - ! At this point, mozart calls SET_SIM_DAT, which is specified by each - ! mechanism separately (ie mozart/chemistry.F90 calls the subroutine - ! set_sim_dat which is in pp_[mechanism]/mo_sim_dat.F90. That sets a lot of - ! data in other places, notably in "chem_mods" - - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_REGISTER' + IF ( MasterProc ) Write(iulog,'(a)') 'GCCALL CHEM_REGISTER' ! hplin 2020-05-16: Call set_sim_dat to populate chemistry constituent information ! from mo_sim_dat.F90 in other places. This is needed for HEMCO_CESM. - call set_sim_dat() - if(masterproc) write(iulog,*) 'GCCALL after set_sim_dat' + CALL set_sim_dat() ! Generate fake state_chm IO%Max_BPCH_Diag = 1000 IO%Max_AdvectSpc = 500 IO%Max_Families = 250 - IO%RootCPU = .False. + ! Prevent Reporting + IO%amIRoot = .False. + IO%thisCpu = MyCPU - CALL Set_Input_Opt( Am_I_Root = MasterProc, & - INPUT_OPT = IO, & + CALL Set_Input_Opt( am_I_Root = MasterProc, & + Input_Opt = IO, & RC = RC ) - IF(MASTERPROC) WRITE(IULOG,*) 'GCCALL AFTER SET_INPUT_OPT' - IF ( RC /= GC_SUCCESS ) THEN - ERRMSG = 'COULD NOT GENERATE REFERENCE INPUT OPTIONS OBJECT!' - CALL ERROR_STOP( ERRMSG, THISLOC ) + ErrMsg = 'Could not generate reference input options object!' + CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - ! OPTIONS NEEDED BY INIT_STATE_CHM - IO%ITS_A_FULLCHEM_SIM = .TRUE. - IO%LLINOZ = .TRUE. - IO%LUCX = .TRUE. - IO%LPRT = .FALSE. - IO%N_ADVECT = NTRACERS - DO I = 1, NTRACERS - IO%ADVECTSPC_NAME(I) = TRIM(TRACERNAMES(I)) + ! Options needed by Init_State_Chm + IO%ITS_A_FULLCHEM_SIM = .True. + IO%LLinoz = .True. + IO%LUCX = .True. + IO%LPRT = .False. + IO%N_Advect = nTracers + DO I = 1, nTracers + IO%AdvectSpc_Name(I) = TRIM(tracerNames(I)) ENDDO - IO%SALA_REDGE_UM(1) = 0.01E+0_FP - IO%SALA_REDGE_UM(2) = 0.50E+0_FP - IO%SALC_REDGE_UM(1) = 0.50E+0_FP - IO%SALC_REDGE_UM(2) = 8.00E+0_FP + IO%SALA_rEdge_um(1) = 0.01E+0_FP + IO%SALA_rEdge_um(2) = 0.50E+0_FP + IO%SALC_rEdge_um(1) = 0.50E+0_FP + IO%SALC_rEdge_um(2) = 8.00E+0_FP - ! PREVENT REPORTING - IO%ROOTCPU = .FALSE. - IO%MYCPU = MYCPU + IO%SpcDatabaseFile = TRIM(speciesDBPath) - CALL INIT_STATE_GRID( STATE_GRID = SG , & - RC = RC ) + CALL Init_State_Grid( Input_Opt = IO, & + State_Grid = SG, & + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN - ERRMSG = 'ERROR ENCOUNTERED WITHIN CALL TO "INIT_STATE_GRID"!' - CALL ERROR_STOP( ERRMSG, THISLOC ) + ErrMsg = 'Error encountered within call to "Init_State_Grid"!' + CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF SG%NX = 1 SG%NY = 1 SG%NZ = 1 - CALL INIT_STATE_CHM( INPUT_OPT = IO, & - STATE_CHM = SC, & - STATE_GRID = SG, & - RC = RC ) + CALL Init_State_Chm( Input_Opt = IO, & + State_Chm = SC, & + State_Grid = SG, & + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN - ERRMSG = 'ERROR ENCOUNTERED WITHIN CALL TO "INIT_STATE_CHM"!' - CALL ERROR_STOP( ERRMSG, THISLOC ) + ErrMsg = 'Error encountered within call to "Init_State_Chm"!' + CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - ! AT THE MOMENT, WE FORCE NADV_CHEM=200 IN THE SETUP FILE - ! DEFAULT - MAP2GC = -1 - REF_MMR(:) = 0.0E+0_R8 - MWRATIO(:) = 1.0E+0_R8 - TRACERLONGNAMES = '' - - DO I = 1, NTRACERSMAX - IF (I.LE.NTRACERS) THEN - N = IND_(TRACERNAMES(I)) - THISSPC => SC%SPCDATA(N)%INFO - LNG_NAME = TRIM(THISSPC%FULLNAME) - MWTMP = REAL(THISSPC%MW_G,R8) - REF_VMR = REAL(THISSPC%BACKGROUNDVV,R8) - ADV_MASS(I) = MWTMP - REF_MMR(I) = REF_VMR / (MWDRY / MWTMP) + map2GC = -1 + ref_MMR(:) = 0.0e+0_r8 + MWRatio(:) = 1.0e+0_r8 + tracerLongNames = '' + + DO I = 1, nTracersMax + IF ( I .LE. nTracers ) THEN + cnstName = TRIM(tracerNames(I)) + N = Ind_(cnstName) + ThisSpc => SC%SpcData(N)%Info + lngName = TRIM(ThisSpc%FullName) + MWTmp = REAL(ThisSpc%MW_g,r8) + ref_VMR = REAL(ThisSpc%BackgroundVV,r8) + adv_Mass(I) = MWTmp + ref_MMR(I) = ref_VMR / (MWDry / MWTmp) ELSE - LNG_NAME = TRIM(TRACERNAMES(I)) - MWTMP = 1000.0E+0_R8 * (0.001E+0_R8) - ADV_MASS(I) = MWTMP - REF_MMR(I) = 1.0E-38_R8 + cnstName = TRIM(tracerNames(I)) + lngName = cnstName + MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) + adv_Mass(I) = MWTmp + ref_MMR(I) = 1.0e-38_r8 ENDIF - MWRATIO(I) = MWDRY/MWTMP - TRACERLONGNAMES(I) = TRIM(LNG_NAME) - - ! DUMMY VALUE FOR SPECIFIC HEAT OF CONSTANT PRESSURE (CP) - CPTMP = 666._R8 - ! MINIMUM MIXING RATIO - QMIN = 1.E-38_R8 - ! MIXING RATIO TYPE - MIXTYPE = 'DRY' - ! USED FOR IONOSPHERIC WACCM (WACCM-X) - MOLECTYPE = 'MINOR' - ! IS AN OUTPUT FIELD (?) - CAMOUT = .FALSE. - ! NOT TRUE FOR O2(1-DELTA) OR O2(1-SIGMA) - IC_FROM_CAM2 = .TRUE. - ! USE A FIXED VALUE AT THE UPPER BOUNDARY - HAS_FIXED_UBC = .FALSE. - ! USE A FIXED FLUX CONDITION AT THE UPPER BOUNDARY - HAS_FIXED_UBFLX = .FALSE. - !WRITE(TRACERNAMES(I),'(A,I0.4)') 'GCTRC_', I - ! NOTE: IN MOZART, THIS ONLY GETS CALLED FOR TRACERS - ! THIS IS THE CALL TO ADD A "CONSTITUENT" - CALL CNST_ADD( TRIM(TRACERNAMES(I)), ADV_MASS(I), CPTMP, QMIN, N, & - READIV=IC_FROM_CAM2, MIXTYPE=MIXTYPE, CAM_OUTFLD=CAMOUT, & - MOLECTYPE=MOLECTYPE, FIXED_UBC=HAS_FIXED_UBC, & - FIXED_UBFLX=HAS_FIXED_UBFLX, LONGNAME=TRIM(LNG_NAME) ) - - ! ADD TO GC MAPPING. WHEN STARTING A TIMESTEP, WE WILL WANT TO UPDATE THE - ! CONCENTRATION OF STATE_CHM(X)%SPECIES(1,ICOL,ILEV,M) WITH DATA FROM - ! CONSTITUENT N - M = IND_(TRIM(TRACERNAMES(I))) + MWRatio(I) = MWDry/MWTmp + tracerLongNames(I) = TRIM(lngName) + + ! dummy value for specific heat of constant pressure (Cp) + cptmp = 666._r8 + ! minimum mixing ratio + qmin = 1.e-38_r8 + ! mixing ratio type + mixtype = 'dry' + ! Used for ionospheric WACCM (WACCM-X) + molectype = 'minor' + ! Is an output field (?) + camout = .false. + ! Not true for O2(1-delta) or O2(1-sigma) + ic_from_cam2 = .true. + ! Use a fixed value at the upper boundary + has_fixed_ubc = .false. + ! Use a fixed flux condition at the upper boundary + has_fixed_ubflx = .false. + ! NOTE: In MOZART, this only gets called for tracers + ! This is the call to add a "constituent" + CALL cnst_add( cnstName, adv_Mass(I), cptmp, qmin, N, & + readiv=ic_from_cam2, mixtype=mixtype, & + cam_outfld=camout, molectype=molectype, & + fixed_ubc=has_fixed_ubc, & + fixed_ubflx=has_fixed_ubflx, & + longname=TRIM(lngName) ) + + ! Add to GC mapping. When starting a timestep, we will want to update the + ! concentration of State_Chm(x)%Species(1,iCol,iLev,m) with data from + ! constituent n + M = Ind_(TRIM(tracerNames(I))) IF ( M > 0 ) THEN - MAP2GC(N) = M - MAP2IDX(N) = I + map2GC(N) = M + map2Idx(N) = I ENDIF - ! NULLIFY POINTER - THISSPC => NULL() + ! Nullify pointer + ThisSpc => NULL() ENDDO - ! NOW UNADVECTED SPECIES - MAP2GC_SLS = 0 - SLS_REF_MMR(:) = 0.0E+0_R8 - SLSMWRATIO(:) = -1.0E+0_R8 - SLSLONGNAMES = '' - DO I = 1, NSLS - N = IND_(SLSNAMES(I)) + ! Now unadvected species + map2GC_Sls = 0 + sls_ref_MMR(:) = 0.0e+0_r8 + SlsMWRatio(:) = -1.0e+0_r8 + slsLongNames = '' + DO I = 1, nSls + N = Ind_(slsNames(I)) IF ( N .GT. 0 ) THEN - THISSPC => SC%SPCDATA(N)%INFO - MWTMP = REAL(THISSPC%MW_G,R8) - REF_VMR = REAL(THISSPC%BACKGROUNDVV,R8) - LNG_NAME = TRIM(THISSPC%FULLNAME) - SLSLONGNAMES(I) = LNG_NAME - SLS_REF_MMR(I) = REF_VMR / (MWDRY / MWTMP) - SLSMWRATIO(I) = MWDRY / MWTMP - MAP2GC_SLS(I) = N - THISSPC => NULL() + ThisSpc => SC%SpcData(N)%Info + MWTmp = REAL(ThisSpc%MW_g,r8) + ref_VMR = REAL(ThisSpc%BackgroundVV,r8) + lngName = TRIM(ThisSpc%FullName) + slsLongNames(I) = lngName + sls_ref_MMR(I) = ref_VMR / (MWDry / MWTmp) + SlsMWRatio(I) = MWDry / MWTmp + map2GC_Sls(I) = N + ThisSpc => NULL() ENDIF ENDDO - ! PASS INFORMATION TO "SHORT_LIVED_SPECIES" MODULE - SLVD_REF_MMR(1:NSLS) = SLS_REF_MMR(1:NSLS) - CALL REGISTER_SHORT_LIVED_SPECIES() - ! MORE INFORMATION: - ! HTTP://WWW.CESM.UCAR.EDU/MODELS/ATM-CAM/DOCS/PHYS-INTERFACE/NODE5.HTML + ! Pass information to "short_lived_species" module + slvd_ref_MMR(1:nSls) = sls_ref_MMR(1:nSls) + CALL Register_Short_Lived_Species() + ! More information: + ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html - ! CLEAN UP - CALL CLEANUP_STATE_CHM ( .FALSE., SC, RC ) - CALL CLEANUP_STATE_GRID( .FALSE., SG, RC ) - CALL CLEANUP_INPUT_OPT ( .FALSE., IO, RC ) + ! Clean up + Call Cleanup_State_Chm ( SC, RC ) + Call Cleanup_State_Grid( SG, RC ) + Call Cleanup_Input_Opt ( IO, RC ) - END SUBROUTINE CHEM_REGISTER + end subroutine chem_register - SUBROUTINE CHEM_READNL(NLFILE) - ! THIS IS THE FIRST ROUTINE TO GET CALLED - SO IT SHOULD READ IN - ! GEOS-CHEM OPTIONS FROM INPUT.GEOS WITHOUT ACTUALLY DOING ANY - ! INITIALIZATION + subroutine chem_readnl(nlfile) - USE CAM_ABORTUTILS, ONLY : ENDRUN - USE UNITS, ONLY : GETUNIT, FREEUNIT - USE MPISHORTHAND - USE GCKPP_MODEL, ONLY : NSPEC, SPC_NAMES - USE MO_CHEM_UTLS, ONLY : GET_SPC_NDX - USE CHEM_MODS, ONLY : DRYSPC_NDX + use cam_abortutils, only : endrun + use units, only : getunit, freeunit + use mpishorthand + use gckpp_Model, only : nSpec, Spc_Names + use mo_chem_utls, only : get_spc_ndx + use chem_mods, only : drySpc_ndx - ! ARGS - CHARACTER(LEN=*), INTENT(IN) :: NLFILE ! FILEPATH FOR FILE CONTAINING NAMELIST INPUT + ! args + CHARACTER(LEN=*), INTENT(IN) :: nlfile ! filepath for file containing namelist input - ! LOCAL VARIABLES - INTEGER :: I, N, NIGNORED + ! Local variables + INTEGER :: I, N, nIgnored INTEGER :: UNITN, IERR - CHARACTER(LEN=500) :: LINE - LOGICAL :: MENUFOUND - LOGICAL :: VALIDSLS + CHARACTER(LEN=500) :: line + LOGICAL :: menuFound + LOGICAL :: validSLS #IF ( OCNDDVEL_MOZART ) NAMELIST /CHEM_INPARM/ MOZART_DEPVEL_LND_FILE, & @@ -385,137 +377,133 @@ SUBROUTINE CHEM_READNL(NLFILE) MOZART_SEASON_WES_FILE #ENDIF - NIGNORED = 0 - - ! SET PATHS - ! MIT PATH - !INPUTGEOSPATH='/HOME/FRITZT/INPUT.GEOS.TEMPLATE' - !CHEMINPUTSDIR='/NET/D06/DATA/GCDATA/EXTDATA/CHEM_INPUTS/' - ! CHEYENNE PATH - INPUTGEOSPATH='/GLADE/U/HOME/FRITZT/INPUT.GEOS.TEMPLATE' - CHEMINPUTSDIR='/GLADE/P/UNIV/UMIT0034/EXTDATA/CHEM_INPUTS/' - - -#IF ( ALLDDVEL_GEOSCHEM + OCNDDVEL_GEOSCHEM + OCNDDVEL_MOZART != 1 ) - IF (MASTERPROC) THEN - WRITE(IULOG,'(/,A)') REPEAT( "=", 79 ) - WRITE(IULOG,'(A)') " PREPROCESSOR FLAGS ARE NOT SET CORRECTLY IN CHEMISTRY.F90" - WRITE(IULOG,'(A)') " THE USER NEEDS TO DECIDE HOW TO COMPUTE DRY DEPOSITION VELOCITIES" - WRITE(IULOG,'(A)') " THREE OPTIONS APPEAR: " - WRITE(IULOG,'(A)') " + LET GEOS-CHEM CALCULATE ALL DRY DEPOSITION VELOCITIES." - WRITE(IULOG,'(A)') " REQUIRED SETUP:" - WRITE(IULOG,'(A)') " ALLDDVEL_GEOSCHEM == 1" - WRITE(IULOG,'(A)') " OCNDDVEL_GEOSCHEM == 0" - WRITE(IULOG,'(A)') " OCNDDVEL_MOZART == 0" - WRITE(IULOG,'(A)') " + LET CLM COMPUTE DRY DEPOSITION VELOCITIES OVER LAND AND LET" - WRITE(IULOG,'(A)') " GEOS-CHEM COMPUTE VELOCITIES OVER OCEAN AND ICE" - WRITE(IULOG,'(A)') " REQUIRED SETUP:" - WRITE(IULOG,'(A)') " ALLDDVEL_GEOSCHEM == 0" - WRITE(IULOG,'(A)') " OCNDDVEL_GEOSCHEM == 1" - WRITE(IULOG,'(A)') " OCNDDVEL_MOZART == 0" - WRITE(IULOG,'(A)') " + LET CLM COMPUTE DRY DEPOSITION VELOCITIES OVER LAND AND" - WRITE(IULOG,'(A)') " COMPUTE VELOCITIES OVER OCEAN AND ICE IN A SIMILAR WAY AS" - WRITE(IULOG,'(A)') " MOZART" - WRITE(IULOG,'(A)') " REQUIRED SETUP:" - WRITE(IULOG,'(A)') " ALLDDVEL_GEOSCHEM == 0" - WRITE(IULOG,'(A)') " OCNDDVEL_GEOSCHEM == 0" - WRITE(IULOG,'(A)') " OCNDDVEL_MOZART == 1" - WRITE(IULOG,'(A)') REPEAT( "=", 79 ) - CALL ENDRUN('INCORRECT DEFINITIONS FOR DRY DEPOSITION VELOCITIES') + nIgnored = 0 + + inputGeosPath='/glade/u/home/fritzt/input.geos.template' + speciesDBPath='/glade/u/home/fritzt/species_database.yml' + chemInputsDir='/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/' + + +#if ( ALLDDVEL_GEOSCHEM + OCNDDVEL_GEOSCHEM + OCNDDVEL_MOZART != 1 ) + IF ( MasterProc ) THEN + Write(iulog,'(/,a)') REPEAT( "=", 79 ) + Write(iulog,'(a)') " Preprocessor flags are not set correctly in chemistry.F90" + Write(iulog,'(a)') " The user needs to decide how to compute dry deposition velocities" + Write(iulog,'(a)') " Three options appear: " + Write(iulog,'(a)') " + Let GEOS-Chem calculate all dry deposition velocities." + Write(iulog,'(a)') " Required setup:" + Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 1" + Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 0" + Write(iulog,'(a)') " OCNDDVEL_MOZART == 0" + Write(iulog,'(a)') " + Let CLM compute dry deposition velocities over land and let" + Write(iulog,'(a)') " GEOS-Chem compute velocities over ocean and ice" + Write(iulog,'(a)') " Required setup:" + Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 0" + Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 1" + Write(iulog,'(a)') " OCNDDVEL_MOZART == 0" + Write(iulog,'(a)') " + Let CLM compute dry deposition velocities over land and" + Write(iulog,'(a)') " compute velocities over ocean and ice in a similar way as" + Write(iulog,'(a)') " MOZART" + Write(iulog,'(a)') " Required setup:" + Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 0" + Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 0" + Write(iulog,'(a)') " OCNDDVEL_MOZART == 1" + Write(iulog,'(a)') REPEAT( "=", 79 ) + CALL ENDRUN('Incorrect definitions for dry deposition velocities') ENDIF -#ENDIF -#IF ( ALLDDVEL_GEOSCHEM && ( LANDTYPE_HEMCO + LANDTYPE_CLM != 1 ) ) - IF (MASTERPROC) THEN - WRITE(IULOG,'(/,A)') REPEAT( "=", 79 ) - WRITE(IULOG,'(A)') REPEAT( "=", 79 ) - WRITE(IULOG,'(A)') " PREPROCESSOR FLAGS ARE NOT SET CORRECTLY IN CHEMISTRY.F90" - WRITE(IULOG,'(A)') " DRY-DEPOSITION VELOCITIES ARE COMPUTED BY GEOS-CHEM" - WRITE(IULOG,'(A)') " THE USER NEEDS TO DECIDE IF LAND TYPES SHOULD BE FROM CLM OR FROM HEMCO" - CALL ENDRUN('INCORRECT DEFINITIONS FOR SOURCE OF LAND TYPE DATA') +#endif +#if ( ALLDDVEL_GEOSCHEM && ( LANDTYPE_HEMCO + LANDTYPE_CLM != 1 ) ) + IF ( MasterProc ) THEN + Write(iulog,'(/,a)') REPEAT( "=", 79 ) + Write(iulog,'(a)') REPEAT( "=", 79 ) + Write(iulog,'(a)') " Preprocessor flags are not set correctly in chemistry.F90" + Write(iulog,'(a)') " Dry-deposition velocities are computed by GEOS-Chem" + Write(iulog,'(a)') " The user needs to decide if land types should be from CLM or from HEMCO" + CALL ENDRUN('Incorrect definitions for source of land type data') ENDIF -#ENDIF +#endif - ALLOCATE(DRYSPC_NDX(NDDVELS), STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('FAILED TO ALLOCATE DRYSPC_NDX') + ALLOCATE(drySpc_ndx(nddvels), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate drySpc_ndx') - IF (MASTERPROC) THEN + IF ( MasterProc ) THEN - WRITE(IULOG,'(/,A)') REPEAT( '=', 50 ) - WRITE(IULOG,'(A)') REPEAT( '=', 50 ) - WRITE(IULOG,'(A)') 'THIS IS THE GEOS-CHEM / CESM INTERFACE' - WRITE(IULOG,'(A)') REPEAT( '=', 50 ) - WRITE(IULOG,'(A)') ' + ROUTINES WRITTEN BY THIBAUD M. FRITZ' - WRITE(IULOG,'(A)') ' + LABORATORY FOR AVIATION AND THE ENVIRONMENT,' - WRITE(IULOG,'(A)') ' + DEPARTMENT OF AERONAUTICS AND ASTRONAUTICS,' - WRITE(IULOG,'(A)') ' + MASSACHUSETTS INSTITUTE OF TECHNOLOGY' - WRITE(IULOG,'(A)') REPEAT( '=', 50 ) + Write(iulog,'(/,a)') REPEAT( '=', 50 ) + Write(iulog,'(a)') REPEAT( '=', 50 ) + Write(iulog,'(a)') 'This is the GEOS-CHEM / CESM interface' + Write(iulog,'(a)') REPEAT( '=', 50 ) + Write(iulog,'(a)') ' + Routines written by Thibaud M. Fritz' + Write(iulog,'(a)') ' + Laboratory for Aviation and the Environment,' + Write(iulog,'(a)') ' + Department of Aeronautics and Astronautics,' + Write(iulog,'(a)') ' + Massachusetts Institute of Technology' + Write(iulog,'(a)') REPEAT( '=', 50 ) - WRITE(IULOG,'(/,/, A)') 'NOW DEFINING GEOS-CHEM TRACERS AND DRY DEPOSITION MAPPING...' + Write(iulog,'(/,/, a)') 'Now defining GEOS-Chem tracers and dry deposition mapping...' - UNITN = GETUNIT() + unitn = getunit() !============================================================== - ! OPENING INPUT.GEOS AND GO TO ADVECTED SPECIES MENU + ! Opening input.geos and go to ADVECTED SPECIES MENU !============================================================== - OPEN( UNITN, FILE=TRIM(INPUTGEOSPATH), STATUS='OLD', IOSTAT=IERR ) - IF (IERR .NE. 0) THEN - CALL ENDRUN('CHEM_READNL: ERROR OPENING INPUT.GEOS') - ENDIF + OPEN( unitn, FILE=TRIM(inputGeosPath), STATUS='OLD', IOSTAT=IERR ) + IF (IERR .NE. 0) THEN + CALL ENDRUN('chem_readnl: ERROR opening input.geos') + ENDIF - ! GO TO ADVECTED SPECIES MENU - MENUFOUND = .FALSE. - DO WHILE ( .NOT. MENUFOUND ) - READ( UNITN, '(A)', IOSTAT=IERR ) LINE + ! Go to ADVECTED SPECIES MENU + menuFound = .False. + DO WHILE ( .NOT. menuFound ) + READ( unitn, '(a)', IOSTAT=IERR ) line IF ( IERR .NE. 0 ) THEN - CALL ENDRUN('CHEM_READNL: ERROR FINDING ADVECTED SPECIES MENU') - ELSEIF ( INDEX(LINE, 'ADVECTED SPECIES MENU') > 0 ) THEN - MENUFOUND = .TRUE. + CALL ENDRUN('chem_readnl: ERROR finding advected species menu') + ELSEIF ( INDEX(line, 'ADVECTED SPECIES MENU') > 0 ) THEN + menuFound = .True. ENDIF ENDDO !============================================================== - ! READ LIST OF GEOS-CHEM TRACERS + ! Read list of GEOS-Chem tracers !============================================================== DO - ! READ LINE - READ(UNITN,'(26X,A)', IOSTAT=IERR) LINE + ! Read line + READ(unitn,'(26x,a)', IOSTAT=IERR) line - IF ( INDEX( TRIM(LINE), '---' ) > 0 ) EXIT + IF ( INDEX( TRIM(line), '---' ) > 0 ) EXIT - NTRACERS = NTRACERS + 1 - TRACERNAMES(NTRACERS) = TRIM(LINE) + nTracers = nTracers + 1 + tracerNames(nTracers) = TRIM(line) ENDDO - CLOSE(UNITN) - CALL FREEUNIT(UNITN) + CLOSE(unitn) + CALL freeunit(unitn) - ! ASSIGN REMAINING TRACERS DUMMY NAMES - DO I = (NTRACERS+1), NTRACERSMAX - WRITE(TRACERNAMES(I),'(A,I0.4)') 'GCTRC_', I + ! Assign remaining tracers dummy names + DO I = (nTracers+1), nTracersMax + WRITE(tracerNames(I),'(a,I0.4)') 'GCTRC_', I ENDDO !============================================================== - ! NOW GO THROUGH THE KPP MECHANISM AND ADD ANY SPECIES NOT - ! IMPLEMENTED BY THE TRACER LIST IN INPUT.GEOS + ! Now go through the KPP mechanism and add any species not + ! implemented by the tracer list in input.geos !============================================================== - IF ( NSPEC > NSLSMAX ) THEN - CALL ENDRUN('CHEM_READNL: TOO MANY SPECIES - INCREASE NSLSMAX') + IF ( nSpec > nSlsMax ) THEN + CALL ENDRUN('chem_readnl: too many species - increase nSlsmax') ENDIF - NSLS = 0 - DO I = 1, NSPEC - ! GET THE NAME OF THE SPECIES FROM KPP - LINE = ADJUSTL(TRIM(SPC_NAMES(I))) - ! ONLY ADD THIS - VALIDSLS = ( .NOT. ANY(TRIM(LINE) .EQ. TRACERNAMES) ) - IF (VALIDSLS) THEN - ! GENUINE NEW SHORT-LIVED SPECIES - NSLS = NSLS + 1 - SLSNAMES(NSLS) = TRIM(LINE) + nSls = 0 + DO I = 1, nSpec + ! Get the name of the species from KPP + line = ADJUSTL(TRIM(Spc_Names(I))) + ! Only add this + validSLS = ( .NOT. ANY(TRIM(line) .EQ. tracerNames) ) + IF (validSLS) THEN + ! Genuine new short-lived species + nSls = nSls + 1 + slsNames(nSls) = TRIM(line) ENDIF ENDDO @@ -532,33 +520,34 @@ SUBROUTINE CHEM_READNL(NLFILE) IF ( DRYSPC_NDX(N) < 0 ) THEN WRITE(IULOG,'(A,A)') ' ## IGNORING DRY DEPOSITION OF ', & TRIM(DRYDEP_LIST(N)) - NIGNORED = NIGNORED + 1 + nIgnored = nIgnored + 1 ENDIF ENDDO - IF ( NIGNORED > 0 ) THEN - WRITE(IULOG,'(A,A)') ' THE SPECIES LISTED ABOVE HAVE DRY', & - ' DEPOSITION TURNED OFF FOR ONE OF THE FOLLOWING REASONS:' - WRITE(IULOG,'(A)') ' - THEY ARE NOT PRESENT IN THE GEOS-CHEM TRACER LIST.' - WRITE(IULOG,'(A)') ' - THEY HAVE A SYNONYM (E.G. CH2O AND HCHO).' + IF ( nIgnored > 0 ) THEN + Write(iulog,'(a,a)') ' The species listed above have dry', & + ' deposition turned off for one of the following reasons:' + Write(iulog,'(a)') ' - They are not present in the GEOS-Chem tracer list.' + Write(iulog,'(a)') ' - They have a synonym (e.g. CH2O and HCHO).' ENDIF !============================================================== - ! PRINT SUMMARY + ! Print summary !============================================================== - WRITE(IULOG,'(/, A)') '### SUMMARY OF GEOS-CHEM SPECIES: ' - WRITE(IULOG,'( A)') REPEAT( '-', 50 ) - WRITE(IULOG,'( A)') '+ LIST OF ADVECTED SPECIES: ' - WRITE(IULOG,100) 'ID', 'TRACER', 'DRY DEPOSITION (T/F)' - DO N = 1, NTRACERS - WRITE(IULOG,110) N, TRIM(TRACERNAMES(N)), ANY(DRYSPC_NDX .EQ. N) - ENDDO - - WRITE(IULOG,'(/, A)') '+ LIST OF SHORT-LIVED SPECIES: ' - DO N = 1, NSLS - WRITE(IULOG,120) N, TRIM(SLSNAMES(N)) - ENDDO + IF ( MasterProc ) THEN + Write(iulog,'(/, a)') '### Summary of GEOS-Chem species: ' + Write(iulog,'( a)') REPEAT( '-', 50 ) + Write(iulog,'( a)') '+ List of advected species: ' + Write(iulog,100) 'ID', 'Tracer', 'Dry deposition (T/F)' + DO N = 1, nTracers + Write(iulog,110) N, TRIM(tracerNames(N)), ANY(drySpc_ndx .eq. N) + ENDDO + Write(iulog,'(/, a)') '+ List of short-lived species: ' + DO N = 1, nSls + Write(iulog,120) N, TRIM(slsNames(N)) + ENDDO + ENDIF 100 FORMAT( 1X, A3, 3X, A10, 1X, A25 ) 110 FORMAT( 1X, I3, 3X, A10, 1X, L15 ) @@ -569,15 +558,15 @@ SUBROUTINE CHEM_READNL(NLFILE) ENDIF !================================================================== - ! BROADCAST TO ALL PROCESSORS + ! Broadcast to all processors !================================================================== -#IF DEFINED( SPMD ) - CALL MPIBCAST(NTRACERS, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(TRACERNAMES, LEN(TRACERNAMES(1))*NTRACERSMAX, MPICHAR, 0, MPICOM ) - CALL MPIBCAST(NSLS, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST(SLSNAMES, LEN(SLSNAMES(1))*NSLSMAX, MPICHAR, 0, MPICOM ) - CALL MPIBCAST(DRYSPC_NDX, NDDVELS, MPIINT, 0, MPICOM ) +#if defined( SPMD ) + CALL MPIBCAST( nTracers, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST( tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST( nSls, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST( slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST( drySpc_ndx, nddvels, MPIINT, 0, MPICOM ) #IF ( OCNDDVEL_MOZART ) !============================================================== @@ -603,197 +592,186 @@ SUBROUTINE CHEM_READNL(NLFILE) SLVD_LST(I) = TRIM(SLSNAMES(I)) ENDDO - END SUBROUTINE CHEM_READNL + end subroutine chem_readnl !================================================================================================ - FUNCTION CHEM_IS_ACTIVE() + function chem_is_active() !----------------------------------------------------------------------- - LOGICAL :: CHEM_IS_ACTIVE + logical :: chem_is_active !----------------------------------------------------------------------- - CHEM_IS_ACTIVE = .TRUE. + chem_is_active = .true. - END FUNCTION CHEM_IS_ACTIVE + end function chem_is_active !================================================================================================ - FUNCTION CHEM_IMPLEMENTS_CNST(NAME) + function chem_implements_cnst(name) !----------------------------------------------------------------------- ! - ! PURPOSE: RETURN TRUE IF SPECIFIED CONSTITUENT IS IMPLEMENTED BY THIS PACKAGE + ! Purpose: return true if specified constituent is implemented by this package ! - ! AUTHOR: B. EATON + ! Author: B. Eaton ! !----------------------------------------------------------------------- IMPLICIT NONE - !-----------------------------ARGUMENTS--------------------------------- + !-----------------------------Arguments--------------------------------- - CHARACTER(LEN=*), INTENT(IN) :: NAME ! CONSTITUENT NAME - LOGICAL :: CHEM_IMPLEMENTS_CNST ! RETURN VALUE + CHARACTER(LEN=*), INTENT(IN) :: name ! constituent name + LOGICAL :: chem_implements_cnst ! return value INTEGER :: I - CHEM_IMPLEMENTS_CNST = .FALSE. + chem_implements_cnst = .false. - DO I = 1, NTRACERS - IF (TRIM(TRACERNAMES(I)) .EQ. TRIM(NAME)) THEN - CHEM_IMPLEMENTS_CNST = .TRUE. + DO I = 1, nTracers + IF (TRIM(tracerNames(I)) .eq. TRIM(name)) THEN + chem_implements_cnst = .true. EXIT ENDIF ENDDO - IF (MASTERPROC) WRITE(IULOG,'(A)') 'GCCALL CHEM_IMPLEMENTS_CNST' - - END FUNCTION CHEM_IMPLEMENTS_CNST + end function chem_implements_cnst !=============================================================================== - SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) + subroutine chem_init(phys_state, pbuf2d) !----------------------------------------------------------------------- ! - ! PURPOSE: INITIALIZE GEOS-CHEM PARTS (STATE OBJECTS, MAINLY) - ! (AND DECLARE HISTORY VARIABLES) + ! Purpose: initialize GEOS-Chem parts (state objects, mainly) + ! (and declare history variables) ! !----------------------------------------------------------------------- - USE PHYSICS_BUFFER, ONLY: PHYSICS_BUFFER_DESC, PBUF_GET_INDEX - USE CAM_HISTORY, ONLY: ADDFLD, ADD_DEFAULT, HORIZ_ONLY - USE CHEM_MODS, ONLY: MAP2GC_DRYDEP, DRYSPC_NDX - - USE MPISHORTHAND - USE CAM_ABORTUTILS, ONLY : ENDRUN - - USE INPUT_OPT_MOD - USE STATE_CHM_MOD - USE STATE_GRID_MOD - USE STATE_MET_MOD - USE DIAGLIST_MOD, ONLY : INIT_DIAGLIST, PRINT_DIAGLIST - USE GC_ENVIRONMENT_MOD - USE GC_GRID_MOD, ONLY : SETGRIDFROMCTREDGES - - ! USE GEOS-CHEM VERSIONS OF PHYSICAL CONSTANTS - USE PHYSCONSTANTS, ONLY : PI, PI_180 - USE PHYSCONSTANTS, ONLY : RE - - USE PHYS_GRID, ONLY : GET_AREA_ALL_P - USE HYCOEF, ONLY : PS0, HYAI, HYBI - - USE TIME_MOD, ONLY : ACCEPT_EXTERNAL_DATE_TIME - !USE TIME_MOD, ONLY : SET_BEGIN_TIME, SET_END_TIME - !USE TIME_MOD, ONLY : SET_CURRENT_TIME, SET_DIAGB - !USE TRANSFER_MOD, ONLY : INIT_TRANSFER - USE LINOZ_MOD, ONLY : LINOZ_READ + use physics_buffer, only : physics_buffer_desc, pbuf_get_index + use cam_history, only : addfld, add_default, horiz_only + use chem_mods, only : map2GC_dryDep, drySpc_ndx -#IF ( OCNDDVEL_MOZART ) - USE SEQ_DRYDEP_MOD, ONLY: DRYDEP_METHOD, DD_XLND - USE MO_DRYDEP, ONLY: DRYDEP_INTI -#ENDIF + use mpishorthand + use cam_abortutils, only : endrun - USE CMN_SIZE_MOD - - USE DRYDEP_MOD, ONLY : INIT_DRYDEP, DEPNAME, NDVZIND - USE CARBON_MOD, ONLY : INIT_CARBON - USE DUST_MOD, ONLY : INIT_DUST - USE SEASALT_MOD, ONLY : INIT_SEASALT - USE SULFATE_MOD, ONLY : INIT_SULFATE - USE AEROSOL_MOD, ONLY : INIT_AEROSOL - USE WETSCAV_MOD, ONLY : INIT_WETSCAV - USE PRESSURE_MOD, ONLY : INIT_PRESSURE, ACCEPT_EXTERNAL_APBP - USE CHEMISTRY_MOD, ONLY : INIT_CHEMISTRY - USE UCX_MOD, ONLY : INIT_UCX -#IF ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) - USE OLSON_LANDMAP_MOD -#ENDIF - USE MIXING_MOD + use Input_Opt_Mod + use State_Chm_Mod + use State_Grid_Mod + use State_Met_Mod + use DiagList_Mod, only : Init_DiagList, Print_DiagList + use GC_Environment_Mod + use GC_Grid_Mod, only : SetGridFromCtrEdges - USE PBL_MIX_MOD, ONLY : INIT_PBL_MIX + ! Use GEOS-Chem versions of physical constants + use PhysConstants, only : PI, PI_180 + use PhysConstants, only : Re - USE GC_EMISSIONS_MOD, ONLY : GC_EMISSIONS_INIT + use Phys_Grid, only : get_Area_All_p + use hycoef, only : ps0, hyai, hybi - TYPE(PHYSICS_STATE), INTENT(IN):: PHYS_STATE(BEGCHUNK:ENDCHUNK) - TYPE(PHYSICS_BUFFER_DESC), POINTER :: PBUF2D(:,:) + use Time_Mod, only : Accept_External_Date_Time + !use Time_Mod, only : Set_Begin_Time, Set_End_Time + !use Time_Mod, only : Set_Current_Time, Set_DiagB + !use Transfer_Mod, only : Init_Transfer + use Linoz_Mod, only : Linoz_Read + +#if ( OCNDDVEL_MOZART ) + use seq_drydep_mod, only: drydep_method, dd_xlnd + use mo_drydep, only: drydep_inti +#endif + + use CMN_Size_Mod + + use Drydep_Mod, only : Depname, Ndvzind + use Pressure_Mod, only : Accept_External_ApBp + use Chemistry_Mod, only : Init_Chemistry + use Ucx_Mod, only : Init_Ucx + use Input_mod, only : Validate_Directories +#if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) + use Olson_Landmap_Mod +#endif + + use GC_Emissions_Mod, only : GC_Emissions_Init + + TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) + TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) - ! LOCAL VARIABLES + ! Local variables !---------------------------- - ! SCALARS + ! Scalars !---------------------------- - ! INTEGERS + ! Integers INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) INTEGER :: IWAIT, IERR - INTEGER :: NX, NY, NZ - INTEGER :: IX, JY + INTEGER :: nX, nY, nZ + INTEGER :: iX, jY INTEGER :: I, J, L, N INTEGER :: RC - INTEGER :: NLINOZ + INTEGER :: nLinoz - ! LOGICALS - LOGICAL :: ROOTCHUNK - LOGICAL :: PRTDEBUG + ! Logicals + LOGICAL :: prtDebug - ! STRINGS - CHARACTER(LEN=255) :: HISTORYCONFIGFILE - CHARACTER(LEN=255) :: SPCNAME + ! Strings + CHARACTER(LEN=255) :: historyConfigFile + CHARACTER(LEN=255) :: SpcName - ! GRID SETUP - REAL(FP) :: LONVAL, LATVAL - REAL(FP) :: DLONFIX, DLATFIX - REAL(F4), ALLOCATABLE :: LONMIDARR(:,:), LATMIDARR(:,:) - REAL(F4), ALLOCATABLE :: LONEDGEARR(:,:), LATEDGEARR(:,:) - REAL(R8), ALLOCATABLE :: LINOZDATA(:,:,:,:) + ! Grid setup + REAL(fp) :: lonVal, latVal + REAL(fp) :: dLonFix, dLatFix + REAL(f4), ALLOCATABLE :: lonMidArr(:,:), latMidArr(:,:) + REAL(f4), ALLOCATABLE :: lonEdgeArr(:,:), latEdgeArr(:,:) + REAL(r8), ALLOCATABLE :: linozData(:,:,:,:) - REAL(R8), ALLOCATABLE :: COL_AREA(:) - REAL(FP), ALLOCATABLE :: AP_CAM_FLIP(:), BP_CAM_FLIP(:) + REAL(r8), ALLOCATABLE :: Col_Area(:) + REAL(fp), ALLOCATABLE :: Ap_CAM_Flip(:), Bp_CAM_Flip(:) - REAL(R8), POINTER :: SLSPTR(:,:,:) + REAL(r8), POINTER :: SlsPtr(:,:,:) - ! ASSUME A SUCCESSFUL RETURN UNTIL OTHERWISE + ! Assume a successful return until otherwise RC = GC_SUCCESS - ! FOR ERROR TRAPPING - ERRMSG = '' - THISLOC = ' -> AT GEOS-CHEM (IN CHEMISTRY/PP_GEOSCHEM/CHEMISTRY.F90)' + ! For error trapping + ErrMsg = '' + ThisLoc = ' -> at GEOS-Chem (in chemistry/pp_geoschem/chemistry.F90)' - ! LCHNK: WHICH CHUNKS WE HAVE ON THIS PROCESS + ! LCHNK: which chunks we have on this process LCHNK = PHYS_STATE%LCHNK - ! NCOL: NUMBER OF ATMOSPHERIC COLUMNS FOR EACH CHUNK + ! NCOL: number of atmospheric columns for each chunk NCOL = PHYS_STATE%NCOL - WRITE(IULOG,'(2(A,X,I6,X))') 'CHEM_INIT CALLED ON PE ', MYCPU, ' OF ', NCPUS - - ! THE GEOS-CHEM GRIDS ON EVERY "CHUNK" WILL ALL BE THE SAME SIZE, TO AVOID - ! THE POSSIBILITY OF HAVING DIFFERENTLY-SIZED CHUNKS - NX = 1 - !NY = MAXVAL(NCOL) - NY = PCOLS - NZ = PVER - - !! ADD SHORT LIVED SPEIES TO BUFFERS - !CALL PBUF_ADD_FIELD(TRIM(SLSBUFFER),'GLOBAL',DTYPE_R8,(/PCOLS,PVER,NSLS/),SLS_PBF_IDX) - !! INITIALIZE - !ALLOCATE(SLSPTR(PCOLS,PVER,BEGCHUNK:ENDCHUNK), STAT=IERR) - !IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING SLSPTR') - !SLSPTR(:,:,:) = 0.0E+0_R8 - !DO I=1,NSLS - ! SLSPTR(:,:,:) = SLS_REF_MMR(I) - ! CALL PBUF_SET_FIELD(PBUF2D,SLS_PBF_IDX,SLSPTR,START=(/1,1,I/),KOUNT=(/PCOLS,PVER,1/)) + write(iulog,'(2(a,x,I6,x))') 'chem_init called on PE ', myCPU, ' of ', nCPUs + + ! The GEOS-Chem grids on every "chunk" will all be the same size, to avoid + ! the possibility of having differently-sized chunks + nX = 1 + !nY = MAXVAL(NCOL) + nY = PCOLS + nZ = PVER + + !! Add short lived speies to buffers + !CALL Pbuf_add_field(Trim(SLSBuffer),'global',dtype_r8,(/PCOLS,PVER,nSls/),Sls_Pbf_Idx) + !! Initialize + !ALLOCATE(SlsPtr(PCOLS,PVER,BEGCHUNK:ENDCHUNK), STAT=IERR) + !IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating SlsPtr') + !SlsPtr(:,:,:) = 0.0e+0_r8 + !DO I=1,nSls + ! SlsPtr(:,:,:) = sls_ref_MMR(I) + ! CALL pbuf_set_field(pbuf2d,Sls_Pbf_Idx,SlsPtr,start=(/1,1,i/),kount=(/PCOLS,PVER,1/)) !ENDDO - !DEALLOCATE(SLSPTR) - - ! THIS ENSURES THAT EACH PROCESS ALLOCATES EVERYTHING NEEDED FOR ITS CHUNKS - ALLOCATE(STATE_CHM(BEGCHUNK:ENDCHUNK) , STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING STATE_CHM') - ALLOCATE(STATE_DIAG(BEGCHUNK:ENDCHUNK) , STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING STATE_DIAG') - ALLOCATE(STATE_GRID(BEGCHUNK:ENDCHUNK), STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING STATE_GRID') - ALLOCATE(STATE_MET(BEGCHUNK:ENDCHUNK) , STAT=IERR) - IF ( IERR .NE. 0 ) CALL ENDRUN('FAILURE WHILE ALLOCATING STATE_MET') - - ! INITIALIZE FIELDS OF THE INPUT OPTIONS OBJECT - CALL SET_INPUT_OPT( AM_I_ROOT = MASTERPROC, & - INPUT_OPT = INPUT_OPT, & + !DEALLOCATE(SlsPtr) + + ! This ensures that each process allocates everything needed for its chunks + ALLOCATE(State_Chm(BEGCHUNK:ENDCHUNK) , STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Chm') + ALLOCATE(State_Diag(BEGCHUNK:ENDCHUNK) , STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Diag') + ALLOCATE(State_Grid(BEGCHUNK:ENDCHUNK), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Grid') + ALLOCATE(State_Met(BEGCHUNK:ENDCHUNK) , STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating State_Met') + + ! Initialize fields of the Input Options object + CALL Set_Input_Opt( am_I_Root = MasterProc, & + Input_Opt = Input_Opt, & RC = RC ) ! Set some basic flags @@ -804,11 +782,18 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + CALL Validate_Directories( Input_Opt, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Validation_Directories"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + DO I = BEGCHUNK, ENDCHUNK ! Initialize fields of the Grid State object - CALL Init_State_Grid( State_Grid = State_Grid(I), & - RC = RC ) + CALL Init_State_Grid( Input_Opt = Input_Opt, & + State_Grid = State_Grid(I), & + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered within call to "Init_State_Grid"!' @@ -865,18 +850,19 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) value_LM_WORLD = nZ, & value_LLSTRAT = 59, & !TMMF RC = RC ) + IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "GC_Allocate_All"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - Input_Opt%myCPU = myCPU - Input_Opt%rootCPU = MasterProc + Input_Opt%thisCPU = myCPU + Input_Opt%amIRoot = MasterProc ! TODO: Mimic GEOS-Chem's reading of input options !IF (MasterProc) THEN - ! CALL Read_Input_File( Input_Opt = Input_Opt(BEGCHUNK), & - ! srcFile = inputGeosPath, & + ! CALL Read_Input_File( Input_Opt = Input_Opt, & + ! srcFile = inputGeosPath, & ! RC = RC ) !ENDIF !CALL @@ -885,6 +871,8 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) ! First setup directories Input_Opt%Chem_Inputs_Dir = TRIM(chemInputsDir) + Input_Opt%SpcDatabaseFile = TRIM(speciesDBPath) + ! Simulation menu Input_Opt%NYMDb = 20000101 Input_Opt%NHMSb = 000000 @@ -923,7 +911,7 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) ! Now READ_PHOTOLYSIS_MENU Input_Opt%FAST_JX_DIR ='/glade/p/univ/umit0034/ExtData/' // & - 'CHEM_INPUTS/FAST_JX/v2019-06/' + 'CHEM_INPUTS/FAST_JX/v2020-02/' ! Now READ_CONVECTION_MENU ! For now, TMMF @@ -934,32 +922,21 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) ! Now READ_EMISSIONS_MENU Input_Opt%LEmis = .False. Input_Opt%HCOConfigFile = 'HEMCO_Config.rc' - Input_Opt%LFix_PBL_Bro = .False. ! Set surface VMRs - turn this off so that CAM can handle it Input_Opt%LCH4Emis = .False. Input_Opt%LCH4SBC = .False. - Input_Opt%LOCSEmis = .False. - Input_Opt%LCFCEmis = .False. - Input_Opt%LClEmis = .False. - Input_Opt%LBrEmis = .False. - Input_Opt%LN2OEmis = .False. - Input_Opt%LBasicEmis = .False. ! Set initial conditions Input_Opt%LSetH2O = .True. - ! CFC control - Input_Opt%CFCYear = 0 - ! Now READ_AEROSOL_MENU Input_Opt%LSulf = .True. Input_Opt%LMetalcatSO2 = .True. Input_Opt%LCarb = .True. Input_Opt%LBrC = .False. - Input_Opt%LSOA = .True. + Input_Opt%LSOA = .False. Input_Opt%LSVPOA = .False. - Input_Opt%LOMOC = .False. Input_Opt%LDust = .True. Input_Opt%LDstUp = .False. Input_Opt%LSSalt = .True. @@ -1039,7 +1016,7 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) IF ( MasterProc ) THEN ! Read data in to Input_Opt%Linoz_TParm - CALL Linoz_Read( MasterProc, Input_Opt, RC ) + CALL Linoz_Read( Input_Opt, RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Linoz_Read"!' CALL Error_Stop( ErrMsg, ThisLoc ) @@ -1103,7 +1080,8 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) latEdgeArr(nX+1,J) = REAL((latVal) * PI_180, f4) ENDDO - CALL SetGridFromCtrEdges( State_Grid = State_Grid(L), & + CALL SetGridFromCtrEdges( Input_Opt = Input_Opt, & + State_Grid = State_Grid(L), & lonCtr = lonMidArr, & latCtr = latMidArr, & lonEdge = lonEdgeArr, & @@ -1139,7 +1117,7 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) CALL GC_Update_Timesteps(300.0E+0_r8) ! Initialize error module - CALL Init_Error( MasterProc, Input_Opt, RC ) + CALL Init_Error( Input_Opt, RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Init_Error"!' CALL Error_Stop( ErrMsg, ThisLoc ) @@ -1163,6 +1141,7 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) !IF ( prtDebug ) CALL Print_DiagList( Diag_List, RC ) DO I = BEGCHUNK, ENDCHUNK + Input_Opt%amIRoot = (MasterProc .AND. (I == BEGCHUNK)) CALL GC_Init_StateObj( Diag_List = Diag_List, & ! Diagnostic list obj & Input_Opt = Input_Opt, & ! Input Options @@ -1182,21 +1161,22 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) State_Chm(I)%Spc_Units = 'v/v dry' ENDDO + Input_Opt%amIRoot = MasterProc - ! Now replicate GC_Init_Extra - IF ( Input_Opt%LDryD ) THEN + CALL GC_Init_Extra( Diag_List = Diag_List, & ! Diagnostic list obj + & Input_Opt = Input_Opt, & ! Input Options + & State_Chm = State_Chm(BEGCHUNK), & ! Chemistry State + & State_Diag = State_Diag(BEGCHUNK), & ! Diagnostics State + & State_Grid = State_Grid(BEGCHUNK), & ! Grid State + & RC = RC ) ! Success or failure - ! Setup for dry deposition - CALL Init_Drydep( Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "GC_Init_Extra"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Drydep"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + IF ( Input_Opt%LDryD ) THEN !============================================================== ! Get mapping between CESM dry deposited species and the @@ -1246,151 +1226,6 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) ' velocities similarly to MOZART over ocean and ice!') ENDIF #endif - - ENDIF - - !================================================================= - ! Call setup routines for wet deposition - ! - ! We need to initialize the wetdep module if either wet - ! deposition or convection is turned on, so that we can do the - ! large-scale and convective scavenging. Also initialize the - ! wetdep module if both wetdep and convection are turned off, - ! but chemistry is turned on. The INIT_WETSCAV routine will also - ! allocate the H2O2s and SO2s arrays that are referenced in the - ! convection code. (bmy, 9/23/15) - !================================================================= - IF ( Input_Opt%LConv .OR. & - Input_Opt%LWetD .OR. & - Input_Opt%LChem ) THEN - CALL Init_WetScav( Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_WetScav"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ENDIF - - !----------------------------------------------------------------- - ! Call SET_VDIFF_VALUES so that we can pass several values from - ! Input_Opt to the vdiff_mod.F90. This replaces the functionality - ! of logical_mod.F and tracer_mod.F.. This has to be called - ! after the input.geos file has been read from disk. - !----------------------------------------------------------------- - !CALL Set_VDiff_Values( Input_Opt = Input_Opt, & - !& State_Chm = State_Chm(BEGCHUNK), & - !& RC = RC ) - - !&IF (RC /= GC_SUCCESS) THEN - ! ErrMsg = 'Error encountered in "Set_VDiff_Values"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - !ENDIF - - !----------------------------------------------------------------- - ! Initialize the GET_NDEP_MOD for soil NOx deposition (bmy, 6/17/16) - !----------------------------------------------------------------- - !CALL Init_Get_NDep( Input_Opt = Input_Opt, & - !& State_Chm = State_Chm(BEGCHUNK), & - !& State_Diag = State_Diag(BEGCHUNK), & - !& RC = RC ) - ! - !IF (RC /= GC_SUCCESS) THEN - ! ErrMsg = 'Error encountered in "Init_Get_NDep"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - !ENDIF - - !----------------------------------------------------------------- - ! Initialize "carbon_mod.F" - !----------------------------------------------------------------- - IF ( Input_Opt%LCarb ) THEN - CALL Init_Carbon( Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Carbon"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ENDIF - - IF ( Input_Opt%LDust ) THEN - CALL Init_Dust( Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Dust"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ENDIF - - IF ( Input_Opt%LSSalt ) THEN - CALL Init_Seasalt( Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Seasalt"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ENDIF - - IF ( Input_Opt%LSulf ) THEN - CALL Init_Sulfate( Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Sulfate"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ENDIF - - IF ( Input_Opt%LSulf .OR. & - Input_Opt%LCarb .OR. & - Input_Opt%LDust .OR. & - Input_Opt%LSSalt ) THEN - CALL Init_Aerosol( Input_Opt = Input_Opt, & - & State_Chm = State_Chm(BEGCHUNK), & - & State_Diag = State_Diag(BEGCHUNK), & - & State_Grid = State_Grid(BEGCHUNK), & - & RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Aerosol"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ENDIF - - ! This is a bare subroutine - no module - CALL NDXX_Setup( Input_Opt, & - & State_Chm(BEGCHUNK), & - & State_Grid(BEGCHUNK), & - & RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_NDXX_Setup"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - - CALL Init_PBL_Mix( State_Grid = State_Grid(BEGCHUNK), & - RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_PBL_Mix"!' - CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF ! Set grid-cell area @@ -1414,7 +1249,6 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) State_Met(I)%Area_M2 = State_Grid(I)%Area_M2 ENDDO - ! Initialize (mostly unused) diagnostic arrays ! WARNING: This routine likely calls on modules which are currently ! excluded from the GC-CESM build (eg diag03) @@ -1434,18 +1268,6 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) Bp_CAM_Flip(I) = hybi(nZ+2-I) ENDDO - !----------------------------------------------------------------- - ! Initialize the hybrid pressure module. Define Ap and Bp. - !----------------------------------------------------------------- - CALL Init_Pressure( State_Grid = State_Grid(BEGCHUNK), & ! Grid State - RC = RC ) ! Success or failure - - ! Trapping errors - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Pressure"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - !----------------------------------------------------------------- ! Pass external Ap and Bp to GEOS-Chem's Pressure_Mod !----------------------------------------------------------------- @@ -1472,21 +1294,6 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) DEALLOCATE(Ap_CAM_Flip,Bp_CAM_Flip) - !! Initialize HEMCO? - !CALL Emissions_Init ( Input_Opt = Input_Opt, & - ! State_Met = State_Met, & - ! State_Chm = State_Chm, & - ! State_Grid = State_Grid, & - ! State_Met = State_Met, & - ! RC = RC, & - ! HcoConfig = HcoConfig ) - ! - !IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = 'Error encountered in "Emissions_Init"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - !ENDIF - ! - #if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) ! Populate the State_Met%LandTypeFrac field with data from HEMCO CALL Init_LandTypeFrac( Input_Opt = Input_Opt, & @@ -1511,21 +1318,6 @@ SUBROUTINE CHEM_INIT(PHYS_STATE, PBUF2D) ENDIF #endif - ! Initialize PBL quantities but do not do mixing - ! Add option for non-local PBL (Lin, 03/31/09) - CALL Init_Mixing ( Input_Opt = Input_Opt, & - State_Chm = State_Chm(BEGCHUNK), & - State_Diag = State_Diag(BEGCHUNK), & - State_Grid = State_Grid(BEGCHUNK), & - State_Met = State_Met(BEGCHUNK), & - RC = RC ) - - ! Trap potential errors - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in Init_Mixing!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - IF ( Input_Opt%Its_A_FullChem_Sim .OR. & Input_Opt%Its_An_Aerosol_Sim ) THEN ! This also initializes Fast-JX @@ -2001,14 +1793,14 @@ subroutine GC_Update_Timesteps(DT) IF (DT_MIN .NE. DT_MIN_LAST) THEN IF (MasterProc) WRITE(iulog,'(a,F7.1,a)') ' --> GC: updating dt to ', DT, ' seconds' - CALL Set_Timesteps( MasterProc, & - CHEMISTRY = DT_MIN, & - EMISSION = DT_MIN, & - DYNAMICS = DT_MIN, & - UNIT_CONV = DT_MIN, & - CONVECTION = DT_MIN, & - DIAGNOS = DT_MIN, & - RADIATION = DT_MIN ) + CALL Set_Timesteps( Input_Opt = Input_Opt, & + CHEMISTRY = DT_MIN, & + EMISSION = DT_MIN, & + DYNAMICS = DT_MIN, & + UNIT_CONV = DT_MIN, & + CONVECTION = DT_MIN, & + DIAGNOS = DT_MIN, & + RADIATION = DT_MIN ) DT_MIN_LAST = DT_MIN ENDIF @@ -2224,7 +2016,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ! Update the grid - Call SetGridFromCtr( State_Grid = State_Grid(LCHNK), & + CALL SetGridFromCtr( Input_Opt = Input_Opt, & + State_Grid = State_Grid(LCHNK), & lonCtr = lonMidArr, & latCtr = latMidArr, & RC = RC ) @@ -3095,7 +2888,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! (7) F_UNDER_PBLTOP: Fraction of grid box underneath the PBL top [-] ! (8) PBL_MAX_L : Model level where PBL top occurs [-] ! ==================================================================== - CALL Compute_PBL_Height( State_Grid = State_Grid(LCHNK), & + CALL Compute_PBL_Height( Input_Opt = Input_Opt, & + State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & RC = RC ) @@ -3424,10 +3218,15 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Input_Opt%Its_An_Aerosol_Sim ) THEN IF ( Input_Opt%LChem ) THEN - CALL Compute_Overhead_O3( State_Grid = State_Grid(LCHNK), & + CALL Compute_Overhead_O3( Input_Opt = Input_Opt, & + State_Grid = State_Grid(LCHNK), & + State_Chm = State_Chm(LCHNK), & DAY = currDy, & USE_O3_FROM_MET = Input_Opt%Use_O3_From_Met, & - TO3 = State_Met(LCHNK)%TO3 ) + TO3 = State_Met(LCHNK)%TO3, & + RC = RC ) + + ! TMMF, Add error check ENDIF ENDIF @@ -3929,8 +3728,6 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) INTEGER :: ILEV, NLEV, I REAL(r8) :: QTemp, Min_MMR - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT_CNST' - NLEV = SIZE(Q, 2) ! Retrieve a "background value" for this from the database Min_MMR = 1.0e-38_r8 @@ -3963,7 +3760,6 @@ subroutine chem_final use FlexChem_Mod, only : Cleanup_FlexChem use UCX_Mod, only : Cleanup_UCX use Drydep_Mod, only : Cleanup_Drydep - use WetScav_Mod, only : Cleanup_Wetscav use Carbon_Mod, only : Cleanup_Carbon use Dust_Mod, only : Cleanup_Dust use Seasalt_Mod, only : Cleanup_Seasalt @@ -3971,14 +3767,15 @@ subroutine chem_final use Sulfate_Mod, only : Cleanup_Sulfate use Pressure_Mod, only : Cleanup_Pressure use Strat_Chem_Mod, only : Cleanup_Strat_Chem - use PBL_Mix_Mod, only : Cleanup_PBL_Mix use CMN_Size_Mod, only : Cleanup_CMN_Size - use CMN_O3_Mod, only : Cleanup_CMN_O3 use CMN_FJX_Mod, only : Cleanup_CMN_FJX +#ifdef BPCH_DIAG + use CMN_O3_Mod, only : Cleanup_CMN_O3 ! Special: cleans up after NDXX_Setup use Diag_Mod, only : Cleanup_Diag +#endif use GC_Emissions_Mod, only: GC_Emissions_Final @@ -3987,7 +3784,7 @@ subroutine chem_final ! Finalize GEOS-Chem IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_FINAL' - CALL Cleanup_UCX( MasterProc ) + CALL Cleanup_UCX CALL Cleanup_Aerosol CALL Cleanup_Carbon CALL Cleanup_Drydep @@ -3998,47 +3795,41 @@ subroutine chem_final CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - CALL Cleanup_PBL_Mix CALL Cleanup_Pressure CALL Cleanup_Seasalt CALL Cleanup_Sulfate CALL Cleanup_Strat_Chem - CALL Cleanup_WetScav( RC) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Cleanup_WetScav"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - CALL GC_Emissions_Final - ! Call extra cleanup routines, from modules in Headers/ - CALL Cleanup_CMN_O3( MasterProc, RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Cleanup_CMN_O3"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - - CALL Cleanup_CMN_SIZE( MasterProc, RC ) + CALL Cleanup_CMN_SIZE( RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Cleanup_CMN_SIZE"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - CALL Cleanup_CMN_FJX( MasterProc, RC ) + CALL Cleanup_CMN_FJX( RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Cleanup_CMN_FJX"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF +#ifdef BPCH_DIAG CALL Cleanup_Diag + ! Call extra cleanup routines, from modules in Headers/ + CALL Cleanup_CMN_O3( RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Cleanup_CMN_O3"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF +#endif + ! Cleanup Input_Opt - CALL Cleanup_Input_Opt( MasterProc, Input_Opt, RC ) + CALL Cleanup_Input_Opt( Input_Opt, RC ) ! Loop over each chunk and cleanup the variables DO I = BEGCHUNK, ENDCHUNK - CALL Cleanup_State_Chm ( State_Chm(I), RC ) CALL Cleanup_State_Diag( State_Diag(I), RC ) CALL Cleanup_State_Grid( State_Grid(I), RC ) From 5f42a1e23ca70be3ec096eccc2ad3e29863f89ad Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 3 Aug 2020 17:20:32 -0400 Subject: [PATCH 116/239] Feat: Set State_Met%Salinity and Iodide to 0. Will be read from HEMCO Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 2efb5e1445..6739ec66b1 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -2404,6 +2404,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Dimensions : nX, nY State_Met(LCHNK)%Z0 (1,:) = Z0(:) + ! TMMF, Fill in Salinity and surface iodide from HEMCO + ! Option to get surface salinity from POP? + State_Met(LCHNK)%SALINITY(1,:) = 0.0e+0_fp + State_Met(LCHNK)%IODIDE(1,:) = 0.0e+0_fp + DO J = 1, nY iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(1,J) + & State_Met(LCHNK)%FRLANDIC(1,J) + & From 65d68432158b26ea51eaa5e711ca0df07564f65d Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 4 Aug 2020 19:43:16 -0400 Subject: [PATCH 117/239] Feat: Compute isLand/Water/Ice/Snow after AirQnt + Get fields from HEMCO (1) Get IODIDE surface concentration and SALINITY from HEMCO Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 108 +++++++++++++++++++----- 1 file changed, 87 insertions(+), 21 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 6739ec66b1..543fdb3a03 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -5,6 +5,7 @@ module chemistry use shr_kind_mod, only: r8 => shr_kind_r8 use physics_types, only: physics_state, physics_ptend, physics_ptend_init + use physics_buffer, only: physics_buffer_desc use ppgrid, only: begchunk, endchunk, pcols use ppgrid, only: pver, pverp use constituents, only: pcnst, cnst_add, cnst_get_ind @@ -98,6 +99,8 @@ module chemistry TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object TYPE(DgnList ) :: Diag_List ! Diagnostics list object + type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! ptr to 2d pbuf + ! Indices of critical species INTEGER :: iH2O, iO3, iCH4, iCO, iNO @@ -1755,6 +1758,8 @@ subroutine chem_init(phys_state, pbuf2d) CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'fraction', TRIM(SpcName)//' surface area') #endif + hco_pbuf2d => pbuf2d + IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT' end subroutine chem_init @@ -1811,6 +1816,7 @@ subroutine GC_Update_Timesteps(DT) subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only : pbuf_get_chunk, pbuf_get_index use cam_history, only: outfld use camsrfexch, only: cam_in_t, cam_out_t @@ -1967,6 +1973,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) LOGICAL :: newDay = .False. LOGICAL :: newMonth = .False. + TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in chnk + REAL(r8), POINTER :: pbuf_ik(:,:) ! ptr to pbuf data (/pcols,pver/) + INTEGER :: tmpIdx ! pbuf field id + CHARACTER(LEN=255) :: fldname_ns ! field name + INTEGER :: TIM_NDX INTEGER, SAVE :: iStep = 0 @@ -2404,27 +2415,36 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Dimensions : nX, nY State_Met(LCHNK)%Z0 (1,:) = Z0(:) - ! TMMF, Fill in Salinity and surface iodide from HEMCO - ! Option to get surface salinity from POP? - State_Met(LCHNK)%SALINITY(1,:) = 0.0e+0_fp - State_Met(LCHNK)%IODIDE(1,:) = 0.0e+0_fp - - DO J = 1, nY - iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(1,J) + & - State_Met(LCHNK)%FRLANDIC(1,J) + & - State_Met(LCHNK)%FRLAKE(1,J), & - State_Met(LCHNK)%FRSEAICE(1,J), & - State_Met(LCHNK)%FROCEAN(1,J) - & - State_Met(LCHNK)%FRSEAICE(1,J) /) ) - IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 - ! reset ocean to 0 + ! Field : IODIDE + ! Description: Surface iodide concentration + ! Unit : nM + ! Dimensions : nX, nY + fldname_ns = 'HCO_surf_iodide' + tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + State_Met(LCHNK)%IODIDE(1,:) = 0.0e+0_fp + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + State_Met(LCHNK)%IODIDE(1,:) = pbuf_ik(:,nZ) + ENDIF - ! Field : LWI - ! Description: Land/water indices - ! Unit : - - ! Dimensions : nX, nY - State_Met(LCHNK)%LWI(1,J) = FLOAT( iMaxLoc(1) ) - ENDDO + ! Field : SALINITY + ! Description: Ocean salinity + ! Unit : PSU + ! Dimensions : nX, nY + ! Note : Possibly get ocean salinity from POP? + fldname_ns = 'HCO_surf_salinity' + tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + State_Met(LCHNK)%SALINITY(1,:) = 0.0e+0_fp + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + State_Met(LCHNK)%SALINITY(1,:) = pbuf_ik(:,nZ) + ENDIF ! Three-dimensional fields on level edges DO J = 1, nY @@ -2737,6 +2757,49 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ! Do this after AirQnt, such that we overwrite GEOS-Chem isLand, isWater and + ! isIce, which are based on albedo. Rather, we use CLM landFranc, ocnFrac + ! and iceFrac. We also compute isSnow + DO J = 1, nY + iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(1,J) + & + State_Met(LCHNK)%FRLANDIC(1,J) + & + State_Met(LCHNK)%FRLAKE(1,J), & + State_Met(LCHNK)%FRSEAICE(1,J), & + State_Met(LCHNK)%FROCEAN(1,J) - & + State_Met(LCHNK)%FRSEAICE(1,J) /) ) + IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 + ! reset ocean to 0 + + ! Field : LWI + ! Description: Land/water indices + ! Unit : - + ! Dimensions : nX, nY + State_Met(LCHNK)%LWI(1,J) = FLOAT( iMaxLoc(1) ) + + IF ( iMaxLoc(1) == 0 ) THEN + State_Met(LCHNK)%isLand(1,J) = .False. + State_Met(LCHNK)%isWater(1,J) = .True. + State_Met(LCHNK)%isIce(1,J) = .False. + ELSEIF ( iMaxLoc(1) == 1 ) THEN + State_Met(LCHNK)%isLand(1,J) = .True. + State_Met(LCHNK)%isWater(1,J) = .False. + State_Met(LCHNK)%isIce(1,J) = .False. + ELSEIF ( iMaxLoc(1) == 2 ) THEN + State_Met(LCHNK)%isLand(1,J) = .False. + State_Met(LCHNK)%isWater(1,J) = .False. + State_Met(LCHNK)%isIce(1,J) = .True. + ELSE + Write(iulog,*) " iMaxLoc gets value: ", iMaxLoc + ErrMsg = 'Failed to figure out land/water' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + State_Met(LCHNK)%isSnow(1,J) = ( State_Met(LCHNK)%FRSEAICE(1,J) > 0.0e+0_fp & + .or. State_Met(LCHNK)%SNODP(1,J) > 0.01 ) + + ENDDO + + ! Initialize strat chem if not already done. This has to be done here because ! it needs to have non-zero values in State_Chm%AD, which only happens after ! the first call to AirQnt @@ -3231,7 +3294,10 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) TO3 = State_Met(LCHNK)%TO3, & RC = RC ) - ! TMMF, Add error check + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Compute_Overhead_O3"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF ENDIF ENDIF From 620fa1cc2f082610e8e83cd73505c2cbe1bd630c Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 5 Aug 2020 17:49:45 -0400 Subject: [PATCH 118/239] Feat: Modify aero_model.F90 to let GEOS-Chem handle its own aerosols Signed-off-by: Thibaud Fritz --- src/chemistry/modal_aero/aero_model.F90 | 78 ++++++++++++++++++++----- 1 file changed, 62 insertions(+), 16 deletions(-) diff --git a/src/chemistry/modal_aero/aero_model.F90 b/src/chemistry/modal_aero/aero_model.F90 index 56c3f22b58..e136f37d70 100644 --- a/src/chemistry/modal_aero/aero_model.F90 +++ b/src/chemistry/modal_aero/aero_model.F90 @@ -90,14 +90,17 @@ module aero_model ! Namelist variables character(len=16) :: wetdep_list(pcnst) = ' ' character(len=16) :: drydep_list(pcnst) = ' ' + logical, allocatable :: isGEOSChem_WetDep(:), isGEOSChem_DryDep(:) real(r8) :: sol_facti_cloud_borne = 1._r8 real(r8) :: sol_factb_interstitial = 0.1_r8 real(r8) :: sol_factic_interstitial = 0.4_r8 real(r8) :: seasalt_emis_scale - integer :: ndrydep = 0 + integer :: ndrydep = 0 + integer :: ndrydepAll = 0 integer,allocatable :: drydep_indices(:) - integer :: nwetdep = 0 + integer :: nwetdep = 0 + integer :: nwetdepAll = 0 integer,allocatable :: wetdep_indices(:) logical :: drydep_lq(pcnst) logical :: wetdep_lq(pcnst) @@ -196,6 +199,8 @@ subroutine aero_model_init( pbuf2d ) use modal_aero_rename, only: modal_aero_rename_init use modal_aero_convproc, only: ma_convproc_init + use chemistry, only: chem_is + ! args type(physics_buffer_desc), pointer :: pbuf2d(:,:) @@ -218,8 +223,11 @@ subroutine aero_model_init( pbuf2d ) character(len=32) :: spec_name character(len=32) :: spec_type character(len=32) :: mode_type + integer :: nspec + character(len=32) :: GCName + dgnum_idx = pbuf_get_index('DGNUM') dgnumwet_idx = pbuf_get_index('DGNUMWET') fracis_idx = pbuf_get_index('FRACIS') @@ -268,10 +276,17 @@ subroutine aero_model_init( pbuf2d ) count_species: do m = 1,pcnst if ( len_trim(wetdep_list(m)) /= 0 ) then - nwetdep = nwetdep+1 + ! This allows us to exclude GEOS-Chem aerosols, such that + ! GEOS-Chem handles its own aerosols + ! Note: GEOS-Chem aerosols are stored as 'GC_AER_' + wetdep_list + call cnst_get_ind ( wetdep_list(m), id, abort=.false. ) + if ( id > 0 ) nwetdep = nwetdep+1 + nwetdepAll = nwetdepAll + 1 endif if ( len_trim(drydep_list(m)) /= 0 ) then - ndrydep = ndrydep+1 + call cnst_get_ind ( drydep_list(m), id, abort=.false. ) + if ( id > 0 ) ndrydep = ndrydep+1 + ndrydepAll = ndrydepAll + 1 endif enddo count_species @@ -280,28 +295,55 @@ subroutine aero_model_init( pbuf2d ) if (ndrydep>0) & allocate(drydep_indices(ndrydep)) - do m = 1,ndrydep + if (nwetdepAll>0) & + allocate(isGEOSChem_WetDep(nwetdepAll)) + if (ndrydepAll>0) & + allocate(isGEOSChem_dryDep(ndrydepAll)) + + isGEOSChem_DryDep(:) = .False. + isGEOSChem_WetDep(:) = .False. + + n = 1 + do m = 1, ndrydepAll call cnst_get_ind ( drydep_list(m), id, abort=.false. ) if (id>0) then - drydep_indices(m) = id - else + drydep_indices(n) = id + n = n+1 + elseif ( chem_is('GEOSCHEM') ) then + ! Let GEOS-Chem handle its own aerosols + write(GCName,'(a,a)') 'GC_AER_', drydep_list(m) + call cnst_get_ind ( GCName, id, abort=.false. ) + if ( id > 0 ) isGEOSChem_DryDep(m) = .True. + endif + + if ( id <= 0 ) then call endrun(subrname//': invalid drydep species: '//trim(drydep_list(m)) ) endif - if (masterproc) then + if (masterproc .and. (.not. isGEOSChem_DryDep(m))) then write(iulog,*) subrname//': '//drydep_list(m)//' will have drydep applied' endif enddo - do m = 1,nwetdep + + n = 1 + do m = 1, nwetdepAll call cnst_get_ind ( wetdep_list(m), id, abort=.false. ) if (id>0) then - wetdep_indices(m) = id - else + wetdep_indices(n) = id + n = n+1 + elseif ( chem_is('GEOSCHEM') ) then + ! Let GEOS-Chem handle its own aerosols + write(GCName,'(a,a)') 'GC_AER_', wetdep_list(m) + call cnst_get_ind ( GCName, id, abort=.false. ) + if ( id > 0 ) isGEOSChem_WetDep(m) = .True. + endif + + if ( id <= 0 ) then call endrun(subrname//': invalid wetdep species: '//trim(wetdep_list(m)) ) endif - if (masterproc) then - write(iulog,*) subrname//': '//wetdep_list(m)//' will have wet removal' + if (masterproc .and. (.not. isGEOSChem_WetDep(m))) then + write(iulog,*) subrname//': '//wetdep_list(m)//' will have wetdep applied' endif enddo @@ -387,8 +429,10 @@ subroutine aero_model_init( pbuf2d ) rate1_cw2pr_st_idx = pbuf_get_index('RATE1_CW2PR_ST') call pbuf_set_field(pbuf2d, rate1_cw2pr_st_idx, 0.0_r8) - do m = 1,ndrydep - + do m = 1,ndrydepAll + + if ( isGEOSChem_DryDep(m) ) cycle + ! units if (drydep_list(m)(1:3) == 'num') then unit_basename = ' 1' @@ -417,7 +461,9 @@ subroutine aero_model_init( pbuf2d ) enddo - do m = 1,nwetdep + do m = 1,nwetdepAll + + if ( isGEOSChem_WetDep(m) ) cycle ! units if (wetdep_list(m)(1:3) == 'num') then From fa9bab802c34388373564bbf4247703a7c72180c Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 6 Aug 2020 16:17:23 -0400 Subject: [PATCH 119/239] Fix: Resolve circular dependency Signed-off-by: Thibaud Fritz --- src/chemistry/modal_aero/aero_model.F90 | 6 +++--- src/chemistry/pp_geoschem/chemistry.F90 | 16 +++++++--------- src/chemistry/pp_geoschem/mo_chem_utls.F90 | 13 +++++++++++++ 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/chemistry/modal_aero/aero_model.F90 b/src/chemistry/modal_aero/aero_model.F90 index e136f37d70..41e0f1156a 100644 --- a/src/chemistry/modal_aero/aero_model.F90 +++ b/src/chemistry/modal_aero/aero_model.F90 @@ -199,7 +199,7 @@ subroutine aero_model_init( pbuf2d ) use modal_aero_rename, only: modal_aero_rename_init use modal_aero_convproc, only: ma_convproc_init - use chemistry, only: chem_is + use mo_chem_utls, only: utls_chem_is ! args type(physics_buffer_desc), pointer :: pbuf2d(:,:) @@ -309,7 +309,7 @@ subroutine aero_model_init( pbuf2d ) if (id>0) then drydep_indices(n) = id n = n+1 - elseif ( chem_is('GEOSCHEM') ) then + elseif ( utls_chem_is('GEOS-Chem') ) then ! Let GEOS-Chem handle its own aerosols write(GCName,'(a,a)') 'GC_AER_', drydep_list(m) call cnst_get_ind ( GCName, id, abort=.false. ) @@ -331,7 +331,7 @@ subroutine aero_model_init( pbuf2d ) if (id>0) then wetdep_indices(n) = id n = n+1 - elseif ( chem_is('GEOSCHEM') ) then + elseif ( utls_chem_is('GEOS-Chem') ) then ! Let GEOS-Chem handle its own aerosols write(GCName,'(a,a)') 'GC_AER_', wetdep_list(m) call cnst_get_ind ( GCName, id, abort=.false. ) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 96830b7f17..c305c47e6b 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -155,15 +155,13 @@ module chemistry contains !================================================================================================ - LOGICAL function chem_is (name) + logical function chem_is (name) - CHARACTER(LEN=*), INTENT(IN) :: name + use mo_chem_utls, only : utls_chem_is - chem_is = .false. - IF (( to_upper(name) == 'GEOSCHEM' ) .OR. & - ( to_upper(name) == 'GEOS-CHEM' )) THEN - chem_is = .true. - ENDIF + character(len=*), intent(in) :: name + + chem_is = utls_chem_is(name) end function chem_is @@ -3607,9 +3605,9 @@ subroutine chem_emissions( state, cam_in ) cam_in%cflx(1:ncol,M) = sflx(1:ncol,N) IF ( rootChunk .and. ( MAXVAL(sflx(1:ncol,N)) > 0.0e+0_fp ) ) THEN - Write(iulog,*) "chem_emissions: debug added emiss for ", & + Write(iulog,'(a,a,E16.4,a,a)') "chem_emissions: debug added emiss for ", & TRIM(cnst_name(M)), MAXVAL(sflx(1:ncol,N)), " from ", TRIM(fldname_ns) - Write(iulog,*) "chem_emissions: Total emission flux for ", & + Write(iulog,'(a,a,a,E16.4)') "chem_emissions: Total emission flux for ", & TRIM(cnst_name(M)), " is: ", MAXVAL(cam_in%cflx(1:ncol,M)) ENDIF ENDIF diff --git a/src/chemistry/pp_geoschem/mo_chem_utls.F90 b/src/chemistry/pp_geoschem/mo_chem_utls.F90 index 7ef4f09393..e93d1db55d 100644 --- a/src/chemistry/pp_geoschem/mo_chem_utls.F90 +++ b/src/chemistry/pp_geoschem/mo_chem_utls.F90 @@ -4,6 +4,7 @@ module mo_chem_utls private public :: get_spc_ndx public :: get_inv_ndx + public :: utls_chem_is !, get_het_ndx, get_extfrc_ndx, get_rxt_ndx save @@ -69,6 +70,18 @@ integer function get_inv_ndx( invariant ) end do end function get_inv_ndx + + logical function utls_chem_is (name) result(chem_is) + use string_utils, only : to_lower + + character(len=*), intent(in) :: name + chem_is = .false. + if (( to_lower(name) == 'geoschem' ) .or. & + ( to_lower(name) == 'geos-chem' )) then + chem_is = .true. + endif + + end function utls_chem_is ! ! integer function get_het_ndx( het_name ) ! !----------------------------------------------------------------------- From 9263a4b5be054ddc1ea414da7af88c38a235525d Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 6 Aug 2020 16:17:52 -0400 Subject: [PATCH 120/239] Feat: Reduce chem_nadv to 240 Signed-off-by: Thibaud Fritz --- bld/configure | 2 +- src/chemistry/pp_geoschem/chem_mods.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/configure b/bld/configure index c382e73cad..103f6627b0 100755 --- a/bld/configure +++ b/bld/configure @@ -1442,7 +1442,7 @@ if ($chem_pkg =~ '_mam3') { if ($chem_pkg =~ 'geoschem') { $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DLINUX_IFORT -DUSE_REAL8 -DMODEL_ -DMODEL_CESM'; # TMMF - Temporary fix - $chem_nadv = 280; + $chem_nadv = 240; if (defined $opts{'clm_vers'}) { if ($opts{'clm_vers'} =~ 'CLM4.0') { $chem_cppdefs .= ' -DCLM40' diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/pp_geoschem/chem_mods.F90 index 582608e0fb..48b074912c 100644 --- a/src/chemistry/pp_geoschem/chem_mods.F90 +++ b/src/chemistry/pp_geoschem/chem_mods.F90 @@ -7,7 +7,7 @@ module chem_mods implicit none save - INTEGER, PARAMETER :: nTracersMax = 280 ! Must be equal to chem_nadv + INTEGER, PARAMETER :: nTracersMax = 240 ! Must be equal to chem_nadv INTEGER :: nTracers CHARACTER(LEN=255) :: tracerNames(nTracersMax) CHARACTER(LEN=255) :: tracerLongNames(nTracersMax) From 8620f0951709d740ebd559ef895d55018a3d4df2 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 6 Aug 2020 16:18:30 -0400 Subject: [PATCH 121/239] Feat: Rename HCO_surf_salinity to HCO_salinity (1) The physics buffer does not allow to store strings as long as `HCO_surf_salinity` and would, for instance, store `HCO_surf_salinit`. To avoid confusion, we rename it to `HCO_salinity`, same for `HCO_iodide`. Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index c305c47e6b..d3bc12419b 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -2416,7 +2416,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Surface iodide concentration ! Unit : nM ! Dimensions : nX, nY - fldname_ns = 'HCO_surf_iodide' + fldname_ns = 'HCO_iodide' tmpIdx = pbuf_get_index(fldname_ns, RC) IF ( tmpIdx < 0 ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) @@ -2432,7 +2432,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Unit : PSU ! Dimensions : nX, nY ! Note : Possibly get ocean salinity from POP? - fldname_ns = 'HCO_surf_salinity' + fldname_ns = 'HCO_salinity' tmpIdx = pbuf_get_index(fldname_ns, RC) IF ( tmpIdx < 0 ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) From bdf3fc6d3f7f529ba5e8c9e5ecb73b444f7bb3a4 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 6 Aug 2020 18:17:29 -0400 Subject: [PATCH 122/239] Feat: Allow CESM-GC to output dry deposition velocity used by GEOS-Chem (1) Add addfld and outfld statements for each dry deposition species, using State_Chm%DryDepVel (2) Fix to let chemistry.F90 when LANDTYPE_HEMCO is 1. Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 45 +++++++++++++------------ 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index d3bc12419b..5526f07065 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -129,8 +129,8 @@ module chemistry #define OCNDDVEL_MOZART 0 ! The following flags are only used if ALLDDVEL_GEOSCHEM is on -#define LANDTYPE_HEMCO 0 -#define LANDTYPE_CLM 1 +#define LANDTYPE_HEMCO 1 +#define LANDTYPE_CLM 0 ! Filenames to compute dry deposition velocities similarly to MOZART character(len=shr_kind_cl) :: clim_soilw_file = 'clim_soilw_file' @@ -1668,18 +1668,26 @@ subroutine chem_init(phys_state, pbuf2d) ! Add all species as output fields if desired DO I = 1, nTracers SpcName = TRIM(tracerNames(I)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(tracerLongNames(I))//' concentration') + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & + TRIM(tracerLongNames(I))//' concentration') IF (TRIM(SpcName) == 'O3') THEN CALL Add_Default ( TRIM(SpcName), 1, ' ') ENDIF ENDDO - DO I =1, nSls + DO I = 1, nSls SpcName = TRIM(slsNames(I)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', TRIM(slsLongNames(I))//' concentration') + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & + TRIM(slsLongNames(I))//' concentration') !CALL Add_Default(TRIM(SpcName), 1, '') ENDDO + DO I = 1, State_Chm(BEGCHUNK)%nDryDep + SpcName = 'DDVel_'//TRIM(depName(I)) + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'm/s', & + TRIM(SpcName)//' dry deposition velocity') + ENDDO + ! Initialize emissions interface (this will eventually handle HEMCO) CALL GC_Emissions_Init @@ -1921,12 +1929,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) LOGICAL :: rootChunk INTEGER :: RC -#if ( LANDTYPE_HEMCO ) - INTEGER :: tmpIdx - character(len=255) :: name - real(r8), pointer :: pbuf_ik(:,:) ! Pointer to pbuf data (/pcols,pver/) -#endif - ! LCHNK: which chunk we have on this process LCHNK = State%LCHNK ! NCOL: number of atmospheric columns on this chunk @@ -2227,13 +2229,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) #endif #elif ( LANDTYPE_HEMCO ) DO N = 1, NSURFTYPE - Write(name, '(a,i2.2)') 'HCO_LANDTYPE', N-1 - If ( MasterProc ) Write(iulog,*) " Getting ", TRIM(name) - - tmpIdx = pbuf_get_index(name, rc) + Write(fldname_ns, '(a,i2.2)') 'HCO_LANDTYPE', N-1 + tmpIdx = pbuf_get_index(fldname_ns, rc) IF ( tmpIdx < 0 ) THEN ! there is an error here and the field was not found - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(name) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) ELSE CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) DO J = 1, nY @@ -2243,13 +2243,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDIF - Write(name, '(a,i2.2)') 'HCO_XLAI', N-1 - If ( MasterProc ) Write(iulog,*) " Getting ", TRIM(name) - - tmpIdx = pbuf_get_index(name, rc) + Write(fldname_ns, '(a,i2.2)') 'HCO_XLAI', N-1 + tmpIdx = pbuf_get_index(fldname_ns, rc) IF ( tmpIdx < 0 ) THEN ! there is an error here and the field was not found - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(name) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) ELSE CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) DO J = 1, nY @@ -3323,6 +3321,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDDO + DO N = 1, State_Chm(BEGCHUNK)%nDryDep + SpcName = 'DDVel_'//TRIM(depName(N)) + CALL OutFld( TRIM(SpcName), State_Chm(LCHNK)%DryDepVel(1,:nY,N), nY, LCHNK ) + ENDDO + ! NOTE: Re-flip all the arrays vertically or suffer the consequences ! ptend%q dimensions: [column, ?, species] ptend%q(:,:,:) = 0.0e+0_r8 From b79ad0d8374d41c48161b8d19a9116a9887db569 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 17 Aug 2020 16:04:24 -0400 Subject: [PATCH 123/239] Feat: Uncomment call to DO_MIXING to allow for dry deposition Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 145 ++++++++++++++++++------ 1 file changed, 108 insertions(+), 37 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 5526f07065..03423c0000 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -24,6 +24,7 @@ module chemistry USE State_Diag_Mod, ONLY : DgnState ! Derived type for Diagnostics State object USE State_Grid_Mod, ONLY : GrdState ! Derived type for Grid State object USE State_Met_Mod, ONLY : MetState ! Derived type for Meteorology State object + USE Species_Mod, ONLY : Species ! Derived type for Species object USE ErrCode_Mod ! Error codes for success or failure USE Error_Mod ! For error checking @@ -178,7 +179,6 @@ subroutine chem_register use State_Chm_Mod, only : Init_State_Chm, Cleanup_State_Chm use State_Chm_Mod, only : Ind_ use Input_Opt_Mod, only : Set_Input_Opt, Cleanup_Input_Opt - use Species_Mod, only : Species use mo_sim_dat, only : set_sim_dat use mo_chem_utls, only : get_spc_ndx @@ -768,7 +768,7 @@ subroutine chem_readnl(nlfile) Write(iulog,'(a)') ' + Massachusetts Institute of Technology' Write(iulog,'(a)') REPEAT( '=', 50 ) - Write(iulog,'(/,/, a)') 'Now defining GEOS-Chem tracers and dry deposition mapping...' + Write(iulog,'(/,a,/)') 'Now defining GEOS-Chem tracers and dry deposition mapping...' unitn = getunit() @@ -982,6 +982,7 @@ subroutine chem_init(phys_state, pbuf2d) use Olson_Landmap_Mod #endif use Mixing_Mod + use Vdiff_Mod use GC_Emissions_Mod, only : GC_Emissions_Init @@ -995,32 +996,35 @@ subroutine chem_init(phys_state, pbuf2d) !---------------------------- ! Integers - INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) - INTEGER :: IWAIT, IERR - INTEGER :: nX, nY, nZ - INTEGER :: iX, jY - INTEGER :: I, J, L, N - INTEGER :: RC - INTEGER :: nLinoz + INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) + INTEGER :: IWAIT, IERR + INTEGER :: nX, nY, nZ + INTEGER :: iX, jY + INTEGER :: I, J, L, N + INTEGER :: RC + INTEGER :: nLinoz ! Logicals - LOGICAL :: prtDebug + LOGICAL :: prtDebug ! Strings - CHARACTER(LEN=255) :: historyConfigFile - CHARACTER(LEN=255) :: SpcName + CHARACTER(LEN=255) :: historyConfigFile + CHARACTER(LEN=255) :: SpcName + + ! Objects + TYPE(Species), POINTER :: SpcInfo ! Grid setup - REAL(fp) :: lonVal, latVal - REAL(fp) :: dLonFix, dLatFix - REAL(f4), ALLOCATABLE :: lonMidArr(:,:), latMidArr(:,:) - REAL(f4), ALLOCATABLE :: lonEdgeArr(:,:), latEdgeArr(:,:) - REAL(r8), ALLOCATABLE :: linozData(:,:,:,:) + REAL(fp) :: lonVal, latVal + REAL(fp) :: dLonFix, dLatFix + REAL(f4), ALLOCATABLE :: lonMidArr(:,:), latMidArr(:,:) + REAL(f4), ALLOCATABLE :: lonEdgeArr(:,:), latEdgeArr(:,:) + REAL(r8), ALLOCATABLE :: linozData(:,:,:,:) - REAL(r8), ALLOCATABLE :: Col_Area(:) - REAL(fp), ALLOCATABLE :: Ap_CAM_Flip(:), Bp_CAM_Flip(:) + REAL(r8), ALLOCATABLE :: Col_Area(:) + REAL(fp), ALLOCATABLE :: Ap_CAM_Flip(:), Bp_CAM_Flip(:) - REAL(r8), POINTER :: SlsPtr(:,:,:) + REAL(r8), POINTER :: SlsPtr(:,:,:) ! Assume a successful return until otherwise @@ -1030,6 +1034,9 @@ subroutine chem_init(phys_state, pbuf2d) ErrMsg = '' ThisLoc = ' -> at GEOS-Chem (in chemistry/pp_geoschem/chemistry.F90)' + ! Initialize pointers + SpcInfo => NULL() + ! LCHNK: which chunks we have on this process LCHNK = PHYS_STATE%LCHNK ! NCOL: number of atmospheric columns for each chunk @@ -1618,6 +1625,18 @@ subroutine chem_init(phys_state, pbuf2d) DEALLOCATE(Ap_CAM_Flip,Bp_CAM_Flip) + ! Once the initial met fields have been read in, we need to find + ! the maximum PBL level for the non-local mixing algorithm. + CALL Max_PblHt_For_Vdiff( Input_Opt = Input_Opt, & + State_Grid = State_Grid(BEGCHUNK), & + State_Met = State_Met(BEGCHUNK), & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Max_PblHt_for_Vdiff"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + IF ( Input_Opt%Its_A_FullChem_Sim .OR. & Input_Opt%Its_An_Aerosol_Sim ) THEN ! This also initializes Fast-JX @@ -1688,6 +1707,22 @@ subroutine chem_init(phys_state, pbuf2d) TRIM(SpcName)//' dry deposition velocity') ENDDO + DO I = 1, State_Chm(BEGCHUNK)%nAdvect + ! Get the species ID from the advected species ID + L = State_Chm(BEGCHUNK)%Map_Advect(I) + + ! Get info about this species from the species database + SpcInfo => State_Chm(BEGCHUNK)%SpcData(L)%Info + SpcName = 'SurfFlux_'//TRIM(SpcInfo%Name) + + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & + TRIM(SpcName)//' dry deposition flux') + + ! Free pointer + SpcInfo => NULL() + ENDDO + + ! Initialize emissions interface (this will eventually handle HEMCO) CALL GC_Emissions_Init @@ -1794,6 +1829,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use PBL_Mix_Mod, only: Compute_PBL_Height use Tropopause, only: Tropopause_findChemTrop, Tropopause_Find + use HCO_Utilities_GC_Mod ! Utility routines for GC-HEMCO interface ! For calculating SZA use Orbit, only: zenith @@ -1909,6 +1945,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CHARACTER(LEN=255) :: SpcName REAL(r8) :: VMR(State%NCOL,PVER) + ! Objects + TYPE(Species), POINTER :: SpcInfo + REAL(r8) :: SlsData(State%NCOL, PVER, nSls) INTEGER :: currYr, currMo, currDy, currTOD @@ -2965,7 +3004,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! The following options are currently supported: ! - ALLDDVEL_GEOSCHEM ! - OCNDDVEL_GEOSCHEM - ! - OCNDDVEL_MOZART + ! !!!! - OCNDDVEL_MOZART, needs investigation ! ! The ALLDDVEL_GEOSCHEM coupled with LANDTYPE_CLM requires that CLM ! passes land type information (land type and leaf area index). @@ -3152,6 +3191,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL ENDRUN('Incorrect definitions for dry deposition velocities') #endif + !TMMF, Here set dry deposition velocities to zero if MAM performs its + !own deposition... + CALL Update_DryDepSav( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & @@ -3165,6 +3207,24 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ***** M I X E D L A Y E R M I X I N G ***** !=========================================================== + ! Updates from Bob Yantosca, 06/2020 + ! Compute the surface flux for the non-local mixing, + ! (which means getting emissions & drydep from HEMCO) + ! and store it in State_Chm%Surface_Flux + IF ( Input_Opt%LTURB .and. Input_Opt%LNLPBL ) THEN + CALL Compute_Sflx_For_Vdiff( Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Compute_Sflx_for_Vdiff"!' + CALL Error_Stop( errMsg, thisLoc ) + ENDIF + ENDIF + ! Note: mixing routine expects tracers in v/v ! DO_MIXING applies the tracer tendencies (dry deposition, ! emission rates) to the tracer arrays and performs PBL @@ -3177,26 +3237,23 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! NOTE: Tracer concentration units are converted locally ! to [v/v dry air] for mixing. Eventually mixing should ! be updated to use [kg/kg total air] (ewl, 9/18/15) - ! - ! This requires HEMCO. For now comment out. - ! Thibaud M. Fritz - 05/07/20 - !CALL Do_Mixing( Input_Opt = Input_Opt, & - ! State_Chm = State_Chm(LCHNK), & - ! State_Diag = State_Diag(LCHNK), & - ! State_Grid = State_Grid(LCHNK), & - ! State_Met = State_Met(LCHNK), & - ! RC = RC ) - ! - !! Trap potential errors - !IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = 'Error encountered in "Do_Mixing"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - !ENDIF + CALL Do_Mixing( Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Do_Mixing"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF !!=========================================================== !! ***** C L O U D C O N V E C T I O N ***** !!=========================================================== - !IF ( LCONV ) THEN + !IF ( Input_Opt%LConv ) THEN ! ! ! Call the appropriate convection routine ! ! NOTE: Tracer concentration units are converted locally @@ -3326,6 +3383,20 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL OutFld( TRIM(SpcName), State_Chm(LCHNK)%DryDepVel(1,:nY,N), nY, LCHNK ) ENDDO + DO N = 1, State_Chm(BEGCHUNK)%nAdvect + ! Get the species ID from the advected species ID + L = State_Chm(BEGCHUNK)%Map_Advect(N) + + ! Get info about this species from the species database + SpcInfo => State_Chm(BEGCHUNK)%SpcData(L)%Info + SpcName = 'SurfFlux_'//TRIM(SpcInfo%Name) + + CALL OutFld( TRIM(SpcName), -State_Chm(LCHNK)%SurfaceFlux(1,:nY,N), nY, LCHNK ) + + ! Free pointer + SpcInfo => NULL() + ENDDO + ! NOTE: Re-flip all the arrays vertically or suffer the consequences ! ptend%q dimensions: [column, ?, species] ptend%q(:,:,:) = 0.0e+0_r8 From 4e852c3927d875c0865163b3b88462ca09da63cf Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 25 Aug 2020 14:37:20 -0400 Subject: [PATCH 124/239] Feat: Change IC condition file (1) Renamed some species into their GEOS-Chem equivalent. This new IC file is a mere copy of the default file, with some species renamed Signed-off-by: Thibaud Fritz --- bld/namelist_files/use_cases/geoschem.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 793741e9e4..f4df7e3d6e 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -5,7 +5,7 @@ 367.0e-6 -atm/cam/inic/fv/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc +/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc atm/cam/solar/spectral_irradiance_Lean_1610-2009_ann_c100405.nc From bf54e80dd2e9915c44161e4c5cd32bb2ab9125ca Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 25 Aug 2020 14:43:30 -0400 Subject: [PATCH 125/239] Fix: Replace species number with `gas_pcnst` Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/mo_chem_utls.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chemistry/pp_geoschem/mo_chem_utls.F90 b/src/chemistry/pp_geoschem/mo_chem_utls.F90 index e93d1db55d..af89cc0f76 100644 --- a/src/chemistry/pp_geoschem/mo_chem_utls.F90 +++ b/src/chemistry/pp_geoschem/mo_chem_utls.F90 @@ -16,7 +16,7 @@ integer function get_spc_ndx( spc_name ) ! ... return overall species index associated with spc_name !----------------------------------------------------------------------- - !use chem_mods, only : nTracers + use chem_mods, only : gas_pcnst use mo_tracname, only : tracnam => solsym use string_utils, only : to_upper @@ -33,7 +33,7 @@ integer function get_spc_ndx( spc_name ) integer :: m get_spc_ndx = -1 - do m = 1, 306 + do m = 1, gas_pcnst if( trim( to_upper( spc_name ) ) == trim( to_upper( tracnam(m) ) ) ) then get_spc_ndx = m exit From 3f70b306d06c2f61d03f5854e00148da2a00b78f Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 25 Aug 2020 14:44:58 -0400 Subject: [PATCH 126/239] Feat: Reindexed GEOS-Chem species: tracers, MAM aerosols, SL species (1) This reindexing is necessary as MAM requires that there is a linear mapping (constant offset) between solsym and constituents. (2) adv_mass is now properly defined in mo_sim_dat, using GEOS-Chem values for all species, except MAM aerosols. Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chem_mods.F90 | 10 +- src/chemistry/pp_geoschem/mo_sim_dat.F90 | 312 ++++++++++++----------- 2 files changed, 176 insertions(+), 146 deletions(-) diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/pp_geoschem/chem_mods.F90 index 48b074912c..c26bcad8b4 100644 --- a/src/chemistry/pp_geoschem/chem_mods.F90 +++ b/src/chemistry/pp_geoschem/chem_mods.F90 @@ -11,7 +11,6 @@ module chem_mods INTEGER :: nTracers CHARACTER(LEN=255) :: tracerNames(nTracersMax) CHARACTER(LEN=255) :: tracerLongNames(nTracersMax) - REAL(r8) :: adv_Mass(nTracersMax) REAL(r8) :: MWRatio(nTracersMax) REAL(r8) :: ref_MMR(nTracersMax) @@ -25,6 +24,7 @@ module chem_mods ! Mapping between constituents and GEOS-Chem tracers INTEGER :: map2GC(pcnst) + INTEGER :: map2GCinv(nTracersMax) INTEGER :: map2GC_Sls(nSlsMax) ! Mapping from constituents to raw index @@ -60,7 +60,7 @@ module chem_mods rxntot = 212, & ! number of total reactions gascnt = 172, & ! number of gas phase reactions nabscol = 2, & ! number of absorbing column densities - gas_pcnst = 103, & ! number of "gas phase" species + gas_pcnst = 317, & ! number of "gas phase" species nfs = 6, & ! number of "fixed" species relcnt = 0, & ! number of relationship species grpcnt = 0, & ! number of group members @@ -82,7 +82,7 @@ module chem_mods integer :: clsmap(gas_pcnst,5) = 0 integer :: permute(gas_pcnst,5) = 0 integer :: diag_map(clscnt4) = 0 - !real(r8) :: adv_mass(gas_pcnst) = 0._r8 + real(r8) :: adv_mass(gas_pcnst) = 0._r8 real(r8) :: crb_mass(gas_pcnst) = 0._r8 real(r8) :: fix_mass(max(1,nfs)) real(r8), allocatable :: cph_enthalpy(:) @@ -101,4 +101,8 @@ module chem_mods integer :: nslvd character(len=255), allocatable :: slvd_lst(:) real(r8), allocatable :: slvd_ref_mmr(:) + + ! Mapping between constituents and solsym + INTEGER :: map2chm(gas_pcnst) + end module chem_mods diff --git a/src/chemistry/pp_geoschem/mo_sim_dat.F90 b/src/chemistry/pp_geoschem/mo_sim_dat.F90 index f292e406a4..2c72fd73e4 100644 --- a/src/chemistry/pp_geoschem/mo_sim_dat.F90 +++ b/src/chemistry/pp_geoschem/mo_sim_dat.F90 @@ -36,101 +36,78 @@ subroutine set_sim_dat ! cls_rxt_cnt(:,1) = (/ 37, 61, 0, 30 /) ! cls_rxt_cnt(:,4) = (/ 23, 174, 326, 191 /) - solsym(:317) = (/ 'CH2I2 ','CH2IBr ','CH2ICl ', & - 'AERI ','CO2 ','INDIOL ', & - 'ISALA ','ISALC ','LBRO2H ', & - 'LBRO2N ','LISOPOH ','LISOPNO3 ', & - 'LTRO2H ','LTRO2N ','LVOCOA ', & - 'LVOC ','LXRO2H ','LXRO2N ', & - 'MSA ','SO4H1 ','SO4H2 ', & - 'SO4H3 ','SO4H4 ','SOAGX ', & - 'SOAIE ','POx ','LOx ', & - 'PCO ','LCO ','PSO4 ', & - 'LCH4 ','PH2O2 ','I2O4 ', & - 'NIT ','NITs ','CH3CCl3 ', & - 'I2O2 ','MONITA ','BENZ ', & - 'CH3I ','H1301 ','H2402 ', & - 'I2O3 ','PPN ','TOLU ', & - 'BrNO2 ','CCl4 ','CFC11 ', & - 'CFC12 ','CFC113 ','CFC114 ', & - 'CFC115 ','H1211 ','INO ', & - 'BRO2 ','N2O ','TRO2 ', & - 'N ','OCS ','PAN ', & - 'SO4 ','XRO2 ','HI ', & - 'MAP ','CHBr3 ','CHCl3 ', & - 'IBr ','MPN ','Cl2O2 ', & - 'CH2Br2 ','CH2Cl2 ','HCFC22 ', & - 'HMHP ','HMML ','IPRNO3 ', & - 'ETNO3 ','MENO3 ','NPRNO3 ', & - 'OIO ','R4P ','RA3P ', & - 'RB3P ','RP ','XYLE ', & - 'HCFC123 ','DMS ','HCFC141b ', & - 'HCFC142b ','IONITA ','CH3Br ', & - 'ICl ','CH3Cl ','PYAC ', & - 'HNO4 ','ClOO ','IDC ', & - 'OClO ','ETP ','PP ', & - 'PRPN ','ALK4 ','IEPOXD ', & - 'HPALD2OO ','MVKDH ','PIP ', & - 'HPALD1OO ','C3H8 ','INA ', & - 'HPALD4 ','Br2 ','HPALD3 ', & - 'IDCHP ','IEPOXA ','IEPOXB ', & - 'MCRDH ','EOH ','HONIT ', & - 'BrCl ','MACR1OOH ','MP ', & - 'IHN3 ','IHN2 ','I2 ', & - 'SO2 ','IDHDP ','C4HVP1 ', & - 'C4HVP2 ','IDNOO ','ICNOO ', & - 'INPD ','ISOPNOO2 ','MPAN ', & - 'MTPA ','MTPO ','MVKPC ', & - 'RIPA ','ROH ','C2H6 ', & - 'RIPB ','MCRENOL ','IDHPE ', & - 'RIPD ','HNO2 ','ISOPNOO1 ', & - 'IDHNDOO1 ','IDHNDOO2 ','LIMO ', & - 'MVKHC ','RIPC ','HPETHNL ', & - 'N2O5 ','ICHE ','MCRHNB ', & - 'H ','BrNO3 ','MONITS ', & - 'INPB ','IHPOO2 ','IHPOO1 ', & - 'MVKHCB ','IHPOO3 ','CH4 ', & - 'IHPNDOO ','HPALD1 ','HPALD2 ', & - 'HC5A ','H2O2 ','ICHOO ', & - 'Cl2 ','ATOOH ','PROPNN ', & - 'MCRHN ','MONITU ','R4N1 ', & - 'PRN1 ','IONO ','MVKOHOO ', & - 'MCROHOO ','ICPDH ','MACR1OO ', & - 'ETHLN ','PO2 ','ACTA ', & - 'HCOOH ','GLYX ','IHN4 ', & - 'ITCN ','ACET ','OLNN ', & - 'OLND ','ETO2 ','MOH ', & - 'IHN1 ','IHPNBOO ','RCO3 ', & - 'HOI ','ISOP ','LIMO2 ', & - 'KO2 ','IONO2 ','IEPOXAOO ', & - 'IEPOXBOO ','MCRHP ','MVKHP ', & - 'CH3CHOO ','PIO2 ','IDHNBOO ', & - 'MGLY ','A3O2 ','GLYC ', & - 'HNO3 ','HOCl ','ClNO2 ', & - 'ICN ','MVKN ','ITHN ', & - 'IDN ','IHOO4 ','IHOO1 ', & - 'INO2D ','INO2B ','MACR ', & - 'MACRNO2 ','HAC ','MVK ', & - 'HOBr ','ATO2 ','MEK ', & - 'OTHRO2 ','R4N2 ','R4O2 ', & - 'B3O2 ','PRPE ','RCHO ', & - 'ClNO3 ','CH2OO ','MCO3 ', & - 'CO ','ALD2 ','I ', & - 'CH2O ','MO2 ','IO ', & - 'O1D ','SALACL ','BrO ', & - 'BrSALA ','BrSALC ','SALCCL ', & - 'O3 ','NO2 ','HCl ', & - 'Cl ','HBr ','ClO ', & - 'OH ','Br ','H2O ', & - 'HO2 ','NO3 ','O ', & - 'NO ','H2 ','N2 ', & - 'O2 ','RCOOH ','BCPI ', & - 'BCPO ','DST1 ','DST2 ', & - 'DST3 ','DST4 ','NH3 ', & - 'NH4 ','OCPI ','OCPO ', & - 'PFE ','SALA ','SALAAL ', & - 'SALC ','SALCAL ','SO4s ', & - 'SOAP ','SOAS ','bc_a1 ', & + ! GEOS-Chem tracers (advected species) are placed first along MAM + ! aerosols, as those will be constituents. MAM requires that there + ! is a linear mapping between solsym and constituents + + solsym(:317) = (/ 'ACET ','ACTA ','AERI ', & + 'ALD2 ','ALK4 ','ATOOH ', & + 'BCPI ','BCPO ','BENZ ', & + 'Br ','Br2 ','BrCl ', & + 'BrNO2 ','BrNO3 ','BrO ', & + 'BrSALA ','BrSALC ','C2H6 ', & + 'C3H8 ','CCl4 ','CFC11 ', & + 'CFC113 ','CFC114 ','CFC115 ', & + 'CFC12 ','CH2Br2 ','CH2Cl2 ', & + 'CH2I2 ','CH2IBr ','CH2ICl ', & + 'CH2O ','CH3Br ','CH3CCl3 ', & + 'CH3Cl ','CH3I ','CH4 ', & + 'CHBr3 ','CHCl3 ','Cl ', & + 'Cl2 ','Cl2O2 ','ClNO2 ', & + 'ClNO3 ','ClO ','ClOO ', & + 'CO ','DMS ','DST1 ', & + 'DST2 ','DST3 ','DST4 ', & + 'EOH ','ETHLN ','ETNO3 ', & + 'ETP ','GLYC ','GLYX ', & + 'H1211 ','H1301 ','H2402 ', & + 'H2O ','H2O2 ','HAC ', & + 'HBr ','HC5A ','HCFC123 ', & + 'HCFC141b ','HCFC142b ','HCFC22 ', & + 'HCl ','HCOOH ','HI ', & + 'HMHP ','HMML ','HNO2 ', & + 'HNO3 ','HNO4 ','HOBr ', & + 'HOCl ','HOI ','HONIT ', & + 'HPALD1 ','HPALD2 ','HPALD3 ', & + 'HPALD4 ','HPETHNL ','I ', & + 'I2 ','I2O2 ','I2O3 ', & + 'I2O4 ','IBr ','ICHE ', & + 'ICl ','ICN ','ICPDH ', & + 'IDC ','IDCHP ','IDHDP ', & + 'IDHPE ','IDN ','IEPOXA ', & + 'IEPOXB ','IEPOXD ','IHN1 ', & + 'IHN2 ','IHN3 ','IHN4 ', & + 'INDIOL ','INO ','INPB ', & + 'INPD ','IO ','IONITA ', & + 'IONO ','IONO2 ','IPRNO3 ', & + 'ISALA ','ISALC ','ISOP ', & + 'ITCN ','ITHN ','LIMO ', & + 'LVOC ','LVOCOA ','MACR ', & + 'MACR1OOH ','MAP ','MCRDH ', & + 'MCRENOL ','MCRHN ','MCRHNB ', & + 'MCRHP ','MEK ','MENO3 ', & + 'MGLY ','MOH ','MONITA ', & + 'MONITS ','MONITU ','MP ', & + 'MPAN ','MPN ','MSA ', & + 'MTPA ','MTPO ','MVK ', & + 'MVKDH ','MVKHC ','MVKHCB ', & + 'MVKHP ','MVKN ','MVKPC ', & + 'N2O ','N2O5 ','NH3 ', & + 'NH4 ','NIT ','NITs ', & + 'NO ','NO2 ','NO3 ', & + 'NPRNO3 ','O3 ','OClO ', & + 'OCPI ','OCPO ','OCS ', & + 'OIO ','PAN ','PFE ', & + 'PIP ','PP ','PPN ', & + 'PROPNN ','PRPE ','PRPN ', & + 'PYAC ','R4N2 ','R4P ', & + 'RA3P ','RB3P ','RCHO ', & + 'RIPA ','RIPB ','RIPC ', & + 'RIPD ','RP ','SALA ', & + 'SALAAL ','SALACL ','SALC ', & + 'SALCAL ','SALCCL ','SO2 ', & + 'SO4 ','SO4s ','SOAGX ', & + 'SOAIE ','SOAP ','SOAS ', & + 'TOLU ','XYLE ','bc_a1 ', & 'bc_a4 ','dst_a1 ','dst_a2 ', & 'dst_a3 ','ncl_a1 ','ncl_a2 ', & 'ncl_a3 ','num_a1 ','num_a2 ', & @@ -141,57 +118,106 @@ subroutine set_sim_dat 'soa3_a2 ','soa4_a1 ','soa4_a2 ', & 'soa5_a1 ','soa5_a2 ','H2SO4 ', & 'SOAG0 ','SOAG1 ','SOAG2 ', & - 'SOAG3 ','SOAG4 ' /) + 'SOAG3 ','SOAG4 ','CO2 ', & + 'LBRO2H ','LBRO2N ','LISOPOH ', & + 'LISOPNO3 ','LTRO2H ','LTRO2N ', & + 'LXRO2H ','LXRO2N ','SO4H1 ', & + 'SO4H2 ','SO4H3 ','SO4H4 ', & + 'POx ','LOx ','PCO ', & + 'LCO ','PSO4 ','LCH4 ', & + 'PH2O2 ','BRO2 ','TRO2 ', & + 'N ','XRO2 ','HPALD2OO ', & + 'HPALD1OO ','INA ','C4HVP1 ', & + 'C4HVP2 ','IDNOO ','ICNOO ', & + 'ISOPNOO2 ','ROH ','ISOPNOO1 ', & + 'IDHNDOO1 ','IDHNDOO2 ','H ', & + 'IHPOO2 ','IHPOO1 ','IHPOO3 ', & + 'IHPNDOO ','ICHOO ','R4N1 ', & + 'PRN1 ','MVKOHOO ','MCROHOO ', & + 'MACR1OO ','PO2 ','OLNN ', & + 'OLND ','ETO2 ','IHPNBOO ', & + 'RCO3 ','LIMO2 ','KO2 ', & + 'IEPOXAOO ','IEPOXBOO ','CH3CHOO ', & + 'PIO2 ','IDHNBOO ','A3O2 ', & + 'IHOO4 ','IHOO1 ','INO2D ', & + 'INO2B ','MACRNO2 ','ATO2 ', & + 'OTHRO2 ','R4O2 ','B3O2 ', & + 'CH2OO ','MCO3 ','MO2 ', & + 'O1D ','OH ','HO2 ', & + 'O ','H2 ','N2 ', & + 'O2 ','RCOOH ' /) - inv_lst(: 6) = (/ 'M ', 'N2 ', 'O2 ', & - 'H2 ', 'MOH ', 'RCOOH ' /) + inv_lst(: 6) = (/ 'M ', 'N2 ', 'O2 ', & + 'H2 ', 'MOH ', 'RCOOH ' /) - ! adv_mass(:221) = (/ 133.141340_r8, 104.142600_r8, 28.010400_r8, 12.011000_r8, 12.011000_r8, & - ! 204.342600_r8, 78.110400_r8, 160.122200_r8, 126.108600_r8, 98.098200_r8, & - ! 84.072400_r8, 98.098200_r8, 98.098200_r8, 112.124000_r8, 72.143800_r8, & - ! 56.103200_r8, 79.904000_r8, 115.356700_r8, 95.903400_r8, 141.908940_r8, & - ! 99.716850_r8, 106.120800_r8, 124.135000_r8, 26.036800_r8, 28.051600_r8, & - ! 46.065800_r8, 62.065200_r8, 30.066400_r8, 42.077400_r8, 76.091000_r8, & - ! 44.092200_r8, 110.109200_r8, 153.821800_r8, 165.364506_r8, 148.910210_r8, & - ! 137.367503_r8, 187.375310_r8, 170.921013_r8, 154.466716_r8, 120.913206_r8, & - ! 173.833800_r8, 30.025200_r8, 94.937200_r8, 133.402300_r8, 44.051000_r8, & - ! 50.485900_r8, 41.050940_r8, 58.076800_r8, 72.061400_r8, 60.050400_r8, & - ! 76.049800_r8, 32.040000_r8, 48.039400_r8, 16.040600_r8, 252.730400_r8, & - ! 35.452700_r8, 70.905400_r8, 102.904200_r8, 51.452100_r8, 97.457640_r8, & - ! 100.916850_r8, 28.010400_r8, 44.009800_r8, 66.007206_r8, 82.461503_r8, & - ! 108.135600_r8, 62.132400_r8, 135.064039_r8, 135.064039_r8, 135.064039_r8, & - ! 28.010400_r8, 78.064600_r8, 18.998403_r8, 60.050400_r8, 58.035600_r8, & - ! 1.007400_r8, 2.014800_r8, 259.823613_r8, 34.013600_r8, 98.078400_r8, & - ! 80.911400_r8, 116.948003_r8, 100.493706_r8, 86.467906_r8, 36.460100_r8, & - ! 27.025140_r8, 46.024600_r8, 20.005803_r8, 63.012340_r8, 79.011740_r8, & - ! 96.910800_r8, 52.459500_r8, 135.114940_r8, 116.112400_r8, 74.076200_r8, & - ! 100.113000_r8, 118.127200_r8, 68.114200_r8, 147.125940_r8, 147.125940_r8, & - ! 162.117940_r8, 163.125340_r8, 118.127200_r8, 184.350200_r8, 70.087800_r8, & - ! 120.100800_r8, 72.102600_r8, 104.101400_r8, 147.084740_r8, 136.228400_r8, & - ! 70.087800_r8, 14.006740_r8, 44.012880_r8, 108.010480_r8, 147.125940_r8, & - ! 145.111140_r8, 58.442468_r8, 58.442468_r8, 58.442468_r8, 17.028940_r8, & - ! 18.036340_r8, 28.010400_r8, 28.010400_r8, 30.006140_r8, 46.005540_r8, & - ! 62.004940_r8, 119.074340_r8, 231.239540_r8, 1.007400_r8, 1.007400_r8, & - ! 1.007400_r8, 1.007400_r8, 15.999400_r8, 47.998200_r8, 67.451500_r8, & - ! 60.076400_r8, 133.100140_r8, 121.047940_r8, 183.117740_r8, 93.102400_r8, & - ! 94.109800_r8, 176.121600_r8, 12.011000_r8, 12.011000_r8, 92.090400_r8, & - ! 90.075600_r8, 32.066000_r8, 146.056419_r8, 48.065400_r8, 64.064800_r8, & - ! 80.064200_r8, 115.107340_r8, 115.107340_r8, 115.107340_r8, 250.445000_r8, & - ! 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & - ! 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & - ! 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 28.010400_r8, & - ! 310.582400_r8, 140.134400_r8, 186.241400_r8, 215.240140_r8, 186.241400_r8, & - ! 168.227200_r8, 154.201400_r8, 174.148000_r8, 92.136200_r8, 150.126000_r8, & - ! 106.162000_r8, 188.173800_r8, 122.161400_r8, 204.173200_r8, 14.006740_r8, & - ! 14.006740_r8, 137.112200_r8, 103.135200_r8, 159.114800_r8, 123.127600_r8, & - ! 61.057800_r8, 75.083600_r8, 109.101800_r8, 75.042400_r8, 47.032000_r8, & - ! 129.089600_r8, 105.108800_r8, 61.057800_r8, 77.057200_r8, 33.006200_r8, & - ! 63.031400_r8, 117.119800_r8, 117.119800_r8, 119.093400_r8, 115.063800_r8, & - ! 101.079200_r8, 117.078600_r8, 103.094000_r8, 230.232140_r8, 15.999400_r8, & - ! 17.006800_r8, 175.114200_r8, 91.083000_r8, 89.068200_r8, 199.218600_r8, & - ! 185.234000_r8, 173.140600_r8, 149.118600_r8, 187.166400_r8, 203.165800_r8, & - ! 18.014200_r8 /) + fix_mass(: 6) = (/ 0.00000000_r8, 28.0134800_r8, 31.9988000_r8, 2.020000_r8, 32.050000_r8, & + 74.090000_r8 /) + adv_mass(:317) = (/ 58.090000_r8, 60.060000_r8, 126.900000_r8, 44.060000_r8, 58.120000_r8, & + 90.090000_r8, 12.010000_r8, 12.010000_r8, 78.120000_r8, 79.900000_r8, & + 159.800000_r8, 115.450000_r8, 125.910000_r8, 141.910000_r8, 95.900000_r8, & + 79.900000_r8, 79.900000_r8, 30.080000_r8, 44.110000_r8, 153.820000_r8, & + 137.370000_r8, 187.380000_r8, 170.920000_r8, 154.470000_r8, 120.910000_r8, & + 173.830000_r8, 84.930000_r8, 267.840000_r8, 220.840000_r8, 176.380000_r8, & + 30.030000_r8, 94.940000_r8, 133.350000_r8, 50.450000_r8, 141.940000_r8, & + 16.050000_r8, 252.730000_r8, 119.350000_r8, 35.450000_r8, 70.900000_r8, & + 102.910000_r8, 81.450000_r8, 97.450000_r8, 51.450000_r8, 67.450000_r8, & + 28.010000_r8, 62.130000_r8, 29.000000_r8, 29.000000_r8, 29.000000_r8, & + 29.000000_r8, 46.080000_r8, 105.060000_r8, 91.080000_r8, 62.080000_r8, & + 60.060000_r8, 58.040000_r8, 165.360000_r8, 148.910000_r8, 259.820000_r8, & + 18.020000_r8, 34.020000_r8, 74.080000_r8, 80.910000_r8, 100.130000_r8, & + 152.930000_r8, 116.940000_r8, 100.500000_r8, 86.470000_r8, 36.450000_r8, & + 46.030000_r8, 127.910000_r8, 64.050000_r8, 102.100000_r8, 47.010000_r8, & + 63.010000_r8, 79.010000_r8, 96.910000_r8, 52.450000_r8, 143.890000_r8, & + 215.000000_r8, 116.130000_r8, 116.130000_r8, 116.130000_r8, 116.130000_r8, & + 76.060000_r8, 126.900000_r8, 253.800000_r8, 285.800000_r8, 301.800000_r8, & + 317.800000_r8, 206.900000_r8, 116.130000_r8, 162.450000_r8, 145.130000_r8, & + 150.150000_r8, 98.110000_r8, 148.130000_r8, 168.170000_r8, 150.150000_r8, & + 192.150000_r8, 106.140000_r8, 106.140000_r8, 106.140000_r8, 147.150000_r8, & + 147.150000_r8, 147.150000_r8, 147.150000_r8, 102.000000_r8, 156.910000_r8, & + 163.150000_r8, 163.150000_r8, 142.900000_r8, 14.010000_r8, 172.910000_r8, & + 188.910000_r8, 105.110000_r8, 126.900000_r8, 126.900000_r8, 68.130000_r8, & + 195.150000_r8, 197.170000_r8, 136.260000_r8, 154.190000_r8, 154.190000_r8, & + 70.100000_r8, 102.100000_r8, 76.060000_r8, 104.120000_r8, 86.100000_r8, & + 149.110000_r8, 149.110000_r8, 120.120000_r8, 72.110000_r8, 77.050000_r8, & + 72.070000_r8, 32.050000_r8, 14.010000_r8, 215.280000_r8, 215.280000_r8, & + 48.050000_r8, 147.100000_r8, 93.050000_r8, 96.100000_r8, 136.260000_r8, & + 136.260000_r8, 70.090000_r8, 105.130000_r8, 102.100000_r8, 102.100000_r8, & + 120.120000_r8, 149.120000_r8, 118.100000_r8, 44.020000_r8, 108.020000_r8, & + 17.040000_r8, 18.050000_r8, 62.010000_r8, 31.400000_r8, 30.010000_r8, & + 46.010000_r8, 62.010000_r8, 105.110000_r8, 48.000000_r8, 67.450000_r8, & + 12.010000_r8, 12.010000_r8, 60.070000_r8, 158.900000_r8, 121.060000_r8, & + -1.000000_r8, 186.280000_r8, 92.110000_r8, 135.080000_r8, 119.080000_r8, & + 42.090000_r8, 137.110000_r8, 88.070000_r8, 119.100000_r8, 90.140000_r8, & + 76.110000_r8, 76.110000_r8, 58.090000_r8, 118.150000_r8, 118.150000_r8, & + 118.150000_r8, 118.150000_r8, 90.090000_r8, 31.400000_r8, 31.400000_r8, & + 35.450000_r8, 31.400000_r8, 31.400000_r8, 35.450000_r8, 64.040000_r8, & + 96.060000_r8, 31.400000_r8, 58.040000_r8, 118.150000_r8, 150.000000_r8, & + 150.000000_r8, 92.150000_r8, 106.180000_r8, 12.011000_r8, 12.011000_r8, & + 135.064039_r8, 135.064039_r8, 135.064039_r8, 58.442468_r8, 58.442468_r8, & + 58.442468_r8, 1.007400_r8, 1.007400_r8, 1.007400_r8, 1.007400_r8, & + 12.011000_r8, 12.011000_r8, 115.107340_r8, 115.107340_r8, 115.107340_r8, & + 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & + 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & + 98.078400_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & + 250.445000_r8, 44.010000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, & + -1.000000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, & + 96.060000_r8, 96.060000_r8, 96.060000_r8, 96.060000_r8, -1.000000_r8, & + -1.000000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, & + -1.000000_r8, 159.130000_r8, 173.160000_r8, 14.010000_r8, 187.190000_r8, & + 147.120000_r8, 147.120000_r8, 146.140000_r8, 103.110000_r8, 103.110000_r8, & + 241.140000_r8, 194.140000_r8, 196.160000_r8, 60.110000_r8, 196.160000_r8, & + 196.160000_r8, 196.160000_r8, 1.010000_r8, 167.160000_r8, 167.160000_r8, & + 167.160000_r8, 212.160000_r8, 149.140000_r8, 150.130000_r8, 136.090000_r8, & + 119.110000_r8, 119.110000_r8, 101.090000_r8, 91.100000_r8, 230.270000_r8, & + 230.270000_r8, 61.070000_r8, 212.160000_r8, 89.080000_r8, 185.270000_r8, & + 101.090000_r8, 149.140000_r8, 149.140000_r8, 60.060000_r8, 185.270000_r8, & + 196.160000_r8, 75.100000_r8, 117.140000_r8, 117.140000_r8, 162.140000_r8, & + 162.140000_r8, 180.100000_r8, 89.080000_r8, 61.070000_r8, 89.130000_r8, & + 75.100000_r8, 46.030000_r8, 75.050000_r8, 47.040000_r8, 16.000000_r8, & + 17.010000_r8, 33.010000_r8, 16.000000_r8, 2.020000_r8, 28.020000_r8, & + 32.000000_r8, 74.090000_r8 /) + ! crb_mass(:221) = (/ 60.055000_r8, 60.055000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & ! 180.165000_r8, 72.066000_r8, 72.066000_r8, 72.066000_r8, 60.055000_r8, & ! 48.044000_r8, 60.055000_r8, 60.055000_r8, 72.066000_r8, 60.055000_r8, & From a8d642c0949ad6727822181279cd54d65f2865fb Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 2 Sep 2020 11:48:59 -0400 Subject: [PATCH 127/239] Feat: Add runtime option to using GEOS-Chem wet deposition Signed-off-by: Thibaud Fritz --- bld/namelist_files/namelist_definition.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 34256e1f88..f1b90d8969 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -4736,11 +4736,12 @@ radiatively passive. Default: FALSE - + Wet deposition method used MOZ --> mozart scheme is used NEU --> J Neu's scheme is used + GEOS-CHEM --> GEOS-Chem scheme is used (only when GEOS-Chem chemistry is used) OFF --> wet deposition is turned off Default: NEU except for SPCAM runs From 4e1e83f93572ca4359e48e4a13e76fce59242ffb Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 2 Sep 2020 11:54:54 -0400 Subject: [PATCH 128/239] Feat: Add files to allow for NEU wet deposition scheme (1) Add mo_neu_wetdep (copied from MOZART) (2) Add additional files (mo_mean_mass, mo_setinv, gas_wetdep_opts) (3) Add new field in mo_neu_wetdep (WDRATE), corresponding to the wet removal rate in kg/s Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/gas_wetdep_opts.F90 | 79 + src/chemistry/pp_geoschem/mo_mean_mass.F90 | 94 + src/chemistry/pp_geoschem/mo_neu_wetdep.F90 | 1776 +++++++++++++++++ src/chemistry/pp_geoschem/mo_setinv.F90 | 153 ++ src/chemistry/pp_geoschem/tracer_cnst.F90 | 371 ++++ 5 files changed, 2473 insertions(+) create mode 100644 src/chemistry/pp_geoschem/gas_wetdep_opts.F90 create mode 100644 src/chemistry/pp_geoschem/mo_mean_mass.F90 create mode 100644 src/chemistry/pp_geoschem/mo_neu_wetdep.F90 create mode 100644 src/chemistry/pp_geoschem/mo_setinv.F90 create mode 100644 src/chemistry/pp_geoschem/tracer_cnst.F90 diff --git a/src/chemistry/pp_geoschem/gas_wetdep_opts.F90 b/src/chemistry/pp_geoschem/gas_wetdep_opts.F90 new file mode 100644 index 0000000000..908e352239 --- /dev/null +++ b/src/chemistry/pp_geoschem/gas_wetdep_opts.F90 @@ -0,0 +1,79 @@ +!----------------------------------------------------------------------- +! Reads namelist options for gas-phase wet deposition +! +! Created by Francis Vitt -- 22 Apr 2011 +!----------------------------------------------------------------------- +module gas_wetdep_opts + + use constituents, only : pcnst + use cam_logfile, only : iulog + use constituents, only : pcnst + use spmd_utils, only : masterproc + use cam_abortutils, only : endrun + + implicit none + + character(len=16), protected :: gas_wetdep_list(pcnst) = ' ' + character(len=9), protected :: gas_wetdep_method = 'MOZ' + integer, protected :: gas_wetdep_cnt = 0 + +contains + + !----------------------------------------------------------------------- + !----------------------------------------------------------------------- + + subroutine gas_wetdep_readnl(nlfile) + + use cam_abortutils, only: endrun + use namelist_utils, only: find_group_name + use units, only: getunit, freeunit +#ifdef SPMD + use mpishorthand, only: mpichar, mpicom +#endif + + implicit none + + character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input + + integer :: unitn, i, ierr + + namelist /wetdep_inparm/ gas_wetdep_list + namelist /wetdep_inparm/ gas_wetdep_method + + if (masterproc) then + unitn = getunit() + open( unitn, file=trim(nlfile), status='old' ) + call find_group_name(unitn, 'wetdep_inparm', status=ierr) + if (ierr == 0) then + read(unitn, wetdep_inparm, iostat=ierr) + if (ierr /= 0) then + call endrun('mo_neu_wetdep->wetdep_readnl: ERROR reading wetdep_inparm namelist') + end if + end if + close(unitn) + call freeunit(unitn) + end if + +#ifdef SPMD + call mpibcast (gas_wetdep_list, len(gas_wetdep_list(1))*pcnst, mpichar, 0, mpicom) + call mpibcast (gas_wetdep_method, len(gas_wetdep_method), mpichar, 0, mpicom) +#endif + + gas_wetdep_cnt = 0 + do i = 1,pcnst + if ( len_trim(gas_wetdep_list(i)) > 0 ) then + gas_wetdep_cnt = gas_wetdep_cnt + 1 + endif + enddo + + if (( gas_wetdep_cnt>0 ).and. & + ( .not.(gas_wetdep_method=='MOZ' .or. & + gas_wetdep_method=='NEU' .or. & + gas_wetdep_method=='GEOS-CHEM' .or. & + gas_wetdep_method=='OFF') )) then + call endrun('gas_wetdep_readnl; gas_wetdep_method must be set to either MOZ, NEU or GEOS-CHEM') + endif + + end subroutine gas_wetdep_readnl + +end module gas_wetdep_opts diff --git a/src/chemistry/pp_geoschem/mo_mean_mass.F90 b/src/chemistry/pp_geoschem/mo_mean_mass.F90 new file mode 100644 index 0000000000..8bf030ce02 --- /dev/null +++ b/src/chemistry/pp_geoschem/mo_mean_mass.F90 @@ -0,0 +1,94 @@ + +module mo_mean_mass + + implicit none + + private + public :: set_mean_mass, init_mean_mass + + integer :: id_o2, id_o, id_h, id_n + +contains + + subroutine init_mean_mass + use mo_chem_utls, only : get_spc_ndx + + implicit none + + id_o2 = get_spc_ndx('O2') + id_o = get_spc_ndx('O') + id_h = get_spc_ndx('H') + id_n = get_spc_ndx('N') + + endsubroutine init_mean_mass + + subroutine set_mean_mass( ncol, mmr, mbar ) + !----------------------------------------------------------------- + ! ... Set the invariant densities (molecules/cm**3) + !----------------------------------------------------------------- + + use shr_kind_mod, only : r8 => shr_kind_r8 + use ppgrid, only : pver, pcols + use chem_mods, only : adv_mass, gas_pcnst + use physconst, only : mwdry ! molecular weight of dry air + use cam_abortutils, only : endrun + use phys_control, only : waccmx_is !WACCM-X runtime switch + + implicit none + + !----------------------------------------------------------------- + ! ... Dummy arguments + !----------------------------------------------------------------- + integer, intent(in) :: ncol + real(r8), intent(in) :: mmr(:,:,:) ! species concentrations (kg/kg) + real(r8), intent(out) :: mbar(:,:) ! mean mass (g/mole) + + !----------------------------------------------------------------- + ! ... Local variables + !----------------------------------------------------------------- + integer :: k + real(r8) :: xn2(ncol) ! n2 mmr + real(r8) :: fn2(ncol) ! n2 vmr + real(r8) :: fo(ncol) ! o vmr + real(r8) :: fo2(ncol) ! o2 vmr + real(r8) :: fh(ncol) ! h vmr + real(r8) :: ftot(ncol) ! total vmr + real(r8) :: mean_mass(ncol) ! wrk variable + + logical :: fixed_mbar ! Fixed mean mass flag + + !------------------------------------------- + ! Mean mass not fixed for WACCM-X + !------------------------------------------- + if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then + fixed_mbar = .false. + else + fixed_mbar = .true. + endif + + if( fixed_mbar ) then + !----------------------------------------------------------------- + ! ... use CAM meam molecular weight + !----------------------------------------------------------------- + mbar(:ncol,:pver) = mwdry + else + if ( id_o2 > 0 .and. id_o > 0 .and. id_h > 0 .and. id_n > 0 ) then + !----------------------------------------------------------------- + ! ... set the mean mass + !----------------------------------------------------------------- + do k = 1,pver + xn2(:) = 1._r8 - (mmr(:ncol,k,id_o2) + mmr(:ncol,k,id_o) + mmr(:ncol,k,id_h)) + fn2(:) = .5_r8 * xn2(:) / adv_mass(id_n) + fo2(:) = mmr(:ncol,k,id_o2) / adv_mass(id_o2) + fo(:) = mmr(:ncol,k,id_o) / adv_mass(id_o) + fh(:) = mmr(:ncol,k,id_h) / adv_mass(id_h) + mbar(:ncol,k) = 1._r8 / (fn2(:) + fo2(:) + fo(:) + fh(:)) + end do + else + call endrun('set_mean_mass: not able to compute mean mass') + endif + endif + + end subroutine set_mean_mass + +end module mo_mean_mass diff --git a/src/chemistry/pp_geoschem/mo_neu_wetdep.F90 b/src/chemistry/pp_geoschem/mo_neu_wetdep.F90 new file mode 100644 index 0000000000..26689dfd60 --- /dev/null +++ b/src/chemistry/pp_geoschem/mo_neu_wetdep.F90 @@ -0,0 +1,1776 @@ +! +! code written by J.-F. Lamarque, S. Walters and F. Vitt +! based on the original code from J. Neu developed for UC Irvine +! model +! +! LKE 2/23/2018 - correct setting flag for mass-limited (HNO3,etc.) vs Henry's Law washout +! +module mo_neu_wetdep +! + use shr_kind_mod, only : r8 => shr_kind_r8 + use cam_logfile, only : iulog + use constituents, only : pcnst + use spmd_utils, only : masterproc + use cam_abortutils, only : endrun + use seq_drydep_mod, only : n_species_table, species_name_table, dheff + use gas_wetdep_opts, only : gas_wetdep_method, gas_wetdep_list, gas_wetdep_cnt +! + implicit none +! + private + public :: neu_wetdep_init + public :: neu_wetdep_tend +! + save +! + integer, allocatable, dimension(:) :: mapping_to_heff,mapping_to_mmr + real(r8),allocatable, dimension(:) :: mol_weight + logical ,allocatable, dimension(:) :: ice_uptake + integer :: index_cldice,index_cldliq,nh3_ndx,co2_ndx + logical :: debug = .false. + integer :: hno3_ndx = 0 + integer :: h2o2_ndx = 0 +! +! diagnostics +! + logical :: do_diag = .false. + integer, parameter :: kdiag = 18 +! + real(r8), parameter :: zero = 0._r8 + real(r8), parameter :: one = 1._r8 +! + logical :: do_neu_wetdep +! + real(r8), parameter :: TICE=263._r8 + +contains + +!----------------------------------------------------------------------- +!----------------------------------------------------------------------- +! +subroutine neu_wetdep_init +! + use constituents, only : cnst_get_ind,cnst_mw + use cam_history, only : addfld, add_default, horiz_only + use phys_control, only : phys_getopts +! + integer :: m,l + character*20 :: test_name + + logical :: history_chemistry + + call phys_getopts(history_chemistry_out=history_chemistry) + + do_neu_wetdep = gas_wetdep_method == 'NEU' .and. gas_wetdep_cnt>0 + + if (.not.do_neu_wetdep) return + + allocate( mapping_to_heff(gas_wetdep_cnt) ) + allocate( mapping_to_mmr(gas_wetdep_cnt) ) + allocate( ice_uptake(gas_wetdep_cnt) ) + allocate( mol_weight(gas_wetdep_cnt) ) + +! +! find mapping to heff table +! + if ( debug ) then + print '(a,i4)','gas_wetdep_cnt=',gas_wetdep_cnt + print '(a,i4)','n_species_table=',n_species_table + end if + mapping_to_heff = -99 + do m=1,gas_wetdep_cnt +! + test_name = gas_wetdep_list(m) + if ( debug ) print '(i4,a)',m,trim(test_name) +! +! mapping based on the MOZART4 wet removal subroutine; +! this might need to be redone (JFL: Sep 2010) +! + select case( trim(test_name) ) +! +! CCMI: added SO2t and NH_50W +! + case( 'HYAC', 'CH3COOH' , 'HCOOH', 'EOOH', 'IEPOX' ) + test_name = 'CH2O' + case ( 'SOGB','SOGI','SOGM','SOGT','SOGX' ) + test_name = 'H2O2' + case ( 'SO2t' ) + test_name = 'SO2' + case ( 'CLONO2','BRONO2','HCL','HOCL','HOBR','HBR', 'Pb', 'MACROOH', 'ISOPOOH', 'XOOH', 'H2SO4', 'HF', 'COF2', 'COFCL') + test_name = 'HNO3' + case ( 'NH_50W', 'NDEP', 'NHDEP', 'NH4', 'NH4NO3' ) + test_name = 'HNO3' + case ( 'ALKOOH', 'MEKOOH', 'TOLOOH' ) + test_name = 'CH3OOH' + case( 'PHENOOH', 'BENZOOH', 'C6H5OOH', 'BZOOH', 'XYLOLOOH', 'XYLENOOH', 'HPALD' ) + test_name = 'CH3OOH' + case( 'TERPOOH', 'TERP2OOH', 'MBOOOH' ) + test_name = 'HNO3' + case( 'TERPROD1', 'TERPROD2' ) + test_name = 'CH2O' + case( 'HMPROP' ) + test_name = 'GLYALD' + case( 'NOA', 'ALKNIT', 'ISOPNITA', 'ISOPNITB', 'HONITR', 'ISOPNOOH' ) + test_name = 'H2O2' + case( 'NC4CHO', 'NC4CH2OH', 'TERPNIT', 'NTERPOOH' ) + test_name = 'H2O2' + case( 'SOAGbb0' ) ! Henry's Law coeff. added for VBS SOA's, biomass burning is the same as fossil fuels + test_name = 'SOAGff0' + case( 'SOAGbb1' ) + test_name = 'SOAGff1' + case( 'SOAGbb2' ) + test_name = 'SOAGff2' + case( 'SOAGbb3' ) + test_name = 'SOAGff3' + case( 'SOAGbb4' ) + test_name = 'SOAGff4' + end select +! + do l = 1,n_species_table +! +! if ( debug ) print '(i4,a)',l,trim(species_name_table(l)) +! + if( trim(test_name) == trim( species_name_table(l) ) ) then + mapping_to_heff(m) = l + if ( debug ) print '(a,a,i4)','mapping to heff of ',trim(species_name_table(l)),l + exit + end if + end do + if ( mapping_to_heff(m) == -99 ) then + if (masterproc) print *,'problem with mapping_to_heff of ',trim(test_name) +! call endrun() + end if +! +! special cases for NH3 and CO2 +! + if ( trim(test_name) == 'NH3' ) then + nh3_ndx = m + end if + if ( trim(test_name) == 'CO2' ) then + co2_ndx = m + end if + if ( trim(gas_wetdep_list(m)) == 'HNO3' ) then + hno3_ndx = m + end if +! + end do + + if (any ( mapping_to_heff(:) == -99 )) call endrun('mo_neu_wet->depwetdep_init: unmapped species error' ) +! + if ( debug ) then + print '(a,i4)','co2_ndx',co2_ndx + print '(a,i4)','nh3_ndx',nh3_ndx + end if +! +! find mapping to species +! + mapping_to_mmr = -99 + do m=1,gas_wetdep_cnt + if ( debug ) print '(i4,a)',m,trim(gas_wetdep_list(m)) + call cnst_get_ind(gas_wetdep_list(m), mapping_to_mmr(m), abort=.false. ) + if ( debug ) print '(a,i4)','mapping_to_mmr ',mapping_to_mmr(m) + if ( mapping_to_mmr(m) <= 0 ) then + print *,'problem with mapping_to_mmr of ',gas_wetdep_list(m) + call endrun('problem with mapping_to_mmr of '//trim(gas_wetdep_list(m))) + end if + end do +! +! define species-dependent arrays +! + do m=1,gas_wetdep_cnt +! + mol_weight(m) = cnst_mw(mapping_to_mmr(m)) + if ( debug ) print '(i4,a,f8.4)',m,' mol_weight ',mol_weight(m) + ice_uptake(m) = .false. + if ( trim(gas_wetdep_list(m)) == 'HNO3' ) then + ice_uptake(m) = .true. + end if +! +! + end do +! +! indices for cloud quantities +! + call cnst_get_ind( 'CLDICE', index_cldice ) + call cnst_get_ind( 'CLDLIQ', index_cldliq ) +! +! define output +! + do m=1,gas_wetdep_cnt + call addfld ('DTWR_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','kg/kg/s','wet removal Neu scheme tendency') + call addfld ('WD_'//trim(gas_wetdep_list(m)),horiz_only, 'A','kg/m2/s','vertical integrated wet deposition flux') + call addfld ('WDRATE_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','kg/s','wet removal Neu scheme rate') + call addfld ('HEFF_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','M/atm','Effective Henrys Law coeff.') + if (history_chemistry) then + call add_default('DTWR_'//trim(gas_wetdep_list(m)), 1, ' ') + call add_default('WD_'//trim(gas_wetdep_list(m)), 1, ' ') + end if + end do +! + if ( do_diag ) then + call addfld ('QT_RAIN_HNO3',(/ 'lev' /), 'A','mol/mol/s','wet removal Neu scheme rain tendency') + call addfld ('QT_RIME_HNO3',(/ 'lev' /), 'A','mol/mol/s','wet removal Neu scheme rain tendency') + call addfld ('QT_WASH_HNO3',(/ 'lev' /), 'A','mol/mol/s','wet removal Neu scheme rain tendency') + call addfld ('QT_EVAP_HNO3',(/ 'lev' /), 'A','mol/mol/s','wet removal Neu scheme rain tendency') + if (history_chemistry) then + call add_default('QT_RAIN_HNO3',1,' ') + call add_default('QT_RIME_HNO3',1,' ') + call add_default('QT_WASH_HNO3',1,' ') + call add_default('QT_EVAP_HNO3',1,' ') + end if + end if +! + return +! +end subroutine neu_wetdep_init +! +subroutine neu_wetdep_tend(lchnk,ncol,mmr,pmid,pdel,zint,tfld,delt, & + prain, nevapr, cld, cmfdqr, wd_tend, wd_tend_int) +! + use ppgrid, only : pcols, pver +!!DEK + use phys_grid, only : get_area_all_p, get_rlat_all_p + use shr_const_mod, only : SHR_CONST_REARTH,SHR_CONST_G + use cam_history, only : outfld +! + implicit none +! + integer, intent(in) :: lchnk,ncol + real(r8), intent(in) :: mmr(pcols,pver,pcnst) ! mass mixing ratio (kg/kg) + real(r8), intent(in) :: pmid(pcols,pver) ! midpoint pressures (Pa) + real(r8), intent(in) :: pdel(pcols,pver) ! pressure delta about midpoints (Pa) + real(r8), intent(in) :: zint(pcols,pver+1) ! interface geopotential height above the surface (m) + real(r8), intent(in) :: tfld(pcols,pver) ! midpoint temperature (K) + real(r8), intent(in) :: delt ! timestep (s) +! + real(r8), intent(in) :: prain(ncol, pver) + real(r8), intent(in) :: nevapr(ncol, pver) + real(r8), intent(in) :: cld(ncol, pver) + real(r8), intent(in) :: cmfdqr(ncol, pver) + real(r8), intent(inout) :: wd_tend(pcols,pver,pcnst) + real(r8), intent(inout) :: wd_tend_int(pcols,pcnst) +! +! local arrays and variables +! + integer :: i,k,l,kk,m,id + real(r8), parameter :: rearth = SHR_CONST_REARTH ! radius earth (m) + real(r8), parameter :: gravit = SHR_CONST_G ! m/s^2 + real(r8), dimension(ncol) :: area, wk_out + real(r8), dimension(ncol,pver) :: cldice,cldliq,cldfrc,totprec,totevap,delz,delp,p + real(r8), dimension(ncol,pver) :: rls,evaprate,mass_in_layer,temp + real(r8), dimension(ncol,pver,gas_wetdep_cnt) :: trc_mass,heff,dtwr + real(r8), dimension(ncol,pver,gas_wetdep_cnt) :: wd_mmr + logical , dimension(gas_wetdep_cnt) :: tckaqb + integer , dimension(ncol) :: test_flag +! +! arrays for HNO3 diagnostics +! + real(r8), dimension(ncol,pver) :: qt_rain,qt_rime,qt_wash,qt_evap +! +! for Henry's law calculations +! + real(r8), parameter :: t0 = 298._r8 + real(r8), parameter :: ph = 1.e-5_r8 + real(r8), parameter :: ph_inv = 1._r8/ph + real(r8) :: e298, dhr + real(r8), dimension(ncol) :: dk1s,dk2s,wrk +!!DEK + real(r8) :: pi + real(r8) :: lats(pcols) +! +! from cam/src/physics/cam/stratiform.F90 +! +!!DEK + pi = 4._r8*atan(1.0_r8) + + if (.not.do_neu_wetdep) return +! +! don't do anything if there are no species to be removed +! + if ( gas_wetdep_cnt == 0 ) return +! +! reset output variables +! + wd_tend_int = 0._r8 +! +! get area (in radians square) +! + call get_area_all_p(lchnk, ncol, area) + area = area * rearth**2 ! in m^2 +! +! reverse order along the vertical before calling +! J. Neu's wet removal subroutine +! + do k=1,pver + kk = pver - k + 1 + do i=1,ncol +! + mass_in_layer(i,k) = area(i) * pdel(i,kk)/gravit ! kg +! + cldice (i,k) = mmr(i,kk,index_cldice) ! kg/kg + cldliq (i,k) = mmr(i,kk,index_cldliq) ! kg/kg + cldfrc (i,k) = cld(i,kk) ! unitless +! + totprec(i,k) = (prain(i,kk)+cmfdqr(i,kk)) & + * mass_in_layer(i,k) ! kg/s + totevap(i,k) = nevapr(i,kk) * mass_in_layer(i,k) ! kg/s +! + delz(i,k) = zint(i,kk) - zint(i,kk+1) ! in m +! + temp(i,k) = tfld(i,kk) +! +! convert tracer mass to kg to kg/kg +! + trc_mass(i,k,:) = mmr(i,kk,mapping_to_mmr(:)) * mass_in_layer(i,k) +! + delp(i,k) = pdel(i,kk) * 0.01_r8 ! in hPa + p (i,k) = pmid(i,kk) * 0.01_r8 ! in hPa +! + end do + end do +! +! define array for tendency calculation (on model grid) +! + dtwr(1:ncol,:,:) = mmr(1:ncol,:,mapping_to_mmr(:)) +! +! compute 1) integrated precipitation flux across the interfaces (rls) +! 2) evaporation rate +! + rls (:,pver) = 0._r8 + evaprate (:,pver) = 0._r8 + do k=pver-1,1,-1 + rls (:,k) = max(0._r8,totprec(:,k)-totevap(:,k)+rls(:,k+1)) + !evaprate(:,k) = min(1._r8,totevap(:,k)/(rls(:,k+1)+totprec(:,k)+1.e-36_r8)) + evaprate(:,k) = min(1._r8,totevap(:,k)/(rls(:,k+1)+1.e-36_r8)) + end do +! +! compute effective Henry's law coefficients +! code taken from models/drv/shr/seq_drydep_mod.F90 +! + heff = 0._r8 + do k=1,pver +! + kk = pver - k + 1 +! + wrk(:) = (t0-tfld(1:ncol,kk))/(t0*tfld(1:ncol,kk)) +! + do m=1,gas_wetdep_cnt +! + l = mapping_to_heff(m) + id = 6*(l - 1) + e298 = dheff(id+1) + dhr = dheff(id+2) + heff(:,k,m) = e298*exp( dhr*wrk(:) ) + test_flag = -99 + if( dheff(id+3) /= 0._r8 .and. dheff(id+5) == 0._r8 ) then + e298 = dheff(id+3) + dhr = dheff(id+4) + dk1s(:) = e298*exp( dhr*wrk(:) ) + where( heff(:,k,m) /= 0._r8 ) + heff(:,k,m) = heff(:,k,m)*(1._r8 + dk1s(:)*ph_inv) + elsewhere + test_flag = 1 + heff(:,k,m) = dk1s(:)*ph_inv + endwhere + end if +! + if (k.eq.1 .and. maxval(test_flag) > 0 .and. debug ) print '(a,i4)','heff for m=',m +! + if( dheff(id+5) /= 0._r8 ) then + if( nh3_ndx > 0 .or. co2_ndx > 0 ) then + e298 = dheff(id+3) + dhr = dheff(id+4) + dk1s(:) = e298*exp( dhr*wrk(:) ) + e298 = dheff(id+5) + dhr = dheff(id+6) + dk2s(:) = e298*exp( dhr*wrk(:) ) + if( m == co2_ndx ) then + heff(:,k,m) = heff(:,k,m)*(1._r8 + dk1s(:)*ph_inv)*(1._r8 + dk2s(:)*ph_inv) + else if( m == nh3_ndx ) then + heff(:,k,m) = heff(:,k,m)*(1._r8 + dk1s(:)*ph/dk2s(:)) + else + write(iulog,*) 'error in assigning henrys law coefficients' + write(iulog,*) 'species ',m + end if + end if + end if +! + end do + end do +! + if ( debug ) then + print '(a,50f8.2)','tckaqb ',tckaqb + print '(a,50e12.4)','heff ',heff(1,1,:) + print '(a,50i4)' ,'ice_uptake ',ice_uptake + print '(a,50f8.2)','mol_weight ',mol_weight(:) + print '(a,50f8.2)','temp ',temp(1,:) + print '(a,50f8.2)','p ',p (1,:) + end if +! +! call J. Neu's subroutine +! + do i=1,ncol +! + call washo(pver,gas_wetdep_cnt,delt,trc_mass(i,:,:),mass_in_layer(i,:),p(i,:),delz(i,:) & + ,rls(i,:),cldliq(i,:),cldice(i,:),cldfrc(i,:),temp(i,:),evaprate(i,:) & + ,area(i),heff(i,:,:),mol_weight(:),tckaqb(:),ice_uptake(:) & + ,qt_rain(i,:),qt_rime(i,:),qt_wash(i,:),qt_evap(i,:) ) +! + end do +! +! compute tendencies and convert back to mmr +! on original vertical grid +! + do k=1,pver + kk = pver - k + 1 + do i=1,ncol +! +! convert tracer mass from kg +! + wd_mmr(i,kk,:) = trc_mass(i,k,:) / mass_in_layer(i,k) +! + end do + end do +! +! tendency calculation (on model grid) +! + dtwr(1:ncol,:,:) = wd_mmr(1:ncol,:,:) - dtwr(1:ncol,:,:) + dtwr(1:ncol,:,:) = dtwr(1:ncol,:,:) / delt + +!!DEK polarward of 60S, 60N and <200hPa set to zero! + call get_rlat_all_p(lchnk, pcols, lats ) + do k = 1, pver + do i= 1, ncol + if ( abs( lats(i)*180._r8/pi ) > 60._r8 ) then + if ( pmid(i,k) < 20000._r8) then + dtwr(i,k,:) = 0._r8 + endif + endif + end do + end do +! +! output tendencies +! + do m=1,gas_wetdep_cnt + wd_tend(1:ncol,:,mapping_to_mmr(m)) = wd_tend(1:ncol,:,mapping_to_mmr(m)) + dtwr(1:ncol,:,m) + call outfld( 'DTWR_'//trim(gas_wetdep_list(m)),dtwr(:,:,m),ncol,lchnk ) + + call outfld( 'HEFF_'//trim(gas_wetdep_list(m)),heff(:,pver:1:-1,m),ncol,lchnk ) +! +! vertical integrated wet deposition rate [kg/m2/s] +! + wk_out = 0._r8 + do k=1,pver + kk = pver - k + 1 + wk_out(1:ncol) = wk_out(1:ncol) + (dtwr(1:ncol,k,m) * mass_in_layer(1:ncol,kk)/area(1:ncol)) + end do + call outfld( 'WD_'//trim(gas_wetdep_list(m)),wk_out,ncol,lchnk ) +! +! local wet deposition rate [kg/s] +! + call outfld( 'WDRATE_'//trim(gas_wetdep_list(m)), & + dtwr(1:ncol,1:pver,m)*mass_in_layer(1:ncol,pver:1:-1),ncol,lchnk ) +! +! to be used in mo_chm_diags to compute wet_deposition_NOy_as_N and wet_deposition_NHx_as_N (units: kg/m2/s) +! + if ( debug) print *,'mo_neu ',mapping_to_mmr(m),(wk_out(1:ncol)) + wd_tend_int(1:ncol,mapping_to_mmr(m)) = wk_out(1:ncol) +! + end do +! + if ( do_diag ) then + call outfld('QT_RAIN_HNO3', qt_rain, ncol, lchnk ) + call outfld('QT_RIME_HNO3', qt_rime, ncol, lchnk ) + call outfld('QT_WASH_HNO3', qt_wash, ncol, lchnk ) + call outfld('QT_EVAP_HNO3', qt_evap, ncol, lchnk ) + end if +! + return +end subroutine neu_wetdep_tend + +!----------------------------------------------------------------------- +! +! Original code from Jessica Neu +! Updated by S. Walters and J.-F. Lamarque (March-April 2011) +! +!----------------------------------------------------------------------- + + subroutine WASHO(LPAR,NTRACE,DTSCAV,QTTJFL,QM,POFL,DELZ, & + RLS,CLWC,CIWC,CFR,TEM,EVAPRATE,GAREA,HSTAR,TCMASS,TCKAQB, & + TCNION, qt_rain, qt_rime, qt_wash, qt_evap) +! + implicit none + +!----------------------------------------------------------------------- +!---p-conde 5.4 (2007) -----called from main----- +!---called from pmain to calculate rainout and washout of tracers +!---revised by JNEU 8/2007 +!--- +!-LAER has been removed - no scavenging for aerosols +!-LAER could be used as LWASHTYP +!---WILL THIS WORK FOR T42->T21??????????? +!----------------------------------------------------------------------- + + integer LPAR, NTRACE + real(r8), intent(inout) :: QTTJFL(LPAR,NTRACE) + real(r8), intent(in) :: DTSCAV, QM(LPAR),POFL(LPAR),DELZ(LPAR),GAREA + real(r8), intent(in) :: RLS(LPAR),CLWC(LPAR),CIWC(LPAR),CFR(LPAR),TEM(LPAR), & + EVAPRATE(LPAR) + real(r8), intent(in) :: HSTAR(LPAR,NTRACE),TCMASS(NTRACE) + logical , intent(in) :: TCKAQB(NTRACE),TCNION(NTRACE) +! + real(r8), intent(inout) :: qt_rain(lpar) + real(r8), intent(inout) :: qt_rime(lpar) + real(r8), intent(inout) :: qt_wash(lpar) + real(r8), intent(inout) :: qt_evap(lpar) +! + integer I,J,L,N,LE, LM1 + real(r8), dimension(LPAR) :: CFXX + real(r8), dimension(LPAR) :: QTT, QTTNEW + + real(r8) WRK, RNEW_TST + real(r8) CLWX + real(r8) RNEW,RPRECIP,DELTARIMEMASS,DELTARIME,RAMPCT + real(r8) MASSLOSS + real(r8) DOR,DNEW,DEMP,COLEFFSNOW,RHOSNOW + real(r8) WEMP,REMP,RRAIN,RWASH + real(r8) QTPRECIP,QTRAIN,QTCXA,QTAX,QTOC + + real(r8) FAMA,RAMA,DAMA,FCA,RCA,DCA + real(r8) FAX,RAX,DAX,FCXA,RCXA,DCXA,FCXB,RCXB,DCXB + real(r8) RAXADJ,FAXADJ,RAXADJF + real(r8) QTDISCF,QTDISRIME,QTDISCXA + real(r8) QTEVAPAXP,QTEVAPAXW,QTEVAPAX + real(r8) QTWASHAX + real(r8) QTEVAPCXAP,QTEVAPCXAW,QTEVAPCXA + real(r8) QTWASHCXA,QTRIMECXA + real(r8) QTRAINCXA,QTRAINCXB + real(r8) QTTOPCA,QTTOPAA,QTTOPCAX,QTTOPAAX + + real(r8) AMPCT,AMCLPCT,CLNEWPCT,CLNEWAMPCT,CLOLDPCT,CLOLDAMPCT + real(r8) RAXLOC,RCXALOC,RCXBLOC,RCALOC,RAMALOC,RCXPCT + + real(r8) QTNETLCXA,QTNETLCXB,QTNETLAX,QTNETL + real(r8) QTDISSTAR + + + real(r8), parameter :: CFMIN=0.1_r8 + real(r8), parameter :: CWMIN=1.0e-5_r8 + real(r8), parameter :: DMIN=1.0e-1_r8 !mm + real(r8), parameter :: VOLPOW=1._r8/3._r8 + real(r8), parameter :: RHORAIN=1.0e3_r8 !kg/m3 + real(r8), parameter :: RHOSNOWFIX=1.0e2_r8 !kg/m3 + real(r8), parameter :: COLEFFRAIN=0.7_r8 + real(r8), parameter :: TMIX=258._r8 + real(r8), parameter :: TFROZ=240._r8 + real(r8), parameter :: COLEFFAER=0.05_r8 +! +! additional work arrays and diagnostics +! + real(r8) :: rls_wrk(lpar) + real(r8) :: rnew_wrk(lpar) + real(r8) :: rca_wrk(lpar) + real(r8) :: fca_wrk(lpar) + real(r8) :: rcxa_wrk(lpar) + real(r8) :: fcxa_wrk(lpar) + real(r8) :: rcxb_wrk(lpar) + real(r8) :: fcxb_wrk(lpar) + real(r8) :: rax_wrk(lpar,2) + real(r8) :: fax_wrk(lpar,2) + real(r8) :: rama_wrk(lpar) + real(r8) :: fama_wrk(lpar) + real(r8) :: deltarime_wrk(lpar) + real(r8) :: clwx_wrk(lpar) + real(r8) :: frc(lpar,3) + real(r8) :: rlsog(lpar) +! + logical :: is_hno3 + logical :: rls_flag(lpar) + logical :: rnew_flag(lpar) + logical :: cf_trigger(lpar) + logical :: freezing(lpar) +! + real(r8), parameter :: four = 4._r8 + real(r8), parameter :: adj_factor = one + 10._r8*epsilon( one ) +! + integer :: LWASHTYP,LICETYP +! + if ( debug ) then + print '(a,50f8.2)','tckaqb ',tckaqb + print '(a,50e12.4)','hstar ',hstar(1,:) + print '(a,50i4)' ,'ice_uptake ',TCNION + print '(a,50f8.2)','mol_weight ',TCMASS(:) + print '(a,50f8.2)','temp ',tem(:) + print '(a,50f8.2)','p ',pofl(:) + end if + +!----------------------------------------------------------------------- + LE = LPAR-1 +! + rls_flag(1:le) = rls(1:le) > zero + freezing(1:le) = tem(1:le) < tice + rlsog(1:le) = rls(1:le)/garea +! +species_loop : & + do N = 1,NTRACE + QTT(:lpar) = QTTJFL(:lpar,N) + QTTNEW(:lpar) = QTTJFL(:lpar,N) + is_hno3 = n == hno3_ndx + if( is_hno3 ) then + qt_rain(:lpar) = zero + qt_rime(:lpar) = zero + qt_wash(:lpar) = zero + qt_evap(:lpar) = zero + rca_wrk(:lpar) = zero + fca_wrk(:lpar) = zero + rcxa_wrk(:lpar) = zero + fcxa_wrk(:lpar) = zero + rcxb_wrk(:lpar) = zero + fcxb_wrk(:lpar) = zero + rls_wrk(:lpar) = zero + rnew_wrk(:lpar) = zero + cf_trigger(:lpar) = .false. + clwx_wrk(:lpar) = -9999._r8 + deltarime_wrk(:lpar) = -9999._r8 + rax_wrk(:lpar,:) = zero + fax_wrk(:lpar,:) = zero + endif + +!----------------------------------------------------------------------- +! check whether soluble in ice +!----------------------------------------------------------------------- + if( TCNION(N) ) then + LICETYP = 1 + else + LICETYP = 2 + end if + +!----------------------------------------------------------------------- +! initialization +!----------------------------------------------------------------------- + QTTOPAA = zero + QTTOPCA = zero + + RCA = zero + FCA = zero + DCA = zero + RAMA = zero + FAMA = zero + DAMA = zero + + AMPCT = zero + AMCLPCT = zero + CLNEWPCT = zero + CLNEWAMPCT = zero + CLOLDPCT = zero + CLOLDAMPCT = zero + + +!----------------------------------------------------------------------- +! Check whether precip in top layer - if so, require CF ge 0.2 +!----------------------------------------------------------------------- + if( RLS(LE) > zero ) then + CFXX(LE) = max( CFMIN,CFR(LE) ) + else + CFXX(LE) = CFR(LE) + endif + + rnew_flag(1:le) = .false. + +level_loop : & + do L = LE,1,-1 + LM1 = L - 1 + FAX = zero + RAX = zero + DAX = zero + FCXA = zero + FCXB = zero + DCXA = zero + DCXB = zero + RCXA = zero + RCXB = zero + + QTDISCF = zero + QTDISRIME = zero + QTDISCXA = zero + + QTEVAPAXP = zero + QTEVAPAXW = zero + QTEVAPAX = zero + QTWASHAX = zero + + QTEVAPCXAP = zero + QTEVAPCXAW = zero + QTEVAPCXA = zero + QTRIMECXA = zero + QTWASHCXA = zero + QTRAINCXA = zero + QTRAINCXB = zero + + RAMPCT = zero + RCXPCT = zero + + RCXALOC = zero + RCXBLOC = zero + RAXLOC = zero + RAMALOC = zero + RCALOC = zero + + RPRECIP = zero + DELTARIMEMASS = zero + DELTARIME = zero + DOR = zero + DNEW = zero + + QTTOPAAX = zero + QTTOPCAX = zero + +has_rls : & + if( rls_flag(l) ) then +!----------------------------------------------------------------------- +!-----Evaporate ambient precip and decrease area------------------------- +!-----If ice, diam=diam falling from above If rain, diam=4mm (not used) +!-----Evaporate tracer contained in evaporated precip +!-----Can't evaporate more than we start with----------------------------- +!-----Don't do washout until we adjust ambient precip to match Rbot if needed +!------(after RNEW if statements) +!----------------------------------------------------------------------- + FAX = max( zero,FAMA*(one - evaprate(l)) ) + RAX = RAMA !kg/m2/s + if ( debug ) then + if( (l == 3 .or. l == 2) ) then + write(*,*) 'washout: l,rls,fax = ',l,rls(l),fax + endif + endif + if( FAMA > zero ) then + if( freezing(l) ) then + DAX = DAMA !mm + else + DAX = four !mm - not necessary + endif + else + DAX = zero + endif + + if( RAMA > zero ) then + QTEVAPAXP = min( QTTOPAA,EVAPRATE(L)*QTTOPAA ) + else + QTEVAPAXP = zero + endif + if( is_hno3 ) then + rax_wrk(l,1) = rax + fax_wrk(l,1) = fax + endif + + +!----------------------------------------------------------------------- +! Determine how much the in-cloud precip rate has increased------ +!----------------------------------------------------------------------- + WRK = RAX*FAX + RCA*FCA + if( WRK > 0._r8 ) then + RNEW_TST = RLS(L)/(GAREA * WRK) + else + RNEW_TST = 10._r8 + endif + RNEW = RLSOG(L) - (RAX*FAX + RCA*FCA) !GBA*CF + rnew_wrk(l) = rnew_tst + if ( debug ) then + if( is_hno3 .and. l == kdiag-1 ) then + write(*,*) ' ' + write(*,*) 'washout: rls,rax,fax,rca,fca' + write(*,'(1p,5g15.7)') rls(l),rax,fax,rca,fca + write(*,*) ' ' + endif + endif +!----------------------------------------------------------------------- +! if RNEW>0, there is growth and/or new precip formation +!----------------------------------------------------------------------- +has_rnew: if( rlsog(l) > adj_factor*(rax*fax + rca*fca) ) then +!----------------------------------------------------------------------- +! Min cloudwater requirement for cloud with new precip +! Min CF is set at top for LE, at end for other levels +! CWMIN is only needed for new precip formation - do not need for RNEW<0 +!----------------------------------------------------------------------- + if( cfxx(l) == zero ) then + if ( do_diag ) then + write(*,*) 'cfxx(l) == zero',l + write(*,*) qttjfl(:,n) + write(*,*) qm(:) + write(*,*) pofl(:) + write(*,*) delz(:) + write(*,*) rls(:) + write(*,*) clwc(:) + write(*,*) ciwc(:) + write(*,*) cfr(:) + write(*,*) tem(:) + write(*,*) evaprate(:) + write(*,*) hstar(:,n) + end if +! +! if we are here,, that means that there is +! a inconsistency and this will lead to a division +! by 0 later on! This column should then be skipped +! + QTTJFL(:lpar,n) = QTT(:lpar) + cycle species_loop +! +! call endrun() +! + endif + rnew_flag(l) = .true. + CLWX = max( CLWC(L)+CIWC(L),CWMIN*CFXX(L) ) + if( is_hno3 ) then + clwx_wrk(l) = clwx + endif +!----------------------------------------------------------------------- +! Area of old cloud and new cloud +!----------------------------------------------------------------------- + FCXA = FCA + FCXB = max( zero,CFXX(L)-FCXA ) +!----------------------------------------------------------------------- +! ICE +! For ice and mixed phase, grow precip in old cloud by riming +! Use only portion of cloudwater in old cloud fraction +! and rain above old cloud fraction +! COLEFF from Lohmann and Roeckner (1996), Loss rate from Rotstayn (1997) +!----------------------------------------------------------------------- +is_freezing : & + if( freezing(l) ) then + COLEFFSNOW = exp( 2.5e-2_r8*(TEM(L) - TICE) ) + if( TEM(L) <= TFROZ ) then + RHOSNOW = RHOSNOWFIX + else + RHOSNOW = 0.303_r8*(TEM(L) - TFROZ)*RHOSNOWFIX + endif + if( FCXA > zero ) then + if( DCA > zero ) then + DELTARIMEMASS = CLWX*QM(L)*(FCXA/CFXX(L))* & + (one - exp( (-COLEFFSNOW/(DCA*1.e-3_r8))*((RCA)/(2._r8*RHOSNOW))*DTSCAV )) !uses GBA R + else + DELTARIMEMASS = zero + endif + else + DELTARIMEMASS = zero + endif +!----------------------------------------------------------------------- +! Increase in precip rate due to riming (kg/m2/s): +! Limit to total increase in R in cloud +!----------------------------------------------------------------------- + if( FCXA > zero ) then + DELTARIME = min( RNEW/FCXA,DELTARIMEMASS/(FCXA*GAREA*DTSCAV) ) !GBA + else + DELTARIME = zero + endif + if( is_hno3 ) then + deltarime_wrk(l) = deltarime + endif +!----------------------------------------------------------------------- +! Find diameter of rimed precip, must be at least .1mm +!----------------------------------------------------------------------- + if( RCA > zero ) then + DOR = max( DMIN,(((RCA+DELTARIME)/RCA)**VOLPOW)*DCA ) + else + DOR = zero + endif +!----------------------------------------------------------------------- +! If there is some in-cloud precip left, we have new precip formation +! Will be spread over whole cloud fraction +!----------------------------------------------------------------------- +! Calculate precip rate in old and new cloud fractions +!----------------------------------------------------------------------- + RPRECIP = (RNEW-(DELTARIME*FCXA))/CFXX(L) !kg/m2/s !GBA +!----------------------------------------------------------------------- +! Calculate precip rate in old and new cloud fractions +!----------------------------------------------------------------------- + RCXA = RCA + DELTARIME + RPRECIP !kg/m2/s GBA + RCXB = RPRECIP !kg/m2/s GBA + +!----------------------------------------------------------------------- +! Find diameter of new precip from empirical relation using Rprecip +! in given area of box- use density of water, not snow, to convert kg/s +! to mm/s -> as given in Field and Heymsfield +! Also calculate diameter of mixed precip,DCXA, from empirical relation +! using total R in FCXA - this will give larger particles than averaging DOR and +! DNEW in the next level +! DNEW and DCXA must be at least .1mm +!----------------------------------------------------------------------- + if( RPRECIP > zero ) then + WEMP = (CLWX*QM(L))/(GAREA*CFXX(L)*DELZ(L)) !kg/m3 + REMP = RPRECIP/((RHORAIN/1.e3_r8)) !mm/s local + DNEW = DEMPIRICAL( WEMP, REMP ) + if ( debug ) then + if( is_hno3 .and. l >= 15 ) then + write(*,*) ' ' + write(*,*) 'washout: wemp,remp.dnew @ l = ',l + write(*,'(1p,3g15.7)') wemp,remp,dnew + write(*,*) ' ' + endif + endif + DNEW = max( DMIN,DNEW ) + if( FCXB > zero ) then + DCXB = DNEW + else + DCXB = zero + endif + else + DCXB = zero + endif + + if( FCXA > zero ) then + WEMP = (CLWX*QM(L)*(FCXA/CFXX(L)))/(GAREA*FCXA*DELZ(L)) !kg/m3 + REMP = RCXA/((RHORAIN/1.e3_r8)) !mm/s local + DEMP = DEMPIRICAL( WEMP, REMP ) + DCXA = ((RCA+DELTARIME)/RCXA)*DOR + (RPRECIP/RCXA)*DNEW + DCXA = max( DEMP,DCXA ) + DCXA = max( DMIN,DCXA ) + else + WEMP = zero + REMP = zero + DEMP = zero + DCXA = zero + endif + if ( debug ) then + if( is_hno3 .and. l >= 15 ) then + write(*,*) ' ' + write(*,*) 'washout: rca,rcxa,deltarime,dor,rprecip,dnew @ l = ',l + write(*,'(1p,6g15.7)') rca,rcxa,deltarime,dor,rprecip,dnew + write(*,*) 'washout: dcxa,dcxb,wemp,remp,demp' + write(*,'(1p,5g15.7)') dcxa,dcxb,wemp,remp,demp + write(*,*) ' ' + end if + endif + + if( QTT(L) > zero ) then +!----------------------------------------------------------------------- +! ICE SCAVENGING +!----------------------------------------------------------------------- +! For ice, rainout only hno3/aerosols using new precip +! Tracer dissolved given by Kaercher and Voigt (2006) for T<258K +! For T>258K, use Henry's Law with Retention coefficient +! Rain out in whole CF +!----------------------------------------------------------------------- + if( RPRECIP > zero ) then + if( LICETYP == 1 ) then + RRAIN = RPRECIP*GAREA !kg/s local + call DISGAS( CLWX, CFXX(L), TCMASS(N), HSTAR(L,N), & + TEM(L),POFL(L),QM(L), & + QTT(L)*CFXX(L),QTDISCF ) + call RAINGAS( RRAIN, DTSCAV, CLWX, CFXX(L), & + QM(L), QTT(L), QTDISCF, QTRAIN ) + WRK = QTRAIN/CFXX(L) + QTRAINCXA = FCXA*WRK + QTRAINCXB = FCXB*WRK + elseif( LICETYP == 2 ) then + QTRAINCXA = zero + QTRAINCXB = zero + endif + if( debug .and. is_hno3 .and. l == kdiag ) then + write(*,*) ' ' + write(*,*) 'washout: Ice Scavenging' + write(*,*) 'washout: qtraincxa, qtraincxb, fcxa, fcxb, qt_rain, cfxx(l), wrk @ level = ',l + write(*,'(1p,7g15.7)') qtraincxa, qtraincxb, fcxa, fcxb, qt_rain(l), cfxx(l), wrk + write(*,*) ' ' + endif + endif +!----------------------------------------------------------------------- +! For ice, accretion removal for hno3 and aerosols is propotional to riming, +! no accretion removal for gases +! remove only in mixed portion of cloud +! Limit DELTARIMEMASS to RNEW*DTSCAV for ice - evaporation of rimed ice to match +! RNEW precip rate would result in HNO3 escaping from ice (no trapping) +!----------------------------------------------------------------------- + if( DELTARIME > zero ) then + if( LICETYP == 1 ) then + if( TEM(L) <= TFROZ ) then + RHOSNOW = RHOSNOWFIX + else + RHOSNOW = 0.303_r8*(TEM(L) - TFROZ)*RHOSNOWFIX + endif + QTCXA = QTT(L)*FCXA + call DISGAS( CLWX*(FCXA/CFXX(L)), FCXA, TCMASS(N), & + HSTAR(L,N), TEM(L), POFL(L), & + QM(L), QTCXA, QTDISRIME ) + QTDISSTAR = (QTDISRIME*QTCXA)/(QTDISRIME + QTCXA) + if ( debug ) then + if( is_hno3 .and. l >= 15 ) then + write(*,*) ' ' + write(*,*) 'washout: fcxa,dca,rca,qtdisstar @ l = ',l + write(*,'(1p,4g15.7)') fcxa,dca,rca,qtdisstar + write(*,*) ' ' + endif + endif + QTRIMECXA = QTCXA* & + (one - exp((-COLEFFSNOW/(DCA*1.e-3_r8))* & + (RCA/(2._r8*RHOSNOW))* & !uses GBA R + (QTDISSTAR/QTCXA)*DTSCAV)) + QTRIMECXA = min( QTRIMECXA, & + ((RNEW*GAREA*DTSCAV)/(CLWX*QM(L)*(FCXA/CFXX(L))))*QTDISSTAR) + elseif( LICETYP == 2 ) then + QTRIMECXA = zero + endif + endif + else + QTRAINCXA = zero + QTRAINCXB = zero + QTRIMECXA = zero + endif +!----------------------------------------------------------------------- +! For ice, no washout in interstitial cloud air +!----------------------------------------------------------------------- + QTWASHCXA = zero + QTEVAPCXA = zero + +!----------------------------------------------------------------------- +! RAIN +! For rain, accretion increases rain rate but diameter remains constant +! Diameter is 4mm (not used) +!----------------------------------------------------------------------- + else is_freezing + if( FCXA > zero ) then + DELTARIMEMASS = (CLWX*QM(L))*(FCXA/CFXX(L))* & + (one - exp( -0.24_r8*COLEFFRAIN*((RCA)**0.75_r8)*DTSCAV )) !local + else + DELTARIMEMASS = zero + endif +!----------------------------------------------------------------------- +! Increase in precip rate due to riming (kg/m2/s): +! Limit to total increase in R in cloud +!----------------------------------------------------------------------- + if( FCXA > zero ) then + DELTARIME = min( RNEW/FCXA,DELTARIMEMASS/(FCXA*GAREA*DTSCAV) ) !GBA + else + DELTARIME = zero + endif +!----------------------------------------------------------------------- +! If there is some in-cloud precip left, we have new precip formation +!----------------------------------------------------------------------- + RPRECIP = (RNEW-(DELTARIME*FCXA))/CFXX(L) !GBA + + RCXA = RCA + DELTARIME + RPRECIP !kg/m2/s GBA + RCXB = RPRECIP !kg/m2/s GBA + DCXA = FOUR + if( FCXB > zero ) then + DCXB = FOUR + else + DCXB = zero + endif +!----------------------------------------------------------------------- +! RAIN SCAVENGING +! For rain, rainout both hno3/aerosols and gases using new precip +!----------------------------------------------------------------------- + if( QTT(L) > zero ) then + if( RPRECIP > zero ) then + RRAIN = (RPRECIP*GAREA) !kg/s local + call DISGAS( CLWX, CFXX(L), TCMASS(N), HSTAR(L,N), & + TEM(L), POFL(L), QM(L), & + QTT(L)*CFXX(L), QTDISCF ) + call RAINGAS( RRAIN, DTSCAV, CLWX, CFXX(L), & + QM(L), QTT(L), QTDISCF, QTRAIN ) + WRK = QTRAIN/CFXX(L) + QTRAINCXA = FCXA*WRK + QTRAINCXB = FCXB*WRK + if( debug .and. is_hno3 .and. l == kdiag ) then + write(*,*) ' ' + write(*,*) 'washout: Rain Scavenging' + write(*,*) 'washout: qtraincxa, qtraincxb, fcxa, fcxb, qt_rain, cfxx(l), wrk @ level = ',l + write(*,'(1p,7g15.7)') qtraincxa, qtraincxb, fcxa, fcxb, qt_rain(l), cfxx(l), wrk + write(*,*) ' ' + endif + endif +!----------------------------------------------------------------------- +! For rain, accretion removal is propotional to riming +! caclulate for hno3/aerosols and gases +! Remove only in mixed portion of cloud +! Limit DELTARIMEMASS to RNEW*DTSCAV +!----------------------------------------------------------------------- + if( DELTARIME > zero ) then + QTCXA = QTT(L)*FCXA + call DISGAS( CLWX*(FCXA/CFXX(L)), FCXA, TCMASS(N), & + HSTAR(L,N), TEM(L), POFL(L), & + QM(L), QTCXA, QTDISRIME ) + QTDISSTAR = (QTDISRIME*QTCXA)/(QTDISRIME + QTCXA) + QTRIMECXA = QTCXA* & + (one - exp(-0.24_r8*COLEFFRAIN* & + ((RCA)**0.75_r8)* & !local + (QTDISSTAR/QTCXA)*DTSCAV)) + QTRIMECXA = min( QTRIMECXA, & + ((RNEW*GAREA*DTSCAV)/(CLWX*QM(L)*(FCXA/CFXX(L))))*QTDISSTAR) + else + QTRIMECXA = zero + endif + else + QTRAINCXA = zero + QTRAINCXB = zero + QTRIMECXA = zero + endif +!----------------------------------------------------------------------- +! For rain, washout gases and HNO3/aerosols using rain from above old cloud +! Washout for HNO3/aerosols is only on non-dissolved portion, impaction-style +! Washout for gases is on non-dissolved portion, limited by QTTOP+QTRIME +!----------------------------------------------------------------------- + if( RCA > zero ) then + QTPRECIP = FCXA*QTT(L) - QTDISRIME + if( HSTAR(L,N) > 1.e4_r8 ) then + if( QTPRECIP > zero ) then + QTWASHCXA = QTPRECIP*(one - exp( -0.24_r8*COLEFFAER*((RCA)**0.75_r8)*DTSCAV )) !local + else + QTWASHCXA = zero + endif + QTEVAPCXA = zero + else + RWASH = RCA*GAREA !kg/s local + if( QTPRECIP > zero ) then + call WASHGAS( RWASH, FCA, DTSCAV, QTTOPCA+QTRIMECXA, & + HSTAR(L,N), TEM(L), POFL(L), & + QM(L), QTPRECIP, QTWASHCXA, QTEVAPCXA ) + else + QTWASHCXA = zero + QTEVAPCXA = zero + endif + endif + endif + endif is_freezing +!----------------------------------------------------------------------- +! If RNEW zero ) then + RCXA = min( RCA,RLS(L)/(GAREA*FCXA) ) !kg/m2/s GBA + if( FAX > zero .and. ((RCXA+1.e-12_r8) < RLS(L)/(GAREA*FCXA)) ) then + RAXADJF = RLS(L)/GAREA - RCXA*FCXA + RAMPCT = RAXADJF/(RAX*FAX) + FAXADJ = RAMPCT*FAX + if( FAXADJ > zero ) then + RAXADJ = RAXADJF/FAXADJ + else + RAXADJ = zero + endif + else + RAXADJ = zero + RAMPCT = zero + FAXADJ = zero + endif + else + RCXA = zero + if( FAX > zero ) then + RAXADJF = RLS(L)/GAREA + RAMPCT = RAXADJF/(RAX*FAX) + FAXADJ = RAMPCT*FAX + if( FAXADJ > zero ) then + RAXADJ = RAXADJF/FAXADJ + else + RAXADJ = zero + endif + else + RAXADJ = zero + RAMPCT = zero + FAXADJ = zero + endif + endif + + QTEVAPAXP = min( QTTOPAA,QTTOPAA - (RAMPCT*(QTTOPAA-QTEVAPAXP)) ) + FAX = FAXADJ + RAX = RAXADJ + if ( debug ) then + if( (l == 3 .or. l == 2) ) then + write(*,*) 'washout: l,fcxa,fax = ',l,fcxa,fax + endif + endif + +!----------------------------------------------------------------------- +! IN-CLOUD EVAPORATION/WASHOUT +! If precip out the bottom of the cloud is 0, evaporate everything +! If there is no cloud, QTTOPCA=0, so nothing happens +!----------------------------------------------------------------------- + if( RCXA <= zero ) then + QTEVAPCXA = QTTOPCA + RCXA = zero + DCXA = zero + else +!----------------------------------------------------------------------- +! If rain out the bottom of the cloud is >0 (but .le. RCA): +! For ice, decrease particle size, +! no washout +! no evap for non-ice gases (b/c there is nothing in ice) +! TTmix, hno3&aerosols are incorporated into ice structure: +! do not release +! For rain, assume full evaporation of some raindrops +! proportional evaporation for all species +! washout for gases using Rbot +! impact washout for hno3/aerosol portion in gas phase +!----------------------------------------------------------------------- +! if (TEM(L) < TICE ) then +is_freezing_a : & + if( freezing(l) ) then + QTWASHCXA = zero + DCXA = ((RCXA/RCA)**VOLPOW)*DCA + if( LICETYP == 1 ) then + if( TEM(L) <= TMIX ) then + MASSLOSS = (RCA-RCXA)*FCXA*GAREA*DTSCAV +!----------------------------------------------------------------------- +! note-QTT doesn't matter b/c T<258K +!----------------------------------------------------------------------- + call DISGAS( (MASSLOSS/QM(L)), FCXA, TCMASS(N), & + HSTAR(L,N), TEM(L), POFL(L), & + QM(L), QTT(L), QTEVAPCXA ) + QTEVAPCXA = min( QTTOPCA,QTEVAPCXA ) + else + QTEVAPCXA = zero + endif + elseif( LICETYP == 2 ) then + QTEVAPCXA = zero + endif + else is_freezing_a + QTEVAPCXAP = (RCA - RCXA)/RCA*QTTOPCA + DCXA = FOUR + QTCXA = FCXA*QTT(L) + if( HSTAR(L,N) > 1.e4_r8 ) then + if( QTT(L) > zero ) then + call DISGAS( CLWX*(FCXA/CFXX(L)), FCXA, TCMASS(N), & + HSTAR(L,N), TEM(L), POFL(L), & + QM(L), QTCXA, QTDISCXA ) + if( QTCXA > QTDISCXA ) then + QTWASHCXA = (QTCXA - QTDISCXA)*(one - exp( -0.24_r8*COLEFFAER*((RCXA)**0.75_r8)*DTSCAV )) !local + else + QTWASHCXA = zero + endif + QTEVAPCXAW = zero + else + QTWASHCXA = zero + QTEVAPCXAW = zero + endif + else + RWASH = RCXA*GAREA !kg/s local + call WASHGAS( RWASH, FCXA, DTSCAV, QTTOPCA, HSTAR(L,N), & + TEM(L), POFL(L), QM(L), & + QTCXA-QTDISCXA, QTWASHCXA, QTEVAPCXAW ) + endif + QTEVAPCXA = QTEVAPCXAP + QTEVAPCXAW + endif is_freezing_a + endif + endif has_rnew + +!----------------------------------------------------------------------- +! AMBIENT WASHOUT +! Ambient precip is finalized - if it is rain, washout +! no ambient washout for ice, since gases are in vapor phase +!----------------------------------------------------------------------- + if( RAX > zero ) then + if( .not. freezing(l) ) then + QTAX = FAX*QTT(L) + if( HSTAR(L,N) > 1.e4_r8 ) then + QTWASHAX = QTAX* & + (one - exp(-0.24_r8*COLEFFAER* & + ((RAX)**0.75_r8)*DTSCAV)) !local + QTEVAPAXW = zero + else + RWASH = RAX*GAREA !kg/s local + call WASHGAS( RWASH, FAX, DTSCAV, QTTOPAA, HSTAR(L,N), & + TEM(L), POFL(L), QM(L), QTAX, & + QTWASHAX, QTEVAPAXW ) + endif + else + QTEVAPAXW = zero + QTWASHAX = zero + endif + else + QTEVAPAXW = zero + QTWASHAX = zero + endif + QTEVAPAX = QTEVAPAXP + QTEVAPAXW + +!----------------------------------------------------------------------- +! END SCAVENGING +! Require CF if our ambient evaporation rate would give less +! precip than R from model. +!----------------------------------------------------------------------- + if( do_diag .and. is_hno3 ) then + rls_wrk(l) = rls(l)/garea + rca_wrk(l) = rca + fca_wrk(l) = fca + rcxa_wrk(l) = rcxa + fcxa_wrk(l) = fcxa + rcxb_wrk(l) = rcxb + fcxb_wrk(l) = fcxb + rax_wrk(l,2) = rax + fax_wrk(l,2) = fax + endif +upper_level : & + if( L > 1 ) then + FAMA = max( FCXA + FCXB + FAX - CFR(LM1),zero ) + if( FAX > zero ) then + RAXLOC = RAX/FAX + else + RAXLOC = zero + endif + if( FCXA > zero ) then + RCXALOC = RCXA/FCXA + else + RCXALOC = zero + endif + if( FCXB > zero ) then + RCXBLOC = RCXB/FCXB + else + RCXBLOC = zero + endif + + if( CFR(LM1) >= CFMIN ) then + CFXX(LM1) = CFR(LM1) + else + if( adj_factor*RLSOG(LM1) >= (RCXA*FCXA + RCXB*FCXB + RAX*FAX)*(one - EVAPRATE(LM1)) ) then + CFXX(LM1) = CFMIN + cf_trigger(lm1) = .true. + else + CFXX(LM1) = CFR(LM1) + endif + if( is_hno3 .and. lm1 == kdiag .and. debug ) then + write(*,*) ' ' + write(*,*) 'washout: rls,garea,rcxa,fcxa,rcxb,fcxb,rax,fax' + write(*,'(1p,8g15.7)') rls(lm1),garea,rcxa,fcxa,rcxb,fcxb,rax,fax + write(*,*) ' ' + endif + endif +!----------------------------------------------------------------------- +! Figure out what will go into ambient and cloud below +! Don't do for lowest level +!----------------------------------------------------------------------- + if( FAX > zero ) then + RAXLOC = RAX/FAX + AMPCT = max( zero,min( one,(CFXX(L) + FAX - CFXX(LM1))/FAX ) ) + AMCLPCT = one - AMPCT + else + RAXLOC = zero + AMPCT = zero + AMCLPCT = zero + endif + if( FCXB > zero ) then + RCXBLOC = RCXB/FCXB + CLNEWPCT = max( zero,min( (CFXX(LM1) - FCXA)/FCXB,one ) ) + CLNEWAMPCT = one - CLNEWPCT + else + RCXBLOC = zero + CLNEWPCT = zero + CLNEWAMPCT = zero + endif + if( FCXA > zero ) then + RCXALOC = RCXA/FCXA + CLOLDPCT = max( zero,min( CFXX(LM1)/FCXA,one ) ) + CLOLDAMPCT = one - CLOLDPCT + else + RCXALOC = zero + CLOLDPCT = zero + CLOLDAMPCT = zero + endif +!----------------------------------------------------------------------- +! Remix everything for the next level +!----------------------------------------------------------------------- + FCA = min( CFXX(LM1),FCXA*CLOLDPCT + CLNEWPCT*FCXB + AMCLPCT*FAX ) + if( FCA > zero ) then +!----------------------------------------------------------------------- +! Maintain cloud core by reducing NC and AM area going into cloud below +!----------------------------------------------------------------------- + RCA = (RCXA*FCXA*CLOLDPCT + RCXB*FCXB*CLNEWPCT + RAX*FAX*AMCLPCT)/FCA + if ( debug ) then + if( is_hno3 ) then + write(*,*) ' ' + write(*,*) 'washout: rcxa,fcxa,cloldpctrca,rca,fca,dcxa @ l = ',l + write(*,'(1p,6g15.7)') rcxa,fcxa,cloldpct,rca,fca,dcxa + write(*,*) 'washout: rcxb,fcxb,clnewpct,dcxb' + write(*,'(1p,4g15.7)') rcxb,fcxb,clnewpct,dcxb + write(*,*) 'washout: rax,fax,amclpct,dax' + write(*,'(1p,4g15.7)') rax,fax,amclpct,dax + write(*,*) ' ' + endif + endif + + if (RCA > zero) then + DCA = (RCXA*FCXA*CLOLDPCT)/(RCA*FCA)*DCXA + & + (RCXB*FCXB*CLNEWPCT)/(RCA*FCA)*DCXB + & + (RAX*FAX*AMCLPCT)/(RCA*FCA)*DAX + else + DCA = zero + FCA = zero + endif + + else + FCA = zero + DCA = zero + RCA = zero + endif + + FAMA = FCXA + FCXB + FAX - CFXX(LM1) + if( FAMA > zero ) then + RAMA = (RCXA*FCXA*CLOLDAMPCT + RCXB*FCXB*CLNEWAMPCT + RAX*FAX*AMPCT)/FAMA + if( RAMA > zero ) then + DAMA = (RCXA*FCXA*CLOLDAMPCT)/(RAMA*FAMA)*DCXA + & + (RCXB*FCXB*CLNEWAMPCT)/(RAMA*FAMA)*DCXB + & + (RAX*FAX*AMPCT)/(RAMA*FAMA)*DAX + else + FAMA = zero + DAMA = zero + endif + else + FAMA = zero + DAMA = zero + RAMA = zero + endif + else upper_level + AMPCT = zero + AMCLPCT = zero + CLNEWPCT = zero + CLNEWAMPCT = zero + CLOLDPCT = zero + CLOLDAMPCT = zero + endif upper_level + else has_rls + RNEW = zero + QTEVAPCXA = QTTOPCA + QTEVAPAX = QTTOPAA + if( L > 1 ) then + if( RLS(LM1) > zero ) then + CFXX(LM1) = max( CFMIN,CFR(LM1) ) +! if( CFR(LM1) >= CFMIN ) then +! CFXX(LM1) = CFR(LM1) +! else +! CFXX(LM1) = CFMIN +! endif + else + CFXX(LM1) = CFR(LM1) + endif + endif + AMPCT = zero + AMCLPCT = zero + CLNEWPCT = zero + CLNEWAMPCT = zero + CLOLDPCT = zero + CLOLDAMPCT = zero + RCA = zero + RAMA = zero + FCA = zero + FAMA = zero + DCA = zero + DAMA = zero + endif has_rls + + if( do_diag .and. is_hno3 ) then + fama_wrk(l) = fama + rama_wrk(l) = rama + endif +!----------------------------------------------------------------------- +! Net loss can not exceed QTT in each region +!----------------------------------------------------------------------- + QTNETLCXA = QTRAINCXA + QTRIMECXA + QTWASHCXA - QTEVAPCXA + QTNETLCXA = min( QTT(L)*FCXA,QTNETLCXA ) + + QTNETLCXB =QTRAINCXB + QTNETLCXB = min( QTT(L)*FCXB,QTNETLCXB ) + + QTNETLAX = QTWASHAX - QTEVAPAX + QTNETLAX = min( QTT(L)*FAX,QTNETLAX ) + + QTTNEW(L) = QTT(L) - (QTNETLCXA + QTNETLCXB + QTNETLAX) + + if( do_diag .and. is_hno3 ) then + qt_rain(l) = qtraincxa + qtraincxb + qt_rime(l) = qtrimecxa + qt_wash(l) = qtwashcxa + qtwashax + qt_evap(l) = qtevapcxa + qtevapax + frc(l,1) = qtnetlcxa + frc(l,2) = qtnetlcxb + frc(l,3) = qtnetlax + endif + if( debug .and. is_hno3 .and. l == kdiag ) then + write(*,*) ' ' + write(*,*) 'washout: qtraincxa, qtraincxb, qtrimecxa @ level = ',l + write(*,'(1p,3g15.7)') qtraincxa, qtraincxb, qtrimecxa + write(*,*) ' ' + endif + if ( debug ) then + if( (l == 3 .or. l == 2) ) then + write(*,*) 'washout: hno3, hno3, qtnetlca,b, qtnetlax @ level = ',l + write(*,'(1p,5g15.7)') qttnew(l), qtt(l), qtnetlcxa, qtnetlcxb, qtnetlax + write(*,*) 'washout: qtwashax, qtevapax,fax,fama' + write(*,'(1p,5g15.7)') qtwashax, qtevapax, fax, fama + endif + endif + + QTTOPCAX = (QTTOPCA + QTNETLCXA)*CLOLDPCT + QTNETLCXB*CLNEWPCT + (QTTOPAA + QTNETLAX)*AMCLPCT + QTTOPAAX = (QTTOPCA + QTNETLCXA)*CLOLDAMPCT + QTNETLCXB*CLNEWAMPCT + (QTTOPAA + QTNETLAX)*AMPCT + QTTOPCA = QTTOPCAX + QTTOPAA = QTTOPAAX + end do level_loop + + if ( debug ) then + if( is_hno3 ) then + write(*,*) ' ' + write(*,*) 'washout: clwx_wrk' + write(*,'(1p,5g15.7)') clwx_wrk(1:le) + write(*,*) 'washout: cfr' + write(*,'(1p,5g15.7)') cfr(1:le) + write(*,*) 'washout: cfxx' + write(*,'(1p,5g15.7)') cfxx(1:le) + write(*,*) 'washout: cf trigger' + write(*,'(10l4)') cf_trigger(1:le) + write(*,*) 'washout: evaprate' + write(*,'(1p,5g15.7)') evaprate(1:le) + write(*,*) 'washout: rls' + write(*,'(1p,5g15.7)') rls(1:le) + write(*,*) 'washout: rls/garea' + write(*,'(1p,5g15.7)') rls_wrk(1:le) + write(*,*) 'washout: rnew_wrk' + write(*,'(1p,5g15.7)') rnew_wrk(1:le) + write(*,*) 'washout: rnew_flag' + write(*,'(10l4)') rnew_flag(1:le) + write(*,*) 'washout: deltarime_wrk' + write(*,'(1p,5g15.7)') deltarime_wrk(1:le) + write(*,*) 'washout: rama_wrk' + write(*,'(1p,5g15.7)') rama_wrk(1:le) + write(*,*) 'washout: fama_wrk' + write(*,'(1p,5g15.7)') fama_wrk(1:le) + write(*,*) 'washout: rca_wrk' + write(*,'(1p,5g15.7)') rca_wrk(1:le) + write(*,*) 'washout: fca_wrk' + write(*,'(1p,5g15.7)') fca_wrk(1:le) + write(*,*) 'washout: rcxa_wrk' + write(*,'(1p,5g15.7)') rcxa_wrk(1:le) + write(*,*) 'washout: fcxa_wrk' + write(*,'(1p,5g15.7)') fcxa_wrk(1:le) + write(*,*) 'washout: rcxb_wrk' + write(*,'(1p,5g15.7)') rcxb_wrk(1:le) + write(*,*) 'washout: fcxb_wrk' + write(*,'(1p,5g15.7)') fcxb_wrk(1:le) + write(*,*) 'washout: rax1_wrk' + write(*,'(1p,5g15.7)') rax_wrk(1:le,1) + write(*,*) 'washout: fax1_wrk' + write(*,'(1p,5g15.7)') fax_wrk(1:le,1) + write(*,*) 'washout: rax2_wrk' + write(*,'(1p,5g15.7)') rax_wrk(1:le,2) + write(*,*) 'washout: fax2_wrk' + write(*,'(1p,5g15.7)') fax_wrk(1:le,2) + write(*,*) 'washout: rls_flag' + write(*,'(1p,10l4)') rls_flag(1:le) + write(*,*) 'washout: freezing' + write(*,'(1p,10l4)') freezing(1:le) + write(*,*) 'washout: qtnetlcxa' + write(*,'(1p,5g15.7)') frc(1:le,1) + write(*,*) 'washout: qtnetlcxb' + write(*,'(1p,5g15.7)') frc(1:le,2) + write(*,*) 'washout: qtnetlax' + write(*,'(1p,5g15.7)') frc(1:le,3) + write(*,*) ' ' + endif + endif +!----------------------------------------------------------------------- +! reload new tracer mass and rescale moments: check upper limits (LE) +!----------------------------------------------------------------------- + QTTJFL(:le,N) = QTTNEW(:le) + + end do species_loop +! + return + end subroutine washo +!--------------------------------------------------------------------- + subroutine DISGAS (CLWX,CFX,MOLMASS,HSTAR,TM,PR,QM,QT,QTDIS) +!--------------------------------------------------------------------- + implicit none + real(r8), intent(in) :: CLWX,CFX !cloud water,cloud fraction + real(r8), intent(in) :: MOLMASS !molecular mass of tracer + real(r8), intent(in) :: HSTAR !Henry's Law coeffs A*exp(-B/T) + real(r8), intent(in) :: TM !temperature of box (K) + real(r8), intent(in) :: PR !pressure of box (hPa) + real(r8), intent(in) :: QM !air mass in box (kg) + real(r8), intent(in) :: QT !tracer in box (kg) + real(r8), intent(out) :: QTDIS !tracer dissolved in aqueous phase + + real(r8) MUEMP + real(r8), parameter :: INV298 = 1._r8/298._r8 + real(r8), parameter :: TMIX=258._r8 + real(r8), parameter :: RETEFF=0.5_r8 +!---Next calculate rate of uptake of tracer + +!---effective Henry's Law constant: H* = moles-T / liter-precip / press(atm-T) +!---p(atm of tracer-T) = (QT/QM) * (.029/MolWt-T) * pressr(hPa)/1000 +!---limit temperature effects to T above freezing +!----MU from fit to Kaercher and Voigt (2006) + + if(TM .ge. TICE) then + QTDIS=(HSTAR*(QT/(QM*CFX))*0.029_r8*(PR/1.0e3_r8))*(CLWX*QM) + elseif (TM .le. TMIX) then + MUEMP=exp(-14.2252_r8+(1.55704e-1_r8*TM)-(7.1929e-4_r8*(TM**2.0_r8))) + QTDIS=MUEMP*(MOLMASS/18._r8)*(CLWX*QM) + else + QTDIS=RETEFF*((HSTAR*(QT/(QM*CFX))*0.029_r8*(PR/1.0e3_r8))*(CLWX*QM)) + endif + + return + end subroutine DISGAS + +!----------------------------------------------------------------------- + subroutine RAINGAS (RRAIN,DTSCAV,CLWX,CFX,QM,QT,QTDIS,QTRAIN) +!----------------------------------------------------------------------- +!---New trace-gas rainout from large-scale precip with two time scales, +!---one based on precip formation from cloud water and one based on +!---Henry's Law solubility: correct limit for delta-t +!--- +!---NB this code does not consider the aqueous dissociation (eg, C-q) +!--- that makes uptake of HNO3 and H2SO4 so complete. To do so would +!--- require that we keep track of the pH of the falling rain. +!---THUS the Henry's Law coefficient KHA needs to be enhanced to incldue this! +!---ALSO the possible formation of other soluble species from, eg, CH2O, H2O2 +!--- can be considered with enhanced values of KHA. +!--- +!---Does NOT now use RMC (moist conv rain) but could, assuming 30% coverage +!----------------------------------------------------------------------- + implicit none + real(r8), intent(in) :: RRAIN !new rain formation in box (kg/s) + real(r8), intent(in) :: DTSCAV !time step (s) + real(r8), intent(in) :: CLWX,CFX !cloud water and cloud fraction + real(r8), intent(in) :: QM !air mass in box (kg) + real(r8), intent(in) :: QT !tracer in box (kg) + real(r8), intent(in) :: QTDIS !tracer in aqueous phase (kg) + real(r8), intent(out) :: QTRAIN !tracer picked up by new rain + + real(r8) QTLF,QTDISSTAR + + + + + + QTDISSTAR=(QTDIS*(QT*CFX))/(QTDIS+(QT*CFX)) + +!---Tracer Loss frequency (1/s) within cloud fraction: + QTLF = (RRAIN*QTDISSTAR)/(CLWX*QM*QT*CFX) + +!---in time = DTSCAV, the amount of QTT scavenged is calculated +!---from CF*AMOUNT OF UPTAKE + QTRAIN = QT*CFX*(1._r8 - exp(-DTSCAV*QTLF)) + + return + end subroutine RAINGAS + + +!----------------------------------------------------------------------- + subroutine WASHGAS (RWASH,BOXF,DTSCAV,QTRTOP,HSTAR,TM,PR,QM, & + QT,QTWASH,QTEVAP) +!----------------------------------------------------------------------- +!---for most gases below-cloud washout assume Henry-Law equilib with precip +!---assumes that precip is liquid, if frozen, do not call this sub +!---since solubility is moderate, fraction of box with rain does not matter +!---NB this code does not consider the aqueous dissociation (eg, C-q) +!--- that makes uptake of HNO3 and H2SO4 so complete. To do so would +!--- require that we keep track of the pH of the falling rain. +!---THUS the Henry's Law coefficient KHA needs to be enhanced to incldue this! +!---ALSO the possible formation of other soluble species from, eg, CH2O, H2O2 +!--- can be considered with enhanced values of KHA. +!----------------------------------------------------------------------- + implicit none + real(r8), intent(in) :: RWASH ! precip leaving bottom of box (kg/s) + real(r8), intent(in) :: BOXF ! fraction of box with washout + real(r8), intent(in) :: DTSCAV ! time step (s) + real(r8), intent(in) :: QTRTOP ! tracer-T in rain entering top of box +! over time step (kg) + real(r8), intent(in) :: HSTAR ! Henry's Law coeffs A*exp(-B/T) + real(r8), intent(in) :: TM ! temperature of box (K) + real(r8), intent(in) :: PR ! pressure of box (hPa) + real(r8), intent(in) :: QT ! tracer in box (kg) + real(r8), intent(in) :: QM ! air mass in box (kg) + real(r8), intent(out) :: QTWASH ! tracer picked up by precip (kg) + real(r8), intent(out) :: QTEVAP ! tracer evaporated from precip (kg) + + real(r8), parameter :: INV298 = 1._r8/298._r8 + real(r8) :: FWASH, QTMAX, QTDIF + +!---effective Henry's Law constant: H* = moles-T / liter-precip / press(atm-T) +!---p(atm of tracer-T) = (QT/QM) * (.029/MolWt-T) * pressr(hPa)/1000 +!---limit temperature effects to T above freezing + +! +! jfl +! +! added test for BOXF = 0. +! + if ( BOXF == 0._r8 ) then + QTWASH = 0._r8 + QTEVAP = 0._r8 + return + end if + +!---effective washout frequency (1/s): + FWASH = (RWASH*HSTAR*29.e-6_r8*PR)/(QM*BOXF) +!---equilib amount of T (kg) in rain thru bottom of box over time step + QTMAX = QT*FWASH*DTSCAV + if (QTMAX .gt. QTRTOP) then +!---more of tracer T can go into rain + QTDIF = min (QT, QTMAX-QTRTOP) + QTWASH = QTDIF * (1._r8 - exp(-DTSCAV*FWASH)) + QTEVAP=0._r8 + else +!--too much of T in rain, must degas/evap T + QTWASH = 0._r8 + QTEVAP = QTRTOP - QTMAX + endif + + return + end subroutine WASHGAS + +!----------------------------------------------------------------------- + function DEMPIRICAL (CWATER,RRATE) +!----------------------------------------------------------------------- + use shr_spfn_mod, only: shr_spfn_gamma + + implicit none + real(r8), intent(in) :: CWATER + real(r8), intent(in) :: RRATE + + real(r8) :: DEMPIRICAL + + real(r8) RRATEX,WX,THETA,PHI,ETA,BETA,ALPHA,BEE + real(r8) GAMTHETA,GAMBETA + + + + RRATEX=RRATE*3600._r8 !mm/hr + WX=CWATER*1.0e3_r8 !g/m3 + + if(RRATEX .gt. 0.04_r8) then + THETA=exp(-1.43_r8*dlog10(7._r8*RRATEX))+2.8_r8 + else + THETA=5._r8 + endif + PHI=RRATEX/(3600._r8*10._r8) !cgs units + ETA=exp((3.01_r8*THETA)-10.5_r8) + BETA=THETA/(1._r8+0.638_r8) + ALPHA=exp(4._r8*(BETA-3.5_r8)) + BEE=(.638_r8*THETA/(1._r8+.638_r8))-1.0_r8 + GAMTHETA = shr_spfn_gamma(THETA) + GAMBETA = shr_spfn_gamma(BETA+1._r8) + DEMPIRICAL=(((WX*ETA*GAMTHETA)/(1.0e6_r8*ALPHA*PHI*GAMBETA))** & + (-1._r8/BEE))*10._r8 ! in mm (wx/1e6 for cgs) + + + return + end function DEMPIRICAL +! +end module mo_neu_wetdep diff --git a/src/chemistry/pp_geoschem/mo_setinv.F90 b/src/chemistry/pp_geoschem/mo_setinv.F90 new file mode 100644 index 0000000000..c36b70b8c6 --- /dev/null +++ b/src/chemistry/pp_geoschem/mo_setinv.F90 @@ -0,0 +1,153 @@ + +module mo_setinv + + use shr_kind_mod, only : r8 => shr_kind_r8 + use cam_logfile, only : iulog + use chem_mods, only : inv_lst, nfs, gas_pcnst + use cam_history, only : addfld, outfld + use ppgrid, only : pcols, pver + + implicit none + + save + + integer :: id_o, id_o2, id_h + integer :: m_ndx, o2_ndx, n2_ndx, h2o_ndx, o3_ndx + logical :: has_o2, has_n2, has_h2o, has_o3, has_var_o2 + + private + public :: setinv_inti, setinv, has_h2o, o2_ndx, h2o_ndx, n2_ndx + +contains + + subroutine setinv_inti + !----------------------------------------------------------------- + ! ... initialize the module + !----------------------------------------------------------------- + + use mo_chem_utls, only : get_inv_ndx, get_spc_ndx + use spmd_utils, only : masterproc + + implicit none + + integer :: i + + m_ndx = get_inv_ndx( 'M' ) + n2_ndx = get_inv_ndx( 'N2' ) + o2_ndx = get_inv_ndx( 'O2' ) + h2o_ndx = get_inv_ndx( 'H2O' ) + o3_ndx = get_inv_ndx( 'O3' ) + + id_o = get_spc_ndx('O') + id_o2 = get_spc_ndx('O2') + id_h = get_spc_ndx('H') + + has_var_o2 = id_o2>0 .and. id_o>0 .and. id_h>0 + + has_n2 = n2_ndx > 0 + has_o2 = o2_ndx > 0 + has_h2o = h2o_ndx > 0 + has_o3 = o3_ndx > 0 + + if (masterproc) write(iulog,*) 'setinv_inti: m,n2,o2,h2o ndx = ',m_ndx,n2_ndx,o2_ndx,h2o_ndx + + do i = 1,nfs + call addfld( trim(inv_lst(i))//'_dens', (/ 'lev' /),'A', 'molecules/cm3', 'invariant density' ) + !call addfld( trim(inv_lst(i))//'_mmr', (/ 'lev' /),'A', 'kg/kg', 'invariant density' ) + call addfld( trim(inv_lst(i))//'_vmr', (/ 'lev' /),'A', 'mole/mole', 'invariant density' ) + enddo + + end subroutine setinv_inti + + subroutine setinv( invariants, tfld, h2ovmr, vmr, pmid, ncol, lchnk, pbuf ) + !----------------------------------------------------------------- + ! ... set the invariant densities (molecules/cm**3) + !----------------------------------------------------------------- + + use mo_constants, only : boltz_cgs + use tracer_cnst, only : num_tracer_cnst, tracer_cnst_flds, get_cnst_data + use mo_chem_utls, only : get_inv_ndx + use physics_buffer, only : physics_buffer_desc + + implicit none + + !----------------------------------------------------------------- + ! ... dummy arguments + !----------------------------------------------------------------- + integer, intent(in) :: ncol ! chunk column count + real(r8), intent(in) :: tfld(pcols,pver) ! temperature + real(r8), intent(in) :: h2ovmr(ncol,pver) ! water vapor vmr + real(r8), intent(in) :: pmid(pcols,pver) ! pressure + integer, intent(in) :: lchnk ! chunk number + real(r8), intent(in) :: vmr(ncol,pver,gas_pcnst) ! vmr + real(r8), intent(out) :: invariants(ncol,pver,nfs) ! invariant array + type(physics_buffer_desc), pointer :: pbuf(:) + + + real(r8) :: cnst_offline( ncol, pver ) + + !----------------------------------------------------------------- + ! .. local variables + !----------------------------------------------------------------- + integer :: k, i, ndx + real(r8), parameter :: Pa_xfac = 10._r8 ! Pascals to dyne/cm^2 + real(r8) :: sum1(ncol) + real(r8) :: tmp_out(ncol,pver) + + !----------------------------------------------------------------- + ! note: invariants are in cgs density units. + ! the pmid array is in pascals and must be + ! mutiplied by 10. to yield dynes/cm**2. + !----------------------------------------------------------------- + invariants(:,:,:) = 0._r8 + !----------------------------------------------------------------- + ! ... set m, n2, o2, and h2o densities + !----------------------------------------------------------------- + do k = 1,pver + invariants(:ncol,k,m_ndx) = Pa_xfac * pmid(:ncol,k) / (boltz_cgs*tfld(:ncol,k)) + end do + + if( has_n2 ) then + if ( has_var_o2 ) then + do k = 1,pver + sum1(:ncol) = (vmr(:ncol,k,id_o) + vmr(:ncol,k,id_o2) + vmr(:ncol,k,id_h)) + invariants(:ncol,k,n2_ndx) = (1._r8 - sum1(:)) * invariants(:ncol,k,m_ndx) + end do + else + do k = 1,pver + invariants(:ncol,k,n2_ndx) = .79_r8 * invariants(:ncol,k,m_ndx) + end do + endif + end if + if( has_o2 ) then + do k = 1,pver + invariants(:ncol,k,o2_ndx) = .21_r8 * invariants(:ncol,k,m_ndx) + end do + end if + if( has_h2o ) then + do k = 1,pver + invariants(:ncol,k,h2o_ndx) = h2ovmr(:ncol,k) * invariants(:ncol,k,m_ndx) + end do + end if + + do i = 1,num_tracer_cnst + + call get_cnst_data( tracer_cnst_flds(i), cnst_offline, ncol, lchnk, pbuf ) + ndx = get_inv_ndx( tracer_cnst_flds(i) ) + + do k = 1,pver + invariants(:ncol,k,ndx) = cnst_offline(:ncol,k)*invariants(:ncol,k,m_ndx) + enddo + + enddo + + do i = 1,nfs + tmp_out(:ncol,:) = invariants(:ncol,:,i) + call outfld( trim(inv_lst(i))//'_dens', tmp_out(:ncol,:), ncol, lchnk ) + tmp_out(:ncol,:) = invariants(:ncol,:,i) / invariants(:ncol,:,m_ndx) + call outfld( trim(inv_lst(i))//'_vmr', tmp_out(:ncol,:), ncol, lchnk ) + enddo + + end subroutine setinv + +end module mo_setinv diff --git a/src/chemistry/pp_geoschem/tracer_cnst.F90 b/src/chemistry/pp_geoschem/tracer_cnst.F90 new file mode 100644 index 0000000000..803e3e1061 --- /dev/null +++ b/src/chemistry/pp_geoschem/tracer_cnst.F90 @@ -0,0 +1,371 @@ +!------------------------------------------------------------------- +! manages reading and interpolation of offline tracer fields +! Created by: Francis Vitt -- 2 May 2006 +!------------------------------------------------------------------- +module tracer_cnst + + use shr_kind_mod, only : r8 => shr_kind_r8 + use cam_abortutils, only : endrun + use spmd_utils, only : masterproc + use tracer_data, only : trfld,trfile,MAXTRCRS + use cam_logfile, only : iulog + + implicit none + + private ! all unless made public + save + + public :: tracer_cnst_init + public :: num_tracer_cnst + public :: tracer_cnst_flds + public :: tracer_cnst_adv + public :: get_cnst_data + public :: get_cnst_data_ptr + public :: write_tracer_cnst_restart + public :: read_tracer_cnst_restart + public :: tracer_cnst_defaultopts + public :: tracer_cnst_setopts + public :: init_tracer_cnst_restart + + type(trfld), pointer :: fields(:) => null() + type(trfile) :: file + + integer :: num_tracer_cnst + character(len=16), pointer :: tracer_cnst_flds(:) => null() + real(r8), allocatable, target, dimension(:,:,:,:) :: data_q ! constituent mass mixing ratios + + character(len=64) :: specifier(MAXTRCRS) = '' + character(len=256) :: filename = 'tracer_cnst_file' + character(len=256) :: filelist = '' + character(len=256) :: datapath = '' + character(len=32) :: data_type = 'SERIAL' + logical :: rmv_file = .false. + integer :: cycle_yr = 0 + integer :: fixed_ymd = 0 + integer :: fixed_tod = 0 + +contains + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine tracer_cnst_init() + + use mo_chem_utls,only : get_inv_ndx + use tracer_data, only : trcdata_init + use cam_history, only : addfld + use error_messages, only: handle_err + use ppgrid, only: pcols, pver, begchunk, endchunk + use physics_buffer, only : physics_buffer_desc + + implicit none + + integer :: i ,ndx, istat + + allocate(file%in_pbuf(size(specifier))) + file%in_pbuf(:) = .false. + call trcdata_init( specifier, filename, filelist, datapath, fields, file, & + rmv_file, cycle_yr, fixed_ymd, fixed_tod, data_type) + + num_tracer_cnst = 0 + if (associated(fields)) num_tracer_cnst = size( fields ) + + if( num_tracer_cnst < 1 ) then + if ( masterproc ) then + write(iulog,*) 'There are no offline invariant species' + write(iulog,*) ' ' + endif + return + end if + + allocate( tracer_cnst_flds(num_tracer_cnst), stat=istat) + call handle_err(istat, 'tracer_cnst_init: ERROR allocating tracer_cnst_flds') + + + do i = 1, num_tracer_cnst + + ndx = get_inv_ndx( fields(i)%fldnam ) + + if (ndx < 1) then + write(iulog,*) fields(i)%fldnam//' is not an invariant' + call endrun('tracer_cnst_init') + endif + + tracer_cnst_flds(i) = fields(i)%fldnam + + call addfld(trim(fields(i)%fldnam), (/ 'lev' /), & + 'I','mol/mol', 'prescribed tracer constituent' ) + enddo + + allocate(data_q(pcols,pver,num_tracer_cnst,begchunk:endchunk), stat=istat) + call handle_err(istat, 'tracer_cnst_init: ERROR allocating data_q') + + end subroutine tracer_cnst_init + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine tracer_cnst_setopts( & + tracer_cnst_file_in, & + tracer_cnst_filelist_in, & + tracer_cnst_datapath_in, & + tracer_cnst_type_in, & + tracer_cnst_specifier_in, & + tracer_cnst_rmfile_in, & + tracer_cnst_cycle_yr_in, & + tracer_cnst_fixed_ymd_in, & + tracer_cnst_fixed_tod_in & + ) + + implicit none + + character(len=*), intent(in), optional :: tracer_cnst_file_in + character(len=*), intent(in), optional :: tracer_cnst_filelist_in + character(len=*), intent(in), optional :: tracer_cnst_datapath_in + character(len=*), intent(in), optional :: tracer_cnst_type_in + character(len=*), intent(in), optional :: tracer_cnst_specifier_in(:) + logical, intent(in), optional :: tracer_cnst_rmfile_in + integer, intent(in), optional :: tracer_cnst_cycle_yr_in + integer, intent(in), optional :: tracer_cnst_fixed_ymd_in + integer, intent(in), optional :: tracer_cnst_fixed_tod_in + + if ( present(tracer_cnst_file_in) ) then + filename = tracer_cnst_file_in + endif + if ( present(tracer_cnst_filelist_in) ) then + filelist = tracer_cnst_filelist_in + endif + if ( present(tracer_cnst_datapath_in) ) then + datapath = tracer_cnst_datapath_in + endif + if ( present(tracer_cnst_type_in) ) then + data_type = tracer_cnst_type_in + endif + if ( present(tracer_cnst_specifier_in) ) then + specifier = tracer_cnst_specifier_in + endif + if ( present(tracer_cnst_rmfile_in) ) then + rmv_file = tracer_cnst_rmfile_in + endif + if ( present(tracer_cnst_cycle_yr_in) ) then + cycle_yr = tracer_cnst_cycle_yr_in + endif + if ( present(tracer_cnst_fixed_ymd_in) ) then + fixed_ymd = tracer_cnst_fixed_ymd_in + endif + if ( present(tracer_cnst_fixed_tod_in) ) then + fixed_tod = tracer_cnst_fixed_tod_in + endif + + endsubroutine tracer_cnst_setopts + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine tracer_cnst_defaultopts( & + tracer_cnst_file_out, & + tracer_cnst_filelist_out, & + tracer_cnst_datapath_out, & + tracer_cnst_type_out, & + tracer_cnst_specifier_out,& + tracer_cnst_rmfile_out, & + tracer_cnst_cycle_yr_out, & + tracer_cnst_fixed_ymd_out,& + tracer_cnst_fixed_tod_out & + ) + + implicit none + + character(len=*), intent(out), optional :: tracer_cnst_file_out + character(len=*), intent(out), optional :: tracer_cnst_filelist_out + character(len=*), intent(out), optional :: tracer_cnst_datapath_out + character(len=*), intent(out), optional :: tracer_cnst_type_out + character(len=*), intent(out), optional :: tracer_cnst_specifier_out(:) + logical, intent(out), optional :: tracer_cnst_rmfile_out + integer, intent(out), optional :: tracer_cnst_cycle_yr_out + integer, intent(out), optional :: tracer_cnst_fixed_ymd_out + integer, intent(out), optional :: tracer_cnst_fixed_tod_out + + if ( present(tracer_cnst_file_out) ) then + tracer_cnst_file_out = filename + endif + if ( present(tracer_cnst_filelist_out) ) then + tracer_cnst_filelist_out = filelist + endif + if ( present(tracer_cnst_datapath_out) ) then + tracer_cnst_datapath_out = datapath + endif + if ( present(tracer_cnst_type_out) ) then + tracer_cnst_type_out = data_type + endif + if ( present(tracer_cnst_specifier_out) ) then + tracer_cnst_specifier_out = specifier + endif + if ( present(tracer_cnst_rmfile_out) ) then + tracer_cnst_rmfile_out = rmv_file + endif + if ( present(tracer_cnst_cycle_yr_out) ) then + tracer_cnst_cycle_yr_out = cycle_yr + endif + if ( present(tracer_cnst_fixed_ymd_out) ) then + tracer_cnst_fixed_ymd_out = fixed_ymd + endif + if ( present(tracer_cnst_fixed_tod_out) ) then + tracer_cnst_fixed_tod_out = fixed_tod + endif + + endsubroutine tracer_cnst_defaultopts + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine tracer_cnst_adv( pbuf2d, state ) + + use physics_buffer, only : physics_buffer_desc + use tracer_data, only : advance_trcdata + use physics_types,only : physics_state + use ppgrid, only : begchunk, endchunk + use ppgrid, only : pcols, pver + use string_utils, only : to_lower, GLC + use chem_mods, only : fix_mass + use mo_chem_utls, only : get_inv_ndx + use cam_history, only : outfld + use physconst, only: mwdry ! molecular weight dry air ~ kg/kmole + use physconst, only: boltz + + implicit none + + type(physics_state), intent(in):: state(begchunk:endchunk) + type(physics_buffer_desc), pointer :: pbuf2d(:,:) + + integer :: i,ind,c,ncol + real(r8) :: to_vmr(pcols,pver) + + if( num_tracer_cnst < 1 ) return + + call advance_trcdata( fields, file, state, pbuf2d ) + + ! copy prescribed tracer fields into state variable with the correct units + + do i = 1,num_tracer_cnst + ind = get_inv_ndx( tracer_cnst_flds(i) ) + do c = begchunk,endchunk + ncol = state(c)%ncol + + select case ( to_lower(trim(fields(i)%units(:GLC(fields(i)%units)))) ) + case ("molec/cm3","/cm3","molecules/cm3","cm^-3","cm**-3") + to_vmr(:ncol,:) = (1.e6_r8*boltz*state(c)%t(:ncol,:))/(state(c)%pmiddry(:ncol,:)) + case ('kg/kg','mmr') + to_vmr(:ncol,:) = mwdry/fix_mass(ind) + case ('mol/mol','mole/mole','vmr') + to_vmr(:ncol,:) = 1._r8 + case default + write(iulog,*) 'tracer_cnst_adv: units = ',trim(fields(i)%units) ,' are not recognized' + call endrun('tracer_cnst_adv: units are not recognized') + end select + + fields(i)%data(:ncol,:,c) = to_vmr(:ncol,:) * fields(i)%data(:ncol,:,c) ! vmr + call outfld( trim(tracer_cnst_flds(i)), fields(i)%data(:ncol,:,c), ncol, state(c)%lchnk ) + + enddo + enddo + + end subroutine tracer_cnst_adv + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine get_cnst_data( field_name, data, ncol, lchnk, pbuf ) + + use tracer_data, only : get_fld_data + use physics_buffer, only : physics_buffer_desc + + implicit none + + character(len=*), intent(in) :: field_name + real(r8), intent(out) :: data(:,:) + integer, intent(in) :: lchnk + integer, intent(in) :: ncol + type(physics_buffer_desc), pointer :: pbuf(:) + + if( num_tracer_cnst < 1 ) return + + call get_fld_data( fields, field_name, data, ncol, lchnk, pbuf ) + + end subroutine get_cnst_data + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine get_cnst_data_ptr(name, state, q, pbuf) + + use tracer_data, only : get_fld_data, get_fld_ndx + use physconst, only : mwdry ! molecular weight dry air ~ kg/kmole + use chem_mods, only : fix_mass + use mo_chem_utls, only : get_inv_ndx + use physics_types, only : physics_state + use ppgrid, only : pcols, pver + use physics_buffer, only : physics_buffer_desc + + implicit none + + character(len=*), intent(in) :: name + type(physics_state), intent(in) :: state + real(r8), pointer, dimension(:,:) :: q ! constituent mass mixing ratio + type(physics_buffer_desc), pointer :: pbuf(:) + + integer :: lchnk + integer :: ncol + integer :: inv_id, idx + + lchnk = state%lchnk + ncol = state%ncol + + ! make sure the requested constituent can be provided + inv_id = get_inv_ndx(name) + if (.not. inv_id > 0) then + if (masterproc) then + write(iulog,*) 'get_cnst_data_ptr: '//name//' is not a prescribed tracer constituent' + endif + return + endif + + + call get_fld_ndx( fields, name, idx ) + call get_fld_data( fields, name, data_q(:,:,idx,lchnk), ncol, lchnk, pbuf ) + + data_q(:ncol,:,idx,lchnk) = data_q(:ncol,:,idx,lchnk)*fix_mass(inv_id)/mwdry ! vmr->mmr + q => data_q(:,:,idx,lchnk) + + end subroutine get_cnst_data_ptr + +!------------------------------------------------------------------- + + subroutine init_tracer_cnst_restart( piofile ) + use pio, only : file_desc_t + use tracer_data, only : init_trc_restart + implicit none + type(file_desc_t),intent(inout) :: pioFile ! pio File pointer + + call init_trc_restart( 'tracer_cnst', piofile, file ) + + end subroutine init_tracer_cnst_restart +!------------------------------------------------------------------- + subroutine write_tracer_cnst_restart( piofile ) + use tracer_data, only : write_trc_restart + use pio, only : file_desc_t + implicit none + + type(file_desc_t) :: piofile + + call write_trc_restart( piofile, file ) + + end subroutine write_tracer_cnst_restart + +!------------------------------------------------------------------- + subroutine read_tracer_cnst_restart( pioFile ) + use tracer_data, only : read_trc_restart + use pio, only : file_desc_t + implicit none + + type(file_desc_t) :: piofile + + call read_trc_restart( 'tracer_cnst', piofile, file ) + + end subroutine read_tracer_cnst_restart + +end module tracer_cnst From a97c5115dd66dc6569324bd12cf7ccdbecc3130b Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 2 Sep 2020 12:17:05 -0400 Subject: [PATCH 129/239] Feat: Add NEU WD routines + MAM gas-aerosol exchange ( 1) Added NEU wet deposition routines. Option to choose between NEU and GEOS-Chem wet deposition scheme is available at runtime. See commit #a8d642c ( 2) Added diagnostic fields for wet deposition. These match the names of the same quantities in MOZART ( 3) Added MAM gas-aerosol exchange ( 4) Rename field DDVel and SurfFlux into DepVel and DepFlux. Might need to change those in the future to match those in MOZART ( 5) Established MAM4 aerosol to GEOS-Chem species mapping based on discussion with Louisa Emmons ( 6) Added inverse mapping map2GCinv hat maps tracers onto constituent. This is now used in chem_emissions. ( 7) Added map2chm which maps solsym onto GEOS-Chem species and constituents ( 8) Remove special handlings when defining constituents. Variable names are now changed in the IC file. ( 9) Compute CSZAmid field (10) Fix bug where qH2O was flipped vertically Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 1036 ++++++++++++++--------- 1 file changed, 636 insertions(+), 400 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 03423c0000..b3db0b9c34 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -40,26 +40,28 @@ module chemistry use chem_mods, only : nTracersMax use chem_mods, only : nTracers - use chem_mods, only : tracerNames - use chem_mods, only : tracerLongNames - use chem_mods, only : adv_Mass + use chem_mods, only : gas_pcnst + use chem_mods, only : tracerNames, tracerLongNames + use chem_mods, only : adv_mass use chem_mods, only : mwRatio use chem_mods, only : ref_MMR use chem_mods, only : nSlsMax use chem_mods, only : nSls - use chem_mods, only : slsNames - use chem_mods, only : slsLongNames + use chem_mods, only : slsNames, slsLongNames use chem_mods, only : sls_ref_MMR use chem_mods, only : slsmwRatio use chem_mods, only : nAerMax use chem_mods, only : nAer use chem_mods, only : aerNames use chem_mods, only : aerAdvMass - use chem_mods, only : map2GC + use chem_mods, only : map2GC, map2GCinv use chem_mods, only : map2GC_Sls + use chem_mods, only : map2chm use chem_mods, only : map2Idx use chem_mods, only : map2MAM4 + use mo_tracname, only : solsym + IMPLICIT NONE PRIVATE SAVE @@ -105,6 +107,8 @@ module chemistry ! Indices of critical species INTEGER :: iH2O, iO3, iCH4, iCO, iNO + INTEGER :: iO, iH, iO2, iPSO4 + REAL(r8) :: MWPSO4 ! Indices in the physics buffer INTEGER :: NDX_PBLH ! PBL height [m] @@ -113,13 +117,17 @@ module chemistry INTEGER :: NDX_CLDFRC ! Cloud fraction [-] INTEGER :: NDX_PRAIN ! Rain production rate [kg/kg/s] INTEGER :: NDX_NEVAPR ! Total rate of precipitation evaporation [kg/kg/s] - INTEGER :: NDX_RPRDTOT ! Convective total precip. production rate [kg/kg/s] INTEGER :: NDX_LSFLXPRC ! Large-scale precip. at interface (liq + snw) [kg/m2/s] INTEGER :: NDX_LSFLXSNW ! Large-scale precip. at interface (snow only) [kg/m2/s] + INTEGER :: NDX_CMFDQR ! Convective total precip. production rate [kg/kg/s] ! Get constituent indices - INTEGER :: ixCldLiq - INTEGER :: ixCldIce + INTEGER :: ixCldLiq ! Cloud liquid water + INTEGER :: ixCldIce ! Cloud ice + INTEGER :: ixNDrop ! Cloud droplet number index + + ! Index of 1st constituent + INTEGER :: iFirstCnst = -1 ! Strings CHARACTER(LEN=255) :: ThisLoc @@ -196,9 +204,9 @@ subroutine chem_register ! !----------------------------------------------------------------------- ! Need to generate a temporary species database - Type(ChmState) :: SC - Type(GrdState) :: SG - Type(OptInput) :: IO + TYPE(ChmState) :: SC + TYPE(GrdState) :: SG + TYPE(OptInput) :: IO TYPE(Species), POINTER :: ThisSpc INTEGER :: I, N, M, L @@ -211,6 +219,7 @@ subroutine chem_register CHARACTER(LEN=128) :: molectype CHARACTER(LEN=128) :: lngName CHARACTER(LEN=64) :: cnstName + CHARACTER(LEN=64) :: trueName LOGICAL :: camout LOGICAL :: ic_from_cam2 LOGICAL :: has_fixed_ubc @@ -258,10 +267,10 @@ subroutine chem_register DO I = 1, nTracers IO%AdvectSpc_Name(I) = TRIM(tracerNames(I)) ENDDO - IO%SALA_rEdge_um(1) = 0.01E+0_FP - IO%SALA_rEdge_um(2) = 0.50E+0_FP - IO%SALC_rEdge_um(1) = 0.50E+0_FP - IO%SALC_rEdge_um(2) = 8.00E+0_FP + IO%SALA_rEdge_um(1) = 0.01e+0_fp + IO%SALA_rEdge_um(2) = 0.50e+0_fp + IO%SALC_rEdge_um(1) = 0.50e+0_fp + IO%SALC_rEdge_um(2) = 8.00e+0_fp IO%SpcDatabaseFile = TRIM(speciesDBPath) @@ -288,78 +297,42 @@ subroutine chem_register CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - map2GC = -1 + map2GC = -1 + map2GCinv = -1 + map2chm = -1 ref_MMR(:) = 0.0e+0_r8 MWRatio(:) = 1.0e+0_r8 tracerLongNames = '' DO I = 1, nTracersMax IF ( I .LE. nTracers ) THEN - cnstName = TRIM(tracerNames(I)) - N = Ind_(cnstName) - ThisSpc => SC%SpcData(N)%Info - lngName = TRIM(ThisSpc%FullName) - MWTmp = REAL(ThisSpc%MW_g,r8) - ref_VMR = REAL(ThisSpc%BackgroundVV,r8) - adv_Mass(I) = MWTmp - ref_MMR(I) = ref_VMR / (MWDry / MWTmp) - IF ( ThisSpc%Is_Gas == .FALSE. ) THEN - Write(cnstName, "(a,a)") 'GC_AER_', & - to_upper(TRIM(tracerNames(I))) - ! Aerosols that inherited from MAM do not need to be defined as a - ! constituent - ! For instance, - ! - SOAGX is inherited from SOAG[0-4], - ! - ! List of GEOS-Chem aerosols: - ! DMS - ! SO4 - ! SO4s - ! MSA - ! NH4 - ! NIT - ! NITs - ! BCPI - ! OCPI - ! BCPO - ! OCPO - ! DST[1-4] - ! SALA - ! SALC - ! TSOA[0-3] - ! ASOAN - ! ASOA[1-3] - ! SOAS - ! SOAIE - ! SOAME - ! SOAGX - ! SOAMG - ! LVOCOA - ! ISN1OA - ! IONITA - ! MONITA - ! INDIOL - ! BrSALA - ! BrSALC - ! ISALA - ! ISALC - ! AERI - ! pFe - ! TMMF, Update this - ENDIF + cnstName = TRIM(tracerNames(I)) + trueName = cnstName + N = Ind_(cnstName) + ThisSpc => SC%SpcData(N)%Info + lngName = TRIM(ThisSpc%FullName) + MWTmp = REAL(ThisSpc%MW_g,r8) + ref_VMR = REAL(ThisSpc%BackgroundVV,r8) + ref_MMR(I) = ref_VMR / (MWDry / MWTmp) + IF ( ThisSpc%Is_Gas == .FALSE. ) THEN + Write(cnstName, "(a,a)") 'GC_AER_', to_upper(TRIM(trueName)) + ! Aerosols that inherited from MAM do not need to be defined as a + ! constituent + ! For instance, + ! - SOAGX is inherited from SOAG[0-4] + ! - BCPI is inherited from bc_a1 + ENDIF ELSEIF ( I .LE. (nTracers + nAer)) THEN - ! Add MAM4 aerosols - cnstName = TRIM(aerNames(I - nTracers)) - lngName = cnstName - MWTmp = aerAdvMass(I - nTracers) - adv_Mass(I) = MWTmp - ref_MMR(I) = 1.0e-38_r8 + ! Add MAM4 aerosols + cnstName = TRIM(aerNames(I - nTracers)) + lngName = cnstName + MWTmp = aerAdvMass(I - nTracers) + ref_MMR(I) = 1.0e-38_r8 ELSE - cnstName = TRIM(tracerNames(I)) - lngName = cnstName - MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) - adv_Mass(I) = MWTmp - ref_MMR(I) = 1.0e-38_r8 + cnstName = TRIM(tracerNames(I)) + lngName = cnstName + MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) + ref_MMR(I) = 1.0e-38_r8 ENDIF MWRatio(I) = MWDry/MWTmp tracerLongNames(I) = TRIM(lngName) @@ -380,39 +353,50 @@ subroutine chem_register has_fixed_ubc = .false. ! Use a fixed flux condition at the upper boundary has_fixed_ubflx = .false. - ! NOTE: In MOZART, this only gets called for tracers - ! This is the call to add a "constituent" + + ! TMMF - 8/20/2020 + ! Note: I had to modify the IC file to rename variables such as + ! CH3COCH3 into ACET. Using that new IC file, we can thus remove + ! the unnecessary special handlings. + ! Another option would have been to modify cnst_add and read_inidat + ! to use a load_name the first time IC are read. Constituent names + ! would be stored in cnst_name, while read_inidat would load from + ! load_name. load_name would be an optional argument to cnst_add, such + ! that, by default, load_name = cnst_name. + ! However, this would be tricky to handle with restart files that + ! would save cnst_name rather than load_name. + ! Special handlings - IF ( cnstName == 'ACET' ) THEN - cnstName = 'CH3COCH3' - ELSEIF ( cnstName == 'ALD2' ) THEN - cnstName = 'CH3CHO' - ELSEIF ( cnstName == 'PRPE' ) THEN - cnstName = 'C3H6' - ELSEIF ( cnstName == 'HNO4' ) THEN + IF ( cnstName == 'HNO4' ) THEN cnstName = 'HO2NO2' ELSEIF ( cnstName == 'HNO2' ) THEN cnstName = 'HONO' - ELSEIF ( cnstName == 'MP' ) THEN - cnstName = 'CH3OOH' - ELSEIF ( cnstName == 'HAC' ) THEN - cnstName = 'HYAC' - ELSEIF ( cnstName == 'GLYC' ) THEN - cnstName = 'GLYALD' - ELSEIF ( cnstName == 'MAP' ) THEN - cnstName = 'CH3COOOH' - ELSEIF ( cnstName == 'EOH' ) THEN - cnstName = 'C2H5OH' - ELSEIF ( cnstName == 'MGLY' ) THEN - cnstName = 'CH3COCHO' - ELSEIF ( cnstName == 'GLYX' ) THEN - cnstName = 'GLYOXAL' - ELSEIF ( cnstName == 'ACTA' ) THEN - cnstName = 'CH3COOH' - ELSEIF ( cnstName == 'TOLU' ) THEN - cnstName = 'TOLUENE' ELSEIF ( cnstName == 'HCHO' ) THEN cnstName = 'CH2O' + !ELSEIF ( cnstName == 'ACET' ) THEN + ! cnstName = 'CH3COCH3' + !ELSEIF ( cnstName == 'ALD2' ) THEN + ! cnstName = 'CH3CHO' + !ELSEIF ( cnstName == 'PRPE' ) THEN + ! cnstName = 'C3H6' + !ELSEIF ( cnstName == 'MP' ) THEN + ! cnstName = 'CH3OOH' + !ELSEIF ( cnstName == 'HAC' ) THEN + ! cnstName = 'HYAC' + !ELSEIF ( cnstName == 'GLYC' ) THEN + ! cnstName = 'GLYALD' + !ELSEIF ( cnstName == 'MAP' ) THEN + ! cnstName = 'CH3COOOH' + !ELSEIF ( cnstName == 'EOH' ) THEN + ! cnstName = 'C2H5OH' + !ELSEIF ( cnstName == 'MGLY' ) THEN + ! cnstName = 'CH3COCHO' + !ELSEIF ( cnstName == 'GLYX' ) THEN + ! cnstName = 'GLYOXAL' + !ELSEIF ( cnstName == 'ACTA' ) THEN + ! cnstName = 'CH3COOH' + !ELSEIF ( cnstName == 'TOLU' ) THEN + ! cnstName = 'TOLUENE' ENDIF If ( MasterProc ) Write(iulog,*) " Species = ", TRIM(cnstName) ! GEOS-Chem lumped species are not on restart file. @@ -421,20 +405,28 @@ subroutine chem_register ! These species will just be uniformily set to some low ! concentration. ! TMMF - 05/19/2020 - CALL cnst_add( cnstName, adv_Mass(I), cptmp, qmin, N, & + + ! This is the call to add a "constituent" + CALL cnst_add( cnstName, MWtmp, cptmp, qmin, N, & readiv=ic_from_cam2, mixtype=mixtype, & cam_outfld=camout, molectype=molectype, & fixed_ubc=has_fixed_ubc, & fixed_ubflx=has_fixed_ubflx, & longname=TRIM(lngName) ) + IF ( iFirstCnst < 0 ) iFirstCnst = N + ! Add to GC mapping. When starting a timestep, we will want to update the ! concentration of State_Chm(x)%Species(1,iCol,iLev,m) with data from ! constituent n M = Ind_(TRIM(tracerNames(I))) IF ( M > 0 ) THEN - map2GC(N) = M - map2Idx(N) = I + ! Map constituent onto GEOS-Chem tracer as indexed in State_Chm(LCHNK)%Species + map2GC(N) = M + ! Map GEOS-Chem tracer onto constituent + map2GCinv(M) = N + ! Map constituent onto raw index + map2Idx(N) = I ENDIF ! Nullify pointer ThisSpc => NULL() @@ -466,6 +458,19 @@ subroutine chem_register ! More information: ! http://www.cesm.ucar.edu/models/atm-cam/docs/phys-interface/node5.html + DO N = 1, gas_pcnst + ! Map solsym onto GEOS-Chem species + map2chm(N) = Ind_(TRIM(solsym(N))) + IF ( map2chm(N) < 0 ) THEN + ! This is not a GEOS-Chem species and we thus map on constituents + ! Most likely, these will be MAM aerosols + ! We store the index as the opposite to not confuse with GEOS-Chem + ! indices. + CALL cnst_get_ind(TRIM(solsym(N)), I, abort=.true.) + map2chm(N) = -I + ENDIF + ENDDO + !============================================================== ! Get mapping between dry deposition species and species set !============================================================== @@ -517,7 +522,12 @@ subroutine chem_register DO L = 1, nspec_amode(M) SELECT CASE ( to_upper(xname_massptr(L,M)(:3)) ) CASE ( 'BC_' ) - map2MAM4(L,M) = Ind_('BCPI') + SELECT CASE ( to_upper(xname_massptr(L,M)(4:5)) ) + CASE ( 'A1' ) + map2MAM4(L,M) = Ind_('BCPI') + CASE ( 'A4' ) + map2MAM4(L,M) = Ind_('BCPO') + END SELECT CASE ( 'DST' ) SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) ) ! DST1 - Dust aerosol, Reff = 0.7 micrometers @@ -532,43 +542,7 @@ subroutine chem_register map2MAM4(L,M) = Ind_('DST4') END SELECT CASE ( 'SOA' ) - SELECT CASE ( to_upper(xname_massptr(L,M)(4:4)) ) - CASE ( '1' ) - SELECT CASE ( to_upper(xname_massptr(L,M)(6:7)) ) - CASE ( 'A1' ) - map2MAM4(L,M) = -1 !TMMF, Fill in - CASE ( 'A2' ) - map2MAM4(L,M) = -1 !TMMF, Fill in - END SELECT - CASE ( '2' ) - SELECT CASE ( to_upper(xname_massptr(L,M)(6:7)) ) - CASE ( 'A1' ) - map2MAM4(L,M) = -1 !TMMF, Fill in - CASE ( 'A2' ) - map2MAM4(L,M) = -1 !TMMF, Fill in - END SELECT - CASE ( '3' ) - SELECT CASE ( to_upper(xname_massptr(L,M)(6:7)) ) - CASE ( 'A1' ) - map2MAM4(L,M) = -1 !TMMF, Fill in - CASE ( 'A2' ) - map2MAM4(L,M) = -1 !TMMF, Fill in - END SELECT - CASE ( '4' ) - SELECT CASE ( to_upper(xname_massptr(L,M)(6:7)) ) - CASE ( 'A1' ) - map2MAM4(L,M) = -1 !TMMF, Fill in - CASE ( 'A2' ) - map2MAM4(L,M) = -1 !TMMF, Fill in - END SELECT - CASE ( '5' ) - SELECT CASE ( to_upper(xname_massptr(L,M)(6:7)) ) - CASE ( 'A1' ) - map2MAM4(L,M) = -1 !TMMF, Fill in - CASE ( 'A2' ) - map2MAM4(L,M) = -1 !TMMF, Fill in - END SELECT - END SELECT + map2MAM4(L,M) = Ind_('SOAS') CASE ( 'SO4' ) map2MAM4(L,M) = Ind_('SO4') CASE ( 'NCL' ) @@ -585,9 +559,9 @@ subroutine chem_register CASE ( 'POM' ) SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) ) CASE ( 'A1' ) - map2MAM4(L,M) = -1 !TMMF, Fill in + map2MAM4(L,M) = Ind_('OCPI') CASE ( 'A4' ) - map2MAM4(L,M) = -1 !TMMF, Fill in + map2MAM4(L,M) = Ind_('OCPO') END SELECT END SELECT ENDDO @@ -635,16 +609,19 @@ end subroutine chem_register subroutine chem_readnl(nlfile) - use cam_abortutils, only : endrun - use units, only : getunit, freeunit - use namelist_utils, only : find_group_name + use cam_abortutils, only : endrun + use units, only : getunit, freeunit + use namelist_utils, only : find_group_name #if defined( MODAL_AERO_4MODE ) - use aero_model, only : aero_model_readnl - use dust_model, only : dust_readnl + use aero_model, only : aero_model_readnl + use dust_model, only : dust_readnl #endif + use gas_wetdep_opts, only : gas_wetdep_readnl +#ifdef SPMD use mpishorthand - use gckpp_Model, only : nSpec, Spc_Names - use chem_mods, only : drySpc_ndx +#endif + use gckpp_Model, only : nSpec, Spc_Names + use chem_mods, only : drySpc_ndx ! args CHARACTER(LEN=*), INTENT(IN) :: nlfile ! filepath for file containing namelist input @@ -756,6 +733,8 @@ subroutine chem_readnl(nlfile) aerAdvMass(I) = -1.00_r8 ENDDO + CALL gas_wetdep_readnl(nlfile) + IF ( MasterProc ) THEN Write(iulog,'(/,a)') REPEAT( '=', 50 ) @@ -915,6 +894,7 @@ function chem_implements_cnst(name) chem_implements_cnst = .false. DO I = 1, nTracers + ! TMMF, will need to replace tracerNames by actual constituent names IF (TRIM(tracerNames(I)) .eq. TRIM(name)) THEN chem_implements_cnst = .true. EXIT @@ -932,35 +912,38 @@ subroutine chem_init(phys_state, pbuf2d) ! (and declare history variables) ! !----------------------------------------------------------------------- - use physics_buffer, only : physics_buffer_desc, pbuf_get_index - use cam_history, only : addfld, add_default, horiz_only - use chem_mods, only : map2GC_dryDep, drySpc_ndx + use physics_buffer, only : physics_buffer_desc, pbuf_get_index + use cam_history, only : addfld, add_default, horiz_only + use chem_mods, only : map2GC_dryDep, drySpc_ndx use mpishorthand - use cam_abortutils, only : endrun + use cam_abortutils, only : endrun - use Phys_Grid, only : get_Area_All_p - use hycoef, only : ps0, hyai, hybi + use Phys_Grid, only : get_Area_All_p + use hycoef, only : ps0, hyai, hybi - use seq_drydep_mod, only : drydep_method, DD_XLND + use seq_drydep_mod, only : drydep_method, DD_XLND #if ( OCNDDVEL_MOZART ) - use mo_drydep, only : drydep_inti + use mo_drydep, only : drydep_inti #endif + use gas_wetdep_opts, only : gas_wetdep_method + use mo_neu_wetdep, only : neu_wetdep_init #if defined( MODAL_AERO_4MODE ) - use aero_model, only : aero_model_init - use mo_drydep, only : drydep_inti_landuse - use modal_aero_data,only : ntot_amode, nspec_amode - use modal_aero_data,only : xname_massptr + use aero_model, only : aero_model_init + use mo_setsox, only : sox_inti + use mo_drydep, only : drydep_inti_landuse + use modal_aero_data, only : ntot_amode, nspec_amode + use modal_aero_data, only : xname_massptr #endif use Input_Opt_Mod use State_Chm_Mod use State_Grid_Mod use State_Met_Mod - use DiagList_Mod, only : Init_DiagList, Print_DiagList + use DiagList_Mod, only : Init_DiagList, Print_DiagList use GC_Environment_Mod - use GC_Grid_Mod, only : SetGridFromCtrEdges + use GC_Grid_Mod, only : SetGridFromCtrEdges ! Use GEOS-Chem versions of physical constants use PhysConstants, only : PI, PI_180, Re @@ -973,7 +956,7 @@ subroutine chem_init(phys_state, pbuf2d) use CMN_Size_Mod - use Drydep_Mod, only : Depname, Ndvzind + use Drydep_Mod, only : depName, Ndvzind use Pressure_Mod, only : Accept_External_ApBp use Chemistry_Mod, only : Init_Chemistry use Ucx_Mod, only : Init_Ucx @@ -984,6 +967,9 @@ subroutine chem_init(phys_state, pbuf2d) use Mixing_Mod use Vdiff_Mod + use mo_setinv, only : setinv_inti + use mo_mean_mass, only : init_mean_mass + use GC_Emissions_Mod, only : GC_Emissions_Init TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) @@ -1513,7 +1499,7 @@ subroutine chem_init(phys_state, pbuf2d) IF ( N == 1 ) Write(iulog,*) " ++ GEOS-Chem Dry deposition ++ " IF ( map2GC_dryDep(N) > 0 ) THEN Write(iulog,*) " CESM species: ", TRIM(drydep_list(N)), & - ' is matched with ', depName(map2GC_dryDep(N)) + ' is matched with ', depName(map2GC_dryDep(N)) ELSE Write(iulog,*) " CESM species: ", TRIM(drydep_list(N)), & ' has no match' @@ -1545,6 +1531,9 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF #if defined( MODAL_AERO_4MODE ) + ! Initialize aqueous chem + CALL SOx_inti() + ! Initialize aerosols CALL aero_model_init( pbuf2d ) @@ -1559,6 +1548,11 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF #endif + IF ( gas_wetdep_method == 'NEU' ) THEN + ! Initialize MOZART's wet deposition + CALL Neu_wetdep_init() + ENDIF + ! Set grid-cell area DO I = BEGCHUNK, ENDCHUNK ALLOCATE(Col_Area(NCOL(I)), STAT=IERR) @@ -1660,27 +1654,39 @@ subroutine chem_init(phys_state, pbuf2d) State_Grid = State_Grid(BEGCHUNK) ) ENDIF - ! Get the index of H2O - iH2O = Ind_('H2O') - iO3 = Ind_('O3') - iCH4 = Ind_('CH4') - iCO = Ind_('CO') - iNO = Ind_('NO') + ! Get some indices + iH2O = Ind_('H2O') + iO3 = Ind_('O3') + iCH4 = Ind_('CH4') + iCO = Ind_('CO') + iNO = Ind_('NO') + ! The following indices are needed to compute invariants + iO = Ind_('O') + iH = Ind_('H') + iO2 = Ind_('O2') + ! This is used to compute gas-phase H2SO4 production + iPSO4 = Ind_('PSO4') + SpcInfo => State_Chm(BEGCHUNK)%SpcData(iPSO4)%Info + MWPSO4 = REAL(SpcInfo%MW_g,r8) ! Get indices for physical fields in physics buffer - NDX_PBLH = Pbuf_Get_Index('pblh' ) - NDX_FSDS = Pbuf_Get_Index('FSDS' ) - NDX_CLDTOP = Pbuf_Get_Index('CLDTOP' ) - NDX_CLDFRC = Pbuf_Get_Index('CLD' ) - NDX_PRAIN = Pbuf_Get_Index('PRAIN' ) - NDX_NEVAPR = Pbuf_Get_Index('NEVAPR' ) - NDX_RPRDTOT = Pbuf_Get_Index('RPRDTOT' ) - NDX_LSFLXPRC = Pbuf_Get_Index('LS_FLXPRC') - NDX_LSFLXSNW = Pbuf_Get_Index('LS_FLXSNW') + NDX_PBLH = pbuf_get_index('pblh' ) + NDX_FSDS = pbuf_get_index('FSDS' ) + NDX_CLDTOP = pbuf_get_index('CLDTOP' ) + NDX_CLDFRC = pbuf_get_index('CLD' ) + NDX_PRAIN = pbuf_get_index('PRAIN' ) + NDX_NEVAPR = pbuf_get_index('NEVAPR' ) + NDX_LSFLXPRC = pbuf_get_index('LS_FLXPRC') + NDX_LSFLXSNW = pbuf_get_index('LS_FLXSNW') + NDX_CMFDQR = pbuf_get_index('RPRDTOT' ) ! Get cloud water indices - CALL cnst_get_ind('CLDLIQ', ixCldLiq) - CALL cnst_get_ind('CLDICE', ixCldIce) + CALL cnst_get_ind( 'CLDLIQ', ixCldLiq) + CALL cnst_get_ind( 'CLDICE', ixCldIce) + CALL cnst_get_ind( 'NUMLIQ', ixNDrop, abort=.false. ) + + CALL init_mean_mass() + CALL setinv_inti() ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default @@ -1702,7 +1708,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDDO DO I = 1, State_Chm(BEGCHUNK)%nDryDep - SpcName = 'DDVel_'//TRIM(depName(I)) + SpcName = 'DepVel_'//TRIM(depName(I)) CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'm/s', & TRIM(SpcName)//' dry deposition velocity') ENDDO @@ -1713,7 +1719,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Get info about this species from the species database SpcInfo => State_Chm(BEGCHUNK)%SpcData(L)%Info - SpcName = 'SurfFlux_'//TRIM(SpcInfo%Name) + SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & TRIM(SpcName)//' dry deposition flux') @@ -1722,6 +1728,16 @@ subroutine chem_init(phys_state, pbuf2d) SpcInfo => NULL() ENDDO + IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN + DO N = 1, gas_pcnst + CALL Addfld( 'DTWR_'//TRIM(solsym(N)), (/ 'lev' /), 'A', 'kg/kg/s', & + 'wet removal tendency' ) + CALL Addfld( 'WD_'//TRIM(solsym(N)), horiz_only, 'A', 'kg/m2/s', & + 'vertical integrated wet deposition flux' ) + CALL Addfld( 'WDRATE_'//TRIM(solsym(N)), (/ 'lev' /), 'A', 'kg/s', & + 'wet removal rate' ) + ENDDO + ENDIF ! Initialize emissions interface (this will eventually handle HEMCO) CALL GC_Emissions_Init @@ -1788,72 +1804,82 @@ subroutine GC_Update_Timesteps(DT) !=============================================================================== - subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) + subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) - use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx use physics_buffer, only : pbuf_get_chunk, pbuf_get_index - use cam_history, only: outfld - use camsrfexch, only: cam_in_t, cam_out_t + use cam_history, only : outfld + use camsrfexch, only : cam_in_t, cam_out_t + use mo_tracname, only : solsym - use phys_grid, only: get_ncols_p, get_rlat_all_p, get_rlon_all_p + use phys_grid, only : get_ncols_p, get_rlat_all_p, get_rlon_all_p - use chem_mods, only: drySpc_ndx, map2GC_dryDep + use chem_mods, only : drySpc_ndx, map2GC_dryDep + use chem_mods, only : nfs, indexm, gas_pcnst + use mo_chem_utls, only : get_spc_ndx + use mo_mean_mass, only : set_mean_mass + use mo_setinv, only : setinv + use mo_neu_wetdep, only : neu_wetdep_tend + use gas_wetdep_opts, only : gas_wetdep_method #if defined( MODAL_AERO_4MODE ) use modal_aero_data, only : ntot_amode, nspec_amode use modal_aero_data, only : lmassptr_amode #endif - use Olson_Landmap_Mod, only: Compute_Olson_Landmap - use Modis_LAI_Mod, only: Compute_XLAI - use CMN_Size_Mod, only: NSURFTYPE + use Olson_Landmap_Mod, only : Compute_Olson_Landmap + use Modis_LAI_Mod, only : Compute_XLAI + use CMN_Size_Mod, only : NSURFTYPE #if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) - use Drydep_Mod, only: Do_Drydep + use Drydep_Mod, only : Do_Drydep #elif ( OCNDDVEL_MOZART ) - use mo_drydep, only: drydep_update, drydep_fromlnd + use mo_drydep, only : drydep_update, drydep_fromlnd #endif - use Drydep_Mod, only: DEPNAME - use Drydep_Mod, only: Update_DryDepSav + use Drydep_Mod, only : DEPNAME + use Drydep_Mod, only : Update_DryDepSav use Mixing_Mod - use Calc_Met_Mod, only: Set_Dry_Surface_Pressure - use Calc_Met_Mod, only: AirQnt - use GC_Grid_Mod, only: SetGridFromCtr - use Pressure_Mod, only: Set_Floating_Pressures - use Pressure_Mod, only: Accept_External_Pedge - use Time_Mod, only: Accept_External_Date_Time - use Strat_chem_Mod, only: Init_Strat_Chem - use Toms_Mod, only: Compute_Overhead_O3 - use Chemistry_Mod, only: Do_Chemistry - use Wetscav_Mod, only: Setup_Wetscav, Do_WetDep - use CMN_Size_Mod, only: PTop - use PBL_Mix_Mod, only: Compute_PBL_Height - - use Tropopause, only: Tropopause_findChemTrop, Tropopause_Find + use Calc_Met_Mod, only : Set_Dry_Surface_Pressure + use Calc_Met_Mod, only : AirQnt + use GC_Grid_Mod, only : SetGridFromCtr + use Pressure_Mod, only : Set_Floating_Pressures + use Pressure_Mod, only : Accept_External_Pedge + use Time_Mod, only : Accept_External_Date_Time + use Strat_chem_Mod, only : Init_Strat_Chem + use Toms_Mod, only : Compute_Overhead_O3 + use Chemistry_Mod, only : Do_Chemistry + use Wetscav_Mod, only : Setup_Wetscav, Do_WetDep + use CMN_Size_Mod, only : PTop + use PBL_Mix_Mod, only : Compute_PBL_Height + + use Tropopause, only : Tropopause_findChemTrop, Tropopause_Find use HCO_Utilities_GC_Mod ! Utility routines for GC-HEMCO interface ! For calculating SZA - use Orbit, only: zenith - use Time_Manager, only: Get_Curr_Calday, Get_Curr_Date + use Orbit, only : zenith + use Time_Manager, only : Get_Curr_Calday, Get_Curr_Date ! Calculating relative humidity - use WV_Saturation, only: QSat - use PhysConst, only: MWDry + use WV_Saturation, only : QSat + use PhysConst, only : MWDry ! Grid area - use PhysConst, only: Gravit - use PhysConstants, only: Re - use Phys_Grid, only: get_area_all_p, get_lat_all_p, get_lon_all_p + use PhysConst, only : Gravit + use PhysConstants, only : Re + use Phys_Grid, only : get_area_all_p, get_lat_all_p, get_lon_all_p use short_lived_species, only : get_short_lived_species use short_lived_species, only : set_short_lived_species + ! Aqueous chemistry and aerosol growth + use aero_model, only : aero_model_gasaerexch + ! Use GEOS-Chem versions of physical constants - use PhysConstants, only: PI, PI_180, g0 + use PhysConstants, only : PI, PI_180, g0 - use rad_constituents, only: rad_cnst_get_info + use rad_constituents, only : rad_cnst_get_info REAL(r8), INTENT(IN) :: dT ! Time step - TYPE(physics_state), INTENT(IN) :: State ! Physics State variables + TYPE(physics_state), INTENT(IN) :: state ! Physics State variables TYPE(physics_ptend), INTENT(OUT) :: ptend ! indivdual parameterization tendencies TYPE(cam_in_t), INTENT(INOUT) :: cam_in TYPE(cam_out_t), INTENT(IN) :: cam_out @@ -1874,8 +1900,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) INTEGER :: LCHNK, NCOL - REAL(r8), DIMENSION(State%NCOL) :: & + REAL(r8), DIMENSION(state%NCOL) :: & CSZA, & ! Cosine of solar zenith angle + CSZAmid, & ! Cosine of solar zenith angle at the mid timestep Zsurf, & ! Surface height Rlats, Rlons ! Chunk latitudes and longitudes (radians) @@ -1884,29 +1911,45 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8), POINTER :: cldFrc(:,:) ! Cloud fraction [-] REAL(r8), POINTER :: Fsds(:) ! Downward shortwave flux at surface [W/m2] REAL(r8), POINTER :: PRain(:,:) ! Total stratiform precip. prod. (rain + snow) [kg/kg/s] - REAL(r8), POINTER :: RprdTot(:,:) ! Total convective precip. prod. (rain + snow) [kg/kg/s] REAL(r8), POINTER :: NEvapr(:,:) ! Evaporation of total precipitation (rain + snow) [kg/kg/s] REAL(r8), POINTER :: LsFlxPrc(:,:) ! Large-scale downward precip. flux at interface (rain + snow) [kg/m2/s] REAL(r8), POINTER :: LsFlxSnw(:,:) ! Large-scale downward precip. flux at interface (snow only) [kg/m2/s] - - REAL(r8) :: RelHum(State%NCOL, PVER) ! Relative humidity [0-1] - REAL(r8) :: SatV (State%NCOL, PVER) ! Work arrays - REAL(r8) :: SatQ (State%NCOL, PVER) ! Work arrays - REAL(r8) :: qH2O (State%NCOL, PVER) ! Specific humidity [kg/kg] - REAL(r8) :: H2OVMR(State%NCOL, PVER) ! H2O volume mixing ratio + REAL(r8), POINTER :: cmfdqr(:,:) ! Total convective precip. prod. (rain + snow) [kg/kg/s] + + REAL(r8) :: cldW (state%NCOL,PVER) ! Cloud water (kg/kg) + REAL(r8) :: nCldWtr(state%NCOL,PVER) ! Droplet number concentration (#/kg) + + REAL(r8) :: relHum (state%NCOL,PVER) ! Relative humidity [0-1] + REAL(r8) :: satV (state%NCOL,PVER) ! Work arrays + REAL(r8) :: satQ (state%NCOL,PVER) ! Work arrays + REAL(r8) :: qH2O (state%NCOL,PVER) ! Specific humidity [kg/kg] + REAL(r8) :: h2ovmr (state%NCOL,PVER) ! H2O volume mixing ratio + REAL(r8) :: mBar (state%NCOL,PVER) ! Meant wet atmospheric mass [amu] + REAL(r8) :: invariants(state%NCOL,PVER,nfs) + REAL(r8) :: reaction_rates(1,1,1) ! Reaction rates (unused) + ! For aerosol formation + REAL(r8) :: del_h2so4_gasprod(state%NCOL,PVER) + REAL(r8) :: vmr0(state%NCOL,PVER,gas_pcnst) + REAL(r8) :: vmr1(state%NCOL,PVER,gas_pcnst) + REAL(r8) :: wetdepflx(pcols,pcnst) ! Wet deposition fluxes (kg/m2/s) #if ( OCNDDVEL_MOZART ) - REAL(r8) :: windSpeed(State%NCOL) ! Wind speed at ground level [m/s] - REAL(r8) :: potT(State%NCOL) ! Potential temperature [K] + REAL(r8) :: windSpeed(state%NCOL) ! Wind speed at ground level [m/s] + REAL(r8) :: potT(state%NCOL) ! Potential temperature [K] INTEGER :: latndx(PCOLS) INTEGER :: lonndx(PCOLS) ! For MOZART's dry deposition over ocean and ice ! Deposition velocity (cm/s) - REAL(r8) :: MOZART_depVel(State%NCOL, nTracersMax) + REAL(r8) :: MOZART_depVel(state%NCOL, nTracersMax) ! Deposition flux (/cm^2/s) - REAL(r8) :: MOZART_depFlx(State%NCOL, nTracersMax) + REAL(r8) :: MOZART_depFlx(state%NCOL, nTracersMax) #endif + ! For GEOS-Chem diagnostics + REAL(r8) :: mmr1(state%NCOL,PVER,gas_pcnst) + REAL(r8) :: wk_out(state%NCOL) + LOGICAL :: isWD + REAL(r8), PARAMETER :: zlnd = 0.01_r8 ! Roughness length for soil [m] REAL(r8), PARAMETER :: zslnd = 0.0024_r8 ! Roughness length for snow [m] REAL(r8), PARAMETER :: zsice = 0.0400_r8 ! Roughness length for sea ice [m] @@ -1918,7 +1961,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(f4) :: lonMidArr(1,PCOLS), latMidArr(1,PCOLS) INTEGER :: iMaxLoc(1) - REAL(r8) :: Col_Area(State%NCOL) + REAL(r8) :: Col_Area(state%NCOL) ! Intermediate arrays INTEGER :: Trop_Lev (PCOLS) @@ -1941,14 +1984,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Calculating SZA REAL(r8) :: Calday - ! For archiving - CHARACTER(LEN=255) :: SpcName - REAL(r8) :: VMR(State%NCOL,PVER) - - ! Objects + CHARACTER(LEN=255) :: SpcName + INTEGER :: SpcId TYPE(Species), POINTER :: SpcInfo - REAL(r8) :: SlsData(State%NCOL, PVER, nSls) + ! For archiving + REAL(r8) :: VMR(state%NCOL,PVER) + + REAL(r8) :: SlsData(state%NCOL, PVER, nSls) INTEGER :: currYr, currMo, currDy, currTOD INTEGER :: currYMD, currHMS, currHr, currMn, currSc @@ -1969,9 +2012,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) INTEGER :: RC ! LCHNK: which chunk we have on this process - LCHNK = State%LCHNK + LCHNK = state%LCHNK ! NCOL: number of atmospheric columns on this chunk - NCOL = State%NCOL + NCOL = state%NCOL ! Am I the first chunk on the first CPU? rootChunk = ( MasterProc.and.(LCHNK==BEGCHUNK) ) @@ -1984,7 +2027,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! For safety's sake - PTop = State%Pint(1,1)*0.01e+0_fp + PTop = state%pint(1,1)*0.01e+0_fp ! Need to be super careful that the module arrays are updated and correctly ! set. NOTE: First thing - you'll need to flip all the data vertically @@ -1998,8 +2041,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! retrieve this from State_Met which is chunked !CALL get_rlat_all_p( LCHNK, NCOL, Rlats ) !CALL get_rlon_all_p( LCHNK, NCOL, Rlons ) - Rlats(1:nY) = State%Lat(1:nY) - Rlons(1:nY) = State%Lon(1:nY) + Rlats(1:nY) = state%Lat(1:nY) + Rlons(1:nY) = state%Lon(1:nY) lonMidArr = 0.0e+0_f4 latMidArr = 0.0e+0_f4 @@ -2048,10 +2091,10 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) MMR_Beg = 0.0e+0_r8 DO N = 1, pcnst M = map2GC(N) - IF (M > 0) THEN + IF ( M > 0 ) THEN DO J = 1, nY DO K = 1, nZ - MMR_Beg(J,K,M) = State%q(J,nZ+1-K,N) + MMR_Beg(J,K,M) = state%q(J,nZ+1-K,N) State_Chm(LCHNK)%Species(1,J,K,M) = REAL(MMR_Beg(J,K,M),fp) ENDDO ENDDO @@ -2063,10 +2106,19 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) SlsData(:,:,:) = 0.0e+0_r8 CALL get_short_lived_species( SlsData, LCHNK, nY, pbuf ) + !----------------------------------------------------------------------- + ! ... Set atmosphere mean mass + !----------------------------------------------------------------------- + ! This is not meant for simulations of the ionosphere. mBar will then just + ! be set to mwdry and does not require to pass anything besides NCOL. We + ! can then just past a dummy array as the second argument + !CALL Set_mean_mass( NCOL, mmr, mBar ) + CALL Set_mean_mass( NCOL, vmr0, mBar ) + ! Map and flip gaseous short-lived species DO N = 1, nSls M = map2GC_Sls(N) - IF (M > 0) THEN + IF ( M > 0 ) THEN DO J = 1, nY DO K = 1, nZ State_Chm(LCHNK)%Species(1,J,K,M) = REAL(SlsData(J,nZ+1-K,N),fp) @@ -2075,18 +2127,38 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDDO + DO N = 1, gas_pcnst + ! See definition of map2chm + M = map2chm(N) + IF ( M > 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + vmr0(J,K,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-K,M) * & + MWDry / adv_mass(N) + ENDDO + ENDDO + ELSEIF ( M < 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + vmr0(J,K,N) = state%q(J,K,-M) * & + MWDry / adv_mass(N) + ENDDO + ENDDO + ENDIF + ENDDO + #if defined( MODAL_AERO_4MODE ) - ! TMMF - This needs more indices to MMR_Beg and MMR_End ! Map and flip aerosols DO M = 1, ntot_amode DO L = 1, nspec_amode(M) + ! TMMF - Here we will have to store the bin to bulk mass ratio + ! TMMF - Should there be a ratio of molar weights involved? P = map2MAM4(L,M) N = lmassptr_amode(L,M) ! Multiple MAM4 bins are mapped to same GEOS-Chem species IF ( P > 0 ) THEN DO J = 1, nY DO K = 1, nZ - !MMR_Beg(J,K,M) = State%q(J,nZ+1-K,N) State_Chm(LCHNK)%Species(1,J,K,P) = State_Chm(LCHNK)%Species(1,J,K,P) & + REAL(state%q(J,nZ+1-K,N),fp) ENDDO @@ -2097,9 +2169,12 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) #endif ! Initialize tendency array - CALL Physics_ptend_init(ptend, State%psetcols, 'chemistry', lq=lq) + CALL Physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) ! Calculate COS(SZA) + Calday = Get_Curr_Calday( INT(dT/2) ) + CALL Zenith( Calday, Rlats, Rlons, CSZAmid, nY ) + Calday = Get_Curr_Calday( ) CALL Zenith( Calday, Rlats, Rlons, CSZA, nY ) @@ -2111,27 +2186,33 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL pbuf_get_field( pbuf, NDX_CLDFRC, cldFrc, START=(/1,1,TIM_NDX/), KOUNT=(/NCOL,PVER,1/) ) CALL pbuf_get_field( pbuf, NDX_NEVAPR, NEvapr, START=(/1,1/), KOUNT=(/NCOL,PVER/)) CALL pbuf_get_field( pbuf, NDX_PRAIN, PRain, START=(/1,1/), KOUNT=(/NCOL,PVER/)) - CALL pbuf_get_field( pbuf, NDX_RPRDTOT, RprdTot, START=(/1,1/), KOUNT=(/NCOL,PVER/)) CALL pbuf_get_field( pbuf, NDX_LSFLXPRC, LsFlxPrc, START=(/1,1/), KOUNT=(/NCOL,PVERP/)) CALL pbuf_get_field( pbuf, NDX_LSFLXSNW, LsFlxSnw, START=(/1,1/), KOUNT=(/NCOL,PVERP/)) + CALL pbuf_get_field( pbuf, NDX_CMFDQR, cmfdqr, START=(/1,1/), KOUNT=(/NCOL,PVER/)) ! Get VMR and MMR of H2O - H2OVMR = 0.0e0_fp + h2ovmr = 0.0e0_fp qH2O = 0.0e0_fp - ! Note MWDRY = 28.966 g/mol + ! Note MWDry = 28.966 g/mol DO J = 1, nY DO L = 1, nZ - qH2O(J,L) = REAL(State_Chm(LCHNK)%Species(1,J,L,iH2O),r8) - H2OVMR(J,L) = qH2O(J,L) * MWDry / 18.016e+0_fp + qH2O(J,L) = REAL(State_Chm(LCHNK)%Species(1,J,nZ+1-L,iH2O),r8) + h2ovmr(J,L) = qH2O(J,L) * MWDry / 18.016e+0_fp ENDDO ENDDO + !----------------------------------------------------------------------- + ! ... Set the "invariants" + !----------------------------------------------------------------------- + CALL Setinv( invariants, state%t(:nY,:), h2ovmr, vmr0, & + state%pmid(:nY,:), NCOL, LCHNK, pbuf ) + ! Calculate RH (range 0-1, note still level 1 = TOA) relHum(:,:) = 0.0e+0_r8 - CALL QSat(State%T(:nY,:), State%Pmid(:nY,:), SatV, SatQ) + CALL QSat(state%t(:nY,:), state%pmid(:nY,:), satV, satQ) DO J = 1, nY DO L = 1, nZ - relHum(J,L) = 0.622e+0_r8 * H2OVMR(J,L) / SatQ(J,L) + relHum(J,L) = 0.622e+0_r8 * h2ovmr(J,L) / satQ(J,L) relHum(J,L) = MAX( 0.0e+0_r8, MIN( 1.0e+0_r8, relHum(J,L) ) ) ENDDO ENDDO @@ -2156,14 +2237,16 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Calculation is based on that done for MOZART DO J = 1, nY DO L = nZ, 1, -1 + cldW(J,L) = state%q(J,L,ixCldLiq) + state%q(J,L,ixCldIce) ! Convert water mixing ratio [kg/kg] to water content [g/m^3] - IF ( ( State%Q(J,L,ixCldLiq) + State%Q(J,L,ixCldIce) ) * & - State%PMid(J,L) / (State%T(J,L) * 287.0e+00_r8) * 1.0e+03_r8 <= 0.01_r8 .AND. & + IF ( cldW(J,L) * state%pmid(J,L) / & + (state%T(J,L) * 287.0e+00_r8) * 1.0e+03_r8 <= 0.01_r8 .AND. & cldFrc(J,L) /= 0.0e+00_r8 ) THEN cld(J,L) = 0.0e+00_r8 ELSE cld(J,L) = cldFrc(J,L) ENDIF + IF ( ixNDrop > 0 ) nCldWtr(J,L) = state%q(J,L,ixNDrop) ENDDO ENDDO @@ -2192,27 +2275,25 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! re : [m] | = 1.0e-5 ! rho_w: [kg H2O/m^3] | = 1.0e+3 ! g : [m/s^2] | = 9.81 - ! - TauClw(J,L) = State%Q(J,L,ixCldLiq) & - * (State%Pint(J,L+1)-State%Pint(J,L)) & + TauClw(J,L) = state%q(J,L,ixCldLiq) & + * (state%pint(J,L+1)-state%pint(J,L)) & * cnst TauClw(J,L) = MAX(TauClw(J,L), 0.0e+00_r8) - TauCli(J,L) = State%Q(J,L,ixCldIce) & - * (State%Pint(J,L+1)-State%Pint(J,L)) & + TauCli(J,L) = state%q(J,L,ixCldIce) & + * (state%pint(J,L+1)-state%pint(J,L)) & * cnst TauCli(J,L) = MAX(TauCli(J,L), 0.0e+00_r8) - ENDDO ENDIF ENDDO ! Retrieve tropopause level Trop_Lev = 0.0e+0_r8 - CALL Tropopause_FindChemTrop(State, Trop_Lev) + CALL Tropopause_FindChemTrop(state, Trop_Lev) ! Back out the pressure Trop_P = 1000.0e+0_r8 DO J = 1, nY - Trop_P(J) = State%PMid(J,Trop_Lev(J)) * 0.01e+0_r8 + Trop_P(J) = state%pmid(J,Trop_Lev(J)) * 0.01e+0_r8 ENDDO ! Calculate snow depth @@ -2354,7 +2435,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Surface geopotential height ! Unit : m ! Dimensions : nX, nY - State_Met(LCHNK)%PHIS (1,:) = State%Phis(:) + State_Met(LCHNK)%PHIS (1,:) = state%Phis(:) ! Field : PRECANV, PRECCON, PRECLSC, PRECTOT ! Description: Anvil precipitation @ ground @@ -2378,14 +2459,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Wet surface pressure at start and end of timestep ! Unit : hPa ! Dimensions : nX, nY - State_Met(LCHNK)%PS1_WET (1,:) = State%ps(:)*0.01e+0_fp - State_Met(LCHNK)%PS2_WET (1,:) = State%ps(:)*0.01e+0_fp + State_Met(LCHNK)%PS1_WET (1,:) = state%ps(:)*0.01e+0_fp + State_Met(LCHNK)%PS2_WET (1,:) = state%ps(:)*0.01e+0_fp ! Field : SLP ! Description: Sea level pressure ! Unit : hPa ! Dimensions : nX, nY - State_Met(LCHNK)%SLP (1,:) = State%ps(:)*0.01e+0_fp + State_Met(LCHNK)%SLP (1,:) = state%ps(:)*0.01e+0_fp ! Field : TS, TSKIN ! Description: Surface temperature, surface skin temperature @@ -2420,16 +2501,15 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! of chemistry timestep ! Unit : - ! Dimensions : nX, nY - ! Note : Compute tendency in -/s (tmmf, 1/13/20) ? State_Met(LCHNK)%SUNCOS (1,:) = CSZA(:) - State_Met(LCHNK)%SUNCOSmid (1,:) = CSZA(:) + State_Met(LCHNK)%SUNCOSmid (1,:) = CSZAmid(:) ! Field : U10M, V10M ! Description: E/W and N/S wind speed @ 10m height ! Unit : m/s ! Dimensions : nX, nY - State_Met(LCHNK)%U10M (1,:) = State%U(:,nZ) - State_Met(LCHNK)%V10M (1,:) = State%V(:,nZ) + State_Met(LCHNK)%U10M (1,:) = state%U(:,nZ) + State_Met(LCHNK)%V10M (1,:) = state%V(:,nZ) ! Field : USTAR ! Description: Friction velocity @@ -2487,7 +2567,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Wet air pressure at (vertical) level edges ! Unit : hPa ! Dimensions : nX, nY, nZ+1 - State_Met(LCHNK)%PEDGE (1,J,L) = State%Pint(J,nZ+2-L)*0.01e+0_fp + State_Met(LCHNK)%PEDGE (1,J,L) = state%pint(J,nZ+2-L)*0.01e+0_fp ! Field : CMFMC ! Description: Upward moist convective mass flux @@ -2512,11 +2592,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO DO J = 1, nY - ! Field : U, V + ! Field : CLDTOPS ! Description: Max cloud top height ! Unit : level ! Dimensions : nX, nY - State_Met(LCHNK)%cldTops(1,J) = nZ + 1 - NINT(cldTop(J)) + State_Met(LCHNK)%CLDTOPS(1,J) = nZ + 1 - NINT(cldTop(J)) ENDDO ! Three-dimensional fields on level centers @@ -2526,14 +2606,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: E/W and N/S component of wind ! Unit : m/s ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%U (1,J,L) = State%U(J,nZ+1-L) - State_Met(LCHNK)%V (1,J,L) = State%V(J,nZ+1-L) + State_Met(LCHNK)%U (1,J,L) = state%U(J,nZ+1-L) + State_Met(LCHNK)%V (1,J,L) = state%V(J,nZ+1-L) ! Field : OMEGA ! Description: Updraft velocity ! Unit : Pa/s ! Dimensions : nX, nY, nZ - !State_Met(LCHNK)%OMEGA (1,J,L) = State%Omega(J,nZ+1-L) + !State_Met(LCHNK)%OMEGA (1,J,L) = state%Omega(J,nZ+1-L) ! Field : CLDF ! Description: 3-D cloud fraction @@ -2563,14 +2643,14 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Cloud ice/water mixing ratio ! Unit : kg/kg dry air ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%QI (1,J,L) = MAX(1.0e-05_fp, State%Q(J,nZ+1-L,ixCldIce)) ! kg ice / kg dry air - State_Met(LCHNK)%QL (1,J,L) = MAX(1.0e-05_fp, State%Q(J,nZ+1-L,ixCldLiq)) ! kg water / kg dry air + State_Met(LCHNK)%QI (1,J,L) = MAX(1.0e-05_fp, state%q(J,nZ+1-L,ixCldIce)) ! kg ice / kg dry air + State_Met(LCHNK)%QL (1,J,L) = MAX(1.0e-05_fp, state%q(J,nZ+1-L,ixCldLiq)) ! kg water / kg dry air ! Field : RH ! Description: Relative humidity ! Unit : % ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%RH (1,J,L) = RelHum(J,nZ+1-L) * 100.0e+0_fp + State_Met(LCHNK)%RH (1,J,L) = relHum(J,nZ+1-L) * 100.0e+0_fp ! Field : TAUCLI, TAUCLW ! Description: Optical depth of ice/H2O clouds @@ -2610,8 +2690,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Note : Since we are using online meteorology, we do not have ! access to the data at the next time step ! Compute tendency in K/s (tmmf, 1/13/20) ? - State_Met(LCHNK)%TMPU1 (1,J,L) = State%T(J,nZ+1-L) - State_Met(LCHNK)%TMPU2 (1,J,L) = State%T(J,nZ+1-L) + State_Met(LCHNK)%TMPU1 (1,J,L) = state%t(J,nZ+1-L) + State_Met(LCHNK)%TMPU2 (1,J,L) = state%t(J,nZ+1-L) ENDDO ENDDO @@ -2639,17 +2719,6 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Dimensions : nX, nY, nZ State_Met(LCHNK)%OPTD = State_Met(LCHNK)%TAUCLI + State_Met(LCHNK)%TAUCLW - ! Nullify all pointers - Nullify(PblH ) - Nullify(Fsds ) - Nullify(PRain ) - Nullify(LsFlxSnw) - Nullify(LsFlxPrc) - Nullify(cldTop ) - Nullify(cldFrc ) - Nullify(NEvapr ) - Nullify(RprdTot ) - ! Field : InChemGrid ! Description: Are we in the chemistry grid? ! Unit : - @@ -2732,8 +2801,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! 2. As we are using online meteorology, we do not ! have access to the fields at the next time step ! Compute Pa/s tendency? (tmmf, 1/13/20) - State_Met(LCHNK)%PS1_DRY (1,:) = State%PSDry(:) * 0.01e+0_fp - State_Met(LCHNK)%PS2_DRY (1,:) = State%PSDry(:) * 0.01e+0_fp + State_Met(LCHNK)%PS1_DRY (1,:) = state%PSDry(:) * 0.01e+0_fp + State_Met(LCHNK)%PS2_DRY (1,:) = state%PSDry(:) * 0.01e+0_fp ! Field : PSC2_WET, PSC2_DRY ! Description: Interpolated wet and dry surface pressure at the @@ -2794,41 +2863,41 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! isIce, which are based on albedo. Rather, we use CLM landFranc, ocnFrac ! and iceFrac. We also compute isSnow DO J = 1, nY - iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(1,J) + & - State_Met(LCHNK)%FRLANDIC(1,J) + & - State_Met(LCHNK)%FRLAKE(1,J), & - State_Met(LCHNK)%FRSEAICE(1,J), & - State_Met(LCHNK)%FROCEAN(1,J) - & - State_Met(LCHNK)%FRSEAICE(1,J) /) ) - IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 - ! reset ocean to 0 - - ! Field : LWI - ! Description: Land/water indices - ! Unit : - - ! Dimensions : nX, nY - State_Met(LCHNK)%LWI(1,J) = FLOAT( iMaxLoc(1) ) - - IF ( iMaxLoc(1) == 0 ) THEN - State_Met(LCHNK)%isLand(1,J) = .False. - State_Met(LCHNK)%isWater(1,J) = .True. - State_Met(LCHNK)%isIce(1,J) = .False. - ELSEIF ( iMaxLoc(1) == 1 ) THEN - State_Met(LCHNK)%isLand(1,J) = .True. - State_Met(LCHNK)%isWater(1,J) = .False. - State_Met(LCHNK)%isIce(1,J) = .False. - ELSEIF ( iMaxLoc(1) == 2 ) THEN - State_Met(LCHNK)%isLand(1,J) = .False. - State_Met(LCHNK)%isWater(1,J) = .False. - State_Met(LCHNK)%isIce(1,J) = .True. - ELSE - Write(iulog,*) " iMaxLoc gets value: ", iMaxLoc - ErrMsg = 'Failed to figure out land/water' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + iMaxLoc = MAXLOC( (/ State_Met(LCHNK)%FRLAND(1,J) + & + State_Met(LCHNK)%FRLANDIC(1,J) + & + State_Met(LCHNK)%FRLAKE(1,J), & + State_Met(LCHNK)%FRSEAICE(1,J), & + State_Met(LCHNK)%FROCEAN(1,J) - & + State_Met(LCHNK)%FRSEAICE(1,J) /) ) + IF ( iMaxLoc(1) == 3 ) iMaxLoc(1) = 0 + ! reset ocean to 0 + + ! Field : LWI + ! Description: Land/water indices + ! Unit : - + ! Dimensions : nX, nY + State_Met(LCHNK)%LWI(1,J) = FLOAT( iMaxLoc(1) ) + + IF ( iMaxLoc(1) == 0 ) THEN + State_Met(LCHNK)%isLand(1,J) = .False. + State_Met(LCHNK)%isWater(1,J) = .True. + State_Met(LCHNK)%isIce(1,J) = .False. + ELSEIF ( iMaxLoc(1) == 1 ) THEN + State_Met(LCHNK)%isLand(1,J) = .True. + State_Met(LCHNK)%isWater(1,J) = .False. + State_Met(LCHNK)%isIce(1,J) = .False. + ELSEIF ( iMaxLoc(1) == 2 ) THEN + State_Met(LCHNK)%isLand(1,J) = .False. + State_Met(LCHNK)%isWater(1,J) = .False. + State_Met(LCHNK)%isIce(1,J) = .True. + ELSE + Write(iulog,*) " iMaxLoc gets value: ", iMaxLoc + ErrMsg = 'Failed to figure out land/water' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF - State_Met(LCHNK)%isSnow(1,J) = ( State_Met(LCHNK)%FRSEAICE(1,J) > 0.0e+0_fp & - .or. State_Met(LCHNK)%SNODP(1,J) > 0.01 ) + State_Met(LCHNK)%isSnow(1,J) = ( State_Met(LCHNK)%FRSEAICE(1,J) > 0.0e+0_fp & + .or. State_Met(LCHNK)%SNODP(1,J) > 0.01 ) ENDDO @@ -3119,9 +3188,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! True. CALL drydep_update( State, cam_in ) - windSpeed(:nY) = SQRT( State%U(:nY,nZ)*State%U(:nY,nZ) + & - State%V(:nY,nZ)*State%V(:nY,nZ) ) - potT(:nY) = State%T(:nY,nZ) * (1._fp + qH2O(:nY,nZ)) + windSpeed(:nY) = SQRT( state%U(:nY,nZ)*state%U(:nY,nZ) + & + state%V(:nY,nZ)*state%V(:nY,nZ) ) + potT(:nY) = state%t(:nY,nZ) * (1._fp + qH2O(:nY,nZ)) CALL get_lat_all_p( LCHNK, nY, latndx ) CALL get_lon_all_p( LCHNK, nY, lonndx ) @@ -3130,11 +3199,11 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) icefrac = cam_in%icefrac(:), & ncdate = currYMD, & sfc_temp = cam_in%TS(:), & - pressure_sfc = State%PS(:), & + pressure_sfc = state%PS(:), & wind_speed = windSpeed(:), & spec_hum = qH2O(:,nZ), & - air_temp = State%T(:,nZ), & - pressure_10m = State%PMid(:,nZ), & + air_temp = state%t(:,nZ), & + pressure_10m = state%pmid(:,nZ), & rain = State_Met(LCHNK)%PRECTOT(1,:), & snow = cam_in%Snowhland(:), & solar_flux = State_Met(LCHNK)%SWGDN(1,:), & @@ -3211,7 +3280,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Compute the surface flux for the non-local mixing, ! (which means getting emissions & drydep from HEMCO) ! and store it in State_Chm%Surface_Flux - IF ( Input_Opt%LTURB .and. Input_Opt%LNLPBL ) THEN + IF ( Input_Opt%LTURB .and. Input_Opt%LNLPBL ) THEN CALL Compute_Sflx_For_Vdiff( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & @@ -3243,7 +3312,7 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & RC = RC ) - + ! Trap potential errors IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Do_Mixing"!' @@ -3295,6 +3364,8 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF + !TMMF - Add Set_h2o_trac + CALL Do_Chemistry( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & @@ -3312,25 +3383,181 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !============================================================== IF ( Input_Opt%LWetD ) THEN - ! Do wet deposition - ! NOTE: Tracer concentration units are converted locally - ! to [kg/m2] in wet deposition to enable calculations - ! along the column (ewl, 9/18/15) - CALL Do_WetDep( Input_Opt = Input_Opt, & - State_Chm = State_Chm(LCHNK), & - State_Diag = State_Diag(LCHNK), & - State_Grid = State_Grid(LCHNK), & - State_Met = State_Met(LCHNK), & - RC = RC ) + ! Store mass mixing ratios before wet deposition is applied + DO N = 1, gas_pcnst + ! See definition of map2chm + M = map2chm(N) + IF ( M > 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + mmr1(J,K,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-K,M) + ENDDO + ENDDO + ELSEIF ( M < 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + mmr1(J,K,N) = state%q(J,K,-M) + ENDDO + ENDDO + ENDIF + ENDDO + + IF ( gas_wetdep_method == 'NEU' ) THEN + CALL Neu_wetdep_tend( LCHNK = LCHNK, & + NCOL = NCOL, & + mmr = state%q, & + pmid = state%pmid, & + pdel = state%pdel, & + zint = state%zi, & + tfld = state%t, & + delt = dT, & + prain = PRain, & + nevapr = NEvapr, & + cld = cldFrc, & + cmfdqr = cmfdqr, & + wd_tend = ptend%q, & + wd_tend_int = wetdepflx ) + ELSEIF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN + ! TMMF, If we perform GEOS-Chem washout and rainout, we should turn + ! it off for MAM4 aerosols, as this is done in physpkg.F90 + ! A way to do this would be to reapply vmr of MAM4 aerosols before + ! wetdep is applied + + ! Do wet deposition + ! NOTE: Tracer concentration units are converted locally + ! to [kg/m2] in wet deposition to enable calculations + ! along the column (ewl, 9/18/15) + CALL Do_WetDep( Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Do_WetDep"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ELSE + ErrMsg = 'Unknown gas_wetdep_method ' //TRIM(gas_wetdep_method) + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + DO N = 1, gas_pcnst + ! See definition of map2chm + M = map2chm(N) + IF ( M > 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + mmr1(J,K,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-K,M) - mmr1(J,K,N) + ENDDO + ENDDO + ELSEIF ( M < 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + mmr1(J,K,N) = state%q(J,K,-M) - mmr1(J,K,N) + ENDDO + ENDDO + ENDIF + ENDDO + + IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN + DO N = 1, gas_pcnst + M = map2chm(N) + isWD = .False. + IF ( M > 0 ) THEN + SpcInfo => State_Chm(BEGCHUNK)%SpcData(M)%Info + isWD = SpcInfo%Is_WetDep + ! Free pointer + SpcInfo => NULL() + ENDIF + + IF ( .NOT. isWD ) CYCLE + + CALL Outfld( 'DTWR_'//TRIM(solsym(N)), mmr1(1:nY,:nZ,N)/dT, nY, LCHNK ) + + wk_out = 0._r8 + DO K = 1, nZ + wk_out(1:nY) = wk_out(1:nY) & + + mmr1(1:nY,k,N)/dT * & + State_Met(LCHNK)%AD(1,1:nY,nZ+1-k) / & + State_Met(LCHNK)%Area_M2(1,1:nY) + ENDDO + CALL Outfld( 'WD_'//TRIM(solsym(N)), wk_out(1:nY), nY, LCHNK ) + + CALL Outfld( 'WDRATE_'//TRIM(solsym(N)), & + mmr1(1:nY,:nZ,N)/dT * State_Met(LCHNK)%AD(1,1:nY,nZ:1:-1), & + nY, LCHNK ) + + ! GEOS-Chem does not currently store HEFF, but calculates it + ! internally. Some potential work around would be to add a + ! SpcInfo%Heff variable. + ENDDO + ENDIF + ENDIF - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Do_WetDep"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF + !============================================================== + ! ***** M A M G A S - A E R O S O L E X C H A N G E ***** + !============================================================== + + DO N = 1, gas_pcnst + ! See definition of map2chm + M = map2chm(N) + IF ( M > 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + vmr1(J,K,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-K,M) * & + MWDry / adv_mass(N) + ENDDO + ENDDO + ELSEIF ( M < 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + vmr1(J,K,N) = state%q(J,K,-M) * & + MWDry / adv_mass(N) + ENDDO + ENDDO + ENDIF + ENDDO + + del_h2so4_gasprod = 0.0e+00_fp + ! This needs to be in mol/mol over this timestep + IF ( ( iPSO4 > 0 ) .and. ( MWPSO4 > 0.0e+00_fp ) ) THEN + If ( rootChunk ) Write(iulog,*) " MAXVAL(PSO4) = ", & + MAXVAL(State_Chm(LCHNK)%Species(1,:nY,:nZ,iPSO4)) + DO K = 1, nZ + ! Convert from kg/kg to mol/mol + del_h2so4_gasprod(:nY,K) = & + State_Chm(LCHNK)%Species(1,:nY,nZ+1-K,iPSO4) * MWDry / MWPSO4 + ENDDO ENDIF - ! Make sure State_Chm(lchnk) is back in kg/kg dry! + call aero_model_gasaerexch( loffset = iFirstCnst - 1, & + ncol = NCOL, & + lchnk = LCHNK, & + troplev = Trop_Lev(:nY), & + delt = dT, & + reaction_rates = reaction_rates, & + tfld = state%t(:nY,:), & + pmid = state%pmid(:nY,:), & + pdel = state%pdel(:nY,:), & + mbar = mBar, & + relhum = relHum(:nY,:), & + zm = state%zm(:nY,:), & + qh2o = qH2O(:nY,:), & + cwat = cldW, & + cldfr = cldFrc, & + cldnum = nCldWtr, & + airdens = invariants(:,:,indexm), & + invariants = invariants, & + del_h2so4_gasprod = del_h2so4_gasprod, & + vmr0 = vmr0, & + vmr = vmr1, & + pbuf = pbuf ) + + + ! Make sure State_Chm(LCHNK) is back in kg/kg dry! ! Reset H2O MMR to the initial value (no chemistry tendency in H2O just yet) State_Chm(LCHNK)%Species(1,:,:,iH2O) = MMR_Beg(:,:,iH2O) @@ -3365,9 +3592,9 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO DO N = 1, nSls - SpcName = slsNames(n) + SpcName = slsNames(N) VMR = 0.0e+0_r8 - M = map2GC_Sls(n) + M = map2GC_Sls(N) IF ( M > 0 ) THEN DO J = 1, nY DO K = 1, nZ @@ -3378,24 +3605,28 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDDO - DO N = 1, State_Chm(BEGCHUNK)%nDryDep - SpcName = 'DDVel_'//TRIM(depName(N)) - CALL OutFld( TRIM(SpcName), State_Chm(LCHNK)%DryDepVel(1,:nY,N), nY, LCHNK ) - ENDDO + IF ( Input_Opt%LDryD ) THEN + DO N = 1, State_Chm(BEGCHUNK)%nDryDep + SpcName = 'DepVel_'//TRIM(depName(N)) + CALL OutFld( TRIM(SpcName), State_Chm(LCHNK)%DryDepVel(1,:nY,N), nY, LCHNK ) + ENDDO - DO N = 1, State_Chm(BEGCHUNK)%nAdvect - ! Get the species ID from the advected species ID - L = State_Chm(BEGCHUNK)%Map_Advect(N) + DO N = 1, State_Chm(BEGCHUNK)%nAdvect + ! Get the species ID from the advected species ID + L = State_Chm(BEGCHUNK)%Map_Advect(N) - ! Get info about this species from the species database - SpcInfo => State_Chm(BEGCHUNK)%SpcData(L)%Info - SpcName = 'SurfFlux_'//TRIM(SpcInfo%Name) + ! Get info about this species from the species database + SpcInfo => State_Chm(BEGCHUNK)%SpcData(L)%Info + SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) - CALL OutFld( TRIM(SpcName), -State_Chm(LCHNK)%SurfaceFlux(1,:nY,N), nY, LCHNK ) + ! SurfaceFlux is Emissions - Drydep, but Emissions = 0, as it is applied + ! in chem_emissions. + CALL OutFld( TRIM(SpcName), -State_Chm(LCHNK)%SurfaceFlux(1,:nY,N), nY, LCHNK ) - ! Free pointer - SpcInfo => NULL() - ENDDO + ! Free pointer + SpcInfo => NULL() + ENDDO + ENDIF ! NOTE: Re-flip all the arrays vertically or suffer the consequences ! ptend%q dimensions: [column, ?, species] @@ -3417,17 +3648,28 @@ subroutine chem_timestep_tend( State, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Debug statements ! Ozone tendencies IF ( rootChunk ) THEN - Write(iulog,*) " MMR_Beg = ", MMR_Beg(1,:,2) - Write(iulog,*) " MMR_End = ", MMR_End(1,:,2) + Write(iulog,*) " MMR_Beg = ", MMR_Beg(1,:,iO3) + Write(iulog,*) " MMR_End = ", MMR_End(1,:,iO3) ENDIF IF (PRESENT(fh2o)) THEN fh2o(:nY) = 0.0e+0_r8 !DO K = 1, nZ - ! fh2o(:nY) = fh2o(:nY) + Ptend%Q(:nY,K,iH2O)*State%Pdel(:nY,K)/Gravit + ! fh2o(:nY) = fh2o(:nY) + ptend%q(:nY,K,iH2O)*state%pdel(:nY,K)/Gravit !ENDDO ENDIF + ! Nullify all pointers + Nullify(PblH ) + Nullify(Fsds ) + Nullify(PRain ) + Nullify(LsFlxSnw) + Nullify(LsFlxPrc) + Nullify(cldTop ) + Nullify(cldFrc ) + Nullify(NEvapr ) + Nullify(cmfdqr ) + IF (rootChunk) WRITE(iulog,*) ' GEOS-Chem Chemistry step ', iStep, ' completed' end subroutine chem_timestep_tend @@ -3615,13 +3857,14 @@ subroutine chem_read_restart( File ) end subroutine chem_read_restart !================================================================================ subroutine chem_emissions( state, cam_in ) + use camsrfexch, only: cam_in_t - use physics_buffer, only : pbuf_get_chunk, pbuf_get_field, pbuf_get_index - use ppgrid, only : pver ! for vertical + use physics_buffer, only : pbuf_get_chunk, pbuf_get_field, pbuf_get_index + use ppgrid, only : pver ! for vertical - use constituents, only: cnst_name - use mo_chem_utls, only : get_spc_ndx - use chem_mods, only : tracerNames, nTracers + use constituents, only: cnst_name + use mo_chem_utls, only : get_spc_ndx + use chem_mods, only : tracerNames, nTracers use PhysConstants, only: PI, PI_180 ! Arguments: @@ -3633,7 +3876,7 @@ subroutine chem_emissions( state, cam_in ) INTEGER :: LCHNK, NCOL LOGICAL :: rootChunk - REAL(r8) :: sflx(State%NCOL,nTracers) + REAL(r8) :: sflx(state%NCOL,nTracers) type(physics_buffer_desc), pointer :: pbuf_chnk(:) ! slice of pbuf in chnk real(r8), pointer :: pbuf_ik(:,:) ! ptr to pbuf data (/pcols,pver/) integer :: tmpIdx ! pbuf field id @@ -3641,9 +3884,9 @@ subroutine chem_emissions( state, cam_in ) integer :: RC ! return code ! LCHNK: which chunk we have on this process - LCHNK = State%LCHNK + LCHNK = state%LCHNK ! NCOL: number of atmospheric columns on this chunk - NCOL = State%NCOL + NCOL = state%NCOL rootChunk = ( MasterProc.and.(LCHNK.EQ.BEGCHUNK) ) sflx(:,:) = 0.0e+0_r8 @@ -3666,14 +3909,7 @@ subroutine chem_emissions( state, cam_in ) ! For each column retrieve data from pbuf_ik(I,K) sflx(1:ncol,N) = pbuf_ik(1:ncol,pver) ! Only surface emissions for now, - !TMMF, Replace this in chem_init - M = -1 - DO I = 1, nTracers - IF( TRIM( to_upper( TRIM(tracerNames(N)) ) ) == TRIM( to_upper( cnst_name(I)) ) ) THEN - M = I - EXIT - ENDIF - ENDDO + M = map2GCinv(N) IF ( M <= 0 ) CYCLE From dac46d589284d258298bd5b1cafb4d1711274ea3 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 2 Sep 2020 17:32:10 -0400 Subject: [PATCH 130/239] Feat: Get UVALBEDO from HEMCO CAM only defines albedo during daytime. However, UVALBEDO is only used for photolysis, which should be fine. Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index b3db0b9c34..ed0553f417 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -2504,6 +2504,21 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%SUNCOS (1,:) = CSZA(:) State_Met(LCHNK)%SUNCOSmid (1,:) = CSZAmid(:) + ! Field : UVALBEDO + ! Description: UV surface albedo + ! Unit : - + ! Dimensions : nX, nY + fldname_ns = 'HCO_uvalbedo' + tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + State_Met(LCHNK)%UVALBEDO(1,:) = 0.0e+0_fp + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + State_Met(LCHNK)%UVALBEDO(1,:) = pbuf_ik(:,nZ) + ENDIF + ! Field : U10M, V10M ! Description: E/W and N/S wind speed @ 10m height ! Unit : m/s @@ -2938,18 +2953,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ! that is for fullchem or aerosol simulations. ! IF ( ITS_A_FULLCHEM_SIM .or. ITS_AN_AEROSOL_SIM ) THEN ! - ! ! Copy UV Albedo data (for photolysis) into the - ! ! State_Met%UVALBEDO field. (bmy, 3/20/15) - ! CALL Get_UvAlbedo( Input_Opt = Input_Opt, & - ! State_Met = State_Met(LCHNK), & - ! RC = RC ) - ! - ! ! Trap potential errors - ! IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = 'Error encountered in "Get_UvAlbedo"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - ! ENDIF - ! ! IF ( Input_Opt%USE_TOMS_O3 ) THEN ! ! Get TOMS overhead O3 columns for photolysis from ! ! the HEMCO data structure (bmy, 3/20/15) From 65fa2dc765c42afc46da6ce7ffa4c8b4f72cd5be Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 24 Sep 2020 18:02:48 -0400 Subject: [PATCH 131/239] Feat: Define MaxTrop/StratLev from grid + Add Set_H2O_Trac Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 321 +++++++++++++++--------- 1 file changed, 200 insertions(+), 121 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index ed0553f417..03c72ed9bb 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -18,15 +18,15 @@ module chemistry !-------------------------------------------------------------------- ! Basic GEOS-Chem modules !-------------------------------------------------------------------- - USE DiagList_Mod, ONLY : DgnList ! Derived type for diagnostics list - USE Input_Opt_Mod, ONLY : OptInput ! Derived type for Input Options - USE State_Chm_Mod, ONLY : ChmState ! Derived type for Chemistry State object - USE State_Diag_Mod, ONLY : DgnState ! Derived type for Diagnostics State object - USE State_Grid_Mod, ONLY : GrdState ! Derived type for Grid State object - USE State_Met_Mod, ONLY : MetState ! Derived type for Meteorology State object - USE Species_Mod, ONLY : Species ! Derived type for Species object - USE ErrCode_Mod ! Error codes for success or failure - USE Error_Mod ! For error checking + USE DiagList_Mod, ONLY : DgnList ! Derived type for diagnostics list + USE Input_Opt_Mod, ONLY : OptInput ! Derived type for Input Options + USE State_Chm_Mod, ONLY : ChmState ! Derived type for Chemistry State object + USE State_Diag_Mod, ONLY : DgnState ! Derived type for Diagnostics State object + USE State_Grid_Mod, ONLY : GrdState ! Derived type for Grid State object + USE State_Met_Mod, ONLY : MetState ! Derived type for Meteorology State object + USE Species_Mod, ONLY : Species ! Derived type for Species object + USE ErrCode_Mod ! Error codes for success or failure + USE Error_Mod ! For error checking !----------------------------------------------------------------- ! Parameters to define floating-point variables @@ -96,12 +96,12 @@ module chemistry !----------------------------- ! Derived type objects !----------------------------- - TYPE(OptInput) :: Input_Opt ! Input Options object - TYPE(ChmState),ALLOCATABLE :: State_Chm(:) ! Chemistry State object - TYPE(DgnState),ALLOCATABLE :: State_Diag(:) ! Diagnostics State object - TYPE(GrdState),ALLOCATABLE :: State_Grid(:) ! Grid State object - TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object - TYPE(DgnList ) :: Diag_List ! Diagnostics list object + TYPE(OptInput) :: Input_Opt ! Input Options object + TYPE(ChmState),ALLOCATABLE :: State_Chm(:) ! Chemistry State object + TYPE(DgnState),ALLOCATABLE :: State_Diag(:) ! Diagnostics State object + TYPE(GrdState),ALLOCATABLE :: State_Grid(:) ! Grid State object + TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object + TYPE(DgnList ) :: Diag_List ! Diagnostics list object type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! ptr to 2d pbuf @@ -227,6 +227,9 @@ subroutine chem_register INTEGER :: RC, IERR + ! Initialize pointer + ThisSpc => NULL() + ! SDE 2018-05-02: This seems to get called before anything else ! that includes CHEM_INIT ! At this point, mozart calls SET_SIM_DAT, which is specified by each @@ -920,7 +923,7 @@ subroutine chem_init(phys_state, pbuf2d) use cam_abortutils, only : endrun use Phys_Grid, only : get_Area_All_p - use hycoef, only : ps0, hyai, hybi + use hycoef, only : ps0, hyai, hybi, hyam use seq_drydep_mod, only : drydep_method, DD_XLND #if ( OCNDDVEL_MOZART ) @@ -941,9 +944,9 @@ subroutine chem_init(phys_state, pbuf2d) use State_Chm_Mod use State_Grid_Mod use State_Met_Mod - use DiagList_Mod, only : Init_DiagList, Print_DiagList + use DiagList_Mod, only : Init_DiagList, Print_DiagList use GC_Environment_Mod - use GC_Grid_Mod, only : SetGridFromCtrEdges + use GC_Grid_Mod, only : SetGridFromCtrEdges ! Use GEOS-Chem versions of physical constants use PhysConstants, only : PI, PI_180, Re @@ -986,6 +989,7 @@ subroutine chem_init(phys_state, pbuf2d) INTEGER :: IWAIT, IERR INTEGER :: nX, nY, nZ INTEGER :: iX, jY + INTEGER :: nStrat INTEGER :: I, J, L, N INTEGER :: RC INTEGER :: nLinoz @@ -1010,7 +1014,7 @@ subroutine chem_init(phys_state, pbuf2d) REAL(r8), ALLOCATABLE :: Col_Area(:) REAL(fp), ALLOCATABLE :: Ap_CAM_Flip(:), Bp_CAM_Flip(:) - REAL(r8), POINTER :: SlsPtr(:,:,:) + !REAL(r8), POINTER :: SlsPtr(:,:,:) ! Assume a successful return until otherwise @@ -1078,6 +1082,12 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ! Find stratopause level, defined at 1 hPa + nStrat = nZ + DO WHILE ( hyam(nZ+1-nStrat) * ps0 < 100.0 ) + nStrat = nStrat-1 + ENDDO + DO I = BEGCHUNK, ENDCHUNK ! Initialize fields of the Grid State object @@ -1097,7 +1107,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Initialize GEOS-Chem horizontal grid structure CALL GC_Init_Grid( Input_Opt = Input_Opt, & State_Grid = State_Grid(I), & - RC = RC ) + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered within call to "GC_Init_Grid"!' @@ -1105,9 +1115,8 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ! Define more variables for State_Grid - ! TMMF, might need tweaking - State_Grid(I)%MaxTropLev = MIN(40, nZ) - State_Grid(I)%MaxStratLev = MIN(59, nZ) + State_Grid(I)%MaxTropLev = nZ + State_Grid(I)%MaxStratLev = nStrat ! Set maximum number of levels in the chemistry grid IF ( Input_Opt%LUCX ) THEN @@ -1128,18 +1137,7 @@ subroutine chem_init(phys_state, pbuf2d) ! allocatable arrays used by GEOS-Chem. CALL GC_Allocate_All ( Input_Opt = Input_Opt, & State_Grid = State_Grid(BEGCHUNK), & - value_I_Lo = 1, & - value_J_Lo = 1, & - value_I_Hi = nX, & - value_J_Hi = nY, & - value_IM = nX, & - value_JM = nY, & - value_LM = nZ, & - value_IM_WORLD = nX, & - value_JM_WORLD = nY, & - value_LM_WORLD = nZ, & - value_LLSTRAT = 59, & !TMMF - RC = RC ) + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "GC_Allocate_All"!' @@ -1157,6 +1155,8 @@ subroutine chem_init(phys_state, pbuf2d) !ENDIF !CALL + Input_Opt%DryRun = .False. + ! For now just hard-code it ! First setup directories Input_Opt%Chem_Inputs_Dir = TRIM(chemInputsDir) @@ -1204,52 +1204,58 @@ subroutine chem_init(phys_state, pbuf2d) 'CHEM_INPUTS/FAST_JX/v2020-02/' ! Now READ_CONVECTION_MENU - ! For now, TMMF Input_Opt%LConv = .False. Input_Opt%LTurb = .True. Input_Opt%LNLPBL = .True. ! Now READ_EMISSIONS_MENU + ! This menu is pointless in CESM-GC Input_Opt%LEmis = .False. Input_Opt%HCOConfigFile = 'HEMCO_Config.rc' + Input_Opt%LSoilNOx = .True. + ! Set surface VMRs - turn this off so that CAM can handle it Input_Opt%LCH4Emis = .False. Input_Opt%LCH4SBC = .False. ! Set initial conditions - Input_Opt%LSetH2O = .True. + Input_Opt%LSetH2O = .False. !TMMF ! Now READ_AEROSOL_MENU - Input_Opt%LSulf = .True. - Input_Opt%LMetalcatSO2 = .True. - Input_Opt%LCarb = .True. - Input_Opt%LBrC = .False. - Input_Opt%LSOA = .False. - Input_Opt%LSVPOA = .False. - Input_Opt%LDust = .True. - Input_Opt%LDstUp = .False. - Input_Opt%LSSalt = .True. - Input_Opt%SalA_rEdge_um(1) = 0.01e+0_fp - Input_Opt%SalA_rEdge_um(2) = 0.50e+0_fp - Input_Opt%SalC_rEdge_um(1) = 0.50e+0_fp - Input_Opt%SalC_rEdge_um(2) = 8.00e+0_fp - Input_Opt%LMPOA = .False. + Input_Opt%LSulf = .True. + Input_Opt%LMetalcatSO2 = .True. + Input_Opt%LCarb = .True. + Input_Opt%LBrC = .False. + Input_Opt%LSOA = .False. + Input_Opt%LSVPOA = .False. + Input_Opt%LDust = .True. + Input_Opt%LDstUp = .False. + Input_Opt%LSSalt = .True. + Input_Opt%SalA_rEdge_um(1) = 0.01e+0_fp + Input_Opt%SalA_rEdge_um(2) = 0.50e+0_fp + Input_Opt%SalC_rEdge_um(1) = 0.50e+0_fp + Input_Opt%SalC_rEdge_um(2) = 8.00e+0_fp + Input_Opt%LMPOA = .False. ! For now, disable solid PSCs and strat aerosol settling ! Our treatment of the stratosphere isn't really sophisticated ! enough to warrant it yet - Input_Opt%LGravStrat = .False. - Input_Opt%LSolidPSC = .False. - Input_Opt%LHomNucNAT = .False. - Input_Opt%T_NAT_Supercool = 3.0e+0_fp - Input_Opt%P_Ice_Supersat = 1.2e+0_fp - Input_Opt%LPSCChem = .True. - Input_Opt%LStratOD = .True. - Input_Opt%hvAerNIT = .False. - Input_Opt%hvAerNIT_JNIT = .False. - Input_Opt%hvAerNIT_JNITs = .False. - Input_Opt%JNITChanA = 0e+0_fp - Input_Opt%JNITChanB = 0e+0_fp + Input_Opt%LGravStrat = .False. + Input_Opt%LSolidPSC = .False. + Input_Opt%LHomNucNAT = .False. + Input_Opt%T_NAT_Supercool = 3.0e+0_fp + Input_Opt%P_Ice_Supersat = 1.2e+0_fp + Input_Opt%LPSCChem = .True. + Input_Opt%LStratOD = .True. + + Input_Opt%LBCAE = .True. + Input_Opt%BCAE_1 = 1.5e+0_fp + Input_Opt%BCAE_2 = 1.0e+0_fp + Input_Opt%hvAerNIT = .False. + Input_Opt%hvAerNIT_JNIT = .False. + Input_Opt%hvAerNIT_JNITs = .False. + Input_Opt%JNITChanA = 66.667e+0_fp + Input_Opt%JNITChanB = 33.333e+0_fp ! Now READ_DEPOSITION_MENU Input_Opt%LDryD = .True. @@ -1268,7 +1274,7 @@ subroutine chem_init(phys_state, pbuf2d) !================================================================== Input_Opt%LWetD = .True. Input_Opt%CO2_Effect = .False. - Input_Opt%CO2_Level = 390.0_fp + Input_Opt%CO2_Level = 600.0_fp Input_Opt%CO2_Ref = 390.0_fp ! Now READ_CHEMISTRY_MENU @@ -1279,12 +1285,20 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%LUCX = .True. Input_Opt%LActiveH2O = .True. Input_Opt%Use_Online_O3 = .True. - ! Expect to get total overhead ozone, although it shouldn not + ! Expect to get total overhead ozone, although it should not ! make too much of a difference since we want to use "full-UCX" Input_Opt%Use_O3_from_Met = .True. Input_Opt%Use_TOMS_O3 = .False. Input_Opt%Gamma_HO2 = 0.2e+0_fp + ! CESM-specific input flags + ! onlineAlbedo -> True (use CLM albedo) + ! -> False (read monthly-mean albedo from HEMCO) + Input_Opt%onlineAlbedo = .True. + ! onlineLandTypes -> True (use CLM landtypes) + ! -> False (read landtypes from HEMCO) + Input_Opt%onlineLandTypes = .True. !TMMF + Input_Opt%LPRT = .False. ! Read in data for Linoz. All CPUs allocate one array to hold the data. Only @@ -1432,13 +1446,17 @@ subroutine chem_init(phys_state, pbuf2d) DO I = BEGCHUNK, ENDCHUNK Input_Opt%amIRoot = (MasterProc .AND. (I == BEGCHUNK)) - CALL GC_Init_StateObj( Diag_List = Diag_List, & ! Diagnostic list obj - Input_Opt = Input_Opt, & ! Input Options - State_Chm = State_Chm(I), & ! Chemistry State - State_Diag = State_Diag(I), & ! Diagnostics State - State_Grid = State_Grid(I), & ! Grid State - State_Met = State_Met(I), & ! Meteorology State - RC = RC ) ! Success or failure + IF ( prtDebug ) THEN + CALL Print_DiagList( Input_Opt%amIRoot, Diag_List, RC ) + ENDIF + + CALL GC_Init_StateObj( Diag_List = Diag_List, & ! Diagnostic list obj + Input_Opt = Input_Opt, & ! Input Options + State_Chm = State_Chm(I), & ! Chemistry State + State_Diag = State_Diag(I), & ! Diagnostics State + State_Grid = State_Grid(I), & ! Grid State + State_Met = State_Met(I), & ! Meteorology State + RC = RC ) ! Success or failure ! Trap potential errors IF ( RC /= GC_SUCCESS ) THEN @@ -1617,7 +1635,8 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - DEALLOCATE(Ap_CAM_Flip,Bp_CAM_Flip) + DEALLOCATE(Ap_CAM_Flip) + DEALLOCATE(Bp_CAM_Flip) ! Once the initial met fields have been read in, we need to find ! the maximum PBL level for the non-local mixing algorithm. @@ -1668,6 +1687,8 @@ subroutine chem_init(phys_state, pbuf2d) iPSO4 = Ind_('PSO4') SpcInfo => State_Chm(BEGCHUNK)%SpcData(iPSO4)%Info MWPSO4 = REAL(SpcInfo%MW_g,r8) + ! Free pointer + SpcInfo => NULL() ! Get indices for physical fields in physics buffer NDX_PBLH = pbuf_get_index('pblh' ) @@ -1749,8 +1770,6 @@ subroutine chem_init(phys_state, pbuf2d) If ( MasterProc ) Write(iulog,*) "hco_pbuf2d now points to pbuf2d" - hco_pbuf2d => pbuf2d - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT' end subroutine chem_init @@ -1796,7 +1815,7 @@ subroutine GC_Update_Timesteps(DT) UNIT_CONV = DT_MIN, & CONVECTION = DT_MIN, & DIAGNOS = DT_MIN, & - RADIATION = DT_MIN ) + RADIATION = DT_MIN ) DT_MIN_LAST = DT_MIN ENDIF @@ -1850,6 +1869,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Wetscav_Mod, only : Setup_Wetscav, Do_WetDep use CMN_Size_Mod, only : PTop use PBL_Mix_Mod, only : Compute_PBL_Height + use UCX_Mod, only : Set_H2O_Trac use Tropopause, only : Tropopause_findChemTrop, Tropopause_Find use HCO_Utilities_GC_Mod ! Utility routines for GC-HEMCO interface @@ -2011,6 +2031,20 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) LOGICAL :: rootChunk INTEGER :: RC + ! Initialize pointers + SpcInfo => NULL() + PblH => NULL() + cldTop => NULL() + cldFrc => NULL() + Fsds => NULL() + PRain => NULL() + NEvapr => NULL() + LsFlxPrc => NULL() + LsFlxSnw => NULL() + cmfdqr => NULL() + pbuf_chnk=> NULL() + pbuf_ik => NULL() + ! LCHNK: which chunk we have on this process LCHNK = state%LCHNK ! NCOL: number of atmospheric columns on this chunk @@ -2361,6 +2395,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! 2-D data is stored in the 1st level of a ! 3-D array due to laziness ENDDO + pbuf_ik => NULL() ENDIF Write(fldname_ns, '(a,i2.2)') 'HCO_XLAI', N-1 @@ -2375,6 +2410,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! 2-D data is stored in the 1st level of a ! 3-D array due to laziness ENDDO + pbuf_ik => NULL() ENDIF ENDDO #endif @@ -2508,15 +2544,21 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: UV surface albedo ! Unit : - ! Dimensions : nX, nY - fldname_ns = 'HCO_uvalbedo' - tmpIdx = pbuf_get_index(fldname_ns, RC) - IF ( tmpIdx < 0 ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) - State_Met(LCHNK)%UVALBEDO(1,:) = 0.0e+0_fp + IF ( Input_Opt%onlineAlbedo ) THEN + State_Met(LCHNK)%UVALBEDO(1,:) = cam_in%asdir(:) ELSE - pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) - CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) - State_Met(LCHNK)%UVALBEDO(1,:) = pbuf_ik(:,nZ) + fldname_ns = 'HCO_UV_ALBEDO' + tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + State_Met(LCHNK)%UVALBEDO(1,:) = 0.0e+0_fp + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + State_Met(LCHNK)%UVALBEDO(1,:) = pbuf_ik(:,nZ) + pbuf_chnk => NULL() + pbuf_ik => NULL() + ENDIF ENDIF ! Field : U10M, V10M @@ -2557,6 +2599,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) State_Met(LCHNK)%IODIDE(1,:) = pbuf_ik(:,nZ) + pbuf_chnk => NULL() + pbuf_ik => NULL() ENDIF ! Field : SALINITY @@ -2573,6 +2617,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) State_Met(LCHNK)%SALINITY(1,:) = pbuf_ik(:,nZ) + pbuf_chnk => NULL() + pbuf_ik => NULL() ENDIF ! Three-dimensional fields on level edges @@ -2734,12 +2780,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Dimensions : nX, nY, nZ State_Met(LCHNK)%OPTD = State_Met(LCHNK)%TAUCLI + State_Met(LCHNK)%TAUCLW - ! Field : InChemGrid - ! Description: Are we in the chemistry grid? - ! Unit : - - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%InChemGrid(:,:,:) = .True. - ! Determine current date and time CALL Get_Curr_Date( yr = currYr, & mon = currMo, & @@ -2854,13 +2894,26 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! across box) ! (8) AIRDEN : Mean grid box dry air density [kg/m^3] ! (defined as total dry air mass/box vol) - ! (9) MAIRDEN : Mean grid box moist air density [kg/m^3] + ! (9) AIRNUMDEN : Mean grid box dry air number density [molec/m^3] + ! (10) MAIRDEN : Mean grid box moist air density [kg/m^3] ! (defined as total moist air mass/box vol) - ! (10) AD : Total dry air mass in grid box [kg] - ! (11) ADMOIST : Total moist air mass in grid box [kg] - ! (12) BXHEIGHT : Vertical height of grid box [m] - ! (13) AIRVOL : Volume of grid box [m^3] - ! (14) MOISTMW : Molecular weight of moist air in box [g/mol] + ! (11) AD : Total dry air mass in grid box [kg] + ! (12) ADMOIST : Total moist air mass in grid box [kg] + ! (13) BXHEIGHT : Vertical height of grid box [m] + ! (14) AIRVOL : Volume of grid box [m^3] + ! (15) MOISTMW : Molecular weight of moist air in box [g/mol] + ! (16) IsLand : Logical for grid cells over land [-] + ! (17) IsWater : Logical for grid cells over water [-] + ! (18) IsIce : Logical for grid cells over ice [-] + ! (19) IsSnow : Logical for grid cells over snow [-] + ! (20) InTroposph: Logical for tropospheric grid cells [-] + ! (21) InStratMes: Logical for non-tropospheric grid cells [-] + ! (22) InStratosp: Logical for stratospheric grid cells [-] + ! (23) InChemGrid: Logical for chemistry grid cells [-] + ! (24) LocalSolar: Local solar time [-] + ! (25) IsLocalNoo: Logical for local noon [-] + ! (26) TropLev : Maximum tropopause level [-] + ! (27) TropHt : Maximum tropopause height [km] ! ==================================================================== CALL AirQnt( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & @@ -2935,6 +2988,32 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) SCHEM_READY = .True. ENDIF + ! SDE 05/28/13: Set H2O to State_Chm tracer if relevant and, + ! if LUCX=T and LSETH2O=F and LACTIVEH2O=T, update specific humidity + ! in the stratosphere + ! + ! NOTE: Specific humidity may change in SET_H2O_TRAC and + ! therefore this routine may call AIRQNT again to update + ! air quantities and tracer concentrations (ewl, 10/28/15) + IF ( Input_Opt%Its_A_Fullchem_Sim .and. iH2O > 0 ) THEN + CALL Set_H2O_Trac( SETSTRAT = ( ( .not. Input_Opt%LUCX ) & + .or. Input_Opt%LSETH2O ), & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Set_H2O_Trac" #1!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Only force strat once if using UCX + IF (Input_Opt%LSETH2O) Input_Opt%LSETH2O = .FALSE. + ENDIF + !---------------------------------------------------------- ! %%% GET SOME NON-EMISSIONS DATA FIELDS VIA HEMCO %%% ! @@ -2947,11 +3026,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! take these calls out of the emissions sequence. ! (ckeller, 4/01/15) !---------------------------------------------------------- - !IF ( LCHEM .and. newMonth ) THEN + !IF ( Input_Opt%LCHEM .and. newMonth ) THEN ! ! ! The following only apply when photolysis is used, ! ! that is for fullchem or aerosol simulations. - ! IF ( ITS_A_FULLCHEM_SIM .or. ITS_AN_AEROSOL_SIM ) THEN + ! IF ( Input_Opt%Its_A_Fullchem_Sim .or. Input_Opt%Its_An_Aerosol_Sim ) THEN ! ! IF ( Input_Opt%USE_TOMS_O3 ) THEN ! ! Get TOMS overhead O3 columns for photolysis from @@ -3322,28 +3401,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - !!=========================================================== - !! ***** C L O U D C O N V E C T I O N ***** - !!=========================================================== - !IF ( Input_Opt%LConv ) THEN - ! - ! ! Call the appropriate convection routine - ! ! NOTE: Tracer concentration units are converted locally - ! ! to [kg/kg total air] for convection (ewl, 9/18/15) - ! CALL Do_Convection( Input_Opt = Input_Opt, & - ! State_Chm = State_Chm(LCHNK), & - ! State_Diag = State_Diag(LCHNK), & - ! State_Grid = State_Grid(LCHNK), & - ! State_Met = State_Met(LCHNK), & - ! RC = RC ) - ! - ! ! Trap potential errors - ! IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = 'Error encountered in "Do_Convection"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - ! ENDIF - !ENDIF - !============================================================== ! ***** C H E M I S T R Y ***** !============================================================== @@ -3367,7 +3424,20 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF - !TMMF - Add Set_h2o_trac + IF ( Input_Opt%Its_A_Fullchem_Sim .and. iH2O > 0 ) THEN + CALL Set_H2O_Trac( SETSTRAT = (.not. Input_Opt%LUCX), & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Set_H2O_Trac" #2!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF CALL Do_Chemistry( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & @@ -3471,6 +3541,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( M > 0 ) THEN SpcInfo => State_Chm(BEGCHUNK)%SpcData(M)%Info isWD = SpcInfo%Is_WetDep + ! Free pointer SpcInfo => NULL() ENDIF @@ -3886,6 +3957,10 @@ subroutine chem_emissions( state, cam_in ) character(len=255) :: fldname_ns ! field name HCO_NH3 integer :: RC ! return code + ! Initialize pointers + pbuf_chnk => NULL() + pbuf_ik => NULL() + ! LCHNK: which chunk we have on this process LCHNK = state%LCHNK ! NCOL: number of atmospheric columns on this chunk @@ -3912,6 +3987,10 @@ subroutine chem_emissions( state, cam_in ) ! For each column retrieve data from pbuf_ik(I,K) sflx(1:ncol,N) = pbuf_ik(1:ncol,pver) ! Only surface emissions for now, + ! Reset pointers + pbuf_ik => NULL() + pbuf_chnk => NULL() + M = map2GCinv(N) IF ( M <= 0 ) CYCLE From 64dac7d32153a0fd70de335ae9f14dad4582aee9 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 28 Sep 2020 09:15:39 -0400 Subject: [PATCH 132/239] Feat: Add OH and JRates diagnostics. Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 246 ++++++++++++++++++------ 1 file changed, 186 insertions(+), 60 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 03c72ed9bb..1f057a5ffd 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -106,9 +106,9 @@ module chemistry type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! ptr to 2d pbuf ! Indices of critical species - INTEGER :: iH2O, iO3, iCH4, iCO, iNO + INTEGER :: iH2O, iO3, iCH4, iCO, iNO, iOH INTEGER :: iO, iH, iO2, iPSO4 - REAL(r8) :: MWPSO4 + REAL(r8) :: MWOH, MWPSO4 ! Indices in the physics buffer INTEGER :: NDX_PBLH ! PBL height [m] @@ -129,9 +129,15 @@ module chemistry ! Index of 1st constituent INTEGER :: iFirstCnst = -1 + ! Number of diagnosed photolytic reactions + INTEGER :: nPhotol + ! Strings - CHARACTER(LEN=255) :: ThisLoc - CHARACTER(LEN=255) :: ErrMsg + CHARACTER(LEN=255) :: ThisLoc + CHARACTER(LEN=255) :: ErrMsg + + REAL(r8) :: OH_Total + REAL(r8) :: Air_Total #define ALLDDVEL_GEOSCHEM 1 #define OCNDDVEL_GEOSCHEM 0 @@ -915,65 +921,66 @@ subroutine chem_init(phys_state, pbuf2d) ! (and declare history variables) ! !----------------------------------------------------------------------- - use physics_buffer, only : physics_buffer_desc, pbuf_get_index - use cam_history, only : addfld, add_default, horiz_only - use chem_mods, only : map2GC_dryDep, drySpc_ndx + use physics_buffer, only : physics_buffer_desc, pbuf_get_index + use cam_history, only : addfld, add_default, horiz_only + use chem_mods, only : map2GC_dryDep, drySpc_ndx +#ifdef SPMD use mpishorthand - use cam_abortutils, only : endrun +#endif + use cam_abortutils, only : endrun - use Phys_Grid, only : get_Area_All_p - use hycoef, only : ps0, hyai, hybi, hyam + use Phys_Grid, only : get_Area_All_p + use hycoef, only : ps0, hyai, hybi, hyam - use seq_drydep_mod, only : drydep_method, DD_XLND + use seq_drydep_mod, only : drydep_method, DD_XLND #if ( OCNDDVEL_MOZART ) - use mo_drydep, only : drydep_inti + use mo_drydep, only : drydep_inti #endif - use gas_wetdep_opts, only : gas_wetdep_method - use mo_neu_wetdep, only : neu_wetdep_init + use gas_wetdep_opts, only : gas_wetdep_method + use mo_neu_wetdep, only : neu_wetdep_init #if defined( MODAL_AERO_4MODE ) - use aero_model, only : aero_model_init - use mo_setsox, only : sox_inti - use mo_drydep, only : drydep_inti_landuse - use modal_aero_data, only : ntot_amode, nspec_amode - use modal_aero_data, only : xname_massptr + use aero_model, only : aero_model_init + use mo_setsox, only : sox_inti + use mo_drydep, only : drydep_inti_landuse + use modal_aero_data, only : ntot_amode, nspec_amode + use modal_aero_data, only : xname_massptr #endif use Input_Opt_Mod use State_Chm_Mod use State_Grid_Mod use State_Met_Mod - use DiagList_Mod, only : Init_DiagList, Print_DiagList + use DiagList_Mod, only : Init_DiagList, Print_DiagList use GC_Environment_Mod - use GC_Grid_Mod, only : SetGridFromCtrEdges + use GC_Grid_Mod, only : SetGridFromCtrEdges + use State_Diag_Mod, only : get_TagInfo ! Use GEOS-Chem versions of physical constants - use PhysConstants, only : PI, PI_180, Re + use PhysConstants, only : PI, PI_180, Re - use Time_Mod, only : Accept_External_Date_Time - !use Time_Mod, only : Set_Begin_Time, Set_End_Time - !use Time_Mod, only : Set_Current_Time, Set_DiagB - !use Transfer_Mod, only : Init_Transfer - use Linoz_Mod, only : Linoz_Read + use Time_Mod, only : Accept_External_Date_Time + use Linoz_Mod, only : Linoz_Read use CMN_Size_Mod - use Drydep_Mod, only : depName, Ndvzind - use Pressure_Mod, only : Accept_External_ApBp - use Chemistry_Mod, only : Init_Chemistry - use Ucx_Mod, only : Init_Ucx - use Input_mod, only : Validate_Directories + use Drydep_Mod, only : depName, Ndvzind + use Pressure_Mod, only : Accept_External_ApBp + use Chemistry_Mod, only : Init_Chemistry + use Ucx_Mod, only : Init_Ucx + use Input_mod, only : Validate_Directories #if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) use Olson_Landmap_Mod #endif use Mixing_Mod use Vdiff_Mod + use CMN_FJX_MOD, only : JVN_ - use mo_setinv, only : setinv_inti - use mo_mean_mass, only : init_mean_mass + use mo_setinv, only : setinv_inti + use mo_mean_mass, only : init_mean_mass - use GC_Emissions_Mod, only : GC_Emissions_Init + use GC_Emissions_Mod, only : GC_Emissions_Init TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) @@ -990,16 +997,18 @@ subroutine chem_init(phys_state, pbuf2d) INTEGER :: nX, nY, nZ INTEGER :: iX, jY INTEGER :: nStrat - INTEGER :: I, J, L, N + INTEGER :: I, J, L, N, M INTEGER :: RC INTEGER :: nLinoz ! Logicals LOGICAL :: prtDebug + LOGICAL :: Found ! Strings CHARACTER(LEN=255) :: historyConfigFile CHARACTER(LEN=255) :: SpcName + CHARACTER(LEN=255) :: tagName ! Objects TYPE(Species), POINTER :: SpcInfo @@ -1016,7 +1025,6 @@ subroutine chem_init(phys_state, pbuf2d) !REAL(r8), POINTER :: SlsPtr(:,:,:) - ! Assume a successful return until otherwise RC = GC_SUCCESS @@ -1435,6 +1443,7 @@ subroutine chem_init(phys_state, pbuf2d) historyConfigFile = 'HISTORY.rc' ! InputOpt not yet initialized !TMMF need to pass input.geos path !CALL Init_DiagList( MasterProc, historyConfigFile, Diag_List, RC ) + !IF ( RC /= GC_SUCCESS ) THEN ! ErrMsg = 'Error encountered in "Init_DiagList"!' ! CALL Error_Stop( ErrMsg, ThisLoc ) @@ -1675,6 +1684,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Get some indices iH2O = Ind_('H2O') + iOH = Ind_('OH') iO3 = Ind_('O3') iCH4 = Ind_('CH4') iCO = Ind_('CO') @@ -1683,6 +1693,13 @@ subroutine chem_init(phys_state, pbuf2d) iO = Ind_('O') iH = Ind_('H') iO2 = Ind_('O2') + + ! This is used to compute gas-phase H2SO4 production + SpcInfo => State_Chm(BEGCHUNK)%SpcData(iOH)%Info + MWOH = REAL(SpcInfo%MW_g,r8) + ! Free pointer + SpcInfo => NULL() + ! This is used to compute gas-phase H2SO4 production iPSO4 = Ind_('PSO4') SpcInfo => State_Chm(BEGCHUNK)%SpcData(iPSO4)%Info @@ -1760,6 +1777,40 @@ subroutine chem_init(phys_state, pbuf2d) ENDDO ENDIF + CALL get_TagInfo( Input_Opt = Input_Opt, & + tagID = 'PHO', & + State_Chm = State_Chm(BEGCHUNK), & + Found = Found, & + RC = RC, & + nTags = nPhotol ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Abnormal exit from routine "Get_TagInfo", could not ' // & + ' get nTags!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + DO M = 1, nPhotol + CALL get_TagInfo( Input_Opt = Input_Opt, & + tagID = 'PHO', & + State_Chm = State_Chm(BEGCHUNK), & + Found = Found, & + RC = RC, & + N = M, & + tagName = tagName ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Abnormal exit from routine "Get_TagInfo"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + SpcName = 'Jval_' // TRIM( tagName ) + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'I', '1/s', & + TRIM(tagName) // ' photolysis rate' ) + ENDDO + ! Initialize emissions interface (this will eventually handle HEMCO) CALL GC_Emissions_Init @@ -1831,6 +1882,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use camsrfexch, only : cam_in_t, cam_out_t use mo_tracname, only : solsym +#ifdef SPMD + use mpishorthand +#endif + use phys_grid, only : get_ncols_p, get_rlat_all_p, get_rlon_all_p use chem_mods, only : drySpc_ndx, map2GC_dryDep @@ -1870,6 +1925,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use CMN_Size_Mod, only : PTop use PBL_Mix_Mod, only : Compute_PBL_Height use UCX_Mod, only : Set_H2O_Trac + use CMN_FJX_MOD, only : ZPJ, JVN_, GC_Photo_ID + use State_Diag_Mod, only : get_TagInfo use Tropopause, only : Tropopause_findChemTrop, Tropopause_Find use HCO_Utilities_GC_Mod ! Utility routines for GC-HEMCO interface @@ -1894,7 +1951,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use aero_model, only : aero_model_gasaerexch ! Use GEOS-Chem versions of physical constants - use PhysConstants, only : PI, PI_180, g0 + use PhysConstants, only : PI, PI_180, g0, AVO use rad_constituents, only : rad_cnst_get_info @@ -1936,6 +1993,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8), POINTER :: LsFlxSnw(:,:) ! Large-scale downward precip. flux at interface (snow only) [kg/m2/s] REAL(r8), POINTER :: cmfdqr(:,:) ! Total convective precip. prod. (rain + snow) [kg/kg/s] + REAL(r8) :: tmpMass REAL(r8) :: cldW (state%NCOL,PVER) ! Cloud water (kg/kg) REAL(r8) :: nCldWtr(state%NCOL,PVER) ! Droplet number concentration (#/kg) @@ -1944,7 +2002,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: satQ (state%NCOL,PVER) ! Work arrays REAL(r8) :: qH2O (state%NCOL,PVER) ! Specific humidity [kg/kg] REAL(r8) :: h2ovmr (state%NCOL,PVER) ! H2O volume mixing ratio - REAL(r8) :: mBar (state%NCOL,PVER) ! Meant wet atmospheric mass [amu] + REAL(r8) :: mBar (state%NCOL,PVER) ! Mean wet atmospheric mass [amu] REAL(r8) :: invariants(state%NCOL,PVER,nfs) REAL(r8) :: reaction_rates(1,1,1) ! Reaction rates (unused) ! For aerosol formation @@ -1966,14 +2024,18 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: MOZART_depFlx(state%NCOL, nTracersMax) #endif ! For GEOS-Chem diagnostics - REAL(r8) :: mmr1(state%NCOL,PVER,gas_pcnst) - REAL(r8) :: wk_out(state%NCOL) - LOGICAL :: isWD - - REAL(r8), PARAMETER :: zlnd = 0.01_r8 ! Roughness length for soil [m] - REAL(r8), PARAMETER :: zslnd = 0.0024_r8 ! Roughness length for snow [m] - REAL(r8), PARAMETER :: zsice = 0.0400_r8 ! Roughness length for sea ice [m] - REAL(r8), PARAMETER :: zocn = 0.0001_r8 ! Roughness length for oean [m] + REAL(r8) :: mmr1(state%NCOL,PVER,gas_pcnst) + REAL(r8) :: wk_out(state%NCOL) + LOGICAL :: isWD + REAL(r8) :: outTmp(state%NCOL,PVER) + REAL(r8) :: JoutTmp(state%NCOL,PVER,nPhotol) + LOGICAL :: Found + CHARACTER(LEN=255) :: tagName + + REAL(r8), PARAMETER :: zlnd = 0.01_r8 ! Roughness length for soil [m] + REAL(r8), PARAMETER :: zslnd = 0.0024_r8 ! Roughness length for snow [m] + REAL(r8), PARAMETER :: zsice = 0.0400_r8 ! Roughness length for sea ice [m] + REAL(r8), PARAMETER :: zocn = 0.0001_r8 ! Roughness length for oean [m] ! Because of strat chem LOGICAL, SAVE :: SCHEM_READY = .FALSE. @@ -2008,9 +2070,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) INTEGER :: SpcId TYPE(Species), POINTER :: SpcInfo - ! For archiving - REAL(r8) :: VMR(state%NCOL,PVER) - REAL(r8) :: SlsData(state%NCOL, PVER, nSls) INTEGER :: currYr, currMo, currDy, currTOD @@ -2031,6 +2090,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) LOGICAL :: rootChunk INTEGER :: RC + ! Initialize pointers SpcInfo => NULL() PblH => NULL() @@ -3439,6 +3499,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF + ZPJ = 0.0e+0_r8 CALL Do_Chemistry( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & @@ -3570,7 +3631,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF - !============================================================== ! ***** M A M G A S - A E R O S O L E X C H A N G E ***** !============================================================== @@ -3630,7 +3690,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) vmr = vmr1, & pbuf = pbuf ) - ! Make sure State_Chm(LCHNK) is back in kg/kg dry! ! Reset H2O MMR to the initial value (no chemistry tendency in H2O just yet) State_Chm(LCHNK)%Species(1,:,:,iH2O) = MMR_Beg(:,:,iH2O) @@ -3649,36 +3708,60 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO CALL set_short_lived_species( SlsData, LCHNK, nY, pbuf ) +#if defined( SPMD ) + ! We here compute a mass-weighted OH average [molec OH/cm3] * [molec air] + ! Species is in kg/kg dry. Convert to molec/box + ! kg/kg air * kg air/m3 * molec/mole / (kg/mole) * m3/cm3 = molec/cm3 + tmpMass = 0.0e+00_r8 + CALL MPISum ( SUM(State_Chm(LCHNK)%Species(1,:nY,:nZ,iOH) * & + State_Met(LCHNK)%AIRDEN(1,:nY,:nZ) * & + State_Met(LCHNK)%AIRNUMDEN(1,:nY,:nZ) * & + State_Met(LCHNK)%AIRVOL(1,:nY,:nZ)) * & + AVO / MWOH * 1.0e+03_r8, & + tmpMass, 1, MPIR8, 0, MPICOM ) + ! This is in [molec OH/cm3] * [molec air] + OH_Total = OH_Total + tmpMass + + ! molec/cm3 * m3/box * cm3/m3 = molec/box + tmpMass = 0.0e+00_r8 + CALL MPISum ( SUM(State_Met(LCHNK)%AIRNUMDEN(1,:nY,:nZ) * & + State_Met(LCHNK)%AIRVOL(1,:nY,:nZ) * 1.0e+06_r8), & + tmpMass, 1, MPIR8, 0, MPICOM ) + ! This is in [molec air] + Air_Total = Air_Total + tmpMass +#endif + ! Write diagnostic output DO N = 1, pcnst M = map2GC(N) I = map2Idx(N) IF ( M > 0 ) THEN SpcName = tracerNames(I) - VMR = 0.0e+0_r8 + outTmp = 0.0e+0_r8 DO J = 1, nY DO K = 1, nZ - VMR(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * MWRatio(I) + outTmp(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * MWRatio(I) ENDDO ENDDO - CALL OutFld( TRIM(SpcName), VMR(:nY,:), nY, LCHNK ) + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) ENDIF ENDDO DO N = 1, nSls SpcName = slsNames(N) - VMR = 0.0e+0_r8 + outTmp = 0.0e+0_r8 M = map2GC_Sls(N) IF ( M > 0 ) THEN DO J = 1, nY DO K = 1, nZ - VMR(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * SLSMWratio(N) + outTmp(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * SLSMWratio(N) ENDDO ENDDO - CALL OutFld( TRIM(SpcName), VMR(:nY,:), nY, LCHNK ) + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) ENDIF ENDDO + ! Dry deposition velocity and surface flux IF ( Input_Opt%LDryD ) THEN DO N = 1, State_Chm(BEGCHUNK)%nDryDep SpcName = 'DepVel_'//TRIM(depName(N)) @@ -3702,6 +3785,38 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDIF + ! Photolysis rates + JoutTmp = 0.0e+00_r8 + DO N = 1, JVN_ + M = GC_Photo_ID(N) + IF ( M > 0 ) THEN + DO J = 1, nY + DO K = 1, nZ + JoutTmp(J,nZ+1-K,M) = JoutTmp(J,nZ+1-K,M) + REAL(ZPJ(K,N,1,J),r8) + ENDDO + ENDDO + ENDIF + ENDDO + + DO M = 1, nPhotol + CALL get_TagInfo( Input_Opt = Input_Opt, & + tagID = 'PHO', & + State_Chm = State_Chm(LCHNK), & + Found = Found, & + RC = RC, & + N = M, & + tagName = tagName ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Abnormal exit from routine "Get_TagInfo"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + SpcName = 'Jval_' // TRIM( tagName ) + CALL OutFld( TRIM(SpcName), JoutTmp(:nY,:,M), nY, LCHNK ) + ENDDO + ! NOTE: Re-flip all the arrays vertically or suffer the consequences ! ptend%q dimensions: [column, ?, species] ptend%q(:,:,:) = 0.0e+0_r8 @@ -3814,10 +3929,21 @@ subroutine chem_final use GC_Emissions_Mod, only: GC_Emissions_Final - INTEGER :: I, RC + ! Local variables + INTEGER :: I, RC + + REAL(r8) :: OHCONC + + OHCONC = OH_Total / Air_Total / 1.0e+05_r8 + + IF ( MasterProc ) THEN + WRITE(iulog,'(/,a)') REPEAT( '=', 79 ) + WRITE(iulog,* ) 'Mass-Weighted OH Concentration' + WRITE(iulog,* ) 'Mean OH = ', OHCONC, ' [1e5 molec/cm3]' + WRITE(iulog,'( a)') REPEAT( '=', 79 ) + ENDIF ! Finalize GEOS-Chem - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_FINAL' CALL Cleanup_UCX CALL Cleanup_Aerosol From ecb5bfc5278e5cc9800a2037a2f59803a4c4f1b8 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 29 Sep 2020 10:21:15 -0400 Subject: [PATCH 133/239] Feat: Get H2O mmr from specific humidity (1) GEOS-Chem's water mass mixing ratio is derived from CAM's specific humidity (2) Additionally, the JRates diagnostics are only computed if they are an output field Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 72 +++++++++++++++++++------ 1 file changed, 57 insertions(+), 15 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 1f057a5ffd..33d157a983 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -105,10 +105,12 @@ module chemistry type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! ptr to 2d pbuf - ! Indices of critical species + ! Indices of critical species in GEOS-Chem INTEGER :: iH2O, iO3, iCH4, iCO, iNO, iOH INTEGER :: iO, iH, iO2, iPSO4 REAL(r8) :: MWOH, MWPSO4 + ! Indices of critical species in the constituent list + INTEGER :: cQ, cH2O ! Indices in the physics buffer INTEGER :: NDX_PBLH ! PBL height [m] @@ -475,10 +477,13 @@ subroutine chem_register ! Most likely, these will be MAM aerosols ! We store the index as the opposite to not confuse with GEOS-Chem ! indices. - CALL cnst_get_ind(TRIM(solsym(N)), I, abort=.true.) + CALL cnst_get_ind(TRIM(solsym(N)), I, abort=.True.) map2chm(N) = -I ENDIF ENDDO + ! Get constituent index of specific humidity + CALL cnst_get_ind('Q', cQ, abort=.True.) + CALL cnst_get_ind('H2O', cH2O, abort=.True.) !============================================================== ! Get mapping between dry deposition species and species set @@ -1742,7 +1747,7 @@ subroutine chem_init(phys_state, pbuf2d) SpcName = TRIM(slsNames(I)) CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & TRIM(slsLongNames(I))//' concentration') - !CALL Add_Default(TRIM(SpcName), 1, '') + !CALL Add_Default(TRIM(SpcName), 1, ' ') ENDDO DO I = 1, State_Chm(BEGCHUNK)%nDryDep @@ -1878,7 +1883,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx use physics_buffer, only : pbuf_get_chunk, pbuf_get_index - use cam_history, only : outfld + use cam_history, only : outfld, hist_fld_active use camsrfexch, only : cam_in_t, cam_out_t use mo_tracname, only : solsym @@ -2179,7 +2184,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Initialize ALL State_Chm species data to zero, not just tracers State_Chm(LCHNK)%Species = 0.0e+0_fp - lq(:) = .FALSE. + lq(:) = .False. ! Map and flip gaseous species MMR_Beg = 0.0e+0_r8 @@ -2192,10 +2197,18 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Chm(LCHNK)%Species(1,J,K,M) = REAL(MMR_Beg(J,K,M),fp) ENDDO ENDDO - lq(N) = .TRUE. + lq(N) = .True. ENDIF ENDDO + ! We need to let CAM know that 'H2O' and 'Q' are identical + DO J = 1, nY + DO K = 1, nZ + MMR_Beg(J,K,iH2O) = state%q(J,nZ+1-K,cQ) + State_Chm(LCHNK)%Species(1,J,K,iH2O) = REAL(MMR_Beg(J,K,iH2O),fp) + ENDDO + ENDDO + ! Retrieve previous value of species data SlsData(:,:,:) = 0.0e+0_r8 CALL get_short_lived_species( SlsData, LCHNK, nY, pbuf ) @@ -2290,7 +2303,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Note MWDry = 28.966 g/mol DO J = 1, nY DO L = 1, nZ - qH2O(J,L) = REAL(State_Chm(LCHNK)%Species(1,J,nZ+1-L,iH2O),r8) + qH2O(J,L) = REAL(state%q(J,L,cQ),r8) + ! Set GEOS-Chem's H2O mixing ratio to CAM's specific humidity 'q' + State_Chm(LCHNK)%Species(1,J,nZ+1-L,iH2O) = qH2O(J,L) h2ovmr(J,L) = qH2O(J,L) * MWDry / 18.016e+0_fp ENDDO ENDDO @@ -3558,7 +3573,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! wetdep is applied ! Do wet deposition - ! NOTE: Tracer concentration units are converted locally + ! Tracer concentration units are converted locally ! to [kg/m2] in wet deposition to enable calculations ! along the column (ewl, 9/18/15) CALL Do_WetDep( Input_Opt = Input_Opt, & @@ -3691,6 +3706,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf = pbuf ) ! Make sure State_Chm(LCHNK) is back in kg/kg dry! + IF ( TRIM(State_Chm(LCHNK)%Spc_Units) /= 'kg/ kg dry' ) THEN + Write(iulog,*) 'Current unit = ', TRIM(State_Chm(LCHNK)%Spc_Units) + Write(iulog,*) 'Expected unit = kg/ kg dry' + CALL ENDRUN('Incorrect unit in GEOS-Chem State_Chm%Species') + ENDIF + ! Reset H2O MMR to the initial value (no chemistry tendency in H2O just yet) State_Chm(LCHNK)%Species(1,:,:,iH2O) = MMR_Beg(:,:,iH2O) @@ -3790,14 +3811,34 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO N = 1, JVN_ M = GC_Photo_ID(N) IF ( M > 0 ) THEN - DO J = 1, nY - DO K = 1, nZ - JoutTmp(J,nZ+1-K,M) = JoutTmp(J,nZ+1-K,M) + REAL(ZPJ(K,N,1,J),r8) - ENDDO - ENDDO + CALL get_TagInfo( Input_Opt = Input_Opt, & + tagID = 'PHO', & + State_Chm = State_Chm(LCHNK), & + Found = Found, & + RC = RC, & + N = M, & + tagName = tagName ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Abnormal exit from routine "Get_TagInfo"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + SpcName = 'Jval_' // TRIM( tagName ) + + IF ( hist_fld_active( TRIM(SpcName) ) ) THEN + DO J = 1, nY + DO K = 1, nZ + JoutTmp(J,nZ+1-K,M) = JoutTmp(J,nZ+1-K,M) + REAL(ZPJ(K,N,1,J),r8) + ENDDO + ENDDO + ENDIF ENDIF ENDDO + ! We need to save out JRates outside of the previous loop as different "N" + ! can contribute to the same "M". DO M = 1, nPhotol CALL get_TagInfo( Input_Opt = Input_Opt, & tagID = 'PHO', & @@ -3817,8 +3858,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL OutFld( TRIM(SpcName), JoutTmp(:nY,:,M), nY, LCHNK ) ENDDO - ! NOTE: Re-flip all the arrays vertically or suffer the consequences - ! ptend%q dimensions: [column, ?, species] + ! Re-flip all the arrays vertically ptend%q(:,:,:) = 0.0e+0_r8 MMR_End = 0.0e+0_r8 DO N = 1, pcnst @@ -3833,6 +3873,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDIF ENDDO + ! Apply GEOS-Chem's H2O mixing ratio tendency to CAM's specific humidity + ptend%q(:,:,cQ) = ptend%q(:,:,cH2O) ! Debug statements ! Ozone tendencies From ce402a2f669a655a0b7ce04d9a37d78e7434c2da Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 30 Sep 2020 09:04:20 -0400 Subject: [PATCH 134/239] Chore: Remove unnecessary comment Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 33d157a983..e92ce8335d 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -327,11 +327,6 @@ subroutine chem_register ref_MMR(I) = ref_VMR / (MWDry / MWTmp) IF ( ThisSpc%Is_Gas == .FALSE. ) THEN Write(cnstName, "(a,a)") 'GC_AER_', to_upper(TRIM(trueName)) - ! Aerosols that inherited from MAM do not need to be defined as a - ! constituent - ! For instance, - ! - SOAGX is inherited from SOAG[0-4] - ! - BCPI is inherited from bc_a1 ENDIF ELSEIF ( I .LE. (nTracers + nAer)) THEN ! Add MAM4 aerosols From 3425bc4ceb2e7f62b2abef3b5ee9384d9645dfeb Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 30 Sep 2020 12:41:42 -0400 Subject: [PATCH 135/239] Fix: Unit check failed because 'kg/ kg dry' /= 'kg/kg dry' Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index e92ce8335d..dc03875bd8 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -328,7 +328,7 @@ subroutine chem_register IF ( ThisSpc%Is_Gas == .FALSE. ) THEN Write(cnstName, "(a,a)") 'GC_AER_', to_upper(TRIM(trueName)) ENDIF - ELSEIF ( I .LE. (nTracers + nAer)) THEN + ELSEIF ( I .LE. (nTracers + nAer) ) THEN ! Add MAM4 aerosols cnstName = TRIM(aerNames(I - nTracers)) lngName = cnstName @@ -3701,7 +3701,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf = pbuf ) ! Make sure State_Chm(LCHNK) is back in kg/kg dry! - IF ( TRIM(State_Chm(LCHNK)%Spc_Units) /= 'kg/ kg dry' ) THEN + IF ( TRIM(State_Chm(LCHNK)%Spc_Units) /= 'kg/kg dry' ) THEN Write(iulog,*) 'Current unit = ', TRIM(State_Chm(LCHNK)%Spc_Units) Write(iulog,*) 'Expected unit = kg/ kg dry' CALL ENDRUN('Incorrect unit in GEOS-Chem State_Chm%Species') From 8d257fcd82ab7f06e462bfe54391c0e163ccd9ad Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 30 Sep 2020 20:00:41 -0400 Subject: [PATCH 136/239] Feat: Remove special handlings as we now use GEOS-Chem IC (1) Previously GEOS-Chem species were modified to account for the species in the CAM restart file (e.g. HNO2 vs HONO). Now, we just use GEOS-Chem initial conditions that have been regridded to ~0.9x1.25 Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index dc03875bd8..29704ac4dc 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -373,12 +373,12 @@ subroutine chem_register ! would save cnst_name rather than load_name. ! Special handlings - IF ( cnstName == 'HNO4' ) THEN - cnstName = 'HO2NO2' - ELSEIF ( cnstName == 'HNO2' ) THEN - cnstName = 'HONO' - ELSEIF ( cnstName == 'HCHO' ) THEN + IF ( cnstName == 'HCHO' ) THEN cnstName = 'CH2O' + !ELSEIF ( cnstName == 'HNO4' ) THEN + ! cnstName = 'HO2NO2' + !ELSEIF ( cnstName == 'HNO2' ) THEN + ! cnstName = 'HONO' !ELSEIF ( cnstName == 'ACET' ) THEN ! cnstName = 'CH3COCH3' !ELSEIF ( cnstName == 'ALD2' ) THEN From bcfea0097f956ed6e4aa6dbd7fb5520fb8fb2fd1 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 2 Oct 2020 14:11:59 -0400 Subject: [PATCH 137/239] Feat: Add option to pass H2O tendency to Q + change some addfld Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 27 ++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 29704ac4dc..5ca5b0df81 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -1299,15 +1299,22 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%Use_TOMS_O3 = .False. Input_Opt%Gamma_HO2 = 0.2e+0_fp + Input_Opt%LPRT = .False. + + !================================================================== ! CESM-specific input flags + !================================================================== + ! onlineAlbedo -> True (use CLM albedo) ! -> False (read monthly-mean albedo from HEMCO) Input_Opt%onlineAlbedo = .True. + ! onlineLandTypes -> True (use CLM landtypes) ! -> False (read landtypes from HEMCO) Input_Opt%onlineLandTypes = .True. !TMMF - Input_Opt%LPRT = .False. + ! applyQtend: apply tendencies of water vapor to specific humidity + Input_Opt%applyQtend = .True. ! Read in data for Linoz. All CPUs allocate one array to hold the data. Only ! the root CPU reads in the data; then we copy it out to a temporary array, @@ -1768,11 +1775,14 @@ subroutine chem_init(phys_state, pbuf2d) IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN DO N = 1, gas_pcnst - CALL Addfld( 'DTWR_'//TRIM(solsym(N)), (/ 'lev' /), 'A', 'kg/kg/s', & + SpcName = 'DTWR_'//TRIM(solsym(N)) + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg/s', & 'wet removal tendency' ) - CALL Addfld( 'WD_'//TRIM(solsym(N)), horiz_only, 'A', 'kg/m2/s', & + SpcName = 'WD_'//TRIM(solsym(N)) + CALL Addfld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & 'vertical integrated wet deposition flux' ) - CALL Addfld( 'WDRATE_'//TRIM(solsym(N)), (/ 'lev' /), 'A', 'kg/s', & + SpcName = 'WDRATE_'//TRIM(solsym(N)) + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/s', & 'wet removal rate' ) ENDDO ENDIF @@ -1807,7 +1817,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF SpcName = 'Jval_' // TRIM( tagName ) - CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'I', '1/s', & + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & TRIM(tagName) // ' photolysis rate' ) ENDDO @@ -3868,8 +3878,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDIF ENDDO - ! Apply GEOS-Chem's H2O mixing ratio tendency to CAM's specific humidity - ptend%q(:,:,cQ) = ptend%q(:,:,cH2O) + + IF ( Input_Opt%applyQtend ) THEN + ! Apply GEOS-Chem's H2O mixing ratio tendency to CAM's specific humidity + ptend%q(:,:,cQ) = ptend%q(:,:,cH2O) + ENDIF ! Debug statements ! Ozone tendencies From f3bef14885cd3e473e18f7c38a3972547b176702 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 2 Oct 2020 19:05:59 -0400 Subject: [PATCH 138/239] Feat: Set State_Met%OMEGA equal to state%omega Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 5ca5b0df81..c1a23e3a89 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -2754,7 +2754,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Updraft velocity ! Unit : Pa/s ! Dimensions : nX, nY, nZ - !State_Met(LCHNK)%OMEGA (1,J,L) = state%Omega(J,nZ+1-L) + State_Met(LCHNK)%OMEGA (1,J,L) = state%Omega(J,nZ+1-L) ! Field : CLDF ! Description: 3-D cloud fraction From 3ce5f81b43e556ca1ddd78b8c77adbe4f51a467e Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 5 Oct 2020 20:19:46 -0400 Subject: [PATCH 139/239] Feat: Allow CESM-GC to compute overhead ozone from State_Chm%Species Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 40 ++++++++++++++++++------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index c1a23e3a89..f1dd50a300 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -108,7 +108,7 @@ module chemistry ! Indices of critical species in GEOS-Chem INTEGER :: iH2O, iO3, iCH4, iCO, iNO, iOH INTEGER :: iO, iH, iO2, iPSO4 - REAL(r8) :: MWOH, MWPSO4 + REAL(r8) :: MWOH, MWPSO4, MWO3 ! Indices of critical species in the constituent list INTEGER :: cQ, cH2O @@ -1703,17 +1703,24 @@ subroutine chem_init(phys_state, pbuf2d) ! This is used to compute gas-phase H2SO4 production SpcInfo => State_Chm(BEGCHUNK)%SpcData(iOH)%Info - MWOH = REAL(SpcInfo%MW_g,r8) + MWOH = REAL(SpcInfo%MW_g,r8) ! Free pointer SpcInfo => NULL() ! This is used to compute gas-phase H2SO4 production - iPSO4 = Ind_('PSO4') + iPSO4 = Ind_('PSO4') SpcInfo => State_Chm(BEGCHUNK)%SpcData(iPSO4)%Info - MWPSO4 = REAL(SpcInfo%MW_g,r8) + MWPSO4 = REAL(SpcInfo%MW_g,r8) ! Free pointer SpcInfo => NULL() + ! This is used to compute overhead ozone column + SpcInfo => State_Chm(BEGCHUNK)%SpcData(iO3)%Info + MWO3 = REAL(SpcInfo%MW_g,r8) + ! Free pointer + SpcInfo => NULL() + + ! Get indices for physical fields in physics buffer NDX_PBLH = pbuf_get_index('pblh' ) NDX_FSDS = pbuf_get_index('FSDS' ) @@ -1993,6 +2000,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Zsurf, & ! Surface height Rlats, Rlons ! Chunk latitudes and longitudes (radians) + REAL(fp) :: O3col(state%NCOL) ! Overhead O3 column (DU) + REAL(r8), POINTER :: PblH(:) ! PBL height on each chunk [m] REAL(r8), POINTER :: cldTop(:) ! Cloud top height [?] REAL(r8), POINTER :: cldFrc(:,:) ! Cloud fraction [-] @@ -2597,12 +2606,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Dimensions : nX, nY State_Met(LCHNK)%SWGDN (1,:) = fsds(:) - ! Field : TO3 - ! Description: Total overhead ozone column - ! Unit : DU - ! Dimensions : nX, nY - State_Met(LCHNK)%TO3 (1,:) = 300.0e+0_fp ! TMMF - ! Field : SNODP, SNOMAS ! Description: Snow depth, snow mass ! Unit : m, kg/m^2 @@ -3049,6 +3052,23 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO + ! Do this after AirQnt in order to use AIRDEN and BXHEIGHT + DO J = 1, nY + O3col(J) = 0.0e+0_fp + DO L = 1, nZ + O3col(J) = O3col(J) & + + State_Chm(LCHNK)%Species(1,J,L,iO3) & + * State_Met(LCHNK)%AIRDEN(1,J,L) & + * State_Met(LCHNK)%BXHEIGHT(1,J,L) + ENDDO + O3col(J) = O3col(J) * ( AVO / MWO3 ) / 1e+1_fp / 2.69e+16_fp + ENDDO + + ! Field : TO3 + ! Description: Total overhead ozone column + ! Unit : DU + ! Dimensions : nX, nY + State_Met(LCHNK)%TO3 (1,:) = O3col(:) ! Initialize strat chem if not already done. This has to be done here because ! it needs to have non-zero values in State_Chm%AD, which only happens after From 4ba24c04150c43918bfb69273a40896ea75846a8 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 7 Oct 2020 14:19:28 -0400 Subject: [PATCH 140/239] Feat: Allow CESM-GC runs to be restartable Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chem_mods.F90 | 2 +- src/chemistry/pp_geoschem/chemistry.F90 | 66 ++++- src/chemistry/pp_geoschem/mo_chem_utls.F90 | 63 ++--- src/chemistry/pp_geoschem/mo_sim_dat.F90 | 23 +- src/chemistry/pp_geoschem/tracer_srcs.F90 | 296 +++++++++++++++++++++ 5 files changed, 391 insertions(+), 59 deletions(-) create mode 100644 src/chemistry/pp_geoschem/tracer_srcs.F90 diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/pp_geoschem/chem_mods.F90 index c26bcad8b4..905cc7b922 100644 --- a/src/chemistry/pp_geoschem/chem_mods.F90 +++ b/src/chemistry/pp_geoschem/chem_mods.F90 @@ -65,7 +65,7 @@ module chem_mods relcnt = 0, & ! number of relationship species grpcnt = 0, & ! number of group members nzcnt = 824, & ! number of non-zero matrix entries - extcnt = 4, & ! number of species with external forcing + extcnt = 0, & ! number of species with external forcing clscnt1 = 8, & ! number of species in explicit class clscnt2 = 0, & ! number of species in hov class clscnt3 = 0, & ! number of species in ebi class diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index f1dd50a300..cc433e68ed 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -647,12 +647,16 @@ subroutine chem_readnl(nlfile) namelist /chem_inparm/ clim_soilw_file, & depvel_file, & depvel_lnd_file, & - ext_frc_cycle_yr, & ext_frc_specifier, & ext_frc_type, & + ext_frc_cycle_yr, & + ext_frc_fixed_ymd, & + ext_frc_fixed_tod, & season_wes_file, & - srf_emis_cycle_yr, & srf_emis_specifier, & + srf_emis_cycle_yr, & + srf_emis_fixed_ymd, & + srf_emis_fixed_tod, & srf_emis_type inputGeosPath='/glade/u/home/fritzt/input.geos.template' @@ -857,6 +861,19 @@ subroutine chem_readnl(nlfile) CALL MPIBCAST(clim_soilw_file, LEN(clim_soilw_file), MPICHAR, 0, MPICOM) CALL MPIBCAST(season_wes_file, LEN(season_wes_file), MPICHAR, 0, MPICOM) + CALL MPIBCAST (depvel_file, LEN(depvel_file), MPICHAR, 0, MPICOM) + CALL MPIBCAST (srf_emis_specifier, LEN(srf_emis_specifier(1))*pcnst, MPICHAR, 0, MPICOM) + CALL MPIBCAST (srf_emis_type, LEN(srf_emis_type), MPICHAR, 0, MPICOM) + CALL MPIBCAST (srf_emis_cycle_yr, 1, MPIINT, 0, MPICOM) + CALL MPIBCAST (srf_emis_fixed_ymd, 1, MPIINT, 0, MPICOM) + CALL MPIBCAST (srf_emis_fixed_tod, 1, MPIINT, 0, MPICOM) + CALL MPIBCAST (srf_emis_specifier, LEN(srf_emis_specifier(1))*pcnst, MPICHAR, 0, MPICOM) + CALL MPIBCAST (ext_frc_type, LEN(ext_frc_type), MPICHAR, 0, MPICOM) + CALL MPIBCAST (ext_frc_cycle_yr, 1, MPIINT, 0, MPICOM) + CALL MPIBCAST (ext_frc_fixed_ymd, 1, MPIINT, 0, MPICOM) + CALL MPIBCAST (ext_frc_fixed_tod, 1, MPIINT, 0, MPICOM) + + #endif ! Update "short_lived_species" arrays - will eventually unify these @@ -979,6 +996,8 @@ subroutine chem_init(phys_state, pbuf2d) use mo_setinv, only : setinv_inti use mo_mean_mass, only : init_mean_mass + use tracer_cnst, only : tracer_cnst_init + use tracer_srcs, only : tracer_srcs_init use GC_Emissions_Mod, only : GC_Emissions_Init @@ -1740,6 +1759,12 @@ subroutine chem_init(phys_state, pbuf2d) CALL init_mean_mass() CALL setinv_inti() + !----------------------------------------------------------------------- + ! ... initialize tracer modules + !----------------------------------------------------------------------- + CALL tracer_cnst_init() + CALL tracer_srcs_init() + ! Can add history output here too with the "addfld" & "add_default" routines ! Note that constituents are already output by default ! Add all species as output fields if desired @@ -4082,47 +4107,60 @@ subroutine chem_final end subroutine chem_final !=============================================================================== subroutine chem_init_restart(File) + use tracer_cnst, only: init_tracer_cnst_restart + use tracer_srcs, only: init_tracer_srcs_restart use pio, only : file_desc_t + + IMPLICIT NONE + TYPE(file_desc_t) :: File IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT_RESTART' - RETURN + ! + ! data for offline tracers + ! + call init_tracer_cnst_restart(File) + call init_tracer_srcs_restart(File) + !call init_linoz_data_restart(File) end subroutine chem_init_restart !=============================================================================== subroutine chem_write_restart( File ) - !use tracer_cnst, only: write_tracer_cnst_restart - !use tracer_srcs, only: write_tracer_srcs_restart + use tracer_cnst, only: write_tracer_cnst_restart + use tracer_srcs, only: write_tracer_srcs_restart !use linoz_data, only: write_linoz_data_restart use pio, only : file_desc_t + IMPLICIT NONE + TYPE(file_desc_t) :: File - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_WRITE_RESTART' + IF ( MasterProc ) WRITE(iulog,'(a)') 'GCCALL CHEM_WRITE_RESTART' ! ! data for offline tracers ! - !call write_tracer_cnst_restart(File) - !call write_tracer_srcs_restart(File) + call write_tracer_cnst_restart(File) + call write_tracer_srcs_restart(File) !call write_linoz_data_restart(File) end subroutine chem_write_restart !=============================================================================== subroutine chem_read_restart( File ) - !use tracer_cnst, only: read_tracer_cnst_restart - !use tracer_srcs, only: read_tracer_srcs_restart + use tracer_cnst, only: read_tracer_cnst_restart + use tracer_srcs, only: read_tracer_srcs_restart !use linoz_data, only: read_linoz_data_restart - use pio, only : file_desc_t + IMPLICIT NONE + TYPE(file_desc_t) :: File - if (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_READ_RESTART' + IF ( MasterProc ) WRITE(iulog,'(a)') 'GCCALL CHEM_READ_RESTART' ! ! data for offline tracers ! - !call read_tracer_cnst_restart(File) - !call read_tracer_srcs_restart(File) + call read_tracer_cnst_restart(File) + call read_tracer_srcs_restart(File) !call read_linoz_data_restart(File) end subroutine chem_read_restart !================================================================================ diff --git a/src/chemistry/pp_geoschem/mo_chem_utls.F90 b/src/chemistry/pp_geoschem/mo_chem_utls.F90 index af89cc0f76..2d0b9ca5d1 100644 --- a/src/chemistry/pp_geoschem/mo_chem_utls.F90 +++ b/src/chemistry/pp_geoschem/mo_chem_utls.F90 @@ -4,8 +4,9 @@ module mo_chem_utls private public :: get_spc_ndx public :: get_inv_ndx + public :: get_extfrc_ndx public :: utls_chem_is - !, get_het_ndx, get_extfrc_ndx, get_rxt_ndx + !, get_het_ndx, get_rxt_ndx save @@ -115,36 +116,36 @@ end function utls_chem_is ! ! end function get_het_ndx ! -! integer function get_extfrc_ndx( frc_name ) -! !----------------------------------------------------------------------- -! ! ... return overall external frcing index associated with spc_name -! !----------------------------------------------------------------------- -! -! use chem_mods, only : extcnt, extfrc_lst -! -! implicit none -! -! !----------------------------------------------------------------------- -! ! ... dummy arguments -! !----------------------------------------------------------------------- -! character(len=*), intent(in) :: frc_name -! -! !----------------------------------------------------------------------- -! ! ... local variables -! !----------------------------------------------------------------------- -! integer :: m -! -! get_extfrc_ndx = -1 -! if( extcnt > 0 ) then -! do m = 1,max(1,extcnt) -! if( trim( frc_name ) == trim( extfrc_lst(m) ) ) then -! get_extfrc_ndx = m -! exit -! end if -! end do -! end if -! -! end function get_extfrc_ndx + integer function get_extfrc_ndx( frc_name ) + !----------------------------------------------------------------------- + ! ... return overall external frcing index associated with spc_name + !----------------------------------------------------------------------- + + use chem_mods, only : extcnt, extfrc_lst + + implicit none + + !----------------------------------------------------------------------- + ! ... dummy arguments + !----------------------------------------------------------------------- + character(len=*), intent(in) :: frc_name + + !----------------------------------------------------------------------- + ! ... local variables + !----------------------------------------------------------------------- + integer :: m + + get_extfrc_ndx = -1 + if( extcnt > 0 ) then + do m = 1,max(1,extcnt) + if( trim( frc_name ) == trim( extfrc_lst(m) ) ) then + get_extfrc_ndx = m + exit + end if + end do + end if + + end function get_extfrc_ndx ! ! integer function get_rxt_ndx( rxt_tag ) ! !----------------------------------------------------------------------- diff --git a/src/chemistry/pp_geoschem/mo_sim_dat.F90 b/src/chemistry/pp_geoschem/mo_sim_dat.F90 index 2c72fd73e4..fe2510c17e 100644 --- a/src/chemistry/pp_geoschem/mo_sim_dat.F90 +++ b/src/chemistry/pp_geoschem/mo_sim_dat.F90 @@ -217,7 +217,16 @@ subroutine set_sim_dat 75.100000_r8, 46.030000_r8, 75.050000_r8, 47.040000_r8, 16.000000_r8, & 17.010000_r8, 33.010000_r8, 16.000000_r8, 2.020000_r8, 28.020000_r8, & 32.000000_r8, 74.090000_r8 /) - + + extfrc_lst(: 1) = (/ ' ' /) + + frc_from_dataset(: 1) = (/ .false. /) + + !extfrc_lst(: 17) = (/ 'so4_a2 ','NO ','NO2 ','SO2 ','SVOC ', & + ! 'pom_a1 ','pom_a4 ','so4_a1 ','CO ','bc_a1 ', & + ! 'bc_a4 ','num_a1 ','num_a2 ','num_a4 ','OH ', & + ! 'N ','AOA_NH ' /) + ! crb_mass(:221) = (/ 60.055000_r8, 60.055000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & ! 180.165000_r8, 72.066000_r8, 72.066000_r8, 72.066000_r8, 60.055000_r8, & ! 48.044000_r8, 60.055000_r8, 60.055000_r8, 72.066000_r8, 60.055000_r8, & @@ -332,18 +341,6 @@ subroutine set_sim_dat ! 1621,1672,1699,1734,1776,1837,1862,1893,1917,1996, & ! 2022 /) - ! extfrc_lst(: 17) = (/ 'so4_a2 ','NO ','NO2 ','SO2 ','SVOC ', & - ! 'pom_a1 ','pom_a4 ','so4_a1 ','CO ','bc_a1 ', & - ! 'bc_a4 ','num_a1 ','num_a2 ','num_a4 ','OH ', & - ! 'N ','AOA_NH ' /) - - ! frc_from_dataset(: 17) = (/ .true., .true., .true., .true., .true., & - ! .true., .true., .true., .true., .true., & - ! .true., .true., .true., .true., .false., & - ! .false., .false. /) - - ! inv_lst(: 3) = (/ 'M ', 'N2 ', 'O2 ' /) - ! slvd_lst(: 34) = (/ 'ACBZO2 ', 'ALKO2 ', 'BENZO2 ', 'BZOO ', 'C2H5O2 ', & ! 'C3H7O2 ', 'C6H5O2 ', 'CH3CO3 ', 'CH3O2 ', 'DICARBO2 ', & ! 'ENEO2 ', 'EO ', 'EO2 ', 'HO2 ', 'HOCH2OO ', & diff --git a/src/chemistry/pp_geoschem/tracer_srcs.F90 b/src/chemistry/pp_geoschem/tracer_srcs.F90 new file mode 100644 index 0000000000..bec087e581 --- /dev/null +++ b/src/chemistry/pp_geoschem/tracer_srcs.F90 @@ -0,0 +1,296 @@ +!------------------------------------------------------------------- +! manages reading and interpolation of offline tracer sources +! Created by: Francis Vitt -- 2 May 2006 +!------------------------------------------------------------------- +module tracer_srcs + + use shr_kind_mod, only: r8 => shr_kind_r8 + use cam_abortutils, only : endrun + use spmd_utils, only : masterproc + + use tracer_data, only : trfld,trfile,MAXTRCRS + use cam_logfile, only : iulog + + implicit none + + private ! all unless made public + save + + public :: tracer_srcs_init + public :: num_tracer_srcs + public :: tracer_src_flds + public :: tracer_srcs_adv + public :: get_srcs_data + public :: write_tracer_srcs_restart + public :: read_tracer_srcs_restart + public :: tracer_srcs_defaultopts + public :: tracer_srcs_setopts + public :: init_tracer_srcs_restart + + type(trfld), pointer :: fields(:) => null() + type(trfile) :: file + + integer :: num_tracer_srcs + character(len=16), allocatable :: tracer_src_flds(:) + + character(len=64) :: specifier(MAXTRCRS) = '' + character(len=256) :: filename = 'tracer_srcs_file' + character(len=256) :: filelist = '' + character(len=256) :: datapath = '' + character(len=32) :: data_type = 'SERIAL' + logical :: rmv_file = .false. + integer :: cycle_yr = 0 + integer :: fixed_ymd = 0 + integer :: fixed_tod = 0 + +contains + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine tracer_srcs_init() + + use mo_chem_utls, only : get_extfrc_ndx + use tracer_data, only : trcdata_init + use cam_history, only : addfld + + implicit none + + integer :: i ,ndx + + allocate(file%in_pbuf(size(specifier))) + file%in_pbuf(:) = .false. + call trcdata_init( specifier, filename, filelist, datapath, fields, file, & + rmv_file, cycle_yr, fixed_ymd, fixed_tod, data_type) + + num_tracer_srcs = 0 + if (associated(fields)) num_tracer_srcs = size( fields ) + + if( num_tracer_srcs < 1 ) then + + if (masterproc) then + write(iulog,*) 'There are no offline tracer sources' + write(iulog,*) ' ' + end if + return + end if + + allocate( tracer_src_flds(num_tracer_srcs)) + + do i = 1, num_tracer_srcs + + ndx = get_extfrc_ndx( fields(i)%fldnam ) + + if (ndx < 1) then + write(iulog,*) fields(i)%fldnam//' is not configured to have an external source' + call endrun('tracer_srcs_init') + endif + + tracer_src_flds(i) = fields(i)%fldnam + + call addfld(trim(fields(i)%fldnam)//'_trsrc', (/ 'lev' /), 'I','/cm3/s', 'tracer source rate' ) + + enddo + + end subroutine tracer_srcs_init + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine tracer_srcs_setopts( & + tracer_srcs_file_in, & + tracer_srcs_filelist_in, & + tracer_srcs_datapath_in, & + tracer_srcs_type_in, & + tracer_srcs_specifier_in, & + tracer_srcs_rmfile_in, & + tracer_srcs_cycle_yr_in, & + tracer_srcs_fixed_ymd_in, & + tracer_srcs_fixed_tod_in & + ) + + implicit none + + character(len=*), intent(in), optional :: tracer_srcs_file_in + character(len=*), intent(in), optional :: tracer_srcs_filelist_in + character(len=*), intent(in), optional :: tracer_srcs_datapath_in + character(len=*), intent(in), optional :: tracer_srcs_type_in + character(len=*), intent(in), optional :: tracer_srcs_specifier_in(:) + logical, intent(in), optional :: tracer_srcs_rmfile_in + integer, intent(in), optional :: tracer_srcs_cycle_yr_in + integer, intent(in), optional :: tracer_srcs_fixed_ymd_in + integer, intent(in), optional :: tracer_srcs_fixed_tod_in + + if ( present(tracer_srcs_file_in) ) then + filename = tracer_srcs_file_in + endif + if ( present(tracer_srcs_filelist_in) ) then + filelist = tracer_srcs_filelist_in + endif + if ( present(tracer_srcs_datapath_in) ) then + datapath = tracer_srcs_datapath_in + endif + if ( present(tracer_srcs_type_in) ) then + data_type = tracer_srcs_type_in + endif + if ( present(tracer_srcs_specifier_in) ) then + specifier = tracer_srcs_specifier_in + endif + if ( present(tracer_srcs_rmfile_in) ) then + rmv_file = tracer_srcs_rmfile_in + endif + if ( present(tracer_srcs_cycle_yr_in) ) then + cycle_yr = tracer_srcs_cycle_yr_in + endif + if ( present(tracer_srcs_fixed_ymd_in) ) then + fixed_ymd = tracer_srcs_fixed_ymd_in + endif + if ( present(tracer_srcs_fixed_tod_in) ) then + fixed_tod = tracer_srcs_fixed_tod_in + endif + + endsubroutine tracer_srcs_setopts + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine tracer_srcs_defaultopts( & + tracer_srcs_file_out, & + tracer_srcs_filelist_out, & + tracer_srcs_datapath_out, & + tracer_srcs_type_out, & + tracer_srcs_specifier_out,& + tracer_srcs_rmfile_out, & + tracer_srcs_cycle_yr_out, & + tracer_srcs_fixed_ymd_out,& + tracer_srcs_fixed_tod_out & + ) + + implicit none + + character(len=*), intent(out), optional :: tracer_srcs_file_out + character(len=*), intent(out), optional :: tracer_srcs_filelist_out + character(len=*), intent(out), optional :: tracer_srcs_datapath_out + character(len=*), intent(out), optional :: tracer_srcs_type_out + character(len=*), intent(out), optional :: tracer_srcs_specifier_out(:) + logical, intent(out), optional :: tracer_srcs_rmfile_out + integer, intent(out), optional :: tracer_srcs_cycle_yr_out + integer, intent(out), optional :: tracer_srcs_fixed_ymd_out + integer, intent(out), optional :: tracer_srcs_fixed_tod_out + + if ( present(tracer_srcs_file_out) ) then + tracer_srcs_file_out = filename + endif + if ( present(tracer_srcs_filelist_out) ) then + tracer_srcs_filelist_out = filelist + endif + if ( present(tracer_srcs_datapath_out) ) then + tracer_srcs_datapath_out = datapath + endif + if ( present(tracer_srcs_type_out) ) then + tracer_srcs_type_out = data_type + endif + if ( present(tracer_srcs_specifier_out) ) then + tracer_srcs_specifier_out = specifier + endif + if ( present(tracer_srcs_rmfile_out) ) then + tracer_srcs_rmfile_out = rmv_file + endif + if ( present(tracer_srcs_cycle_yr_out) ) then + tracer_srcs_cycle_yr_out = cycle_yr + endif + if ( present(tracer_srcs_fixed_ymd_out) ) then + tracer_srcs_fixed_ymd_out = fixed_ymd + endif + if ( present(tracer_srcs_fixed_tod_out) ) then + tracer_srcs_fixed_tod_out = fixed_tod + endif + + endsubroutine tracer_srcs_defaultopts + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine tracer_srcs_adv( pbuf2d, state ) + + use tracer_data, only : advance_trcdata + use ppgrid, only : begchunk, endchunk + use physics_types,only : physics_state + use cam_history, only : outfld + use physics_buffer, only : physics_buffer_desc + + implicit none + + type(physics_state), intent(in):: state(begchunk:endchunk) + type(physics_buffer_desc), pointer :: pbuf2d(:,:) + + integer :: i,c,ncol + + if( num_tracer_srcs < 1 ) return + + call advance_trcdata( fields, file, state, pbuf2d ) + + do c = begchunk,endchunk + ncol = state(c)%ncol + do i = 1,num_tracer_srcs + call outfld( trim(fields(i)%fldnam)//'_trsrc', fields(i)%data(:ncol,:,c), ncol, state(c)%lchnk ) + enddo + enddo + + end subroutine tracer_srcs_adv + +!------------------------------------------------------------------- +!------------------------------------------------------------------- + subroutine get_srcs_data( field_name, data, ncol, lchnk, pbuf ) + + use tracer_data, only : get_fld_data + use physics_buffer, only : physics_buffer_desc + + implicit none + + character(len=*), intent(in) :: field_name + real(r8), intent(out) :: data(:,:) + integer, intent(in) :: lchnk + integer, intent(in) :: ncol + type(physics_buffer_desc), pointer :: pbuf(:) + + if( num_tracer_srcs < 1 ) return + + call get_fld_data( fields, field_name, data, ncol, lchnk, pbuf ) + + end subroutine get_srcs_data + +!------------------------------------------------------------------- + + subroutine init_tracer_srcs_restart( piofile ) + use pio, only : file_desc_t + use tracer_data, only : init_trc_restart + implicit none + type(file_desc_t),intent(inout) :: pioFile ! pio File pointer + + call init_trc_restart( 'tracer_srcs', piofile, file ) + + end subroutine init_tracer_srcs_restart +!------------------------------------------------------------------- + subroutine write_tracer_srcs_restart( piofile ) + use tracer_data, only : write_trc_restart + use pio, only : file_desc_t + implicit none + + type(file_desc_t) :: piofile + + call write_trc_restart( piofile, file ) + + end subroutine write_tracer_srcs_restart + +!------------------------------------------------------------------- + + subroutine read_tracer_srcs_restart( pioFile ) + use tracer_data, only : read_trc_restart + use pio, only : file_desc_t + implicit none + + type(file_desc_t) :: piofile + + call read_trc_restart( 'tracer_srcs', piofile, file ) + + end subroutine read_tracer_srcs_restart + + +end module tracer_srcs From 8222292021663a30f1cbdd2af29c4a2d66c30661 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 20 Oct 2020 16:33:46 -0400 Subject: [PATCH 141/239] Feat: Implement 3-D emissions. (1) Surface emissions (layer PVER) are passed to cam_in%cflx while the non-surface emissions are added directly to the chemical tendencies (2) Dry deposition fluxes are now passed to cam_in%cflx such that: cam_in%cflx = eflx - dflx (3) Remove call to DO_MIXING as this is now handled by CAM. Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 280 +++++++++--------- src/chemistry/pp_geoschem/gc_emissions.F90 | 76 ----- .../pp_geoschem/gc_emissions_mod.F90 | 220 ++++++++++++++ 3 files changed, 366 insertions(+), 210 deletions(-) delete mode 100644 src/chemistry/pp_geoschem/gc_emissions.F90 create mode 100644 src/chemistry/pp_geoschem/gc_emissions_mod.F90 diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index f1dd50a300..e37fa698d5 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -61,6 +61,7 @@ module chemistry use chem_mods, only : map2MAM4 use mo_tracname, only : solsym + use constituents, only : cnst_name IMPLICIT NONE PRIVATE @@ -103,7 +104,7 @@ module chemistry TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object TYPE(DgnList ) :: Diag_List ! Diagnostics list object - type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! ptr to 2d pbuf + type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! Pointer to 2D pbuf ! Indices of critical species in GEOS-Chem INTEGER :: iH2O, iO3, iCH4, iCO, iNO, iOH @@ -973,7 +974,6 @@ subroutine chem_init(phys_state, pbuf2d) #if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) use Olson_Landmap_Mod #endif - use Mixing_Mod use Vdiff_Mod use CMN_FJX_MOD, only : JVN_ @@ -1780,6 +1780,13 @@ subroutine chem_init(phys_state, pbuf2d) SpcInfo => NULL() ENDDO + ! Surface fluxes (emissions - drydep) + DO I = 1, pcnst + SpcName = 'SurfFlux_'//TRIM(cnst_name(I)) + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & + TRIM(SpcName)//' surface flux') + ENDDO + IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN DO N = 1, gas_pcnst SpcName = 'DTWR_'//TRIM(solsym(N)) @@ -1828,7 +1835,7 @@ subroutine chem_init(phys_state, pbuf2d) TRIM(tagName) // ' photolysis rate' ) ENDDO - ! Initialize emissions interface (this will eventually handle HEMCO) + ! Initialize emissions interface CALL GC_Emissions_Init !CALL AddFld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) @@ -1897,7 +1904,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use physics_buffer, only : pbuf_get_chunk, pbuf_get_index use cam_history, only : outfld, hist_fld_active use camsrfexch, only : cam_in_t, cam_out_t - use mo_tracname, only : solsym #ifdef SPMD use mpishorthand @@ -1927,7 +1933,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) #endif use Drydep_Mod, only : DEPNAME use Drydep_Mod, only : Update_DryDepSav - use Mixing_Mod use Calc_Met_Mod, only : Set_Dry_Surface_Pressure use Calc_Met_Mod, only : AirQnt @@ -1944,6 +1949,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use UCX_Mod, only : Set_H2O_Trac use CMN_FJX_MOD, only : ZPJ, JVN_, GC_Photo_ID use State_Diag_Mod, only : get_TagInfo + use Unitconv_Mod, only : Convert_Spc_Units + + use GC_Emissions_Mod, only : GC_Emissions_Calc use Tropopause, only : Tropopause_findChemTrop, Tropopause_Find use HCO_Utilities_GC_Mod ! Utility routines for GC-HEMCO interface @@ -1989,8 +1997,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) LOGICAL :: lq(pcnst) ! Indexing - INTEGER :: I, J, K, L, N, M, P - INTEGER :: nX, nY, nZ + INTEGER :: N, M, P, SM, ND + INTEGER :: I, J, L, nX, nY, nZ INTEGER :: LCHNK, NCOL @@ -2024,11 +2032,16 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: mBar (state%NCOL,PVER) ! Mean wet atmospheric mass [amu] REAL(r8) :: invariants(state%NCOL,PVER,nfs) REAL(r8) :: reaction_rates(1,1,1) ! Reaction rates (unused) + ! For aerosol formation REAL(r8) :: del_h2so4_gasprod(state%NCOL,PVER) REAL(r8) :: vmr0(state%NCOL,PVER,gas_pcnst) REAL(r8) :: vmr1(state%NCOL,PVER,gas_pcnst) REAL(r8) :: wetdepflx(pcols,pcnst) ! Wet deposition fluxes (kg/m2/s) + + ! For emissions + REAL(r8) :: eflx(pcols,pver,pcnst) ! 3-D emissions in kg/m2/s + #if ( OCNDDVEL_MOZART ) REAL(r8) :: windSpeed(state%NCOL) ! Wind speed at ground level [m/s] REAL(r8) :: potT(state%NCOL) ! Potential temperature [K] @@ -2089,6 +2102,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) INTEGER :: SpcId TYPE(Species), POINTER :: SpcInfo + CHARACTER(LEN=63) :: OrigUnit + REAL(r8) :: SlsData(state%NCOL, PVER, nSls) INTEGER :: currYr, currMo, currDy, currTOD @@ -2206,9 +2221,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2GC(N) IF ( M > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - MMR_Beg(J,K,M) = state%q(J,nZ+1-K,N) - State_Chm(LCHNK)%Species(1,J,K,M) = REAL(MMR_Beg(J,K,M),fp) + DO L = 1, nZ + MMR_Beg(J,L,M) = state%q(J,nZ+1-L,N) + State_Chm(LCHNK)%Species(1,J,L,M) = REAL(MMR_Beg(J,L,M),fp) ENDDO ENDDO lq(N) = .True. @@ -2217,9 +2232,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! We need to let CAM know that 'H2O' and 'Q' are identical DO J = 1, nY - DO K = 1, nZ - MMR_Beg(J,K,iH2O) = state%q(J,nZ+1-K,cQ) - State_Chm(LCHNK)%Species(1,J,K,iH2O) = REAL(MMR_Beg(J,K,iH2O),fp) + DO L = 1, nZ + MMR_Beg(J,L,iH2O) = state%q(J,nZ+1-L,cQ) + State_Chm(LCHNK)%Species(1,J,L,iH2O) = REAL(MMR_Beg(J,L,iH2O),fp) ENDDO ENDDO @@ -2241,8 +2256,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2GC_Sls(N) IF ( M > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - State_Chm(LCHNK)%Species(1,J,K,M) = REAL(SlsData(J,nZ+1-K,N),fp) + DO L = 1, nZ + State_Chm(LCHNK)%Species(1,J,L,M) = REAL(SlsData(J,nZ+1-L,N),fp) ENDDO ENDDO ENDIF @@ -2253,15 +2268,15 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2chm(N) IF ( M > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - vmr0(J,K,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-K,M) * & + DO L = 1, nZ + vmr0(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) * & MWDry / adv_mass(N) ENDDO ENDDO ELSEIF ( M < 0 ) THEN DO J = 1, nY - DO K = 1, nZ - vmr0(J,K,N) = state%q(J,K,-M) * & + DO L = 1, nZ + vmr0(J,L,N) = state%q(J,L,-M) * & MWDry / adv_mass(N) ENDDO ENDDO @@ -2271,17 +2286,17 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) #if defined( MODAL_AERO_4MODE ) ! Map and flip aerosols DO M = 1, ntot_amode - DO L = 1, nspec_amode(M) + DO SM = 1, nspec_amode(M) ! TMMF - Here we will have to store the bin to bulk mass ratio ! TMMF - Should there be a ratio of molar weights involved? - P = map2MAM4(L,M) - N = lmassptr_amode(L,M) + P = map2MAM4(SM,M) + N = lmassptr_amode(SM,M) ! Multiple MAM4 bins are mapped to same GEOS-Chem species IF ( P > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - State_Chm(LCHNK)%Species(1,J,K,P) = State_Chm(LCHNK)%Species(1,J,K,P) & - + REAL(state%q(J,nZ+1-K,N),fp) + DO L = 1, nZ + State_Chm(LCHNK)%Species(1,J,L,P) = State_Chm(LCHNK)%Species(1,J,L,P) & + + REAL(state%q(J,nZ+1-L,N),fp) ENDDO ENDDO ENDIF @@ -2389,8 +2404,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! LWC / \rho_air = Q ! ! Tau = 3/2 * Q * dP / ( r_e * rho_w * g ) - ! Tau(K) = 3/2 * Q(K) * (Pint(K+1) - Pint(K)) / (re * rho_w * g ) - ! Tau(K) = Q(K) * (Pint(K+1) - Pint(K)) * Cnst + ! Tau(L) = 3/2 * Q(L) * (Pint(L+1) - Pint(L)) / (re * rho_w * g ) + ! Tau(L) = Q(L) * (Pint(L+1) - Pint(L)) * Cnst ! ! Unit check: | ! Q : [kg H2O/kg air] | @@ -3462,6 +3477,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Compute the surface flux for the non-local mixing, ! (which means getting emissions & drydep from HEMCO) ! and store it in State_Chm%Surface_Flux + ! + ! For CESM-GC, Surface_Flux will be equal to the opposite of the + ! dry deposition flux since emissions are loaded externally + ! ( SurfaceFlux = eflx - dflx = - dflx ) IF ( Input_Opt%LTURB .and. Input_Opt%LNLPBL ) THEN CALL Compute_Sflx_For_Vdiff( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & @@ -3476,28 +3495,64 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF - ! Note: mixing routine expects tracers in v/v - ! DO_MIXING applies the tracer tendencies (dry deposition, - ! emission rates) to the tracer arrays and performs PBL - ! mixing. - ! In the non-local PBL scheme, dry deposition and emission - ! fluxes below the PBL are handled within the PBL mixing - ! routine. Otherwise, tracer concentrations are first updated - ! and the full-mixing is then applied. - ! (ckeller, 3/5/15) - ! NOTE: Tracer concentration units are converted locally - ! to [v/v dry air] for mixing. Eventually mixing should - ! be updated to use [kg/kg total air] (ewl, 9/18/15) - CALL Do_Mixing( Input_Opt = Input_Opt, & - State_Chm = State_Chm(LCHNK), & - State_Diag = State_Diag(LCHNK), & - State_Grid = State_Grid(LCHNK), & - State_Met = State_Met(LCHNK), & - RC = RC ) + CALL GC_Emissions_Calc( state, hco_pbuf2d, eflx ) + + ! Add near-surface emissions to surface flux BC + cam_in%cflx(1:nY,:) = cam_in%cflx(1:nY,:) + eflx(1:nY,nZ,:) + eflx(1:nY,nZ,:) = 0.0e+00_r8 + + DO ND = 1, State_Chm(BEGCHUNK)%nDryDep + ! Get the species ID from the drydep ID + N = State_Chm(BEGCHUNK)%Map_DryDep(ND) + IF ( N <= 0 ) CYCLE + + M = map2GCinv(N) + IF ( M <= 0 ) CYCLE + + ! Add dry deposition flux (stored as SurfaceFlux = -dflx) + cam_in%cflx(1:nY,M) = cam_in%cflx(1:nY,M) & + + State_Chm(LCHNK)%SurfaceFlux(1,1:nY,N) + + ENDDO + + ! Add non-surface emissions + ! Use units of kg/m2 as State_Chm%Species to add emissions fluxes + CALL Convert_Spc_Units( Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + OutUnit = 'kg/m2', & + RC = RC, & + OrigUnit = OrigUnit ) - ! Trap potential errors IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Do_Mixing"!' + ErrMsg = 'Error encountered in "Convert_Spc_Units"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + DO N = 1, pcnst + M = map2GC(N) + IF ( M < 0 ) CYCLE + + DO J = 1, nY + DO L = 1, nZ + State_Chm(LCHNK)%Species(1,J,L,M) = State_Chm(LCHNK)%Species(1,J,L,M) & + + eflx(J,nZ+1-L,N) * dT + ENDDO + ENDDO + ENDDO + + ! Convert back to original unit + CALL Convert_Spc_Units( Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + OutUnit = OrigUnit, & + RC = RC ) + + ! Convert State_Chm%Species back to original units + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Convert_Spc_Units"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF @@ -3563,14 +3618,14 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2chm(N) IF ( M > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - mmr1(J,K,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-K,M) + DO L = 1, nZ + mmr1(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) ENDDO ENDDO ELSEIF ( M < 0 ) THEN DO J = 1, nY - DO K = 1, nZ - mmr1(J,K,N) = state%q(J,K,-M) + DO L = 1, nZ + mmr1(J,L,N) = state%q(J,L,-M) ENDDO ENDDO ENDIF @@ -3622,14 +3677,14 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2chm(N) IF ( M > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - mmr1(J,K,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-K,M) - mmr1(J,K,N) + DO L = 1, nZ + mmr1(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) - mmr1(J,L,N) ENDDO ENDDO ELSEIF ( M < 0 ) THEN DO J = 1, nY - DO K = 1, nZ - mmr1(J,K,N) = state%q(J,K,-M) - mmr1(J,K,N) + DO L = 1, nZ + mmr1(J,L,N) = state%q(J,L,-M) - mmr1(J,L,N) ENDDO ENDDO ENDIF @@ -3652,10 +3707,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Outfld( 'DTWR_'//TRIM(solsym(N)), mmr1(1:nY,:nZ,N)/dT, nY, LCHNK ) wk_out = 0._r8 - DO K = 1, nZ + DO L = 1, nZ wk_out(1:nY) = wk_out(1:nY) & - + mmr1(1:nY,k,N)/dT * & - State_Met(LCHNK)%AD(1,1:nY,nZ+1-k) / & + + mmr1(1:nY,L,N)/dT * & + State_Met(LCHNK)%AD(1,1:nY,nZ+1-L) / & State_Met(LCHNK)%Area_M2(1,1:nY) ENDDO CALL Outfld( 'WD_'//TRIM(solsym(N)), wk_out(1:nY), nY, LCHNK ) @@ -3680,15 +3735,15 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2chm(N) IF ( M > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - vmr1(J,K,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-K,M) * & + DO L = 1, nZ + vmr1(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) * & MWDry / adv_mass(N) ENDDO ENDDO ELSEIF ( M < 0 ) THEN DO J = 1, nY - DO K = 1, nZ - vmr1(J,K,N) = state%q(J,K,-M) * & + DO L = 1, nZ + vmr1(J,L,N) = state%q(J,L,-M) * & MWDry / adv_mass(N) ENDDO ENDDO @@ -3700,10 +3755,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( ( iPSO4 > 0 ) .and. ( MWPSO4 > 0.0e+00_fp ) ) THEN If ( rootChunk ) Write(iulog,*) " MAXVAL(PSO4) = ", & MAXVAL(State_Chm(LCHNK)%Species(1,:nY,:nZ,iPSO4)) - DO K = 1, nZ + DO L = 1, nZ ! Convert from kg/kg to mol/mol - del_h2so4_gasprod(:nY,K) = & - State_Chm(LCHNK)%Species(1,:nY,nZ+1-K,iPSO4) * MWDry / MWPSO4 + del_h2so4_gasprod(:nY,L) = & + State_Chm(LCHNK)%Species(1,:nY,nZ+1-L,iPSO4) * MWDry / MWPSO4 ENDDO ENDIF @@ -3746,8 +3801,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2GC_Sls(N) IF ( M > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - SlsData(J,nZ+1-K,N) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) + DO L = 1, nZ + SlsData(J,nZ+1-L,N) = REAL(State_Chm(LCHNK)%Species(1,J,L,M),r8) ENDDO ENDDO ENDIF @@ -3785,8 +3840,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) SpcName = tracerNames(I) outTmp = 0.0e+0_r8 DO J = 1, nY - DO K = 1, nZ - outTmp(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * MWRatio(I) + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Chm(LCHNK)%Species(1,J,L,M),r8) * MWRatio(I) ENDDO ENDDO CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) @@ -3799,8 +3854,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2GC_Sls(N) IF ( M > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - outTmp(J,nZ+1-K) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) * SLSMWratio(N) + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Chm(LCHNK)%Species(1,J,L,M),r8) * SLSMWratio(N) ENDDO ENDDO CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) @@ -3831,6 +3886,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDIF + ! Surface fluxes (emissions - drydep) + DO N = 1, pcnst + SpcName = 'SurfFlux_'//TRIM(cnst_name(N)) + CALL OutFld( TRIM(SpcName), cam_in%cflx(:nY,N), nY, LCHNK ) + ENDDO + ! Photolysis rates JoutTmp = 0.0e+00_r8 DO N = 1, JVN_ @@ -3854,8 +3915,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( hist_fld_active( TRIM(SpcName) ) ) THEN DO J = 1, nY - DO K = 1, nZ - JoutTmp(J,nZ+1-K,M) = JoutTmp(J,nZ+1-K,M) + REAL(ZPJ(K,N,1,J),r8) + DO L = 1, nZ + JoutTmp(J,nZ+1-L,M) = JoutTmp(J,nZ+1-L,M) + REAL(ZPJ(L,N,1,J),r8) ENDDO ENDDO ENDIF @@ -3890,10 +3951,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2GC(N) IF ( M > 0 ) THEN DO J = 1, nY - DO K = 1, nZ - MMR_End (J,K,M) = REAL(State_Chm(LCHNK)%Species(1,J,K,M),r8) - MMR_TEnd(J,K,M) = MMR_End(J,K,M) - MMR_Beg(J,K,M) - ptend%q(J,nZ+1-K,N) = (MMR_End(J,K,M)-MMR_Beg(J,K,M))/dT + DO L = 1, nZ + MMR_End (J,L,M) = REAL(State_Chm(LCHNK)%Species(1,J,L,M),r8) + MMR_TEnd(J,L,M) = MMR_End(J,L,M) - MMR_Beg(J,L,M) + ptend%q(J,nZ+1-L,N) = (MMR_End(J,L,M)-MMR_Beg(J,L,M))/dT ENDDO ENDDO ENDIF @@ -3901,6 +3962,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( Input_Opt%applyQtend ) THEN ! Apply GEOS-Chem's H2O mixing ratio tendency to CAM's specific humidity + ! TMMF, this might need to set lq(cQ) = lq(cH2O) ( = .True. ) ptend%q(:,:,cQ) = ptend%q(:,:,cH2O) ENDIF @@ -3913,8 +3975,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF (PRESENT(fh2o)) THEN fh2o(:nY) = 0.0e+0_r8 - !DO K = 1, nZ - ! fh2o(:nY) = fh2o(:nY) + ptend%q(:nY,K,iH2O)*state%pdel(:nY,K)/Gravit + !DO L = 1, nZ + ! fh2o(:nY) = fh2o(:nY) + ptend%q(:nY,L,iH2O)*state%pdel(:nY,L)/Gravit !ENDDO ENDIF @@ -4129,76 +4191,26 @@ end subroutine chem_read_restart subroutine chem_emissions( state, cam_in ) use camsrfexch, only: cam_in_t - use physics_buffer, only : pbuf_get_chunk, pbuf_get_field, pbuf_get_index - use ppgrid, only : pver ! for vertical - - use constituents, only: cnst_name - use mo_chem_utls, only : get_spc_ndx - use chem_mods, only : tracerNames, nTracers - use PhysConstants, only: PI, PI_180 ! Arguments: TYPE(physics_state), INTENT(IN) :: state ! Physics state variables TYPE(cam_in_t), INTENT(INOUT) :: cam_in ! import state - INTEGER :: M, N, I + INTEGER :: M, N INTEGER :: LCHNK, NCOL LOGICAL :: rootChunk - REAL(r8) :: sflx(state%NCOL,nTracers) - type(physics_buffer_desc), pointer :: pbuf_chnk(:) ! slice of pbuf in chnk - real(r8), pointer :: pbuf_ik(:,:) ! ptr to pbuf data (/pcols,pver/) - integer :: tmpIdx ! pbuf field id - character(len=255) :: fldname_ns ! field name HCO_NH3 - integer :: RC ! return code - - ! Initialize pointers - pbuf_chnk => NULL() - pbuf_ik => NULL() - ! LCHNK: which chunk we have on this process LCHNK = state%LCHNK ! NCOL: number of atmospheric columns on this chunk NCOL = state%NCOL rootChunk = ( MasterProc.and.(LCHNK.EQ.BEGCHUNK) ) - sflx(:,:) = 0.0e+0_r8 - - DO N = 1, nTracers - - fldname_ns = 'HCO_' // TRIM(tracerNames(N)) - tmpIdx = pbuf_get_index(fldname_ns, RC) - IF ( tmpIdx < 0 ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_emissions hemco: Field not found ", TRIM(fldname_ns) - ELSE - ! This is already in chunk, retrieve it - pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) - CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) - - IF ( .NOT. ASSOCIATED(pbuf_ik) ) THEN ! Sanity check - CALL ENDRUN("chem_emissions: FATAL - tmpIdx > 0 but pbuf_ik not associated") - ENDIF - - ! For each column retrieve data from pbuf_ik(I,K) - sflx(1:ncol,N) = pbuf_ik(1:ncol,pver) ! Only surface emissions for now, - - ! Reset pointers - pbuf_ik => NULL() - pbuf_chnk => NULL() - - M = map2GCinv(N) - - IF ( M <= 0 ) CYCLE - - cam_in%cflx(1:ncol,M) = sflx(1:ncol,N) - IF ( rootChunk .and. ( MAXVAL(sflx(1:ncol,N)) > 0.0e+0_fp ) ) THEN - Write(iulog,'(a,a,E16.4,a,a)') "chem_emissions: debug added emiss for ", & - TRIM(cnst_name(M)), MAXVAL(sflx(1:ncol,N)), " from ", TRIM(fldname_ns) - Write(iulog,'(a,a,a,E16.4)') "chem_emissions: Total emission flux for ", & - TRIM(cnst_name(M)), " is: ", MAXVAL(cam_in%cflx(1:ncol,M)) - ENDIF - ENDIF + ! Reset surface fluxes + DO M = 2, pcnst + N = map2chm(M) + IF ( N > 0 ) cam_in%cflx(1:NCOL,N) = 0.0e+0_r8 ENDDO end subroutine chem_emissions diff --git a/src/chemistry/pp_geoschem/gc_emissions.F90 b/src/chemistry/pp_geoschem/gc_emissions.F90 deleted file mode 100644 index 05841a9e66..0000000000 --- a/src/chemistry/pp_geoschem/gc_emissions.F90 +++ /dev/null @@ -1,76 +0,0 @@ -!================================================================================================ -! This is the "GEOS-Chem" chemistry emissions interface -!================================================================================================ -module GC_Emissions_Mod - - use Shr_kind_mod, only : r8 => shr_kind_r8 - use Spmd_utils, only : MasterProc, myCPU=>iam, nCPUs=>npes - use Cam_logfile, only : iulog - use Cam_abortutils, only : endrun - - use Chem_mods, only : NTracers - use Chem_mods, only : TracerNames - use Chem_mods, only : Map2GC - - use Tracer_data, only : trfld,trfile - - IMPLICIT NONE - - TYPE :: Emission - INTEGER :: Spc_Ndx - REAL(r8) :: MW - REAL(r8) :: Scalefactor - CHARACTER(LEN=256) :: Filename - CHARACTER(LEN=16) :: Species - CHARACTER(LEN=8) :: Units - INTEGER :: Nsectors - CHARACTER(LEN=32), POINTER :: Sectors(:) - TYPE(trfld), POINTER :: Fields(:) - TYPE(trfile) :: File - ENDTYPE Emission - - PRIVATE - - PUBLIC :: GC_Emissions_Init - PUBLIC :: GC_Emissions_Calc - PUBLIC :: GC_Emissions_Final - - ! Stand-in: emissions - TYPE(Emission), ALLOCATABLE :: Emissions(:) - INTEGER :: N_Emis_Files - -!================================================================================================ -contains -!================================================================================================ - - subroutine GC_Emissions_Init - - INTEGER :: Ierr - - N_Emis_Files=1 - ALLOCATE(Emissions(N_Emis_Files), STAT=IERR) - IF (IERR.NE.0) CALL ENDRUN('Could not allocate GC emissions') - - end subroutine GC_Emissions_Init - - subroutine GC_Emissions_Calc(Eflx) - - ! Emissions in kg/m2/s - ! Dimensions: [N columns x K levels x C constituents ] - REAL(r8), INTENT(OUT) :: EFlx(:,:,:) - INTEGER :: I_Trc, I_Emis - - EFlx(:,:,:) = 0.0e+0_r8 - DO I_Emis = 1, N_Emis_Files - ! Read emissions file - DO I_Trc = 1, NTracers - ENDDO - ENDDO - - end subroutine GC_Emissions_Calc - - subroutine GC_Emissions_Final - IF (ALLOCATED(Emissions)) DEALLOCATE(Emissions) - end subroutine GC_Emissions_Final - - end module GC_Emissions_Mod diff --git a/src/chemistry/pp_geoschem/gc_emissions_mod.F90 b/src/chemistry/pp_geoschem/gc_emissions_mod.F90 new file mode 100644 index 0000000000..71dd703df4 --- /dev/null +++ b/src/chemistry/pp_geoschem/gc_emissions_mod.F90 @@ -0,0 +1,220 @@ +!------------------------------------------------------------------------------ +! "GEOS-Chem" chemistry emissions interface ! +!------------------------------------------------------------------------------ +!BOP +! +! !MODULE: gc_emissions_mod.F90 +! +! !DESCRIPTION: Module gc\_emissions\_mod contains routines which retrieve +! emission fluxes from HEMCO and transfers it back to the CESM-GC interface +!\\ +!\\ +! !INTERFACE: +! +MODULE GC_Emissions_Mod +! +! !USES: +! + USE SHR_KIND_MOD, ONLY : r8 => shr_kind_r8 + USE SPMD_UTILS, ONLY : MasterProc + USE CAM_LOGFILE, ONLY : iulog + + IMPLICIT NONE + + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + PUBLIC :: GC_Emissions_Init + PUBLIC :: GC_Emissions_Calc + PUBLIC :: GC_Emissions_Final +! +! !REVISION HISTORY: +! 07 Oct 2020 - T. M. Fritz - Initial version +!EOP +!------------------------------------------------------------------------------ +!BOC +! +CONTAINS +! +!EOC +!------------------------------------------------------------------------------ +!BOP +! +! !IROUTINE: gc_emissions_init +! +! !DESCRIPTION: Subroutine GC\_Emissions\_Init initializes the emissions routine +!\\ +!\\ +! !INTERFACE: +! + SUBROUTINE GC_Emissions_Init +! +! !INPUT PARAMETERS: +! +! +! !REVISION HISTORY: +! 07 Oct 2020 - T. M. Fritz - Initial version +!EOP +!------------------------------------------------------------------------------ +!BOC +! + !================================================================= + ! GC_Emissions_Init begins here! + !================================================================= + + + END SUBROUTINE GC_Emissions_Init +!EOC +!------------------------------------------------------------------------------ +!BOP +! +! !IROUTINE: gc_emissions_calc +! +! !DESCRIPTION: Subroutine GC\_Emissions\_Calc retrieves emission fluxes from +! HEMCO and returns a 3-D array of emission flux to the CESM-GC interface. +! On top of passing data, this routine handles a number of checks. +!\\ +!\\ +! !INTERFACE: +! + SUBROUTINE GC_Emissions_Calc( state, hco_pbuf2d, eflx ) +! +! !USES: +! + USE CONSTITUENTS, ONLY : cnst_name, pcnst + USE CHEM_MODS, ONLY : tracerNames, nTracers, map2GCinv + USE CAM_ABORTUTILS, ONLY : endrun + USE PHYSICS_TYPES, ONLY : physics_state + USE PHYSICS_BUFFER, ONLY : pbuf_get_index, pbuf_get_chunk + USE PHYSICS_BUFFER, ONLY : physics_buffer_desc, pbuf_get_field + USE PPGRID, ONLY : pcols, pver, begchunk +! +! !INPUT PARAMETERS: +! + ! Physics state variables + TYPE(physics_state), INTENT(IN) :: state + ! Pointer to 2-D pbuf + TYPE(physics_buffer_desc), POINTER, INTENT(IN) :: hco_pbuf2d(:,:) +! +! !OUTPUT PARAMETERS: +! + ! 3-D emissions in kg/m2/s + REAL(r8), INTENT(OUT) :: eflx(pcols,pver,pcnst) +! +! !REVISION HISTORY: +! 07 Oct 2020 - T. M. Fritz - Initial version +!EOP +!------------------------------------------------------------------------------ +!BOC +! +! !LOCAL VARIABLES: +! + ! Integers + INTEGER :: LCHNK, NCOL + INTEGER :: M, N, I + INTEGER :: RC ! return code + INTEGER :: tmpIdx ! pbuf field id + + ! Logical + LOGICAL :: rootChunk + LOGICAL, SAVE :: FIRST = .True. + + ! Objects + TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in current chunk + + ! Real + REAL(r8), POINTER :: pbuf_ik(:,:) ! pointer to pbuf data (/pcols,pver/) + + ! Strings + CHARACTER(LEN=255) :: fldname_ns ! field name HCO_* + + !================================================================= + ! GC_Emissions_Calc begins here! + !================================================================= + + ! Initialize pointers + pbuf_chnk => NULL() + pbuf_ik => NULL() + + ! LCHNK: which chunk we have on this process + LCHNK = state%LCHNK + ! NCOL: number of atmospheric columns on this chunk + NCOL = state%NCOL + rootChunk = ( MasterProc .AND. ( LCHNK.EQ.BEGCHUNK ) ) + + ! Initialize emission flux + eflx(:,:,:) = 0.0e+0_r8 + + DO N = 1, nTracers + + fldname_ns = 'HCO_' // TRIM(tracerNames(N)) + tmpIdx = pbuf_get_index(fldname_ns, RC) + + IF ( tmpIdx < 0 ) THEN + IF ( rootChunk ) Write(iulog,*) "GC_Emissions_Calc: Field not found ", TRIM(fldname_ns) + ELSE + ! This is already in chunk, retrieve it + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + + IF ( .NOT. ASSOCIATED(pbuf_ik) ) THEN ! Sanity check + CALL ENDRUN("GC_Emissions_Calc: FATAL - tmpIdx > 0 but pbuf_ik not associated") + ENDIF + + M = map2GCinv(N) + + IF ( M <= 0 ) CYCLE + + eflx(1:ncol,:,M) = pbuf_ik(1:ncol,:) + + ! Reset pointers + pbuf_ik => NULL() + pbuf_chnk => NULL() + + IF ( MINVAL(eflx(:,:,M)) < 0.0e+00_r8 ) THEN + Write(iulog,*) "GC_Emissions_Calc: HEMCO emission flux is negative for ", & + TRIM(cnst_name(M)), " with value ", MINVAL(eflx(:,:,M)), " at ", & + MINLOC(eflx(:,:,M)) + ENDIF + + IF ( rootChunk .and. ( MAXVAL(eflx(1:ncol,:,M)) > 0.0e+0_r8 ) ) THEN + Write(iulog,'(a,a,a,a)') "GC_Emissions_Calc: HEMCO flux ", & + TRIM(fldname_ns), " added to ", TRIM(cnst_name(M)) + Write(iulog,'(a,a,E16.4)') "GC_Emissions_Calc: Maximum flux ", & + TRIM(fldname_ns), MAXVAL(eflx(1:ncol,:,M)) + ENDIF + ENDIF + ENDDO + + IF ( FIRST ) FIRST = .False. + + END SUBROUTINE GC_Emissions_Calc +!EOC +!------------------------------------------------------------------------------ +!BOP +! +! !IROUTINE: gc_emissions_final +! +! !DESCRIPTION: Subroutine GC\_Emissions\_Final cleans up the module +!\\ +!\\ +! !INTERFACE: +! + SUBROUTINE GC_Emissions_Final +! +! !REVISION HISTORY: +! 07 Oct 2020 - T. M. Fritz - Initial version +!EOP +!------------------------------------------------------------------------------ +!BOC +! + !================================================================= + ! GC_Emissions_Final begins here! + !================================================================= +!EOC +!------------------------------------------------------------------------------ + END SUBROUTINE GC_Emissions_Final +!EOC + END MODULE GC_Emissions_Mod From 978d33e3071e28adfde971273df2dc8fcbf1cedd Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 20 Oct 2020 17:23:05 -0400 Subject: [PATCH 142/239] Feat: Replace tracerNames with solsym in chem_implements_cnst Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index d513dc51f0..1e444b906b 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -916,13 +916,12 @@ function chem_implements_cnst(name) CHARACTER(LEN=*), INTENT(IN) :: name ! constituent name LOGICAL :: chem_implements_cnst ! return value - INTEGER :: I + INTEGER :: M chem_implements_cnst = .false. - DO I = 1, nTracers - ! TMMF, will need to replace tracerNames by actual constituent names - IF (TRIM(tracerNames(I)) .eq. TRIM(name)) THEN + DO M = 1, gas_pcnst + IF (TRIM(solsym(M)) .eq. TRIM(name)) THEN chem_implements_cnst = .true. EXIT ENDIF @@ -4027,20 +4026,20 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) REAL(r8), INTENT(IN) :: latvals(:) ! lat in degrees (NCOL) REAL(r8), INTENT(IN) :: lonvals(:) ! lon in degrees (NCOL) LOGICAL, INTENT(IN) :: mask(:) ! Only initialize where .true. - REAL(r8), INTENT(OUT) :: q(:,:) ! kg tracer/kg dry air (NCOL, PVER + REAL(r8), INTENT(OUT) :: q(:,:) ! kg tracer/kg dry air (NCOL, PVER) ! Used to initialize tracer fields if desired. ! Will need a simple mapping structure as well as the CAM tracer registration ! routines. - INTEGER :: iLev, NLEV, I + INTEGER :: iLev, NLEV, M REAL(r8) :: QTemp, Min_MMR NLEV = SIZE(q, 2) ! Retrieve a "background value" for this from the database Min_MMR = 1.0e-38_r8 - DO I = 1, nTracers - IF (TRIM(tracerNames(I)).eq.TRIM(name)) THEN - Min_MMR = ref_MMR(I) + DO M = 1, gas_pcnst + IF (TRIM(solsym(M)).eq.TRIM(name)) THEN + Min_MMR = ref_MMR(M) EXIT ENDIF ENDDO From a7dbe02b7829d5e9be3553feca6ee12ffd2233ba Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 27 Oct 2020 11:29:54 -0400 Subject: [PATCH 143/239] Feat: Changes required by GEOS-Chem 13.0.0 Signed-off-by: Thibaud Fritz --- bld/configure | 2 +- src/chemistry/pp_geoschem/chemistry.F90 | 209 ++++++++++++++---------- 2 files changed, 120 insertions(+), 91 deletions(-) diff --git a/bld/configure b/bld/configure index 103f6627b0..91f27afc67 100755 --- a/bld/configure +++ b/bld/configure @@ -2835,7 +2835,7 @@ sub write_filepath print $fh "$chem_src_dir/geoschem_src/GeosUtil\n"; print $fh "$chem_src_dir/geoschem_src/Headers\n"; print $fh "$chem_src_dir/geoschem_src/ISORROPIA\n"; - print $fh "$chem_src_dir/geoschem_src/KPP/Standard\n"; + print $fh "$chem_src_dir/geoschem_src/KPP/fullchem\n"; if ($chem =~ /_mam/) { print $fh "$camsrcdir/src/chemistry/modal_aero\n"; print $fh "$camsrcdir/src/chemistry/aerosol\n"; diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 1e444b906b..8bf57da4cb 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -19,12 +19,14 @@ module chemistry ! Basic GEOS-Chem modules !-------------------------------------------------------------------- USE DiagList_Mod, ONLY : DgnList ! Derived type for diagnostics list + USE TaggedDiagList_Mod, ONLY : TaggedDgnList ! Derived type for tagged diagnostics list USE Input_Opt_Mod, ONLY : OptInput ! Derived type for Input Options USE State_Chm_Mod, ONLY : ChmState ! Derived type for Chemistry State object USE State_Diag_Mod, ONLY : DgnState ! Derived type for Diagnostics State object USE State_Grid_Mod, ONLY : GrdState ! Derived type for Grid State object USE State_Met_Mod, ONLY : MetState ! Derived type for Meteorology State object USE Species_Mod, ONLY : Species ! Derived type for Species object + USE GC_Environment_Mod ! Runtime GEOS-Chem environment USE ErrCode_Mod ! Error codes for success or failure USE Error_Mod ! For error checking @@ -103,6 +105,7 @@ module chemistry TYPE(GrdState),ALLOCATABLE :: State_Grid(:) ! Grid State object TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object TYPE(DgnList ) :: Diag_List ! Diagnostics list object + TYPE(TaggedDgnList ) :: TaggedDiag_List ! Tagged diagnostics list object type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! Pointer to 2D pbuf @@ -196,6 +199,7 @@ subroutine chem_register use State_Chm_Mod, only : Init_State_Chm, Cleanup_State_Chm use State_Chm_Mod, only : Ind_ use Input_Opt_Mod, only : Set_Input_Opt, Cleanup_Input_Opt + use CMN_SIZE_Mod, only : Init_CMN_SIZE use mo_sim_dat, only : set_sim_dat use mo_chem_utls, only : get_spc_ndx @@ -299,6 +303,23 @@ subroutine chem_register SG%NY = 1 SG%NZ = 1 + CALL GC_Init_Grid( Input_Opt = IO, & + State_Grid = SG, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error in GC_Init_Grid"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + CALL Init_CMN_SIZE( Input_Opt = IO, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "Init_CMN_SIZE"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + CALL Init_State_Chm( Input_Opt = IO, & State_Chm = SC, & State_Grid = SG, & @@ -326,7 +347,7 @@ subroutine chem_register MWTmp = REAL(ThisSpc%MW_g,r8) ref_VMR = REAL(ThisSpc%BackgroundVV,r8) ref_MMR(I) = ref_VMR / (MWDry / MWTmp) - IF ( ThisSpc%Is_Gas == .FALSE. ) THEN + IF ( ThisSpc%Is_Gas .eqv. .False. ) THEN Write(cnstName, "(a,a)") 'GC_AER_', to_upper(TRIM(trueName)) ENDIF ELSEIF ( I .LE. (nTracers + nAer) ) THEN @@ -970,7 +991,7 @@ subroutine chem_init(phys_state, pbuf2d) use State_Grid_Mod use State_Met_Mod use DiagList_Mod, only : Init_DiagList, Print_DiagList - use GC_Environment_Mod + use TaggedDiagList_Mod,only : Init_TaggedDiagList, Print_TaggedDiagList use GC_Grid_Mod, only : SetGridFromCtrEdges use State_Diag_Mod, only : get_TagInfo @@ -991,7 +1012,6 @@ subroutine chem_init(phys_state, pbuf2d) use Olson_Landmap_Mod #endif use Vdiff_Mod - use CMN_FJX_MOD, only : JVN_ use mo_setinv, only : setinv_inti use mo_mean_mass, only : init_mean_mass @@ -1278,8 +1298,8 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%BCAE_1 = 1.5e+0_fp Input_Opt%BCAE_2 = 1.0e+0_fp Input_Opt%hvAerNIT = .False. - Input_Opt%hvAerNIT_JNIT = .False. - Input_Opt%hvAerNIT_JNITs = .False. + Input_Opt%hvAerNIT_JNIT = 0.0e+00_fp + Input_Opt%hvAerNIT_JNITs = 0.0e+00_fp Input_Opt%JNITChanA = 66.667e+0_fp Input_Opt%JNITChanB = 33.333e+0_fp @@ -1462,29 +1482,35 @@ subroutine chem_init(phys_state, pbuf2d) ! Set a flag to denote if we should print ND70 debug output prtDebug = ( Input_Opt%LPRT .and. MasterProc ) - ! Debug output - IF ( prtDebug ) CALL Debug_Msg( '### MAIN: a READ_INPUT_FILE' ) + historyConfigFile = 'HISTORY.rc' + ! This requires input.geos and HISTORY.rc to be in the run directory + ! This is the current way chosen to diagnose photolysis rates! + CALL Init_DiagList( MasterProc, historyConfigFile, Diag_List, RC ) - historyConfigFile = 'HISTORY.rc' ! InputOpt not yet initialized - !TMMF need to pass input.geos path - !CALL Init_DiagList( MasterProc, historyConfigFile, Diag_List, RC ) + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_DiagList"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF - !IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = 'Error encountered in "Init_DiagList"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - !ENDIF + ! Initialize the TaggedDiag_List (list of wildcards/tags per diagnostic) + CALL Init_TaggedDiagList( Input_Opt%amIroot, Diag_List, & + TaggedDiag_List, RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_TaggedDiagList"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF - !!### Print diagnostic list if needed for debugging - !IF ( prtDebug ) CALL Print_DiagList( Diag_List, RC ) + IF ( prtDebug ) THEN + CALL Print_DiagList( Input_Opt%amIRoot, Diag_List, RC ) + CALL Print_TaggedDiagList( Input_Opt%amIRoot, TaggedDiag_List, RC ) + ENDIF DO I = BEGCHUNK, ENDCHUNK Input_Opt%amIRoot = (MasterProc .AND. (I == BEGCHUNK)) - IF ( prtDebug ) THEN - CALL Print_DiagList( Input_Opt%amIRoot, Diag_List, RC ) - ENDIF - CALL GC_Init_StateObj( Diag_List = Diag_List, & ! Diagnostic list obj + TaggedDiag_List = TaggedDiag_List, & ! TaggedDiag list obj Input_Opt = Input_Opt, & ! Input Options State_Chm = State_Chm(I), & ! Chemistry State State_Diag = State_Diag(I), & ! Diagnostics State @@ -1783,26 +1809,28 @@ subroutine chem_init(phys_state, pbuf2d) !CALL Add_Default(TRIM(SpcName), 1, ' ') ENDDO - DO I = 1, State_Chm(BEGCHUNK)%nDryDep - SpcName = 'DepVel_'//TRIM(depName(I)) - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'm/s', & - TRIM(SpcName)//' dry deposition velocity') - ENDDO + IF ( Input_Opt%LDryD ) THEN + DO I = 1, State_Chm(BEGCHUNK)%nDryDep + SpcName = 'DepVel_'//TRIM(depName(I)) + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'm/s', & + TRIM(SpcName)//' dry deposition velocity') + ENDDO - DO I = 1, State_Chm(BEGCHUNK)%nAdvect - ! Get the species ID from the advected species ID - L = State_Chm(BEGCHUNK)%Map_Advect(I) + DO I = 1, State_Chm(BEGCHUNK)%nAdvect + ! Get the species ID from the advected species ID + L = State_Chm(BEGCHUNK)%Map_Advect(I) - ! Get info about this species from the species database - SpcInfo => State_Chm(BEGCHUNK)%SpcData(L)%Info - SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) + ! Get info about this species from the species database + SpcInfo => State_Chm(BEGCHUNK)%SpcData(L)%Info + SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & - TRIM(SpcName)//' dry deposition flux') + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & + TRIM(SpcName)//' dry deposition flux') - ! Free pointer - SpcInfo => NULL() - ENDDO + ! Free pointer + SpcInfo => NULL() + ENDDO + ENDIF ! Surface fluxes (emissions - drydep) DO I = 1, pcnst @@ -1858,13 +1886,17 @@ subroutine chem_init(phys_state, pbuf2d) CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & TRIM(tagName) // ' photolysis rate' ) ENDDO + ! Add Jval_O3O1D and Jval_O3O3P + SpcName = 'Jval_O3O1D' + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & + TRIM(tagName) // ' photolysis rate' ) + SpcName = 'Jval_O3O3P' + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & + TRIM(tagName) // ' photolysis rate' ) ! Initialize emissions interface CALL GC_Emissions_Init - !CALL AddFld ( 'BCPI', (/'lev'/), 'A', 'mole/mole', trim('BCPI')//' mixing ratio' ) - !CALL Add_Default ( 'BCPI', 1, ' ') - hco_pbuf2d => pbuf2d If ( MasterProc ) Write(iulog,*) "hco_pbuf2d now points to pbuf2d" @@ -1955,8 +1987,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) #elif ( OCNDDVEL_MOZART ) use mo_drydep, only : drydep_update, drydep_fromlnd #endif - use Drydep_Mod, only : DEPNAME - use Drydep_Mod, only : Update_DryDepSav + use Drydep_Mod, only : DEPNAME, NDVZIND + use Drydep_Mod, only : Update_DryDepFreq use Calc_Met_Mod, only : Set_Dry_Surface_Pressure use Calc_Met_Mod, only : AirQnt @@ -1971,7 +2003,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use CMN_Size_Mod, only : PTop use PBL_Mix_Mod, only : Compute_PBL_Height use UCX_Mod, only : Set_H2O_Trac - use CMN_FJX_MOD, only : ZPJ, JVN_, GC_Photo_ID + use CMN_FJX_MOD, only : ZPJ use State_Diag_Mod, only : get_TagInfo use Unitconv_Mod, only : Convert_Spc_Units @@ -1996,8 +2028,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use short_lived_species, only : get_short_lived_species use short_lived_species, only : set_short_lived_species +#if defined( MODAL_AERO ) ! Aqueous chemistry and aerosol growth use aero_model, only : aero_model_gasaerexch +#endif ! Use GEOS-Chem versions of physical constants use PhysConstants, only : PI, PI_180, g0, AVO @@ -2084,7 +2118,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: wk_out(state%NCOL) LOGICAL :: isWD REAL(r8) :: outTmp(state%NCOL,PVER) - REAL(r8) :: JoutTmp(state%NCOL,PVER,nPhotol) LOGICAL :: Found CHARACTER(LEN=255) :: tagName @@ -2716,11 +2749,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) tmpIdx = pbuf_get_index(fldname_ns, RC) IF ( tmpIdx < 0 ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) - State_Met(LCHNK)%IODIDE(1,:) = 0.0e+0_fp + State_Chm(LCHNK)%IODIDE(1,:) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) - State_Met(LCHNK)%IODIDE(1,:) = pbuf_ik(:,nZ) + State_Chm(LCHNK)%IODIDE(1,:) = pbuf_ik(:,nZ) pbuf_chnk => NULL() pbuf_ik => NULL() ENDIF @@ -2734,11 +2767,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) tmpIdx = pbuf_get_index(fldname_ns, RC) IF ( tmpIdx < 0 ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) - State_Met(LCHNK)%SALINITY(1,:) = 0.0e+0_fp + State_Chm(LCHNK)%SALINITY(1,:) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) - State_Met(LCHNK)%SALINITY(1,:) = pbuf_ik(:,nZ) + State_Chm(LCHNK)%SALINITY(1,:) = pbuf_ik(:,nZ) pbuf_chnk => NULL() pbuf_ik => NULL() ENDIF @@ -3484,12 +3517,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !TMMF, Here set dry deposition velocities to zero if MAM performs its !own deposition... - CALL Update_DryDepSav( Input_Opt = Input_Opt, & - State_Chm = State_Chm(LCHNK), & - State_Diag = State_Diag(LCHNK), & - State_Grid = State_Grid(LCHNK), & - State_Met = State_Met(LCHNK), & - RC = RC ) + CALL Update_DryDepFreq( Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) ENDIF @@ -3754,6 +3787,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ***** M A M G A S - A E R O S O L E X C H A N G E ***** !============================================================== +#if defined( MODAL_AERO ) DO N = 1, gas_pcnst ! See definition of map2chm M = map2chm(N) @@ -3808,6 +3842,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) vmr0 = vmr0, & vmr = vmr1, & pbuf = pbuf ) +#endif ! Make sure State_Chm(LCHNK) is back in kg/kg dry! IF ( TRIM(State_Chm(LCHNK)%Spc_Units) /= 'kg/kg dry' ) THEN @@ -3889,8 +3924,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Dry deposition velocity and surface flux IF ( Input_Opt%LDryD ) THEN DO N = 1, State_Chm(BEGCHUNK)%nDryDep + ND = NDVZIND(N) SpcName = 'DepVel_'//TRIM(depName(N)) - CALL OutFld( TRIM(SpcName), State_Chm(LCHNK)%DryDepVel(1,:nY,N), nY, LCHNK ) + CALL OutFld( TRIM(SpcName), State_Chm(LCHNK)%DryDepVel(1,:nY,ND), nY, LCHNK ) ENDDO DO N = 1, State_Chm(BEGCHUNK)%nAdvect @@ -3902,7 +3938,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) ! SurfaceFlux is Emissions - Drydep, but Emissions = 0, as it is applied - ! in chem_emissions. + ! externally CALL OutFld( TRIM(SpcName), -State_Chm(LCHNK)%SurfaceFlux(1,:nY,N), nY, LCHNK ) ! Free pointer @@ -3917,10 +3953,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ! Photolysis rates - JoutTmp = 0.0e+00_r8 - DO N = 1, JVN_ - M = GC_Photo_ID(N) - IF ( M > 0 ) THEN + IF ( ASSOCIATED(State_Diag(LCHNK)%Jval) ) THEN + DO M = 1, nPhotol CALL get_TagInfo( Input_Opt = Input_Opt, & tagID = 'PHO', & State_Chm = State_Chm(LCHNK), & @@ -3936,37 +3970,32 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF SpcName = 'Jval_' // TRIM( tagName ) - - IF ( hist_fld_active( TRIM(SpcName) ) ) THEN - DO J = 1, nY - DO L = 1, nZ - JoutTmp(J,nZ+1-L,M) = JoutTmp(J,nZ+1-L,M) + REAL(ZPJ(L,N,1,J),r8) - ENDDO - ENDDO - ENDIF - ENDIF - ENDDO - - ! We need to save out JRates outside of the previous loop as different "N" - ! can contribute to the same "M". - DO M = 1, nPhotol - CALL get_TagInfo( Input_Opt = Input_Opt, & - tagID = 'PHO', & - State_Chm = State_Chm(LCHNK), & - Found = Found, & - RC = RC, & - N = M, & - tagName = tagName ) - - ! Trap potential errors - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Abnormal exit from routine "Get_TagInfo"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - - SpcName = 'Jval_' // TRIM( tagName ) - CALL OutFld( TRIM(SpcName), JoutTmp(:nY,:,M), nY, LCHNK ) - ENDDO + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Diag(LCHNK)%Jval(1,J,L,M),r8) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDDO + ENDIF + IF ( ASSOCIATED(State_Diag(LCHNK)%JvalO3O1D) ) THEN + SpcName = 'Jval_O3O1D' + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Diag(LCHNK)%JvalO3O1D(1,J,L),r8) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + IF ( ASSOCIATED(State_Diag(LCHNK)%JvalO3O3P) ) THEN + SpcName = 'Jval_O3O3P' + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Diag(LCHNK)%JvalO3O3P(1,J,L),r8) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF ! Re-flip all the arrays vertically ptend%q(:,:,:) = 0.0e+0_r8 From 8e9f7a5b1c954091dc3856c90d4337b81e2c6b6b Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 27 Oct 2020 18:23:07 -0400 Subject: [PATCH 144/239] Feat: Move compile time flags to run time flags for DD velocities Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 391 +++++++----------------- 1 file changed, 110 insertions(+), 281 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 8bf57da4cb..ca8fca6d0b 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -145,14 +145,6 @@ module chemistry REAL(r8) :: OH_Total REAL(r8) :: Air_Total -#define ALLDDVEL_GEOSCHEM 1 -#define OCNDDVEL_GEOSCHEM 0 -#define OCNDDVEL_MOZART 0 - -! The following flags are only used if ALLDDVEL_GEOSCHEM is on -#define LANDTYPE_HEMCO 1 -#define LANDTYPE_CLM 0 - ! Filenames to compute dry deposition velocities similarly to MOZART character(len=shr_kind_cl) :: clim_soilw_file = 'clim_soilw_file' character(len=shr_kind_cl) :: depvel_file = '' @@ -685,46 +677,6 @@ subroutine chem_readnl(nlfile) speciesDBPath='/glade/u/home/fritzt/species_database.yml' chemInputsDir='/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/' - -#if ( ALLDDVEL_GEOSCHEM + OCNDDVEL_GEOSCHEM + OCNDDVEL_MOZART != 1 ) - IF ( MasterProc ) THEN - Write(iulog,'(/,a)') REPEAT( "=", 79 ) - Write(iulog,'(a)') " Preprocessor flags are not set correctly in chemistry.F90" - Write(iulog,'(a)') " The user needs to decide how to compute dry deposition velocities" - Write(iulog,'(a)') " Three options appear: " - Write(iulog,'(a)') " + Let GEOS-Chem calculate all dry deposition velocities." - Write(iulog,'(a)') " Required setup:" - Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 1" - Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 0" - Write(iulog,'(a)') " OCNDDVEL_MOZART == 0" - Write(iulog,'(a)') " + Let CLM compute dry deposition velocities over land and let" - Write(iulog,'(a)') " GEOS-Chem compute velocities over ocean and ice" - Write(iulog,'(a)') " Required setup:" - Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 0" - Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 1" - Write(iulog,'(a)') " OCNDDVEL_MOZART == 0" - Write(iulog,'(a)') " + Let CLM compute dry deposition velocities over land and" - Write(iulog,'(a)') " compute velocities over ocean and ice in a similar way as" - Write(iulog,'(a)') " MOZART" - Write(iulog,'(a)') " Required setup:" - Write(iulog,'(a)') " ALLDDVEL_GEOSCHEM == 0" - Write(iulog,'(a)') " OCNDDVEL_GEOSCHEM == 0" - Write(iulog,'(a)') " OCNDDVEL_MOZART == 1" - Write(iulog,'(a)') REPEAT( "=", 79 ) - CALL ENDRUN('Incorrect definitions for dry deposition velocities') - ENDIF -#endif -#if ( ALLDDVEL_GEOSCHEM && ( LANDTYPE_HEMCO + LANDTYPE_CLM != 1 ) ) - IF ( MasterProc ) THEN - Write(iulog,'(/,a)') REPEAT( "=", 79 ) - Write(iulog,'(a)') REPEAT( "=", 79 ) - Write(iulog,'(a)') " Preprocessor flags are not set correctly in chemistry.F90" - Write(iulog,'(a)') " Dry-deposition velocities are computed by GEOS-Chem" - Write(iulog,'(a)') " The user needs to decide if land types should be from CLM or from HEMCO" - CALL ENDRUN('Incorrect definitions for source of land type data') - ENDIF -#endif - ALLOCATE(drySpc_ndx(nddvels), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate drySpc_ndx') @@ -972,9 +924,6 @@ subroutine chem_init(phys_state, pbuf2d) use hycoef, only : ps0, hyai, hybi, hyam use seq_drydep_mod, only : drydep_method, DD_XLND -#if ( OCNDDVEL_MOZART ) - use mo_drydep, only : drydep_inti -#endif use gas_wetdep_opts, only : gas_wetdep_method use mo_neu_wetdep, only : neu_wetdep_init @@ -1008,9 +957,7 @@ subroutine chem_init(phys_state, pbuf2d) use Chemistry_Mod, only : Init_Chemistry use Ucx_Mod, only : Init_Ucx use Input_mod, only : Validate_Directories -#if ( ALLDDVEL_GEOSCHEM && LANDTYPE_HEMCO ) use Olson_Landmap_Mod -#endif use Vdiff_Mod use mo_setinv, only : setinv_inti @@ -1349,7 +1296,11 @@ subroutine chem_init(phys_state, pbuf2d) ! onlineLandTypes -> True (use CLM landtypes) ! -> False (read landtypes from HEMCO) - Input_Opt%onlineLandTypes = .True. !TMMF + Input_Opt%onlineLandTypes = .True. + + ! ddVel_CLM -> True (use CLM dry deposition velocities) + ! -> False (let GEOS-Chem compute dry deposition velocities) + Input_Opt%ddVel_CLM = .False. ! applyQtend: apply tendencies of water vapor to specific humidity Input_Opt%applyQtend = .True. @@ -1588,24 +1539,6 @@ subroutine chem_init(phys_state, pbuf2d) ENDDO -#if ( OCNDDVEL_MOZART ) - !============================================================== - ! The following line should only be called if we compute - ! velocities over the ocean and ice in a MOZART-like way. - ! Thibaud M. Fritz - 26 Feb 2020 - !============================================================== - - IF ( drydep_method == DD_XLND ) THEN - CALL drydep_inti( depvel_lnd_file, & - clim_soilw_file, & - season_wes_file ) - ELSE - Write(iulog,'(a,a)') ' drydep_method is set to: ', TRIM(drydep_method) - CALL ENDRUN('drydep_method must be DD_XLND to compute dry deposition' // & - ' velocities similarly to MOZART over ocean and ice!') - ENDIF -#endif - ENDIF #if defined( MODAL_AERO_4MODE ) @@ -1982,11 +1915,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Olson_Landmap_Mod, only : Compute_Olson_Landmap use Modis_LAI_Mod, only : Compute_XLAI use CMN_Size_Mod, only : NSURFTYPE -#if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) use Drydep_Mod, only : Do_Drydep -#elif ( OCNDDVEL_MOZART ) - use mo_drydep, only : drydep_update, drydep_fromlnd -#endif use Drydep_Mod, only : DEPNAME, NDVZIND use Drydep_Mod, only : Update_DryDepFreq @@ -2100,19 +2029,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! For emissions REAL(r8) :: eflx(pcols,pver,pcnst) ! 3-D emissions in kg/m2/s -#if ( OCNDDVEL_MOZART ) - REAL(r8) :: windSpeed(state%NCOL) ! Wind speed at ground level [m/s] - REAL(r8) :: potT(state%NCOL) ! Potential temperature [K] - - INTEGER :: latndx(PCOLS) - INTEGER :: lonndx(PCOLS) - - ! For MOZART's dry deposition over ocean and ice - ! Deposition velocity (cm/s) - REAL(r8) :: MOZART_depVel(state%NCOL, nTracersMax) - ! Deposition flux (/cm^2/s) - REAL(r8) :: MOZART_depFlx(state%NCOL, nTracersMax) -#endif ! For GEOS-Chem diagnostics REAL(r8) :: mmr1(state%NCOL,PVER,gas_pcnst) REAL(r8) :: wk_out(state%NCOL) @@ -2533,48 +2449,48 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Unit : - (between 0 and 1) ! Dimensions : nX, nY, NSURFTYPE ! Note : Index 1 is water -#if ( LANDTYPE_CLM ) - ! Fill in water - State_Met(LCHNK)%LandTypeFrac(1,:, 1) = cam_in%ocnFrac(:) & - + cam_in%iceFrac(:) -#if ( ALLDDVEL_GEOSCHEM ) - CALL getLandTypes( cam_in, & - nY, & - State_Met(LCHNK) ) -#endif -#elif ( LANDTYPE_HEMCO ) - DO N = 1, NSURFTYPE - Write(fldname_ns, '(a,i2.2)') 'HCO_LANDTYPE', N-1 - tmpIdx = pbuf_get_index(fldname_ns, rc) - IF ( tmpIdx < 0 ) THEN - ! there is an error here and the field was not found - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) - ELSE - CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) - DO J = 1, nY - State_Met(LCHNK)%LandTypeFrac(1,J,N) = pbuf_ik(J,nZ) - ! 2-D data is stored in the 1st level of a - ! 3-D array due to laziness - ENDDO - pbuf_ik => NULL() + IF ( Input_Opt%onlineLandTypes ) THEN + ! Fill in water + State_Met(LCHNK)%LandTypeFrac(1,:, 1) = cam_in%ocnFrac(:) & + + cam_in%iceFrac(:) + IF ( .NOT. Input_Opt%ddVel_CLM ) THEN + CALL getLandTypes( cam_in, & + nY, & + State_Met(LCHNK) ) ENDIF + ELSE + DO N = 1, NSURFTYPE + Write(fldname_ns, '(a,i2.2)') 'HCO_LANDTYPE', N-1 + tmpIdx = pbuf_get_index(fldname_ns, rc) + IF ( tmpIdx < 0 ) THEN + ! there is an error here and the field was not found + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + ELSE + CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) + DO J = 1, nY + State_Met(LCHNK)%LandTypeFrac(1,J,N) = pbuf_ik(J,nZ) + ! 2-D data is stored in the 1st level of a + ! 3-D array due to laziness + ENDDO + pbuf_ik => NULL() + ENDIF - Write(fldname_ns, '(a,i2.2)') 'HCO_XLAI', N-1 - tmpIdx = pbuf_get_index(fldname_ns, rc) - IF ( tmpIdx < 0 ) THEN - ! there is an error here and the field was not found - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) - ELSE - CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) - DO J = 1, nY - State_Met(LCHNK)%XLAI_NATIVE(1,J,N) = pbuf_ik(J,nZ) - ! 2-D data is stored in the 1st level of a - ! 3-D array due to laziness - ENDDO - pbuf_ik => NULL() - ENDIF - ENDDO -#endif + Write(fldname_ns, '(a,i2.2)') 'HCO_XLAI', N-1 + tmpIdx = pbuf_get_index(fldname_ns, rc) + IF ( tmpIdx < 0 ) THEN + ! there is an error here and the field was not found + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + ELSE + CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) + DO J = 1, nY + State_Met(LCHNK)%XLAI_NATIVE(1,J,N) = pbuf_ik(J,nZ) + ! 2-D data is stored in the 1st level of a + ! 3-D array due to laziness + ENDDO + pbuf_ik => NULL() + ENDIF + ENDDO + ENDIF ! Field : FRCLND, FRLAND, FROCEAN, FRSEAICE, FRLAKE, FRLANDIC ! Description: Olson land fraction @@ -2591,16 +2507,16 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%FRLAND (1,:) = cam_in%landFrac(:) State_Met(LCHNK)%FROCEAN (1,:) = cam_in%ocnFrac(:) + cam_in%iceFrac(:) State_Met(LCHNK)%FRSEAICE (1,:) = cam_in%iceFrac(:) -#if ( LANDTYPE_CLM ) - State_Met(LCHNK)%FRLAKE (1,:) = cam_in%lwtgcell(:,3) + & - cam_in%lwtgcell(:,4) - State_Met(LCHNK)%FRLANDIC (1,:) = cam_in%lwtgcell(:,2) - State_Met(LCHNK)%FRSNO (1,:) = 0.0e+0_fp -#else - State_Met(LCHNK)%FRLAKE (1,:) = 0.0e+0_fp - State_Met(LCHNK)%FRLANDIC (1,:) = 0.0e+0_fp - State_Met(LCHNK)%FRSNO (1,:) = 0.0e+0_fp -#endif + IF ( Input_Opt%onlineLandTypes ) THEN + State_Met(LCHNK)%FRLAKE (1,:) = cam_in%lwtgcell(:,3) + & + cam_in%lwtgcell(:,4) + State_Met(LCHNK)%FRLANDIC (1,:) = cam_in%lwtgcell(:,2) + State_Met(LCHNK)%FRSNO (1,:) = 0.0e+0_fp + ELSE + State_Met(LCHNK)%FRLAKE (1,:) = 0.0e+0_fp + State_Met(LCHNK)%FRLANDIC (1,:) = 0.0e+0_fp + State_Met(LCHNK)%FRSNO (1,:) = 0.0e+0_fp + ENDIF ! Field : GWETROOT, GWETTOP ! Description: Root and top soil moisture @@ -3313,24 +3229,18 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! We need to merge the land component passed through cam_in and ! the ocn/ice dry deposition velocities. ! - ! If using the CLM velocities, two options show up: - ! 1. Compute dry deposition velocities over ocean and ice similarly - ! to the way MOZART does it (OCNDDVEL_MOZART) - ! 2. Use GEOS-Chem's dry deposition module to compute velocities - ! and then scale them with the ocean fraction (OCNDDVEL_GEOSCHEM) + ! If using the CLM velocities, then use GEOS-Chem's dry deposition + ! module to compute velocities and then scale them with the ocean + ! fraction (Input_Opt%ddVel_CLM) ! - ! A third option would be to let GEOS-Chem compute dry deposition - ! velocity (ALLDDVEL_GEOSCHEM), thus overwriting the input from CLM + ! A second option would be to let GEOS-Chem compute dry deposition + ! velocity, thus overwriting the input from CLM ! ! drydep_method must be set to DD_XLND. ! - ! The following options are currently supported: - ! - ALLDDVEL_GEOSCHEM - ! - OCNDDVEL_GEOSCHEM - ! !!!! - OCNDDVEL_MOZART, needs investigation - ! - ! The ALLDDVEL_GEOSCHEM coupled with LANDTYPE_CLM requires that CLM - ! passes land type information (land type and leaf area index). + ! The GEOS-Chem option (.not. Input_Opt%ddVel_CLM) option coupled + ! with Input_Opt%onlineLandTypes requires that CLM passes land + ! type information (land type and leaf area index). !================================================================== ! ! State_Chm expects dry deposition velocities in m/s, whereas @@ -3370,8 +3280,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF -#if ( ALLDDVEL_GEOSCHEM || OCNDDVEL_GEOSCHEM ) - ! Compute drydep velocities and update State_Chm%DryDepVel CALL Do_Drydep( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & @@ -3386,133 +3294,54 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF -#if ( OCNDDVEL_GEOSCHEM ) - - DO N = 1, nddvels - - !! Print debug - !IF ( rootChunk ) THEN - ! IF ( N == 1 ) THEN - ! Write(iulog,*) "Number of GC dry deposition species = ", & - ! SIZE(State_Chm(LCHNK)%DryDepVel(:,:,:),3) - ! Write(iulog,*) "Number of CESM dry deposition species = ", & - ! nddvels - ! ENDIF - ! Write(iulog,*) "N = ", N - ! Write(iulog,*) "drySpc_ndx = ", drySpc_ndx(N) - ! Write(iulog,*) "GC index = ", map2GC_dryDep(N) - ! IF ( map2GC_dryDep(N) > 0 ) THEN - ! Write(iulog,*) "GC name = ", TRIM(DEPNAME(map2GC_dryDep(N))) - ! ENDIF - ! Write(iulog,*) "dry Species= ", TRIM(drydep_list(N)) - ! IF ( drySpc_ndx(N) > 0 ) THEN - ! Write(iulog,*) "tracerName = ", TRIM(tracerNames(drySpc_ndx(N))) - ! ENDIF - ! Write(iulog,*) "CLM-depVel = ", & - ! MAXVAL(cam_in%depvel(:nY,N)) * 1.0e-02_fp, " [m/s]" - ! IF ( map2GC_dryDep(N) > 0 ) THEN - ! Write(iulog,*) "GC-depVel = ", & - ! MAXVAL(State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N))), " [m/s]" - ! ENDIF - !ENDIF - - IF ( map2GC_dryDep(N) > 0 ) THEN - ! State_Chm%DryDepVel is in m/s - State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N)) = & - ! This first bit corresponds to the dry deposition - ! velocities over land as computed from CLM and - ! converted to m/s. This is scaled by the fraction - ! of land. - cam_in%depVel(:nY,N) * 1.0e-02_fp & - * MAX(0._fp, 1.0_fp - State_Met(LCHNK)%FROCEAN(1,:nY)) & - ! This second bit corresponds to the dry deposition - ! velocities over ocean and sea ice as computed from - ! GEOS-Chem. This is scaled by the fraction of ocean - ! and sea ice. - + State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N)) & - * State_Met(LCHNK)%FROCEAN(1,:nY) - ENDIF - ENDDO - -#endif - -#elif ( OCNDDVEL_MOZART ) - ! This routine updates the deposition velocities from CLM in the - ! pointer lnd(LCHNK)%dvel as long as drydep_method == DD_XLND is - ! True. - CALL drydep_update( State, cam_in ) - - windSpeed(:nY) = SQRT( state%U(:nY,nZ)*state%U(:nY,nZ) + & - state%V(:nY,nZ)*state%V(:nY,nZ) ) - potT(:nY) = state%t(:nY,nZ) * (1._fp + qH2O(:nY,nZ)) - - CALL get_lat_all_p( LCHNK, nY, latndx ) - CALL get_lon_all_p( LCHNK, nY, lonndx ) - - CALL drydep_fromlnd( ocnfrac = cam_in%ocnfrac(:), & - icefrac = cam_in%icefrac(:), & - ncdate = currYMD, & - sfc_temp = cam_in%TS(:), & - pressure_sfc = state%PS(:), & - wind_speed = windSpeed(:), & - spec_hum = qH2O(:,nZ), & - air_temp = state%t(:,nZ), & - pressure_10m = state%pmid(:,nZ), & - rain = State_Met(LCHNK)%PRECTOT(1,:), & - snow = cam_in%Snowhland(:), & - solar_flux = State_Met(LCHNK)%SWGDN(1,:), & - dvelocity = MOZART_depVel(:,:), & - dflx = MOZART_depFlx(:,:), & - State_Chm = State_Chm(LCHNK), & - tv = potT(:), & - soilw = -99._fp, & - rh = relHum(:,nZ), & - ncol = nY, & - lonndx = lonndx(:), & - latndx = latndx(:), & - lchnk = LCHNK ) - - DO N = 1, nddvels - - !! Print debug - !IF ( rootChunk ) THEN - ! IF ( N == 1 ) THEN - ! Write(iulog,*) "Number of GC dry deposition species = ", & - ! SIZE(State_Chm(LCHNK)%DryDepVel(:,:,:),3) - ! Write(iulog,*) "Number of CESM dry deposition species = ", & - ! nddvels - ! ENDIF - ! Write(iulog,*) "N = ", N - ! Write(iulog,*) "drySpc_ndx = ", drySpc_ndx(N) - ! Write(iulog,*) "GC index = ", map2GC_dryDep(N) - ! IF ( map2GC_dryDep(N) > 0 ) THEN - ! Write(iulog,*) "GC name = ", TRIM(DEPNAME(map2GC_dryDep(N))) - ! ENDIF - ! Write(iulog,*) "dry Species= ", TRIM(drydep_list(N)) - ! IF ( drySpc_ndx(N) > 0 ) THEN - ! Write(iulog,*) "tracerName = ", TRIM(tracerNames(drySpc_ndx(N))) - ! ENDIF - ! Write(iulog,*) "CLM-depVel = ", & - ! MAXVAL(cam_in%depvel(:nY,N)) * 1.0e-02_fp, " [m/s]", LCHNK - ! IF ( drySpc_ndx(N) > 0 ) THEN - ! Write(iulog,*) "Merged depVel = ", & - ! MAXVAL(MOZART_depVel(:nY,drySpc_ndx(N))) * 1.0e-02_fp, " [m/s]", LCHNK - ! ENDIF - !ENDIF - - IF ( ( map2GC_dryDep(N) > 0 ) .AND. ( drySpc_ndx(N) > 0 ) ) THEN - ! State_Chm%DryDepVel is in m/s - State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N)) = & - MOZART_depVel(:nY,drySpc_ndx(N)) * 1.0e-02_fp - ENDIF - - ENDDO + IF ( Input_Opt%ddVel_CLM ) THEN + DO N = 1, nddvels + + !! Print debug + !IF ( rootChunk ) THEN + ! IF ( N == 1 ) THEN + ! Write(iulog,*) "Number of GC dry deposition species = ", & + ! SIZE(State_Chm(LCHNK)%DryDepVel(:,:,:),3) + ! Write(iulog,*) "Number of CESM dry deposition species = ", & + ! nddvels + ! ENDIF + ! Write(iulog,*) "N = ", N + ! Write(iulog,*) "drySpc_ndx = ", drySpc_ndx(N) + ! Write(iulog,*) "GC index = ", map2GC_dryDep(N) + ! IF ( map2GC_dryDep(N) > 0 ) THEN + ! Write(iulog,*) "GC name = ", TRIM(DEPNAME(map2GC_dryDep(N))) + ! ENDIF + ! Write(iulog,*) "dry Species= ", TRIM(drydep_list(N)) + ! IF ( drySpc_ndx(N) > 0 ) THEN + ! Write(iulog,*) "tracerName = ", TRIM(tracerNames(drySpc_ndx(N))) + ! ENDIF + ! Write(iulog,*) "CLM-depVel = ", & + ! MAXVAL(cam_in%depvel(:nY,N)) * 1.0e-02_fp, " [m/s]" + ! IF ( map2GC_dryDep(N) > 0 ) THEN + ! Write(iulog,*) "GC-depVel = ", & + ! MAXVAL(State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N))), " [m/s]" + ! ENDIF + !ENDIF + + IF ( map2GC_dryDep(N) > 0 ) THEN + ! State_Chm%DryDepVel is in m/s + State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N)) = & + ! This first bit corresponds to the dry deposition + ! velocities over land as computed from CLM and + ! converted to m/s. This is scaled by the fraction + ! of land. + cam_in%depVel(:nY,N) * 1.0e-02_fp & + * MAX(0._fp, 1.0_fp - State_Met(LCHNK)%FROCEAN(1,:nY)) & + ! This second bit corresponds to the dry deposition + ! velocities over ocean and sea ice as computed from + ! GEOS-Chem. This is scaled by the fraction of ocean + ! and sea ice. + + State_Chm(LCHNK)%DryDepVel(1,:nY,map2GC_dryDep(N)) & + * State_Met(LCHNK)%FROCEAN(1,:nY) + ENDIF + ENDDO + ENDIF -#else - ! We should be in one of the cases above as any exceptions should be - ! caught when running chem_readnl, but just for safety's safe: - CALL ENDRUN('Incorrect definitions for dry deposition velocities') -#endif !TMMF, Here set dry deposition velocities to zero if MAM performs its !own deposition... From 4deaa19efe8fc4c5556ffe647d52624053b6ac0f Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 28 Oct 2020 14:34:00 -0400 Subject: [PATCH 145/239] Feat: Read OMOC from HEMCO and store in State_Chm Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 113 ++++++++++++++---------- 1 file changed, 68 insertions(+), 45 deletions(-) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index ca8fca6d0b..ecbc401546 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -2280,6 +2280,47 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Initialize tendency array CALL Physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) + ! Determine current date and time + CALL Get_Curr_Date( yr = currYr, & + mon = currMo, & + day = currDy, & + tod = currTOD ) + + ! For now, force year to be 2000 + currYr = 2000 + currYMD = (currYr*1000) + (currMo*100) + (currDy) + ! Deal with subdaily + currUTC = REAL(currTOD,f4)/3600.0e+0_f4 + currSc = 0 + currMn = 0 + currHr = 0 + DO WHILE (currTOD >= 3600) + currTOD = currTOD - 3600 + currHr = currHr + 1 + ENDDO + DO WHILE (currTOD >= 60) + currTOD = currTOD - 60 + currMn = currMn + 1 + ENDDO + currSc = currTOD + currHMS = (currHr*1000) + (currMn*100) + (currSc) + + IF ( firstDay ) THEN + newDay = .True. + newMonth = .True. + firstDay = .False. + ELSE IF ( currHMS < dT ) THEN + newDay = .True. + IF ( currDy == 1 ) THEN + newMonth = .True. + ELSE + newMonth = .False. + ENDIF + ELSE + newDay = .False. + newMonth = .False. + ENDIF + ! Calculate COS(SZA) Calday = Get_Curr_Calday( INT(dT/2) ) CALL Zenith( Calday, Rlats, Rlons, CSZAmid, nY ) @@ -2692,6 +2733,33 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf_ik => NULL() ENDIF + ! Field : OMOC + ! Description: OM/OC ratio + ! Unit : - + ! Dimensions : nX, nY + IF ( currMo == 12 .or. currMo == 1 .or. currMo == 2 ) THEN + fldname_ns = 'HCO_OMOC_DJF' + ELSE IF ( currMo == 3 .or. currMo == 4 .or. currMo == 5 ) THEN + fldname_ns = 'HCO_OMOC_MAM' + ELSE IF ( currMo == 6 .or. currMo == 7 .or. currMo == 8 ) THEN + fldname_ns = 'HCO_OMOC_JJA' + ELSE IF ( currMo == 9 .or. currMo == 10 .or. currMo == 11 ) THEN + fldname_ns = 'HCO_OMOC_SON' + ENDIF + tmpIdx = pbuf_get_index(fldname_ns, rc) + IF ( tmpIdx < 0 ) THEN + ! there is an error here and the field was not found + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + ELSE + CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) + DO J = 1, nY + State_Chm(LCHNK)%OMOC(1,J) = pbuf_ik(J,nZ) + ! 2-D data is stored in the 1st level of a + ! 3-D array due to laziness + ENDDO + pbuf_ik => NULL() + ENDIF + ! Three-dimensional fields on level edges DO J = 1, nY DO L = 1, nZ+1 @@ -2851,47 +2919,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Dimensions : nX, nY, nZ State_Met(LCHNK)%OPTD = State_Met(LCHNK)%TAUCLI + State_Met(LCHNK)%TAUCLW - ! Determine current date and time - CALL Get_Curr_Date( yr = currYr, & - mon = currMo, & - day = currDy, & - tod = currTOD ) - - ! For now, force year to be 2000 - currYr = 2000 - currYMD = (currYr*1000) + (currMo*100) + (currDy) - ! Deal with subdaily - currUTC = REAL(currTOD,f4)/3600.0e+0_f4 - currSc = 0 - currMn = 0 - currHr = 0 - DO WHILE (currTOD >= 3600) - currTOD = currTOD - 3600 - currHr = currHr + 1 - ENDDO - DO WHILE (currTOD >= 60) - currTOD = currTOD - 60 - currMn = currMn + 1 - ENDDO - currSc = currTOD - currHMS = (currHr*1000) + (currMn*100) + (currSc) - - IF ( firstDay ) THEN - newDay = .True. - newMonth = .True. - firstDay = .False. - ELSE IF ( currHMS < dT ) THEN - newDay = .True. - IF ( currDy == 1 ) THEN - newMonth = .True. - ELSE - newMonth = .False. - ENDIF - ELSE - newDay = .False. - newMonth = .False. - ENDIF - ! Pass time values obtained from the ESMF environment to GEOS-Chem CALL Accept_External_Date_Time( value_NYMD = currYMD, & value_NHMS = currHMS, & @@ -3342,10 +3369,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDIF - - !TMMF, Here set dry deposition velocities to zero if MAM performs its - !own deposition... - CALL Update_DryDepFreq( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & From 4945731c90afe7d51026f023a8bdf3ca2d30d55b Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 28 Oct 2020 17:59:07 -0400 Subject: [PATCH 146/239] Feat: Move all GEOS-Chem related diagnostics to cesmgc_diag_mod.F90 Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 | 415 ++++++++++++++++++ ...sions_mod.F90 => cesmgc_emissions_mod.F90} | 60 +-- src/chemistry/pp_geoschem/chemistry.F90 | 239 +--------- 3 files changed, 464 insertions(+), 250 deletions(-) create mode 100644 src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 rename src/chemistry/pp_geoschem/{gc_emissions_mod.F90 => cesmgc_emissions_mod.F90} (75%) diff --git a/src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 b/src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 new file mode 100644 index 0000000000..b9c152be9f --- /dev/null +++ b/src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 @@ -0,0 +1,415 @@ +!------------------------------------------------------------------------------ +! "GEOS-Chem" chemistry diagnostics interface ! +!------------------------------------------------------------------------------ +!BOP +! +! !MODULE: cesmgc_diag_mod.F90 +! +! !DESCRIPTION: Module cesmgc\_diag\_mod contains routines which aim to +! diagnose variables from GEOS-Chem +!\\ +!\\ +! !INTERFACE: +! +MODULE CESMGC_Diag_Mod +! +! !USES: +! + USE SHR_KIND_MOD, ONLY : r8 => shr_kind_r8 + USE SPMD_UTILS, ONLY : MasterProc + USE CAM_LOGFILE, ONLY : iulog + USE Error_Mod ! For error checking + USE ErrCode_Mod ! Error codes for success or failure + + IMPLICIT NONE + + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + PUBLIC :: CESMGC_Diag_Init + PUBLIC :: CESMGC_Diag_Calc + + ! Number of diagnosed photolytic reactions + INTEGER :: nPhotol +! +! !REVISION HISTORY: +! 28 Oct 2020 - T. M. Fritz - Initial version +!EOP +!------------------------------------------------------------------------------ +!BOC +! +CONTAINS +! +!EOC +!------------------------------------------------------------------------------ +!BOP +! +! !IROUTINE: cesmgc_diag_init +! +! !DESCRIPTION: Subroutine CESMGC\_Diag\_Init declares the variables to +! diagnosethe +!\\ +!\\ +! !INTERFACE: +! + SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm ) +! +! !USES: +! + USE Input_Opt_Mod, ONLY : OptInput + USE State_Chm_Mod, ONLY : ChmState + USE State_Diag_Mod, ONLY : get_TagInfo + USE Species_Mod, ONLY : Species + USE CHEM_MODS, ONLY : nTracers, nSls + USE CHEM_MODS, ONLY : tracerNames, tracerLongNames + USE CHEM_MODS, ONLY : slsNames, slsLongNames + USE CHEM_MODS, ONLY : gas_pcnst + USE MO_TRACNAME, ONLY : solsym + USE CONSTITUENTS, ONLY : pcnst, cnst_name + USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only + USE GAS_WETDEP_OPTS, ONLY : gas_wetdep_method + USE DRYDEP_MOD, ONLY : depName +! +! !INPUT PARAMETERS: +! + TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input options + TYPE(ChmState), INTENT(IN) :: State_Chm ! Chemistry State object +! +! !REVISION HISTORY: +! 20 Oct 2020 - T. M. Fritz - Initial version +!EOP +!------------------------------------------------------------------------------ +!BOC +! + ! Integer + INTEGER :: I, L, M, N + INTEGER :: RC + + ! Logical + LOGICAL :: Found + + ! Strings + CHARACTER(LEN=255) :: SpcName + CHARACTER(LEN=255) :: tagName + CHARACTER(LEN=255) :: ThisLoc + CHARACTER(LEN=255) :: ErrMsg + + ! Objects + TYPE(Species), POINTER :: SpcInfo + + !================================================================= + ! CESMGC_Diag_Init begins here! + !================================================================= + + ! Initialize pointers + SpcInfo => NULL() + + ! Assume a successful return until otherwise + RC = GC_SUCCESS + + ! Can add history output here too with the "addfld" & "add_default" routines + ! Note that constituents are already output by default + ! Add all species as output fields if desired + DO I = 1, nTracers + SpcName = TRIM(tracerNames(I)) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & + TRIM(tracerLongNames(I))//' concentration') + IF (TRIM(SpcName) == 'O3') THEN + CALL Add_Default ( TRIM(SpcName), 1, ' ') + ENDIF + ENDDO + + DO I = 1, nSls + SpcName = TRIM(slsNames(I)) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & + TRIM(slsLongNames(I))//' concentration') + !CALL Add_Default(TRIM(SpcName), 1, ' ') + ENDDO + + IF ( Input_Opt%LDryD ) THEN + DO I = 1, State_Chm%nDryDep + SpcName = 'DepVel_'//TRIM(depName(I)) + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'm/s', & + TRIM(SpcName)//' dry deposition velocity') + ENDDO + + DO I = 1, State_Chm%nAdvect + ! Get the species ID from the advected species ID + L = State_Chm%Map_Advect(I) + + ! Get info about this species from the species database + SpcInfo => State_Chm%SpcData(L)%Info + SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) + + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & + TRIM(SpcName)//' dry deposition flux') + + ! Free pointer + SpcInfo => NULL() + ENDDO + ENDIF + + ! Surface fluxes (emissions - drydep) + DO I = 1, pcnst + SpcName = 'SurfFlux_'//TRIM(cnst_name(I)) + CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & + TRIM(SpcName)//' surface flux') + ENDDO + + IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN + DO N = 1, gas_pcnst + SpcName = 'DTWR_'//TRIM(solsym(N)) + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg/s', & + 'wet removal tendency' ) + SpcName = 'WD_'//TRIM(solsym(N)) + CALL Addfld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & + 'vertical integrated wet deposition flux' ) + SpcName = 'WDRATE_'//TRIM(solsym(N)) + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/s', & + 'wet removal rate' ) + ENDDO + ENDIF + + CALL get_TagInfo( Input_Opt = Input_Opt, & + tagID = 'PHO', & + State_Chm = State_Chm, & + Found = Found, & + RC = RC, & + nTags = nPhotol ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Abnormal exit from routine "Get_TagInfo", could not ' // & + ' get nTags!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + DO M = 1, nPhotol + CALL get_TagInfo( Input_Opt = Input_Opt, & + tagID = 'PHO', & + State_Chm = State_Chm, & + Found = Found, & + RC = RC, & + N = M, & + tagName = tagName ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Abnormal exit from routine "Get_TagInfo"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + SpcName = 'Jval_' // TRIM( tagName ) + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & + TRIM(tagName) // ' photolysis rate' ) + ENDDO + ! Add Jval_O3O1D and Jval_O3O3P + SpcName = 'Jval_O3O1D' + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & + TRIM(tagName) // ' photolysis rate' ) + SpcName = 'Jval_O3O3P' + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & + TRIM(tagName) // ' photolysis rate' ) + + + END SUBROUTINE CESMGC_Diag_Init +!EOC +!------------------------------------------------------------------------------ +!BOP +! +! !IROUTINE: cesmgc_diag_calc +! +! !DESCRIPTION: Subroutine CESMGC\_Diag\_Calc passes the diagnostics variable +! to the CAM History routines +!\\ +!\\ +! !INTERFACE: +! + SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & + State_Grid, State_Met, cam_in, LCHNK ) +! +! !USES: +! + USE Input_Opt_Mod, ONLY : OptInput + USE State_Chm_Mod, ONLY : ChmState + USE State_Met_Mod, ONLY : MetState + USE State_Diag_Mod, ONLY : DgnState + USE State_Diag_Mod, ONLY : get_TagInfo + USE State_Grid_Mod, ONLY : GrdState + USE Species_Mod, ONLY : Species + USE MO_TRACNAME, ONLY : solsym + USE CAM_HISTORY, ONLY : outfld + USE CONSTITUENTS, ONLY : pcnst, cnst_name + USE CHEM_MODS, ONLY : MWRatio + USE CHEM_MODS, ONLY : SlsMWRatio + USE CHEM_MODS, ONLY : tracerNames + USE CHEM_MODS, ONLY : slsNames + USE CHEM_MODS, ONLY : nSls + USE CHEM_MODS, ONLY : map2GC, map2Idx, map2GC_Sls + USE DRYDEP_MOD, ONLY : depName, Ndvzind + USE CAMSRFEXCH, ONLY : cam_in_t +! +! !INPUT PARAMETERS: +! + TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input options + TYPE(ChmState), INTENT(IN) :: State_Chm ! Chemistry State object + TYPE(DgnState), INTENT(IN) :: State_Diag ! Diag State object + TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object + TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object + TYPE(cam_in_t), INTENT(IN) :: cam_in ! import state + INTEGER, INTENT(IN) :: LCHNK ! Chunk number +! +! !REVISION HISTORY: +! 20 Oct 2020 - T. M. Fritz - Initial version +!EOP +!------------------------------------------------------------------------------ +!BOC +! + ! Integers + INTEGER :: I, J, L, M, N, ND + INTEGER :: RC + + INTEGER :: nY, nZ + + ! Logicals + LOGICAL :: Found + + ! Strings + CHARACTER(LEN=255) :: ThisLoc + CHARACTER(LEN=255) :: ErrMsg + CHARACTER(LEN=255) :: SpcName + CHARACTER(LEN=255) :: tagName + + ! Arrays + REAL(r8) :: outTmp(State_Grid%nY,State_Grid%nZ) + + ! Objects + TYPE(Species), POINTER :: SpcInfo + + !================================================================= + ! CESMGC_Diag_Calc begins here! + !================================================================= + + nY = State_Grid%nY + nZ = State_Grid%nZ + + ! Initialize pointers + SpcInfo => NULL() + + ! For error trapping + ErrMsg = '' + ThisLoc = ' -> at CESMGC_Diag_Calc (in chemistry/pp_geoschem/cesmgc_diag_mod.F90)' + + ! Write diagnostic output + DO N = 1, pcnst + M = map2GC(N) + I = map2Idx(N) + IF ( M > 0 ) THEN + SpcName = tracerNames(I) + outTmp = 0.0e+0_r8 + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Chm%Species(1,J,L,M),r8) * MWRatio(I) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + ENDDO + + DO N = 1, nSls + SpcName = slsNames(N) + outTmp = 0.0e+0_r8 + M = map2GC_Sls(N) + IF ( M > 0 ) THEN + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Chm%Species(1,J,L,M),r8) * SLSMWratio(N) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + ENDDO + + ! Dry deposition velocity and surface flux + IF ( Input_Opt%LDryD ) THEN + DO N = 1, State_Chm%nDryDep + ND = NDVZIND(N) + SpcName = 'DepVel_'//TRIM(depName(N)) + CALL OutFld( TRIM(SpcName), State_Chm%DryDepVel(1,:nY,ND), nY, LCHNK ) + ENDDO + + DO N = 1, State_Chm%nAdvect + ! Get the species ID from the advected species ID + L = State_Chm%Map_Advect(N) + + ! Get info about this species from the species database + SpcInfo => State_Chm%SpcData(L)%Info + SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) + + ! SurfaceFlux is Emissions - Drydep, but Emissions = 0, as it is applied + ! externally + CALL OutFld( TRIM(SpcName), -State_Chm%SurfaceFlux(1,:nY,N), nY, LCHNK ) + + ! Free pointer + SpcInfo => NULL() + ENDDO + ENDIF + + ! Surface fluxes (emissions - drydep) + DO N = 1, pcnst + SpcName = 'SurfFlux_'//TRIM(cnst_name(N)) + CALL OutFld( TRIM(SpcName), cam_in%cflx(:nY,N), nY, LCHNK ) + ENDDO + + ! Photolysis rates + IF ( ASSOCIATED(State_Diag%Jval) ) THEN + DO M = 1, nPhotol + CALL get_TagInfo( Input_Opt = Input_Opt, & + tagID = 'PHO', & + State_Chm = State_Chm, & + Found = Found, & + RC = RC, & + N = M, & + tagName = tagName ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Abnormal exit from routine "Get_TagInfo"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + SpcName = 'Jval_' // TRIM( tagName ) + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Diag%Jval(1,J,L,M),r8) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDDO + ENDIF + IF ( ASSOCIATED(State_Diag%JvalO3O1D) ) THEN + SpcName = 'Jval_O3O1D' + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Diag%JvalO3O1D(1,J,L),r8) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + IF ( ASSOCIATED(State_Diag%JvalO3O3P) ) THEN + SpcName = 'Jval_O3O3P' + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Diag%JvalO3O3P(1,J,L),r8) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + END SUBROUTINE CESMGC_Diag_Calc +!EOC +!------------------------------------------------------------------------------ + END MODULE CESMGC_Diag_Mod + diff --git a/src/chemistry/pp_geoschem/gc_emissions_mod.F90 b/src/chemistry/pp_geoschem/cesmgc_emissions_mod.F90 similarity index 75% rename from src/chemistry/pp_geoschem/gc_emissions_mod.F90 rename to src/chemistry/pp_geoschem/cesmgc_emissions_mod.F90 index 71dd703df4..840f997373 100644 --- a/src/chemistry/pp_geoschem/gc_emissions_mod.F90 +++ b/src/chemistry/pp_geoschem/cesmgc_emissions_mod.F90 @@ -3,15 +3,15 @@ !------------------------------------------------------------------------------ !BOP ! -! !MODULE: gc_emissions_mod.F90 +! !MODULE: cesmgc_emissions_mod.F90 ! -! !DESCRIPTION: Module gc\_emissions\_mod contains routines which retrieve +! !DESCRIPTION: Module cesmgc\_emissions\_mod contains routines which retrieve ! emission fluxes from HEMCO and transfers it back to the CESM-GC interface !\\ !\\ ! !INTERFACE: ! -MODULE GC_Emissions_Mod +MODULE CESMGC_Emissions_Mod ! ! !USES: ! @@ -26,9 +26,9 @@ MODULE GC_Emissions_Mod ! ! !PUBLIC MEMBER FUNCTIONS: ! - PUBLIC :: GC_Emissions_Init - PUBLIC :: GC_Emissions_Calc - PUBLIC :: GC_Emissions_Final + PUBLIC :: CESMGC_Emissions_Init + PUBLIC :: CESMGC_Emissions_Calc + PUBLIC :: CESMGC_Emissions_Final ! ! !REVISION HISTORY: ! 07 Oct 2020 - T. M. Fritz - Initial version @@ -42,14 +42,15 @@ MODULE GC_Emissions_Mod !------------------------------------------------------------------------------ !BOP ! -! !IROUTINE: gc_emissions_init +! !IROUTINE: cesmgc_emissions_init ! -! !DESCRIPTION: Subroutine GC\_Emissions\_Init initializes the emissions routine +! !DESCRIPTION: Subroutine CESMGC\_Emissions\_Init initializes the emissions +! routine !\\ !\\ ! !INTERFACE: ! - SUBROUTINE GC_Emissions_Init + SUBROUTINE CESMGC_Emissions_Init ! ! !INPUT PARAMETERS: ! @@ -61,25 +62,25 @@ SUBROUTINE GC_Emissions_Init !BOC ! !================================================================= - ! GC_Emissions_Init begins here! + ! CESMGC_Emissions_Init begins here! !================================================================= - END SUBROUTINE GC_Emissions_Init + END SUBROUTINE CESMGC_Emissions_Init !EOC !------------------------------------------------------------------------------ !BOP ! -! !IROUTINE: gc_emissions_calc +! !IROUTINE: cesmgc_emissions_calc ! -! !DESCRIPTION: Subroutine GC\_Emissions\_Calc retrieves emission fluxes from -! HEMCO and returns a 3-D array of emission flux to the CESM-GC interface. -! On top of passing data, this routine handles a number of checks. +! !DESCRIPTION: Subroutine CESMGC\_Emissions\_Calc retrieves emission fluxes +! from HEMCO and returns a 3-D array of emission flux to the CESM-GC +! interface. On top of passing data, this routine handles a number of checks. !\\ !\\ ! !INTERFACE: ! - SUBROUTINE GC_Emissions_Calc( state, hco_pbuf2d, eflx ) + SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, eflx ) ! ! !USES: ! @@ -131,7 +132,7 @@ SUBROUTINE GC_Emissions_Calc( state, hco_pbuf2d, eflx ) CHARACTER(LEN=255) :: fldname_ns ! field name HCO_* !================================================================= - ! GC_Emissions_Calc begins here! + ! CESMGC_Emissions_Calc begins here! !================================================================= ! Initialize pointers @@ -153,14 +154,15 @@ SUBROUTINE GC_Emissions_Calc( state, hco_pbuf2d, eflx ) tmpIdx = pbuf_get_index(fldname_ns, RC) IF ( tmpIdx < 0 ) THEN - IF ( rootChunk ) Write(iulog,*) "GC_Emissions_Calc: Field not found ", TRIM(fldname_ns) + IF ( rootChunk ) Write(iulog,*) "CESMGC_Emissions_Calc: Field not found ", & + TRIM(fldname_ns) ELSE ! This is already in chunk, retrieve it pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) IF ( .NOT. ASSOCIATED(pbuf_ik) ) THEN ! Sanity check - CALL ENDRUN("GC_Emissions_Calc: FATAL - tmpIdx > 0 but pbuf_ik not associated") + CALL ENDRUN("CESMGC_Emissions_Calc: FATAL - tmpIdx > 0 but pbuf_ik not associated") ENDIF M = map2GCinv(N) @@ -174,15 +176,15 @@ SUBROUTINE GC_Emissions_Calc( state, hco_pbuf2d, eflx ) pbuf_chnk => NULL() IF ( MINVAL(eflx(:,:,M)) < 0.0e+00_r8 ) THEN - Write(iulog,*) "GC_Emissions_Calc: HEMCO emission flux is negative for ", & + Write(iulog,*) "CESMGC_Emissions_Calc: HEMCO emission flux is negative for ", & TRIM(cnst_name(M)), " with value ", MINVAL(eflx(:,:,M)), " at ", & MINLOC(eflx(:,:,M)) ENDIF IF ( rootChunk .and. ( MAXVAL(eflx(1:ncol,:,M)) > 0.0e+0_r8 ) ) THEN - Write(iulog,'(a,a,a,a)') "GC_Emissions_Calc: HEMCO flux ", & + Write(iulog,'(a,a,a,a)') "CESMGC_Emissions_Calc: HEMCO flux ", & TRIM(fldname_ns), " added to ", TRIM(cnst_name(M)) - Write(iulog,'(a,a,E16.4)') "GC_Emissions_Calc: Maximum flux ", & + Write(iulog,'(a,a,E16.4)') "CESMGC_Emissions_Calc: Maximum flux ", & TRIM(fldname_ns), MAXVAL(eflx(1:ncol,:,M)) ENDIF ENDIF @@ -190,19 +192,19 @@ SUBROUTINE GC_Emissions_Calc( state, hco_pbuf2d, eflx ) IF ( FIRST ) FIRST = .False. - END SUBROUTINE GC_Emissions_Calc + END SUBROUTINE CESMGC_Emissions_Calc !EOC !------------------------------------------------------------------------------ !BOP ! -! !IROUTINE: gc_emissions_final +! !IROUTINE: cesmgc_emissions_final ! -! !DESCRIPTION: Subroutine GC\_Emissions\_Final cleans up the module +! !DESCRIPTION: Subroutine CESMGC\_Emissions\_Final cleans up the module !\\ !\\ ! !INTERFACE: ! - SUBROUTINE GC_Emissions_Final + SUBROUTINE CESMGC_Emissions_Final ! ! !REVISION HISTORY: ! 07 Oct 2020 - T. M. Fritz - Initial version @@ -211,10 +213,10 @@ SUBROUTINE GC_Emissions_Final !BOC ! !================================================================= - ! GC_Emissions_Final begins here! + ! CESMGC_Emissions_Final begins here! !================================================================= !EOC !------------------------------------------------------------------------------ - END SUBROUTINE GC_Emissions_Final + END SUBROUTINE CESMGC_Emissions_Final !EOC - END MODULE GC_Emissions_Mod + END MODULE CESMGC_Emissions_Mod diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index ecbc401546..7e594cce25 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -135,9 +135,6 @@ module chemistry ! Index of 1st constituent INTEGER :: iFirstCnst = -1 - ! Number of diagnosed photolytic reactions - INTEGER :: nPhotol - ! Strings CHARACTER(LEN=255) :: ThisLoc CHARACTER(LEN=255) :: ErrMsg @@ -912,7 +909,6 @@ subroutine chem_init(phys_state, pbuf2d) ! !----------------------------------------------------------------------- use physics_buffer, only : physics_buffer_desc, pbuf_get_index - use cam_history, only : addfld, add_default, horiz_only use chem_mods, only : map2GC_dryDep, drySpc_ndx #ifdef SPMD @@ -942,7 +938,6 @@ subroutine chem_init(phys_state, pbuf2d) use DiagList_Mod, only : Init_DiagList, Print_DiagList use TaggedDiagList_Mod,only : Init_TaggedDiagList, Print_TaggedDiagList use GC_Grid_Mod, only : SetGridFromCtrEdges - use State_Diag_Mod, only : get_TagInfo ! Use GEOS-Chem versions of physical constants use PhysConstants, only : PI, PI_180, Re @@ -965,7 +960,8 @@ subroutine chem_init(phys_state, pbuf2d) use tracer_cnst, only : tracer_cnst_init use tracer_srcs, only : tracer_srcs_init - use GC_Emissions_Mod, only : GC_Emissions_Init + use CESMGC_Emissions_Mod, only : CESMGC_Emissions_Init + use CESMGC_Diag_Mod, only : CESMGC_Diag_Init TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) @@ -993,7 +989,6 @@ subroutine chem_init(phys_state, pbuf2d) ! Strings CHARACTER(LEN=255) :: historyConfigFile CHARACTER(LEN=255) :: SpcName - CHARACTER(LEN=255) :: tagName ! Objects TYPE(Species), POINTER :: SpcInfo @@ -1723,112 +1718,12 @@ subroutine chem_init(phys_state, pbuf2d) CALL tracer_cnst_init() CALL tracer_srcs_init() - ! Can add history output here too with the "addfld" & "add_default" routines - ! Note that constituents are already output by default - ! Add all species as output fields if desired - DO I = 1, nTracers - SpcName = TRIM(tracerNames(I)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & - TRIM(tracerLongNames(I))//' concentration') - IF (TRIM(SpcName) == 'O3') THEN - CALL Add_Default ( TRIM(SpcName), 1, ' ') - ENDIF - ENDDO - - DO I = 1, nSls - SpcName = TRIM(slsNames(I)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & - TRIM(slsLongNames(I))//' concentration') - !CALL Add_Default(TRIM(SpcName), 1, ' ') - ENDDO - - IF ( Input_Opt%LDryD ) THEN - DO I = 1, State_Chm(BEGCHUNK)%nDryDep - SpcName = 'DepVel_'//TRIM(depName(I)) - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'm/s', & - TRIM(SpcName)//' dry deposition velocity') - ENDDO - - DO I = 1, State_Chm(BEGCHUNK)%nAdvect - ! Get the species ID from the advected species ID - L = State_Chm(BEGCHUNK)%Map_Advect(I) - - ! Get info about this species from the species database - SpcInfo => State_Chm(BEGCHUNK)%SpcData(L)%Info - SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) - - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & - TRIM(SpcName)//' dry deposition flux') - - ! Free pointer - SpcInfo => NULL() - ENDDO - ENDIF - - ! Surface fluxes (emissions - drydep) - DO I = 1, pcnst - SpcName = 'SurfFlux_'//TRIM(cnst_name(I)) - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & - TRIM(SpcName)//' surface flux') - ENDDO - - IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN - DO N = 1, gas_pcnst - SpcName = 'DTWR_'//TRIM(solsym(N)) - CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg/s', & - 'wet removal tendency' ) - SpcName = 'WD_'//TRIM(solsym(N)) - CALL Addfld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & - 'vertical integrated wet deposition flux' ) - SpcName = 'WDRATE_'//TRIM(solsym(N)) - CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/s', & - 'wet removal rate' ) - ENDDO - ENDIF - - CALL get_TagInfo( Input_Opt = Input_Opt, & - tagID = 'PHO', & - State_Chm = State_Chm(BEGCHUNK), & - Found = Found, & - RC = RC, & - nTags = nPhotol ) - - ! Trap potential errors - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Abnormal exit from routine "Get_TagInfo", could not ' // & - ' get nTags!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - - DO M = 1, nPhotol - CALL get_TagInfo( Input_Opt = Input_Opt, & - tagID = 'PHO', & - State_Chm = State_Chm(BEGCHUNK), & - Found = Found, & - RC = RC, & - N = M, & - tagName = tagName ) - - ! Trap potential errors - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Abnormal exit from routine "Get_TagInfo"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - - SpcName = 'Jval_' // TRIM( tagName ) - CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & - TRIM(tagName) // ' photolysis rate' ) - ENDDO - ! Add Jval_O3O1D and Jval_O3O3P - SpcName = 'Jval_O3O1D' - CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & - TRIM(tagName) // ' photolysis rate' ) - SpcName = 'Jval_O3O3P' - CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & - TRIM(tagName) // ' photolysis rate' ) + ! Initialize diagnostics interface + CALL CESMGC_Diag_Init( Input_Opt = Input_Opt, & + State_Chm = State_Chm(BEGCHUNK) ) ! Initialize emissions interface - CALL GC_Emissions_Init + CALL CESMGC_Emissions_Init hco_pbuf2d => pbuf2d @@ -1936,7 +1831,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use State_Diag_Mod, only : get_TagInfo use Unitconv_Mod, only : Convert_Spc_Units - use GC_Emissions_Mod, only : GC_Emissions_Calc + use CESMGC_Emissions_Mod, only : CESMGC_Emissions_Calc + use CESMGC_Diag_Mod, only : CESMGC_Diag_Calc use Tropopause, only : Tropopause_findChemTrop, Tropopause_Find use HCO_Utilities_GC_Mod ! Utility routines for GC-HEMCO interface @@ -2033,7 +1929,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: mmr1(state%NCOL,PVER,gas_pcnst) REAL(r8) :: wk_out(state%NCOL) LOGICAL :: isWD - REAL(r8) :: outTmp(state%NCOL,PVER) LOGICAL :: Found CHARACTER(LEN=255) :: tagName @@ -3404,7 +3299,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF - CALL GC_Emissions_Calc( state, hco_pbuf2d, eflx ) + CALL CESMGC_Emissions_Calc( state, hco_pbuf2d, eflx ) ! Add near-surface emissions to surface flux BC cam_in%cflx(1:nY,:) = cam_in%cflx(1:nY,:) + eflx(1:nY,nZ,:) @@ -3743,111 +3638,13 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Air_Total = Air_Total + tmpMass #endif - ! Write diagnostic output - DO N = 1, pcnst - M = map2GC(N) - I = map2Idx(N) - IF ( M > 0 ) THEN - SpcName = tracerNames(I) - outTmp = 0.0e+0_r8 - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Chm(LCHNK)%Species(1,J,L,M),r8) * MWRatio(I) - ENDDO - ENDDO - CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) - ENDIF - ENDDO - - DO N = 1, nSls - SpcName = slsNames(N) - outTmp = 0.0e+0_r8 - M = map2GC_Sls(N) - IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Chm(LCHNK)%Species(1,J,L,M),r8) * SLSMWratio(N) - ENDDO - ENDDO - CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) - ENDIF - ENDDO - - ! Dry deposition velocity and surface flux - IF ( Input_Opt%LDryD ) THEN - DO N = 1, State_Chm(BEGCHUNK)%nDryDep - ND = NDVZIND(N) - SpcName = 'DepVel_'//TRIM(depName(N)) - CALL OutFld( TRIM(SpcName), State_Chm(LCHNK)%DryDepVel(1,:nY,ND), nY, LCHNK ) - ENDDO - - DO N = 1, State_Chm(BEGCHUNK)%nAdvect - ! Get the species ID from the advected species ID - L = State_Chm(BEGCHUNK)%Map_Advect(N) - - ! Get info about this species from the species database - SpcInfo => State_Chm(BEGCHUNK)%SpcData(L)%Info - SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) - - ! SurfaceFlux is Emissions - Drydep, but Emissions = 0, as it is applied - ! externally - CALL OutFld( TRIM(SpcName), -State_Chm(LCHNK)%SurfaceFlux(1,:nY,N), nY, LCHNK ) - - ! Free pointer - SpcInfo => NULL() - ENDDO - ENDIF - - ! Surface fluxes (emissions - drydep) - DO N = 1, pcnst - SpcName = 'SurfFlux_'//TRIM(cnst_name(N)) - CALL OutFld( TRIM(SpcName), cam_in%cflx(:nY,N), nY, LCHNK ) - ENDDO - - ! Photolysis rates - IF ( ASSOCIATED(State_Diag(LCHNK)%Jval) ) THEN - DO M = 1, nPhotol - CALL get_TagInfo( Input_Opt = Input_Opt, & - tagID = 'PHO', & - State_Chm = State_Chm(LCHNK), & - Found = Found, & - RC = RC, & - N = M, & - tagName = tagName ) - - ! Trap potential errors - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Abnormal exit from routine "Get_TagInfo"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - - SpcName = 'Jval_' // TRIM( tagName ) - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Diag(LCHNK)%Jval(1,J,L,M),r8) - ENDDO - ENDDO - CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) - ENDDO - ENDIF - IF ( ASSOCIATED(State_Diag(LCHNK)%JvalO3O1D) ) THEN - SpcName = 'Jval_O3O1D' - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Diag(LCHNK)%JvalO3O1D(1,J,L),r8) - ENDDO - ENDDO - CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) - ENDIF - IF ( ASSOCIATED(State_Diag(LCHNK)%JvalO3O3P) ) THEN - SpcName = 'Jval_O3O3P' - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Diag(LCHNK)%JvalO3O3P(1,J,L),r8) - ENDDO - ENDDO - CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) - ENDIF + CALL CESMGC_Diag_Calc( Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + cam_in = cam_in, & + LCHNK = LCHNK ) ! Re-flip all the arrays vertically ptend%q(:,:,:) = 0.0e+0_r8 @@ -3964,7 +3761,7 @@ subroutine chem_final use Diag_Mod, only : Cleanup_Diag #endif - use GC_Emissions_Mod, only: GC_Emissions_Final + use CESMGC_Emissions_Mod, only: CESMGC_Emissions_Final ! Local variables INTEGER :: I, RC @@ -3998,7 +3795,7 @@ subroutine chem_final CALL Cleanup_Sulfate CALL Cleanup_Strat_Chem - CALL GC_Emissions_Final + CALL CESMGC_Emissions_Final CALL Cleanup_CMN_SIZE( RC ) IF ( RC /= GC_SUCCESS ) THEN From 2c6fc28c74bcb868dbda32a1957410b361909835 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 28 Oct 2020 18:00:03 -0400 Subject: [PATCH 147/239] Feat: Add missing initialization of ThisLoc and ErrMsg Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/chemistry.F90 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index 7e594cce25..b4d9dd970e 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -229,6 +229,13 @@ subroutine chem_register INTEGER :: RC, IERR + ! Assume a successful return until otherwise + RC = GC_SUCCESS + + ! For error trapping + ErrMsg = '' + ThisLoc = ' -> at GEOS-Chem (in chemistry/pp_geoschem/chemistry.F90)' + ! Initialize pointer ThisSpc => NULL() From 7966f8c6746cfb94a04f00eaa448ed39cc90aefa Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 29 Oct 2020 14:53:10 -0400 Subject: [PATCH 148/239] Feat: Add option to output State_Met in cesmgc_diag_mod.F90 Signed-off-by: Thibaud Fritz --- src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 | 150 +++++++++++++++++- src/chemistry/pp_geoschem/chemistry.F90 | 7 +- 2 files changed, 149 insertions(+), 8 deletions(-) diff --git a/src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 b/src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 index b9c152be9f..ce2bb7db5b 100644 --- a/src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 @@ -54,14 +54,16 @@ MODULE CESMGC_Diag_Mod !\\ ! !INTERFACE: ! - SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm ) + SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! ! !USES: ! USE Input_Opt_Mod, ONLY : OptInput USE State_Chm_Mod, ONLY : ChmState + USE State_Met_Mod, ONLY : MetState USE State_Diag_Mod, ONLY : get_TagInfo USE Species_Mod, ONLY : Species + USE Registry_Mod, ONLY : MetaRegItem, RegItem USE CHEM_MODS, ONLY : nTracers, nSls USE CHEM_MODS, ONLY : tracerNames, tracerLongNames USE CHEM_MODS, ONLY : slsNames, slsLongNames @@ -76,6 +78,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm ) ! TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input options TYPE(ChmState), INTENT(IN) :: State_Chm ! Chemistry State object + TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object ! ! !REVISION HISTORY: ! 20 Oct 2020 - T. M. Fritz - Initial version @@ -97,14 +100,18 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm ) CHARACTER(LEN=255) :: ErrMsg ! Objects - TYPE(Species), POINTER :: SpcInfo + TYPE(Species), POINTER :: SpcInfo + TYPE(MetaRegItem), POINTER :: Current + TYPE(RegItem ), POINTER :: Item !================================================================= ! CESMGC_Diag_Init begins here! !================================================================= ! Initialize pointers - SpcInfo => NULL() + SpcInfo => NULL() + Current => NULL() + Item => NULL() ! Assume a successful return until otherwise RC = GC_SUCCESS @@ -213,6 +220,44 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm ) CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & TRIM(tagName) // ' photolysis rate' ) + ! ========================================== + ! Now add fields corresponding to State_Met + ! ========================================== + + ! Copied from Headers/registry_mod.F90 + ! Point to the head node of the Registry + Current => State_Met%Registry + + ! As long as the current node isn't NULL + DO WHILE( ASSOCIATED( Current ) ) + + ! Get the REGISTRY ITEM belonging to this node of the Registry + Item => Current%Item + + ! Only print on the root CPU + IF ( ASSOCIATED( Item ) ) THEN + + IF ( TRIM(Item%DimNames) == 'xy' ) THEN + CALL Addfld( TRIM( Item%FullName ), horiz_only, 'A', & + TRIM( Item%Units ), TRIM( Item%Description ) ) + ELSE + CALL Addfld( TRIM( Item%FullName ), (/ 'lev' /), 'A', & + TRIM( Item%Units ), TRIM( Item%Description ) ) + ENDIF + CALL Add_Default( TRIM(Item%FullName), 4, ' ') + + ENDIF + + ! Point to next node of the Registry + Current => Current%Next + + ENDDO + + !======================================================================= + ! Cleanup and quit + !======================================================================= + Current => NULL() + Item => NULL() END SUBROUTINE CESMGC_Diag_Init !EOC @@ -239,6 +284,10 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & USE State_Diag_Mod, ONLY : get_TagInfo USE State_Grid_Mod, ONLY : GrdState USE Species_Mod, ONLY : Species + USE Registry_Mod, ONLY : MetaRegItem, RegItem + USE Registry_Mod, ONLY : Registry_Lookup + USE Registry_Params_Mod + USE PRECISION_MOD USE MO_TRACNAME, ONLY : solsym USE CAM_HISTORY, ONLY : outfld USE CONSTITUENTS, ONLY : pcnst, cnst_name @@ -250,6 +299,8 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & USE CHEM_MODS, ONLY : map2GC, map2Idx, map2GC_Sls USE DRYDEP_MOD, ONLY : depName, Ndvzind USE CAMSRFEXCH, ONLY : cam_in_t + USE PPGRID, ONLY : begchunk + USE SPMD_UTILS, ONLY : MasterProc ! ! !INPUT PARAMETERS: ! @@ -270,11 +321,17 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! Integers INTEGER :: I, J, L, M, N, ND INTEGER :: RC + INTEGER :: Source_KindVal ! KIND value of data + INTEGER :: Output_KindVal ! KIND value for output + INTEGER :: Rank ! Size of data INTEGER :: nY, nZ ! Logicals LOGICAL :: Found + LOGICAL :: rootChunk + LOGICAL :: OnLevelEdges ! Is the data defined + ! on level edges (T/F) ! Strings CHARACTER(LEN=255) :: ThisLoc @@ -284,9 +341,16 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! Arrays REAL(r8) :: outTmp(State_Grid%nY,State_Grid%nZ) + ! Floating-point data pointers (8-byte precision) + REAL(f8), POINTER :: Ptr0d_8 ! 0D 8-byte data + REAL(f8), POINTER :: Ptr1d_8(: ) ! 1D 8-byte data + REAL(f8), POINTER :: Ptr2d_8(:,: ) ! 2D 8-byte data + REAL(f8), POINTER :: Ptr3d_8(:,:,:) ! 3D 8-byte data ! Objects - TYPE(Species), POINTER :: SpcInfo + TYPE(Species), POINTER :: SpcInfo + TYPE(MetaRegItem), POINTER :: Current + TYPE(RegItem ), POINTER :: Item !================================================================= ! CESMGC_Diag_Calc begins here! @@ -296,12 +360,17 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & nZ = State_Grid%nZ ! Initialize pointers - SpcInfo => NULL() + SpcInfo => NULL() + Current => NULL() + Item => NULL() ! For error trapping ErrMsg = '' ThisLoc = ' -> at CESMGC_Diag_Calc (in chemistry/pp_geoschem/cesmgc_diag_mod.F90)' + ! Define rootChunk + rootChunk = ( MasterProc.and.(LCHNK==BEGCHUNK) ) + ! Write diagnostic output DO N = 1, pcnst M = map2GC(N) @@ -408,6 +477,77 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) ENDIF + ! =============================================== + ! Now diagnose fields corresponding to State_Met + ! =============================================== + + ! Copied from Headers/registry_mod.F90 + ! Point to the head node of the Registry + Current => State_Met%Registry + + Source_KindVal = KINDVAL_F8 + Output_KindVal = KINDVAL_F8 + + ! As long as the current node isn't NULL + DO WHILE( ASSOCIATED( Current ) ) + + ! Get the REGISTRY ITEM belonging to this node of the Registry + Item => Current%Item + + ! Only print on the root CPU + IF ( ASSOCIATED( Item ) ) THEN + + CALL Registry_Lookup( am_I_Root = Input_Opt%amIRoot, & + Registry = State_Met%Registry, & + RegDict = State_Met%RegDict, & + State = State_Met%State, & + Variable = Item%FullName, & + Source_KindVal = Source_KindVal, & + Output_KindVal = Output_KindVal, & + Rank = Rank, & + OnLevelEdges = OnLevelEdges, & + Ptr0d_8 = Ptr0d_8, & + Ptr1d_8 = Ptr1d_8, & + Ptr2d_8 = Ptr2d_8, & + Ptr3d_8 = Ptr3d_8, & + RC = RC ) + + IF ( Source_KindVal /= KINDVAL_I4 ) THEN + IF ( Rank == 2 ) THEN + outTmp(:,nZ) = REAL(Ptr2d_8(1,:),r8) + CALL Outfld( TRIM( Item%FullName ), outTmp(:,nZ), nY, LCHNK ) + ELSEIF ( Rank == 3 ) THEN + ! For now, treat variables defined on level edges by ignoring top + ! most layer + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(Ptr3d_8(1,J,L),r8) + ENDDO + ENDDO + CALL Outfld( TRIM( Item%FullName ), outTmp, nY, LCHNK ) + ELSE + IF ( rootChunk ) Write(iulog,*) " Item ", TRIM(Item%FullName), & + " is of rank ", Rank, " and will not be diagnosed!" + ENDIF + ENDIF + + ENDIF + + ! Point to next node of the Registry + Current => Current%Next + + ENDDO + + !======================================================================= + ! Cleanup and quit + !======================================================================= + Current => NULL() + Item => NULL() + Ptr0d_8 => NULL() + Ptr1d_8 => NULL() + Ptr2d_8 => NULL() + Ptr3d_8 => NULL() + END SUBROUTINE CESMGC_Diag_Calc !EOC !------------------------------------------------------------------------------ diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/pp_geoschem/chemistry.F90 index b4d9dd970e..9b517dc2d5 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/pp_geoschem/chemistry.F90 @@ -1726,8 +1726,9 @@ subroutine chem_init(phys_state, pbuf2d) CALL tracer_srcs_init() ! Initialize diagnostics interface - CALL CESMGC_Diag_Init( Input_Opt = Input_Opt, & - State_Chm = State_Chm(BEGCHUNK) ) + CALL CESMGC_Diag_Init( Input_Opt = Input_Opt, & + State_Chm = State_Chm(BEGCHUNK), & + State_Met = State_Met(BEGCHUNK) ) ! Initialize emissions interface CALL CESMGC_Emissions_Init @@ -2721,7 +2722,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: 3-D cloud fraction ! Unit : - ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%CLDF (1,J,L) = cldFrc(j,nZ+1-l) + State_Met(LCHNK)%CLDF (1,J,L) = cldFrc(J,nZ+1-L) ! Field : DTRAIN ! Description: Detrainment flux From 2556476c851cbe6f552765cee2fd978b00ba466f Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 29 Oct 2020 17:36:17 -0400 Subject: [PATCH 149/239] Feat: Update GEOS-Chem branch in Externals_CAM.cfg to be `CESM` Signed-off-by: Thibaud Fritz --- Externals_CAM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 2c92a0df6c..adf52e8afd 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -27,9 +27,9 @@ tag = v2.0.3cesm/src required = True [geoschem] -local_path = src/chemistry/pp_geoschem/geoschem_src +local_path = src/chemistry/geoschem/geoschem_src protocol = git -branch = feature/13.0.0+CESM +branch = CESM repo_url = https://github.com/CESM-GC/geos-chem required = True From f4a27228c2ccc4bfe9d4a56cafb1db6be1168fbd Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 29 Oct 2020 18:14:12 -0400 Subject: [PATCH 150/239] Feat: Replace pp_geoschem with geoschem Signed-off-by: Thibaud Fritz --- bld/configure | 2 +- src/chemistry/{pp_geoschem => geoschem}/.exclude | 0 src/chemistry/{pp_geoschem => geoschem}/cesmgc_diag_mod.F90 | 2 +- .../{pp_geoschem => geoschem}/cesmgc_emissions_mod.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/charge_neutrality.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/chem_mods.F90 | 0 .../{pp_geoschem => geoschem}/chem_prod_loss_diags.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/chemistry.F90 | 4 ++-- src/chemistry/{pp_geoschem => geoschem}/clybry_fam.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/epp_ionization.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/gas_wetdep_opts.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/getLandTypes.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/m_spc_id.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/mo_apex.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/mo_chem_utls.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/mo_drydep.F90 | 0 .../{pp_geoschem => geoschem}/mo_gas_phase_chemdr.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/mo_lightning.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/mo_mean_mass.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/mo_neu_wetdep.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/mo_setinv.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/mo_sim_dat.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/mo_tracname.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/rate_diags.F90 | 0 .../{pp_geoschem => geoschem}/short_lived_species.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/tracer_cnst.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/tracer_srcs.F90 | 0 src/chemistry/{pp_geoschem => geoschem}/upper_bc.F90 | 0 28 files changed, 4 insertions(+), 4 deletions(-) rename src/chemistry/{pp_geoschem => geoschem}/.exclude (100%) rename src/chemistry/{pp_geoschem => geoschem}/cesmgc_diag_mod.F90 (99%) rename src/chemistry/{pp_geoschem => geoschem}/cesmgc_emissions_mod.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/charge_neutrality.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/chem_mods.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/chem_prod_loss_diags.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/chemistry.F90 (99%) rename src/chemistry/{pp_geoschem => geoschem}/clybry_fam.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/epp_ionization.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/gas_wetdep_opts.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/getLandTypes.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/m_spc_id.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/mo_apex.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/mo_chem_utls.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/mo_drydep.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/mo_gas_phase_chemdr.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/mo_lightning.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/mo_mean_mass.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/mo_neu_wetdep.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/mo_setinv.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/mo_sim_dat.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/mo_tracname.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/rate_diags.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/short_lived_species.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/tracer_cnst.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/tracer_srcs.F90 (100%) rename src/chemistry/{pp_geoschem => geoschem}/upper_bc.F90 (100%) diff --git a/bld/configure b/bld/configure index 91f27afc67..551d9d5cd3 100755 --- a/bld/configure +++ b/bld/configure @@ -1393,7 +1393,7 @@ my $chem_src_dir = ''; if (!$prog_species) { if ($chem_pkg =~ 'geoschem') { - $chem_src_dir = "$cam_dir/src/chemistry/pp_geoschem"; + $chem_src_dir = "$cam_dir/src/chemistry/geoschem"; } else { $chem_src_dir = "$cam_dir/src/chemistry/pp_$chem_pkg"; } diff --git a/src/chemistry/pp_geoschem/.exclude b/src/chemistry/geoschem/.exclude similarity index 100% rename from src/chemistry/pp_geoschem/.exclude rename to src/chemistry/geoschem/.exclude diff --git a/src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 similarity index 99% rename from src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 rename to src/chemistry/geoschem/cesmgc_diag_mod.F90 index ce2bb7db5b..31c69c72ad 100644 --- a/src/chemistry/pp_geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -366,7 +366,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! For error trapping ErrMsg = '' - ThisLoc = ' -> at CESMGC_Diag_Calc (in chemistry/pp_geoschem/cesmgc_diag_mod.F90)' + ThisLoc = ' -> at CESMGC_Diag_Calc (in chemistry/geoschem/cesmgc_diag_mod.F90)' ! Define rootChunk rootChunk = ( MasterProc.and.(LCHNK==BEGCHUNK) ) diff --git a/src/chemistry/pp_geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 similarity index 100% rename from src/chemistry/pp_geoschem/cesmgc_emissions_mod.F90 rename to src/chemistry/geoschem/cesmgc_emissions_mod.F90 diff --git a/src/chemistry/pp_geoschem/charge_neutrality.F90 b/src/chemistry/geoschem/charge_neutrality.F90 similarity index 100% rename from src/chemistry/pp_geoschem/charge_neutrality.F90 rename to src/chemistry/geoschem/charge_neutrality.F90 diff --git a/src/chemistry/pp_geoschem/chem_mods.F90 b/src/chemistry/geoschem/chem_mods.F90 similarity index 100% rename from src/chemistry/pp_geoschem/chem_mods.F90 rename to src/chemistry/geoschem/chem_mods.F90 diff --git a/src/chemistry/pp_geoschem/chem_prod_loss_diags.F90 b/src/chemistry/geoschem/chem_prod_loss_diags.F90 similarity index 100% rename from src/chemistry/pp_geoschem/chem_prod_loss_diags.F90 rename to src/chemistry/geoschem/chem_prod_loss_diags.F90 diff --git a/src/chemistry/pp_geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 similarity index 99% rename from src/chemistry/pp_geoschem/chemistry.F90 rename to src/chemistry/geoschem/chemistry.F90 index 9b517dc2d5..da257af608 100644 --- a/src/chemistry/pp_geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -234,7 +234,7 @@ subroutine chem_register ! For error trapping ErrMsg = '' - ThisLoc = ' -> at GEOS-Chem (in chemistry/pp_geoschem/chemistry.F90)' + ThisLoc = ' -> at GEOS-Chem (in chemistry/geoschem/chemistry.F90)' ! Initialize pointer ThisSpc => NULL() @@ -1017,7 +1017,7 @@ subroutine chem_init(phys_state, pbuf2d) ! For error trapping ErrMsg = '' - ThisLoc = ' -> at GEOS-Chem (in chemistry/pp_geoschem/chemistry.F90)' + ThisLoc = ' -> at GEOS-Chem (in chemistry/geoschem/chemistry.F90)' ! Initialize pointers SpcInfo => NULL() diff --git a/src/chemistry/pp_geoschem/clybry_fam.F90 b/src/chemistry/geoschem/clybry_fam.F90 similarity index 100% rename from src/chemistry/pp_geoschem/clybry_fam.F90 rename to src/chemistry/geoschem/clybry_fam.F90 diff --git a/src/chemistry/pp_geoschem/epp_ionization.F90 b/src/chemistry/geoschem/epp_ionization.F90 similarity index 100% rename from src/chemistry/pp_geoschem/epp_ionization.F90 rename to src/chemistry/geoschem/epp_ionization.F90 diff --git a/src/chemistry/pp_geoschem/gas_wetdep_opts.F90 b/src/chemistry/geoschem/gas_wetdep_opts.F90 similarity index 100% rename from src/chemistry/pp_geoschem/gas_wetdep_opts.F90 rename to src/chemistry/geoschem/gas_wetdep_opts.F90 diff --git a/src/chemistry/pp_geoschem/getLandTypes.F90 b/src/chemistry/geoschem/getLandTypes.F90 similarity index 100% rename from src/chemistry/pp_geoschem/getLandTypes.F90 rename to src/chemistry/geoschem/getLandTypes.F90 diff --git a/src/chemistry/pp_geoschem/m_spc_id.F90 b/src/chemistry/geoschem/m_spc_id.F90 similarity index 100% rename from src/chemistry/pp_geoschem/m_spc_id.F90 rename to src/chemistry/geoschem/m_spc_id.F90 diff --git a/src/chemistry/pp_geoschem/mo_apex.F90 b/src/chemistry/geoschem/mo_apex.F90 similarity index 100% rename from src/chemistry/pp_geoschem/mo_apex.F90 rename to src/chemistry/geoschem/mo_apex.F90 diff --git a/src/chemistry/pp_geoschem/mo_chem_utls.F90 b/src/chemistry/geoschem/mo_chem_utls.F90 similarity index 100% rename from src/chemistry/pp_geoschem/mo_chem_utls.F90 rename to src/chemistry/geoschem/mo_chem_utls.F90 diff --git a/src/chemistry/pp_geoschem/mo_drydep.F90 b/src/chemistry/geoschem/mo_drydep.F90 similarity index 100% rename from src/chemistry/pp_geoschem/mo_drydep.F90 rename to src/chemistry/geoschem/mo_drydep.F90 diff --git a/src/chemistry/pp_geoschem/mo_gas_phase_chemdr.F90 b/src/chemistry/geoschem/mo_gas_phase_chemdr.F90 similarity index 100% rename from src/chemistry/pp_geoschem/mo_gas_phase_chemdr.F90 rename to src/chemistry/geoschem/mo_gas_phase_chemdr.F90 diff --git a/src/chemistry/pp_geoschem/mo_lightning.F90 b/src/chemistry/geoschem/mo_lightning.F90 similarity index 100% rename from src/chemistry/pp_geoschem/mo_lightning.F90 rename to src/chemistry/geoschem/mo_lightning.F90 diff --git a/src/chemistry/pp_geoschem/mo_mean_mass.F90 b/src/chemistry/geoschem/mo_mean_mass.F90 similarity index 100% rename from src/chemistry/pp_geoschem/mo_mean_mass.F90 rename to src/chemistry/geoschem/mo_mean_mass.F90 diff --git a/src/chemistry/pp_geoschem/mo_neu_wetdep.F90 b/src/chemistry/geoschem/mo_neu_wetdep.F90 similarity index 100% rename from src/chemistry/pp_geoschem/mo_neu_wetdep.F90 rename to src/chemistry/geoschem/mo_neu_wetdep.F90 diff --git a/src/chemistry/pp_geoschem/mo_setinv.F90 b/src/chemistry/geoschem/mo_setinv.F90 similarity index 100% rename from src/chemistry/pp_geoschem/mo_setinv.F90 rename to src/chemistry/geoschem/mo_setinv.F90 diff --git a/src/chemistry/pp_geoschem/mo_sim_dat.F90 b/src/chemistry/geoschem/mo_sim_dat.F90 similarity index 100% rename from src/chemistry/pp_geoschem/mo_sim_dat.F90 rename to src/chemistry/geoschem/mo_sim_dat.F90 diff --git a/src/chemistry/pp_geoschem/mo_tracname.F90 b/src/chemistry/geoschem/mo_tracname.F90 similarity index 100% rename from src/chemistry/pp_geoschem/mo_tracname.F90 rename to src/chemistry/geoschem/mo_tracname.F90 diff --git a/src/chemistry/pp_geoschem/rate_diags.F90 b/src/chemistry/geoschem/rate_diags.F90 similarity index 100% rename from src/chemistry/pp_geoschem/rate_diags.F90 rename to src/chemistry/geoschem/rate_diags.F90 diff --git a/src/chemistry/pp_geoschem/short_lived_species.F90 b/src/chemistry/geoschem/short_lived_species.F90 similarity index 100% rename from src/chemistry/pp_geoschem/short_lived_species.F90 rename to src/chemistry/geoschem/short_lived_species.F90 diff --git a/src/chemistry/pp_geoschem/tracer_cnst.F90 b/src/chemistry/geoschem/tracer_cnst.F90 similarity index 100% rename from src/chemistry/pp_geoschem/tracer_cnst.F90 rename to src/chemistry/geoschem/tracer_cnst.F90 diff --git a/src/chemistry/pp_geoschem/tracer_srcs.F90 b/src/chemistry/geoschem/tracer_srcs.F90 similarity index 100% rename from src/chemistry/pp_geoschem/tracer_srcs.F90 rename to src/chemistry/geoschem/tracer_srcs.F90 diff --git a/src/chemistry/pp_geoschem/upper_bc.F90 b/src/chemistry/geoschem/upper_bc.F90 similarity index 100% rename from src/chemistry/pp_geoschem/upper_bc.F90 rename to src/chemistry/geoschem/upper_bc.F90 From dff479ffcb4333984612d19af46903eafb890be5 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 4 Nov 2020 18:20:09 -0500 Subject: [PATCH 151/239] Feat: Reset MAM-inherited aerosols to 0 before mapping (1) Resetting MAM-inherited aerosols in State_Chm%Species allows these aerosols to not accumulate over time. Otherwise, we would have for instance: BCPI = BCPI + MAM4, which would accumulate overtime if BCPI was not reset (2) Lowered the threshold on QI and QL to 1.0E-10 rather than 1.0E-05 Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index da257af608..0a2c63f7b4 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -63,7 +63,6 @@ module chemistry use chem_mods, only : map2MAM4 use mo_tracname, only : solsym - use constituents, only : cnst_name IMPLICIT NONE PRIVATE @@ -2160,6 +2159,14 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO #if defined( MODAL_AERO_4MODE ) + ! First reset State_Chm%Species to zero for aerosols + DO M = 1, ntot_amode + DO SM = 1, nspec_amode(M) + P = map2MAM4(SM,M) + State_Chm(LCHNK)%Species(1,:,:,P) = 0.0e+00_fp + ENDDO + ENDDO + ! Map and flip aerosols DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) @@ -2746,8 +2753,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Cloud ice/water mixing ratio ! Unit : kg/kg dry air ! Dimensions : nX, nY, nZ - State_Met(LCHNK)%QI (1,J,L) = MAX(1.0e-05_fp, state%q(J,nZ+1-L,ixCldIce)) ! kg ice / kg dry air - State_Met(LCHNK)%QL (1,J,L) = MAX(1.0e-05_fp, state%q(J,nZ+1-L,ixCldLiq)) ! kg water / kg dry air + State_Met(LCHNK)%QI (1,J,L) = MAX(1.0e-10_fp, state%q(J,nZ+1-L,ixCldIce)) ! kg ice / kg dry air + State_Met(LCHNK)%QL (1,J,L) = MAX(1.0e-10_fp, state%q(J,nZ+1-L,ixCldLiq)) ! kg water / kg dry air ! Field : RH ! Description: Relative humidity @@ -3646,7 +3653,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Air_Total = Air_Total + tmpMass #endif - CALL CESMGC_Diag_Calc( Input_Opt = Input_Opt, & + CALL CESMGC_Diag_Calc( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & State_Grid = State_Grid(LCHNK), & From 97c87706ccc8135e2312d77a0db2c767bdb44a94 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 4 Nov 2020 21:02:46 -0500 Subject: [PATCH 152/239] Feat: Add MAM aerosols to cesmgc_diag_mod Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 143 +++++++++++++-------- src/chemistry/geoschem/chemistry.F90 | 1 + 2 files changed, 90 insertions(+), 54 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 31c69c72ad..2ab04fb5f1 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -73,12 +73,16 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only USE GAS_WETDEP_OPTS, ONLY : gas_wetdep_method USE DRYDEP_MOD, ONLY : depName +#if defined( MODAL_AERO_4MODE ) + USE MODAL_AERO_DATA, ONLY : ntot_amode, nspec_amode + USE MODAL_AERO_DATA, ONLY : xname_massptr +#endif ! ! !INPUT PARAMETERS: ! - TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input options - TYPE(ChmState), INTENT(IN) :: State_Chm ! Chemistry State object - TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object + TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input options + TYPE(ChmState), INTENT(IN) :: State_Chm ! Chemistry State object + TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object ! ! !REVISION HISTORY: ! 20 Oct 2020 - T. M. Fritz - Initial version @@ -87,7 +91,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) !BOC ! ! Integer - INTEGER :: I, L, M, N + INTEGER :: I, L, M, N, SM INTEGER :: RC ! Logical @@ -122,16 +126,24 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) DO I = 1, nTracers SpcName = TRIM(tracerNames(I)) CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & - TRIM(tracerLongNames(I))//' concentration') + TRIM(tracerLongNames(I))//' volume mixing ratio') IF (TRIM(SpcName) == 'O3') THEN - CALL Add_Default ( TRIM(SpcName), 1, ' ') + CALL Add_Default ( TRIM(SpcName), 2, ' ') ENDIF ENDDO + DO M = 1, ntot_amode + DO SM = 1, nspec_amode(M) + SpcName = TRIM(xname_massptr(SM,M)) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg', & + TRIM(SpcName//' mass mixing ratio') ) + ENDDO + ENDDO + DO I = 1, nSls SpcName = TRIM(slsNames(I)) CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & - TRIM(slsLongNames(I))//' concentration') + TRIM(slsLongNames(I))//' volume mixing ratio') !CALL Add_Default(TRIM(SpcName), 1, ' ') ENDDO @@ -237,14 +249,17 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Only print on the root CPU IF ( ASSOCIATED( Item ) ) THEN - IF ( TRIM(Item%DimNames) == 'xy' ) THEN - CALL Addfld( TRIM( Item%FullName ), horiz_only, 'A', & - TRIM( Item%Units ), TRIM( Item%Description ) ) - ELSE - CALL Addfld( TRIM( Item%FullName ), (/ 'lev' /), 'A', & - TRIM( Item%Units ), TRIM( Item%Description ) ) + IF (( TRIM(Item%FullName(1:8)) /= 'MET_XLAI' ) .AND. & + ( TRIM(Item%FullName(1:8)) /= 'MET_IUSE' ) .AND. & + ( TRIM(Item%FullName(1:9)) /= 'MET_ILAND' )) THEN + IF ( TRIM(Item%DimNames) == 'xy' ) THEN + CALL Addfld( TRIM( Item%FullName ), horiz_only, 'A', & + TRIM( Item%Units ), TRIM( Item%Description ) ) + ELSE + CALL Addfld( TRIM( Item%FullName ), (/ 'lev' /), 'A', & + TRIM( Item%Units ), TRIM( Item%Description ) ) + ENDIF ENDIF - CALL Add_Default( TRIM(Item%FullName), 4, ' ') ENDIF @@ -273,7 +288,8 @@ END SUBROUTINE CESMGC_Diag_Init ! !INTERFACE: ! SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & - State_Grid, State_Met, cam_in, LCHNK ) + State_Grid, State_Met, cam_in, state, & + LCHNK ) ! ! !USES: ! @@ -299,18 +315,25 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & USE CHEM_MODS, ONLY : map2GC, map2Idx, map2GC_Sls USE DRYDEP_MOD, ONLY : depName, Ndvzind USE CAMSRFEXCH, ONLY : cam_in_t + USE PHYSICS_TYPES, ONLY : physics_state USE PPGRID, ONLY : begchunk USE SPMD_UTILS, ONLY : MasterProc +#if defined( MODAL_AERO_4MODE ) + USE MODAL_AERO_DATA, ONLY : lmassptr_amode + USE MODAL_AERO_DATA, ONLY : ntot_amode, nspec_amode + USE MODAL_AERO_DATA, ONLY : xname_massptr +#endif ! ! !INPUT PARAMETERS: ! - TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input options - TYPE(ChmState), INTENT(IN) :: State_Chm ! Chemistry State object - TYPE(DgnState), INTENT(IN) :: State_Diag ! Diag State object - TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object - TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object - TYPE(cam_in_t), INTENT(IN) :: cam_in ! import state - INTEGER, INTENT(IN) :: LCHNK ! Chunk number + TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input options + TYPE(ChmState), INTENT(IN) :: State_Chm ! Chemistry State object + TYPE(DgnState), INTENT(IN) :: State_Diag ! Diag State object + TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object + TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object + TYPE(cam_in_t), INTENT(IN) :: cam_in ! import state + TYPE(physics_state), INTENT(IN) :: state ! Physics state variables + INTEGER, INTENT(IN) :: LCHNK ! Chunk number ! ! !REVISION HISTORY: ! 20 Oct 2020 - T. M. Fritz - Initial version @@ -319,7 +342,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & !BOC ! ! Integers - INTEGER :: I, J, L, M, N, ND + INTEGER :: I, J, L, M, N, ND, SM INTEGER :: RC INTEGER :: Source_KindVal ! KIND value of data INTEGER :: Output_KindVal ! KIND value for output @@ -387,6 +410,14 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ENDIF ENDDO + DO M = 1, ntot_amode + DO SM = 1, nspec_amode(M) + SpcName = TRIM(xname_massptr(SM,M)) + N = lmassptr_amode(SM,M) + CALL OutFld( TRIM(SpcName), state%q(:nY,:,N), nY, LCHNK ) + ENDDO + ENDDO + DO N = 1, nSls SpcName = slsNames(N) outTmp = 0.0e+0_r8 @@ -497,37 +528,41 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! Only print on the root CPU IF ( ASSOCIATED( Item ) ) THEN - CALL Registry_Lookup( am_I_Root = Input_Opt%amIRoot, & - Registry = State_Met%Registry, & - RegDict = State_Met%RegDict, & - State = State_Met%State, & - Variable = Item%FullName, & - Source_KindVal = Source_KindVal, & - Output_KindVal = Output_KindVal, & - Rank = Rank, & - OnLevelEdges = OnLevelEdges, & - Ptr0d_8 = Ptr0d_8, & - Ptr1d_8 = Ptr1d_8, & - Ptr2d_8 = Ptr2d_8, & - Ptr3d_8 = Ptr3d_8, & - RC = RC ) - - IF ( Source_KindVal /= KINDVAL_I4 ) THEN - IF ( Rank == 2 ) THEN - outTmp(:,nZ) = REAL(Ptr2d_8(1,:),r8) - CALL Outfld( TRIM( Item%FullName ), outTmp(:,nZ), nY, LCHNK ) - ELSEIF ( Rank == 3 ) THEN - ! For now, treat variables defined on level edges by ignoring top - ! most layer - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(Ptr3d_8(1,J,L),r8) - ENDDO - ENDDO - CALL Outfld( TRIM( Item%FullName ), outTmp, nY, LCHNK ) - ELSE - IF ( rootChunk ) Write(iulog,*) " Item ", TRIM(Item%FullName), & - " is of rank ", Rank, " and will not be diagnosed!" + IF (( TRIM(Item%FullName(1:8)) /= 'MET_XLAI' ) .AND. & + ( TRIM(Item%FullName(1:8)) /= 'MET_IUSE' ) .AND. & + ( TRIM(Item%FullName(1:9)) /= 'MET_ILAND' )) THEN + CALL Registry_Lookup( am_I_Root = Input_Opt%amIRoot, & + Registry = State_Met%Registry, & + RegDict = State_Met%RegDict, & + State = State_Met%State, & + Variable = Item%FullName, & + Source_KindVal = Source_KindVal, & + Output_KindVal = Output_KindVal, & + Rank = Rank, & + OnLevelEdges = OnLevelEdges, & + Ptr0d_8 = Ptr0d_8, & + Ptr1d_8 = Ptr1d_8, & + Ptr2d_8 = Ptr2d_8, & + Ptr3d_8 = Ptr3d_8, & + RC = RC ) + + IF ( Source_KindVal /= KINDVAL_I4 ) THEN + IF ( Rank == 2 ) THEN + outTmp(:,nZ) = REAL(Ptr2d_8(1,:),r8) + CALL Outfld( TRIM( Item%FullName ), outTmp(:,nZ), nY, LCHNK ) + ELSEIF ( Rank == 3 ) THEN + ! For now, treat variables defined on level edges by ignoring top + ! most layer + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(Ptr3d_8(1,J,L),r8) + ENDDO + ENDDO + CALL Outfld( TRIM( Item%FullName ), outTmp, nY, LCHNK ) + ELSE + IF ( rootChunk ) Write(iulog,*) " Item ", TRIM(Item%FullName), & + " is of rank ", Rank, " and will not be diagnosed!" + ENDIF ENDIF ENDIF diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 0a2c63f7b4..9a8dded181 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -3659,6 +3659,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Grid = State_Grid(LCHNK), & State_Met = State_Met(LCHNK), & cam_in = cam_in, & + state = state, & LCHNK = LCHNK ) ! Re-flip all the arrays vertically From e47454ef9232debbfb787593479d680973172cf7 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 4 Nov 2020 22:12:01 -0500 Subject: [PATCH 153/239] Feat: Add lightning emissions Signed-off-by: Thibaud Fritz --- .../geoschem/cesmgc_emissions_mod.F90 | 74 +++++++++++++------ src/chemistry/geoschem/chemistry.F90 | 18 ++++- 2 files changed, 67 insertions(+), 25 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 840f997373..29dcbd3a13 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -26,9 +26,11 @@ MODULE CESMGC_Emissions_Mod ! ! !PUBLIC MEMBER FUNCTIONS: ! - PUBLIC :: CESMGC_Emissions_Init - PUBLIC :: CESMGC_Emissions_Calc - PUBLIC :: CESMGC_Emissions_Final + PUBLIC :: CESMGC_Emissions_Init + PUBLIC :: CESMGC_Emissions_Calc + PUBLIC :: CESMGC_Emissions_Final + + INTEGER :: iNO ! ! !REVISION HISTORY: ! 07 Oct 2020 - T. M. Fritz - Initial version @@ -52,6 +54,10 @@ MODULE CESMGC_Emissions_Mod ! SUBROUTINE CESMGC_Emissions_Init ! +! !USES: +! + USE CONSTITUENTS, ONLY : cnst_get_ind +! ! !INPUT PARAMETERS: ! ! @@ -65,6 +71,8 @@ SUBROUTINE CESMGC_Emissions_Init ! CESMGC_Emissions_Init begins here! !================================================================= + ! Get constituent index for NO + CALL cnst_get_ind('NO', iNO, abort=.True.) END SUBROUTINE CESMGC_Emissions_Init !EOC @@ -80,24 +88,26 @@ END SUBROUTINE CESMGC_Emissions_Init !\\ ! !INTERFACE: ! - SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, eflx ) + SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, eflx ) ! ! !USES: ! - USE CONSTITUENTS, ONLY : cnst_name, pcnst - USE CHEM_MODS, ONLY : tracerNames, nTracers, map2GCinv - USE CAM_ABORTUTILS, ONLY : endrun - USE PHYSICS_TYPES, ONLY : physics_state - USE PHYSICS_BUFFER, ONLY : pbuf_get_index, pbuf_get_chunk - USE PHYSICS_BUFFER, ONLY : physics_buffer_desc, pbuf_get_field - USE PPGRID, ONLY : pcols, pver, begchunk + USE State_Met_Mod, ONLY : MetState + USE CONSTITUENTS, ONLY : cnst_name, cnst_get_ind, cnst_mw, pcnst + USE CHEM_MODS, ONLY : tracerNames, nTracers, map2GCinv + USE CAM_ABORTUTILS, ONLY : endrun + USE PHYSICS_TYPES, ONLY : physics_state + USE PHYSICS_BUFFER, ONLY : pbuf_get_index, pbuf_get_chunk + USE PHYSICS_BUFFER, ONLY : physics_buffer_desc, pbuf_get_field + USE PPGRID, ONLY : pcols, pver, begchunk + USE MO_LIGHTNING, ONLY : prod_NO + uSE PHYSCONSTANTS, ONLY : AVO ! ! !INPUT PARAMETERS: ! - ! Physics state variables - TYPE(physics_state), INTENT(IN) :: state - ! Pointer to 2-D pbuf - TYPE(physics_buffer_desc), POINTER, INTENT(IN) :: hco_pbuf2d(:,:) + TYPE(physics_state), INTENT(IN) :: state ! Physics state variables + TYPE(physics_buffer_desc), POINTER, INTENT(IN) :: hco_pbuf2d(:,:) ! Pointer to 2-D pbuf + TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object ! ! !OUTPUT PARAMETERS: ! @@ -113,8 +123,8 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, eflx ) ! !LOCAL VARIABLES: ! ! Integers - INTEGER :: LCHNK, NCOL - INTEGER :: M, N, I + INTEGER :: LCHNK, nY, nZ + INTEGER :: M, N, J, L INTEGER :: RC ! return code INTEGER :: tmpIdx ! pbuf field id @@ -127,6 +137,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, eflx ) ! Real REAL(r8), POINTER :: pbuf_ik(:,:) ! pointer to pbuf data (/pcols,pver/) + REAL(r8) :: SCALFAC ! Multiplying factor ! Strings CHARACTER(LEN=255) :: fldname_ns ! field name HCO_* @@ -141,8 +152,9 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, eflx ) ! LCHNK: which chunk we have on this process LCHNK = state%LCHNK - ! NCOL: number of atmospheric columns on this chunk - NCOL = state%NCOL + ! nY: number of atmospheric columns on this chunk + nY = state%NCOL + nZ = PVER rootChunk = ( MasterProc .AND. ( LCHNK.EQ.BEGCHUNK ) ) ! Initialize emission flux @@ -169,7 +181,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, eflx ) IF ( M <= 0 ) CYCLE - eflx(1:ncol,:,M) = pbuf_ik(1:ncol,:) + eflx(1:nY,:,M) = pbuf_ik(1:nY,:) ! Reset pointers pbuf_ik => NULL() @@ -181,15 +193,33 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, eflx ) MINLOC(eflx(:,:,M)) ENDIF - IF ( rootChunk .and. ( MAXVAL(eflx(1:ncol,:,M)) > 0.0e+0_r8 ) ) THEN + IF ( rootChunk .and. ( MAXVAL(eflx(1:nY,:,M)) > 0.0e+0_r8 ) ) THEN Write(iulog,'(a,a,a,a)') "CESMGC_Emissions_Calc: HEMCO flux ", & TRIM(fldname_ns), " added to ", TRIM(cnst_name(M)) Write(iulog,'(a,a,E16.4)') "CESMGC_Emissions_Calc: Maximum flux ", & - TRIM(fldname_ns), MAXVAL(eflx(1:ncol,:,M)) + TRIM(fldname_ns), MAXVAL(eflx(1:nY,:,M)) ENDIF ENDIF ENDDO + ! Now add lightning emissions computed from lighning_no_prod + M = iNO + + ! prod_NO is in atom N cm^-3 s^-1 <=> molec cm^-3 s^-1 + ! We need to convert this to kg NO/m2/s + ! Multiply by AVO * MWNO * BXHEIGHT * 1.0E+06 + ! = molec/mole * kg NO/mole * m * cm^3/m^3 + ! cnst_mw(M) is in g/mole + SCALFAC = AVO * cnst_mw(M) * 1.0E-03 * 1.0E+06 + DO J = 1, nY + DO L = 1, nZ + eflx(J,L,M) = eflx(J,L,M) & + + prod_NO(J,L,LCHNK) & + * State_Met%BXHEIGHT(1,J,nZ+1-L) & + * SCALFAC + ENDDO + ENDDO + IF ( FIRST ) FIRST = .False. END SUBROUTINE CESMGC_Emissions_Calc diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 9a8dded181..c4444eaf12 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -134,6 +134,9 @@ module chemistry ! Index of 1st constituent INTEGER :: iFirstCnst = -1 + ! lightning + REAL(r8) :: lght_no_prd_factor = 1._r8 + ! Strings CHARACTER(LEN=255) :: ThisLoc CHARACTER(LEN=255) :: ErrMsg @@ -663,6 +666,7 @@ subroutine chem_readnl(nlfile) ! aerosol dry deposition namelist /chem_inparm/ clim_soilw_file, & depvel_file, & + lght_no_prd_factor, & depvel_lnd_file, & ext_frc_specifier, & ext_frc_type, & @@ -838,6 +842,7 @@ subroutine chem_readnl(nlfile) CALL MPIBCAST(clim_soilw_file, LEN(clim_soilw_file), MPICHAR, 0, MPICOM) CALL MPIBCAST(season_wes_file, LEN(season_wes_file), MPICHAR, 0, MPICOM) + CALL MPIBCAST (lght_no_prd_factor, 1, MPIR8, 0, MPICOM) CALL MPIBCAST (depvel_file, LEN(depvel_file), MPICHAR, 0, MPICOM) CALL MPIBCAST (srf_emis_specifier, LEN(srf_emis_specifier(1))*pcnst, MPICHAR, 0, MPICOM) CALL MPIBCAST (srf_emis_type, LEN(srf_emis_type), MPICHAR, 0, MPICOM) @@ -849,8 +854,6 @@ subroutine chem_readnl(nlfile) CALL MPIBCAST (ext_frc_cycle_yr, 1, MPIINT, 0, MPICOM) CALL MPIBCAST (ext_frc_fixed_ymd, 1, MPIINT, 0, MPICOM) CALL MPIBCAST (ext_frc_fixed_tod, 1, MPIINT, 0, MPICOM) - - #endif ! Update "short_lived_species" arrays - will eventually unify these @@ -965,6 +968,7 @@ subroutine chem_init(phys_state, pbuf2d) use mo_mean_mass, only : init_mean_mass use tracer_cnst, only : tracer_cnst_init use tracer_srcs, only : tracer_srcs_init + use mo_lightning, only : lightning_inti use CESMGC_Emissions_Mod, only : CESMGC_Emissions_Init use CESMGC_Diag_Mod, only : CESMGC_Diag_Init @@ -1724,6 +1728,11 @@ subroutine chem_init(phys_state, pbuf2d) CALL tracer_cnst_init() CALL tracer_srcs_init() + !----------------------------------------------------------------------- + ! ... initialize the lightning module + !----------------------------------------------------------------------- + call lightning_inti(lght_no_prd_factor) + ! Initialize diagnostics interface CALL CESMGC_Diag_Init( Input_Opt = Input_Opt, & State_Chm = State_Chm(BEGCHUNK), & @@ -3314,7 +3323,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF - CALL CESMGC_Emissions_Calc( state, hco_pbuf2d, eflx ) + CALL CESMGC_Emissions_Calc( state = state, & + hco_pbuf2d = hco_pbuf2d, & + State_Met = State_Met(LCHNK), & + eflx = eflx ) ! Add near-surface emissions to surface flux BC cam_in%cflx(1:nY,:) = cam_in%cflx(1:nY,:) + eflx(1:nY,nZ,:) From 8ff6a2c283c5a0a8e8ef23a888df5f57bb6ba760 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 4 Nov 2020 22:44:26 -0500 Subject: [PATCH 154/239] Feat: Add MEGAN emissions Signed-off-by: Thibaud Fritz --- bld/build-namelist | 4 +- src/chemistry/geoschem/chemistry.F90 | 77 ++++++++++++++++++++++++---- 2 files changed, 68 insertions(+), 13 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 1beb49edb0..8e03f6f28f 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -2413,7 +2413,7 @@ if ($chem =~ /_mam4/ and $phys =~ /cam6/) { 'num_a2_cv_ext_file' => 'num_a2', ); - # air craft emissions + # aircraft emissions if ($chem !~ /trop_mam/ and $chem !~ /waccm_sc/) { %species = (%species, 'bc_a4_ar_ext_file' => 'bc_a4', @@ -2468,7 +2468,7 @@ if ($chem =~ /_mam4/ and $phys =~ /cam6/) { } # MEGAN emissions - if ($chem =~ /trop_strat/ or $chem =~ /_tsmlt/) { + if ($chem =~ /trop_strat/ or $chem =~ /_tsmlt/ or $chem =~ /geoschem/) { my $val = "'ISOP = isoprene'," . "'MTERP = pinene_a + carene_3 + thujene_a + 2met_styrene + cymene_p + cymene_o + terpinolene + bornene " . "+ fenchene_a + ocimene_al + pinene_b + sabinene + camphene + limonene + phellandrene_a + terpinene_g " diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index c4444eaf12..9ec2a19953 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -3,13 +3,14 @@ !================================================================================================ module chemistry - use shr_kind_mod, only: r8 => shr_kind_r8, shr_kind_cl - use physics_types, only: physics_state, physics_ptend, physics_ptend_init - use physics_buffer, only: physics_buffer_desc - use ppgrid, only: begchunk, endchunk, pcols - use ppgrid, only: pver, pverp - use constituents, only: pcnst, cnst_add, cnst_get_ind - use shr_const_mod, only: molw_dryair=>SHR_CONST_MWDAIR + use shr_kind_mod, only : r8 => shr_kind_r8, shr_kind_cl + use physics_types, only : physics_state, physics_ptend, physics_ptend_init + use physics_buffer, only : physics_buffer_desc + use ppgrid, only : begchunk, endchunk, pcols + use ppgrid, only : pver, pverp + use constituents, only : pcnst, cnst_add, cnst_get_ind + use shr_const_mod, only : molw_dryair=>SHR_CONST_MWDAIR + use shr_megan_mod, only : shr_megan_mechcomps, shr_megan_mechcomps_n use seq_drydep_mod, only : nddvels => n_drydep, drydep_list use spmd_utils, only : MasterProc, myCPU=>Iam, nCPUs=>npes use cam_logfile, only : iulog @@ -163,6 +164,11 @@ module chemistry integer :: ext_frc_fixed_ymd = 0 integer :: ext_frc_fixed_tod = 0 + ! for MEGAN emissions + integer, allocatable :: megan_indices_map(:) + real(r8),allocatable :: megan_wght_factors(:) + + !================================================================================================ contains !================================================================================================ @@ -919,11 +925,14 @@ subroutine chem_init(phys_state, pbuf2d) !----------------------------------------------------------------------- use physics_buffer, only : physics_buffer_desc, pbuf_get_index use chem_mods, only : map2GC_dryDep, drySpc_ndx + use cam_history, only : addfld, add_default, horiz_only #ifdef SPMD use mpishorthand #endif use cam_abortutils, only : endrun + use infnan, only : nan, assignment(=) + use mo_chem_utls, only : get_spc_ndx use Phys_Grid, only : get_Area_All_p use hycoef, only : ps0, hyai, hybi, hyam @@ -988,7 +997,7 @@ subroutine chem_init(phys_state, pbuf2d) INTEGER :: nX, nY, nZ INTEGER :: iX, jY INTEGER :: nStrat - INTEGER :: I, J, L, N, M + INTEGER :: I, J, L, N, M, II INTEGER :: RC INTEGER :: nLinoz @@ -1717,7 +1726,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Get cloud water indices CALL cnst_get_ind( 'CLDLIQ', ixCldLiq) CALL cnst_get_ind( 'CLDICE', ixCldIce) - CALL cnst_get_ind( 'NUMLIQ', ixNDrop, abort=.false. ) + CALL cnst_get_ind( 'NUMLIQ', ixNDrop, abort=.False. ) CALL init_mean_mass() CALL setinv_inti() @@ -1731,7 +1740,35 @@ subroutine chem_init(phys_state, pbuf2d) !----------------------------------------------------------------------- ! ... initialize the lightning module !----------------------------------------------------------------------- - call lightning_inti(lght_no_prd_factor) + CALL lightning_inti(lght_no_prd_factor) + + ! MEGAN emissions initialize + IF ( shr_megan_mechcomps_n > 0 ) THEN + + ALLOCATE( megan_indices_map(shr_megan_mechcomps_n), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating megan_indices_map') + ALLOCATE( megan_wght_factors(shr_megan_mechcomps_n), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating megan_wght_factors') + megan_wght_factors(:) = NaN + + DO N = 1, shr_megan_mechcomps_n + CALL cnst_get_ind (shr_megan_mechcomps(N)%name, megan_indices_map(N), abort=.False.) + II = get_spc_ndx(shr_megan_mechcomps(N)%name) + IF ( II > 0 ) THEN + megan_wght_factors(N) = adv_mass(II)*1.e-3_r8 ! kg/moles (to convert moles/m2/sec to kg/m2/sec) + ELSE + CALL ENDRUN( 'chem_init: MEGAN compound not in chemistry mechanism : ' & + //TRIM(shr_megan_mechcomps(N)%name)) + ENDIF + + ! MEGAN history fields + CALL addfld( 'MEG_'//TRIM(shr_megan_mechcomps(N)%name), horiz_only, 'A', 'kg/m2/sec', & + TRIM(shr_megan_mechcomps(N)%name)//' MEGAN emissions flux') + !if (history_chemistry) then + CALL add_default('MEG_'//trim(shr_megan_mechcomps(N)%name), 1, ' ') + !endif + ENDDO + ENDIF ! Initialize diagnostics interface CALL CESMGC_Diag_Init( Input_Opt = Input_Opt, & @@ -1853,6 +1890,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Tropopause, only : Tropopause_findChemTrop, Tropopause_Find use HCO_Utilities_GC_Mod ! Utility routines for GC-HEMCO interface + ! Data from CLM + use cam_cpl_indices, only : index_x2a_Fall_flxvoc + ! For calculating SZA use Orbit, only : zenith use Time_Manager, only : Get_Curr_Calday, Get_Curr_Date @@ -1940,6 +1980,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! For emissions REAL(r8) :: eflx(pcols,pver,pcnst) ! 3-D emissions in kg/m2/s + ! For MEGAN emissions + REAL(r8) :: megflx(pcols) ! For GEOS-Chem diagnostics REAL(r8) :: mmr1(state%NCOL,PVER,gas_pcnst) @@ -3332,6 +3374,20 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) cam_in%cflx(1:nY,:) = cam_in%cflx(1:nY,:) + eflx(1:nY,nZ,:) eflx(1:nY,nZ,:) = 0.0e+00_r8 + ! MEGAN emissions ... + IF ( index_x2a_Fall_flxvoc > 0 .AND. shr_megan_mechcomps_n > 0 ) THEN + ! set MEGAN fluxes + DO N = 1, shr_megan_mechcomps_n + DO I = 1, nY + megflx(I) = -cam_in%meganflx(I,N) * megan_wght_factors(N) + cam_in%cflx(I,megan_indices_map(N)) = cam_in%cflx(I,megan_indices_map(N)) + megflx(I) + enddO + ! output MEGAN emis fluxes to history + CALL Outfld('MEG_'//TRIM(shr_megan_mechcomps(N)%name), megflx(:nY), nY, LCHNK) + ENDDO + ENDIF + + ! Add dry deposition flux (stored as SurfaceFlux = -dflx) DO ND = 1, State_Chm(BEGCHUNK)%nDryDep ! Get the species ID from the drydep ID N = State_Chm(BEGCHUNK)%Map_DryDep(ND) @@ -3340,7 +3396,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2GCinv(N) IF ( M <= 0 ) CYCLE - ! Add dry deposition flux (stored as SurfaceFlux = -dflx) cam_in%cflx(1:nY,M) = cam_in%cflx(1:nY,M) & + State_Chm(LCHNK)%SurfaceFlux(1,1:nY,N) From 3876974786970bce74250ce79233bcdb919cdd1f Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 5 Nov 2020 17:31:32 -0500 Subject: [PATCH 155/239] Feat: Symbolic link to mozart/mo_lightning Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/mo_lightning.F90 | 183 +----------------------- 1 file changed, 1 insertion(+), 182 deletions(-) mode change 100644 => 120000 src/chemistry/geoschem/mo_lightning.F90 diff --git a/src/chemistry/geoschem/mo_lightning.F90 b/src/chemistry/geoschem/mo_lightning.F90 deleted file mode 100644 index 206c1e7fc6..0000000000 --- a/src/chemistry/geoschem/mo_lightning.F90 +++ /dev/null @@ -1,182 +0,0 @@ -module mo_lightning - !---------------------------------------------------------------------- - ! ... the lightning module - !---------------------------------------------------------------------- - - use shr_kind_mod, only : r8 => shr_kind_r8 - use ppgrid, only : begchunk, endchunk, pcols, pver - use phys_grid, only : ngcols_p - use cam_abortutils, only : endrun - use cam_logfile, only : iulog - use spmd_utils, only : masterproc, mpicom - - implicit none - - private - public :: lightning_inti - public :: lightning_no_prod - public :: prod_no - - save - - real(r8) :: csrf - real(r8) :: factor = 0.1_r8 ! user-controlled scaling factor to achieve arbitrary no prod. - real(r8) :: geo_factor ! grid cell area factor - real(r8) :: vdist(16,3) ! vertical distribution of lightning - real(r8), allocatable :: prod_no(:,:,:) - real(r8), allocatable :: glob_prod_no_col(:,:) - real(r8), allocatable :: flash_freq(:,:) - integer :: no_ndx,xno_ndx - logical :: has_no_lightning_prod = .false. - -contains - - subroutine lightning_inti( lght_no_prd_factor ) - !---------------------------------------------------------------------- - ! ... initialize the lightning module - !---------------------------------------------------------------------- - use mo_constants, only : pi - use ioFileMod, only : getfil - !use mo_chem_utls, only : get_spc_ndx - - use cam_history, only : addfld, add_default, horiz_only - use dyn_grid, only : get_dyn_grid_parm - use phys_control, only : phys_getopts - - implicit none - - !---------------------------------------------------------------------- - ! ... dummy args - !---------------------------------------------------------------------- - real(r8), intent(in) :: lght_no_prd_factor ! lightning no production factor - - !!---------------------------------------------------------------------- - !! ... local variables - !!---------------------------------------------------------------------- - !integer :: astat - !integer :: ncid - !integer :: dimid - !integer :: vid - !integer :: gndx - !integer :: jl, ju - !integer :: nlat, nlon - !integer :: plon, plat - !real(r8), allocatable :: lats(:) - !real(r8), allocatable :: lons(:) - !real(r8), allocatable :: landmask(:,:) - !character(len=256) :: locfn - !logical :: history_cesm_forcing - - !call phys_getopts( history_cesm_forcing_out = history_cesm_forcing ) - - !no_ndx = get_spc_ndx('NO') - !xno_ndx = get_spc_ndx('XNO') - - !has_no_lightning_prod = no_ndx>0 .or. xno_ndx>0 - !if (.not.has_no_lightning_prod) return - - ! - !if( lght_no_prd_factor /= 1._r8 ) then - ! factor = factor*lght_no_prd_factor - !end if - - - !if (masterproc) write(iulog,*) 'lght_inti: lightning no production scaling factor = ',factor - - !!---------------------------------------------------------------------- - !! ... vdist(kk,itype) = % of lightning nox between (kk-1) and (kk) - !! km for profile itype - !!---------------------------------------------------------------------- - !vdist(:,1) = (/ 3.0_r8, 3.0_r8, 3.0_r8, 3.0_r8, 3.4_r8, 3.5_r8, 3.6_r8, 4.0_r8, & ! midlat cont - ! 5.0_r8, 7.0_r8, 9.0_r8, 14.0_r8, 16.0_r8, 14.0_r8, 8.0_r8, 0.5_r8 /) - !vdist(:,2) = (/ 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 6.1_r8, & ! trop marine - ! 17.0_r8, 15.4_r8, 14.5_r8, 13.0_r8, 12.5_r8, 2.8_r8, 0.9_r8, 0.3_r8 /) - !vdist(:,3) = (/ 2.0_r8, 2.0_r8, 2.0_r8, 1.5_r8, 1.5_r8, 1.5_r8, 3.0_r8, 5.8_r8, & ! trop cont - ! 7.6_r8, 9.6_r8, 11.0_r8, 14.0_r8, 14.0_r8, 14.0_r8, 8.2_r8, 2.3_r8 /) - - !allocate( prod_no(pcols,pver,begchunk:endchunk),stat=astat ) - !if( astat /= 0 ) then - ! write(iulog,*) 'lght_inti: failed to allocate prod_no; error = ',astat - ! call endrun - !end if - !allocate( flash_freq(pcols,begchunk:endchunk),stat=astat ) - !if( astat /= 0 ) then - ! write(iulog,*) 'lght_inti: failed to allocate flash_freq; error = ',astat - ! call endrun - !end if - !allocate( glob_prod_no_col(pcols,begchunk:endchunk),stat=astat ) - !if( astat /= 0 ) then - ! write(iulog,*) 'lght_inti: failed to allocate glob_prod_no_col; error = ',astat - ! call endrun - !end if - !prod_no(:,:,:) = 0._r8 - !flash_freq(:,:) = 0._r8 - !geo_factor = ngcols_p/(4._r8*pi) - - - !call addfld( 'LNO_COL_PROD', horiz_only, 'I', 'TG N/YR', 'lighting column NO source' ) - !call addfld( 'LNO_PROD', (/ 'lev' /), 'I', '/cm3/s', 'lighting insitu NO source' ) - !call addfld( 'FLASHFRQ', horiz_only, 'I', '1/MIN', 'lighting flash rate' ) ! flash frequency in grid box per minute (PPP) - !call addfld( 'FLASHENGY', horiz_only, 'I', ' ', 'lighting flash rate' ) ! flash frequency in grid box per minute (PPP) - !call addfld( 'CLDHGT', horiz_only, 'I', 'KM', 'cloud top height' ) ! cloud top height - !call addfld( 'DCHGZONE', horiz_only, 'I', 'KM', 'depth of discharge zone' ) ! depth of discharge zone - !call addfld( 'CGIC', horiz_only, 'I', 'RATIO', 'ratio of cloud-ground/intracloud discharges' ) ! ratio of cloud-ground/intracloud discharges - - !if ( history_cesm_forcing ) then - ! call add_default('LNO_COL_PROD',1,' ') - !endif - - end subroutine lightning_inti - - subroutine lightning_no_prod( state, pbuf2d, cam_in ) - !---------------------------------------------------------------------- - ! ... set no production from lightning - !---------------------------------------------------------------------- - use physics_types, only : physics_state - - use physics_buffer, only : pbuf_get_index, physics_buffer_desc, pbuf_get_field, pbuf_get_chunk - use physconst, only : rga - use phys_grid, only : get_rlat_all_p, get_lat_all_p, get_lon_all_p, get_wght_all_p - use cam_history, only : outfld - use camsrfexch, only : cam_in_t - use shr_reprosum_mod, only : shr_reprosum_calc - !use mo_constants, only : rearth, d2r - implicit none - - !---------------------------------------------------------------------- - ! ... dummy args - !---------------------------------------------------------------------- - type(physics_state), intent(in) :: state(begchunk:endchunk) ! physics state - - type(physics_buffer_desc), pointer :: pbuf2d(:,:) - type(cam_in_t), intent(in) :: cam_in(begchunk:endchunk) ! physics state - - !---------------------------------------------------------------------- - ! ... local variables - !---------------------------------------------------------------------- - - !---------------------------------------------------------------------- - ! ... parameters to determine cg/ic ratio [price and rind, 1993] - !---------------------------------------------------------------------- - - if (.not.has_no_lightning_prod) return - - ! < === INSERT CALCULATION HERE === > - - !!-------------------------------------------------------------------------------- - !! ... output lightning no production to history file - !!-------------------------------------------------------------------------------- - !do c = begchunk,endchunk - ! lchnk = state(c)%lchnk - ! call outfld( 'LNO_PROD', prod_no(:,:,c), pcols, lchnk ) - ! call outfld( 'LNO_COL_PROD', glob_prod_no_col(:,c), pcols, lchnk ) - ! call outfld( 'FLASHFRQ', flash_freq(:,c), pcols, lchnk ) - ! call outfld( 'FLASHENGY', flash_energy(:,c), pcols, lchnk ) - ! call outfld( 'CLDHGT', cldhgt(:,c), pcols, lchnk ) - ! call outfld( 'DCHGZONE', dchgzone(:,c), pcols, lchnk ) - ! call outfld( 'CGIC', cgic(:,c), pcols, lchnk ) - !enddo - - end subroutine lightning_no_prod - -end module mo_lightning diff --git a/src/chemistry/geoschem/mo_lightning.F90 b/src/chemistry/geoschem/mo_lightning.F90 new file mode 120000 index 0000000000..8b731ae98f --- /dev/null +++ b/src/chemistry/geoschem/mo_lightning.F90 @@ -0,0 +1 @@ +../mozart/mo_lightning.F90 \ No newline at end of file From b03e5058af9d6e451f74eacbaac0143428124426 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 5 Nov 2020 17:39:53 -0500 Subject: [PATCH 156/239] Feat: Add symbolic link to MOZART files, rather than copy Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/fire_emissions.F90 | 1 + src/chemistry/geoschem/mo_mean_mass.F90 | 95 +----- src/chemistry/geoschem/mo_setinv.F90 | 154 +-------- src/chemistry/geoschem/tracer_cnst.F90 | 372 +--------------------- src/chemistry/geoschem/tracer_srcs.F90 | 297 +---------------- 5 files changed, 5 insertions(+), 914 deletions(-) create mode 120000 src/chemistry/geoschem/fire_emissions.F90 mode change 100644 => 120000 src/chemistry/geoschem/mo_mean_mass.F90 mode change 100644 => 120000 src/chemistry/geoschem/mo_setinv.F90 mode change 100644 => 120000 src/chemistry/geoschem/tracer_cnst.F90 mode change 100644 => 120000 src/chemistry/geoschem/tracer_srcs.F90 diff --git a/src/chemistry/geoschem/fire_emissions.F90 b/src/chemistry/geoschem/fire_emissions.F90 new file mode 120000 index 0000000000..7b9f50ff22 --- /dev/null +++ b/src/chemistry/geoschem/fire_emissions.F90 @@ -0,0 +1 @@ +../mozart/fire_emissions.F90 \ No newline at end of file diff --git a/src/chemistry/geoschem/mo_mean_mass.F90 b/src/chemistry/geoschem/mo_mean_mass.F90 deleted file mode 100644 index 8bf030ce02..0000000000 --- a/src/chemistry/geoschem/mo_mean_mass.F90 +++ /dev/null @@ -1,94 +0,0 @@ - -module mo_mean_mass - - implicit none - - private - public :: set_mean_mass, init_mean_mass - - integer :: id_o2, id_o, id_h, id_n - -contains - - subroutine init_mean_mass - use mo_chem_utls, only : get_spc_ndx - - implicit none - - id_o2 = get_spc_ndx('O2') - id_o = get_spc_ndx('O') - id_h = get_spc_ndx('H') - id_n = get_spc_ndx('N') - - endsubroutine init_mean_mass - - subroutine set_mean_mass( ncol, mmr, mbar ) - !----------------------------------------------------------------- - ! ... Set the invariant densities (molecules/cm**3) - !----------------------------------------------------------------- - - use shr_kind_mod, only : r8 => shr_kind_r8 - use ppgrid, only : pver, pcols - use chem_mods, only : adv_mass, gas_pcnst - use physconst, only : mwdry ! molecular weight of dry air - use cam_abortutils, only : endrun - use phys_control, only : waccmx_is !WACCM-X runtime switch - - implicit none - - !----------------------------------------------------------------- - ! ... Dummy arguments - !----------------------------------------------------------------- - integer, intent(in) :: ncol - real(r8), intent(in) :: mmr(:,:,:) ! species concentrations (kg/kg) - real(r8), intent(out) :: mbar(:,:) ! mean mass (g/mole) - - !----------------------------------------------------------------- - ! ... Local variables - !----------------------------------------------------------------- - integer :: k - real(r8) :: xn2(ncol) ! n2 mmr - real(r8) :: fn2(ncol) ! n2 vmr - real(r8) :: fo(ncol) ! o vmr - real(r8) :: fo2(ncol) ! o2 vmr - real(r8) :: fh(ncol) ! h vmr - real(r8) :: ftot(ncol) ! total vmr - real(r8) :: mean_mass(ncol) ! wrk variable - - logical :: fixed_mbar ! Fixed mean mass flag - - !------------------------------------------- - ! Mean mass not fixed for WACCM-X - !------------------------------------------- - if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then - fixed_mbar = .false. - else - fixed_mbar = .true. - endif - - if( fixed_mbar ) then - !----------------------------------------------------------------- - ! ... use CAM meam molecular weight - !----------------------------------------------------------------- - mbar(:ncol,:pver) = mwdry - else - if ( id_o2 > 0 .and. id_o > 0 .and. id_h > 0 .and. id_n > 0 ) then - !----------------------------------------------------------------- - ! ... set the mean mass - !----------------------------------------------------------------- - do k = 1,pver - xn2(:) = 1._r8 - (mmr(:ncol,k,id_o2) + mmr(:ncol,k,id_o) + mmr(:ncol,k,id_h)) - fn2(:) = .5_r8 * xn2(:) / adv_mass(id_n) - fo2(:) = mmr(:ncol,k,id_o2) / adv_mass(id_o2) - fo(:) = mmr(:ncol,k,id_o) / adv_mass(id_o) - fh(:) = mmr(:ncol,k,id_h) / adv_mass(id_h) - mbar(:ncol,k) = 1._r8 / (fn2(:) + fo2(:) + fo(:) + fh(:)) - end do - else - call endrun('set_mean_mass: not able to compute mean mass') - endif - endif - - end subroutine set_mean_mass - -end module mo_mean_mass diff --git a/src/chemistry/geoschem/mo_mean_mass.F90 b/src/chemistry/geoschem/mo_mean_mass.F90 new file mode 120000 index 0000000000..e4231e65f7 --- /dev/null +++ b/src/chemistry/geoschem/mo_mean_mass.F90 @@ -0,0 +1 @@ +../mozart/mo_mean_mass.F90 \ No newline at end of file diff --git a/src/chemistry/geoschem/mo_setinv.F90 b/src/chemistry/geoschem/mo_setinv.F90 deleted file mode 100644 index c36b70b8c6..0000000000 --- a/src/chemistry/geoschem/mo_setinv.F90 +++ /dev/null @@ -1,153 +0,0 @@ - -module mo_setinv - - use shr_kind_mod, only : r8 => shr_kind_r8 - use cam_logfile, only : iulog - use chem_mods, only : inv_lst, nfs, gas_pcnst - use cam_history, only : addfld, outfld - use ppgrid, only : pcols, pver - - implicit none - - save - - integer :: id_o, id_o2, id_h - integer :: m_ndx, o2_ndx, n2_ndx, h2o_ndx, o3_ndx - logical :: has_o2, has_n2, has_h2o, has_o3, has_var_o2 - - private - public :: setinv_inti, setinv, has_h2o, o2_ndx, h2o_ndx, n2_ndx - -contains - - subroutine setinv_inti - !----------------------------------------------------------------- - ! ... initialize the module - !----------------------------------------------------------------- - - use mo_chem_utls, only : get_inv_ndx, get_spc_ndx - use spmd_utils, only : masterproc - - implicit none - - integer :: i - - m_ndx = get_inv_ndx( 'M' ) - n2_ndx = get_inv_ndx( 'N2' ) - o2_ndx = get_inv_ndx( 'O2' ) - h2o_ndx = get_inv_ndx( 'H2O' ) - o3_ndx = get_inv_ndx( 'O3' ) - - id_o = get_spc_ndx('O') - id_o2 = get_spc_ndx('O2') - id_h = get_spc_ndx('H') - - has_var_o2 = id_o2>0 .and. id_o>0 .and. id_h>0 - - has_n2 = n2_ndx > 0 - has_o2 = o2_ndx > 0 - has_h2o = h2o_ndx > 0 - has_o3 = o3_ndx > 0 - - if (masterproc) write(iulog,*) 'setinv_inti: m,n2,o2,h2o ndx = ',m_ndx,n2_ndx,o2_ndx,h2o_ndx - - do i = 1,nfs - call addfld( trim(inv_lst(i))//'_dens', (/ 'lev' /),'A', 'molecules/cm3', 'invariant density' ) - !call addfld( trim(inv_lst(i))//'_mmr', (/ 'lev' /),'A', 'kg/kg', 'invariant density' ) - call addfld( trim(inv_lst(i))//'_vmr', (/ 'lev' /),'A', 'mole/mole', 'invariant density' ) - enddo - - end subroutine setinv_inti - - subroutine setinv( invariants, tfld, h2ovmr, vmr, pmid, ncol, lchnk, pbuf ) - !----------------------------------------------------------------- - ! ... set the invariant densities (molecules/cm**3) - !----------------------------------------------------------------- - - use mo_constants, only : boltz_cgs - use tracer_cnst, only : num_tracer_cnst, tracer_cnst_flds, get_cnst_data - use mo_chem_utls, only : get_inv_ndx - use physics_buffer, only : physics_buffer_desc - - implicit none - - !----------------------------------------------------------------- - ! ... dummy arguments - !----------------------------------------------------------------- - integer, intent(in) :: ncol ! chunk column count - real(r8), intent(in) :: tfld(pcols,pver) ! temperature - real(r8), intent(in) :: h2ovmr(ncol,pver) ! water vapor vmr - real(r8), intent(in) :: pmid(pcols,pver) ! pressure - integer, intent(in) :: lchnk ! chunk number - real(r8), intent(in) :: vmr(ncol,pver,gas_pcnst) ! vmr - real(r8), intent(out) :: invariants(ncol,pver,nfs) ! invariant array - type(physics_buffer_desc), pointer :: pbuf(:) - - - real(r8) :: cnst_offline( ncol, pver ) - - !----------------------------------------------------------------- - ! .. local variables - !----------------------------------------------------------------- - integer :: k, i, ndx - real(r8), parameter :: Pa_xfac = 10._r8 ! Pascals to dyne/cm^2 - real(r8) :: sum1(ncol) - real(r8) :: tmp_out(ncol,pver) - - !----------------------------------------------------------------- - ! note: invariants are in cgs density units. - ! the pmid array is in pascals and must be - ! mutiplied by 10. to yield dynes/cm**2. - !----------------------------------------------------------------- - invariants(:,:,:) = 0._r8 - !----------------------------------------------------------------- - ! ... set m, n2, o2, and h2o densities - !----------------------------------------------------------------- - do k = 1,pver - invariants(:ncol,k,m_ndx) = Pa_xfac * pmid(:ncol,k) / (boltz_cgs*tfld(:ncol,k)) - end do - - if( has_n2 ) then - if ( has_var_o2 ) then - do k = 1,pver - sum1(:ncol) = (vmr(:ncol,k,id_o) + vmr(:ncol,k,id_o2) + vmr(:ncol,k,id_h)) - invariants(:ncol,k,n2_ndx) = (1._r8 - sum1(:)) * invariants(:ncol,k,m_ndx) - end do - else - do k = 1,pver - invariants(:ncol,k,n2_ndx) = .79_r8 * invariants(:ncol,k,m_ndx) - end do - endif - end if - if( has_o2 ) then - do k = 1,pver - invariants(:ncol,k,o2_ndx) = .21_r8 * invariants(:ncol,k,m_ndx) - end do - end if - if( has_h2o ) then - do k = 1,pver - invariants(:ncol,k,h2o_ndx) = h2ovmr(:ncol,k) * invariants(:ncol,k,m_ndx) - end do - end if - - do i = 1,num_tracer_cnst - - call get_cnst_data( tracer_cnst_flds(i), cnst_offline, ncol, lchnk, pbuf ) - ndx = get_inv_ndx( tracer_cnst_flds(i) ) - - do k = 1,pver - invariants(:ncol,k,ndx) = cnst_offline(:ncol,k)*invariants(:ncol,k,m_ndx) - enddo - - enddo - - do i = 1,nfs - tmp_out(:ncol,:) = invariants(:ncol,:,i) - call outfld( trim(inv_lst(i))//'_dens', tmp_out(:ncol,:), ncol, lchnk ) - tmp_out(:ncol,:) = invariants(:ncol,:,i) / invariants(:ncol,:,m_ndx) - call outfld( trim(inv_lst(i))//'_vmr', tmp_out(:ncol,:), ncol, lchnk ) - enddo - - end subroutine setinv - -end module mo_setinv diff --git a/src/chemistry/geoschem/mo_setinv.F90 b/src/chemistry/geoschem/mo_setinv.F90 new file mode 120000 index 0000000000..eeca85151d --- /dev/null +++ b/src/chemistry/geoschem/mo_setinv.F90 @@ -0,0 +1 @@ +../mozart/mo_setinv.F90 \ No newline at end of file diff --git a/src/chemistry/geoschem/tracer_cnst.F90 b/src/chemistry/geoschem/tracer_cnst.F90 deleted file mode 100644 index 803e3e1061..0000000000 --- a/src/chemistry/geoschem/tracer_cnst.F90 +++ /dev/null @@ -1,371 +0,0 @@ -!------------------------------------------------------------------- -! manages reading and interpolation of offline tracer fields -! Created by: Francis Vitt -- 2 May 2006 -!------------------------------------------------------------------- -module tracer_cnst - - use shr_kind_mod, only : r8 => shr_kind_r8 - use cam_abortutils, only : endrun - use spmd_utils, only : masterproc - use tracer_data, only : trfld,trfile,MAXTRCRS - use cam_logfile, only : iulog - - implicit none - - private ! all unless made public - save - - public :: tracer_cnst_init - public :: num_tracer_cnst - public :: tracer_cnst_flds - public :: tracer_cnst_adv - public :: get_cnst_data - public :: get_cnst_data_ptr - public :: write_tracer_cnst_restart - public :: read_tracer_cnst_restart - public :: tracer_cnst_defaultopts - public :: tracer_cnst_setopts - public :: init_tracer_cnst_restart - - type(trfld), pointer :: fields(:) => null() - type(trfile) :: file - - integer :: num_tracer_cnst - character(len=16), pointer :: tracer_cnst_flds(:) => null() - real(r8), allocatable, target, dimension(:,:,:,:) :: data_q ! constituent mass mixing ratios - - character(len=64) :: specifier(MAXTRCRS) = '' - character(len=256) :: filename = 'tracer_cnst_file' - character(len=256) :: filelist = '' - character(len=256) :: datapath = '' - character(len=32) :: data_type = 'SERIAL' - logical :: rmv_file = .false. - integer :: cycle_yr = 0 - integer :: fixed_ymd = 0 - integer :: fixed_tod = 0 - -contains - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine tracer_cnst_init() - - use mo_chem_utls,only : get_inv_ndx - use tracer_data, only : trcdata_init - use cam_history, only : addfld - use error_messages, only: handle_err - use ppgrid, only: pcols, pver, begchunk, endchunk - use physics_buffer, only : physics_buffer_desc - - implicit none - - integer :: i ,ndx, istat - - allocate(file%in_pbuf(size(specifier))) - file%in_pbuf(:) = .false. - call trcdata_init( specifier, filename, filelist, datapath, fields, file, & - rmv_file, cycle_yr, fixed_ymd, fixed_tod, data_type) - - num_tracer_cnst = 0 - if (associated(fields)) num_tracer_cnst = size( fields ) - - if( num_tracer_cnst < 1 ) then - if ( masterproc ) then - write(iulog,*) 'There are no offline invariant species' - write(iulog,*) ' ' - endif - return - end if - - allocate( tracer_cnst_flds(num_tracer_cnst), stat=istat) - call handle_err(istat, 'tracer_cnst_init: ERROR allocating tracer_cnst_flds') - - - do i = 1, num_tracer_cnst - - ndx = get_inv_ndx( fields(i)%fldnam ) - - if (ndx < 1) then - write(iulog,*) fields(i)%fldnam//' is not an invariant' - call endrun('tracer_cnst_init') - endif - - tracer_cnst_flds(i) = fields(i)%fldnam - - call addfld(trim(fields(i)%fldnam), (/ 'lev' /), & - 'I','mol/mol', 'prescribed tracer constituent' ) - enddo - - allocate(data_q(pcols,pver,num_tracer_cnst,begchunk:endchunk), stat=istat) - call handle_err(istat, 'tracer_cnst_init: ERROR allocating data_q') - - end subroutine tracer_cnst_init - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine tracer_cnst_setopts( & - tracer_cnst_file_in, & - tracer_cnst_filelist_in, & - tracer_cnst_datapath_in, & - tracer_cnst_type_in, & - tracer_cnst_specifier_in, & - tracer_cnst_rmfile_in, & - tracer_cnst_cycle_yr_in, & - tracer_cnst_fixed_ymd_in, & - tracer_cnst_fixed_tod_in & - ) - - implicit none - - character(len=*), intent(in), optional :: tracer_cnst_file_in - character(len=*), intent(in), optional :: tracer_cnst_filelist_in - character(len=*), intent(in), optional :: tracer_cnst_datapath_in - character(len=*), intent(in), optional :: tracer_cnst_type_in - character(len=*), intent(in), optional :: tracer_cnst_specifier_in(:) - logical, intent(in), optional :: tracer_cnst_rmfile_in - integer, intent(in), optional :: tracer_cnst_cycle_yr_in - integer, intent(in), optional :: tracer_cnst_fixed_ymd_in - integer, intent(in), optional :: tracer_cnst_fixed_tod_in - - if ( present(tracer_cnst_file_in) ) then - filename = tracer_cnst_file_in - endif - if ( present(tracer_cnst_filelist_in) ) then - filelist = tracer_cnst_filelist_in - endif - if ( present(tracer_cnst_datapath_in) ) then - datapath = tracer_cnst_datapath_in - endif - if ( present(tracer_cnst_type_in) ) then - data_type = tracer_cnst_type_in - endif - if ( present(tracer_cnst_specifier_in) ) then - specifier = tracer_cnst_specifier_in - endif - if ( present(tracer_cnst_rmfile_in) ) then - rmv_file = tracer_cnst_rmfile_in - endif - if ( present(tracer_cnst_cycle_yr_in) ) then - cycle_yr = tracer_cnst_cycle_yr_in - endif - if ( present(tracer_cnst_fixed_ymd_in) ) then - fixed_ymd = tracer_cnst_fixed_ymd_in - endif - if ( present(tracer_cnst_fixed_tod_in) ) then - fixed_tod = tracer_cnst_fixed_tod_in - endif - - endsubroutine tracer_cnst_setopts - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine tracer_cnst_defaultopts( & - tracer_cnst_file_out, & - tracer_cnst_filelist_out, & - tracer_cnst_datapath_out, & - tracer_cnst_type_out, & - tracer_cnst_specifier_out,& - tracer_cnst_rmfile_out, & - tracer_cnst_cycle_yr_out, & - tracer_cnst_fixed_ymd_out,& - tracer_cnst_fixed_tod_out & - ) - - implicit none - - character(len=*), intent(out), optional :: tracer_cnst_file_out - character(len=*), intent(out), optional :: tracer_cnst_filelist_out - character(len=*), intent(out), optional :: tracer_cnst_datapath_out - character(len=*), intent(out), optional :: tracer_cnst_type_out - character(len=*), intent(out), optional :: tracer_cnst_specifier_out(:) - logical, intent(out), optional :: tracer_cnst_rmfile_out - integer, intent(out), optional :: tracer_cnst_cycle_yr_out - integer, intent(out), optional :: tracer_cnst_fixed_ymd_out - integer, intent(out), optional :: tracer_cnst_fixed_tod_out - - if ( present(tracer_cnst_file_out) ) then - tracer_cnst_file_out = filename - endif - if ( present(tracer_cnst_filelist_out) ) then - tracer_cnst_filelist_out = filelist - endif - if ( present(tracer_cnst_datapath_out) ) then - tracer_cnst_datapath_out = datapath - endif - if ( present(tracer_cnst_type_out) ) then - tracer_cnst_type_out = data_type - endif - if ( present(tracer_cnst_specifier_out) ) then - tracer_cnst_specifier_out = specifier - endif - if ( present(tracer_cnst_rmfile_out) ) then - tracer_cnst_rmfile_out = rmv_file - endif - if ( present(tracer_cnst_cycle_yr_out) ) then - tracer_cnst_cycle_yr_out = cycle_yr - endif - if ( present(tracer_cnst_fixed_ymd_out) ) then - tracer_cnst_fixed_ymd_out = fixed_ymd - endif - if ( present(tracer_cnst_fixed_tod_out) ) then - tracer_cnst_fixed_tod_out = fixed_tod - endif - - endsubroutine tracer_cnst_defaultopts - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine tracer_cnst_adv( pbuf2d, state ) - - use physics_buffer, only : physics_buffer_desc - use tracer_data, only : advance_trcdata - use physics_types,only : physics_state - use ppgrid, only : begchunk, endchunk - use ppgrid, only : pcols, pver - use string_utils, only : to_lower, GLC - use chem_mods, only : fix_mass - use mo_chem_utls, only : get_inv_ndx - use cam_history, only : outfld - use physconst, only: mwdry ! molecular weight dry air ~ kg/kmole - use physconst, only: boltz - - implicit none - - type(physics_state), intent(in):: state(begchunk:endchunk) - type(physics_buffer_desc), pointer :: pbuf2d(:,:) - - integer :: i,ind,c,ncol - real(r8) :: to_vmr(pcols,pver) - - if( num_tracer_cnst < 1 ) return - - call advance_trcdata( fields, file, state, pbuf2d ) - - ! copy prescribed tracer fields into state variable with the correct units - - do i = 1,num_tracer_cnst - ind = get_inv_ndx( tracer_cnst_flds(i) ) - do c = begchunk,endchunk - ncol = state(c)%ncol - - select case ( to_lower(trim(fields(i)%units(:GLC(fields(i)%units)))) ) - case ("molec/cm3","/cm3","molecules/cm3","cm^-3","cm**-3") - to_vmr(:ncol,:) = (1.e6_r8*boltz*state(c)%t(:ncol,:))/(state(c)%pmiddry(:ncol,:)) - case ('kg/kg','mmr') - to_vmr(:ncol,:) = mwdry/fix_mass(ind) - case ('mol/mol','mole/mole','vmr') - to_vmr(:ncol,:) = 1._r8 - case default - write(iulog,*) 'tracer_cnst_adv: units = ',trim(fields(i)%units) ,' are not recognized' - call endrun('tracer_cnst_adv: units are not recognized') - end select - - fields(i)%data(:ncol,:,c) = to_vmr(:ncol,:) * fields(i)%data(:ncol,:,c) ! vmr - call outfld( trim(tracer_cnst_flds(i)), fields(i)%data(:ncol,:,c), ncol, state(c)%lchnk ) - - enddo - enddo - - end subroutine tracer_cnst_adv - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine get_cnst_data( field_name, data, ncol, lchnk, pbuf ) - - use tracer_data, only : get_fld_data - use physics_buffer, only : physics_buffer_desc - - implicit none - - character(len=*), intent(in) :: field_name - real(r8), intent(out) :: data(:,:) - integer, intent(in) :: lchnk - integer, intent(in) :: ncol - type(physics_buffer_desc), pointer :: pbuf(:) - - if( num_tracer_cnst < 1 ) return - - call get_fld_data( fields, field_name, data, ncol, lchnk, pbuf ) - - end subroutine get_cnst_data - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine get_cnst_data_ptr(name, state, q, pbuf) - - use tracer_data, only : get_fld_data, get_fld_ndx - use physconst, only : mwdry ! molecular weight dry air ~ kg/kmole - use chem_mods, only : fix_mass - use mo_chem_utls, only : get_inv_ndx - use physics_types, only : physics_state - use ppgrid, only : pcols, pver - use physics_buffer, only : physics_buffer_desc - - implicit none - - character(len=*), intent(in) :: name - type(physics_state), intent(in) :: state - real(r8), pointer, dimension(:,:) :: q ! constituent mass mixing ratio - type(physics_buffer_desc), pointer :: pbuf(:) - - integer :: lchnk - integer :: ncol - integer :: inv_id, idx - - lchnk = state%lchnk - ncol = state%ncol - - ! make sure the requested constituent can be provided - inv_id = get_inv_ndx(name) - if (.not. inv_id > 0) then - if (masterproc) then - write(iulog,*) 'get_cnst_data_ptr: '//name//' is not a prescribed tracer constituent' - endif - return - endif - - - call get_fld_ndx( fields, name, idx ) - call get_fld_data( fields, name, data_q(:,:,idx,lchnk), ncol, lchnk, pbuf ) - - data_q(:ncol,:,idx,lchnk) = data_q(:ncol,:,idx,lchnk)*fix_mass(inv_id)/mwdry ! vmr->mmr - q => data_q(:,:,idx,lchnk) - - end subroutine get_cnst_data_ptr - -!------------------------------------------------------------------- - - subroutine init_tracer_cnst_restart( piofile ) - use pio, only : file_desc_t - use tracer_data, only : init_trc_restart - implicit none - type(file_desc_t),intent(inout) :: pioFile ! pio File pointer - - call init_trc_restart( 'tracer_cnst', piofile, file ) - - end subroutine init_tracer_cnst_restart -!------------------------------------------------------------------- - subroutine write_tracer_cnst_restart( piofile ) - use tracer_data, only : write_trc_restart - use pio, only : file_desc_t - implicit none - - type(file_desc_t) :: piofile - - call write_trc_restart( piofile, file ) - - end subroutine write_tracer_cnst_restart - -!------------------------------------------------------------------- - subroutine read_tracer_cnst_restart( pioFile ) - use tracer_data, only : read_trc_restart - use pio, only : file_desc_t - implicit none - - type(file_desc_t) :: piofile - - call read_trc_restart( 'tracer_cnst', piofile, file ) - - end subroutine read_tracer_cnst_restart - -end module tracer_cnst diff --git a/src/chemistry/geoschem/tracer_cnst.F90 b/src/chemistry/geoschem/tracer_cnst.F90 new file mode 120000 index 0000000000..be79edec09 --- /dev/null +++ b/src/chemistry/geoschem/tracer_cnst.F90 @@ -0,0 +1 @@ +../mozart/tracer_cnst.F90 \ No newline at end of file diff --git a/src/chemistry/geoschem/tracer_srcs.F90 b/src/chemistry/geoschem/tracer_srcs.F90 deleted file mode 100644 index bec087e581..0000000000 --- a/src/chemistry/geoschem/tracer_srcs.F90 +++ /dev/null @@ -1,296 +0,0 @@ -!------------------------------------------------------------------- -! manages reading and interpolation of offline tracer sources -! Created by: Francis Vitt -- 2 May 2006 -!------------------------------------------------------------------- -module tracer_srcs - - use shr_kind_mod, only: r8 => shr_kind_r8 - use cam_abortutils, only : endrun - use spmd_utils, only : masterproc - - use tracer_data, only : trfld,trfile,MAXTRCRS - use cam_logfile, only : iulog - - implicit none - - private ! all unless made public - save - - public :: tracer_srcs_init - public :: num_tracer_srcs - public :: tracer_src_flds - public :: tracer_srcs_adv - public :: get_srcs_data - public :: write_tracer_srcs_restart - public :: read_tracer_srcs_restart - public :: tracer_srcs_defaultopts - public :: tracer_srcs_setopts - public :: init_tracer_srcs_restart - - type(trfld), pointer :: fields(:) => null() - type(trfile) :: file - - integer :: num_tracer_srcs - character(len=16), allocatable :: tracer_src_flds(:) - - character(len=64) :: specifier(MAXTRCRS) = '' - character(len=256) :: filename = 'tracer_srcs_file' - character(len=256) :: filelist = '' - character(len=256) :: datapath = '' - character(len=32) :: data_type = 'SERIAL' - logical :: rmv_file = .false. - integer :: cycle_yr = 0 - integer :: fixed_ymd = 0 - integer :: fixed_tod = 0 - -contains - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine tracer_srcs_init() - - use mo_chem_utls, only : get_extfrc_ndx - use tracer_data, only : trcdata_init - use cam_history, only : addfld - - implicit none - - integer :: i ,ndx - - allocate(file%in_pbuf(size(specifier))) - file%in_pbuf(:) = .false. - call trcdata_init( specifier, filename, filelist, datapath, fields, file, & - rmv_file, cycle_yr, fixed_ymd, fixed_tod, data_type) - - num_tracer_srcs = 0 - if (associated(fields)) num_tracer_srcs = size( fields ) - - if( num_tracer_srcs < 1 ) then - - if (masterproc) then - write(iulog,*) 'There are no offline tracer sources' - write(iulog,*) ' ' - end if - return - end if - - allocate( tracer_src_flds(num_tracer_srcs)) - - do i = 1, num_tracer_srcs - - ndx = get_extfrc_ndx( fields(i)%fldnam ) - - if (ndx < 1) then - write(iulog,*) fields(i)%fldnam//' is not configured to have an external source' - call endrun('tracer_srcs_init') - endif - - tracer_src_flds(i) = fields(i)%fldnam - - call addfld(trim(fields(i)%fldnam)//'_trsrc', (/ 'lev' /), 'I','/cm3/s', 'tracer source rate' ) - - enddo - - end subroutine tracer_srcs_init - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine tracer_srcs_setopts( & - tracer_srcs_file_in, & - tracer_srcs_filelist_in, & - tracer_srcs_datapath_in, & - tracer_srcs_type_in, & - tracer_srcs_specifier_in, & - tracer_srcs_rmfile_in, & - tracer_srcs_cycle_yr_in, & - tracer_srcs_fixed_ymd_in, & - tracer_srcs_fixed_tod_in & - ) - - implicit none - - character(len=*), intent(in), optional :: tracer_srcs_file_in - character(len=*), intent(in), optional :: tracer_srcs_filelist_in - character(len=*), intent(in), optional :: tracer_srcs_datapath_in - character(len=*), intent(in), optional :: tracer_srcs_type_in - character(len=*), intent(in), optional :: tracer_srcs_specifier_in(:) - logical, intent(in), optional :: tracer_srcs_rmfile_in - integer, intent(in), optional :: tracer_srcs_cycle_yr_in - integer, intent(in), optional :: tracer_srcs_fixed_ymd_in - integer, intent(in), optional :: tracer_srcs_fixed_tod_in - - if ( present(tracer_srcs_file_in) ) then - filename = tracer_srcs_file_in - endif - if ( present(tracer_srcs_filelist_in) ) then - filelist = tracer_srcs_filelist_in - endif - if ( present(tracer_srcs_datapath_in) ) then - datapath = tracer_srcs_datapath_in - endif - if ( present(tracer_srcs_type_in) ) then - data_type = tracer_srcs_type_in - endif - if ( present(tracer_srcs_specifier_in) ) then - specifier = tracer_srcs_specifier_in - endif - if ( present(tracer_srcs_rmfile_in) ) then - rmv_file = tracer_srcs_rmfile_in - endif - if ( present(tracer_srcs_cycle_yr_in) ) then - cycle_yr = tracer_srcs_cycle_yr_in - endif - if ( present(tracer_srcs_fixed_ymd_in) ) then - fixed_ymd = tracer_srcs_fixed_ymd_in - endif - if ( present(tracer_srcs_fixed_tod_in) ) then - fixed_tod = tracer_srcs_fixed_tod_in - endif - - endsubroutine tracer_srcs_setopts - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine tracer_srcs_defaultopts( & - tracer_srcs_file_out, & - tracer_srcs_filelist_out, & - tracer_srcs_datapath_out, & - tracer_srcs_type_out, & - tracer_srcs_specifier_out,& - tracer_srcs_rmfile_out, & - tracer_srcs_cycle_yr_out, & - tracer_srcs_fixed_ymd_out,& - tracer_srcs_fixed_tod_out & - ) - - implicit none - - character(len=*), intent(out), optional :: tracer_srcs_file_out - character(len=*), intent(out), optional :: tracer_srcs_filelist_out - character(len=*), intent(out), optional :: tracer_srcs_datapath_out - character(len=*), intent(out), optional :: tracer_srcs_type_out - character(len=*), intent(out), optional :: tracer_srcs_specifier_out(:) - logical, intent(out), optional :: tracer_srcs_rmfile_out - integer, intent(out), optional :: tracer_srcs_cycle_yr_out - integer, intent(out), optional :: tracer_srcs_fixed_ymd_out - integer, intent(out), optional :: tracer_srcs_fixed_tod_out - - if ( present(tracer_srcs_file_out) ) then - tracer_srcs_file_out = filename - endif - if ( present(tracer_srcs_filelist_out) ) then - tracer_srcs_filelist_out = filelist - endif - if ( present(tracer_srcs_datapath_out) ) then - tracer_srcs_datapath_out = datapath - endif - if ( present(tracer_srcs_type_out) ) then - tracer_srcs_type_out = data_type - endif - if ( present(tracer_srcs_specifier_out) ) then - tracer_srcs_specifier_out = specifier - endif - if ( present(tracer_srcs_rmfile_out) ) then - tracer_srcs_rmfile_out = rmv_file - endif - if ( present(tracer_srcs_cycle_yr_out) ) then - tracer_srcs_cycle_yr_out = cycle_yr - endif - if ( present(tracer_srcs_fixed_ymd_out) ) then - tracer_srcs_fixed_ymd_out = fixed_ymd - endif - if ( present(tracer_srcs_fixed_tod_out) ) then - tracer_srcs_fixed_tod_out = fixed_tod - endif - - endsubroutine tracer_srcs_defaultopts - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine tracer_srcs_adv( pbuf2d, state ) - - use tracer_data, only : advance_trcdata - use ppgrid, only : begchunk, endchunk - use physics_types,only : physics_state - use cam_history, only : outfld - use physics_buffer, only : physics_buffer_desc - - implicit none - - type(physics_state), intent(in):: state(begchunk:endchunk) - type(physics_buffer_desc), pointer :: pbuf2d(:,:) - - integer :: i,c,ncol - - if( num_tracer_srcs < 1 ) return - - call advance_trcdata( fields, file, state, pbuf2d ) - - do c = begchunk,endchunk - ncol = state(c)%ncol - do i = 1,num_tracer_srcs - call outfld( trim(fields(i)%fldnam)//'_trsrc', fields(i)%data(:ncol,:,c), ncol, state(c)%lchnk ) - enddo - enddo - - end subroutine tracer_srcs_adv - -!------------------------------------------------------------------- -!------------------------------------------------------------------- - subroutine get_srcs_data( field_name, data, ncol, lchnk, pbuf ) - - use tracer_data, only : get_fld_data - use physics_buffer, only : physics_buffer_desc - - implicit none - - character(len=*), intent(in) :: field_name - real(r8), intent(out) :: data(:,:) - integer, intent(in) :: lchnk - integer, intent(in) :: ncol - type(physics_buffer_desc), pointer :: pbuf(:) - - if( num_tracer_srcs < 1 ) return - - call get_fld_data( fields, field_name, data, ncol, lchnk, pbuf ) - - end subroutine get_srcs_data - -!------------------------------------------------------------------- - - subroutine init_tracer_srcs_restart( piofile ) - use pio, only : file_desc_t - use tracer_data, only : init_trc_restart - implicit none - type(file_desc_t),intent(inout) :: pioFile ! pio File pointer - - call init_trc_restart( 'tracer_srcs', piofile, file ) - - end subroutine init_tracer_srcs_restart -!------------------------------------------------------------------- - subroutine write_tracer_srcs_restart( piofile ) - use tracer_data, only : write_trc_restart - use pio, only : file_desc_t - implicit none - - type(file_desc_t) :: piofile - - call write_trc_restart( piofile, file ) - - end subroutine write_tracer_srcs_restart - -!------------------------------------------------------------------- - - subroutine read_tracer_srcs_restart( pioFile ) - use tracer_data, only : read_trc_restart - use pio, only : file_desc_t - implicit none - - type(file_desc_t) :: piofile - - call read_trc_restart( 'tracer_srcs', piofile, file ) - - end subroutine read_tracer_srcs_restart - - -end module tracer_srcs diff --git a/src/chemistry/geoschem/tracer_srcs.F90 b/src/chemistry/geoschem/tracer_srcs.F90 new file mode 120000 index 0000000000..136404bf05 --- /dev/null +++ b/src/chemistry/geoschem/tracer_srcs.F90 @@ -0,0 +1 @@ +../mozart/tracer_srcs.F90 \ No newline at end of file From 1e4a06fbef5799629efb947a9aefaf3f2f48f8cb Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 6 Nov 2020 11:45:23 -0500 Subject: [PATCH 157/239] Feat: Add lightning, MEGAN, aerosol and fire emissions Signed-off-by: Thibaud Fritz --- .../geoschem/cesmgc_emissions_mod.F90 | 242 ++++++++++++++++-- src/chemistry/geoschem/chemistry.F90 | 154 ++++------- 2 files changed, 270 insertions(+), 126 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 29dcbd3a13..056b3d516d 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -17,6 +17,8 @@ MODULE CESMGC_Emissions_Mod ! USE SHR_KIND_MOD, ONLY : r8 => shr_kind_r8 USE SPMD_UTILS, ONLY : MasterProc + USE CAM_ABORTUTILS, ONLY : endrun + USE SHR_MEGAN_MOD, ONLY : shr_megan_mechcomps, shr_megan_mechcomps_n USE CAM_LOGFILE, ONLY : iulog IMPLICIT NONE @@ -31,6 +33,11 @@ MODULE CESMGC_Emissions_Mod PUBLIC :: CESMGC_Emissions_Final INTEGER :: iNO + + ! MEGAN Emissions + INTEGER, ALLOCATABLE :: megan_indices_map(:) + REAL(r8), ALLOCATABLE :: megan_wght_factors(:) + ! ! !REVISION HISTORY: ! 07 Oct 2020 - T. M. Fritz - Initial version @@ -52,14 +59,22 @@ MODULE CESMGC_Emissions_Mod !\\ ! !INTERFACE: ! - SUBROUTINE CESMGC_Emissions_Init + SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) ! ! !USES: ! + USE PHYSICS_TYPES, ONLY : physics_state USE CONSTITUENTS, ONLY : cnst_get_ind + USE MO_CHEM_UTLS, ONLY : get_spc_ndx + USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only + USE MO_LIGHTNING, ONLY : lightning_inti + USE FIRE_EMISSIONS, ONLY : fire_emissions_init + USE CHEM_MODS, ONLY : adv_mass + USE INFNAN, ONLY : NaN, assignment(=) ! ! !INPUT PARAMETERS: ! + REAL(r8), INTENT(IN ) :: lght_no_prd_factor ! Lightning scaling factor ! ! !REVISION HISTORY: ! 07 Oct 2020 - T. M. Fritz - Initial version @@ -67,6 +82,17 @@ SUBROUTINE CESMGC_Emissions_Init !------------------------------------------------------------------------------ !BOC ! + ! Integers + INTEGER :: IERR + INTEGER :: N, II + + ! Strings + CHARACTER(LEN=255) :: SpcName + CHARACTER(LEN=255) :: Description + + ! Real + REAL(r8) :: MW + !================================================================= ! CESMGC_Emissions_Init begins here! !================================================================= @@ -74,6 +100,90 @@ SUBROUTINE CESMGC_Emissions_Init ! Get constituent index for NO CALL cnst_get_ind('NO', iNO, abort=.True.) + !----------------------------------------------------------------------- + ! ... initialize the lightning module + !----------------------------------------------------------------------- + CALL lightning_inti(lght_no_prd_factor) + + !----------------------------------------------------------------------- + ! ... MEGAN emissions + !----------------------------------------------------------------------- + IF ( shr_megan_mechcomps_n > 0 ) THEN + + ALLOCATE( megan_indices_map(shr_megan_mechcomps_n), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating megan_indices_map') + ALLOCATE( megan_wght_factors(shr_megan_mechcomps_n), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating megan_wght_factors') + megan_wght_factors(:) = NaN + + DO N = 1, shr_megan_mechcomps_n + SpcName = TRIM(shr_megan_mechcomps(N)%name) + ! Special handlings for GEOS-Chem species + IF ( TRIM(SpcName) == 'MTERP' ) THEN + SpcName = 'MTPA' + ELSEIF ( TRIM(SpcName) == 'BCARY' ) THEN + SpcName = 'None' + MW = 204.342600_r8 ! Taken from pp_trop_strat_mam4_vbs + ELSEIF ( TRIM(SpcName) == 'CH3OH' ) THEN + SpcName = 'MOH' + ELSEIF ( TRIM(SpcName) == 'C2H5OH' ) THEN + SpcName = 'EOH' + ELSEIF ( TRIM(SpcName) == 'CH3CHO' ) THEN + SpcName = 'ALD2' + ELSEIF ( TRIM(SpcName) == 'CH3COOH' ) THEN + SpcName = 'ACTA' + ELSEIF ( TRIM(SpcName) == 'CH3COCH3' ) THEN + SpcName = 'ACET' + ELSEIF ( TRIM(SpcName) == 'HCN' ) THEN + SpcName = 'None' + MW = 27.025140_r8 ! Taken from pp_trop_strat_mam4_vbs + ELSEIF ( TRIM(SpcName) == 'C2H4' ) THEN + SpcName = 'None' + MW = 28.051600_r8 ! Taken from pp_trop_strat_mam4_vbs + ELSEIF ( TRIM(SpcName) == 'C3H6' ) THEN + SpcName = 'PRPE' + ELSEIF ( TRIM(SpcName) == 'BIGALK' ) THEN + ! BIGALK = Pentane + Hexane + Heptane + Tricyclene + SpcName = 'ALK4' + ELSEIF ( TRIM(SpcName) == 'BIGENE' ) THEN + ! BIGENE = butene (C4H8) + SpcName = 'PRPE' ! Lumped >= C3 alkenes + ELSEIF ( TRIM(SpcName) == 'TOLUENE' ) THEN + SpcName = 'TOLU' + ENDIF + + CALL cnst_get_ind (SpcName, megan_indices_map(N), abort=.False.) + II = get_spc_ndx(SpcName) + IF ( II > 0 ) THEN + SpcName = TRIM(shr_megan_mechcomps(N)%name) + megan_wght_factors(N) = adv_mass(II)*1.e-3_r8 ! kg/moles (to convert moles/m2/sec to kg/m2/sec) + Description = TRIM(SpcName)//' MEGAN emissions flux (released as '//TRIM(SpcName)//' in GEOS-Chem)' + ELSEIF ( TRIM(SpcName) == 'None' ) THEN + SpcName = TRIM(shr_megan_mechcomps(N)%name) + megan_wght_factors(N) = MW*1.e-3_r8 ! kg/moles + IF ( MasterProc ) Write(iulog,*) " MEGAN ", TRIM(SpcName), & + " emissions will be ignored as no species match in GEOS-Chem." + Description = TRIM(SpcName)//' MEGAN emissions flux (not released in GEOS-Chem)' + ELSE + SpcName = TRIM(shr_megan_mechcomps(N)%name) + CALL ENDRUN( 'chem_init: MEGAN compound not in chemistry mechanism : '//TRIM(SpcName)) + ENDIF + + ! MEGAN history fields + CALL addfld( 'MEG_'//TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & + Description ) + + !if (history_chemistry) then + CALL add_default('MEG_'//TRIM(SpcName), 1, ' ') + !endif + ENDDO + ENDIF + + !----------------------------------------------------------------------- + ! ... Fire emissions + !----------------------------------------------------------------------- + CALL fire_emissions_init() + END SUBROUTINE CESMGC_Emissions_Init !EOC !------------------------------------------------------------------------------ @@ -88,31 +198,48 @@ END SUBROUTINE CESMGC_Emissions_Init !\\ ! !INTERFACE: ! - SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, eflx ) + SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) ! ! !USES: ! USE State_Met_Mod, ONLY : MetState + USE CAMSRFEXCH, ONLY : cam_in_t USE CONSTITUENTS, ONLY : cnst_name, cnst_get_ind, cnst_mw, pcnst USE CHEM_MODS, ONLY : tracerNames, nTracers, map2GCinv - USE CAM_ABORTUTILS, ONLY : endrun USE PHYSICS_TYPES, ONLY : physics_state USE PHYSICS_BUFFER, ONLY : pbuf_get_index, pbuf_get_chunk USE PHYSICS_BUFFER, ONLY : physics_buffer_desc, pbuf_get_field USE PPGRID, ONLY : pcols, pver, begchunk + USE CAM_HISTORY, ONLY : outfld + + ! Data from CLM + USE CAM_CPL_INDICES, ONLY : index_x2a_Fall_flxvoc + + ! Lightning emissions USE MO_LIGHTNING, ONLY : prod_NO - uSE PHYSCONSTANTS, ONLY : AVO + + ! Fire emissions + USE FIRE_EMISSIONS, ONLY : fire_emissions_srf + USE FIRE_EMISSIONS, ONLY : fire_emissions_vrt + + ! Aerosol emissions + USE AERO_MODEL, ONLY : aero_model_emissions + + ! GEOS-Chem version of physical constants + USE PHYSCONSTANTS, ONLY : AVO + ! CAM version of physical constants + USE PHYSCONST, ONLY : rga ! ! !INPUT PARAMETERS: ! - TYPE(physics_state), INTENT(IN) :: state ! Physics state variables - TYPE(physics_buffer_desc), POINTER, INTENT(IN) :: hco_pbuf2d(:,:) ! Pointer to 2-D pbuf - TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object + TYPE(physics_state), INTENT(IN ) :: state ! Physics state variables + TYPE(physics_buffer_desc), POINTER, INTENT(IN ) :: hco_pbuf2d(:,:) ! Pointer to 2-D pbuf + TYPE(MetState), INTENT(IN ) :: State_Met ! Meteorology State object ! ! !OUTPUT PARAMETERS: ! - ! 3-D emissions in kg/m2/s - REAL(r8), INTENT(OUT) :: eflx(pcols,pver,pcnst) + TYPE(cam_in_t), INTENT(INOUT) :: cam_in ! import state + REAL(r8), INTENT( OUT) :: eflx(pcols,pver,pcnst) ! 3-D emissions in kg/m2/s ! ! !REVISION HISTORY: ! 07 Oct 2020 - T. M. Fritz - Initial version @@ -123,24 +250,29 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, eflx ) ! !LOCAL VARIABLES: ! ! Integers - INTEGER :: LCHNK, nY, nZ - INTEGER :: M, N, J, L - INTEGER :: RC ! return code - INTEGER :: tmpIdx ! pbuf field id + INTEGER :: LCHNK + INTEGER :: nY, nZ + INTEGER :: I, M, N, J, L + INTEGER :: RC ! return code + INTEGER :: tmpIdx ! pbuf field id ! Logical - LOGICAL :: rootChunk - LOGICAL, SAVE :: FIRST = .True. + LOGICAL :: rootChunk + LOGICAL, SAVE :: FIRST = .True. ! Objects - TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in current chunk + TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in current chunk ! Real - REAL(r8), POINTER :: pbuf_ik(:,:) ! pointer to pbuf data (/pcols,pver/) - REAL(r8) :: SCALFAC ! Multiplying factor + REAL(r8), POINTER :: pbuf_ik(:,:) ! pointer to pbuf data (/pcols,pver/) + REAL(r8), DIMENSION(state%NCOL,PVER+1) :: zint ! Interface geopotential in km + REAL(r8), DIMENSION(state%NCOL) :: zsurf ! Surface height + REAL(r8) :: SCALFAC ! Multiplying factor + REAL(r8) :: megflx(pcols) ! For MEGAN emissions + REAL(r8), PARAMETER :: m2km = 1.e-3_r8 ! Strings - CHARACTER(LEN=255) :: fldname_ns ! field name HCO_* + CHARACTER(LEN=255) :: fldname_ns ! field name HCO_* !================================================================= ! CESMGC_Emissions_Calc begins here! @@ -202,15 +334,17 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, eflx ) ENDIF ENDDO - ! Now add lightning emissions computed from lighning_no_prod + !----------------------------------------------------------------------- + ! Lightning NO emissions + !----------------------------------------------------------------------- M = iNO ! prod_NO is in atom N cm^-3 s^-1 <=> molec cm^-3 s^-1 ! We need to convert this to kg NO/m2/s - ! Multiply by AVO * MWNO * BXHEIGHT * 1.0E+06 - ! = molec/mole * kg NO/mole * m * cm^3/m^3 + ! Multiply by MWNO * BXHEIGHT * 1.0E+06 / AVO + ! = mole/molec * kg NO/mole * m * cm^3/m^3 ! cnst_mw(M) is in g/mole - SCALFAC = AVO * cnst_mw(M) * 1.0E-03 * 1.0E+06 + SCALFAC = cnst_mw(M) * 1.0E-03 * 1.0E+06 / AVO DO J = 1, nY DO L = 1, nZ eflx(J,L,M) = eflx(J,L,M) & @@ -220,6 +354,62 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, eflx ) ENDDO ENDDO + !----------------------------------------------------------------------- + ! Aerosol emissions (dust + seasalt) ... + !----------------------------------------------------------------------- + call aero_model_emissions( state, cam_in ) + + !----------------------------------------------------------------------- + ! MEGAN emissions ... + !----------------------------------------------------------------------- + + IF ( index_x2a_Fall_flxvoc > 0 .AND. shr_megan_mechcomps_n > 0 ) THEN + ! set MEGAN fluxes + DO N = 1, shr_megan_mechcomps_n + DO I = 1, nY + megflx(I) = -cam_in%meganflx(I,N) * megan_wght_factors(N) + ENDDO + IF ( ( megan_indices_map(N) > 0 ) .AND. ( megan_wght_factors(N) > 0.0e+00_r8 ) ) THEN + DO I = 1, nY + cam_in%cflx(I,megan_indices_map(N)) = cam_in%cflx(I,megan_indices_map(N)) & + + megflx(I) + ENDDO + ENDIF + ! output MEGAN emis fluxes to history + CALL Outfld('MEG_'//TRIM(shr_megan_mechcomps(N)%name), megflx(:nY), nY, LCHNK) + ENDDO + ENDIF + + !----------------------------------------------------------------------- + ! Fire surface emissions if not elevated forcing + !----------------------------------------------------------------------- + + CALL fire_emissions_srf( LCHNK, nY, cam_in%fireflx, cam_in%cflx ) + + !----------------------------------------------------------------------- + ! Apply CLM emissions (for elevated forcing) + !----------------------------------------------------------------------- + + ! Compute geopotential height in km (needed for vertical distribution of + ! fire emissions + zsurf(:nY) = rga * state%phis(:nY) + DO L = 1, nZ + zint(:nY,L) = m2km * ( state%zi(:nY,L) + zsurf(:nY) ) + ENDDO + L = nZ+1 + zint(:nY,L) = m2km * ( state%zi(:nY,L) + zsurf(:nY) ) + + ! Distributed fire emissions if elevated forcing + ! extfrc is in molec/cm3/s + ! TMMF - vertical distributino of fire emissions is not implemented yet + !CALL fire_emissions_vrt( nY, LCHNK, zint, cam_in%fireflx, cam_in%fireztop, extfrc ) + + !----------------------------------------------------------------------- + ! Add near-surface emissions to surface flux boundary condition + !----------------------------------------------------------------------- + cam_in%cflx(1:nY,:) = cam_in%cflx(1:nY,:) + eflx(1:nY,nZ,:) + eflx(1:nY,nZ,:) = 0.0e+00_r8 + IF ( FIRST ) FIRST = .False. END SUBROUTINE CESMGC_Emissions_Calc @@ -245,8 +435,12 @@ SUBROUTINE CESMGC_Emissions_Final !================================================================= ! CESMGC_Emissions_Final begins here! !================================================================= + + IF ( ALLOCATED( megan_indices_map ) ) DEALLOCATE( megan_indices_map ) + IF ( ALLOCATED( megan_wght_factors ) ) DEALLOCATE( megan_wght_factors ) + + END SUBROUTINE CESMGC_Emissions_Final !EOC !------------------------------------------------------------------------------ - END SUBROUTINE CESMGC_Emissions_Final !EOC END MODULE CESMGC_Emissions_Mod diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 9ec2a19953..39e3b24f13 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -10,7 +10,6 @@ module chemistry use ppgrid, only : pver, pverp use constituents, only : pcnst, cnst_add, cnst_get_ind use shr_const_mod, only : molw_dryair=>SHR_CONST_MWDAIR - use shr_megan_mod, only : shr_megan_mechcomps, shr_megan_mechcomps_n use seq_drydep_mod, only : nddvels => n_drydep, drydep_list use spmd_utils, only : MasterProc, myCPU=>Iam, nCPUs=>npes use cam_logfile, only : iulog @@ -164,10 +163,6 @@ module chemistry integer :: ext_frc_fixed_ymd = 0 integer :: ext_frc_fixed_tod = 0 - ! for MEGAN emissions - integer, allocatable :: megan_indices_map(:) - real(r8),allocatable :: megan_wght_factors(:) - !================================================================================================ contains @@ -931,7 +926,6 @@ subroutine chem_init(phys_state, pbuf2d) use mpishorthand #endif use cam_abortutils, only : endrun - use infnan, only : nan, assignment(=) use mo_chem_utls, only : get_spc_ndx use Phys_Grid, only : get_Area_All_p @@ -977,7 +971,6 @@ subroutine chem_init(phys_state, pbuf2d) use mo_mean_mass, only : init_mean_mass use tracer_cnst, only : tracer_cnst_init use tracer_srcs, only : tracer_srcs_init - use mo_lightning, only : lightning_inti use CESMGC_Emissions_Mod, only : CESMGC_Emissions_Init use CESMGC_Diag_Mod, only : CESMGC_Diag_Init @@ -995,9 +988,8 @@ subroutine chem_init(phys_state, pbuf2d) INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) INTEGER :: IWAIT, IERR INTEGER :: nX, nY, nZ - INTEGER :: iX, jY INTEGER :: nStrat - INTEGER :: I, J, L, N, M, II + INTEGER :: I, J, L, N, M INTEGER :: RC INTEGER :: nLinoz @@ -1035,9 +1027,9 @@ subroutine chem_init(phys_state, pbuf2d) SpcInfo => NULL() ! LCHNK: which chunks we have on this process - LCHNK = PHYS_STATE%LCHNK + LCHNK = phys_state%LCHNK ! NCOL: number of atmospheric columns for each chunk - NCOL = PHYS_STATE%NCOL + NCOL = phys_state%NCOL write(iulog,'(2(a,x,I6,x))') 'chem_init called on PE ', myCPU, ' of ', nCPUs @@ -1352,7 +1344,7 @@ subroutine chem_init(phys_state, pbuf2d) IF ( .NOT. MasterProc ) THEN Input_Opt%LINOZ_TPARM = REAL(linozData,fp) ENDIF - DEALLOCATE(linozData) + IF ( ALLOCATED( linozData ) ) DEALLOCATE(linozData) ENDIF ! Note: The following calculations do not setup the gridcell areas. @@ -1415,10 +1407,10 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDDO - DEALLOCATE(lonMidArr) - DEALLOCATE(latMidArr) - DEALLOCATE(lonEdgeArr) - DEALLOCATE(latEdgeArr) + IF ( ALLOCATED( lonMidArr ) ) DEALLOCATE( lonMidArr ) + IF ( ALLOCATED( latMidArr ) ) DEALLOCATE( latMidArr ) + IF ( ALLOCATED( lonEdgeArr ) ) DEALLOCATE( lonEdgeArr ) + IF ( ALLOCATED( latEdgeArr ) ) DEALLOCATE( latEdgeArr ) ! Set the times held by "time_mod" CALL Accept_External_Date_Time( value_NYMDb = Input_Opt%NYMDb, & @@ -1579,24 +1571,24 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ! Set grid-cell area - DO I = BEGCHUNK, ENDCHUNK - ALLOCATE(Col_Area(NCOL(I)), STAT=IERR) + DO N = BEGCHUNK, ENDCHUNK + ALLOCATE(Col_Area(NCOL(N)), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Col_Area') - CALL Get_Area_All_p(I, NCOL(I), Col_Area) + CALL Get_Area_All_p(N, NCOL(N), Col_Area) ! Set default value (in case of chunks with fewer columns) - State_Grid(I)%Area_M2 = 1.0e+10_fp - DO iX = 1, nX - DO jY = 1, NCOL(I) - State_Grid(I)%Area_M2(iX,jY) = REAL(Col_Area(jY) * Re**2,fp) + State_Grid(N)%Area_M2 = 1.0e+10_fp + DO I = 1, nX + DO J = 1, NCOL(N) + State_Grid(N)%Area_M2(I,J) = REAL(Col_Area(J) * Re**2,fp) ENDDO ENDDO - DEALLOCATE(Col_Area) + IF ( ALLOCATED( Col_Area ) ) DEALLOCATE(Col_Area) ! Copy to State_Met(I)%Area_M2 - State_Met(I)%Area_M2 = State_Grid(I)%Area_M2 + State_Met(N)%Area_M2 = State_Grid(N)%Area_M2 ENDDO ! Initialize (mostly unused) diagnostic arrays @@ -1642,8 +1634,8 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - DEALLOCATE(Ap_CAM_Flip) - DEALLOCATE(Bp_CAM_Flip) + IF ( ALLOCATED( Ap_CAM_Flip ) ) DEALLOCATE( Ap_CAM_Flip ) + IF ( ALLOCATED( Bp_CAM_Flip ) ) DEALLOCATE( Bp_CAM_Flip ) ! Once the initial met fields have been read in, we need to find ! the maximum PBL level for the non-local mixing algorithm. @@ -1737,46 +1729,13 @@ subroutine chem_init(phys_state, pbuf2d) CALL tracer_cnst_init() CALL tracer_srcs_init() - !----------------------------------------------------------------------- - ! ... initialize the lightning module - !----------------------------------------------------------------------- - CALL lightning_inti(lght_no_prd_factor) - - ! MEGAN emissions initialize - IF ( shr_megan_mechcomps_n > 0 ) THEN - - ALLOCATE( megan_indices_map(shr_megan_mechcomps_n), STAT=IERR ) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating megan_indices_map') - ALLOCATE( megan_wght_factors(shr_megan_mechcomps_n), STAT=IERR ) - IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating megan_wght_factors') - megan_wght_factors(:) = NaN - - DO N = 1, shr_megan_mechcomps_n - CALL cnst_get_ind (shr_megan_mechcomps(N)%name, megan_indices_map(N), abort=.False.) - II = get_spc_ndx(shr_megan_mechcomps(N)%name) - IF ( II > 0 ) THEN - megan_wght_factors(N) = adv_mass(II)*1.e-3_r8 ! kg/moles (to convert moles/m2/sec to kg/m2/sec) - ELSE - CALL ENDRUN( 'chem_init: MEGAN compound not in chemistry mechanism : ' & - //TRIM(shr_megan_mechcomps(N)%name)) - ENDIF - - ! MEGAN history fields - CALL addfld( 'MEG_'//TRIM(shr_megan_mechcomps(N)%name), horiz_only, 'A', 'kg/m2/sec', & - TRIM(shr_megan_mechcomps(N)%name)//' MEGAN emissions flux') - !if (history_chemistry) then - CALL add_default('MEG_'//trim(shr_megan_mechcomps(N)%name), 1, ' ') - !endif - ENDDO - ENDIF - ! Initialize diagnostics interface CALL CESMGC_Diag_Init( Input_Opt = Input_Opt, & State_Chm = State_Chm(BEGCHUNK), & State_Met = State_Met(BEGCHUNK) ) ! Initialize emissions interface - CALL CESMGC_Emissions_Init + CALL CESMGC_Emissions_Init( lght_no_prd_factor = lght_no_prd_factor ) hco_pbuf2d => pbuf2d @@ -1850,7 +1809,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use chem_mods, only : drySpc_ndx, map2GC_dryDep use chem_mods, only : nfs, indexm, gas_pcnst - use mo_chem_utls, only : get_spc_ndx use mo_mean_mass, only : set_mean_mass use mo_setinv, only : setinv use mo_neu_wetdep, only : neu_wetdep_tend @@ -1890,20 +1848,14 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Tropopause, only : Tropopause_findChemTrop, Tropopause_Find use HCO_Utilities_GC_Mod ! Utility routines for GC-HEMCO interface - ! Data from CLM - use cam_cpl_indices, only : index_x2a_Fall_flxvoc - ! For calculating SZA use Orbit, only : zenith use Time_Manager, only : Get_Curr_Calday, Get_Curr_Date ! Calculating relative humidity use WV_Saturation, only : QSat - use PhysConst, only : MWDry ! Grid area - use PhysConst, only : Gravit - use PhysConstants, only : Re use Phys_Grid, only : get_area_all_p, get_lat_all_p, get_lon_all_p use short_lived_species, only : get_short_lived_species @@ -1914,11 +1866,13 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use aero_model, only : aero_model_gasaerexch #endif - ! Use GEOS-Chem versions of physical constants - use PhysConstants, only : PI, PI_180, g0, AVO - use rad_constituents, only : rad_cnst_get_info + ! GEOS-Chem version of physical constants + use PhysConstants, only : PI, PI_180, g0, AVO, Re + ! CAM version of physical constants + use PhysConst, only : MWDry, Gravit + REAL(r8), INTENT(IN) :: dT ! Time step TYPE(physics_state), INTENT(IN) :: state ! Physics State variables TYPE(physics_ptend), INTENT(OUT) :: ptend ! indivdual parameterization tendencies @@ -1944,7 +1898,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8), DIMENSION(state%NCOL) :: & CSZA, & ! Cosine of solar zenith angle CSZAmid, & ! Cosine of solar zenith angle at the mid timestep - Zsurf, & ! Surface height Rlats, Rlons ! Chunk latitudes and longitudes (radians) REAL(fp) :: O3col(state%NCOL) ! Overhead O3 column (DU) @@ -1980,8 +1933,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! For emissions REAL(r8) :: eflx(pcols,pver,pcnst) ! 3-D emissions in kg/m2/s - ! For MEGAN emissions - REAL(r8) :: megflx(pcols) ! For GEOS-Chem diagnostics REAL(r8) :: mmr1(state%NCOL,PVER,gas_pcnst) @@ -3365,29 +3316,22 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF + !----------------------------------------------------------------------- + ! Get emissions from HEMCO + Lightning + Fire + ! Add surface emissions to cam_in + !----------------------------------------------------------------------- + CALL CESMGC_Emissions_Calc( state = state, & hco_pbuf2d = hco_pbuf2d, & State_Met = State_Met(LCHNK), & + cam_in = cam_in, & eflx = eflx ) - ! Add near-surface emissions to surface flux BC - cam_in%cflx(1:nY,:) = cam_in%cflx(1:nY,:) + eflx(1:nY,nZ,:) - eflx(1:nY,nZ,:) = 0.0e+00_r8 - - ! MEGAN emissions ... - IF ( index_x2a_Fall_flxvoc > 0 .AND. shr_megan_mechcomps_n > 0 ) THEN - ! set MEGAN fluxes - DO N = 1, shr_megan_mechcomps_n - DO I = 1, nY - megflx(I) = -cam_in%meganflx(I,N) * megan_wght_factors(N) - cam_in%cflx(I,megan_indices_map(N)) = cam_in%cflx(I,megan_indices_map(N)) + megflx(I) - enddO - ! output MEGAN emis fluxes to history - CALL Outfld('MEG_'//TRIM(shr_megan_mechcomps(N)%name), megflx(:nY), nY, LCHNK) - ENDDO - ENDIF + !----------------------------------------------------------------------- + ! Add dry deposition flux + ! (stored as SurfaceFlux = -dflx) + !----------------------------------------------------------------------- - ! Add dry deposition flux (stored as SurfaceFlux = -dflx) DO ND = 1, State_Chm(BEGCHUNK)%nDryDep ! Get the species ID from the drydep ID N = State_Chm(BEGCHUNK)%Map_DryDep(ND) @@ -3398,10 +3342,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) cam_in%cflx(1:nY,M) = cam_in%cflx(1:nY,M) & + State_Chm(LCHNK)%SurfaceFlux(1,1:nY,N) - ENDDO + !----------------------------------------------------------------------- ! Add non-surface emissions + !----------------------------------------------------------------------- + ! Use units of kg/m2 as State_Chm%Species to add emissions fluxes CALL Convert_Spc_Units( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & @@ -3916,13 +3862,13 @@ subroutine chem_final CALL Cleanup_Error ! Finally deallocate state variables - IF (ALLOCATED(State_Chm)) DEALLOCATE(State_Chm) - IF (ALLOCATED(State_Diag)) DEALLOCATE(State_Diag) - IF (ALLOCATED(State_Grid)) DEALLOCATE(State_Grid) - IF (ALLOCATED(State_Met)) DEALLOCATE(State_Met) + IF ( ALLOCATED( State_Chm ) ) DEALLOCATE( State_Chm ) + IF ( ALLOCATED( State_Diag ) ) DEALLOCATE( State_Diag ) + IF ( ALLOCATED( State_Grid ) ) DEALLOCATE( State_Grid ) + IF ( ALLOCATED( State_Met ) ) DEALLOCATE( State_Met ) - IF (ALLOCATED(slvd_Lst )) DEALLOCATE(slvd_Lst) - IF (ALLOCATED(slvd_ref_MMR)) DEALLOCATE(slvd_ref_MMR) + IF ( ALLOCATED( slvd_Lst ) ) DEALLOCATE( slvd_Lst ) + IF ( ALLOCATED( slvd_ref_MMR ) ) DEALLOCATE( slvd_ref_MMR ) RETURN @@ -3988,7 +3934,7 @@ end subroutine chem_read_restart !================================================================================ subroutine chem_emissions( state, cam_in ) - use camsrfexch, only: cam_in_t + use camsrfexch, only : cam_in_t ! Arguments: @@ -3996,19 +3942,23 @@ subroutine chem_emissions( state, cam_in ) TYPE(cam_in_t), INTENT(INOUT) :: cam_in ! import state INTEGER :: M, N - INTEGER :: LCHNK, NCOL + INTEGER :: LCHNK, nY LOGICAL :: rootChunk + ! LCHNK: which chunk we have on this process LCHNK = state%LCHNK ! NCOL: number of atmospheric columns on this chunk - NCOL = state%NCOL + nY = state%NCOL rootChunk = ( MasterProc.and.(LCHNK.EQ.BEGCHUNK) ) + !----------------------------------------------------------------------- ! Reset surface fluxes + !----------------------------------------------------------------------- + DO M = 2, pcnst N = map2chm(M) - IF ( N > 0 ) cam_in%cflx(1:NCOL,N) = 0.0e+0_r8 + IF ( N > 0 ) cam_in%cflx(1:nY,N) = 0.0e+0_r8 ENDDO end subroutine chem_emissions From 62afa560a383cf9f9125c7e2024d08b091f2318a Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 6 Nov 2020 11:47:52 -0500 Subject: [PATCH 158/239] Feat: Remote WDRATE_* from CAM history fields Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 3 --- src/chemistry/geoschem/chemistry.F90 | 4 ---- src/chemistry/geoschem/mo_neu_wetdep.F90 | 16 ++++++---------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 2ab04fb5f1..3f8235da12 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -185,9 +185,6 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) SpcName = 'WD_'//TRIM(solsym(N)) CALL Addfld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & 'vertical integrated wet deposition flux' ) - SpcName = 'WDRATE_'//TRIM(solsym(N)) - CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/s', & - 'wet removal rate' ) ENDDO ENDIF diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 39e3b24f13..032b150984 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -3547,10 +3547,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO CALL Outfld( 'WD_'//TRIM(solsym(N)), wk_out(1:nY), nY, LCHNK ) - CALL Outfld( 'WDRATE_'//TRIM(solsym(N)), & - mmr1(1:nY,:nZ,N)/dT * State_Met(LCHNK)%AD(1,1:nY,nZ:1:-1), & - nY, LCHNK ) - ! GEOS-Chem does not currently store HEFF, but calculates it ! internally. Some potential work around would be to add a ! SpcInfo%Heff variable. diff --git a/src/chemistry/geoschem/mo_neu_wetdep.F90 b/src/chemistry/geoschem/mo_neu_wetdep.F90 index 26689dfd60..fa0e3d356b 100644 --- a/src/chemistry/geoschem/mo_neu_wetdep.F90 +++ b/src/chemistry/geoschem/mo_neu_wetdep.F90 @@ -199,12 +199,13 @@ subroutine neu_wetdep_init do m=1,gas_wetdep_cnt call addfld ('DTWR_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','kg/kg/s','wet removal Neu scheme tendency') call addfld ('WD_'//trim(gas_wetdep_list(m)),horiz_only, 'A','kg/m2/s','vertical integrated wet deposition flux') - call addfld ('WDRATE_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','kg/s','wet removal Neu scheme rate') call addfld ('HEFF_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','M/atm','Effective Henrys Law coeff.') - if (history_chemistry) then - call add_default('DTWR_'//trim(gas_wetdep_list(m)), 1, ' ') - call add_default('WD_'//trim(gas_wetdep_list(m)), 1, ' ') - end if + call add_default('DTWR_'//trim(gas_wetdep_list(m)), 4, ' ') + call add_default('WD_'//trim(gas_wetdep_list(m)), 4, ' ') + !if (history_chemistry) then + ! call add_default('DTWR_'//trim(gas_wetdep_list(m)), 1, ' ') + ! call add_default('WD_'//trim(gas_wetdep_list(m)), 1, ' ') + !end if end do ! if ( do_diag ) then @@ -466,11 +467,6 @@ subroutine neu_wetdep_tend(lchnk,ncol,mmr,pmid,pdel,zint,tfld,delt, & end do call outfld( 'WD_'//trim(gas_wetdep_list(m)),wk_out,ncol,lchnk ) ! -! local wet deposition rate [kg/s] -! - call outfld( 'WDRATE_'//trim(gas_wetdep_list(m)), & - dtwr(1:ncol,1:pver,m)*mass_in_layer(1:ncol,pver:1:-1),ncol,lchnk ) -! ! to be used in mo_chm_diags to compute wet_deposition_NOy_as_N and wet_deposition_NHx_as_N (units: kg/m2/s) ! if ( debug) print *,'mo_neu ',mapping_to_mmr(m),(wk_out(1:ncol)) From 122d9aa25497fd28288cfe63943796d88588e0f6 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 9 Nov 2020 22:29:56 -0500 Subject: [PATCH 159/239] Fix: Molar weight pFe Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/mo_sim_dat.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chemistry/geoschem/mo_sim_dat.F90 b/src/chemistry/geoschem/mo_sim_dat.F90 index fe2510c17e..7b2dabb31c 100644 --- a/src/chemistry/geoschem/mo_sim_dat.F90 +++ b/src/chemistry/geoschem/mo_sim_dat.F90 @@ -187,7 +187,7 @@ subroutine set_sim_dat 17.040000_r8, 18.050000_r8, 62.010000_r8, 31.400000_r8, 30.010000_r8, & 46.010000_r8, 62.010000_r8, 105.110000_r8, 48.000000_r8, 67.450000_r8, & 12.010000_r8, 12.010000_r8, 60.070000_r8, 158.900000_r8, 121.060000_r8, & - -1.000000_r8, 186.280000_r8, 92.110000_r8, 135.080000_r8, 119.080000_r8, & + 55.850000_r8, 186.280000_r8, 92.110000_r8, 135.080000_r8, 119.080000_r8, & 42.090000_r8, 137.110000_r8, 88.070000_r8, 119.100000_r8, 90.140000_r8, & 76.110000_r8, 76.110000_r8, 58.090000_r8, 118.150000_r8, 118.150000_r8, & 118.150000_r8, 118.150000_r8, 90.090000_r8, 31.400000_r8, 31.400000_r8, & From 897d95a6301391bd3769972ac48d80c6d9335b1b Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 10 Nov 2020 10:14:19 -0500 Subject: [PATCH 160/239] Fix: Add to_upper to tracerNames, required since 'pFe' /= 'PFE' Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_emissions_mod.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 056b3d516d..029d1da1b4 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -211,6 +211,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) USE PHYSICS_BUFFER, ONLY : physics_buffer_desc, pbuf_get_field USE PPGRID, ONLY : pcols, pver, begchunk USE CAM_HISTORY, ONLY : outfld + USE STRING_UTILS, ONLY : to_upper ! Data from CLM USE CAM_CPL_INDICES, ONLY : index_x2a_Fall_flxvoc @@ -294,11 +295,12 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) DO N = 1, nTracers - fldname_ns = 'HCO_' // TRIM(tracerNames(N)) + ! to_upper is required because pFe /= PFE + fldname_ns = 'HCO_' // to_upper(TRIM(tracerNames(N))) tmpIdx = pbuf_get_index(fldname_ns, RC) IF ( tmpIdx < 0 ) THEN - IF ( rootChunk ) Write(iulog,*) "CESMGC_Emissions_Calc: Field not found ", & + IF ( rootChunk ) Write(iulog,'(a,a)') "CESMGC_Emissions_Calc: Field not found ", & TRIM(fldname_ns) ELSE ! This is already in chunk, retrieve it From 4d20d5c8f091a050e0c485ba74d8f463cff36537 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 30 Nov 2020 10:35:43 -0500 Subject: [PATCH 161/239] Chore: Try lower and uppercase tracernames when getting data from pbuf Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_emissions_mod.F90 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 029d1da1b4..b1dee66769 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -295,10 +295,16 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) DO N = 1, nTracers - ! to_upper is required because pFe /= PFE - fldname_ns = 'HCO_' // to_upper(TRIM(tracerNames(N))) + fldname_ns = 'HCO_' // TRIM(tracerNames(N)) tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 ) THEN + ! If previous field name was not found, try with capitalized version + ! to_upper is required because pFe /= PFE + fldname_ns = 'HCO_' // to_upper(TRIM(tracerNames(N))) + tmpIdx = pbuf_get_index(fldname_ns, RC) + ENDIF + IF ( tmpIdx < 0 ) THEN IF ( rootChunk ) Write(iulog,'(a,a)') "CESMGC_Emissions_Calc: Field not found ", & TRIM(fldname_ns) From 1c280c5edb4ec109ddb1f2aa94b50f232e301710 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 30 Nov 2020 10:37:29 -0500 Subject: [PATCH 162/239] Fix: Handle cases where ncol /= pcols Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 339 +++++++++++++++------------ 1 file changed, 190 insertions(+), 149 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 032b150984..629f148d91 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -249,8 +249,6 @@ subroutine chem_register ! set_sim_dat which is in pp_[mechanism]/mo_sim_dat.F90. That sets a lot of ! data in other places, notably in "chem_mods" - IF ( MasterProc ) Write(iulog,'(a)') 'GCCALL CHEM_REGISTER' - ! hplin 2020-05-16: Call set_sim_dat to populate chemistry constituent information ! from mo_sim_dat.F90 in other places. This is needed for HEMCO_CESM. CALL Set_sim_dat() @@ -963,6 +961,8 @@ subroutine chem_init(phys_state, pbuf2d) use Pressure_Mod, only : Accept_External_ApBp use Chemistry_Mod, only : Init_Chemistry use Ucx_Mod, only : Init_Ucx + use Strat_chem_Mod, only : Init_Strat_Chem + use isorropiaII_Mod, only : Init_IsorropiaII use Input_mod, only : Validate_Directories use Olson_Landmap_Mod use Vdiff_Mod @@ -1011,6 +1011,9 @@ subroutine chem_init(phys_state, pbuf2d) REAL(f4), ALLOCATABLE :: lonEdgeArr(:,:), latEdgeArr(:,:) REAL(r8), ALLOCATABLE :: linozData(:,:,:,:) + ! Grid with largest number of columns + TYPE(GrdState) :: maxGrid ! Grid State object + REAL(r8), ALLOCATABLE :: Col_Area(:) REAL(fp), ALLOCATABLE :: Ap_CAM_Flip(:), Bp_CAM_Flip(:) @@ -1087,6 +1090,47 @@ subroutine chem_init(phys_state, pbuf2d) nStrat = nStrat-1 ENDDO + + ! Initialize grid with largest number of columns + ! This is required as State_Grid(LCHNK) can have different + ! number of columns, but GEOS-Chem arrays are defined based + ! on State_Grid(BEGCHUNK). + ! To go around this, we define all of GEOS-Chem arrays with + ! size PCOLS x PVER, which is the largest possible number of + ! grid cells. + CALL Init_State_Grid( Input_Opt = Input_Opt, & + State_Grid = maxGrid, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "Init_State_Grid"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + maxGrid%NX = nX + maxGrid%NY = nY + maxGrid%NZ = nZ + + ! Initialize GEOS-Chem horizontal grid structure + CALL GC_Init_Grid( Input_Opt = Input_Opt, & + State_Grid = maxGrid, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered within call to "GC_Init_Grid"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Define more variables for maxGrid + maxGrid%MaxTropLev = nZ + maxGrid%MaxStratLev = nStrat + IF ( Input_Opt%LUCX ) THEN + maxGrid%MaxChemLev = maxGrid%MaxStratLev + ELSE + maxGrid%MaxChemLev = maxGrid%MaxTropLev + ENDIF + + DO I = BEGCHUNK, ENDCHUNK ! Initialize fields of the Grid State object @@ -1100,7 +1144,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF State_Grid(I)%NX = nX - State_Grid(I)%NY = nY + State_Grid(I)%NY = NCOL(I) State_Grid(I)%NZ = nZ ! Initialize GEOS-Chem horizontal grid structure @@ -1134,9 +1178,9 @@ subroutine chem_init(phys_state, pbuf2d) ! Call the routine GC_Allocate_All (located in module file ! GeosCore/gc_environment_mod.F90) to allocate all lat/lon ! allocatable arrays used by GEOS-Chem. - CALL GC_Allocate_All ( Input_Opt = Input_Opt, & - State_Grid = State_Grid(BEGCHUNK), & - RC = RC ) + CALL GC_Allocate_All ( Input_Opt = Input_Opt, & + State_Grid = maxGrid, & + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "GC_Allocate_All"!' @@ -1350,13 +1394,13 @@ subroutine chem_init(phys_state, pbuf2d) ! Note: The following calculations do not setup the gridcell areas. ! In any case, we will need to be constantly updating this grid ! to compensate for the "multiple chunks per processor" element - ALLOCATE(lonMidArr(nX,nY), STAT=IERR) + ALLOCATE(lonMidArr(maxGrid%nX,maxGrid%nY), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating lonMidArr') - ALLOCATE(lonEdgeArr(nX+1,nY+1), STAT=IERR) + ALLOCATE(lonEdgeArr(maxGrid%nX+1,maxGrid%nY+1), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating lonEdgeArr') - ALLOCATE(latMidArr(nX,nY), STAT=IERR) + ALLOCATE(latMidArr(maxGrid%nX,maxGrid%nY), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating latMidArr') - ALLOCATE(latEdgeArr(nX+1,nY+1), STAT=IERR) + ALLOCATE(latEdgeArr(maxGrid%nX+1,maxGrid%nY+1), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating latEdgeArr') ! We could try and get the data from CAM.. but the goal is to make this GC @@ -1368,11 +1412,11 @@ subroutine chem_init(phys_state, pbuf2d) lonMidArr = 0.0e+0_f4 latMidArr = 0.0e+0_f4 dLonFix = 360.0e+0_fp / REAL(nX,fp) - dLatFix = 180.0e+0_fp / REAL(nY,fp) + dLatFix = 180.0e+0_fp / REAL(NCOL(L),fp) DO I = 1, nX ! Center of box, assuming dateline edge lonVal = -180.0e+0_fp + (REAL(I-1,fp)*dLonFix) - DO J = 1, nY + DO J = 1, NCOL(L) ! Center of box, assuming regular cells latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) lonMidArr(I,J) = REAL((lonVal + (0.5e+0_fp * dLonFix)) * PI_180, f4) @@ -1383,10 +1427,10 @@ subroutine chem_init(phys_state, pbuf2d) latEdgeArr(I,J) = REAL(latVal * PI_180, f4) ENDDO ! Edges of box, assuming regular cells - lonEdgeArr(I,nY+1) = REAL((lonVal + dLonFix) * PI_180, f4) - latEdgeArr(I,nY+1) = REAL((latVal + dLatFix) * PI_180, f4) + lonEdgeArr(I,NCOL(L)+1) = REAL((lonVal + dLonFix) * PI_180, f4) + latEdgeArr(I,NCOL(L)+1) = REAL((latVal + dLatFix) * PI_180, f4) ENDDO - DO J = 1, nY+1 + DO J = 1, NCOL(L)+1 ! Edges of box, assuming regular cells latVal = -90.0e+0_fp + (REAL(J-1,fp)*dLatFix) lonEdgeArr(nX+1,J) = REAL((lonVal + dLonFix) * PI_180, f4) @@ -1471,7 +1515,7 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt = Input_Opt, & ! Input Options State_Chm = State_Chm(I), & ! Chemistry State State_Diag = State_Diag(I), & ! Diagnostics State - State_Grid = State_Grid(I), & ! Grid State + State_Grid = maxGrid, & ! Grid State State_Met = State_Met(I), & ! Meteorology State RC = RC ) ! Success or failure @@ -1491,7 +1535,7 @@ subroutine chem_init(phys_state, pbuf2d) & Input_Opt = Input_Opt, & ! Input Options & State_Chm = State_Chm(BEGCHUNK), & ! Chemistry State & State_Diag = State_Diag(BEGCHUNK), & ! Diagnostics State - & State_Grid = State_Grid(BEGCHUNK), & ! Grid State + & State_Grid = maxGrid, & ! Grid State & RC = RC ) ! Success or failure ! Trap potential errors @@ -1572,23 +1616,21 @@ subroutine chem_init(phys_state, pbuf2d) ! Set grid-cell area DO N = BEGCHUNK, ENDCHUNK - ALLOCATE(Col_Area(NCOL(N)), STAT=IERR) + ALLOCATE(Col_Area(State_Grid(N)%nY), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating Col_Area') - CALL Get_Area_All_p(N, NCOL(N), Col_Area) + CALL Get_Area_All_p(N, State_Grid(N)%nY, Col_Area) ! Set default value (in case of chunks with fewer columns) State_Grid(N)%Area_M2 = 1.0e+10_fp - DO I = 1, nX - DO J = 1, NCOL(N) + DO I = 1, State_Grid(N)%nX + DO J = 1, State_Grid(N)%nY State_Grid(N)%Area_M2(I,J) = REAL(Col_Area(J) * Re**2,fp) + State_Met(N)%Area_M2(I,J) = State_Grid(N)%Area_M2(I,J) ENDDO ENDDO IF ( ALLOCATED( Col_Area ) ) DEALLOCATE(Col_Area) - - ! Copy to State_Met(I)%Area_M2 - State_Met(N)%Area_M2 = State_Grid(N)%Area_M2 ENDDO ! Initialize (mostly unused) diagnostic arrays @@ -1613,18 +1655,18 @@ subroutine chem_init(phys_state, pbuf2d) !----------------------------------------------------------------- ! Pass external Ap and Bp to GEOS-Chem's Pressure_Mod !----------------------------------------------------------------- - CALL Accept_External_ApBp( State_Grid = State_Grid(BEGCHUNK), & ! Grid State - ApIn = Ap_CAM_Flip, & ! "A" term for hybrid grid - BpIn = Bp_CAM_Flip, & ! "B" term for hybrid grid - RC = RC ) ! Success or failure + CALL Accept_External_ApBp( State_Grid = maxGrid, & ! Grid State + ApIn = Ap_CAM_Flip, & ! "A" term for hybrid grid + BpIn = Bp_CAM_Flip, & ! "B" term for hybrid grid + RC = RC ) ! Success or failure ! Print vertical coordinates IF ( MasterProc ) THEN WRITE( 6, '(a)' ) REPEAT( '=', 79 ) WRITE( 6, '(a,/)' ) 'V E R T I C A L G R I D S E T U P' - WRITE( 6, '( ''Ap '', /, 6(f11.6,1x) )' ) Ap_CAM_Flip(1:State_Grid(BEGCHUNK)%NZ+1) + WRITE( 6, '( ''Ap '', /, 6(f11.6,1x) )' ) Ap_CAM_Flip(1:maxGrid%nZ+1) WRITE( 6, '(a)' ) - WRITE( 6, '( ''Bp '', /, 6(f11.6,1x) )' ) Bp_CAM_Flip(1:State_Grid(BEGCHUNK)%NZ+1) + WRITE( 6, '( ''Bp '', /, 6(f11.6,1x) )' ) Bp_CAM_Flip(1:maxGrid%nZ+1) WRITE( 6, '(a)' ) REPEAT( '=', 79 ) ENDIF @@ -1669,7 +1711,24 @@ subroutine chem_init(phys_state, pbuf2d) CALL Init_UCX( Input_Opt = Input_Opt, & State_Chm = State_Chm(BEGCHUNK), & State_Diag = State_Diag(BEGCHUNK), & - State_Grid = State_Grid(BEGCHUNK) ) + State_Grid = maxGrid ) + ENDIF + + IF ( Input_Opt%LSCHEM ) THEN + CALL Init_Strat_Chem( Input_Opt = Input_Opt, & + State_Chm = State_Chm(BEGCHUNK), & + State_Met = State_Met(BEGCHUNK), & + State_Grid = maxGrid, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Init_Strat_Chem"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ENDIF + + IF ( Input_Opt%LSSalt ) THEN + CALL INIT_ISORROPIAII( State_Grid = maxGrid ) ENDIF ! Get some indices @@ -1741,7 +1800,8 @@ subroutine chem_init(phys_state, pbuf2d) If ( MasterProc ) Write(iulog,*) "hco_pbuf2d now points to pbuf2d" - IF (MasterProc) WRITE(iulog,'(a)') 'GCCALL CHEM_INIT' + ! Cleanup + Call Cleanup_State_Grid( maxGrid, RC ) end subroutine chem_init @@ -1831,7 +1891,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Pressure_Mod, only : Set_Floating_Pressures use Pressure_Mod, only : Accept_External_Pedge use Time_Mod, only : Accept_External_Date_Time - use Strat_chem_Mod, only : Init_Strat_Chem use Toms_Mod, only : Compute_Overhead_O3 use Chemistry_Mod, only : Do_Chemistry use Wetscav_Mod, only : Setup_Wetscav, Do_WetDep @@ -1946,9 +2005,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8), PARAMETER :: zsice = 0.0400_r8 ! Roughness length for sea ice [m] REAL(r8), PARAMETER :: zocn = 0.0001_r8 ! Roughness length for oean [m] - ! Because of strat chem - LOGICAL, SAVE :: SCHEM_READY = .FALSE. - REAL(f4) :: lonMidArr(1,PCOLS), latMidArr(1,PCOLS) INTEGER :: iMaxLoc(1) @@ -1981,7 +2037,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CHARACTER(LEN=63) :: OrigUnit - REAL(r8) :: SlsData(state%NCOL, PVER, nSls) + REAL(r8) :: SlsData(PCOLS, PVER, nSls) INTEGER :: currYr, currMo, currDy, currTOD INTEGER :: currYMD, currHMS, currHr, currMn, currSc @@ -2030,7 +2086,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Need to update the timesteps throughout the code CALL GC_Update_Timesteps(dT) - ! For safety's sake PTop = state%pint(1,1)*0.01e+0_fp @@ -2078,11 +2133,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Unit : - ! Dimensions : nX, nY ! Note : Set default value (in case of chunks with fewer columns) - State_Grid(LCHNK)%Area_M2 = 1.0e+10_fp + State_Grid(LCHNK)%Area_M2 = -1.0e+10_fp + State_Met(LCHNK)%Area_M2 = -1.0e+10_fp DO J = 1, nY State_Grid(LCHNK)%Area_M2(1,J) = REAL(Col_Area(J) * Re**2,fp) + State_Met(LCHNK)%Area_M2(1,J) = State_Grid(LCHNK)%Area_M2(1,J) ENDDO - State_Met(LCHNK)%Area_M2 = State_Grid(LCHNK)%Area_M2 ! 2. Copy tracers into State_Chm ! Data was received in kg/kg dry @@ -2165,7 +2221,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) P = map2MAM4(SM,M) - State_Chm(LCHNK)%Species(1,:,:,P) = 0.0e+00_fp + State_Chm(LCHNK)%Species(1,:nY,:nZ,P) = 0.0e+00_fp ENDDO ENDDO @@ -2268,8 +2324,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !----------------------------------------------------------------------- ! ... Set the "invariants" !----------------------------------------------------------------------- - CALL Setinv( invariants, state%t(:nY,:), h2ovmr, vmr0, & - state%pmid(:nY,:), NCOL, LCHNK, pbuf ) + CALL Setinv( invariants, state%t(:,:), h2ovmr, vmr0, & + state%pmid(:,:), nY, LCHNK, pbuf ) ! Calculate RH (range 0-1, note still level 1 = TOA) relHum(:,:) = 0.0e+0_r8 @@ -2378,7 +2434,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Visible surface albedo ! Unit : - ! Dimensions : nX, nY - State_Met(LCHNK)%ALBD (1,:) = cam_in%Asdir(:) + State_Met(LCHNK)%ALBD (1,:nY) = cam_in%asdir(:nY) ! Field : CLDFRC ! Description: Column cloud fraction @@ -2394,8 +2450,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Latent heat flux, sensible heat flux ! Unit : W/m^2 ! Dimensions : nX, nY - State_Met(LCHNK)%EFLUX (1,:) = cam_in%Lhf(:) - State_Met(LCHNK)%HFLUX (1,:) = cam_in%Shf(:) + State_Met(LCHNK)%EFLUX (1,:nY) = cam_in%Lhf(:nY) + State_Met(LCHNK)%HFLUX (1,:nY) = cam_in%Shf(:nY) ! Field : LandTypeFrac ! Description: Olson fraction per type @@ -2404,8 +2460,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Note : Index 1 is water IF ( Input_Opt%onlineLandTypes ) THEN ! Fill in water - State_Met(LCHNK)%LandTypeFrac(1,:, 1) = cam_in%ocnFrac(:) & - + cam_in%iceFrac(:) + State_Met(LCHNK)%LandTypeFrac(1,:nY,1) = cam_in%ocnFrac(:nY) & + + cam_in%iceFrac(:nY) IF ( .NOT. Input_Opt%ddVel_CLM ) THEN CALL getLandTypes( cam_in, & nY, & @@ -2455,53 +2511,53 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Fraction of snow ! Unit : - ! Dimensions : nX, nY - State_Met(LCHNK)%FRCLND (1,:) = 1.e+0_fp - & - State_Met(LCHNK)%LandTypeFrac(1,:,1) ! Olson Land Fraction - State_Met(LCHNK)%FRLAND (1,:) = cam_in%landFrac(:) - State_Met(LCHNK)%FROCEAN (1,:) = cam_in%ocnFrac(:) + cam_in%iceFrac(:) - State_Met(LCHNK)%FRSEAICE (1,:) = cam_in%iceFrac(:) + State_Met(LCHNK)%FRCLND (1,:ny) = 1.e+0_fp - & + State_Met(LCHNK)%LandTypeFrac(1,:nY,1) ! Olson Land Fraction + State_Met(LCHNK)%FRLAND (1,:nY) = cam_in%landFrac(:nY) + State_Met(LCHNK)%FROCEAN (1,:nY) = cam_in%ocnFrac(:nY) + cam_in%iceFrac(:nY) + State_Met(LCHNK)%FRSEAICE (1,:nY) = cam_in%iceFrac(:nY) IF ( Input_Opt%onlineLandTypes ) THEN - State_Met(LCHNK)%FRLAKE (1,:) = cam_in%lwtgcell(:,3) + & + State_Met(LCHNK)%FRLAKE (1,:nY) = cam_in%lwtgcell(:,3) + & cam_in%lwtgcell(:,4) - State_Met(LCHNK)%FRLANDIC (1,:) = cam_in%lwtgcell(:,2) - State_Met(LCHNK)%FRSNO (1,:) = 0.0e+0_fp + State_Met(LCHNK)%FRLANDIC (1,:nY) = cam_in%lwtgcell(:,2) + State_Met(LCHNK)%FRSNO (1,:nY) = 0.0e+0_fp ELSE - State_Met(LCHNK)%FRLAKE (1,:) = 0.0e+0_fp - State_Met(LCHNK)%FRLANDIC (1,:) = 0.0e+0_fp - State_Met(LCHNK)%FRSNO (1,:) = 0.0e+0_fp + State_Met(LCHNK)%FRLAKE (1,:nY) = 0.0e+0_fp + State_Met(LCHNK)%FRLANDIC (1,:nY) = 0.0e+0_fp + State_Met(LCHNK)%FRSNO (1,:nY) = 0.0e+0_fp ENDIF ! Field : GWETROOT, GWETTOP ! Description: Root and top soil moisture ! Unit : - ! Dimensions : nX, nY - State_Met(LCHNK)%GWETROOT (1,:) = 0.0e+0_fp - State_Met(LCHNK)%GWETTOP (1,:) = 0.0e+0_fp + State_Met(LCHNK)%GWETROOT (1,:nY) = 0.0e+0_fp + State_Met(LCHNK)%GWETTOP (1,:nY) = 0.0e+0_fp ! Field : LAI ! Description: Leaf area index ! Unit : m^2/m^2 ! Dimensions : nX, nY - State_Met(LCHNK)%LAI (1,:) = 0.0e+0_fp + State_Met(LCHNK)%LAI (1,:nY) = 0.0e+0_fp ! Field : PARDR, PARDF ! Description: Direct and diffuse photosynthetically active radiation ! Unit : W/m^2 ! Dimensions : nX, nY - State_Met(LCHNK)%PARDR (1,:) = 0.0e+0_fp - State_Met(LCHNK)%PARDF (1,:) = 0.0e+0_fp + State_Met(LCHNK)%PARDR (1,:nY) = 0.0e+0_fp + State_Met(LCHNK)%PARDF (1,:nY) = 0.0e+0_fp ! Field : PBLH ! Description: PBL height ! Unit : m ! Dimensions : nX, nY - State_Met(LCHNK)%PBLH (1,:) = PblH(:nY) + State_Met(LCHNK)%PBLH (1,:nY) = PblH(:nY) ! Field : PHIS ! Description: Surface geopotential height ! Unit : m ! Dimensions : nX, nY - State_Met(LCHNK)%PHIS (1,:) = state%Phis(:) + State_Met(LCHNK)%PHIS (1,:nY) = state%Phis(:nY) ! Field : PRECANV, PRECCON, PRECLSC, PRECTOT ! Description: Anvil precipitation @ ground @@ -2510,42 +2566,42 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Total precipitation @ ground ! Unit : kg/m^2/s ! Dimensions : nX, nY - State_Met(LCHNK)%PRECANV (1,:) = 0.0e+0_fp - State_Met(LCHNK)%PRECCON (1,:) = cam_out%Precc(:) - State_Met(LCHNK)%PRECLSC (1,:) = cam_out%Precl(:) - State_Met(LCHNK)%PRECTOT (1,:) = cam_out%Precc(:) + cam_out%Precl(:) + State_Met(LCHNK)%PRECANV (1,:nY) = 0.0e+0_fp + State_Met(LCHNK)%PRECCON (1,:nY) = cam_out%Precc(:nY) + State_Met(LCHNK)%PRECLSC (1,:nY) = cam_out%Precl(:nY) + State_Met(LCHNK)%PRECTOT (1,:nY) = cam_out%Precc(:nY) + cam_out%Precl(:nY) ! Field : TROPP ! Description: Tropopause pressure ! Unit : hPa ! Dimensions : nX, nY - State_Met(LCHNK)%TROPP (1,:) = Trop_P(:) + State_Met(LCHNK)%TROPP (1,:nY) = Trop_P(:nY) ! Field : PS1_WET, PS2_WET ! Description: Wet surface pressure at start and end of timestep ! Unit : hPa ! Dimensions : nX, nY - State_Met(LCHNK)%PS1_WET (1,:) = state%ps(:)*0.01e+0_fp - State_Met(LCHNK)%PS2_WET (1,:) = state%ps(:)*0.01e+0_fp + State_Met(LCHNK)%PS1_WET (1,:nY) = state%ps(:nY)*0.01e+0_fp + State_Met(LCHNK)%PS2_WET (1,:nY) = state%ps(:nY)*0.01e+0_fp ! Field : SLP ! Description: Sea level pressure ! Unit : hPa ! Dimensions : nX, nY - State_Met(LCHNK)%SLP (1,:) = state%ps(:)*0.01e+0_fp + State_Met(LCHNK)%SLP (1,:nY) = state%ps(:nY)*0.01e+0_fp ! Field : TS, TSKIN ! Description: Surface temperature, surface skin temperature ! Unit : K ! Dimensions : nX, nY - State_Met(LCHNK)%TS (1,:) = cam_in%TS(:) - State_Met(LCHNK)%TSKIN (1,:) = cam_in%TS(:) + State_Met(LCHNK)%TS (1,:nY) = cam_in%TS(:nY) + State_Met(LCHNK)%TSKIN (1,:nY) = cam_in%TS(:nY) ! Field : SWGDN ! Description: Incident radiation @ ground ! Unit : W/m^2 ! Dimensions : nX, nY - State_Met(LCHNK)%SWGDN (1,:) = fsds(:) + State_Met(LCHNK)%SWGDN (1,:nY) = fsds(:nY) ! Field : SNODP, SNOMAS ! Description: Snow depth, snow mass @@ -2553,33 +2609,33 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Dimensions : nX, nY ! Note : Conversion from m to kg/m^2 ! \rho_{ice} = 916.7 kg/m^3 - State_Met(LCHNK)%SNODP (1,:) = snowDepth(:) - State_Met(LCHNK)%SNOMAS (1,:) = snowDepth(:) * 916.7e+0_r8 + State_Met(LCHNK)%SNODP (1,:nY) = snowDepth(:nY) + State_Met(LCHNK)%SNOMAS (1,:nY) = snowDepth(:nY) * 916.7e+0_r8 ! Field : SUNCOS, SUNCOSmid ! Description: COS(solar zenith angle) at current time and midpoint ! of chemistry timestep ! Unit : - ! Dimensions : nX, nY - State_Met(LCHNK)%SUNCOS (1,:) = CSZA(:) - State_Met(LCHNK)%SUNCOSmid (1,:) = CSZAmid(:) + State_Met(LCHNK)%SUNCOS (1,:nY) = CSZA(:nY) + State_Met(LCHNK)%SUNCOSmid (1,:nY) = CSZAmid(:nY) ! Field : UVALBEDO ! Description: UV surface albedo ! Unit : - ! Dimensions : nX, nY IF ( Input_Opt%onlineAlbedo ) THEN - State_Met(LCHNK)%UVALBEDO(1,:) = cam_in%asdir(:) + State_Met(LCHNK)%UVALBEDO(1,:nY) = cam_in%asdir(:nY) ELSE fldname_ns = 'HCO_UV_ALBEDO' tmpIdx = pbuf_get_index(fldname_ns, RC) IF ( tmpIdx < 0 ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) - State_Met(LCHNK)%UVALBEDO(1,:) = 0.0e+0_fp + State_Met(LCHNK)%UVALBEDO(1,:nY) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) - State_Met(LCHNK)%UVALBEDO(1,:) = pbuf_ik(:,nZ) + State_Met(LCHNK)%UVALBEDO(1,:nY) = pbuf_ik(:nY,nZ) pbuf_chnk => NULL() pbuf_ik => NULL() ENDIF @@ -2589,8 +2645,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: E/W and N/S wind speed @ 10m height ! Unit : m/s ! Dimensions : nX, nY - State_Met(LCHNK)%U10M (1,:) = state%U(:,nZ) - State_Met(LCHNK)%V10M (1,:) = state%V(:,nZ) + State_Met(LCHNK)%U10M (1,:nY) = state%U(:nY,nZ) + State_Met(LCHNK)%V10M (1,:nY) = state%V(:nY,nZ) ! Field : USTAR ! Description: Friction velocity @@ -2608,7 +2664,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Surface roughness length ! Unit : m ! Dimensions : nX, nY - State_Met(LCHNK)%Z0 (1,:) = Z0(:) + State_Met(LCHNK)%Z0 (1,:nY) = Z0(:nY) ! Field : IODIDE ! Description: Surface iodide concentration @@ -2618,11 +2674,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) tmpIdx = pbuf_get_index(fldname_ns, RC) IF ( tmpIdx < 0 ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) - State_Chm(LCHNK)%IODIDE(1,:) = 0.0e+0_fp + State_Chm(LCHNK)%IODIDE(1,:nY) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) - State_Chm(LCHNK)%IODIDE(1,:) = pbuf_ik(:,nZ) + State_Chm(LCHNK)%IODIDE(1,:nY) = pbuf_ik(:nY,nZ) pbuf_chnk => NULL() pbuf_ik => NULL() ENDIF @@ -2636,11 +2692,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) tmpIdx = pbuf_get_index(fldname_ns, RC) IF ( tmpIdx < 0 ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) - State_Chm(LCHNK)%SALINITY(1,:) = 0.0e+0_fp + State_Chm(LCHNK)%SALINITY(1,:nY) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) - State_Chm(LCHNK)%SALINITY(1,:) = pbuf_ik(:,nZ) + State_Chm(LCHNK)%SALINITY(1,:nY) = pbuf_ik(:nY,nZ) pbuf_chnk => NULL() pbuf_ik => NULL() ENDIF @@ -2698,7 +2754,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Downward flux of ice/liquid precipitation (Large-scale & anvil) ! Unit : kg/m^2/s ! Dimensions : nX, nY, nZ+1 - State_Met(LCHNK)%PFILSAN (1,J,L) = LsFlxSnw(j,nZ+2-L) ! kg/m2/s + State_Met(LCHNK)%PFILSAN (1,J,L) = LsFlxSnw(J,nZ+2-L) ! kg/m2/s State_Met(LCHNK)%PFLLSAN (1,J,L) = MAX(0.0e+0_fp,LsFlxPrc(J,nZ+2-L) - LsFlxSnw(J,nZ+2-L)) ! kg/m2/s ENDDO ENDDO @@ -2806,6 +2862,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%TMPU2 (1,J,L) = state%t(J,nZ+1-L) ENDDO ENDDO + !TMMF, FIX ME + State_Met(LCHNK)%DQRLSAN (1,:nY,nZ) = 0.0e+00_fp ! Field : T ! Description: Temperature at current time @@ -2849,8 +2907,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - CALL Accept_External_PEdge( State_Met = State_Met(LCHNK), & - RC = RC ) + CALL Accept_External_PEdge( State_Met = State_Met(LCHNK), & + State_Grid = State_Grid(LCHNK), & + RC = RC ) IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Failed to update pressure edges!' @@ -2866,8 +2925,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! 2. As we are using online meteorology, we do not ! have access to the fields at the next time step ! Compute Pa/s tendency? (tmmf, 1/13/20) - State_Met(LCHNK)%PS1_DRY (1,:) = state%PSDry(:) * 0.01e+0_fp - State_Met(LCHNK)%PS2_DRY (1,:) = state%PSDry(:) * 0.01e+0_fp + State_Met(LCHNK)%PS1_DRY (1,:nY) = state%PSDry(:nY) * 0.01e+0_fp + State_Met(LCHNK)%PS2_DRY (1,:nY) = state%PSDry(:nY) * 0.01e+0_fp ! Field : PSC2_WET, PSC2_DRY ! Description: Interpolated wet and dry surface pressure at the @@ -2937,6 +2996,32 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ! SDE 05/28/13: Set H2O to State_Chm tracer if relevant and, + ! if LUCX=T and LSETH2O=F and LACTIVEH2O=T, update specific humidity + ! in the stratosphere + ! + ! NOTE: Specific humidity may change in SET_H2O_TRAC and + ! therefore this routine may call AIRQNT again to update + ! air quantities and tracer concentrations (ewl, 10/28/15) + IF ( Input_Opt%Its_A_Fullchem_Sim .and. iH2O > 0 ) THEN + CALL Set_H2O_Trac( SETSTRAT = ( ( .not. Input_Opt%LUCX ) & + .or. Input_Opt%LSETH2O ), & + Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + RC = RC ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Set_H2O_Trac" #1!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ! Only force strat once if using UCX + IF (Input_Opt%LSETH2O) Input_Opt%LSETH2O = .FALSE. + ENDIF + ! Do this after AirQnt, such that we overwrite GEOS-Chem isLand, isWater and ! isIce, which are based on albedo. Rather, we use CLM landFranc, ocnFrac ! and iceFrac. We also compute isSnow @@ -2995,51 +3080,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Total overhead ozone column ! Unit : DU ! Dimensions : nX, nY - State_Met(LCHNK)%TO3 (1,:) = O3col(:) - - ! Initialize strat chem if not already done. This has to be done here because - ! it needs to have non-zero values in State_Chm%AD, which only happens after - ! the first call to AirQnt - !IF ( (.not.SCHEM_READY) .and. Input_Opt%LSCHEM ) THEN - IF ( (.not.SCHEM_READY) .and. .True. ) THEN !TMMF - CALL Init_Strat_Chem( Input_Opt = Input_Opt, & - State_Chm = State_Chm(LCHNK), & - State_Met = State_Met(LCHNK), & - State_Grid = State_Grid(LCHNK), & - RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Init_Strat_Chem"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - SCHEM_READY = .True. - ENDIF - - ! SDE 05/28/13: Set H2O to State_Chm tracer if relevant and, - ! if LUCX=T and LSETH2O=F and LACTIVEH2O=T, update specific humidity - ! in the stratosphere - ! - ! NOTE: Specific humidity may change in SET_H2O_TRAC and - ! therefore this routine may call AIRQNT again to update - ! air quantities and tracer concentrations (ewl, 10/28/15) - IF ( Input_Opt%Its_A_Fullchem_Sim .and. iH2O > 0 ) THEN - CALL Set_H2O_Trac( SETSTRAT = ( ( .not. Input_Opt%LUCX ) & - .or. Input_Opt%LSETH2O ), & - Input_Opt = Input_Opt, & - State_Chm = State_Chm(LCHNK), & - State_Grid = State_Grid(LCHNK), & - State_Met = State_Met(LCHNK), & - RC = RC ) - - ! Trap potential errors - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Set_H2O_Trac" #1!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - - ! Only force strat once if using UCX - IF (Input_Opt%LSETH2O) Input_Opt%LSETH2O = .FALSE. - ENDIF + State_Met(LCHNK)%TO3 (1,:nY) = O3col(:nY) !---------------------------------------------------------- ! %%% GET SOME NON-EMISSIONS DATA FIELDS VIA HEMCO %%% @@ -3585,7 +3626,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) If ( rootChunk ) Write(iulog,*) " MAXVAL(PSO4) = ", & MAXVAL(State_Chm(LCHNK)%Species(1,:nY,:nZ,iPSO4)) DO L = 1, nZ - ! Convert from kg/kg to mol/mol + ! Convert from kg SO4/kg to mol/mol del_h2so4_gasprod(:nY,L) = & State_Chm(LCHNK)%Species(1,:nY,nZ+1-L,iPSO4) * MWDry / MWPSO4 ENDDO @@ -3594,16 +3635,16 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) call aero_model_gasaerexch( loffset = iFirstCnst - 1, & ncol = NCOL, & lchnk = LCHNK, & - troplev = Trop_Lev(:nY), & + troplev = Trop_Lev(:), & delt = dT, & reaction_rates = reaction_rates, & - tfld = state%t(:nY,:), & - pmid = state%pmid(:nY,:), & - pdel = state%pdel(:nY,:), & + tfld = state%t(:,:), & + pmid = state%pmid(:,:), & + pdel = state%pdel(:,:), & mbar = mBar, & - relhum = relHum(:nY,:), & - zm = state%zm(:nY,:), & - qh2o = qH2O(:nY,:), & + relhum = relHum(:,:), & + zm = state%zm(:,:), & + qh2o = qH2O(:,:), & cwat = cldW, & cldfr = cldFrc, & cldnum = nCldWtr, & From 99c3c7417ae67222cd9f85b5885f4a4080e418ea Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 30 Nov 2020 19:30:05 -0500 Subject: [PATCH 163/239] Chore: Add note explaining why DQRLSAN needs to be zero in top layer Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 629f148d91..8aa607b2bd 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -2862,7 +2862,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%TMPU2 (1,J,L) = state%t(J,nZ+1-L) ENDDO ENDDO - !TMMF, FIX ME + ! Note: Setting DQRLSAN to zero in the top layer prevents upcoming NaNs + ! in the GEOS-Chem wet deposition routines. Given the altitude, it should + ! be zero anyway, this is just to prevent any numerical artifacts from + ! creeping in. State_Met(LCHNK)%DQRLSAN (1,:nY,nZ) = 0.0e+00_fp ! Field : T From 5242321923697d76849f03c6c1e562d994c2745a Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 3 Dec 2020 14:24:27 -0500 Subject: [PATCH 164/239] Feat: Pass GEOS-Chem aerosol emissions to MAM tendencies Signed-off-by: Thibaud Fritz --- .../geoschem/cesmgc_emissions_mod.F90 | 102 ++++++++++++++++-- src/chemistry/geoschem/chemistry.F90 | 39 +++++-- 2 files changed, 121 insertions(+), 20 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index b1dee66769..bfa188fb26 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -32,8 +32,33 @@ MODULE CESMGC_Emissions_Mod PUBLIC :: CESMGC_Emissions_Calc PUBLIC :: CESMGC_Emissions_Final + ! Constituent number for NO INTEGER :: iNO + ! Aerosol constituent number + INTEGER :: iBC1 + INTEGER :: iBC4 + INTEGER :: iH2SO4 + INTEGER :: iSOA11 + INTEGER :: iSOA12 + INTEGER :: iSOA21 + INTEGER :: iSOA22 + INTEGER :: iSOA31 + INTEGER :: iSOA32 + INTEGER :: iSOA41 + INTEGER :: iSOA42 + INTEGER :: iSOA51 + INTEGER :: iSOA52 + INTEGER :: iPOM1 + INTEGER :: iPOM4 + + INTEGER :: iBCPI + INTEGER :: iBCPO + INTEGER :: iOCPI + INTEGER :: iOCPO + INTEGER :: iSO4 + INTEGER :: iSOAS + ! MEGAN Emissions INTEGER, ALLOCATABLE :: megan_indices_map(:) REAL(r8), ALLOCATABLE :: megan_wght_factors(:) @@ -100,6 +125,32 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) ! Get constituent index for NO CALL cnst_get_ind('NO', iNO, abort=.True.) +#if defined( MODAL_AERO_4MODE ) + ! Get constituent index for aerosols + CALL cnst_get_ind('bc_a1', iBC1, abort=.True.) + CALL cnst_get_ind('bc_a4', iBC4, abort=.True.) + CALL cnst_get_ind('soa1_a1', iSOA11, abort=.True.) + CALL cnst_get_ind('soa1_a2', iSOA12, abort=.True.) + CALL cnst_get_ind('soa2_a1', iSOA21, abort=.True.) + CALL cnst_get_ind('soa2_a2', iSOA22, abort=.True.) + CALL cnst_get_ind('soa3_a1', iSOA31, abort=.True.) + CALL cnst_get_ind('soa3_a2', iSOA32, abort=.True.) + CALL cnst_get_ind('soa4_a1', iSOA41, abort=.True.) + CALL cnst_get_ind('soa4_a2', iSOA42, abort=.True.) + CALL cnst_get_ind('soa5_a1', iSOA51, abort=.True.) + CALL cnst_get_ind('soa5_a2', iSOA52, abort=.True.) + CALL cnst_get_ind('H2SO4', iH2SO4, abort=.True.) + CALL cnst_get_ind('pom_a1', iPOM1, abort=.True.) + CALL cnst_get_ind('pom_a4', iPOM4, abort=.True.) + + CALL cnst_get_ind('GC_AER_BCPI', iBCPI, abort=.True.) + CALL cnst_get_ind('GC_AER_BCPO', iBCPO, abort=.True.) + CALL cnst_get_ind('GC_AER_SOAS', iSOAS, abort=.True.) + CALL cnst_get_ind('GC_AER_SO4', iSO4, abort=.True.) + CALL cnst_get_ind('GC_AER_OCPI', iOCPI, abort=.True.) + CALL cnst_get_ind('GC_AER_OCPO', iOCPO, abort=.True.) +#endif + !----------------------------------------------------------------------- ! ... initialize the lightning module !----------------------------------------------------------------------- @@ -170,11 +221,11 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) ENDIF ! MEGAN history fields - CALL addfld( 'MEG_'//TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & + CALL Addfld( 'MEG_'//TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & Description ) !if (history_chemistry) then - CALL add_default('MEG_'//TRIM(SpcName), 1, ' ') + CALL Add_default('MEG_'//TRIM(SpcName), 1, ' ') !endif ENDDO ENDIF @@ -259,7 +310,6 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) ! Logical LOGICAL :: rootChunk - LOGICAL, SAVE :: FIRST = .True. ! Objects TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in current chunk @@ -306,7 +356,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) ENDIF IF ( tmpIdx < 0 ) THEN - IF ( rootChunk ) Write(iulog,'(a,a)') "CESMGC_Emissions_Calc: Field not found ", & + IF ( rootChunk ) Write(iulog,'(a,a)') " CESMGC_Emissions_Calc: Field not found ", & TRIM(fldname_ns) ELSE ! This is already in chunk, retrieve it @@ -328,15 +378,15 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) pbuf_chnk => NULL() IF ( MINVAL(eflx(:,:,M)) < 0.0e+00_r8 ) THEN - Write(iulog,*) "CESMGC_Emissions_Calc: HEMCO emission flux is negative for ", & + Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO emission flux is negative for ", & TRIM(cnst_name(M)), " with value ", MINVAL(eflx(:,:,M)), " at ", & MINLOC(eflx(:,:,M)) ENDIF IF ( rootChunk .and. ( MAXVAL(eflx(1:nY,:,M)) > 0.0e+0_r8 ) ) THEN - Write(iulog,'(a,a,a,a)') "CESMGC_Emissions_Calc: HEMCO flux ", & + Write(iulog,'(a,a,a,a)') " CESMGC_Emissions_Calc: HEMCO flux ", & TRIM(fldname_ns), " added to ", TRIM(cnst_name(M)) - Write(iulog,'(a,a,E16.4)') "CESMGC_Emissions_Calc: Maximum flux ", & + Write(iulog,'(a,a,E16.4)') " CESMGC_Emissions_Calc: Maximum flux ", & TRIM(fldname_ns), MAXVAL(eflx(1:nY,:,M)) ENDIF ENDIF @@ -362,11 +412,47 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) ENDDO ENDDO +#if defined( MODAL_AERO_4MODE ) !----------------------------------------------------------------------- ! Aerosol emissions (dust + seasalt) ... !----------------------------------------------------------------------- call aero_model_emissions( state, cam_in ) + ! Since GEOS-Chem DST* aerosols are inherited from MAM's DST, we do not + ! need to feed MAM dust emissions into the GEOS-Chem DST* constituents + ! Same thing applies for sea salt. + + ! However, emissions of other aerosols (black carbon, organic carbon, + ! secondary organic aerosols and SO4), as read by HEMCO, need to be fed + ! to MAM's aerosol emission flux + eflx(:nY,:nZ,iBC1) = eflx(:nY,:nZ,iBCPI) + eflx(:nY,:nZ,iBCPI) = 0.0e+00_r8 + eflx(:nY,:nZ,iBC4) = eflx(:nY,:nZ,iBCPO) + eflx(:nY,:nZ,iBCPO) = 0.0e+00_r8 + + eflx(:nY,:nZ,iH2SO4) = eflx(:nY,:nZ,iSO4) + eflx(:nY,:nZ,iSO4) = 0.0e+00_r8 + + ! For SOA emission, split evently GEOS-Chem SOAS emission into each + ! VBS bin. + eflx(:nY,:nZ,iSOA11) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 + eflx(:nY,:nZ,iSOA12) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 + eflx(:nY,:nZ,iSOA21) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 + eflx(:nY,:nZ,iSOA22) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 + eflx(:nY,:nZ,iSOA31) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 + eflx(:nY,:nZ,iSOA32) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 + eflx(:nY,:nZ,iSOA41) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 + eflx(:nY,:nZ,iSOA42) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 + eflx(:nY,:nZ,iSOA51) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 + eflx(:nY,:nZ,iSOA52) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 + eflx(:nY,:nZ,iSO4S) = 0.0e+00_r8 + + eflx(:nY,:nZ,iPOM1) = eflx(:nY,:nZ,iOCPI) + eflx(:nY,:nZ,iOCPI) = 0.0e+00_r8 + eflx(:nY,:nZ,iPOM4) = eflx(:nY,:nZ,iOCPO) + eflx(:nY,:nZ,iOCPO) = 0.0e+00_r8 +#endif + !----------------------------------------------------------------------- ! MEGAN emissions ... !----------------------------------------------------------------------- @@ -418,8 +504,6 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) cam_in%cflx(1:nY,:) = cam_in%cflx(1:nY,:) + eflx(1:nY,nZ,:) eflx(1:nY,nZ,:) = 0.0e+00_r8 - IF ( FIRST ) FIRST = .False. - END SUBROUTINE CESMGC_Emissions_Calc !EOC !------------------------------------------------------------------------------ diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 8aa607b2bd..1ec8725b3e 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -1928,7 +1928,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use rad_constituents, only : rad_cnst_get_info ! GEOS-Chem version of physical constants - use PhysConstants, only : PI, PI_180, g0, AVO, Re + use PhysConstants, only : PI, PI_180, g0, AVO, Re, g0_100 ! CAM version of physical constants use PhysConst, only : MWDry, Gravit @@ -2248,6 +2248,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Initialize tendency array CALL Physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) + ! Reset chemical tendencies + ptend%q(:,:,:) = 0.0e+0_r8 + ! Determine current date and time CALL Get_Curr_Date( yr = currYr, & mon = currMo, & @@ -3408,14 +3411,26 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO N = 1, pcnst M = map2GC(N) - IF ( M < 0 ) CYCLE - DO J = 1, nY - DO L = 1, nZ - State_Chm(LCHNK)%Species(1,J,L,M) = State_Chm(LCHNK)%Species(1,J,L,M) & - + eflx(J,nZ+1-L,N) * dT - ENDDO - ENDDO + IF ( M > 0 ) THEN + ! Add to GEOS-Chem species + DO J = 1, nY + DO L = 1, nZ + State_Chm(LCHNK)%Species(1,J,L,M) = State_Chm(LCHNK)%Species(1,J,L,M) & + + eflx(J,nZ+1-L,N) * dT + ENDDO + ENDDO + ELSE + ! Add to constituent (mostly for MAM4 aerosols) + ! Convert from kg/m2/s to kg/kg/s + DO J = 1, nY + DO L = 1, nZ + ptend%q(J,nZ+1-L,N) = ptend%q(J,nZ+1-L,N) & + + eflx(J,nZ+1-L,N) & + / ( g0_100 * State_Met(LCHNK)%DELP_DRY(1,J,L) ) + ENDDO + ENDDO + ENDIF ENDDO ! Convert back to original unit @@ -3715,17 +3730,19 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) state = state, & LCHNK = LCHNK ) - ! Re-flip all the arrays vertically - ptend%q(:,:,:) = 0.0e+0_r8 MMR_End = 0.0e+0_r8 DO N = 1, pcnst M = map2GC(N) IF ( M > 0 ) THEN + ! Add change in mass mixing ratio to tendencies. + ! For NEU wet deposition, the wet removal rates are added to + ! ptend. DO J = 1, nY DO L = 1, nZ MMR_End (J,L,M) = REAL(State_Chm(LCHNK)%Species(1,J,L,M),r8) MMR_TEnd(J,L,M) = MMR_End(J,L,M) - MMR_Beg(J,L,M) - ptend%q(J,nZ+1-L,N) = (MMR_End(J,L,M)-MMR_Beg(J,L,M))/dT + ptend%q(J,nZ+1-L,N) = ptend%q(J,nZ+1-L,N) & + + (MMR_End(J,L,M)-MMR_Beg(J,L,M))/dT ENDDO ENDDO ENDIF From fbbe603e91c23f848b56b9f44a8c9e1d83166f6b Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 3 Dec 2020 16:17:59 -0500 Subject: [PATCH 165/239] Fix: Fix typo SO4S vs SOAS Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_emissions_mod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index bfa188fb26..5877c8e735 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -445,7 +445,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) eflx(:nY,:nZ,iSOA42) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 eflx(:nY,:nZ,iSOA51) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 eflx(:nY,:nZ,iSOA52) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSO4S) = 0.0e+00_r8 + eflx(:nY,:nZ,iSOAS) = 0.0e+00_r8 eflx(:nY,:nZ,iPOM1) = eflx(:nY,:nZ,iOCPI) eflx(:nY,:nZ,iOCPI) = 0.0e+00_r8 From 0a0afd572dfbe7820f504ea2db58e0195075be3c Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 3 Dec 2020 16:20:46 -0500 Subject: [PATCH 166/239] Feat: Enforce lq('Q') to be true if passing H2O tendencies (1) lq(cQ) = .True. if applyQTend is True (2) iFirstCnst is now a variable in chem_mods (3) Reset cam_in%cflx for all species (including MAM aerosols) Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 8 ++-- src/chemistry/geoschem/chem_mods.F90 | 3 ++ src/chemistry/geoschem/chemistry.F90 | 53 ++++++++++++---------- 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 3f8235da12..fc9cdc37a8 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -68,6 +68,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) USE CHEM_MODS, ONLY : tracerNames, tracerLongNames USE CHEM_MODS, ONLY : slsNames, slsLongNames USE CHEM_MODS, ONLY : gas_pcnst + USE CHEM_MODS, ONLY : iFirstCnst USE MO_TRACNAME, ONLY : solsym USE CONSTITUENTS, ONLY : pcnst, cnst_name USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only @@ -171,7 +172,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ENDIF ! Surface fluxes (emissions - drydep) - DO I = 1, pcnst + DO I = iFirstCnst, pcnst SpcName = 'SurfFlux_'//TRIM(cnst_name(I)) CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & TRIM(SpcName)//' surface flux') @@ -310,6 +311,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & USE CHEM_MODS, ONLY : slsNames USE CHEM_MODS, ONLY : nSls USE CHEM_MODS, ONLY : map2GC, map2Idx, map2GC_Sls + USE CHEM_MODS, ONLY : iFirstCnst USE DRYDEP_MOD, ONLY : depName, Ndvzind USE CAMSRFEXCH, ONLY : cam_in_t USE PHYSICS_TYPES, ONLY : physics_state @@ -392,7 +394,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & rootChunk = ( MasterProc.and.(LCHNK==BEGCHUNK) ) ! Write diagnostic output - DO N = 1, pcnst + DO N = iFirstCnst, pcnst M = map2GC(N) I = map2Idx(N) IF ( M > 0 ) THEN @@ -455,7 +457,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ENDIF ! Surface fluxes (emissions - drydep) - DO N = 1, pcnst + DO N = iFirstCnst, pcnst SpcName = 'SurfFlux_'//TRIM(cnst_name(N)) CALL OutFld( TRIM(SpcName), cam_in%cflx(:nY,N), nY, LCHNK ) ENDDO diff --git a/src/chemistry/geoschem/chem_mods.F90 b/src/chemistry/geoschem/chem_mods.F90 index 905cc7b922..ab0821159c 100644 --- a/src/chemistry/geoschem/chem_mods.F90 +++ b/src/chemistry/geoschem/chem_mods.F90 @@ -14,6 +14,9 @@ module chem_mods REAL(r8) :: MWRatio(nTracersMax) REAL(r8) :: ref_MMR(nTracersMax) + ! Index of first constituent + INTEGER :: iFirstCnst + ! Short-lived species (i.e. not advected) INTEGER, PARAMETER :: nSlsMax = 500 ! UNadvected species only INTEGER :: nSls diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 1ec8725b3e..92035ddca7 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -47,6 +47,7 @@ module chemistry use chem_mods, only : adv_mass use chem_mods, only : mwRatio use chem_mods, only : ref_MMR + use chem_mods, only : iFirstCnst use chem_mods, only : nSlsMax use chem_mods, only : nSls use chem_mods, only : slsNames, slsLongNames @@ -127,12 +128,9 @@ module chemistry INTEGER :: NDX_CMFDQR ! Convective total precip. production rate [kg/kg/s] ! Get constituent indices - INTEGER :: ixCldLiq ! Cloud liquid water - INTEGER :: ixCldIce ! Cloud ice - INTEGER :: ixNDrop ! Cloud droplet number index - - ! Index of 1st constituent - INTEGER :: iFirstCnst = -1 + INTEGER :: ixCldLiq ! Cloud liquid water + INTEGER :: ixCldIce ! Cloud ice + INTEGER :: ixNDrop ! Cloud droplet number index ! lightning REAL(r8) :: lght_no_prd_factor = 1._r8 @@ -145,23 +143,23 @@ module chemistry REAL(r8) :: Air_Total ! Filenames to compute dry deposition velocities similarly to MOZART - character(len=shr_kind_cl) :: clim_soilw_file = 'clim_soilw_file' - character(len=shr_kind_cl) :: depvel_file = '' - character(len=shr_kind_cl) :: depvel_lnd_file = 'depvel_lnd_file' - character(len=shr_kind_cl) :: season_wes_file = 'season_wes_file' + character(len=shr_kind_cl) :: clim_soilw_file = 'clim_soilw_file' + character(len=shr_kind_cl) :: depvel_file = '' + character(len=shr_kind_cl) :: depvel_lnd_file = 'depvel_lnd_file' + character(len=shr_kind_cl) :: season_wes_file = 'season_wes_file' character(len=shr_kind_cl) :: srf_emis_specifier(pcnst) = '' character(len=shr_kind_cl) :: ext_frc_specifier(pcnst) = '' - character(len=24) :: srf_emis_type = 'CYCLICAL' ! 'CYCLICAL' | 'SERIAL' | 'INTERP_MISSING_MONTHS' - integer :: srf_emis_cycle_yr = 0 - integer :: srf_emis_fixed_ymd = 0 - integer :: srf_emis_fixed_tod = 0 + character(len=24) :: srf_emis_type = 'CYCLICAL' ! 'CYCLICAL' | 'SERIAL' | 'INTERP_MISSING_MONTHS' + integer :: srf_emis_cycle_yr = 0 + integer :: srf_emis_fixed_ymd = 0 + integer :: srf_emis_fixed_tod = 0 - character(len=24) :: ext_frc_type = 'CYCLICAL' ! 'CYCLICAL' | 'SERIAL' | 'INTERP_MISSING_MONTHS' - integer :: ext_frc_cycle_yr = 0 - integer :: ext_frc_fixed_ymd = 0 - integer :: ext_frc_fixed_tod = 0 + character(len=24) :: ext_frc_type = 'CYCLICAL' ! 'CYCLICAL' | 'SERIAL' | 'INTERP_MISSING_MONTHS' + integer :: ext_frc_cycle_yr = 0 + integer :: ext_frc_fixed_ymd = 0 + integer :: ext_frc_fixed_tod = 0 !================================================================================================ @@ -327,6 +325,7 @@ subroutine chem_register CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + iFirstCnst = -1 map2GC = -1 map2GCinv = -1 map2chm = -1 @@ -1353,7 +1352,7 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%ddVel_CLM = .False. ! applyQtend: apply tendencies of water vapor to specific humidity - Input_Opt%applyQtend = .True. + Input_Opt%applyQtend = .False. ! Read in data for Linoz. All CPUs allocate one array to hold the data. Only ! the root CPU reads in the data; then we copy it out to a temporary array, @@ -1762,7 +1761,6 @@ subroutine chem_init(phys_state, pbuf2d) ! Free pointer SpcInfo => NULL() - ! Get indices for physical fields in physics buffer NDX_PBLH = pbuf_get_index('pblh' ) NDX_FSDS = pbuf_get_index('FSDS' ) @@ -2221,7 +2219,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) P = map2MAM4(SM,M) - State_Chm(LCHNK)%Species(1,:nY,:nZ,P) = 0.0e+00_fp + IF ( P > 0 ) State_Chm(LCHNK)%Species(1,:nY,:nZ,P) = 0.0e+00_fp ENDDO ENDDO @@ -2245,6 +2243,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO #endif + ! If H2O tendencies are propagated to specific humidity, then make sure + ! that Q actually applies tendencies + IF ( Input_Opt%applyQtend ) lq(cQ) = .True. + ! Initialize tendency array CALL Physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) @@ -3750,7 +3752,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( Input_Opt%applyQtend ) THEN ! Apply GEOS-Chem's H2O mixing ratio tendency to CAM's specific humidity - ! TMMF, this might need to set lq(cQ) = lq(cH2O) ( = .True. ) + ! This requires to set lq(cQ) = lq(cH2O) ( = .True. ) ptend%q(:,:,cQ) = ptend%q(:,:,cH2O) ENDIF @@ -4013,9 +4015,10 @@ subroutine chem_emissions( state, cam_in ) ! Reset surface fluxes !----------------------------------------------------------------------- - DO M = 2, pcnst - N = map2chm(M) - IF ( N > 0 ) cam_in%cflx(1:nY,N) = 0.0e+0_r8 + DO M = iFirstCnst, pcnst + !N = map2chm(M) + !IF ( N > 0 ) cam_in%cflx(1:nY,N) = 0.0e+0_r8 + cam_in%cflx(1:nY,M) = 0.0e+0_r8 ENDDO end subroutine chem_emissions From e3fb0f19a3e2bdc019c3350fdae0dba5d6c19824 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 22 Dec 2020 12:38:33 -0500 Subject: [PATCH 167/239] Feat: Only diagnose wet deposition rates of soluble species Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index fc9cdc37a8..cb2158eccd 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -17,6 +17,7 @@ MODULE CESMGC_Diag_Mod ! USE SHR_KIND_MOD, ONLY : r8 => shr_kind_r8 USE SPMD_UTILS, ONLY : MasterProc + USE PPGRID, ONLY : begchunk USE CAM_LOGFILE, ONLY : iulog USE Error_Mod ! For error checking USE ErrCode_Mod ! Error codes for success or failure @@ -69,6 +70,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) USE CHEM_MODS, ONLY : slsNames, slsLongNames USE CHEM_MODS, ONLY : gas_pcnst USE CHEM_MODS, ONLY : iFirstCnst + USE CHEM_MODS, ONLY : map2chm USE MO_TRACNAME, ONLY : solsym USE CONSTITUENTS, ONLY : pcnst, cnst_name USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only @@ -97,6 +99,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Logical LOGICAL :: Found + LOGICAL :: isWD ! Strings CHARACTER(LEN=255) :: SpcName @@ -180,6 +183,18 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN DO N = 1, gas_pcnst + M = map2chm(N) + isWD = .False. + IF ( M > 0 ) THEN + SpcInfo => State_Chm%SpcData(M)%Info + isWD = SpcInfo%Is_WetDep + + ! Free pointer + SpcInfo => NULL() + ENDIF + + IF ( .NOT. isWD ) CYCLE + SpcName = 'DTWR_'//TRIM(solsym(N)) CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg/s', & 'wet removal tendency' ) @@ -315,7 +330,6 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & USE DRYDEP_MOD, ONLY : depName, Ndvzind USE CAMSRFEXCH, ONLY : cam_in_t USE PHYSICS_TYPES, ONLY : physics_state - USE PPGRID, ONLY : begchunk USE SPMD_UTILS, ONLY : MasterProc #if defined( MODAL_AERO_4MODE ) USE MODAL_AERO_DATA, ONLY : lmassptr_amode From 6e3a93e11d24d1312aa8b444407771b6eccdfb5e Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 22 Dec 2020 12:41:25 -0500 Subject: [PATCH 168/239] Feat: Skip emissions on first time step before HEMCO fills in data Signed-off-by: Thibaud Fritz --- .../geoschem/cesmgc_emissions_mod.F90 | 5 +- src/chemistry/geoschem/chemistry.F90 | 84 +++++++++---------- 2 files changed, 44 insertions(+), 45 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 5877c8e735..0bca823ed9 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -249,7 +249,7 @@ END SUBROUTINE CESMGC_Emissions_Init !\\ ! !INTERFACE: ! - SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) + SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iStep ) ! ! !USES: ! @@ -287,6 +287,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) TYPE(physics_state), INTENT(IN ) :: state ! Physics state variables TYPE(physics_buffer_desc), POINTER, INTENT(IN ) :: hco_pbuf2d(:,:) ! Pointer to 2-D pbuf TYPE(MetState), INTENT(IN ) :: State_Met ! Meteorology State object + INTEGER, INTENT(IN ) :: iStep ! ! !OUTPUT PARAMETERS: ! @@ -355,7 +356,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx ) tmpIdx = pbuf_get_index(fldname_ns, RC) ENDIF - IF ( tmpIdx < 0 ) THEN + IF ( tmpIdx < 0 .OR. ( iStep == 1 ) ) THEN IF ( rootChunk ) Write(iulog,'(a,a)') " CESMGC_Emissions_Calc: Field not found ", & TRIM(fldname_ns) ELSE diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 92035ddca7..1678b78993 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -9,6 +9,7 @@ module chemistry use ppgrid, only : begchunk, endchunk, pcols use ppgrid, only : pver, pverp use constituents, only : pcnst, cnst_add, cnst_get_ind + use constituents, only : cnst_name use shr_const_mod, only : molw_dryair=>SHR_CONST_MWDAIR use seq_drydep_mod, only : nddvels => n_drydep, drydep_list use spmd_utils, only : MasterProc, myCPU=>Iam, nCPUs=>npes @@ -915,67 +916,66 @@ subroutine chem_init(phys_state, pbuf2d) ! (and declare history variables) ! !----------------------------------------------------------------------- - use physics_buffer, only : physics_buffer_desc, pbuf_get_index - use chem_mods, only : map2GC_dryDep, drySpc_ndx - use cam_history, only : addfld, add_default, horiz_only + use physics_buffer, only : physics_buffer_desc, pbuf_get_index + use chem_mods, only : map2GC_dryDep, drySpc_ndx #ifdef SPMD use mpishorthand #endif - use cam_abortutils, only : endrun - use mo_chem_utls, only : get_spc_ndx + use cam_abortutils, only : endrun + use mo_chem_utls, only : get_spc_ndx - use Phys_Grid, only : get_Area_All_p - use hycoef, only : ps0, hyai, hybi, hyam + use Phys_Grid, only : get_Area_All_p + use hycoef, only : ps0, hyai, hybi, hyam - use seq_drydep_mod, only : drydep_method, DD_XLND - use gas_wetdep_opts, only : gas_wetdep_method - use mo_neu_wetdep, only : neu_wetdep_init + use seq_drydep_mod, only : drydep_method, DD_XLND + use gas_wetdep_opts, only : gas_wetdep_method + use mo_neu_wetdep, only : neu_wetdep_init #if defined( MODAL_AERO_4MODE ) - use aero_model, only : aero_model_init - use mo_setsox, only : sox_inti - use mo_drydep, only : drydep_inti_landuse - use modal_aero_data, only : ntot_amode, nspec_amode - use modal_aero_data, only : xname_massptr + use aero_model, only : aero_model_init + use mo_setsox, only : sox_inti + use mo_drydep, only : drydep_inti_landuse + use modal_aero_data, only : ntot_amode, nspec_amode + use modal_aero_data, only : xname_massptr #endif use Input_Opt_Mod use State_Chm_Mod use State_Grid_Mod use State_Met_Mod - use DiagList_Mod, only : Init_DiagList, Print_DiagList - use TaggedDiagList_Mod,only : Init_TaggedDiagList, Print_TaggedDiagList - use GC_Grid_Mod, only : SetGridFromCtrEdges + use DiagList_Mod, only : Init_DiagList, Print_DiagList + use TaggedDiagList_Mod, only : Init_TaggedDiagList, Print_TaggedDiagList + use GC_Grid_Mod, only : SetGridFromCtrEdges ! Use GEOS-Chem versions of physical constants - use PhysConstants, only : PI, PI_180, Re + use PhysConstants, only : PI, PI_180, Re - use Time_Mod, only : Accept_External_Date_Time - use Linoz_Mod, only : Linoz_Read + use Time_Mod, only : Accept_External_Date_Time + use Linoz_Mod, only : Linoz_Read use CMN_Size_Mod - use Drydep_Mod, only : depName, Ndvzind - use Pressure_Mod, only : Accept_External_ApBp - use Chemistry_Mod, only : Init_Chemistry - use Ucx_Mod, only : Init_Ucx - use Strat_chem_Mod, only : Init_Strat_Chem - use isorropiaII_Mod, only : Init_IsorropiaII - use Input_mod, only : Validate_Directories + use Drydep_Mod, only : depName, Ndvzind + use Pressure_Mod, only : Accept_External_ApBp + use Chemistry_Mod, only : Init_Chemistry + use Ucx_Mod, only : Init_Ucx + use Strat_chem_Mod, only : Init_Strat_Chem + use isorropiaII_Mod, only : Init_IsorropiaII + use Input_mod, only : Validate_Directories use Olson_Landmap_Mod use Vdiff_Mod - use mo_setinv, only : setinv_inti - use mo_mean_mass, only : init_mean_mass - use tracer_cnst, only : tracer_cnst_init - use tracer_srcs, only : tracer_srcs_init + use mo_setinv, only : setinv_inti + use mo_mean_mass, only : init_mean_mass + use tracer_cnst, only : tracer_cnst_init + use tracer_srcs, only : tracer_srcs_init use CESMGC_Emissions_Mod, only : CESMGC_Emissions_Init use CESMGC_Diag_Mod, only : CESMGC_Diag_Init - TYPE(physics_state), INTENT(IN):: phys_state(BEGCHUNK:ENDCHUNK) - TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) + TYPE(physics_state), INTENT(IN ) :: phys_state(BEGCHUNK:ENDCHUNK) + TYPE(physics_buffer_desc), POINTER, INTENT(INOUT) :: pbuf2d(:,:) ! Local variables @@ -1941,7 +1941,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Initial MMR for all species REAL(r8) :: MMR_Beg(PCOLS,PVER,nSls+nTracers) REAL(r8) :: MMR_End(PCOLS,PVER,nSls+nTracers) - REAL(r8) :: MMR_TEnd(PCOLS,PVER,nSls+nTracers) ! Logical to apply tendencies to mixing ratios LOGICAL :: lq(pcnst) @@ -2148,6 +2147,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Map and flip gaseous species MMR_Beg = 0.0e+0_r8 + MMR_End = 0.0e+0_r8 DO N = 1, pcnst M = map2GC(N) IF ( M > 0 ) THEN @@ -2634,7 +2634,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ELSE fldname_ns = 'HCO_UV_ALBEDO' tmpIdx = pbuf_get_index(fldname_ns, RC) - IF ( tmpIdx < 0 ) THEN + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) State_Met(LCHNK)%UVALBEDO(1,:nY) = 0.0e+0_fp ELSE @@ -2677,7 +2677,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Dimensions : nX, nY fldname_ns = 'HCO_iodide' tmpIdx = pbuf_get_index(fldname_ns, RC) - IF ( tmpIdx < 0 ) THEN + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) State_Chm(LCHNK)%IODIDE(1,:nY) = 0.0e+0_fp ELSE @@ -2695,7 +2695,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Note : Possibly get ocean salinity from POP? fldname_ns = 'HCO_salinity' tmpIdx = pbuf_get_index(fldname_ns, RC) - IF ( tmpIdx < 0 ) THEN + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) State_Chm(LCHNK)%SALINITY(1,:nY) = 0.0e+0_fp ELSE @@ -2842,7 +2842,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Field : REEVAPLS ! Description: Evaporation of large-scale + anvil precipitation ! (w/r/t dry air) - ! Unit : kg + ! Unit : kg/kg/s ! Dimensions : nX, nY, nZ State_Met(LCHNK)%REEVAPLS (1,J,L) = NEvapr(J,nZ+1-L) ! kg/kg/s @@ -3374,7 +3374,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) hco_pbuf2d = hco_pbuf2d, & State_Met = State_Met(LCHNK), & cam_in = cam_in, & - eflx = eflx ) + eflx = eflx, & + iStep = iStep ) !----------------------------------------------------------------------- ! Add dry deposition flux @@ -3413,7 +3414,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO N = 1, pcnst M = map2GC(N) - IF ( M > 0 ) THEN ! Add to GEOS-Chem species DO J = 1, nY @@ -3732,7 +3732,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) state = state, & LCHNK = LCHNK ) - MMR_End = 0.0e+0_r8 DO N = 1, pcnst M = map2GC(N) IF ( M > 0 ) THEN @@ -3742,7 +3741,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO J = 1, nY DO L = 1, nZ MMR_End (J,L,M) = REAL(State_Chm(LCHNK)%Species(1,J,L,M),r8) - MMR_TEnd(J,L,M) = MMR_End(J,L,M) - MMR_Beg(J,L,M) ptend%q(J,nZ+1-L,N) = ptend%q(J,nZ+1-L,N) & + (MMR_End(J,L,M)-MMR_Beg(J,L,M))/dT ENDDO From a50163268ea95ff31a6b4ec52e1cbb53f9b3eabc Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 5 Jan 2021 09:49:26 -0500 Subject: [PATCH 169/239] Feat: Add chem_is-like function in mo_chm_utls Signed-off-by: Thibaud Fritz --- src/chemistry/mozart/mo_chem_utls.F90 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/chemistry/mozart/mo_chem_utls.F90 b/src/chemistry/mozart/mo_chem_utls.F90 index 1620422e12..6d47ed3a0a 100644 --- a/src/chemistry/mozart/mo_chem_utls.F90 +++ b/src/chemistry/mozart/mo_chem_utls.F90 @@ -3,6 +3,7 @@ module mo_chem_utls private public :: get_spc_ndx, get_het_ndx, get_extfrc_ndx, get_rxt_ndx, get_inv_ndx + public :: utls_chem_is save @@ -159,4 +160,15 @@ integer function get_rxt_ndx( rxt_tag ) end function get_rxt_ndx + logical function utls_chem_is (name) result(chem_is) + use string_utils, only : to_lower + + character(len=*), intent(in) :: name + chem_is = .false. + if ( to_lower(name) == 'mozart' ) then + chem_is = .true. + endif + + end function utls_chem_is + end module mo_chem_utls From e4a188bf3db4e802a97aa7e510e84b28894f196d Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 5 Jan 2021 16:46:35 -0500 Subject: [PATCH 170/239] Fix: Fix typo Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_emissions_mod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 0bca823ed9..b4e4faa7a2 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -496,7 +496,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! Distributed fire emissions if elevated forcing ! extfrc is in molec/cm3/s - ! TMMF - vertical distributino of fire emissions is not implemented yet + ! TMMF - vertical distribution of fire emissions is not implemented yet !CALL fire_emissions_vrt( nY, LCHNK, zint, cam_in%fireflx, cam_in%fireztop, extfrc ) !----------------------------------------------------------------------- From 87547703e29f5b7d9d139f0eed3ab56266709aa4 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 5 Jan 2021 16:47:14 -0500 Subject: [PATCH 171/239] Feat: Add or rename some output fields (1) Add option to save out chemical tendencies (kg/kg/s or kg/s) (2) Rename output fluxes to match CAM-Chem Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 142 ++++++++++++++------- src/chemistry/geoschem/chemistry.F90 | 50 +++++--- 2 files changed, 128 insertions(+), 64 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index cb2158eccd..48510ce842 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -16,8 +16,10 @@ MODULE CESMGC_Diag_Mod ! !USES: ! USE SHR_KIND_MOD, ONLY : r8 => shr_kind_r8 + USE CAM_HISTORY, ONLY : fieldname_len + USE CHEM_MODS, ONLY : gas_pcnst USE SPMD_UTILS, ONLY : MasterProc - USE PPGRID, ONLY : begchunk + USE PPGRID, ONLY : begchunk, pver USE CAM_LOGFILE, ONLY : iulog USE Error_Mod ! For error checking USE ErrCode_Mod ! Error codes for success or failure @@ -32,8 +34,8 @@ MODULE CESMGC_Diag_Mod PUBLIC :: CESMGC_Diag_Init PUBLIC :: CESMGC_Diag_Calc - ! Number of diagnosed photolytic reactions - INTEGER :: nPhotol + INTEGER :: nPhotol ! Number of diagnosed photolytic reactions + CHARACTER(LEN=FIELDNAME_LEN) :: srcnam(gas_pcnst) ! Names of source/sink tendencies ! ! !REVISION HISTORY: ! 28 Oct 2020 - T. M. Fritz - Initial version @@ -68,11 +70,11 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) USE CHEM_MODS, ONLY : nTracers, nSls USE CHEM_MODS, ONLY : tracerNames, tracerLongNames USE CHEM_MODS, ONLY : slsNames, slsLongNames - USE CHEM_MODS, ONLY : gas_pcnst USE CHEM_MODS, ONLY : iFirstCnst USE CHEM_MODS, ONLY : map2chm USE MO_TRACNAME, ONLY : solsym - USE CONSTITUENTS, ONLY : pcnst, cnst_name + USE CONSTITUENTS, ONLY : pcnst, cnst_name, sflxnam + USE CONSTITUENTS, ONLY : cnst_get_ind USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only USE GAS_WETDEP_OPTS, ONLY : gas_wetdep_method USE DRYDEP_MOD, ONLY : depName @@ -106,6 +108,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) CHARACTER(LEN=255) :: tagName CHARACTER(LEN=255) :: ThisLoc CHARACTER(LEN=255) :: ErrMsg + CHARACTER(LEN=2) :: unit_basename ! Units 'kg' or '1' ! Objects TYPE(Species), POINTER :: SpcInfo @@ -124,7 +127,10 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Assume a successful return until otherwise RC = GC_SUCCESS - ! Can add history output here too with the "addfld" & "add_default" routines + CALL Addfld( 'MASS', (/ 'lev' /), 'A', 'kg', 'Mass of grid box' ) + CALL Addfld( 'AREA', horiz_only, 'A', 'm2', 'Area of grid box' ) + CALL Addfld( 'HEIGHT', (/ 'ilev' /),'A','m', 'Geopotential height above surface at interfaces' ) + ! Note that constituents are already output by default ! Add all species as output fields if desired DO I = 1, nTracers @@ -153,7 +159,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) IF ( Input_Opt%LDryD ) THEN DO I = 1, State_Chm%nDryDep - SpcName = 'DepVel_'//TRIM(depName(I)) + SpcName = 'DV_'//TRIM(depName(I)) CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'm/s', & TRIM(SpcName)//' dry deposition velocity') ENDDO @@ -164,7 +170,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Get info about this species from the species database SpcInfo => State_Chm%SpcData(L)%Info - SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) + SpcName = 'DF_'//TRIM(SpcInfo%Name) CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & TRIM(SpcName)//' dry deposition flux') @@ -174,11 +180,22 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ENDDO ENDIF - ! Surface fluxes (emissions - drydep) - DO I = iFirstCnst, pcnst - SpcName = 'SurfFlux_'//TRIM(cnst_name(I)) - CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & - TRIM(SpcName)//' surface flux') + ! Chemical tendencies and surface fluxes + DO N = 1, gas_pcnst + srcnam(N) = 'CT_'//TRIM(solsym(N)) ! chem tendency (source/sink) + SpcName = srcnam(N) + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg/s', TRIM(SpcName)//' source/sink' ) + + CALL cnst_get_ind(solsym(N), M, abort=.false. ) + IF ( M > 0 ) THEN + IF (sflxnam(M)(3:5) == 'num') then ! name is in the form of "SF****" + unit_basename = ' 1' + ELSE + unit_basename = 'kg' + ENDIF + CALL Addfld (sflxnam(M), horiz_only, 'A', unit_basename//'/m2/s', & + TRIM(solsym(N))//' surface flux') + ENDIF ENDDO IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN @@ -262,17 +279,17 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Only print on the root CPU IF ( ASSOCIATED( Item ) ) THEN - IF (( TRIM(Item%FullName(1:8)) /= 'MET_XLAI' ) .AND. & - ( TRIM(Item%FullName(1:8)) /= 'MET_IUSE' ) .AND. & - ( TRIM(Item%FullName(1:9)) /= 'MET_ILAND' )) THEN - IF ( TRIM(Item%DimNames) == 'xy' ) THEN - CALL Addfld( TRIM( Item%FullName ), horiz_only, 'A', & - TRIM( Item%Units ), TRIM( Item%Description ) ) - ELSE - CALL Addfld( TRIM( Item%FullName ), (/ 'lev' /), 'A', & - TRIM( Item%Units ), TRIM( Item%Description ) ) - ENDIF - ENDIF + !IF (( TRIM(Item%FullName(1:8)) /= 'MET_XLAI' ) .AND. & + ! ( TRIM(Item%FullName(1:8)) /= 'MET_IUSE' ) .AND. & + ! ( TRIM(Item%FullName(1:9)) /= 'MET_ILAND' )) THEN + ! IF ( TRIM(Item%DimNames) == 'xy' ) THEN + ! CALL Addfld( TRIM( Item%FullName ), horiz_only, 'A', & + ! TRIM( Item%Units ), TRIM( Item%Description ) ) + ! ELSE + ! CALL Addfld( TRIM( Item%FullName ), (/ 'lev' /), 'A', & + ! TRIM( Item%Units ), TRIM( Item%Description ) ) + ! ENDIF + !ENDIF ENDIF @@ -281,6 +298,13 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ENDDO + ! Chemical tendencies + DO N = 1, gas_pcnst + SpcName = TRIM(solsym(N)) + CALL Addfld( 'D'//TRIM(SpcName)//'CHM', (/ 'lev' /), 'A', 'kg/s', & + 'net tendency from chemistry' ) + ENDDO + !======================================================================= ! Cleanup and quit !======================================================================= @@ -302,7 +326,7 @@ END SUBROUTINE CESMGC_Diag_Init ! SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & State_Grid, State_Met, cam_in, state, & - LCHNK ) + mmr_tend, LCHNK ) ! ! !USES: ! @@ -319,7 +343,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & USE PRECISION_MOD USE MO_TRACNAME, ONLY : solsym USE CAM_HISTORY, ONLY : outfld - USE CONSTITUENTS, ONLY : pcnst, cnst_name + USE CONSTITUENTS, ONLY : pcnst, cnst_name, sflxnam USE CHEM_MODS, ONLY : MWRatio USE CHEM_MODS, ONLY : SlsMWRatio USE CHEM_MODS, ONLY : tracerNames @@ -346,6 +370,8 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object TYPE(cam_in_t), INTENT(IN) :: cam_in ! import state TYPE(physics_state), INTENT(IN) :: state ! Physics state variables + REAL(r8), INTENT(IN) :: mmr_tend(state%ncol,pver,gas_pcnst) + ! Net tendency from chemistry in kg/s INTEGER, INTENT(IN) :: LCHNK ! Chunk number ! ! !REVISION HISTORY: @@ -407,6 +433,10 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! Define rootChunk rootChunk = ( MasterProc.and.(LCHNK==BEGCHUNK) ) + CALL OutFld( 'AREA', State_Grid%Area_M2(1,1:nY), nY, LCHNK) + CALL OutFld( 'MASS', State_Met%AD(1,1:nY,nZ:1:-1), nY, LCHNK) + CALL Outfld( 'HEIGHT', state%zi(:nY,:), nY, LCHNK ) + ! Write diagnostic output DO N = iFirstCnst, pcnst M = map2GC(N) @@ -449,7 +479,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & IF ( Input_Opt%LDryD ) THEN DO N = 1, State_Chm%nDryDep ND = NDVZIND(N) - SpcName = 'DepVel_'//TRIM(depName(N)) + SpcName = 'DV_'//TRIM(depName(N)) CALL OutFld( TRIM(SpcName), State_Chm%DryDepVel(1,:nY,ND), nY, LCHNK ) ENDDO @@ -459,7 +489,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! Get info about this species from the species database SpcInfo => State_Chm%SpcData(L)%Info - SpcName = 'DepFlux_'//TRIM(SpcInfo%Name) + SpcName = 'DF_'//TRIM(SpcInfo%Name) ! SurfaceFlux is Emissions - Drydep, but Emissions = 0, as it is applied ! externally @@ -472,10 +502,28 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! Surface fluxes (emissions - drydep) DO N = iFirstCnst, pcnst - SpcName = 'SurfFlux_'//TRIM(cnst_name(N)) + SpcName = sflxnam(N) CALL OutFld( TRIM(SpcName), cam_in%cflx(:nY,N), nY, LCHNK ) ENDDO + ! Chemical tendencies in kg/kg/s + DO N = 1, gas_pcnst + SpcName = TRIM(srcnam(N)) + CALL OutFld( TRIM(SpcName), mmr_tend(:nY,:,N), nY, LCHNK ) + ENDDO + + ! Chemical tendencies in kg/s + DO N = 1, gas_pcnst + SpcName = 'D'//TRIM(solsym(N))//'CHM' + outTmp = 0.0e+0_r8 + DO J = 1, nY + DO L = 1, nZ + outTmp(J,L) = mmr_tend(J,L,N) * REAL(State_Met%AD(1,J,nZ+1-L),r8) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDDO + ! Photolysis rates IF ( ASSOCIATED(State_Diag%Jval) ) THEN DO M = 1, nPhotol @@ -559,24 +607,24 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & Ptr3d_8 = Ptr3d_8, & RC = RC ) - IF ( Source_KindVal /= KINDVAL_I4 ) THEN - IF ( Rank == 2 ) THEN - outTmp(:,nZ) = REAL(Ptr2d_8(1,:),r8) - CALL Outfld( TRIM( Item%FullName ), outTmp(:,nZ), nY, LCHNK ) - ELSEIF ( Rank == 3 ) THEN - ! For now, treat variables defined on level edges by ignoring top - ! most layer - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(Ptr3d_8(1,J,L),r8) - ENDDO - ENDDO - CALL Outfld( TRIM( Item%FullName ), outTmp, nY, LCHNK ) - ELSE - IF ( rootChunk ) Write(iulog,*) " Item ", TRIM(Item%FullName), & - " is of rank ", Rank, " and will not be diagnosed!" - ENDIF - ENDIF + !IF ( Source_KindVal /= KINDVAL_I4 ) THEN + ! IF ( Rank == 2 ) THEN + ! outTmp(:,nZ) = REAL(Ptr2d_8(1,:),r8) + ! CALL Outfld( TRIM( Item%FullName ), outTmp(:,nZ), nY, LCHNK ) + ! ELSEIF ( Rank == 3 ) THEN + ! ! For now, treat variables defined on level edges by ignoring top + ! ! most layer + ! DO J = 1, nY + ! DO L = 1, nZ + ! outTmp(J,nZ+1-L) = REAL(Ptr3d_8(1,J,L),r8) + ! ENDDO + ! ENDDO + ! CALL Outfld( TRIM( Item%FullName ), outTmp, nY, LCHNK ) + ! ELSE + ! IF ( rootChunk ) Write(iulog,*) " Item ", TRIM(Item%FullName), & + ! " is of rank ", Rank, " and will not be diagnosed!" + ! ENDIF + !ENDIF ENDIF ENDIF diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 1678b78993..16f6a1e1a9 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -830,16 +830,16 @@ subroutine chem_readnl(nlfile) !================================================================== #if defined( SPMD ) - CALL MPIBCAST( nTracers, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST( tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) - CALL MPIBCAST( nSls, 1, MPIINT, 0, MPICOM ) - CALL MPIBCAST( slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST ( nTracers, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST ( tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM ) + CALL MPIBCAST ( nSls, 1, MPIINT, 0, MPICOM ) + CALL MPIBCAST ( slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) ! The following files are required to compute land maps, required to perform ! aerosol dry deposition - CALL MPIBCAST(depvel_lnd_file, LEN(depvel_lnd_file), MPICHAR, 0, MPICOM) - CALL MPIBCAST(clim_soilw_file, LEN(clim_soilw_file), MPICHAR, 0, MPICOM) - CALL MPIBCAST(season_wes_file, LEN(season_wes_file), MPICHAR, 0, MPICOM) + CALL MPIBCAST (depvel_lnd_file, LEN(depvel_lnd_file), MPICHAR, 0, MPICOM) + CALL MPIBCAST (clim_soilw_file, LEN(clim_soilw_file), MPICHAR, 0, MPICOM) + CALL MPIBCAST (season_wes_file, LEN(season_wes_file), MPICHAR, 0, MPICOM) CALL MPIBCAST (lght_no_prd_factor, 1, MPIR8, 0, MPICOM) CALL MPIBCAST (depvel_file, LEN(depvel_file), MPICHAR, 0, MPICOM) @@ -848,7 +848,7 @@ subroutine chem_readnl(nlfile) CALL MPIBCAST (srf_emis_cycle_yr, 1, MPIINT, 0, MPICOM) CALL MPIBCAST (srf_emis_fixed_ymd, 1, MPIINT, 0, MPICOM) CALL MPIBCAST (srf_emis_fixed_tod, 1, MPIINT, 0, MPICOM) - CALL MPIBCAST (srf_emis_specifier, LEN(srf_emis_specifier(1))*pcnst, MPICHAR, 0, MPICOM) + CALL MPIBCAST (ext_frc_specifier, LEN(ext_frc_specifier(1))*pcnst, MPICHAR, 0, MPICOM) CALL MPIBCAST (ext_frc_type, LEN(ext_frc_type), MPICHAR, 0, MPICOM) CALL MPIBCAST (ext_frc_cycle_yr, 1, MPIINT, 0, MPICOM) CALL MPIBCAST (ext_frc_fixed_ymd, 1, MPIINT, 0, MPICOM) @@ -1992,6 +1992,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! For GEOS-Chem diagnostics REAL(r8) :: mmr1(state%NCOL,PVER,gas_pcnst) + REAL(r8) :: mmr_tend(state%NCOL,PVER,gas_pcnst) REAL(r8) :: wk_out(state%NCOL) LOGICAL :: isWD LOGICAL :: Found @@ -2202,6 +2203,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO L = 1, nZ vmr0(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) * & MWDry / adv_mass(N) + ! We'll substract concentrations after chemistry later + mmr_tend(J,L,N) = REAL(State_Chm(LCHNK)%Species(1,J,nZ+1-L,M),r8) ENDDO ENDDO ELSEIF ( M < 0 ) THEN @@ -3723,15 +3726,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Air_Total = Air_Total + tmpMass #endif - CALL CESMGC_Diag_Calc( Input_Opt = Input_Opt, & - State_Chm = State_Chm(LCHNK), & - State_Diag = State_Diag(LCHNK), & - State_Grid = State_Grid(LCHNK), & - State_Met = State_Met(LCHNK), & - cam_in = cam_in, & - state = state, & - LCHNK = LCHNK ) - DO N = 1, pcnst M = map2GC(N) IF ( M > 0 ) THEN @@ -3748,12 +3742,34 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDDO + DO N = 1, gas_pcnst + ! See definition of map2chm + M = map2chm(N) + IF ( M > 0 ) THEN + DO J = 1, nY + DO L = 1, nZ + mmr_tend(J,L,N) = ( REAL(State_Chm(LCHNK)%Species(1,J,nZ+1-L,M),r8) - mmr_tend(J,L,N) ) / dT + ENDDO + ENDDO + ENDIF + ENDDO + IF ( Input_Opt%applyQtend ) THEN ! Apply GEOS-Chem's H2O mixing ratio tendency to CAM's specific humidity ! This requires to set lq(cQ) = lq(cH2O) ( = .True. ) ptend%q(:,:,cQ) = ptend%q(:,:,cH2O) ENDIF + CALL CESMGC_Diag_Calc( Input_Opt = Input_Opt, & + State_Chm = State_Chm(LCHNK), & + State_Diag = State_Diag(LCHNK), & + State_Grid = State_Grid(LCHNK), & + State_Met = State_Met(LCHNK), & + cam_in = cam_in, & + state = state, & + mmr_tend = mmr_tend, & + LCHNK = LCHNK ) + ! Debug statements ! Ozone tendencies IF ( rootChunk ) THEN From 8489ec5f002dde9e906fdaf46dc2d9b2f18efd9a Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 6 Jan 2021 18:45:56 -0500 Subject: [PATCH 172/239] Feat: Add _CLFX and other CAM-Chem like diagnostics to CESM-GC Signed-off-by: Thibaud Fritz --- .../geoschem/cesmgc_emissions_mod.F90 | 79 +++++++++++++------ 1 file changed, 57 insertions(+), 22 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index b4e4faa7a2..42bdb4befb 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -18,6 +18,8 @@ MODULE CESMGC_Emissions_Mod USE SHR_KIND_MOD, ONLY : r8 => shr_kind_r8 USE SPMD_UTILS, ONLY : MasterProc USE CAM_ABORTUTILS, ONLY : endrun + USE CHEM_MODS, ONLY : iFirstCnst + USE CONSTITUENTS, ONLY : pcnst, cnst_name USE SHR_MEGAN_MOD, ONLY : shr_megan_mechcomps, shr_megan_mechcomps_n USE CAM_LOGFILE, ONLY : iulog @@ -230,6 +232,21 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) ENDDO ENDIF + DO N = iFirstCnst, pcnst + SpcName = TRIM(cnst_name(N))//'_XFRC' + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'molec/cm3/s', & + 'External forcing for '//TRIM(cnst_name(N))) + SpcName = TRIM(cnst_name(N))//'_CLXF' + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'molec/cm2/s', & + 'Vertically-integrated external forcing for '//TRIM(cnst_name(N))) + SpcName = TRIM(cnst_name(N))//'_CMXF' + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/m2/s', & + 'Vertically-integrated external forcing for '//TRIM(cnst_name(N))) + ENDDO + + CALL Addfld( 'NO_Lightning', (/ 'lev' /), 'A','molec/cm3/s', & + 'lightning NO source' ) + !----------------------------------------------------------------------- ! ... Fire emissions !----------------------------------------------------------------------- @@ -255,7 +272,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! USE State_Met_Mod, ONLY : MetState USE CAMSRFEXCH, ONLY : cam_in_t - USE CONSTITUENTS, ONLY : cnst_name, cnst_get_ind, cnst_mw, pcnst + USE CONSTITUENTS, ONLY : cnst_get_ind, cnst_mw USE CHEM_MODS, ONLY : tracerNames, nTracers, map2GCinv USE PHYSICS_TYPES, ONLY : physics_state USE PHYSICS_BUFFER, ONLY : pbuf_get_index, pbuf_get_chunk @@ -280,7 +297,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! GEOS-Chem version of physical constants USE PHYSCONSTANTS, ONLY : AVO ! CAM version of physical constants - USE PHYSCONST, ONLY : rga + USE PHYSCONST, ONLY : rga, avogad ! ! !INPUT PARAMETERS: ! @@ -324,6 +341,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS REAL(r8), PARAMETER :: m2km = 1.e-3_r8 ! Strings + CHARACTER(LEN=255) :: SpcName CHARACTER(LEN=255) :: fldname_ns ! field name HCO_* !================================================================= @@ -393,26 +411,6 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ENDIF ENDDO - !----------------------------------------------------------------------- - ! Lightning NO emissions - !----------------------------------------------------------------------- - M = iNO - - ! prod_NO is in atom N cm^-3 s^-1 <=> molec cm^-3 s^-1 - ! We need to convert this to kg NO/m2/s - ! Multiply by MWNO * BXHEIGHT * 1.0E+06 / AVO - ! = mole/molec * kg NO/mole * m * cm^3/m^3 - ! cnst_mw(M) is in g/mole - SCALFAC = cnst_mw(M) * 1.0E-03 * 1.0E+06 / AVO - DO J = 1, nY - DO L = 1, nZ - eflx(J,L,M) = eflx(J,L,M) & - + prod_NO(J,L,LCHNK) & - * State_Met%BXHEIGHT(1,J,nZ+1-L) & - * SCALFAC - ENDDO - ENDDO - #if defined( MODAL_AERO_4MODE ) !----------------------------------------------------------------------- ! Aerosol emissions (dust + seasalt) ... @@ -454,6 +452,43 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS eflx(:nY,:nZ,iOCPO) = 0.0e+00_r8 #endif + ! Output fields before lightning NO emissions are applied to eflx + DO N = iFirstCnst, pcnst + SpcName = TRIM(cnst_name(N))//'_XFRC' + CALL Outfld( TRIM(SpcName), eflx(:,:,N) / State_Met%BXHEIGHT(1,:,nZ:1:-1) * 1.0E-06 / cnst_mw(N) * avogad, nY, LCHNK ) + + SpcName = TRIM(cnst_name(N))//'_CLXF' + ! Convert from kg/m2/s to molec/cm2/s + ! Note 1: cnst_mw is in kg/kmole + ! Note 2: avogad is in molecules/kmole + CALL Outfld( TRIM(SpcName), SUM(eflx(:,:,N), DIM=2) * 1.0E-04 / cnst_mw(N) * avogad, nY, LCHNK ) + + SpcName = TRIM(cnst_name(N))//'_CMXF' + CALL Outfld( TRIM(SpcName), SUM(eflx(:,:,N), DIM=2), nY, LCHNK ) + ENDDO + + !----------------------------------------------------------------------- + ! Lightning NO emissions + !----------------------------------------------------------------------- + M = iNO + + ! prod_NO is in atom N cm^-3 s^-1 <=> molec cm^-3 s^-1 + ! We need to convert this to kg NO/m2/s + ! Multiply by MWNO * BXHEIGHT * 1.0E+06 / AVO + ! = mole/molec * kg NO/mole * m * cm^3/m^3 + ! cnst_mw(M) is in g/mole + SCALFAC = cnst_mw(M) * 1.0E-03 * 1.0E+06 / AVO + DO J = 1, nY + DO L = 1, nZ + eflx(J,L,M) = eflx(J,L,M) & + + prod_NO(J,L,LCHNK) & + * State_Met%BXHEIGHT(1,J,nZ+1-L) & + * SCALFAC + ENDDO + ENDDO + + CALL Outfld( 'NO_Lightning', prod_NO(:nY,:,LCHNK), nY, LCHNK ) + !----------------------------------------------------------------------- ! MEGAN emissions ... !----------------------------------------------------------------------- From 2eea5eda76c52e57f0e914d5ce4fdc3bb27d2e8e Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 8 Jan 2021 17:28:05 -0500 Subject: [PATCH 173/239] Feat: Add new GC compsets that mimic CAM-Chem compsets (1) New compsets (2) Enforce NTHRDS_ATM to be 1 when running with GEOS-Chem Signed-off-by: Thibaud Fritz --- cime_config/config_component.xml | 22 +++++++++++++++------- cime_config/config_compsets.xml | 26 ++++++++++++++++---------- cime_config/config_pes.xml | 5 +++++ 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 4f7c657938..a3ea777227 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -11,7 +11,7 @@ CAM cam6 physics: CAM cam5 physics: CAM cam4 physics: - CAM simplified and non-versioned physics : + CAM simplified and non-versioned physics : CAM-Chem troposphere/stratosphere chem with simplified volatility basis set SOA scheme and modal aersols : + GEOS-Chem troposphere/stratosphere chemistry : CAM-Chem troposphere/stratosphere chem with simplified volatility basis set SOA scheme and fire emissons : CAM CLUBB - turned on by default in CAM60: - CAM-Chem troposphere/stratosphere chem with extended volatility basis set SOA scheme and modal aersols : + CAM-Chem troposphere/stratosphere chem with extended volatility basis set SOA scheme and modal aerosols : CAM CO2 ramp: CAM super-parameterized CAM one moment SAM microphysics CAM super-parameterized CAM one moment SAM microphysics using CLUBB CAM super-parameterized CAM double moment m2005 SAM microphysics + CAM super-parameterized CAM double moment m2005 SAM microphysics using GEOS-Chem CAM super-parameterized CAM double moment m2005 SAM microphysics using CLUBB CAM tropospheric chemistry with bulk aerosols: @@ -65,7 +67,6 @@ CAM dry adiabatic baroclinic instability (Polvani et al., 2004): CAM moist Held-Suarez forcing (Thatcher and Jablonowski, 2016): CAM dry Held-Suarez forcing (Held and Suarez (1994)): - CAM with GEOS-Chem: CAM with GEOS-Chem dycore test: CAM moist dynamical core test with Ullrich et al. (2014) baroclinic wave IC, Kessler physics and terminator chemistry: @@ -119,12 +120,14 @@ -chem trop_strat_mam4_vbs + -chem geoschem_mam4 -chem trop_strat_mam4_vbsext -clubb_sgs -dyn eul -scam -rad camrt -chem none -spcam_nx 32 -spcam_ny 1 -spcam_dx 4000 -spcam_dt 20 -phys spcam_sam1mom -rad camrt -chem none -spcam_nx 32 -spcam_ny 1 -spcam_dx 4000 -spcam_dt 20 -phys spcam_sam1mom -spcam_clubb_sgs -rad rrtmg -chem trop_mam3 -spcam_nx 32 -spcam_ny 1 -spcam_dx 4000 -spcam_dt 20 -phys spcam_m2005 + -rad rrtmg -chem geoschem_mam3 -spcam_nx 32 -spcam_ny 1 -spcam_dx 4000 -spcam_dt 20 -phys spcam_m2005 -rad rrtmg -chem trop_mam3 -spcam_nx 32 -spcam_ny 1 -spcam_dx 4000 -spcam_dt 20 -phys spcam_m2005 -spcam_clubb_sgs -chem trop_mozart @@ -196,11 +199,17 @@ 2000_cam4_trop_chem waccmxie_ma_2000_cam4 + geoschem + geoschem + geoschem + geoschem_baro_moist + 2000_cam6 waccm_tsmlt_2000_cam6 waccm_ma_2000_cam6 waccm_sc_2000_cam6 2000_trop_strat_vbs_cam6 + geoschem_2000 aquaplanet_cam4 aquaplanet_cam4 @@ -213,6 +222,7 @@ 2010_trop_strat_vbs_cam6 waccm_tsmlt_2010_cam6 waccm_sc_2010_cam6 + geoschem_2010 1850-2005_cam5 1850-2005_cam4 @@ -230,6 +240,7 @@ hist_trop_strat_vbs_cam6 hist_trop_strat_vbsext_cam6 hist_trop_strat_vbsfire_cam6 + hist_geoschem 1850-PD_cam5 @@ -261,6 +272,7 @@ sd_waccm_mad_cam6 sd_waccm_ma_cam4 sd_trop_strat_vbs_cam6 + sd_geoschem sd_cam6 dabi_p2004 @@ -271,10 +283,6 @@ scam_arm97 - geoschem - geoschem - geoschem - geoschem_baro_moist run_component_cam env_run.xml diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 141f3a6201..1f6db389fd 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -383,30 +383,35 @@ + + + + + - GEOSCHEM - 2000_CAM40%GC_SLND_SICE_SOCN_SROF_SGLC_SWAV + FSPCAMM_GC + 2000_CAM%SPCAMMGC_CLM50%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV - GEOSCHEMTEST - 2000_CAM%GCHS_SLND_SICE_SOCN_SROF_SGLC_SWAV + FC2000climo_GC + 2000_CAM60%GC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV - FGC - 2000_CAM60%GC_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV + FC2010climo_GC + 2010_CAM60%GC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV - FGC_CLM45 - 2000_CAM60%GC_CLM45%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV + FCHIST_GC + HIST_CAM60%GC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV - FGC_CLM50 - 2000_CAM60%GC_CLM50%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV + FCSD_GC + HIST_CAM60%GC%SDYN_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV @@ -631,6 +636,7 @@ 1 1 + 1 diff --git a/cime_config/config_pes.xml b/cime_config/config_pes.xml index d4e7ae45c8..bb4abfe015 100644 --- a/cime_config/config_pes.xml +++ b/cime_config/config_pes.xml @@ -1698,6 +1698,11 @@ 1 + + + 1 + + From cbba931603b28f53b85538f24fe51ac1539d49d7 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 8 Jan 2021 17:30:10 -0500 Subject: [PATCH 174/239] Feat: Add new use_cases XML entries for newly added GC compsets Signed-off-by: Thibaud Fritz --- bld/namelist_files/use_cases/geoschem.xml | 6 +- .../use_cases/hist_geoschem.xml | 172 +++++++++++++++++ bld/namelist_files/use_cases/sd_geoschem.xml | 180 ++++++++++++++++++ 3 files changed, 357 insertions(+), 1 deletion(-) create mode 100644 bld/namelist_files/use_cases/hist_geoschem.xml create mode 100644 bld/namelist_files/use_cases/sd_geoschem.xml diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index f4df7e3d6e..4129e9a191 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -5,7 +5,9 @@ 367.0e-6 -/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc +/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc + +/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f19_f19.134.1975.009.cam.i.2010-01-01_32L_c170403.nc atm/cam/solar/spectral_irradiance_Lean_1610-2009_ann_c100405.nc @@ -70,4 +72,6 @@ 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', +'GEOS-CHEM' + diff --git a/bld/namelist_files/use_cases/hist_geoschem.xml b/bld/namelist_files/use_cases/hist_geoschem.xml new file mode 100644 index 0000000000..8a25d032a7 --- /dev/null +++ b/bld/namelist_files/use_cases/hist_geoschem.xml @@ -0,0 +1,172 @@ + + + + +00010101 + +/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc + +/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f19_f19.134.1975.009.cam.i.2010-01-01_32L_c170403.nc + + +atm/cam/solar/SolarForcingCMIP6_18491230-23000102_c20200615.nc + + +.true. +.true. +.false. +0.25D0 + +SERIAL +atm/waccm/lb/LBC_1750-2014_CMIP6_0p5degLat_c170126.nc + + SERIAL + + + +INTERP_MISSING_MONTHS + +INTERP_MISSING_MONTHS + +'noy', 'nhx' + + + + 1,30,365,240,240,480,365,73,30 + 0,-24,-24,-3,-1,1,-24,-120,-240 +'A','A','A','A','A','A','A','A','I' + +.true. +.false. +.false. +.false. +.false. +.false. +.false. +.false. +.false. + + + + 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2', + 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO', + 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3', + 'BENZ', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', 'CFC12', + 'CH2O', 'CH3BR', 'CH3CCL3', 'ALD2', 'CH3CL', 'ACET', 'MOH', 'CH4', + 'CO', 'H2O2', 'HCFC22', 'HNO3', 'ISOP', 'MTPA', 'N2O', 'O3', + 'PAN', 'SO2', 'OH', 'ALK4', 'PRPE', 'BR', 'BRCL', 'BRO', 'BRNO3', + 'EOH', 'ETP', 'PRPE', 'RA3P', 'CCL4', 'H1211', 'H1301', + 'CFC11', 'CFC113', 'CFC114', 'CFC115', 'CFC12', 'CH2BR2', 'CH2O', + 'CH3BR', 'CH3CCL3', 'ALD2', 'CH3CL', 'MGLY', 'ACTA', 'MAP', 'MP', + 'CH4', 'CHBR3', 'CL', 'CL2', 'CL2O2', 'CLO', 'CLNO3', 'CO', + 'CO2', 'DMS', 'GLYC', 'GLYX', + 'H', 'H2', 'H2402', 'H2O2', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', + 'HCL', 'HNO3', 'HNO4', 'HOBR', 'HOCL', 'HONIT', 'HPALD1', 'HPALD2', 'HPALD3', + 'HPALD4', 'HAC', 'HC5A', 'IEPOXA', 'IEPOXB', 'IEPOXD', 'ISOP', 'IHN1', 'IHN2', 'IHN3', + 'IHN4', 'INO2B', 'INO2D', 'INPB', 'INPD', 'RIPA', 'RIPB', 'RIPC', 'RIPD', + 'MACR', 'MVKHP', 'MEK', 'MCRDH', 'MPAN', 'MVK', 'N', 'N2O', 'N2O5', 'ICN', + 'NH3', 'NH4', 'NO', 'NO2', 'NO3', 'PROPNN', 'OLND', 'OLNN', 'O', 'OCLO', + 'OCS', 'PAN', 'SO2', 'SO4', 'SOAP', 'TOLU', 'XYLE', + 'R4O2', 'BRO2', 'ETO2', 'A3O2', 'MCO3', 'MO2', 'HO2', 'O1D', 'OH', + 'H2O', 'SAD_PSC', 'SAD_SULFC', 'SAD_TROP', 'SAD_AERO', 'REFF_AERO', + 'PDELDRY', 'RAD_PSC', 'RAD_SULFC', + 'HNO3_GAS', 'HNO3_STS', 'HNO3_NAT', 'NOX', 'NOY', 'CLOX', 'CLOY', + 'BROX', 'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', + 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', + 'AODVISdn', 'AODdnMODE1', 'AODVISstdn', 'AODNIRstdn', + 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', + 'AODdnDUST3', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn', + 'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', + 'EXTINCTNIRdn', 'EXTINCTUVdn', + 'WD_EOH', 'WD_ETP', 'WD_RA3P', 'WD_CH2O', 'WD_ALD2', + 'WD_MGLY', 'WD_ACTA', 'WD_MAP', 'WD_MOH', 'WD_MP', + 'WD_GLYC', 'WD_H2O2', 'WD_SO4', 'WD_HBR', 'WD_HCL', + 'WD_HNO3', 'WD_HOBR', 'WD_HOCL', 'WD_HONIT', 'WD_HAC', 'WD_IEPOXA', + 'WD_IEPOXB', 'WD_IEPOXD', 'WD_MVK', 'WD_NH3', 'WD_NH4', 'WD_SO2', + 'DF_EOH', 'DF_ETP', 'DF_RA3P', 'DF_CH2O', 'DF_ALD2', 'DF_ACET', + 'DF_MGLY', 'DF_ACTA', 'DF_MAP', 'DF_MOH', 'DF_MP', 'DF_CO', + 'DF_GLYC', 'DF_H2O2', 'DF_SO4', 'DF_HNO3', 'DF_HNO4', + 'DF_HONIT', 'DF_HPALD1', 'DF_HPALD2', 'DF_HPALD3', 'DF_HPALD4', + 'DF_HAC', 'DF_IEPOXA', 'DF_IEPOXB', 'DF_IEPOXD', + 'DF_MPAN', 'DF_NH3', 'DF_NH4', 'DF_NO', + 'DF_NO2', 'DF_O3', 'DF_PAN', 'DF_SO2', + 'DF_SOAP', 'SO2_CLXF', 'SO2_XFRC', + 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD', 'LNO_COL_PROD', 'SOAP_CLXF', + 'SFEOH', 'SFALD2', 'SFMEK', 'SFCH2O', 'SFC2H6', 'SFC3H8', + 'SFALK4', 'SFPRPE', 'SFBENZ', 'SFTOLU', 'SFXYLE', + 'SFNO', 'SFACTA', 'SFDMS', 'SFMEK', 'SFSO2', 'SFNH3', + 'SFISOP', 'SFMTPA', 'SFMOH', 'SFACET', 'SFCO', 'SFSOAP', + 'MEG_ISOP', 'MEG_MTERP', 'MEG_BCARY', 'MEG_CH3OH', 'MEG_C2H5OH', 'MEG_CH2O', + 'MEG_CH3CHO', 'MEG_CH3COOH', 'MEG_CH3COCH3', 'MEG_HCOOH', 'MEG_HCN', 'MEG_CO', + 'MEG_C2H6', 'MEG_C2H4', 'MEG_C3H8', 'MEG_C3H6', 'MEG_BIGALK', 'MEG_BIGENE', + 'MEG_TOLUENE', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', + 'DHNO3CHM', 'DH2O2CHM', 'DO3CHM', 'DCOCHM', 'AQ_SO2', 'GS_SO2', 'SO2_CLXF', + 'MASS', 'ABSORB', + 'Jval_O3O1D', 'Jval_NO2', 'Jval_PAN', 'Jval_H2O2', 'Jval_Cl2O2', + 'bc_a1', 'bc_a4', 'dst_a1', 'dst_a2', 'dst_a3', 'ncl_a1', 'ncl_a1', + 'ncl_a2', 'ncl_a3', 'pom_a1', 'pom_a4', 'so4_a1', 'so4_a2', 'so4_a3', + 'soa1_a1', 'soa2_a1', 'soa3_a1', 'soa4_a1', 'soa5_a1', 'soa1_a2', 'soa2_a2', 'soa3_a2', + 'soa4_a2', 'soa5_a2', 'bc_c1', 'bc_c4', 'dst_c1', 'dst_c2', 'dst_c3', 'ncl_c1', 'ncl_c1', + 'ncl_c2', 'ncl_c3', 'pom_c1', 'pom_c4', 'so4_c1', 'so4_c2', 'so4_c3', 'soa1_c1', 'soa2_c1', + 'soa3_c1', 'soa4_c1', 'soa5_c1', 'soa1_c2', 'soa2_c2', 'soa3_c2', 'soa4_c2', 'soa5_c2', + 'bc_a1SFWET', 'num_a1','num_a2','num_a3','num_a4','num_c1','num_c2','num_c3','num_c4', + 'bc_a1SFWET', 'bc_a4SFWET', 'dst_a1SFWET', 'dst_a2SFWET', 'dst_a3SFWET', 'ncl_a1SFWET', + 'ncl_a2SFWET', 'ncl_a3SFWET', 'pom_a1SFWET', 'pom_a4SFWET', + 'so4_a1SFWET', 'so4_a2SFWET', 'so4_a3SFWET', 'soa1_a1SFWET', 'soa1_a2SFWET', + 'soa2_a1SFWET', 'soa2_a2SFWET', 'soa3_a1SFWET', 'soa3_a2SFWET', + 'soa4_a1SFWET', 'soa4_a2SFWET', 'soa5_a1SFWET', 'soa5_a2SFWET', 'bc_c1SFWET', + 'bc_c4SFWET', 'dst_c1SFWET', 'dst_c2SFWET', 'dst_c3SFWET', + 'ncl_c1SFWET', 'ncl_c2SFWET', 'ncl_c3SFWET', 'pom_c1SFWET', 'pom_c4SFWET', + 'so4_c1SFWET', 'so4_c2SFWET', 'so4_c3SFWET', 'soa1_c1SFWET', + 'soa1_c2SFWET', 'soa2_c1SFWET', 'soa2_c2SFWET', 'soa3_c1SFWET', 'soa3_c2SFWET', + 'soa4_c1SFWET', 'soa4_c2SFWET', 'soa5_c1SFWET', 'soa5_c2SFWET', + 'bc_a1DDF', 'bc_a4DDF', 'dst_a1DDF', 'dst_a2DDF', 'dst_a3DDF', 'ncl_a1DDF', + 'ncl_a2DDF', 'ncl_a3DDF', 'pom_a1DDF', + 'pom_a4DDF', 'so4_a1DDF', 'so4_a2DDF', 'so4_a3DDF', 'soa1_a1DDF', + 'soa1_a2DDF', 'soa2_a1DDF', 'soa2_a2DDF', 'soa3_a1DDF', + 'soa3_a2DDF', 'soa4_a1DDF', 'soa4_a2DDF', 'soa5_a1DDF', 'soa5_a2DDF', + 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', + 'dst_c3DDF', 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', + 'pom_c4DDF', 'so4_c1DDF', 'so4_c2DDF', 'so4_c3DDF', + 'soa1_c1DDF', 'soa1_c2DDF', 'soa2_c1DDF', 'soa2_c2DDF', 'soa3_c1DDF', + 'soa3_c2DDF', 'soa4_c1DDF', 'soa4_c2DDF', 'soa5_c1DDF', + 'soa5_c2DDF', 'num_a1DDF', 'num_a2DDF', 'num_a3DDF', 'num_a4DDF', + 'num_c1DDF', 'num_c2DDF', 'num_c3DDF', 'num_c4DDF', + 'bc_a4_CLXF', 'pom_a4_CLXF', 'so4_a1_CLXF', 'so4_a2_CLXF', + 'num_a1_CLXF', 'num_a2_CLXF', 'SFbc_a4', 'SFpom_a4', 'SFso4_a1', + 'SFso4_a2', 'SFnum_a1', 'SFnum_a2', 'SFnum_a3', 'so4_a1_sfgaex1', + 'so4_a2_sfgaex1', 'so4_a3_sfgaex1', 'soa1_a1_sfgaex1', 'soa1_a2_sfgaex1', + 'soa2_a1_sfgaex1', 'soa2_a2_sfgaex1', 'soa3_a1_sfgaex1', 'soa3_a2_sfgaex1', + 'soa4_a1_sfgaex1', 'soa4_a2_sfgaex1', 'soa5_a1_sfgaex1', 'soa5_a2_sfgaex1', + 'so4_a2_sfnnuc1', 'so4_c1AQH2SO4', 'so4_c2AQH2SO4', 'so4_c3AQH2SO4', + 'so4_c1AQSO4', 'so4_c2AQSO4', 'so4_c3AQSO4', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', + 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', + 'TMOCS', 'TMSO2', 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', + 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSO4dn', 'BURDENSOAdn', + 'BURDENSEASALTdn','BURDENBCdn', 'PM25' + + + + + + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + + + + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + + + + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + + + + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + + +'GEOS-CHEM' + + diff --git a/bld/namelist_files/use_cases/sd_geoschem.xml b/bld/namelist_files/use_cases/sd_geoschem.xml new file mode 100644 index 0000000000..ff88ece522 --- /dev/null +++ b/bld/namelist_files/use_cases/sd_geoschem.xml @@ -0,0 +1,180 @@ + + + + +20050101 + +/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc +atm/cam/met/MERRA2/0.9x1.25/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_sgh30_24km_GRNL_MERRA2_c171218.nc + +/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f19_f19.134.1975.009.cam.i.2010-01-01_32L_c170403.nc +atm/cam/met/MERRA2/1.9x2.5/fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_ZR_GRNL_MERRA2_c190617.nc + +atm/cam/met/MERRA2/0.5x0.63/fv_0.47x0.63_nc3000_Co030_Fi001_PF_nullRR_Nsw021_MERRA2_c180612.nc + +50. +.true. + +2005/MERRA2_0.9x1.25_20050101.nc +atm/cam/met/MERRA2/0.9x1.25 +atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c190125.txt + +2010/MERRA2_0.5x0.63_20100101.nc +atm/cam/met/MERRA2/0.5x0.63 +atm/cam/met/MERRA2/0.5x0.63/filenames_list_c180612 + + +atm/cam/solar/SolarForcingNRLSSI2_daily_s18820101_e20171231_c191122.nc +SERIAL + + +.true. +.true. +.false. +0.25D0 + + +SERIAL +atm/waccm/lb/LBC_1750-2014_CMIP6_0p5degLat_c170126.nc + + + +INTERP_MISSING_MONTHS + +INTERP_MISSING_MONTHS + + + + 1,30,365,240,240,480,365,73,30 + 0,-24,-24,-3,-1,1,-24,-120,-240 +'A','A','A','A','A','A','A','A','I' + +.true. +.false. +.false. +.false. +.false. +.false. +.false. +.false. +.false. + + + + 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2', + 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO', + 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3', + 'BENZ', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', 'CFC12', + 'CH2O', 'CH3BR', 'CH3CCL3', 'ALD2', 'CH3CL', 'ACET', 'MOH', 'CH4', + 'CO', 'H2O2', 'HCFC22', 'HNO3', 'ISOP', 'MTPA', 'N2O', 'O3', + 'PAN', 'SO2', 'OH', 'ALK4', 'PRPE', 'BR', 'BRCL', 'BRO', 'BRNO3', + 'EOH', 'ETP', 'PRPE', 'RA3P', 'CCL4', 'H1211', 'H1301', + 'CFC11', 'CFC113', 'CFC114', 'CFC115', 'CFC12', 'CH2BR2', 'CH2O', + 'CH3BR', 'CH3CCL3', 'ALD2', 'CH3CL', 'MGLY', 'ACTA', 'MAP', 'MP', + 'CH4', 'CHBR3', 'CL', 'CL2', 'CL2O2', 'CLO', 'CLNO3', 'CO', + 'CO2', 'DMS', 'GLYC', 'GLYX', + 'H', 'H2', 'H2402', 'H2O2', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', + 'HCL', 'HNO3', 'HNO4', 'HOBR', 'HOCL', 'HONIT', 'HPALD1', 'HPALD2', 'HPALD3', + 'HPALD4', 'HAC', 'HC5A', 'IEPOXA', 'IEPOXB', 'IEPOXD', 'ISOP', 'IHN1', 'IHN2', 'IHN3', + 'IHN4', 'INO2B', 'INO2D', 'INPB', 'INPD', 'RIPA', 'RIPB', 'RIPC', 'RIPD', + 'MACR', 'MVKHP', 'MEK', 'MCRDH', 'MPAN', 'MVK', 'N', 'N2O', 'N2O5', 'ICN', + 'NH3', 'NH4', 'NO', 'NO2', 'NO3', 'PROPNN', 'OLND', 'OLNN', 'O', 'OCLO', + 'OCS', 'PAN', 'SO2', 'SO4', 'SOAP', 'TOLU', 'XYLE', + 'R4O2', 'BRO2', 'ETO2', 'A3O2', 'MCO3', 'MO2', 'HO2', 'O1D', 'OH', + 'H2O', 'SAD_PSC', 'SAD_SULFC', 'SAD_TROP', 'SAD_AERO', 'REFF_AERO', + 'PDELDRY', 'RAD_PSC', 'RAD_SULFC', + 'HNO3_GAS', 'HNO3_STS', 'HNO3_NAT', 'NOX', 'NOY', 'CLOX', 'CLOY', + 'BROX', 'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', + 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', + 'AODVISdn', 'AODdnMODE1', 'AODVISstdn', 'AODNIRstdn', + 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', + 'AODdnDUST3', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn', + 'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', + 'EXTINCTNIRdn', 'EXTINCTUVdn', + 'WD_EOH', 'WD_ETP', 'WD_RA3P', 'WD_CH2O', 'WD_ALD2', + 'WD_MGLY', 'WD_ACTA', 'WD_MAP', 'WD_MOH', 'WD_MP', + 'WD_GLYC', 'WD_H2O2', 'WD_SO4', 'WD_HBR', 'WD_HCL', + 'WD_HNO3', 'WD_HOBR', 'WD_HOCL', 'WD_HONIT', 'WD_HAC', 'WD_IEPOXA', + 'WD_IEPOXB', 'WD_IEPOXD', 'WD_MVK', 'WD_NH3', 'WD_NH4', 'WD_SO2', + 'DF_EOH', 'DF_ETP', 'DF_RA3P', 'DF_CH2O', 'DF_ALD2', 'DF_ACET', + 'DF_MGLY', 'DF_ACTA', 'DF_MAP', 'DF_MOH', 'DF_MP', 'DF_CO', + 'DF_GLYC', 'DF_H2O2', 'DF_SO4', 'DF_HNO3', 'DF_HNO4', + 'DF_HONIT', 'DF_HPALD1', 'DF_HPALD2', 'DF_HPALD3', 'DF_HPALD4', + 'DF_HAC', 'DF_IEPOXA', 'DF_IEPOXB', 'DF_IEPOXD', + 'DF_MPAN', 'DF_NH3', 'DF_NH4', 'DF_NO', + 'DF_NO2', 'DF_O3', 'DF_PAN', 'DF_SO2', + 'DF_SOAP', 'SO2_CLXF', 'SO2_XFRC', + 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD', 'LNO_COL_PROD', 'SOAP_CLXF', + 'SFEOH', 'SFALD2', 'SFMEK', 'SFCH2O', 'SFC2H6', 'SFC3H8', + 'SFALK4', 'SFPRPE', 'SFBENZ', 'SFTOLU', 'SFXYLE', + 'SFNO', 'SFACTA', 'SFDMS', 'SFMEK', 'SFSO2', 'SFNH3', + 'SFISOP', 'SFMTPA', 'SFMOH', 'SFACET', 'SFCO', 'SFSOAP', + 'MEG_ISOP', 'MEG_MTERP', 'MEG_BCARY', 'MEG_CH3OH', 'MEG_C2H5OH', 'MEG_CH2O', + 'MEG_CH3CHO', 'MEG_CH3COOH', 'MEG_CH3COCH3', 'MEG_HCOOH', 'MEG_HCN', 'MEG_CO', + 'MEG_C2H6', 'MEG_C2H4', 'MEG_C3H8', 'MEG_C3H6', 'MEG_BIGALK', 'MEG_BIGENE', + 'MEG_TOLUENE', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', + 'DHNO3CHM', 'DH2O2CHM', 'DO3CHM', 'DCOCHM', 'AQ_SO2', 'GS_SO2', 'SO2_CLXF', + 'MASS', 'ABSORB', + 'Jval_O3O1D', 'Jval_NO2', 'Jval_PAN', 'Jval_H2O2', 'Jval_Cl2O2', + 'bc_a1', 'bc_a4', 'dst_a1', 'dst_a2', 'dst_a3', 'ncl_a1', 'ncl_a1', + 'ncl_a2', 'ncl_a3', 'pom_a1', 'pom_a4', 'so4_a1', 'so4_a2', 'so4_a3', + 'soa1_a1', 'soa2_a1', 'soa3_a1', 'soa4_a1', 'soa5_a1', 'soa1_a2', 'soa2_a2', 'soa3_a2', + 'soa4_a2', 'soa5_a2', 'bc_c1', 'bc_c4', 'dst_c1', 'dst_c2', 'dst_c3', 'ncl_c1', 'ncl_c1', + 'ncl_c2', 'ncl_c3', 'pom_c1', 'pom_c4', 'so4_c1', 'so4_c2', 'so4_c3', 'soa1_c1', 'soa2_c1', + 'soa3_c1', 'soa4_c1', 'soa5_c1', 'soa1_c2', 'soa2_c2', 'soa3_c2', 'soa4_c2', 'soa5_c2', + 'bc_a1SFWET', 'num_a1','num_a2','num_a3','num_a4','num_c1','num_c2','num_c3','num_c4', + 'bc_a1SFWET', 'bc_a4SFWET', 'dst_a1SFWET', 'dst_a2SFWET', 'dst_a3SFWET', 'ncl_a1SFWET', + 'ncl_a2SFWET', 'ncl_a3SFWET', 'pom_a1SFWET', 'pom_a4SFWET', + 'so4_a1SFWET', 'so4_a2SFWET', 'so4_a3SFWET', 'soa1_a1SFWET', 'soa1_a2SFWET', + 'soa2_a1SFWET', 'soa2_a2SFWET', 'soa3_a1SFWET', 'soa3_a2SFWET', + 'soa4_a1SFWET', 'soa4_a2SFWET', 'soa5_a1SFWET', 'soa5_a2SFWET', 'bc_c1SFWET', + 'bc_c4SFWET', 'dst_c1SFWET', 'dst_c2SFWET', 'dst_c3SFWET', + 'ncl_c1SFWET', 'ncl_c2SFWET', 'ncl_c3SFWET', 'pom_c1SFWET', 'pom_c4SFWET', + 'so4_c1SFWET', 'so4_c2SFWET', 'so4_c3SFWET', 'soa1_c1SFWET', + 'soa1_c2SFWET', 'soa2_c1SFWET', 'soa2_c2SFWET', 'soa3_c1SFWET', 'soa3_c2SFWET', + 'soa4_c1SFWET', 'soa4_c2SFWET', 'soa5_c1SFWET', 'soa5_c2SFWET', + 'bc_a1DDF', 'bc_a4DDF', 'dst_a1DDF', 'dst_a2DDF', 'dst_a3DDF', 'ncl_a1DDF', + 'ncl_a2DDF', 'ncl_a3DDF', 'pom_a1DDF', + 'pom_a4DDF', 'so4_a1DDF', 'so4_a2DDF', 'so4_a3DDF', 'soa1_a1DDF', + 'soa1_a2DDF', 'soa2_a1DDF', 'soa2_a2DDF', 'soa3_a1DDF', + 'soa3_a2DDF', 'soa4_a1DDF', 'soa4_a2DDF', 'soa5_a1DDF', 'soa5_a2DDF', + 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', + 'dst_c3DDF', 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', + 'pom_c4DDF', 'so4_c1DDF', 'so4_c2DDF', 'so4_c3DDF', + 'soa1_c1DDF', 'soa1_c2DDF', 'soa2_c1DDF', 'soa2_c2DDF', 'soa3_c1DDF', + 'soa3_c2DDF', 'soa4_c1DDF', 'soa4_c2DDF', 'soa5_c1DDF', + 'soa5_c2DDF', 'num_a1DDF', 'num_a2DDF', 'num_a3DDF', 'num_a4DDF', + 'num_c1DDF', 'num_c2DDF', 'num_c3DDF', 'num_c4DDF', + 'bc_a4_CLXF', 'pom_a4_CLXF', 'so4_a1_CLXF', 'so4_a2_CLXF', + 'num_a1_CLXF', 'num_a2_CLXF', 'SFbc_a4', 'SFpom_a4', 'SFso4_a1', + 'SFso4_a2', 'SFnum_a1', 'SFnum_a2', 'SFnum_a3', 'so4_a1_sfgaex1', + 'so4_a2_sfgaex1', 'so4_a3_sfgaex1', 'soa1_a1_sfgaex1', 'soa1_a2_sfgaex1', + 'soa2_a1_sfgaex1', 'soa2_a2_sfgaex1', 'soa3_a1_sfgaex1', 'soa3_a2_sfgaex1', + 'soa4_a1_sfgaex1', 'soa4_a2_sfgaex1', 'soa5_a1_sfgaex1', 'soa5_a2_sfgaex1', + 'so4_a2_sfnnuc1', 'so4_c1AQH2SO4', 'so4_c2AQH2SO4', 'so4_c3AQH2SO4', + 'so4_c1AQSO4', 'so4_c2AQSO4', 'so4_c3AQSO4', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', + 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', + 'TMOCS', 'TMSO2', 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', + 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSO4dn', 'BURDENSOAdn', + 'BURDENSEASALTdn','BURDENBCdn', 'PM25' + + + + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + + + + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + + + + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + + + + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + + +'GEOS-CHEM' + + From 34df6dc8db7199f0480076a4e2fde6046568c60e Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 8 Jan 2021 17:32:58 -0500 Subject: [PATCH 175/239] Feat: Turn on rad_prog_ozone for GEOS-Chem chemistry Signed-off-by: Thibaud Fritz --- bld/build-namelist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/build-namelist b/bld/build-namelist index 8e03f6f28f..2ae13b544d 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -665,7 +665,7 @@ my $rad_prog_bcarb = (($prog_species =~ "BC" or $aero_chem) and !($chem_rad_pa my $rad_prog_sulf = (($prog_species =~ "SO4" or $aero_chem) and !($chem_rad_passive)); my $rad_prog_dust = (($prog_species =~ "DST" or $aero_chem) and !($chem_rad_passive)); my $rad_prog_sslt = (($prog_species =~ "SSLT" or $aero_chem) and !($chem_rad_passive)); -my $rad_prog_ozone = (($chem =~ "mozart" or $chem =~ "waccm_ma" or $chem =~ "tsmlt" or $chem =~ "trop_strat") and !($chem_rad_passive)); +my $rad_prog_ozone = (($chem =~ "mozart" or $chem =~ "waccm_ma" or $chem =~ "tsmlt" or $chem =~ "trop_strat" or $chem =~ /geoschem/) and !($chem_rad_passive)); # Check for eruptive volcano emissions. These will be radiatively active by default, but # only if using BAM and the camrt radiation package From da09b13ad09e4668065f17aeeda7b90537575875 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 8 Jan 2021 17:36:11 -0500 Subject: [PATCH 176/239] Feat: Implement CAM-Chem like diagnostics for CESM-GC (1) Rename diagnostics to match CAM-Chem's (2) Only perform diagnostics computations if field is an output. Use hist_fld_active whenever a call to outfld is performed. Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 1143 +++++++++++++++++--- src/chemistry/geoschem/chemistry.F90 | 119 +- 2 files changed, 1077 insertions(+), 185 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 48510ce842..650caa2daa 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -5,7 +5,7 @@ ! ! !MODULE: cesmgc_diag_mod.F90 ! -! !DESCRIPTION: Module cesmgc\_diag\_mod contains routines which aim to +! !DESCRIPTION: Module cesmgc\_diag\_mod contains routines which aim to ! diagnose variables from GEOS-Chem !\\ !\\ @@ -16,11 +16,16 @@ MODULE CESMGC_Diag_Mod ! !USES: ! USE SHR_KIND_MOD, ONLY : r8 => shr_kind_r8 + USE SHR_CONST_MOD, ONLY : pi => shr_const_pi USE CAM_HISTORY, ONLY : fieldname_len - USE CHEM_MODS, ONLY : gas_pcnst + USE CONSTITUENTS, ONLY : pcnst + USE CHEM_MODS, ONLY : gas_pcnst, map2chm + USE CHEM_MODS, ONLY : iFirstCnst + USE MO_TRACNAME, ONLY : solsym USE SPMD_UTILS, ONLY : MasterProc USE PPGRID, ONLY : begchunk, pver USE CAM_LOGFILE, ONLY : iulog + USE STRING_UTILS, ONLY : to_upper USE Error_Mod ! For error checking USE ErrCode_Mod ! Error codes for success or failure @@ -33,9 +38,83 @@ MODULE CESMGC_Diag_Mod ! PUBLIC :: CESMGC_Diag_Init PUBLIC :: CESMGC_Diag_Calc - - INTEGER :: nPhotol ! Number of diagnosed photolytic reactions - CHARACTER(LEN=FIELDNAME_LEN) :: srcnam(gas_pcnst) ! Names of source/sink tendencies + PUBLIC :: wetdep_name, wtrate_name + + INTEGER :: nPhotol ! Number of diagnosed photolytic reactions + CHARACTER(LEN=fieldname_len) :: srcnam(gas_pcnst) ! Names of source/sink tendencies + CHARACTER(LEN=fieldname_len) :: wetdep_name(gas_pcnst) ! Wet deposition tendencies + CHARACTER(LEN=fieldname_len) :: wtrate_name(gas_pcnst) ! Column tendencies for wet dep + CHARACTER(LEN=fieldname_len) :: dtchem_name(gas_pcnst) ! Chemical tendencies + CHARACTER(LEN=16) :: sflxnam_loc(pcnst) ! Names of surface fluxes + + ! Chemical families + INTEGER :: NOx_species(3) + INTEGER :: NOy_species(63) + INTEGER :: HOx_species(4) + INTEGER :: ClOx_species(6) + INTEGER :: ClOy_species(11) + INTEGER :: tCly_species(30) + INTEGER :: BrOx_species(4) + INTEGER :: BrOy_species(9) + INTEGER :: tBry_species(18) + INTEGER :: SOx_species(2) + INTEGER :: NHx_species(2) + INTEGER :: TOTH_species(3) + REAL(r8) :: NOx_MWs(3) + REAL(r8) :: NOy_MWs(64) + REAL(r8) :: HOx_MWs(4) + REAL(r8) :: ClOx_MWs(6) + REAL(r8) :: ClOy_MWs(11) + REAL(r8) :: tCly_MWs(30) + REAL(r8) :: BrOx_MWs(4) + REAL(r8) :: BrOy_MWs(9) + REAL(r8) :: tBry_MWs(18) + REAL(r8) :: SOx_MWs(2) + REAL(r8) :: NHx_MWs(2) + REAL(r8) :: TOTH_MWs(3) + + REAL(r8), PARAMETER :: MW_NIT = 62.01 + REAL(r8), PARAMETER :: MW_HNO3 = 63.01 + REAL(r8), PARAMETER :: MW_HCl = 36.45 + REAL(r8), PARAMETER :: MW_H2O = 18.02 + + ! NOx species + INTEGER :: i_NO, i_NO2, i_N + ! NOy \ NOx species + INTEGER :: i_BrNO2, i_BrNO3, i_ClNO2, i_ClNO3, i_ETHLN, i_ETNO3, & + i_HNO2, i_HNO3, i_HNO4, i_ICN, i_ICNOO, i_IDHNBOO, & + i_IDHNDOO1, i_IDN, i_IDNOO, i_IHN1, i_IHN2, & + i_IHN3, i_IHN4, i_IHPNBOO, i_IHPNDOO, i_INA, i_INO, & + i_INO2B, i_INO2D, i_INPB, i_INPD, i_IONO, i_IONO2, & + i_IPRNO3, i_ISOPNOO1, i_ISOPNOO2, i_ITCN, i_ITHN, & + i_MACRNO2, i_MCRHN, i_MCRHNB, i_MENO3, i_MONITS, i_MONITU, & + i_MPAN, i_MPN, i_MVKN, i_N2O5, i_NO3, i_NPRNO3, i_OLND, & + i_OLNN, i_PAN, i_PPN, i_PRN1, i_PROPNN, i_PRPN, i_R4N1, & + i_R4N2, i_HONIT, i_IONITA, i_NIT, i_NITs, i_NH4 + ! HOx + INTEGER :: i_H, i_OH, i_HO2, i_H2O2 + ! ClOx + INTEGER :: i_Cl, i_ClO, i_HOCl, i_Cl2, i_Cl2O2, i_OClO + ! tCly \ ClOx + INTEGER :: i_ClOO, i_HCl, i_BrCl, i_ICl, i_H1211, & + i_CFC115, i_CH3Cl, i_HCFC142b, i_HCFC22, i_CH2ICl, & + i_CFC114, i_CFC12, i_HCFC141b, i_HCFC123, i_CH2Cl2, & + i_CFC11, i_CH3CCl3, i_CHCl3, i_CCl4, i_CFC113, i_SALACL, & + i_SALCCL !ClNO2, ClNO3 already defined in NOy_species + ! BrOx + INTEGER :: i_Br, i_BrO, i_HOBr !BrCl already defined in tCly_species + ! Bry \ BrOx + INTEGER :: i_HBr, i_IBr, i_Br2, i_CH3Br, & + i_H1301, i_H2402, i_CH2Br2, i_CHBr3, i_BrSALA, i_BrSALC, & + i_CH2IBr + !BrNO2, BrNO3 already defined in NOy_speies + !H1211 already defined in tCly_species + ! SOx + INTEGER :: i_SO2, i_SO4 + ! NHx + INTEGER :: i_NH3 !NH4 already defined in NOy_species + ! TOTH + INTEGER :: i_CH4, i_H2O, i_H2 ! ! !REVISION HISTORY: ! 28 Oct 2020 - T. M. Fritz - Initial version @@ -67,21 +146,12 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) USE State_Diag_Mod, ONLY : get_TagInfo USE Species_Mod, ONLY : Species USE Registry_Mod, ONLY : MetaRegItem, RegItem - USE CHEM_MODS, ONLY : nTracers, nSls - USE CHEM_MODS, ONLY : tracerNames, tracerLongNames - USE CHEM_MODS, ONLY : slsNames, slsLongNames - USE CHEM_MODS, ONLY : iFirstCnst - USE CHEM_MODS, ONLY : map2chm - USE MO_TRACNAME, ONLY : solsym - USE CONSTITUENTS, ONLY : pcnst, cnst_name, sflxnam + USE State_Chm_Mod, ONLY : Ind_ + USE CONSTITUENTS, ONLY : cnst_name, sflxnam USE CONSTITUENTS, ONLY : cnst_get_ind USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only USE GAS_WETDEP_OPTS, ONLY : gas_wetdep_method USE DRYDEP_MOD, ONLY : depName -#if defined( MODAL_AERO_4MODE ) - USE MODAL_AERO_DATA, ONLY : ntot_amode, nspec_amode - USE MODAL_AERO_DATA, ONLY : xname_massptr -#endif ! ! !INPUT PARAMETERS: ! @@ -96,7 +166,8 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) !BOC ! ! Integer - INTEGER :: I, L, M, N, SM + INTEGER :: M, N, SM + INTEGER :: idx INTEGER :: RC ! Logical @@ -108,7 +179,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) CHARACTER(LEN=255) :: tagName CHARACTER(LEN=255) :: ThisLoc CHARACTER(LEN=255) :: ErrMsg - CHARACTER(LEN=2) :: unit_basename ! Units 'kg' or '1' + CHARACTER(LEN=2) :: unit_basename ! Units 'kg' or '1' ! Objects TYPE(Species), POINTER :: SpcInfo @@ -133,45 +204,42 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Note that constituents are already output by default ! Add all species as output fields if desired - DO I = 1, nTracers - SpcName = TRIM(tracerNames(I)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & - TRIM(tracerLongNames(I))//' volume mixing ratio') - IF (TRIM(SpcName) == 'O3') THEN - CALL Add_Default ( TRIM(SpcName), 2, ' ') + DO N = 1, gas_pcnst + M = map2chm(N) + IF ( M > 0 ) THEN + ! It's a GEOS-Chem species + SpcName = to_upper(TRIM(solsym(N))) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & + TRIM(SpcName)//' volume mixing ratio') + CALL AddFld( TRIM(SpcName)//'_SRF', horiz_only, 'A', 'mol/mol', & + TRIM(SpcName)//' in bottom layer') + IF (TRIM(SpcName) == 'O3') CALL Add_Default( TRIM(SpcName), 2, ' ' ) + ELSE + ! MAM aerosols + SpcName = TRIM(solsym(N)) + unit_basename = 'kg' + IF ( SpcName(1:3) == 'num' ) unit_basename = ' 1' + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', unit_basename//'/kg', & + TRIM(SpcName)//' concentration' ) + CALL AddFld( TRIM(SpcName)//'_SRF', horiz_only, 'A', unit_basename//'/kg', & + TRIM(SpcName)//' in bottom layer' ) ENDIF ENDDO - DO M = 1, ntot_amode - DO SM = 1, nspec_amode(M) - SpcName = TRIM(xname_massptr(SM,M)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg', & - TRIM(SpcName//' mass mixing ratio') ) - ENDDO - ENDDO - - DO I = 1, nSls - SpcName = TRIM(slsNames(I)) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & - TRIM(slsLongNames(I))//' volume mixing ratio') - !CALL Add_Default(TRIM(SpcName), 1, ' ') - ENDDO - IF ( Input_Opt%LDryD ) THEN - DO I = 1, State_Chm%nDryDep - SpcName = 'DV_'//TRIM(depName(I)) + DO N = 1, State_Chm%nDryDep + SpcName = 'DV_'//to_upper(TRIM(depName(N))) CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'm/s', & TRIM(SpcName)//' dry deposition velocity') ENDDO - DO I = 1, State_Chm%nAdvect + DO N = 1, State_Chm%nAdvect ! Get the species ID from the advected species ID - L = State_Chm%Map_Advect(I) + M = State_Chm%Map_Advect(N) ! Get info about this species from the species database - SpcInfo => State_Chm%SpcData(L)%Info - SpcName = 'DF_'//TRIM(SpcInfo%Name) - + SpcInfo => State_Chm%SpcData(M)%Info + SpcName = 'DF_'//to_upper(TRIM(SpcInfo%Name)) CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & TRIM(SpcName)//' dry deposition flux') @@ -180,28 +248,58 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ENDDO ENDIF + sflxnam_loc(:) = '' ! Chemical tendencies and surface fluxes DO N = 1, gas_pcnst - srcnam(N) = 'CT_'//TRIM(solsym(N)) ! chem tendency (source/sink) + IF ( map2chm(N) > 0 ) THEN + ! If this is a GEOS-Chem species then capitalize. This avoids + ! issues where Br2 /= BR2 + srcnam(N) = 'CT_'//to_upper(TRIM(solsym(N))) ! chem tendency (source/sink) + ELSE + ! For MAM aerosols, keep as it is (i.e. bc_a1) + srcnam(N) = 'CT_'//TRIM(solsym(N)) ! chem tendency (source/sink) + ENDIF SpcName = srcnam(N) CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg/s', TRIM(SpcName)//' source/sink' ) - CALL cnst_get_ind(solsym(N), M, abort=.false. ) + SpcName = TRIM(solsym(N)) + IF ( map2chm(N) > 0 ) THEN + !SpcName = to_upper(SpcName) + IF ( State_Chm%SpcData(map2chm(N))%Info%Is_Gas .eqv. .False. ) THEN + SpcName = 'GC_AER_'//to_upper(TRIM(SpcName)) + ENDIF + ENDIF + CALL cnst_get_ind( SpcName, M, abort=.false. ) IF ( M > 0 ) THEN IF (sflxnam(M)(3:5) == 'num') then ! name is in the form of "SF****" unit_basename = ' 1' ELSE - unit_basename = 'kg' + unit_basename = 'kg' ENDIF - CALL Addfld (sflxnam(M), horiz_only, 'A', unit_basename//'/m2/s', & + IF ( map2chm(N) > 0 ) THEN + IF ( State_Chm%SpcData(map2chm(N))%Info%Is_Gas .eqv. .True. ) THEN + sflxnam_loc(M) = to_upper(sflxnam(M)) + ELSE + ! Prevent from saving as GC_AER_... + sflxnam_loc(M) = 'SF'//to_upper(cnst_name(M)(8:)) + ENDIF + ELSE + sflxnam_loc(M) = sflxnam(M) + ENDIF + Write(iulog,*) " sflxnam_loc = ", TRIM(sflxnam_loc(M)), TRIM(cnst_name(M)), M + SpcName = sflxnam_loc(M) + CALL Addfld ( TRIM(SpcName), horiz_only, 'A', unit_basename//'/m2/s', & TRIM(solsym(N))//' surface flux') ENDIF ENDDO IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN DO N = 1, gas_pcnst - M = map2chm(N) isWD = .False. + wetdep_name(N) = 'DTWR_'//to_upper(TRIM(solsym(N))) + wtrate_name(N) = 'WD_'//to_upper(TRIM(solsym(N))) + + M = map2chm(N) IF ( M > 0 ) THEN SpcInfo => State_Chm%SpcData(M)%Info isWD = SpcInfo%Is_WetDep @@ -212,10 +310,10 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) IF ( .NOT. isWD ) CYCLE - SpcName = 'DTWR_'//TRIM(solsym(N)) + SpcName = wetdep_name(N) CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg/s', & 'wet removal tendency' ) - SpcName = 'WD_'//TRIM(solsym(N)) + SpcName = wtrate_name(N) CALL Addfld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & 'vertical integrated wet deposition flux' ) ENDDO @@ -300,11 +398,398 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Chemical tendencies DO N = 1, gas_pcnst - SpcName = TRIM(solsym(N)) - CALL Addfld( 'D'//TRIM(SpcName)//'CHM', (/ 'lev' /), 'A', 'kg/s', & + M = map2chm(N) + IF ( M > 0 ) THEN + dtchem_name(N) = 'D'//to_upper(TRIM(solsym(N)))//'CHM' + ELSE + dtchem_name(N) = 'D'//TRIM(solsym(N))//'CHM' + ENDIF + SpcName = TRIM(dtchem_name(N)) + CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/s', & 'net tendency from chemistry' ) ENDDO + i_NO = Ind_('NO') + i_NO2 = Ind_('NO2') + i_N = Ind_('N') + i_BrNO2 = Ind_('BrNO2') + i_BrNO3 = Ind_('BrNO3') + i_ClNO2 = Ind_('ClNO2') + i_ClNO3 = Ind_('ClNO3') + i_ETHLN = Ind_('ETHLN') + i_ETNO3 = Ind_('ETNO3') + i_HNO2 = Ind_('HNO2') + i_HNO3 = Ind_('HNO3') + i_HNO4 = Ind_('HNO4') + i_ICN = Ind_('ICN') + i_ICNOO = Ind_('ICNOO') + i_IDHNBOO = Ind_('IDHNBOO') + i_IDHNDOO1 = Ind_('IDHNDOO1') + i_IDN = Ind_('IDN') + i_IDNOO = Ind_('IDNOO') + i_IHN1 = Ind_('IHN1') + i_IHN2 = Ind_('IHN2') + i_IHN3 = Ind_('IHN3') + i_IHN4 = Ind_('IHN4') + i_IHPNBOO = Ind_('IHPNBOO') + i_IHPNDOO = Ind_('IHPNDOO') + i_INA = Ind_('INA') + i_INO = Ind_('INO') + i_INO2B = Ind_('INO2B') + i_INO2D = Ind_('INO2D') + i_INPB = Ind_('INPB') + i_INPD = Ind_('INPD') + i_IONO = Ind_('IONO') + i_IONO2 = Ind_('IONO2') + i_IPRNO3 = Ind_('IPRNO3') + i_ISOPNOO1 = Ind_('ISOPNOO1') + i_ISOPNOO2 = Ind_('ISOPNOO2') + i_ITCN = Ind_('ITCN') + i_ITHN = Ind_('ITHN') + i_MACRNO2 = Ind_('MACRNO2') + i_MCRHN = Ind_('MCRHN') + i_MCRHNB = Ind_('MCRHNB') + i_MENO3 = Ind_('MENO3') + i_MONITS = Ind_('MONITS') + i_MONITU = Ind_('MONITU') + i_MPAN = Ind_('MPAN') + i_MPN = Ind_('MPN') + i_MVKN = Ind_('MVKN') + i_N2O5 = Ind_('N2O5') + i_NO3 = Ind_('NO3') + i_NPRNO3 = Ind_('NPRNO3') + i_OLND = Ind_('OLND') + i_OLNN = Ind_('OLNN') + i_PAN = Ind_('PAN') + i_PPN = Ind_('PPN') + i_PRN1 = Ind_('PRN1') + i_PROPNN = Ind_('PROPNN') + i_PRPN = Ind_('PRPN') + i_R4N1 = Ind_('R4N1') + i_R4N2 = Ind_('R4N2') + i_HONIT = Ind_('HONIT') + i_IONITA = Ind_('IONITA') + i_NIT = Ind_('NIT') + i_NITs = Ind_('NITs') + i_H = Ind_('H') + i_OH = Ind_('OH') + i_HO2 = Ind_('HO2') + i_H2O2 = Ind_('H2O2') + i_Cl = Ind_('Cl') + i_ClO = Ind_('ClO') + i_HOCl = Ind_('HOCl') + i_Cl2 = Ind_('Cl2') + i_Cl2O2 = Ind_('Cl2O2') + i_OClO = Ind_('OClO') + i_ClOO = Ind_('ClOO') + i_HCl = Ind_('HCl') + i_ClNO2 = Ind_('ClNO2') + i_ClNO3 = Ind_('ClNO3') + i_BrCl = Ind_('BrCl') + i_ICl = Ind_('ICl') + i_H1211 = Ind_('H1211') + i_CFC115 = Ind_('CFC115') + i_CH3Cl = Ind_('CH3Cl') + i_HCFC142b = Ind_('HCFC142b') + i_HCFC22 = Ind_('HCFC22') + i_CH2ICl = Ind_('CH2ICl') + i_CFC114 = Ind_('CFC114') + i_CFC12 = Ind_('CFC12') + i_HCFC141b = Ind_('HCFC141b') + i_HCFC123 = Ind_('HCFC123') + i_CH2Cl2 = Ind_('CH2Cl2') + i_CFC11 = Ind_('CFC11') + i_CH3CCl3 = Ind_('CH3CCl3') + i_CHCl3 = Ind_('CHCl3') + i_CCl4 = Ind_('CCl4') + i_CFC113 = Ind_('CFC113') + i_SALACL = Ind_('SALACL') + i_SALCCL = Ind_('SALCCL') + i_Br = Ind_('Br') + i_BrO = Ind_('BrO') + i_BrCl = Ind_('BrCl') + i_HOBr = Ind_('HOBr') + i_HBr = Ind_('HBr') + i_BrNO2 = Ind_('BrNO2') + i_BrNO3 = Ind_('BrNO3') + i_IBr = Ind_('IBr') + i_Br2 = Ind_('Br2') + i_CH3Br = Ind_('CH3Br') + i_H1211 = Ind_('H1211') + i_H1301 = Ind_('H1301') + i_H2402 = Ind_('H2402') + i_CH2Br2 = Ind_('CH2Br2') + i_CHBr3 = Ind_('CHBr3') + i_BrSALA = Ind_('BrSALA') + i_BrSALC = Ind_('BrSALC') + i_CH2IBr = Ind_('CH2IBr') + i_SO2 = Ind_('SO2') + i_SO4 = Ind_('SO4') + i_NH3 = Ind_('NH3') + i_NH4 = Ind_('NH4') + i_CH4 = Ind_('CH4') + i_H2O = Ind_('H2O') + i_H2 = Ind_('H2') + + NOx_species = (/ i_N, i_NO, i_NO2 /) + NOy_species = (/ i_N, i_NO, i_NO2, i_BrNO2, i_BrNO3, i_ClNO2, i_ClNO3,& + i_ETHLN, i_ETNO3, i_HNO2, i_HNO3, i_HNO4, i_ICN, & + i_ICNOO, i_IDHNBOO, i_IDHNDOO1, i_IDN, & + i_IDNOO, i_IHN1, i_IHN2, i_IHN3, i_IHN4, i_IHPNBOO, & + i_IHPNDOO, i_INA, i_INO, i_INO2B, i_INO2D, i_INPB, & + i_INPD, i_IONO, i_IONO2, i_IPRNO3, i_ISOPNOO1, & + i_ISOPNOO2, i_ITCN, i_ITHN, i_MACRNO2, i_MCRHN, & + i_MCRHNB, i_MENO3, i_MONITS, i_MONITU, i_MPAN, i_MPN,& + i_MVKN, i_N2O5, i_NO3, i_NPRNO3, i_OLND, i_OLNN, & + i_PAN, i_PPN, i_PRN1, i_PROPNN, i_PRPN, i_R4N1, & + i_R4N2, i_HONIT, i_IONITA, i_NIT, i_NITs, i_NH4 /) + HOx_species = (/ i_H, i_OH, i_HO2, i_H2O2 /) + ClOx_species = (/ i_Cl, i_ClO, i_HOCl, i_Cl2, i_Cl2O2, i_OClO /) + ClOy_species = (/ i_Cl, i_ClO, i_HOCl, i_Cl2, i_Cl2O2, i_OClO, & + i_HCl, i_ClNO3, i_BrCl, i_ICl, i_ClNO2 /) + tCly_species = (/ i_Cl, i_ClO, i_HOCl, i_Cl2, i_Cl2O2, i_OClO, i_ClOO, & + i_HCl, i_ClNO2, i_ClNO3, i_BrCl, i_ICl, i_H1211, & + i_CFC115, i_CH3Cl, i_HCFC142b, i_HCFC22, i_CH2ICl, & + i_CFC114, i_CFC12, i_HCFC141b, i_HCFC123, i_CH2Cl2, & + i_CFC11, i_CH3CCl3, i_CHCl3, i_CCl4, i_CFC113, & + i_SALACL, i_SALCCL /) + BrOx_species = (/ i_Br, i_BrO, i_BrCl, i_HOBr /) + BrOy_species = (/ i_Br, i_BrO, i_BrCl, i_HOBr, i_HBr, i_BrNO2, & + i_BrNO3, i_IBr, i_Br2 /) + tBry_species = (/ i_Br, i_BrO, i_BrCl, i_HOBr, i_HBr, i_BrNO2, & + i_BrNO3, i_IBr, i_Br2, i_CH3Br, i_H1211, i_H1301, & + i_H2402, i_CH2Br2, i_CHBr3, i_BrSALA, i_BrSALC, & + i_CH2IBr /) + SOx_species = (/ i_SO2, i_SO4 /) + NHx_species = (/ i_NH3, i_NH4 /) + TOTH_species = (/ i_CH4, i_H2O, i_H2 /) + + DO N = 1, SIZE(NOx_species) + idx = NOx_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + NOx_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + NOx_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(NOy_species) + idx = NOy_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + NOy_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + NOy_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(HOx_species) + idx = HOx_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + HOx_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + HOx_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(ClOx_species) + idx = ClOx_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + ClOx_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + ClOx_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(ClOy_species) + idx = ClOy_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + ClOy_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + ClOy_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(tCly_species) + idx = tCly_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + tCly_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + tCly_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(BrOx_species) + idx = BrOx_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + BrOx_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + BrOx_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(BrOy_species) + idx = BrOy_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + BrOy_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + BrOy_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(tBry_species) + idx = tBry_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + tBry_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + tBry_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(SOx_species) + idx = SOx_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + SOx_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + SOx_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(NHx_species) + idx = NHx_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + NHx_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + NHx_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + DO N = 1, SIZE(TOTH_species) + idx = TOTH_species(N) + IF ( idx > 0 ) THEN + SpcInfo => State_Chm%SpcData(idx)%Info + TOTH_MWs(N) = REAL(SpcInfo%MW_g,r8) + SpcInfo => NULL() + ELSE + TOTH_MWs(N) = -1.0e+00_r8 + ENDIF + ENDDO + + IF ( ANY(NOx_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "NOx indices: ", NOx_species + ENDIF + IF ( ANY(NOy_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "NOy indices: ", NOy_species + ENDIF + IF ( ANY(HOx_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "HOx indices: ", HOx_species + ENDIF + IF ( ANY(ClOx_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "ClOx indices: ", ClOx_species + ENDIF + IF ( ANY(ClOy_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "ClOy indices: ", ClOy_species + ENDIF + IF ( ANY(tCly_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "tCly indices: ", tCly_species + ENDIF + IF ( ANY(BrOx_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "BrOx indices: ", BrOx_species + ENDIF + IF ( ANY(BrOy_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "BrOy indices: ", BrOy_species + ENDIF + IF ( ANY(tBry_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "tBry indices: ", tBry_species + ENDIF + IF ( ANY(SOx_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "SOx indices: ", SOx_species + ENDIF + IF ( ANY(NHx_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "NHx indices: ", NHx_species + ENDIF + IF ( ANY(TOTH_species <= 0 ) ) THEN + IF ( MasterProc ) Write(iulog,*) "TOTH indices: ", TOTH_species + ENDIF + + CALL Addfld( 'NOX', (/ 'lev' /), 'A', 'mol/mol', & + 'NOx molar mixing ratio' ) + CALL Addfld( 'NOY', (/ 'lev' /), 'A', 'mol/mol', & + 'NOy molar mixing ratio' ) + CALL Addfld( 'NOY_mmr', (/ 'lev' /), 'A', 'kg/kg', & + 'NOy mass mixing ratio' ) + CALL Addfld( 'NOY_SRF', horiz_only, 'A', 'mol/mol', & + 'Surface NOy molar mixing ratio' ) + CALL Addfld( 'HOX', (/ 'lev' /), 'A', 'mol/mol', & + 'HOx molar mixing ratio' ) + CALL Addfld( 'CLOX', (/ 'lev' /), 'A', 'mol/mol', & + 'ClOx molar mixing ratio' ) + CALL Addfld( 'CLOY', (/ 'lev' /), 'A', 'mol/mol', & + 'Total inorganic chlorine (ClOy) molar mixing ratio' ) + CALL Addfld( 'TCLY', (/ 'lev' /), 'A', 'mol/mol', & + 'Total Cl molar mixing ratio' ) + CALL Addfld( 'BROX', (/ 'lev' /), 'A', 'mol/mol', & + 'BrOx molar mixing ratio' ) + CALL Addfld( 'BROY', (/ 'lev' /), 'A', 'mol/mol', & + 'Total inorganic bromine (BrOy) molar mixing ratio' ) + CALL Addfld( 'TBRY', (/ 'lev' /), 'A', 'mol/mol', & + 'Total Br molar mixing ratio' ) + CALL Addfld( 'SOX', (/ 'lev' /), 'A', 'mol/mol', & + 'SOx molar mixing ratio' ) + CALL Addfld( 'SOX_mmr', (/ 'lev' /), 'A', 'kg/kg', & + 'SOx mass mixing ratio' ) + CALL Addfld( 'NHX', (/ 'lev' /), 'A', 'mol/mol', & + 'NHx molar mixing ratio' ) + CALL Addfld( 'NHX_mmr', (/ 'lev' /), 'A', 'kg/kg', & + 'NHx mass mixing ratio' ) + CALL Addfld( 'TOTH', (/ 'lev' /), 'A', 'mol/mol', & + 'Total H2 molar mixing ratio' ) + + CALL Addfld( 'SAD_STRAT', (/ 'lev' /), 'I', 'cm2/cm3', 'Stratospheric aerosol SAD' ) + CALL Addfld( 'SAD_SULFC', (/ 'lev' /), 'I', 'cm2/cm3', 'Chemical sulfate aerosol SAD' ) + CALL Addfld( 'SAD_PSC', (/ 'lev' /), 'I', 'cm2/cm3', 'PSC aerosol SAD' ) + CALL Addfld( 'RAD_SULFC', (/ 'lev' /), 'I', 'cm', 'Chemical sulfate radius' ) + CALL Addfld( 'RAD_PSC', (/ 'lev' /), 'I', 'cm', 'PSC aerosol radius' ) + CALL Addfld( 'SAD_TROP', (/ 'lev' /), 'I', 'cm2/cm3', 'Tropospheric aerosol SAD' ) + CALL Addfld( 'SAD_AERO', (/ 'lev' /), 'I', 'cm2/cm3', 'Aerosol surface area density' ) + CALL Addfld( 'REFF_AERO', (/ 'lev' /), 'I', 'cm', 'Aerosol effective radius') + CALL Addfld( 'SULF_TROP', (/ 'lev' /), 'I', 'cm2/cm3', 'Tropospheric sulfate area density') + + CALL Addfld( 'HNO3_TOTAL', (/ 'lev' /), 'I', 'mol/mol', 'Total HNO3' ) + CALL Addfld( 'HNO3_STS', (/ 'lev' /), 'I', 'mol/mol', 'STS condensed HNO3' ) + CALL Addfld( 'HNO3_NAT', (/ 'lev' /), 'I', 'mol/mol', 'NAT condensed HNO3' ) + CALL Addfld( 'HNO3_GAS', (/ 'lev' /), 'I', 'mol/mol', 'Gas phase HNO3' ) + CALL Addfld( 'H2O_GAS', (/ 'lev' /), 'I', 'mol/mol', 'Gas phase H2O' ) + CALL Addfld( 'HCL_TOTAL', (/ 'lev' /), 'I', 'mol/mol', 'Total HCl' ) + CALL Addfld( 'HCL_GAS', (/ 'lev' /), 'I', 'mol/mol', 'Gas phase HCl' ) + CALL Addfld( 'HCL_STS', (/ 'lev' /), 'I', 'mol/mol', 'STS condensend HCl' ) + + CALL Addfld( 'SZA', horiz_only, 'I', 'degrees', 'Solar Zenith Angle' ) + CALL Addfld( 'U_SRF', horiz_only, 'I', 'm/s', 'Horizontal wind velocity' ) + CALL Addfld( 'V_SRF', horiz_only, 'I', 'm/s', 'Vertical wind velocity' ) + CALL Addfld( 'Q_SRF', horiz_only, 'I', 'kg/kg', 'Specific humidity' ) + !======================================================================= ! Cleanup and quit !======================================================================= @@ -341,25 +826,16 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & USE Registry_Mod, ONLY : Registry_Lookup USE Registry_Params_Mod USE PRECISION_MOD - USE MO_TRACNAME, ONLY : solsym - USE CAM_HISTORY, ONLY : outfld - USE CONSTITUENTS, ONLY : pcnst, cnst_name, sflxnam - USE CHEM_MODS, ONLY : MWRatio - USE CHEM_MODS, ONLY : SlsMWRatio - USE CHEM_MODS, ONLY : tracerNames - USE CHEM_MODS, ONLY : slsNames - USE CHEM_MODS, ONLY : nSls - USE CHEM_MODS, ONLY : map2GC, map2Idx, map2GC_Sls - USE CHEM_MODS, ONLY : iFirstCnst + USE CHEM_MODS, ONLY : adv_mass + USE CAM_HISTORY, ONLY : outfld, hist_fld_active + USE CONSTITUENTS, ONLY : cnst_name, sflxnam USE DRYDEP_MOD, ONLY : depName, Ndvzind USE CAMSRFEXCH, ONLY : cam_in_t USE PHYSICS_TYPES, ONLY : physics_state USE SPMD_UTILS, ONLY : MasterProc -#if defined( MODAL_AERO_4MODE ) - USE MODAL_AERO_DATA, ONLY : lmassptr_amode - USE MODAL_AERO_DATA, ONLY : ntot_amode, nspec_amode - USE MODAL_AERO_DATA, ONLY : xname_massptr -#endif + USE PHYSCONST, ONLY : MWDry + USE UCX_MOD, ONLY : GET_STRAT_OPT!, AERFRAC + USE CMN_SIZE_MOD, ONLY : NDUST ! ! !INPUT PARAMETERS: ! @@ -370,7 +846,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object TYPE(cam_in_t), INTENT(IN) :: cam_in ! import state TYPE(physics_state), INTENT(IN) :: state ! Physics state variables - REAL(r8), INTENT(IN) :: mmr_tend(state%ncol,pver,gas_pcnst) + REAL(r8), INTENT(IN) :: mmr_tend(state%ncol,pver,gas_pcnst) ! Net tendency from chemistry in kg/s INTEGER, INTENT(IN) :: LCHNK ! Chunk number ! @@ -382,6 +858,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! ! Integers INTEGER :: I, J, L, M, N, ND, SM + INTEGER :: idx INTEGER :: RC INTEGER :: Source_KindVal ! KIND value of data INTEGER :: Output_KindVal ! KIND value for output @@ -401,8 +878,15 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & CHARACTER(LEN=255) :: SpcName CHARACTER(LEN=255) :: tagName + ! Real + REAL(r8) :: wgt + REAL(r8) :: MW + REAL(r8) :: RAER, REFF, SADSTRAT, XSASTRAT + ! Arrays REAL(r8) :: outTmp(State_Grid%nY,State_Grid%nZ) + REAL(r8) :: radTmp(State_Grid%nY,State_Grid%nZ) + ! Floating-point data pointers (8-byte precision) REAL(f8), POINTER :: Ptr0d_8 ! 0D 8-byte data REAL(f8), POINTER :: Ptr1d_8(: ) ! 1D 8-byte data @@ -433,53 +917,388 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! Define rootChunk rootChunk = ( MasterProc.and.(LCHNK==BEGCHUNK) ) - CALL OutFld( 'AREA', State_Grid%Area_M2(1,1:nY), nY, LCHNK) - CALL OutFld( 'MASS', State_Met%AD(1,1:nY,nZ:1:-1), nY, LCHNK) + CALL OutFld( 'AREA', State_Grid%Area_M2(1,:nY), nY, LCHNK) + CALL OutFld( 'MASS', State_Met%AD(1,:nY,nZ:1:-1), nY, LCHNK) CALL Outfld( 'HEIGHT', state%zi(:nY,:), nY, LCHNK ) - ! Write diagnostic output - DO N = iFirstCnst, pcnst - M = map2GC(N) - I = map2Idx(N) + ! =============================================== + ! Diagnose chemical species (constituents and short-lived) + ! =============================================== + + DO N = 1, gas_pcnst + M = map2chm(N) IF ( M > 0 ) THEN - SpcName = tracerNames(I) - outTmp = 0.0e+0_r8 - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Chm%Species(1,J,L,M),r8) * MWRatio(I) - ENDDO - ENDDO + ! It's a GEOS-Chem species + SpcName = to_upper(TRIM(solsym(N))) + ELSE + ! MAM aerosols + SpcName = TRIM(solsym(N)) + ENDIF + outTmp = 0.0e+00_r8 + IF ( adv_mass(N) > 0.0e+00_r8 .AND. M /= 0 .AND. hist_fld_active(TRIM(SpcName)) ) THEN + IF ( M > 0 ) THEN + outTmp(:nY,:) = REAL(State_Chm%Species(1,:nY,nZ:1:-1,M),r8) * MWDry / adv_mass(N) + ELSE + outTmp(:nY,:) = state%q(:nY,:,-M) + ENDIF CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + CALL OutFld( TRIM(SpcName)//'_SRF', outTmp(:nY,nZ), nY, LCHNK ) ENDIF ENDDO - DO M = 1, ntot_amode - DO SM = 1, nspec_amode(M) - SpcName = TRIM(xname_massptr(SM,M)) - N = lmassptr_amode(SM,M) - CALL OutFld( TRIM(SpcName), state%q(:nY,:,N), nY, LCHNK ) + ! =============================================== + ! Diagnose chemical families (NOx, NOy, ...) + ! =============================================== + + SpcName = 'NOX' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(NOx_species) + idx = NOx_species(N) + MW = NOx_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW ENDDO - ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF - DO N = 1, nSls - SpcName = slsNames(N) - outTmp = 0.0e+0_r8 - M = map2GC_Sls(N) - IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Chm%Species(1,J,L,M),r8) * SLSMWratio(N) - ENDDO - ENDDO - CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) - ENDIF + SpcName = 'NOY' + IF ( hist_fld_active(TRIM(SpcName)) .OR. hist_fld_active(TRIM(SpcName)//'_SRF') ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(NOy_species) + idx = NOy_species(N) + MW = NOy_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + IF ( idx == i_N2O5 .OR. idx == i_IDN .OR. idx == i_IDNOO ) THEN + wgt = 2.0E+00_r8 + ENDIF + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + SpcName = 'NOY_SRF' + IF ( hist_fld_active(TRIM(SpcName)) ) CALL Outfld( TRIM(SpcName), outTmp(:nY,nZ), nY, LCHNK ) + + SpcName = 'NOY_mmr' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(NOy_species) + idx = NOy_species(N) + MW = NOy_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + IF ( idx == i_N2O5 .OR. idx == i_IDN .OR. idx == i_IDNOO ) THEN + wgt = 2.0E+00_r8 + ENDIF + outTmp(:nY,:) = outTmp(:nY,:) + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'HOX' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(HOx_species) + idx = HOx_species(N) + MW = HOx_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + IF ( idx == i_H2O2 ) THEN + wgt = 2.0E+00_r8 + ENDIF + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'CLOX' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(ClOx_species) + idx = ClOx_species(N) + MW = ClOx_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + IF ( idx == i_Cl2 .OR. idx == i_Cl2O2 ) THEN + wgt = 2.0E+00_r8 + ENDIF + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'CLOY' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(ClOy_species) + idx = ClOy_species(N) + MW = ClOy_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + IF ( idx == i_Cl2 .OR. idx == i_Cl2O2 ) THEN + wgt = 2.0E+00_r8 + ENDIF + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'TCLY' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(tCly_species) + idx = tCly_species(N) + MW = tCly_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + IF ( idx == i_Cl2 .OR. idx == i_Cl2O2 .OR. idx == i_CFC114 .OR. & + idx == i_CFC12 .OR. idx == i_CH2Cl2 .OR. idx == i_HCFC123 .OR. & + idx == i_HCFC141b ) THEN + wgt = 2.0E+00_r8 + ELSEIF ( idx == i_CFC11 .OR. idx == i_CFC113 .OR. idx == i_CH3CCl3 .OR. & + idx == i_CHCl3 ) THEN + wgt = 3.0E+00_r8 + ELSEIF ( idx == i_CCl4 ) THEN + wgt = 4.0E+00_r8 + ENDIF + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'BROX' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(BrOx_species) + idx = BrOx_species(N) + MW = BrOx_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'BROY' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(BrOy_species) + idx = BrOy_species(N) + MW = BrOy_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + IF ( idx == i_Br2 ) THEN + wgt = 2.0E+00_r8 + ENDIF + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'TBRY' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(tBry_species) + idx = tBry_species(N) + MW = tBry_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + IF ( idx == i_Br2 .OR. idx == i_H2402 .OR. idx == i_CH2Br2 ) THEN + wgt = 2.0E+00_r8 + ENDIF + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'SOX' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(SOx_species) + idx = SOx_species(N) + MW = SOx_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'SOX_mmr' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(SOx_species) + idx = SOx_species(N) + MW = SOx_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + outTmp(:nY,:) = outTmp(:nY,:) + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'NHX' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(NHx_species) + idx = NHx_species(N) + MW = NHx_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'NHX_mmr' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(NHx_species) + idx = NHx_species(N) + MW = NHx_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + outTmp(:nY,:) = outTmp(:nY,:) + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + SpcName = 'TOTH' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp = 0.0e+00_r8 + DO N = 1, SIZE(TOTH_species) + idx = TOTH_species(N) + MW = TOTH_MWs(N) + IF ( idx <= 0 .OR. MW <= 0.0e+00_r8 ) CYCLE + wgt = 1.0E+00_r8 + IF ( idx == i_CH4 ) THEN + wgt = 2.0E+00_r8 + ENDIF + outTmp(:nY,:) = outTmp(:nY,:) & + + wgt * REAL(State_Chm%Species(1,:nY,nZ:1:-1,idx),r8) * MWDry / MW + ENDDO + CALL Outfld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF + + ! =============================================== + ! Diagnose GEOS-Chem aerosol quantities + ! =============================================== + + IF ( hist_fld_active('SAD_PSC') .OR. hist_fld_active('RAD_PSC') ) THEN + outTmp = 0.0e+00_r8 + radTmp = 0.0e+00_r8 + DO J = 1, nY + DO L = 1, nZ + CALL GET_STRAT_OPT(1,J,L,1,RAER,REFF,SADSTRAT,XSASTRAT) + outTmp(J,nZ+1-L) = SADSTRAT + radTmp(J,nZ+1-L) = RAER + ENDDO + ENDDO + CALL Outfld( 'SAD_PSC', outTmp(:nY,:), nY, LCHNK ) + CALL Outfld( 'RAD_PSC', radTmp(:nY,:), nY, LCHNK ) + ENDIF + + IF ( hist_fld_active('SAD_SULFC') .OR. hist_fld_active('RAD_SULFC') ) THEN + outTmp = 0.0e+00_r8 + DO J = 1, nY + DO L = 1, nZ + CALL GET_STRAT_OPT(1,J,L,2,RAER,REFF,SADSTRAT,XSASTRAT) + outTmp(J,nZ+1-L) = SADSTRAT + radTmp(J,nZ+1-L) = RAER + ENDDO + ENDDO + CALL Outfld( 'SAD_SULFC', outTmp(:nY,:), nY, LCHNK ) + CALL Outfld( 'RAD_SULFC', radTmp(:nY,:), nY, LCHNK ) + ENDIF + + IF ( hist_fld_active('SAD_AERO') .OR. hist_fld_active('SAD_TROP') ) THEN + outTmp(:nY,:) = SUM(State_Chm%AeroArea(1,:nY,nZ:1:-1,:), DIM=3) + CALL Outfld( 'SAD_AERO', outTmp(:nY,:), nY, LCHNK ) + ENDIF + + IF ( hist_fld_active('SAD_TROP') ) THEN + DO J = 1, nY + DO L = 1, nZ + IF ( .NOT. State_Met%InTroposphere(1,J,nZ+1-L) ) THEN + outTmp(J,L) = 0.0e+00_r8 + ENDIF + ENDDO + ENDDO + CALL Outfld( 'SAD_TROP', outTmp(:nY,:), nY, LCHNK ) + ENDIF + + IF ( hist_fld_active('REFF_AERO') ) THEN + !outTmp(:nY,:) = State_Chm%AeroRadi(1,:nY,nZ:1:-1,:) + !CALL Outfld( 'REFF_AERO', outTmp(:nY,:), nY, LCHNK ) + ENDIF + + IF ( hist_fld_active('SULF_TROP') ) THEN + outTmp(:nY,:) = State_Chm%AeroArea(1,:nY,nZ:1:-1,NDUST+1) + CALL Outfld( 'SULF_TROP', outTmp(:nY,:), nY, LCHNK ) + ENDIF + + ! =============================================== + ! Diagnose stratospheric quantities + ! =============================================== + + outTmp(:nY,:) = State_Chm%Species(1,:nY,nZ:1:-1,i_HNO3) * MWDry / MW_HNO3 + CALL Outfld( 'HNO3_GAS', outTmp(:nY,:), nY, LCHNK ) + + ! TMMF, this requires to have access to the AERFRAC variable in ucx_mod. + !outTmp(:nY,:) = AERFRAC(1,:nY,nZ:1:-1,2) + !CALL Outfld( 'HNO3_STS', outTmp(:nY,:), nY, LCHNK ) + + outTmp = 0.0e+00_r8 + DO J = 1, nY + DO L = 1, nZ + IF ( State_Met%InTroposphere(1,J,nZ+1-L) ) CYCLE + outTmp(J,L) = State_Chm%Species(1,J,nZ+1-L,i_NIT) * MWDry / MW_NIT ENDDO + ENDDO + CALL Outfld( 'HNO3_NAT', outTmp(:nY,:), nY, LCHNK ) + + outTmp(:nY,:) = outTmp(:nY,:) + & + ! AERFRAC(1,:nY,nZ:1:-1,2) + & + State_Chm%Species(1,:nY,nZ:1:-1,i_HNO3) * MWDry / MW_HNO3 + CALL Outfld( 'HNO3_TOTAL', outTmp(:nY,:), nY, LCHNK ) + + outTmp(:nY,:) = State_Chm%Species(1,:nY,nZ:1:-1,i_H2O) * MWDry / MW_H2O + CALL Outfld( 'H2O_GAS', outTmp(:nY,:), nY, LCHNK ) + + outTmp(:nY,:) = State_Chm%Species(1,:nY,nZ:1:-1,i_HCl) * MWDry / MW_HCl + CALL Outfld( 'HCL_GAS', outTmp(:nY,:), nY, LCHNK ) + + !outTmp(:nY,:) = AERFRAC(1,:nY,nZ:1:-1,3) + !CALL Outfld( 'HCL_STS', outTmp(:nY,:), nY, LCHNK ) + + outTmp(:nY,:) = 0.0e+00_r8 + !outTmp(:nY,:) = AERFRAC(1,:nY,nZ:1:-1,3) + outTmp(:nY,:) = outTmp(:nY,:) + & + State_Chm%Species(1,:nY,nZ:1:-1,i_HCl) * MWDry / MW_HCl + CALL Outfld( 'HCL_TOTAL', outTmp(:nY,:), nY, LCHNK ) + + ! =============================================== + ! Diagnose dry deposition velocities and fluxes + ! =============================================== - ! Dry deposition velocity and surface flux IF ( Input_Opt%LDryD ) THEN DO N = 1, State_Chm%nDryDep ND = NDVZIND(N) - SpcName = 'DV_'//TRIM(depName(N)) + SpcName = 'DV_'//to_upper(TRIM(depName(N))) + IF ( .NOT. hist_fld_active(TRIM(SpcName)) ) CYCLE CALL OutFld( TRIM(SpcName), State_Chm%DryDepVel(1,:nY,ND), nY, LCHNK ) ENDDO @@ -489,8 +1308,9 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! Get info about this species from the species database SpcInfo => State_Chm%SpcData(L)%Info - SpcName = 'DF_'//TRIM(SpcInfo%Name) + SpcName = 'DF_'//to_upper(TRIM(SpcInfo%Name)) + IF ( .NOT. hist_fld_active(TRIM(SpcName)) ) CYCLE ! SurfaceFlux is Emissions - Drydep, but Emissions = 0, as it is applied ! externally CALL OutFld( TRIM(SpcName), -State_Chm%SurfaceFlux(1,:nY,N), nY, LCHNK ) @@ -500,21 +1320,33 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ENDDO ENDIF - ! Surface fluxes (emissions - drydep) + ! =============================================== + ! Diagnose surface fluxes (emissions - drydep) + ! =============================================== + DO N = iFirstCnst, pcnst - SpcName = sflxnam(N) + SpcName = TRIM(sflxnam_loc(N)) + IF ( TRIM(SpcName) == '' ) CYCLE + IF ( .NOT. hist_fld_active(TRIM(SpcName)) ) CYCLE CALL OutFld( TRIM(SpcName), cam_in%cflx(:nY,N), nY, LCHNK ) ENDDO + ! =============================================== + ! Diagnose chemical tendencies + ! =============================================== + ! Chemical tendencies in kg/kg/s DO N = 1, gas_pcnst SpcName = TRIM(srcnam(N)) + IF ( TRIM(SpcName) == '' ) CYCLE + IF ( .NOT. hist_fld_active(TRIM(SpcName)) ) CYCLE CALL OutFld( TRIM(SpcName), mmr_tend(:nY,:,N), nY, LCHNK ) ENDDO ! Chemical tendencies in kg/s DO N = 1, gas_pcnst - SpcName = 'D'//TRIM(solsym(N))//'CHM' + SpcName = TRIM(dtchem_name(N)) + IF ( .NOT. hist_fld_active(TRIM(SpcName)) ) CYCLE outTmp = 0.0e+0_r8 DO J = 1, nY DO L = 1, nZ @@ -524,7 +1356,10 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) ENDDO - ! Photolysis rates + ! =============================================== + ! Diagnose photolysis rates + ! =============================================== + IF ( ASSOCIATED(State_Diag%Jval) ) THEN DO M = 1, nPhotol CALL get_TagInfo( Input_Opt = Input_Opt, & @@ -542,6 +1377,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ENDIF SpcName = 'Jval_' // TRIM( tagName ) + IF ( .NOT. hist_fld_active(TRIM(SpcName)) ) CYCLE DO J = 1, nY DO L = 1, nZ outTmp(J,nZ+1-L) = REAL(State_Diag%Jval(1,J,L,M),r8) @@ -552,25 +1388,29 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ENDIF IF ( ASSOCIATED(State_Diag%JvalO3O1D) ) THEN SpcName = 'Jval_O3O1D' - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Diag%JvalO3O1D(1,J,L),r8) - ENDDO - ENDDO - CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Diag%JvalO3O1D(1,J,L),r8) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF ENDIF IF ( ASSOCIATED(State_Diag%JvalO3O3P) ) THEN SpcName = 'Jval_O3O3P' - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Diag%JvalO3O3P(1,J,L),r8) - ENDDO - ENDDO - CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + DO J = 1, nY + DO L = 1, nZ + outTmp(J,nZ+1-L) = REAL(State_Diag%JvalO3O3P(1,J,L),r8) + ENDDO + ENDDO + CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) + ENDIF ENDIF ! =============================================== - ! Now diagnose fields corresponding to State_Met + ! Diagnose fields corresponding to State_Met ! =============================================== ! Copied from Headers/registry_mod.F90 @@ -589,6 +1429,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! Only print on the root CPU IF ( ASSOCIATED( Item ) ) THEN + SpcName = TRIM(Item%FullName) IF (( TRIM(Item%FullName(1:8)) /= 'MET_XLAI' ) .AND. & ( TRIM(Item%FullName(1:8)) /= 'MET_IUSE' ) .AND. & ( TRIM(Item%FullName(1:9)) /= 'MET_ILAND' )) THEN @@ -607,22 +1448,24 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & Ptr3d_8 = Ptr3d_8, & RC = RC ) - !IF ( Source_KindVal /= KINDVAL_I4 ) THEN - ! IF ( Rank == 2 ) THEN - ! outTmp(:,nZ) = REAL(Ptr2d_8(1,:),r8) - ! CALL Outfld( TRIM( Item%FullName ), outTmp(:,nZ), nY, LCHNK ) - ! ELSEIF ( Rank == 3 ) THEN - ! ! For now, treat variables defined on level edges by ignoring top - ! ! most layer - ! DO J = 1, nY - ! DO L = 1, nZ - ! outTmp(J,nZ+1-L) = REAL(Ptr3d_8(1,J,L),r8) - ! ENDDO - ! ENDDO - ! CALL Outfld( TRIM( Item%FullName ), outTmp, nY, LCHNK ) - ! ELSE - ! IF ( rootChunk ) Write(iulog,*) " Item ", TRIM(Item%FullName), & - ! " is of rank ", Rank, " and will not be diagnosed!" + !IF ( hist_fld_active(TRIM(SpcName)) ) THEN + ! IF ( Source_KindVal /= KINDVAL_I4 ) THEN + ! IF ( Rank == 2 ) THEN + ! outTmp(:,nZ) = REAL(Ptr2d_8(1,:),r8) + ! CALL Outfld( TRIM( Item%FullName ), outTmp(:,nZ), nY, LCHNK ) + ! ELSEIF ( Rank == 3 ) THEN + ! ! For now, treat variables defined on level edges by ignoring top + ! ! most layer + ! DO J = 1, nY + ! DO L = 1, nZ + ! outTmp(J,nZ+1-L) = REAL(Ptr3d_8(1,J,L),r8) + ! ENDDO + ! ENDDO + ! CALL Outfld( TRIM( Item%FullName ), outTmp, nY, LCHNK ) + ! ELSE + ! IF ( rootChunk ) Write(iulog,*) " Item ", TRIM(Item%FullName), & + ! " is of rank ", Rank, " and will not be diagnosed!" + ! ENDIF ! ENDIF !ENDIF ENDIF @@ -634,6 +1477,30 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ENDDO + SpcName = 'SZA' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp(:nY,1) = ACOS(MIN(MAX(State_Met%SUNCOS(1,:nY),-1._r8),1._r8))/pi*180.e+0_r8 + CALL Outfld( TRIM(SpcName), outTmp(:nY,1) , nY, LCHNK ) + ENDIF + + SpcName = 'U_SRF' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp(:nY,:) = state%u(:nY,:) + CALL Outfld( TRIM(SpcName), outTmp(:nY,:) , nY, LCHNK ) + ENDIF + + SpcName = 'V_SRF' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp(:nY,:) = state%v(:nY,:) + CALL Outfld( TRIM(SpcName), outTmp(:nY,:) , nY, LCHNK ) + ENDIF + + SpcName = 'Q_SRF' + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + outTmp(:nY,:) = State_Chm%Species(1,:nY,nZ:1:-1,i_H2O) + CALL Outfld( TRIM(SpcName), outTmp(:nY,:) , nY, LCHNK ) + ENDIF + !======================================================================= ! Cleanup and quit !======================================================================= diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 16f6a1e1a9..3cab879193 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -344,6 +344,8 @@ subroutine chem_register MWTmp = REAL(ThisSpc%MW_g,r8) ref_VMR = REAL(ThisSpc%BackgroundVV,r8) ref_MMR(I) = ref_VMR / (MWDry / MWTmp) + ! This is required as we need to distinguish between MAM and GEOS-Chem aerosols + ! (Both are included in aer_drydep_list) IF ( ThisSpc%Is_Gas .eqv. .False. ) THEN Write(cnstName, "(a,a)") 'GC_AER_', to_upper(TRIM(trueName)) ENDIF @@ -1899,8 +1901,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use State_Diag_Mod, only : get_TagInfo use Unitconv_Mod, only : Convert_Spc_Units - use CESMGC_Emissions_Mod, only : CESMGC_Emissions_Calc - use CESMGC_Diag_Mod, only : CESMGC_Diag_Calc + use CESMGC_Emissions_Mod,only : CESMGC_Emissions_Calc + use CESMGC_Diag_Mod, only : CESMGC_Diag_Calc + use CESMGC_Diag_Mod, only : wetdep_name, wtrate_name use Tropopause, only : Tropopause_findChemTrop, Tropopause_Find use HCO_Utilities_GC_Mod ! Utility routines for GC-HEMCO interface @@ -3509,23 +3512,39 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( Input_Opt%LWetD ) THEN ! Store mass mixing ratios before wet deposition is applied - DO N = 1, gas_pcnst - ! See definition of map2chm - M = map2chm(N) - IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - mmr1(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) - ENDDO - ENDDO - ELSEIF ( M < 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - mmr1(J,L,N) = state%q(J,L,-M) - ENDDO - ENDDO - ENDIF - ENDDO + IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN + DO N = 1, gas_pcnst + isWD = .False. + IF ( M > 0 ) THEN + SpcInfo => State_Chm(BEGCHUNK)%SpcData(M)%Info + isWD = SpcInfo%Is_WetDep + + ! Free pointer + SpcInfo => NULL() + ENDIF + + IF ( .NOT. isWD ) CYCLE + + IF ( hist_fld_active( TRIM(wetdep_name(N)) ) .OR. & + hist_fld_active( TRIM(wtrate_name(N)) ) ) THEN + ! See definition of map2chm + M = map2chm(N) + IF ( M > 0 ) THEN + DO J = 1, nY + DO L = 1, nZ + mmr1(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) + ENDDO + ENDDO + ELSEIF ( M < 0 ) THEN + DO J = 1, nY + DO L = 1, nZ + mmr1(J,L,N) = state%q(J,L,-M) + ENDDO + ENDDO + ENDIF + ENDIF + ENDDO + ENDIF IF ( gas_wetdep_method == 'NEU' ) THEN CALL Neu_wetdep_tend( LCHNK = LCHNK, & @@ -3568,27 +3587,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - DO N = 1, gas_pcnst - ! See definition of map2chm - M = map2chm(N) - IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - mmr1(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) - mmr1(J,L,N) - ENDDO - ENDDO - ELSEIF ( M < 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - mmr1(J,L,N) = state%q(J,L,-M) - mmr1(J,L,N) - ENDDO - ENDDO - ENDIF - ENDDO - IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN DO N = 1, gas_pcnst - M = map2chm(N) isWD = .False. IF ( M > 0 ) THEN SpcInfo => State_Chm(BEGCHUNK)%SpcData(M)%Info @@ -3600,16 +3600,41 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( .NOT. isWD ) CYCLE - CALL Outfld( 'DTWR_'//TRIM(solsym(N)), mmr1(1:nY,:nZ,N)/dT, nY, LCHNK ) + IF ( hist_fld_active( TRIM(wetdep_name(N)) ) .OR. & + hist_fld_active( TRIM(wtrate_name(N)) ) ) THEN + ! See definition of map2chm + M = map2chm(N) + IF ( M > 0 ) THEN + DO J = 1, nY + DO L = 1, nZ + mmr1(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) - mmr1(J,L,N) + ENDDO + ENDDO + ELSEIF ( M < 0 ) THEN + DO J = 1, nY + DO L = 1, nZ + mmr1(J,L,N) = state%q(J,L,-M) - mmr1(J,L,N) + ENDDO + ENDDO + ENDIF - wk_out = 0._r8 - DO L = 1, nZ - wk_out(1:nY) = wk_out(1:nY) & - + mmr1(1:nY,L,N)/dT * & - State_Met(LCHNK)%AD(1,1:nY,nZ+1-L) / & - State_Met(LCHNK)%Area_M2(1,1:nY) - ENDDO - CALL Outfld( 'WD_'//TRIM(solsym(N)), wk_out(1:nY), nY, LCHNK ) + SpcName = wetdep_name(N) + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + CALL Outfld( TRIM(SpcName), mmr1(1:nY,:nZ,N)/dT, nY, LCHNK ) + ENDIF + + SpcName = wtrate_name(N) + IF ( hist_fld_active(TRIM(SpcName)) ) THEN + wk_out = 0._r8 + DO L = 1, nZ + wk_out(1:nY) = wk_out(1:nY) & + + mmr1(1:nY,L,N)/dT * & + State_Met(LCHNK)%AD(1,1:nY,nZ+1-L) / & + State_Met(LCHNK)%Area_M2(1,1:nY) + ENDDO + CALL Outfld( TRIM(SpcName), wk_out(1:nY), nY, LCHNK ) + ENDIF + ENDIF ! GEOS-Chem does not currently store HEFF, but calculates it ! internally. Some potential work around would be to add a From 3583ba4e896d965c73f907f21905c8b2f3eb86d3 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 8 Jan 2021 17:37:53 -0500 Subject: [PATCH 177/239] Feat: Make sure that GC's SOAGX species is not picked up by MAM Signed-off-by: Thibaud Fritz --- src/chemistry/modal_aero/modal_aero_data.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chemistry/modal_aero/modal_aero_data.F90 b/src/chemistry/modal_aero/modal_aero_data.F90 index 2db8a73750..1f23b28f18 100644 --- a/src/chemistry/modal_aero/modal_aero_data.F90 +++ b/src/chemistry/modal_aero/modal_aero_data.F90 @@ -451,7 +451,7 @@ subroutine modal_aero_data_init(pbuf2d) lptr2_soa_g_amode(:) = -1 soa_ndx = 0 do i = 1, pcnst - if (cnst_name(i)(:4) == 'SOAG') then + if (cnst_name(i)(:4) == 'SOAG' .and. cnst_name(i)(:5) /= 'SOAGX') then soa_ndx = soa_ndx+1 lptr2_soa_g_amode(soa_ndx) = i endif From 1c4e343237023cb044ec8ba62d9f0574b4f24404 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 8 Jan 2021 20:44:03 -0500 Subject: [PATCH 178/239] Fix: Remove debug statement in cesmgc_diag_mod Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 650caa2daa..5446152480 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -286,7 +286,6 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ELSE sflxnam_loc(M) = sflxnam(M) ENDIF - Write(iulog,*) " sflxnam_loc = ", TRIM(sflxnam_loc(M)), TRIM(cnst_name(M)), M SpcName = sflxnam_loc(M) CALL Addfld ( TRIM(SpcName), horiz_only, 'A', unit_basename//'/m2/s', & TRIM(solsym(N))//' surface flux') From 56df3c8312fb6203cf4d16aec5d9fb0cb5c5ead0 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 11 Jan 2021 13:31:48 -0500 Subject: [PATCH 179/239] Feat: Add mmr tendencies for MAM aerosols from chemistry Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 29 ++++++++++------------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 3cab879193..21f068c096 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -2202,21 +2202,14 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! See definition of map2chm M = map2chm(N) IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - vmr0(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) * & - MWDry / adv_mass(N) - ! We'll substract concentrations after chemistry later - mmr_tend(J,L,N) = REAL(State_Chm(LCHNK)%Species(1,J,nZ+1-L,M),r8) - ENDDO - ENDDO + vmr0(:nY,:nZ,N) = State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) * & + MWDry / adv_mass(N) + ! We'll substract concentrations after chemistry later + mmr_tend(:nY,:nZ,N) = REAL(State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M),r8) ELSEIF ( M < 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - vmr0(J,L,N) = state%q(J,L,-M) * & - MWDry / adv_mass(N) - ENDDO - ENDDO + vmr0(:nY,:nZ,N) = state%q(:nY,:nZ,-M) * & + MWDry / adv_mass(N) + mmr_tend(:nY,:nZ,N) = state%q(:nY,:nZ,-M) ENDIF ENDDO @@ -3771,11 +3764,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! See definition of map2chm M = map2chm(N) IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - mmr_tend(J,L,N) = ( REAL(State_Chm(LCHNK)%Species(1,J,nZ+1-L,M),r8) - mmr_tend(J,L,N) ) / dT - ENDDO - ENDDO + mmr_tend(:nY,:nZ,N) = ( REAL(State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M),r8) - mmr_tend(:nY,:nZ,N) ) / dT + ELSEIF ( M < 0 ) THEN + mmr_tend(:nY,:nZ,N) = ( state%q(:nY,:nZ,-M) - mmr_tend(:nY,:nZ,-M) ) / dT ENDIF ENDDO From 3d231a5df5e528e68eeeed9ec836b09617e0d410 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 11 Jan 2021 13:32:50 -0500 Subject: [PATCH 180/239] Feat: Replace DO loops with array element-wise operations Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 32 +++++-------------- .../geoschem/cesmgc_emissions_mod.F90 | 20 ++++++------ 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 5446152480..73520cf69f 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -938,7 +938,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & IF ( M > 0 ) THEN outTmp(:nY,:) = REAL(State_Chm%Species(1,:nY,nZ:1:-1,M),r8) * MWDry / adv_mass(N) ELSE - outTmp(:nY,:) = state%q(:nY,:,-M) + outTmp(:nY,:) = state%q(:nY,:nZ,-M) ENDIF CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) CALL OutFld( TRIM(SpcName)//'_SRF', outTmp(:nY,nZ), nY, LCHNK ) @@ -1339,7 +1339,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & SpcName = TRIM(srcnam(N)) IF ( TRIM(SpcName) == '' ) CYCLE IF ( .NOT. hist_fld_active(TRIM(SpcName)) ) CYCLE - CALL OutFld( TRIM(SpcName), mmr_tend(:nY,:,N), nY, LCHNK ) + CALL OutFld( TRIM(SpcName), mmr_tend(:nY,:nZ,N), nY, LCHNK ) ENDDO ! Chemical tendencies in kg/s @@ -1347,11 +1347,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & SpcName = TRIM(dtchem_name(N)) IF ( .NOT. hist_fld_active(TRIM(SpcName)) ) CYCLE outTmp = 0.0e+0_r8 - DO J = 1, nY - DO L = 1, nZ - outTmp(J,L) = mmr_tend(J,L,N) * REAL(State_Met%AD(1,J,nZ+1-L),r8) - ENDDO - ENDDO + outTmp(:nY,:nZ) = mmr_tend(:nY,:nZ,N) * REAL(State_Met%AD(1,:nY,nZ:1:-1),r8) CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) ENDDO @@ -1377,33 +1373,21 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & SpcName = 'Jval_' // TRIM( tagName ) IF ( .NOT. hist_fld_active(TRIM(SpcName)) ) CYCLE - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Diag%Jval(1,J,L,M),r8) - ENDDO - ENDDO + outTmp(:nY,:nZ) = REAL(State_Diag%Jval(1,:nY,nZ:1:-1,M),r8) CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) ENDDO ENDIF IF ( ASSOCIATED(State_Diag%JvalO3O1D) ) THEN SpcName = 'Jval_O3O1D' IF ( hist_fld_active(TRIM(SpcName)) ) THEN - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Diag%JvalO3O1D(1,J,L),r8) - ENDDO - ENDDO + outTmp(:nY,:nZ) = REAL(State_Diag%JvalO3O1D(1,:nY,nZ:1:-1),r8) CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) ENDIF ENDIF IF ( ASSOCIATED(State_Diag%JvalO3O3P) ) THEN SpcName = 'Jval_O3O3P' IF ( hist_fld_active(TRIM(SpcName)) ) THEN - DO J = 1, nY - DO L = 1, nZ - outTmp(J,nZ+1-L) = REAL(State_Diag%JvalO3O3P(1,J,L),r8) - ENDDO - ENDDO + outTmp(:nY,:nZ) = REAL(State_Diag%JvalO3O3P(1,:nY,nZ:1:-1),r8) CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) ENDIF ENDIF @@ -1450,8 +1434,8 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & !IF ( hist_fld_active(TRIM(SpcName)) ) THEN ! IF ( Source_KindVal /= KINDVAL_I4 ) THEN ! IF ( Rank == 2 ) THEN - ! outTmp(:,nZ) = REAL(Ptr2d_8(1,:),r8) - ! CALL Outfld( TRIM( Item%FullName ), outTmp(:,nZ), nY, LCHNK ) + ! outTmp(:nY,nZ) = REAL(Ptr2d_8(1,:),r8) + ! CALL Outfld( TRIM( Item%FullName ), outTmp(:nY,nZ), nY, LCHNK ) ! ELSEIF ( Rank == 3 ) THEN ! ! For now, treat variables defined on level edges by ignoring top ! ! most layer diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 42bdb4befb..d43ab2e7bb 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -390,23 +390,23 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS IF ( M <= 0 ) CYCLE - eflx(1:nY,:,M) = pbuf_ik(1:nY,:) + eflx(1:nY,:nZ,M) = pbuf_ik(1:nY,:nZ) ! Reset pointers pbuf_ik => NULL() pbuf_chnk => NULL() - IF ( MINVAL(eflx(:,:,M)) < 0.0e+00_r8 ) THEN + IF ( MINVAL(eflx(:nY,:nZ,M)) < 0.0e+00_r8 ) THEN Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO emission flux is negative for ", & - TRIM(cnst_name(M)), " with value ", MINVAL(eflx(:,:,M)), " at ", & - MINLOC(eflx(:,:,M)) + TRIM(cnst_name(M)), " with value ", MINVAL(eflx(:nY,:nZ,M)), " at ", & + MINLOC(eflx(:nY,:nZ,M)) ENDIF - IF ( rootChunk .and. ( MAXVAL(eflx(1:nY,:,M)) > 0.0e+0_r8 ) ) THEN + IF ( rootChunk .and. ( MAXVAL(eflx(:nY,:nZ,M)) > 0.0e+0_r8 ) ) THEN Write(iulog,'(a,a,a,a)') " CESMGC_Emissions_Calc: HEMCO flux ", & TRIM(fldname_ns), " added to ", TRIM(cnst_name(M)) Write(iulog,'(a,a,E16.4)') " CESMGC_Emissions_Calc: Maximum flux ", & - TRIM(fldname_ns), MAXVAL(eflx(1:nY,:,M)) + TRIM(fldname_ns), MAXVAL(eflx(:nY,:nZ,M)) ENDIF ENDIF ENDDO @@ -455,16 +455,16 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! Output fields before lightning NO emissions are applied to eflx DO N = iFirstCnst, pcnst SpcName = TRIM(cnst_name(N))//'_XFRC' - CALL Outfld( TRIM(SpcName), eflx(:,:,N) / State_Met%BXHEIGHT(1,:,nZ:1:-1) * 1.0E-06 / cnst_mw(N) * avogad, nY, LCHNK ) + CALL Outfld( TRIM(SpcName), eflx(:nY,:nZ,N) / State_Met%BXHEIGHT(1,:nY,nZ:1:-1) * 1.0E-06 / cnst_mw(N) * avogad, nY, LCHNK ) SpcName = TRIM(cnst_name(N))//'_CLXF' ! Convert from kg/m2/s to molec/cm2/s ! Note 1: cnst_mw is in kg/kmole ! Note 2: avogad is in molecules/kmole - CALL Outfld( TRIM(SpcName), SUM(eflx(:,:,N), DIM=2) * 1.0E-04 / cnst_mw(N) * avogad, nY, LCHNK ) + CALL Outfld( TRIM(SpcName), SUM(eflx(:nY,:nZ,N), DIM=2) * 1.0E-04 / cnst_mw(N) * avogad, nY, LCHNK ) SpcName = TRIM(cnst_name(N))//'_CMXF' - CALL Outfld( TRIM(SpcName), SUM(eflx(:,:,N), DIM=2), nY, LCHNK ) + CALL Outfld( TRIM(SpcName), SUM(eflx(:nY,:nZ,N), DIM=2), nY, LCHNK ) ENDDO !----------------------------------------------------------------------- @@ -487,7 +487,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ENDDO ENDDO - CALL Outfld( 'NO_Lightning', prod_NO(:nY,:,LCHNK), nY, LCHNK ) + CALL Outfld( 'NO_Lightning', prod_NO(:nY,:nZ,LCHNK), nY, LCHNK ) !----------------------------------------------------------------------- ! MEGAN emissions ... From fce98979ba3d01e84dfcc04f45bd2b4e2a9d022f Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 11 Jan 2021 17:17:17 -0500 Subject: [PATCH 181/239] Feat: Set NTHRDS_*=1 when using a GEOS-Chem compset Signed-off-by: Thibaud Fritz --- cime_config/config_compsets.xml | 13 +++++++++++-- cime_config/config_pes.xml | 7 +++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 1f6db389fd..ece974b5b7 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -383,8 +383,8 @@ - - + + @@ -644,6 +644,7 @@ 1 1 + 1 @@ -651,6 +652,7 @@ 1 1 + 1 @@ -658,6 +660,7 @@ 1 1 + 1 @@ -665,6 +668,7 @@ 1 1 + 1 @@ -672,6 +676,7 @@ 1 1 + 1 @@ -679,6 +684,7 @@ 1 1 + 1 @@ -686,6 +692,7 @@ 1 1 + 1 @@ -693,6 +700,7 @@ 1 1 + 1 @@ -700,6 +708,7 @@ 1 1 + 1 diff --git a/cime_config/config_pes.xml b/cime_config/config_pes.xml index bb4abfe015..89b4290731 100644 --- a/cime_config/config_pes.xml +++ b/cime_config/config_pes.xml @@ -1701,6 +1701,13 @@ 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 From 1014fe4a4f811f1d1d784b0c8c1644da6d647dea Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 13 Jan 2021 18:44:27 -0500 Subject: [PATCH 182/239] Feat: Make SDYN compset with GEOS-Chem have 56 levs Signed-off-by: Thibaud Fritz --- bld/namelist_files/use_cases/sd_geoschem.xml | 5 +---- cime_config/config_component.xml | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/use_cases/sd_geoschem.xml b/bld/namelist_files/use_cases/sd_geoschem.xml index ff88ece522..2734b82229 100644 --- a/bld/namelist_files/use_cases/sd_geoschem.xml +++ b/bld/namelist_files/use_cases/sd_geoschem.xml @@ -4,12 +4,9 @@ 20050101 -/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc +/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_56L_c170403.nc atm/cam/met/MERRA2/0.9x1.25/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_sgh30_24km_GRNL_MERRA2_c171218.nc -/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f19_f19.134.1975.009.cam.i.2010-01-01_32L_c170403.nc -atm/cam/met/MERRA2/1.9x2.5/fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_ZR_GRNL_MERRA2_c190617.nc - atm/cam/met/MERRA2/0.5x0.63/fv_0.47x0.63_nc3000_Co030_Fi001_PF_nullRR_Nsw021_MERRA2_c180612.nc 50. diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index a3ea777227..aac547eb25 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -150,6 +150,7 @@ -offline_dyn -nlev 56 -nlev 56 + -nlev 56 -nlev 88 -nlev 145 From 2e413ee83c97dbb7fd5e40933624507f671a3658 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 19 Jan 2021 16:18:38 -0500 Subject: [PATCH 183/239] Feat: Pass chemical tendencies to MAM aerosols (1) Changes in aerosol concentrations due to GEOS-Chem processing is now passed to chemical tendencies for MAM aerosols (2) Wet deposition of MAM-inherited aerosols is not performed in GEOS-Chem. To do so, we define a new logical `WD_ExternalDep` in SpcInfo Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 116 ++++++++++++++++++--------- 1 file changed, 77 insertions(+), 39 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 21f068c096..1e1a6b5fac 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -1545,8 +1545,26 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - IF ( Input_Opt%LDryD ) THEN +#if defined ( MODAL_AERO ) + IF ( Input_Opt%LWetD ) THEN + DO I = BEGCHUNK, ENDCHUNK + DO N = 1, State_Chm(I)%nWetDep + M = State_Chm(I)%Map_WetDep(N) + SpcInfo => State_Chm(I)%SpcData(M)%Info + SELECT CASE ( TRIM(SpcInfo%Name) ) + CASE ( 'BCPI', 'BCPO', 'DST1', 'DST2', 'DST3', 'DST4', & + 'SOAS', 'SO4', 'SALA', 'SALC', 'OCPI' , 'OCPO' ) + SpcInfo%WD_ExternalDep = .True. + CASE DEFAULT + SpcInfo%WD_ExternalDep = .False. + END SELECT + SpcInfo => NULL() + ENDDO + ENDDO + ENDIF +#endif + IF ( Input_Opt%LDryD ) THEN !============================================================== ! Get mapping between CESM dry deposited species and the ! indices of State_Chm%DryDepVel. This needs to be done after @@ -1558,7 +1576,6 @@ subroutine chem_init(phys_state, pbuf2d) IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate map2GC_dryDep') DO N = 1, nddvels - ! Initialize index to -1 map2GC_dryDep(N) = -1 @@ -1587,9 +1604,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ENDIF - ENDDO - ENDIF #if defined( MODAL_AERO_4MODE ) @@ -1876,6 +1891,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) #if defined( MODAL_AERO_4MODE ) use modal_aero_data, only : ntot_amode, nspec_amode use modal_aero_data, only : lmassptr_amode + use modal_aero_data, only : xname_massptr #endif use Olson_Landmap_Mod, only : Compute_Olson_Landmap @@ -1990,6 +2006,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: vmr1(state%NCOL,PVER,gas_pcnst) REAL(r8) :: wetdepflx(pcols,pcnst) ! Wet deposition fluxes (kg/m2/s) +#if defined( MODAL_AERO ) + REAL(r8) :: binRatio(MAXVAL(nspec_amode(:)),ntot_amode,state%NCOL,PVER) +#endif + ! For emissions REAL(r8) :: eflx(pcols,pver,pcnst) ! 3-D emissions in kg/m2/s @@ -2056,6 +2076,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) INTEGER, SAVE :: iStep = 0 LOGICAL :: rootChunk + LOGICAL :: lastChunk INTEGER :: RC @@ -2078,8 +2099,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! NCOL: number of atmospheric columns on this chunk NCOL = state%NCOL - ! Am I the first chunk on the first CPU? - rootChunk = ( MasterProc.and.(LCHNK==BEGCHUNK) ) + ! Root Chunk + rootChunk = ( MasterProc .and. (LCHNK==BEGCHUNK) ) + ! Last Chunk + lastChunk = ( MasterProc .and. (LCHNK==ENDCHUNK) ) ! Count the number of steps which have passed IF (LCHNK.EQ.BEGCHUNK) iStep = iStep + 1 @@ -2225,19 +2248,30 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Map and flip aerosols DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) - ! TMMF - Here we will have to store the bin to bulk mass ratio ! TMMF - Should there be a ratio of molar weights involved? P = map2MAM4(SM,M) + IF ( P <= 0 ) CYCLE N = lmassptr_amode(SM,M) ! Multiple MAM4 bins are mapped to same GEOS-Chem species - IF ( P > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - State_Chm(LCHNK)%Species(1,J,L,P) = State_Chm(LCHNK)%Species(1,J,L,P) & - + REAL(state%q(J,nZ+1-L,N),fp) - ENDDO - ENDDO - ENDIF + State_Chm(LCHNK)%Species(1,:nY,:nZ,P) = State_Chm(LCHNK)%Species(1,:nY,:nZ,P) & + + REAL(state%q(:nY,nZ:1:-1,N),fp) + ENDDO + ENDDO + DO M = 1, ntot_amode + DO SM = 1, nspec_amode(M) + P = map2MAM4(SM,M) + IF ( P <= 0 ) CYCLE + N = lmassptr_amode(SM,M) + DO J = 1, nY + DO L = 1, nZ + IF ( State_Chm(LCHNK)%Species(1,J,nZ+1-L,P) > 0.0e+00_r8 ) THEN + binRatio(SM,M,J,L) = REAL(state%q(J,L,N),r8) & + / State_Chm(LCHNK)%Species(1,J,nZ+1-L,P) + ELSE + binRatio(SM,M,J,L) = 0.0e+00_r8 + ENDIF + ENDDO + ENDDO ENDDO ENDDO #endif @@ -3523,17 +3557,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! See definition of map2chm M = map2chm(N) IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - mmr1(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) - ENDDO - ENDDO - ELSEIF ( M < 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - mmr1(J,L,N) = state%q(J,L,-M) - ENDDO - ENDDO + mmr1(:nY,:nZ,N) = State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) ENDIF ENDIF ENDDO @@ -3575,6 +3599,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ErrMsg = 'Error encountered in "Do_WetDep"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ELSE ErrMsg = 'Unknown gas_wetdep_method ' //TRIM(gas_wetdep_method) CALL Error_Stop( ErrMsg, ThisLoc ) @@ -3598,17 +3623,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! See definition of map2chm M = map2chm(N) IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - mmr1(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) - mmr1(J,L,N) - ENDDO - ENDDO - ELSEIF ( M < 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - mmr1(J,L,N) = state%q(J,L,-M) - mmr1(J,L,N) - ENDDO - ENDDO + mmr1(:nY,:nZ,N) = State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) - mmr1(:nY,:nZ,N) ENDIF SpcName = wetdep_name(N) @@ -3760,13 +3775,35 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDDO +#if defined( MODAL_AERO_4MODE ) + ! Here apply tendencies to MAM aerosols + ! Initial mass in bin SM is stored as state%q(N) + ! Final mass in bin SM is stored as binRatio(SM,M) * State_Chm(P) + ! + ! We decide to apply chemical tendencies to all MAM aerosols, + ! except so4, for which the chemically-produced sulfate gets + ! partitioned in aero_model_gasaerexch + DO M = 1, ntot_amode + DO SM = 1, nspec_amode(M) + P = map2MAM4(SM,M) + IF ( P <= 0 .OR. to_upper(xname_massptr(SM,M)(:3)) == 'SO4' ) CYCLE + N = lmassptr_amode(SM,M) + ! Apply MAM4 chemical tendencies owing to GEOS-Chem aerosol processing + ptend%q(:nY,:nZ,N) = ptend%q(:nY,:nZ,N) & + + (binRatio(SM,M,:nY,:nZ) * & + REAL(State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,P),r8) & + - state%q(:nY,:nZ,N))/dT + ENDDO + ENDDO +#endif + DO N = 1, gas_pcnst ! See definition of map2chm M = map2chm(N) IF ( M > 0 ) THEN mmr_tend(:nY,:nZ,N) = ( REAL(State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M),r8) - mmr_tend(:nY,:nZ,N) ) / dT ELSEIF ( M < 0 ) THEN - mmr_tend(:nY,:nZ,N) = ( state%q(:nY,:nZ,-M) - mmr_tend(:nY,:nZ,-M) ) / dT + mmr_tend(:nY,:nZ,N) = ptend%q(:nY,:nZ,-M) ENDIF ENDDO @@ -3811,7 +3848,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) Nullify(NEvapr ) Nullify(cmfdqr ) - IF (rootChunk) WRITE(iulog,*) ' GEOS-Chem Chemistry step ', iStep, ' completed' + IF ( rootChunk ) WRITE(iulog,*) ' GEOS-Chem Chemistry step ', iStep, ' completed' + IF ( lastChunk ) WRITE(iulog,*) ' Chemistry completed on all chunks completed of MasterProc' end subroutine chem_timestep_tend From 6e0e656377e6feed8a2014df329d011d5aa45cff Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 19 Jan 2021 16:26:28 -0500 Subject: [PATCH 184/239] Feat: Remove mass-weighted OH concentration diagnostics Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 37 ---------------------------- 1 file changed, 37 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 1e1a6b5fac..03705a629d 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -140,9 +140,6 @@ module chemistry CHARACTER(LEN=255) :: ThisLoc CHARACTER(LEN=255) :: ErrMsg - REAL(r8) :: OH_Total - REAL(r8) :: Air_Total - ! Filenames to compute dry deposition velocities similarly to MOZART character(len=shr_kind_cl) :: clim_soilw_file = 'clim_soilw_file' character(len=shr_kind_cl) :: depvel_file = '' @@ -3736,29 +3733,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO CALL set_short_lived_species( SlsData, LCHNK, nY, pbuf ) -#if defined( SPMD ) - ! We here compute a mass-weighted OH average [molec OH/cm3] * [molec air] - ! Species is in kg/kg dry. Convert to molec/box - ! kg/kg air * kg air/m3 * molec/mole / (kg/mole) * m3/cm3 = molec/cm3 - tmpMass = 0.0e+00_r8 - CALL MPISum ( SUM(State_Chm(LCHNK)%Species(1,:nY,:nZ,iOH) * & - State_Met(LCHNK)%AIRDEN(1,:nY,:nZ) * & - State_Met(LCHNK)%AIRNUMDEN(1,:nY,:nZ) * & - State_Met(LCHNK)%AIRVOL(1,:nY,:nZ)) * & - AVO / MWOH * 1.0e+03_r8, & - tmpMass, 1, MPIR8, 0, MPICOM ) - ! This is in [molec OH/cm3] * [molec air] - OH_Total = OH_Total + tmpMass - - ! molec/cm3 * m3/box * cm3/m3 = molec/box - tmpMass = 0.0e+00_r8 - CALL MPISum ( SUM(State_Met(LCHNK)%AIRNUMDEN(1,:nY,:nZ) * & - State_Met(LCHNK)%AIRVOL(1,:nY,:nZ) * 1.0e+06_r8), & - tmpMass, 1, MPIR8, 0, MPICOM ) - ! This is in [molec air] - Air_Total = Air_Total + tmpMass -#endif - DO N = 1, pcnst M = map2GC(N) IF ( M > 0 ) THEN @@ -3922,17 +3896,6 @@ subroutine chem_final ! Local variables INTEGER :: I, RC - REAL(r8) :: OHCONC - - OHCONC = OH_Total / Air_Total / 1.0e+05_r8 - - IF ( MasterProc ) THEN - WRITE(iulog,'(/,a)') REPEAT( '=', 79 ) - WRITE(iulog,* ) 'Mass-Weighted OH Concentration' - WRITE(iulog,* ) 'Mean OH = ', OHCONC, ' [1e5 molec/cm3]' - WRITE(iulog,'( a)') REPEAT( '=', 79 ) - ENDIF - ! Finalize GEOS-Chem CALL Cleanup_UCX From d1a075468e0a99df0dd73190ffd4af5705b301b0 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 19 Jan 2021 17:31:13 -0500 Subject: [PATCH 185/239] Feat: Add CO2 as constituent Signed-off-by: Thibaud Fritz --- bld/build-namelist | 2 +- src/chemistry/geoschem/chemistry.F90 | 38 +++++++++++++++------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 2ae13b544d..98aec3f578 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -998,7 +998,7 @@ my $radval = "'A:Q:H2O'"; if (($chem =~ /waccm_ma/ or $chem =~ /waccm_tsmlt/) and !$chem_rad_passive) { $radval .= ",'A:O2:O2','A:CO2:CO2'"; } -elsif ($chem =~ /trop_strat/ and !$chem_rad_passive) { +elsif (($chem =~ /trop_strat/ or $chem =~ /geoschem/) and !$chem_rad_passive) { $radval .= ",'N:O2:O2','A:CO2:CO2'"; } elsif ($co2_cycle and !$co2_cycle_rad_passive) { diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 03705a629d..c841d6f588 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -352,6 +352,12 @@ subroutine chem_register lngName = cnstName MWTmp = aerAdvMass(I - nTracers) ref_MMR(I) = 1.0e-38_r8 + ELSEIF ( I .EQ. (nTracers + nAer + 1) ) THEN + ! Add CO2 (which is not a GEOS-Chem tracer) + cnstName = 'CO2' + lngName = 'CO2' + MWTmp = 44.009800_r8 + ref_MMR(I) = 1.0e-38_r8 ELSE cnstName = TRIM(tracerNames(I)) lngName = cnstName @@ -422,15 +428,10 @@ subroutine chem_register !ELSEIF ( cnstName == 'TOLU' ) THEN ! cnstName = 'TOLUENE' ENDIF - If ( MasterProc ) Write(iulog,*) " Species = ", TRIM(cnstName) - ! GEOS-Chem lumped species are not on restart file. - ! Bromine, chlorine, iodine and halons species are missing - ! from CESM restart file. - ! These species will just be uniformily set to some low - ! concentration. - ! TMMF - 05/19/2020 - - ! This is the call to add a "constituent" + + ! For debug, only + !If ( MasterProc ) Write(iulog,*) " Species = ", TRIM(cnstName) + CALL cnst_add( cnstName, MWtmp, cptmp, qmin, N, & readiv=ic_from_cam2, mixtype=mixtype, & cam_outfld=camout, molectype=molectype, & @@ -799,9 +800,10 @@ subroutine chem_readnl(nlfile) DO I = 1, nSpec ! Get the name of the species from KPP line = ADJUSTL(TRIM(Spc_Names(I))) - ! Only add this - validSLS = ( .NOT. ANY(TRIM(line) .EQ. tracerNames) ) - IF (validSLS) THEN + ! Only add short-lived KPP species, except from CO2 + validSLS = (( .NOT. ANY(TRIM(line) .EQ. tracerNames) ) & + .AND. TRIM(line) /= 'CO2' ) + IF ( validSLS ) THEN ! Genuine new short-lived species nSls = nSls + 1 slsNames(nSls) = TRIM(line) @@ -3839,23 +3841,23 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) ! Will need a simple mapping structure as well as the CAM tracer registration ! routines. - INTEGER :: iLev, NLEV, M + INTEGER :: ilev, nlev, M REAL(r8) :: QTemp, Min_MMR - NLEV = SIZE(q, 2) + nlev = SIZE(q, 2) ! Retrieve a "background value" for this from the database Min_MMR = 1.0e-38_r8 - DO M = 1, gas_pcnst - IF (TRIM(solsym(M)).eq.TRIM(name)) THEN + DO M = 1, nTracersMax + IF (TRIM(cnst_name(M)) .eq. TRIM(name)) THEN Min_MMR = ref_MMR(M) EXIT ENDIF ENDDO - DO iLev = 1, NLEV + DO ilev = 1, nlev WHERE(mask) ! Set to the minimum mixing ratio - q(:,iLev) = Min_MMR + q(:,ilev) = Min_MMR END WHERE ENDDO From 71818ab528e34b11e90f1ed2821af649fc12f445 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 20 Jan 2021 12:38:25 -0500 Subject: [PATCH 186/239] Feat: Compute CO2 chemical tendencies (1) GEOS-Chem overwrites CO2 concentrations at every time step. We thus set State_Chm%Species(:,:,:,iCO2) = 0.0e+00 before chemistry and compute chemical tendencies based on how much CO2 has been produced. (2) Cleanup Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 86 ++++++++++------------------ 1 file changed, 29 insertions(+), 57 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index c841d6f588..ad0a745b0c 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -111,9 +111,9 @@ module chemistry type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! Pointer to 2D pbuf ! Indices of critical species in GEOS-Chem - INTEGER :: iH2O, iO3, iCH4, iCO, iNO, iOH + INTEGER :: iH2O, iO3, iCO2 INTEGER :: iO, iH, iO2, iPSO4 - REAL(r8) :: MWOH, MWPSO4, MWO3 + REAL(r8) :: MWPSO4, MWO3 ! Indices of critical species in the constituent list INTEGER :: cQ, cH2O @@ -349,17 +349,20 @@ subroutine chem_register ELSEIF ( I .LE. (nTracers + nAer) ) THEN ! Add MAM4 aerosols cnstName = TRIM(aerNames(I - nTracers)) + trueName = cnstName lngName = cnstName MWTmp = aerAdvMass(I - nTracers) ref_MMR(I) = 1.0e-38_r8 ELSEIF ( I .EQ. (nTracers + nAer + 1) ) THEN ! Add CO2 (which is not a GEOS-Chem tracer) cnstName = 'CO2' + trueName = cnstName lngName = 'CO2' MWTmp = 44.009800_r8 ref_MMR(I) = 1.0e-38_r8 ELSE cnstName = TRIM(tracerNames(I)) + trueName = cnstName lngName = cnstName MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) ref_MMR(I) = 1.0e-38_r8 @@ -444,7 +447,7 @@ subroutine chem_register ! Add to GC mapping. When starting a timestep, we will want to update the ! concentration of State_Chm(x)%Species(1,iCol,iLev,m) with data from ! constituent n - M = Ind_(TRIM(tracerNames(I))) + M = Ind_(TRIM(trueName)) IF ( M > 0 ) THEN ! Map constituent onto GEOS-Chem tracer as indexed in State_Chm(LCHNK)%Species map2GC(N) = M @@ -1748,22 +1751,13 @@ subroutine chem_init(phys_state, pbuf2d) ! Get some indices iH2O = Ind_('H2O') - iOH = Ind_('OH') iO3 = Ind_('O3') - iCH4 = Ind_('CH4') - iCO = Ind_('CO') - iNO = Ind_('NO') + iCO2 = Ind_('CO2') ! The following indices are needed to compute invariants iO = Ind_('O') iH = Ind_('H') iO2 = Ind_('O2') - ! This is used to compute gas-phase H2SO4 production - SpcInfo => State_Chm(BEGCHUNK)%SpcData(iOH)%Info - MWOH = REAL(SpcInfo%MW_g,r8) - ! Free pointer - SpcInfo => NULL() - ! This is used to compute gas-phase H2SO4 production iPSO4 = Ind_('PSO4') SpcInfo => State_Chm(BEGCHUNK)%SpcData(iPSO4)%Info @@ -1957,8 +1951,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8), OPTIONAL, INTENT(OUT) :: fh2o(PCOLS) ! h2o flux to balance source from chemistry ! Initial MMR for all species - REAL(r8) :: MMR_Beg(PCOLS,PVER,nSls+nTracers) - REAL(r8) :: MMR_End(PCOLS,PVER,nSls+nTracers) + REAL(r8) :: MMR_Beg(PCOLS,PVER,MAXVAL(map2GC(:))) + REAL(r8) :: MMR_End(PCOLS,PVER,MAXVAL(map2GC(:))) ! Logical to apply tendencies to mixing ratios LOGICAL :: lq(pcnst) @@ -2177,23 +2171,21 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO N = 1, pcnst M = map2GC(N) IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - MMR_Beg(J,L,M) = state%q(J,nZ+1-L,N) - State_Chm(LCHNK)%Species(1,J,L,M) = REAL(MMR_Beg(J,L,M),fp) - ENDDO - ENDDO + MMR_Beg(:nY,:nZ,M) = state%q(:nY,nZ:1:-1,N) + State_Chm(LCHNK)%Species(1,:nY,:nZ,M) = REAL(MMR_Beg(:nY,:nZ,M),fp) lq(N) = .True. ENDIF ENDDO + ! GEOS-Chem considers CO2 as a "short-lived" species and its concentration + ! is overwritten at every time-step. The CO2 concentration after chemistry + ! corresponds to how much CO2 has been chemically produced. We thus reset + ! the initial CO2 MMR to zero such that we can compute a CO2 tendency due + ! to chemistry + MMR_Beg(:nY,:nZ,iCO2) = 0.0e+00_r8 ! We need to let CAM know that 'H2O' and 'Q' are identical - DO J = 1, nY - DO L = 1, nZ - MMR_Beg(J,L,iH2O) = state%q(J,nZ+1-L,cQ) - State_Chm(LCHNK)%Species(1,J,L,iH2O) = REAL(MMR_Beg(J,L,iH2O),fp) - ENDDO - ENDDO + MMR_Beg(:nY,:nZ,iH2O) = state%q(:nY,nZ:1:-1,cQ) + State_Chm(LCHNK)%Species(1,:nY,:nZ,iH2O) = REAL(MMR_Beg(:nY,:nZ,iH2O),fp) ! Retrieve previous value of species data SlsData(:,:,:) = 0.0e+0_r8 @@ -2212,11 +2204,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO N = 1, nSls M = map2GC_Sls(N) IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - State_Chm(LCHNK)%Species(1,J,L,M) = REAL(SlsData(J,nZ+1-L,N),fp) - ENDDO - ENDDO + State_Chm(LCHNK)%Species(1,:nY,:nZ,M) = REAL(SlsData(:nY,nZ:1:-1,N),fp) ENDIF ENDDO @@ -3448,22 +3436,14 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) M = map2GC(N) IF ( M > 0 ) THEN ! Add to GEOS-Chem species - DO J = 1, nY - DO L = 1, nZ - State_Chm(LCHNK)%Species(1,J,L,M) = State_Chm(LCHNK)%Species(1,J,L,M) & - + eflx(J,nZ+1-L,N) * dT - ENDDO - ENDDO + State_Chm(LCHNK)%Species(1,:nY,:nZ,M) = State_Chm(LCHNK)%Species(1,:nY,:nZ,M) & + + eflx(:nY,nZ:1:-1,N) * dT ELSE ! Add to constituent (mostly for MAM4 aerosols) ! Convert from kg/m2/s to kg/kg/s - DO J = 1, nY - DO L = 1, nZ - ptend%q(J,nZ+1-L,N) = ptend%q(J,nZ+1-L,N) & - + eflx(J,nZ+1-L,N) & - / ( g0_100 * State_Met(LCHNK)%DELP_DRY(1,J,L) ) - ENDDO - ENDDO + ptend%q(:nY,nZ:1:-1,N) = ptend%q(:nY,nZ:1:-1,N) & + + eflx(:nY,nZ:1:-1,N) & + / ( g0_100 * State_Met(LCHNK)%DELP_DRY(1,:nY,:nZ) ) ENDIF ENDDO @@ -3726,11 +3706,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO N = 1, nSls M = map2GC_Sls(N) IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - SlsData(J,nZ+1-L,N) = REAL(State_Chm(LCHNK)%Species(1,J,L,M),r8) - ENDDO - ENDDO + SlsData(:nY,nZ:1:-1,N) = REAL(State_Chm(LCHNK)%Species(1,:nY,:nZ,M),r8) ENDIF ENDDO CALL set_short_lived_species( SlsData, LCHNK, nY, pbuf ) @@ -3741,13 +3717,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Add change in mass mixing ratio to tendencies. ! For NEU wet deposition, the wet removal rates are added to ! ptend. - DO J = 1, nY - DO L = 1, nZ - MMR_End (J,L,M) = REAL(State_Chm(LCHNK)%Species(1,J,L,M),r8) - ptend%q(J,nZ+1-L,N) = ptend%q(J,nZ+1-L,N) & - + (MMR_End(J,L,M)-MMR_Beg(J,L,M))/dT - ENDDO - ENDDO + MMR_End(:nY,:nZ,M) = REAL(State_Chm(LCHNK)%Species(1,:nY,:nZ,M),r8) + ptend%q(:nY,nZ:1:-1,N) = ptend%q(:nY,nZ:1:-1,N) & + + (MMR_End(:nY,:nZ,M)-MMR_Beg(:nY,:nZ,M))/dT ENDIF ENDDO From 3154681c62863d9fc50cc545e888b35aff613606 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Jan 2021 10:54:02 -0500 Subject: [PATCH 187/239] Feat: Apply CAM-Chem surface boundary conditions for long-lived species Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 2 + src/chemistry/geoschem/chem_mods.F90 | 6 +- src/chemistry/geoschem/chemistry.F90 | 135 +++++++++++++++------ src/chemistry/geoschem/mo_chem_utls.F90 | 61 +++++----- src/chemistry/geoschem/mo_ghg_chem.F90 | 1 + 5 files changed, 138 insertions(+), 67 deletions(-) create mode 120000 src/chemistry/geoschem/mo_ghg_chem.F90 diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 73520cf69f..56ae25d33c 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -789,6 +789,8 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) CALL Addfld( 'V_SRF', horiz_only, 'I', 'm/s', 'Vertical wind velocity' ) CALL Addfld( 'Q_SRF', horiz_only, 'I', 'kg/kg', 'Specific humidity' ) + CALL Addfld( 'CT_H2O_GHG', (/ 'lev' /), 'A','kg/kg/s', 'ghg-chem h2o source/sink' ) + !======================================================================= ! Cleanup and quit !======================================================================= diff --git a/src/chemistry/geoschem/chem_mods.F90 b/src/chemistry/geoschem/chem_mods.F90 index ab0821159c..ef8ac5b6c8 100644 --- a/src/chemistry/geoschem/chem_mods.F90 +++ b/src/chemistry/geoschem/chem_mods.F90 @@ -30,8 +30,8 @@ module chem_mods INTEGER :: map2GCinv(nTracersMax) INTEGER :: map2GC_Sls(nSlsMax) - ! Mapping from constituents to raw index - INTEGER :: map2Idx(pcnst) + ! Mapping constituent onto chemical species (as listed in solsym) + INTEGER :: mapCnst(pcnst) ! Aerosols INTEGER, PARAMETER :: nAerMax = 35 @@ -105,7 +105,7 @@ module chem_mods character(len=255), allocatable :: slvd_lst(:) real(r8), allocatable :: slvd_ref_mmr(:) - ! Mapping between constituents and solsym + ! Mapping between chemical species and GEOS-Chem species/other tracers INTEGER :: map2chm(gas_pcnst) end module chem_mods diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index ad0a745b0c..ef3a8d02a5 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -60,8 +60,8 @@ module chemistry use chem_mods, only : aerAdvMass use chem_mods, only : map2GC, map2GCinv use chem_mods, only : map2GC_Sls + use chem_mods, only : mapCnst use chem_mods, only : map2chm - use chem_mods, only : map2Idx use chem_mods, only : map2MAM4 use mo_tracname, only : solsym @@ -133,6 +133,12 @@ module chemistry INTEGER :: ixCldIce ! Cloud ice INTEGER :: ixNDrop ! Cloud droplet number index + ! ghg + + LOGICAL :: ghg_chem = .false. ! .true. => use ghg chem package + CHARACTER(len=shr_kind_cl) :: bndtvg = ' ' ! pathname for greenhouse gas loss rate + CHARACTER(len=shr_kind_cl) :: h2orates = ' ' ! pathname for greenhouse gas (lyman-alpha H2O loss) + ! lightning REAL(r8) :: lght_no_prd_factor = 1._r8 @@ -324,6 +330,7 @@ subroutine chem_register ENDIF iFirstCnst = -1 + mapCnst = -1 map2GC = -1 map2GCinv = -1 map2chm = -1 @@ -346,6 +353,8 @@ subroutine chem_register IF ( ThisSpc%Is_Gas .eqv. .False. ) THEN Write(cnstName, "(a,a)") 'GC_AER_', to_upper(TRIM(trueName)) ENDIF + ! Nullify pointer + ThisSpc => NULL() ELSEIF ( I .LE. (nTracers + nAer) ) THEN ! Add MAM4 aerosols cnstName = TRIM(aerNames(I - nTracers)) @@ -357,7 +366,7 @@ subroutine chem_register ! Add CO2 (which is not a GEOS-Chem tracer) cnstName = 'CO2' trueName = cnstName - lngName = 'CO2' + lngName = cnstName MWTmp = 44.009800_r8 ref_MMR(I) = 1.0e-38_r8 ELSE @@ -453,11 +462,12 @@ subroutine chem_register map2GC(N) = M ! Map GEOS-Chem tracer onto constituent map2GCinv(M) = N - ! Map constituent onto raw index - map2Idx(N) = I ENDIF - ! Nullify pointer - ThisSpc => NULL() + ! Map constituent onto chemically-active species (aka as indexed in solsym) + M = get_spc_ndx(TRIM(trueName)) + IF ( M > 0 ) THEN + mapCnst(N) = M + ENDIF ENDDO ! Now unadvected species @@ -682,6 +692,10 @@ subroutine chem_readnl(nlfile) srf_emis_fixed_tod, & srf_emis_type + ! ghg chem + + namelist /chem_inparm/ bndtvg, h2orates, ghg_chem + inputGeosPath='/glade/u/home/fritzt/input.geos.template' speciesDBPath='/glade/u/home/fritzt/species_database.yml' chemInputsDir='/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/' @@ -839,6 +853,8 @@ subroutine chem_readnl(nlfile) CALL MPIBCAST ( nSls, 1, MPIINT, 0, MPICOM ) CALL MPIBCAST ( slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM ) + ! Broadcast namelist variables + ! The following files are required to compute land maps, required to perform ! aerosol dry deposition CALL MPIBCAST (depvel_lnd_file, LEN(depvel_lnd_file), MPICHAR, 0, MPICOM) @@ -857,6 +873,10 @@ subroutine chem_readnl(nlfile) CALL MPIBCAST (ext_frc_cycle_yr, 1, MPIINT, 0, MPICOM) CALL MPIBCAST (ext_frc_fixed_ymd, 1, MPIINT, 0, MPICOM) CALL MPIBCAST (ext_frc_fixed_tod, 1, MPIINT, 0, MPICOM) + + CALL MPIBCAST (ghg_chem, 1, MPILOG, 0, MPICOM) + CALL MPIBCAST (bndtvg, LEN(bndtvg), MPICHAR, 0, MPICOM) + CALL MPIBCAST (h2orates, LEN(h2orates), MPICHAR, 0, MPICOM) #endif ! Update "short_lived_species" arrays - will eventually unify these @@ -972,6 +992,7 @@ subroutine chem_init(phys_state, pbuf2d) use mo_setinv, only : setinv_inti use mo_mean_mass, only : init_mean_mass + use mo_ghg_chem, only : ghg_chem_init use tracer_cnst, only : tracer_cnst_init use tracer_srcs, only : tracer_srcs_init @@ -1796,6 +1817,10 @@ subroutine chem_init(phys_state, pbuf2d) CALL tracer_cnst_init() CALL tracer_srcs_init() + IF ( ghg_chem ) THEN + CALL ghg_chem_init(phys_state, bndtvg, h2orates) + ENDIF + ! Initialize diagnostics interface CALL CESMGC_Diag_Init( Input_Opt = Input_Opt, & State_Chm = State_Chm(BEGCHUNK), & @@ -1816,13 +1841,25 @@ end subroutine chem_init !=============================================================================== subroutine chem_timestep_init(phys_state, pbuf2d) - use physics_buffer, only: physics_buffer_desc + + use physics_buffer, only : physics_buffer_desc + use mo_flbc, only : flbc_chk + use mo_ghg_chem, only : ghg_chem_timestep_init TYPE(physics_state), INTENT(IN):: phys_state(begchunk:endchunk) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) ! Not sure what we would realistically do here rather than in tend + !----------------------------------------------------------------------- + ! Set fixed lower boundary timing factors + !----------------------------------------------------------------------- + CALL flbc_chk + + IF ( ghg_chem ) THEN + CALL ghg_chem_timestep_init(phys_state) + ENDIF + end subroutine chem_timestep_init !=============================================================================== @@ -1879,6 +1916,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use chem_mods, only : nfs, indexm, gas_pcnst use mo_mean_mass, only : set_mean_mass use mo_setinv, only : setinv + use mo_flbc, only : flbc_set + use mo_ghg_chem, only : ghg_chem_set_flbc use mo_neu_wetdep, only : neu_wetdep_tend use gas_wetdep_opts, only : gas_wetdep_method #if defined( MODAL_AERO_4MODE ) @@ -2152,10 +2191,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Note : Set default value (in case of chunks with fewer columns) State_Grid(LCHNK)%Area_M2 = -1.0e+10_fp State_Met(LCHNK)%Area_M2 = -1.0e+10_fp - DO J = 1, nY - State_Grid(LCHNK)%Area_M2(1,J) = REAL(Col_Area(J) * Re**2,fp) - State_Met(LCHNK)%Area_M2(1,J) = State_Grid(LCHNK)%Area_M2(1,J) - ENDDO + State_Grid(LCHNK)%Area_M2(1,:nY) = REAL(Col_Area(:nY) * Re**2,fp) + State_Met(LCHNK)%Area_M2(1,:nY) = State_Grid(LCHNK)%Area_M2(1,:nY) ! 2. Copy tracers into State_Chm ! Data was received in kg/kg dry @@ -2176,12 +2213,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) lq(N) = .True. ENDIF ENDDO - ! GEOS-Chem considers CO2 as a "short-lived" species and its concentration - ! is overwritten at every time-step. The CO2 concentration after chemistry - ! corresponds to how much CO2 has been chemically produced. We thus reset - ! the initial CO2 MMR to zero such that we can compute a CO2 tendency due - ! to chemistry - MMR_Beg(:nY,:nZ,iCO2) = 0.0e+00_r8 ! We need to let CAM know that 'H2O' and 'Q' are identical MMR_Beg(:nY,:nZ,iH2O) = state%q(:nY,nZ:1:-1,cQ) @@ -2267,6 +2298,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! that Q actually applies tendencies IF ( Input_Opt%applyQtend ) lq(cQ) = .True. + IF ( ghg_chem ) lq(1) = .True. + ! Initialize tendency array CALL Physics_ptend_init(ptend, state%psetcols, 'chemistry', lq=lq) @@ -3499,7 +3532,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF + ! Reset photolysis rates ZPJ = 0.0e+0_r8 + + ! Perform chemistry CALL Do_Chemistry( Input_Opt = Input_Opt, & State_Chm = State_Chm(LCHNK), & State_Diag = State_Diag(LCHNK), & @@ -3512,6 +3548,21 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + + ! Make sure State_Chm(LCHNK) is back in kg/kg dry! + IF ( TRIM(State_Chm(LCHNK)%Spc_Units) /= 'kg/kg dry' ) THEN + Write(iulog,*) 'Current unit = ', TRIM(State_Chm(LCHNK)%Spc_Units) + Write(iulog,*) 'Expected unit = kg/ kg dry' + CALL ENDRUN('Incorrect unit in GEOS-Chem State_Chm%Species') + ENDIF + + ! GEOS-Chem considers CO2 as a dead species and resets its concentration + ! internally. Right after the call to `Do_Chemistry`, State_Chm%Species(iCO2) + ! corresponds to the chemically-produced CO2. The real CO2 concentration + ! is thus the concentration before chemistry + the chemically-produced CO2. + State_Chm(LCHNK)%Species(1,:nY,:nZ,iCO2) = State_Chm(LCHNK)%Species(1,:nY,:nZ,iCO2) & + + MMR_Beg(:nY,:nZ,iCO2) + !============================================================== ! ***** W E T D E P O S I T I O N (rainout + washout) ***** !============================================================== @@ -3630,31 +3681,24 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF - !============================================================== - ! ***** M A M G A S - A E R O S O L E X C H A N G E ***** - !============================================================== - -#if defined( MODAL_AERO ) DO N = 1, gas_pcnst ! See definition of map2chm M = map2chm(N) IF ( M > 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - vmr1(J,L,N) = State_Chm(LCHNK)%Species(1,J,nZ+1-L,M) * & - MWDry / adv_mass(N) - ENDDO - ENDDO + vmr1(:nY,:nZ,N) = State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) * & + MWDry / adv_mass(N) ELSEIF ( M < 0 ) THEN - DO J = 1, nY - DO L = 1, nZ - vmr1(J,L,N) = state%q(J,L,-M) * & - MWDry / adv_mass(N) - ENDDO - ENDDO + vmr1(:nY,:nZ,N) = state%q(:nY,:nZ,-M) * & + MWDry / adv_mass(N) ENDIF ENDDO + !============================================================== + ! ***** M A M G A S - A E R O S O L E X C H A N G E ***** + !============================================================== + +#if defined( MODAL_AERO ) + del_h2so4_gasprod = 0.0e+00_fp ! This needs to be in mol/mol over this timestep IF ( ( iPSO4 > 0 ) .and. ( MWPSO4 > 0.0e+00_fp ) ) THEN @@ -3691,6 +3735,24 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf = pbuf ) #endif + ! Set boundary conditions of long-lived species (most likely + ! CH4, OCS, N2O, CFC11, CFC12). + ! Note: This will overwrite the UCX boundary conditions + + CALL flbc_set( vmr1(:nY,:nZ,:), nY, LCHNK, mapCnst ) + + IF ( ghg_chem ) THEN + CALL ghg_chem_set_flbc( vmr1, nY ) + ENDIF + + DO N = 1, gas_pcnst + ! See definition of map2chm + M = map2chm(N) + IF ( M <= 0 ) CYCLE + State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) = vmr1(:nY,:nZ,N) * & + adv_mass(N) / MWDry + ENDDO + ! Make sure State_Chm(LCHNK) is back in kg/kg dry! IF ( TRIM(State_Chm(LCHNK)%Spc_Units) /= 'kg/kg dry' ) THEN Write(iulog,*) 'Current unit = ', TRIM(State_Chm(LCHNK)%Spc_Units) @@ -3771,6 +3833,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) mmr_tend = mmr_tend, & LCHNK = LCHNK ) + IF ( ghg_chem ) THEN + ptend%lq(1) = .True. + CALL outfld( 'CT_H2O_GHG', ptend%q(:,:,1), PCOLS, LCHNK ) + ENDIF + ! Debug statements ! Ozone tendencies IF ( rootChunk ) THEN diff --git a/src/chemistry/geoschem/mo_chem_utls.F90 b/src/chemistry/geoschem/mo_chem_utls.F90 index 2d0b9ca5d1..43e2d7317e 100644 --- a/src/chemistry/geoschem/mo_chem_utls.F90 +++ b/src/chemistry/geoschem/mo_chem_utls.F90 @@ -5,8 +5,9 @@ module mo_chem_utls public :: get_spc_ndx public :: get_inv_ndx public :: get_extfrc_ndx + public :: get_rxt_ndx public :: utls_chem_is - !, get_het_ndx, get_rxt_ndx + !, get_het_ndx save @@ -146,34 +147,34 @@ integer function get_extfrc_ndx( frc_name ) end if end function get_extfrc_ndx -! -! integer function get_rxt_ndx( rxt_tag ) -! !----------------------------------------------------------------------- -! ! ... return overall external frcing index associated with spc_name -! !----------------------------------------------------------------------- -! -! use chem_mods, only : rxt_tag_cnt, rxt_tag_lst, rxt_tag_map -! -! implicit none -! -! !----------------------------------------------------------------------- -! ! ... dummy arguments -! !----------------------------------------------------------------------- -! character(len=*), intent(in) :: rxt_tag -! -! !----------------------------------------------------------------------- -! ! ... local variables -! !----------------------------------------------------------------------- -! integer :: m -! -! get_rxt_ndx = -1 -! do m = 1,rxt_tag_cnt -! if( trim( rxt_tag ) == trim( rxt_tag_lst(m) ) ) then -! get_rxt_ndx = rxt_tag_map(m) -! exit -! end if -! end do -! -! end function get_rxt_ndx + + integer function get_rxt_ndx( rxt_tag ) + !----------------------------------------------------------------------- + ! ... return overall external frcing index associated with spc_name + !----------------------------------------------------------------------- + + use chem_mods, only : rxt_tag_cnt, rxt_tag_lst, rxt_tag_map + + implicit none + + !----------------------------------------------------------------------- + ! ... dummy arguments + !----------------------------------------------------------------------- + character(len=*), intent(in) :: rxt_tag + + !----------------------------------------------------------------------- + ! ... local variables + !----------------------------------------------------------------------- + integer :: m + + get_rxt_ndx = -1 + do m = 1,rxt_tag_cnt + if( trim( rxt_tag ) == trim( rxt_tag_lst(m) ) ) then + get_rxt_ndx = rxt_tag_map(m) + exit + end if + end do + + end function get_rxt_ndx end module mo_chem_utls diff --git a/src/chemistry/geoschem/mo_ghg_chem.F90 b/src/chemistry/geoschem/mo_ghg_chem.F90 new file mode 120000 index 0000000000..f8a8b4ba4c --- /dev/null +++ b/src/chemistry/geoschem/mo_ghg_chem.F90 @@ -0,0 +1 @@ +../mozart/mo_ghg_chem.F90 \ No newline at end of file From 4d2287cc5f11b4f8d09299873fdf3f7052846f7f Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 21 Jan 2021 17:24:08 -0500 Subject: [PATCH 188/239] Feat: Remove hardwired path to GEOS-Chem CHEM_INPUTS directory Signed-off-by: Thibaud Fritz --- bld/namelist_files/namelist_definition.xml | 10 ++- bld/namelist_files/use_cases/geoschem.xml | 2 + .../use_cases/hist_geoschem.xml | 2 + bld/namelist_files/use_cases/sd_geoschem.xml | 2 + src/chemistry/geoschem/chemistry.F90 | 87 +++++++++++++++++-- 5 files changed, 95 insertions(+), 8 deletions(-) diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index f1b90d8969..ec297033a7 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -4009,11 +4009,17 @@ Full pathname of AMIE inputs for southern hemisphere. Default: NONE. + + +Full pathname to GEOS-Chem chemistry inputs directory +Default: set by build-namelist. + + -Full pathname of dataset for coefficient data used in Weimer05 -high latitude electric potential model. +Full pathname to HEMCO_Config.rc, which prescribes emission inventories Default: set by build-namelist. diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 4129e9a191..35b0d07397 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -5,6 +5,8 @@ 367.0e-6 +/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/ + /glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc /glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f19_f19.134.1975.009.cam.i.2010-01-01_32L_c170403.nc diff --git a/bld/namelist_files/use_cases/hist_geoschem.xml b/bld/namelist_files/use_cases/hist_geoschem.xml index 8a25d032a7..f0ccf03de2 100644 --- a/bld/namelist_files/use_cases/hist_geoschem.xml +++ b/bld/namelist_files/use_cases/hist_geoschem.xml @@ -4,6 +4,8 @@ 00010101 +/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/ + /glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc /glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f19_f19.134.1975.009.cam.i.2010-01-01_32L_c170403.nc diff --git a/bld/namelist_files/use_cases/sd_geoschem.xml b/bld/namelist_files/use_cases/sd_geoschem.xml index 2734b82229..a4f765a215 100644 --- a/bld/namelist_files/use_cases/sd_geoschem.xml +++ b/bld/namelist_files/use_cases/sd_geoschem.xml @@ -4,6 +4,8 @@ 20050101 +/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/ + /glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_56L_c170403.nc atm/cam/met/MERRA2/0.9x1.25/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_sgh30_24km_GRNL_MERRA2_c171218.nc diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index ef3a8d02a5..278a0db1d0 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -94,8 +94,8 @@ module chemistry ! Location of valid species_database.yml CHARACTER(LEN=500) :: speciesDBPath - ! Location of chemistry input (for now) - CHARACTER(LEN=500) :: chemInputsDir + ! Location of chemistry input + CHARACTER(LEN=256) :: gc_cheminputs !----------------------------- ! Derived type objects @@ -648,6 +648,8 @@ subroutine chem_register end subroutine chem_register +!=============================================================================== + subroutine chem_readnl(nlfile) use cam_abortutils, only : endrun @@ -698,7 +700,6 @@ subroutine chem_readnl(nlfile) inputGeosPath='/glade/u/home/fritzt/input.geos.template' speciesDBPath='/glade/u/home/fritzt/species_database.yml' - chemInputsDir='/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/' ALLOCATE(drySpc_ndx(nddvels), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate drySpc_ndx') @@ -745,6 +746,8 @@ subroutine chem_readnl(nlfile) CALL gas_wetdep_readnl(nlfile) + CALL gc_readnl(nlfile) + IF ( MasterProc ) THEN Write(iulog,'(/,a)') REPEAT( '=', 50 ) @@ -1224,10 +1227,8 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%DryRun = .False. - ! For now just hard-code it ! First setup directories - Input_Opt%Chem_Inputs_Dir = TRIM(chemInputsDir) - + Input_Opt%Chem_Inputs_Dir = TRIM(gc_cheminputs) Input_Opt%SpcDatabaseFile = TRIM(speciesDBPath) ! Simulation menu @@ -1897,6 +1898,68 @@ subroutine GC_Update_Timesteps(DT) end subroutine +!=============================================================================== + +!------------------------------------------------------------------------------ +!BOP +! +! !IROUTINE: gc_readnl +! +! !DESCRIPTION: Reads the namelist from cam/src/control/runtime_opts. +!\\ +!\\ +! !INTERFACE: +! + subroutine gc_readnl(nlfile) +! +! !USES: +! + use namelist_utils, only: find_group_name + use units, only: getunit, freeunit + use mpishorthand +! +! !INPUT PARAMETERS: +! + character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input +! +! !REVISION HISTORY: +! 21 Jan 2021 - T.M. Fritz - Initial version +!EOP +!------------------------------------------------------------------------------ +!BOC +! +! !LOCAL VARIABLES: +! + integer :: unitn, ierr + character(len=*), parameter :: subname = 'gc_readnl' + + namelist /gc_nl/ gc_cheminputs + + !----------------------------------------------------------------------------- + + ! Read namelist + IF ( MasterProc ) THEN + unitn = getunit() + OPEN( unitn, FILE=TRIM(nlfile), STATUS='old' ) + CALL find_group_name(unitn, 'gc_nl', STATUS=ierr) + IF ( ierr == 0 ) THEN + READ(unitn, gc_nl, IOSTAT=ierr) + IF ( ierr /= 0 ) THEN + CALL ENDRUN(subname // ':: ERROR reading namelist') + ENDIF + ENDIF + CLOSE(unitn) + CALL freeunit(unitn) + ENDIF + +#ifdef SPMD + ! Broadcast namelist variables + CALL MPIBCAST(gc_cheminputs, LEN(gc_cheminputs), MPICHAR, 0, MPICOM) +#endif + + end subroutine +!EOC + !=============================================================================== subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) @@ -3869,6 +3932,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) end subroutine chem_timestep_tend !=============================================================================== + subroutine chem_init_cnst(name, latvals, lonvals, mask, q) CHARACTER(LEN=*), INTENT(IN) :: name ! constituent name @@ -3903,6 +3967,7 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) end subroutine chem_init_cnst !=============================================================================== + subroutine chem_final use Input_Opt_Mod, only : Cleanup_Input_Opt @@ -4004,7 +4069,9 @@ subroutine chem_final RETURN end subroutine chem_final + !=============================================================================== + subroutine chem_init_restart(File) use tracer_cnst, only: init_tracer_cnst_restart use tracer_srcs, only: init_tracer_srcs_restart @@ -4024,7 +4091,9 @@ subroutine chem_init_restart(File) !call init_linoz_data_restart(File) end subroutine chem_init_restart + !=============================================================================== + subroutine chem_write_restart( File ) use tracer_cnst, only: write_tracer_cnst_restart use tracer_srcs, only: write_tracer_srcs_restart @@ -4043,7 +4112,9 @@ subroutine chem_write_restart( File ) call write_tracer_srcs_restart(File) !call write_linoz_data_restart(File) end subroutine chem_write_restart + !=============================================================================== + subroutine chem_read_restart( File ) use tracer_cnst, only: read_tracer_cnst_restart use tracer_srcs, only: read_tracer_srcs_restart @@ -4062,7 +4133,9 @@ subroutine chem_read_restart( File ) call read_tracer_srcs_restart(File) !call read_linoz_data_restart(File) end subroutine chem_read_restart + !================================================================================ + subroutine chem_emissions( state, cam_in ) use camsrfexch, only : cam_in_t @@ -4095,4 +4168,6 @@ subroutine chem_emissions( state, cam_in ) end subroutine chem_emissions +!=============================================================================== + end module chemistry From 44c684946f71cf2bcecff4f96ff1b5b8df64a180 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 22 Jan 2021 14:00:10 -0500 Subject: [PATCH 189/239] Feat: Remove hard-wired paths for GEOS-Chem inputs. (1) All input files are now (one-time) copied from geoschem_src/run/CESM to Buildconf/camconf. Then to the run folder every time builnml is called Signed-off-by: Thibaud Fritz --- cime_config/buildnml | 48 ++++++++++++++++++++++++---- src/chemistry/geoschem/chemistry.F90 | 8 ++--- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index b12f690263..cb3a9412e9 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -36,6 +36,7 @@ def buildnml(case, caseroot, compname): din_loc_root = case.get_value("DIN_LOC_ROOT") atm_ncpl = case.get_value("ATM_NCPL") CAM_NAMELIST_OPTS = case.get_value("CAM_NAMELIST_OPTS") + CAM_CONFIG_OPTS = case.get_value("CAM_CONFIG_OPTS") CAM_NML_USE_CASE = case.get_value("CAM_NML_USE_CASE") DEBUG = case.get_value("DEBUG") NINST_ATM = case.get_value("NINST_ATM") @@ -175,17 +176,52 @@ def buildnml(case, caseroot, compname): rc, out, err = run_cmd(cmd, from_dir=camconf) expect(rc==0,"Command %s failed rc=%d\nout=%s\nerr=%s"%(cmd,rc,out,err)) + # ----------------------------------------------------- + # For GEOS-Chem / HEMCO only: + # Copy input files from storage location into Buildconf/camconf + # This only needs to be done once + # ----------------------------------------------------- + + # We use this to figure out if we are using the GEOS-Chem chemistry + # mechanism. + # Might have to do something else with HEMCO_CESM? + if '-chem geoschem' in CAM_CONFIG_OPTS: + geoschem_src = os.path.join(srcroot, "src/chemistry/geoschem/geoschem_src") + if not os.path.isdir(geoschem_src): + raise SystemExit("ERROR: Did not find path to GEOS-Chem source code at {:s}".format(geoschem_src)) + if os.path.isdir(rundir): + for fileName in ['species_database.yml', 'input.geos', + 'HISTORY.rc', 'HEMCO_Config.rc', 'HEMCO_Diagn.rc']: + file1 = os.path.join(geoschem_src, "run/CESM", fileName) + file2 = os.path.join(camconf, fileName) + if not os.path.exists(file2): + logger.info("CAM namelist one-time copy: file1 %s file2 %s ", file1, file2) + shutil.copy(file1,file2) + # ----------------------------------------------------- # copy resolved namelist, atm_in, to rundir # ----------------------------------------------------- if os.path.isdir(rundir): - file1 = os.path.join(camconf, "atm_in") - file2 = os.path.join(rundir, "atm_in") - if ninst > 1: - file2 += inst_string - logger.info("CAM namelist copy: file1 %s file2 %s ", file1, file2) - shutil.copy(file1,file2) + for fileName in ['atm_in', 'species_database.yml', 'input.geos', + 'HISTORY.rc', 'HEMCO_Config.rc', 'HEMCO_Diagn.rc']: + file1 = os.path.join(camconf, fileName) + file2 = os.path.join(rundir, fileName) + if fileName == 'atm_in' and ninst > 1: + file2 += inst_string + if os.path.exists(file1) or fileName == 'atm_in': + logger.info("CAM namelist copy: file1 %s file2 %s ", file1, file2) + shutil.copy(file1,file2) + + if fileName == 'input.geos': + # We need to replace the simulation name by "Standard" + # in input.geos + # This should already be the case, but just making sure + with open(file2, 'r') as file: + inputGC = file.read() + inputGC = inputGC.replace('{SIM}', 'Standard') + with open(file2, 'w') as file: + file.write(inputGC) # ----------------------------------------------------- # copy drv_flds_in to rundir if it does not exist diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 278a0db1d0..461f40c717 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -698,8 +698,8 @@ subroutine chem_readnl(nlfile) namelist /chem_inparm/ bndtvg, h2orates, ghg_chem - inputGeosPath='/glade/u/home/fritzt/input.geos.template' - speciesDBPath='/glade/u/home/fritzt/species_database.yml' + inputGeosPath='input.geos' + speciesDBPath='species_database.yml' ALLOCATE(drySpc_ndx(nddvels), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate drySpc_ndx') @@ -794,6 +794,8 @@ subroutine chem_readnl(nlfile) IF ( INDEX( TRIM(line), '---' ) > 0 ) EXIT + IF ( INDEX( TRIM(line), 'CLOCK' ) > 0 ) CYCLE + nTracers = nTracers + 1 tracerNames(nTracers) = TRIM(line) @@ -1061,8 +1063,6 @@ subroutine chem_init(phys_state, pbuf2d) ! NCOL: number of atmospheric columns for each chunk NCOL = phys_state%NCOL - write(iulog,'(2(a,x,I6,x))') 'chem_init called on PE ', myCPU, ' of ', nCPUs - ! The GEOS-Chem grids on every "chunk" will all be the same size, to avoid ! the possibility of having differently-sized chunks nX = 1 From cf7e371ff99b5ad945889209fe63a8f4c0ffc2c2 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 22 Jan 2021 15:44:24 -0500 Subject: [PATCH 190/239] Feat: Read from input.geos Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 353 +++++++++++++-------------- 1 file changed, 176 insertions(+), 177 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 461f40c717..d3f3486746 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -991,7 +991,8 @@ subroutine chem_init(phys_state, pbuf2d) use Ucx_Mod, only : Init_Ucx use Strat_chem_Mod, only : Init_Strat_Chem use isorropiaII_Mod, only : Init_IsorropiaII - use Input_mod, only : Validate_Directories + use Input_Mod, only : Read_Input_File + use Input_Mod, only : Validate_Directories use Olson_Landmap_Mod use Vdiff_Mod @@ -1097,27 +1098,17 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt = Input_Opt, & RC = RC ) - ! Set some basic flags - Input_Opt%LUCX = .True. - IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered within call to "Set_Input_Opt"!' CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - CALL Validate_Directories( Input_Opt, RC ) - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Validation_Directories"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ! Find stratopause level, defined at 1 hPa nStrat = nZ DO WHILE ( hyam(nZ+1-nStrat) * ps0 < 100.0 ) nStrat = nStrat-1 ENDDO - ! Initialize grid with largest number of columns ! This is required as State_Grid(LCHNK) can have different ! number of columns, but GEOS-Chem arrays are defined based @@ -1138,6 +1129,180 @@ subroutine chem_init(phys_state, pbuf2d) maxGrid%NY = nY maxGrid%NZ = nZ + Input_Opt%thisCPU = myCPU + Input_Opt%amIRoot = MasterProc + + ! TODO: Mimic GEOS-Chem's reading of input options + IF ( MasterProc ) THEN + CALL Read_Input_File( Input_Opt = Input_Opt, & + State_Grid = maxGrid, & + RC = RC ) + + !Input_Opt%DryRun = .False. + + ! First setup directories + Input_Opt%Chem_Inputs_Dir = TRIM(gc_cheminputs) + Input_Opt%SpcDatabaseFile = TRIM(speciesDBPath) + + !! Simulation menu + !Input_Opt%NYMDb = 20000101 + !Input_Opt%NHMSb = 000000 + !Input_Opt%NYMDe = 20010101 + !Input_Opt%NHMSe = 000000 + + !! Now READ_SIMULATION_MENU + !Input_Opt%ITS_A_CH4_SIM = .False. + !Input_Opt%ITS_A_CO2_SIM = .False. + !Input_Opt%ITS_A_FULLCHEM_SIM = .True. + !Input_Opt%ITS_A_MERCURY_SIM = .False. + !Input_Opt%ITS_A_POPS_SIM = .False. + !Input_Opt%ITS_A_RnPbBe_SIM = .False. + !Input_Opt%ITS_A_TAGO3_SIM = .False. + !Input_Opt%ITS_A_TAGCO_SIM = .False. + !Input_Opt%ITS_AN_AEROSOL_SIM = .False. + + ! Now READ_ADVECTED_SPECIES_MENU + !Input_Opt%N_Advect = nTracers + !IF (Input_Opt%N_Advect.GT.Input_Opt%Max_AdvectSpc) THEN + ! CALL ENDRUN('Number of tracers exceeds max count') + !ENDIF + !! Assign tracer names + !DO J = 1, Input_Opt%N_Advect + ! Input_Opt%AdvectSpc_Name(J) = TRIM(tracerNames(J)) + !ENDDO + !! No tagged species + !Input_Opt%LSplit = .False. + + !! Now READ_TRANSPORT_MENU + !Input_Opt%LTran = .True. + !Input_Opt%LFill = .True. + !Input_Opt%TPCore_IOrd = 3 + !Input_Opt%TPCore_JOrd = 3 + !Input_Opt%TPCore_KOrd = 3 + + ! Now READ_PHOTOLYSIS_MENU + Input_Opt%FAST_JX_DIR = TRIM(gc_cheminputs)//'FAST_JX/v2020-02' + + !! Now READ_CONVECTION_MENU + !Input_Opt%LConv = .False. + !Input_Opt%LTurb = .True. + !Input_Opt%LNLPBL = .True. + + !! Now READ_EMISSIONS_MENU + !! This menu is pointless in CESM-GC + !Input_Opt%LEmis = .False. + !Input_Opt%HCOConfigFile = 'HEMCO_Config.rc' + + !Input_Opt%LSoilNOx = .False. + + !! Set surface VMRs - turn this off so that CAM can handle it + !Input_Opt%LCH4Emis = .False. + !Input_Opt%LCH4SBC = .False. + + ! Set initial conditions + Input_Opt%LSetH2O = .False. !TMMF + + !! Now READ_AEROSOL_MENU + !Input_Opt%LSulf = .True. + !Input_Opt%LMetalcatSO2 = .True. + !Input_Opt%LCarb = .True. + !Input_Opt%LBrC = .False. + !Input_Opt%LSOA = .False. + !Input_Opt%LSVPOA = .False. + !Input_Opt%LDust = .True. + !Input_Opt%LDstUp = .False. + !Input_Opt%LSSalt = .True. + !Input_Opt%SalA_rEdge_um(1) = 0.01e+0_fp + !Input_Opt%SalA_rEdge_um(2) = 0.50e+0_fp + !Input_Opt%SalC_rEdge_um(1) = 0.50e+0_fp + !Input_Opt%SalC_rEdge_um(2) = 8.00e+0_fp + !Input_Opt%LMPOA = .False. + + ! For now, disable solid PSCs and strat aerosol settling + ! Our treatment of the stratosphere isn't really sophisticated + ! enough to warrant it yet + Input_Opt%LGravStrat = .False. + Input_Opt%LSolidPSC = .False. + !Input_Opt%LHomNucNAT = .False. + !Input_Opt%T_NAT_Supercool = 3.0e+0_fp + !Input_Opt%P_Ice_Supersat = 1.2e+0_fp + !Input_Opt%LPSCChem = .True. + !Input_Opt%LStratOD = .True. + + !Input_Opt%LBCAE = .True. + !Input_Opt%BCAE_1 = 1.5e+0_fp + !Input_Opt%BCAE_2 = 1.0e+0_fp + !Input_Opt%hvAerNIT = .False. + !Input_Opt%hvAerNIT_JNIT = 0.0e+00_fp + !Input_Opt%hvAerNIT_JNITs = 0.0e+00_fp + !Input_Opt%JNITChanA = 66.667e+0_fp + !Input_Opt%JNITChanB = 33.333e+0_fp + + !! Now READ_DEPOSITION_MENU + !Input_Opt%LDryD = .True. + !!================================================================== + !! Add the following options: + !! + GEOS-Chem computes ALL dry-deposition velocities + !! + CLM computes land velocities. Velocities over ocean and ice are + !! computed in a MOZART-like way + !! + CLM computes land velocities. Velocities over ocean and ice are + !! computed from GEOS-Chem + !! + !! Note: What to do about aerosols? Who should compute the dry + !! deposition velocities + !! + !! Thibaud M. Fritz - 26 Feb 2020 + !!================================================================== + !Input_Opt%LWetD = .True. + !Input_Opt%CO2_Effect = .False. + !Input_Opt%CO2_Level = 600.0_fp + !Input_Opt%CO2_Ref = 390.0_fp + + ! Now READ_CHEMISTRY_MENU + !Input_Opt%LChem = .True. + Input_Opt%LSChem = .False. ! .True. !TMMF + !Input_Opt%LLinoz = .True. + !Input_Opt%LSynoz = .True. + !Input_Opt%LUCX = .True. + !Input_Opt%LActiveH2O = .True. + !Input_Opt%Use_Online_O3 = .True. + ! Expect to get total overhead ozone, although it should not + ! make too much of a difference since we want to use "full-UCX" + !Input_Opt%Use_O3_from_Met = .True. + !Input_Opt%Use_TOMS_O3 = .False. + !Input_Opt%Gamma_HO2 = 0.2e+0_fp + + !Input_Opt%LPRT = .False. + + !================================================================== + ! CESM-specific input flags + !================================================================== + + ! onlineAlbedo -> True (use CLM albedo) + ! -> False (read monthly-mean albedo from HEMCO) + Input_Opt%onlineAlbedo = .True. + + ! onlineLandTypes -> True (use CLM landtypes) + ! -> False (read landtypes from HEMCO) + Input_Opt%onlineLandTypes = .True. + + ! ddVel_CLM -> True (use CLM dry deposition velocities) + ! -> False (let GEOS-Chem compute dry deposition velocities) + Input_Opt%ddVel_CLM = .False. + + ! applyQtend: apply tendencies of water vapor to specific humidity + Input_Opt%applyQtend = .False. + + CALL MPIBCAST( Input_Opt, 1, OptInput, 0, MPICOM ) + ENDIF + + CALL Validate_Directories( Input_Opt, RC ) + + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered in "Validation_Directories"!' + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + ! Initialize GEOS-Chem horizontal grid structure CALL GC_Init_Grid( Input_Opt = Input_Opt, & State_Grid = maxGrid, & @@ -1214,172 +1379,6 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - Input_Opt%thisCPU = myCPU - Input_Opt%amIRoot = MasterProc - - ! TODO: Mimic GEOS-Chem's reading of input options - !IF (MasterProc) THEN - ! CALL Read_Input_File( Input_Opt = Input_Opt, & - ! srcFile = inputGeosPath, & - ! RC = RC ) - !ENDIF - !CALL - - Input_Opt%DryRun = .False. - - ! First setup directories - Input_Opt%Chem_Inputs_Dir = TRIM(gc_cheminputs) - Input_Opt%SpcDatabaseFile = TRIM(speciesDBPath) - - ! Simulation menu - Input_Opt%NYMDb = 20000101 - Input_Opt%NHMSb = 000000 - Input_Opt%NYMDe = 20010101 - Input_Opt%NHMSe = 000000 - - ! Now READ_SIMULATION_MENU - Input_Opt%ITS_A_CH4_SIM = .False. - Input_Opt%ITS_A_CO2_SIM = .False. - Input_Opt%ITS_A_FULLCHEM_SIM = .True. - Input_Opt%ITS_A_MERCURY_SIM = .False. - Input_Opt%ITS_A_POPS_SIM = .False. - Input_Opt%ITS_A_RnPbBe_SIM = .False. - Input_Opt%ITS_A_TAGO3_SIM = .False. - Input_Opt%ITS_A_TAGCO_SIM = .False. - Input_Opt%ITS_AN_AEROSOL_SIM = .False. - - ! Now READ_ADVECTED_SPECIES_MENU - Input_Opt%N_Advect = nTracers - IF (Input_Opt%N_Advect.GT.Input_Opt%Max_AdvectSpc) THEN - CALL ENDRUN('Number of tracers exceeds max count') - ENDIF - ! Assign tracer names - DO J = 1, Input_Opt%N_Advect - Input_Opt%AdvectSpc_Name(J) = TRIM(tracerNames(J)) - ENDDO - ! No tagged species - Input_Opt%LSplit = .False. - - ! Now READ_TRANSPORT_MENU - Input_Opt%LTran = .True. - Input_Opt%LFill = .True. - Input_Opt%TPCore_IOrd = 3 - Input_Opt%TPCore_JOrd = 3 - Input_Opt%TPCore_KOrd = 3 - - ! Now READ_PHOTOLYSIS_MENU - Input_Opt%FAST_JX_DIR ='/glade/p/univ/umit0034/ExtData/' // & - 'CHEM_INPUTS/FAST_JX/v2020-02/' - - ! Now READ_CONVECTION_MENU - Input_Opt%LConv = .False. - Input_Opt%LTurb = .True. - Input_Opt%LNLPBL = .True. - - ! Now READ_EMISSIONS_MENU - ! This menu is pointless in CESM-GC - Input_Opt%LEmis = .False. - Input_Opt%HCOConfigFile = 'HEMCO_Config.rc' - - Input_Opt%LSoilNOx = .True. - - ! Set surface VMRs - turn this off so that CAM can handle it - Input_Opt%LCH4Emis = .False. - Input_Opt%LCH4SBC = .False. - - ! Set initial conditions - Input_Opt%LSetH2O = .False. !TMMF - - ! Now READ_AEROSOL_MENU - Input_Opt%LSulf = .True. - Input_Opt%LMetalcatSO2 = .True. - Input_Opt%LCarb = .True. - Input_Opt%LBrC = .False. - Input_Opt%LSOA = .False. - Input_Opt%LSVPOA = .False. - Input_Opt%LDust = .True. - Input_Opt%LDstUp = .False. - Input_Opt%LSSalt = .True. - Input_Opt%SalA_rEdge_um(1) = 0.01e+0_fp - Input_Opt%SalA_rEdge_um(2) = 0.50e+0_fp - Input_Opt%SalC_rEdge_um(1) = 0.50e+0_fp - Input_Opt%SalC_rEdge_um(2) = 8.00e+0_fp - Input_Opt%LMPOA = .False. - ! For now, disable solid PSCs and strat aerosol settling - ! Our treatment of the stratosphere isn't really sophisticated - ! enough to warrant it yet - Input_Opt%LGravStrat = .False. - Input_Opt%LSolidPSC = .False. - Input_Opt%LHomNucNAT = .False. - Input_Opt%T_NAT_Supercool = 3.0e+0_fp - Input_Opt%P_Ice_Supersat = 1.2e+0_fp - Input_Opt%LPSCChem = .True. - Input_Opt%LStratOD = .True. - - Input_Opt%LBCAE = .True. - Input_Opt%BCAE_1 = 1.5e+0_fp - Input_Opt%BCAE_2 = 1.0e+0_fp - Input_Opt%hvAerNIT = .False. - Input_Opt%hvAerNIT_JNIT = 0.0e+00_fp - Input_Opt%hvAerNIT_JNITs = 0.0e+00_fp - Input_Opt%JNITChanA = 66.667e+0_fp - Input_Opt%JNITChanB = 33.333e+0_fp - - ! Now READ_DEPOSITION_MENU - Input_Opt%LDryD = .True. - !================================================================== - ! Add the following options: - ! + GEOS-Chem computes ALL dry-deposition velocities - ! + CLM computes land velocities. Velocities over ocean and ice are - ! computed in a MOZART-like way - ! + CLM computes land velocities. Velocities over ocean and ice are - ! computed from GEOS-Chem - ! - ! Note: What to do about aerosols? Who should compute the dry - ! deposition velocities - ! - ! Thibaud M. Fritz - 26 Feb 2020 - !================================================================== - Input_Opt%LWetD = .True. - Input_Opt%CO2_Effect = .False. - Input_Opt%CO2_Level = 600.0_fp - Input_Opt%CO2_Ref = 390.0_fp - - ! Now READ_CHEMISTRY_MENU - Input_Opt%LChem = .True. - Input_Opt%LSChem = .False. ! .True. !TMMF - Input_Opt%LLinoz = .True. - Input_Opt%LSynoz = .True. - Input_Opt%LUCX = .True. - Input_Opt%LActiveH2O = .True. - Input_Opt%Use_Online_O3 = .True. - ! Expect to get total overhead ozone, although it should not - ! make too much of a difference since we want to use "full-UCX" - Input_Opt%Use_O3_from_Met = .True. - Input_Opt%Use_TOMS_O3 = .False. - Input_Opt%Gamma_HO2 = 0.2e+0_fp - - Input_Opt%LPRT = .False. - - !================================================================== - ! CESM-specific input flags - !================================================================== - - ! onlineAlbedo -> True (use CLM albedo) - ! -> False (read monthly-mean albedo from HEMCO) - Input_Opt%onlineAlbedo = .True. - - ! onlineLandTypes -> True (use CLM landtypes) - ! -> False (read landtypes from HEMCO) - Input_Opt%onlineLandTypes = .True. - - ! ddVel_CLM -> True (use CLM dry deposition velocities) - ! -> False (let GEOS-Chem compute dry deposition velocities) - Input_Opt%ddVel_CLM = .False. - - ! applyQtend: apply tendencies of water vapor to specific humidity - Input_Opt%applyQtend = .False. - ! Read in data for Linoz. All CPUs allocate one array to hold the data. Only ! the root CPU reads in the data; then we copy it out to a temporary array, ! broadcast to all other CPUs, and finally duplicate the data into every From 77fac21d1320522f90be602e5110fd1193ba06b5 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 22 Jan 2021 21:11:00 -0500 Subject: [PATCH 191/239] Feat: Read input.geos rather than hard-wiring input options Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chem_mods.F90 | 2 +- src/chemistry/geoschem/chemistry.F90 | 164 ++----------------------- src/chemistry/geoschem/mo_sim_dat.F90 | 6 +- src/chemistry/geoschem/mo_tracname.F90 | 2 +- 4 files changed, 17 insertions(+), 157 deletions(-) diff --git a/src/chemistry/geoschem/chem_mods.F90 b/src/chemistry/geoschem/chem_mods.F90 index ef8ac5b6c8..2d2903182a 100644 --- a/src/chemistry/geoschem/chem_mods.F90 +++ b/src/chemistry/geoschem/chem_mods.F90 @@ -63,7 +63,7 @@ module chem_mods rxntot = 212, & ! number of total reactions gascnt = 172, & ! number of gas phase reactions nabscol = 2, & ! number of absorbing column densities - gas_pcnst = 317, & ! number of "gas phase" species + gas_pcnst = 318, & ! number of "gas phase" species nfs = 6, & ! number of "fixed" species relcnt = 0, & ! number of relationship species grpcnt = 0, & ! number of group members diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index d3f3486746..5f5c76bd8c 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -88,11 +88,10 @@ module chemistry public :: chem_emissions public :: chem_timestep_init - ! Location of valid input.geos - CHARACTER(LEN=500) :: inputGeosPath - - ! Location of valid species_database.yml - CHARACTER(LEN=500) :: speciesDBPath + ! Location of valid input.geos and species_database.yml + ! Use local files in run folder + CHARACTER(LEN=500) :: inputGeos = 'input.geos' + CHARACTER(LEN=500) :: speciesDB = 'species_database.yml' ! Location of chemistry input CHARACTER(LEN=256) :: gc_cheminputs @@ -256,9 +255,6 @@ subroutine chem_register CALL Set_sim_dat() ! Generate fake state_chm - IO%Max_BPCH_Diag = 1000 - IO%Max_AdvectSpc = 500 - IO%Max_Families = 250 ! Prevent Reporting IO%amIRoot = .False. @@ -287,7 +283,7 @@ subroutine chem_register IO%SALC_rEdge_um(1) = 0.50e+0_fp IO%SALC_rEdge_um(2) = 8.00e+0_fp - IO%SpcDatabaseFile = TRIM(speciesDBPath) + IO%SpcDatabaseFile = TRIM(speciesDB) CALL Init_State_Grid( Input_Opt = IO, & State_Grid = SG, & @@ -698,9 +694,6 @@ subroutine chem_readnl(nlfile) namelist /chem_inparm/ bndtvg, h2orates, ghg_chem - inputGeosPath='input.geos' - speciesDBPath='species_database.yml' - ALLOCATE(drySpc_ndx(nddvels), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate drySpc_ndx') @@ -768,7 +761,7 @@ subroutine chem_readnl(nlfile) ! Opening input.geos and go to ADVECTED SPECIES MENU !============================================================== - OPEN( unitn, FILE=TRIM(inputGeosPath), STATUS='OLD', IOSTAT=IERR ) + OPEN( unitn, FILE=TRIM(inputGeos), STATUS='OLD', IOSTAT=IERR ) IF (IERR .NE. 0) THEN CALL ENDRUN('chem_readnl: ERROR opening input.geos') ENDIF @@ -788,17 +781,15 @@ subroutine chem_readnl(nlfile) ! Read list of GEOS-Chem tracers !============================================================== + ! Mimic GEOS-Chem's READ_ADVECTED_SPECIES_MENU DO ! Read line READ(unitn,'(26x,a)', IOSTAT=IERR) line IF ( INDEX( TRIM(line), '---' ) > 0 ) EXIT - IF ( INDEX( TRIM(line), 'CLOCK' ) > 0 ) CYCLE - nTracers = nTracers + 1 tracerNames(nTracers) = TRIM(line) - ENDDO CLOSE(unitn) @@ -1132,147 +1123,16 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%thisCPU = myCPU Input_Opt%amIRoot = MasterProc - ! TODO: Mimic GEOS-Chem's reading of input options - IF ( MasterProc ) THEN + !IF ( MasterProc ) THEN + IF ( .True. ) THEN CALL Read_Input_File( Input_Opt = Input_Opt, & State_Grid = maxGrid, & RC = RC ) - !Input_Opt%DryRun = .False. - ! First setup directories Input_Opt%Chem_Inputs_Dir = TRIM(gc_cheminputs) - Input_Opt%SpcDatabaseFile = TRIM(speciesDBPath) - - !! Simulation menu - !Input_Opt%NYMDb = 20000101 - !Input_Opt%NHMSb = 000000 - !Input_Opt%NYMDe = 20010101 - !Input_Opt%NHMSe = 000000 - - !! Now READ_SIMULATION_MENU - !Input_Opt%ITS_A_CH4_SIM = .False. - !Input_Opt%ITS_A_CO2_SIM = .False. - !Input_Opt%ITS_A_FULLCHEM_SIM = .True. - !Input_Opt%ITS_A_MERCURY_SIM = .False. - !Input_Opt%ITS_A_POPS_SIM = .False. - !Input_Opt%ITS_A_RnPbBe_SIM = .False. - !Input_Opt%ITS_A_TAGO3_SIM = .False. - !Input_Opt%ITS_A_TAGCO_SIM = .False. - !Input_Opt%ITS_AN_AEROSOL_SIM = .False. - - ! Now READ_ADVECTED_SPECIES_MENU - !Input_Opt%N_Advect = nTracers - !IF (Input_Opt%N_Advect.GT.Input_Opt%Max_AdvectSpc) THEN - ! CALL ENDRUN('Number of tracers exceeds max count') - !ENDIF - !! Assign tracer names - !DO J = 1, Input_Opt%N_Advect - ! Input_Opt%AdvectSpc_Name(J) = TRIM(tracerNames(J)) - !ENDDO - !! No tagged species - !Input_Opt%LSplit = .False. - - !! Now READ_TRANSPORT_MENU - !Input_Opt%LTran = .True. - !Input_Opt%LFill = .True. - !Input_Opt%TPCore_IOrd = 3 - !Input_Opt%TPCore_JOrd = 3 - !Input_Opt%TPCore_KOrd = 3 - - ! Now READ_PHOTOLYSIS_MENU - Input_Opt%FAST_JX_DIR = TRIM(gc_cheminputs)//'FAST_JX/v2020-02' - - !! Now READ_CONVECTION_MENU - !Input_Opt%LConv = .False. - !Input_Opt%LTurb = .True. - !Input_Opt%LNLPBL = .True. - - !! Now READ_EMISSIONS_MENU - !! This menu is pointless in CESM-GC - !Input_Opt%LEmis = .False. - !Input_Opt%HCOConfigFile = 'HEMCO_Config.rc' - - !Input_Opt%LSoilNOx = .False. - - !! Set surface VMRs - turn this off so that CAM can handle it - !Input_Opt%LCH4Emis = .False. - !Input_Opt%LCH4SBC = .False. - - ! Set initial conditions - Input_Opt%LSetH2O = .False. !TMMF - - !! Now READ_AEROSOL_MENU - !Input_Opt%LSulf = .True. - !Input_Opt%LMetalcatSO2 = .True. - !Input_Opt%LCarb = .True. - !Input_Opt%LBrC = .False. - !Input_Opt%LSOA = .False. - !Input_Opt%LSVPOA = .False. - !Input_Opt%LDust = .True. - !Input_Opt%LDstUp = .False. - !Input_Opt%LSSalt = .True. - !Input_Opt%SalA_rEdge_um(1) = 0.01e+0_fp - !Input_Opt%SalA_rEdge_um(2) = 0.50e+0_fp - !Input_Opt%SalC_rEdge_um(1) = 0.50e+0_fp - !Input_Opt%SalC_rEdge_um(2) = 8.00e+0_fp - !Input_Opt%LMPOA = .False. - - ! For now, disable solid PSCs and strat aerosol settling - ! Our treatment of the stratosphere isn't really sophisticated - ! enough to warrant it yet - Input_Opt%LGravStrat = .False. - Input_Opt%LSolidPSC = .False. - !Input_Opt%LHomNucNAT = .False. - !Input_Opt%T_NAT_Supercool = 3.0e+0_fp - !Input_Opt%P_Ice_Supersat = 1.2e+0_fp - !Input_Opt%LPSCChem = .True. - !Input_Opt%LStratOD = .True. - - !Input_Opt%LBCAE = .True. - !Input_Opt%BCAE_1 = 1.5e+0_fp - !Input_Opt%BCAE_2 = 1.0e+0_fp - !Input_Opt%hvAerNIT = .False. - !Input_Opt%hvAerNIT_JNIT = 0.0e+00_fp - !Input_Opt%hvAerNIT_JNITs = 0.0e+00_fp - !Input_Opt%JNITChanA = 66.667e+0_fp - !Input_Opt%JNITChanB = 33.333e+0_fp - - !! Now READ_DEPOSITION_MENU - !Input_Opt%LDryD = .True. - !!================================================================== - !! Add the following options: - !! + GEOS-Chem computes ALL dry-deposition velocities - !! + CLM computes land velocities. Velocities over ocean and ice are - !! computed in a MOZART-like way - !! + CLM computes land velocities. Velocities over ocean and ice are - !! computed from GEOS-Chem - !! - !! Note: What to do about aerosols? Who should compute the dry - !! deposition velocities - !! - !! Thibaud M. Fritz - 26 Feb 2020 - !!================================================================== - !Input_Opt%LWetD = .True. - !Input_Opt%CO2_Effect = .False. - !Input_Opt%CO2_Level = 600.0_fp - !Input_Opt%CO2_Ref = 390.0_fp - - ! Now READ_CHEMISTRY_MENU - !Input_Opt%LChem = .True. - Input_Opt%LSChem = .False. ! .True. !TMMF - !Input_Opt%LLinoz = .True. - !Input_Opt%LSynoz = .True. - !Input_Opt%LUCX = .True. - !Input_Opt%LActiveH2O = .True. - !Input_Opt%Use_Online_O3 = .True. - ! Expect to get total overhead ozone, although it should not - ! make too much of a difference since we want to use "full-UCX" - !Input_Opt%Use_O3_from_Met = .True. - !Input_Opt%Use_TOMS_O3 = .False. - !Input_Opt%Gamma_HO2 = 0.2e+0_fp - - !Input_Opt%LPRT = .False. + Input_Opt%SpcDatabaseFile = TRIM(speciesDB) + Input_Opt%FAST_JX_DIR = TRIM(gc_cheminputs)//'FAST_JX/v2020-02/' !================================================================== ! CESM-specific input flags @@ -1292,8 +1152,6 @@ subroutine chem_init(phys_state, pbuf2d) ! applyQtend: apply tendencies of water vapor to specific humidity Input_Opt%applyQtend = .False. - - CALL MPIBCAST( Input_Opt, 1, OptInput, 0, MPICOM ) ENDIF CALL Validate_Directories( Input_Opt, RC ) diff --git a/src/chemistry/geoschem/mo_sim_dat.F90 b/src/chemistry/geoschem/mo_sim_dat.F90 index 7b2dabb31c..4749340fac 100644 --- a/src/chemistry/geoschem/mo_sim_dat.F90 +++ b/src/chemistry/geoschem/mo_sim_dat.F90 @@ -40,7 +40,7 @@ subroutine set_sim_dat ! aerosols, as those will be constituents. MAM requires that there ! is a linear mapping between solsym and constituents - solsym(:317) = (/ 'ACET ','ACTA ','AERI ', & + solsym(:318) = (/ 'ACET ','ACTA ','AERI ', & 'ALD2 ','ALK4 ','ATOOH ', & 'BCPI ','BCPO ','BENZ ', & 'Br ','Br2 ','BrCl ', & @@ -55,6 +55,7 @@ subroutine set_sim_dat 'CHBr3 ','CHCl3 ','Cl ', & 'Cl2 ','Cl2O2 ','ClNO2 ', & 'ClNO3 ','ClO ','ClOO ', & + 'CLOCK ', & 'CO ','DMS ','DST1 ', & 'DST2 ','DST3 ','DST4 ', & 'EOH ','ETHLN ','ETNO3 ', & @@ -153,7 +154,7 @@ subroutine set_sim_dat fix_mass(: 6) = (/ 0.00000000_r8, 28.0134800_r8, 31.9988000_r8, 2.020000_r8, 32.050000_r8, & 74.090000_r8 /) - adv_mass(:317) = (/ 58.090000_r8, 60.060000_r8, 126.900000_r8, 44.060000_r8, 58.120000_r8, & + adv_mass(:318) = (/ 58.090000_r8, 60.060000_r8, 126.900000_r8, 44.060000_r8, 58.120000_r8, & 90.090000_r8, 12.010000_r8, 12.010000_r8, 78.120000_r8, 79.900000_r8, & 159.800000_r8, 115.450000_r8, 125.910000_r8, 141.910000_r8, 95.900000_r8, & 79.900000_r8, 79.900000_r8, 30.080000_r8, 44.110000_r8, 153.820000_r8, & @@ -162,6 +163,7 @@ subroutine set_sim_dat 30.030000_r8, 94.940000_r8, 133.350000_r8, 50.450000_r8, 141.940000_r8, & 16.050000_r8, 252.730000_r8, 119.350000_r8, 35.450000_r8, 70.900000_r8, & 102.910000_r8, 81.450000_r8, 97.450000_r8, 51.450000_r8, 67.450000_r8, & + 1.000000_r8, & 28.010000_r8, 62.130000_r8, 29.000000_r8, 29.000000_r8, 29.000000_r8, & 29.000000_r8, 46.080000_r8, 105.060000_r8, 91.080000_r8, 62.080000_r8, & 60.060000_r8, 58.040000_r8, 165.360000_r8, 148.910000_r8, 259.820000_r8, & diff --git a/src/chemistry/geoschem/mo_tracname.F90 b/src/chemistry/geoschem/mo_tracname.F90 index ee03a86974..be9c474506 100644 --- a/src/chemistry/geoschem/mo_tracname.F90 +++ b/src/chemistry/geoschem/mo_tracname.F90 @@ -12,6 +12,6 @@ module mo_tracname ! modified to an arbitrary high #, was gas_pcnst. this would cause a memory ! overflow overwrite in mo_sim_dat, which allocates :273 larger than ! the default specified gas_pcnst (hplin, 5/16/20) - character(len=16) :: solsym(317) ! species names + character(len=16) :: solsym(318) ! species names end module mo_tracname From c95ad2bdaf155d4856d443f6f10e5f2e2e409982 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 25 Jan 2021 10:26:01 -0500 Subject: [PATCH 192/239] Feat: Add check to make sure that solsym is following list of GC tracer Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 5f5c76bd8c..08ac665258 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -349,6 +349,12 @@ subroutine chem_register IF ( ThisSpc%Is_Gas .eqv. .False. ) THEN Write(cnstName, "(a,a)") 'GC_AER_', to_upper(TRIM(trueName)) ENDIF + ! Make sure that solsym is following the list of tracers as listed in input.geos + IF ( to_upper(TRIM(tracerNames(I))) /= to_upper(TRIM(solsym(I))) ) THEN + Write(iulog,*) "tracerNames (", TRIM(tracerNames(I)), ") /= solsym (", & + TRIM(solsym(I)), ")" + CALL ENDRUN('Solsym must be following GEOS-Chem tracer. Check geoschem/mo_sim.dat') + ENDIF ! Nullify pointer ThisSpc => NULL() ELSEIF ( I .LE. (nTracers + nAer) ) THEN From a72aff94cb83ad6391544c57c25697461416b215 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 25 Jan 2021 12:07:37 -0500 Subject: [PATCH 193/239] Chore: Clean up in short_lived_species Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/short_lived_species.F90 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/chemistry/geoschem/short_lived_species.F90 b/src/chemistry/geoschem/short_lived_species.F90 index b4dc6d55ff..293aaa65cd 100644 --- a/src/chemistry/geoschem/short_lived_species.F90 +++ b/src/chemistry/geoschem/short_lived_species.F90 @@ -17,7 +17,6 @@ module short_lived_species save private - !public :: map public :: register_short_lived_species public :: short_lived_species_initic public :: short_lived_species_writeic @@ -28,7 +27,6 @@ module short_lived_species public :: pbf_idx integer :: pbf_idx - !integer :: map(nslvd) character(len=16), parameter :: pbufname = 'ShortLivedSpecies' @@ -129,8 +127,6 @@ subroutine initialize_short_lived_species(ncid_ini, pbuf2d) allocate(tmpptr(pcols,pver,begchunk:endchunk)) do m=1,nslvd - !n = map(m) - !fieldname = solsym(n) write(fieldname,'(a,a)') trim(slvd_lst(m)) call infld( fieldname,ncid_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tmpptr, found, gridname='physgrid') @@ -170,8 +166,6 @@ subroutine set_short_lived_species( q, lchnk, ncol, pbuf ) if ( nslvd < 1 ) return do m=1,nslvd - !n = map(m) - !call pbuf_set_field(pbuf, pbf_idx, q(:,:,m), start=(/1,1,n/),kount=(/pcols,pver,1/)) call pbuf_set_field(pbuf, pbf_idx, q(:,:,m), start=(/1,1,m/),kount=(/pcols,pver,1/)) enddo @@ -195,9 +189,7 @@ subroutine get_short_lived_species( q, lchnk, ncol, pbuf ) if ( nslvd < 1 ) return do m=1,nslvd - !n = map(m) call pbuf_get_field(pbuf, pbf_idx, tmpptr, start=(/1,1,m/), kount=(/ pcols,pver,1 /)) - !q(:ncol,:,n) = tmpptr(:ncol,:) q(:ncol,:,m) = tmpptr(:ncol,:) enddo From 40b0f3deaf74a78cc6ebb3bd45a48386dd9710c1 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 25 Jan 2021 12:07:56 -0500 Subject: [PATCH 194/239] Fix: Fix wrong reference MMR Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chem_mods.F90 | 2 +- src/chemistry/geoschem/chemistry.F90 | 31 +++++++++++++--------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/chemistry/geoschem/chem_mods.F90 b/src/chemistry/geoschem/chem_mods.F90 index 2d2903182a..ba53ce8138 100644 --- a/src/chemistry/geoschem/chem_mods.F90 +++ b/src/chemistry/geoschem/chem_mods.F90 @@ -12,7 +12,7 @@ module chem_mods CHARACTER(LEN=255) :: tracerNames(nTracersMax) CHARACTER(LEN=255) :: tracerLongNames(nTracersMax) REAL(r8) :: MWRatio(nTracersMax) - REAL(r8) :: ref_MMR(nTracersMax) + REAL(r8) :: ref_MMR(pcnst) ! Index of first constituent INTEGER :: iFirstCnst diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 08ac665258..fb94f20b43 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -220,7 +220,7 @@ subroutine chem_register REAL(r8) :: cptmp REAL(r8) :: MWTmp REAL(r8) :: qmin - REAL(r8) :: ref_VMR + REAL(r8) :: refmmr, refvmr CHARACTER(LEN=128) :: mixtype CHARACTER(LEN=128) :: molectype CHARACTER(LEN=128) :: lngName @@ -254,8 +254,6 @@ subroutine chem_register ! from mo_sim_dat.F90 in other places. This is needed for HEMCO_CESM. CALL Set_sim_dat() - ! Generate fake state_chm - ! Prevent Reporting IO%amIRoot = .False. IO%thisCpu = MyCPU @@ -342,8 +340,8 @@ subroutine chem_register ThisSpc => SC%SpcData(N)%Info lngName = TRIM(ThisSpc%FullName) MWTmp = REAL(ThisSpc%MW_g,r8) - ref_VMR = REAL(ThisSpc%BackgroundVV,r8) - ref_MMR(I) = ref_VMR / (MWDry / MWTmp) + refvmr = REAL(ThisSpc%BackgroundVV,r8) + refmmr = refvmr / (MWDry / MWTmp) ! This is required as we need to distinguish between MAM and GEOS-Chem aerosols ! (Both are included in aer_drydep_list) IF ( ThisSpc%Is_Gas .eqv. .False. ) THEN @@ -363,20 +361,20 @@ subroutine chem_register trueName = cnstName lngName = cnstName MWTmp = aerAdvMass(I - nTracers) - ref_MMR(I) = 1.0e-38_r8 + refmmr = 1.0e-38_r8 ELSEIF ( I .EQ. (nTracers + nAer + 1) ) THEN ! Add CO2 (which is not a GEOS-Chem tracer) cnstName = 'CO2' trueName = cnstName lngName = cnstName MWTmp = 44.009800_r8 - ref_MMR(I) = 1.0e-38_r8 + refmmr = 1.0e-38_r8 ELSE cnstName = TRIM(tracerNames(I)) trueName = cnstName lngName = cnstName MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) - ref_MMR(I) = 1.0e-38_r8 + refmmr = 1.0e-38_r8 ENDIF MWRatio(I) = MWDry/MWTmp tracerLongNames(I) = TRIM(lngName) @@ -455,6 +453,8 @@ subroutine chem_register IF ( iFirstCnst < 0 ) iFirstCnst = N + ref_MMR(N) = refmmr + ! Add to GC mapping. When starting a timestep, we will want to update the ! concentration of State_Chm(x)%Species(1,iCol,iLev,m) with data from ! constituent n @@ -482,10 +482,10 @@ subroutine chem_register IF ( N .GT. 0 ) THEN ThisSpc => SC%SpcData(N)%Info MWTmp = REAL(ThisSpc%MW_g,r8) - ref_VMR = REAL(ThisSpc%BackgroundVV,r8) + refvmr = REAL(ThisSpc%BackgroundVV,r8) lngName = TRIM(ThisSpc%FullName) slsLongNames(I) = lngName - sls_ref_MMR(I) = ref_VMR / (MWDry / MWTmp) + sls_ref_MMR(I) = refvmr / (MWDry / MWTmp) SlsMWRatio(I) = MWDry / MWTmp map2GC_Sls(I) = N ThisSpc => NULL() @@ -881,7 +881,7 @@ subroutine chem_readnl(nlfile) CALL MPIBCAST (h2orates, LEN(h2orates), MPICHAR, 0, MPICOM) #endif - ! Update "short_lived_species" arrays - will eventually unify these + ! Update "short_lived_species" arrays nSlvd = nSls ALLOCATE(slvd_Lst(nSlvd), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating slvd_Lst') @@ -3811,14 +3811,11 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) REAL(r8) :: QTemp, Min_MMR nlev = SIZE(q, 2) + ! Retrieve a "background value" for this from the database Min_MMR = 1.0e-38_r8 - DO M = 1, nTracersMax - IF (TRIM(cnst_name(M)) .eq. TRIM(name)) THEN - Min_MMR = ref_MMR(M) - EXIT - ENDIF - ENDDO + CALL cnst_get_ind(TRIM(name), M, abort=.False.) + IF ( M > 0 ) Min_MMR = ref_MMR(M) DO ilev = 1, nlev WHERE(mask) From ccb5b0276d9c68db1430f62c076b795ae4aa272a Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 25 Jan 2021 12:15:53 -0500 Subject: [PATCH 195/239] Chore: Cleanup, remove unused MWRatio and longNames Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chem_mods.F90 | 2 -- src/chemistry/geoschem/chemistry.F90 | 14 ++------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/chemistry/geoschem/chem_mods.F90 b/src/chemistry/geoschem/chem_mods.F90 index ba53ce8138..36c946252b 100644 --- a/src/chemistry/geoschem/chem_mods.F90 +++ b/src/chemistry/geoschem/chem_mods.F90 @@ -11,7 +11,6 @@ module chem_mods INTEGER :: nTracers CHARACTER(LEN=255) :: tracerNames(nTracersMax) CHARACTER(LEN=255) :: tracerLongNames(nTracersMax) - REAL(r8) :: MWRatio(nTracersMax) REAL(r8) :: ref_MMR(pcnst) ! Index of first constituent @@ -23,7 +22,6 @@ module chem_mods CHARACTER(LEN=255) :: slsNames(nSlsMax) CHARACTER(LEN=255) :: slsLongnames(nSlsMax) REAL(r8) :: sls_Ref_MMR(nSlsMax) - REAL(r8) :: slsMWRatio(nSlsMax) ! Mapping between constituents and GEOS-Chem tracers INTEGER :: map2GC(pcnst) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index fb94f20b43..b20a5ae4b4 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -44,16 +44,14 @@ module chemistry use chem_mods, only : nTracersMax use chem_mods, only : nTracers use chem_mods, only : gas_pcnst - use chem_mods, only : tracerNames, tracerLongNames + use chem_mods, only : tracerNames use chem_mods, only : adv_mass - use chem_mods, only : mwRatio use chem_mods, only : ref_MMR use chem_mods, only : iFirstCnst use chem_mods, only : nSlsMax use chem_mods, only : nSls - use chem_mods, only : slsNames, slsLongNames + use chem_mods, only : slsNames use chem_mods, only : sls_ref_MMR - use chem_mods, only : slsmwRatio use chem_mods, only : nAerMax use chem_mods, only : nAer use chem_mods, only : aerNames @@ -329,8 +327,6 @@ subroutine chem_register map2GCinv = -1 map2chm = -1 ref_MMR(:) = 0.0e+0_r8 - MWRatio(:) = 1.0e+0_r8 - tracerLongNames = '' DO I = 1, nTracersMax IF ( I .LE. nTracers ) THEN @@ -376,8 +372,6 @@ subroutine chem_register MWTmp = 1000.0e+0_r8 * (0.001e+0_r8) refmmr = 1.0e-38_r8 ENDIF - MWRatio(I) = MWDry/MWTmp - tracerLongNames(I) = TRIM(lngName) ! dummy value for specific heat of constant pressure (Cp) cptmp = 666._r8 @@ -475,8 +469,6 @@ subroutine chem_register ! Now unadvected species map2GC_Sls = 0 sls_ref_MMR(:) = 0.0e+0_r8 - SlsMWRatio(:) = -1.0e+0_r8 - slsLongNames = '' DO I = 1, nSls N = Ind_(slsNames(I)) IF ( N .GT. 0 ) THEN @@ -484,9 +476,7 @@ subroutine chem_register MWTmp = REAL(ThisSpc%MW_g,r8) refvmr = REAL(ThisSpc%BackgroundVV,r8) lngName = TRIM(ThisSpc%FullName) - slsLongNames(I) = lngName sls_ref_MMR(I) = refvmr / (MWDry / MWTmp) - SlsMWRatio(I) = MWDry / MWTmp map2GC_Sls(I) = N ThisSpc => NULL() ENDIF From 1592dbbea57ed082193dcba1b5dc32b8ded4ad37 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 25 Jan 2021 15:37:35 -0500 Subject: [PATCH 196/239] Feat: Update .exclude to exclude gosat and tccon from GEOS-Chem folder Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/.exclude | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/chemistry/geoschem/.exclude b/src/chemistry/geoschem/.exclude index 7a64f3ddff..b0c26be3ef 100644 --- a/src/chemistry/geoschem/.exclude +++ b/src/chemistry/geoschem/.exclude @@ -5,14 +5,16 @@ tpcore_fvdas_mod.F90 flexgrid_read_mod.F90 get_met_mod.F90 planeflight_mod.F90 -diag51_mod.F90 diag1.F90 diag03_mod.F90 diag3.F90 +diag51_mod.F90 diag51b_mod.F90 diag53_mod.F90 emissions_mod.F90 gamap_mod.F90 +gosat_ch4_mod.F90 +tccon_ch4_mod.F90 initialize.F90 cleanup.F90 main.F90 From af8aa79c89aee47fbaa42b64a07b9f3a0c2dac60 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 25 Jan 2021 16:42:01 -0500 Subject: [PATCH 197/239] Feat: Get strat_chem data from HEMCO Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 284 ++++++++++++++++++--------- 1 file changed, 194 insertions(+), 90 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index b20a5ae4b4..fed8576ed2 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -1005,7 +1005,7 @@ subroutine chem_init(phys_state, pbuf2d) INTEGER :: LCHNK(BEGCHUNK:ENDCHUNK), NCOL(BEGCHUNK:ENDCHUNK) INTEGER :: IWAIT, IERR INTEGER :: nX, nY, nZ - INTEGER :: nStrat + INTEGER :: nStrat, nTrop INTEGER :: I, J, L, N, M INTEGER :: RC INTEGER :: nLinoz @@ -1090,6 +1090,12 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ! Find maximum tropopause level, set at 40 hPa (based on GEOS-Chem 72 and 47 + ! layer grids) + nTrop = nZ + DO WHILE ( hyam(nZ+1-nTrop) * ps0 < 4000.0 ) + nTrop = nTrop-1 + ENDDO ! Find stratopause level, defined at 1 hPa nStrat = nZ DO WHILE ( hyam(nZ+1-nStrat) * ps0 < 100.0 ) @@ -1168,7 +1174,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ! Define more variables for maxGrid - maxGrid%MaxTropLev = nZ + maxGrid%MaxTropLev = nTrop maxGrid%MaxStratLev = nStrat IF ( Input_Opt%LUCX ) THEN maxGrid%MaxChemLev = maxGrid%MaxStratLev @@ -1176,7 +1182,6 @@ subroutine chem_init(phys_state, pbuf2d) maxGrid%MaxChemLev = maxGrid%MaxTropLev ENDIF - DO I = BEGCHUNK, ENDCHUNK ! Initialize fields of the Grid State object @@ -1204,7 +1209,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDIF ! Define more variables for State_Grid - State_Grid(I)%MaxTropLev = nZ + State_Grid(I)%MaxTropLev = nTrop State_Grid(I)%MaxStratLev = nStrat ! Set maximum number of levels in the chemistry grid @@ -1247,7 +1252,7 @@ subroutine chem_init(phys_state, pbuf2d) Input_Opt%Linoz_NLat, & Input_Opt%Linoz_NMonths, & Input_Opt%Linoz_NFields ), STAT=IERR) - IF (IERR.NE.0) CALL ENDRUN('Failure while allocating linozData') + IF (IERR .NE. 0) CALL ENDRUN('Failure while allocating linozData') linozData = 0.0e+0_r8 IF ( MasterProc ) THEN @@ -1865,6 +1870,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use State_Diag_Mod, only : get_TagInfo use Unitconv_Mod, only : Convert_Spc_Units + use Strat_Chem_Mod, only : Strat_TrID_GC, GC_Bry_TrID, NSCHEM + use Strat_Chem_Mod, only : BrPtrDay, BrPtrNight, PLVEC, STRAT_OH + use CESMGC_Emissions_Mod,only : CESMGC_Emissions_Calc use CESMGC_Diag_Mod, only : CESMGC_Diag_Calc use CESMGC_Diag_Mod, only : wetdep_name, wtrate_name @@ -2001,31 +2009,31 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: Calday CHARACTER(LEN=255) :: SpcName + CHARACTER(LEN=255) :: Prefix, FieldName + LOGICAL :: FND INTEGER :: SpcId TYPE(Species), POINTER :: SpcInfo CHARACTER(LEN=63) :: OrigUnit - REAL(r8) :: SlsData(PCOLS, PVER, nSls) + REAL(r8) :: SlsData(PCOLS, PVER, nSls) - INTEGER :: currYr, currMo, currDy, currTOD - INTEGER :: currYMD, currHMS, currHr, currMn, currSc - REAL(f4) :: currUTC - LOGICAL :: firstDay = .True. - LOGICAL :: newDay = .False. - LOGICAL :: newMonth = .False. + INTEGER :: currYr, currMo, currDy, currTOD + INTEGER :: currYMD, currHMS, currHr, currMn, currSc + REAL(f4) :: currUTC TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in chnk - REAL(r8), POINTER :: pbuf_ik(:,:) ! ptr to pbuf data (/pcols,pver/) - INTEGER :: tmpIdx ! pbuf field id - CHARACTER(LEN=255) :: fldname_ns ! field name + REAL(r8), POINTER :: pbuf_ik(:,:) ! ptr to pbuf data (/pcols,pver/) + INTEGER :: tmpIdx ! pbuf field id + CHARACTER(LEN=255) :: fldname_ns ! field name - INTEGER :: TIM_NDX + INTEGER :: TIM_NDX + INTEGER :: IERR - INTEGER, SAVE :: iStep = 0 - LOGICAL :: rootChunk - LOGICAL :: lastChunk - INTEGER :: RC + INTEGER, SAVE :: iStep = 0 + LOGICAL :: rootChunk + LOGICAL :: lastChunk + INTEGER :: RC ! Initialize pointers @@ -2053,7 +2061,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) lastChunk = ( MasterProc .and. (LCHNK==ENDCHUNK) ) ! Count the number of steps which have passed - IF (LCHNK.EQ.BEGCHUNK) iStep = iStep + 1 + IF ( LCHNK .EQ. BEGCHUNK ) iStep = iStep + 1 ! Need to update the timesteps throughout the code CALL GC_Update_Timesteps(dT) @@ -2228,8 +2236,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) day = currDy, & tod = currTOD ) - ! For now, force year to be 2000 - currYr = 2000 currYMD = (currYr*1000) + (currMo*100) + (currDy) ! Deal with subdaily currUTC = REAL(currTOD,f4)/3600.0e+0_f4 @@ -2247,22 +2253,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) currSc = currTOD currHMS = (currHr*1000) + (currMn*100) + (currSc) - IF ( firstDay ) THEN - newDay = .True. - newMonth = .True. - firstDay = .False. - ELSE IF ( currHMS < dT ) THEN - newDay = .True. - IF ( currDy == 1 ) THEN - newMonth = .True. - ELSE - newMonth = .False. - ENDIF - ELSE - newDay = .False. - newMonth = .False. - ENDIF - ! Calculate COS(SZA) Calday = Get_Curr_Calday( INT(dT/2) ) CALL Zenith( Calday, Rlats, Rlons, CSZAmid, nY ) @@ -3059,58 +3049,172 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Dimensions : nX, nY State_Met(LCHNK)%TO3 (1,:nY) = O3col(:nY) - !---------------------------------------------------------- - ! %%% GET SOME NON-EMISSIONS DATA FIELDS VIA HEMCO %%% - ! - ! HEMCO can track non-emission data fields for chemistry - ! simulations. Put these subroutine calls after the - ! call to EMISSIONS_RUN, so that the HEMCO data structure - ! will be initialized. (bmy, 3/20/15) - ! - ! HEMCO data list is now updated further above, so can - ! take these calls out of the emissions sequence. - ! (ckeller, 4/01/15) - !---------------------------------------------------------- - !IF ( Input_Opt%LCHEM .and. newMonth ) THEN - ! - ! ! The following only apply when photolysis is used, - ! ! that is for fullchem or aerosol simulations. - ! IF ( Input_Opt%Its_A_Fullchem_Sim .or. Input_Opt%Its_An_Aerosol_Sim ) THEN - ! - ! IF ( Input_Opt%USE_TOMS_O3 ) THEN - ! ! Get TOMS overhead O3 columns for photolysis from - ! ! the HEMCO data structure (bmy, 3/20/15) - ! CALL Read_TOMS( Input_Opt = Input_Opt, & - ! RC = RC ) - ! - ! ! Trap potential errors - ! IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = 'Error encountered in "Read_TOMS"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - ! ENDIF - ! ENDIF - ! - ! ENDIF - ! - ! ! Read data required for Hg2 gas-particle partitioning - ! ! (H Amos, 25 Oct 2011) - ! IF ( ITS_A_MERCURY_SIM ) THEN - ! CALL Read_Hg2_Partitioning( Input_Opt = Input_Opt, & - ! State_Grid = State_Grid(LCHNK), & - ! State_Met = State_Met(LCHNK), & - ! MONTH = 1, & !TMMF - ! RC = RC ) - ! - ! ! Trap potential errors - ! IF ( RC /= GC_SUCCESS ) THEN - ! ErrMsg = - ! 'Error encountered in "Read_Hg2_Partitioning"!' - ! CALL Error_Stop( ErrMsg, ThisLoc ) - ! ENDIF - ! - ! ENDIF - !ENDIF + IF ( Input_Opt%LSCHEM .AND. & + State_Grid(LCHNK)%MaxChemLev /= State_Grid(LCHNK)%nZ ) THEN + IF ( iStep == 1 ) THEN + ALLOCATE( BrPtrDay ( 6 ), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating BrPtrDay') + ALLOCATE( BrPtrNight( 6 ), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating BrPtrNight') + DO N = 1, 6 + ! Skip if species is not defined + IF ( GC_Bry_TrID(N) <= 0 ) CYCLE + + ! Get Bry name + SpcName = State_Chm(LCHNK)%SpcData(GC_Bry_TrID(N))%Info%Name + + ! Construct field name using Bry name + PREFIX = 'GEOSCCM_'//TRIM(SpcName) + + ALLOCATE( BrPtrDay(N)%MR(1,PCOLS,nZ), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating BrPtrDay%MR') + ALLOCATE( BrPtrNight(N)%MR(1,PCOLS,nZ), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating BrPtrNight%MR') + + ! Get pointer to this field. These are the mixing ratios (pptv). + + ! Day + FIELDNAME = TRIM(PREFIX) // '_DAY' + fldname_ns = FIELDNAME + tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + BrPtrDay(N)%MR(1,:nY,nZ:1:-1) = 0.0e+0_f4 + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + BrPtrDay(N)%MR(1,:nY,nZ:1:-1) = REAL(pbuf_ik(:nY,:nZ), f4) + pbuf_chnk => NULL() + pbuf_ik => NULL() + ENDIF + !CALL HCO_GetPtr( HcoState, FIELDNAME, BrPtrDay(N)%MR, RC ) + + ! Night + FIELDNAME = TRIM(PREFIX) // '_NIGHT' + tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + BrPtrDay(N)%MR(1,:nY,nZ:1:-1) = 0.0e+0_f4 + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + BrPtrNight(N)%MR(1,:nY,nZ:1:-1) = REAL(pbuf_ik(:nY,:nZ), f4) + pbuf_chnk => NULL() + pbuf_ik => NULL() + ENDIF + !CALL HCO_GetPtr( HcoState, FIELDNAME, BrPtrNight(N)%MR, RC ) + + ENDDO + + DO N = 1,NSCHEM + + ! Get GEOS-Chem species index + M = Strat_TrID_GC(N) + + ! Skip if species is not defined + IF ( M <= 0 ) CYCLE + + ! Get species name + SpcName = State_Chm(LCHNK)%SpcData(M)%Info%Name + + ! --------------------------------------------------------------- + ! Get pointers to fields + ! --------------------------------------------------------------- + + ! Production rates [v/v/s] + IF ( Input_Opt%LUCX ) THEN + FIELDNAME = 'GMI_PROD_'//TRIM(SpcName) + ELSE + FIELDNAME = 'UCX_PROD_'//TRIM(SpcName) + ENDIF + + ALLOCATE( PLVEC(N)%PROD(1,PCOLS,nZ), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating PLVEC%PROD') + ALLOCATE( PLVEC(N)%LOSS(1,PCOLS,nZ), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating PLVEC%PROD') + + ! Get pointer from HEMCO + tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + PLVEC(N)%PROD(1,:nY,nZ:1:-1) = 0.0e+0_f4 + FND = .False. + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + PLVEC(N)%PROD(1,:nY,nZ:1:-1) = REAL(pbuf_ik(:nY,:nZ),f4) + FND = .True. + pbuf_chnk => NULL() + pbuf_ik => NULL() + ENDIF + !CALL HCO_GetPtr( HcoState, FIELDNAME, PLVEC(N)%PROD, RC, FOUND=FND ) + + ! Warning message + IF ( .NOT. FND .AND. Input_Opt%amIRoot ) THEN + ErrMsg = 'Cannot find archived production rates for ' // & + TRIM(SpcName) // ' - will use value of 0.0. ' // & + 'To use archived rates, add the following field ' // & + 'to the HEMCO configuration file: '// TRIM( FIELDNAME ) + CALL GC_Warning( ErrMsg, RC, ThisLoc ) + ENDIF + + ! Loss frequency [s-1] + IF ( Input_Opt%LUCX ) THEN + FIELDNAME = 'GMI_LOSS_'//TRIM(SpcName) + ELSE + FIELDNAME = 'UCX_LOSS_'//TRIM(SpcName) + ENDIF + + ! Get pointer from HEMCO + tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + PLVEC(N)%LOSS(1,:nY,nZ:1:-1) = 0.0e+0_f4 + FND = .False. + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + PLVEC(N)%LOSS(1,:nY,nZ:1:-1) = REAL(pbuf_ik(:nY,:nZ), f4) + FND = .True. + pbuf_chnk => NULL() + pbuf_ik => NULL() + ENDIF + !CALL HCO_GetPtr( HcoState, FIELDNAME, PLVEC(N)%LOSS, RC, FOUND=FND ) + + ! Warning message + IF ( .NOT. FND .AND. Input_Opt%amIRoot ) THEN + ErrMsg= 'Cannot find archived loss frequencies for ' // & + TRIM(SpcName) // ' - will use value of 0.0. ' // & + 'To use archived rates, add the following field ' // & + 'to the HEMCO configuration file: '//TRIM(FIELDNAME) + CALL GC_Warning( ErrMsg, RC, ThisLoc ) + ENDIF + + ENDDO !N + + ! Get pointer to STRAT_OH + + ALLOCATE( STRAT_OH(1,PCOLS,nZ), STAT=IERR ) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating STRAT_OH') + + tmpIdx = pbuf_get_index(fldname_ns, RC) + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + STRAT_OH(1,:nY,nZ:1:-1) = 0.0e+0_f4 + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + STRAT_OH(1,:nY,nZ:1:-1) = REAL(pbuf_ik(:nY,:nZ), f4) + pbuf_chnk => NULL() + pbuf_ik => NULL() + ENDIF + !CALL HCO_GetPtr( HcoState, 'STRAT_OH', STRAT_OH, RC, FOUND=FND ) + ENDIF + + ENDIF + ! This is not necessary as we prescribe CH4 surface mixing ratios + ! through CAM. !! Prescribe methane surface concentrations throughout PBL !IF ( ITS_A_FULLCHEM_SIM .and. id_CH4 > 0 ) THEN ! From a79cc60a038b719dc0d45818adaef9a15884982d Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 28 Jan 2021 10:38:23 -0500 Subject: [PATCH 198/239] Feat: Add timers around DO_CHEMISTRY + Fix diagnostic in WetDep Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index fed8576ed2..fe6a788997 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -1824,6 +1824,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx use physics_buffer, only : pbuf_get_chunk, pbuf_get_index + use perf_mod, only : t_startf, t_stopf use cam_history, only : outfld, hist_fld_active use camsrfexch, only : cam_in_t, cam_out_t @@ -3517,6 +3518,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !============================================================== ! ***** C H E M I S T R Y ***** !============================================================== + + call t_startf( 'chemdr' ) + ! Get the overhead column O3 for use with FAST-J IF ( Input_Opt%Its_A_FullChem_Sim .OR. & Input_Opt%Its_An_Aerosol_Sim ) THEN @@ -3583,6 +3587,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Chm(LCHNK)%Species(1,:nY,:nZ,iCO2) = State_Chm(LCHNK)%Species(1,:nY,:nZ,iCO2) & + MMR_Beg(:nY,:nZ,iCO2) + call t_stopf( 'chemdr' ) + !============================================================== ! ***** W E T D E P O S I T I O N (rainout + washout) ***** !============================================================== @@ -3592,6 +3598,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN DO N = 1, gas_pcnst isWD = .False. + ! See definition of map2chm + M = map2chm(N) IF ( M > 0 ) THEN SpcInfo => State_Chm(BEGCHUNK)%SpcData(M)%Info isWD = SpcInfo%Is_WetDep @@ -3604,8 +3612,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( hist_fld_active( TRIM(wetdep_name(N)) ) .OR. & hist_fld_active( TRIM(wtrate_name(N)) ) ) THEN - ! See definition of map2chm - M = map2chm(N) IF ( M > 0 ) THEN mmr1(:nY,:nZ,N) = State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) ENDIF @@ -3658,6 +3664,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN DO N = 1, gas_pcnst isWD = .False. + ! See definition of map2chm + M = map2chm(N) IF ( M > 0 ) THEN SpcInfo => State_Chm(BEGCHUNK)%SpcData(M)%Info isWD = SpcInfo%Is_WetDep @@ -3670,8 +3678,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( hist_fld_active( TRIM(wetdep_name(N)) ) .OR. & hist_fld_active( TRIM(wtrate_name(N)) ) ) THEN - ! See definition of map2chm - M = map2chm(N) IF ( M > 0 ) THEN mmr1(:nY,:nZ,N) = State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) - mmr1(:nY,:nZ,N) ENDIF From 8c3bbe9b856c793c793f0d951bcd8e6c57a05b91 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 28 Jan 2021 11:14:50 -0500 Subject: [PATCH 199/239] Feat: Remove PSO4 diagnostic (write statement) Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index fe6a788997..e973ec3299 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -3728,8 +3728,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) del_h2so4_gasprod = 0.0e+00_fp ! This needs to be in mol/mol over this timestep IF ( ( iPSO4 > 0 ) .and. ( MWPSO4 > 0.0e+00_fp ) ) THEN - If ( rootChunk ) Write(iulog,*) " MAXVAL(PSO4) = ", & - MAXVAL(State_Chm(LCHNK)%Species(1,:nY,:nZ,iPSO4)) DO L = 1, nZ ! Convert from kg SO4/kg to mol/mol del_h2so4_gasprod(:nY,L) = & From 60d6adf4aa622484e8d604428bf479b4fa399abc Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 1 Feb 2021 22:13:27 -0500 Subject: [PATCH 200/239] Fix: Fix diagnostics of emissions Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_emissions_mod.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index d43ab2e7bb..737f7ad915 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -237,10 +237,10 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'molec/cm3/s', & 'External forcing for '//TRIM(cnst_name(N))) SpcName = TRIM(cnst_name(N))//'_CLXF' - CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'molec/cm2/s', & + CALL Addfld( TRIM(SpcName), horiz_only, 'A', 'molec/cm2/s', & 'Vertically-integrated external forcing for '//TRIM(cnst_name(N))) SpcName = TRIM(cnst_name(N))//'_CMXF' - CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/m2/s', & + CALL Addfld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & 'Vertically-integrated external forcing for '//TRIM(cnst_name(N))) ENDDO @@ -465,6 +465,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS SpcName = TRIM(cnst_name(N))//'_CMXF' CALL Outfld( TRIM(SpcName), SUM(eflx(:nY,:nZ,N), DIM=2), nY, LCHNK ) + ENDDO !----------------------------------------------------------------------- From b2ee5c48a0d5e08f4000e3de4d2425c12a9b19e9 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 22 Feb 2021 19:49:18 -0500 Subject: [PATCH 201/239] Feat: Remove option to let GEOS-Chem perform wet scavenging. (1) The only option to perform convective scavenging in CESM-GC is currently to rely on the NEU scheme, which handles large-scale precipitation and convective scavening. Since the variables required by the GEOS-Chem convective routines cannot be extracted easily, we rely on the NEU scheme to perform washout due to both LS precipitation and convective scavenging for gases AND aerosols. (2) A next commit will follow to specify Henry coefficients of aerosols. The best option is to probably set something similar as HNO3 Signed-off-by: Thibaud Fritz --- bld/namelist_files/namelist_definition.xml | 3 +- bld/namelist_files/use_cases/geoschem.xml | 10 +- .../use_cases/hist_geoschem.xml | 10 +- bld/namelist_files/use_cases/sd_geoschem.xml | 10 +- src/chemistry/geoschem/chemistry.F90 | 155 +++--------------- src/chemistry/geoschem/mo_neu_wetdep.F90 | 23 +++ src/chemistry/geoschem/mo_sim_dat.F90 | 2 +- 7 files changed, 56 insertions(+), 157 deletions(-) diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index ec297033a7..eb2966f274 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -4743,11 +4743,10 @@ Default: FALSE + group="wetdep_inparm" valid_values="MOZ,NEU,OFF" > Wet deposition method used MOZ --> mozart scheme is used NEU --> J Neu's scheme is used - GEOS-CHEM --> GEOS-Chem scheme is used (only when GEOS-Chem chemistry is used) OFF --> wet deposition is turned off Default: NEU except for SPCAM runs diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 35b0d07397..752209f6cc 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -59,21 +59,19 @@ - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' -'GEOS-CHEM' - diff --git a/bld/namelist_files/use_cases/hist_geoschem.xml b/bld/namelist_files/use_cases/hist_geoschem.xml index f0ccf03de2..f0d762d102 100644 --- a/bld/namelist_files/use_cases/hist_geoschem.xml +++ b/bld/namelist_files/use_cases/hist_geoschem.xml @@ -154,21 +154,19 @@ 'so4_a2_CHMP', 'so4_a3_CHMP', 'H2SO4_sfnnuc1', 'num_a2_sfnnuc1', --> - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' -'GEOS-CHEM' - diff --git a/bld/namelist_files/use_cases/sd_geoschem.xml b/bld/namelist_files/use_cases/sd_geoschem.xml index a4f765a215..4da602d58d 100644 --- a/bld/namelist_files/use_cases/sd_geoschem.xml +++ b/bld/namelist_files/use_cases/sd_geoschem.xml @@ -159,21 +159,19 @@ - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' -'GEOS-CHEM' - diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index e973ec3299..eac9e441ab 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -341,7 +341,7 @@ subroutine chem_register ! This is required as we need to distinguish between MAM and GEOS-Chem aerosols ! (Both are included in aer_drydep_list) IF ( ThisSpc%Is_Gas .eqv. .False. ) THEN - Write(cnstName, "(a,a)") 'GC_AER_', to_upper(TRIM(trueName)) + Write(cnstName, "(a,a)") 'GC_AER_', TRIM(trueName) ENDIF ! Make sure that solsym is following the list of tracers as listed in input.geos IF ( to_upper(TRIM(tracerNames(I))) /= to_upper(TRIM(solsym(I))) ) THEN @@ -1427,25 +1427,6 @@ subroutine chem_init(phys_state, pbuf2d) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF -#if defined ( MODAL_AERO ) - IF ( Input_Opt%LWetD ) THEN - DO I = BEGCHUNK, ENDCHUNK - DO N = 1, State_Chm(I)%nWetDep - M = State_Chm(I)%Map_WetDep(N) - SpcInfo => State_Chm(I)%SpcData(M)%Info - SELECT CASE ( TRIM(SpcInfo%Name) ) - CASE ( 'BCPI', 'BCPO', 'DST1', 'DST2', 'DST3', 'DST4', & - 'SOAS', 'SO4', 'SALA', 'SALC', 'OCPI' , 'OCPO' ) - SpcInfo%WD_ExternalDep = .True. - CASE DEFAULT - SpcInfo%WD_ExternalDep = .False. - END SELECT - SpcInfo => NULL() - ENDDO - ENDDO - ENDIF -#endif - IF ( Input_Opt%LDryD ) THEN !============================================================== ! Get mapping between CESM dry deposited species and the @@ -1741,8 +1722,6 @@ subroutine GC_Update_Timesteps(DT) ! Only bother updating the module information if there's been a change IF (DT_MIN .NE. DT_MIN_LAST) THEN - IF (MasterProc) WRITE(iulog,'(a,F7.1,a)') ' --> GC: updating dt to ', DT, ' seconds' - CALL Set_Timesteps( Input_Opt = Input_Opt, & CHEMISTRY = DT_MIN, & EMISSION = DT_MIN, & @@ -1863,7 +1842,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use Time_Mod, only : Accept_External_Date_Time use Toms_Mod, only : Compute_Overhead_O3 use Chemistry_Mod, only : Do_Chemistry - use Wetscav_Mod, only : Setup_Wetscav, Do_WetDep + use Wetscav_Mod, only : Setup_Wetscav use CMN_Size_Mod, only : PTop use PBL_Mix_Mod, only : Compute_PBL_Height use UCX_Mod, only : Set_H2O_Trac @@ -1971,7 +1950,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: eflx(pcols,pver,pcnst) ! 3-D emissions in kg/m2/s ! For GEOS-Chem diagnostics - REAL(r8) :: mmr1(state%NCOL,PVER,gas_pcnst) REAL(r8) :: mmr_tend(state%NCOL,PVER,gas_pcnst) REAL(r8) :: wk_out(state%NCOL) LOGICAL :: isWD @@ -2132,11 +2110,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) MMR_End = 0.0e+0_r8 DO N = 1, pcnst M = map2GC(N) - IF ( M > 0 ) THEN - MMR_Beg(:nY,:nZ,M) = state%q(:nY,nZ:1:-1,N) - State_Chm(LCHNK)%Species(1,:nY,:nZ,M) = REAL(MMR_Beg(:nY,:nZ,M),fp) - lq(N) = .True. - ENDIF + IF ( M <= 0 ) CYCLE + MMR_Beg(:nY,:nZ,M) = state%q(:nY,nZ:1:-1,N) + State_Chm(LCHNK)%Species(1,:nY,:nZ,M) = REAL(MMR_Beg(:nY,:nZ,M),fp) + lq(N) = .True. ENDDO ! We need to let CAM know that 'H2O' and 'Q' are identical @@ -2159,9 +2136,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Map and flip gaseous short-lived species DO N = 1, nSls M = map2GC_Sls(N) - IF ( M > 0 ) THEN - State_Chm(LCHNK)%Species(1,:nY,:nZ,M) = REAL(SlsData(:nY,nZ:1:-1,N),fp) - ENDIF + IF ( M <= 0 ) CYCLE + State_Chm(LCHNK)%Species(1,:nY,:nZ,M) = REAL(SlsData(:nY,nZ:1:-1,N),fp) ENDDO DO N = 1, gas_pcnst @@ -3492,7 +3468,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Add to GEOS-Chem species State_Chm(LCHNK)%Species(1,:nY,:nZ,M) = State_Chm(LCHNK)%Species(1,:nY,:nZ,M) & + eflx(:nY,nZ:1:-1,N) * dT - ELSE + ELSEIF ( M < 0 ) THEN ! Add to constituent (mostly for MAM4 aerosols) ! Convert from kg/m2/s to kg/kg/s ptend%q(:nY,nZ:1:-1,N) = ptend%q(:nY,nZ:1:-1,N) & @@ -3594,31 +3570,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !============================================================== IF ( Input_Opt%LWetD ) THEN - ! Store mass mixing ratios before wet deposition is applied - IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN - DO N = 1, gas_pcnst - isWD = .False. - ! See definition of map2chm - M = map2chm(N) - IF ( M > 0 ) THEN - SpcInfo => State_Chm(BEGCHUNK)%SpcData(M)%Info - isWD = SpcInfo%Is_WetDep - - ! Free pointer - SpcInfo => NULL() - ENDIF - - IF ( .NOT. isWD ) CYCLE - - IF ( hist_fld_active( TRIM(wetdep_name(N)) ) .OR. & - hist_fld_active( TRIM(wtrate_name(N)) ) ) THEN - IF ( M > 0 ) THEN - mmr1(:nY,:nZ,N) = State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) - ENDIF - ENDIF - ENDDO - ENDIF - IF ( gas_wetdep_method == 'NEU' ) THEN CALL Neu_wetdep_tend( LCHNK = LCHNK, & NCOL = NCOL, & @@ -3634,77 +3585,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) cmfdqr = cmfdqr, & wd_tend = ptend%q, & wd_tend_int = wetdepflx ) - ELSEIF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN - ! TMMF, If we perform GEOS-Chem washout and rainout, we should turn - ! it off for MAM4 aerosols, as this is done in physpkg.F90 - ! A way to do this would be to reapply vmr of MAM4 aerosols before - ! wetdep is applied - - ! Do wet deposition - ! Tracer concentration units are converted locally - ! to [kg/m2] in wet deposition to enable calculations - ! along the column (ewl, 9/18/15) - CALL Do_WetDep( Input_Opt = Input_Opt, & - State_Chm = State_Chm(LCHNK), & - State_Diag = State_Diag(LCHNK), & - State_Grid = State_Grid(LCHNK), & - State_Met = State_Met(LCHNK), & - RC = RC ) - - IF ( RC /= GC_SUCCESS ) THEN - ErrMsg = 'Error encountered in "Do_WetDep"!' - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - ELSE - ErrMsg = 'Unknown gas_wetdep_method ' //TRIM(gas_wetdep_method) + ErrMsg = 'Unknown gas_wetdep_method '//TRIM(gas_wetdep_method) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF - IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN - DO N = 1, gas_pcnst - isWD = .False. - ! See definition of map2chm - M = map2chm(N) - IF ( M > 0 ) THEN - SpcInfo => State_Chm(BEGCHUNK)%SpcData(M)%Info - isWD = SpcInfo%Is_WetDep - - ! Free pointer - SpcInfo => NULL() - ENDIF - - IF ( .NOT. isWD ) CYCLE - - IF ( hist_fld_active( TRIM(wetdep_name(N)) ) .OR. & - hist_fld_active( TRIM(wtrate_name(N)) ) ) THEN - IF ( M > 0 ) THEN - mmr1(:nY,:nZ,N) = State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) - mmr1(:nY,:nZ,N) - ENDIF - - SpcName = wetdep_name(N) - IF ( hist_fld_active(TRIM(SpcName)) ) THEN - CALL Outfld( TRIM(SpcName), mmr1(1:nY,:nZ,N)/dT, nY, LCHNK ) - ENDIF - - SpcName = wtrate_name(N) - IF ( hist_fld_active(TRIM(SpcName)) ) THEN - wk_out = 0._r8 - DO L = 1, nZ - wk_out(1:nY) = wk_out(1:nY) & - + mmr1(1:nY,L,N)/dT * & - State_Met(LCHNK)%AD(1,1:nY,nZ+1-L) / & - State_Met(LCHNK)%Area_M2(1,1:nY) - ENDDO - CALL Outfld( TRIM(SpcName), wk_out(1:nY), nY, LCHNK ) - ENDIF - ENDIF - - ! GEOS-Chem does not currently store HEFF, but calculates it - ! internally. Some potential work around would be to add a - ! SpcInfo%Heff variable. - ENDDO - ENDIF ENDIF DO N = 1, gas_pcnst @@ -3791,22 +3676,20 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) SlsData = 0.0e+0_r8 DO N = 1, nSls M = map2GC_Sls(N) - IF ( M > 0 ) THEN - SlsData(:nY,nZ:1:-1,N) = REAL(State_Chm(LCHNK)%Species(1,:nY,:nZ,M),r8) - ENDIF + IF ( M <= 0 ) CYCLE + SlsData(:nY,nZ:1:-1,N) = REAL(State_Chm(LCHNK)%Species(1,:nY,:nZ,M),r8) ENDDO CALL set_short_lived_species( SlsData, LCHNK, nY, pbuf ) DO N = 1, pcnst M = map2GC(N) - IF ( M > 0 ) THEN - ! Add change in mass mixing ratio to tendencies. - ! For NEU wet deposition, the wet removal rates are added to - ! ptend. - MMR_End(:nY,:nZ,M) = REAL(State_Chm(LCHNK)%Species(1,:nY,:nZ,M),r8) - ptend%q(:nY,nZ:1:-1,N) = ptend%q(:nY,nZ:1:-1,N) & - + (MMR_End(:nY,:nZ,M)-MMR_Beg(:nY,:nZ,M))/dT - ENDIF + IF ( M <= 0 ) CYCLE + ! Add change in mass mixing ratio to tendencies. + ! For NEU wet deposition, the wet removal rates are added to + ! ptend. + MMR_End(:nY,:nZ,M) = REAL(State_Chm(LCHNK)%Species(1,:nY,:nZ,M),r8) + ptend%q(:nY,nZ:1:-1,N) = ptend%q(:nY,nZ:1:-1,N) & + + (MMR_End(:nY,:nZ,M)-MMR_Beg(:nY,:nZ,M))/dT ENDDO #if defined( MODAL_AERO_4MODE ) diff --git a/src/chemistry/geoschem/mo_neu_wetdep.F90 b/src/chemistry/geoschem/mo_neu_wetdep.F90 index fa0e3d356b..680367b7f1 100644 --- a/src/chemistry/geoschem/mo_neu_wetdep.F90 +++ b/src/chemistry/geoschem/mo_neu_wetdep.F90 @@ -53,6 +53,8 @@ subroutine neu_wetdep_init use constituents, only : cnst_get_ind,cnst_mw use cam_history, only : addfld, add_default, horiz_only use phys_control, only : phys_getopts + + use mo_chem_utls, only : utls_chem_is ! integer :: m,l character*20 :: test_name @@ -124,6 +126,24 @@ subroutine neu_wetdep_init test_name = 'SOAGff3' case( 'SOAGbb4' ) test_name = 'SOAGff4' + case( 'H2O2' ) + test_name = 'GC_H2O2' + case( 'HCHO' ) + test_name = 'GC_CH2O' + case( 'CH2O' ) + test_name = 'GC_CH2O' + case( 'NO2' ) + test_name = 'GC_NO2' + case( 'HNO3' ) + test_name = 'GC_HNO3' + case( 'NH3' ) + test_name = 'GC_NH3' + case( 'N2O5' ) + test_name = 'GC_N2O5' + case( 'PAN' ) + test_name = 'GC_PAN' + case( 'SO2' ) + test_name = 'GC_SO2' end select ! do l = 1,n_species_table @@ -168,6 +188,9 @@ subroutine neu_wetdep_init do m=1,gas_wetdep_cnt if ( debug ) print '(i4,a)',m,trim(gas_wetdep_list(m)) call cnst_get_ind(gas_wetdep_list(m), mapping_to_mmr(m), abort=.false. ) + if ( ( mapping_to_mmr(m) <= 0 ) .and. utls_chem_is('GEOS-Chem') ) then + call cnst_get_ind('GC_AER_'//gas_wetdep_list(m), mapping_to_mmr(m), abort=.false. ) + endif if ( debug ) print '(a,i4)','mapping_to_mmr ',mapping_to_mmr(m) if ( mapping_to_mmr(m) <= 0 ) then print *,'problem with mapping_to_mmr of ',gas_wetdep_list(m) diff --git a/src/chemistry/geoschem/mo_sim_dat.F90 b/src/chemistry/geoschem/mo_sim_dat.F90 index 4749340fac..44997c160e 100644 --- a/src/chemistry/geoschem/mo_sim_dat.F90 +++ b/src/chemistry/geoschem/mo_sim_dat.F90 @@ -97,7 +97,7 @@ subroutine set_sim_dat 'NO ','NO2 ','NO3 ', & 'NPRNO3 ','O3 ','OClO ', & 'OCPI ','OCPO ','OCS ', & - 'OIO ','PAN ','PFE ', & + 'OIO ','PAN ','pFe ', & 'PIP ','PP ','PPN ', & 'PROPNN ','PRPE ','PRPN ', & 'PYAC ','R4N2 ','R4P ', & From 17783e767854b36224110e7ac557b579d2715849 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 24 Feb 2021 12:06:50 -0500 Subject: [PATCH 202/239] Feat: Make non-MAM GC aerosols "gas-like" species for wet&dry dep (1) Move all GC aerosols from aer_drydep_list to drydep_list and from aer_wetdep_list to gas_wetdep_list (see previous commits too) (2) This allows to remove the 'GC_AER_' terminology for GC aerosols (3) Aerosol emission fluxes (e.g. BCPI) are now passed directly to MAM (e.g. flux to bc_a4). This allows for the removal of some interfacing code in cesmgc_emissions_mod.F90 (4) Fix diagnostic naming issues (e.g. replaced WD_HBR with WD_HBr) (5) Remove extra bit of code in cesmgc_diag_mod dealing with wet dep in GEOS-Chem, which had been removed in previous commits (6) In mo_neu_wetdep.F90, make all GC aerosols be removed like HNO3 (7) Revert previous changes in modal_aero that used to deal with GC aerosols in aer_drydep_list Signed-off-by: Thibaud Fritz --- bld/namelist_files/use_cases/geoschem.xml | 4 +- .../use_cases/hist_geoschem.xml | 8 +- bld/namelist_files/use_cases/sd_geoschem.xml | 8 +- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 51 +---------- .../geoschem/cesmgc_emissions_mod.F90 | 91 ++++++------------- src/chemistry/geoschem/chemistry.F90 | 6 -- src/chemistry/geoschem/mo_neu_wetdep.F90 | 15 +-- src/chemistry/modal_aero/aero_model.F90 | 76 +++------------- 8 files changed, 66 insertions(+), 193 deletions(-) diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 752209f6cc..9cc95b8e97 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -59,11 +59,11 @@ - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' diff --git a/bld/namelist_files/use_cases/hist_geoschem.xml b/bld/namelist_files/use_cases/hist_geoschem.xml index f0d762d102..606e409b36 100644 --- a/bld/namelist_files/use_cases/hist_geoschem.xml +++ b/bld/namelist_files/use_cases/hist_geoschem.xml @@ -82,8 +82,8 @@ 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_EOH', 'WD_ETP', 'WD_RA3P', 'WD_CH2O', 'WD_ALD2', 'WD_MGLY', 'WD_ACTA', 'WD_MAP', 'WD_MOH', 'WD_MP', - 'WD_GLYC', 'WD_H2O2', 'WD_SO4', 'WD_HBR', 'WD_HCL', - 'WD_HNO3', 'WD_HOBR', 'WD_HOCL', 'WD_HONIT', 'WD_HAC', 'WD_IEPOXA', + 'WD_GLYC', 'WD_H2O2', 'WD_SO4', 'WD_HBr', 'WD_HCl', + 'WD_HNO3', 'WD_HOBr', 'WD_HOCl', 'WD_HONIT', 'WD_HAC', 'WD_IEPOXA', 'WD_IEPOXB', 'WD_IEPOXD', 'WD_MVK', 'WD_NH3', 'WD_NH4', 'WD_SO2', 'DF_EOH', 'DF_ETP', 'DF_RA3P', 'DF_CH2O', 'DF_ALD2', 'DF_ACET', 'DF_MGLY', 'DF_ACTA', 'DF_MAP', 'DF_MOH', 'DF_MP', 'DF_CO', @@ -154,11 +154,11 @@ 'so4_a2_CHMP', 'so4_a3_CHMP', 'H2SO4_sfnnuc1', 'num_a2_sfnnuc1', --> - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' diff --git a/bld/namelist_files/use_cases/sd_geoschem.xml b/bld/namelist_files/use_cases/sd_geoschem.xml index 4da602d58d..40d1799727 100644 --- a/bld/namelist_files/use_cases/sd_geoschem.xml +++ b/bld/namelist_files/use_cases/sd_geoschem.xml @@ -92,8 +92,8 @@ 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_EOH', 'WD_ETP', 'WD_RA3P', 'WD_CH2O', 'WD_ALD2', 'WD_MGLY', 'WD_ACTA', 'WD_MAP', 'WD_MOH', 'WD_MP', - 'WD_GLYC', 'WD_H2O2', 'WD_SO4', 'WD_HBR', 'WD_HCL', - 'WD_HNO3', 'WD_HOBR', 'WD_HOCL', 'WD_HONIT', 'WD_HAC', 'WD_IEPOXA', + 'WD_GLYC', 'WD_H2O2', 'WD_SO4', 'WD_HBr', 'WD_HCl', + 'WD_HNO3', 'WD_HOBr', 'WD_HOCl', 'WD_HONIT', 'WD_HAC', 'WD_IEPOXA', 'WD_IEPOXB', 'WD_IEPOXD', 'WD_MVK', 'WD_NH3', 'WD_NH4', 'WD_SO2', 'DF_EOH', 'DF_ETP', 'DF_RA3P', 'DF_CH2O', 'DF_ALD2', 'DF_ACET', 'DF_MGLY', 'DF_ACTA', 'DF_MAP', 'DF_MOH', 'DF_MP', 'DF_CO', @@ -159,11 +159,11 @@ - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 56ae25d33c..7c3180ddd6 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -150,7 +150,6 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) USE CONSTITUENTS, ONLY : cnst_name, sflxnam USE CONSTITUENTS, ONLY : cnst_get_ind USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only - USE GAS_WETDEP_OPTS, ONLY : gas_wetdep_method USE DRYDEP_MOD, ONLY : depName ! ! !INPUT PARAMETERS: @@ -172,7 +171,6 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Logical LOGICAL :: Found - LOGICAL :: isWD ! Strings CHARACTER(LEN=255) :: SpcName @@ -263,12 +261,6 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg/s', TRIM(SpcName)//' source/sink' ) SpcName = TRIM(solsym(N)) - IF ( map2chm(N) > 0 ) THEN - !SpcName = to_upper(SpcName) - IF ( State_Chm%SpcData(map2chm(N))%Info%Is_Gas .eqv. .False. ) THEN - SpcName = 'GC_AER_'//to_upper(TRIM(SpcName)) - ENDIF - ENDIF CALL cnst_get_ind( SpcName, M, abort=.false. ) IF ( M > 0 ) THEN IF (sflxnam(M)(3:5) == 'num') then ! name is in the form of "SF****" @@ -277,12 +269,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) unit_basename = 'kg' ENDIF IF ( map2chm(N) > 0 ) THEN - IF ( State_Chm%SpcData(map2chm(N))%Info%Is_Gas .eqv. .True. ) THEN - sflxnam_loc(M) = to_upper(sflxnam(M)) - ELSE - ! Prevent from saving as GC_AER_... - sflxnam_loc(M) = 'SF'//to_upper(cnst_name(M)(8:)) - ENDIF + sflxnam_loc(M) = to_upper(sflxnam(M)) ELSE sflxnam_loc(M) = sflxnam(M) ENDIF @@ -292,32 +279,6 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ENDIF ENDDO - IF ( gas_wetdep_method == 'GEOS-CHEM' ) THEN - DO N = 1, gas_pcnst - isWD = .False. - wetdep_name(N) = 'DTWR_'//to_upper(TRIM(solsym(N))) - wtrate_name(N) = 'WD_'//to_upper(TRIM(solsym(N))) - - M = map2chm(N) - IF ( M > 0 ) THEN - SpcInfo => State_Chm%SpcData(M)%Info - isWD = SpcInfo%Is_WetDep - - ! Free pointer - SpcInfo => NULL() - ENDIF - - IF ( .NOT. isWD ) CYCLE - - SpcName = wetdep_name(N) - CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', 'kg/kg/s', & - 'wet removal tendency' ) - SpcName = wtrate_name(N) - CALL Addfld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & - 'vertical integrated wet deposition flux' ) - ENDDO - ENDIF - CALL get_TagInfo( Input_Opt = Input_Opt, & tagID = 'PHO', & State_Chm = State_Chm, & @@ -1436,17 +1397,13 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & !IF ( hist_fld_active(TRIM(SpcName)) ) THEN ! IF ( Source_KindVal /= KINDVAL_I4 ) THEN ! IF ( Rank == 2 ) THEN - ! outTmp(:nY,nZ) = REAL(Ptr2d_8(1,:),r8) + ! outTmp(:nY,nZ) = REAL(Ptr2d_8(1,:nY),r8) ! CALL Outfld( TRIM( Item%FullName ), outTmp(:nY,nZ), nY, LCHNK ) ! ELSEIF ( Rank == 3 ) THEN ! ! For now, treat variables defined on level edges by ignoring top ! ! most layer - ! DO J = 1, nY - ! DO L = 1, nZ - ! outTmp(J,nZ+1-L) = REAL(Ptr3d_8(1,J,L),r8) - ! ENDDO - ! ENDDO - ! CALL Outfld( TRIM( Item%FullName ), outTmp, nY, LCHNK ) + ! outTmp(:nY,:nZ) = REAL(Ptr3d_8(1,:nY,nZ:1:-1),r8) + ! CALL Outfld( TRIM( Item%FullName ), outTmp(:nY,:), nY, LCHNK ) ! ELSE ! IF ( rootChunk ) Write(iulog,*) " Item ", TRIM(Item%FullName), & ! " is of rank ", Rank, " and will not be diagnosed!" diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 737f7ad915..2a1ff841b2 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -129,8 +129,6 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) #if defined( MODAL_AERO_4MODE ) ! Get constituent index for aerosols - CALL cnst_get_ind('bc_a1', iBC1, abort=.True.) - CALL cnst_get_ind('bc_a4', iBC4, abort=.True.) CALL cnst_get_ind('soa1_a1', iSOA11, abort=.True.) CALL cnst_get_ind('soa1_a2', iSOA12, abort=.True.) CALL cnst_get_ind('soa2_a1', iSOA21, abort=.True.) @@ -141,16 +139,8 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) CALL cnst_get_ind('soa4_a2', iSOA42, abort=.True.) CALL cnst_get_ind('soa5_a1', iSOA51, abort=.True.) CALL cnst_get_ind('soa5_a2', iSOA52, abort=.True.) - CALL cnst_get_ind('H2SO4', iH2SO4, abort=.True.) - CALL cnst_get_ind('pom_a1', iPOM1, abort=.True.) - CALL cnst_get_ind('pom_a4', iPOM4, abort=.True.) - - CALL cnst_get_ind('GC_AER_BCPI', iBCPI, abort=.True.) - CALL cnst_get_ind('GC_AER_BCPO', iBCPO, abort=.True.) - CALL cnst_get_ind('GC_AER_SOAS', iSOAS, abort=.True.) - CALL cnst_get_ind('GC_AER_SO4', iSO4, abort=.True.) - CALL cnst_get_ind('GC_AER_OCPI', iOCPI, abort=.True.) - CALL cnst_get_ind('GC_AER_OCPO', iOCPO, abort=.True.) + + CALL cnst_get_ind('SOAS', iSOAS, abort=.True.) #endif !----------------------------------------------------------------------- @@ -273,7 +263,6 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS USE State_Met_Mod, ONLY : MetState USE CAMSRFEXCH, ONLY : cam_in_t USE CONSTITUENTS, ONLY : cnst_get_ind, cnst_mw - USE CHEM_MODS, ONLY : tracerNames, nTracers, map2GCinv USE PHYSICS_TYPES, ONLY : physics_state USE PHYSICS_BUFFER, ONLY : pbuf_get_index, pbuf_get_chunk USE PHYSICS_BUFFER, ONLY : physics_buffer_desc, pbuf_get_field @@ -322,15 +311,15 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! Integers INTEGER :: LCHNK INTEGER :: nY, nZ - INTEGER :: I, M, N, J, L - INTEGER :: RC ! return code - INTEGER :: tmpIdx ! pbuf field id + INTEGER :: J, L, N + INTEGER :: RC ! return code + INTEGER :: tmpIdx ! pbuf field id ! Logical LOGICAL :: rootChunk ! Objects - TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in current chunk + TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in current chunk ! Real REAL(r8), POINTER :: pbuf_ik(:,:) ! pointer to pbuf data (/pcols,pver/) @@ -342,7 +331,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! Strings CHARACTER(LEN=255) :: SpcName - CHARACTER(LEN=255) :: fldname_ns ! field name HCO_* + CHARACTER(LEN=255) :: fldname_ns ! field name HCO_* !================================================================= ! CESMGC_Emissions_Calc begins here! @@ -362,18 +351,10 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! Initialize emission flux eflx(:,:,:) = 0.0e+0_r8 - DO N = 1, nTracers - - fldname_ns = 'HCO_' // TRIM(tracerNames(N)) + DO N = iFirstCnst, pcnst + fldname_ns = 'HCO_'//TRIM(cnst_name(N)) tmpIdx = pbuf_get_index(fldname_ns, RC) - IF ( tmpIdx < 0 ) THEN - ! If previous field name was not found, try with capitalized version - ! to_upper is required because pFe /= PFE - fldname_ns = 'HCO_' // to_upper(TRIM(tracerNames(N))) - tmpIdx = pbuf_get_index(fldname_ns, RC) - ENDIF - IF ( tmpIdx < 0 .OR. ( iStep == 1 ) ) THEN IF ( rootChunk ) Write(iulog,'(a,a)') " CESMGC_Emissions_Calc: Field not found ", & TRIM(fldname_ns) @@ -386,27 +367,23 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS CALL ENDRUN("CESMGC_Emissions_Calc: FATAL - tmpIdx > 0 but pbuf_ik not associated") ENDIF - M = map2GCinv(N) - - IF ( M <= 0 ) CYCLE - - eflx(1:nY,:nZ,M) = pbuf_ik(1:nY,:nZ) + eflx(1:nY,:nZ,N) = pbuf_ik(1:nY,:nZ) ! Reset pointers pbuf_ik => NULL() pbuf_chnk => NULL() - IF ( MINVAL(eflx(:nY,:nZ,M)) < 0.0e+00_r8 ) THEN + IF ( MINVAL(eflx(:nY,:nZ,N)) < 0.0e+00_r8 ) THEN Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO emission flux is negative for ", & - TRIM(cnst_name(M)), " with value ", MINVAL(eflx(:nY,:nZ,M)), " at ", & - MINLOC(eflx(:nY,:nZ,M)) + TRIM(cnst_name(N)), " with value ", MINVAL(eflx(:nY,:nZ,N)), " at ", & + MINLOC(eflx(:nY,:nZ,N)) ENDIF - IF ( rootChunk .and. ( MAXVAL(eflx(:nY,:nZ,M)) > 0.0e+0_r8 ) ) THEN + IF ( rootChunk .and. ( MAXVAL(eflx(:nY,:nZ,N)) > 0.0e+0_r8 ) ) THEN Write(iulog,'(a,a,a,a)') " CESMGC_Emissions_Calc: HEMCO flux ", & - TRIM(fldname_ns), " added to ", TRIM(cnst_name(M)) + TRIM(fldname_ns), " added to ", TRIM(cnst_name(N)) Write(iulog,'(a,a,E16.4)') " CESMGC_Emissions_Calc: Maximum flux ", & - TRIM(fldname_ns), MAXVAL(eflx(:nY,:nZ,M)) + TRIM(fldname_ns), MAXVAL(eflx(:nY,:nZ,N)) ENDIF ENDIF ENDDO @@ -421,16 +398,9 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! need to feed MAM dust emissions into the GEOS-Chem DST* constituents ! Same thing applies for sea salt. - ! However, emissions of other aerosols (black carbon, organic carbon, - ! secondary organic aerosols and SO4), as read by HEMCO, need to be fed - ! to MAM's aerosol emission flux - eflx(:nY,:nZ,iBC1) = eflx(:nY,:nZ,iBCPI) - eflx(:nY,:nZ,iBCPI) = 0.0e+00_r8 - eflx(:nY,:nZ,iBC4) = eflx(:nY,:nZ,iBCPO) - eflx(:nY,:nZ,iBCPO) = 0.0e+00_r8 - - eflx(:nY,:nZ,iH2SO4) = eflx(:nY,:nZ,iSO4) - eflx(:nY,:nZ,iSO4) = 0.0e+00_r8 + ! HEMCO aerosol emissions are fed to MAM through the HEMCO_Config.rc + ! where all GEOS-Chem aerosols (BCPI, BCPO, OCPI, OCPO, SO4) have been + ! replaced with the corresponding MAM aerosols ! For SOA emission, split evently GEOS-Chem SOAS emission into each ! VBS bin. @@ -446,10 +416,6 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS eflx(:nY,:nZ,iSOA52) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 eflx(:nY,:nZ,iSOAS) = 0.0e+00_r8 - eflx(:nY,:nZ,iPOM1) = eflx(:nY,:nZ,iOCPI) - eflx(:nY,:nZ,iOCPI) = 0.0e+00_r8 - eflx(:nY,:nZ,iPOM4) = eflx(:nY,:nZ,iOCPO) - eflx(:nY,:nZ,iOCPO) = 0.0e+00_r8 #endif ! Output fields before lightning NO emissions are applied to eflx @@ -465,23 +431,22 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS SpcName = TRIM(cnst_name(N))//'_CMXF' CALL Outfld( TRIM(SpcName), SUM(eflx(:nY,:nZ,N), DIM=2), nY, LCHNK ) - ENDDO !----------------------------------------------------------------------- ! Lightning NO emissions !----------------------------------------------------------------------- - M = iNO + N = iNO ! prod_NO is in atom N cm^-3 s^-1 <=> molec cm^-3 s^-1 ! We need to convert this to kg NO/m2/s ! Multiply by MWNO * BXHEIGHT * 1.0E+06 / AVO ! = mole/molec * kg NO/mole * m * cm^3/m^3 - ! cnst_mw(M) is in g/mole - SCALFAC = cnst_mw(M) * 1.0E-03 * 1.0E+06 / AVO + ! cnst_mw(N) is in g/mole + SCALFAC = cnst_mw(N) * 1.0E-03 * 1.0E+06 / AVO DO J = 1, nY DO L = 1, nZ - eflx(J,L,M) = eflx(J,L,M) & + eflx(J,L,N) = eflx(J,L,N) & + prod_NO(J,L,LCHNK) & * State_Met%BXHEIGHT(1,J,nZ+1-L) & * SCALFAC @@ -497,13 +462,13 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS IF ( index_x2a_Fall_flxvoc > 0 .AND. shr_megan_mechcomps_n > 0 ) THEN ! set MEGAN fluxes DO N = 1, shr_megan_mechcomps_n - DO I = 1, nY - megflx(I) = -cam_in%meganflx(I,N) * megan_wght_factors(N) + DO J = 1, nY + megflx(J) = -cam_in%meganflx(J,N) * megan_wght_factors(N) ENDDO IF ( ( megan_indices_map(N) > 0 ) .AND. ( megan_wght_factors(N) > 0.0e+00_r8 ) ) THEN - DO I = 1, nY - cam_in%cflx(I,megan_indices_map(N)) = cam_in%cflx(I,megan_indices_map(N)) & - + megflx(I) + DO J = 1, nY + cam_in%cflx(J,megan_indices_map(N)) = cam_in%cflx(J,megan_indices_map(N)) & + + megflx(J) ENDDO ENDIF ! output MEGAN emis fluxes to history diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index eac9e441ab..3f327f5d19 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -338,11 +338,6 @@ subroutine chem_register MWTmp = REAL(ThisSpc%MW_g,r8) refvmr = REAL(ThisSpc%BackgroundVV,r8) refmmr = refvmr / (MWDry / MWTmp) - ! This is required as we need to distinguish between MAM and GEOS-Chem aerosols - ! (Both are included in aer_drydep_list) - IF ( ThisSpc%Is_Gas .eqv. .False. ) THEN - Write(cnstName, "(a,a)") 'GC_AER_', TRIM(trueName) - ENDIF ! Make sure that solsym is following the list of tracers as listed in input.geos IF ( to_upper(TRIM(tracerNames(I))) /= to_upper(TRIM(solsym(I))) ) THEN Write(iulog,*) "tracerNames (", TRIM(tracerNames(I)), ") /= solsym (", & @@ -1952,7 +1947,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! For GEOS-Chem diagnostics REAL(r8) :: mmr_tend(state%NCOL,PVER,gas_pcnst) REAL(r8) :: wk_out(state%NCOL) - LOGICAL :: isWD LOGICAL :: Found CHARACTER(LEN=255) :: tagName diff --git a/src/chemistry/geoschem/mo_neu_wetdep.F90 b/src/chemistry/geoschem/mo_neu_wetdep.F90 index 680367b7f1..c48af5cc0c 100644 --- a/src/chemistry/geoschem/mo_neu_wetdep.F90 +++ b/src/chemistry/geoschem/mo_neu_wetdep.F90 @@ -53,8 +53,6 @@ subroutine neu_wetdep_init use constituents, only : cnst_get_ind,cnst_mw use cam_history, only : addfld, add_default, horiz_only use phys_control, only : phys_getopts - - use mo_chem_utls, only : utls_chem_is ! integer :: m,l character*20 :: test_name @@ -100,7 +98,7 @@ subroutine neu_wetdep_init test_name = 'SO2' case ( 'CLONO2','BRONO2','HCL','HOCL','HOBR','HBR', 'Pb', 'MACROOH', 'ISOPOOH', 'XOOH', 'H2SO4', 'HF', 'COF2', 'COFCL') test_name = 'HNO3' - case ( 'NH_50W', 'NDEP', 'NHDEP', 'NH4', 'NH4NO3' ) + case ( 'NH_50W', 'NDEP', 'NHDEP', 'NH4NO3' ) test_name = 'HNO3' case ( 'ALKOOH', 'MEKOOH', 'TOLOOH' ) test_name = 'CH3OOH' @@ -144,6 +142,14 @@ subroutine neu_wetdep_init test_name = 'GC_PAN' case( 'SO2' ) test_name = 'GC_SO2' + ! Now list all non-MAM GEOS-Chem aerosols. These will be scavenged similarly + ! to HNO3 + case( 'AERI', 'BrSALA', 'BrSALC', 'DMS', 'INDIOL', & + 'IONITA', 'ISALA', 'ISALC', 'LVOCOA', 'MONITA', & + 'MSA', 'NH4', 'NIT', 'NITs', 'pFe', & + 'SALAAL', 'SALACL', 'SALCAL', 'SALCCL', 'SO4s', & + 'SOAGX', 'SOAIE' ) + test_name = 'HNO3' end select ! do l = 1,n_species_table @@ -188,9 +194,6 @@ subroutine neu_wetdep_init do m=1,gas_wetdep_cnt if ( debug ) print '(i4,a)',m,trim(gas_wetdep_list(m)) call cnst_get_ind(gas_wetdep_list(m), mapping_to_mmr(m), abort=.false. ) - if ( ( mapping_to_mmr(m) <= 0 ) .and. utls_chem_is('GEOS-Chem') ) then - call cnst_get_ind('GC_AER_'//gas_wetdep_list(m), mapping_to_mmr(m), abort=.false. ) - endif if ( debug ) print '(a,i4)','mapping_to_mmr ',mapping_to_mmr(m) if ( mapping_to_mmr(m) <= 0 ) then print *,'problem with mapping_to_mmr of ',gas_wetdep_list(m) diff --git a/src/chemistry/modal_aero/aero_model.F90 b/src/chemistry/modal_aero/aero_model.F90 index 41e0f1156a..489f06a69b 100644 --- a/src/chemistry/modal_aero/aero_model.F90 +++ b/src/chemistry/modal_aero/aero_model.F90 @@ -90,17 +90,14 @@ module aero_model ! Namelist variables character(len=16) :: wetdep_list(pcnst) = ' ' character(len=16) :: drydep_list(pcnst) = ' ' - logical, allocatable :: isGEOSChem_WetDep(:), isGEOSChem_DryDep(:) real(r8) :: sol_facti_cloud_borne = 1._r8 real(r8) :: sol_factb_interstitial = 0.1_r8 real(r8) :: sol_factic_interstitial = 0.4_r8 real(r8) :: seasalt_emis_scale - integer :: ndrydep = 0 - integer :: ndrydepAll = 0 + integer :: ndrydep = 0 integer,allocatable :: drydep_indices(:) - integer :: nwetdep = 0 - integer :: nwetdepAll = 0 + integer :: nwetdep = 0 integer,allocatable :: wetdep_indices(:) logical :: drydep_lq(pcnst) logical :: wetdep_lq(pcnst) @@ -199,8 +196,6 @@ subroutine aero_model_init( pbuf2d ) use modal_aero_rename, only: modal_aero_rename_init use modal_aero_convproc, only: ma_convproc_init - use mo_chem_utls, only: utls_chem_is - ! args type(physics_buffer_desc), pointer :: pbuf2d(:,:) @@ -223,11 +218,8 @@ subroutine aero_model_init( pbuf2d ) character(len=32) :: spec_name character(len=32) :: spec_type character(len=32) :: mode_type - integer :: nspec - character(len=32) :: GCName - dgnum_idx = pbuf_get_index('DGNUM') dgnumwet_idx = pbuf_get_index('DGNUMWET') fracis_idx = pbuf_get_index('FRACIS') @@ -276,17 +268,10 @@ subroutine aero_model_init( pbuf2d ) count_species: do m = 1,pcnst if ( len_trim(wetdep_list(m)) /= 0 ) then - ! This allows us to exclude GEOS-Chem aerosols, such that - ! GEOS-Chem handles its own aerosols - ! Note: GEOS-Chem aerosols are stored as 'GC_AER_' + wetdep_list - call cnst_get_ind ( wetdep_list(m), id, abort=.false. ) - if ( id > 0 ) nwetdep = nwetdep+1 - nwetdepAll = nwetdepAll + 1 + nwetdep = nwetdep+1 endif if ( len_trim(drydep_list(m)) /= 0 ) then - call cnst_get_ind ( drydep_list(m), id, abort=.false. ) - if ( id > 0 ) ndrydep = ndrydep+1 - ndrydepAll = ndrydepAll + 1 + ndrydep = ndrydep+1 endif enddo count_species @@ -295,55 +280,28 @@ subroutine aero_model_init( pbuf2d ) if (ndrydep>0) & allocate(drydep_indices(ndrydep)) - if (nwetdepAll>0) & - allocate(isGEOSChem_WetDep(nwetdepAll)) - if (ndrydepAll>0) & - allocate(isGEOSChem_dryDep(ndrydepAll)) - - isGEOSChem_DryDep(:) = .False. - isGEOSChem_WetDep(:) = .False. - - n = 1 - do m = 1, ndrydepAll + do m = 1,ndrydep call cnst_get_ind ( drydep_list(m), id, abort=.false. ) if (id>0) then - drydep_indices(n) = id - n = n+1 - elseif ( utls_chem_is('GEOS-Chem') ) then - ! Let GEOS-Chem handle its own aerosols - write(GCName,'(a,a)') 'GC_AER_', drydep_list(m) - call cnst_get_ind ( GCName, id, abort=.false. ) - if ( id > 0 ) isGEOSChem_DryDep(m) = .True. - endif - - if ( id <= 0 ) then + drydep_indices(m) = id + else call endrun(subrname//': invalid drydep species: '//trim(drydep_list(m)) ) endif - if (masterproc .and. (.not. isGEOSChem_DryDep(m))) then + if (masterproc) then write(iulog,*) subrname//': '//drydep_list(m)//' will have drydep applied' endif enddo - - n = 1 - do m = 1, nwetdepAll + do m = 1,nwetdep call cnst_get_ind ( wetdep_list(m), id, abort=.false. ) if (id>0) then - wetdep_indices(n) = id - n = n+1 - elseif ( utls_chem_is('GEOS-Chem') ) then - ! Let GEOS-Chem handle its own aerosols - write(GCName,'(a,a)') 'GC_AER_', wetdep_list(m) - call cnst_get_ind ( GCName, id, abort=.false. ) - if ( id > 0 ) isGEOSChem_WetDep(m) = .True. - endif - - if ( id <= 0 ) then + wetdep_indices(m) = id + else call endrun(subrname//': invalid wetdep species: '//trim(wetdep_list(m)) ) endif - if (masterproc .and. (.not. isGEOSChem_WetDep(m))) then - write(iulog,*) subrname//': '//wetdep_list(m)//' will have wetdep applied' + if (masterproc) then + write(iulog,*) subrname//': '//wetdep_list(m)//' will have wet removal' endif enddo @@ -429,9 +387,7 @@ subroutine aero_model_init( pbuf2d ) rate1_cw2pr_st_idx = pbuf_get_index('RATE1_CW2PR_ST') call pbuf_set_field(pbuf2d, rate1_cw2pr_st_idx, 0.0_r8) - do m = 1,ndrydepAll - - if ( isGEOSChem_DryDep(m) ) cycle + do m = 1,ndrydep ! units if (drydep_list(m)(1:3) == 'num') then @@ -461,10 +417,8 @@ subroutine aero_model_init( pbuf2d ) enddo - do m = 1,nwetdepAll + do m = 1,nwetdep - if ( isGEOSChem_WetDep(m) ) cycle - ! units if (wetdep_list(m)(1:3) == 'num') then unit_basename = ' 1' From 63db2d55c252ebe95bd8292b4da1155970d9d1ac Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Wed, 24 Feb 2021 13:16:28 -0500 Subject: [PATCH 203/239] Feat: Write ZPJ values for RXN_NO2, RXN_O3_1/2a into HCO_IN_JNO2, HCO_IN_JOH for HEMCO ParaNOx extension. Fix: fldname_ns fix to FIELDNAME --- src/chemistry/geoschem/chemistry.F90 | 60 +++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index e973ec3299..5fba5b787b 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -1868,6 +1868,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use PBL_Mix_Mod, only : Compute_PBL_Height use UCX_Mod, only : Set_H2O_Trac use CMN_FJX_MOD, only : ZPJ + USE FAST_JX_MOD, only : RXN_NO2, RXN_O3_1, RXN_O3_2a use State_Diag_Mod, only : get_TagInfo use Unitconv_Mod, only : Convert_Spc_Units @@ -3076,10 +3077,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Day FIELDNAME = TRIM(PREFIX) // '_DAY' - fldname_ns = FIELDNAME - tmpIdx = pbuf_get_index(fldname_ns, RC) + tmpIdx = pbuf_get_index(FIELDNAME, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) BrPtrDay(N)%MR(1,:nY,nZ:1:-1) = 0.0e+0_f4 ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) @@ -3092,9 +3092,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Night FIELDNAME = TRIM(PREFIX) // '_NIGHT' - tmpIdx = pbuf_get_index(fldname_ns, RC) + tmpIdx = pbuf_get_index(FIELDNAME, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) BrPtrDay(N)%MR(1,:nY,nZ:1:-1) = 0.0e+0_f4 ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) @@ -3135,9 +3135,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating PLVEC%PROD') ! Get pointer from HEMCO - tmpIdx = pbuf_get_index(fldname_ns, RC) + tmpIdx = pbuf_get_index(FIELDNAME, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) PLVEC(N)%PROD(1,:nY,nZ:1:-1) = 0.0e+0_f4 FND = .False. ELSE @@ -3167,9 +3167,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ! Get pointer from HEMCO - tmpIdx = pbuf_get_index(fldname_ns, RC) + tmpIdx = pbuf_get_index(FIELDNAME, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) PLVEC(N)%LOSS(1,:nY,nZ:1:-1) = 0.0e+0_f4 FND = .False. ELSE @@ -3198,9 +3198,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ALLOCATE( STRAT_OH(1,PCOLS,nZ), STAT=IERR ) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating STRAT_OH') - tmpIdx = pbuf_get_index(fldname_ns, RC) + tmpIdx = pbuf_get_index(FIELDNAME, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) STRAT_OH(1,:nY,nZ:1:-1) = 0.0e+0_f4 ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) @@ -3580,6 +3580,44 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL ENDRUN('Incorrect unit in GEOS-Chem State_Chm%Species') ENDIF + ! Save and write J-values to pbuf for HEMCO + ! in HCO_IN_JNO2, HCO_IN_JOH + FIELDNAME = 'HCO_IN_JNO2' + tmpIdx = pbuf_get_index(FIELDNAME, RC) + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + + ! RXN_NO2: NO2 + hv --> NO + O + pbuf_ik(:nY,:nZ) = ZPJ(nZ:1:-1, RXN_NO2, 1, :nY) + + pbuf_chnk => NULL() + pbuf_ik => NULL() + ENDIF + + + FIELDNAME = 'HCO_IN_JOH' + tmpIdx = pbuf_get_index(FIELDNAME, RC) + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + + IF ( Input_Opt%LUCX ) THEN + ! RXN_O3_1: O3 + hv --> O2 + O + pbuf_ik(:nY,:nZ) = ZPJ(nZ:1:-1, RXN_O3_1, 1, :nY) + ELSE + ! RXN_O3_2a: O3 + hv --> 2OH + pbuf_ik(:nY,:nZ) = ZPJ(nZ:1:-1, RXN_O3_2a, 1, :nY) + ENDIF + + pbuf_chnk => NULL() + pbuf_ik => NULL() + ENDIF + ! GEOS-Chem considers CO2 as a dead species and resets its concentration ! internally. Right after the call to `Do_Chemistry`, State_Chm%Species(iCO2) ! corresponds to the chemically-produced CO2. The real CO2 concentration From 9b384900b7c9a1102a51be582eced7273a1e6b9b Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Thu, 25 Feb 2021 19:57:11 -0500 Subject: [PATCH 204/239] Fix: Forgot to allocate pbuf fields before proceeding. Added to chem_register Signed-off-by: Haipeng Lin --- src/chemistry/geoschem/chemistry.F90 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 5fba5b787b..9b1d971699 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -215,6 +215,7 @@ subroutine chem_register INTEGER :: I, N, M, L INTEGER :: nIgnored + INTEGER :: tmpIdx REAL(r8) :: cptmp REAL(r8) :: MWTmp REAL(r8) :: qmin @@ -638,6 +639,11 @@ subroutine chem_register Call Cleanup_State_Grid( SG, RC ) Call Cleanup_Input_Opt ( IO, RC ) + ! Add data for HEMCO extensions to buffers + call pbuf_add_field('HCO_IN_JNO2', 'global', dtype_r8, (/pcols/), tmpIdx) + call pbuf_add_field('HCO_IN_JOH', 'global', dtype_r8, (/pcols/), tmpIdx) + + end subroutine chem_register !=============================================================================== From 69f86c10b7d0c925a90d79f6de16379f7addd3f4 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 24 Feb 2021 15:17:30 -0500 Subject: [PATCH 205/239] Feat: Uniformize calls to HEMCO Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 105 +++++++++++++-------------- 1 file changed, 49 insertions(+), 56 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index e63d2f609d..579b068878 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -2005,7 +2005,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in chnk REAL(r8), POINTER :: pbuf_ik(:,:) ! ptr to pbuf data (/pcols,pver/) INTEGER :: tmpIdx ! pbuf field id - CHARACTER(LEN=255) :: fldname_ns ! field name INTEGER :: TIM_NDX INTEGER :: IERR @@ -2411,11 +2410,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ELSE DO N = 1, NSURFTYPE - Write(fldname_ns, '(a,i2.2)') 'HCO_LANDTYPE', N-1 - tmpIdx = pbuf_get_index(fldname_ns, rc) - IF ( tmpIdx < 0 ) THEN - ! there is an error here and the field was not found - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + Write(FieldName, '(a,i2.2)') 'HCO_LANDTYPE', N-1 + tmpIdx = pbuf_get_index(FieldName, rc) + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) ELSE CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) DO J = 1, nY @@ -2426,11 +2424,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf_ik => NULL() ENDIF - Write(fldname_ns, '(a,i2.2)') 'HCO_XLAI', N-1 - tmpIdx = pbuf_get_index(fldname_ns, rc) - IF ( tmpIdx < 0 ) THEN - ! there is an error here and the field was not found - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + Write(FieldName, '(a,i2.2)') 'HCO_XLAI', N-1 + tmpIdx = pbuf_get_index(FieldName, rc) + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) ELSE CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) DO J = 1, nY @@ -2569,10 +2566,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( Input_Opt%onlineAlbedo ) THEN State_Met(LCHNK)%UVALBEDO(1,:nY) = cam_in%asdir(:nY) ELSE - fldname_ns = 'HCO_UV_ALBEDO' - tmpIdx = pbuf_get_index(fldname_ns, RC) + FieldName = 'HCO_UV_ALBEDO' + tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) State_Met(LCHNK)%UVALBEDO(1,:nY) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) @@ -2612,11 +2609,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Description: Surface iodide concentration ! Unit : nM ! Dimensions : nX, nY - fldname_ns = 'HCO_iodide' - tmpIdx = pbuf_get_index(fldname_ns, RC) + FieldName = 'HCO_iodide' + tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) - State_Chm(LCHNK)%IODIDE(1,:nY) = 0.0e+0_fp + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) + State_Chm(LCHNK)%IODIDE(1,:nY) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) @@ -2630,10 +2627,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Unit : PSU ! Dimensions : nX, nY ! Note : Possibly get ocean salinity from POP? - fldname_ns = 'HCO_salinity' - tmpIdx = pbuf_get_index(fldname_ns, RC) + FieldName = 'HCO_salinity' + tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) State_Chm(LCHNK)%SALINITY(1,:nY) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) @@ -2648,18 +2645,18 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Unit : - ! Dimensions : nX, nY IF ( currMo == 12 .or. currMo == 1 .or. currMo == 2 ) THEN - fldname_ns = 'HCO_OMOC_DJF' + FieldName = 'HCO_OMOC_DJF' ELSE IF ( currMo == 3 .or. currMo == 4 .or. currMo == 5 ) THEN - fldname_ns = 'HCO_OMOC_MAM' + FieldName = 'HCO_OMOC_MAM' ELSE IF ( currMo == 6 .or. currMo == 7 .or. currMo == 8 ) THEN - fldname_ns = 'HCO_OMOC_JJA' + FieldName = 'HCO_OMOC_JJA' ELSE IF ( currMo == 9 .or. currMo == 10 .or. currMo == 11 ) THEN - fldname_ns = 'HCO_OMOC_SON' + FieldName = 'HCO_OMOC_SON' ENDIF - tmpIdx = pbuf_get_index(fldname_ns, rc) - IF ( tmpIdx < 0 ) THEN + tmpIdx = pbuf_get_index(FieldName, rc) + IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN ! there is an error here and the field was not found - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(fldname_ns) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) ELSE CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) DO J = 1, nY @@ -3052,10 +3049,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Get pointer to this field. These are the mixing ratios (pptv). ! Day - FIELDNAME = TRIM(PREFIX) // '_DAY' - tmpIdx = pbuf_get_index(FIELDNAME, RC) + FieldName = TRIM(PREFIX) // '_DAY' + tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) BrPtrDay(N)%MR(1,:nY,nZ:1:-1) = 0.0e+0_f4 ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) @@ -3064,13 +3061,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf_chnk => NULL() pbuf_ik => NULL() ENDIF - !CALL HCO_GetPtr( HcoState, FIELDNAME, BrPtrDay(N)%MR, RC ) ! Night - FIELDNAME = TRIM(PREFIX) // '_NIGHT' - tmpIdx = pbuf_get_index(FIELDNAME, RC) + FieldName = TRIM(PREFIX) // '_NIGHT' + tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) BrPtrDay(N)%MR(1,:nY,nZ:1:-1) = 0.0e+0_f4 ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) @@ -3079,7 +3075,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf_chnk => NULL() pbuf_ik => NULL() ENDIF - !CALL HCO_GetPtr( HcoState, FIELDNAME, BrPtrNight(N)%MR, RC ) ENDDO @@ -3100,9 +3095,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Production rates [v/v/s] IF ( Input_Opt%LUCX ) THEN - FIELDNAME = 'GMI_PROD_'//TRIM(SpcName) + FieldName = 'GMI_PROD_'//TRIM(SpcName) ELSE - FIELDNAME = 'UCX_PROD_'//TRIM(SpcName) + FieldName = 'UCX_PROD_'//TRIM(SpcName) ENDIF ALLOCATE( PLVEC(N)%PROD(1,PCOLS,nZ), STAT=IERR ) @@ -3111,9 +3106,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating PLVEC%PROD') ! Get pointer from HEMCO - tmpIdx = pbuf_get_index(FIELDNAME, RC) + tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) PLVEC(N)%PROD(1,:nY,nZ:1:-1) = 0.0e+0_f4 FND = .False. ELSE @@ -3124,28 +3119,27 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf_chnk => NULL() pbuf_ik => NULL() ENDIF - !CALL HCO_GetPtr( HcoState, FIELDNAME, PLVEC(N)%PROD, RC, FOUND=FND ) ! Warning message IF ( .NOT. FND .AND. Input_Opt%amIRoot ) THEN ErrMsg = 'Cannot find archived production rates for ' // & TRIM(SpcName) // ' - will use value of 0.0. ' // & 'To use archived rates, add the following field ' // & - 'to the HEMCO configuration file: '// TRIM( FIELDNAME ) + 'to the HEMCO configuration file: '// TRIM( FieldName ) CALL GC_Warning( ErrMsg, RC, ThisLoc ) ENDIF ! Loss frequency [s-1] IF ( Input_Opt%LUCX ) THEN - FIELDNAME = 'GMI_LOSS_'//TRIM(SpcName) + FieldName = 'GMI_LOSS_'//TRIM(SpcName) ELSE - FIELDNAME = 'UCX_LOSS_'//TRIM(SpcName) + FieldName = 'UCX_LOSS_'//TRIM(SpcName) ENDIF ! Get pointer from HEMCO - tmpIdx = pbuf_get_index(FIELDNAME, RC) + tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) PLVEC(N)%LOSS(1,:nY,nZ:1:-1) = 0.0e+0_f4 FND = .False. ELSE @@ -3156,14 +3150,13 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf_chnk => NULL() pbuf_ik => NULL() ENDIF - !CALL HCO_GetPtr( HcoState, FIELDNAME, PLVEC(N)%LOSS, RC, FOUND=FND ) ! Warning message IF ( .NOT. FND .AND. Input_Opt%amIRoot ) THEN ErrMsg= 'Cannot find archived loss frequencies for ' // & TRIM(SpcName) // ' - will use value of 0.0. ' // & 'To use archived rates, add the following field ' // & - 'to the HEMCO configuration file: '//TRIM(FIELDNAME) + 'to the HEMCO configuration file: '//TRIM(FieldName) CALL GC_Warning( ErrMsg, RC, ThisLoc ) ENDIF @@ -3174,9 +3167,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ALLOCATE( STRAT_OH(1,PCOLS,nZ), STAT=IERR ) IF ( IERR .NE. 0 ) CALL ENDRUN('Failure while allocating STRAT_OH') - tmpIdx = pbuf_get_index(FIELDNAME, RC) + tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) STRAT_OH(1,:nY,nZ:1:-1) = 0.0e+0_f4 ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) @@ -3558,10 +3551,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Save and write J-values to pbuf for HEMCO ! in HCO_IN_JNO2, HCO_IN_JOH - FIELDNAME = 'HCO_IN_JNO2' - tmpIdx = pbuf_get_index(FIELDNAME, RC) + FieldName = 'HCO_IN_JNO2' + tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) @@ -3574,10 +3567,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF - FIELDNAME = 'HCO_IN_JOH' - tmpIdx = pbuf_get_index(FIELDNAME, RC) + FieldName = 'HCO_IN_JOH' + tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN - IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FIELDNAME) + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) From 35afc37f0ef1b3f4af5f56e70af37525c4c0a117 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 25 Feb 2021 09:54:03 -0500 Subject: [PATCH 206/239] Fix: Replace SO4S with SO4s Signed-off-by: Thibaud Fritz --- bld/namelist_files/use_cases/geoschem.xml | 4 ++-- bld/namelist_files/use_cases/hist_geoschem.xml | 4 ++-- bld/namelist_files/use_cases/sd_geoschem.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 9cc95b8e97..c6fdd19bf1 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -59,7 +59,7 @@ - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', @@ -67,7 +67,7 @@ - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', diff --git a/bld/namelist_files/use_cases/hist_geoschem.xml b/bld/namelist_files/use_cases/hist_geoschem.xml index 606e409b36..7d94084f4e 100644 --- a/bld/namelist_files/use_cases/hist_geoschem.xml +++ b/bld/namelist_files/use_cases/hist_geoschem.xml @@ -154,7 +154,7 @@ 'so4_a2_CHMP', 'so4_a3_CHMP', 'H2SO4_sfnnuc1', 'num_a2_sfnnuc1', --> - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', @@ -162,7 +162,7 @@ - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', diff --git a/bld/namelist_files/use_cases/sd_geoschem.xml b/bld/namelist_files/use_cases/sd_geoschem.xml index 40d1799727..41a8585d11 100644 --- a/bld/namelist_files/use_cases/sd_geoschem.xml +++ b/bld/namelist_files/use_cases/sd_geoschem.xml @@ -159,7 +159,7 @@ - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', @@ -167,7 +167,7 @@ - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', From 5b10258766f4c2700c4b46453074c5979ad82c56 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 26 Feb 2021 18:36:32 -0500 Subject: [PATCH 207/239] Fix: Fix XML file name Signed-off-by: Thibaud Fritz --- cime_config/config_component.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index aac547eb25..09042b38c3 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -210,7 +210,7 @@ waccm_ma_2000_cam6 waccm_sc_2000_cam6 2000_trop_strat_vbs_cam6 - geoschem_2000 + geoschem aquaplanet_cam4 aquaplanet_cam4 From a5971667ce10f29d527d09735fb2e77d84aa5813 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 26 Feb 2021 18:38:14 -0500 Subject: [PATCH 208/239] Feat: Capitalize all GC constituents name (1) This is required because boundary conditions are stored with capitalized name. I would rather follow the same terminology as MOZART (with capitalized constituents) rather than modify the interface with flbc. (2) Update geoschem.xml to match FC2000climo compset (3) Fix bug where lght_no_prod_factor was not applied in CESM-GC (4) Set ext_frc_specifier to '' for CESM-GC compsets as we rely on HEMCO Signed-off-by: Thibaud Fritz --- bld/build-namelist | 9 ++-- bld/namelist_files/use_cases/geoschem.xml | 39 ++++++---------- .../use_cases/hist_geoschem.xml | 10 ++-- bld/namelist_files/use_cases/sd_geoschem.xml | 10 ++-- src/chemistry/geoschem/chemistry.F90 | 2 +- src/chemistry/geoschem/mo_neu_wetdep.F90 | 14 +++--- src/chemistry/geoschem/mo_sim_dat.F90 | 46 +++++++++---------- 7 files changed, 60 insertions(+), 70 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 98aec3f578..c84c794867 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -1906,7 +1906,7 @@ my $megan_emis = defined $nl->get_value('megan_specifier'); if ( $megan_emis ) { add_default($nl, 'megan_factors_file'); } # Tropospheric full chemistry options -if (($chem =~ /geoschem/ or $chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $chem =~ /waccm_tsmlt/) and ($phys !~ /cam6/)) { +if (($chem =~ /trop_mozart/ or $chem =~ /trop_strat/ or $chem =~ /waccm_tsmlt/) and ($phys !~ /cam6/)) { # Surface emission datasets: my %verhash; @@ -2092,7 +2092,8 @@ if ($chem =~ /geoschem/) { my $val; # Species with fixed lower boundary - $val = "'CH4','OCS','N2O','CO2','CFC11','CFC12'"; + $val = "'CCL4','CH4','N2O','CO2','CFC11','CFC12','CH3BR','CH3CCL3','CH3CL'" + .",'HCFC22','CFC114','CFC115','HCFC141B','HCFC142B','CH2BR2','CHBR3','H2402'"; if ($chem_has_ocs) { $val .= ",'OCS'"; @@ -3017,7 +3018,7 @@ if ($clubb_sgs =~ /$TRUE/io) { add_default($nl, 'clubb_history'); add_default($nl, 'clubb_rad_history'); - if ($nl->get_value('clubb_history') =~ "true" && $nl->get_value('atm_nthreads') != 1) { + if ($nl->get_value('clubb_history') =~ "true" && $nl->get_value('atm_nthreads') > 1) { die "$ProgName - ERROR: clubb_history = .true. with multiple threads is not supported. \n"; } @@ -3193,7 +3194,7 @@ if ( length($nl->get_value('soil_erod_file'))>0 ) { add_default($nl, 'dust_emis_fact', 'tms'=>'1'); } else { - if ($chem =~ /trop_strat/ or $chem =~ /waccm_ma/ or $chem =~ /waccm_tsmlt/ or $chem =~ /trop_mozart/) { + if ($chem =~ /trop_strat/ or $chem =~ /geoschem/ or $chem =~ /waccm_ma/ or $chem =~ /waccm_tsmlt/ or $chem =~ /trop_mozart/) { add_default($nl, 'dust_emis_fact', 'ver'=>'chem'); # set scaling of lightning NOx production add_default($nl, 'lght_no_prd_factor' ); diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index c6fdd19bf1..4e5775d3e1 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -3,8 +3,6 @@ 00010101 -367.0e-6 - /glade/p/univ/umit0034/ExtData/CHEM_INPUTS/ /glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc @@ -12,43 +10,34 @@ /glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f19_f19.134.1975.009.cam.i.2010-01-01_32L_c170403.nc -atm/cam/solar/spectral_irradiance_Lean_1610-2009_ann_c100405.nc +atm/cam/solar/SolarForcing1995-2005avg_c160929.nc 20000101 FIXED - -atm/cam/chem/trop_mozart_aero/aero -aerosoldep_monthly_2000_mean_1.9x2.5_c090421.nc -CYCLICAL -2000 - - - atm/cam/ozone - ozone_1.9x2.5_L26_1850-2005_c090803.nc - O3 - CYCLICAL - 2000 - 'xactive_lnd' - -2000 + +.true. +.true. +.false. +0.25D0 -2000 -atm/waccm/lb/LBC_1765-2500_1.9x2.5_CMIP5_RCP45_za_c120204.nc CYCLICAL +2000 +atm/waccm/lb/LBC_2000climo_CMIP6_0p5degLat_c180227.nc 'CYCLICAL' + 2000 - 1, 24 - 0, -1 - 'A', 'A' + 1,30,365,240,240,480,365,73,30 + 0,-24,-24,-3,-1,1,-24,-120,-240 +'A','A','A','A','A','A','A','A','I' 'Q', 'U', 'V', 'OMEGA', 'T', 'PS', @@ -59,7 +48,7 @@ - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', @@ -67,7 +56,7 @@ - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', diff --git a/bld/namelist_files/use_cases/hist_geoschem.xml b/bld/namelist_files/use_cases/hist_geoschem.xml index 7d94084f4e..8d8dce5377 100644 --- a/bld/namelist_files/use_cases/hist_geoschem.xml +++ b/bld/namelist_files/use_cases/hist_geoschem.xml @@ -27,7 +27,7 @@ INTERP_MISSING_MONTHS - + INTERP_MISSING_MONTHS 'noy', 'nhx' @@ -82,8 +82,8 @@ 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_EOH', 'WD_ETP', 'WD_RA3P', 'WD_CH2O', 'WD_ALD2', 'WD_MGLY', 'WD_ACTA', 'WD_MAP', 'WD_MOH', 'WD_MP', - 'WD_GLYC', 'WD_H2O2', 'WD_SO4', 'WD_HBr', 'WD_HCl', - 'WD_HNO3', 'WD_HOBr', 'WD_HOCl', 'WD_HONIT', 'WD_HAC', 'WD_IEPOXA', + 'WD_GLYC', 'WD_H2O2', 'WD_SO4', 'WD_HBR', 'WD_HCL', + 'WD_HNO3', 'WD_HOBR', 'WD_HOCL', 'WD_HONIT', 'WD_HAC', 'WD_IEPOXA', 'WD_IEPOXB', 'WD_IEPOXD', 'WD_MVK', 'WD_NH3', 'WD_NH4', 'WD_SO2', 'DF_EOH', 'DF_ETP', 'DF_RA3P', 'DF_CH2O', 'DF_ALD2', 'DF_ACET', 'DF_MGLY', 'DF_ACTA', 'DF_MAP', 'DF_MOH', 'DF_MP', 'DF_CO', @@ -154,7 +154,7 @@ 'so4_a2_CHMP', 'so4_a3_CHMP', 'H2SO4_sfnnuc1', 'num_a2_sfnnuc1', --> - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', @@ -162,7 +162,7 @@ - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', diff --git a/bld/namelist_files/use_cases/sd_geoschem.xml b/bld/namelist_files/use_cases/sd_geoschem.xml index 41a8585d11..02c3508e54 100644 --- a/bld/namelist_files/use_cases/sd_geoschem.xml +++ b/bld/namelist_files/use_cases/sd_geoschem.xml @@ -39,7 +39,7 @@ INTERP_MISSING_MONTHS - + INTERP_MISSING_MONTHS @@ -92,8 +92,8 @@ 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_EOH', 'WD_ETP', 'WD_RA3P', 'WD_CH2O', 'WD_ALD2', 'WD_MGLY', 'WD_ACTA', 'WD_MAP', 'WD_MOH', 'WD_MP', - 'WD_GLYC', 'WD_H2O2', 'WD_SO4', 'WD_HBr', 'WD_HCl', - 'WD_HNO3', 'WD_HOBr', 'WD_HOCl', 'WD_HONIT', 'WD_HAC', 'WD_IEPOXA', + 'WD_GLYC', 'WD_H2O2', 'WD_SO4', 'WD_HBR', 'WD_HCL', + 'WD_HNO3', 'WD_HOBR', 'WD_HOCL', 'WD_HONIT', 'WD_HAC', 'WD_IEPOXA', 'WD_IEPOXB', 'WD_IEPOXD', 'WD_MVK', 'WD_NH3', 'WD_NH4', 'WD_SO2', 'DF_EOH', 'DF_ETP', 'DF_RA3P', 'DF_CH2O', 'DF_ALD2', 'DF_ACET', 'DF_MGLY', 'DF_ACTA', 'DF_MAP', 'DF_MOH', 'DF_MP', 'DF_CO', @@ -159,7 +159,7 @@ - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','BrNO3','CH2O','Cl2','ClNO2','ClNO3','ClO','ClOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg0','Hg0_ANT','Hg0_ARC','Hg0_ATL','Hg0_BB','Hg0_CAM','Hg0_CAN','Hg0_EAF','Hg0_EAS','Hg0_EEU','Hg0_EUR','Hg0_GEO','Hg0_JPN','Hg0_MDE','Hg0_NAF','Hg0_NAT','Hg0_NPA','Hg0_OCE','Hg0_OCN','Hg0_SAF','Hg0_SAM','Hg0_SAS','Hg0_SAT','Hg0_SEA','Hg0_SO','Hg0_SOV','Hg0_STR','Hg0_USA','Hg0_WAF','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3Strat','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', @@ -167,7 +167,7 @@ - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','Br2','BrCl','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBr','HC5A','HCl','HCOOH','Hg2','Hg2_ANT','Hg2_ARC','Hg2_ATL','Hg2_BB','Hg2_CAM','Hg2_CAN','Hg2_EAF','Hg2_EAS','Hg2_EEU','Hg2_EUR','Hg2_GEO','Hg2_JPN','Hg2_MDE','Hg2_NAF','Hg2_NAT','Hg2_NPA','Hg2_OCE','Hg2_OCN','Hg2_SAF','Hg2_SAM','Hg2_SAS','Hg2_SAT','Hg2_SEA','Hg2_SO','Hg2_SOV','Hg2_STR','Hg2_USA','Hg2_WAF','HI','HMHP','HMML','HNO3','HOBr','HOCl','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBr','ICHE','ICl','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','Be10','Be10Strat','Be7','Be7Strat','BrSALA','BrSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HgP','HgP_ANT','HgP_ARC','HgP_ATL','HgP_BB','HgP_CAM','HgP_CAN','HgP_EAF','HgP_EAS','HgP_EEU','HgP_EUR','HgP_GEO','HgP_JPN','HgP_MDE','HgP_NAF','HgP_NAT','HgP_NPA','HgP_OCE','HgP_OCN','HgP_SAF','HgP_SAM','HgP_SAS','HgP_SAT','HgP_SEA','HgP_SO','HgP_SOV','HgP_STR','HgP_USA','HgP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITs','OCPI','OCPO','OPOA1','OPOA2','Pb210','Pb210Strat','pFe','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4s','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 579b068878..63425ed7ba 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -331,7 +331,7 @@ subroutine chem_register DO I = 1, nTracersMax IF ( I .LE. nTracers ) THEN - cnstName = TRIM(tracerNames(I)) + cnstName = to_upper(TRIM(tracerNames(I))) trueName = cnstName N = Ind_(cnstName) ThisSpc => SC%SpcData(N)%Info diff --git a/src/chemistry/geoschem/mo_neu_wetdep.F90 b/src/chemistry/geoschem/mo_neu_wetdep.F90 index c48af5cc0c..d31ab9d7f4 100644 --- a/src/chemistry/geoschem/mo_neu_wetdep.F90 +++ b/src/chemistry/geoschem/mo_neu_wetdep.F90 @@ -132,22 +132,22 @@ subroutine neu_wetdep_init test_name = 'GC_CH2O' case( 'NO2' ) test_name = 'GC_NO2' - case( 'HNO3' ) - test_name = 'GC_HNO3' + !case( 'HNO3' ) + ! test_name = 'GC_HNO3' case( 'NH3' ) test_name = 'GC_NH3' case( 'N2O5' ) test_name = 'GC_N2O5' case( 'PAN' ) test_name = 'GC_PAN' - case( 'SO2' ) - test_name = 'GC_SO2' + !case( 'SO2' ) + ! test_name = 'GC_SO2' ! Now list all non-MAM GEOS-Chem aerosols. These will be scavenged similarly ! to HNO3 - case( 'AERI', 'BrSALA', 'BrSALC', 'DMS', 'INDIOL', & + case( 'AERI', 'BRSALA', 'BRSALC', 'INDIOL', & 'IONITA', 'ISALA', 'ISALC', 'LVOCOA', 'MONITA', & - 'MSA', 'NH4', 'NIT', 'NITs', 'pFe', & - 'SALAAL', 'SALACL', 'SALCAL', 'SALCCL', 'SO4s', & + 'MSA', 'NH4', 'NIT', 'NITS', 'PFE', & + 'SALAAL', 'SALACL', 'SALCAL', 'SALCCL', 'SO4S', & 'SOAGX', 'SOAIE' ) test_name = 'HNO3' end select diff --git a/src/chemistry/geoschem/mo_sim_dat.F90 b/src/chemistry/geoschem/mo_sim_dat.F90 index 44997c160e..442e2fc4a0 100644 --- a/src/chemistry/geoschem/mo_sim_dat.F90 +++ b/src/chemistry/geoschem/mo_sim_dat.F90 @@ -43,18 +43,18 @@ subroutine set_sim_dat solsym(:318) = (/ 'ACET ','ACTA ','AERI ', & 'ALD2 ','ALK4 ','ATOOH ', & 'BCPI ','BCPO ','BENZ ', & - 'Br ','Br2 ','BrCl ', & - 'BrNO2 ','BrNO3 ','BrO ', & - 'BrSALA ','BrSALC ','C2H6 ', & - 'C3H8 ','CCl4 ','CFC11 ', & + 'BR ','BR2 ','BRCL ', & + 'BRNO2 ','BRNO3 ','BRO ', & + 'BRSALA ','BRSALC ','C2H6 ', & + 'C3H8 ','CCL4 ','CFC11 ', & 'CFC113 ','CFC114 ','CFC115 ', & - 'CFC12 ','CH2Br2 ','CH2Cl2 ', & - 'CH2I2 ','CH2IBr ','CH2ICl ', & - 'CH2O ','CH3Br ','CH3CCl3 ', & - 'CH3Cl ','CH3I ','CH4 ', & - 'CHBr3 ','CHCl3 ','Cl ', & - 'Cl2 ','Cl2O2 ','ClNO2 ', & - 'ClNO3 ','ClO ','ClOO ', & + 'CFC12 ','CH2BR2 ','CH2CL2 ', & + 'CH2I2 ','CH2IBR ','CH2ICL ', & + 'CH2O ','CH3BR ','CH3CCL3 ', & + 'CH3CL ','CH3I ','CH4 ', & + 'CHBR3 ','CHCL3 ','CL ', & + 'CL2 ','CL2O2 ','CLNO2 ', & + 'CLNO3 ','CLO ','CLOO ', & 'CLOCK ', & 'CO ','DMS ','DST1 ', & 'DST2 ','DST3 ','DST4 ', & @@ -62,17 +62,17 @@ subroutine set_sim_dat 'ETP ','GLYC ','GLYX ', & 'H1211 ','H1301 ','H2402 ', & 'H2O ','H2O2 ','HAC ', & - 'HBr ','HC5A ','HCFC123 ', & - 'HCFC141b ','HCFC142b ','HCFC22 ', & - 'HCl ','HCOOH ','HI ', & + 'HBR ','HC5A ','HCFC123 ', & + 'HCFC141B ','HCFC142B ','HCFC22 ', & + 'HCL ','HCOOH ','HI ', & 'HMHP ','HMML ','HNO2 ', & - 'HNO3 ','HNO4 ','HOBr ', & - 'HOCl ','HOI ','HONIT ', & + 'HNO3 ','HNO4 ','HOBR ', & + 'HOCL ','HOI ','HONIT ', & 'HPALD1 ','HPALD2 ','HPALD3 ', & 'HPALD4 ','HPETHNL ','I ', & 'I2 ','I2O2 ','I2O3 ', & - 'I2O4 ','IBr ','ICHE ', & - 'ICl ','ICN ','ICPDH ', & + 'I2O4 ','IBR ','ICHE ', & + 'ICL ','ICN ','ICPDH ', & 'IDC ','IDCHP ','IDHDP ', & 'IDHPE ','IDN ','IEPOXA ', & 'IEPOXB ','IEPOXD ','IHN1 ', & @@ -93,11 +93,11 @@ subroutine set_sim_dat 'MVKDH ','MVKHC ','MVKHCB ', & 'MVKHP ','MVKN ','MVKPC ', & 'N2O ','N2O5 ','NH3 ', & - 'NH4 ','NIT ','NITs ', & + 'NH4 ','NIT ','NITS ', & 'NO ','NO2 ','NO3 ', & - 'NPRNO3 ','O3 ','OClO ', & + 'NPRNO3 ','O3 ','OCLO ', & 'OCPI ','OCPO ','OCS ', & - 'OIO ','PAN ','pFe ', & + 'OIO ','PAN ','PFE ', & 'PIP ','PP ','PPN ', & 'PROPNN ','PRPE ','PRPN ', & 'PYAC ','R4N2 ','R4P ', & @@ -106,7 +106,7 @@ subroutine set_sim_dat 'RIPD ','RP ','SALA ', & 'SALAAL ','SALACL ','SALC ', & 'SALCAL ','SALCCL ','SO2 ', & - 'SO4 ','SO4s ','SOAGX ', & + 'SO4 ','SO4S ','SOAGX ', & 'SOAIE ','SOAP ','SOAS ', & 'TOLU ','XYLE ','bc_a1 ', & 'bc_a4 ','dst_a1 ','dst_a2 ', & @@ -124,7 +124,7 @@ subroutine set_sim_dat 'LISOPNO3 ','LTRO2H ','LTRO2N ', & 'LXRO2H ','LXRO2N ','SO4H1 ', & 'SO4H2 ','SO4H3 ','SO4H4 ', & - 'POx ','LOx ','PCO ', & + 'POX ','LOX ','PCO ', & 'LCO ','PSO4 ','LCH4 ', & 'PH2O2 ','BRO2 ','TRO2 ', & 'N ','XRO2 ','HPALD2OO ', & From 87b572a1ba0ff9ef05923659fa875d7b264033da Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Sun, 28 Feb 2021 22:51:12 -0500 Subject: [PATCH 209/239] Feat: Now retrieve fields from HEMCO using 2-D pbuf fields --- src/chemistry/geoschem/chemistry.F90 | 39 ++++++++++++---------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 63425ed7ba..da3d200a95 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -2004,6 +2004,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in chnk REAL(r8), POINTER :: pbuf_ik(:,:) ! ptr to pbuf data (/pcols,pver/) + REAL(r8), POINTER :: pbuf_i(:) ! ptr to pbuf data (/pcols/) horizontal only (horiz_only) INTEGER :: tmpIdx ! pbuf field id INTEGER :: TIM_NDX @@ -2415,11 +2416,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) ELSE - CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) + CALL pbuf_get_field(pbuf, tmpIdx, pbuf_i) DO J = 1, nY - State_Met(LCHNK)%LandTypeFrac(1,J,N) = pbuf_ik(J,nZ) - ! 2-D data is stored in the 1st level of a - ! 3-D array due to laziness + State_Met(LCHNK)%LandTypeFrac(1,J,N) = pbuf_i(J) ENDDO pbuf_ik => NULL() ENDIF @@ -2429,11 +2428,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) ELSE - CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) + CALL pbuf_get_field(pbuf, tmpIdx, pbuf_i) DO J = 1, nY - State_Met(LCHNK)%XLAI_NATIVE(1,J,N) = pbuf_ik(J,nZ) - ! 2-D data is stored in the 1st level of a - ! 3-D array due to laziness + State_Met(LCHNK)%XLAI_NATIVE(1,J,N) = pbuf_i(J) ENDDO pbuf_ik => NULL() ENDIF @@ -2573,10 +2570,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Met(LCHNK)%UVALBEDO(1,:nY) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) - CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) - State_Met(LCHNK)%UVALBEDO(1,:nY) = pbuf_ik(:nY,nZ) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_i) + State_Met(LCHNK)%UVALBEDO(1,:nY) = pbuf_i(:nY) pbuf_chnk => NULL() - pbuf_ik => NULL() + pbuf_i => NULL() ENDIF ENDIF @@ -2616,10 +2613,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Chm(LCHNK)%IODIDE(1,:nY) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) - CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) - State_Chm(LCHNK)%IODIDE(1,:nY) = pbuf_ik(:nY,nZ) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_i) + State_Chm(LCHNK)%IODIDE(1,:nY) = pbuf_i(:nY) pbuf_chnk => NULL() - pbuf_ik => NULL() + pbuf_i => NULL() ENDIF ! Field : SALINITY @@ -2634,10 +2631,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Chm(LCHNK)%SALINITY(1,:nY) = 0.0e+0_fp ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) - CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) - State_Chm(LCHNK)%SALINITY(1,:nY) = pbuf_ik(:nY,nZ) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_i) + State_Chm(LCHNK)%SALINITY(1,:nY) = pbuf_i(:nY) pbuf_chnk => NULL() - pbuf_ik => NULL() + pbuf_i => NULL() ENDIF ! Field : OMOC @@ -2658,13 +2655,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! there is an error here and the field was not found IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) ELSE - CALL pbuf_get_field(pbuf, tmpIdx, pbuf_ik) + CALL pbuf_get_field(pbuf, tmpIdx, pbuf_i) DO J = 1, nY - State_Chm(LCHNK)%OMOC(1,J) = pbuf_ik(J,nZ) - ! 2-D data is stored in the 1st level of a - ! 3-D array due to laziness + State_Chm(LCHNK)%OMOC(1,J) = pbuf_i(J) ENDDO - pbuf_ik => NULL() + pbuf_i => NULL() ENDIF ! Three-dimensional fields on level edges From 14e962bd3bc2ce2050549082aa787024ac4018fb Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 2 Mar 2021 17:09:19 -0500 Subject: [PATCH 210/239] Fix: Pass surface J-Rates to HEMCO for PARANOX Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 37 +++++++++++++--------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index da3d200a95..e2df71f9e9 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -2420,7 +2420,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO J = 1, nY State_Met(LCHNK)%LandTypeFrac(1,J,N) = pbuf_i(J) ENDDO - pbuf_ik => NULL() + pbuf_i => NULL() ENDIF Write(FieldName, '(a,i2.2)') 'HCO_XLAI', N-1 @@ -2432,7 +2432,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO J = 1, nY State_Met(LCHNK)%XLAI_NATIVE(1,J,N) = pbuf_i(J) ENDDO - pbuf_ik => NULL() + pbuf_i => NULL() ENDIF ENDDO ENDIF @@ -3536,6 +3536,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Error_Stop( ErrMsg, ThisLoc ) ENDIF + ! GEOS-Chem considers CO2 as a dead species and resets its concentration + ! internally. Right after the call to `Do_Chemistry`, State_Chm%Species(iCO2) + ! corresponds to the chemically-produced CO2. The real CO2 concentration + ! is thus the concentration before chemistry + the chemically-produced CO2. + State_Chm(LCHNK)%Species(1,:nY,:nZ,iCO2) = State_Chm(LCHNK)%Species(1,:nY,:nZ,iCO2) & + + MMR_Beg(:nY,:nZ,iCO2) ! Make sure State_Chm(LCHNK) is back in kg/kg dry! IF ( TRIM(State_Chm(LCHNK)%Spc_Units) /= 'kg/kg dry' ) THEN @@ -3552,43 +3558,34 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) - CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_i) ! RXN_NO2: NO2 + hv --> NO + O - pbuf_ik(:nY,:nZ) = ZPJ(nZ:1:-1, RXN_NO2, 1, :nY) + pbuf_i(:nY) = ZPJ(1,RXN_NO2,1,:nY) pbuf_chnk => NULL() - pbuf_ik => NULL() + pbuf_i => NULL() ENDIF - FieldName = 'HCO_IN_JOH' tmpIdx = pbuf_get_index(FieldName, RC) IF ( tmpIdx < 0 .or. ( iStep == 1 ) ) THEN IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(FieldName) ELSE pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) - CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_ik) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_i) IF ( Input_Opt%LUCX ) THEN - ! RXN_O3_1: O3 + hv --> O2 + O - pbuf_ik(:nY,:nZ) = ZPJ(nZ:1:-1, RXN_O3_1, 1, :nY) + ! RXN_O3_1: O3 + hv --> O2 + O + pbuf_i(:nY) = ZPJ(1,RXN_O3_1,1,:nY) ELSE - ! RXN_O3_2a: O3 + hv --> 2OH - pbuf_ik(:nY,:nZ) = ZPJ(nZ:1:-1, RXN_O3_2a, 1, :nY) + ! RXN_O3_2a: O3 + hv --> 2OH + pbuf_i(:nY) = ZPJ(1,RXN_O3_2a,1,:nY) ENDIF - pbuf_chnk => NULL() - pbuf_ik => NULL() + pbuf_i => NULL() ENDIF - ! GEOS-Chem considers CO2 as a dead species and resets its concentration - ! internally. Right after the call to `Do_Chemistry`, State_Chm%Species(iCO2) - ! corresponds to the chemically-produced CO2. The real CO2 concentration - ! is thus the concentration before chemistry + the chemically-produced CO2. - State_Chm(LCHNK)%Species(1,:nY,:nZ,iCO2) = State_Chm(LCHNK)%Species(1,:nY,:nZ,iCO2) & - + MMR_Beg(:nY,:nZ,iCO2) - call t_stopf( 'chemdr' ) !============================================================== From f78d930bf355098b5ce926aaff9cccf5f08a8199 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 4 Mar 2021 12:13:15 -0500 Subject: [PATCH 211/239] Fix: Update MMR_Beg for MAM aerosols (1) This fix avoids a slow, but steady build up of some MAM aerosols Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index e2df71f9e9..d62680521a 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -431,9 +431,6 @@ subroutine chem_register ! cnstName = 'TOLUENE' ENDIF - ! For debug, only - !If ( MasterProc ) Write(iulog,*) " Species = ", TRIM(cnstName) - CALL cnst_add( cnstName, MWtmp, cptmp, qmin, N, & readiv=ic_from_cam2, mixtype=mixtype, & cam_outfld=camout, molectype=molectype, & @@ -2181,6 +2178,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) DO SM = 1, nspec_amode(M) P = map2MAM4(SM,M) IF ( P <= 0 ) CYCLE + ! Overwrite MMR_Beg with MAM value + MMR_Beg(:nY,:nZ,P) = State_Chm(LCHNK)%Species(1,:nY,:nZ,P) N = lmassptr_amode(SM,M) DO J = 1, nY DO L = 1, nZ From a15281e3bc5ab4777eeefae545f24a32306cc0a4 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 19 Mar 2021 17:36:30 -0400 Subject: [PATCH 212/239] Fix: Make sure GEOS-Chem (aerosol phase) MSA is not picked up by MAM Signed-off-by: Thibaud Fritz --- src/chemistry/modal_aero/modal_aero_gasaerexch.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/chemistry/modal_aero/modal_aero_gasaerexch.F90 b/src/chemistry/modal_aero/modal_aero_gasaerexch.F90 index aa7155a78a..b940757b1d 100644 --- a/src/chemistry/modal_aero/modal_aero_gasaerexch.F90 +++ b/src/chemistry/modal_aero/modal_aero_gasaerexch.F90 @@ -106,6 +106,7 @@ subroutine modal_aero_gasaerexch_sub( & use physconst, only: gravit, mwdry, rair use cam_abortutils, only: endrun use spmd_utils, only: iam, masterproc +use mo_chem_utls, only: utls_chem_is implicit none @@ -260,7 +261,11 @@ subroutine modal_aero_gasaerexch_sub( & ! set gas species indices call cnst_get_ind( 'H2SO4', l_so4g, .false. ) call cnst_get_ind( 'NH3', l_nh4g, .false. ) - call cnst_get_ind( 'MSA', l_msag, .false. ) + if ( .not. utls_chem_is('GEOS-Chem') ) then + call cnst_get_ind( 'MSA', l_msag, .false. ) + else + l_msag = 0 + endif l_so4g = l_so4g - loffset l_nh4g = l_nh4g - loffset l_msag = l_msag - loffset @@ -590,7 +595,6 @@ subroutine modal_aero_gasaerexch_sub( & end do mw_poa_host = 12.0_r8 mw_soa_host = 250.0_r8 - call modal_aero_soaexch( deltat, t(i,k), pmid(i,k), & niter, niter_max, ntot_amode, ntot_soamode, npoa, nsoa, & mw_poa_host, mw_soa_host, & From 8dfbfb06503947c36aab37fbfdf36edc93cbcb3e Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 19 Mar 2021 17:40:59 -0400 Subject: [PATCH 213/239] Feat: Diagnose constituents as mol/mol apart from MAM aerosols Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 84 ++++++++++++++++------ 1 file changed, 64 insertions(+), 20 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 7c3180ddd6..542deed081 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -47,6 +47,8 @@ MODULE CESMGC_Diag_Mod CHARACTER(LEN=fieldname_len) :: dtchem_name(gas_pcnst) ! Chemical tendencies CHARACTER(LEN=16) :: sflxnam_loc(pcnst) ! Names of surface fluxes + INTEGER :: aer_species(gas_pcnst) + ! Chemical families INTEGER :: NOx_species(3) INTEGER :: NOy_species(63) @@ -151,6 +153,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) USE CONSTITUENTS, ONLY : cnst_get_ind USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only USE DRYDEP_MOD, ONLY : depName + USE MO_CHEM_UTLS, ONLY : get_spc_ndx ! ! !INPUT PARAMETERS: ! @@ -165,9 +168,15 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) !BOC ! ! Integer - INTEGER :: M, N, SM + INTEGER :: M, N, K, SM INTEGER :: idx INTEGER :: RC + INTEGER :: bulkaero_species(20) + INTEGER :: id_so4, id_nh4no3 + INTEGER :: id_dst01, id_dst02, id_dst03, id_dst04 + INTEGER :: id_sslt01, id_sslt02, id_sslt03, id_sslt04 + INTEGER :: id_soa, id_oc1, id_oc2, id_cb1, id_cb2 + INTEGER :: id_soam,id_soai,id_soat,id_soab,id_soax ! Logical LOGICAL :: Found @@ -196,6 +205,45 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Assume a successful return until otherwise RC = GC_SUCCESS + id_dst01 = get_spc_ndx( 'DST01' ) + id_dst02 = get_spc_ndx( 'DST02' ) + id_dst03 = get_spc_ndx( 'DST03' ) + id_dst04 = get_spc_ndx( 'DST04' ) + id_sslt01 = get_spc_ndx( 'SSLT01' ) + id_sslt02 = get_spc_ndx( 'SSLT02' ) + id_sslt03 = get_spc_ndx( 'SSLT03' ) + id_sslt04 = get_spc_ndx( 'SSLT04' ) + id_soa = get_spc_ndx( 'SOA' ) + id_so4 = get_spc_ndx( 'SO4' ) + id_oc1 = get_spc_ndx( 'OC1' ) + id_oc2 = get_spc_ndx( 'OC2' ) + id_cb1 = get_spc_ndx( 'CB1' ) + id_cb2 = get_spc_ndx( 'CB2' ) + id_nh4no3 = get_spc_ndx( 'NH4NO3' ) + id_soam = get_spc_ndx( 'SOAM' ) + id_soai = get_spc_ndx( 'SOAI' ) + id_soat = get_spc_ndx( 'SOAT' ) + id_soab = get_spc_ndx( 'SOAB' ) + id_soax = get_spc_ndx( 'SOAX' ) + + bulkaero_species(:) = -1 + bulkaero_species(1:20) = (/ id_dst01, id_dst02, id_dst03, id_dst04, & + id_sslt01, id_sslt02, id_sslt03, id_sslt04, & + id_soa, id_so4, id_oc1, id_oc2, id_cb1, id_cb2, id_nh4no3, & + id_soam,id_soai,id_soat,id_soab,id_soax /) + aer_species(:) = -1 + n = 1 + do m = 1,gas_pcnst + k=0 + if ( any(bulkaero_species(:)==m) ) k=1 + if ( k==0 ) k = index(trim(solsym(m)), '_a') + if ( k==0 ) k = index(trim(solsym(m)), '_c') + if ( k>0 ) then ! must be aerosol species + aer_species(n) = m + n = n+1 + endif + enddo + CALL Addfld( 'MASS', (/ 'lev' /), 'A', 'kg', 'Mass of grid box' ) CALL Addfld( 'AREA', horiz_only, 'A', 'm2', 'Area of grid box' ) CALL Addfld( 'HEIGHT', (/ 'ilev' /),'A','m', 'Geopotential height above surface at interfaces' ) @@ -203,17 +251,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Note that constituents are already output by default ! Add all species as output fields if desired DO N = 1, gas_pcnst - M = map2chm(N) - IF ( M > 0 ) THEN - ! It's a GEOS-Chem species - SpcName = to_upper(TRIM(solsym(N))) - CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & - TRIM(SpcName)//' volume mixing ratio') - CALL AddFld( TRIM(SpcName)//'_SRF', horiz_only, 'A', 'mol/mol', & - TRIM(SpcName)//' in bottom layer') - IF (TRIM(SpcName) == 'O3') CALL Add_Default( TRIM(SpcName), 2, ' ' ) - ELSE - ! MAM aerosols + IF ( ANY( aer_species == N ) ) THEN SpcName = TRIM(solsym(N)) unit_basename = 'kg' IF ( SpcName(1:3) == 'num' ) unit_basename = ' 1' @@ -221,6 +259,13 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) TRIM(SpcName)//' concentration' ) CALL AddFld( TRIM(SpcName)//'_SRF', horiz_only, 'A', unit_basename//'/kg', & TRIM(SpcName)//' in bottom layer' ) + ELSE + M = map2chm(N) + SpcName = TRIM(solsym(N)) + CALL AddFld( TRIM(SpcName), (/ 'lev' /), 'A', 'mol/mol', & + TRIM(SpcName)//' volume mixing ratio') + CALL AddFld( TRIM(SpcName)//'_SRF', horiz_only, 'A', 'mol/mol', & + TRIM(SpcName)//' in bottom layer') ENDIF ENDDO @@ -889,19 +934,18 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & DO N = 1, gas_pcnst M = map2chm(N) - IF ( M > 0 ) THEN - ! It's a GEOS-Chem species - SpcName = to_upper(TRIM(solsym(N))) - ELSE - ! MAM aerosols - SpcName = TRIM(solsym(N)) - ENDIF + SpcName = TRIM(solsym(N)) outTmp = 0.0e+00_r8 IF ( adv_mass(N) > 0.0e+00_r8 .AND. M /= 0 .AND. hist_fld_active(TRIM(SpcName)) ) THEN IF ( M > 0 ) THEN + ! mol/mol outTmp(:nY,:) = REAL(State_Chm%Species(1,:nY,nZ:1:-1,M),r8) * MWDry / adv_mass(N) - ELSE + ELSEIF ( ANY( aer_species == N ) ) THEN + ! kg/kg outTmp(:nY,:) = state%q(:nY,:nZ,-M) + ELSE + ! mol/mol + outTmp(:nY,:) = state%q(:nY,:nZ,-M) * MWDry / adv_mass(N) ENDIF CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) CALL OutFld( TRIM(SpcName)//'_SRF', outTmp(:nY,nZ), nY, LCHNK ) From 91082744356a2a45f1207268eb45d4564add3123 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 22 Mar 2021 18:16:19 -0400 Subject: [PATCH 214/239] Feat: Update namelist_defaults s.t. geoschem mimics trop_strat_mam4vbs Signed-off-by: Thibaud Fritz --- bld/namelist_files/namelist_defaults_cam.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 444e59811b..7d61bd3b17 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -493,6 +493,7 @@ 0.4D0 0.55D0 0.5D0 +0.5D0 0.5D0 0.5D0 0.0625D0 @@ -505,22 +506,27 @@ atm/waccm/gw/mfspectra_shallow_c140530.nc 0.25d0 0.5d0 +0.5d0 0.5d0 0.5d0 1.d0 2.d0 +2.d0 2.d0 2.d0 .true. .false. +.false. .false. .false. .false. .true. +.true. .true. .true. .true. .false. +.false. .false. .false. From 2bec4a5068f2cbfcf2ef4ed9c574abbb91e755ee Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 22 Mar 2021 18:19:53 -0400 Subject: [PATCH 215/239] Feat: Update geoschem.xml to mimic history_* XML variables Signed-off-by: Thibaud Fritz --- bld/namelist_files/use_cases/geoschem.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 4e5775d3e1..12018aca71 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -39,6 +39,16 @@ 0,-24,-24,-3,-1,1,-24,-120,-240 'A','A','A','A','A','A','A','A','I' +.true. +.false. +.false. +.false. +.false. +.false. +.false. +.false. +.false. + 'Q', 'U', 'V', 'OMEGA', 'T', 'PS', From 189088e4c996f808c9c83a5d4757042432e2b0f1 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 23 Mar 2021 11:28:38 -0400 Subject: [PATCH 216/239] Feat: Add history_* options to save out fields in cesmgc_diag_mod Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 107 +++++++++++++++++++-- 1 file changed, 101 insertions(+), 6 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 542deed081..dbf034bb16 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -51,7 +51,7 @@ MODULE CESMGC_Diag_Mod ! Chemical families INTEGER :: NOx_species(3) - INTEGER :: NOy_species(63) + INTEGER :: NOy_species(62) INTEGER :: HOx_species(4) INTEGER :: ClOx_species(6) INTEGER :: ClOy_species(11) @@ -63,7 +63,7 @@ MODULE CESMGC_Diag_Mod INTEGER :: NHx_species(2) INTEGER :: TOTH_species(3) REAL(r8) :: NOx_MWs(3) - REAL(r8) :: NOy_MWs(64) + REAL(r8) :: NOy_MWs(62) REAL(r8) :: HOx_MWs(4) REAL(r8) :: ClOx_MWs(6) REAL(r8) :: ClOy_MWs(11) @@ -92,7 +92,7 @@ MODULE CESMGC_Diag_Mod i_MACRNO2, i_MCRHN, i_MCRHNB, i_MENO3, i_MONITS, i_MONITU, & i_MPAN, i_MPN, i_MVKN, i_N2O5, i_NO3, i_NPRNO3, i_OLND, & i_OLNN, i_PAN, i_PPN, i_PRN1, i_PROPNN, i_PRPN, i_R4N1, & - i_R4N2, i_HONIT, i_IONITA, i_NIT, i_NITs, i_NH4 + i_R4N2, i_HONIT, i_IONITA, i_NIT, i_NITs ! HOx INTEGER :: i_H, i_OH, i_HO2, i_H2O2 ! ClOx @@ -114,9 +114,18 @@ MODULE CESMGC_Diag_Mod ! SOx INTEGER :: i_SO2, i_SO4 ! NHx - INTEGER :: i_NH3 !NH4 already defined in NOy_species + INTEGER :: i_NH3, i_NH4 ! TOTH INTEGER :: i_CH4, i_H2O, i_H2 + + + ! Index in solsym + integer :: id_no,id_no3 + integer :: id_cfc11,id_cfc12 + integer :: id_ch4,id_h2o + integer :: id_o,id_o2,id_h,id_n2o + integer :: id_co2,id_o3,id_oh,id_ho2,id_so4_a1,id_so4_a2,id_so4_a3 + integer :: id_num_a2,id_num_a3,id_dst_a3,id_ncl_a3 ! ! !REVISION HISTORY: ! 28 Oct 2020 - T. M. Fritz - Initial version @@ -152,6 +161,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) USE CONSTITUENTS, ONLY : cnst_name, sflxnam USE CONSTITUENTS, ONLY : cnst_get_ind USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only + USE PHYS_CONTROL, ONLY : phys_getopts USE DRYDEP_MOD, ONLY : depName USE MO_CHEM_UTLS, ONLY : get_spc_ndx ! @@ -177,9 +187,16 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) INTEGER :: id_sslt01, id_sslt02, id_sslt03, id_sslt04 INTEGER :: id_soa, id_oc1, id_oc2, id_cb1, id_cb2 INTEGER :: id_soam,id_soai,id_soat,id_soab,id_soax + integer :: id_bry, id_cly ! Logical LOGICAL :: Found + LOGICAL :: history_aerosol ! Output the MAM aerosol tendencies + LOGICAL :: history_chemistry + LOGICAL :: history_cesm_forcing + LOGICAL :: history_scwaccm_forcing + LOGICAL :: history_chemspecies_srf ! output the chemistry constituents species in the surface layer + LOGICAL :: history_dust ! Strings CHARACTER(LEN=255) :: SpcName @@ -205,6 +222,38 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Assume a successful return until otherwise RC = GC_SUCCESS + CALL phys_getopts( history_aerosol_out = history_aerosol, & + history_chemistry_out = history_chemistry, & + history_chemspecies_srf_out = history_chemspecies_srf, & + history_cesm_forcing_out = history_cesm_forcing, & + history_scwaccm_forcing_out = history_scwaccm_forcing, & + history_dust_out = history_dust ) + + id_no3 = get_spc_ndx( 'NO3' ) + id_o3 = get_spc_ndx( 'O3' ) + id_oh = get_spc_ndx( 'OH' ) + id_ho2 = get_spc_ndx( 'HO2' ) + id_so4_a1 = get_spc_ndx( 'so4_a1' ) + id_so4_a2 = get_spc_ndx( 'so4_a2' ) + id_so4_a3 = get_spc_ndx( 'so4_a3' ) + id_num_a2 = get_spc_ndx( 'num_a2' ) + id_num_a3 = get_spc_ndx( 'num_a3' ) + id_dst_a3 = get_spc_ndx( 'dst_a3' ) + id_ncl_a3 = get_spc_ndx( 'ncl_a3' ) + id_co2 = get_spc_ndx( 'CO2' ) + id_no = get_spc_ndx( 'NO' ) + id_h = get_spc_ndx( 'H' ) + id_o = get_spc_ndx( 'O' ) + id_o2 = get_spc_ndx( 'O2' ) + id_ch4 = get_spc_ndx( 'CH4' ) + id_h2o = get_spc_ndx( 'H2O' ) + id_n2o = get_spc_ndx( 'N2O' ) + id_cfc11 = get_spc_ndx( 'CFC11' ) + id_cfc12 = get_spc_ndx( 'CFC12' ) + + id_bry = get_spc_ndx( 'BRY' ) + id_cly = get_spc_ndx( 'CLY' ) + id_dst01 = get_spc_ndx( 'DST01' ) id_dst02 = get_spc_ndx( 'DST02' ) id_dst03 = get_spc_ndx( 'DST03' ) @@ -214,7 +263,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) id_sslt03 = get_spc_ndx( 'SSLT03' ) id_sslt04 = get_spc_ndx( 'SSLT04' ) id_soa = get_spc_ndx( 'SOA' ) - id_so4 = get_spc_ndx( 'SO4' ) + id_so4 = get_spc_ndx( 'SO4' ); id_so4 = -1 ! Don't pick up GEOS-Chem's SO4! id_oc1 = get_spc_ndx( 'OC1' ) id_oc2 = get_spc_ndx( 'OC2' ) id_cb1 = get_spc_ndx( 'CB1' ) @@ -267,6 +316,49 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) CALL AddFld( TRIM(SpcName)//'_SRF', horiz_only, 'A', 'mol/mol', & TRIM(SpcName)//' in bottom layer') ENDIF + IF ( ( N /= id_cly ) .AND. ( N /= id_bry ) ) THEN + IF ( history_aerosol .OR. history_chemistry ) THEN + CALL Add_Default( TRIM(SpcName), 1, ' ' ) + ENDIF + IF ( history_chemspecies_srf ) THEN + CALL Add_Default( TRIM(SpcName)//'_SRF', 1, ' ' ) + ENDIF + ENDIF + + IF ( history_cesm_forcing ) THEN + IF ( N == id_o3 ) CALL Add_Default( TRIM(SpcName), 1, ' ') + IF ( N == id_oh ) CALL Add_Default( TRIM(SpcName), 1, ' ') + IF ( N == id_no3 ) CALL Add_Default( TRIM(SpcName), 1, ' ') + IF ( N == id_ho2 ) CALL Add_Default( TRIM(SpcName), 1, ' ') + + IF ( N == id_o3 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_so4_a1 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_so4_a2 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_so4_a3 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + + IF ( N == id_num_a2 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_num_a3 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_dst_a3 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_ncl_a3 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + + ENDIF + IF ( history_scwaccm_forcing ) THEN + IF ( N == id_co2 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_h ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_no ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_o ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_o2 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_o3 ) CALL Add_Default( TRIM(SpcName), 8, ' ') + IF ( N == id_h2o ) CALL Add_Default( TRIM(SpcName), 1, ' ') + IF ( N == id_ch4 ) CALL Add_Default( TRIM(SpcName), 1, ' ') + IF ( N == id_n2o ) CALL Add_Default( TRIM(SpcName), 1, ' ') + IF ( N == id_cfc11 ) CALL Add_Default( TRIM(SpcName), 1, ' ') + IF ( N == id_cfc12 ) CALL Add_Default( TRIM(SpcName), 1, ' ') + ENDIF + + IF (history_dust .AND. (index(TRIM(SpcName),'dst_') > 0)) THEN + CALL Add_Default( TRIM(SpcName), 1, ' ') + ENDIF ENDDO IF ( Input_Opt%LDryD ) THEN @@ -285,6 +377,9 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) SpcName = 'DF_'//to_upper(TRIM(SpcInfo%Name)) CALL AddFld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & TRIM(SpcName)//' dry deposition flux') + IF ( history_chemistry ) THEN + CALL Add_Default( TRIM(SpcName), 1, ' ' ) + ENDIF ! Free pointer SpcInfo => NULL() @@ -547,7 +642,7 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) i_MCRHNB, i_MENO3, i_MONITS, i_MONITU, i_MPAN, i_MPN,& i_MVKN, i_N2O5, i_NO3, i_NPRNO3, i_OLND, i_OLNN, & i_PAN, i_PPN, i_PRN1, i_PROPNN, i_PRPN, i_R4N1, & - i_R4N2, i_HONIT, i_IONITA, i_NIT, i_NITs, i_NH4 /) + i_R4N2, i_HONIT, i_IONITA, i_NIT, i_NITs /) HOx_species = (/ i_H, i_OH, i_HO2, i_H2O2 /) ClOx_species = (/ i_Cl, i_ClO, i_HOCl, i_Cl2, i_Cl2O2, i_OClO /) ClOy_species = (/ i_Cl, i_ClO, i_HOCl, i_Cl2, i_Cl2O2, i_OClO, & From d924b90189871cfe60bbd34b557407f982a5f4b1 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 23 Mar 2021 13:27:52 -0400 Subject: [PATCH 217/239] Feat: Don't make solsym fixed size, but rather of size gas_pcnst Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/mo_tracname.F90 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/chemistry/geoschem/mo_tracname.F90 b/src/chemistry/geoschem/mo_tracname.F90 index be9c474506..8e8a80b9a3 100644 --- a/src/chemistry/geoschem/mo_tracname.F90 +++ b/src/chemistry/geoschem/mo_tracname.F90 @@ -5,13 +5,10 @@ module mo_tracname ! surface fluxes for the advected species. !----------------------------------------------------------- - use chem_mods, only : nTracersMax + use chem_mods, only : gas_pcnst implicit none -! modified to an arbitrary high #, was gas_pcnst. this would cause a memory -! overflow overwrite in mo_sim_dat, which allocates :273 larger than -! the default specified gas_pcnst (hplin, 5/16/20) - character(len=16) :: solsym(318) ! species names + character(len=16) :: solsym(gas_pcnst) ! species names end module mo_tracname From 6d00709320821f650c8d65028f9ba610ebac8753 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 23 Mar 2021 13:29:11 -0400 Subject: [PATCH 218/239] Feat: Change nadv_chem from 240 to 238 Signed-off-by: Thibaud Fritz --- bld/configure | 3 +-- src/chemistry/geoschem/chem_mods.F90 | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bld/configure b/bld/configure index 551d9d5cd3..98faf00aa3 100755 --- a/bld/configure +++ b/bld/configure @@ -1441,8 +1441,7 @@ if ($chem_pkg =~ '_mam3') { # TMMF - wedge in GEOS-Chem CPP definitions here if ($chem_pkg =~ 'geoschem') { $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DLINUX_IFORT -DUSE_REAL8 -DMODEL_ -DMODEL_CESM'; - # TMMF - Temporary fix - $chem_nadv = 240; + $chem_nadv = 238; if (defined $opts{'clm_vers'}) { if ($opts{'clm_vers'} =~ 'CLM4.0') { $chem_cppdefs .= ' -DCLM40' diff --git a/src/chemistry/geoschem/chem_mods.F90 b/src/chemistry/geoschem/chem_mods.F90 index 36c946252b..5e00fddcdb 100644 --- a/src/chemistry/geoschem/chem_mods.F90 +++ b/src/chemistry/geoschem/chem_mods.F90 @@ -7,7 +7,7 @@ module chem_mods implicit none save - INTEGER, PARAMETER :: nTracersMax = 240 ! Must be equal to chem_nadv + INTEGER, PARAMETER :: nTracersMax = 238 ! Must be equal to chem_nadv INTEGER :: nTracers CHARACTER(LEN=255) :: tracerNames(nTracersMax) CHARACTER(LEN=255) :: tracerLongNames(nTracersMax) From 6b06bea62ad3e89b11d20163de23128b9d6e385e Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 23 Mar 2021 13:30:38 -0400 Subject: [PATCH 219/239] Feat: Add more history_* options to save out fields (mimic CAM-Chem) Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 60 +++++++++++++------ .../geoschem/cesmgc_emissions_mod.F90 | 28 ++++++++- src/chemistry/geoschem/mo_neu_wetdep.F90 | 15 ++--- 3 files changed, 74 insertions(+), 29 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index dbf034bb16..f27dfa7e53 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -45,7 +45,6 @@ MODULE CESMGC_Diag_Mod CHARACTER(LEN=fieldname_len) :: wetdep_name(gas_pcnst) ! Wet deposition tendencies CHARACTER(LEN=fieldname_len) :: wtrate_name(gas_pcnst) ! Column tendencies for wet dep CHARACTER(LEN=fieldname_len) :: dtchem_name(gas_pcnst) ! Chemical tendencies - CHARACTER(LEN=16) :: sflxnam_loc(pcnst) ! Names of surface fluxes INTEGER :: aer_species(gas_pcnst) @@ -187,16 +186,26 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) INTEGER :: id_sslt01, id_sslt02, id_sslt03, id_sslt04 INTEGER :: id_soa, id_oc1, id_oc2, id_cb1, id_cb2 INTEGER :: id_soam,id_soai,id_soat,id_soab,id_soax - integer :: id_bry, id_cly + INTEGER :: id_bry, id_cly + INTEGER :: history_budget_histfile_num ! output history file number + ! for budget fields ! Logical LOGICAL :: Found - LOGICAL :: history_aerosol ! Output the MAM aerosol tendencies + LOGICAL :: history_aerosol ! Output the MAM aerosol + ! tendencies LOGICAL :: history_chemistry LOGICAL :: history_cesm_forcing LOGICAL :: history_scwaccm_forcing - LOGICAL :: history_chemspecies_srf ! output the chemistry constituents species in the surface layer + LOGICAL :: history_chemspecies_srf ! Output the chemistry + ! constituents species + ! in the surface layer LOGICAL :: history_dust + LOGICAL :: history_budget ! output tendencies and state + ! variables for CAM + ! temperature, water vapor, + ! cloud ice and cloud + ! liquid budgets. ! Strings CHARACTER(LEN=255) :: SpcName @@ -222,12 +231,14 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ! Assume a successful return until otherwise RC = GC_SUCCESS - CALL phys_getopts( history_aerosol_out = history_aerosol, & - history_chemistry_out = history_chemistry, & - history_chemspecies_srf_out = history_chemspecies_srf, & - history_cesm_forcing_out = history_cesm_forcing, & - history_scwaccm_forcing_out = history_scwaccm_forcing, & - history_dust_out = history_dust ) + CALL phys_getopts( history_aerosol_out = history_aerosol, & + history_chemistry_out = history_chemistry, & + history_chemspecies_srf_out = history_chemspecies_srf, & + history_budget_out = history_budget , & + history_budget_histfile_num_out = history_budget_histfile_num, & + history_cesm_forcing_out = history_cesm_forcing, & + history_scwaccm_forcing_out = history_scwaccm_forcing, & + history_dust_out = history_dust ) id_no3 = get_spc_ndx( 'NO3' ) id_o3 = get_spc_ndx( 'O3' ) @@ -386,7 +397,6 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) ENDDO ENDIF - sflxnam_loc(:) = '' ! Chemical tendencies and surface fluxes DO N = 1, gas_pcnst IF ( map2chm(N) > 0 ) THEN @@ -403,22 +413,31 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) SpcName = TRIM(solsym(N)) CALL cnst_get_ind( SpcName, M, abort=.false. ) IF ( M > 0 ) THEN - IF (sflxnam(M)(3:5) == 'num') then ! name is in the form of "SF****" + IF (sflxnam(M)(3:5) == 'num') THEN ! name is in the form of "SF****" unit_basename = ' 1' ELSE unit_basename = 'kg' ENDIF - IF ( map2chm(N) > 0 ) THEN - sflxnam_loc(M) = to_upper(sflxnam(M)) - ELSE - sflxnam_loc(M) = sflxnam(M) - ENDIF - SpcName = sflxnam_loc(M) + SpcName = sflxnam(M) CALL Addfld ( TRIM(SpcName), horiz_only, 'A', unit_basename//'/m2/s', & TRIM(solsym(N))//' surface flux') + IF ( history_aerosol .OR. history_chemistry ) THEN + CALL Add_Default( TRIM(SpcName), 1, ' ' ) + ENDIF + + IF ( history_cesm_forcing ) THEN + IF ( TRIM(SpcName(3:)) == 'NO' .OR. TRIM(SpcName(3:)) == 'NH3' ) THEN + CALL Add_Default( TRIM(SpcName), 1, ' ' ) + ENDIF + ENDIF ENDIF ENDDO + ! Add chemical tendency of water vapor to water budget output + IF ( history_budget ) THEN + CALL Add_Default ('CT_H2O' , history_budget_histfile_num, ' ') + ENDIF + CALL get_TagInfo( Input_Opt = Input_Opt, & tagID = 'PHO', & State_Chm = State_Chm, & @@ -873,6 +892,9 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) CALL Addfld( 'RAD_PSC', (/ 'lev' /), 'I', 'cm', 'PSC aerosol radius' ) CALL Addfld( 'SAD_TROP', (/ 'lev' /), 'I', 'cm2/cm3', 'Tropospheric aerosol SAD' ) CALL Addfld( 'SAD_AERO', (/ 'lev' /), 'I', 'cm2/cm3', 'Aerosol surface area density' ) + IF ( history_cesm_forcing ) THEN + CALL Add_Default( 'SAD_AERO', 8, ' ' ) + ENDIF CALL Addfld( 'REFF_AERO', (/ 'lev' /), 'I', 'cm', 'Aerosol effective radius') CALL Addfld( 'SULF_TROP', (/ 'lev' /), 'I', 'cm2/cm3', 'Tropospheric sulfate area density') @@ -1426,7 +1448,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ! =============================================== DO N = iFirstCnst, pcnst - SpcName = TRIM(sflxnam_loc(N)) + SpcName = TRIM(sflxnam(N)) IF ( TRIM(SpcName) == '' ) CYCLE IF ( .NOT. hist_fld_active(TRIM(SpcName)) ) CYCLE CALL OutFld( TRIM(SpcName), cam_in%cflx(:nY,N), nY, LCHNK ) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 2a1ff841b2..4709699035 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -92,6 +92,7 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) ! USE PHYSICS_TYPES, ONLY : physics_state USE CONSTITUENTS, ONLY : cnst_get_ind + USE PHYS_CONTROL, ONLY : phys_getopts USE MO_CHEM_UTLS, ONLY : get_spc_ndx USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only USE MO_LIGHTNING, ONLY : lightning_inti @@ -113,6 +114,11 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) INTEGER :: IERR INTEGER :: N, II + ! Logicals + LOGICAL :: history_aerosol + LOGICAL :: history_chemistry + LOGICAL :: history_cesm_forcing + ! Strings CHARACTER(LEN=255) :: SpcName CHARACTER(LEN=255) :: Description @@ -124,6 +130,10 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) ! CESMGC_Emissions_Init begins here! !================================================================= + CALL phys_getopts( history_aerosol_out = history_aerosol, & + history_chemistry_out = history_chemistry, & + history_cesm_forcing_out = history_cesm_forcing ) + ! Get constituent index for NO CALL cnst_get_ind('NO', iNO, abort=.True.) @@ -216,9 +226,9 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) CALL Addfld( 'MEG_'//TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & Description ) - !if (history_chemistry) then - CALL Add_default('MEG_'//TRIM(SpcName), 1, ' ') - !endif + IF ( history_chemistry ) THEN + CALL Add_default('MEG_'//TRIM(SpcName), 1, ' ') + ENDIF ENDDO ENDIF @@ -229,9 +239,21 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) SpcName = TRIM(cnst_name(N))//'_CLXF' CALL Addfld( TRIM(SpcName), horiz_only, 'A', 'molec/cm2/s', & 'Vertically-integrated external forcing for '//TRIM(cnst_name(N))) + IF ( history_aerosol .OR. history_chemistry ) THEN + CALL Add_Default( TRIM(SpcName), 1, ' ' ) + ENDIF + IF ( history_cesm_forcing .AND. TRIM(cnst_name(N)) == 'NO2' ) THEN + CALL Add_Default( TRIM(SpcName), 1, ' ' ) + ENDIF SpcName = TRIM(cnst_name(N))//'_CMXF' CALL Addfld( TRIM(SpcName), horiz_only, 'A', 'kg/m2/s', & 'Vertically-integrated external forcing for '//TRIM(cnst_name(N))) + IF ( history_aerosol .OR. history_chemistry ) THEN + CALL Add_Default( TRIM(SpcName), 1, ' ' ) + ENDIF + IF ( history_cesm_forcing .AND. TRIM(cnst_name(N)) == 'NO2' ) THEN + CALL Add_Default( TRIM(SpcName), 1, ' ' ) + ENDIF ENDDO CALL Addfld( 'NO_Lightning', (/ 'lev' /), 'A','molec/cm3/s', & diff --git a/src/chemistry/geoschem/mo_neu_wetdep.F90 b/src/chemistry/geoschem/mo_neu_wetdep.F90 index d31ab9d7f4..49a9acb3a0 100644 --- a/src/chemistry/geoschem/mo_neu_wetdep.F90 +++ b/src/chemistry/geoschem/mo_neu_wetdep.F90 @@ -226,12 +226,13 @@ subroutine neu_wetdep_init call addfld ('DTWR_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','kg/kg/s','wet removal Neu scheme tendency') call addfld ('WD_'//trim(gas_wetdep_list(m)),horiz_only, 'A','kg/m2/s','vertical integrated wet deposition flux') call addfld ('HEFF_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','M/atm','Effective Henrys Law coeff.') - call add_default('DTWR_'//trim(gas_wetdep_list(m)), 4, ' ') - call add_default('WD_'//trim(gas_wetdep_list(m)), 4, ' ') - !if (history_chemistry) then - ! call add_default('DTWR_'//trim(gas_wetdep_list(m)), 1, ' ') - ! call add_default('WD_'//trim(gas_wetdep_list(m)), 1, ' ') - !end if + call add_default('DTWR_'//trim(gas_wetdep_list(m)), 2, ' ') + call add_default('WD_'//trim(gas_wetdep_list(m)), 2, ' ') + !call add_default('HEFF_'//trim(gas_wetdep_list(m)), 2, ' ') + if (history_chemistry) then + call add_default('DTWR_'//trim(gas_wetdep_list(m)), 1, ' ') + call add_default('WD_'//trim(gas_wetdep_list(m)), 1, ' ') + end if end do ! if ( do_diag ) then @@ -481,7 +482,7 @@ subroutine neu_wetdep_tend(lchnk,ncol,mmr,pmid,pdel,zint,tfld,delt, & do m=1,gas_wetdep_cnt wd_tend(1:ncol,:,mapping_to_mmr(m)) = wd_tend(1:ncol,:,mapping_to_mmr(m)) + dtwr(1:ncol,:,m) call outfld( 'DTWR_'//trim(gas_wetdep_list(m)),dtwr(:,:,m),ncol,lchnk ) - + call outfld( 'HEFF_'//trim(gas_wetdep_list(m)),heff(:,pver:1:-1,m),ncol,lchnk ) ! ! vertical integrated wet deposition rate [kg/m2/s] From 07f4da6e29d41d219d3f628434809b9420635cac Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Wed, 24 Mar 2021 11:30:20 -0400 Subject: [PATCH 220/239] Feat: Retrieve ParaNOx deposition fluxes from HEMCO --- .../geoschem/cesmgc_emissions_mod.F90 | 96 +++++++++++++++++-- 1 file changed, 87 insertions(+), 9 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 2a1ff841b2..ef8e5118cc 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -312,26 +312,29 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS INTEGER :: LCHNK INTEGER :: nY, nZ INTEGER :: J, L, N - INTEGER :: RC ! return code - INTEGER :: tmpIdx ! pbuf field id + INTEGER :: RC ! return code + INTEGER :: tmpIdx ! pbuf field id + + INTEGER :: id_O3, id_HNO3 ! Species IDs for reuse ! Logical LOGICAL :: rootChunk ! Objects - TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in current chunk + TYPE(physics_buffer_desc), POINTER :: pbuf_chnk(:) ! slice of pbuf in current chunk ! Real - REAL(r8), POINTER :: pbuf_ik(:,:) ! pointer to pbuf data (/pcols,pver/) - REAL(r8), DIMENSION(state%NCOL,PVER+1) :: zint ! Interface geopotential in km - REAL(r8), DIMENSION(state%NCOL) :: zsurf ! Surface height - REAL(r8) :: SCALFAC ! Multiplying factor - REAL(r8) :: megflx(pcols) ! For MEGAN emissions + REAL(r8), POINTER :: pbuf_ik(:,:) ! pointer to pbuf data (/pcols,pver/) + REAL(r8), POINTER :: pbuf_i(:) ! pointer to 2-D (1-D in CAM) data (/pcols/) + REAL(r8), DIMENSION(state%NCOL,PVER+1) :: zint ! Interface geopotential in km + REAL(r8), DIMENSION(state%NCOL) :: zsurf ! Surface height + REAL(r8) :: SCALFAC ! Multiplying factor + REAL(r8) :: megflx(pcols) ! For MEGAN emissions REAL(r8), PARAMETER :: m2km = 1.e-3_r8 ! Strings CHARACTER(LEN=255) :: SpcName - CHARACTER(LEN=255) :: fldname_ns ! field name HCO_* + CHARACTER(LEN=255) :: fldname_ns ! field name HCO_* !================================================================= ! CESMGC_Emissions_Calc begins here! @@ -340,6 +343,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! Initialize pointers pbuf_chnk => NULL() pbuf_ik => NULL() + pbuf_i => NULL() ! LCHNK: which chunk we have on this process LCHNK = state%LCHNK @@ -388,6 +392,80 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ENDIF ENDDO + !----------------------------------------------------------------------- + ! Deposition fluxes from HEMCO + !----------------------------------------------------------------------- + + ! Part 1: Eventually retrieve deposition velocities [1/s] from HEMCO + ! and convert to negative flux and apply. + ! TODO hplin 3/24/21 + + + ! Part 2: Handle special deposition fluxes for the ParaNOx extension + ! for PAR_O3_DEP and PAR_HNO3_DEP + CALL cnst_get_ind('O3', id_O3) + CALL cnst_get_ind('HNO3', id_HNO3) + + ! write(iulog,*) 'id_O3, cnst_name, id_HNO3, cnst_name', id_O3, cnst_name(id_O3), id_HNO3, cnst_name(id_HNO3) + + tmpIdx = pbuf_get_index('HCO_PAR_O3_DEP', RC) + IF(tmpIdx < 0 .OR. ( iStep == 1 )) then + ! No ParaNOx dep flux for O3 + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_i) + + IF ( .NOT. ASSOCIATED(pbuf_i) ) THEN ! Sanity check + CALL ENDRUN("CESMGC_Emissions_Calc: FATAL - tmpIdx > 0 but pbuf_i not associated (2)") + ENDIF + + ! apply loss flux to surface (level nZ) + eflx(1:NY,nZ,id_O3) = eflx(1:NY,nZ,id_O3) - pbuf_i(1:nY) + + IF ( MINVAL(eflx(:nY,nZ,id_O3)) < 0.0e+00_r8 ) THEN + Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO sfc flux after ParaNOx is negative for O3 with value ", MINVAL(eflx(:nY,:nZ,id_O3)), " at ", & + MINLOC(eflx(:nY,nZ,id_O3)) + ENDIF + + IF ( rootChunk .and. ( MINVAL(pbuf_i(1:nY)) < 0.0e+0_r8 ) ) THEN + Write(iulog,'(a,a,a,a)') " CESMGC_Emissions_Calc: HEMCO dflx(paranox) O3 added to ", TRIM(cnst_name(id_O3)) + Write(iulog,'(a,a,E16.4)') " CESMGC_Emissions_Calc: Minval dflx(paranox), eflx(sfc) O3 ", MINVAL(pbuf_i(1:nY)), MINVAL(eflx(:nY,nZ,id_O3)) + ENDIF + + ! Reset pointers + pbuf_i => NULL() + pbuf_chnk => NULL() + ENDIF + + tmpIdx = pbuf_get_index('HCO_PAR_HNO3_DEP', RC) + IF(tmpIdx < 0 .OR. ( iStep == 1 )) then + ! No ParaNOx dep flux for HNO3 + ELSE + pbuf_chnk => pbuf_get_chunk(hco_pbuf2d, LCHNK) + CALL pbuf_get_field(pbuf_chnk, tmpIdx, pbuf_i) + + IF ( .NOT. ASSOCIATED(pbuf_i) ) THEN ! Sanity check + CALL ENDRUN("CESMGC_Emissions_Calc: FATAL - tmpIdx > 0 but pbuf_i not associated (3)") + ENDIF + + eflx(1:NY,nZ,id_HNO3) = eflx(1:NY,nZ,id_HNO3) - pbuf_i(1:nY) + + IF ( MINVAL(eflx(:nY,nZ,id_HNO3)) < 0.0e+00_r8 ) THEN + Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO sfc flux after ParaNOx is negative for HNO3 with value ", MINVAL(eflx(:nY,nZ,id_HNO3)), " at ", & + MINLOC(eflx(:nY,nZ,id_HNO3)) + ENDIF + + IF ( rootChunk .and. ( MINVAL(pbuf_i(1:nY)) < 0.0e+0_r8 ) ) THEN + Write(iulog,'(a,a,a,a)') " CESMGC_Emissions_Calc: HEMCO dflx(paranox) HNO3 added to ", TRIM(cnst_name(id_HNO3)) + Write(iulog,'(a,a,E16.4)') " CESMGC_Emissions_Calc: Minval dflx(paranox), eflx(sfc) HNO3 ", MINVAL(pbuf_i(1:nY)), MINVAL(eflx(:nY,nZ,id_HNO3)) + ENDIF + + ! Reset pointers + pbuf_i => NULL() + pbuf_chnk => NULL() + ENDIF + + #if defined( MODAL_AERO_4MODE ) !----------------------------------------------------------------------- ! Aerosol emissions (dust + seasalt) ... From 92a1ad99d4a945f2792cc7861722022a7bb4e2f8 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 23 Mar 2021 22:34:39 -0400 Subject: [PATCH 221/239] Feat: Revert mo_drydep to MOZART's version + Update chemistry.F90 (1) Note that most of the mo_drydep routines are unused. We only need to load in landtypes for MAM Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 17 +- src/chemistry/geoschem/mo_drydep.F90 | 3495 +------------------------- 2 files changed, 10 insertions(+), 3502 deletions(-) mode change 100644 => 120000 src/chemistry/geoschem/mo_drydep.F90 diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index d62680521a..4951eb2de1 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -942,14 +942,14 @@ subroutine chem_init(phys_state, pbuf2d) use Phys_Grid, only : get_Area_All_p use hycoef, only : ps0, hyai, hybi, hyam - use seq_drydep_mod, only : drydep_method, DD_XLND + use seq_drydep_mod, only : drydep_method, DD_XLND, DD_XATM use gas_wetdep_opts, only : gas_wetdep_method use mo_neu_wetdep, only : neu_wetdep_init #if defined( MODAL_AERO_4MODE ) use aero_model, only : aero_model_init use mo_setsox, only : sox_inti - use mo_drydep, only : drydep_inti_landuse + use mo_drydep, only : drydep_inti use modal_aero_data, only : ntot_amode, nspec_amode use modal_aero_data, only : xname_massptr #endif @@ -1476,13 +1476,14 @@ subroutine chem_init(phys_state, pbuf2d) CALL aero_model_init( pbuf2d ) ! Initialize land maps for aerosol dry deposition - IF ( drydep_method == DD_XLND ) THEN - CALL drydep_inti_landuse( depvel_lnd_file, & - clim_soilw_file ) + IF ( drydep_method == DD_XATM .OR. drydep_method == DD_XLND ) THEN + CALL drydep_inti( depvel_lnd_file, & + clim_soilw_file, & + season_wes_file ) ELSE - Write(iulog,'(a,a)') ' drydep_method is set to: ', TRIM(drydep_method) - CALL ENDRUN('drydep_method must be DD_XLND to compute land maps for aerosol' // & - ' dry deposition!') + IF ( masterProc ) Write(iulog,'(a,a)') ' drydep_method is set to: ', TRIM(drydep_method) + CALL ENDRUN('drydep_method must be DD_XLND or DD_XATM to compute land '// & + 'maps for aerosol dry deposition!') ENDIF #endif diff --git a/src/chemistry/geoschem/mo_drydep.F90 b/src/chemistry/geoschem/mo_drydep.F90 deleted file mode 100644 index 66f4b122f0..0000000000 --- a/src/chemistry/geoschem/mo_drydep.F90 +++ /dev/null @@ -1,3494 +0,0 @@ -module mo_drydep - - !--------------------------------------------------------------------- - ! ... Dry deposition velocity input data and code for netcdf input - !--------------------------------------------------------------------- - -!LKE (10/11/2010): added HCN, CH3CN, HCOOH -!LKE (7/30/2015): added new TS1 species (phenooh, iepox, noa, etc.) - - use shr_kind_mod, only : r8 => shr_kind_r8, shr_kind_cl - !use chem_mods, only : gas_pcnst !This needs to be replaced by nTracersMax - use pmgrid, only : plev, plevp - use spmd_utils, only : masterproc, iam - use ppgrid, only : pcols, begchunk, endchunk - !use mo_tracname, only : solsym !This is replaced by tracerNames - use chem_mods, only : tracerNames, nTracersMax, nTracers, drySpc_ndx - use cam_abortutils, only : endrun - use ioFileMod, only : getfil - use pio - use cam_pio_utils, only : cam_pio_openfile, cam_pio_closefile - use cam_logfile, only : iulog - use dyn_grid, only : get_dyn_grid_parm, get_horiz_grid_d - use scamMod, only : single_column - - use seq_drydep_mod, only : nddvels => n_drydep, drydep_list, mapping - use physconst, only : karman - - use State_Chm_Mod, only : ChmState ! Derived type for Chemistry State object - - implicit none - - save - - interface drydep_inti - module procedure dvel_inti_table - module procedure dvel_inti_xactive - module procedure dvel_inti_fromlnd - end interface - - interface drydep_inti_landuse - module procedure dvel_inti_xactive_landuse - end interface - - interface drydep - !module procedure drydep_table - module procedure drydep_xactive - module procedure drydep_fromlnd - end interface - - private - public :: drydep_inti, drydep, set_soilw, chk_soilw, has_drydep - public :: drydep_inti_landuse - public :: drydep_update - public :: drydep_fromlnd - public :: n_land_type, fraction_landuse, drydep_srf_file - - real(r8) :: dels - real(r8), allocatable :: days(:) ! day of year for soilw - real(r8), allocatable :: dvel(:,:,:,:) ! depvel array interpolated to model grid - real(r8), allocatable :: dvel_interp(:,:,:) ! depvel array interpolated to grid and time - integer :: last, next ! day indicies - integer :: ndays ! # of days in soilw file - !integer :: map(gas_pcnst) ! indices for drydep species - integer :: map(nTracersMax) ! indices for drydep species - integer :: nspecies ! number of depvel species in input file - - integer :: pan_ndx, mpan_ndx, no2_ndx, hno3_ndx, o3_ndx, & - h2o2_ndx, onit_ndx, onitr_ndx, ch4_ndx, ch2o_ndx, & - ch3ooh_ndx, pooh_ndx, ch3coooh_ndx, c2h5ooh_ndx, eooh_ndx, & - c3h7ooh_ndx, rooh_ndx, ch3cocho_ndx, co_ndx, ch3coch3_ndx, & - no_ndx, ho2no2_ndx, glyald_ndx, hyac_ndx, ch3oh_ndx, c2h5oh_ndx, & - hydrald_ndx, h2_ndx, Pb_ndx, o3s_ndx, o3inert_ndx, macrooh_ndx, & - xooh_ndx, ch3cho_ndx, isopooh_ndx - integer :: alkooh_ndx, mekooh_ndx, tolooh_ndx, terpooh_ndx, ch3cooh_ndx - integer :: soa_ndx, so4_ndx, cb1_ndx, cb2_ndx, oc1_ndx, oc2_ndx, nh3_ndx, nh4no3_ndx, & - sa1_ndx, sa2_ndx, sa3_ndx, sa4_ndx, nh4_ndx - integer :: soam_ndx, soai_ndx, soat_ndx, soab_ndx, soax_ndx, & - sogm_ndx, sogi_ndx, sogt_ndx, sogb_ndx, sogx_ndx - - logical :: alkooh_dd, mekooh_dd, tolooh_dd, terpooh_dd, ch3cooh_dd - logical :: soa_dd, so4_dd, cb1_dd, cb2_dd, oc1_dd, oc2_dd, nh3_dd, nh4no3_dd, & - sa1_dd, sa2_dd, sa3_dd, sa4_dd, nh4_dd - logical :: soam_dd, soai_dd, soat_dd, soab_dd, soax_dd, & - sogm_dd, sogi_dd, sogt_dd, sogb_dd, sogx_dd - - logical :: pan_dd, mpan_dd, no2_dd, hno3_dd, o3_dd, isopooh_dd, ch4_dd,& - h2o2_dd, onit_dd, onitr_dd, ch2o_dd, macrooh_dd, xooh_dd, & - ch3ooh_dd, pooh_dd, ch3coooh_dd, c2h5ooh_dd, eooh_dd, ch3cho_dd, c2h5oh_dd, & - c3h7ooh_dd, rooh_dd, ch3cocho_dd, co_dd, ch3coch3_dd, & - glyald_dd, hyac_dd, ch3oh_dd, hydrald_dd, h2_dd, Pb_dd, o3s_dd, o3inert_dd - - integer :: so2_ndx - integer :: ch3cn_ndx, hcn_ndx, hcooh_ndx - logical :: ch3cn_dd, hcn_dd, hcooh_dd - - integer :: o3a_ndx,xpan_ndx,xmpan_ndx,xno2_ndx,xhno3_ndx,xonit_ndx,xonitr_ndx,xno_ndx,xho2no2_ndx,xnh4no3_ndx - logical :: o3a_dd, xpan_dd, xmpan_dd, xno2_dd, xhno3_dd, xonit_dd, xonitr_dd, xno_dd, xho2no2_dd, xnh4no3_dd - -!lke-TS1 - integer :: phenooh_ndx, benzooh_ndx, c6h5ooh_ndx, bzooh_ndx, xylolooh_ndx, xylenooh_ndx - integer :: terp2ooh_ndx, terprod1_ndx, terprod2_ndx, hmprop_ndx, mboooh_ndx, hpald_ndx, iepox_ndx - integer :: noa_ndx, alknit_ndx, isopnita_ndx, isopnitb_ndx, honitr_ndx, isopnooh_ndx - integer :: nc4cho_ndx, nc4ch2oh_ndx, terpnit_ndx, nterpooh_ndx - logical :: phenooh_dd, benzooh_dd, c6h5ooh_dd, bzooh_dd, xylolooh_dd, xylenooh_dd - logical :: terp2ooh_dd, terprod1_dd, terprod2_dd, hmprop_dd, mboooh_dd, hpald_dd, iepox_dd - logical :: noa_dd, alknit_dd, isopnita_dd, isopnitb_dd, honitr_dd, isopnooh_dd - logical :: nc4cho_dd, nc4ch2oh_dd, terpnit_dd, nterpooh_dd - - integer :: cohc_ndx=-1, come_ndx=-1 - integer, parameter :: NTAGS = 50 - integer :: cotag_ndx(NTAGS) - integer :: tag_cnt - - integer :: & - o3_tab_ndx = -1, & - h2o2_tab_ndx = -1, & - ch3ooh_tab_ndx = -1, & - co_tab_ndx = -1, & - ch3cho_tab_ndx = -1 - logical :: & - o3_in_tab = .false., & - h2o2_in_tab = .false., & - ch3ooh_in_tab = .false., & - co_in_tab = .false., & - ch3cho_in_tab = .false. - - real(r8), parameter :: small_value = 1.e-36_r8 - real(r8), parameter :: large_value = 1.e36_r8 - real(r8), parameter :: diffm = 1.789e-5_r8 - real(r8), parameter :: diffk = 1.461e-5_r8 - real(r8), parameter :: difft = 2.060e-5_r8 - real(r8), parameter :: vonkar = karman - real(r8), parameter :: ric = 0.2_r8 - real(r8), parameter :: r = 287.04_r8 - real(r8), parameter :: cp = 1004._r8 - real(r8), parameter :: grav = 9.81_r8 - real(r8), parameter :: p00 = 100000._r8 - real(r8), parameter :: wh2o = 18.0153_r8 - real(r8), parameter :: ph = 1.e-5_r8 - real(r8), parameter :: ph_inv = 1._r8/ph - real(r8), parameter :: rovcp = r/cp - - integer, pointer :: index_season_lai(:,:) - - !logical, public :: has_dvel(gas_pcnst) = .false. - !integer :: map_dvel(gas_pcnst) = 0 - logical, public :: has_dvel(nTracersMax) = .false. - integer :: map_dvel(nTracersMax) = 0 - real(r8) , allocatable :: soilw_3d(:,:,:) - - logical, parameter :: dyn_soilw = .false. - - real(r8), allocatable :: fraction_landuse(:,:,:) - real(r8), allocatable, dimension(:,:,:) :: dep_ra ! [s/m] aerodynamic resistance - real(r8), allocatable, dimension(:,:,:) :: dep_rb ! [s/m] resistance across sublayer - integer, parameter :: n_land_type = 11 - - real(r8), public :: crb - - type lnd_dvel_type - real(r8), pointer :: dvel(:,:) ! deposition velocity over land (cm/s) - end type lnd_dvel_type - - type(lnd_dvel_type), allocatable :: lnd(:) - character(len=SHR_KIND_CL) :: drydep_srf_file - -contains - - !--------------------------------------------------------------------------- - !--------------------------------------------------------------------------- - subroutine dvel_inti_fromlnd - use cam_abortutils, only : endrun - use seq_drydep_mod, only : dfoxd - - implicit none - - allocate( lnd(begchunk:endchunk) ) - - crb = (difft/diffm)**(2._r8/3._r8) !.666666_r8 - - endsubroutine dvel_inti_fromlnd - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - subroutine drydep_update( state, cam_in ) - use physics_types, only : physics_state - use camsrfexch, only : cam_in_t - use seq_drydep_mod, only : drydep_method, DD_XLND - - type(physics_state), intent(in) :: state ! Physics state variables - type(cam_in_t), intent(in) :: cam_in - integer :: ispec - - if (nddvels<1) return - if (drydep_method /= DD_XLND) return - - lnd(state%lchnk)%dvel => cam_in%depvel - - end subroutine drydep_update - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - subroutine drydep_fromlnd( ocnfrac, icefrac, ncdate, sfc_temp, pressure_sfc, & - wind_speed, spec_hum, air_temp, pressure_10m, rain, & - snow, solar_flux, dvelocity, dflx, State_Chm, & - tv, soilw, rh, ncol, lonndx, latndx, lchnk ) - - !------------------------------------------------------------------------------------- - ! combines the deposition velocities provided by the land model with deposition - ! velocities over ocean and sea ice - !------------------------------------------------------------------------------------- - - use ppgrid, only : pcols - -#if (defined OFFLINE_DYN) - use metdata, only: get_met_fields -#endif - - implicit none - - !------------------------------------------------------------------------------------- - ! ... dummy arguments - !------------------------------------------------------------------------------------- - - real(r8), intent(in) :: icefrac(pcols) - real(r8), intent(in) :: ocnfrac(pcols) - - integer, intent(in) :: ncol - integer, intent(in) :: ncdate ! present date (yyyymmdd) - real(r8), intent(in) :: sfc_temp(pcols) ! surface temperature (K) - real(r8), intent(in) :: pressure_sfc(pcols) ! surface pressure (Pa) - real(r8), intent(in) :: wind_speed(pcols) ! 10 meter wind speed (m/s) - real(r8), intent(in) :: spec_hum(pcols) ! specific humidity (kg/kg) - real(r8), intent(in) :: rh(ncol,1) ! relative humidity - real(r8), intent(in) :: air_temp(pcols) ! surface air temperature (K) - real(r8), intent(in) :: pressure_10m(pcols) ! 10 meter pressure (Pa) - real(r8), intent(in) :: rain(pcols) - real(r8), intent(in) :: snow(pcols) ! snow height (m) - real(r8), intent(in) :: soilw(pcols) ! soil moisture fraction - real(r8), intent(in) :: solar_flux(pcols) ! direct shortwave radiation at surface (W/m^2) - real(r8), intent(in) :: tv(pcols) ! potential temperature - type(ChmState), intent(in):: State_Chm ! GEOS-Chem State Chem - real(r8), intent(out) :: dvelocity(ncol,nTracersMax) ! deposition velocity (cm/s) - real(r8), intent(inout) :: dflx(pcols,nTracersMax) ! deposition flux (/cm^2/s) - - integer, intent(in) :: latndx(pcols) ! chunk latitude indicies - integer, intent(in) :: lonndx(pcols) ! chunk longitude indicies - integer, intent(in) :: lchnk ! chunk number - - !------------------------------------------------------------------------------------- - ! ... local variables - !------------------------------------------------------------------------------------- - real(r8) :: ocnice_dvel(ncol,nTracersMax) - real(r8) :: ocnice_dflx(pcols,nTracersMax) - - real(r8), dimension(ncol) :: term ! work array - integer :: ispec - real(r8) :: lndfrac(pcols) -#if (defined OFFLINE_DYN) - real(r8) :: met_ocnfrac(pcols) - real(r8) :: met_icefrac(pcols) -#endif - integer :: i - - lndfrac(:ncol) = 1._r8 - ocnfrac(:ncol) - icefrac(:ncol) - - where( lndfrac(:ncol) < 0._r8 ) - lndfrac(:ncol) = 0._r8 - endwhere - -#if (defined OFFLINE_DYN) - call get_met_fields(lndfrac, met_ocnfrac, met_icefrac, lchnk, ncol) -#endif - - !------------------------------------------------------------------------------------- - ! ... initialize - !------------------------------------------------------------------------------------- - dvelocity(:,:) = 0._r8 - - !------------------------------------------------------------------------------------- - ! ... compute the dep velocities over ocean and sea ice - ! land type 7 is used for ocean - ! land type 8 is used for sea ice - !------------------------------------------------------------------------------------- - call drydep_xactive( ncdate, sfc_temp, pressure_sfc, & - wind_speed, spec_hum, air_temp, pressure_10m, rain, & - snow, solar_flux, ocnice_dvel, ocnice_dflx, & - State_Chm, tv, soilw, & - rh, ncol, lonndx, latndx, lchnk, & -#if (defined OFFLINE_DYN) - ocnfrc=met_ocnfrac,icefrc=met_icefrac, beglandtype=7, endlandtype=8 ) -#else - ocnfrc=ocnfrac,icefrc=icefrac, beglandtype=7, endlandtype=8 ) -#endif - term(:ncol) = 1.e-2_r8 * pressure_10m(:ncol) / (r*tv(:ncol)) - - do ispec = 1, nddvels - !------------------------------------------------------------------------------------- - ! ... merge the land component with the non-land component - ! ocn and ice already have fractions factored in - !------------------------------------------------------------------------------------- - if ( drySpc_ndx(ispec) > 0 ) then - !Write(6,*) " Spec = ", drydep_list(iSpec), lchnk - !Write(6,*) " lndfrac = ", MAXVAL(lndfrac(:)), lchnk - !Write(6,*) " lndfrac = ", MINVAL(lndfrac(:)), lchnk - !Write(6,*) " lndvel = ", MAXVAL(lnd(lchnk)%dvel(:,iSpec)), " [cm/s]", lchnk - !Write(6,*) " ocnvel = ", MAXVAL(ocnice_dvel(:,drySpc_ndx(iSpec))), " [cm/s]", lchnk - dvelocity(:ncol,drySpc_ndx(ispec)) = lnd(lchnk)%dvel(:ncol,ispec)*lndfrac(:ncol) & - + ocnice_dvel(:ncol,drySpc_ndx(ispec)) - !Write(6,*) " dvel = ", MAXVAL(dvelocity(:,drySpc_ndx(iSpec))), " [cm/s]", lchnk - endif - enddo - - !------------------------------------------------------------------------------------- - ! ... special adjustments - !------------------------------------------------------------------------------------- - if( mpan_ndx>0 ) then - dvelocity(:ncol,mpan_ndx) = dvelocity(:ncol,mpan_ndx)/3._r8 - endif - if( xmpan_ndx>0 ) then - dvelocity(:ncol,xmpan_ndx) = dvelocity(:ncol,xmpan_ndx)/3._r8 - endif - if( hcn_ndx>0 ) then - dvelocity(:ncol,hcn_ndx) = ocnice_dvel(:ncol,hcn_ndx) ! should be zero over land - endif - if( ch3cn_ndx>0 ) then - dvelocity(:ncol,ch3cn_ndx) = ocnice_dvel(:ncol,ch3cn_ndx) ! should be zero over land - endif - - ! HCOOH, use CH3COOH dep.vel - if( hcooh_ndx > 0 .and. ch3cooh_ndx > 0 ) then - if( has_dvel(hcooh_ndx) ) then - dvelocity(:ncol,hcooh_ndx) = dvelocity(:ncol,ch3cooh_ndx) - end if - end if - - !------------------------------------------------------------------------------------- - ! ... assign CO tags to CO - ! put this kludge in for now ... - ! -- should be able to set all these via the table mapping in seq_drydep_mod - !------------------------------------------------------------------------------------- - if( cohc_ndx>0 .and. co_ndx>0 ) then - dvelocity(:ncol,cohc_ndx) = dvelocity(:ncol,co_ndx) - dflx(:ncol,cohc_ndx) = dvelocity(:ncol,co_ndx) * term(:ncol) * State_Chm%Species(1,:ncol,plev,cohc_ndx) - endif - if( come_ndx>0 .and. co_ndx>0 ) then - dvelocity(:ncol,come_ndx) = dvelocity(:ncol,co_ndx) - dflx(:ncol,come_ndx) = dvelocity(:ncol,co_ndx) * term(:ncol) * State_Chm%Species(1,:ncol,plev,come_ndx) - endif - - if ( co_ndx>0 ) then - do i=1,tag_cnt - dvelocity(:ncol,cotag_ndx(i)) = dvelocity(:ncol,co_ndx) - dflx(:ncol,cotag_ndx(i)) = dvelocity(:ncol,co_ndx) * term(:ncol) * State_Chm%Species(1,:ncol,plev,cotag_ndx(i)) - enddo - endif - - do ispec = 1,nddvels - !------------------------------------------------------------------------------------- - ! ... compute the deposition flux - !------------------------------------------------------------------------------------- - if ( drySpc_ndx(ispec) > 0 ) then - dflx(:ncol,drySpc_ndx(ispec)) = dvelocity(:ncol,drySpc_ndx(ispec)) * term(:ncol) * State_Chm%Species(1,:ncol,plev,drySpc_ndx(ispec)) - endif - end do - - end subroutine drydep_fromlnd - - !--------------------------------------------------------------------------- - !--------------------------------------------------------------------------- - subroutine dvel_inti_table( depvel_file ) - !--------------------------------------------------------------------------- - ! ... Initialize module, depvel arrays, and a few other variables. - ! The depvel fields will be linearly interpolated to the correct time - !--------------------------------------------------------------------------- - - use mo_constants, only : d2r, r2d - use ioFileMod, only : getfil - use string_utils, only : to_lower, GLC - use mo_chem_utls, only : get_spc_ndx - use constituents, only : pcnst - use chem_mods, only : drySpc_ndx - use interpolate_data, only : lininterp_init, lininterp, lininterp_finish,interp_type - use mo_constants, only : pi - use phys_grid, only : get_ncols_p, get_rlat_all_p, get_rlon_all_p - - implicit none - - character(len=*), intent(in) :: depvel_file - - !--------------------------------------------------------------------------- - ! ... Local variables - !--------------------------------------------------------------------------- - integer :: nlat, nlon, nmonth, ndims - integer :: dimid_lat, dimid_lon, dimid_species, dimid_time - integer :: dimid(4), count(4), start(4) - integer :: m, ispecies, nchar, ierr - real(r8) :: scale_factor - - real(r8), allocatable :: dvel_lats(:), dvel_lons(:) - real(r8), allocatable :: dvel_in(:,:,:,:) ! input depvel array - character(len=50) :: units - character(len=20), allocatable :: species_names(:) ! names of depvel species - logical :: found - type(file_desc_t) :: piofile - type(var_desc_t) :: vid, vid_dvel - - character(len=shr_kind_cl) :: locfn - integer :: mm,n - - integer :: i, c, ncols - real(r8) :: to_lats(pcols), to_lons(pcols) - type(interp_type) :: lon_wgts, lat_wgts - real(r8), parameter :: zero=0._r8, twopi=2._r8*pi - - mm = 1 - do m = 1,pcnst - if ( len_trim(drydep_list(m))==0 ) exit - n = drySpc_ndx(m) - !n = get_spc_ndx(drydep_list(m)) - if ( n < 1 ) then - write(iulog,*) 'drydep_inti: '//drydep_list(m)//' is not included in species set' - call endrun('drydep_init: invalid dry deposition species') - endif - enddo - - if( masterproc ) then - write(iulog,*) 'drydep_inti: following species have dry deposition' - do i=1,nddvels - if( len_trim(drydep_list(i)) > 0 ) then - write(iulog,*) 'drydep_inti: '//trim(drydep_list(i))//' is requested to have dry dep' - endif - enddo - write(iulog,*) 'drydep_inti:' - endif - - if ( nddvels < 1 ) return - - !--------------------------------------------------------------------------- - ! ... Setup species maps - !--------------------------------------------------------------------------- - o3a_ndx = get_spc_ndx( 'O3A') - xpan_ndx = get_spc_ndx( 'XPAN') - xmpan_ndx = get_spc_ndx( 'XMPAN') - xno2_ndx = get_spc_ndx( 'XNO2') - xhno3_ndx = get_spc_ndx( 'XHNO3') - xonit_ndx = get_spc_ndx( 'XONIT') - xonitr_ndx = get_spc_ndx( 'XONITR') - xno_ndx = get_spc_ndx( 'XNO') - xho2no2_ndx = get_spc_ndx( 'XHO2NO2') - o3a_dd = has_drydep( 'O3A') - xpan_dd = has_drydep( 'XPAN') - xmpan_dd = has_drydep( 'XMPAN') - xno2_dd = has_drydep( 'XNO2') - xhno3_dd = has_drydep( 'XHNO3') - xonit_dd = has_drydep( 'XONIT') - xonitr_dd = has_drydep( 'XONITR') - xno_dd = has_drydep( 'XNO') - xho2no2_dd = has_drydep( 'XHO2NO2') - - pan_ndx = get_spc_ndx( 'PAN') - mpan_ndx = get_spc_ndx( 'MPAN') - no2_ndx = get_spc_ndx( 'NO2') - hno3_ndx = get_spc_ndx( 'HNO3') - co_ndx = get_spc_ndx( 'CO') - o3_ndx = get_spc_ndx( 'O3') - if( o3_ndx < 1 ) then - o3_ndx = get_spc_ndx( 'OX') - end if - h2o2_ndx = get_spc_ndx( 'H2O2') - onit_ndx = get_spc_ndx( 'ONIT') - onitr_ndx = get_spc_ndx( 'ONITR') - ch4_ndx = get_spc_ndx( 'CH4') - ch2o_ndx = get_spc_ndx( 'CH2O') - ch3ooh_ndx = get_spc_ndx( 'CH3OOH') - ch3cho_ndx = get_spc_ndx( 'CH3CHO') - ch3cocho_ndx = get_spc_ndx( 'CH3COCHO') - pooh_ndx = get_spc_ndx( 'POOH') - ch3coooh_ndx = get_spc_ndx( 'CH3COOOH') - c2h5ooh_ndx = get_spc_ndx( 'C2H5OOH') - eooh_ndx = get_spc_ndx( 'EOOH') - c3h7ooh_ndx = get_spc_ndx( 'C3H7OOH') - rooh_ndx = get_spc_ndx( 'ROOH') - ch3coch3_ndx = get_spc_ndx( 'CH3COCH3') - no_ndx = get_spc_ndx( 'NO') - ho2no2_ndx = get_spc_ndx( 'HO2NO2') - glyald_ndx = get_spc_ndx( 'GLYALD') - hyac_ndx = get_spc_ndx( 'HYAC') - ch3oh_ndx = get_spc_ndx( 'CH3OH') - c2h5oh_ndx = get_spc_ndx( 'C2H5OH') - macrooh_ndx = get_spc_ndx( 'MACROOH') - isopooh_ndx = get_spc_ndx( 'ISOPOOH') - xooh_ndx = get_spc_ndx( 'XOOH') - hydrald_ndx = get_spc_ndx( 'HYDRALD') - h2_ndx = get_spc_ndx( 'H2') - Pb_ndx = get_spc_ndx( 'Pb') - o3s_ndx = get_spc_ndx( 'O3S') - o3inert_ndx = get_spc_ndx( 'O3INERT') - alkooh_ndx = get_spc_ndx( 'ALKOOH') - mekooh_ndx = get_spc_ndx( 'MEKOOH') - tolooh_ndx = get_spc_ndx( 'TOLOOH') - terpooh_ndx = get_spc_ndx( 'TERPOOH') - ch3cooh_ndx = get_spc_ndx( 'CH3COOH') - soam_ndx = get_spc_ndx( 'SOAM' ) - soai_ndx = get_spc_ndx( 'SOAI' ) - soat_ndx = get_spc_ndx( 'SOAT' ) - soab_ndx = get_spc_ndx( 'SOAB' ) - soax_ndx = get_spc_ndx( 'SOAX' ) - sogm_ndx = get_spc_ndx( 'SOGM' ) - sogi_ndx = get_spc_ndx( 'SOGI' ) - sogt_ndx = get_spc_ndx( 'SOGT' ) - sogb_ndx = get_spc_ndx( 'SOGB' ) - sogx_ndx = get_spc_ndx( 'SOGX' ) - soa_ndx = get_spc_ndx( 'SOA' ) - so4_ndx = get_spc_ndx( 'SO4' ) - cb1_ndx = get_spc_ndx( 'CB1' ) - cb2_ndx = get_spc_ndx( 'CB2' ) - oc1_ndx = get_spc_ndx( 'OC1' ) - oc2_ndx = get_spc_ndx( 'OC2' ) - nh3_ndx = get_spc_ndx( 'NH3' ) - nh4no3_ndx = get_spc_ndx( 'NH4NO3' ) - xnh4no3_ndx = get_spc_ndx( 'XNH4NO3' ) - sa1_ndx = get_spc_ndx( 'SA1' ) - sa2_ndx = get_spc_ndx( 'SA2' ) - sa3_ndx = get_spc_ndx( 'SA3' ) - sa4_ndx = get_spc_ndx( 'SA4' ) - nh4_ndx = get_spc_ndx( 'NH4' ) - alkooh_dd = has_drydep( 'ALKOOH') - mekooh_dd = has_drydep( 'MEKOOH') - tolooh_dd = has_drydep( 'TOLOOH') - terpooh_dd = has_drydep( 'TERPOOH') - ch3cooh_dd = has_drydep( 'CH3COOH') - soam_dd = has_drydep( 'SOAM' ) - soai_dd = has_drydep( 'SOAI' ) - soat_dd = has_drydep( 'SOAT' ) - soab_dd = has_drydep( 'SOAB' ) - soax_dd = has_drydep( 'SOAX' ) - sogm_dd = has_drydep( 'SOGM' ) - sogi_dd = has_drydep( 'SOGI' ) - sogt_dd = has_drydep( 'SOGT' ) - sogb_dd = has_drydep( 'SOGB' ) - sogx_dd = has_drydep( 'SOGX' ) - soa_dd = has_drydep( 'SOA' ) - so4_dd = has_drydep( 'SO4' ) - cb1_dd = has_drydep( 'CB1' ) - cb2_dd = has_drydep( 'CB2' ) - oc1_dd = has_drydep( 'OC1' ) - oc2_dd = has_drydep( 'OC2' ) - nh3_dd = has_drydep( 'NH3' ) - nh4no3_dd = has_drydep( 'NH4NO3' ) - xnh4no3_dd = has_drydep( 'XNH4NO3' ) - sa1_dd = has_drydep( 'SA1' ) - sa2_dd = has_drydep( 'SA2' ) - sa3_dd = has_drydep( 'SA3' ) - sa4_dd = has_drydep( 'SA4' ) - nh4_dd = has_drydep( 'NH4' ) - pan_dd = has_drydep( 'PAN') - mpan_dd = has_drydep( 'MPAN') - no2_dd = has_drydep( 'NO2') - hno3_dd = has_drydep( 'HNO3') - co_dd = has_drydep( 'CO') - o3_dd = has_drydep( 'O3') - if( .not. o3_dd ) then - o3_dd = has_drydep( 'OX') - end if - h2o2_dd = has_drydep( 'H2O2') - onit_dd = has_drydep( 'ONIT') - onitr_dd = has_drydep( 'ONITR') - ch4_dd = has_drydep( 'CH4') - ch2o_dd = has_drydep( 'CH2O') - ch3ooh_dd = has_drydep( 'CH3OOH') - ch3cho_dd = has_drydep( 'CH3CHO') - c2h5oh_dd = has_drydep( 'C2H5OH') - eooh_dd = has_drydep( 'EOOH') - ch3cocho_dd = has_drydep( 'CH3COCHO') - pooh_dd = has_drydep( 'POOH') - ch3coooh_dd = has_drydep( 'CH3COOOH') - c2h5ooh_dd = has_drydep( 'C2H5OOH') - c3h7ooh_dd = has_drydep( 'C3H7OOH') - rooh_dd = has_drydep( 'ROOH') - ch3coch3_dd = has_drydep( 'CH3COCH3') - glyald_dd = has_drydep( 'GLYALD') - hyac_dd = has_drydep( 'HYAC') - ch3oh_dd = has_drydep( 'CH3OH') - macrooh_dd = has_drydep( 'MACROOH') - isopooh_dd = has_drydep( 'ISOPOOH') - xooh_dd = has_drydep( 'XOOH') - hydrald_dd = has_drydep( 'HYDRALD') - h2_dd = has_drydep( 'H2') - Pb_dd = has_drydep( 'Pb') - o3s_dd = has_drydep( 'O3S') - o3inert_dd = has_drydep( 'O3INERT') - ch3cn_dd = has_drydep( 'CH3CN') - hcn_dd = has_drydep( 'HCN') - hcooh_dd = has_drydep( 'HCOOH') - ch3cn_ndx = get_spc_ndx( 'CH3CN') - hcn_ndx = get_spc_ndx( 'HCN') - hcooh_ndx = get_spc_ndx( 'HCOOH' ) - - if( masterproc ) then - write(iulog,*) 'dvel_inti: diagnostics' - write(iulog,'(10i5)') pan_ndx, mpan_ndx, no2_ndx, hno3_ndx, o3_ndx, & - h2o2_ndx, onit_ndx, onitr_ndx, ch4_ndx, ch2o_ndx, & - ch3ooh_ndx, pooh_ndx, ch3coooh_ndx, c2h5ooh_ndx, eooh_ndx, & - c3h7ooh_ndx, rooh_ndx, ch3cocho_ndx, co_ndx, ch3coch3_ndx, & - no_ndx, ho2no2_ndx, glyald_ndx, hyac_ndx, ch3oh_ndx, c2h5oh_ndx, & - hydrald_ndx, h2_ndx, Pb_ndx, o3s_ndx, o3inert_ndx, macrooh_ndx, & - xooh_ndx, ch3cho_ndx, isopooh_ndx, noa_ndx, alknit_ndx, isopnita_ndx, & - honitr_ndx, isopnooh_ndx, nc4cho_ndx, nc4ch2oh_ndx, terpnit_ndx, nterpooh_ndx - write(iulog,*) pan_dd, mpan_dd, no2_dd, hno3_dd, o3_dd, isopooh_dd, ch4_dd,& - h2o2_dd, onit_dd, onitr_dd, ch2o_dd, macrooh_dd, xooh_dd, & - ch3ooh_dd, pooh_dd, ch3coooh_dd, c2h5ooh_dd, eooh_dd, ch3cho_dd, c2h5oh_dd, & - c3h7ooh_dd, rooh_dd, ch3cocho_dd, co_dd, ch3coch3_dd, & - glyald_dd, hyac_dd, ch3oh_dd, hydrald_dd, h2_dd, Pb_dd, o3s_dd, o3inert_dd, & - noa_dd, alknit_dd, isopnita_dd, & - honitr_dd, isopnooh_dd, nc4cho_dd, nc4ch2oh_dd, terpnit_dd, nterpooh_dd - endif - !--------------------------------------------------------------------------- - ! ... Open NetCDF file - !--------------------------------------------------------------------------- - call getfil (depvel_file, locfn, 0) - call cam_pio_openfile (piofile, trim(locfn), PIO_NOWRITE) - - !--------------------------------------------------------------------------- - ! ... Get variable ID for dep vel array - !--------------------------------------------------------------------------- - ierr = pio_inq_varid( piofile, 'dvel', vid_dvel ) - - !--------------------------------------------------------------------------- - ! ... Inquire about dimensions - !--------------------------------------------------------------------------- - ierr = pio_inq_dimid( piofile, 'lon', dimid_lon ) - ierr = pio_inq_dimlen( piofile, dimid_lon, nlon ) - ierr = pio_inq_dimid( piofile, 'lat', dimid_lat ) - ierr = pio_inq_dimlen( piofile, dimid_lat, nlat ) - ierr = pio_inq_dimid( piofile, 'species', dimid_species ) - ierr = pio_inq_dimlen( piofile, dimid_species, nspecies ) - ierr = pio_inq_dimid( piofile, 'time', dimid_time ) - ierr = pio_inq_dimlen( piofile, dimid_time, nmonth ) - if(masterproc) write(iulog,*) 'dvel_inti: dimensions (nlon,nlat,nspecies,nmonth) = ',nlon,nlat,nspecies,nmonth - - !--------------------------------------------------------------------------- - ! ... Check dimensions of dvel variable. Must be (lon, lat, species, month). - !--------------------------------------------------------------------------- - ierr = pio_inq_varndims( piofile, vid_dvel, ndims ) - - if( masterproc .and. ndims /= 4 ) then - write(iulog,*) 'dvel_inti: dvel has ',ndims,' dimensions. Expecting 4.' - call endrun - end if - ierr = pio_inq_vardimid( piofile, vid_dvel, dimid ) - - if( dimid(1) /= dimid_lon .or. dimid(2) /= dimid_lat .or. & - dimid(3) /= dimid_species .or. dimid(4) /= dimid_time ) then - write(iulog,*) 'dvel_inti: Dimensions in wrong order for dvel' - write(iulog,*) '... Expecting (lon, lat, species, month)' - call endrun - end if - - !--------------------------------------------------------------------------- - ! ... Allocate depvel lats, lons and read - !--------------------------------------------------------------------------- - allocate( dvel_lats(nlat), stat=ierr ) - if( ierr /= 0 ) then - write(iulog,*) 'dvel_inti: Failed to allocate dvel_lats vector' - call endrun - end if - allocate( dvel_lons(nlon), stat=ierr ) - if( ierr /= 0 ) then - write(iulog,*) 'dvel_inti: Failed to allocate dvel_lons vector' - call endrun - end if - - ierr = pio_inq_varid( piofile, 'lat', vid ) - ierr = pio_get_var( piofile, vid, dvel_lats ) - ierr = pio_inq_varid( piofile, 'lon', vid ) - ierr = pio_get_var( piofile, vid, dvel_lons ) - - !--------------------------------------------------------------------------- - ! ... Set the transform from inputs lats to simulation lats - !--------------------------------------------------------------------------- - dvel_lats(:nlat) = d2r * dvel_lats(:nlat) - dvel_lons(:nlon) = d2r * dvel_lons(:nlon) - - !--------------------------------------------------------------------------- - ! ... Allocate dvel and read data from file - !--------------------------------------------------------------------------- - allocate( dvel_in(nlon, nlat ,nspecies, nmonth), stat=ierr ) - if( ierr /= 0 ) then - write(iulog,*) 'dvel_inti: Failed to allocate dvel_in' - call endrun - end if - start = (/ 1, 1, 1, 1 /) - count = (/ nlon, nlat, nspecies, nmonth /) - - ierr = pio_get_var( piofile, vid_dvel, start, count, dvel_in ) - - - !--------------------------------------------------------------------------- - ! ... Check units of deposition velocity. If necessary, convert to cm/s. - !--------------------------------------------------------------------------- - units(:) = ' ' - ierr = pio_get_att( piofile, vid_dvel, 'units', units ) - if( to_lower(trim(units(:GLC(units)))) == 'm/s' ) then -#ifdef DEBUG - if(masterproc) write(iulog,*) 'dvel_inti: depvel units = m/s. Converting to cm/s' -#endif - scale_factor = 100._r8 - elseif( to_lower(trim(units(:GLC(units)))) == 'cm/s' ) then -#ifdef DEBUG - if(masterproc) write(iulog,*) 'dvel_inti: depvel units = cm/s' -#endif - scale_factor = 1._r8 - else -#ifdef DEBUG - if(masterproc) then - write(iulog,*) 'dvel_inti: Warning! depvel units unknown = ', to_lower(trim(units)) - write(iulog,*) ' ... proceeding with scale_factor=1' - end if -#endif - scale_factor = 1._r8 - end if - - dvel_in(:,:,:,:) = scale_factor*dvel_in(:,:,:,:) - - !--------------------------------------------------------------------------- - ! ... Regrid deposition velocities - !--------------------------------------------------------------------------- - allocate( dvel(pcols,begchunk:endchunk,nspecies,nmonth),stat=ierr ) - if( ierr /= 0 ) then - write(iulog,*) 'dvel_inti: Failed to allocate dvel' - call endrun - end if - - do c=begchunk,endchunk - ncols = get_ncols_p(c) - call get_rlat_all_p(c, pcols, to_lats) - call get_rlon_all_p(c, pcols, to_lons) - call lininterp_init(dvel_lons, nlon, to_lons, ncols, 2, lon_wgts, zero, twopi) - call lininterp_init(dvel_lats, nlat, to_lats, ncols, 1, lat_wgts) - - do ispecies = 1,nspecies - do m = 1,12 - call lininterp( dvel_in( :,:,ispecies,m ), nlon, nlat, dvel(:,c,ispecies,m), ncols,lon_wgts,lat_wgts) - end do - end do - - call lininterp_finish(lat_wgts) - call lininterp_finish(lon_wgts) - end do - - deallocate( dvel_in ) - deallocate( dvel_lats, dvel_lons ) - - !--------------------------------------------------------------------------- - ! ... Read in species names and determine mapping to tracer numbers - !--------------------------------------------------------------------------- - allocate( species_names(nspecies), stat=ierr ) - if( ierr /= 0 ) then - write(iulog,*) 'dvel_inti: species_names allocation error = ',ierr - call endrun - end if - ierr = pio_inq_varid( piofile, 'species_name', vid ) - ierr = pio_inq_varndims( piofile, vid, ndims ) - - ierr = pio_inq_vardimid( piofile, vid, dimid ) - - ierr = pio_inq_dimlen( piofile, dimid(1), nchar ) - map(:) = 0 - do ispecies = 1,nspecies - start(:2) = (/ 1, ispecies /) - count(:2) = (/ nchar, 1 /) - species_names(ispecies)(:) = ' ' - ierr = pio_get_var( piofile, vid, start(1:2), count(1:2), species_names(ispecies:ispecies) ) - if( species_names(ispecies) == 'O3' ) then - o3_in_tab = .true. - o3_tab_ndx = ispecies - else if( species_names(ispecies) == 'H2O2' ) then - h2o2_in_tab = .true. - h2o2_tab_ndx = ispecies - else if( species_names(ispecies) == 'CH3OOH' ) then - ch3ooh_in_tab = .true. - ch3ooh_tab_ndx = ispecies - else if( species_names(ispecies) == 'CO' ) then - co_in_tab = .true. - co_tab_ndx = ispecies - else if( species_names(ispecies) == 'CH3CHO' ) then - ch3cho_in_tab = .true. - ch3cho_tab_ndx = ispecies - end if - found = .false. - do m = 1, nTracers - if( species_names(ispecies) == tracerNames(m) .or. & - (species_names(ispecies) == 'O3' .and. tracerNames(m) == 'OX') .or. & - (species_names(ispecies) == 'HNO4' .and. tracerNames(m) == 'HO2NO2') ) then - if ( has_drydep( tracerNames(m) ) ) then - map(m) = ispecies - found = .true. -#ifdef DEBUG - if( masterproc ) then - write(iulog,*) 'dvel_inti: ispecies, m, tracnam = ',ispecies,m,trim(tracerNames(m)) - end if -#endif - exit - end if - end if - end do - if( .not. found ) then - write(iulog,*) 'dvel_inti: Warning! DVEL species ',trim(species_names(ispecies)),' not found' - endif - end do - deallocate( species_names ) - - call cam_pio_closefile( piofile ) - - !--------------------------------------------------------------------------- - ! ... Allocate dvel_interp array - !--------------------------------------------------------------------------- - allocate( dvel_interp(pcols,begchunk:endchunk,nspecies),stat=ierr ) - if( ierr /= 0 ) then - write(iulog,*) 'dvel_inti: Failed to allocate dvel_interp; error = ',ierr - call endrun - end if - - end subroutine dvel_inti_table - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - subroutine interpdvel( calday, ncol, lchnk ) - !--------------------------------------------------------------------------- - ! ... Interpolate the fields whose values are required at the - ! begining of a timestep. - !--------------------------------------------------------------------------- - - use time_manager, only : get_calday - - implicit none - - !--------------------------------------------------------------------------- - ! ... Dummy arguments - !--------------------------------------------------------------------------- - real(r8), intent(in) :: calday ! Interpolate the input data to calday - integer, intent(in) :: ncol, lchnk - - !--------------------------------------------------------------------------- - ! ... Local variables - !--------------------------------------------------------------------------- - integer :: m, last, next - integer :: dates(12) = (/ 116, 214, 316, 415, 516, 615, & - 716, 816, 915, 1016, 1115, 1216 /) - real(r8) :: calday_loc, last_days, next_days - real(r8), save :: dys(12) - logical, save :: entered = .false. - - if( .not. entered ) then - do m = 1,12 - dys(m) = get_calday( dates(m), 0 ) - end do - entered = .true. - end if - - if( calday < dys(1) ) then - next = 1 - last = 12 - else if( calday >= dys(12) ) then - next = 1 - last = 12 - else - do m = 11,1,-1 - if( calday >= dys(m) ) then - exit - end if - end do - last = m - next = m + 1 - end if - - last_days = dys( last ) - next_days = dys( next ) - calday_loc = calday - - if( next_days < last_days ) then - next_days = next_days + 365._r8 - end if - if( calday_loc < last_days ) then - calday_loc = calday_loc + 365._r8 - end if - - do m = 1,nspecies - call intp2d( last_days, next_days, calday_loc, ncol, lchnk, & - dvel(:,lchnk,m,last), & - dvel(:,lchnk,m,next), & - dvel_interp(:,lchnk,m) ) - end do - - end subroutine interpdvel - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - subroutine intp2d( t1, t2, tint, ncol, lchnk, f1, f2, fint ) - !----------------------------------------------------------------------- - ! ... Linearly interpolate between f1(t1) and f2(t2) to fint(tint). - !----------------------------------------------------------------------- - - implicit none - - !----------------------------------------------------------------------- - ! ... Dummy arguments - !----------------------------------------------------------------------- - real(r8), intent(in) :: & - t1, & ! time level of f1 - t2, & ! time level of f2 - tint ! interpolant time - real(r8), dimension(pcols), intent(in) :: & - f1, & ! field at time t1 - f2 ! field at time t2 - - integer, intent(in) :: ncol, lchnk - - real(r8), intent(out) :: & - fint(pcols) ! field at time tint - - - !----------------------------------------------------------------------- - ! ... Local variables - !----------------------------------------------------------------------- - real(r8) :: factor - - factor = (tint - t1)/(t2 - t1) - - fint(:ncol) = f1(:ncol) + (f2(:ncol) - f1(:ncol))*factor - - end subroutine intp2d - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - !subroutine drydep_table( calday, tsurf, zen_angle, & - ! depvel, dflx, q, p, & - ! tv, ncol, icefrac, ocnfrac, lchnk ) - ! !-------------------------------------------------------- - ! ! ... Form the deposition velocities for this - ! ! latitude slice - ! !-------------------------------------------------------- - - ! use physconst, only : rair,pi - ! use dycore, only : dycore_is - - ! implicit none - - ! !-------------------------------------------------------- - ! ! ... Dummy arguments - ! !-------------------------------------------------------- - ! integer, intent(in) :: ncol ! columns in chunk - ! real(r8), intent(in) :: q(pcols,plev,gas_pcnst) ! tracer mmr (kg/kg) - ! real(r8), intent(in) :: p(pcols) ! midpoint pressure in surface layer (Pa) - ! real(r8), intent(in) :: tv(pcols) ! virtual temperature in surface layer (K) - ! real(r8), intent(in) :: calday ! time of year in days - ! real(r8), intent(in) :: tsurf(pcols) ! surface temperature (K) - ! real(r8), intent(in) :: zen_angle(ncol) ! zenith angle (radians) - ! real(r8), intent(inout) :: dflx(pcols,gas_pcnst) ! flux due to dry deposition (kg/m^2/sec) - ! real(r8), intent(out) :: depvel(ncol,gas_pcnst) ! deposition vel (cm/s) - - ! real(r8), intent(in) :: icefrac(pcols) ! sea-ice areal fraction - ! real(r8), intent(in) :: ocnfrac(pcols) ! ocean areal fraction - ! - ! integer, intent(in) :: lchnk - ! !----------------------------------------------------------------------- - ! ! ... Local variables - ! !----------------------------------------------------------------------- - ! integer :: m, i - ! real(r8), dimension(ncol) :: vel, glace, temp_fac, wrk, tmp - ! real(r8), dimension(ncol) :: o3_tab_dvel - ! real(r8), dimension(ncol) :: ocean - - ! real(r8), parameter :: pid2 = .5_r8 * pi - - ! if(dycore_is('UNSTRUCTURED')) then - ! call endrun( 'Option not supported for unstructured atmosphere grids ') - ! end if - - ! !----------------------------------------------------------------------- - ! ! ... Note the factor 1.e-2 in the wrk array calculation is - ! ! to transform the incoming dep vel from cm/s to m/s - ! !----------------------------------------------------------------------- - ! wrk(:ncol) = 1.e-2_r8 * p(:ncol) / (rair * tv(:ncol)) - - ! !-------------------------------------------------------- - ! ! ... Initialize all deposition velocities to zero - ! !-------------------------------------------------------- - ! depvel(:,:) = 0._r8 - - ! !-------------------------------------------------------- - ! ! ... Time interpolate primary depvel array - ! ! (also seaice and npp) - ! !-------------------------------------------------------- - ! call interpdvel( calday, ncol, lchnk ) - - ! if( o3_in_tab ) then - ! do i=1,ncol - ! o3_tab_dvel(i) = dvel_interp(i,lchnk,o3_tab_ndx) - ! enddo - ! end if - - ! !-------------------------------------------------------- - ! ! ... Set deposition velocities - ! !-------------------------------------------------------- - ! do m = 1,gas_pcnst - ! if( map(m) /= 0 ) then - ! do i = 1,ncol - ! depvel(i,m) = dvel_interp(i,lchnk,map(m)) - ! dflx(i,m) = wrk(i) * depvel(i,m) * q(i,plev,m) - ! enddo - ! end if - ! end do - - ! !-------------------------------------------------------- - ! ! ... Set some variables needed for some dvel calculations - ! !-------------------------------------------------------- - ! temp_fac(:ncol) = min( 1._r8, max( 0._r8, (tsurf(:ncol) - 268._r8) / 5._r8 ) ) - ! ocean(:ncol) = icefrac(:ncol)+ocnfrac(:ncol) - ! glace(:ncol) = icefrac(:ncol) + (1._r8 - ocean(:ncol)) * (1._r8 - temp_fac(:ncol)) - ! glace(:ncol) = min( 1._r8,glace(:ncol) ) - - ! !-------------------------------------------------------- - ! ! ... Set pan & mpan - ! !-------------------------------------------------------- - ! if( o3_in_tab ) then - ! tmp(:ncol) = o3_tab_dvel(:ncol) / 3._r8 - ! else - ! tmp(:) = 0._r8 - ! end if - ! if( pan_dd ) then - ! if( map(pan_ndx) == 0 ) then - ! depvel(:ncol,pan_ndx) = tmp(:ncol) - ! dflx(:ncol,pan_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,pan_ndx) - ! end if - ! end if - ! if( mpan_dd ) then - ! if( map(mpan_ndx) == 0 ) then - ! depvel(:ncol,mpan_ndx) = tmp(:ncol) - ! dflx(:ncol,mpan_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,mpan_ndx) - ! end if - ! end if - - ! !-------------------------------------------------------- - ! ! ... Set no2 dvel - ! !-------------------------------------------------------- - ! if( no2_dd ) then - ! if( map(no2_ndx) == 0 .and. o3_in_tab ) then - ! depvel(:ncol,no2_ndx) = (.6_r8*o3_tab_dvel(:ncol) + .055_r8*ocean(:ncol)) * .9_r8 - ! dflx(:ncol,no2_ndx) = wrk(:) * depvel(:ncol,no2_ndx) * q(:ncol,plev,no2_ndx) - ! end if - ! end if - - ! !-------------------------------------------------------- - ! ! ... Set hno3 dvel - ! !-------------------------------------------------------- - ! tmp(:ncol) = (2._r8 - ocnfrac(:ncol)) * (1._r8 - glace(:ncol)) + .05_r8 * glace(:ncol) - ! if( hno3_dd ) then - ! if( map(hno3_ndx) == 0 ) then - ! depvel(:ncol,hno3_ndx) = tmp(:ncol) - ! dflx(:ncol,hno3_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,hno3_ndx) - ! else - ! tmp(:ncol) = depvel(:ncol,hno3_ndx) - ! end if - ! end if - ! if( onitr_dd ) then - ! if( map(onitr_ndx) == 0 ) then - ! depvel(:ncol,onitr_ndx) = tmp(:ncol) - ! dflx(:ncol,onitr_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,onitr_ndx) - ! end if - ! end if - ! if( isopooh_dd ) then - ! if( map(isopooh_ndx) == 0 ) then - ! depvel(:ncol,isopooh_ndx) = tmp(:ncol) - ! dflx(:ncol,isopooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,isopooh_ndx) - ! end if - ! end if - - ! !-------------------------------------------------------- - ! ! ... Set h2o2 dvel - ! !-------------------------------------------------------- - ! if( .not. h2o2_in_tab ) then - ! if( o3_in_tab ) then - ! tmp(:ncol) = .05_r8*glace(:ncol) + ocean(:ncol) - icefrac(:ncol) & - ! + (1._r8 - (glace(:) + ocean(:ncol)) + icefrac(:ncol)) & - ! *max( 1._r8,1._r8/(.5_r8 + 1._r8/(6._r8*o3_tab_dvel(:ncol))) ) - ! else - ! tmp(:ncol) = 0._r8 - ! end if - ! else - ! do i=1,ncol - ! tmp(i) = dvel_interp(i,lchnk,h2o2_tab_ndx) - ! enddo - ! end if - ! if( h2o2_dd ) then - ! if( map(h2o2_ndx) == 0 ) then - ! depvel(:ncol,h2o2_ndx) = tmp(:ncol) - ! dflx(:ncol,h2o2_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,h2o2_ndx) - ! end if - ! end if - ! !-------------------------------------------------------- - ! ! ... Set hcn dvel - ! !-------------------------------------------------------- - ! if( hcn_dd ) then - ! if( map(hcn_ndx) == 0 ) then - ! depvel(:ncol,hcn_ndx) = ocnfrac(:ncol)*0.2_r8 - ! endif - ! endif - ! !-------------------------------------------------------- - ! ! ... Set ch3cn dvel - ! !-------------------------------------------------------- - ! if( ch3cn_dd ) then - ! if( map(ch3cn_ndx) == 0 ) then - ! depvel(:,ch3cn_ndx) = ocnfrac(:ncol)*0.2_r8 - ! endif - ! endif - ! !-------------------------------------------------------- - ! ! ... Set onit - ! !-------------------------------------------------------- - ! if( onit_dd ) then - ! if( map(onit_ndx) == 0 ) then - ! depvel(:ncol,onit_ndx) = tmp(:ncol) - ! dflx(:ncol,onit_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,onit_ndx) - ! end if - ! end if - ! if( ch3cocho_dd ) then - ! if( map(ch3cocho_ndx) == 0 ) then - ! depvel(:ncol,ch3cocho_ndx) = tmp(:ncol) - ! dflx(:ncol,ch3cocho_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch3cocho_ndx) - ! end if - ! end if - ! if( ch3ooh_in_tab ) then - ! do i=1,ncol - ! tmp(i) = dvel_interp(i,lchnk,ch3ooh_tab_ndx) - ! enddo - ! else - ! tmp(:ncol) = .5_r8 * tmp(:ncol) - ! end if - ! if( ch3ooh_dd ) then - ! if( map(ch3ooh_ndx) == 0 ) then - ! depvel(:ncol,ch3ooh_ndx) = tmp(:ncol) - ! dflx(:ncol,ch3ooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch3ooh_ndx) - ! end if - ! end if - ! if( pooh_dd ) then - ! if( map(pooh_ndx) == 0 ) then - ! depvel(:ncol,pooh_ndx) = tmp(:ncol) - ! dflx(:ncol,pooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,pooh_ndx) - ! end if - ! end if - ! if( ch3coooh_dd ) then - ! if( map(ch3coooh_ndx) == 0 ) then - ! depvel(:ncol,ch3coooh_ndx) = tmp(:ncol) - ! dflx(:ncol,ch3coooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch3coooh_ndx) - ! end if - ! end if - ! if( c2h5ooh_dd ) then - ! if( map(c2h5ooh_ndx) == 0 ) then - ! depvel(:ncol,c2h5ooh_ndx) = tmp(:ncol) - ! dflx(:ncol,c2h5ooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,c2h5ooh_ndx) - ! end if - ! end if - ! if( c3h7ooh_dd ) then - ! if( map(c3h7ooh_ndx) == 0 ) then - ! depvel(:ncol,c3h7ooh_ndx) = tmp(:ncol) - ! dflx(:ncol,c3h7ooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,c3h7ooh_ndx) - ! end if - ! end if - ! if( rooh_dd ) then - ! if( map(rooh_ndx) == 0 ) then - ! depvel(:ncol,rooh_ndx) = tmp(:ncol) - ! dflx(:ncol,rooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,rooh_ndx) - ! end if - ! end if - ! if( macrooh_dd ) then - ! if( map(macrooh_ndx) == 0 ) then - ! depvel(:ncol,macrooh_ndx) = tmp(:ncol) - ! dflx(:ncol,macrooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,macrooh_ndx) - ! end if - ! end if - ! if( xooh_dd ) then - ! if( map(xooh_ndx) == 0 ) then - ! depvel(:ncol,xooh_ndx) = tmp(:ncol) - ! dflx(:ncol,xooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,xooh_ndx) - ! end if - ! end if - ! if( ch3oh_dd ) then - ! if( map(ch3oh_ndx) == 0 ) then - ! depvel(:ncol,ch3oh_ndx) = tmp(:ncol) - ! dflx(:ncol,ch3oh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch3oh_ndx) - ! end if - ! end if - ! if( c2h5oh_dd ) then - ! if( map(c2h5oh_ndx) == 0 ) then - ! depvel(:ncol,c2h5oh_ndx) = tmp(:ncol) - ! dflx(:ncol,c2h5oh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,c2h5oh_ndx) - ! end if - ! end if - ! if( alkooh_dd ) then - ! if( map(alkooh_ndx) == 0 ) then - ! depvel(:ncol,alkooh_ndx) = tmp(:ncol) - ! dflx(:ncol,alkooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,alkooh_ndx) - ! end if - ! end if - ! if( mekooh_dd ) then - ! if( map(mekooh_ndx) == 0 ) then - ! depvel(:ncol,mekooh_ndx) = tmp(:ncol) - ! dflx(:ncol,mekooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,mekooh_ndx) - ! end if - ! end if - ! if( tolooh_dd ) then - ! if( map(tolooh_ndx) == 0 ) then - ! depvel(:ncol,tolooh_ndx) = tmp(:ncol) - ! dflx(:ncol,tolooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,tolooh_ndx) - ! end if - ! end if - ! if( o3_in_tab ) then - ! tmp(:ncol) = o3_tab_dvel(:ncol) - ! else - ! tmp(:ncol) = 0._r8 - ! end if - ! if( ch2o_dd ) then - ! if( map(ch2o_ndx) == 0 ) then - ! depvel(:ncol,ch2o_ndx) = tmp(:ncol) - ! dflx(:ncol,ch2o_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch2o_ndx) - ! end if - ! end if - - ! if( hydrald_dd ) then - ! if( map(hydrald_ndx) == 0 ) then - ! depvel(:ncol,hydrald_ndx) = tmp(:ncol) - ! dflx(:ncol,hydrald_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,hydrald_ndx) - ! end if - ! end if - ! if( ch3cooh_dd ) then - ! if( map(ch3cooh_ndx) == 0 ) then - ! depvel(:ncol,ch3cooh_ndx) = depvel(:ncol,ch2o_ndx) - ! dflx(:ncol,ch3cooh_ndx) = wrk(:ncol) * depvel(:ncol,ch3cooh_ndx) * q(:ncol,plev,ch3cooh_ndx) - ! end if - ! end if - ! if( eooh_dd ) then - ! if( map(eooh_ndx) == 0 ) then - ! depvel(:ncol,eooh_ndx) = depvel(:ncol,ch2o_ndx) - ! dflx(:ncol,eooh_ndx) = wrk(:ncol) * depvel(:ncol,eooh_ndx) * q(:ncol,plev,eooh_ndx) - ! end if - ! end if - ! ! HCOOH - set to CH3COOH - ! if( hcooh_dd ) then - ! if( map(hcooh_ndx) == 0 ) then - ! depvel(:ncol,hcooh_ndx) = depvel(:ncol,ch2o_ndx) - ! dflx(:ncol,hcooh_ndx) = wrk(:ncol) * depvel(:ncol,hcooh_ndx) * q(:ncol,plev,hcooh_ndx) - ! end if - ! end if - - ! !-------------------------------------------------------- - ! ! ... Set co and related species dep vel - ! !-------------------------------------------------------- - ! if( co_in_tab ) then - ! do i=1,ncol - ! tmp(i) = dvel_interp(i,lchnk,co_tab_ndx) - ! enddo - ! else - ! tmp(:) = 0._r8 - ! end if - ! if( co_dd ) then - ! if( map(co_ndx) == 0 ) then - ! depvel(:ncol,co_ndx) = tmp(:ncol) - ! dflx(:ncol,co_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,co_ndx) - ! end if - ! end if - ! if( ch3coch3_dd ) then - ! if( map(ch3coch3_ndx) == 0 ) then - ! depvel(:ncol,ch3coch3_ndx) = tmp(:ncol) - ! dflx(:ncol,ch3coch3_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,ch3coch3_ndx) - ! end if - ! end if - ! if( hyac_dd ) then - ! if( map(hyac_ndx) == 0 ) then - ! depvel(:ncol,hyac_ndx) = tmp(:ncol) - ! dflx(:ncol,hyac_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,hyac_ndx) - ! end if - ! end if - ! if( h2_dd ) then - ! if( map(h2_ndx) == 0 ) then - ! depvel(:ncol,h2_ndx) = tmp(:ncol) * 1.5_r8 ! Hough(1991) - ! dflx(:ncol,h2_ndx) = wrk(:ncol) * depvel(:ncol,h2_ndx) * q(:ncol,plev,h2_ndx) - ! end if - ! end if - - ! !-------------------------------------------------------- - ! ! ... Set glyald - ! !-------------------------------------------------------- - ! if( glyald_dd ) then - ! if( map(glyald_ndx) == 0 ) then - ! if( ch3cho_dd ) then - ! depvel(:ncol,glyald_ndx) = depvel(:ncol,ch3cho_ndx) - ! else if( ch3cho_in_tab ) then - ! do i=1,ncol - ! depvel(i,glyald_ndx) = dvel_interp(i,lchnk,ch3cho_tab_ndx) - ! enddo - ! else - ! depvel(:ncol,glyald_ndx) = 0._r8 - ! end if - ! dflx(:ncol,glyald_ndx) = wrk(:ncol) * depvel(:ncol,glyald_ndx) * q(:ncol,plev,glyald_ndx) - ! end if - ! end if - - ! !-------------------------------------------------------- - ! ! ... Lead deposition - ! !-------------------------------------------------------- - ! if( Pb_dd ) then - ! if( map(Pb_ndx) == 0 ) then - ! depvel(:ncol,Pb_ndx) = ocean(:ncol) * .05_r8 + (1._r8 - ocean(:ncol)) * .2_r8 - ! dflx(:ncol,Pb_ndx) = wrk(:ncol) * depvel(:ncol,Pb_ndx) * q(:ncol,plev,Pb_ndx) - ! end if - ! end if - - ! !-------------------------------------------------------- - ! ! ... diurnal dependence for OX dvel - ! !-------------------------------------------------------- - ! if( o3_dd .or. o3s_dd .or. o3inert_dd ) then - ! if( o3_dd .or. o3_in_tab ) then - ! if( o3_dd ) then - ! tmp(:ncol) = max( 1._r8,sqrt( (depvel(:ncol,o3_ndx) - .2_r8)**3/.27_r8 + 4._r8*depvel(:ncol,o3_ndx) + .67_r8 ) ) - ! vel(:ncol) = depvel(:ncol,o3_ndx) - ! else if( o3_in_tab ) then - ! tmp(:ncol) = max( 1._r8,sqrt( (o3_tab_dvel(:ncol) - .2_r8)**3/.27_r8 + 4._r8*o3_tab_dvel(:ncol) + .67_r8 ) ) - ! vel(:ncol) = o3_tab_dvel(:ncol) - ! end if - ! where( abs( zen_angle(:) ) > pid2 ) - ! vel(:) = vel(:) / tmp(:) - ! elsewhere - ! vel(:) = vel(:) * tmp(:) - ! endwhere - - ! else - ! vel(:ncol) = 0._r8 - ! end if - ! if( o3_dd ) then - ! depvel(:ncol,o3_ndx) = vel(:ncol) - ! dflx(:ncol,o3_ndx) = wrk(:ncol) * vel(:ncol) * q(:ncol,plev,o3_ndx) - ! end if - ! !-------------------------------------------------------- - ! ! ... Set stratospheric O3 deposition - ! !-------------------------------------------------------- - ! if( o3s_dd ) then - ! depvel(:ncol,o3s_ndx) = vel(:ncol) - ! dflx(:ncol,o3s_ndx) = wrk(:ncol) * vel(:ncol) * q(:ncol,plev,o3s_ndx) - ! end if - ! if( o3inert_dd ) then - ! depvel(:ncol,o3inert_ndx) = vel(:ncol) - ! dflx(:ncol,o3inert_ndx) = wrk(:ncol) * vel(:ncol) * q(:ncol,plev,o3inert_ndx) - ! end if - ! end if - - ! if( xno2_dd ) then - ! if( map(xno2_ndx) == 0 ) then - ! depvel(:ncol,xno2_ndx) = depvel(:ncol,no2_ndx) - ! dflx(:ncol,xno2_ndx) = wrk(:ncol) * depvel(:ncol,xno2_ndx) * q(:ncol,plev,xno2_ndx) - ! end if - ! endif - ! if( o3a_dd ) then - ! if( map(o3a_ndx) == 0 ) then - ! depvel(:ncol,o3a_ndx) = depvel(:ncol,o3_ndx) - ! dflx(:ncol,o3a_ndx) = wrk(:ncol) * depvel(:ncol,o3a_ndx) * q(:ncol,plev,o3a_ndx) - ! end if - ! endif - ! if( xhno3_dd ) then - ! if( map(xhno3_ndx) == 0 ) then - ! depvel(:ncol,xhno3_ndx) = depvel(:ncol,hno3_ndx) - ! dflx(:ncol,xhno3_ndx) = wrk(:ncol) * depvel(:ncol,xhno3_ndx) * q(:ncol,plev,xhno3_ndx) - ! end if - ! endif - ! if( xnh4no3_dd ) then - ! if( map(xnh4no3_ndx) == 0 ) then - ! depvel(:ncol,xnh4no3_ndx) = depvel(:ncol,nh4no3_ndx) - ! dflx(:ncol,xnh4no3_ndx) = wrk(:ncol) * depvel(:ncol,xnh4no3_ndx) * q(:ncol,plev,xnh4no3_ndx) - ! end if - ! endif - ! if( xpan_dd ) then - ! if( map(xpan_ndx) == 0 ) then - ! depvel(:ncol,xpan_ndx) = depvel(:ncol,pan_ndx) - ! dflx(:ncol,xpan_ndx) = wrk(:ncol) * depvel(:ncol,xpan_ndx) * q(:ncol,plev,xpan_ndx) - ! end if - ! endif - ! if( xmpan_dd ) then - ! if( map(xmpan_ndx) == 0 ) then - ! depvel(:ncol,xmpan_ndx) = depvel(:ncol,mpan_ndx) - ! dflx(:ncol,xmpan_ndx) = wrk(:ncol) * depvel(:ncol,xmpan_ndx) * q(:ncol,plev,xmpan_ndx) - ! end if - ! endif - ! if( xonit_dd ) then - ! if( map(xonit_ndx) == 0 ) then - ! depvel(:ncol,xonit_ndx) = depvel(:ncol,onit_ndx) - ! dflx(:ncol,xonit_ndx) = wrk(:ncol) * depvel(:ncol,xonit_ndx) * q(:ncol,plev,xonit_ndx) - ! end if - ! endif - ! if( xonitr_dd ) then - ! if( map(xonitr_ndx) == 0 ) then - ! depvel(:ncol,xonitr_ndx) = depvel(:ncol,onitr_ndx) - ! dflx(:ncol,xonitr_ndx) = wrk(:ncol) * depvel(:ncol,xonitr_ndx) * q(:ncol,plev,xonitr_ndx) - ! end if - ! endif - ! if( xno_dd ) then - ! if( map(xno_ndx) == 0 ) then - ! depvel(:ncol,xno_ndx) = depvel(:ncol,no_ndx) - ! dflx(:ncol,xno_ndx) = wrk(:ncol) * depvel(:ncol,xno_ndx) * q(:ncol,plev,xno_ndx) - ! end if - ! endif - ! if( xho2no2_dd ) then - ! if( map(xho2no2_ndx) == 0 ) then - ! depvel(:ncol,xho2no2_ndx) = depvel(:ncol,ho2no2_ndx) - ! dflx(:ncol,xho2no2_ndx) = wrk(:ncol) * depvel(:ncol,xho2no2_ndx) * q(:ncol,plev,xho2no2_ndx) - ! end if - ! endif - ! !lke-TS1 - ! if( phenooh_dd ) then - ! if( map(phenooh_ndx) == 0 ) then - ! depvel(:ncol,phenooh_ndx) = depvel(:ncol,ch3ooh_ndx) - ! dflx(:ncol,phenooh_ndx) = wrk(:ncol) * depvel(:ncol,phenooh_ndx) * q(:ncol,plev,phenooh_ndx) - ! end if - ! endif - ! if( benzooh_dd ) then - ! if( map(benzooh_ndx) == 0 ) then - ! depvel(:ncol,benzooh_ndx) = depvel(:ncol,ch3ooh_ndx) - ! dflx(:ncol,benzooh_ndx) = wrk(:ncol) * depvel(:ncol,benzooh_ndx) * q(:ncol,plev,benzooh_ndx) - ! end if - ! endif - ! if( c6h5ooh_dd ) then - ! if( map(c6h5ooh_ndx) == 0 ) then - ! depvel(:ncol,c6h5ooh_ndx) = depvel(:ncol,ch3ooh_ndx) - ! dflx(:ncol,c6h5ooh_ndx) = wrk(:ncol) * depvel(:ncol,c6h5ooh_ndx) * q(:ncol,plev,c6h5ooh_ndx) - ! end if - ! endif - ! if( bzooh_dd ) then - ! if( map(bzooh_ndx) == 0 ) then - ! depvel(:ncol,bzooh_ndx) = depvel(:ncol,ch3ooh_ndx) - ! dflx(:ncol,bzooh_ndx) = wrk(:ncol) * depvel(:ncol,bzooh_ndx) * q(:ncol,plev,bzooh_ndx) - ! end if - ! endif - ! if( xylolooh_dd ) then - ! if( map(xylolooh_ndx) == 0 ) then - ! depvel(:ncol,xylolooh_ndx) = depvel(:ncol,ch3ooh_ndx) - ! dflx(:ncol,xylolooh_ndx) = wrk(:ncol) * depvel(:ncol,xylolooh_ndx) * q(:ncol,plev,xylolooh_ndx) - ! end if - ! endif - ! if( xylenooh_dd ) then - ! if( map(xylenooh_ndx) == 0 ) then - ! depvel(:ncol,xylenooh_ndx) = depvel(:ncol,ch3ooh_ndx) - ! dflx(:ncol,xylenooh_ndx) = wrk(:ncol) * depvel(:ncol,xylenooh_ndx) * q(:ncol,plev,xylenooh_ndx) - ! end if - ! endif - ! if( terpooh_dd ) then - ! if( map(terpooh_ndx) == 0 ) then - ! depvel(:ncol,terpooh_ndx) = depvel(:ncol,isopooh_ndx) - ! dflx(:ncol,terpooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,terpooh_ndx) - ! end if - ! end if - ! if( terp2ooh_dd ) then - ! if( map(terp2ooh_ndx) == 0 ) then - ! depvel(:ncol,terp2ooh_ndx) = depvel(:ncol,isopooh_ndx) - ! dflx(:ncol,terp2ooh_ndx) = wrk(:ncol) * tmp(:ncol) * q(:ncol,plev,terp2ooh_ndx) - ! end if - ! end if - ! if( terprod1_dd ) then - ! if( map(terprod1_ndx) == 0 ) then - ! depvel(:ncol,terprod1_ndx) = depvel(:ncol,hyac_ndx) - ! dflx(:ncol,terprod1_ndx) = wrk(:ncol) * depvel(:ncol,terprod1_ndx) * q(:ncol,plev,terprod1_ndx) - ! end if - ! endif - ! if( terprod2_dd ) then - ! if( map(terprod2_ndx) == 0 ) then - ! depvel(:ncol,terprod2_ndx) = depvel(:ncol,hyac_ndx) - ! dflx(:ncol,terprod2_ndx) = wrk(:ncol) * depvel(:ncol,terprod2_ndx) * q(:ncol,plev,terprod2_ndx) - ! end if - ! endif - ! if( hmprop_dd ) then - ! if( map(hmprop_ndx) == 0 ) then - ! depvel(:ncol,hmprop_ndx) = depvel(:ncol,glyald_ndx) - ! dflx(:ncol,hmprop_ndx) = wrk(:ncol) * depvel(:ncol,hmprop_ndx) * q(:ncol,plev,hmprop_ndx) - ! end if - ! endif - ! if( mboooh_dd ) then - ! if( map(mboooh_ndx) == 0 ) then - ! depvel(:ncol,mboooh_ndx) = depvel(:ncol,isopooh_ndx) - ! dflx(:ncol,mboooh_ndx) = wrk(:ncol) * depvel(:ncol,mboooh_ndx) * q(:ncol,plev,mboooh_ndx) - ! end if - ! endif - ! if( hpald_dd ) then - ! if( map(hpald_ndx) == 0 ) then - ! depvel(:ncol,hpald_ndx) = depvel(:ncol,ch3ooh_ndx) - ! dflx(:ncol,hpald_ndx) = wrk(:ncol) * depvel(:ncol,hpald_ndx) * q(:ncol,plev,hpald_ndx) - ! end if - ! endif - ! if( iepox_dd ) then - ! if( map(iepox_ndx) == 0 ) then - ! depvel(:ncol,iepox_ndx) = depvel(:ncol,hyac_ndx) - ! dflx(:ncol,iepox_ndx) = wrk(:ncol) * depvel(:ncol,iepox_ndx) * q(:ncol,plev,iepox_ndx) - ! end if - ! endif - ! if( noa_dd ) then - ! if( map(noa_ndx) == 0 ) then - ! depvel(:ncol,noa_ndx) = depvel(:ncol,h2o2_ndx) - ! dflx(:ncol,noa_ndx) = wrk(:ncol) * depvel(:ncol,noa_ndx) * q(:ncol,plev,noa_ndx) - ! end if - ! endif - ! if( alknit_dd ) then - ! if( map(alknit_ndx) == 0 ) then - ! depvel(:ncol,alknit_ndx) = depvel(:ncol,h2o2_ndx) - ! dflx(:ncol,alknit_ndx) = wrk(:ncol) * depvel(:ncol,alknit_ndx) * q(:ncol,plev,alknit_ndx) - ! end if - ! endif - ! if( isopnita_dd ) then - ! if( map(isopnita_ndx) == 0 ) then - ! depvel(:ncol,isopnita_ndx) = depvel(:ncol,h2o2_ndx) - ! dflx(:ncol,isopnita_ndx) = wrk(:ncol) * depvel(:ncol,isopnita_ndx) * q(:ncol,plev,isopnita_ndx) - ! end if - ! endif - ! if( isopnitb_dd ) then - ! if( map(isopnitb_ndx) == 0 ) then - ! depvel(:ncol,isopnitb_ndx) = depvel(:ncol,h2o2_ndx) - ! dflx(:ncol,isopnitb_ndx) = wrk(:ncol) * depvel(:ncol,isopnitb_ndx) * q(:ncol,plev,isopnitb_ndx) - ! end if - ! endif - ! if( honitr_dd ) then - ! if( map(honitr_ndx) == 0 ) then - ! depvel(:ncol,honitr_ndx) = depvel(:ncol,h2o2_ndx) - ! dflx(:ncol,honitr_ndx) = wrk(:ncol) * depvel(:ncol,honitr_ndx) * q(:ncol,plev,honitr_ndx) - ! end if - ! endif - ! if( isopnooh_dd ) then - ! if( map(isopnooh_ndx) == 0 ) then - ! depvel(:ncol,isopnooh_ndx) = depvel(:ncol,h2o2_ndx) - ! dflx(:ncol,isopnooh_ndx) = wrk(:ncol) * depvel(:ncol,isopnooh_ndx) * q(:ncol,plev,isopnooh_ndx) - ! end if - ! endif - ! if( nc4cho_dd ) then - ! if( map(nc4cho_ndx) == 0 ) then - ! depvel(:ncol,nc4cho_ndx) = depvel(:ncol,h2o2_ndx) - ! dflx(:ncol,nc4cho_ndx) = wrk(:ncol) * depvel(:ncol,nc4cho_ndx) * q(:ncol,plev,nc4cho_ndx) - ! end if - ! endif - ! if( nc4ch2oh_dd ) then - ! if( map(nc4ch2oh_ndx) == 0 ) then - ! depvel(:ncol,nc4ch2oh_ndx) = depvel(:ncol,h2o2_ndx) - ! dflx(:ncol,nc4ch2oh_ndx) = wrk(:ncol) * depvel(:ncol,nc4ch2oh_ndx) * q(:ncol,plev,nc4ch2oh_ndx) - ! end if - ! endif - ! if( terpnit_dd ) then - ! if( map(terpnit_ndx) == 0 ) then - ! depvel(:ncol,terpnit_ndx) = depvel(:ncol,h2o2_ndx) - ! dflx(:ncol,terpnit_ndx) = wrk(:ncol) * depvel(:ncol,terpnit_ndx) * q(:ncol,plev,terpnit_ndx) - ! end if - ! endif - ! if( nterpooh_dd ) then - ! if( map(nterpooh_ndx) == 0 ) then - ! depvel(:ncol,nterpooh_ndx) = depvel(:ncol,h2o2_ndx) - ! dflx(:ncol,nterpooh_ndx) = wrk(:ncol) * depvel(:ncol,nterpooh_ndx) * q(:ncol,plev,nterpooh_ndx) - ! end if - ! endif - - - !end subroutine drydep_table - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - subroutine dvel_inti_xactive( depvel_lnd_file, clim_soilw_file, season_wes_file ) - !------------------------------------------------------------------------------------- - ! ... intialize interactive drydep - !------------------------------------------------------------------------------------- - use dycore, only : dycore_is - use mo_constants, only : r2d - use chem_mods, only : adv_mass - use mo_chem_utls, only : get_spc_ndx ! Replaced, TMMF - use seq_drydep_mod,only : drydep_method, DD_XATM, DD_XLND - use phys_control, only : phys_getopts - - implicit none - - !------------------------------------------------------------------------------------- - ! ... dummy arguments - !------------------------------------------------------------------------------------- - character(len=*), intent(in) :: depvel_lnd_file, clim_soilw_file, season_wes_file - - !------------------------------------------------------------------------------------- - ! ... local variables - !------------------------------------------------------------------------------------- - integer :: i, j, ii, jj, jl, ju - integer :: nlon_veg, nlat_veg, npft_veg - integer :: nlat_lai, npft_lai, pos_min, imin - integer :: dimid - integer :: m, n, l, id - integer :: length1, astat - integer, allocatable :: wk_lai(:,:,:) - integer, allocatable :: index_season_lai_j(:,:) - integer :: k, num_max, k_max - integer :: num_seas(5) - integer :: plon, plat - integer :: ierr, ndx - - real(r8) :: spc_mass - real(r8) :: diff_min, target_lat - real(r8), allocatable :: vegetation_map(:,:,:) - real(r8), pointer :: soilw_map(:,:,:) - real(r8), allocatable :: work(:,:) - real(r8), allocatable :: landmask(:,:) - real(r8), allocatable :: urban(:,:) - real(r8), allocatable :: lake(:,:) - real(r8), allocatable :: wetland(:,:) - real(r8), allocatable :: lon_veg(:) - real(r8), allocatable :: lon_veg_edge(:) - real(r8), allocatable :: lat_veg(:) - real(r8), allocatable :: lat_veg_edge(:) - real(r8), allocatable :: lat_lai(:) - real(r8), allocatable :: clat(:) - character(len=32) :: test_name - character(len=4) :: tag_name - type(file_desc_t) :: piofile - type(var_desc_t) :: vid - logical :: do_soilw - - character(len=shr_kind_cl) :: locfn - logical :: prog_modal_aero - - ! determine if modal aerosols are active so that fraction_landuse array is initialized for modal aerosal dry dep - call phys_getopts(prog_modal_aero_out=prog_modal_aero) - - call dvel_inti_fromlnd() - - if( masterproc ) then - write(iulog,*) 'drydep_inti: following species have dry deposition' - do i=1,nddvels - if( len_trim(drydep_list(i)) > 0 ) then - write(iulog,*) 'drydep_inti: '//trim(drydep_list(i))//' is requested to have dry dep' - endif - enddo - write(iulog,*) 'drydep_inti:' - endif - - !------------------------------------------------------------------------------------- - ! ... get species indices - !------------------------------------------------------------------------------------- - xpan_ndx = get_spc_ndx( 'XPAN' ) - xmpan_ndx = get_spc_ndx( 'XMPAN' ) - o3a_ndx = get_spc_ndx( 'O3A' ) - - ch4_ndx = get_spc_ndx( 'CH4' ) - h2_ndx = get_spc_ndx( 'H2' ) - co_ndx = get_spc_ndx( 'CO' ) - Pb_ndx = get_spc_ndx( 'Pb' ) - pan_ndx = get_spc_ndx( 'PAN' ) - mpan_ndx = get_spc_ndx( 'MPAN' ) - o3_ndx = get_spc_ndx( 'OX' ) - if( o3_ndx < 0 ) then - o3_ndx = get_spc_ndx( 'O3' ) - end if - so2_ndx = get_spc_ndx( 'SO2' ) - alkooh_ndx = get_spc_ndx( 'ALKOOH') - mekooh_ndx = get_spc_ndx( 'MEKOOH') - tolooh_ndx = get_spc_ndx( 'TOLOOH') - terpooh_ndx = get_spc_ndx( 'TERPOOH') - ch3cooh_ndx = get_spc_ndx( 'CH3COOH') - soa_ndx = get_spc_ndx( 'SOA' ) - so4_ndx = get_spc_ndx( 'SO4' ) - cb1_ndx = get_spc_ndx( 'CB1' ) - cb2_ndx = get_spc_ndx( 'CB2' ) - oc1_ndx = get_spc_ndx( 'OC1' ) - oc2_ndx = get_spc_ndx( 'OC2' ) - nh3_ndx = get_spc_ndx( 'NH3' ) - nh4no3_ndx = get_spc_ndx( 'NH4NO3' ) - sa1_ndx = get_spc_ndx( 'SA1' ) - sa2_ndx = get_spc_ndx( 'SA2' ) - sa3_ndx = get_spc_ndx( 'SA3' ) - sa4_ndx = get_spc_ndx( 'SA4' ) - nh4_ndx = get_spc_ndx( 'NH4' ) - alkooh_dd = has_drydep( 'ALKOOH') - mekooh_dd = has_drydep( 'MEKOOH') - tolooh_dd = has_drydep( 'TOLOOH') - terpooh_dd = has_drydep( 'TERPOOH') - ch3cooh_dd = has_drydep( 'CH3COOH') - soa_dd = has_drydep( 'SOA' ) - so4_dd = has_drydep( 'SO4' ) - cb1_dd = has_drydep( 'CB1' ) - cb2_dd = has_drydep( 'CB2' ) - oc1_dd = has_drydep( 'OC1' ) - oc2_dd = has_drydep( 'OC2' ) - nh3_dd = has_drydep( 'NH3' ) - nh4no3_dd = has_drydep( 'NH4NO3' ) - sa1_dd = has_drydep( 'SA1' ) - sa2_dd = has_drydep( 'SA2' ) - sa3_dd = has_drydep( 'SA3' ) - sa4_dd = has_drydep( 'SA4' ) - nh4_dd = has_drydep( 'NH4' ) -! - soam_ndx = get_spc_ndx( 'SOAM' ) - soai_ndx = get_spc_ndx( 'SOAI' ) - soat_ndx = get_spc_ndx( 'SOAT' ) - soab_ndx = get_spc_ndx( 'SOAB' ) - soax_ndx = get_spc_ndx( 'SOAX' ) - sogm_ndx = get_spc_ndx( 'SOGM' ) - sogi_ndx = get_spc_ndx( 'SOGI' ) - sogt_ndx = get_spc_ndx( 'SOGT' ) - sogb_ndx = get_spc_ndx( 'SOGB' ) - sogx_ndx = get_spc_ndx( 'SOGX' ) - soam_dd = has_drydep ( 'SOAM' ) - soai_dd = has_drydep ( 'SOAI' ) - soat_dd = has_drydep ( 'SOAT' ) - soab_dd = has_drydep ( 'SOAB' ) - soax_dd = has_drydep ( 'SOAX' ) - sogm_dd = has_drydep ( 'SOGM' ) - sogi_dd = has_drydep ( 'SOGI' ) - sogt_dd = has_drydep ( 'SOGT' ) - sogb_dd = has_drydep ( 'SOGB' ) - sogx_dd = has_drydep ( 'SOGX' ) -! - hcn_ndx = get_spc_ndx( 'HCN') - ch3cn_ndx = get_spc_ndx( 'CH3CN') - -!lke-TS1 - phenooh_ndx = get_spc_ndx( 'PHENOOH') - benzooh_ndx = get_spc_ndx( 'BENZOOH') - c6h5ooh_ndx = get_spc_ndx( 'C6H5OOH') - bzooh_ndx = get_spc_ndx( 'BZOOH') - xylolooh_ndx = get_spc_ndx( 'XYLOLOOH') - xylenooh_ndx = get_spc_ndx( 'XYLENOOH') - terp2ooh_ndx = get_spc_ndx( 'TERP2OOH') - terprod1_ndx = get_spc_ndx( 'TERPROD1') - terprod2_ndx = get_spc_ndx( 'TERPROD2') - hmprop_ndx = get_spc_ndx( 'HMPROP') - mboooh_ndx = get_spc_ndx( 'MBOOOH') - hpald_ndx = get_spc_ndx( 'HPALD') - iepox_ndx = get_spc_ndx( 'IEPOX') - noa_ndx = get_spc_ndx( 'NOA') - alknit_ndx = get_spc_ndx( 'ALKNIT') - isopnita_ndx = get_spc_ndx( 'ISOPNITA') - isopnitb_ndx = get_spc_ndx( 'ISOPNITB') - honitr_ndx = get_spc_ndx( 'HONITR') - isopnooh_ndx = get_spc_ndx( 'ISOPNOOH') - nc4cho_ndx = get_spc_ndx( 'NC4CHO') - nc4ch2oh_ndx = get_spc_ndx( 'NC4CH2OH') - terpnit_ndx = get_spc_ndx( 'TERPNIT') - nterpooh_ndx = get_spc_ndx( 'NTERPOOH') - phenooh_dd = has_drydep( 'PHENOOH') - benzooh_dd = has_drydep( 'BENZOOH') - c6h5ooh_dd = has_drydep( 'C6H5OOH') - bzooh_dd = has_drydep( 'BZOOH') - xylolooh_dd = has_drydep( 'XYLOLOOH') - xylenooh_dd = has_drydep( 'XYLENOOH') - terp2ooh_dd = has_drydep( 'TERP2OOH') - terprod1_dd = has_drydep( 'TERPROD1') - terprod2_dd = has_drydep( 'TERPROD2') - hmprop_dd = has_drydep( 'HMPROP') - mboooh_dd = has_drydep( 'MBOOOH') - hpald_dd = has_drydep( 'HPALD') - iepox_dd = has_drydep( 'IEPOX') - noa_dd = has_drydep( 'NOA') - alknit_dd = has_drydep( 'ALKNIT') - isopnita_dd = has_drydep( 'ISOPNITA') - isopnitb_dd = has_drydep( 'ISOPNITB') - honitr_dd = has_drydep( 'HONITR') - isopnooh_dd = has_drydep( 'ISOPNOOH') - nc4cho_dd = has_drydep( 'NC4CHO') - nc4ch2oh_dd = has_drydep( 'NC4CH2OH') - terpnit_dd = has_drydep( 'TERPNIT') - nterpooh_dd = has_drydep( 'NTERPOOH') -! - cohc_ndx = get_spc_ndx( 'COhc' ) - come_ndx = get_spc_ndx( 'COme' ) - - tag_cnt=0 - cotag_ndx(:)=-1 - do i = 1,NTAGS - write(tag_name,'(a2,i2.2)') 'CO',i - ndx = get_spc_ndx(tag_name) - if (ndx>0) then - tag_cnt = tag_cnt+1 - cotag_ndx(tag_cnt) = ndx - endif - enddo - - o3s_ndx = get_spc_ndx( 'O3S' ) - - do i=1,nddvels - if ( ( mapping(i) > 0 ) .and. ( drySpc_ndx(i) > 0 ) ) then - m = drySpc_ndx(i) - has_dvel(m) = .true. - map_dvel(m) = i - endif - enddo - - if( all( .not. has_dvel(:) ) ) then - return - end if - - !--------------------------------------------------------------------------- - ! ... allocate module variables - !--------------------------------------------------------------------------- - allocate( dep_ra(pcols,n_land_type,begchunk:endchunk),stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate dep_ra; error = ',astat - call endrun - end if - allocate( dep_rb(pcols,n_land_type,begchunk:endchunk),stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate dep_rb; error = ',astat - call endrun - end if - - if (drydep_method == DD_XLND .and. (.not.prog_modal_aero)) then - return - endif - - do_soilw = .not. dyn_soilw .and. (has_drydep( 'H2' ) .or. has_drydep( 'CO' )) - allocate( fraction_landuse(pcols,n_land_type, begchunk:endchunk),stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate fraction_landuse; error = ',astat - call endrun - end if - if(do_soilw) then - allocate(soilw_3d(pcols,12,begchunk:endchunk),stat=astat) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate soilw_3d error = ',astat - call endrun - end if - end if - - plon = get_dyn_grid_parm('plon') - plat = get_dyn_grid_parm('plat') - allocate( index_season_lai_j(n_land_type,12),stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate index_season_lai_j; error = ',astat - call endrun - end if - if(dycore_is('UNSTRUCTURED') ) then - call get_landuse_and_soilw_from_file(do_soilw) - allocate( index_season_lai(plon,12),stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate index_season_lai; error = ',astat - call endrun - end if - else - allocate( index_season_lai(plat,12),stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate index_season_lai; error = ',astat - call endrun - end if - !--------------------------------------------------------------------------- - ! ... read landuse map - !--------------------------------------------------------------------------- - call getfil (depvel_lnd_file, locfn, 0) - call cam_pio_openfile (piofile, trim(locfn), PIO_NOWRITE) - !--------------------------------------------------------------------------- - ! ... get the dimensions - !--------------------------------------------------------------------------- - ierr = pio_inq_dimid( piofile, 'lon', dimid ) - ierr = pio_inq_dimlen( piofile, dimid, nlon_veg ) - ierr = pio_inq_dimid( piofile, 'lat', dimid ) - ierr = pio_inq_dimlen( piofile, dimid, nlat_veg ) - ierr = pio_inq_dimid( piofile, 'pft', dimid ) - ierr = pio_inq_dimlen( piofile, dimid, npft_veg ) - !--------------------------------------------------------------------------- - ! ... allocate arrays - !--------------------------------------------------------------------------- - allocate( vegetation_map(nlon_veg,nlat_veg,npft_veg), work(nlon_veg,nlat_veg), stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate vegation_map; error = ',astat - call endrun - end if - allocate( urban(nlon_veg,nlat_veg), lake(nlon_veg,nlat_veg), & - landmask(nlon_veg,nlat_veg), wetland(nlon_veg,nlat_veg), stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate vegation_map; error = ',astat - call endrun - end if - allocate( lon_veg(nlon_veg), lat_veg(nlat_veg), & - lon_veg_edge(nlon_veg+1), lat_veg_edge(nlat_veg+1), stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate vegation lon, lat arrays; error = ',astat - call endrun - end if - !--------------------------------------------------------------------------- - ! ... read the vegetation map and landmask - !--------------------------------------------------------------------------- - ierr = pio_inq_varid( piofile, 'PCT_PFT', vid ) - ierr = pio_get_var( piofile, vid, vegetation_map ) - - ierr = pio_inq_varid( piofile, 'LANDMASK', vid ) - ierr = pio_get_var( piofile, vid, landmask ) - - ierr = pio_inq_varid( piofile, 'PCT_URBAN', vid ) - ierr = pio_get_var( piofile, vid, urban ) - - ierr = pio_inq_varid( piofile, 'PCT_LAKE', vid ) - ierr = pio_get_var( piofile, vid, lake ) - - ierr = pio_inq_varid( piofile, 'PCT_WETLAND', vid ) - ierr = pio_get_var( piofile, vid, wetland ) - - call cam_pio_closefile( piofile ) - - !--------------------------------------------------------------------------- - ! scale vegetation, urban, lake, and wetland to fraction - !--------------------------------------------------------------------------- - vegetation_map(:,:,:) = .01_r8 * vegetation_map(:,:,:) - wetland(:,:) = .01_r8 * wetland(:,:) - lake(:,:) = .01_r8 * lake(:,:) - urban(:,:) = .01_r8 * urban(:,:) -#ifdef DEBUG - if(masterproc) then - write(iulog,*) 'minmax vegetation_map ',minval(vegetation_map),maxval(vegetation_map) - write(iulog,*) 'minmax wetland ',minval(wetland),maxval(wetland) - write(iulog,*) 'minmax landmask ',minval(landmask),maxval(landmask) - end if -#endif - !--------------------------------------------------------------------------- - ! ... define lat-lon of vegetation map (1x1) - !--------------------------------------------------------------------------- - lat_veg(:) = (/ (-89.5_r8 + (i-1),i=1,nlat_veg ) /) - lon_veg(:) = (/ ( 0.5_r8 + (i-1),i=1,nlon_veg ) /) - lat_veg_edge(:) = (/ (-90.0_r8 + (i-1),i=1,nlat_veg+1) /) - lon_veg_edge(:) = (/ ( 0.0_r8 + (i-1),i=1,nlon_veg+1) /) - !--------------------------------------------------------------------------- - ! ... read soilw table if necessary - !--------------------------------------------------------------------------- - - if( do_soilw ) then - call soilw_inti( clim_soilw_file, nlon_veg, nlat_veg, soilw_map ) - end if - - !--------------------------------------------------------------------------- - ! ... regrid to model grid - !--------------------------------------------------------------------------- - - call interp_map( plon, plat, nlon_veg, nlat_veg, npft_veg, lat_veg, lat_veg_edge, & - lon_veg, lon_veg_edge, landmask, urban, lake, & - wetland, vegetation_map, soilw_map, do_soilw ) - - deallocate( vegetation_map, work, stat=astat ) - deallocate( lon_veg, lat_veg, lon_veg_edge, lat_veg_edge, stat=astat ) - deallocate( landmask, urban, lake, wetland, stat=astat ) - if( do_soilw ) then - deallocate( soilw_map, stat=astat ) - end if - endif ! Unstructured grid - - if (drydep_method == DD_XLND) then - return - endif - - !--------------------------------------------------------------------------- - ! ... read LAI based season indeces - !--------------------------------------------------------------------------- - call getfil (season_wes_file, locfn, 0) - call cam_pio_openfile (piofile, trim(locfn), PIO_NOWRITE) - !--------------------------------------------------------------------------- - ! ... get the dimensions - !--------------------------------------------------------------------------- - ierr = pio_inq_dimid( piofile, 'lat', dimid ) - ierr = pio_inq_dimlen( piofile, dimid, nlat_lai ) - ierr = pio_inq_dimid( piofile, 'pft', dimid ) - ierr = pio_inq_dimlen( piofile, dimid, npft_lai ) - !--------------------------------------------------------------------------- - ! ... allocate arrays - !--------------------------------------------------------------------------- - allocate( lat_lai(nlat_lai), wk_lai(nlat_lai,npft_lai,12), stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate vegation_map; error = ',astat - call endrun - end if - !--------------------------------------------------------------------------- - ! ... read the latitude and the season indicies - !--------------------------------------------------------------------------- - ierr = pio_inq_varid( piofile, 'lat', vid ) - ierr = pio_get_var( piofile, vid, lat_lai ) - - ierr = pio_inq_varid( piofile, 'season_wes', vid ) - ierr = pio_get_var( piofile, vid, wk_lai ) - - call cam_pio_closefile( piofile ) - - - if(dycore_is('UNSTRUCTURED') ) then - ! For unstructured grids plon is the 1d horizontal grid size and plat=1 - allocate(clat(plon)) - call get_horiz_grid_d(plon, clat_d_out=clat) - jl = 1 - ju = plon - else - allocate(clat(plat)) - call get_horiz_grid_d(plat, clat_d_out=clat) - jl = 1 - ju = plat - end if - imin = 1 - do j = 1,ju - diff_min = 10._r8 - pos_min = -99 - target_lat = clat(j)*r2d - do i = imin,nlat_lai - if( abs(lat_lai(i) - target_lat) < diff_min ) then - diff_min = abs(lat_lai(i) - target_lat) - pos_min = i - end if - end do - if( pos_min < 0 ) then - write(iulog,*) 'dvel_inti: cannot find ',target_lat,' at j,pos_min,diff_min = ',j,pos_min,diff_min - write(iulog,*) 'dvel_inti: imin,nlat_lai = ',imin,nlat_lai - write(iulog,*) 'dvel_inti: lat_lai' - write(iulog,'(1p,10g12.5)') lat_lai(:) - call endrun - end if - if(dycore_is('UNSTRUCTURED') ) then - imin=1 - else - imin = pos_min - end if - index_season_lai_j(:,:) = wk_lai(pos_min,:,:) - - !--------------------------------------------------------------------------- - ! specify the season as the most frequent in the 11 vegetation classes - ! this was done to remove a banding problem in dvel (JFL Oct 04) - !--------------------------------------------------------------------------- - do m = 1,12 - num_seas = 0 - do l = 1,11 - do k = 1,5 - if( index_season_lai_j(l,m) == k ) then - num_seas(k) = num_seas(k) + 1 - exit - end if - end do - end do - - num_max = -1 - do k = 1,5 - if( num_seas(k) > num_max ) then - num_max = num_seas(k) - k_max = k - endif - end do - - index_season_lai(j,m) = k_max - end do - end do - - deallocate( lat_lai, wk_lai, clat, index_season_lai_j) - - end subroutine dvel_inti_xactive - - subroutine dvel_inti_xactive_landuse( depvel_lnd_file, clim_soilw_file ) - !------------------------------------------------------------------------------------- - ! ... intialize interactive drydep - !------------------------------------------------------------------------------------- - use dycore, only : dycore_is - use mo_constants, only : r2d - use chem_mods, only : adv_mass - use mo_chem_utls, only : get_spc_ndx ! Replaced, TMMF - use seq_drydep_mod,only : drydep_method, DD_XATM, DD_XLND - use phys_control, only : phys_getopts - - implicit none - - !------------------------------------------------------------------------------------- - ! ... dummy arguments - !------------------------------------------------------------------------------------- - character(len=*), intent(in) :: depvel_lnd_file, clim_soilw_file - - !------------------------------------------------------------------------------------- - ! ... local variables - !------------------------------------------------------------------------------------- - integer :: i, j, ii, jj, jl, ju - integer :: nlon_veg, nlat_veg, npft_veg - integer :: nlat_lai, npft_lai, pos_min, imin - integer :: dimid - integer :: m, n, l, id - integer :: length1, astat - integer :: k, num_max, k_max - integer :: num_seas(5) - integer :: plon, plat - integer :: ierr, ndx - - real(r8) :: spc_mass - real(r8) :: diff_min, target_lat - real(r8), allocatable :: vegetation_map(:,:,:) - real(r8), pointer :: soilw_map(:,:,:) - real(r8), allocatable :: work(:,:) - real(r8), allocatable :: landmask(:,:) - real(r8), allocatable :: urban(:,:) - real(r8), allocatable :: lake(:,:) - real(r8), allocatable :: wetland(:,:) - real(r8), allocatable :: lon_veg(:) - real(r8), allocatable :: lon_veg_edge(:) - real(r8), allocatable :: lat_veg(:) - real(r8), allocatable :: lat_veg_edge(:) - character(len=32) :: test_name - character(len=4) :: tag_name - type(file_desc_t) :: piofile - type(var_desc_t) :: vid - logical :: do_soilw - - character(len=shr_kind_cl) :: locfn - logical :: prog_modal_aero - - ! determine if modal aerosols are active so that fraction_landuse array is initialized for modal aerosal dry dep - call phys_getopts(prog_modal_aero_out=prog_modal_aero) - - call dvel_inti_fromlnd() - - !--------------------------------------------------------------------------- - ! ... allocate module variables - !--------------------------------------------------------------------------- - if (drydep_method == DD_XLND .and. (.not.prog_modal_aero)) then - return - endif - - do_soilw = .not. dyn_soilw - allocate( fraction_landuse(pcols,n_land_type, begchunk:endchunk),stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate fraction_landuse; error = ',astat - call endrun - end if - if(do_soilw) then - allocate(soilw_3d(pcols,12,begchunk:endchunk),stat=astat) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate soilw_3d error = ',astat - call endrun - end if - end if - - plon = get_dyn_grid_parm('plon') - plat = get_dyn_grid_parm('plat') - if(dycore_is('UNSTRUCTURED') ) then - call get_landuse_and_soilw_from_file(do_soilw) - else - !--------------------------------------------------------------------------- - ! ... read landuse map - !--------------------------------------------------------------------------- - call getfil (depvel_lnd_file, locfn, 0) - call cam_pio_openfile (piofile, trim(locfn), PIO_NOWRITE) - !--------------------------------------------------------------------------- - ! ... get the dimensions - !--------------------------------------------------------------------------- - ierr = pio_inq_dimid( piofile, 'lon', dimid ) - ierr = pio_inq_dimlen( piofile, dimid, nlon_veg ) - ierr = pio_inq_dimid( piofile, 'lat', dimid ) - ierr = pio_inq_dimlen( piofile, dimid, nlat_veg ) - ierr = pio_inq_dimid( piofile, 'pft', dimid ) - ierr = pio_inq_dimlen( piofile, dimid, npft_veg ) - !--------------------------------------------------------------------------- - ! ... allocate arrays - !--------------------------------------------------------------------------- - allocate( vegetation_map(nlon_veg,nlat_veg,npft_veg), work(nlon_veg,nlat_veg), stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate vegation_map; error = ',astat - call endrun - end if - allocate( urban(nlon_veg,nlat_veg), lake(nlon_veg,nlat_veg), & - landmask(nlon_veg,nlat_veg), wetland(nlon_veg,nlat_veg), stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate vegation_map; error = ',astat - call endrun - end if - allocate( lon_veg(nlon_veg), lat_veg(nlat_veg), & - lon_veg_edge(nlon_veg+1), lat_veg_edge(nlat_veg+1), stat=astat ) - if( astat /= 0 ) then - write(iulog,*) 'dvel_inti: failed to allocate vegation lon, lat arrays; error = ',astat - call endrun - end if - !--------------------------------------------------------------------------- - ! ... read the vegetation map and landmask - !--------------------------------------------------------------------------- - ierr = pio_inq_varid( piofile, 'PCT_PFT', vid ) - ierr = pio_get_var( piofile, vid, vegetation_map ) - - ierr = pio_inq_varid( piofile, 'LANDMASK', vid ) - ierr = pio_get_var( piofile, vid, landmask ) - - ierr = pio_inq_varid( piofile, 'PCT_URBAN', vid ) - ierr = pio_get_var( piofile, vid, urban ) - - ierr = pio_inq_varid( piofile, 'PCT_LAKE', vid ) - ierr = pio_get_var( piofile, vid, lake ) - - ierr = pio_inq_varid( piofile, 'PCT_WETLAND', vid ) - ierr = pio_get_var( piofile, vid, wetland ) - - call cam_pio_closefile( piofile ) - - !--------------------------------------------------------------------------- - ! scale vegetation, urban, lake, and wetland to fraction - !--------------------------------------------------------------------------- - vegetation_map(:,:,:) = .01_r8 * vegetation_map(:,:,:) - wetland(:,:) = .01_r8 * wetland(:,:) - lake(:,:) = .01_r8 * lake(:,:) - urban(:,:) = .01_r8 * urban(:,:) -#ifdef DEBUG - if(masterproc) then - write(iulog,*) 'minmax vegetation_map ',minval(vegetation_map),maxval(vegetation_map) - write(iulog,*) 'minmax wetland ',minval(wetland),maxval(wetland) - write(iulog,*) 'minmax landmask ',minval(landmask),maxval(landmask) - end if -#endif - !--------------------------------------------------------------------------- - ! ... define lat-lon of vegetation map (1x1) - !--------------------------------------------------------------------------- - lat_veg(:) = (/ (-89.5_r8 + (i-1),i=1,nlat_veg ) /) - lon_veg(:) = (/ ( 0.5_r8 + (i-1),i=1,nlon_veg ) /) - lat_veg_edge(:) = (/ (-90.0_r8 + (i-1),i=1,nlat_veg+1) /) - lon_veg_edge(:) = (/ ( 0.0_r8 + (i-1),i=1,nlon_veg+1) /) - !--------------------------------------------------------------------------- - ! ... read soilw table if necessary - !--------------------------------------------------------------------------- - - if( do_soilw ) then - call soilw_inti( clim_soilw_file, nlon_veg, nlat_veg, soilw_map ) - end if - - !--------------------------------------------------------------------------- - ! ... regrid to model grid - !--------------------------------------------------------------------------- - - call interp_map( plon, plat, nlon_veg, nlat_veg, npft_veg, lat_veg, lat_veg_edge, & - lon_veg, lon_veg_edge, landmask, urban, lake, & - wetland, vegetation_map, soilw_map, do_soilw ) - - deallocate( vegetation_map, work, stat=astat ) - deallocate( lon_veg, lat_veg, lon_veg_edge, lat_veg_edge, stat=astat ) - deallocate( landmask, urban, lake, wetland, stat=astat ) - if( do_soilw ) then - deallocate( soilw_map, stat=astat ) - end if - endif ! Unstructured grid - - end subroutine dvel_inti_xactive_landuse - - !------------------------------------------------------------------------------------- - subroutine get_landuse_and_soilw_from_file(do_soilw) - use ncdio_atm, only : infld - logical, intent(in) :: do_soilw - logical :: readvar - - type(file_desc_t) :: piofile - character(len=shr_kind_cl) :: locfn - logical :: lexist - - call getfil (drydep_srf_file, locfn, 1, lexist) - if(lexist) then - call cam_pio_openfile(piofile, locfn, PIO_NOWRITE) - - call infld('fraction_landuse', piofile, 'ncol','class',1,pcols,1,n_land_type, begchunk,endchunk, & - fraction_landuse, readvar, gridname='physgrid') - if (.not. readvar) then - write(iulog,*)'**************************************' - write(iulog,*)'get_landuse_and_soilw_from_file: INFO:' - write(iulog,*)' fraction_landuse not read from file: ' - write(iulog,*)' ', trim(locfn) - write(iulog,*)' setting all values to zero' - write(iulog,*)'**************************************' - fraction_landuse = 0._r8 - end if - - if(do_soilw) then - call infld('soilw', piofile, 'ncol','month',1,pcols,1,12, begchunk,endchunk, & - soilw_3d, readvar, gridname='physgrid') - end if - - call cam_pio_closefile(piofile) - else - call endrun('Unstructured grids require drydep_srf_file ') - end if - - - end subroutine get_landuse_and_soilw_from_file - - !------------------------------------------------------------------------------------- - subroutine interp_map( plon, plat, nlon_veg, nlat_veg, npft_veg, lat_veg, lat_veg_edge, & - lon_veg, lon_veg_edge, landmask, urban, lake, & - wetland, vegetation_map, soilw_map, do_soilw ) - - use mo_constants, only : r2d - use scamMod, only : latiop,loniop,scmlat,scmlon,scm_cambfb_mode - use shr_scam_mod , only: shr_scam_getCloseLatLon ! Standardized system subroutines - use cam_initfiles, only: initial_file_get_id - use dycore, only : dycore_is - use phys_grid, only : scatter_field_to_chunk - implicit none - - !------------------------------------------------------------------------------------- - ! ... dummy arguments - !------------------------------------------------------------------------------------- - integer, intent(in) :: plon, plat, nlon_veg, nlat_veg, npft_veg - real(r8), pointer :: soilw_map(:,:,:) - real(r8), intent(in) :: landmask(nlon_veg,nlat_veg) - real(r8), intent(in) :: urban(nlon_veg,nlat_veg) - real(r8), intent(in) :: lake(nlon_veg,nlat_veg) - real(r8), intent(in) :: wetland(nlon_veg,nlat_veg) - real(r8), intent(in) :: vegetation_map(nlon_veg,nlat_veg,npft_veg) - real(r8), intent(in) :: lon_veg(nlon_veg) - real(r8), intent(in) :: lon_veg_edge(nlon_veg+1) - real(r8), intent(in) :: lat_veg(nlat_veg) - real(r8), intent(in) :: lat_veg_edge(nlat_veg+1) - logical, intent(in) :: do_soilw - - !------------------------------------------------------------------------------------- - ! ... local variables - !------------------------------------------------------------------------------------- - real(r8) :: closelat,closelon - integer :: latidx,lonidx - - integer, parameter :: veg_ext = 20 - type(file_desc_t), pointer :: piofile - integer :: i, j, ii, jj, jl, ju, i_ndx, n - integer, dimension(plon+1) :: ind_lon - integer, dimension(plat+1) :: ind_lat - real(r8) :: total_land - real(r8), dimension(plon+1) :: lon_edge - real(r8), dimension(plat+1) :: lat_edge - real(r8) :: lat1, lat2, lon1, lon2 - real(r8) :: x1, x2, y1, y2, dx, dy - real(r8) :: area, total_area - real(r8), dimension(npft_veg+3) :: fraction - real(r8) :: total_soilw_area - real(r8) :: fraction_soilw - real(r8) :: total_soilw(12) - - real(r8), dimension(-veg_ext:nlon_veg+veg_ext) :: lon_veg_edge_ext - integer, dimension(-veg_ext:nlon_veg+veg_ext) :: mapping_ext - - real(r8), allocatable :: lam(:), phi(:), garea(:) - - logical, parameter :: has_npole = .true. - integer :: ploniop,platiop - real(r8) :: tmp_frac_lu(plon,n_land_type,plat), tmp_soilw_3d(plon,12,plat) - - if(dycore_is('UNSTRUCTURED') ) then - ! For unstructured grids plon is the 1d horizontal grid size and plat=1 - allocate(lam(plon), phi(plon)) - call get_horiz_grid_d(plon, clat_d_out=phi) - else - allocate(lam(plon), phi(plat)) - call get_horiz_grid_d(plat, clat_d_out=phi) - endif - call get_horiz_grid_d(plon, clon_d_out=lam) - - - jl = 1 - ju = plon - - if (single_column) then - if (scm_cambfb_mode) then - piofile => initial_file_get_id() - call shr_scam_getCloseLatLon(piofile%fh,scmlat,scmlon,closelat,closelon,latidx,lonidx) - ploniop=size(loniop) - platiop=size(latiop) - else - latidx=1 - lonidx=1 - ploniop=1 - platiop=1 - end if - - lon_edge(1) = loniop(lonidx) * r2d - .5_r8*(loniop(2) - loniop(1)) * r2d - - if (lonidx.lt.ploniop) then - lon_edge(2) = loniop(lonidx+1) * r2d - .5_r8*(loniop(2) - loniop(1)) * r2d - else - lon_edge(2) = lon_edge(1) + (loniop(2) - loniop(1)) * r2d - end if - - lat_edge(1) = latiop(latidx) * r2d - .5_r8*(latiop(2) - latiop(1)) * r2d - - if (latidx.lt.platiop) then - lat_edge(2) = latiop(latidx+1) * r2d - .5_r8*(latiop(2) - latiop(1)) * r2d - else - lat_edge(2) = lat_edge(1) + (latiop(2) - latiop(1)) * r2d - end if - else - do i = 1,plon - lon_edge(i) = lam(i) * r2d - .5_r8*(lam(2) - lam(1)) * r2d - end do - lon_edge(plon+1) = lon_edge(plon) + (lam(2) - lam(1)) * r2d - if( .not. has_npole ) then - do j = 1,plat+1 - lat_edge(j) = phi(j) * r2d - .5_r8*(phi(2) - phi(1)) * r2d - end do - else - do j = 1,plat - lat_edge(j) = phi(j) * r2d - .5_r8*(phi(2) - phi(1)) * r2d - end do - lat_edge(plat+1) = lat_edge(plat) + (phi(2) - phi(1)) * r2d - end if - end if - do j = 1,plat+1 - lat_edge(j) = min( lat_edge(j), 90._r8 ) - lat_edge(j) = max( lat_edge(j),-90._r8 ) - end do - - !------------------------------------------------------------------------------------- - ! wrap around the longitudes - !------------------------------------------------------------------------------------- - do i = -veg_ext,0 - lon_veg_edge_ext(i) = lon_veg_edge(nlon_veg+i) - 360._r8 - mapping_ext (i) = nlon_veg+i - end do - do i = 1,nlon_veg - lon_veg_edge_ext(i) = lon_veg_edge(i) - mapping_ext (i) = i - end do - do i = nlon_veg+1,nlon_veg+veg_ext - lon_veg_edge_ext(i) = lon_veg_edge(i-nlon_veg) + 360._r8 - mapping_ext (i) = i-nlon_veg - end do -#ifdef DEBUG - write(iulog,*) 'interp_map : lon_edge ',lon_edge - write(iulog,*) 'interp_map : lat_edge ',lat_edge - write(iulog,*) 'interp_map : mapping_ext ',mapping_ext -#endif - do j = 1,plon+1 - lon1 = lon_edge(j) - do i = -veg_ext,nlon_veg+veg_ext - dx = lon_veg_edge_ext(i ) - lon1 - dy = lon_veg_edge_ext(i+1) - lon1 - if( dx*dy <= 0._r8 ) then - ind_lon(j) = i - exit - end if - end do - end do - - do j = 1,plat+1 - lat1 = lat_edge(j) - do i = 1,nlat_veg - dx = lat_veg_edge(i ) - lat1 - dy = lat_veg_edge(i+1) - lat1 - if( dx*dy <= 0._r8 ) then - ind_lat(j) = i - exit - end if - end do - end do -#ifdef DEBUG - write(iulog,*) 'interp_map : ind_lon ',ind_lon - write(iulog,*) 'interp_map : ind_lat ',ind_lat -#endif - lat_loop : do j = 1,plat - lon_loop : do i = 1,plon - total_area = 0._r8 - fraction = 0._r8 - total_soilw(:) = 0._r8 - total_soilw_area = 0._r8 - do jj = ind_lat(j),ind_lat(j+1) - y1 = max( lat_edge(j),lat_veg_edge(jj) ) - y2 = min( lat_edge(j+1),lat_veg_edge(jj+1) ) - dy = (y2 - y1)/(lat_veg_edge(jj+1) - lat_veg_edge(jj)) - do ii =ind_lon(i),ind_lon(i+1) - i_ndx = mapping_ext(ii) - x1 = max( lon_edge(i),lon_veg_edge_ext(ii) ) - x2 = min( lon_edge(i+1),lon_veg_edge_ext(ii+1) ) - dx = (x2 - x1)/(lon_veg_edge_ext(ii+1) - lon_veg_edge_ext(ii)) - area = dx * dy - total_area = total_area + area - !----------------------------------------------------------------- - ! ... special case for ocean grid point - !----------------------------------------------------------------- - if( nint(landmask(i_ndx,jj)) == 0 ) then - fraction(npft_veg+1) = fraction(npft_veg+1) + area - else - do n = 1,npft_veg - fraction(n) = fraction(n) + vegetation_map(i_ndx,jj,n) * area - end do - fraction(npft_veg+1) = fraction(npft_veg+1) + area * lake (i_ndx,jj) - fraction(npft_veg+2) = fraction(npft_veg+2) + area * wetland(i_ndx,jj) - fraction(npft_veg+3) = fraction(npft_veg+3) + area * urban (i_ndx,jj) - !----------------------------------------------------------------- - ! ... check if land accounts for the whole area. - ! If not, the remaining area is in the ocean - !----------------------------------------------------------------- - total_land = sum(vegetation_map(i_ndx,jj,:)) & - + urban (i_ndx,jj) & - + lake (i_ndx,jj) & - + wetland(i_ndx,jj) - if( total_land < 1._r8 ) then - fraction(npft_veg+1) = fraction(npft_veg+1) + (1._r8 - total_land) * area - end if - !------------------------------------------------------------------------------------- - ! ... compute weighted average of soilw over grid (non-water only) - !------------------------------------------------------------------------------------- - if( do_soilw ) then - fraction_soilw = total_land - (lake(i_ndx,jj) + wetland(i_ndx,jj)) - total_soilw_area = total_soilw_area + fraction_soilw * area - total_soilw(:) = total_soilw(:) + fraction_soilw * area * soilw_map(i_ndx,jj,:) - end if - end if - end do - end do - !------------------------------------------------------------------------------------- - ! ... divide by total area of grid box - !------------------------------------------------------------------------------------- - fraction(:) = fraction(:)/total_area - !------------------------------------------------------------------------------------- - ! ... make sure we don't have too much or too little - !------------------------------------------------------------------------------------- - if( abs( sum(fraction) - 1._r8) > .001_r8 ) then - fraction(:) = fraction(:)/sum(fraction) - end if - !------------------------------------------------------------------------------------- - ! ... map to Wesely land classification - !------------------------------------------------------------------------------------- - - - - - tmp_frac_lu(i, 1, j) = fraction(20) ! Urban - tmp_frac_lu(i, 2, j) = sum(fraction(16:17)) ! - tmp_frac_lu(i, 3, j) = sum(fraction(13:15)) ! - tmp_frac_lu(i, 4, j) = sum(fraction( 5: 9)) ! - tmp_frac_lu(i, 5, j) = sum(fraction( 2: 4)) ! - tmp_frac_lu(i, 6, j) = fraction(19) ! Wetland - tmp_frac_lu(i, 7, j) = fraction(18) ! Lake - tmp_frac_lu(i, 8, j) = fraction( 1) ! - tmp_frac_lu(i, 9, j) = 0._r8 - tmp_frac_lu(i,10, j) = 0._r8 - tmp_frac_lu(i,11, j) = sum(fraction(10:12)) ! - if( do_soilw ) then - if( total_soilw_area > 0._r8 ) then - tmp_soilw_3d(i,:,j) = total_soilw(:)/total_soilw_area - else - tmp_soilw_3d(i,:,j) = -99._r8 - end if - end if - end do lon_loop - end do lat_loop - !------------------------------------------------------------------------------------- - ! ... reshape according to lat-lon blocks - !------------------------------------------------------------------------------------- - call scatter_field_to_chunk(1,n_land_type,1,plon,tmp_frac_lu,fraction_landuse) - if(do_soilw) call scatter_field_to_chunk(1,12,1,plon,tmp_soilw_3d,soilw_3d) - !------------------------------------------------------------------------------------- - ! ... make sure there are no out of range values - !------------------------------------------------------------------------------------- - where (fraction_landuse < 0._r8) fraction_landuse = 0._r8 - where (fraction_landuse > 1._r8) fraction_landuse = 1._r8 - - end subroutine interp_map - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - subroutine drydep_xactive( ncdate, sfc_temp, pressure_sfc, & - wind_speed, spec_hum, air_temp, pressure_10m, rain, & - snow, solar_flux, dvel, dflx, State_Chm, & - tv, soilw, rh, ncol, lonndx, latndx, lchnk, & - ocnfrc, icefrc, beglandtype, endlandtype ) - !------------------------------------------------------------------------------------- - ! code based on wesely (atmospheric environment, 1989, vol 23, p. 1293-1304) for - ! calculation of r_c, and on walcek et. al. (atmospheric enviroment, 1986, - ! vol. 20, p. 949-964) for calculation of r_a and r_b - ! - ! as suggested in walcek (u_i)(u*_i) = (u_a)(u*_a) - ! is kept constant where i represents a subgrid environment and a the - ! grid average environment. thus the calculation proceeds as follows: - ! va the grid averaged wind is calculated on dots - ! z0(i) the grid averaged roughness coefficient is calculated - ! ri(i) the grid averaged richardson number is calculated - ! --> the grid averaged (u_a)(u*_a) is calculated - ! --> subgrid scale u*_i is calculated assuming (u_i) given as above - ! --> final deposotion velocity is weighted average of subgrid scale velocities - ! - ! code written by P. Hess, rewritten in fortran 90 by JFL (August 2000) - ! modified by JFL to be used in MOZART-2 (October 2002) - !------------------------------------------------------------------------------------- - - use seq_drydep_mod, only: z0, rgso, rgss, h2_a, h2_b, h2_c, ri, rclo, rcls, rlu, rac - use seq_drydep_mod, only: seq_drydep_setHCoeff, foxd, drat - use physconst, only: tmelt - use seq_drydep_mod, only: drydep_method, DD_XLND - - implicit none - - !------------------------------------------------------------------------------------- - ! ... dummy arguments - !------------------------------------------------------------------------------------- - integer, intent(in) :: ncol - integer, intent(in) :: ncdate ! present date (yyyymmdd) - real(r8), intent(in) :: sfc_temp(pcols) ! surface temperature (K) - real(r8), intent(in) :: pressure_sfc(pcols) ! surface pressure (Pa) - real(r8), intent(in) :: wind_speed(pcols) ! 10 meter wind speed (m/s) - real(r8), intent(in) :: spec_hum(pcols) ! specific humidity (kg/kg) - real(r8), intent(in) :: rh(ncol,1) ! relative humidity - real(r8), intent(in) :: air_temp(pcols) ! surface air temperature (K) - real(r8), intent(in) :: pressure_10m(pcols) ! 10 meter pressure (Pa) - real(r8), intent(in) :: rain(pcols) - real(r8), intent(in) :: snow(pcols) ! snow height (m) - real(r8), intent(in) :: soilw(pcols) ! soil moisture fraction - real(r8), intent(in) :: solar_flux(pcols) ! direct shortwave radiation at surface (W/m^2) - real(r8), intent(in) :: tv(pcols) ! potential temperature - type(ChmState), intent(in):: State_Chm ! GEOS-Chem State Chem - real(r8), intent(out) :: dvel(ncol,nTracersMax) ! deposition velocity (cm/s) - real(r8), intent(inout) :: dflx(pcols,nTracersMax) ! deposition flux (/cm^2/s) - - integer, intent(in) :: latndx(pcols) ! chunk latitude indicies - integer, intent(in) :: lonndx(pcols) ! chunk longitude indicies - integer, intent(in) :: lchnk ! chunk number - - integer, intent(in), optional :: beglandtype - integer, intent(in), optional :: endlandtype - - real(r8), intent(in), optional :: ocnfrc(pcols) - real(r8), intent(in), optional :: icefrc(pcols) - - !------------------------------------------------------------------------------------- - ! ... local variables - !------------------------------------------------------------------------------------- - real(r8), parameter :: scaling_to_cm_per_s = 100._r8 - real(r8), parameter :: rain_threshold = 1.e-7_r8 ! of the order of 1cm/day expressed in m/s - - integer :: i, ispec, lt, m - integer :: sndx - integer :: month - - real(r8) :: slope = 0._r8 - real(r8) :: z0water ! revised z0 over water - real(r8) :: p ! pressure at midpoint first layer - real(r8) :: pg ! surface pressure - real(r8) :: es ! saturation vapor pressure - real(r8) :: ws ! saturation mixing ratio - real(r8) :: hvar ! constant to compute xmol - real(r8) :: h ! constant to compute xmol - real(r8) :: psih ! stability correction factor - real(r8) :: rs ! constant for calculating rsmx - real(r8) :: rmx ! resistance by vegetation - real(r8) :: zovl ! ratio of z to m-o length - real(r8) :: cvarb ! cvar averaged over landtypes - real(r8) :: bb ! b averaged over landtypes - real(r8) :: ustarb ! ustar averaged over landtypes - real(r8) :: tc(ncol) ! temperature in celsius - real(r8) :: cts(ncol) ! correction to rlu rcl and rgs for frost - - !------------------------------------------------------------------------------------- - ! local arrays: dependent on location and species - !------------------------------------------------------------------------------------- - real(r8), dimension(ncol,nddvels) :: heff - - !------------------------------------------------------------------------------------- - ! local arrays: dependent on location only - !------------------------------------------------------------------------------------- - integer :: index_season(ncol,n_land_type) - real(r8), dimension(ncol) :: tha ! atmospheric virtual potential temperature - real(r8), dimension(ncol) :: thg ! ground virtual potential temperature - real(r8), dimension(ncol) :: z ! height of lowest level - real(r8), dimension(ncol) :: va ! magnitude of v on cross points - real(r8), dimension(ncol) :: ribn ! richardson number - real(r8), dimension(ncol) :: qs ! saturation specific humidity - real(r8), dimension(ncol) :: crs ! multiplier to calculate crs - real(r8), dimension(ncol) :: rdc ! part of lower canopy resistance - real(r8), dimension(ncol) :: uustar ! u*ustar (assumed constant over grid) - real(r8), dimension(ncol) :: z0b ! average roughness length over grid - real(r8), dimension(ncol) :: wrk ! work array - real(r8), dimension(ncol) :: term ! work array - real(r8), dimension(ncol) :: resc ! work array - real(r8), dimension(ncol) :: lnd_frc ! work array - logical, dimension(ncol) :: unstable - logical, dimension(ncol) :: has_rain - logical, dimension(ncol) :: has_dew - - !------------------------------------------------------------------------------------- - ! local arrays: dependent on location and landtype - !------------------------------------------------------------------------------------- - real(r8), dimension(ncol,n_land_type) :: rds ! resistance for deposition of sulfate - real(r8), dimension(ncol,n_land_type) :: b ! buoyancy parameter for unstable conditions - real(r8), dimension(ncol,n_land_type) :: cvar ! height parameter - real(r8), dimension(ncol,n_land_type) :: ustar ! friction velocity - real(r8), dimension(ncol,n_land_type) :: xmol ! monin-obukhov length - - !------------------------------------------------------------------------------------- - ! local arrays: dependent on location, landtype and species - !------------------------------------------------------------------------------------- - real(r8), dimension(ncol,n_land_type,nTracersMax) :: rsmx ! vegetative resistance (plant mesophyll) - real(r8), dimension(ncol,n_land_type,nTracersMax) :: rclx ! lower canopy resistance - real(r8), dimension(ncol,n_land_type,nTracersMax) :: rlux ! vegetative resistance (upper canopy) - real(r8), dimension(ncol,n_land_type) :: rlux_o3 ! vegetative resistance (upper canopy) - real(r8), dimension(ncol,n_land_type,nTracersMax) :: rgsx ! ground resistance - real(r8) :: pmid(ncol,1) ! for seasalt aerosols - real(r8) :: tfld(ncol,1) ! for seasalt aerosols - real(r8) :: fact, vds - real(r8) :: rc ! combined surface resistance - real(r8) :: var_soilw, dv_soil_h2, fact_h2 ! h2 dvel wrking variables - logical :: fr_lnduse(ncol,n_land_type) ! wrking array - real(r8) :: dewm ! multiplier for rs when dew occurs - - real(r8) :: lcl_frc_landuse(ncol,n_land_type) - - integer :: beglt, endlt - - !------------------------------------------------------------------------------------- - ! jfl : mods for PAN - !------------------------------------------------------------------------------------- - real(r8) :: dv_pan - real(r8) :: c0_pan(11) = (/ 0.000_r8, 0.006_r8, 0.002_r8, 0.009_r8, 0.015_r8, & - 0.006_r8, 0.000_r8, 0.000_r8, 0.000_r8, 0.002_r8, 0.002_r8 /) - real(r8) :: k_pan (11) = (/ 0.000_r8, 0.010_r8, 0.005_r8, 0.004_r8, 0.003_r8, & - 0.005_r8, 0.000_r8, 0.000_r8, 0.000_r8, 0.075_r8, 0.002_r8 /) - - if (present( beglandtype)) then - beglt = beglandtype - else - beglt = 1 - endif - if (present( endlandtype)) then - endlt = endlandtype - else - endlt = n_land_type - endif - - !------------------------------------------------------------------------------------- - ! initialize - !------------------------------------------------------------------------------------- - do m = 1,nTracersMax - dvel(:,m) = 0._r8 - end do - - if( all( .not. has_dvel(:) ) ) then - return - end if - - !------------------------------------------------------------------------------------- - ! define species-dependent parameters (temperature dependent) - !------------------------------------------------------------------------------------- - call seq_drydep_setHCoeff( ncol, sfc_temp, heff ) - - do lt = 1,n_land_type - dep_ra (:,lt,lchnk) = 0._r8 - dep_rb (:,lt,lchnk) = 0._r8 - rds(:,lt) = 0._r8 - end do - - !------------------------------------------------------------------------------------- - ! ... set month - !------------------------------------------------------------------------------------- - month = mod( ncdate,10000 )/100 - - !------------------------------------------------------------------------------------- - ! define which season (relative to Northern hemisphere climate) - !------------------------------------------------------------------------------------- - - !------------------------------------------------------------------------------------- - ! define season index based on fixed LAI - !------------------------------------------------------------------------------------- - if ( drydep_method == DD_XLND ) then - index_season = 4 - else - do i = 1,ncol - index_season(i,:) = index_season_lai(latndx(i),month) - end do - endif - !------------------------------------------------------------------------------------- - ! special case for snow covered terrain - !------------------------------------------------------------------------------------- - do i = 1,ncol - if( snow(i) > .01_r8 ) then - index_season(i,:) = 4 - end if - end do - !------------------------------------------------------------------------------------- - ! scale rain and define logical arrays - !------------------------------------------------------------------------------------- - has_rain(:ncol) = rain(:ncol) > rain_threshold - - !------------------------------------------------------------------------------------- - ! loop over longitude points - !------------------------------------------------------------------------------------- - col_loop : do i = 1,ncol - p = pressure_10m(i) - pg = pressure_sfc(i) - !------------------------------------------------------------------------------------- - ! potential temperature - !------------------------------------------------------------------------------------- - tha(i) = air_temp(i) * (p00/p )**rovcp * (1._r8 + .61_r8*spec_hum(i)) - thg(i) = sfc_temp(i) * (p00/pg)**rovcp * (1._r8 + .61_r8*spec_hum(i)) - !------------------------------------------------------------------------------------- - ! height of 1st level - !------------------------------------------------------------------------------------- - z(i) = - r/grav * air_temp(i) * (1._r8 + .61_r8*spec_hum(i)) * log(p/pg) - !------------------------------------------------------------------------------------- - ! wind speed - !------------------------------------------------------------------------------------- - va(i) = max( .01_r8,wind_speed(i) ) - !------------------------------------------------------------------------------------- - ! Richardson number - !------------------------------------------------------------------------------------- - ribn(i) = z(i) * grav * (tha(i) - thg(i))/thg(i) / (va(i)*va(i)) - ribn(i) = min( ribn(i),ric ) - unstable(i) = ribn(i) < 0._r8 - !------------------------------------------------------------------------------------- - ! saturation vapor pressure (Pascals) - ! saturation mixing ratio - ! saturation specific humidity - !------------------------------------------------------------------------------------- - es = 611._r8*exp( 5414.77_r8*(sfc_temp(i) - tmelt)/(tmelt*sfc_temp(i)) ) - ws = .622_r8*es/(pg - es) - qs(i) = ws/(1._r8 + ws) - has_dew(i) = .false. - if( qs(i) <= spec_hum(i) ) then - has_dew(i) = .true. - end if - if( sfc_temp(i) < tmelt ) then - has_dew(i) = .false. - end if - !------------------------------------------------------------------------------------- - ! constant in determining rs - !------------------------------------------------------------------------------------- - tc(i) = sfc_temp(i) - tmelt - if( sfc_temp(i) > tmelt .and. sfc_temp(i) < 313.15_r8 ) then - crs(i) = (1._r8 + (200._r8/(solar_flux(i) + .1_r8))**2) * (400._r8/(tc(i)*(40._r8 - tc(i)))) - else - crs(i) = large_value - end if - !------------------------------------------------------------------------------------- - ! rdc (lower canopy res) - !------------------------------------------------------------------------------------- - rdc(i) = 100._r8*(1._r8 + 1000._r8/(solar_flux(i) + 10._r8))/(1._r8 + 1000._r8*slope) - end do col_loop - - !------------------------------------------------------------------------------------- - ! ... form working arrays - !------------------------------------------------------------------------------------- - do lt = 1,n_land_type - do i=1,ncol - if ( drydep_method == DD_XLND ) then - lcl_frc_landuse(i,lt) = 0._r8 - else - lcl_frc_landuse(i,lt) = fraction_landuse(i,lt,lchnk) - endif - enddo - end do - if ( present(ocnfrc) .and. present(icefrc) ) then - do i=1,ncol - ! land type 7 is used for ocean - ! land type 8 is used for sea ice - lcl_frc_landuse(i,7) = ocnfrc(i) - lcl_frc_landuse(i,8) = icefrc(i) - enddo - endif - do lt = 1,n_land_type - do i=1,ncol - fr_lnduse(i,lt) = lcl_frc_landuse(i,lt) > 0._r8 - enddo - end do - - !------------------------------------------------------------------------------------- - ! find grid averaged z0: z0bar (the roughness length) z_o=exp[S(f_i*ln(z_oi))] - ! this is calculated so as to find u_i, assuming u*u=u_i*u_i - !------------------------------------------------------------------------------------- - z0b(:) = 0._r8 - do lt = 1,n_land_type - do i = 1,ncol - if( fr_lnduse(i,lt) ) then - z0b(i) = z0b(i) + lcl_frc_landuse(i,lt) * log( z0(index_season(i,lt),lt) ) - end if - end do - end do - - !------------------------------------------------------------------------------------- - ! find the constant velocity uu*=(u_i)(u*_i) - !------------------------------------------------------------------------------------- - do i = 1,ncol - z0b(i) = exp( z0b(i) ) - cvarb = vonkar/log( z(i)/z0b(i) ) - !------------------------------------------------------------------------------------- - ! unstable and stable cases - !------------------------------------------------------------------------------------- - if( unstable(i) ) then - bb = 9.4_r8*(cvarb**2)*sqrt( abs(ribn(i))*z(i)/z0b(i) ) - ustarb = cvarb * va(i) * sqrt( 1._r8 - (9.4_r8*ribn(i)/(1._r8 + 7.4_r8*bb)) ) - else - ustarb = cvarb * va(i)/(1._r8 + 4.7_r8*ribn(i)) - end if - uustar(i) = va(i)*ustarb - end do - - !------------------------------------------------------------------------------------- - ! calculate the friction velocity for each land type u_i=uustar/u*_i - !------------------------------------------------------------------------------------- - do lt = beglt,endlt - do i = 1,ncol - if( fr_lnduse(i,lt) ) then - if( unstable(i) ) then - cvar(i,lt) = vonkar/log( z(i)/z0(index_season(i,lt),lt) ) - b(i,lt) = 9.4_r8*(cvar(i,lt)**2)* sqrt( abs(ribn(i))*z(i)/z0(index_season(i,lt),lt) ) - ustar(i,lt) = sqrt( cvar(i,lt)*uustar(i)*sqrt( 1._r8 - (9.4_r8*ribn(i)/(1._r8 + 7.4_r8*b(i,lt))) ) ) - else - cvar(i,lt) = vonkar/log( z(i)/z0(index_season(i,lt),lt) ) - ustar(i,lt) = sqrt( cvar(i,lt)*uustar(i)/(1._r8 + 4.7_r8*ribn(i)) ) - end if - end if - end do - end do - - !------------------------------------------------------------------------------------- - ! revise calculation of friction velocity and z0 over water - !------------------------------------------------------------------------------------- - lt = 7 - do i = 1,ncol - if( fr_lnduse(i,lt) ) then - if( unstable(i) ) then - z0water = (.016_r8*(ustar(i,lt)**2)/grav) + diffk/(9.1_r8*ustar(i,lt)) - cvar(i,lt) = vonkar/(log( z(i)/z0water )) - b(i,lt) = 9.4_r8*(cvar(i,lt)**2)*sqrt( abs(ribn(i))*z(i)/z0water ) - ustar(i,lt) = sqrt( cvar(i,lt)*uustar(i)* sqrt( 1._r8 - (9.4_r8*ribn(i)/(1._r8+ 7.4_r8*b(i,lt))) ) ) - else - z0water = (.016_r8*(ustar(i,lt)**2)/grav) + diffk/(9.1_r8*ustar(i,lt)) - cvar(i,lt) = vonkar/(log(z(i)/z0water)) - ustar(i,lt) = sqrt( cvar(i,lt)*uustar(i)/(1._r8 + 4.7_r8*ribn(i)) ) - end if - end if - end do - - !------------------------------------------------------------------------------------- - ! compute monin-obukhov length for unstable and stable conditions/ sublayer resistance - !------------------------------------------------------------------------------------- - do lt = beglt,endlt - do i = 1,ncol - if( fr_lnduse(i,lt) ) then - hvar = (va(i)/0.74_r8) * (tha(i) - thg(i)) * (cvar(i,lt)**2) - if( unstable(i) ) then ! unstable - h = hvar*(1._r8 - (9.4_r8*ribn(i)/(1._r8 + 5.3_r8*b(i,lt)))) - else - h = hvar/((1._r8+4.7_r8*ribn(i))**2) - end if - xmol(i,lt) = thg(i) * ustar(i,lt) * ustar(i,lt) / (vonkar * grav * h) - end if - end do - end do - - !------------------------------------------------------------------------------------- - ! psih - !------------------------------------------------------------------------------------- - do lt = beglt,endlt - do i = 1,ncol - if( fr_lnduse(i,lt) ) then - if( xmol(i,lt) < 0._r8 ) then - zovl = z(i)/xmol(i,lt) - zovl = max( -1._r8,zovl ) - psih = exp( .598_r8 + .39_r8*log( -zovl ) - .09_r8*(log( -zovl ))**2 ) - vds = 2.e-3_r8*ustar(i,lt) * (1._r8 + (300/(-xmol(i,lt)))**0.666_r8) - else - zovl = z(i)/xmol(i,lt) - zovl = min( 1._r8,zovl ) - psih = -5._r8 * zovl - vds = 2.e-3_r8*ustar(i,lt) - end if - dep_ra (i,lt,lchnk) = (vonkar - psih*cvar(i,lt))/(ustar(i,lt)*vonkar*cvar(i,lt)) - dep_rb (i,lt,lchnk) = (2._r8/(vonkar*ustar(i,lt))) * crb - rds(i,lt) = 1._r8/vds - end if - end do - end do - - !------------------------------------------------------------------------------------- - ! surface resistance : depends on both land type and species - ! land types are computed seperately, then resistance is computed as average of values - ! following wesely rc=(1/(rs+rm) + 1/rlu +1/(rdc+rcl) + 1/(rac+rgs))**-1 - ! - ! compute rsmx = 1/(rs+rm) : multiply by 3 if surface is wet - !------------------------------------------------------------------------------------- - species_loop1 : do ispec = 1,nTracersMax - if( has_dvel(ispec) ) then - m = map_dvel(ispec) - do lt = beglt,endlt - do i = 1,ncol - if( fr_lnduse(i,lt) ) then - sndx = index_season(i,lt) - if( ispec == o3_ndx .or. ispec == o3a_ndx .or. ispec == so2_ndx ) then - rmx = 0._r8 - else - rmx = 1._r8/(heff(i,m)/3000._r8 + 100._r8*foxd(m)) - end if - cts(i) = 1000._r8*exp( - tc(i) - 4._r8 ) ! correction for frost - rgsx(i,lt,ispec) = cts(i) + 1._r8/((heff(i,m)/(1.e5_r8*rgss(sndx,lt))) + (foxd(m)/rgso(sndx,lt))) - !------------------------------------------------------------------------------------- - ! special case for H2 and CO;; CH4 is set ot a fraction of dv(H2) - !------------------------------------------------------------------------------------- - if( ispec == h2_ndx .or. ispec == co_ndx .or. ispec == ch4_ndx ) then - if( ispec == co_ndx ) then - fact_h2 = 1.0_r8 - elseif ( ispec == h2_ndx ) then - fact_h2 = 0.5_r8 - elseif ( ispec == ch4_ndx ) then - fact_h2 = 50.0_r8 - end if - !------------------------------------------------------------------------------------- - ! no deposition on snow, ice, desert, and water - !------------------------------------------------------------------------------------- - if( lt == 1 .or. lt == 7 .or. lt == 8 .or. sndx == 4 ) then - rgsx(i,lt,ispec) = large_value - else - var_soilw = max( .1_r8,min( soilw(i),.3_r8 ) ) - if( lt == 3 ) then - var_soilw = log( var_soilw ) - end if - dv_soil_h2 = h2_c(lt) + var_soilw*(h2_b(lt) + var_soilw*h2_a(lt)) - if( dv_soil_h2 > 0._r8 ) then - rgsx(i,lt,ispec) = fact_h2/(dv_soil_h2*1.e-4_r8) - end if - end if - end if - if( lt == 7 ) then - rclx(i,lt,ispec) = large_value - rsmx(i,lt,ispec) = large_value - rlux(i,lt,ispec) = large_value - else - rs = ri(sndx,lt)*crs(i) - if ( has_dew(i) .or. has_rain(i) ) then - dewm = 3._r8 - else - dewm = 1._r8 - end if - rsmx(i,lt,ispec) = (dewm*rs*drat(m) + rmx) - !------------------------------------------------------------------------------------- - ! jfl : special case for PAN - !------------------------------------------------------------------------------------- - if( ispec == pan_ndx .or. ispec == xpan_ndx ) then - dv_pan = c0_pan(lt) * (1._r8 - exp( -k_pan(lt)*(dewm*rs*drat(m))*1.e-2_r8 )) - if( dv_pan > 0._r8 .and. sndx /= 4 ) then - rsmx(i,lt,ispec) = ( 1._r8/dv_pan ) - end if - end if - rclx(i,lt,ispec) = cts(i) + 1._r8/((heff(i,m)/(1.e5_r8*rcls(sndx,lt))) + (foxd(m)/rclo(sndx,lt))) - rlux(i,lt,ispec) = cts(i) + rlu(sndx,lt)/(1.e-5_r8*heff(i,m) + foxd(m)) - end if - end if - end do - end do - end if - end do species_loop1 - - do lt = beglt,endlt - if( lt /= 7 ) then - do i = 1,ncol - if( fr_lnduse(i,lt) ) then - sndx = index_season(i,lt) - !------------------------------------------------------------------------------------- - ! ... no effect if sfc_temp < O C - !------------------------------------------------------------------------------------- - if( sfc_temp(i) > tmelt ) then - if( has_dew(i) ) then - rlux_o3(i,lt) = 3000._r8*rlu(sndx,lt)/(1000._r8 + rlu(sndx,lt)) - if( o3_ndx > 0 ) then - rlux(i,lt,o3_ndx) = rlux_o3(i,lt) - endif - if( o3a_ndx > 0 ) then - rlux(i,lt,o3a_ndx) = rlux_o3(i,lt) - endif - end if - if( has_rain(i) ) then - ! rlux(i,lt,o3_ndx) = 1./(1.e-3 + (1./(3.*rlu(sndx,lt)))) - rlux_o3(i,lt) = 3000._r8*rlu(sndx,lt)/(1000._r8 + 3._r8*rlu(sndx,lt)) - if( o3_ndx > 0 ) then - rlux(i,lt,o3_ndx) = rlux_o3(i,lt) - endif - if( o3a_ndx > 0 ) then - rlux(i,lt,o3a_ndx) = rlux_o3(i,lt) - endif - end if - end if - - if ( o3_ndx > 0 ) then - rclx(i,lt,o3_ndx) = cts(i) + rclo(index_season(i,lt),lt) - rlux(i,lt,o3_ndx) = cts(i) + rlux(i,lt,o3_ndx) - end if - if ( o3a_ndx > 0 ) then - rclx(i,lt,o3a_ndx) = cts(i) + rclo(index_season(i,lt),lt) - rlux(i,lt,o3a_ndx) = cts(i) + rlux(i,lt,o3a_ndx) - end if - - end if - end do - end if - end do - - species_loop2 : do ispec = 1,nTracersMax - m = map_dvel(ispec) - if( has_dvel(ispec) ) then - if( ispec /= o3_ndx .and. ispec /= o3a_ndx .and. ispec /= so2_ndx ) then - do lt = beglt,endlt - if( lt /= 7 ) then - do i = 1,ncol - if( fr_lnduse(i,lt) ) then - !------------------------------------------------------------------------------------- - ! no effect if sfc_temp < O C - !------------------------------------------------------------------------------------- - if( sfc_temp(i) > tmelt ) then - if( has_dew(i) ) then - rlux(i,lt,ispec) = 1._r8/((1._r8/(3._r8*rlux(i,lt,ispec))) & - + 1.e-7_r8*heff(i,m) + foxd(m)/rlux_o3(i,lt)) - end if - end if - - end if - end do - end if - end do - else if( ispec == so2_ndx ) then - do lt = beglt,endlt - if( lt /= 7 ) then - do i = 1,ncol - if( fr_lnduse(i,lt) ) then - !------------------------------------------------------------------------------------- - ! no effect if sfc_temp < O C - !------------------------------------------------------------------------------------- - if( sfc_temp(i) > tmelt ) then - if( qs(i) <= spec_hum(i) ) then - rlux(i,lt,ispec) = 100._r8 - end if - if( has_rain(i) ) then - ! rlux(i,lt,ispec) = 1./(2.e-4 + (1./(3.*rlu(index_season(i,lt),lt)))) - rlux(i,lt,ispec) = 15._r8*rlu(index_season(i,lt),lt)/(5._r8 + 3.e-3_r8*rlu(index_season(i,lt),lt)) - end if - end if - rclx(i,lt,ispec) = cts(i) + rcls(index_season(i,lt),lt) - rlux(i,lt,ispec) = cts(i) + rlux(i,lt,ispec) - - end if - end do - end if - end do - do i = 1,ncol - if( fr_lnduse(i,1) .and. (has_dew(i) .or. has_rain(i)) ) then - rlux(i,1,ispec) = 50._r8 - end if - end do - end if - end if - end do species_loop2 - - !------------------------------------------------------------------------------------- - ! compute rc - !------------------------------------------------------------------------------------- - term(:ncol) = 1.e-2_r8 * pressure_10m(:ncol) / (r*tv(:ncol)) - species_loop3 : do ispec = 1,nTracersMax - if( has_dvel(ispec) ) then - wrk(:) = 0._r8 - lt_loop: do lt = beglt,endlt - do i = 1,ncol - if (fr_lnduse(i,lt)) then - resc(i) = 1._r8/( 1._r8/rsmx(i,lt,ispec) + 1._r8/rlux(i,lt,ispec) & - + 1._r8/(rdc(i) + rclx(i,lt,ispec)) & - + 1._r8/(rac(index_season(i,lt),lt) + rgsx(i,lt,ispec))) - - resc(i) = max( 10._r8,resc(i) ) - - lnd_frc(i) = lcl_frc_landuse(i,lt) - endif - enddo - !------------------------------------------------------------------------------------- - ! ... compute average deposition velocity - !------------------------------------------------------------------------------------- - select case( tracerNames(ispec) ) - case( 'SO2' ) - if( lt == 7 ) then - where( fr_lnduse(:ncol,lt) ) - ! assume no surface resistance for SO2 over water` - wrk(:) = wrk(:) + lnd_frc(:)/(dep_ra(:ncol,lt,lchnk) + dep_rb(:ncol,lt,lchnk)) - endwhere - else - where( fr_lnduse(:ncol,lt) ) - wrk(:) = wrk(:) + lnd_frc(:)/(dep_ra(:ncol,lt,lchnk) + dep_rb(:ncol,lt,lchnk) + resc(:)) - endwhere - end if - - ! JFL - increase in dry deposition of SO2 to improve bias over US/Europe - wrk(:) = wrk(:) * 2._r8 - - case( 'SO4' ) - where( fr_lnduse(:ncol,lt) ) - wrk(:) = wrk(:) + lnd_frc(:)/(dep_ra(:ncol,lt,lchnk) + rds(:,lt)) - endwhere - case( 'NH4', 'NH4NO3', 'XNH4NO3' ) - where( fr_lnduse(:ncol,lt) ) - wrk(:) = wrk(:) + lnd_frc(:)/(dep_ra(:ncol,lt,lchnk) + 0.5_r8*rds(:,lt)) - endwhere - - !------------------------------------------------------------------------------------- - ! ... special case for Pb (for consistency with offline code) - !------------------------------------------------------------------------------------- - case( 'Pb' ) - if( lt == 7 ) then - where( fr_lnduse(:ncol,lt) ) - wrk(:) = wrk(:) + lnd_frc(:) * 0.05e-2_r8 - endwhere - else - where( fr_lnduse(:ncol,lt) ) - wrk(:ncol) = wrk(:ncol) + lnd_frc(:ncol) * 0.2e-2_r8 - endwhere - end if - - !------------------------------------------------------------------------------------- - ! ... special case for carbon aerosols - !------------------------------------------------------------------------------------- - case( 'CB1', 'CB2', 'OC1', 'OC2', 'SOAM', 'SOAI', 'SOAT', 'SOAB','SOAX' ) - if ( drydep_method == DD_XLND ) then - where( fr_lnduse(:ncol,lt) ) - wrk(:ncol) = wrk(:ncol) + lnd_frc(:ncol) * 0.10e-2_r8 - endwhere - else - wrk(:ncol) = 0.10e-2_r8 - endif - - !------------------------------------------------------------------------------------- - ! deposition over ocean for HCN, CH3CN - ! velocity estimated from aircraft measurements (E.Apel, INTEX-B) - !------------------------------------------------------------------------------------- - case( 'HCN','CH3CN' ) - if( lt == 7 ) then ! over ocean only - where( fr_lnduse(:ncol,lt) .and. snow(:ncol) < 0.01_r8 ) - wrk(:ncol) = wrk(:ncol) + lnd_frc(:ncol) * 0.2e-2_r8 - endwhere - end if - case default - where( fr_lnduse(:ncol,lt) ) - wrk(:ncol) = wrk(:ncol) + lnd_frc(:ncol)/(dep_ra(:ncol,lt,lchnk) + dep_rb(:ncol,lt,lchnk) + resc(:ncol)) - endwhere - end select - end do lt_loop - dvel(:ncol,ispec) = wrk(:ncol) * scaling_to_cm_per_s - dflx(:ncol,ispec) = term(:ncol) * dvel(:ncol,ispec) * State_Chm%Species(1,:ncol,plev,ispec) - end if - - end do species_loop3 - - if ( beglt > 1 ) return - - !------------------------------------------------------------------------------------- - ! ... special adjustments - !------------------------------------------------------------------------------------- - if( mpan_ndx > 0 ) then - if( has_dvel(mpan_ndx) ) then - dvel(:ncol,mpan_ndx) = dvel(:ncol,mpan_ndx)/3._r8 - dflx(:ncol,mpan_ndx) = term(:ncol) * dvel(:ncol,mpan_ndx) * State_Chm%Species(1,:ncol,plev,mpan_ndx) - end if - end if - if( xmpan_ndx > 0 ) then - if( has_dvel(xmpan_ndx) ) then - dvel(:ncol,xmpan_ndx) = dvel(:ncol,xmpan_ndx)/3._r8 - dflx(:ncol,xmpan_ndx) = term(:ncol) * dvel(:ncol,xmpan_ndx) * State_Chm%Species(1,:ncol,plev,xmpan_ndx) - end if - end if - - ! HCOOH, use CH3COOH dep.vel - if( hcooh_ndx > 0) then - if( has_dvel(hcooh_ndx) ) then - dvel(:ncol,hcooh_ndx) = dvel(:ncol,ch3cooh_ndx) - dflx(:ncol,hcooh_ndx) = term(:ncol) * dvel(:ncol,hcooh_ndx) * State_Chm%Species(1,:ncol,plev,hcooh_ndx) - end if - end if -! -! SOG species -! - if( sogm_ndx > 0) then - if( has_dvel(sogm_ndx) ) then - dvel(:ncol,sogm_ndx) = dvel(:ncol,ch3cooh_ndx) - dflx(:ncol,sogm_ndx) = term(:ncol) * dvel(:ncol,sogm_ndx) * State_Chm%Species(1,:ncol,plev,sogm_ndx) - end if - end if - if( sogi_ndx > 0) then - if( has_dvel(sogi_ndx) ) then - dvel(:ncol,sogi_ndx) = dvel(:ncol,ch3cooh_ndx) - dflx(:ncol,sogi_ndx) = term(:ncol) * dvel(:ncol,sogi_ndx) * State_Chm%Species(1,:ncol,plev,sogi_ndx) - end if - end if - if( sogt_ndx > 0) then - if( has_dvel(sogt_ndx) ) then - dvel(:ncol,sogt_ndx) = dvel(:ncol,ch3cooh_ndx) - dflx(:ncol,sogt_ndx) = term(:ncol) * dvel(:ncol,sogt_ndx) * State_Chm%Species(1,:ncol,plev,sogt_ndx) - end if - end if - if( sogb_ndx > 0) then - if( has_dvel(sogb_ndx) ) then - dvel(:ncol,sogb_ndx) = dvel(:ncol,ch3cooh_ndx) - dflx(:ncol,sogb_ndx) = term(:ncol) * dvel(:ncol,sogb_ndx) * State_Chm%Species(1,:ncol,plev,sogb_ndx) - end if - end if - if( sogx_ndx > 0) then - if( has_dvel(sogx_ndx) ) then - dvel(:ncol,sogx_ndx) = dvel(:ncol,ch3cooh_ndx) - dflx(:ncol,sogx_ndx) = term(:ncol) * dvel(:ncol,sogx_ndx) * State_Chm%Species(1,:ncol,plev,sogx_ndx) - end if - end if -! - end subroutine drydep_xactive - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - subroutine soilw_inti( ncfile, nlon_veg, nlat_veg, soilw_map ) - !------------------------------------------------------------------ - ! ... read primary soil moisture table - !------------------------------------------------------------------ - - use time_manager, only : get_calday - - implicit none - - !------------------------------------------------------------------ - ! ... dummy args - !------------------------------------------------------------------ - integer, intent(in) :: & - nlon_veg, & - nlat_veg - real(r8), pointer :: soilw_map(:,:,:) - character(len=*), intent(in) :: ncfile ! file name of netcdf file containing data - - !------------------------------------------------------------------ - ! ... local variables - !------------------------------------------------------------------ - integer :: gndx = 0 - integer :: nlat, & ! # of lats in soilw file - nlon ! # of lons in soilw file - integer :: i, ip, k, m - integer :: j, jl, ju - integer :: lev, day, ierr - type(file_desc_t) :: piofile - type(var_desc_t) :: vid - - integer :: dimid_lat, dimid_lon, dimid_time - integer :: dates(12) = (/ 116, 214, 316, 415, 516, 615, & - 716, 816, 915, 1016, 1115, 1216 /) - - character(len=shr_kind_cl) :: locfn - - !----------------------------------------------------------------------- - ! ... open netcdf file - !----------------------------------------------------------------------- - call getfil (ncfile, locfn, 0) - call cam_pio_openfile (piofile, trim(locfn), PIO_NOWRITE) - - !----------------------------------------------------------------------- - ! ... get longitudes - !----------------------------------------------------------------------- - ierr = pio_inq_dimid( piofile, 'lon', dimid_lon ) - ierr = pio_inq_dimlen( piofile, dimid_lon, nlon ) - if( nlon /= nlon_veg ) then - write(iulog,*) 'soilw_inti: soil and vegetation lons differ; ',nlon, nlon_veg - call endrun - end if - !----------------------------------------------------------------------- - ! ... get latitudes - !----------------------------------------------------------------------- - ierr = pio_inq_dimid( piofile, 'lat', dimid_lat ) - ierr = pio_inq_dimlen( piofile, dimid_lat, nlat ) - if( nlat /= nlat_veg ) then - write(iulog,*) 'soilw_inti: soil and vegetation lats differ; ',nlat, nlat_veg - call endrun - end if - !----------------------------------------------------------------------- - ! ... set times (days of year) - !----------------------------------------------------------------------- - ierr = pio_inq_dimid( piofile, 'time', dimid_time ) - ierr = pio_inq_dimlen( piofile, dimid_time, ndays ) - if( ndays /= 12 ) then - write(iulog,*) 'soilw_inti: dataset not a cyclical year' - call endrun - end if - allocate( days(ndays),stat=ierr ) - if( ierr /= 0 ) then - write(iulog,*) 'soilw_inti: days allocation error = ',ierr - call endrun - end if - do m = 1,min(12,ndays) - days(m) = get_calday( dates(m), 0 ) - end do - - !------------------------------------------------------------------ - ! ... allocate arrays - !------------------------------------------------------------------ - allocate( soilw_map(nlon,nlat,ndays), stat=ierr ) - if( ierr /= 0 ) then - write(iulog,*) 'soilw_inti: soilw_map allocation error = ',ierr - call endrun - end if - - !------------------------------------------------------------------ - ! ... read in the soil moisture - !------------------------------------------------------------------ - ierr = pio_inq_varid( piofile, 'SOILW', vid ) - ierr = pio_get_var( piofile, vid, soilw_map ) - !------------------------------------------------------------------ - ! ... close file - !------------------------------------------------------------------ - call cam_pio_closefile( piofile ) - - end subroutine soilw_inti - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - subroutine chk_soilw( calday ) - !-------------------------------------------------------------------- - ! ... check timing for ub values - !-------------------------------------------------------------------- - - use mo_constants, only : dayspy - - implicit none - - !-------------------------------------------------------------------- - ! ... dummy args - !-------------------------------------------------------------------- - real(r8), intent(in) :: calday - - !-------------------------------------------------------------------- - ! ... local variables - !-------------------------------------------------------------------- - integer :: m, upper - real(r8) :: numer, denom - - !-------------------------------------------------------- - ! ... setup the time interpolation - !-------------------------------------------------------- - if( calday < days(1) ) then - next = 1 - last = ndays - else - if( days(ndays) < dayspy ) then - upper = ndays - else - upper = ndays - 1 - end if - do m = upper,1,-1 - if( calday >= days(m) ) then - exit - end if - end do - last = m - next = mod( m,ndays ) + 1 - end if - numer = calday - days(last) - denom = days(next) - days(last) - if( numer < 0._r8 ) then - numer = dayspy + numer - end if - if( denom < 0._r8 ) then - denom = dayspy + denom - end if - dels = max( min( 1._r8,numer/denom ),0._r8 ) - - end subroutine chk_soilw - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - subroutine set_soilw( soilw, lchnk, calday ) - !-------------------------------------------------------------------- - ! ... set the soil moisture - !-------------------------------------------------------------------- - - implicit none - - !-------------------------------------------------------------------- - ! ... dummy args - !-------------------------------------------------------------------- - real(r8), intent(inout) :: soilw(pcols) - integer, intent(in) :: lchnk ! chunk indice - real(r8), intent(in) :: calday - - - integer :: i, ilon,ilat - - call chk_soilw( calday ) - - soilw(:) = soilw_3d(:,last,lchnk) + dels *( soilw_3d(:,next,lchnk) - soilw_3d(:,last,lchnk)) - - end subroutine set_soilw - - !------------------------------------------------------------------------------------- - !------------------------------------------------------------------------------------- - function has_drydep( name ) - - implicit none - - character(len=*), intent(in) :: name - - logical :: has_drydep - integer :: i - - has_drydep = .false. - - do i=1,nddvels - if ( trim(name) == trim(drydep_list(i)) ) then - has_drydep = .true. - exit - endif - enddo - - endfunction has_drydep - -end module mo_drydep diff --git a/src/chemistry/geoschem/mo_drydep.F90 b/src/chemistry/geoschem/mo_drydep.F90 new file mode 120000 index 0000000000..fcb098953c --- /dev/null +++ b/src/chemistry/geoschem/mo_drydep.F90 @@ -0,0 +1 @@ +../mozart/mo_drydep.F90 \ No newline at end of file From 78010779bc270596b830d9967ba6572d64dd437f Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 15 Apr 2021 18:17:20 -0400 Subject: [PATCH 222/239] Feat: Add aerosol number emissions in CESM-GC (1) Emission diameters are taken from: Emmons, Louisa K., et al. "The chemistry mechanism in the Community Earth System Model version 2 (CESM2)." Journal of Advances in Modeling Earth Systems 12.4 (2020). Signed-off-by: Thibaud Fritz --- .../geoschem/cesmgc_emissions_mod.F90 | 78 ++++++++++++++++--- 1 file changed, 66 insertions(+), 12 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 54d75a01b9..4ee782b1a1 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -291,6 +291,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS USE PPGRID, ONLY : pcols, pver, begchunk USE CAM_HISTORY, ONLY : outfld USE STRING_UTILS, ONLY : to_upper + USE PHYSCONSTANTS, ONLY : PI ! Data from CLM USE CAM_CPL_INDICES, ONLY : index_x2a_Fall_flxvoc @@ -304,6 +305,9 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! Aerosol emissions USE AERO_MODEL, ONLY : aero_model_emissions + USE MODAL_AERO_DATA, ONLY : ntot_amode, nspec_amode + USE MODAL_AERO_DATA, ONLY : lmassptr_amode, numptr_amode + USE MODAL_AERO_DATA, ONLY : specdens_amode ! GEOS-Chem version of physical constants USE PHYSCONSTANTS, ONLY : AVO @@ -333,7 +337,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! Integers INTEGER :: LCHNK INTEGER :: nY, nZ - INTEGER :: J, L, N + INTEGER :: J, L, N, M, SM, P INTEGER :: RC ! return code INTEGER :: tmpIdx ! pbuf field id @@ -353,6 +357,12 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS REAL(r8) :: SCALFAC ! Multiplying factor REAL(r8) :: megflx(pcols) ! For MEGAN emissions REAL(r8), PARAMETER :: m2km = 1.e-3_r8 + REAL(r8) :: diam ! Emission diameter + ! for aerosols (m) + REAL(r8) :: voltonumb ! Conversion factor + ! between aerosol mass + ! and number + REAL(r8) :: rho ! Aerosol density (kg/m3) ! Strings CHARACTER(LEN=255) :: SpcName @@ -444,10 +454,10 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! apply loss flux to surface (level nZ) eflx(1:NY,nZ,id_O3) = eflx(1:NY,nZ,id_O3) - pbuf_i(1:nY) - IF ( MINVAL(eflx(:nY,nZ,id_O3)) < 0.0e+00_r8 ) THEN - Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO sfc flux after ParaNOx is negative for O3 with value ", MINVAL(eflx(:nY,:nZ,id_O3)), " at ", & - MINLOC(eflx(:nY,nZ,id_O3)) - ENDIF + !IF ( MINVAL(eflx(:nY,nZ,id_O3)) < 0.0e+00_r8 ) THEN + ! Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO sfc flux after ParaNOx is negative for O3 with value ", MINVAL(eflx(:nY,:nZ,id_O3)), " at ", & + ! MINLOC(eflx(:nY,nZ,id_O3)) + !ENDIF IF ( rootChunk .and. ( MINVAL(pbuf_i(1:nY)) < 0.0e+0_r8 ) ) THEN Write(iulog,'(a,a,a,a)') " CESMGC_Emissions_Calc: HEMCO dflx(paranox) O3 added to ", TRIM(cnst_name(id_O3)) @@ -472,10 +482,10 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS eflx(1:NY,nZ,id_HNO3) = eflx(1:NY,nZ,id_HNO3) - pbuf_i(1:nY) - IF ( MINVAL(eflx(:nY,nZ,id_HNO3)) < 0.0e+00_r8 ) THEN - Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO sfc flux after ParaNOx is negative for HNO3 with value ", MINVAL(eflx(:nY,nZ,id_HNO3)), " at ", & - MINLOC(eflx(:nY,nZ,id_HNO3)) - ENDIF + !IF ( MINVAL(eflx(:nY,nZ,id_HNO3)) < 0.0e+00_r8 ) THEN + ! Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO sfc flux after ParaNOx is negative for HNO3 with value ", MINVAL(eflx(:nY,nZ,id_HNO3)), " at ", & + ! MINLOC(eflx(:nY,nZ,id_HNO3)) + !ENDIF IF ( rootChunk .and. ( MINVAL(pbuf_i(1:nY)) < 0.0e+0_r8 ) ) THEN Write(iulog,'(a,a,a,a)') " CESMGC_Emissions_Calc: HEMCO dflx(paranox) HNO3 added to ", TRIM(cnst_name(id_HNO3)) @@ -487,8 +497,48 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS pbuf_chnk => NULL() ENDIF +#if defined( MODAL_AERO ) + + ! Estimate aerosol number emissions + ! Enumber = Emass / ( pi/6 * rho * D_emit^3 ) + ! D_emit is sector-dependent and is taken from Table S4 of: + ! Emmons, Louisa K., et al. "The chemistry mechanism in the Community Earth + ! System Model version 2 (CESM2)." Journal of Advances in Modeling Earth + ! Systems 12.4 (2020). + DO M = 1, ntot_amode + P = numptr_amode(M) + IF ( M == 1 ) THEN + ! Species affected: so4_a1 + diam = 0.134E-06_r8 + ! This diam value should be sector-dependent. + ! Agriculture, waste, solvents -> 0.134 + ! Shipping -> 0.261 + ! Energy, industrial -> 0.261 + ! Biomass burning -> 0.134 + ! Volcanoes -> 0.134 + ELSEIF ( M == 2 ) THEN + ! Species affected: so4_a2 + diam = 0.0504E-06_r8 + ELSEIF ( M == 4 ) THEN + ! Species affected: bc_a4, pom_a4 + diam = 0.134E-06_r8 + ENDIF + voltonumb = 1.0_r8 / ( PI / 6.0_r8 * diam * diam * diam ) + + IF ( M == 3 ) THEN + ! There shouldn't be any a3 number emissions, so we just enforce + ! voltonumb to be 0 + voltonumb = 0.0E-00_r8 + ENDIF + + DO SM = 1, nspec_amode(M) + N = lmassptr_amode(SM,M) + rho = specdens_amode(SM,M) + eflx(:nY,:nZ,P) = eflx(:nY,:nZ,P) & + + eflx(:nY,:nZ,N) * voltonumb / rho + ENDDO + ENDDO -#if defined( MODAL_AERO_4MODE ) !----------------------------------------------------------------------- ! Aerosol emissions (dust + seasalt) ... !----------------------------------------------------------------------- @@ -519,18 +569,22 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS #endif ! Output fields before lightning NO emissions are applied to eflx + ! Make sure that we do not include surface emissions in the diagnostics! DO N = iFirstCnst, pcnst SpcName = TRIM(cnst_name(N))//'_XFRC' + ! Convert from kg/m2/s to molec/cm3/s + ! Note 1: cnst_mw is in kg/kmole + ! Note 2: avogad is in molecules/kmole CALL Outfld( TRIM(SpcName), eflx(:nY,:nZ,N) / State_Met%BXHEIGHT(1,:nY,nZ:1:-1) * 1.0E-06 / cnst_mw(N) * avogad, nY, LCHNK ) SpcName = TRIM(cnst_name(N))//'_CLXF' ! Convert from kg/m2/s to molec/cm2/s ! Note 1: cnst_mw is in kg/kmole ! Note 2: avogad is in molecules/kmole - CALL Outfld( TRIM(SpcName), SUM(eflx(:nY,:nZ,N), DIM=2) * 1.0E-04 / cnst_mw(N) * avogad, nY, LCHNK ) + CALL Outfld( TRIM(SpcName), SUM(eflx(:nY,:nZ-1,N), DIM=2) * 1.0E-04 / cnst_mw(N) * avogad, nY, LCHNK ) SpcName = TRIM(cnst_name(N))//'_CMXF' - CALL Outfld( TRIM(SpcName), SUM(eflx(:nY,:nZ,N), DIM=2), nY, LCHNK ) + CALL Outfld( TRIM(SpcName), SUM(eflx(:nY,:nZ-1,N), DIM=2), nY, LCHNK ) ENDDO !----------------------------------------------------------------------- From d98860c43235bf4f24cfcd88cf6987bb2f21d9ca Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 21 Apr 2021 13:28:21 -0400 Subject: [PATCH 223/239] Feat: Lump GEOS-Chem SO4 with so4_a* and H2SO4 Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 279 +++++++++++++++++---------- 1 file changed, 173 insertions(+), 106 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 4951eb2de1..8a0f6ff55a 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -61,6 +61,9 @@ module chemistry use chem_mods, only : mapCnst use chem_mods, only : map2chm use chem_mods, only : map2MAM4 +#if defined( MODAL_AERO ) + use modal_aero_data, only : ntot_amode +#endif use mo_tracname, only : solsym @@ -108,11 +111,16 @@ module chemistry type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! Pointer to 2D pbuf ! Indices of critical species in GEOS-Chem - INTEGER :: iH2O, iO3, iCO2 - INTEGER :: iO, iH, iO2, iPSO4 - REAL(r8) :: MWPSO4, MWO3 + INTEGER :: iH2O, iO3, iCO2, iSO4 + INTEGER :: iO, iH, iO2 + REAL(r8) :: MWO3 ! Indices of critical species in the constituent list - INTEGER :: cQ, cH2O + INTEGER :: cQ, cH2O, cH2SO4 + ! Indices of critical species in the solsym list + INTEGER :: l_H2SO4, l_SO4 +#if defined( MODAL_AERO ) + INTEGER, ALLOCATABLE :: iSulf(:) +#endif ! Indices in the physics buffer INTEGER :: NDX_PBLH ! PBL height [m] @@ -195,7 +203,7 @@ subroutine chem_register use mo_sim_dat, only : set_sim_dat use mo_chem_utls, only : get_spc_ndx use chem_mods, only : drySpc_ndx -#if defined( MODAL_AERO_4MODE ) +#if defined( MODAL_AERO ) use aero_model, only : aero_model_register use modal_aero_data, only : nspec_max use modal_aero_data, only : ntot_amode, nspec_amode @@ -494,9 +502,10 @@ subroutine chem_register ENDIF ENDDO ! Get constituent index of specific humidity - CALL cnst_get_ind('Q', cQ, abort=.True.) - CALL cnst_get_ind('H2O', cH2O, abort=.True.) - + CALL cnst_get_ind('Q', cQ, abort=.True.) + CALL cnst_get_ind('H2O', cH2O, abort=.True.) + CALL cnst_get_ind('H2SO4', cH2SO4, abort=.True.) + !============================================================== ! Get mapping between dry deposition species and species set !============================================================== @@ -541,8 +550,12 @@ subroutine chem_register ALLOCATE(map2MAM4(nspec_max,ntot_amode), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate map2MAM4') + ALLOCATE(iSulf(ntot_amode), STAT=IERR) + IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate iSulf') + ! Initialize indices map2MAM4(:,:) = -1 + iSulf(:) = -1 DO M = 1, ntot_amode DO L = 1, nspec_amode(M) @@ -550,9 +563,9 @@ subroutine chem_register CASE ( 'BC_' ) SELECT CASE ( to_upper(xname_massptr(L,M)(4:5)) ) CASE ( 'A1' ) - map2MAM4(L,M) = Ind_('BCPI') + CALL cnst_get_ind( 'BCPI', map2MAM4(L,M) ) CASE ( 'A4' ) - map2MAM4(L,M) = Ind_('BCPO') + CALL cnst_get_ind( 'BCPO', map2MAM4(L,M) ) END SELECT CASE ( 'DST' ) SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) ) @@ -561,33 +574,34 @@ subroutine chem_register ! DST3 - Dust aerosol, Reff = 2.4 micrometers ! DST4 - Dust aerosol, Reff = 4.5 micrometers CASE ( 'A1' ) - map2MAM4(L,M) = Ind_('DST1') + CALL cnst_get_ind( 'DST1', map2MAM4(L,M) ) CASE ( 'A2' ) - map2MAM4(L,M) = Ind_('DST1') + CALL cnst_get_ind( 'DST1', map2MAM4(L,M) ) CASE ( 'A3' ) - map2MAM4(L,M) = Ind_('DST4') + CALL cnst_get_ind( 'DST4', map2MAM4(L,M) ) END SELECT CASE ( 'SOA' ) - map2MAM4(L,M) = Ind_('SOAS') + CALL cnst_get_ind( 'SOAS', map2MAM4(L,M) ) CASE ( 'SO4' ) - map2MAM4(L,M) = Ind_('SO4') + CALL cnst_get_ind( 'SO4', map2MAM4(L,M) ) + iSulf(M) = L CASE ( 'NCL' ) SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) ) ! SALA - Fine (0.01-0.05 micros) sea salt aerosol ! SALC - Coarse (0.5-8 micros) sea salt aerosol CASE ( 'A1' ) - map2MAM4(L,M) = Ind_('SALA') + CALL cnst_get_ind( 'SALA', map2MAM4(L,M) ) CASE ( 'A2' ) - map2MAM4(L,M) = Ind_('SALA') + CALL cnst_get_ind( 'SALA', map2MAM4(L,M) ) CASE ( 'A3' ) - map2MAM4(L,M) = Ind_('SALC') + CALL cnst_get_ind( 'SALC', map2MAM4(L,M) ) END SELECT CASE ( 'POM' ) SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) ) CASE ( 'A1' ) - map2MAM4(L,M) = Ind_('OCPI') + CALL cnst_get_ind( 'OCPI', map2MAM4(L,M) ) CASE ( 'A4' ) - map2MAM4(L,M) = Ind_('OCPO') + CALL cnst_get_ind( 'OCPO', map2MAM4(L,M) ) END SELECT END SELECT ENDDO @@ -645,7 +659,7 @@ subroutine chem_readnl(nlfile) use cam_abortutils, only : endrun use units, only : getunit, freeunit use namelist_utils, only : find_group_name -#if defined( MODAL_AERO_4MODE ) +#if defined( MODAL_AERO ) use aero_model, only : aero_model_readnl use dust_model, only : dust_readnl #endif @@ -946,7 +960,7 @@ subroutine chem_init(phys_state, pbuf2d) use gas_wetdep_opts, only : gas_wetdep_method use mo_neu_wetdep, only : neu_wetdep_init -#if defined( MODAL_AERO_4MODE ) +#if defined( MODAL_AERO ) use aero_model, only : aero_model_init use mo_setsox, only : sox_inti use mo_drydep, only : drydep_inti @@ -1468,7 +1482,7 @@ subroutine chem_init(phys_state, pbuf2d) ENDDO ENDIF -#if defined( MODAL_AERO_4MODE ) +#if defined( MODAL_AERO ) ! Initialize aqueous chem CALL SOx_inti() @@ -1613,24 +1627,21 @@ subroutine chem_init(phys_state, pbuf2d) iH2O = Ind_('H2O') iO3 = Ind_('O3') iCO2 = Ind_('CO2') + iSO4 = Ind_('SO4') ! The following indices are needed to compute invariants iO = Ind_('O') iH = Ind_('H') iO2 = Ind_('O2') - ! This is used to compute gas-phase H2SO4 production - iPSO4 = Ind_('PSO4') - SpcInfo => State_Chm(BEGCHUNK)%SpcData(iPSO4)%Info - MWPSO4 = REAL(SpcInfo%MW_g,r8) - ! Free pointer - SpcInfo => NULL() - ! This is used to compute overhead ozone column SpcInfo => State_Chm(BEGCHUNK)%SpcData(iO3)%Info MWO3 = REAL(SpcInfo%MW_g,r8) ! Free pointer SpcInfo => NULL() + l_H2SO4 = get_spc_ndx('H2SO4') + l_SO4 = get_spc_ndx('SO4') + ! Get indices for physical fields in physics buffer NDX_PBLH = pbuf_get_index('pblh' ) NDX_FSDS = pbuf_get_index('FSDS' ) @@ -1820,10 +1831,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use mo_ghg_chem, only : ghg_chem_set_flbc use mo_neu_wetdep, only : neu_wetdep_tend use gas_wetdep_opts, only : gas_wetdep_method -#if defined( MODAL_AERO_4MODE ) +#if defined( MODAL_AERO ) use modal_aero_data, only : ntot_amode, nspec_amode - use modal_aero_data, only : lmassptr_amode - use modal_aero_data, only : xname_massptr + use modal_aero_data, only : lmassptr_amode, numptr_amode + use modal_aero_data, only : lptr_so4_a_amode #endif use Olson_Landmap_Mod, only : Compute_Olson_Landmap @@ -1901,7 +1912,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) LOGICAL :: lq(pcnst) ! Indexing - INTEGER :: N, M, P, SM, ND + INTEGER :: K, N, M, P, SM, ND INTEGER :: I, J, L, nX, nY, nZ INTEGER :: LCHNK, NCOL @@ -1944,6 +1955,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) #if defined( MODAL_AERO ) REAL(r8) :: binRatio(MAXVAL(nspec_amode(:)),ntot_amode,state%NCOL,PVER) + REAL(r8) :: SO4_gasRatio(state%NCOL,PVER) #endif ! For emissions @@ -2108,11 +2120,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) MMR_Beg = 0.0e+0_r8 MMR_End = 0.0e+0_r8 DO N = 1, pcnst + IF ( mapCnst(N) > 0 ) lq(N) = .True. M = map2GC(N) IF ( M <= 0 ) CYCLE MMR_Beg(:nY,:nZ,M) = state%q(:nY,nZ:1:-1,N) State_Chm(LCHNK)%Species(1,:nY,:nZ,M) = REAL(MMR_Beg(:nY,:nZ,M),fp) - lq(N) = .True. ENDDO ! We need to let CAM know that 'H2O' and 'Q' are identical @@ -2139,54 +2151,49 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Chm(LCHNK)%Species(1,:nY,:nZ,M) = REAL(SlsData(:nY,nZ:1:-1,N),fp) ENDDO - DO N = 1, gas_pcnst - ! See definition of map2chm - M = map2chm(N) - IF ( M > 0 ) THEN - vmr0(:nY,:nZ,N) = State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) * & - MWDry / adv_mass(N) - ! We'll substract concentrations after chemistry later - mmr_tend(:nY,:nZ,N) = REAL(State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M),r8) - ELSEIF ( M < 0 ) THEN - vmr0(:nY,:nZ,N) = state%q(:nY,:nZ,-M) * & - MWDry / adv_mass(N) - mmr_tend(:nY,:nZ,N) = state%q(:nY,:nZ,-M) - ENDIF - ENDDO - -#if defined( MODAL_AERO_4MODE ) +#if defined( MODAL_AERO ) ! First reset State_Chm%Species to zero for aerosols DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) - P = map2MAM4(SM,M) - IF ( P > 0 ) State_Chm(LCHNK)%Species(1,:nY,:nZ,P) = 0.0e+00_fp + P = map2MAM4(SM,M) ! Constituent index for GEOS-Chem + IF ( P > 0 ) K = map2GC(P) ! Index in State_Chm + IF ( K > 0 ) State_Chm(LCHNK)%Species(1,:nY,:nZ,K) = 0.0e+00_fp ENDDO ENDDO ! Map and flip aerosols DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) - ! TMMF - Should there be a ratio of molar weights involved? - P = map2MAM4(SM,M) + P = map2MAM4(SM,M) ! Constituent index for GEOS-Chem IF ( P <= 0 ) CYCLE N = lmassptr_amode(SM,M) + K = map2GC(P) ! Index in State_Chm + ! /!\ MAM aerosols (with cnst index N) is mapped onto GEOS-Chem + ! species (with cnst index P, which corresponds to index K in + ! State_Chm) + ! Multiple MAM4 bins are mapped to same GEOS-Chem species - State_Chm(LCHNK)%Species(1,:nY,:nZ,P) = State_Chm(LCHNK)%Species(1,:nY,:nZ,P) & - + REAL(state%q(:nY,nZ:1:-1,N),fp) + State_Chm(LCHNK)%Species(1,:nY,:nZ,K) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K) & + + REAL(state%q(:nY,nZ:1:-1,N),fp) * & + adv_mass(mapCnst(P)) / & + adv_mass(mapCnst(N)) ENDDO ENDDO + DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) P = map2MAM4(SM,M) IF ( P <= 0 ) CYCLE - ! Overwrite MMR_Beg with MAM value - MMR_Beg(:nY,:nZ,P) = State_Chm(LCHNK)%Species(1,:nY,:nZ,P) N = lmassptr_amode(SM,M) + K = map2GC(P) ! Index in State_Chm + ! Overwrite MMR_Beg with value from MAM + MMR_Beg(:nY,:nZ,K) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K) DO J = 1, nY DO L = 1, nZ - IF ( State_Chm(LCHNK)%Species(1,J,nZ+1-L,P) > 0.0e+00_r8 ) THEN - binRatio(SM,M,J,L) = REAL(state%q(J,L,N),r8) & - / State_Chm(LCHNK)%Species(1,J,nZ+1-L,P) + IF ( State_Chm(LCHNK)%Species(1,J,nZ+1-L,K) > 0.0e+00_r8 ) THEN + binRatio(SM,M,J,L) = REAL(state%q(J,L,N),r8) & + * adv_mass(mapCnst(P)) / adv_mass(mapCnst(N)) & + / State_Chm(LCHNK)%Species(1,J,nZ+1-L,K) ELSE binRatio(SM,M,J,L) = 0.0e+00_r8 ENDIF @@ -2194,8 +2201,35 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDDO ENDDO + + ! Add gas-phase H2SO4 to GEOS-Chem SO4 (which lumps SO4 aerosol and gaseous) + K = iSO4 + N = cH2SO4 + IF ( K > 0 .AND. N > 0 .AND. l_SO4 > 0 ) THEN + State_Chm(LCHNK)%Species(1,:nY,:nZ,K) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K) & + + REAL(state%q(:nY,nZ:1:-1,N),fp) * & + adv_mass(l_SO4) / adv_mass(mapCnst(N)) + SO4_gasRatio(:nY,:nZ) = state%q(:nY,:nZ,N) & + * adv_mass(l_SO4) / adv_mass(mapCnst(N)) & + / State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,K) + ENDIF #endif + DO N = 1, gas_pcnst + ! See definition of map2chm + M = map2chm(N) + IF ( M > 0 ) THEN + vmr0(:nY,:nZ,N) = State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M) * & + MWDry / adv_mass(N) + ! We'll substract concentrations after chemistry later + mmr_tend(:nY,:nZ,N) = REAL(State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,M),r8) + ELSEIF ( M < 0 ) THEN + vmr0(:nY,:nZ,N) = state%q(:nY,:nZ,-M) * & + MWDry / adv_mass(N) + mmr_tend(:nY,:nZ,N) = state%q(:nY,:nZ,-M) + ENDIF + ENDDO + ! If H2O tendencies are propagated to specific humidity, then make sure ! that Q actually applies tendencies IF ( Input_Opt%applyQtend ) lq(cQ) = .True. @@ -3173,7 +3207,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf_chnk => NULL() pbuf_ik => NULL() ENDIF - !CALL HCO_GetPtr( HcoState, 'STRAT_OH', STRAT_OH, RC, FOUND=FND ) ENDIF ENDIF @@ -3550,6 +3583,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL ENDRUN('Incorrect unit in GEOS-Chem State_Chm%Species') ENDIF + call t_stopf( 'chemdr' ) + ! Save and write J-values to pbuf for HEMCO ! in HCO_IN_JNO2, HCO_IN_JOH FieldName = 'HCO_IN_JNO2' @@ -3586,35 +3621,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf_i => NULL() ENDIF - call t_stopf( 'chemdr' ) - - !============================================================== - ! ***** W E T D E P O S I T I O N (rainout + washout) ***** - !============================================================== - IF ( Input_Opt%LWetD ) THEN - - IF ( gas_wetdep_method == 'NEU' ) THEN - CALL Neu_wetdep_tend( LCHNK = LCHNK, & - NCOL = NCOL, & - mmr = state%q, & - pmid = state%pmid, & - pdel = state%pdel, & - zint = state%zi, & - tfld = state%t, & - delt = dT, & - prain = PRain, & - nevapr = NEvapr, & - cld = cldFrc, & - cmfdqr = cmfdqr, & - wd_tend = ptend%q, & - wd_tend_int = wetdepflx ) - ELSE - ErrMsg = 'Unknown gas_wetdep_method '//TRIM(gas_wetdep_method) - CALL Error_Stop( ErrMsg, ThisLoc ) - ENDIF - - ENDIF - DO N = 1, gas_pcnst ! See definition of map2chm M = map2chm(N) @@ -3632,17 +3638,26 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) !============================================================== #if defined( MODAL_AERO ) - - del_h2so4_gasprod = 0.0e+00_fp - ! This needs to be in mol/mol over this timestep - IF ( ( iPSO4 > 0 ) .and. ( MWPSO4 > 0.0e+00_fp ) ) THEN - DO L = 1, nZ - ! Convert from kg SO4/kg to mol/mol - del_h2so4_gasprod(:nY,L) = & - State_Chm(LCHNK)%Species(1,:nY,nZ+1-L,iPSO4) * MWDry / MWPSO4 + ! Repartition SO4 into H2SO4 and so4_a* + IF ( l_H2SO4 > 0 .AND. l_SO4 > 0 ) THEN + P = l_H2SO4 + ! SO4_gasRatio is kg(SO4) (gaseous) / kg(SO4) (gaseous+aerosol) + vmr1(:nY,:nZ,P) = SO4_gasRatio(:nY,:nZ) * vmr1(:nY,:nZ,l_SO4) + ! binRatio is kg(SO4) (current bin) / kg(SO4) (all bins) + DO M = 1, ntot_amode + N = lptr_so4_a_amode(M) + IF ( N <= 0 ) CYCLE + P = mapCnst(N) + vmr1(:nY,:nZ,P) = vmr1(:nY,:nZ,l_SO4) & + * ( 1.0d+00 - SO4_gasRatio(:nY,:nZ) ) & + * binRatio(iSulf(M),M,:nY,:nZ) ENDDO ENDIF + ! Amount of chemically-produced H2SO4 (mol/mol) + del_h2so4_gasprod(:nY,:nZ) = vmr1(:nY,:nZ,l_H2SO4) & + - vmr0(:nY,:nZ,l_H2SO4) + call aero_model_gasaerexch( loffset = iFirstCnst - 1, & ncol = NCOL, & lchnk = LCHNK, & @@ -3667,6 +3682,36 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) pbuf = pbuf ) #endif + !============================================================== + ! ***** W E T D E P O S I T I O N (rainout + washout) ***** + !============================================================== + IF ( Input_Opt%LWetD ) THEN + + IF ( gas_wetdep_method == 'NEU' ) THEN + CALL Neu_wetdep_tend( LCHNK = LCHNK, & + NCOL = NCOL, & + mmr = state%q, & + pmid = state%pmid, & + pdel = state%pdel, & + zint = state%zi, & + tfld = state%t, & + delt = dT, & + prain = PRain, & + nevapr = NEvapr, & + cld = cldFrc, & + cmfdqr = cmfdqr, & + wd_tend = ptend%q, & + wd_tend_int = wetdepflx ) + ELSE + ErrMsg = 'Unknown gas_wetdep_method '//TRIM(gas_wetdep_method) + CALL Error_Stop( ErrMsg, ThisLoc ) + ENDIF + + ENDIF + + !============================================================== + ! ***** B O U N D A R Y C O N D I T I O N S ***** + !============================================================== ! Set boundary conditions of long-lived species (most likely ! CH4, OCS, N2O, CFC11, CFC12). ! Note: This will overwrite the UCX boundary conditions @@ -3715,7 +3760,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) + (MMR_End(:nY,:nZ,M)-MMR_Beg(:nY,:nZ,M))/dT ENDDO -#if defined( MODAL_AERO_4MODE ) +#if defined( MODAL_AERO ) ! Here apply tendencies to MAM aerosols ! Initial mass in bin SM is stored as state%q(N) ! Final mass in bin SM is stored as binRatio(SM,M) * State_Chm(P) @@ -3725,16 +3770,38 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! partitioned in aero_model_gasaerexch DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) - P = map2MAM4(SM,M) - IF ( P <= 0 .OR. to_upper(xname_massptr(SM,M)(:3)) == 'SO4' ) CYCLE N = lmassptr_amode(SM,M) - ! Apply MAM4 chemical tendencies owing to GEOS-Chem aerosol processing + P = mapCnst(N) + IF ( P <= 0 ) CYCLE + ! Apply tendency from MAM gasaerexch ptend%q(:nY,:nZ,N) = ptend%q(:nY,:nZ,N) & - + (binRatio(SM,M,:nY,:nZ) * & - REAL(State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,P),r8) & + + (vmr1(:nY,:nZ,P) - vmr0(:nY,:nZ,P))/dT & + * adv_mass(P) / MWDry + P = map2MAM4(SM,M) + IF ( P <= 0 ) CYCLE + K = map2GC(P) + IF ( K <= 0 .or. K == iSO4 ) CYCLE + ! Apply MAM4 chemical tendencies owing to GEOS-Chem aerosol processing + ptend%q(:nY,:nZ,N) = ptend%q(:nY,:nZ,N) & + + (binRatio(SM,M,:nY,:nZ) * & + REAL(State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,K),r8) & + * adv_mass(mapCnst(N)) / adv_mass(mapCnst(P)) & - state%q(:nY,:nZ,N))/dT ENDDO + N = numptr_amode(M) + P = mapCnst(N) + IF ( P <= 0 ) CYCLE + ptend%q(:nY,:nZ,N) = ptend%q(:nY,:nZ,N) & + + (vmr1(:nY,:nZ,P) - vmr0(:nY,:nZ,P))/dT & + * adv_mass(P) / MWDry ENDDO + N = cH2SO4 + P = l_H2SO4 + IF ( P > 0 ) THEN + ptend%q(:nY,:nZ,N) = ptend%q(:nY,:nZ,N) & + + (vmr1(:nY,:nZ,P) - vmr0(:nY,:nZ,P))/dT & + * adv_mass(P) / MWDry + ENDIF #endif DO N = 1, gas_pcnst From d7265749bb8ddbf820708ffb87ad2735fe57f6c7 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 11 May 2021 17:37:38 -0400 Subject: [PATCH 224/239] Fix: Remove hard-wired number emissions as this has been moved to HEMCO Signed-off-by: Thibaud Fritz --- .../geoschem/cesmgc_emissions_mod.F90 | 51 +------------------ 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index 4ee782b1a1..b2f0b193f0 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -305,9 +305,6 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! Aerosol emissions USE AERO_MODEL, ONLY : aero_model_emissions - USE MODAL_AERO_DATA, ONLY : ntot_amode, nspec_amode - USE MODAL_AERO_DATA, ONLY : lmassptr_amode, numptr_amode - USE MODAL_AERO_DATA, ONLY : specdens_amode ! GEOS-Chem version of physical constants USE PHYSCONSTANTS, ONLY : AVO @@ -337,7 +334,7 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! Integers INTEGER :: LCHNK INTEGER :: nY, nZ - INTEGER :: J, L, N, M, SM, P + INTEGER :: J, L, N INTEGER :: RC ! return code INTEGER :: tmpIdx ! pbuf field id @@ -357,12 +354,6 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS REAL(r8) :: SCALFAC ! Multiplying factor REAL(r8) :: megflx(pcols) ! For MEGAN emissions REAL(r8), PARAMETER :: m2km = 1.e-3_r8 - REAL(r8) :: diam ! Emission diameter - ! for aerosols (m) - REAL(r8) :: voltonumb ! Conversion factor - ! between aerosol mass - ! and number - REAL(r8) :: rho ! Aerosol density (kg/m3) ! Strings CHARACTER(LEN=255) :: SpcName @@ -499,46 +490,6 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS #if defined( MODAL_AERO ) - ! Estimate aerosol number emissions - ! Enumber = Emass / ( pi/6 * rho * D_emit^3 ) - ! D_emit is sector-dependent and is taken from Table S4 of: - ! Emmons, Louisa K., et al. "The chemistry mechanism in the Community Earth - ! System Model version 2 (CESM2)." Journal of Advances in Modeling Earth - ! Systems 12.4 (2020). - DO M = 1, ntot_amode - P = numptr_amode(M) - IF ( M == 1 ) THEN - ! Species affected: so4_a1 - diam = 0.134E-06_r8 - ! This diam value should be sector-dependent. - ! Agriculture, waste, solvents -> 0.134 - ! Shipping -> 0.261 - ! Energy, industrial -> 0.261 - ! Biomass burning -> 0.134 - ! Volcanoes -> 0.134 - ELSEIF ( M == 2 ) THEN - ! Species affected: so4_a2 - diam = 0.0504E-06_r8 - ELSEIF ( M == 4 ) THEN - ! Species affected: bc_a4, pom_a4 - diam = 0.134E-06_r8 - ENDIF - voltonumb = 1.0_r8 / ( PI / 6.0_r8 * diam * diam * diam ) - - IF ( M == 3 ) THEN - ! There shouldn't be any a3 number emissions, so we just enforce - ! voltonumb to be 0 - voltonumb = 0.0E-00_r8 - ENDIF - - DO SM = 1, nspec_amode(M) - N = lmassptr_amode(SM,M) - rho = specdens_amode(SM,M) - eflx(:nY,:nZ,P) = eflx(:nY,:nZ,P) & - + eflx(:nY,:nZ,N) * voltonumb / rho - ENDDO - ENDDO - !----------------------------------------------------------------------- ! Aerosol emissions (dust + seasalt) ... !----------------------------------------------------------------------- From 987966f876c01d00599ce6acae337b0cf1786de2 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 14 May 2021 21:25:02 -0400 Subject: [PATCH 225/239] Feat: Update .xml files with GEOS-Chem chemistry (MEGAN) Signed-off-by: Thibaud Fritz --- bld/namelist_files/use_cases/geoschem.xml | 29 ++++++++- .../use_cases/hist_geoschem.xml | 49 +++++++++++---- bld/namelist_files/use_cases/sd_geoschem.xml | 62 +++++++++++++++---- 3 files changed, 114 insertions(+), 26 deletions(-) diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml index 12018aca71..2b7264fc61 100644 --- a/bld/namelist_files/use_cases/geoschem.xml +++ b/bld/namelist_files/use_cases/geoschem.xml @@ -5,9 +5,32 @@ /glade/p/univ/umit0034/ExtData/CHEM_INPUTS/ -/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc - -/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f19_f19.134.1975.009.cam.i.2010-01-01_32L_c170403.nc +/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc + +/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc + + + + 'ISOP = isoprene', + 'MOH = methanol', + 'EOH = ethanol', + 'CH2O = formaldehyde', + 'ALD2 = acetaldehyde', + 'ACTA = acetic_acid', + 'ACET = acetone', + 'HCOOH = formic_acid', + 'HCN = hydrogen_cyanide', + 'CO = carbon_monoxide', + 'C2H6 = ethane', + 'C2H4 = ethene', + 'C3H8 = propane', + 'ALK4 = pentane + hexane + heptane + tricyclene', + 'PRPE = propene + butene', + 'TOLU = toluene', + 'LIMO = limonene', + 'MTPA = pinene_a + pinene_b + sabinene + carene_3', + 'MTPO = terpinene_g + terpinene_a + terpinolene + myrcene + ocimene_al + ocimene_t_b + ocimene_c_b + thujene_a + 2met_styrene + cymene_p + cymene_o + bornene + fenchene_a + camphene + phellandrene_a + phellandrene_b' + atm/cam/solar/SolarForcing1995-2005avg_c160929.nc diff --git a/bld/namelist_files/use_cases/hist_geoschem.xml b/bld/namelist_files/use_cases/hist_geoschem.xml index 8d8dce5377..9eac1a5be6 100644 --- a/bld/namelist_files/use_cases/hist_geoschem.xml +++ b/bld/namelist_files/use_cases/hist_geoschem.xml @@ -6,9 +6,32 @@ /glade/p/univ/umit0034/ExtData/CHEM_INPUTS/ -/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_32L_c170403.nc - -/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f19_f19.134.1975.009.cam.i.2010-01-01_32L_c170403.nc +/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc + +/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc + + + + 'ISOP = isoprene', + 'MOH = methanol', + 'EOH = ethanol', + 'CH2O = formaldehyde', + 'ALD2 = acetaldehyde', + 'ACTA = acetic_acid', + 'ACET = acetone', + 'HCOOH = formic_acid', + 'HCN = hydrogen_cyanide', + 'CO = carbon_monoxide', + 'C2H6 = ethane', + 'C2H4 = ethene', + 'C3H8 = propane', + 'ALK4 = pentane + hexane + heptane + tricyclene', + 'PRPE = propene + butene', + 'TOLU = toluene', + 'LIMO = limonene', + 'MTPA = pinene_a + pinene_b + sabinene + carene_3', + 'MTPO = terpinene_g + terpinene_a + terpinolene + myrcene + ocimene_al + ocimene_t_b + ocimene_c_b + thujene_a + 2met_styrene + cymene_p + cymene_o + bornene + fenchene_a + camphene + phellandrene_a + phellandrene_b' + atm/cam/solar/SolarForcingCMIP6_18491230-23000102_c20200615.nc @@ -52,7 +75,7 @@ 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2', 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO', - 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3', + 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'PHIS', 'Z3', 'BENZ', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', 'CFC12', 'CH2O', 'CH3BR', 'CH3CCL3', 'ALD2', 'CH3CL', 'ACET', 'MOH', 'CH4', 'CO', 'H2O2', 'HCFC22', 'HNO3', 'ISOP', 'MTPA', 'N2O', 'O3', @@ -68,8 +91,10 @@ 'IHN4', 'INO2B', 'INO2D', 'INPB', 'INPD', 'RIPA', 'RIPB', 'RIPC', 'RIPD', 'MACR', 'MVKHP', 'MEK', 'MCRDH', 'MPAN', 'MVK', 'N', 'N2O', 'N2O5', 'ICN', 'NH3', 'NH4', 'NO', 'NO2', 'NO3', 'PROPNN', 'OLND', 'OLNN', 'O', 'OCLO', - 'OCS', 'PAN', 'SO2', 'SO4', 'SOAP', 'TOLU', 'XYLE', + 'OCS', 'PAN', 'SO2', 'SO4', 'TOLU', 'XYLE', 'R4O2', 'BRO2', 'ETO2', 'A3O2', 'MCO3', 'MO2', 'HO2', 'O1D', 'OH', + 'TSOA0', 'TSOA1', 'TSOA2', 'TSOA3', 'ASOAN', 'ASOA1', 'ASOA2', 'ASOA3', + 'SOAIE', 'SOAGX', 'H2O', 'SAD_PSC', 'SAD_SULFC', 'SAD_TROP', 'SAD_AERO', 'REFF_AERO', 'PDELDRY', 'RAD_PSC', 'RAD_SULFC', 'HNO3_GAS', 'HNO3_STS', 'HNO3_NAT', 'NOX', 'NOY', 'CLOX', 'CLOY', @@ -92,16 +117,16 @@ 'DF_HAC', 'DF_IEPOXA', 'DF_IEPOXB', 'DF_IEPOXD', 'DF_MPAN', 'DF_NH3', 'DF_NH4', 'DF_NO', 'DF_NO2', 'DF_O3', 'DF_PAN', 'DF_SO2', - 'DF_SOAP', 'SO2_CLXF', 'SO2_XFRC', - 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD', 'LNO_COL_PROD', 'SOAP_CLXF', + 'SO2_CLXF', 'SO2_XFRC', + 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD', 'LNO_COL_PROD', 'SFEOH', 'SFALD2', 'SFMEK', 'SFCH2O', 'SFC2H6', 'SFC3H8', 'SFALK4', 'SFPRPE', 'SFBENZ', 'SFTOLU', 'SFXYLE', 'SFNO', 'SFACTA', 'SFDMS', 'SFMEK', 'SFSO2', 'SFNH3', - 'SFISOP', 'SFMTPA', 'SFMOH', 'SFACET', 'SFCO', 'SFSOAP', - 'MEG_ISOP', 'MEG_MTERP', 'MEG_BCARY', 'MEG_CH3OH', 'MEG_C2H5OH', 'MEG_CH2O', - 'MEG_CH3CHO', 'MEG_CH3COOH', 'MEG_CH3COCH3', 'MEG_HCOOH', 'MEG_HCN', 'MEG_CO', - 'MEG_C2H6', 'MEG_C2H4', 'MEG_C3H8', 'MEG_C3H6', 'MEG_BIGALK', 'MEG_BIGENE', - 'MEG_TOLUENE', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', + 'SFISOP', 'SFMTPA', 'SFMOH', 'SFACET', 'SFCO', + 'MEG_ISOP', 'MEG_MOH', 'MEG_EOH', 'MEG_CH2O', 'MEG_ALD2', 'MEG_ACTA', + 'MEG_ACET', 'MEG_HCOOH', 'MEG_HCN', 'MEG_CO', 'MEG_C2H6', 'MEG_C2H4', + 'MEG_C3H8', 'MEG_ALK4', 'MEG_PRPE', 'MEG_TOLU', 'MEG_LIMO', 'MEG_MTPA', + 'MEG_MTPO', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', 'DHNO3CHM', 'DH2O2CHM', 'DO3CHM', 'DCOCHM', 'AQ_SO2', 'GS_SO2', 'SO2_CLXF', 'MASS', 'ABSORB', 'Jval_O3O1D', 'Jval_NO2', 'Jval_PAN', 'Jval_H2O2', 'Jval_Cl2O2', diff --git a/bld/namelist_files/use_cases/sd_geoschem.xml b/bld/namelist_files/use_cases/sd_geoschem.xml index 02c3508e54..e420cc20bb 100644 --- a/bld/namelist_files/use_cases/sd_geoschem.xml +++ b/bld/namelist_files/use_cases/sd_geoschem.xml @@ -6,14 +6,52 @@ /glade/p/univ/umit0034/ExtData/CHEM_INPUTS/ -/glade/p/univ/umit0034/Shared/f.e20.FWAMIP.f09_f09.134.1975.009.cam.i.2010-01-01_56L_c170403.nc +atm/cam/met/MERRA2/0.5x0.63/fv_0.47x0.63_nc3000_Co030_Fi001_PF_nullRR_Nsw021_MERRA2_c180612.nc + +/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FCSD.f09_f09_mg17.cesm2.1-exp002.001.cam.i.2005-01-01-00000_c180801.nc atm/cam/met/MERRA2/0.9x1.25/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_sgh30_24km_GRNL_MERRA2_c171218.nc -atm/cam/met/MERRA2/0.5x0.63/fv_0.47x0.63_nc3000_Co030_Fi001_PF_nullRR_Nsw021_MERRA2_c180612.nc +/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FCSD.f19_f19_mg17.cesm2.1-exp002.001.cam.i.2005-01-01-00000_c180801.nc +atm/cam/met/MERRA2/1.9x2.5/fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_ZR_GRNL_MERRA2_c190617.nc + + + + 'ISOP = isoprene', + 'MOH = methanol', + 'EOH = ethanol', + 'CH2O = formaldehyde', + 'ALD2 = acetaldehyde', + 'ACTA = acetic_acid', + 'ACET = acetone', + 'HCOOH = formic_acid', + 'HCN = hydrogen_cyanide', + 'CO = carbon_monoxide', + 'C2H6 = ethane', + 'C2H4 = ethene', + 'C3H8 = propane', + 'ALK4 = pentane + hexane + heptane + tricyclene', + 'PRPE = propene + butene', + 'TOLU = toluene', + 'LIMO = limonene', + 'MTPA = pinene_a + pinene_b + sabinene + carene_3', + 'MTPO = terpinene_g + terpinene_a + terpinolene + myrcene + ocimene_al + ocimene_t_b + ocimene_c_b + thujene_a + 2met_styrene + cymene_p + cymene_o + bornene + fenchene_a + camphene + phellandrene_a + phellandrene_b' + 50. .true. +2005/MERRA2_1.9x2.5_20050101.nc +atm/cam/met/MERRA2/1.9x2.5 +atm/cam/met/MERRA2/1.9x2.5/filenames_list_c20210302 + +2005/MERRA2_0.9x1.25_20050101.nc +atm/cam/met/MERRA2/0.9x1.25 +atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c190125.txt + +2010/MERRA2_0.5x0.63_20100101.nc +atm/cam/met/MERRA2/0.5x0.63 +atm/cam/met/MERRA2/0.5x0.63/filenames_list_c180612 + 2005/MERRA2_0.9x1.25_20050101.nc atm/cam/met/MERRA2/0.9x1.25 atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c190125.txt @@ -62,7 +100,7 @@ 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2', 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO', - 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3', + 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'PHIS', 'Z3', 'BENZ', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', 'CFC12', 'CH2O', 'CH3BR', 'CH3CCL3', 'ALD2', 'CH3CL', 'ACET', 'MOH', 'CH4', 'CO', 'H2O2', 'HCFC22', 'HNO3', 'ISOP', 'MTPA', 'N2O', 'O3', @@ -78,8 +116,10 @@ 'IHN4', 'INO2B', 'INO2D', 'INPB', 'INPD', 'RIPA', 'RIPB', 'RIPC', 'RIPD', 'MACR', 'MVKHP', 'MEK', 'MCRDH', 'MPAN', 'MVK', 'N', 'N2O', 'N2O5', 'ICN', 'NH3', 'NH4', 'NO', 'NO2', 'NO3', 'PROPNN', 'OLND', 'OLNN', 'O', 'OCLO', - 'OCS', 'PAN', 'SO2', 'SO4', 'SOAP', 'TOLU', 'XYLE', + 'OCS', 'PAN', 'SO2', 'SO4', 'TOLU', 'XYLE', 'R4O2', 'BRO2', 'ETO2', 'A3O2', 'MCO3', 'MO2', 'HO2', 'O1D', 'OH', + 'TSOA0', 'TSOA1', 'TSOA2', 'TSOA3', 'ASOAN', 'ASOA1', 'ASOA2', 'ASOA3', + 'SOAIE', 'SOAGX', 'H2O', 'SAD_PSC', 'SAD_SULFC', 'SAD_TROP', 'SAD_AERO', 'REFF_AERO', 'PDELDRY', 'RAD_PSC', 'RAD_SULFC', 'HNO3_GAS', 'HNO3_STS', 'HNO3_NAT', 'NOX', 'NOY', 'CLOX', 'CLOY', @@ -102,16 +142,16 @@ 'DF_HAC', 'DF_IEPOXA', 'DF_IEPOXB', 'DF_IEPOXD', 'DF_MPAN', 'DF_NH3', 'DF_NH4', 'DF_NO', 'DF_NO2', 'DF_O3', 'DF_PAN', 'DF_SO2', - 'DF_SOAP', 'SO2_CLXF', 'SO2_XFRC', - 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD', 'LNO_COL_PROD', 'SOAP_CLXF', + 'SO2_CLXF', 'SO2_XFRC', + 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD', 'LNO_COL_PROD', 'SFEOH', 'SFALD2', 'SFMEK', 'SFCH2O', 'SFC2H6', 'SFC3H8', 'SFALK4', 'SFPRPE', 'SFBENZ', 'SFTOLU', 'SFXYLE', 'SFNO', 'SFACTA', 'SFDMS', 'SFMEK', 'SFSO2', 'SFNH3', - 'SFISOP', 'SFMTPA', 'SFMOH', 'SFACET', 'SFCO', 'SFSOAP', - 'MEG_ISOP', 'MEG_MTERP', 'MEG_BCARY', 'MEG_CH3OH', 'MEG_C2H5OH', 'MEG_CH2O', - 'MEG_CH3CHO', 'MEG_CH3COOH', 'MEG_CH3COCH3', 'MEG_HCOOH', 'MEG_HCN', 'MEG_CO', - 'MEG_C2H6', 'MEG_C2H4', 'MEG_C3H8', 'MEG_C3H6', 'MEG_BIGALK', 'MEG_BIGENE', - 'MEG_TOLUENE', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', + 'SFISOP', 'SFMTPA', 'SFMOH', 'SFACET', 'SFCO', + 'MEG_ISOP', 'MEG_MOH', 'MEG_EOH', 'MEG_CH2O', 'MEG_ALD2', 'MEG_ACTA', + 'MEG_ACET', 'MEG_HCOOH', 'MEG_HCN', 'MEG_CO', 'MEG_C2H6', 'MEG_C2H4', + 'MEG_C3H8', 'MEG_ALK4', 'MEG_PRPE', 'MEG_TOLU', 'MEG_LIMO', 'MEG_MTPA', + 'MEG_MTPO', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', 'DHNO3CHM', 'DH2O2CHM', 'DO3CHM', 'DCOCHM', 'AQ_SO2', 'GS_SO2', 'SO2_CLXF', 'MASS', 'ABSORB', 'Jval_O3O1D', 'Jval_NO2', 'Jval_PAN', 'Jval_H2O2', 'Jval_Cl2O2', From c3dc4ba89809ef357cf56b169bafb4badaa49998 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 14 May 2021 21:27:18 -0400 Subject: [PATCH 226/239] Feat: Add MEGAN emissions with GEOS-Chem species Signed-off-by: Thibaud Fritz --- .../geoschem/cesmgc_emissions_mod.F90 | 117 +++++++----------- 1 file changed, 42 insertions(+), 75 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 index b2f0b193f0..5489b0f043 100644 --- a/src/chemistry/geoschem/cesmgc_emissions_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_emissions_mod.F90 @@ -41,25 +41,12 @@ MODULE CESMGC_Emissions_Mod INTEGER :: iBC1 INTEGER :: iBC4 INTEGER :: iH2SO4 - INTEGER :: iSOA11 - INTEGER :: iSOA12 - INTEGER :: iSOA21 - INTEGER :: iSOA22 - INTEGER :: iSOA31 - INTEGER :: iSOA32 - INTEGER :: iSOA41 - INTEGER :: iSOA42 - INTEGER :: iSOA51 - INTEGER :: iSOA52 - INTEGER :: iPOM1 - INTEGER :: iPOM4 INTEGER :: iBCPI INTEGER :: iBCPO INTEGER :: iOCPI INTEGER :: iOCPO INTEGER :: iSO4 - INTEGER :: iSOAS ! MEGAN Emissions INTEGER, ALLOCATABLE :: megan_indices_map(:) @@ -137,22 +124,6 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) ! Get constituent index for NO CALL cnst_get_ind('NO', iNO, abort=.True.) -#if defined( MODAL_AERO_4MODE ) - ! Get constituent index for aerosols - CALL cnst_get_ind('soa1_a1', iSOA11, abort=.True.) - CALL cnst_get_ind('soa1_a2', iSOA12, abort=.True.) - CALL cnst_get_ind('soa2_a1', iSOA21, abort=.True.) - CALL cnst_get_ind('soa2_a2', iSOA22, abort=.True.) - CALL cnst_get_ind('soa3_a1', iSOA31, abort=.True.) - CALL cnst_get_ind('soa3_a2', iSOA32, abort=.True.) - CALL cnst_get_ind('soa4_a1', iSOA41, abort=.True.) - CALL cnst_get_ind('soa4_a2', iSOA42, abort=.True.) - CALL cnst_get_ind('soa5_a1', iSOA51, abort=.True.) - CALL cnst_get_ind('soa5_a2', iSOA52, abort=.True.) - - CALL cnst_get_ind('SOAS', iSOAS, abort=.True.) -#endif - !----------------------------------------------------------------------- ! ... initialize the lightning module !----------------------------------------------------------------------- @@ -171,41 +142,50 @@ SUBROUTINE CESMGC_Emissions_Init( lght_no_prd_factor ) DO N = 1, shr_megan_mechcomps_n SpcName = TRIM(shr_megan_mechcomps(N)%name) + ! Special handlings for GEOS-Chem species - IF ( TRIM(SpcName) == 'MTERP' ) THEN - SpcName = 'MTPA' - ELSEIF ( TRIM(SpcName) == 'BCARY' ) THEN - SpcName = 'None' - MW = 204.342600_r8 ! Taken from pp_trop_strat_mam4_vbs - ELSEIF ( TRIM(SpcName) == 'CH3OH' ) THEN - SpcName = 'MOH' - ELSEIF ( TRIM(SpcName) == 'C2H5OH' ) THEN - SpcName = 'EOH' - ELSEIF ( TRIM(SpcName) == 'CH3CHO' ) THEN - SpcName = 'ALD2' - ELSEIF ( TRIM(SpcName) == 'CH3COOH' ) THEN - SpcName = 'ACTA' - ELSEIF ( TRIM(SpcName) == 'CH3COCH3' ) THEN - SpcName = 'ACET' - ELSEIF ( TRIM(SpcName) == 'HCN' ) THEN + IF ( TRIM(SpcName) == 'HCN' ) THEN SpcName = 'None' MW = 27.025140_r8 ! Taken from pp_trop_strat_mam4_vbs ELSEIF ( TRIM(SpcName) == 'C2H4' ) THEN SpcName = 'None' MW = 28.051600_r8 ! Taken from pp_trop_strat_mam4_vbs - ELSEIF ( TRIM(SpcName) == 'C3H6' ) THEN - SpcName = 'PRPE' - ELSEIF ( TRIM(SpcName) == 'BIGALK' ) THEN - ! BIGALK = Pentane + Hexane + Heptane + Tricyclene - SpcName = 'ALK4' - ELSEIF ( TRIM(SpcName) == 'BIGENE' ) THEN - ! BIGENE = butene (C4H8) - SpcName = 'PRPE' ! Lumped >= C3 alkenes - ELSEIF ( TRIM(SpcName) == 'TOLUENE' ) THEN - SpcName = 'TOLU' ENDIF + !IF ( TRIM(SpcName) == 'MTERP' ) THEN + ! SpcName = 'MTPA' + !ELSEIF ( TRIM(SpcName) == 'BCARY' ) THEN + ! SpcName = 'None' + ! MW = 204.342600_r8 ! Taken from pp_trop_strat_mam4_vbs + !ELSEIF ( TRIM(SpcName) == 'CH3OH' ) THEN + ! SpcName = 'MOH' + !ELSEIF ( TRIM(SpcName) == 'C2H5OH' ) THEN + ! SpcName = 'EOH' + !ELSEIF ( TRIM(SpcName) == 'CH3CHO' ) THEN + ! SpcName = 'ALD2' + !ELSEIF ( TRIM(SpcName) == 'CH3COOH' ) THEN + ! SpcName = 'ACTA' + !ELSEIF ( TRIM(SpcName) == 'CH3COCH3' ) THEN + ! SpcName = 'ACET' + !ELSEIF ( TRIM(SpcName) == 'HCN' ) THEN + ! SpcName = 'None' + ! MW = 27.025140_r8 ! Taken from pp_trop_strat_mam4_vbs + !ELSEIF ( TRIM(SpcName) == 'C2H4' ) THEN + ! SpcName = 'None' + ! MW = 28.051600_r8 ! Taken from pp_trop_strat_mam4_vbs + !ELSEIF ( TRIM(SpcName) == 'C3H6' ) THEN + ! SpcName = 'PRPE' + !ELSEIF ( TRIM(SpcName) == 'BIGALK' ) THEN + ! ! BIGALK = Pentane + Hexane + Heptane + Tricyclene + ! SpcName = 'ALK4' + !ELSEIF ( TRIM(SpcName) == 'BIGENE' ) THEN + ! ! BIGENE = butene (C4H8) + ! SpcName = 'PRPE' ! Lumped >= C3 alkenes + !ELSEIF ( TRIM(SpcName) == 'TOLUENE' ) THEN + ! SpcName = 'TOLU' + !ENDIF CALL cnst_get_ind (SpcName, megan_indices_map(N), abort=.False.) + II = get_spc_ndx(SpcName) IF ( II > 0 ) THEN SpcName = TRIM(shr_megan_mechcomps(N)%name) @@ -400,13 +380,14 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS pbuf_ik => NULL() pbuf_chnk => NULL() - IF ( MINVAL(eflx(:nY,:nZ,N)) < 0.0e+00_r8 ) THEN - Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO emission flux is negative for ", & - TRIM(cnst_name(N)), " with value ", MINVAL(eflx(:nY,:nZ,N)), " at ", & - MINLOC(eflx(:nY,:nZ,N)) - ENDIF + !IF ( MINVAL(eflx(:nY,:nZ,N)) < 0.0e+00_r8 ) THEN + ! Write(iulog,*) " CESMGC_Emissions_Calc: HEMCO emission flux is negative for ", & + ! TRIM(cnst_name(N)), " with value ", MINVAL(eflx(:nY,:nZ,N)), " at ", & + ! MINLOC(eflx(:nY,:nZ,N)) + !ENDIF - IF ( rootChunk .and. ( MAXVAL(eflx(:nY,:nZ,N)) > 0.0e+0_r8 ) ) THEN + IF ( rootChunk .AND. (iStep == 2) .AND. ( MAXVAL(eflx(:nY,:nZ,N)) > 0.0e+0_r8 ) ) THEN + ! Only print this once Write(iulog,'(a,a,a,a)') " CESMGC_Emissions_Calc: HEMCO flux ", & TRIM(fldname_ns), " added to ", TRIM(cnst_name(N)) Write(iulog,'(a,a,E16.4)') " CESMGC_Emissions_Calc: Maximum flux ", & @@ -503,20 +484,6 @@ SUBROUTINE CESMGC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iS ! where all GEOS-Chem aerosols (BCPI, BCPO, OCPI, OCPO, SO4) have been ! replaced with the corresponding MAM aerosols - ! For SOA emission, split evently GEOS-Chem SOAS emission into each - ! VBS bin. - eflx(:nY,:nZ,iSOA11) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSOA12) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSOA21) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSOA22) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSOA31) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSOA32) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSOA41) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSOA42) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSOA51) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSOA52) = eflx(:nY,:nZ,iSOAS) / 10.0e+00_r8 - eflx(:nY,:nZ,iSOAS) = 0.0e+00_r8 - #endif ! Output fields before lightning NO emissions are applied to eflx From 0c50dd867eacc0a7873d7250c0d65cd7628f8676 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Fri, 14 May 2021 21:28:43 -0400 Subject: [PATCH 227/239] Fix: Update IF condition for SRF diagnostics Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index f27dfa7e53..80872b4583 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -1053,7 +1053,8 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & M = map2chm(N) SpcName = TRIM(solsym(N)) outTmp = 0.0e+00_r8 - IF ( adv_mass(N) > 0.0e+00_r8 .AND. M /= 0 .AND. hist_fld_active(TRIM(SpcName)) ) THEN + IF ( adv_mass(N) > 0.0e+00_r8 .AND. M /= 0 .AND. & + (hist_fld_active(TRIM(SpcName)) .OR. hist_fld_active(TRIM(SpcName)//'_SRF')) ) THEN IF ( M > 0 ) THEN ! mol/mol outTmp(:nY,:) = REAL(State_Chm%Species(1,:nY,nZ:1:-1,M),r8) * MWDry / adv_mass(N) From 07d34eb2f74ee7203ba66e82a36ccaa676378893 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 17 May 2021 11:51:33 -0400 Subject: [PATCH 228/239] Feat: Add hemco_nl in build-namelist Signed-off-by: Thibaud Fritz --- bld/build-namelist | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bld/build-namelist b/bld/build-namelist index c84c794867..38228cc678 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -2795,6 +2795,9 @@ else { } } +# HEMCO +$nl->set_variable_value('hemco_nl', 'hemco_config_File', "'HEMCO_Config.rc'"); + # Physics options # Add the name of the physics package based on the info in configure. If the user tries From efd68032c1e4c88e3fe72a6b5fa1e85806c1dbc6 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 17 May 2021 11:53:17 -0400 Subject: [PATCH 229/239] Feat: Rename geoschem.xml to 2000_geoscheml.xml (FC2000climo_GC) Signed-off-by: Thibaud Fritz --- .../use_cases/2000_geoschem.xml | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 bld/namelist_files/use_cases/2000_geoschem.xml diff --git a/bld/namelist_files/use_cases/2000_geoschem.xml b/bld/namelist_files/use_cases/2000_geoschem.xml new file mode 100644 index 0000000000..2b7264fc61 --- /dev/null +++ b/bld/namelist_files/use_cases/2000_geoschem.xml @@ -0,0 +1,99 @@ + + + +00010101 + +/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/ + +/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc + +/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc + + + + 'ISOP = isoprene', + 'MOH = methanol', + 'EOH = ethanol', + 'CH2O = formaldehyde', + 'ALD2 = acetaldehyde', + 'ACTA = acetic_acid', + 'ACET = acetone', + 'HCOOH = formic_acid', + 'HCN = hydrogen_cyanide', + 'CO = carbon_monoxide', + 'C2H6 = ethane', + 'C2H4 = ethene', + 'C3H8 = propane', + 'ALK4 = pentane + hexane + heptane + tricyclene', + 'PRPE = propene + butene', + 'TOLU = toluene', + 'LIMO = limonene', + 'MTPA = pinene_a + pinene_b + sabinene + carene_3', + 'MTPO = terpinene_g + terpinene_a + terpinolene + myrcene + ocimene_al + ocimene_t_b + ocimene_c_b + thujene_a + 2met_styrene + cymene_p + cymene_o + bornene + fenchene_a + camphene + phellandrene_a + phellandrene_b' + + + +atm/cam/solar/SolarForcing1995-2005avg_c160929.nc +20000101 +FIXED + +'xactive_lnd' + + +.true. +.true. +.false. +0.25D0 + + +CYCLICAL +2000 +atm/waccm/lb/LBC_2000climo_CMIP6_0p5degLat_c180227.nc + + + + +'CYCLICAL' + +2000 + + + 1,30,365,240,240,480,365,73,30 + 0,-24,-24,-3,-1,1,-24,-120,-240 +'A','A','A','A','A','A','A','A','I' + +.true. +.false. +.false. +.false. +.false. +.false. +.false. +.false. +.false. + + + 'Q', 'U', 'V', 'OMEGA', 'T', 'PS', + + + + 'O3', 'NO', 'NO2', 'CO', 'HNO3', 'CH4', 'NIT', 'NH4', 'NH3', 'SO4', 'SO2', 'OH', + + + + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + + + + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' + + + + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + + + + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' + + + From 95cf89cc4f7aa2920d5a0901c17727ecd1771b3d Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 17 May 2021 11:53:52 -0400 Subject: [PATCH 230/239] Feat: Add 2010_geoscheml.xml (FC2010climo_GC) Signed-off-by: Thibaud Fritz --- .../use_cases/2010_geoschem.xml | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 bld/namelist_files/use_cases/2010_geoschem.xml diff --git a/bld/namelist_files/use_cases/2010_geoschem.xml b/bld/namelist_files/use_cases/2010_geoschem.xml new file mode 100644 index 0000000000..6d10dd02df --- /dev/null +++ b/bld/namelist_files/use_cases/2010_geoschem.xml @@ -0,0 +1,91 @@ + + + + +00010101 + +/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/ + +/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc + +/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc + + + + 'ISOP = isoprene', + 'MOH = methanol', + 'EOH = ethanol', + 'CH2O = formaldehyde', + 'ALD2 = acetaldehyde', + 'ACTA = acetic_acid', + 'ACET = acetone', + 'HCOOH = formic_acid', + 'HCN = hydrogen_cyanide', + 'CO = carbon_monoxide', + 'C2H6 = ethane', + 'C2H4 = ethene', + 'C3H8 = propane', + 'ALK4 = pentane + hexane + heptane + tricyclene', + 'PRPE = propene + butene', + 'TOLU = toluene', + 'LIMO = limonene', + 'MTPA = pinene_a + pinene_b + sabinene + carene_3', + 'MTPO = terpinene_g + terpinene_a + terpinolene + myrcene + ocimene_al + ocimene_t_b + ocimene_c_b + thujene_a + 2met_styrene + cymene_p + cymene_o + bornene + fenchene_a + camphene + phellandrene_a + phellandrene_b' + + + +atm/cam/solar/SolarForcing2006-2014avg_c180917.nc +20100101 +FIXED + +'xactive_lnd' + + +.true. +.true. +.false. +0.25D0 + + +CYCLICAL +2010 +atm/waccm/lb/LBC_2010climo_CMIP6_0p5degLat_c180227.nc + + + + + 1,30,365,240,240,480,365,73,30 + 0,-24,-24,-3,-1,1,-24,-120,-240 +'A','A','A','A','A','A','A','A','I' + +.true. +.false. +.false. +.false. +.false. +.false. +.false. +.false. +.false. + + + 'Q', 'U', 'V', 'OMEGA', 'T', 'PS', + + + + 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + + + + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' + + + + 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', + + + + 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' + + + From f6e3da6bf71e6c2ac9176893f9d967339009dec5 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 17 May 2021 11:56:41 -0400 Subject: [PATCH 231/239] Feat: Update config_component to reflect recent changes to xml files Signed-off-by: Thibaud Fritz --- bld/namelist_files/use_cases/geoschem.xml | 99 ----------------------- cime_config/config_component.xml | 4 +- 2 files changed, 2 insertions(+), 101 deletions(-) delete mode 100644 bld/namelist_files/use_cases/geoschem.xml diff --git a/bld/namelist_files/use_cases/geoschem.xml b/bld/namelist_files/use_cases/geoschem.xml deleted file mode 100644 index 2b7264fc61..0000000000 --- a/bld/namelist_files/use_cases/geoschem.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - -00010101 - -/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/ - -/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc - -/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc - - - - 'ISOP = isoprene', - 'MOH = methanol', - 'EOH = ethanol', - 'CH2O = formaldehyde', - 'ALD2 = acetaldehyde', - 'ACTA = acetic_acid', - 'ACET = acetone', - 'HCOOH = formic_acid', - 'HCN = hydrogen_cyanide', - 'CO = carbon_monoxide', - 'C2H6 = ethane', - 'C2H4 = ethene', - 'C3H8 = propane', - 'ALK4 = pentane + hexane + heptane + tricyclene', - 'PRPE = propene + butene', - 'TOLU = toluene', - 'LIMO = limonene', - 'MTPA = pinene_a + pinene_b + sabinene + carene_3', - 'MTPO = terpinene_g + terpinene_a + terpinolene + myrcene + ocimene_al + ocimene_t_b + ocimene_c_b + thujene_a + 2met_styrene + cymene_p + cymene_o + bornene + fenchene_a + camphene + phellandrene_a + phellandrene_b' - - - -atm/cam/solar/SolarForcing1995-2005avg_c160929.nc -20000101 -FIXED - -'xactive_lnd' - - -.true. -.true. -.false. -0.25D0 - - -CYCLICAL -2000 -atm/waccm/lb/LBC_2000climo_CMIP6_0p5degLat_c180227.nc - - - - -'CYCLICAL' - -2000 - - - 1,30,365,240,240,480,365,73,30 - 0,-24,-24,-3,-1,1,-24,-120,-240 -'A','A','A','A','A','A','A','A','I' - -.true. -.false. -.false. -.false. -.false. -.false. -.false. -.false. -.false. - - - 'Q', 'U', 'V', 'OMEGA', 'T', 'PS', - - - - 'O3', 'NO', 'NO2', 'CO', 'HNO3', 'CH4', 'NIT', 'NH4', 'NH3', 'SO4', 'SO2', 'OH', - - - - 'ACET','ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','BRNO3','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','EOH','ETHLN','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG0','HG0_ANT','HG0_ARC','HG0_ATL','HG0_BB','HG0_CAM','HG0_CAN','HG0_EAF','HG0_EAS','HG0_EEU','HG0_EUR','HG0_GEO','HG0_JPN','HG0_MDE','HG0_NAF','HG0_NAT','HG0_NPA','HG0_OCE','HG0_OCN','HG0_SAF','HG0_SAM','HG0_SAS','HG0_SAT','HG0_SEA','HG0_SO','HG0_SOV','HG0_STR','HG0_USA','HG0_WAF','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPRNO3','O3','O3AFBL','O3ASBL','O3ATBL','O3EUBL','O3INIT','O3MT','O3NABL','O3PCBL','O3ROW','O3STRAT','O3USA','O3UT','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - - - - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' - - - - 'ACTA','ALD2','ASOG1','ASOG2','ASOG3','ATOOH','BR2','BRCL','CH2O','EOH','ETHLN','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HG2','HG2_ANT','HG2_ARC','HG2_ATL','HG2_BB','HG2_CAM','HG2_CAN','HG2_EAF','HG2_EAS','HG2_EEU','HG2_EUR','HG2_GEO','HG2_JPN','HG2_MDE','HG2_NAF','HG2_NAT','HG2_NPA','HG2_OCE','HG2_OCN','HG2_SAF','HG2_SAM','HG2_SAS','HG2_SAT','HG2_SEA','HG2_SO','HG2_SOV','HG2_STR','HG2_USA','HG2_WAF','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','OPOG1','OPOG2','PAN','POG1','POG2','POPG_BAP','POPG_PHE','POPG_PYR','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2','TSOG0','TSOG1','TSOG2','TSOG3','AERI','ASOA1','ASOA2','ASOA3','ASOAN','BCPI','BCPO','BE10','BE10STRAT','BE7','BE7STRAT','BRSALA','BRSALC','DST1','DST2','DST3','DST4','DSTAL1','DSTAL2','DSTAL3','DSTAL4','HGP','HGP_ANT','HGP_ARC','HGP_ATL','HGP_BB','HGP_CAM','HGP_CAN','HGP_EAF','HGP_EAS','HGP_EEU','HGP_EUR','HGP_GEO','HGP_JPN','HGP_MDE','HGP_NAF','HGP_NAT','HGP_NPA','HGP_OCE','HGP_OCN','HGP_SAF','HGP_SAM','HGP_SAS','HGP_SAT','HGP_SEA','HGP_SO','HGP_SOV','HGP_STR','HGP_USA','HGP_WAF','INDIOL','IONITA','ISALA','ISALC','LVOCOA','MONITA','MOPI','MOPO','MSA','NH4','NIT','NITD1','NITD2','NITD3','NITD4','NITS','OCPI','OCPO','OPOA1','OPOA2','PB210','PB210STRAT','PFE','POA1','POA2','POPPBCPI_BAP','POPPBCPI_PHE','POPPBCPI_PYR','POPPBCPO_BAP','POPPBCPO_PHE','POPPBCPO_PYR','POPPOCPI_BAP','POPPOCPI_PHE','POPPOCPI_PYR','POPPOCPO_BAP','POPPOCPO_PHE','POPPOCPO_PYR','SALA','SALAAL','SALACL','SALC','SALCAL','SALCCL','SO4','SO4D1','SO4D2','SO4D3','SO4D4','SO4S','SOAGX','SOAIE','SOAS','TSOA0','TSOA1','TSOA2','TSOA3', - - - - 'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2' - - - diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 09042b38c3..fc0c1a22d3 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -210,7 +210,7 @@ waccm_ma_2000_cam6 waccm_sc_2000_cam6 2000_trop_strat_vbs_cam6 - geoschem + 2000_geoschem aquaplanet_cam4 aquaplanet_cam4 @@ -223,7 +223,7 @@ 2010_trop_strat_vbs_cam6 waccm_tsmlt_2010_cam6 waccm_sc_2010_cam6 - geoschem_2010 + 2010_geoschem 1850-2005_cam5 1850-2005_cam4 From 21575e655e81dad16e949844bfaeabe243b5e548 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 17 May 2021 11:57:06 -0400 Subject: [PATCH 232/239] Feat: Add SOA mapping between MAM and GEOS-Chem complex SOA option (1) Add mapping (2) Extend number of constituents Signed-off-by: Thibaud Fritz --- bld/configure | 2 +- src/chemistry/geoschem/chem_mods.F90 | 4 +- src/chemistry/geoschem/chemistry.F90 | 326 ++++++++++- src/chemistry/geoschem/mo_neu_wetdep.F90 | 12 +- src/chemistry/geoschem/mo_sim_dat.F90 | 697 +++-------------------- 5 files changed, 400 insertions(+), 641 deletions(-) diff --git a/bld/configure b/bld/configure index 98faf00aa3..8b7787a3c0 100755 --- a/bld/configure +++ b/bld/configure @@ -1441,7 +1441,7 @@ if ($chem_pkg =~ '_mam3') { # TMMF - wedge in GEOS-Chem CPP definitions here if ($chem_pkg =~ 'geoschem') { $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DLINUX_IFORT -DUSE_REAL8 -DMODEL_ -DMODEL_CESM'; - $chem_nadv = 238; + $chem_nadv = 251; if (defined $opts{'clm_vers'}) { if ($opts{'clm_vers'} =~ 'CLM4.0') { $chem_cppdefs .= ' -DCLM40' diff --git a/src/chemistry/geoschem/chem_mods.F90 b/src/chemistry/geoschem/chem_mods.F90 index 5e00fddcdb..08733b6d85 100644 --- a/src/chemistry/geoschem/chem_mods.F90 +++ b/src/chemistry/geoschem/chem_mods.F90 @@ -7,7 +7,7 @@ module chem_mods implicit none save - INTEGER, PARAMETER :: nTracersMax = 238 ! Must be equal to chem_nadv + INTEGER, PARAMETER :: nTracersMax = 251 ! Must be equal to chem_nadv INTEGER :: nTracers CHARACTER(LEN=255) :: tracerNames(nTracersMax) CHARACTER(LEN=255) :: tracerLongNames(nTracersMax) @@ -61,7 +61,7 @@ module chem_mods rxntot = 212, & ! number of total reactions gascnt = 172, & ! number of gas phase reactions nabscol = 2, & ! number of absorbing column densities - gas_pcnst = 318, & ! number of "gas phase" species + gas_pcnst = 331, & ! number of "gas phase" species nfs = 6, & ! number of "fixed" species relcnt = 0, & ! number of relationship species grpcnt = 0, & ! number of group members diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 8a0f6ff55a..82aa85e509 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -580,8 +580,8 @@ subroutine chem_register CASE ( 'A3' ) CALL cnst_get_ind( 'DST4', map2MAM4(L,M) ) END SELECT - CASE ( 'SOA' ) - CALL cnst_get_ind( 'SOAS', map2MAM4(L,M) ) + !CASE ( 'SOA' ) + ! CALL cnst_get_ind( 'SOAS', map2MAM4(L,M) ) CASE ( 'SO4' ) CALL cnst_get_ind( 'SO4', map2MAM4(L,M) ) iSulf(M) = L @@ -1142,7 +1142,7 @@ subroutine chem_init(phys_state, pbuf2d) CALL Read_Input_File( Input_Opt = Input_Opt, & State_Grid = maxGrid, & RC = RC ) - + ! First setup directories Input_Opt%Chem_Inputs_Dir = TRIM(gc_cheminputs) Input_Opt%SpcDatabaseFile = TRIM(speciesDB) @@ -1166,6 +1166,11 @@ subroutine chem_init(phys_state, pbuf2d) ! applyQtend: apply tendencies of water vapor to specific humidity Input_Opt%applyQtend = .False. + + IF ( .NOT. Input_Opt%LSOA ) THEN + CALL ENDRUN('CESM2-GC requires the complex SOA option to be on!') + ENDIF + ENDIF CALL Validate_Directories( Input_Opt, RC ) @@ -1823,6 +1828,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use phys_grid, only : get_ncols_p, get_rlat_all_p, get_rlon_all_p + use mo_chem_utls, only : get_spc_ndx use chem_mods, only : drySpc_ndx, map2GC_dryDep use chem_mods, only : nfs, indexm, gas_pcnst use mo_mean_mass, only : set_mean_mass @@ -1833,8 +1839,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use gas_wetdep_opts, only : gas_wetdep_method #if defined( MODAL_AERO ) use modal_aero_data, only : ntot_amode, nspec_amode + use modal_aero_data, only : nspec_max, nsoa use modal_aero_data, only : lmassptr_amode, numptr_amode use modal_aero_data, only : lptr_so4_a_amode + use modal_aero_data, only : lptr2_soa_a_amode, lptr2_soa_g_amode #endif use Olson_Landmap_Mod, only : Compute_Olson_Landmap @@ -1857,9 +1865,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use PBL_Mix_Mod, only : Compute_PBL_Height use UCX_Mod, only : Set_H2O_Trac use CMN_FJX_MOD, only : ZPJ - USE FAST_JX_MOD, only : RXN_NO2, RXN_O3_1, RXN_O3_2a + use FAST_JX_MOD, only : RXN_NO2, RXN_O3_1, RXN_O3_2a use State_Diag_Mod, only : get_TagInfo use Unitconv_Mod, only : Convert_Spc_Units + use State_Chm_Mod, only : Ind_ use Strat_Chem_Mod, only : Strat_TrID_GC, GC_Bry_TrID, NSCHEM use Strat_Chem_Mod, only : BrPtrDay, BrPtrNight, PLVEC, STRAT_OH @@ -1949,13 +1958,28 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! For aerosol formation REAL(r8) :: del_h2so4_gasprod(state%NCOL,PVER) + REAL(r8) :: vmr0(state%NCOL,PVER,gas_pcnst) REAL(r8) :: vmr1(state%NCOL,PVER,gas_pcnst) + REAL(r8) :: vmr2(state%NCOL,PVER,gas_pcnst) + REAL(r8) :: wetdepflx(pcols,pcnst) ! Wet deposition fluxes (kg/m2/s) #if defined( MODAL_AERO ) - REAL(r8) :: binRatio(MAXVAL(nspec_amode(:)),ntot_amode,state%NCOL,PVER) + REAL(r8) :: binRatio(nspec_max,ntot_amode,state%NCOL,PVER) + REAL(r8) :: SO4_gasRatio(state%NCOL,PVER) + + ! For SOA mapping + REAL(r8) :: totMass(state%NCOL,PVER) + REAL(r8) :: bulkMass(state%NCOL,PVER) + REAL(r8) :: tmpMW_g + CHARACTER(LEN=64) :: speciesName_1, speciesName_2, speciesName_3, speciesName_4 + INTEGER :: speciesId_1, speciesId_2, speciesId_3, speciesId_4 + INTEGER :: iMap, nMapping, iBin, binSOA_1, binSOA_2 + INTEGER :: K1, K2, K3, K4 + LOGICAL :: isSOA_aerosol + #endif ! For emissions @@ -2152,7 +2176,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO #if defined( MODAL_AERO ) - ! First reset State_Chm%Species to zero for aerosols + ! First reset State_Chm%Species to zero out MAM-inherited GEOS-Chem aerosols DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) P = map2MAM4(SM,M) ! Constituent index for GEOS-Chem @@ -2161,7 +2185,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDDO - ! Map and flip aerosols + ! Map and vertically flip aerosols DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) P = map2MAM4(SM,M) ! Constituent index for GEOS-Chem @@ -2180,28 +2204,164 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ENDDO + ! Compute ratios of bin to bulk mass + binRatio = 0.0e+00_r8 DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) P = map2MAM4(SM,M) IF ( P <= 0 ) CYCLE - N = lmassptr_amode(SM,M) K = map2GC(P) ! Index in State_Chm - ! Overwrite MMR_Beg with value from MAM - MMR_Beg(:nY,:nZ,K) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K) + N = lmassptr_amode(SM,M) + IF ( N < 0 ) CYCLE DO J = 1, nY DO L = 1, nZ IF ( State_Chm(LCHNK)%Species(1,J,nZ+1-L,K) > 0.0e+00_r8 ) THEN - binRatio(SM,M,J,L) = REAL(state%q(J,L,N),r8) & + binRatio(SM,M,J,L) = state%q(J,L,N) & * adv_mass(mapCnst(P)) / adv_mass(mapCnst(N)) & - / State_Chm(LCHNK)%Species(1,J,nZ+1-L,K) - ELSE - binRatio(SM,M,J,L) = 0.0e+00_r8 + / REAL(State_Chm(LCHNK)%Species(1,J,nZ+1-L,K), r8) ENDIF ENDDO ENDDO + ! Overwrite MMR_Beg with value from MAM + MMR_Beg(:nY,:nZ,K) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K) ENDDO ENDDO + ! Deal with secondary organic aerosols (SOAs). This mapping is using the + ! complex SOA option in GEOS-Chem. + ! MAM uses five volatility bins spanning saturation concentrations from 0.01 + ! to 100 ug/m3 (logarithmically). The complex SOA option has four volatility + ! bins that 0.1 to 100 ug/m3. We lump the lowest two bins in CESM2 to the + ! lowest bin in GEOS-Chem. + ! + ! The mapping goes as follows: + ! TSOA0 + ASOAN + SOAIE + SOAGX <- soa1_a* + soa2_a* + ! TSOA1 + ASOA1 <- soa3_a* + ! TSOA2 + ASOA2 <- soa4_a* + ! TSOA3 + ASOA3 <- soa5_a* + ! TSOG0 <- SOAG0 + SOAG1 + ! TSOG1 + ASOG1 <- SOAG2 + ! TSOG2 + ASOG2 <- SOAG3 + ! TSOG3 + ASOG3 <- SOAG4 + + IF ( iStep > 1 ) THEN + ! Do not perform this mapping on initialization as we first want to + ! overwrite soa*_a* with the GEOS-Chem SOAs. + nMapping = 8 + DO iMap = 1, nMapping + speciesName_1 = '' + speciesName_2 = '' + speciesName_3 = '' + speciesName_4 = '' + IF ( iMap == 1 ) THEN + binSOA_1 = 1 + binSOA_2 = 2 + speciesName_1 = 'TSOA0' + speciesName_2 = 'ASOAN' + speciesName_3 = 'SOAIE' + speciesName_4 = 'SOAGX' + ELSEIF ( iMap == 2 ) THEN + binSOA_1 = 3 + binSOA_2 = 3 + speciesName_1 = 'TSOA1' + speciesName_2 = 'ASOA1' + ELSEIF ( iMap == 3 ) THEN + binSOA_1 = 4 + binSOA_2 = 4 + speciesName_1 = 'TSOA2' + speciesName_2 = 'ASOA2' + ELSEIF ( iMap == 4 ) THEN + binSOA_1 = 5 + binSOA_2 = 5 + speciesName_1 = 'TSOA3' + speciesName_2 = 'ASOA3' + ELSEIF ( iMap == 5 ) THEN + binSOA_1 = 1 + binSOA_2 = 2 + speciesName_1 = 'TSOG0' + speciesName_2 = 'TSOG0' + ELSEIF ( iMap == 6 ) THEN + binSOA_1 = 3 + binSOA_2 = 3 + speciesName_1 = 'TSOG1' + speciesName_2 = 'ASOG1' + ELSEIF ( iMap == 7 ) THEN + binSOA_1 = 4 + binSOA_2 = 4 + speciesName_1 = 'TSOG2' + speciesName_2 = 'ASOG2' + ELSEIF ( iMap == 8 ) THEN + binSOA_1 = 5 + binSOA_2 = 5 + speciesName_1 = 'TSOG3' + speciesName_2 = 'ASOG3' + ELSE + CALL ENDRUN('Unknown SOA mapping!') + ENDIF + isSOA_aerosol = .False. + IF ( iMap <= 4 ) isSOA_aerosol = .True. + + ! Compute total mass from GEOS-Chem species. This sets the ratio between + ! speciesId_1 and speciesId_2 + totMass(:nY,:nZ) = 0.0e+00_r8 + + CALL cnst_get_ind( speciesName_1, speciesId_1, abort=.True. ) + CALL cnst_get_ind( speciesName_2, speciesId_2, abort=.False. ) + CALL cnst_get_ind( speciesName_3, speciesId_3, abort=.False. ) + CALL cnst_get_ind( speciesName_4, speciesId_4, abort=.False. ) + IF ( speciesId_1 > 0 ) totMass(:nY,:nZ) = totMass(:nY,:nZ) + state%q(:nY,:nZ,speciesId_1) + IF ( speciesId_2 > 0 ) totMass(:nY,:nZ) = totMass(:nY,:nZ) + state%q(:nY,:nZ,speciesId_2) + IF ( speciesId_3 > 0 ) totMass(:nY,:nZ) = totMass(:nY,:nZ) + state%q(:nY,:nZ,speciesId_3) + IF ( speciesId_4 > 0 ) totMass(:nY,:nZ) = totMass(:nY,:nZ) + state%q(:nY,:nZ,speciesId_4) + + ! Compute total bulk mass from MAM + bulkMass(:nY,:nZ) = 0.0e+00_r8 + IF ( isSOA_aerosol ) THEN + DO iBin = binSOA_1, binSOA_2 + DO M = 1, ntot_amode + N = lptr2_soa_a_amode(M,iBin) + IF ( N <= 0 ) CYCLE + tmpMW_g = adv_mass(mapCnst(N)) + bulkMass(:nY,:nZ) = bulkMass(:nY,:nZ) + state%q(:nY,:nZ,N) + ENDDO + ENDDO + ELSE + DO iBin = binSOA_1, binSOA_2 + N = lptr2_soa_g_amode(iBin) + IF ( N <= 0 ) CYCLE + tmpMW_g = adv_mass(mapCnst(N)) + bulkMass(:nY,:nZ) = bulkMass(:nY,:nZ) + state%q(:nY,:nZ,N) + ENDDO + ENDIF + + K1 = Ind_(speciesName_1) + K2 = Ind_(speciesName_2) + K3 = Ind_(speciesName_3) + K4 = Ind_(speciesName_4) + DO J = 1, nY + DO L = 1, nZ + IF ( totMass(J,L) > 0.0e+00_r8 ) THEN + IF ( K1 > 0 ) State_Chm(LCHNK)%Species(1,J,L,K1) = state%q(J,nZ+1-L,speciesId_1) / totMass(J,nZ+1-L) * bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_1)) / tmpMW_g + IF ( K2 > 0 ) State_Chm(LCHNK)%Species(1,J,L,K2) = state%q(J,nZ+1-L,speciesId_2) / totMass(J,nZ+1-L) * bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_2)) / tmpMW_g + IF ( K3 > 0 ) State_Chm(LCHNK)%Species(1,J,L,K3) = state%q(J,nZ+1-L,speciesId_3) / totMass(J,nZ+1-L) * bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_3)) / tmpMW_g + IF ( K4 > 0 ) State_Chm(LCHNK)%Species(1,J,L,K4) = state%q(J,nZ+1-L,speciesId_4) / totMass(J,nZ+1-L) * bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_4)) / tmpMW_g + ELSE + IF ( K1 == K2 ) THEN + State_Chm(LCHNK)%Species(1,J,L,K1) = bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_1)) / tmpMW_g + ELSE + State_Chm(LCHNK)%Species(1,J,L,K1) = bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_1)) / tmpMW_g / 2.0_r8 + State_Chm(LCHNK)%Species(1,J,L,K2) = bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_1)) / tmpMW_g / 2.0_r8 + ENDIF + ENDIF + ENDDO + ENDDO + IF ( K1 > 0 ) MMR_Beg(:nY,:nZ,K1) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K1) + IF ( K2 > 0 ) MMR_Beg(:nY,:nZ,K2) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K2) + IF ( K3 > 0 ) MMR_Beg(:nY,:nZ,K4) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K3) + IF ( K4 > 0 ) MMR_Beg(:nY,:nZ,K3) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K4) + ENDDO + ENDIF + ! Add gas-phase H2SO4 to GEOS-Chem SO4 (which lumps SO4 aerosol and gaseous) K = iSO4 N = cH2SO4 @@ -2212,6 +2372,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) SO4_gasRatio(:nY,:nZ) = state%q(:nY,:nZ,N) & * adv_mass(l_SO4) / adv_mass(mapCnst(N)) & / State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,K) + MMR_Beg(:nY,:nZ,K) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K) ENDIF #endif @@ -3642,14 +3803,16 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) IF ( l_H2SO4 > 0 .AND. l_SO4 > 0 ) THEN P = l_H2SO4 ! SO4_gasRatio is kg(SO4) (gaseous) / kg(SO4) (gaseous+aerosol) - vmr1(:nY,:nZ,P) = SO4_gasRatio(:nY,:nZ) * vmr1(:nY,:nZ,l_SO4) + vmr1(:nY,:nZ,P) = SO4_gasRatio(:nY,:nZ) * vmr1(:nY,:nZ,l_SO4) & + * adv_mass(l_SO4) / adv_mass(P) ! binRatio is kg(SO4) (current bin) / kg(SO4) (all bins) DO M = 1, ntot_amode N = lptr_so4_a_amode(M) IF ( N <= 0 ) CYCLE P = mapCnst(N) - vmr1(:nY,:nZ,P) = vmr1(:nY,:nZ,l_SO4) & - * ( 1.0d+00 - SO4_gasRatio(:nY,:nZ) ) & + vmr1(:nY,:nZ,P) = vmr1(:nY,:nZ,l_SO4) & + * adv_mass(l_SO4) / adv_mass(P) & + * ( 1.0_r8 - SO4_gasRatio(:nY,:nZ) ) & * binRatio(iSulf(M),M,:nY,:nZ) ENDDO ENDIF @@ -3680,6 +3843,111 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) vmr0 = vmr0, & vmr = vmr1, & pbuf = pbuf ) + + ! Repartition MAM SOAs following mapping: + ! TSOA0 + ASOAN + SOAIE + SOAGX -> soa1_a* + soa2_a* + ! TSOA1 + ASOA1 -> soa3_a* + ! TSOA2 + ASOA2 -> soa4_a* + ! TSOA3 + ASOA3 -> soa5_a* + ! TSOG0 -> SOAG0 + SOAG1 + ! TSOG1 + ASOG1 -> SOAG2 + ! TSOG2 + ASOG2 -> SOAG3 + ! TSOG3 + ASOG3 -> SOAG4 + + ! Deal with aerosol SOA species + ! First deal with lowest two volatility bins + speciesName_1 = 'TSOA0' + speciesName_2 = 'ASOAN' + speciesName_2 = 'SOAIE' + speciesName_2 = 'SOAGX' + K1 = get_spc_ndx(TRIM(speciesName_1)) + K2 = get_spc_ndx(TRIM(speciesName_2)) + K3 = get_spc_ndx(TRIM(speciesName_3)) + K4 = get_spc_ndx(TRIM(speciesName_4)) + bulkMass(:nY,:nZ) = 0.0e+00_r8 + DO iBin = 1, 2 + DO M = 1, ntot_amode + N = lptr2_soa_a_amode(M,iBin) + IF ( N <= 0 ) CYCLE + bulkMass(:nY,:nZ) = bulkMass(:nY,:nZ) + state%q(:nY,:nZ,N) + ENDDO + ENDDO + DO iBin = 1, 2 + DO M = 1, ntot_amode + N = lptr2_soa_a_amode(M,iBin) + IF ( N <= 0 ) CYCLE + P = mapCnst(N) + IF ( P > 0 .AND. K1 > 0 .AND. K2 > 0 .AND. K3 > 0 .AND. K4 > 0 ) THEN + vmr1(:nY,:nZ,P) = state%q(:nY,:nZ,N) / bulkMass(:nY,:nZ) & + * (vmr1(:nY,:nZ,K1) + vmr1(:nY,:nZ,K2) + & + vmr1(:nY,:nZ,K3) + vmr1(:nY,:nZ,K4)) + ENDIF + ENDDO + ENDDO + + ! Now deal with other volatility bins + DO iBin = 3, nsoa + IF ( iBin == 3 ) THEN + speciesName_1 = 'TSOA1' + speciesName_2 = 'ASOA1' + ELSEIF ( iBin == 4 ) THEN + speciesName_1 = 'TSOA2' + speciesName_2 = 'ASOA2' + ELSEIF ( iBin == 5 ) THEN + speciesName_1 = 'TSOA3' + speciesName_2 = 'ASOA3' + ENDIF + K1 = get_spc_ndx(TRIM(speciesName_1)) + K2 = get_spc_ndx(TRIM(speciesName_2)) + bulkMass(:nY,:nZ) = 0.0e+00_r8 + DO M = 1, ntot_amode + N = lptr2_soa_a_amode(M,iBin) + IF ( N <= 0 ) CYCLE + bulkMass(:nY,:nZ) = bulkMass(:nY,:nZ) + state%q(:nY,:nZ,N) + ENDDO + DO M = 1, ntot_amode + N = lptr2_soa_a_amode(M,iBin) + IF ( N <= 0 ) CYCLE + P = mapCnst(N) + IF ( P > 0 .AND. K1 > 0 .AND. K2 > 0 ) THEN + vmr1(:nY,:nZ,P) = state%q(:nY,:nZ,N) / bulkMass(:nY,:nZ) & + * (vmr1(:nY,:nZ,K1) + vmr1(:nY,:nZ,K2)) + ENDIF + ENDDO + ENDDO + + ! Now deal with gaseous SOA species + ! Deal with lowest two volatility bins + speciesName_1 = 'TSOG0' + K1 = get_spc_ndx(TRIM(speciesName_1)) + N = lptr2_soa_g_amode(1) + P = mapCnst(N) + vmr1(:nY,:nZ,P) = vmr0(:nY,:nZ,P) / (vmr0(:nY,:nZ,P) + vmr0(:nY,:nZ,mapCnst(lptr2_soa_g_amode(2)))) & + * vmr1(:nY,:nZ,K1) + N = lptr2_soa_g_amode(2) + P = mapCnst(N) + vmr1(:nY,:nZ,P) = vmr0(:nY,:nZ,P) / (vmr0(:nY,:nZ,P) + vmr0(:nY,:nZ,mapCnst(lptr2_soa_g_amode(1)))) & + * vmr1(:nY,:nZ,K1) + + ! Deal with other volatility bins + DO iBin = 3, nsoa + N = lptr2_soa_g_amode(iBin) + P = mapCnst(N) + IF ( iBin == 3 ) THEN + speciesName_1 = 'TSOG1' + speciesName_2 = 'ASOG1' + ELSEIF ( iBin == 4 ) THEN + speciesName_1 = 'TSOG2' + speciesName_2 = 'ASOG2' + ELSEIF ( iBin == 5 ) THEN + speciesName_1 = 'TSOG3' + speciesName_2 = 'ASOG3' + ENDIF + K1 = get_spc_ndx(TRIM(speciesName_1)) + K2 = get_spc_ndx(TRIM(speciesName_2)) + IF ( P > 0 .AND. K1 > 0 .AND. K2 > 0 ) vmr1(:nY,:nZ,P) = vmr1(:nY,:nZ,K1) + vmr1(:nY,:nZ,K2) + ENDDO + #endif !============================================================== @@ -3749,6 +4017,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO CALL set_short_lived_species( SlsData, LCHNK, nY, pbuf ) + ! Apply tendencies to GEOS-Chem species DO N = 1, pcnst M = map2GC(N) IF ( M <= 0 ) CYCLE @@ -3767,7 +4036,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! ! We decide to apply chemical tendencies to all MAM aerosols, ! except so4, for which the chemically-produced sulfate gets - ! partitioned in aero_model_gasaerexch + ! partitioned in aero_model_gasaerexch. DO M = 1, ntot_amode DO SM = 1, nspec_amode(M) N = lmassptr_amode(SM,M) @@ -3802,6 +4071,15 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) + (vmr1(:nY,:nZ,P) - vmr0(:nY,:nZ,P))/dT & * adv_mass(P) / MWDry ENDIF + DO iBin = 1, nsoa + N = lptr2_soa_g_amode(iBin) + P = mapCnst(N) + IF ( P > 0 ) THEN + ptend%q(:nY,:nZ,N) = ptend%q(:nY,:nZ,N) & + + (vmr1(:nY,:nZ,P) - vmr0(:nY,:nZ,P))/dT & + * adv_mass(P) / MWDry + ENDIF + ENDDO #endif DO N = 1, gas_pcnst @@ -3835,12 +4113,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL outfld( 'CT_H2O_GHG', ptend%q(:,:,1), PCOLS, LCHNK ) ENDIF - ! Debug statements - ! Ozone tendencies - IF ( rootChunk ) THEN - Write(iulog,*) " MMR_Beg = ", MMR_Beg(1,:,iO3) - Write(iulog,*) " MMR_End = ", MMR_End(1,:,iO3) - ENDIF + !! Debug statements + !! Ozone tendencies + !IF ( rootChunk ) THEN + ! Write(iulog,*) " MMR_Beg = ", MMR_Beg(1,:,iO3) + ! Write(iulog,*) " MMR_End = ", MMR_End(1,:,iO3) + !ENDIF IF (PRESENT(fh2o)) THEN fh2o(:nY) = 0.0e+0_r8 diff --git a/src/chemistry/geoschem/mo_neu_wetdep.F90 b/src/chemistry/geoschem/mo_neu_wetdep.F90 index 49a9acb3a0..b70718015a 100644 --- a/src/chemistry/geoschem/mo_neu_wetdep.F90 +++ b/src/chemistry/geoschem/mo_neu_wetdep.F90 @@ -148,8 +148,14 @@ subroutine neu_wetdep_init 'IONITA', 'ISALA', 'ISALC', 'LVOCOA', 'MONITA', & 'MSA', 'NH4', 'NIT', 'NITS', 'PFE', & 'SALAAL', 'SALACL', 'SALCAL', 'SALCCL', 'SO4S', & - 'SOAGX', 'SOAIE' ) + 'SOAS', 'SOAGX', 'SOAIE', 'TSOA0', 'TSOA1', & + 'TSOA2', 'TSOA3', 'ASOAN', 'ASOA1', 'ASOA2', & + 'ASOA3' ) test_name = 'HNO3' + case( 'ASOG1', 'ASOG2', 'ASOG3' ) + test_name = 'ASOG' + case( 'TSOG0', 'TSOG1', 'TSOG2', 'TSOG3' ) + test_name = 'TSOG' end select ! do l = 1,n_species_table @@ -226,8 +232,8 @@ subroutine neu_wetdep_init call addfld ('DTWR_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','kg/kg/s','wet removal Neu scheme tendency') call addfld ('WD_'//trim(gas_wetdep_list(m)),horiz_only, 'A','kg/m2/s','vertical integrated wet deposition flux') call addfld ('HEFF_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','M/atm','Effective Henrys Law coeff.') - call add_default('DTWR_'//trim(gas_wetdep_list(m)), 2, ' ') - call add_default('WD_'//trim(gas_wetdep_list(m)), 2, ' ') + !call add_default('DTWR_'//trim(gas_wetdep_list(m)), 2, ' ') + !call add_default('WD_'//trim(gas_wetdep_list(m)), 2, ' ') !call add_default('HEFF_'//trim(gas_wetdep_list(m)), 2, ' ') if (history_chemistry) then call add_default('DTWR_'//trim(gas_wetdep_list(m)), 1, ' ') diff --git a/src/chemistry/geoschem/mo_sim_dat.F90 b/src/chemistry/geoschem/mo_sim_dat.F90 index 442e2fc4a0..46c344415b 100644 --- a/src/chemistry/geoschem/mo_sim_dat.F90 +++ b/src/chemistry/geoschem/mo_sim_dat.F90 @@ -40,22 +40,24 @@ subroutine set_sim_dat ! aerosols, as those will be constituents. MAM requires that there ! is a linear mapping between solsym and constituents - solsym(:318) = (/ 'ACET ','ACTA ','AERI ', & - 'ALD2 ','ALK4 ','ATOOH ', & - 'BCPI ','BCPO ','BENZ ', & - 'BR ','BR2 ','BRCL ', & - 'BRNO2 ','BRNO3 ','BRO ', & - 'BRSALA ','BRSALC ','C2H6 ', & - 'C3H8 ','CCL4 ','CFC11 ', & - 'CFC113 ','CFC114 ','CFC115 ', & - 'CFC12 ','CH2BR2 ','CH2CL2 ', & - 'CH2I2 ','CH2IBR ','CH2ICL ', & - 'CH2O ','CH3BR ','CH3CCL3 ', & - 'CH3CL ','CH3I ','CH4 ', & - 'CHBR3 ','CHCL3 ','CL ', & - 'CL2 ','CL2O2 ','CLNO2 ', & - 'CLNO3 ','CLO ','CLOO ', & - 'CLOCK ', & + solsym(:331) = (/ 'ACET ','ACTA ','AERI ', & + 'ALD2 ','ALK4 ','ASOA1 ', & + 'ASOA2 ','ASOA3 ','ASOAN ', & + 'ASOG1 ','ASOG2 ','ASOG3 ', & + 'ATOOH ','BCPI ','BCPO ', & + 'BENZ ','BR ','BR2 ', & + 'BRCL ','BRNO2 ','BRNO3 ', & + 'BRO ','BRSALA ','BRSALC ', & + 'C2H6 ','C3H8 ','CCL4 ', & + 'CFC11 ','CFC113 ','CFC114 ', & + 'CFC115 ','CFC12 ','CH2BR2 ', & + 'CH2CL2 ','CH2I2 ','CH2IBR ', & + 'CH2ICL ','CH2O ','CH3BR ', & + 'CH3CCL3 ','CH3CL ','CH3I ', & + 'CH4 ','CHBR3 ','CHCL3 ', & + 'CL ','CL2 ','CL2O2 ', & + 'CLNO2 ','CLNO3 ','CLO ', & + 'CLOO ','CLOCK ', & 'CO ','DMS ','DST1 ', & 'DST2 ','DST3 ','DST4 ', & 'EOH ','ETHLN ','ETNO3 ', & @@ -107,8 +109,10 @@ subroutine set_sim_dat 'SALAAL ','SALACL ','SALC ', & 'SALCAL ','SALCCL ','SO2 ', & 'SO4 ','SO4S ','SOAGX ', & - 'SOAIE ','SOAP ','SOAS ', & - 'TOLU ','XYLE ','bc_a1 ', & + 'SOAIE ','TOLU ','TSOA0 ', & + 'TSOA1 ','TSOA2 ','TSOA3 ', & + 'TSOG0 ','TSOG1 ','TSOG2 ', & + 'TSOG3 ','XYLE ','bc_a1 ', & 'bc_a4 ','dst_a1 ','dst_a2 ', & 'dst_a3 ','ncl_a1 ','ncl_a2 ', & 'ncl_a3 ','num_a1 ','num_a2 ', & @@ -154,81 +158,78 @@ subroutine set_sim_dat fix_mass(: 6) = (/ 0.00000000_r8, 28.0134800_r8, 31.9988000_r8, 2.020000_r8, 32.050000_r8, & 74.090000_r8 /) - adv_mass(:318) = (/ 58.090000_r8, 60.060000_r8, 126.900000_r8, 44.060000_r8, 58.120000_r8, & - 90.090000_r8, 12.010000_r8, 12.010000_r8, 78.120000_r8, 79.900000_r8, & - 159.800000_r8, 115.450000_r8, 125.910000_r8, 141.910000_r8, 95.900000_r8, & - 79.900000_r8, 79.900000_r8, 30.080000_r8, 44.110000_r8, 153.820000_r8, & - 137.370000_r8, 187.380000_r8, 170.920000_r8, 154.470000_r8, 120.910000_r8, & - 173.830000_r8, 84.930000_r8, 267.840000_r8, 220.840000_r8, 176.380000_r8, & - 30.030000_r8, 94.940000_r8, 133.350000_r8, 50.450000_r8, 141.940000_r8, & - 16.050000_r8, 252.730000_r8, 119.350000_r8, 35.450000_r8, 70.900000_r8, & - 102.910000_r8, 81.450000_r8, 97.450000_r8, 51.450000_r8, 67.450000_r8, & - 1.000000_r8, & - 28.010000_r8, 62.130000_r8, 29.000000_r8, 29.000000_r8, 29.000000_r8, & - 29.000000_r8, 46.080000_r8, 105.060000_r8, 91.080000_r8, 62.080000_r8, & - 60.060000_r8, 58.040000_r8, 165.360000_r8, 148.910000_r8, 259.820000_r8, & - 18.020000_r8, 34.020000_r8, 74.080000_r8, 80.910000_r8, 100.130000_r8, & - 152.930000_r8, 116.940000_r8, 100.500000_r8, 86.470000_r8, 36.450000_r8, & - 46.030000_r8, 127.910000_r8, 64.050000_r8, 102.100000_r8, 47.010000_r8, & - 63.010000_r8, 79.010000_r8, 96.910000_r8, 52.450000_r8, 143.890000_r8, & - 215.000000_r8, 116.130000_r8, 116.130000_r8, 116.130000_r8, 116.130000_r8, & - 76.060000_r8, 126.900000_r8, 253.800000_r8, 285.800000_r8, 301.800000_r8, & - 317.800000_r8, 206.900000_r8, 116.130000_r8, 162.450000_r8, 145.130000_r8, & - 150.150000_r8, 98.110000_r8, 148.130000_r8, 168.170000_r8, 150.150000_r8, & - 192.150000_r8, 106.140000_r8, 106.140000_r8, 106.140000_r8, 147.150000_r8, & - 147.150000_r8, 147.150000_r8, 147.150000_r8, 102.000000_r8, 156.910000_r8, & - 163.150000_r8, 163.150000_r8, 142.900000_r8, 14.010000_r8, 172.910000_r8, & - 188.910000_r8, 105.110000_r8, 126.900000_r8, 126.900000_r8, 68.130000_r8, & - 195.150000_r8, 197.170000_r8, 136.260000_r8, 154.190000_r8, 154.190000_r8, & - 70.100000_r8, 102.100000_r8, 76.060000_r8, 104.120000_r8, 86.100000_r8, & - 149.110000_r8, 149.110000_r8, 120.120000_r8, 72.110000_r8, 77.050000_r8, & - 72.070000_r8, 32.050000_r8, 14.010000_r8, 215.280000_r8, 215.280000_r8, & - 48.050000_r8, 147.100000_r8, 93.050000_r8, 96.100000_r8, 136.260000_r8, & - 136.260000_r8, 70.090000_r8, 105.130000_r8, 102.100000_r8, 102.100000_r8, & - 120.120000_r8, 149.120000_r8, 118.100000_r8, 44.020000_r8, 108.020000_r8, & - 17.040000_r8, 18.050000_r8, 62.010000_r8, 31.400000_r8, 30.010000_r8, & - 46.010000_r8, 62.010000_r8, 105.110000_r8, 48.000000_r8, 67.450000_r8, & - 12.010000_r8, 12.010000_r8, 60.070000_r8, 158.900000_r8, 121.060000_r8, & - 55.850000_r8, 186.280000_r8, 92.110000_r8, 135.080000_r8, 119.080000_r8, & - 42.090000_r8, 137.110000_r8, 88.070000_r8, 119.100000_r8, 90.140000_r8, & - 76.110000_r8, 76.110000_r8, 58.090000_r8, 118.150000_r8, 118.150000_r8, & - 118.150000_r8, 118.150000_r8, 90.090000_r8, 31.400000_r8, 31.400000_r8, & - 35.450000_r8, 31.400000_r8, 31.400000_r8, 35.450000_r8, 64.040000_r8, & - 96.060000_r8, 31.400000_r8, 58.040000_r8, 118.150000_r8, 150.000000_r8, & - 150.000000_r8, 92.150000_r8, 106.180000_r8, 12.011000_r8, 12.011000_r8, & - 135.064039_r8, 135.064039_r8, 135.064039_r8, 58.442468_r8, 58.442468_r8, & - 58.442468_r8, 1.007400_r8, 1.007400_r8, 1.007400_r8, 1.007400_r8, & - 12.011000_r8, 12.011000_r8, 115.107340_r8, 115.107340_r8, 115.107340_r8, & + adv_mass(:331) = (/ 58.090000_r8, 60.060000_r8, 126.900000_r8, 44.060000_r8, 58.120000_r8, & + 150.000000_r8, 150.000000_r8, 150.000000_r8, 150.000000_r8, 150.000000_r8, & + 150.00000_r8, 150.000000_r8, 90.0900000_r8, 12.010000_r8, 12.010000_r8, & + 78.120000_r8, 79.900000_r8, 159.800000_r8, 115.450000_r8, 125.910000_r8, & + 141.910000_r8, 95.900000_r8, 79.900000_r8, 79.900000_r8, 30.080000_r8, & + 44.110000_r8, 153.820000_r8, 137.370000_r8, 187.380000_r8, 170.920000_r8, & + 154.470000_r8, 120.910000_r8, 173.830000_r8, 84.930000_r8, 267.840000_r8, & + 220.840000_r8, 176.380000_r8, 30.030000_r8, 94.940000_r8, 133.350000_r8, & + 50.450000_r8, 141.940000_r8, 16.050000_r8, 252.730000_r8, 119.350000_r8, & + 35.450000_r8, 70.900000_r8, 102.910000_r8, 81.450000_r8, 97.450000_r8, & + 51.450000_r8, 67.450000_r8, 1.000000_r8, 28.010000_r8, 62.130000_r8, & + 29.000000_r8, 29.000000_r8, 29.000000_r8, 29.000000_r8, 46.080000_r8, & + 105.060000_r8, 91.080000_r8, 62.080000_r8, 60.060000_r8, 58.040000_r8, & + 165.360000_r8, 148.910000_r8, 259.820000_r8, 18.020000_r8, 34.020000_r8, & + 74.080000_r8, 80.910000_r8, 100.130000_r8, 152.930000_r8, 116.940000_r8, & + 100.500000_r8, 86.470000_r8, 36.450000_r8, 46.030000_r8, 127.910000_r8, & + 64.050000_r8, 102.100000_r8, 47.010000_r8, 63.010000_r8, 79.010000_r8, & + 96.910000_r8, 52.450000_r8, 143.890000_r8, 215.000000_r8, 116.130000_r8, & + 116.130000_r8, 116.130000_r8, 116.130000_r8, 76.060000_r8, 126.900000_r8, & + 253.800000_r8, 285.800000_r8, 301.800000_r8, 317.800000_r8, 206.900000_r8, & + 116.130000_r8, 162.450000_r8, 145.130000_r8, 150.150000_r8, 98.110000_r8, & + 148.130000_r8, 168.170000_r8, 150.150000_r8, 192.150000_r8, 106.140000_r8, & + 106.140000_r8, 106.140000_r8, 147.150000_r8, 147.150000_r8, 147.150000_r8, & + 147.150000_r8, 102.000000_r8, 156.910000_r8, 163.150000_r8, 163.150000_r8, & + 142.900000_r8, 14.010000_r8, 172.910000_r8, 188.910000_r8, 105.110000_r8, & + 126.900000_r8, 126.900000_r8, 68.130000_r8, 195.150000_r8, 197.170000_r8, & + 136.260000_r8, 154.190000_r8, 154.190000_r8, 70.100000_r8, 102.100000_r8, & + 76.060000_r8, 104.120000_r8, 86.100000_r8, 149.110000_r8, 149.110000_r8, & + 120.120000_r8, 72.110000_r8, 77.050000_r8, 72.070000_r8, 32.050000_r8, & + 14.010000_r8, 215.280000_r8, 215.280000_r8, 48.050000_r8, 147.100000_r8, & + 93.050000_r8, 96.100000_r8, 136.260000_r8, 136.260000_r8, 70.090000_r8, & + 105.130000_r8, 102.100000_r8, 102.100000_r8, 120.120000_r8, 149.120000_r8, & + 118.100000_r8, 44.020000_r8, 108.020000_r8, 17.040000_r8, 18.050000_r8, & + 62.010000_r8, 31.400000_r8, 30.010000_r8, 46.010000_r8, 62.010000_r8, & + 105.110000_r8, 48.000000_r8, 67.450000_r8, 12.010000_r8, 12.010000_r8, & + 60.070000_r8, 158.900000_r8, 121.060000_r8, 55.850000_r8, 186.280000_r8, & + 92.110000_r8, 135.080000_r8, 119.080000_r8, 42.090000_r8, 137.110000_r8, & + 88.070000_r8, 119.100000_r8, 90.140000_r8, 76.110000_r8, 76.110000_r8, & + 58.090000_r8, 118.150000_r8, 118.150000_r8, 118.150000_r8, 118.150000_r8, & + 90.090000_r8, 31.400000_r8, 31.400000_r8, 35.450000_r8, 31.400000_r8, & + 31.400000_r8, 35.450000_r8, 64.040000_r8, 96.060000_r8, 31.400000_r8, & + 58.040000_r8, 118.150000_r8, 92.150000_r8, 150.000000_r8, 150.000000_r8, & + 150.000000_r8, 150.000000_r8, 150.000000_r8, 150.000000_r8, 150.000000_r8, & + 150.000000_r8, 106.180000_r8, 12.011000_r8, 12.011000_r8, 135.064039_r8, & + 135.064039_r8, 135.064039_r8, 58.442468_r8, 58.442468_r8, 58.442468_r8, & + 1.007400_r8, 1.007400_r8, 1.007400_r8, 1.007400_r8, 12.011000_r8, & + 12.011000_r8, 115.107340_r8, 115.107340_r8, 115.107340_r8, 250.445000_r8, & 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & + 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 98.078400_r8, & 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & - 98.078400_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, 250.445000_r8, & - 250.445000_r8, 44.010000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, & + 44.010000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, & + -1.000000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, 96.060000_r8, & + 96.060000_r8, 96.060000_r8, 96.060000_r8, -1.000000_r8, -1.000000_r8, & -1.000000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, & - 96.060000_r8, 96.060000_r8, 96.060000_r8, 96.060000_r8, -1.000000_r8, & - -1.000000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, -1.000000_r8, & - -1.000000_r8, 159.130000_r8, 173.160000_r8, 14.010000_r8, 187.190000_r8, & - 147.120000_r8, 147.120000_r8, 146.140000_r8, 103.110000_r8, 103.110000_r8, & - 241.140000_r8, 194.140000_r8, 196.160000_r8, 60.110000_r8, 196.160000_r8, & - 196.160000_r8, 196.160000_r8, 1.010000_r8, 167.160000_r8, 167.160000_r8, & - 167.160000_r8, 212.160000_r8, 149.140000_r8, 150.130000_r8, 136.090000_r8, & - 119.110000_r8, 119.110000_r8, 101.090000_r8, 91.100000_r8, 230.270000_r8, & - 230.270000_r8, 61.070000_r8, 212.160000_r8, 89.080000_r8, 185.270000_r8, & - 101.090000_r8, 149.140000_r8, 149.140000_r8, 60.060000_r8, 185.270000_r8, & - 196.160000_r8, 75.100000_r8, 117.140000_r8, 117.140000_r8, 162.140000_r8, & - 162.140000_r8, 180.100000_r8, 89.080000_r8, 61.070000_r8, 89.130000_r8, & - 75.100000_r8, 46.030000_r8, 75.050000_r8, 47.040000_r8, 16.000000_r8, & - 17.010000_r8, 33.010000_r8, 16.000000_r8, 2.020000_r8, 28.020000_r8, & - 32.000000_r8, 74.090000_r8 /) + 159.130000_r8, 173.160000_r8, 14.010000_r8, 187.190000_r8, 147.120000_r8, & + 147.120000_r8, 146.140000_r8, 103.110000_r8, 103.110000_r8, 241.140000_r8, & + 194.140000_r8, 196.160000_r8, 60.110000_r8, 196.160000_r8, 196.160000_r8, & + 196.160000_r8, 1.010000_r8, 167.160000_r8, 167.160000_r8, 167.160000_r8, & + 212.160000_r8, 149.140000_r8, 150.130000_r8, 136.090000_r8, 119.110000_r8, & + 119.110000_r8, 101.090000_r8, 91.100000_r8, 230.270000_r8, 230.270000_r8, & + 61.070000_r8, 212.160000_r8, 89.080000_r8, 185.270000_r8, 101.090000_r8, & + 149.140000_r8, 149.140000_r8, 60.060000_r8, 185.270000_r8, 196.160000_r8, & + 75.100000_r8, 117.140000_r8, 117.140000_r8, 162.140000_r8, 162.140000_r8, & + 180.100000_r8, 89.080000_r8, 61.070000_r8, 89.130000_r8, 75.100000_r8, & + 46.030000_r8, 75.050000_r8, 47.040000_r8, 16.000000_r8, 17.010000_r8, & + 33.010000_r8, 16.000000_r8, 2.020000_r8, 28.020000_r8, 32.000000_r8, & + 74.090000_r8 /) extfrc_lst(: 1) = (/ ' ' /) frc_from_dataset(: 1) = (/ .false. /) - !extfrc_lst(: 17) = (/ 'so4_a2 ','NO ','NO2 ','SO2 ','SVOC ', & - ! 'pom_a1 ','pom_a4 ','so4_a1 ','CO ','bc_a1 ', & - ! 'bc_a4 ','num_a1 ','num_a2 ','num_a4 ','OH ', & - ! 'N ','AOA_NH ' /) - ! crb_mass(:221) = (/ 60.055000_r8, 60.055000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, & ! 180.165000_r8, 72.066000_r8, 72.066000_r8, 72.066000_r8, 60.055000_r8, & ! 48.044000_r8, 60.055000_r8, 60.055000_r8, 72.066000_r8, 60.055000_r8, & @@ -351,532 +352,6 @@ subroutine set_sim_dat ! 'PHENO2 ', 'PO2 ', 'RO2 ', 'TERP2O2 ', 'TERPO2 ', & ! 'TOLO2 ', 'XO2 ', 'XYLENO2 ', 'XYLOLO2 ' /) - ! if( allocated( rxt_tag_lst ) ) then - ! deallocate( rxt_tag_lst ) - ! end if - ! allocate( rxt_tag_lst(rxt_tag_cnt),stat=ios ) - ! if( ios /= 0 ) then - ! write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_lst; error = ',ios - ! call endrun - ! end if - ! if( allocated( rxt_tag_map ) ) then - ! deallocate( rxt_tag_map ) - ! end if - ! allocate( rxt_tag_map(rxt_tag_cnt),stat=ios ) - ! if( ios /= 0 ) then - ! write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_map; error = ',ios - ! call endrun - ! end if - ! rxt_tag_lst( 1: 200) = (/ 'jh2o_b ', 'jh2o_a ', & - ! 'jh2o_c ', 'jh2o2 ', & - ! 'jo2_a ', 'jo2_b ', & - ! 'jo3_a ', 'jo3_b ', & - ! 'jhno3 ', 'jho2no2_a ', & - ! 'jho2no2_b ', 'jn2o ', & - ! 'jn2o5_a ', 'jn2o5_b ', & - ! 'jno ', 'jno2 ', & - ! 'jno3_b ', 'jno3_a ', & - ! 'jalknit ', 'jalkooh ', & - ! 'jbenzooh ', 'jbepomuc ', & - ! 'jbigald ', 'jbigald1 ', & - ! 'jbigald2 ', 'jbigald3 ', & - ! 'jbigald4 ', 'jbzooh ', & - ! 'jc2h5ooh ', 'jc3h7ooh ', & - ! 'jc6h5ooh ', 'jch2o_a ', & - ! 'jch2o_b ', 'jch3cho ', & - ! 'jacet ', 'jmgly ', & - ! 'jch3co3h ', 'jch3ooh ', & - ! 'jch4_a ', 'jch4_b ', & - ! 'jco2 ', 'jeooh ', & - ! 'jglyald ', 'jglyoxal ', & - ! 'jhonitr ', 'jhpald ', & - ! 'jhyac ', 'jisopnooh ', & - ! 'jisopooh ', 'jmacr_a ', & - ! 'jmacr_b ', 'jmek ', & - ! 'jmekooh ', 'jmpan ', & - ! 'jmvk ', 'jnc4cho ', & - ! 'jnoa ', 'jnterpooh ', & - ! 'jonitr ', 'jpan ', & - ! 'jphenooh ', 'jpooh ', & - ! 'jrooh ', 'jtepomuc ', & - ! 'jterp2ooh ', 'jterpnit ', & - ! 'jterpooh ', 'jterprd1 ', & - ! 'jterprd2 ', 'jtolooh ', & - ! 'jxooh ', 'jxylenooh ', & - ! 'jxylolooh ', 'jbrcl ', & - ! 'jbro ', 'jbrono2_b ', & - ! 'jbrono2_a ', 'jccl4 ', & - ! 'jcf2clbr ', 'jcf3br ', & - ! 'jcfcl3 ', 'jcfc113 ', & - ! 'jcfc114 ', 'jcfc115 ', & - ! 'jcf2cl2 ', 'jch2br2 ', & - ! 'jch3br ', 'jch3ccl3 ', & - ! 'jch3cl ', 'jchbr3 ', & - ! 'jcl2 ', 'jcl2o2 ', & - ! 'jclo ', 'jclono2_a ', & - ! 'jclono2_b ', 'jcof2 ', & - ! 'jcofcl ', 'jh2402 ', & - ! 'jhbr ', 'jhcfc141b ', & - ! 'jhcfc142b ', 'jhcfc22 ', & - ! 'jhcl ', 'jhf ', & - ! 'jhobr ', 'jhocl ', & - ! 'joclo ', 'jsf6 ', & - ! 'jh2so4 ', 'jocs ', & - ! 'jso ', 'jso2 ', & - ! 'jso3 ', 'jsoa1_a1 ', & - ! 'jsoa1_a2 ', 'jsoa2_a1 ', & - ! 'jsoa2_a2 ', 'jsoa3_a1 ', & - ! 'jsoa3_a2 ', 'jsoa4_a1 ', & - ! 'jsoa4_a2 ', 'jsoa5_a1 ', & - ! 'jsoa5_a2 ', 'O1D_H2 ', & - ! 'O1D_H2O ', 'O1D_N2 ', & - ! 'O1D_O2ab ', 'O1D_O3 ', & - ! 'O_O3 ', 'usr_O_O ', & - ! 'usr_O_O2 ', 'H2_O ', & - ! 'H2O2_O ', 'H_HO2 ', & - ! 'H_HO2a ', 'H_HO2b ', & - ! 'H_O2 ', 'HO2_O ', & - ! 'HO2_O3 ', 'H_O3 ', & - ! 'OH_H2 ', 'OH_H2O2 ', & - ! 'OH_HO2 ', 'OH_O ', & - ! 'OH_O3 ', 'OH_OH ', & - ! 'OH_OH_M ', 'usr_HO2_HO2 ', & - ! 'HO2NO2_OH ', 'N_NO ', & - ! 'N_NO2a ', 'N_NO2b ', & - ! 'N_NO2c ', 'N_O2 ', & - ! 'NO2_O ', 'NO2_O3 ', & - ! 'NO2_O_M ', 'NO3_HO2 ', & - ! 'NO3_NO ', 'NO3_O ', & - ! 'NO3_OH ', 'N_OH ', & - ! 'NO_HO2 ', 'NO_O3 ', & - ! 'NO_O_M ', 'O1D_N2Oa ', & - ! 'O1D_N2Ob ', 'tag_NO2_HO2 ', & - ! 'tag_NO2_NO3 ', 'tag_NO2_OH ', & - ! 'usr_HNO3_OH ', 'usr_HO2NO2_M ', & - ! 'usr_N2O5_M ', 'CL_CH2O ', & - ! 'CL_CH4 ', 'CL_H2 ', & - ! 'CL_H2O2 ', 'CL_HO2a ', & - ! 'CL_HO2b ', 'CL_O3 ', & - ! 'CLO_CH3O2 ', 'CLO_CLOa ', & - ! 'CLO_CLOb ', 'CLO_CLOc ', & - ! 'CLO_HO2 ', 'CLO_NO ', & - ! 'CLONO2_CL ', 'CLO_NO2_M ', & - ! 'CLONO2_O ', 'CLONO2_OH ', & - ! 'CLO_O ', 'CLO_OHa ', & - ! 'CLO_OHb ', 'HCL_O ', & - ! 'HCL_OH ', 'HOCL_CL ', & - ! 'HOCL_O ', 'HOCL_OH ', & - ! 'O1D_CCL4 ', 'O1D_CF2CLBR ' /) - ! rxt_tag_lst( 201: 400) = (/ 'O1D_CFC11 ', 'O1D_CFC113 ', & - ! 'O1D_CFC114 ', 'O1D_CFC115 ', & - ! 'O1D_CFC12 ', 'O1D_HCLa ', & - ! 'O1D_HCLb ', 'tag_CLO_CLO_M ', & - ! 'usr_CL2O2_M ', 'BR_CH2O ', & - ! 'BR_HO2 ', 'BR_O3 ', & - ! 'BRO_BRO ', 'BRO_CLOa ', & - ! 'BRO_CLOb ', 'BRO_CLOc ', & - ! 'BRO_HO2 ', 'BRO_NO ', & - ! 'BRO_NO2_M ', 'BRONO2_O ', & - ! 'BRO_O ', 'BRO_OH ', & - ! 'HBR_O ', 'HBR_OH ', & - ! 'HOBR_O ', 'O1D_CF3BR ', & - ! 'O1D_CHBR3 ', 'O1D_H2402 ', & - ! 'O1D_HBRa ', 'O1D_HBRb ', & - ! 'F_CH4 ', 'F_H2 ', & - ! 'F_H2O ', 'F_HNO3 ', & - ! 'O1D_COF2 ', 'O1D_COFCL ', & - ! 'CH2BR2_CL ', 'CH2BR2_OH ', & - ! 'CH3BR_CL ', 'CH3BR_OH ', & - ! 'CH3CCL3_OH ', 'CH3CL_CL ', & - ! 'CH3CL_OH ', 'CHBR3_CL ', & - ! 'CHBR3_OH ', 'HCFC141B_OH ', & - ! 'HCFC142B_OH ', 'HCFC22_OH ', & - ! 'O1D_CH2BR2 ', 'O1D_CH3BR ', & - ! 'O1D_HCFC141B ', 'O1D_HCFC142B ', & - ! 'O1D_HCFC22 ', 'CH2O_HO2 ', & - ! 'CH2O_NO3 ', 'CH2O_O ', & - ! 'CH2O_OH ', 'CH3O2_CH3O2a ', & - ! 'CH3O2_CH3O2b ', 'CH3O2_HO2 ', & - ! 'CH3O2_NO ', 'CH3OH_OH ', & - ! 'CH3OOH_OH ', 'CH4_OH ', & - ! 'CO_OH_M ', 'HCN_OH ', & - ! 'HCOOH_OH ', 'HOCH2OO_HO2 ', & - ! 'HOCH2OO_M ', 'HOCH2OO_NO ', & - ! 'O1D_CH4a ', 'O1D_CH4b ', & - ! 'O1D_CH4c ', 'O1D_HCN ', & - ! 'usr_CO_OH_b ', 'C2H2_CL_M ', & - ! 'C2H2_OH_M ', 'C2H4_CL_M ', & - ! 'C2H4_O3 ', 'C2H5O2_C2H5O2 ', & - ! 'C2H5O2_CH3O2 ', 'C2H5O2_HO2 ', & - ! 'C2H5O2_NO ', 'C2H5OH_OH ', & - ! 'C2H5OOH_OH ', 'C2H6_CL ', & - ! 'C2H6_OH ', 'CH3CHO_NO3 ', & - ! 'CH3CHO_OH ', 'CH3CN_OH ', & - ! 'CH3CO3_CH3CO3 ', 'CH3CO3_CH3O2 ', & - ! 'CH3CO3_HO2 ', 'CH3CO3_NO ', & - ! 'CH3COOH_OH ', 'CH3COOOH_OH ', & - ! 'EO2_HO2 ', 'EO2_NO ', & - ! 'EO_M ', 'EO_O2 ', & - ! 'GLYALD_OH ', 'GLYOXAL_OH ', & - ! 'PAN_OH ', 'tag_C2H4_OH ', & - ! 'tag_CH3CO3_NO2 ', 'usr_PAN_M ', & - ! 'C3H6_NO3 ', 'C3H6_O3 ', & - ! 'C3H7O2_CH3O2 ', 'C3H7O2_HO2 ', & - ! 'C3H7O2_NO ', 'C3H7OOH_OH ', & - ! 'C3H8_OH ', 'CH3COCHO_NO3 ', & - ! 'CH3COCHO_OH ', 'HYAC_OH ', & - ! 'NOA_OH ', 'PO2_HO2 ', & - ! 'PO2_NO ', 'POOH_OH ', & - ! 'RO2_CH3O2 ', 'RO2_HO2 ', & - ! 'RO2_NO ', 'ROOH_OH ', & - ! 'tag_C3H6_OH ', 'usr_CH3COCH3_OH ', & - ! 'BIGENE_NO3 ', 'BIGENE_OH ', & - ! 'ENEO2_NO ', 'ENEO2_NOb ', & - ! 'HONITR_OH ', 'MACRO2_CH3CO3 ', & - ! 'MACRO2_CH3O2 ', 'MACRO2_HO2 ', & - ! 'MACRO2_NO3 ', 'MACRO2_NOa ', & - ! 'MACRO2_NOb ', 'MACR_O3 ', & - ! 'MACR_OH ', 'MACROOH_OH ', & - ! 'MCO3_CH3CO3 ', 'MCO3_CH3O2 ', & - ! 'MCO3_HO2 ', 'MCO3_MCO3 ', & - ! 'MCO3_NO ', 'MCO3_NO3 ', & - ! 'MEKO2_HO2 ', 'MEKO2_NO ', & - ! 'MEK_OH ', 'MEKOOH_OH ', & - ! 'MPAN_OH_M ', 'MVK_O3 ', & - ! 'MVK_OH ', 'usr_MCO3_NO2 ', & - ! 'usr_MPAN_M ', 'ALKNIT_OH ', & - ! 'ALKO2_HO2 ', 'ALKO2_NO ', & - ! 'ALKO2_NOb ', 'ALKOOH_OH ', & - ! 'BIGALK_OH ', 'HPALD_OH ', & - ! 'HYDRALD_OH ', 'IEPOX_OH ', & - ! 'ISOPAO2_CH3CO3 ', 'ISOPAO2_CH3O2 ', & - ! 'ISOPAO2_HO2 ', 'ISOPAO2_NO ', & - ! 'ISOPAO2_NO3 ', 'ISOPBO2_CH3CO3 ', & - ! 'ISOPBO2_CH3O2 ', 'ISOPBO2_HO2 ', & - ! 'ISOPBO2_M ', 'ISOPBO2_NO ', & - ! 'ISOPBO2_NO3 ', 'ISOPNITA_OH ', & - ! 'ISOPNITB_OH ', 'ISOP_NO3 ', & - ! 'ISOPNO3_CH3CO3 ', 'ISOPNO3_CH3O2 ', & - ! 'ISOPNO3_HO2 ', 'ISOPNO3_NO ', & - ! 'ISOPNO3_NO3 ', 'ISOPNOOH_OH ', & - ! 'ISOP_O3 ', 'ISOP_OH ', & - ! 'ISOPOOH_OH ', 'NC4CH2OH_OH ', & - ! 'NC4CHO_OH ', 'XO2_CH3CO3 ', & - ! 'XO2_CH3O2 ', 'XO2_HO2 ', & - ! 'XO2_NO ', 'XO2_NO3 ', & - ! 'XOOH_OH ', 'ACBZO2_HO2 ', & - ! 'ACBZO2_NO ', 'BENZENE_OH ', & - ! 'BENZO2_HO2 ', 'BENZO2_NO ' /) - ! rxt_tag_lst( 401: 528) = (/ 'BENZOOH_OH ', 'BZALD_OH ', & - ! 'BZOO_HO2 ', 'BZOOH_OH ', & - ! 'BZOO_NO ', 'C6H5O2_HO2 ', & - ! 'C6H5O2_NO ', 'C6H5OOH_OH ', & - ! 'CRESOL_OH ', 'DICARBO2_HO2 ', & - ! 'DICARBO2_NO ', 'DICARBO2_NO2 ', & - ! 'MALO2_HO2 ', 'MALO2_NO ', & - ! 'MALO2_NO2 ', 'MDIALO2_HO2 ', & - ! 'MDIALO2_NO ', 'MDIALO2_NO2 ', & - ! 'PHENO2_HO2 ', 'PHENO2_NO ', & - ! 'PHENOL_OH ', 'PHENO_NO2 ', & - ! 'PHENO_O3 ', 'PHENOOH_OH ', & - ! 'tag_ACBZO2_NO2 ', 'TOLO2_HO2 ', & - ! 'TOLO2_NO ', 'TOLOOH_OH ', & - ! 'TOLUENE_OH ', 'usr_PBZNIT_M ', & - ! 'XYLENES_OH ', 'XYLENO2_HO2 ', & - ! 'XYLENO2_NO ', 'XYLENOOH_OH ', & - ! 'XYLOLO2_HO2 ', 'XYLOLO2_NO ', & - ! 'XYLOL_OH ', 'XYLOLOOH_OH ', & - ! 'BCARY_NO3 ', 'BCARY_O3 ', & - ! 'BCARY_OH ', 'MTERP_NO3 ', & - ! 'MTERP_O3 ', 'MTERP_OH ', & - ! 'NTERPO2_CH3O2 ', 'NTERPO2_HO2 ', & - ! 'NTERPO2_NO ', 'NTERPO2_NO3 ', & - ! 'NTERPOOH_OH ', 'TERP2O2_CH3O2 ', & - ! 'TERP2O2_HO2 ', 'TERP2O2_NO ', & - ! 'TERP2OOH_OH ', 'TERPNIT_OH ', & - ! 'TERPO2_CH3O2 ', 'TERPO2_HO2 ', & - ! 'TERPO2_NO ', 'TERPOOH_OH ', & - ! 'TERPROD1_NO3 ', 'TERPROD1_OH ', & - ! 'TERPROD2_OH ', 'OCS_O ', & - ! 'OCS_OH ', 'S_O2 ', & - ! 'S_O3 ', 'SO_BRO ', & - ! 'SO_CLO ', 'S_OH ', & - ! 'SO_NO2 ', 'SO_O2 ', & - ! 'SO_O3 ', 'SO_OCLO ', & - ! 'SO_OH ', 'usr_SO2_OH ', & - ! 'usr_SO3_H2O ', 'DMS_NO3 ', & - ! 'DMS_OHa ', 'NH3_OH ', & - ! 'usr_DMS_OH ', 'usr_GLYOXAL_aer ', & - ! 'usr_HO2_aer ', 'usr_HONITR_aer ', & - ! 'usr_ISOPNITA_aer ', 'usr_ISOPNITB_aer ', & - ! 'usr_N2O5_aer ', 'usr_NC4CH2OH_aer ', & - ! 'usr_NC4CHO_aer ', 'usr_NH4_strat_tau ', & - ! 'usr_NO2_aer ', 'usr_NO3_aer ', & - ! 'usr_NTERPOOH_aer ', 'usr_ONITR_aer ', & - ! 'usr_TERPNIT_aer ', 'BCARY_NO3_vbs ', & - ! 'BCARY_O3_vbs ', 'BCARY_OH_vbs ', & - ! 'BENZENE_OH_vbs ', 'ISOP_NO3_vbs ', & - ! 'ISOP_O3_vbs ', 'ISOP_OH_vbs ', & - ! 'IVOC_OH ', 'MTERP_NO3_vbs ', & - ! 'MTERP_O3_vbs ', 'MTERP_OH_vbs ', & - ! 'SVOC_OH ', 'TOLUENE_OH_vbs ', & - ! 'XYLENES_OH_vbs ', 'het1 ', & - ! 'het10 ', 'het11 ', & - ! 'het12 ', 'het13 ', & - ! 'het14 ', 'het15 ', & - ! 'het16 ', 'het17 ', & - ! 'het2 ', 'het3 ', & - ! 'het4 ', 'het5 ', & - ! 'het6 ', 'het7 ', & - ! 'het8 ', 'het9 ', & - ! 'E90_tau ', 'NH_50_tau ', & - ! 'NH_5_tau ', 'ST80_25_tau ' /) - ! rxt_tag_map(:rxt_tag_cnt) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, & - ! 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, & - ! 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, & - ! 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, & - ! 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, & - ! 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, & - ! 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, & - ! 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, & - ! 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, & - ! 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, & - ! 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, & - ! 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, & - ! 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, & - ! 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, & - ! 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, & - ! 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, & - ! 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, & - ! 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, & - ! 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, & - ! 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, & - ! 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, & - ! 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, & - ! 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, & - ! 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, & - ! 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, & - ! 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, & - ! 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, & - ! 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, & - ! 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, & - ! 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, & - ! 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, & - ! 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, & - ! 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, & - ! 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, & - ! 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, & - ! 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, & - ! 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, & - ! 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, & - ! 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, & - ! 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, & - ! 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, & - ! 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, & - ! 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, & - ! 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, & - ! 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, & - ! 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, & - ! 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, & - ! 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, & - ! 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, & - ! 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, & - ! 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, & - ! 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, & - ! 521, 522, 523, 524, 525, 526, 527, 528 /) - ! if( allocated( pht_alias_lst ) ) then - ! deallocate( pht_alias_lst ) - ! end if - ! allocate( pht_alias_lst(phtcnt,2),stat=ios ) - ! if( ios /= 0 ) then - ! write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_lst; error = ',ios - ! call endrun - ! end if - ! if( allocated( pht_alias_mult ) ) then - ! deallocate( pht_alias_mult ) - ! end if - ! allocate( pht_alias_mult(phtcnt,2),stat=ios ) - ! if( ios /= 0 ) then - ! write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_mult; error = ',ios - ! call endrun - ! end if - ! pht_alias_lst(:,1) = (/ ' ', ' ', ' ', ' ', & - ! 'userdefined ', 'userdefined ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', 'userdefined ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ' /) - ! pht_alias_lst(:,2) = (/ ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', 'jch3ooh ', 'jch3ooh ', & - ! 'jch3ooh ', 'jno2 ', 'jno2 ', 'jno2 ', & - ! 'jno2 ', 'jno2 ', 'jno2 ', 'jch3ooh ', & - ! 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! 'jh2o2 ', ' ', ' ', ' ', & - ! ' ', 'jch3ooh ', ' ', 'jmgly ', & - ! 'jch2o_a ', 'jno2 ', ' ', 'jch3ooh ', & - ! 'jch3ooh ', ' ', ' ', 'jacet ', & - ! 'jch3ooh ', 'jpan ', ' ', 'jch2o_a ', & - ! 'jch2o_a ', 'jch3ooh ', 'jch3cho ', ' ', & - ! 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', 'jno2 ', & - ! 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', 'jch3cho ', & - ! 'jch3cho ', 'jch3ooh ', 'jch3ooh ', 'jch3ooh ', & - ! 'jch3ooh ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', ' ', ' ', ' ', & - ! ' ', 'jno2 ', 'jno2 ', 'jno2 ', & - ! 'jno2 ', 'jno2 ', 'jno2 ', 'jno2 ', & - ! 'jno2 ', 'jno2 ', 'jno2 ' /) - ! pht_alias_mult(:,1) = (/ 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8 /) - ! pht_alias_mult(:,2) = (/ 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, .10_r8, 0.2_r8, .14_r8, .20_r8, & - ! .20_r8, .006_r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 0.28_r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! .006_r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, .10_r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, 1._r8, 1._r8, & - ! 1._r8, 1._r8, 1._r8, .0004_r8, .0004_r8, & - ! .0004_r8, .0004_r8, .0004_r8, .0004_r8, .0004_r8, & - ! .0004_r8, .0004_r8, .0004_r8 /) - ! allocate( cph_enthalpy(enthalpy_cnt),stat=ios ) - ! if( ios /= 0 ) then - ! write(iulog,*) 'set_sim_dat: failed to allocate cph_enthalpy; error = ',ios - ! call endrun - ! end if - ! allocate( cph_rid(enthalpy_cnt),stat=ios ) - ! if( ios /= 0 ) then - ! write(iulog,*) 'set_sim_dat: failed to allocate cph_rid; error = ',ios - ! call endrun - ! end if - ! cph_rid(:) = (/ 126, 129, 130, 131, 134, & - ! 137, 138, 139, 140, 143, & - ! 144, 145, 148, 150, 154, & - ! 155, 163, 164 /) - ! cph_enthalpy(:) = (/ 189.810000_r8, 392.190000_r8, 493.580000_r8, 101.390000_r8, 232.590000_r8, & - ! 203.400000_r8, 226.580000_r8, 120.100000_r8, 194.710000_r8, 293.620000_r8, & - ! 67.670000_r8, 165.300000_r8, 165.510000_r8, 313.750000_r8, 133.750000_r8, & - ! 193.020000_r8, 34.470000_r8, 199.170000_r8 /) - ! allocate( num_rnts(rxntot-phtcnt),stat=ios ) - ! if( ios /= 0 ) then - ! write(iulog,*) 'set_sim_dat: failed to allocate num_rnts; error = ',ios - ! call endrun - ! end if - ! num_rnts(:) = (/ 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, & - ! 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, & - ! 2, 3, 2, 2, 3, 3, 3, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 3, 3, 2, 2, 1, 2, 2, 2, 2, & - ! 2, 2, 3, 3, 3, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, & - ! 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, & - ! 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, & - ! 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, & - ! 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, & - ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, & - ! 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, & - ! 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, & - ! 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, & - ! 2, 1, 1, 1, 1 /) - end subroutine set_sim_dat end module mo_sim_dat From b5730ff531e0a8e3b334dff16c69a9f01fecab70 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 17 May 2021 22:54:17 -0400 Subject: [PATCH 233/239] Feat: Add AEIC organic species to external forcings list Signed-off-by: Thibaud Fritz --- src/chemistry/pp_trop_strat_mam4_vbs/chem_mods.F90 | 2 +- .../pp_trop_strat_mam4_vbs/mo_sim_dat.F90 | 14 ++++++++------ .../pp_trop_strat_mam4_vbsext/chem_mods.F90 | 2 +- .../pp_trop_strat_mam4_vbsext/mo_sim_dat.F90 | 10 ++++++---- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/chemistry/pp_trop_strat_mam4_vbs/chem_mods.F90 b/src/chemistry/pp_trop_strat_mam4_vbs/chem_mods.F90 index 8050030043..b6cbc77dcc 100644 --- a/src/chemistry/pp_trop_strat_mam4_vbs/chem_mods.F90 +++ b/src/chemistry/pp_trop_strat_mam4_vbs/chem_mods.F90 @@ -14,7 +14,7 @@ module chem_mods relcnt = 0, & ! number of relationship species grpcnt = 0, & ! number of group members nzcnt = 2022, & ! number of non-zero matrix entries - extcnt = 17, & ! number of species with external forcing + extcnt = 25, & ! number of species with external forcing clscnt1 = 30, & ! number of species in explicit class clscnt2 = 0, & ! number of species in hov class clscnt3 = 0, & ! number of species in ebi class diff --git a/src/chemistry/pp_trop_strat_mam4_vbs/mo_sim_dat.F90 b/src/chemistry/pp_trop_strat_mam4_vbs/mo_sim_dat.F90 index b4acb1295a..5eec3adef2 100644 --- a/src/chemistry/pp_trop_strat_mam4_vbs/mo_sim_dat.F90 +++ b/src/chemistry/pp_trop_strat_mam4_vbs/mo_sim_dat.F90 @@ -242,15 +242,17 @@ subroutine set_sim_dat 1621,1672,1699,1734,1776,1837,1862,1893,1917,1996, & 2022 /) - extfrc_lst(: 17) = (/ 'so4_a2 ','NO ','NO2 ','SO2 ','SVOC ', & + extfrc_lst(: 25) = (/ 'so4_a2 ','NO ','NO2 ','SO2 ','SVOC ', & 'pom_a1 ','pom_a4 ','so4_a1 ','CO ','bc_a1 ', & - 'bc_a4 ','num_a1 ','num_a2 ','num_a4 ','OH ', & - 'N ','AOA_NH ' /) + 'bc_a4 ','num_a1 ','num_a2 ','num_a4 ','CH3COCH3 ', & + 'CH3CHO ','BIGALK ','C2H6 ','C3H8 ','CH2O ', & + 'C3H6 ','MACR ','OH ','N ','AOA_NH ' /) - frc_from_dataset(: 17) = (/ .true., .true., .true., .true., .true., & + frc_from_dataset(: 25) = (/ .true., .true., .true., .true., .true., & .true., .true., .true., .true., .true., & - .true., .true., .true., .true., .false., & - .false., .false. /) + .true., .true., .true., .true., .true., & + .true., .true., .true., .true., .true., & + .true., .true., .false., .false., .false. /) inv_lst(: 3) = (/ 'M ', 'N2 ', 'O2 ' /) diff --git a/src/chemistry/pp_trop_strat_mam4_vbsext/chem_mods.F90 b/src/chemistry/pp_trop_strat_mam4_vbsext/chem_mods.F90 index 9665256a26..02c648cbcb 100644 --- a/src/chemistry/pp_trop_strat_mam4_vbsext/chem_mods.F90 +++ b/src/chemistry/pp_trop_strat_mam4_vbsext/chem_mods.F90 @@ -14,7 +14,7 @@ module chem_mods relcnt = 0, & ! number of relationship species grpcnt = 0, & ! number of group members nzcnt = 2078, & ! number of non-zero matrix entries - extcnt = 17, & ! number of species with external forcing + extcnt = 25, & ! number of species with external forcing clscnt1 = 26, & ! number of species in explicit class clscnt2 = 0, & ! number of species in hov class clscnt3 = 0, & ! number of species in ebi class diff --git a/src/chemistry/pp_trop_strat_mam4_vbsext/mo_sim_dat.F90 b/src/chemistry/pp_trop_strat_mam4_vbsext/mo_sim_dat.F90 index ec5d8e28ed..6559e5596d 100644 --- a/src/chemistry/pp_trop_strat_mam4_vbsext/mo_sim_dat.F90 +++ b/src/chemistry/pp_trop_strat_mam4_vbsext/mo_sim_dat.F90 @@ -269,15 +269,17 @@ subroutine set_sim_dat 1395,1418,1513,1538,1698,1722,1764,1822,1873,1934, & 1959,1986,2017,2052,2078 /) - extfrc_lst(: 17) = (/ 'pombb1_a4 ','bc_a4 ','CO ','NO ','NO2 ', & + extfrc_lst(: 25) = (/ 'pombb1_a4 ','bc_a4 ','CO ','NO ','NO2 ', & 'num_a1 ','num_a2 ','num_a4 ','SO2 ','so4_a1 ', & 'so4_a2 ','SVOCbb ','SVOCff ','pomff1_a4 ','bc_a1 ', & - 'N ','OH ' /) + 'CH3COCH3 ','CH3CHO ','BIGALK ','C2H6 ','C3H8 ', & + 'CH2O ','C3H6 ','MACR ','N ','OH ' /) - frc_from_dataset(: 17) = (/ .true., .true., .true., .true., .true., & + frc_from_dataset(: 25) = (/ .true., .true., .true., .true., .true., & .true., .true., .true., .true., .true., & .true., .true., .true., .true., .true., & - .false., .false. /) + .true., .true., .true., .true., .true., & + .true., .true., .true., .false., .false. /) inv_lst(: 3) = (/ 'M ', 'O2 ', 'N2 ' /) From 48324be29962efa0d3ce146265356b86bcbdff06 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Mon, 17 May 2021 22:59:00 -0400 Subject: [PATCH 234/239] Feat: Add GEOS-Chem surface boundary conditions Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 109 +++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 7 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 82aa85e509..c3213fc00b 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -110,6 +110,20 @@ module chemistry type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! Pointer to 2D pbuf + ! Mimic code in sfcvmr_mod.F90 + TYPE :: SfcMrObj + CHARACTER(LEN=63) :: FldName ! Field name + INTEGER :: SpcID ! ID in species database + TYPE(SfcMrObj), POINTER :: Next ! Next element in list + END TYPE SfcMrObj + + ! Heat of linked list with SfcMrObj objects + TYPE(SfcMrObj), POINTER :: SfcMrHead => NULL() + + ! Field prefix + CHARACTER(LEN=63), PARAMETER :: Prefix_SfcVMR = 'VMR_' + + ! Indices of critical species in GEOS-Chem INTEGER :: iH2O, iO3, iCO2, iSO4 INTEGER :: iO, iH, iO2 @@ -1686,8 +1700,6 @@ subroutine chem_init(phys_state, pbuf2d) hco_pbuf2d => pbuf2d - If ( MasterProc ) Write(iulog,*) "hco_pbuf2d now points to pbuf2d" - ! Cleanup Call Cleanup_State_Grid( maxGrid, RC ) @@ -2022,11 +2034,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Calculating SZA REAL(r8) :: Calday - CHARACTER(LEN=255) :: SpcName - CHARACTER(LEN=255) :: Prefix, FieldName - LOGICAL :: FND - INTEGER :: SpcId - TYPE(Species), POINTER :: SpcInfo + CHARACTER(LEN=255) :: SpcName + CHARACTER(LEN=255) :: Prefix, FieldName + LOGICAL :: FND + INTEGER :: SpcId + TYPE(Species), POINTER :: SpcInfo + TYPE(SfcMrObj), POINTER :: iSfcMrObj CHARACTER(LEN=63) :: OrigUnit @@ -2063,6 +2076,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) cmfdqr => NULL() pbuf_chnk=> NULL() pbuf_ik => NULL() + pbuf_i => NULL() ! LCHNK: which chunk we have on this process LCHNK = state%LCHNK @@ -2159,6 +2173,54 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) SlsData(:,:,:) = 0.0e+0_r8 CALL get_short_lived_species( SlsData, LCHNK, nY, pbuf ) + IF ( iStep == 1 ) THEN + ! Retrieve list of species with surface boundary conditions (copied from + ! sfcvmr_mod.F90) + + ! Head of linked list + SfcMrHead => NULL() + iSfcMrObj => NULL() + SpcInfo => NULL() + + ! Loop over all species + DO N = 1, State_Chm(BEGCHUNK)%nSpecies + ! Species information + SpcInfo => State_Chm(BEGCHUNK)%SpcData(N)%Info + + ! Check if field exists (note: this needs to be less than 16 + ! characters long) + FieldName = 'HCO_'//TRIM(Prefix_SfcVMR)//TRIM(to_upper(SpcInfo%Name)) + M = pbuf_get_index(FieldName, RC) + IF ( M > 0 ) THEN + + ! Must have positive, non-zero MW + IF ( SpcInfo%MW_g <= 0.0_fp ) THEN + ErrMsg = 'Cannot use surface boundary condition for species ' & + // TRIM(SpcInfo%Name) // ' due to invalid MW!' + CALL ENDRUN(TRIM(ErrMsg)) + ENDIF + + ! Create new object, add to list + ALLOCATE( iSfcMrObj, STAT=RC ) + CALL GC_CheckVar( 'sfcvmr_mod.F90:iSfcMrObj', 0, RC ) + IF ( RC /= GC_SUCCESS ) CALL ENDRUN('Failure while allocating iSfcMrObj') + + iSfcMrObj%SpcID = N + iSfcMrObj%FldName = FieldName + iSfcMrObj%Next => SfcMrHead + SfcMrHead => iSfcMrObj + IF ( rootChunk ) THEN + WRITE( 6, 110 ) TRIM( SpcInfo%Name ), TRIM( iSfcMrObj%FldName ) + 110 FORMAT( '--> ', a, ' will use prescribed surface boundary ', & + 'conditions from field ', a ) + ENDIF + + ! Free the pointer + iSfcMrObj => NULL() + ENDIF + ENDDO + ENDIF + !----------------------------------------------------------------------- ! ... Set atmosphere mean mass !----------------------------------------------------------------------- @@ -3714,6 +3776,39 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDIF ENDIF + ! Here, we apply surface mixing ratios for long-lived species + ! (copied from sfcvmr_mod.F90) + ! Loop over all objects + iSfcMrObj => SfcMrHead + DO WHILE( ASSOCIATED( iSfcMrObj ) ) + + ! Get concentration for this species + tmpIdx = pbuf_get_index(TRIM(iSfcMrObj%FldName), RC) + IF ( tmpIdx < 0 .OR. (iStep == 1) ) THEN + IF ( rootChunk ) Write(iulog,*) "chem_timestep_tend: Field not found ", TRIM(iSfcMrObj%FldName) + ELSE + CALL pbuf_get_field(pbuf, tmpIdx, pbuf_i) + + ! Set mixing ratio in PBL + SpcInfo => State_Chm(LCHNK)%SpcData(iSfcMrObj%SpcID)%Info + N = SpcInfo%ModelID + IF ( N > 0 ) THEN + DO L = 1, nZ + DO J = 1, nY + IF ( State_Met(LCHNK)%F_UNDER_PBLTOP(1,J,L) > 0.0_fp ) THEN + State_Chm(LCHNK)%Species(1,J,L,N) = & + ( pbuf_i(J) * 1.0e-9_fp ) & + / ( MWDry / SpcInfo%MW_g ) + ENDIF ! end selection of PBL boxes + ENDDO + ENDDO + ENDIF + ENDIF + + ! Point to next element in list + iSfcMrObj => iSfcMrObj%Next + ENDDO + ! Reset photolysis rates ZPJ = 0.0e+0_r8 From 719010caaa562b46154d8539f0dea7f1ee73c947 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 18 May 2021 19:45:20 -0400 Subject: [PATCH 235/239] Feat: Update .gitignore to exclude GEOS-Chem source code Signed-off-by: Thibaud Fritz --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fcb95837b8..2ff73275bf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ src/physics/carma/base src/physics/clubb src/physics/cosp2/src src/physics/silhs -src/chemistry/pp_geoschem/geoschem_src +src/chemistry/geoschem/geoschem_src src/hemco # Ignore compiled python From 93844ef86597dc689f680f0825188b44bf0dd5c0 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Wed, 26 May 2021 22:31:55 -0400 Subject: [PATCH 236/239] Fix: Fix for sulfur mapping between CESM2 and GEOS-Chem (1) SO4_gasRatio and binRatio are in mol/mol, not kg/kg Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/chemistry.F90 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index c3213fc00b..e3409ed0db 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -2431,6 +2431,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) State_Chm(LCHNK)%Species(1,:nY,:nZ,K) = State_Chm(LCHNK)%Species(1,:nY,:nZ,K) & + REAL(state%q(:nY,nZ:1:-1,N),fp) * & adv_mass(l_SO4) / adv_mass(mapCnst(N)) + ! SO4_gasRatio is in mol/mol SO4_gasRatio(:nY,:nZ) = state%q(:nY,:nZ,N) & * adv_mass(l_SO4) / adv_mass(mapCnst(N)) & / State_Chm(LCHNK)%Species(1,:nY,nZ:1:-1,K) @@ -3897,16 +3898,14 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Repartition SO4 into H2SO4 and so4_a* IF ( l_H2SO4 > 0 .AND. l_SO4 > 0 ) THEN P = l_H2SO4 - ! SO4_gasRatio is kg(SO4) (gaseous) / kg(SO4) (gaseous+aerosol) - vmr1(:nY,:nZ,P) = SO4_gasRatio(:nY,:nZ) * vmr1(:nY,:nZ,l_SO4) & - * adv_mass(l_SO4) / adv_mass(P) - ! binRatio is kg(SO4) (current bin) / kg(SO4) (all bins) + ! SO4_gasRatio is mol(SO4) (gaseous) / mol(SO4) (gaseous+aerosol) + vmr1(:nY,:nZ,P) = SO4_gasRatio(:nY,:nZ) * vmr1(:nY,:nZ,l_SO4) + ! binRatio is mol(SO4) (current bin) / mol(SO4) (all bins) DO M = 1, ntot_amode N = lptr_so4_a_amode(M) IF ( N <= 0 ) CYCLE P = mapCnst(N) vmr1(:nY,:nZ,P) = vmr1(:nY,:nZ,l_SO4) & - * adv_mass(l_SO4) / adv_mass(P) & * ( 1.0_r8 - SO4_gasRatio(:nY,:nZ) ) & * binRatio(iSulf(M),M,:nY,:nZ) ENDDO From cede07813f862a96871321e356a66563dbae5464 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 17 Aug 2021 09:21:32 +0200 Subject: [PATCH 237/239] Feat: Update .exclude for GEOS-Chem 13.1 Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/.exclude | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/chemistry/geoschem/.exclude b/src/chemistry/geoschem/.exclude index b0c26be3ef..b8418763c5 100644 --- a/src/chemistry/geoschem/.exclude +++ b/src/chemistry/geoschem/.exclude @@ -18,6 +18,3 @@ tccon_ch4_mod.F90 initialize.F90 cleanup.F90 main.F90 -hcoi_gc_diagn_include.H -hcoi_gc_diagn_mod.F90 -hco_interface_gc_mod.F90 From 315f29400edf33a68f4474e5a7da167825560a21 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Tue, 17 Aug 2021 09:22:01 +0200 Subject: [PATCH 238/239] Fix: Update in-cloud opticaldepth with cloud fractions Signed-off-by: Thibaud Fritz --- src/chemistry/geoschem/cesmgc_diag_mod.F90 | 16 ++-- src/chemistry/geoschem/chemistry.F90 | 88 +++++++++------------- 2 files changed, 46 insertions(+), 58 deletions(-) diff --git a/src/chemistry/geoschem/cesmgc_diag_mod.F90 b/src/chemistry/geoschem/cesmgc_diag_mod.F90 index 80872b4583..584ab12a07 100644 --- a/src/chemistry/geoschem/cesmgc_diag_mod.F90 +++ b/src/chemistry/geoschem/cesmgc_diag_mod.F90 @@ -471,13 +471,14 @@ SUBROUTINE CESMGC_Diag_Init( Input_Opt, State_Chm, State_Met ) CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & TRIM(tagName) // ' photolysis rate' ) ENDDO - ! Add Jval_O3O1D and Jval_O3O3P - SpcName = 'Jval_O3O1D' + ! Add JvalO3O1D and JvalO3O3P + SpcName = 'JvalO3O1D' CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & - TRIM(tagName) // ' photolysis rate' ) - SpcName = 'Jval_O3O3P' + 'O3 -> O1D photolysis rate' ) + + SpcName = 'JvalO3O3P' CALL Addfld( TRIM(SpcName), (/ 'lev' /), 'A', '1/s', & - TRIM(tagName) // ' photolysis rate' ) + 'O3 -> O3P photolysis rate' ) ! ========================================== ! Now add fields corresponding to State_Met @@ -960,6 +961,7 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & USE PHYSCONST, ONLY : MWDry USE UCX_MOD, ONLY : GET_STRAT_OPT!, AERFRAC USE CMN_SIZE_MOD, ONLY : NDUST + USE CMN_FJX_MOD ! ! !INPUT PARAMETERS: ! @@ -1503,14 +1505,14 @@ SUBROUTINE CESMGC_Diag_Calc( Input_Opt, State_Chm, State_Diag, & ENDDO ENDIF IF ( ASSOCIATED(State_Diag%JvalO3O1D) ) THEN - SpcName = 'Jval_O3O1D' + SpcName = 'JvalO3O1D' IF ( hist_fld_active(TRIM(SpcName)) ) THEN outTmp(:nY,:nZ) = REAL(State_Diag%JvalO3O1D(1,:nY,nZ:1:-1),r8) CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) ENDIF ENDIF IF ( ASSOCIATED(State_Diag%JvalO3O3P) ) THEN - SpcName = 'Jval_O3O3P' + SpcName = 'JvalO3O3P' IF ( hist_fld_active(TRIM(SpcName)) ) THEN outTmp(:nY,:nZ) = REAL(State_Diag%JvalO3O3P(1,:nY,nZ:1:-1),r8) CALL OutFld( TRIM(SpcName), outTmp(:nY,:), nY, LCHNK ) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index e3409ed0db..eda8b869a0 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -1168,7 +1168,7 @@ subroutine chem_init(phys_state, pbuf2d) ! onlineAlbedo -> True (use CLM albedo) ! -> False (read monthly-mean albedo from HEMCO) - Input_Opt%onlineAlbedo = .True. + Input_Opt%onlineAlbedo = .False. ! onlineLandTypes -> True (use CLM landtypes) ! -> False (read landtypes from HEMCO) @@ -1890,7 +1890,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use CESMGC_Diag_Mod, only : wetdep_name, wtrate_name use Tropopause, only : Tropopause_findChemTrop, Tropopause_Find - use HCO_Utilities_GC_Mod ! Utility routines for GC-HEMCO interface + use HCO_Interface_GC_Mod ! Utility routines for GC-HEMCO interface ! For calculating SZA use Orbit, only : zenith @@ -2024,7 +2024,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: Sd_Ice, Sd_Lnd, Sd_Avg, Frc_Ice ! Estimating cloud optical depth - REAL(r8) :: cld(PCOLS,PVER) REAL(r8) :: TauCli(PCOLS,PVER) REAL(r8) :: TauClw(PCOLS,PVER) REAL(r8), PARAMETER :: re_m = 1.0e-05_r8 ! Cloud drop radius in m @@ -2553,60 +2552,47 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) TauCli = 0.0e+0_r8 TauClw = 0.0e+0_r8 - ! Note: all using CAM vertical convention (1 = TOA) - ! Calculation is based on that done for MOZART + cldW(:nY,:nZ) = state%q(:nY,:nZ,ixCldLiq) + state%q(:nY,:nZ,ixCldIce) + IF ( ixNDrop > 0 ) nCldWtr(:nY,:nZ) = state%q(:nY,:nZ,ixNDrop) + DO J = 1, nY DO L = nZ, 1, -1 - cldW(J,L) = state%q(J,L,ixCldLiq) + state%q(J,L,ixCldIce) - ! Convert water mixing ratio [kg/kg] to water content [g/m^3] - IF ( cldW(J,L) * state%pmid(J,L) / & - (state%T(J,L) * 287.0e+00_r8) * 1.0e+03_r8 <= 0.01_r8 .AND. & - cldFrc(J,L) /= 0.0e+00_r8 ) THEN - cld(J,L) = 0.0e+00_r8 - ELSE - cld(J,L) = cldFrc(J,L) + ! ================================================================= + ! =========== Compute cloud optical depth based on ============ + ! =========== Liao et al. JGR, 104, 23697, 1999 ============ + ! ================================================================= + ! + ! Tau = 3/2 * LWC * dZ / ( \rho_w * r_e ) + ! dZ = - dP / ( \rho_air * g ) + ! since Pint is ascending, we can neglect the minus sign + ! + ! Tau = 3/2 * LWC * dP / ( \rho_air * r_e * \rho_w * g ) + ! LWC / \rho_air = Q + ! + ! Tau = 3/2 * Q * dP / ( r_e * rho_w * g ) + ! Tau(L) = 3/2 * Q(L) * (Pint(L+1) - Pint(L)) / (re * rho_w * g ) + ! Tau(L) = Q(L) * (Pint(L+1) - Pint(L)) * Cnst + ! Then divide by cloud fraction to get the in-cloud optical depth + + ! Unit check: | + ! Q : [kg H2O/kg air] | + ! Pint : [Pa]=[kg air/m/s^2] | + ! re : [m] | = 1.0e-5 + ! rho_w: [kg H2O/m^3] | = 1.0e+3 + ! g : [m/s^2] | = 9.81 + IF ( cldFrc(J,L) > cldMin ) THEN + TauClw(J,L) = state%q(J,L,ixCldLiq) & + * (state%pint(J,L+1)-state%pint(J,L)) & + * cnst / cldFrc(J,L) + TauClw(J,L) = MAX(TauClw(J,L), 0.0e+00_r8) + TauCli(J,L) = state%q(J,L,ixCldIce) & + * (state%pint(J,L+1)-state%pint(J,L)) & + * cnst / cldFrc(J,L) + TauCli(J,L) = MAX(TauCli(J,L), 0.0e+00_r8) ENDIF - IF ( ixNDrop > 0 ) nCldWtr(J,L) = state%q(J,L,ixNDrop) ENDDO ENDDO - DO J = 1, nY - IF ( COUNT( cld(J,:nZ) > cldMin ) > 0 ) THEN - DO L = nZ, 1, -1 - ! ================================================================= - ! =========== Compute cloud optical depth based on ============ - ! =========== Liao et al. JGR, 104, 23697, 1999 ============ - ! ================================================================= - ! - ! Tau = 3/2 * LWC * dZ / ( \rho_w * r_e ) - ! dZ = - dP / ( \rho_air * g ) - ! since Pint is ascending, we can neglect the minus sign - ! - ! Tau = 3/2 * LWC * dP / ( \rho_air * r_e * \rho_w * g ) - ! LWC / \rho_air = Q - ! - ! Tau = 3/2 * Q * dP / ( r_e * rho_w * g ) - ! Tau(L) = 3/2 * Q(L) * (Pint(L+1) - Pint(L)) / (re * rho_w * g ) - ! Tau(L) = Q(L) * (Pint(L+1) - Pint(L)) * Cnst - ! - ! Unit check: | - ! Q : [kg H2O/kg air] | - ! Pint : [Pa]=[kg air/m/s^2] | - ! re : [m] | = 1.0e-5 - ! rho_w: [kg H2O/m^3] | = 1.0e+3 - ! g : [m/s^2] | = 9.81 - TauClw(J,L) = state%q(J,L,ixCldLiq) & - * (state%pint(J,L+1)-state%pint(J,L)) & - * cnst - TauClw(J,L) = MAX(TauClw(J,L), 0.0e+00_r8) - TauCli(J,L) = state%q(J,L,ixCldIce) & - * (state%pint(J,L+1)-state%pint(J,L)) & - * cnst - TauCli(J,L) = MAX(TauCli(J,L), 0.0e+00_r8) - ENDDO - ENDIF - ENDDO - ! Retrieve tropopause level Trop_Lev = 0.0e+0_r8 CALL Tropopause_FindChemTrop(state, Trop_Lev) From 987508df6a9b64c2a9f05d4d47542cc995113a43 Mon Sep 17 00:00:00 2001 From: Thibaud Fritz Date: Thu, 9 Dec 2021 09:50:55 +0100 Subject: [PATCH 239/239] Feat: Return in sox_cldaero_mod if running with GEOS-Chem This prevents the code from double counting in-cloud sulfur oxidation Signed-off-by: Thibaud Fritz --- src/chemistry/modal_aero/sox_cldaero_mod.F90 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chemistry/modal_aero/sox_cldaero_mod.F90 b/src/chemistry/modal_aero/sox_cldaero_mod.F90 index bacf94246c..589c881279 100644 --- a/src/chemistry/modal_aero/sox_cldaero_mod.F90 +++ b/src/chemistry/modal_aero/sox_cldaero_mod.F90 @@ -7,6 +7,7 @@ module sox_cldaero_mod use cam_abortutils, only : endrun use ppgrid, only : pcols, pver use mo_chem_utls, only : get_spc_ndx + use mo_chem_utls, only: utls_chem_is use cldaero_mod, only : cldaero_conc_t, cldaero_allocate, cldaero_deallocate use modal_aero_data, only : ntot_amode, modeptr_accum, lptr_so4_cw_amode, lptr_msa_cw_amode use modal_aero_data, only : numptrcw_amode, lptr_nh4_cw_amode @@ -229,6 +230,12 @@ subroutine sox_cldaero_update( & dqdt_aqhprxn(:,:) = 0.0_r8 dqdt_aqo3rxn(:,:) = 0.0_r8 + ! Avoid double counting in-cloud sulfur oxidation when running with + ! GEOS-Chem (CESM2-GC). If running with CESM2-GC, sulfur oxidation + ! is performed internally to GEOS-Chem. Here, we just return to the + ! parent routine and thus we do not apply tendencies calculated by MAM. + if ( utls_chem_is('GEOS-Chem') ) return + lev_loop: do k = 1,pver col_loop: do i = 1,ncol cloud: if (cldfrc(i,k) >= 1.0e-5_r8) then