diff --git a/.gitignore b/.gitignore index e69de29b..e46b9cc1 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,13 @@ +/cmake@/ +/ESMF/Shared/MAPL@/ +/cmake-build-debug/ +/build/ +/.mepo/ +/.idea/ +/ESMF/Shared/GMAO_Shared@/ +/ESMF/Shared/NCEP_Shared@/ +/ESMF/HEMCO_GridComp@/ +/install/ +tags + +.DS_STORE diff --git a/CCPP/GOCART_CCPP.F90 b/CCPP/GOCART_CCPP.F90 new file mode 100644 index 00000000..e69de29b diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..9aa21717 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,50 @@ +cmake_minimum_required (VERSION 3.17) +cmake_policy (SET CMP0053 NEW) +cmake_policy (SET CMP0054 NEW) + +project ( + GOCART + VERSION 0.9.0 + LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF + +if ("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}") + message(SEND_ERROR "In-source builds are disabled. Please + issue cmake command in separate build directory.") +endif ("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}") + +# Set the default build type to release +if (NOT CMAKE_BUILD_TYPE) + message (STATUS "Setting build type to 'Release' as none was specified.") + set (CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif () + +set (DOING_GEOS5 YES) + +# Should find a better place for this - used in Chem component +set (ACG_FLAGS -v) +set (FV_PRECISION R4R8) + +if (NOT COMMAND esma) + list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake@") + include (esma) +endif() + + ecbuild_declare_project() + +# This is a KLUDGE to emulate paths used in GEOSgcm so that GOCART Legacy code generation works +file (MAKE_DIRECTORY ${esma_include}/GEOSchem_GridComp) + +# Generic DFLAGS +# These should be relocated and/or eliminated. +add_definitions(-Dsys${CMAKE_SYSTEM_NAME} -DESMA64) +add_definitions(${MPI_Fortran_COMPILE_FLAGS}) +include_directories(${MPI_Fortran_INCLUDE_PATH}) + +# Recursively build source tree +add_subdirectory (ESMF) +add_subdirectory (Process_Library) + +ecbuild_install_project (NAME GOCART) diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/AeroCinderella_GridComp.F90 b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/AeroCinderella_GridComp.F90 new file mode 100644 index 00000000..d3e6fb90 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/AeroCinderella_GridComp.F90 @@ -0,0 +1,85 @@ +#include "MAPL_Generic.h" + +module AeroCinderella_GridCompMod + use ESMF + use MAPL + + implicit none + private + + public SetServices + + type AeroCinderella_GridComp + integer :: nbins + end type AeroCinderella_GridComp + +contains + subroutine SetServices(gc, rc) + type(ESMF_GridComp), intent(inout) :: gc + integer, optional, intent( out) :: rc + + type(AeroCinderella_GridComp), pointer :: self + + character(len=ESMF_MAXSTR) :: comp_name + + __Iam__('SetServices') + + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + call MAPL_GridCompSetEntryPoint(gc, ESMF_METHOD_INITIALIZE, Initialize, __RC__) + call MAPL_GridCompSetEntryPoint(gc, ESMF_METHOD_RUN, Run, __RC__) + +#include "AeroCinderella_Internal___.h" +#include "AeroCinderella_Export___.h" +#include "AeroCinderella_Import___.h" + + call MAPL_GenericSetServices(gc, __RC__) + + _RETURN(_SUCCESS) + end subroutine SetServices + + subroutine Initialize(gc, import, export, clock, rc) + type(ESMF_GridComp), intent(inout) :: gc + type(ESMF_State), intent(inout) :: import + type(ESMF_State), intent(inout) :: export + type(ESMF_Clock), intent(inout) :: clock + integer, optional, intent( out) :: rc + + character(len=ESMF_MAXSTR) :: comp_name + + type(MAPL_MetaComp), pointer :: MAPL + + __Iam__('Initialize') + + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + call MAPL_GetObjectFromgc(gc, MAPL, __RC__) + + _RETURN(_SUCCESS) + end subroutine Initialize + + subroutine Run(gc, import, export, clock, rc) + type(ESMF_GridComp), intent(inout) :: gc + type(ESMF_State), intent(inout) :: import + type(ESMF_State), intent(inout) :: export + type(ESMF_Clock), intent(inout) :: clock + integer, optional, intent( out) :: rc + + character(len=ESMF_MAXSTR) :: comp_name + + type(MAPL_MetaComp), pointer :: MAPL + +#include "AeroCinderella_DeclarePointer___.h" + + __Iam__('Run') + + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + call MAPL_GetObjectFromgc(gc, MAPL, __RC__) + + _RETURN(_SUCCESS) + end subroutine Run +end module AeroCinderella_GridCompMod \ No newline at end of file diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/AeroCinderella_StateSpecs.rc b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/AeroCinderella_StateSpecs.rc new file mode 100644 index 00000000..dd8c8682 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/AeroCinderella_StateSpecs.rc @@ -0,0 +1,106 @@ +schema_version: 2.0.0 +component: AeroCinderella + +category: IMPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS| Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC| COND | LONG NAME +#---------------------------------------------------------------------------------------- + DU_SRC | 1 | xy | N | | erod + FRLAKE | 1 | xy | N | | fraction_of_lake + WET1 | 1 | xy | N | | surface_soil_wetness + LWI | 1 | xy | N | | land-ocean-ice_mask + U10M | m s-1 | xy | N | | 10-meter_eastward_wind + V10M | m s-1 | xy | N | | 10-meter_northward_wind + AREA | m^2 | xy | N | | agrid_cell_area + USTAR | m s-1 | xy | N | | equivalent_neutral_10-meter_northward_wind + CN_PRCP |kg/m^2/s| xy | N | | surface_conv._rain_flux_needed_by_land + NCN_PRCP |kg/m^2/s| xy | N | | Non-convective precipitation + ZPBL | m | xy | N | | planetary_boundary_layer_height + SH | w m-2 | xy | N | | sensible_heat_flux_from_turbulence + Z0H | m | xy | N | | surface_roughness_for_heat +#........................................................................................ + DELP | Pa | xyz | C | | pressure_thickness + RH2 | 1 | xyz | C | | Rel_Hum_after_moist + T | K | xyz | C | | air_temperature + ZLE | m | xyz | E | | geopotential_height + PLE | Pa | xyz | E | | air_pressure + PFL_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_liquid_nonconvective_precipitation + PFI_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_ice_nonconvective_precipitation + U | m s-1 | xyz | C | | eastward_wind + V | m s-1 | xyz | C | | northward_wind + +category: EXPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS| VLOC| UNGRIDDED | LONG_NAME +#---------------------------------------------------------------------------------------- + AIRDENS | kg/m^3 | xyz | C | | moist_air_density + DUMASS | kg kg-1 | xyz | C | | Dust Mass Mixing Ratio __ENSEMBLE__ + DUMASS25 | kg kg-1 | xyz | C | | Dust Mass Mixing Ratio __ENSEMBLE__ + DUCONC | kg m-3 | xyz | C | | Dust Mass Concentration __ENSEMBLE__ + DUEXTCOEF | m-1 | xyz | C | | Dust Extinction Coefficient [550 nm] __ENSEMBLE__ + DUSCACOEF | m-1 | xyz | C | | Dust Scattering Coefficient [550 nm] __ENSEMBLE__ +#........................................................................................ + DUSMASS | kg m-3 | xy | N | | Dust Surface Mass Concentration __ENSEMBLE__ + DUCMASS | kg m-2 | xy | N | | Dust Column Mass Density __ENSEMBLE__ + DUEXTTAU | 1 | xy | N | | Dust Extinction AOT [550 nm] __ENSEMBLE__ + DUSCATAU | 1 | xy | N | | Dust Scattering AOT [550 nm] __ENSEMBLE__ + DUSMASS25 | kg m-3 | xy | N | | Dust Surface Mass Concentration - PM 2.5 __ENSEMBLE__ + DUCMASS25 | kg m-2 | xy | N | | Dust Column Mass Density - PM 2.5 __ENSEMBLE__ + DUEXTT25 | 1 | xy | N | | Dust Extinction AOT [550 nm] - PM 2.5 __ENSEMBLE__ + DUSCAT25 | 1 | xy | N | | Dust Scattering AOT [550 nm] - PM 2.5 __ENSEMBLE__ + DUAERIDX | 1 | xy | N | | Dust TOMS UV Aerosol Index __ENSEMBLE__ + DUFLUXU | kg m-1 s-1 | xy | N | | Dust column u-wind mass flux __ENSEMBLE__ + DUFLUXV | kg m-1 s-1 | xy | N | | Dust column v-wind mass flux __ENSEMBLE__ + DUEXTTFM | 1 | xy | N | | Dust Extinction AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + DUSCATFM | 1 | xy | N | | Dust Scattering AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + DUANGSTR | 1 | xy | N | | Dust Angstrom parameter [470-870 nm] __ENSEMBLE__ + DUEM | kg m-2 s-1 | xy | N | self%nbins | Dust Emission All Bins __ENSEMBLE__ + DUSD | kg m-2 s-1 | xy | N | self%nbins | Dust Sedimentation All Bins __ENSEMBLE__ + DUDP | kg m-2 s-1 | xy | N | self%nbins | Dust Dry Deposition All Bins __ENSEMBLE__ + DUWT | kg m-2 s-1 | xy | N | self%nbins | Dust Wet Deposition All Bins __ENSEMBLE__ + DUSV | kg m-2 s-1 | xy | N | self%nbins | Dust Convective Scavenging All Bins __ENSEMBLE__ + + +category: INTERNAL +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSION | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC | UNGRIDDED | RESTART | ADD2EXPORT | FRIENDLYTO | LONG NAME +#---------------------------------------------------------------------------------------- + DU |kg kg-1| xyz | C | self%nbins | MAPL_RestartOptional | .true. | DYNAMICS:TURBULENCE:MOIST | Dust Mixing Ratio all bins + + + +#******************************************************** +# +# Legend +# +#------------------------------------------------------------------ +# Column label | MAPL keyword/interpretation | Default +#--------------|--------------------------------------------------- +# NAME | short_name | +# UNITS | units | +# DIMS | dims | +# VLOC | VLocation | MAPL_VLocationNone +# LONG NAME | long_name | +# COND | if () then | .FALSE. +# NUM_SUBTILES | num_subtiles +# ... +#------------------------------------------------------------------ +# +#-------------------------------------------- +# Entry alias | Column | MAPL keyword/interpretation +#--------------|----------------------------- +# xyz | DIMS | MAPL_HorzVert +# xy | DIMS | MAPL_HorzOnly +# z | DIMS | MAPL_VertOnly (plus ungridded) +# C | VLOC | MAPL_VlocationCenter +# E | VLOC | MAPL_VlocationEdge +# N | VLOC | MAPL_VlocationNone +#-------------------------------------------- + + diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/CMakeLists.txt b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/CMakeLists.txt new file mode 100644 index 00000000..c5d5e3e0 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/CMakeLists.txt @@ -0,0 +1,23 @@ +esma_set_this() + +set (alldirs + Cinderella + ) + +if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/AeroCinderella_GridComp.F90) + + esma_add_library (${this} + SRCS AeroCinderella_GridComp.F90 + SUBCOMPONENTS ${alldirs} + DEPENDENCIES MAPL GEOS_Shared + INCLUDES ${INC_ESMF}) + + mapl_acg (${this} AeroCinderella_StateSpecs.rc + IMPORT_SPECS EXPORT_SPECS INTERNAL_SPECS + GET_POINTERS DECLARE_POINTERS) + +else () + + esma_add_subdirectories (${alldirs}) + +endif() diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/CMakeLists.txt b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/CMakeLists.txt new file mode 100644 index 00000000..86e3fccc --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/CMakeLists.txt @@ -0,0 +1,20 @@ +esma_set_this() + +set (srcs + LinearFields.F90 + ConvertUnits_private.F90 + ConvertUnits.F90 + NOAA_TracerMap.F90 + NOAA_GOCARTtracers.F90 + MissingFields.F90 + ) + +esma_add_library(${this} + SRCS ${srcs} + DEPENDENCIES MAPL GEOS_Shared) + +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +if (PFUNIT_FOUND) + add_subdirectory(tests EXCLUDE_FROM_ALL) +endif () diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/ConvertUnits.F90 b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/ConvertUnits.F90 new file mode 100644 index 00000000..2a94d6cc --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/ConvertUnits.F90 @@ -0,0 +1,10 @@ +module ConvertUnits_mod + use ConvertUnits_private_mod, only: read_scale_config, ScaleMapReal32, ScaleMapReal64 + + implicit none + private + + public read_scale_config + public ScaleMapReal32 + public ScaleMapReal64 +end module ConvertUnits_mod \ No newline at end of file diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/ConvertUnits_private.F90 b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/ConvertUnits_private.F90 new file mode 100644 index 00000000..9742f487 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/ConvertUnits_private.F90 @@ -0,0 +1,220 @@ +#include "MAPL_Generic.h" + +module ConvertUnits_private_mod + use, intrinsic :: iso_fortran_env, only: REAL32, REAL64 + + use ESMF + use MAPL + use gFTL_StringReal32Map + use gFTL_StringReal64Map + + use LinearFields_mod + + implicit none + private + + public ScaleMapReal32 + public ScaleMapReal64 + + public read_scale_config + public read_scale_config_real32 + public read_scale_config_real64 + + public scale_field_in_real32 + public scale_field_in_real64 + public scale_field_out_real32 + public scale_field_out_real64 + + interface read_scale_config + module procedure read_scale_config_real32 + module procedure read_scale_config_real64 + end interface read_scale_config + + type, extends(StringReal32Map) :: ScaleMapReal32 + contains + procedure :: scale_in => scale_in_real32 + procedure :: scale_out => scale_out_real32 + end type ScaleMapReal32 + + type, extends(StringReal64Map) :: ScaleMapReal64 + contains + procedure :: scale_in => scale_in_real64 + procedure :: scale_out => scale_out_real64 + end type ScaleMapReal64 +contains + subroutine read_scale_config_real32(config, scale_map, rc) + type(ESMF_Config), intent(inout) :: config + type(ScaleMapReal32), intent( out) :: scale_map + integer, optional, intent( out) :: rc + + integer :: i, num_fields, columns, status + real(kind=REAL32) :: scale_factor + character(len=ESMF_MaxStr) :: name + + call ESMF_ConfigGetDim(config, label="fields_to_scale:", lineCount=num_fields, & + columnCount=columns, __RC__) + call ESMF_ConfigFindLabel(config, label="fields_to_scale:", __RC__) + call ESMF_ConfigNextLine(config, __RC__) + + do i=1, num_fields + call ESMF_ConfigGetAttribute(config, value=name, __RC__) + call ESMF_ConfigGetAttribute(config, value=scale_factor, __RC__) + + call scale_map%insert(trim(name), scale_factor) + + call ESMF_ConfigNextLine(config, __RC__) + end do + + _RETURN(_SUCCESS) + end subroutine read_scale_config_real32 + + subroutine read_scale_config_real64(config, scale_map, rc) + type(ESMF_Config), intent(inout) :: config + type(ScaleMapReal64), intent( out) :: scale_map + integer, optional, intent( out) :: rc + + integer :: i, num_fields, columns, status + real(kind=REAL64) :: scale_factor + character(len=ESMF_MaxStr) :: name + + call ESMF_ConfigGetDim(config, label="fields_to_scale:", lineCount=num_fields, & + columnCount=columns, __RC__) + call ESMF_ConfigFindLabel(config, label="fields_to_scale:", __RC__) + call ESMF_ConfigNextLine(config, __RC__) + + do i=1, num_fields + call ESMF_ConfigGetAttribute(config, value=name, __RC__) + call ESMF_ConfigGetAttribute(config, value=scale_factor, __RC__) + + call scale_map%insert(trim(name), scale_factor) + + call ESMF_ConfigNextLine(config, __RC__) + end do + + _RETURN(_SUCCESS) + end subroutine read_scale_config_real64 + + subroutine scale_field_in_real32(state, scale_iter, rc) + type(ESMF_State), intent(in ) :: state + type(StringReal32MapIterator), intent(in ) :: scale_iter + integer, optional, intent( out) :: rc + + type(ESMF_Field) :: field + integer :: status + + call ESMF_StateGet(state, scale_iter%key(), field, __RC__) + call scale_field(field, scale_iter%value(), __RC__) + + _RETURN(_SUCCESS) + end subroutine scale_field_in_real32 + + subroutine scale_in_real32(this, state, rc) + class(ScaleMapReal32), intent(inout) :: this + type(ESMF_State), intent(in ) :: state + integer, optional, intent( out) :: rc + + type(StringReal32MapIterator) :: iter + integer :: status + + iter = this%begin() + do while (iter /= this%end()) + call scale_field_in_real32(state, iter, __RC__) + call iter%next() + end do + + _RETURN(_SUCCESS) + end subroutine scale_in_real32 + + subroutine scale_field_in_real64(state, scale_iter, rc) + type(ESMF_State), intent(in ) :: state + type(StringReal64MapIterator), intent(in ) :: scale_iter + integer, optional, intent( out) :: rc + + type(ESMF_Field) :: field + integer :: status + + call ESMF_StateGet(state, scale_iter%key(), field, __RC__) + call scale_field(field, scale_iter%value(), __RC__) + + _RETURN(_SUCCESS) + end subroutine scale_field_in_real64 + + subroutine scale_in_real64(this, state, rc) + class(ScaleMapReal64), intent(inout) :: this + type(ESMF_State), intent(in ) :: state + integer, optional, intent( out) :: rc + + type(StringReal64MapIterator) :: iter + integer :: status + + iter = this%begin() + do while (iter /= this%end()) + call scale_field_in_real64(state, iter, __RC__) + call iter%next() + end do + + _RETURN(_SUCCESS) + end subroutine scale_in_real64 + + subroutine scale_field_out_real32(state, scale_iter, rc) + type(ESMF_State), intent(in ) :: state + type(StringReal32MapIterator), intent(in ) :: scale_iter + integer, optional, intent( out) :: rc + + type(ESMF_Field) :: field + integer :: status + + call ESMF_StateGet(state, scale_iter%key(), field, __RC__) + call scale_field(field, 1.e0/scale_iter%value(), __RC__) + + _RETURN(_SUCCESS) + end subroutine scale_field_out_real32 + + subroutine scale_out_real32(this, state, rc) + class(ScaleMapReal32), intent(inout) :: this + type(ESMF_State), intent(in ) :: state + integer, optional, intent( out) :: rc + + type(StringReal32MapIterator) :: iter + integer :: status + + iter = this%begin() + do while (iter /= this%end()) + call scale_field_out_real32(state, iter, __RC__) + call iter%next() + end do + + _RETURN(_SUCCESS) + end subroutine scale_out_real32 + + subroutine scale_field_out_real64(state, scale_iter, rc) + type(ESMF_State), intent(in ) :: state + type(StringReal64MapIterator), intent(in ) :: scale_iter + integer, optional, intent( out) :: rc + + type(ESMF_Field) :: field + integer :: status + + call ESMF_StateGet(state, scale_iter%key(), field, __RC__) + call scale_field(field, 1.d0/scale_iter%value(), __RC__) + + _RETURN(_SUCCESS) + end subroutine scale_field_out_real64 + + subroutine scale_out_real64(this, state, rc) + class(ScaleMapReal64), intent(inout) :: this + type(ESMF_State), intent(in ) :: state + integer, optional, intent( out) :: rc + + type(StringReal64MapIterator) :: iter + integer :: status + + iter = this%begin() + do while (iter /= this%end()) + call scale_field_out_real64(state, iter, __RC__) + call iter%next() + end do + + _RETURN(_SUCCESS) + end subroutine scale_out_real64 +end module ConvertUnits_private_mod \ No newline at end of file diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/LinearFields.F90 b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/LinearFields.F90 new file mode 100644 index 00000000..38d73677 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/LinearFields.F90 @@ -0,0 +1,428 @@ +#include "MAPL_Generic.h" + +module LinearFields_mod + use, intrinsic :: iso_fortran_env, only: REAL32, REAL64 + + use ESMF + use MAPL + + implicit none + private + + public scale_field + public shift_field + + type, abstract :: MAPL_Field + private + type(ESMF_Field) :: field + contains + procedure(i_scale_real32), deferred :: scale_real32 + procedure(i_scale_real64), deferred :: scale_real64 + generic :: scale => scale_real32, scale_real64 + + procedure(i_shift_real32), deferred :: shift_real32 + procedure(i_shift_real64), deferred :: shift_real64 + generic :: shift => shift_real32, shift_real64 + end type MAPL_Field + + type, extends(MAPL_Field) :: MAPL_Real32_2DField + contains + procedure :: scale_real32 => scale_real32_2D_field_real32 + procedure :: scale_real64 => scale_real32_2D_field_real64 + + procedure :: shift_real32 => shift_real32_2D_field_real32 + procedure :: shift_real64 => shift_real32_2D_field_real64 + end type MAPL_Real32_2DField + + type, extends(MAPL_Field) :: MAPL_Real32_3DField + contains + procedure :: scale_real32 => scale_real32_3D_field_real32 + procedure :: scale_real64 => scale_real32_3D_field_real64 + + procedure :: shift_real32 => shift_real32_3D_field_real32 + procedure :: shift_real64 => shift_real32_3D_field_real64 + end type MAPL_Real32_3DField + + type, extends(MAPL_Field) :: MAPL_Real64_2DField + contains + procedure :: scale_real32 => scale_real64_2D_field_real32 + procedure :: scale_real64 => scale_real64_2D_field_real64 + + procedure :: shift_real32 => shift_real64_2D_field_real32 + procedure :: shift_real64 => shift_real64_2D_field_real64 + end type MAPL_Real64_2DField + + type, extends(MAPL_Field) :: MAPL_Real64_3DField + contains + procedure :: scale_real32 => scale_real64_3D_field_real32 + procedure :: scale_real64 => scale_real64_3D_field_real64 + + procedure :: shift_real32 => shift_real64_3D_field_real32 + procedure :: shift_real64 => shift_real64_3D_field_real64 + end type MAPL_Real64_3DField + + abstract interface + subroutine i_scale_real32(this, scale_factor, rc) + use, intrinsic :: iso_fortran_env, only: REAL32 + import MAPL_Field + class(MAPL_Field), intent(inout) :: this + real(kind=REAL32), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + end subroutine i_scale_real32 + + subroutine i_scale_real64(this, scale_factor, rc) + use, intrinsic :: iso_fortran_env, only: REAL64 + import MAPL_Field + class(MAPL_Field), intent(inout) :: this + real(kind=REAL64), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + end subroutine i_scale_real64 + + subroutine i_shift_real32(this, shift_factor, rc) + use, intrinsic :: iso_fortran_env, only: REAL32 + import MAPL_Field + class(MAPL_Field), intent(inout) :: this + real(kind=REAL32), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + end subroutine i_shift_real32 + + subroutine i_shift_real64(this, shift_factor, rc) + use, intrinsic :: iso_fortran_env, only: REAL64 + import MAPL_Field + class(MAPL_Field), intent(inout) :: this + real(kind=REAL64), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + end subroutine i_shift_real64 + end interface + + interface scale_field + module procedure scale_field_real32 + module procedure scale_field_real64 + end interface scale_field + + interface shift_field + module procedure shift_field_real32 + module procedure shift_field_real64 + end interface shift_field +contains + subroutine wrap_field(field, wrapper, rc) + type(ESMF_Field), intent(in ) :: field + class(MAPL_Field), allocatable, intent( out) :: wrapper + integer, optional, intent( out) :: rc + + type(ESMF_TypeKind_Flag) :: typekind + integer :: status, field_rank + + call ESMF_FieldGet(field, typekind=typekind, rank=field_rank, __RC__) + + if (typekind == ESMF_TYPEKIND_R4) then + select case(field_rank) + case (2) + wrapper = MAPL_Real32_2DField(field) + case (3) + wrapper = MAPL_Real32_3DField(field) + case default + _FAIL("Unsupported ESMF_Field Rank") + end select + elseif (typekind == ESMF_TYPEKIND_R8) then + select case(field_rank) + case (2) + wrapper = MAPL_Real64_2DField(field) + case (3) + wrapper = MAPL_Real64_3DField(field) + case default + _FAIL("Unsupported ESMF_Field Rank") + end select + else + _FAIL("Unsupported ESMF_TYPEKIND") + end if + + _RETURN(_SUCCESS) + end subroutine wrap_field + + subroutine scale_field_real32(field, scale_factor, rc) + type(ESMF_Field), intent(in ) :: field + real(kind=REAL32), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + + class(MAPL_Field), allocatable :: wrapper + integer :: status + + call wrap_field(field, wrapper, __RC__) + + call wrapper%scale(scale_factor, __RC__) + + _RETURN(_SUCCESS) + end subroutine scale_field_real32 + + subroutine scale_field_real64(field, scale_factor, rc) + type(ESMF_Field), intent(in ) :: field + real(kind=REAL64), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + + class(MAPL_Field), allocatable :: wrapper + integer :: status + + call wrap_field(field, wrapper, __RC__) + + call wrapper%scale(scale_factor, __RC__) + + _RETURN(_SUCCESS) + end subroutine scale_field_real64 + + subroutine scale_real32_2D_field_real32(this, scale_factor, rc) + class(MAPL_Real32_2DField), intent(inout) :: this + real(kind=REAL32), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + + real(kind=REAL32), pointer :: array(:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + + array = array*scale_factor + + _RETURN(_SUCCESS) + end subroutine scale_real32_2D_field_real32 + + subroutine scale_real32_2D_field_real64(this, scale_factor, rc) + class(MAPL_Real32_2DField), intent(inout) :: this + real(kind=REAL64), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + + real(kind=REAL32), pointer :: array(:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array*scale_factor + + _RETURN(_SUCCESS) + end subroutine scale_real32_2D_field_real64 + + subroutine scale_real32_3D_field_real32(this, scale_factor, rc) + class(MAPL_Real32_3DField), intent(inout) :: this + real(kind=REAL32), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + + real(kind=REAL32), pointer :: array(:,:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array*scale_factor + + _RETURN(_SUCCESS) + end subroutine scale_real32_3D_field_real32 + + subroutine scale_real32_3D_field_real64(this, scale_factor, rc) + class(MAPL_Real32_3DField), intent(inout) :: this + real(kind=REAL64), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + + real(kind=REAL32), pointer :: array(:,:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array*scale_factor + + _RETURN(_SUCCESS) + end subroutine scale_real32_3D_field_real64 + + subroutine scale_real64_2D_field_real32(this, scale_factor, rc) + class(MAPL_Real64_2DField), intent(inout) :: this + real(kind=REAL32), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + + real(kind=REAL64), pointer :: array(:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array*scale_factor + + _RETURN(_SUCCESS) + end subroutine scale_real64_2D_field_real32 + + subroutine scale_real64_2D_field_real64(this, scale_factor, rc) + class(MAPL_Real64_2DField), intent(inout) :: this + real(kind=REAL64), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + + real(kind=REAL64), pointer :: array(:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array*scale_factor + + _RETURN(_SUCCESS) + end subroutine scale_real64_2D_field_real64 + + subroutine scale_real64_3D_field_real32(this, scale_factor, rc) + class(MAPL_Real64_3DField), intent(inout) :: this + real(kind=REAL32), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + + real(kind=REAL64), pointer :: array(:,:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array*scale_factor + + _RETURN(_SUCCESS) + end subroutine scale_real64_3D_field_real32 + + subroutine scale_real64_3D_field_real64(this, scale_factor, rc) + class(MAPL_Real64_3DField), intent(inout) :: this + real(kind=REAL64), intent(in ) :: scale_factor + integer, optional, intent( out) :: rc + + real(kind=REAL64), pointer :: array(:,:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array*scale_factor + + _RETURN(_SUCCESS) + end subroutine scale_real64_3D_field_real64 + + subroutine shift_field_real32(field, shift_factor, rc) + type(ESMF_Field), intent(in ) :: field + real(kind=REAL32), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + + class(MAPL_Field), allocatable :: wrapper + integer :: status + + call wrap_field(field, wrapper, __RC__) + + call wrapper%shift(shift_factor, __RC__) + + _RETURN(_SUCCESS) + end subroutine shift_field_real32 + + subroutine shift_field_real64(field, shift_factor, rc) + type(ESMF_Field), intent(in ) :: field + real(kind=REAL64), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + + class(MAPL_Field), allocatable :: wrapper + integer :: status + + call wrap_field(field, wrapper, __RC__) + + call wrapper%shift(shift_factor, __RC__) + + _RETURN(_SUCCESS) + end subroutine shift_field_real64 + + subroutine shift_real32_2D_field_real32(this, shift_factor, rc) + class(MAPL_Real32_2DField), intent(inout) :: this + real(kind=REAL32), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + + real(kind=REAL32), pointer :: array(:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + + array = array+shift_factor + + _RETURN(_SUCCESS) + end subroutine shift_real32_2D_field_real32 + + subroutine shift_real32_2D_field_real64(this, shift_factor, rc) + class(MAPL_Real32_2DField), intent(inout) :: this + real(kind=REAL64), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + + real(kind=REAL32), pointer :: array(:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array+shift_factor + + _RETURN(_SUCCESS) + end subroutine shift_real32_2D_field_real64 + + subroutine shift_real32_3D_field_real32(this, shift_factor, rc) + class(MAPL_Real32_3DField), intent(inout) :: this + real(kind=REAL32), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + + real(kind=REAL32), pointer :: array(:,:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array+shift_factor + + _RETURN(_SUCCESS) + end subroutine shift_real32_3D_field_real32 + + subroutine shift_real32_3D_field_real64(this, shift_factor, rc) + class(MAPL_Real32_3DField), intent(inout) :: this + real(kind=REAL64), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + + real(kind=REAL32), pointer :: array(:,:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array+shift_factor + + _RETURN(_SUCCESS) + end subroutine shift_real32_3D_field_real64 + + subroutine shift_real64_2D_field_real32(this, shift_factor, rc) + class(MAPL_Real64_2DField), intent(inout) :: this + real(kind=REAL32), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + + real(kind=REAL64), pointer :: array(:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array+shift_factor + + _RETURN(_SUCCESS) + end subroutine shift_real64_2D_field_real32 + + subroutine shift_real64_2D_field_real64(this, shift_factor, rc) + class(MAPL_Real64_2DField), intent(inout) :: this + real(kind=REAL64), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + + real(kind=REAL64), pointer :: array(:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array+shift_factor + + _RETURN(_SUCCESS) + end subroutine shift_real64_2D_field_real64 + + subroutine shift_real64_3D_field_real32(this, shift_factor, rc) + class(MAPL_Real64_3DField), intent(inout) :: this + real(kind=REAL32), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + + real(kind=REAL64), pointer :: array(:,:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array+shift_factor + + _RETURN(_SUCCESS) + end subroutine shift_real64_3D_field_real32 + + subroutine shift_real64_3D_field_real64(this, shift_factor, rc) + class(MAPL_Real64_3DField), intent(inout) :: this + real(kind=REAL64), intent(in ) :: shift_factor + integer, optional, intent( out) :: rc + + real(kind=REAL64), pointer :: array(:,:,:) + integer :: status + + call ESMF_FieldGet(this%field, localDE=0, farrayPtr=array, __RC__) + array = array+shift_factor + + _RETURN(_SUCCESS) + end subroutine shift_real64_3D_field_real64 +end module LinearFields_mod \ No newline at end of file diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/MissingFields.F90 b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/MissingFields.F90 new file mode 100644 index 00000000..f6c9237e --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/MissingFields.F90 @@ -0,0 +1,262 @@ +#include "MAPL_Generic.h" + +module MissingFields_mod + use, intrinsic :: iso_fortran_env, only: REAL32, REAL64 + + use ESMF + use MAPL + + use GEOS_UtilsMod + + implicit none + private + + public get_AIRDENS + public get_DELP + public get_ZLE + + logical, parameter :: ice_flip = .false. + logical, parameter :: lake_flip = .false. + logical, parameter :: ocean_flip = .false. + + interface get_AIRDENS + module procedure :: get_AIRDENS_real32 + module procedure :: get_AIRDENS_real64 + end interface get_AIRDENS + + interface get_DELP + module procedure :: get_DELP_real32 + module procedure :: get_DELP_real64 + end interface get_DELP + + interface get_FRACI + module procedure :: get_FRACI_real32 + module procedure :: get_FRACI_real64 + end interface get_FRACI + + interface get_FRLAKE + module procedure :: get_FRLAKE_real32 + module procedure :: get_FRLAKE_real64 + end interface get_FRLAKE + + interface get_FROCEAN + module procedure :: get_FROCEAN_real32 + module procedure :: get_FROCEAN_real64 + end interface get_FROCEAN + + interface get_ZLE + module procedure :: get_ZLE_real32 + module procedure :: get_ZLE_real64 + end interface get_ZLE +contains + subroutine get_AIRDENS_real32(PLE, T, AIRDENS) + real(kind=REAL32), intent(in ) :: PLE(:,:,:) + real(kind=REAL32), intent(in ) :: T(:,:,:) + real(kind=REAL32), intent( out) :: AIRDENS(:,:,:) + + AIRDENS = PLE/(MAPL_RDRY*T) + end subroutine get_AIRDENS_real32 + + subroutine get_AIRDENS_real64(PLE, T, AIRDENS) + real(kind=REAL64), intent(in ) :: PLE(:,:,:) + real(kind=REAL64), intent(in ) :: T(:,:,:) + real(kind=REAL64), intent( out) :: AIRDENS(:,:,:) + + AIRDENS = PLE/(MAPL_RDRY*T) + end subroutine get_AIRDENS_real64 + + subroutine get_AIRDENS_DRYP() + end subroutine get_AIRDENS_DRYP + + subroutine get_DELP_real32(PRESS, DELP) + real(kind=REAL32), intent(in ) :: PRESS(:,:,:) + real(kind=REAL32), intent( out) :: DELP(:,:,:) + + integer :: i, n(3) + + n = shape(PRESS) + + do i=1, n(3)-1 + DELP(:,:,i) = PRESS(:,:,i+1) - PRESS(:,:,i) + end do + end subroutine get_DELP_real32 + + subroutine get_DELP_real64(PRESS, DELP) + real(kind=REAL64), intent(in ) :: PRESS(:,:,:) + real(kind=REAL64), intent( out) :: DELP(:,:,:) + + integer :: i, n(3) + + n = shape(PRESS) + + do i=1, n(3)-1 + DELP(:,:,i) = PRESS(:,:,i+1) - PRESS(:,:,i) + end do + end subroutine get_DELP_real64 + + subroutine get_FRACI_real32(sea_ice, FRACI, flip) + real(kind=REAL32), intent(in ) :: sea_ice + real(kind=REAL32), intent( out) :: FRACI + logical, optional, intent(in ) :: flip + + logical :: flip_values + + if (present(flip)) then + flip_values = flip + else + flip_values = ice_flip + end if + + if (flip_values) then + FRACI = 1.0 - sea_ice + else + FRACI = sea_ice + end if + end subroutine get_FRACI_real32 + + subroutine get_FRACI_real64(sea_ice, FRACI, flip) + real(kind=REAL64), intent(in ) :: sea_ice + real(kind=REAL64), intent( out) :: FRACI + logical, optional, intent(in ) :: flip + + logical :: flip_values + + if (present(flip)) then + flip_values = flip + else + flip_values = ice_flip + end if + + if (flip_values) then + FRACI = 1.0 - sea_ice + else + FRACI = sea_ice + end if + end subroutine get_FRACI_real64 + + subroutine get_FRLAKE_real32(lake_land, FRLAKE, flip) + real(kind=REAL32), intent(in ) :: lake_land + real(kind=REAL32), intent( out) :: FRLAKE + logical, optional, intent(in ) :: flip + + logical :: flip_values + + if (present(flip)) then + flip_values = flip + else + flip_values = lake_flip + end if + + if (flip_values) then + FRLAKE = 1.0 - lake_land + else + FRLAKE = lake_land + end if + end subroutine get_FRLAKE_real32 + + subroutine get_FRLAKE_real64(lake_land, FRLAKE, flip) + real(kind=REAL64), intent(in ) :: lake_land + real(kind=REAL64), intent( out) :: FRLAKE + logical, optional, intent(in ) :: flip + + logical :: flip_values + + if (present(flip)) then + flip_values = flip + else + flip_values = lake_flip + end if + + if (flip_values) then + FRLAKE = 1.0 - lake_land + else + FRLAKE = lake_land + end if + end subroutine get_FRLAKE_real64 + + subroutine get_FROCEAN_real32(land_sea, FROCEAN, flip) + real(kind=REAL32), intent(in ) :: land_sea + real(kind=REAL32), intent( out) :: FROCEAN + logical, optional, intent(in ) :: flip + + logical :: flip_values + + if (present(flip)) then + flip_values = flip + else + flip_values = ocean_flip + end if + + if (flip_values) then + FROCEAN = 1.0 - land_sea + else + FROCEAN = land_sea + end if + end subroutine get_FROCEAN_real32 + + subroutine get_FROCEAN_real64(land_sea, FROCEAN, flip) + real(kind=REAL64), intent(in ) :: land_sea + real(kind=REAL64), intent( out) :: FROCEAN + logical, optional, intent(in ) :: flip + + logical :: flip_values + + if (present(flip)) then + flip_values = flip + else + flip_values = ocean_flip + end if + + if (flip_values) then + FROCEAN = 1.0 - land_sea + else + FROCEAN = land_sea + end if + end subroutine get_FROCEAN_real64 + + subroutine get_PS() + end subroutine get_PS + + subroutine get_RH2(T, PLE, Q, RH2) + real(kind=REAL32), intent(in ) :: T(:,:,:) + real(kind=REAL32), intent(in ) :: PLE(:,:,:) + real(kind=REAL32), intent(in ) :: Q(:,:,:) + real(kind=REAL32), intent( out) :: RH2(:,:,:) + + integer :: i, j, k, n(3) + + n = size(T) + + do i=1, n(1) + do j=1, n(2) + do k=1, n(3) + RH2(i,j,k) = Q(i,j,k) / GEOS_Qsat(T(i,j,k), PLE(i,j,k)) + end do + end do + end do + + end subroutine + + subroutine get_DZ() + end subroutine get_DZ + + subroutine get_ZLE_real32(inst_geop_interface, ZLE) + real(kind=REAL32), intent(in ) :: inst_geop_interface(:,:,:) + real(kind=REAL32), intent( out) :: ZLE(:,:,:) + + ZLE = inst_geop_interface/MAPL_GRAV + end subroutine get_ZLE_real32 + + subroutine get_ZLE_real64(inst_geop_interface, ZLE) + real(kind=REAL64), intent(in ) :: inst_geop_interface(:,:,:) + real(kind=REAL64), intent(out) :: ZLE(:,:,:) + + ZLE = inst_geop_interface/MAPL_GRAV + end subroutine get_ZLE_real64 + + subroutine get_PFI_LSAN() + end subroutine get_PFI_LSAN + + subroutine get_PFL_LSAN() + end subroutine get_PFL_LSAN +end module MissingFields_mod \ No newline at end of file diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/NOAA_GOCARTtracers.F90 b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/NOAA_GOCARTtracers.F90 new file mode 100644 index 00000000..9beda41a --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/NOAA_GOCARTtracers.F90 @@ -0,0 +1,122 @@ +#include "MAPL_Generic.h" + +module NOAA_GOCARTtracers_mod + use, intrinsic :: iso_fortran_env, only: REAL32, REAL64 + + use ESMF + use MAPL + use yaFyaml + use gFTL_StringVector + use NOAA_TracerMap_mod + + implicit none + private + + public :: GOCARTtracers + + character(*), parameter :: rc_label = 'GOCART_tracer_config:' + character(*), parameter :: bundle_label = 'inst_mass_tracers' + + type, extends(StringVector) :: GOCARTtracers + type(TracerMap) :: tracer_map + contains + procedure, nopass :: read_filename_from_config + procedure :: parse_yaml + procedure :: initialize + + procedure :: create_tracer_bundle + end type GOCARTtracers +contains + subroutine read_filename_from_config(config, filename, rc) + type(ESMF_Config), intent(inout) :: config + character(:), allocatable, intent( out) :: filename + integer, optional, intent( out) :: rc + + character(len=ESMF_MaxStr) :: value + integer :: status + + call ESMF_ConfigGetAttribute(config, value=value, label=rc_label, __RC__) + filename = trim(value) + + _RETURN(_SUCCESS) + end subroutine read_filename_from_config + + subroutine parse_yaml(this, filename) + class(GOCARTtracers), intent(inout) :: this + character(*), intent(in ) :: filename + + type(Parser) :: p + type(FileStream) :: file_stream + type(Configuration) :: config, sub_config, sub_sub_config + type(ConfigurationIterator) :: iter, sub_iter + + character(:), pointer :: key + character(:), allocatable :: field_table, field_name + + p = Parser('core') + file_stream = FileStream(filename) + config = p%load(file_stream) + + iter = config%begin() + do while (iter /= config%end()) + key => iter%key() + + select case(key) + case('NOAA_field_table') + field_table = iter%value() + call this%tracer_map%read_field_table(field_table) + case('GOCART_Tracers') + sub_config = iter%value() + sub_iter = sub_config%begin() + do while(sub_iter /= sub_config%end()) + field_name = sub_iter%get() + call this%push_back(field_name) + + call sub_iter%next() + end do + end select + + call iter%next() + end do + + call file_stream%close() + end subroutine parse_yaml + + subroutine initialize(this, config, rc) + class(GOCARTtracers), intent(inout) :: this + type(ESMF_Config), intent(inout) :: config + integer, optional, intent( out) :: rc + + character(:), allocatable :: filename + integer :: status + + call this%read_filename_from_config(config, filename, __RC__) + call this%parse_yaml(filename) + end subroutine initialize + + subroutine create_tracer_bundle(this, field, bundle, rc) + class(GOCARTtracers), intent(inout) :: this + type(ESMF_Field), intent(in ) :: field + type(ESMF_FieldBundle), intent( out) :: bundle + integer, optional, intent( out) :: rc + + type(ESMF_Field), allocatable :: tracers(:) + type(StringVectorIterator) :: iter + integer :: status, i + + allocate(tracers(this%size())) + + i = 1 + iter = this%begin() + do while(iter /= this%end()) + call this%tracer_map%create_tracer(field, iter%get(), tracers(i), __RC__) + + i = i + 1 + call iter%next() + end do + + bundle = ESMF_FieldBundleCreate(fieldList=tracers, name=bundle_label, __RC__) + + _RETURN(_SUCCESS) + end subroutine create_tracer_bundle +end module NOAA_GOCARTtracers_mod \ No newline at end of file diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/NOAA_TracerMap.F90 b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/NOAA_TracerMap.F90 new file mode 100644 index 00000000..afd0dd74 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/NOAA_TracerMap.F90 @@ -0,0 +1,174 @@ +#include "MAPL_Generic.h" + +module NOAA_TracerMap_mod + use, intrinsic :: iso_fortran_env, only: REAL32, REAL64 + + use ESMF + use MAPL + use gFTL_StringIntegerMap + + implicit none + private + + public :: TracerMap + + type, extends(StringIntegerMap) :: TracerMap + contains + procedure, nopass :: read_tracer_name + procedure, nopass :: remove_first_quote + procedure, nopass :: remove_second_quote + + procedure :: read_field_table_line + procedure :: read_field_table + + procedure :: create_tracer_real32 + procedure :: create_tracer_real64 + procedure :: create_tracer + end type TracerMap +contains + function read_tracer_name(str) result(tracer_name) + character(*), intent(in) :: str + character(:), allocatable :: tracer_name + + integer :: str_index + + str_index = scan(str, ',', back=.true.) + tracer_name = str(str_index:) + end function read_tracer_name + + function remove_first_quote(str) result(tracer_name) + character(*), intent(in) :: str + character(:), allocatable :: tracer_name + + integer :: str_index + + str_index = scan(str, '"') + tracer_name = str(str_index + 1:) + end function remove_first_quote + + function remove_second_quote(str) result(tracer_name) + character(*), intent(in) :: str + character(:), allocatable :: tracer_name + + integer :: str_index + + str_index = scan(str, '"', back=.true.) + tracer_name = str(:str_index - 1) + end function remove_second_quote + + subroutine read_field_table_line(this, str, tracer_index) + class(TracerMap), intent(inout) :: this + character(*), intent(in ) :: str + integer, intent(inout) :: tracer_index + + character(:), allocatable :: tracer_name + + if (index(str, 'TRACER') > 0) then + tracer_index = tracer_index + 1 + + tracer_name = this%remove_second_quote(& + this%remove_first_quote(this%read_tracer_name(str))) + call this%insert(tracer_name, tracer_index) + end if + end subroutine read_field_table_line + + subroutine read_field_table(this, filename) + class(TracerMap), intent(inout) :: this + character(*), intent(in ) :: filename + + character(len=ESMF_MAXSTR) :: str + + integer :: file_unit, iostat, tracer_index, str_index + + open(newunit=file_unit, file=filename, form='formatted', access='sequential', status='old') + + tracer_index = 0 + do + read(file_unit, '(a)', iostat=iostat) str + if (iostat /= 0) exit + + call this%read_field_table_line(str, tracer_index) + end do + + close(unit=file_unit) + end subroutine read_field_table + + subroutine create_tracer_real32(this, field, name, tracer, rc) + class(TracerMap), intent(inout) :: this + type(ESMF_Field), intent(in ) :: field + character(*), intent(in ) :: name + type(ESMF_Field), intent( out) :: tracer + integer, optional, intent( out) :: rc + + type(ESMF_Grid) :: grid + real(kind=REAL32), pointer :: field_array(:,:,:,:) + real(kind=REAL32), pointer :: tracer_array(:,:,:) + integer :: tracer_size(4) + integer :: idx, status + + idx = this%at(name) + + call ESMF_FieldGet(field, grid=grid, __RC__) + call ESMF_FieldGet(field, localDE=0, farrayPtr=field_array, __RC__) + + ! check tracer index + tracer_size = shape(field_array) + _ASSERT(idx <= tracer_size(4), "invalid tracer index") + + tracer_array => field_array(:,:,:,idx) + tracer = ESMF_FieldCreate(grid, tracer_array, name=name, __RC__) + + _RETURN(_SUCCESS) + end subroutine create_tracer_real32 + + subroutine create_tracer_real64(this, field, name, tracer, rc) + class(TracerMap), intent(inout) :: this + type(ESMF_Field), intent(in ) :: field + character(*), intent(in ) :: name + type(ESMF_Field), intent( out) :: tracer + integer, optional, intent( out) :: rc + + type(ESMF_Grid) :: grid + real(kind=REAL64), pointer :: field_array(:,:,:,:) + real(kind=REAL64), pointer :: tracer_array(:,:,:) + integer :: tracer_size(4) + integer :: idx, status + + idx = this%at(name) + + call ESMF_FieldGet(field, grid=grid, __RC__) + call ESMF_FieldGet(field, localDE=0, farrayPtr=field_array, __RC__) + + ! check tracer index + tracer_size = shape(field_array) + _ASSERT(idx <= tracer_size(4), "invalid tracer index") + + tracer_array => field_array(:,:,:,idx) + tracer = ESMF_FieldCreate(grid, tracer_array, name=name, __RC__) + + _RETURN(_SUCCESS) + end subroutine create_tracer_real64 + + subroutine create_tracer(this, field, name, tracer, rc) + class(TracerMap), intent(inout) :: this + type(ESMF_Field), intent(in ) :: field + character(*), intent(in ) :: name + type(ESMF_Field), intent( out) :: tracer + integer, optional, intent( out) :: rc + + type(ESMF_TypeKind_Flag) :: typekind + integer :: status + + call ESMF_FieldGet(field, typekind=typekind, __RC__) + + if (typekind == ESMF_TYPEKIND_R4) then + call this%create_tracer_real32(field, name, tracer, __RC__) + elseif (typekind == ESMF_TYPEKIND_R8) then + call this%create_tracer_real64(field, name, tracer, __RC__) + else + _FAIL("Unsupported ESMF_TYPEKIND") + end if + + _RETURN(_SUCCESS) + end subroutine create_tracer +end module NOAA_TracerMap_mod diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/CMakeLists.txt b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/CMakeLists.txt new file mode 100644 index 00000000..0dca1861 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/CMakeLists.txt @@ -0,0 +1,24 @@ +add_definitions(-DUSE_MPI) + +set (TEST_SRCS + test_LinearFields.pf + test_ConvertUnits_private.pf + test_NOAA_TracerMap.pf + test_NOAA_GOCARTtracers.pf + test_MissingFields.pf +) + +add_pfunit_ctest(Cinderella_private_tests + TEST_SOURCES ${TEST_SRCS} + LINK_LIBRARIES MAPL MAPL.pfio base_extras MAPL_pFUnit Cinderella + EXTRA_INITIALIZE Initialize + EXTRA_USE MAPL_pFUnit_Initialize + MAX_PES 6 + ) + +add_dependencies(build-tests Cinderella_private_tests) + +configure_file(test_GOCART_Tracers.rc test_GOCART_Tracers.rc COPYONLY) +configure_file(field_table field_table COPYONLY) +configure_file(GOCART_Tracers.yaml GOCART_Tracers.yaml COPYONLY) +configure_file(test_ConvertUnits.rc test_ConvertUnits.rc COPYONLY) diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/GOCART_Tracers.yaml b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/GOCART_Tracers.yaml new file mode 100644 index 00000000..c756b09c --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/GOCART_Tracers.yaml @@ -0,0 +1,31 @@ +NOAA_field_table: field_table + +GOCART_Tracers: + - sphum + - liq_wat + - rainwat + - ice_wat + - snowwat + - graupel + - o3mr + - so2 + - sulf + - DMS + - msa + - pp25 + - bc1 + - bc2 + - oc1 + - oc2 + - dust1 + - dust2 + - dust3 + - dust4 + - dust5 + - seas1 + - seas2 + - seas3 + - seas4 + - seas5 + - pp10 + - cld_amt \ No newline at end of file diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/field_table b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/field_table new file mode 100644 index 00000000..af4b7743 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/field_table @@ -0,0 +1,137 @@ +# added by FRE: sphum must be present in atmos +# specific humidity for moist runs + "TRACER", "atmos_mod", "sphum" + "longname", "specific humidity" + "units", "kg/kg" + "profile_type", "fixed", "surface_value=1.e30" / +# prognostic cloud water mixing ratio + "TRACER", "atmos_mod", "liq_wat" + "longname", "cloud water mixing ratio" + "units", "kg/kg" + "profile_type", "fixed", "surface_value=1.e30" / + "TRACER", "atmos_mod", "rainwat" + "longname", "rain mixing ratio" + "units", "kg/kg" + "profile_type", "fixed", "surface_value=1.e30" / + "TRACER", "atmos_mod", "ice_wat" + "longname", "cloud ice mixing ratio" + "units", "kg/kg" + "profile_type", "fixed", "surface_value=1.e30" / + "TRACER", "atmos_mod", "snowwat" + "longname", "snow mixing ratio" + "units", "kg/kg" + "profile_type", "fixed", "surface_value=1.e30" / + "TRACER", "atmos_mod", "graupel" + "longname", "graupel mixing ratio" + "units", "kg/kg" + "profile_type", "fixed", "surface_value=1.e30" / +# prognostic ozone mixing ratio tracer + "TRACER", "atmos_mod", "o3mr" + "longname", "ozone mixing ratio" + "units", "kg/kg" + "profile_type", "fixed", "surface_value=1.e30" / +# prognostic so2 mixing ratio tracer + "TRACER", "atmos_mod", "so2" + "longname", "so2 mixing ratio" + "units", "ppm" + "profile_type", "fixed", "surface_value=5.e-6" / +# prognostic sulfate mixing ratio tracer + "TRACER", "atmos_mod", "sulf" + "longname", "sulfate mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=3.e-6" / +# prognostic DMS mixing ratio tracer + "TRACER", "atmos_mod", "DMS" + "longname", "DMS mixing ratio" + "units", "ppm" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic msa mixing ratio tracer + "TRACER", "atmos_mod", "msa" + "longname", "msa mixing ratio" + "units", "ppm" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic pp25 mixing ratio tracer + "TRACER", "atmos_mod", "pp25" + "longname", "primary PM25 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e+0" / +# prognostic bc1 mixing ratio tracer + "TRACER", "atmos_mod", "bc1" + "longname", "hydrophobic black carbon mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic bc2 mixing ratio tracer + "TRACER", "atmos_mod", "bc2" + "longname", "hydrophillic black carbon mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic oc1 mixing ratio tracer + "TRACER", "atmos_mod", "oc1" + "longname", "hydrophobic organic carbon mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic oc2 mixing ratio tracer + "TRACER", "atmos_mod", "oc2" + "longname", "hydrophillic organic carbon mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic dust1 mixing ratio tracer + "TRACER", "atmos_mod", "dust1" + "longname", "fine dust1 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic dust2 mixing ratio tracer + "TRACER", "atmos_mod", "dust2" + "longname", "fine dust2 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic dust3 mixing ratio tracer + "TRACER", "atmos_mod", "dust3" + "longname", "coarse dust3 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic dust4 mixing ratio tracer + "TRACER", "atmos_mod", "dust4" + "longname", "coarse dust4 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic dust5 mixing ratio tracer + "TRACER", "atmos_mod", "dust5" + "longname", "coarse dust5 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic seas1 mixing ratio tracer + "TRACER", "atmos_mod", "seas1" + "longname", "seasalt1 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic seas2 mixing ratio tracer + "TRACER", "atmos_mod", "seas2" + "longname", "seasalt2 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic seas3 mixing ratio tracer + "TRACER", "atmos_mod", "seas3" + "longname", "seasalt3 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic seas4 mixing ratio tracer + "TRACER", "atmos_mod", "seas4" + "longname", "seasalt4 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic seas5 mixing ratio tracer + "TRACER", "atmos_mod", "seas5" + "longname", "seasalt5 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e-7" / +# prognostic pp10 mixing ratio tracer + "TRACER", "atmos_mod", "pp10" + "longname", "primary PM10 mixing ratio" + "units", "ug/kg" + "profile_type", "fixed", "surface_value=1.e+0" / +# non-prognostic cloud amount + "TRACER", "atmos_mod", "cld_amt" + "longname", "cloud amount" + "units", "1" + "profile_type", "fixed", "surface_value=1.e30" / diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_ConvertUnits.rc b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_ConvertUnits.rc new file mode 100644 index 00000000..e4e2f672 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_ConvertUnits.rc @@ -0,0 +1,16 @@ +fields_to_scale: + BCPhobic 1.d-9 + BCPhilic 1.d-9 + OCPhobic 1.d-9 + OCPhilic 1.d-9 + DU001 1.d-9 + DU002 1.d-9 + DU003 1.d-9 + DU004 1.d-9 + DU005 1.d-9 + SS001 1.d-9 + SS002 1.d-9 + SS003 1.d-9 + SS004 1.d-9 + SS005 1.d-9 +:: \ No newline at end of file diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_ConvertUnits_private.pf b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_ConvertUnits_private.pf new file mode 100644 index 00000000..07040a49 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_ConvertUnits_private.pf @@ -0,0 +1,550 @@ +#include "MAPL_Generic.h" + +module test_ConvertUnits_private + use, intrinsic :: iso_fortran_env, only: REAL32, REAL64, INT64 + + use ConvertUnits_private_mod + use LinearFields_mod + use gFTL_StringReal32Map + use gFTL_StringReal64Map + use pFunit + use MAPL + use ESMF + use ESMF_TestCase_mod + use ESMF_TestMethod_mod + + implicit none + + interface add_field + module procedure add_field_real32 + module procedure add_field_real64 + end interface add_field + + interface create_map + module procedure create_map_real32 + module procedure create_map_real64 + end interface create_map + +contains + subroutine create_config(config, rc) + type(ESMF_Config), intent(out) :: config + integer, optional, intent(out) :: rc + + integer :: status + + config = ESMF_ConfigCreate(rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_ConfigLoadFile(config, "test_ConvertUnits.rc", rc=status) + @assert_that(status, is(equal_to(0))) + + _RETURN(_SUCCESS) + end subroutine create_config + + subroutine create_ESMF_state(state, rc) + type(ESMF_State), intent(out) :: state + integer, optional, intent(out) :: rc + + type(ESMF_Field) :: field + integer :: status + + state = ESMF_StateCreate(name="test", rc=status) + @assert_that(status, is(equal_to(0))) + + _RETURN(_SUCCESS) + end subroutine create_ESMF_state + + subroutine create_ESMF_field(name, field, f_array, t_array, rc) + character(*), intent(in ) :: name + type(ESMF_Field), intent( out) :: field + real(kind=REAL32), allocatable, dimension(:,:), intent( out) :: f_array, t_array + integer, optional, intent( out) :: rc + + type(ESMF_Grid) :: grid + type(ESMF_DistGrid) :: dist_grid + type(ESMF_Array) :: array + + real(kind=REAL32) :: f_array_val + integer, dimension(2) :: fa_shape + integer :: x_dim, y_dim, i, j, status, field_rank + + x_dim = 4 + y_dim = 3 + + grid = ESMF_GridCreateNoPeriDim(minIndex=[1,1], maxIndex=[x_dim,y_dim], & + regDecomp=[1,1], name="grid", rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGet(grid=grid, staggerloc=ESMF_STAGGERLOC_CENTER, & + distgrid=dist_grid, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGetFieldBounds(grid=grid, localDe=0, & + staggerloc=ESMF_STAGGERLOC_CENTER, totalCount=fa_shape, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(fa_shape(1), is(equal_to(x_dim))) + @assert_that(fa_shape(2), is(equal_to(y_dim))) + + allocate(f_array(fa_shape(1), fa_shape(2))) + allocate(t_array(fa_shape(1), fa_shape(2))) + f_array_val = 1.0 + do i=1, fa_shape(1) + do j=1, fa_shape(2) + f_array(i,j) = f_array_val + f_array_val = f_array_val + 1.0 + end do + end do + + t_array = f_array + + @assert_that(f_array_val, is(equal_to(fa_shape(1)*fa_shape(2) + 1.0))) + + array = ESMF_ArrayCreate(dist_grid, f_array, & + indexflag=ESMF_INDEX_DELOCAL, rc=status) + @assert_that(status, is(equal_to(0))) + + field = ESMF_FieldCreate(grid=grid, name=name, array=array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, rank=field_rank, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_rank, is(equal_to(2))) + + _RETURN(_SUCCESS) + end subroutine create_ESMF_field + + subroutine add_field_real32(name, value, state, map, f_array, t_array, rc) + character(*), intent(in ) :: name + real(kind=REAL32), intent(in ) :: value + type(ESMF_State), intent(inout) :: state + type(ScaleMapReal32), intent(inout) :: map + real(kind=REAL32), allocatable, dimension(:,:), intent( out) :: f_array, t_array + integer, optional, intent( out) :: rc + + type(ESMF_Field) :: field + integer :: status + + call create_ESMF_field(name, field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_StateAdd(state, [field], rc=status) + @assert_that(status, is(equal_to(0))) + + call map%insert(name, value) + + _RETURN(_SUCCESS) + end subroutine add_field_real32 + + subroutine create_map_real32(name, value, state, map, f_array, t_array, rc) + character(*), intent(in ) :: name + real(kind=REAL32), intent(in ) :: value + type(ESMF_State), intent( out) :: state + type(ScaleMapReal32), intent( out) :: map + real(kind=REAL32), allocatable, dimension(:,:), intent( out) :: f_array, t_array + integer, optional, intent( out) :: rc + + type(ESMF_Field) :: field + integer :: status + + call create_ESMF_state(state, rc=status) + @assert_that(status, is(equal_to(0))) + + call add_field(name, value, state, map, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + _RETURN(_SUCCESS) + end subroutine create_map_real32 + + subroutine add_field_real64(name, value, state, map, f_array, t_array, rc) + character(*), intent(in ) :: name + real(kind=REAL64), intent(in ) :: value + type(ESMF_State), intent(inout) :: state + type(ScaleMapReal64), intent(inout) :: map + real(kind=REAL32), allocatable, dimension(:,:), intent( out) :: f_array, t_array + integer, optional, intent( out) :: rc + + type(ESMF_Field) :: field + integer :: status + + call create_ESMF_field(name, field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_StateAdd(state, [field], rc=status) + @assert_that(status, is(equal_to(0))) + + call map%insert(name, value) + + _RETURN(_SUCCESS) + end subroutine add_field_real64 + + subroutine create_map_real64(name, value, state, map, f_array, t_array, rc) + character(*), intent(in ) :: name + real(kind=REAL64), intent(in ) :: value + type(ESMF_State), intent( out) :: state + type(ScaleMapReal64), intent( out) :: map + real(kind=REAL32), allocatable, dimension(:,:), intent( out) :: f_array, t_array + integer, optional, intent( out) :: rc + + type(ESMF_Field) :: field + integer :: status + + call create_ESMF_state(state, rc=status) + @assert_that(status, is(equal_to(0))) + + call add_field(name, value, state, map, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + _RETURN(_SUCCESS) + end subroutine create_map_real64 + + @test + subroutine test_read_scale_config_real32() + type(ESMF_Config) :: config + type(ScaleMapReal32) :: scale_map + integer :: status + + call create_config(config, rc=status) + @assert_that(status, is(equal_to(0))) + + call read_scale_config_real32(config, scale_map, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(scale_map%size(), is(equal_to(14_INT64))) + + @assert_that(scale_map%at("BCPhobic"), is(equal_to(1.e-9))) + @assert_that(scale_map%at("BCPhilic"), is(equal_to(1.e-9))) + @assert_that(scale_map%at("OCPhobic"), is(equal_to(1.e-9))) + @assert_that(scale_map%at("OCPhilic"), is(equal_to(1.e-9))) + @assert_that(scale_map%at("DU001" ), is(equal_to(1.e-9))) + @assert_that(scale_map%at("DU002" ), is(equal_to(1.e-9))) + @assert_that(scale_map%at("DU003" ), is(equal_to(1.e-9))) + @assert_that(scale_map%at("DU004" ), is(equal_to(1.e-9))) + @assert_that(scale_map%at("DU005" ), is(equal_to(1.e-9))) + @assert_that(scale_map%at("SS001" ), is(equal_to(1.e-9))) + @assert_that(scale_map%at("SS002" ), is(equal_to(1.e-9))) + @assert_that(scale_map%at("SS003" ), is(equal_to(1.e-9))) + @assert_that(scale_map%at("SS004" ), is(equal_to(1.e-9))) + @assert_that(scale_map%at("SS005" ), is(equal_to(1.e-9))) + end subroutine test_read_scale_config_real32 + + @test + subroutine test_read_scale_config_real64() + type(ESMF_Config) :: config + type(ScaleMapReal64) :: scale_map + integer :: status + + call create_config(config, rc=status) + @assert_that(status, is(equal_to(0))) + + call read_scale_config_real64(config, scale_map, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(scale_map%size(), is(equal_to(14_INT64))) + + @assert_that(scale_map%at("BCPhobic"), is(equal_to(1.d-9))) + @assert_that(scale_map%at("BCPhilic"), is(equal_to(1.d-9))) + @assert_that(scale_map%at("OCPhobic"), is(equal_to(1.d-9))) + @assert_that(scale_map%at("OCPhilic"), is(equal_to(1.d-9))) + @assert_that(scale_map%at("DU001" ), is(equal_to(1.d-9))) + @assert_that(scale_map%at("DU002" ), is(equal_to(1.d-9))) + @assert_that(scale_map%at("DU003" ), is(equal_to(1.d-9))) + @assert_that(scale_map%at("DU004" ), is(equal_to(1.d-9))) + @assert_that(scale_map%at("DU005" ), is(equal_to(1.d-9))) + @assert_that(scale_map%at("SS001" ), is(equal_to(1.d-9))) + @assert_that(scale_map%at("SS002" ), is(equal_to(1.d-9))) + @assert_that(scale_map%at("SS003" ), is(equal_to(1.d-9))) + @assert_that(scale_map%at("SS004" ), is(equal_to(1.d-9))) + @assert_that(scale_map%at("SS005" ), is(equal_to(1.d-9))) + end subroutine test_read_scale_config_real64 + + @test + subroutine test_scale_field_in_real32() + type(ESMF_State) :: state + type(ScaleMapReal32) :: map + real(kind=REAL32), allocatable, dimension(:,:) :: f_array, t_array + integer :: status + type(ESMF_Field) :: field + type(StringReal32MapIterator) :: iter + real(kind=REAL32), pointer :: ptr(:,:) + + call create_map('test_field', 2.0, state, map, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + iter = map%begin() + @assert_that(iter%key(), is(equal_to('test_field'))) + @assert_that(iter%value(), is(equal_to(2.0 ))) + + call scale_field_in_real32(state, iter, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_StateGet(state, 'test_field', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array))) + @assert_that(ptr, is(not(equal_to(t_array)))) + @assert_that(ptr, is(equal_to(t_array*(2.0)))) + end subroutine test_scale_field_in_real32 + + @test + subroutine test_scale_in_real32() + type(ESMF_State) :: state + type(ScaleMapReal32) :: map + real(kind=REAL32), allocatable, dimension(:,:) :: f_array1, t_array1 + real(kind=REAL32), allocatable, dimension(:,:) :: f_array2, t_array2 + integer :: status + type(ESMF_Field) :: field + real(kind=REAL32), pointer :: ptr(:,:) + + call create_map('test_field1', 2.0, state, map, f_array1, t_array1, rc=status) + @assert_that(status, is(equal_to(0))) + call add_field('test_field2', 3.0, state, map, f_array2, t_array2, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(map%size(), is(equal_to(2_INT64))) + + call map%scale_in(state, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_StateGet(state, 'test_field1', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array1))) + @assert_that(ptr, is(not(equal_to(t_array1)))) + @assert_that(ptr, is(equal_to(t_array1*(2.0)))) + + call ESMF_StateGet(state, 'test_field2', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array2))) + @assert_that(ptr, is(not(equal_to(t_array2)))) + @assert_that(ptr, is(equal_to(t_array2*(3.0)))) + end subroutine test_scale_in_real32 + + @test + subroutine test_scale_field_in_real64() + type(ESMF_State) :: state + type(ScaleMapReal64) :: map + real(kind=REAL32), allocatable, dimension(:,:) :: f_array, t_array + integer :: status + type(ESMF_Field) :: field + type(StringReal64MapIterator) :: iter + real(kind=REAL32), pointer :: ptr(:,:) + + call create_map('test_field', 2.d0, state, map, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + iter = map%begin() + @assert_that(iter%key(), is(equal_to('test_field'))) + @assert_that(iter%value(), is(equal_to(2.d0 ))) + + call scale_field_in_real64(state, iter, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_StateGet(state, 'test_field', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array))) + @assert_that(ptr, is(not(equal_to(t_array)))) + @assert_that(ptr, is(equal_to(t_array*(2.0)))) + end subroutine test_scale_field_in_real64 + + @test + subroutine test_scale_in_real64() + type(ESMF_State) :: state + type(ScaleMapReal64) :: map + real(kind=REAL32), allocatable, dimension(:,:) :: f_array1, t_array1 + real(kind=REAL32), allocatable, dimension(:,:) :: f_array2, t_array2 + integer :: status + type(ESMF_Field) :: field + real(kind=REAL32), pointer :: ptr(:,:) + + call create_map('test_field1', 2.d0, state, map, f_array1, t_array1, rc=status) + @assert_that(status, is(equal_to(0))) + call add_field('test_field2', 3.d0, state, map, f_array2, t_array2, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(map%size(), is(equal_to(2_INT64))) + + call map%scale_in(state, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_StateGet(state, 'test_field1', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array1))) + @assert_that(ptr, is(not(equal_to(t_array1)))) + @assert_that(ptr, is(equal_to(t_array1*(2.0)))) + + call ESMF_StateGet(state, 'test_field2', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array2))) + @assert_that(ptr, is(not(equal_to(t_array2)))) + @assert_that(ptr, is(equal_to(t_array2*(3.0)))) + end subroutine test_scale_in_real64 + + @test + subroutine test_scale_field_out_real32() + type(ESMF_State) :: state + type(ScaleMapReal32) :: map + real(kind=REAL32), allocatable, dimension(:,:) :: f_array, t_array + integer :: status + type(ESMF_Field) :: field + type(StringReal32MapIterator) :: iter + real(kind=REAL32), pointer :: ptr(:,:) + + call create_map('test_field', 2.0, state, map, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + iter = map%begin() + @assert_that(iter%key(), is(equal_to('test_field'))) + @assert_that(iter%value(), is(equal_to(2.0 ))) + + call scale_field_out_real32(state, iter, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_StateGet(state, 'test_field', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array))) + @assert_that(ptr, is(not(equal_to(t_array)))) + @assert_that(ptr, is(equal_to(t_array*(1.0/2.0)))) + end subroutine test_scale_field_out_real32 + + @test + subroutine test_scale_out_real32() + type(ESMF_State) :: state + type(ScaleMapReal32) :: map + real(kind=REAL32), allocatable, dimension(:,:) :: f_array1, t_array1 + real(kind=REAL32), allocatable, dimension(:,:) :: f_array2, t_array2 + integer :: status + type(ESMF_Field) :: field + real(kind=REAL32), pointer :: ptr(:,:) + + call create_map('test_field1', 2.0, state, map, f_array1, t_array1, rc=status) + @assert_that(status, is(equal_to(0))) + call add_field('test_field2', 3.0, state, map, f_array2, t_array2, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(map%size(), is(equal_to(2_INT64))) + + call map%scale_out(state, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_StateGet(state, 'test_field1', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array1))) + @assert_that(ptr, is(not(equal_to(t_array1)))) + @assert_that(ptr, is(equal_to(t_array1*(1.0/2.0)))) + + call ESMF_StateGet(state, 'test_field2', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array2))) + @assert_that(ptr, is(not(equal_to(t_array2)))) + @assert_that(ptr, is(equal_to(t_array2*(1.0/3.0)))) + end subroutine test_scale_out_real32 + + @test + subroutine test_scale_field_out_real64() + type(ESMF_State) :: state + type(ScaleMapReal64) :: map + real(kind=REAL32), allocatable, dimension(:,:) :: f_array, t_array + integer :: status + type(ESMF_Field) :: field + type(StringReal64MapIterator) :: iter + real(kind=REAL32), pointer :: ptr(:,:) + + call create_map('test_field', 2.d0, state, map, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + iter = map%begin() + @assert_that(iter%key(), is(equal_to('test_field'))) + @assert_that(iter%value(), is(equal_to(2.d0 ))) + + call scale_field_out_real64(state, iter, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_StateGet(state, 'test_field', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array))) + @assert_that(ptr, is(not(equal_to(t_array)))) + @assert_that(ptr, is(equal_to(t_array*(1.0/2.0)))) + end subroutine test_scale_field_out_real64 + + @test + subroutine test_scale_out_real64() + type(ESMF_State) :: state + type(ScaleMapReal64) :: map + real(kind=REAL32), allocatable, dimension(:,:) :: f_array1, t_array1 + real(kind=REAL32), allocatable, dimension(:,:) :: f_array2, t_array2 + integer :: status + type(ESMF_Field) :: field + real(kind=REAL32), pointer :: ptr(:,:) + + call create_map('test_field1', 2.d0, state, map, f_array1, t_array1, rc=status) + @assert_that(status, is(equal_to(0))) + call add_field('test_field2', 3.d0, state, map, f_array2, t_array2, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(map%size(), is(equal_to(2_INT64))) + + call map%scale_out(state, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_StateGet(state, 'test_field1', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array1))) + @assert_that(ptr, is(not(equal_to(t_array1)))) + @assert_that(ptr, is(equal_to(t_array1*(1.0/2.0)))) + + call ESMF_StateGet(state, 'test_field2', field, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(ptr, is(equal_to(f_array2))) + @assert_that(ptr, is(not(equal_to(t_array2)))) + t_array2 = t_array2*(1.d0/3.d0) + @assert_that(ptr, is(equal_to(t_array2))) + end subroutine test_scale_out_real64 +end module test_ConvertUnits_private \ No newline at end of file diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_GOCART_Tracers.rc b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_GOCART_Tracers.rc new file mode 100644 index 00000000..075496e4 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_GOCART_Tracers.rc @@ -0,0 +1,32 @@ +GOCART_tracer_config: GOCART_Tracers.yaml + +NOAA_tracer_config: default + +default.inst_tracer_mass_frac: + QV 1 + QL 2 + rain 3 + ice 4 + snow 5 + grapel 6 + O3 7 + SO2 8 + SO4 9 + DMS 10 + MSA 11 + BCPhobic 13 + BCPhilic 14 + OCPhobic 15 + OCPhilic 16 + DU001 17 + DU002 18 + DU003 19 + DU004 20 + DU005 21 + SS001 22 + SS002 23 + SS003 24 + SS004 25 + SS005 26 + CLDTT 28 +:: diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_LinearFields.pf b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_LinearFields.pf new file mode 100644 index 00000000..c142e784 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_LinearFields.pf @@ -0,0 +1,720 @@ +#include "MAPL_Generic.h" + +module test_LinearFields + use, intrinsic :: iso_fortran_env, only: REAL32, REAL64 + + use LinearFields_mod + use pFunit + use MAPL + use ESMF + use ESMF_TestCase_mod + use ESMF_TestMethod_mod + + implicit none + + interface create_ESMF_Field + module procedure create_ESMF_real32_2DField + module procedure create_ESMF_real32_3DField + module procedure create_ESMF_real64_2DField + module procedure create_ESMF_real64_3DField + end interface create_ESMF_Field +contains + subroutine create_ESMF_real32_2DField(field, f_array, t_array, rc) + type(ESMF_Field), intent(out) :: field + real(kind=REAL32), allocatable, intent(out) :: f_array(:,:), t_array(:,:) + integer, optional, intent(out) :: rc + + type(ESMF_Grid) :: grid + type(ESMF_DistGrid) :: distgrid + type(ESMF_Array) :: array + integer :: fa_shape(2) + real(kind=REAL32) :: f_array_val + integer :: status, x_dim, y_dim, i, j, field_rank + + x_dim = 4 + y_dim = 3 + + grid = ESMF_GridCreateNoPeriDim(minIndex=[1,1], maxIndex=[x_dim,y_dim], & + regDecomp=[1,1], name="grid", rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGet(grid, staggerloc=ESMF_STAGGERLOC_CENTER, & + distgrid=distgrid, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGetFieldBounds(grid=grid, localDe=0, & + staggerloc=ESMF_STAGGERLOC_CENTER, totalCount=fa_shape, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(fa_shape(1), is(equal_to(x_dim))) + @assert_that(fa_shape(2), is(equal_to(y_dim))) + + allocate(f_array(fa_shape(1), fa_shape(2))) + allocate(t_array(fa_shape(1), fa_shape(2))) + f_array_val = 1.0 + do i=1, fa_shape(1) + do j=1, fa_shape(2) + f_array(i,j) = f_array_val + f_array_val = f_array_val + 1.0 + end do + end do + t_array = f_array + + @assert_that(f_array_val, is(equal_to(fa_shape(1)*fa_shape(2) + 1.0))) + + array = ESMF_ArrayCreate(distgrid, f_array, & + indexflag=ESMF_INDEX_DELOCAL, rc=status) + @assert_that(status, is(equal_to(0))) + + field = ESMF_FieldCreate(grid=grid, array=array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, rank=field_rank, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_rank, is(equal_to(2))) + + _RETURN(_SUCCESS) + end subroutine create_ESMF_real32_2DField + + subroutine create_ESMF_real32_3DField(field, f_array, t_array, rc) + type(ESMF_Field), intent(out) :: field + real(kind=REAL32), allocatable, intent(out) :: f_array(:,:,:), t_array(:,:,:) + integer, optional, intent(out) :: rc + + type(ESMF_Grid) :: grid + type(ESMF_DistGrid) :: distgrid + type(ESMF_Array) :: array + integer :: fa_shape(3) + real(kind=REAL32) :: f_array_val + integer :: status, x_dim, y_dim, z_dim, i, j, k, field_rank + + x_dim = 4 + y_dim = 3 + z_dim = 2 + + grid = ESMF_GridCreateNoPeriDim(minIndex=[1,1,1], maxIndex=[x_dim,y_dim,z_dim], & + regDecomp=[1,1,1], name="grid", rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGet(grid, staggerloc=ESMF_STAGGERLOC_CENTER, & + distgrid=distgrid, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGetFieldBounds(grid=grid, localDe=0, & + staggerloc=ESMF_STAGGERLOC_CENTER, totalCount=fa_shape, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(fa_shape(1), is(equal_to(x_dim))) + @assert_that(fa_shape(2), is(equal_to(y_dim))) + @assert_that(fa_shape(3), is(equal_to(z_dim))) + + allocate(f_array(fa_shape(1), fa_shape(2), fa_shape(3))) + allocate(t_array(fa_shape(1), fa_shape(2), fa_shape(3))) + f_array_val = 1.0 + do i=1, fa_shape(1) + do j=1, fa_shape(2) + do k=1, fa_shape(3) + f_array(i,j,k) = f_array_val + f_array_val = f_array_val + 1.0 + end do + end do + end do + t_array = f_array + + @assert_that(f_array_val, is(equal_to(fa_shape(1)*fa_shape(2)*fa_shape(3) + 1.0))) + + array = ESMF_ArrayCreate(distgrid, f_array, & + indexflag=ESMF_INDEX_DELOCAL, rc=status) + @assert_that(status, is(equal_to(0))) + + field = ESMF_FieldCreate(grid=grid, array=array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, rank=field_rank, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_rank, is(equal_to(3))) + + _RETURN(_SUCCESS) + end subroutine create_ESMF_real32_3DField + + subroutine create_ESMF_real64_2DField(field, f_array, t_array, rc) + type(ESMF_Field), intent(out) :: field + real(kind=REAL64), allocatable, intent(out) :: f_array(:,:), t_array(:,:) + integer, optional, intent(out) :: rc + + type(ESMF_Grid) :: grid + type(ESMF_DistGrid) :: distgrid + type(ESMF_Array) :: array + integer :: fa_shape(2) + real(kind=REAL64) :: f_array_val + integer :: status, x_dim, y_dim, i, j, field_rank + + x_dim = 4 + y_dim = 3 + + grid = ESMF_GridCreateNoPeriDim(minIndex=[1,1], maxIndex=[x_dim,y_dim], & + regDecomp=[1,1], name="grid", rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGet(grid, staggerloc=ESMF_STAGGERLOC_CENTER, & + distgrid=distgrid, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGetFieldBounds(grid=grid, localDe=0, & + staggerloc=ESMF_STAGGERLOC_CENTER, totalCount=fa_shape, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(fa_shape(1), is(equal_to(x_dim))) + @assert_that(fa_shape(2), is(equal_to(y_dim))) + + allocate(f_array(fa_shape(1), fa_shape(2))) + allocate(t_array(fa_shape(1), fa_shape(2))) + f_array_val = 1.d0 + do i=1, fa_shape(1) + do j=1, fa_shape(2) + f_array(i,j) = f_array_val + f_array_val = f_array_val + 1.d0 + end do + end do + t_array = f_array + + @assert_that(f_array_val, is(equal_to(fa_shape(1)*fa_shape(2) + 1.d0))) + + array = ESMF_ArrayCreate(distgrid, f_array, & + indexflag=ESMF_INDEX_DELOCAL, rc=status) + @assert_that(status, is(equal_to(0))) + + field = ESMF_FieldCreate(grid=grid, array=array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, rank=field_rank, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_rank, is(equal_to(2))) + + _RETURN(_SUCCESS) + end subroutine create_ESMF_real64_2DField + + subroutine create_ESMF_real64_3DField(field, f_array, t_array, rc) + type(ESMF_Field), intent(out) :: field + real(kind=REAL64), allocatable, intent(out) :: f_array(:,:,:), t_array(:,:,:) + integer, optional, intent(out) :: rc + + type(ESMF_Grid) :: grid + type(ESMF_DistGrid) :: distgrid + type(ESMF_Array) :: array + integer :: fa_shape(3) + real(kind=REAL64) :: f_array_val + integer :: status, x_dim, y_dim, z_dim, i, j, k, field_rank + + x_dim = 4 + y_dim = 3 + z_dim = 2 + + grid = ESMF_GridCreateNoPeriDim(minIndex=[1,1,1], maxIndex=[x_dim,y_dim,z_dim], & + regDecomp=[1,1,1], name="grid", rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGet(grid, staggerloc=ESMF_STAGGERLOC_CENTER, & + distgrid=distgrid, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGetFieldBounds(grid=grid, localDe=0, & + staggerloc=ESMF_STAGGERLOC_CENTER, totalCount=fa_shape, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(fa_shape(1), is(equal_to(x_dim))) + @assert_that(fa_shape(2), is(equal_to(y_dim))) + @assert_that(fa_shape(3), is(equal_to(z_dim))) + + allocate(f_array(fa_shape(1), fa_shape(2), fa_shape(3))) + allocate(t_array(fa_shape(1), fa_shape(2), fa_shape(3))) + f_array_val = 1.d0 + do i=1, fa_shape(1) + do j=1, fa_shape(2) + do k=1, fa_shape(3) + f_array(i,j,k) = f_array_val + f_array_val = f_array_val + 1.d0 + end do + end do + end do + t_array = f_array + + @assert_that(f_array_val, is(equal_to(fa_shape(1)*fa_shape(2)*fa_shape(3) + 1.d0))) + + array = ESMF_ArrayCreate(distgrid, f_array, & + indexflag=ESMF_INDEX_DELOCAL, rc=status) + @assert_that(status, is(equal_to(0))) + + field = ESMF_FieldCreate(grid=grid, array=array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, rank=field_rank, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_rank, is(equal_to(3))) + + _RETURN(_SUCCESS) + end subroutine create_ESMF_real64_3DField + + @test(npes=[1,2,0],type=newESMF_TestMethod) + subroutine test_simpleMAPLcomp(this) + class(ESMF_TestMethod), intent(inout) :: this + + type(ESMF_VM) :: vm + integer :: localPet, petCount + + vm = this%getVM() + call ESMF_VMGet(vm, localPet=localPet, petCount=petCount) + end subroutine test_simpleMAPLcomp + + @test + subroutine test_scale_real32_2D_field_real32() + type(ESMF_Field) :: field + real(kind=REAL32), allocatable :: f_array(:,:), t_array(:,:) + real(kind=REAL32) :: scale_factor = 3.0 + integer :: status + + real(kind=REAL32),pointer :: array(:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call scale_field(field, scale_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array*scale_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array*scale_factor))) + end subroutine test_scale_real32_2D_field_real32 + + @test + subroutine test_scale_real32_2D_field_real64() + type(ESMF_Field) :: field + real(kind=REAL32), allocatable :: f_array(:,:), t_array(:,:) + real(kind=REAL64) :: scale_factor = 3.d0 + integer :: status + + real(kind=REAL32),pointer :: array(:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call scale_field(field, scale_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array*3.0))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array*3.0))) + end subroutine test_scale_real32_2D_field_real64 + + @test + subroutine test_scale_real32_3D_field_real32() + type(ESMF_Field) :: field + real(kind=REAL32), allocatable :: f_array(:,:,:), t_array(:,:,:) + real(kind=REAL32) :: scale_factor = 3.0 + integer :: status + + real(kind=REAL32),pointer :: array(:,:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call scale_field(field, scale_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array*scale_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array*scale_factor))) + end subroutine test_scale_real32_3D_field_real32 + + @test + subroutine test_scale_real32_3D_field_real64() + type(ESMF_Field) :: field + real(kind=REAL32), allocatable :: f_array(:,:,:), t_array(:,:,:) + real(kind=REAL64) :: scale_factor = 3.d0 + integer :: status + + real(kind=REAL32),pointer :: array(:,:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call scale_field(field, scale_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array*3.0))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array*3.0))) + end subroutine test_scale_real32_3D_field_real64 + + @test + subroutine test_scale_real64_2D_field_real32() + type(ESMF_Field) :: field + real(kind=REAL64), allocatable :: f_array(:,:), t_array(:,:) + real(kind=REAL32) :: scale_factor = 3.0 + integer :: status + + real(kind=REAL64),pointer :: array(:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call scale_field(field, scale_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array*scale_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array*scale_factor))) + end subroutine test_scale_real64_2D_field_real32 + + @test + subroutine test_scale_real64_2D_field_real64() + type(ESMF_Field) :: field + real(kind=REAL64), allocatable :: f_array(:,:), t_array(:,:) + real(kind=REAL64) :: scale_factor = 3.d0 + integer :: status + + real(kind=REAL64),pointer :: array(:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call scale_field(field, scale_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array*scale_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array*scale_factor))) + end subroutine test_scale_real64_2D_field_real64 + + @test + subroutine test_scale_real64_3D_field_real32() + type(ESMF_Field) :: field + real(kind=REAL64), allocatable :: f_array(:,:,:), t_array(:,:,:) + real(kind=REAL32) :: scale_factor = 3.0 + integer :: status + + real(kind=REAL64),pointer :: array(:,:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call scale_field(field, scale_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array*scale_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array*scale_factor))) + end subroutine test_scale_real64_3D_field_real32 + + @test + subroutine test_scale_real64_3D_field_real64() + type(ESMF_Field) :: field + real(kind=REAL64), allocatable :: f_array(:,:,:), t_array(:,:,:) + real(kind=REAL64) :: scale_factor = 3.d0 + integer :: status + + real(kind=REAL64),pointer :: array(:,:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call scale_field(field, scale_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array*scale_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array*scale_factor))) + end subroutine test_scale_real64_3D_field_real64 + + @test + subroutine test_shift_real32_2D_field_real32() + type(ESMF_Field) :: field + real(kind=REAL32), allocatable :: f_array(:,:), t_array(:,:) + real(kind=REAL32) :: shift_factor = 3.0 + integer :: status + + real(kind=REAL32),pointer :: array(:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call shift_field(field, shift_factor) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array+shift_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array+shift_factor))) + end subroutine test_shift_real32_2D_field_real32 + + @test + subroutine test_shift_real32_2D_field_real64() + type(ESMF_Field) :: field + real(kind=REAL32), allocatable :: f_array(:,:), t_array(:,:) + real(kind=REAL64) :: shift_factor = 3.d0 + integer :: status + + real(kind=REAL32),pointer :: array(:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call shift_field(field, shift_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array+3.0))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array+3.0))) + end subroutine test_shift_real32_2D_field_real64 + + @test + subroutine test_shift_real32_3D_field_real32() + type(ESMF_Field) :: field + real(kind=REAL32), allocatable :: f_array(:,:,:), t_array(:,:,:) + real(kind=REAL32) :: shift_factor = 3.0 + integer :: status + + real(kind=REAL32),pointer :: array(:,:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call shift_field(field, shift_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array+shift_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array+shift_factor))) + end subroutine test_shift_real32_3D_field_real32 + + @test + subroutine test_shift_real32_3D_field_real64() + type(ESMF_Field) :: field + real(kind=REAL32), allocatable :: f_array(:,:,:), t_array(:,:,:) + real(kind=REAL64) :: shift_factor = 3.d0 + integer :: status + + real(kind=REAL32),pointer :: array(:,:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call shift_field(field, shift_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array+3.0))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array+3.0))) + end subroutine test_shift_real32_3D_field_real64 + + @test + subroutine test_shift_real64_2D_field_real32() + type(ESMF_Field) :: field + real(kind=REAL64), allocatable :: f_array(:,:), t_array(:,:) + real(kind=REAL32) :: shift_factor = 3.0 + integer :: status + + real(kind=REAL64),pointer :: array(:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call shift_field(field, shift_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array+shift_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array+shift_factor))) + end subroutine test_shift_real64_2D_field_real32 + + @test + subroutine test_shift_real64_2D_field_real64() + type(ESMF_Field) :: field + real(kind=REAL64), allocatable :: f_array(:,:), t_array(:,:) + real(kind=REAL64) :: shift_factor = 3.d0 + integer :: status + + real(kind=REAL64),pointer :: array(:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call shift_field(field, shift_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array+shift_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array+shift_factor))) + end subroutine test_shift_real64_2D_field_real64 + + @test + subroutine test_shift_real64_3D_field_real32() + type(ESMF_Field) :: field + real(kind=REAL64), allocatable :: f_array(:,:,:), t_array(:,:,:) + real(kind=REAL32) :: shift_factor = 3.0 + integer :: status + + real(kind=REAL64),pointer :: array(:,:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call shift_field(field, shift_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array+shift_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array+shift_factor))) + end subroutine test_shift_real64_3D_field_real32 + + @test + subroutine test_shift_real64_3D_field_real64() + type(ESMF_Field) :: field + real(kind=REAL64), allocatable :: f_array(:,:,:), t_array(:,:,:) + real(kind=REAL64) :: shift_factor = 3.d0 + integer :: status + + real(kind=REAL64),pointer :: array(:,:,:) + + call create_ESMF_Field(field, f_array, t_array, rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, localDE=0, farrayPtr=array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(array, is(equal_to(t_array))) + @assert_that(array, is(equal_to(f_array))) + + call shift_field(field, shift_factor, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(f_array, is(not(equal_to(t_array)))) + @assert_that(f_array, is(equal_to(t_array+shift_factor))) + + @assert_that(array, is(equal_to(f_array))) + @assert_that(array, is(equal_to(t_array+shift_factor))) + end subroutine test_shift_real64_3D_field_real64 +end module test_LinearFields \ No newline at end of file diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_MissingFields.pf b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_MissingFields.pf new file mode 100644 index 00000000..2989b862 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_MissingFields.pf @@ -0,0 +1,194 @@ +#include "MAPL_Generic.h" + +module test_MissingFields + use, intrinsic :: iso_fortran_env, only: INT64, REAL32, REAL64 + + use MissingFields_mod + use pFUnit + use MAPL + use ESMF + use ESMF_TestCase_mod + use ESMF_TestMethod_mod + + implicit none + + integer, parameter :: x_dim = 2 + integer, parameter :: y_dim = 3 + integer, parameter :: z_dim = 4 +contains + @test + subroutine test_get_AIRDENS_real32() + real(kind=REAL32) :: PLE(x_dim,y_dim,z_dim) + real(kind=REAL32) :: T(x_dim,y_dim,z_dim) + real(kind=REAL32) :: AIRDENS(x_dim,y_dim,z_dim) + + real(kind=REAL32) :: PLE_val, T_val + integer :: i, j, k + + PLE_val = 0.0 + T_val = 0.0 + + do i=1, x_dim + do j=1, y_dim + do k=1, z_dim + PLE_val = PLE_val + 1.0 + T_val = T_val + 10.0 + + PLE(i, j, k) = PLE_val + T(i, j, k) = T_val + end do + end do + end do + @assert_that(PLE_val, is(equal_to(1.0*x_dim*y_dim*z_dim))) + @assert_that(T_val, is(equal_to(10.0*x_dim*y_dim*z_dim))) + + call get_AIRDENS(PLE, T, AIRDENS) + + do i=1, x_dim + do j=1, y_dim + do k=1, z_dim + @assert_that(AIRDENS(i,j,k), is(equal_to(PLE(i,j,k)/(MAPL_RDRY*T(i,j,k))))) + end do + end do + end do + end subroutine test_get_AIRDENS_real32 + + @test + subroutine test_get_AIRDENS_real64() + real(kind=REAL64) :: PLE(x_dim,y_dim,z_dim) + real(kind=REAL64) :: T(x_dim,y_dim,z_dim) + real(kind=REAL64) :: AIRDENS(x_dim,y_dim,z_dim) + + real(kind=REAL64) :: PLE_val, T_val + integer :: i, j, k + + PLE_val = 0.d0 + T_val = 0.d0 + + do i=1, x_dim + do j=1, y_dim + do k=1, z_dim + PLE_val = PLE_val + 1.d0 + T_val = T_val + 10.d0 + + PLE(i, j, k) = PLE_val + T(i, j, k) = T_val + end do + end do + end do + @assert_that(PLE_val, is(equal_to(1.d0*x_dim*y_dim*z_dim))) + @assert_that(T_val, is(equal_to(10.d0*x_dim*y_dim*z_dim))) + + call get_AIRDENS(PLE, T, AIRDENS) + + do i=1, x_dim + do j=1, y_dim + do k=1, z_dim + @assert_that(AIRDENS(i,j,k), is(equal_to(PLE(i,j,k)/(MAPL_RDRY*T(i,j,k))))) + end do + end do + end do + end subroutine test_get_AIRDENS_real64 + + @test + subroutine test_get_DELP_real32() + real(kind=REAL32) :: PRESS(x_dim,y_dim,z_dim) + real(kind=REAL32) :: DELP(x_dim,y_dim,z_dim-1) + + real(kind=REAL32) :: PRESS_val + integer :: i, j, k + + PRESS_val = 0.0 + + do i=1, x_dim + do j=1, y_dim + do k=1, z_dim + PRESS_val = PRESS_val + i + j + k + PRESS(i,j,k) = PRESS_val + end do + end do + end do + @assert_that(PRESS_VAL, is(equal_to(x_dim*y_dim*z_dim*(x_dim + y_dim + z_dim + 3.0)/2.0))) + + call get_DELP(PRESS, DELP) + do k=1, z_dim-1 + @assert_that(DELP(:,:,k), is(equal_to(PRESS(:,:,k+1) - PRESS(:,:,k)))) + end do + end subroutine test_get_DELP_real32 + + @test + subroutine test_get_DELP_real64() + real(kind=REAL64) :: PRESS(x_dim,y_dim,z_dim) + real(kind=REAL64) :: DELP(x_dim,y_dim,z_dim-1) + + real(kind=REAL64) :: PRESS_val + integer :: i, j, k + + PRESS_val = 0.d0 + + do i=1, x_dim + do j=1, y_dim + do k=1, z_dim + PRESS_val = PRESS_val + i + j + k + PRESS(i,j,k) = PRESS_val + end do + end do + end do + @assert_that(PRESS_VAL, is(equal_to(x_dim*y_dim*z_dim*(x_dim + y_dim + z_dim + 3.d0)/2.d0))) + + call get_DELP(PRESS, DELP) + do k=1, z_dim-1 + @assert_that(DELP(:,:,k), is(equal_to(PRESS(:,:,k+1) - PRESS(:,:,k)))) + end do + end subroutine test_get_DELP_real64 + + @test + subroutine test_get_ZLE_real32() + real(kind=REAL32) :: inst_geop_interface(x_dim,y_dim,z_dim) + real(kind=REAL32) :: ZLE(x_dim,y_dim,z_dim) + + real(kind=REAL32) :: inst_geop_interface_val + integer :: i, j, k + + inst_geop_interface_val = 0.0 + + do i=1, x_dim + do j=1, y_dim + do k=1, z_dim + inst_geop_interface_val = inst_geop_interface_val + 1.0 + + inst_geop_interface(i, j, k) = inst_geop_interface_val + end do + end do + end do + @assert_that(inst_geop_interface_val, is(equal_to(1.0*x_dim*y_dim*z_dim))) + + call get_ZLE(inst_geop_interface, ZLE) + @assert_that(ZLE, is(equal_to(inst_geop_interface/MAPL_GRAV))) + end subroutine test_get_ZLE_real32 + + @test + subroutine test_get_ZLE_real64() + real(kind=REAL64) :: inst_geop_interface(x_dim,y_dim,z_dim) + real(kind=REAL64) :: ZLE(x_dim,y_dim,z_dim) + + real(kind=REAL64) :: inst_geop_interface_val + integer :: i, j, k + + inst_geop_interface_val = 0.d0 + + do i=1, x_dim + do j=1, y_dim + do k=1, z_dim + inst_geop_interface_val = inst_geop_interface_val + 1.d0 + + inst_geop_interface(i, j, k) = inst_geop_interface_val + end do + end do + end do + @assert_that(inst_geop_interface_val, is(equal_to(1.d0*x_dim*y_dim*z_dim))) + + call get_ZLE(inst_geop_interface, ZLE) + @assert_that(ZLE, is(equal_to(inst_geop_interface/MAPL_GRAV))) + end subroutine test_get_ZLE_real64 +end module test_MissingFields diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_NOAA_GOCARTtracers.pf b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_NOAA_GOCARTtracers.pf new file mode 100644 index 00000000..eb376d2d --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_NOAA_GOCARTtracers.pf @@ -0,0 +1,270 @@ +#include "MAPL_Generic.h" + +module test_NOAA_GOCARTtracers + use, intrinsic :: iso_fortran_env, only: INT64, REAL32, REAL64 + + use NOAA_TracerMap_mod + use NOAA_GOCARTtracers_mod + use pFUnit + use MAPL + use ESMF + use ESMF_TestCase_mod + use ESMF_TestMethod_mod + + implicit none + + integer, parameter :: t_dim = 20 + integer(kind=INT64), parameter :: l_dim = 10 + character(*), parameter :: test_rc = "test_GOCART_Tracers.rc" + +contains + subroutine create_config(config, rc) + type(ESMF_Config), intent(out) :: config + integer, optional, intent(out) :: rc + + integer :: status + + config = ESMF_ConfigCreate(rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_ConfigLoadFile(config, test_rc, rc=status) + @assert_that(status, is(equal_to(0))) + + _RETURN(_SUCCESS) + end subroutine create_config + + function str(x) + character(:), allocatable :: str + integer, intent(in) :: x + + character(32) :: buffer + + write(buffer,'(g0)') x + str = trim(buffer) + end function str + + subroutine create_mass_tracers(GOCART_tracers, field, f_array, t_array, rc) + type(GOCARTtracers), intent(out) :: GOCART_tracers + type(ESMF_Field), intent(out) :: field + real(kind=REAL32), allocatable, dimension(:,:,:,:), intent(out) :: f_array,t_array + integer, optional, intent(out) :: rc + + type(ESMF_Grid) :: grid + type(ESMF_DistGrid) :: dist_grid + + real(kind=REAL32) :: f_array_val + integer, dimension(3) :: fa_shape + integer :: x_dim, y_dim, z_dim, i, j, k, l, status, field_rank + + x_dim = 4 + y_dim = 3 + z_dim = 2 + + dist_grid = ESMF_DistGridCreate(minIndex=[1,1,1], maxIndex=[x_dim,y_dim,z_dim], & + regDecomp=[1,1,1], rc=status) + @assert_that(status, is(equal_to(0))) + + grid = ESMF_GridCreate(distgrid=dist_grid, name="grid", rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGetFieldBounds(grid=grid, localDe=0, & + staggerloc=ESMF_STAGGERLOC_CENTER, totalCount=fa_shape, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(fa_shape(1), is(equal_to(x_dim))) + @assert_that(fa_shape(2), is(equal_to(y_dim))) + @assert_that(fa_shape(3), is(equal_to(z_dim))) + + allocate(f_array(fa_shape(1),fa_shape(2),fa_shape(3), t_dim)) + allocate(t_array(fa_shape(1),fa_shape(2),fa_shape(3), t_dim)) + + f_array_val = 1.0 + do i=1, fa_shape(1) + do j=1, fa_shape(2) + do k=1, fa_shape(3) + do l=1, t_dim + f_array(i,j,k,l) = f_array_val + f_array_val = f_array_val + 1.0 + end do + end do + end do + end do + + @assert_that(f_array_val, is(equal_to(fa_shape(1)*fa_shape(2)*fa_shape(3)*t_dim + 1.0))) + t_array = f_array + @assertEqual(f_array, t_array) + + field = ESMF_FieldCreate(grid, f_array, ESMF_INDEX_DELOCAL, & + ungriddedLBound=[1], ungriddedUbound=[t_dim], rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, rank=field_rank, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_rank, is(equal_to(4))) + + do i=1, t_dim + call GOCART_tracers%tracer_map%insert("tracer"//str(i), i) + if (i <= l_dim) call GOCART_tracers%push_back("tracer"//str(i)) + end do + + _RETURN(_SUCCESS) + end subroutine create_mass_tracers + + subroutine check_tracer(field, tracer, tracer_name, f_array, t_array, idx) + type(ESMF_Field), intent(in) :: field, tracer + character(*), intent(in) :: tracer_name + real(kind=REAL32), dimension(:,:,:,:), intent(in) :: f_array, t_array + integer, intent(in) :: idx + + type(ESMF_Grid) :: field_grid, tracer_grid + real(kind=REAL32), pointer :: tracer_array(:,:,:) + character(len=ESMF_MaxStr) :: name + integer :: status + + call ESMF_FieldGet(field, grid=field_grid, rc=status) + @assert_that(status, is(equal_to(0))) + call ESMF_FieldGet(tracer, grid=tracer_grid, name=name, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_grid == tracer_grid, is(true())) + @assert_that(tracer_name, is(equal_to(trim(name)))) + + call ESMF_FieldGet(tracer, localDE=0, farrayPtr=tracer_array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(tracer_array, is(equal_to(f_array(:,:,:,idx)))) + @assert_that(tracer_array, is(equal_to(t_array(:,:,:,idx)))) + end subroutine check_tracer + + subroutine check_tracer_bundle(GOCART_tracers, bundle, field, f_array, t_array, idx) + type(GOCARTtracers), intent(in) :: GOCART_tracers + type(ESMF_FieldBundle), intent(in) :: bundle + type(ESMF_Field), intent(in) :: field + real(kind=REAL32), dimension(:,:,:,:), intent(in) :: f_array, t_array + integer, intent(in) :: idx + + type(ESMF_Field) :: tracer + character(:), allocatable :: name + integer :: status + + name = GOCART_tracers%at(idx) + + call ESMF_FieldBundleGet(bundle, fieldName=name, field=tracer, rc=status) + @assert_that(status, is(equal_to(0))) + + call check_tracer(field, tracer, name, f_array, t_array, idx) + end subroutine check_tracer_bundle + + @test + subroutine test_read_file_name_from_config() + type(GOCARTtracers) :: GOCART_tracers + type(ESMF_Config) :: config + + character(:), allocatable :: filename + integer :: rc + + call create_config(config, rc) + @assert_that(rc, is(equal_to(0))) + + call GOCART_tracers%read_filename_from_config(config, filename, rc) + @assert_that(rc, is(equal_to(0))) + @assert_that(filename, is(equal_to('GOCART_Tracers.yaml'))) + end subroutine test_read_file_name_from_config + + @test + subroutine test_parse_yaml() + type(GOCARTtracers) :: GOCART_tracers + + @assert_that(GOCART_tracers%size(), is(equal_to(0_INT64))) + @assert_that(GOCART_tracers%tracer_map%size(), is(equal_to(0_INT64))) + call GOCART_tracers%parse_yaml('GOCART_Tracers.yaml') + @assert_that(GOCART_tracers%size(), is(equal_to(28_INT64))) + @assert_that(GOCART_tracers%tracer_map%size(), is(equal_to(28_INT64))) + + @assert_that(GOCART_tracers%at( 1), is(equal_to('sphum'))) + @assert_that(GOCART_tracers%at( 2), is(equal_to('liq_wat'))) + @assert_that(GOCART_tracers%at( 3), is(equal_to('rainwat'))) + @assert_that(GOCART_tracers%at( 4), is(equal_to('ice_wat'))) + @assert_that(GOCART_tracers%at( 5), is(equal_to('snowwat'))) + @assert_that(GOCART_tracers%at( 6), is(equal_to('graupel'))) + @assert_that(GOCART_tracers%at( 7), is(equal_to('o3mr'))) + @assert_that(GOCART_tracers%at( 8), is(equal_to('so2'))) + @assert_that(GOCART_tracers%at( 9), is(equal_to('sulf'))) + @assert_that(GOCART_tracers%at(10), is(equal_to('DMS'))) + @assert_that(GOCART_tracers%at(11), is(equal_to('msa'))) + @assert_that(GOCART_tracers%at(12), is(equal_to('pp25'))) + @assert_that(GOCART_tracers%at(13), is(equal_to('bc1'))) + @assert_that(GOCART_tracers%at(14), is(equal_to('bc2'))) + @assert_that(GOCART_tracers%at(15), is(equal_to('oc1'))) + @assert_that(GOCART_tracers%at(16), is(equal_to('oc2'))) + @assert_that(GOCART_tracers%at(17), is(equal_to('dust1'))) + @assert_that(GOCART_tracers%at(18), is(equal_to('dust2'))) + @assert_that(GOCART_tracers%at(19), is(equal_to('dust3'))) + @assert_that(GOCART_tracers%at(20), is(equal_to('dust4'))) + @assert_that(GOCART_tracers%at(21), is(equal_to('dust5'))) + @assert_that(GOCART_tracers%at(22), is(equal_to('seas1'))) + @assert_that(GOCART_tracers%at(23), is(equal_to('seas2'))) + @assert_that(GOCART_tracers%at(24), is(equal_to('seas3'))) + @assert_that(GOCART_tracers%at(25), is(equal_to('seas4'))) + @assert_that(GOCART_tracers%at(26), is(equal_to('seas5'))) + @assert_that(GOCART_tracers%at(27), is(equal_to('pp10'))) + @assert_that(GOCART_tracers%at(28), is(equal_to('cld_amt'))) + end subroutine test_parse_yaml + + @test + subroutine test_initialize() + type(GOCARTtracers) :: GOCART_tracers + type(ESMF_Config) :: config + + integer :: rc + + call create_config(config, rc) + @assert_that(rc, is(equal_to(0))) + + @assert_that(GOCART_tracers%size(), is(equal_to(0_INT64))) + @assert_that(GOCART_tracers%tracer_map%size(), is(equal_to(0_INT64))) + call GOCART_tracers%initialize(config, rc) + @assert_that(rc, is(equal_to(0))) + @assert_that(GOCART_tracers%size(), is(equal_to(28_INT64))) + @assert_that(GOCART_tracers%tracer_map%size(), is(equal_to(28_INT64))) + end subroutine test_initialize + + @test + subroutine test_create_tracer_bundle() + type(GOCARTtracers) :: GOCART_tracers + type(ESMF_Field) :: field + type(ESMF_FieldBundle) :: bundle + real(kind=REAL32), allocatable, dimension(:,:,:,:) :: f_array, t_array + + character(len=ESMF_MaxStr) :: name + integer :: rc, field_count, i + + call create_mass_tracers(GOCART_tracers, field, f_array, t_array, rc) + @assert_that(rc, is(equal_to(0))) + + @assert_that(GOCART_tracers%size(), is(equal_to(l_dim))) + + call GOCART_tracers%create_tracer_bundle(field, bundle, rc) + @assert_that(rc, is(equal_to(0))) + + call ESMF_FieldBundleGet(bundle, name=name, fieldCount=field_count, rc=rc) + @assert_that(rc, is(equal_to(0))) + +! @assert_that(trim(name), is(equal_to('inst_mass_tracers'))) + @assert_that(trim(name) == 'inst_mass_tracers', is(true())) + + @assert_that(field_count == GOCART_tracers%size(), is(true())) + do i=1, field_count + call check_tracer_bundle(GOCART_tracers, bundle, field, f_array, t_array, i) + end do + end subroutine test_create_tracer_bundle +! +! @test +! subroutine test_reproducer() +! character(len=100) :: name +! +! name = 'test' +! @assert_that(trim(name), is(equal_to(name))) +! end subroutine test_reproducer +end module test_NOAA_GOCARTtracers diff --git a/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_NOAA_TracerMap.pf b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_NOAA_TracerMap.pf new file mode 100644 index 00000000..57786d90 --- /dev/null +++ b/ESMF/Aerosol_GridComp/AeroCinderella_GridComp/Cinderella/tests/test_NOAA_TracerMap.pf @@ -0,0 +1,401 @@ +#include "MAPL_Generic.h" + +module test_NOAA_TracerMap + use, intrinsic :: iso_fortran_env, only: INT64, REAL32, REAL64 + + use NOAA_TracerMap_mod + use pFUnit + use MAPL + use ESMF + use ESMF_TestCase_mod + use ESMF_TestMethod_mod + + implicit none + + interface create_mass_tracers + module procedure create_mass_tracers_real32 + module procedure create_mass_tracers_real64 + end interface create_mass_tracers + + interface check_tracer + module procedure check_tracer_real32 + module procedure check_tracer_real64 + end interface check_tracer + + integer, parameter :: t_dim = 28 + + character(len=*), parameter :: filename = 'field_table' + + character(len=*), parameter :: test_tracer_line = ' "TRACER", "atmos_mod", "sphum"' + character(len=*), parameter :: test_tracer_with_quotes = ', "sphum"' + character(len=*), parameter :: test_tracer_without_first_quote = 'sphum"' + character(len=*), parameter :: test_tracer_without_second_quote = 'sphum' + + character(len=*), parameter :: test_false_line_0 = ' "longname", "specific humidity"' + character(len=*), parameter :: test_false_line_1 = ' "units", "kg/kg"' + character(len=*), parameter :: test_false_line_2 = ' "profile_type", "fixed", "surface_value=1.e30" /' + character(len=*), parameter :: test_false_line_3 = '# specific humidity for moist runs' +contains + function str(x) + character(:), allocatable :: str + integer, intent(in) :: x + + character(32) :: buffer + + write(buffer,'(g0)') x + str = trim(buffer) + end function str + + subroutine create_mass_tracers_real32(tracer_map, field, f_array, t_array, rc) + type(TracerMap), intent(out) :: tracer_map + type(ESMF_Field), intent(out) :: field + real(kind=REAL32), allocatable, dimension(:,:,:,:), intent(out) :: f_array,t_array + integer, optional, intent(out) :: rc + + type(ESMF_Grid) :: grid + type(ESMF_DistGrid) :: dist_grid + + real(kind=REAL32) :: f_array_val + integer, dimension(3) :: fa_shape + integer :: x_dim, y_dim, z_dim, i, j, k, l, status, field_rank + + x_dim = 4 + y_dim = 3 + z_dim = 2 + + dist_grid = ESMF_DistGridCreate(minIndex=[1,1,1], maxIndex=[x_dim,y_dim,z_dim], & + regDecomp=[1,1,1], rc=status) + @assert_that(status, is(equal_to(0))) + + grid = ESMF_GridCreate(distgrid=dist_grid, name="grid", rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGetFieldBounds(grid=grid, localDe=0, & + staggerloc=ESMF_STAGGERLOC_CENTER, totalCount=fa_shape, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(fa_shape(1), is(equal_to(x_dim))) + @assert_that(fa_shape(2), is(equal_to(y_dim))) + @assert_that(fa_shape(3), is(equal_to(z_dim))) + + allocate(f_array(fa_shape(1),fa_shape(2),fa_shape(3), t_dim)) + allocate(t_array(fa_shape(1),fa_shape(2),fa_shape(3), t_dim)) + + f_array_val = 1.0 + do i=1, fa_shape(1) + do j=1, fa_shape(2) + do k=1, fa_shape(3) + do l=1, t_dim + f_array(i,j,k,l) = f_array_val + f_array_val = f_array_val + 1.0 + end do + end do + end do + end do + + @assert_that(f_array_val, is(equal_to(fa_shape(1)*fa_shape(2)*fa_shape(3)*t_dim + 1.0))) + t_array = f_array + @assertEqual(f_array, t_array) + + field = ESMF_FieldCreate(grid, f_array, ESMF_INDEX_DELOCAL, & + ungriddedLBound=[1], ungriddedUbound=[t_dim], rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, rank=field_rank, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_rank, is(equal_to(4))) + + do i=1, t_dim + call tracer_map%insert("tracer"//str(i), i) + end do + + _RETURN(_SUCCESS) + end subroutine create_mass_tracers_real32 + + subroutine create_mass_tracers_real64(tracer_map, field, f_array, t_array, rc) + type(TracerMap), intent(out) :: tracer_map + type(ESMF_Field), intent(out) :: field + real(kind=REAL64), allocatable, dimension(:,:,:,:), intent(out) :: f_array,t_array + integer, optional, intent(out) :: rc + + type(ESMF_Grid) :: grid + type(ESMF_DistGrid) :: dist_grid + + real(kind=REAL64) :: f_array_val + integer, dimension(3) :: fa_shape + integer :: x_dim, y_dim, z_dim, i, j, k, l, status, field_rank + + x_dim = 4 + y_dim = 3 + z_dim = 2 + + dist_grid = ESMF_DistGridCreate(minIndex=[1,1,1], maxIndex=[x_dim,y_dim,z_dim], & + regDecomp=[1,1,1], rc=status) + @assert_that(status, is(equal_to(0))) + + grid = ESMF_GridCreate(distgrid=dist_grid, name="grid", rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_GridGetFieldBounds(grid=grid, localDe=0, & + staggerloc=ESMF_STAGGERLOC_CENTER, totalCount=fa_shape, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(fa_shape(1), is(equal_to(x_dim))) + @assert_that(fa_shape(2), is(equal_to(y_dim))) + @assert_that(fa_shape(3), is(equal_to(z_dim))) + + allocate(f_array(fa_shape(1),fa_shape(2),fa_shape(3), t_dim)) + allocate(t_array(fa_shape(1),fa_shape(2),fa_shape(3), t_dim)) + + f_array_val = 1.d0 + do i=1, fa_shape(1) + do j=1, fa_shape(2) + do k=1, fa_shape(3) + do l=1, t_dim + f_array(i,j,k,l) = f_array_val + f_array_val = f_array_val + 1.d0 + end do + end do + end do + end do + + @assert_that(f_array_val, is(equal_to(fa_shape(1)*fa_shape(2)*fa_shape(3)*t_dim + 1.d0))) + t_array = f_array + @assertEqual(f_array, t_array) + + field = ESMF_FieldCreate(grid, f_array, ESMF_INDEX_DELOCAL, & + ungriddedLBound=[1], ungriddedUbound=[t_dim], rc=status) + @assert_that(status, is(equal_to(0))) + + call ESMF_FieldGet(field, rank=field_rank, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_rank, is(equal_to(4))) + + do i=1, t_dim + call tracer_map%insert("tracer"//str(i), i) + end do + + _RETURN(_SUCCESS) + end subroutine create_mass_tracers_real64 + + subroutine check_tracer_real32(field, tracer, tracer_name, f_array, t_array, idx) + type(ESMF_Field), intent(in) :: field, tracer + character(*), intent(in) :: tracer_name + real(kind=REAL32), dimension(:,:,:,:), intent(in) :: f_array, t_array + integer, intent(in) :: idx + + type(ESMF_Grid) :: field_grid, tracer_grid + real(kind=REAL32), pointer :: tracer_array(:,:,:) + character(len=ESMF_MaxStr) :: name + integer :: status + + call ESMF_FieldGet(field, grid=field_grid, rc=status) + @assert_that(status, is(equal_to(0))) + call ESMF_FieldGet(tracer, grid=tracer_grid, name=name, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_grid == tracer_grid, is(true())) + @assert_that(tracer_name, is(equal_to(trim(name)))) + + call ESMF_FieldGet(tracer, localDE=0, farrayPtr=tracer_array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(tracer_array, is(equal_to(f_array(:,:,:,idx)))) + @assert_that(tracer_array, is(equal_to(t_array(:,:,:,idx)))) + end subroutine check_tracer_real32 + + subroutine check_tracer_real64(field, tracer, tracer_name, f_array, t_array, idx) + type(ESMF_Field), intent(in) :: field, tracer + character(*), intent(in) :: tracer_name + real(kind=REAL64), dimension(:,:,:,:), intent(in) :: f_array, t_array + integer, intent(in) :: idx + + type(ESMF_Grid) :: field_grid, tracer_grid + real(kind=REAL64), pointer :: tracer_array(:,:,:) + character(len=ESMF_MaxStr) :: name + integer :: status + + call ESMF_FieldGet(field, grid=field_grid, rc=status) + @assert_that(status, is(equal_to(0))) + call ESMF_FieldGet(tracer, grid=tracer_grid, name=name, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(field_grid == tracer_grid, is(true())) + @assert_that(tracer_name, is(equal_to(trim(name)))) + + call ESMF_FieldGet(tracer, localDE=0, farrayPtr=tracer_array, rc=status) + @assert_that(status, is(equal_to(0))) + + @assert_that(tracer_array, is(equal_to(f_array(:,:,:,idx)))) + @assert_that(tracer_array, is(equal_to(t_array(:,:,:,idx)))) + end subroutine check_tracer_real64 + + @test + subroutine test_read_tracer_name() + type(TracerMap) :: tracer_map + + @assert_that(tracer_map%read_tracer_name(test_tracer_line), is(equal_to(test_tracer_with_quotes))) + end subroutine test_read_tracer_name + + @test + subroutine test_remove_first_quote() + type(TracerMap) :: tracer_map + + @assert_that(tracer_map%remove_first_quote(test_tracer_with_quotes), is(equal_to(test_tracer_without_first_quote))) + + @assert_that(tracer_map%remove_first_quote(tracer_map%read_tracer_name(test_tracer_line)), is(equal_to(test_tracer_without_first_quote))) + end subroutine test_remove_first_quote + + @test + subroutine test_remove_second_quote() + type(TracerMap) :: tracer_map + + @assert_that(tracer_map%remove_second_quote(test_tracer_without_first_quote), is(equal_to(test_tracer_without_second_quote))) + + @assert_that(tracer_map%remove_second_quote(tracer_map%remove_first_quote(tracer_map%read_tracer_name(test_tracer_line))), is(equal_to(test_tracer_without_second_quote))) + end subroutine test_remove_second_quote + + @test + subroutine test_read_field_table_line() + type(TracerMap) :: tracer_map + integer :: tracer_index + + tracer_index = 1 + call tracer_map%read_field_table_line(test_tracer_line, tracer_index) + @assert_that(tracer_index, is(equal_to(2))) + @assert_that(tracer_map%size(), is(equal_to(1_INT64))) + @assert_that(tracer_map%count(test_tracer_without_second_quote) > 0, is(true())) + @assert_that(tracer_map%at(test_tracer_without_second_quote), is(equal_to(2))) + + call tracer_map%read_field_table_line(test_false_line_0, tracer_index) + @assert_that(tracer_index, is(equal_to(2))) + @assert_that(tracer_map%size(), is(equal_to(1_INT64))) + + call tracer_map%read_field_table_line(test_false_line_1, tracer_index) + @assert_that(tracer_index, is(equal_to(2))) + @assert_that(tracer_map%size(), is(equal_to(1_INT64))) + + call tracer_map%read_field_table_line(test_false_line_2, tracer_index) + @assert_that(tracer_index, is(equal_to(2))) + @assert_that(tracer_map%size(), is(equal_to(1_INT64))) + + call tracer_map%read_field_table_line(test_false_line_3, tracer_index) + @assert_that(tracer_index, is(equal_to(2))) + @assert_that(tracer_map%size(), is(equal_to(1_INT64))) + end subroutine test_read_field_table_line + + @test + subroutine test_read_field_table() + type(TracerMap) :: tracer_map + integer :: rc + + call tracer_map%read_field_table(filename) + @assert_that(tracer_map%size(), is(equal_to(28_INT64))) + + @assert_that(tracer_map%count('sphum') > 0, is(true())) + @assert_that(tracer_map%count('liq_wat') > 0, is(true())) + @assert_that(tracer_map%count('rainwat') > 0, is(true())) + @assert_that(tracer_map%count('ice_wat') > 0, is(true())) + @assert_that(tracer_map%count('snowwat') > 0, is(true())) + @assert_that(tracer_map%count('graupel') > 0, is(true())) + @assert_that(tracer_map%count('o3mr') > 0, is(true())) + @assert_that(tracer_map%count('so2') > 0, is(true())) + @assert_that(tracer_map%count('sulf') > 0, is(true())) + @assert_that(tracer_map%count('DMS') > 0, is(true())) + @assert_that(tracer_map%count('msa') > 0, is(true())) + @assert_that(tracer_map%count('pp25') > 0, is(true())) + @assert_that(tracer_map%count('bc1') > 0, is(true())) + @assert_that(tracer_map%count('bc2') > 0, is(true())) + @assert_that(tracer_map%count('oc1') > 0, is(true())) + @assert_that(tracer_map%count('oc2') > 0, is(true())) + @assert_that(tracer_map%count('dust1') > 0, is(true())) + @assert_that(tracer_map%count('dust2') > 0, is(true())) + @assert_that(tracer_map%count('dust3') > 0, is(true())) + @assert_that(tracer_map%count('dust4') > 0, is(true())) + @assert_that(tracer_map%count('dust5') > 0, is(true())) + @assert_that(tracer_map%count('seas1') > 0, is(true())) + @assert_that(tracer_map%count('seas2') > 0, is(true())) + @assert_that(tracer_map%count('seas3') > 0, is(true())) + @assert_that(tracer_map%count('seas4') > 0, is(true())) + @assert_that(tracer_map%count('seas5') > 0, is(true())) + @assert_that(tracer_map%count('pp10') > 0, is(true())) + @assert_that(tracer_map%count('cld_amt') > 0, is(true())) + + @assert_that(tracer_map%at('sphum'), is(equal_to( 1))) + @assert_that(tracer_map%at('liq_wat'), is(equal_to( 2))) + @assert_that(tracer_map%at('rainwat'), is(equal_to( 3))) + @assert_that(tracer_map%at('ice_wat'), is(equal_to( 4))) + @assert_that(tracer_map%at('snowwat'), is(equal_to( 5))) + @assert_that(tracer_map%at('graupel'), is(equal_to( 6))) + @assert_that(tracer_map%at('o3mr'), is(equal_to( 7))) + @assert_that(tracer_map%at('so2'), is(equal_to( 8))) + @assert_that(tracer_map%at('sulf'), is(equal_to( 9))) + @assert_that(tracer_map%at('DMS'), is(equal_to(10))) + @assert_that(tracer_map%at('msa'), is(equal_to(11))) + @assert_that(tracer_map%at('pp25'), is(equal_to(12))) + @assert_that(tracer_map%at('bc1'), is(equal_to(13))) + @assert_that(tracer_map%at('bc2'), is(equal_to(14))) + @assert_that(tracer_map%at('oc1'), is(equal_to(15))) + @assert_that(tracer_map%at('oc2'), is(equal_to(16))) + @assert_that(tracer_map%at('dust1'), is(equal_to(17))) + @assert_that(tracer_map%at('dust2'), is(equal_to(18))) + @assert_that(tracer_map%at('dust3'), is(equal_to(19))) + @assert_that(tracer_map%at('dust4'), is(equal_to(20))) + @assert_that(tracer_map%at('dust5'), is(equal_to(21))) + @assert_that(tracer_map%at('seas1'), is(equal_to(22))) + @assert_that(tracer_map%at('seas2'), is(equal_to(23))) + @assert_that(tracer_map%at('seas3'), is(equal_to(24))) + @assert_that(tracer_map%at('seas4'), is(equal_to(25))) + @assert_that(tracer_map%at('seas5'), is(equal_to(26))) + @assert_that(tracer_map%at('pp10'), is(equal_to(27))) + @assert_that(tracer_map%at('cld_amt'), is(equal_to(28))) + end subroutine test_read_field_table + + @test + subroutine test_create_tracer_real32() + type(TracerMap) :: tracer_map + type(ESMF_Field) :: field, tracer + real(kind=REAL32), allocatable, dimension(:,:,:,:) :: f_array, t_array + + character(:), allocatable :: name + integer :: i, rc + + call create_mass_tracers(tracer_map, field, f_array, t_array, rc) + @assert_that(rc, is(equal_to(0))) + + do i=1, t_dim + name = 'tracer'//str(i) + @assert_that(tracer_map%count(name) > 0, is(true())) + @assert_that(tracer_map%at(name), is(equal_to(i))) + + call tracer_map%create_tracer(field, name, tracer, rc) + @assert_that(rc, is(equal_to(0))) + call check_tracer(field, tracer, name, f_array, t_array, i) + end do + end subroutine test_create_tracer_real32 + + @test + subroutine test_create_tracer_real64() + type(TracerMap) :: tracer_map + type(ESMF_Field) :: field, tracer + real(kind=REAL64), allocatable, dimension(:,:,:,:) :: f_array, t_array + + character(:), allocatable :: name + integer :: i, rc + + call create_mass_tracers(tracer_map, field, f_array, t_array, rc) + @assert_that(rc, is(equal_to(0))) + + do i=1, t_dim + name = 'tracer'//str(i) + @assert_that(tracer_map%count(name) > 0, is(true())) + @assert_that(tracer_map%at(name), is(equal_to(i))) + + call tracer_map%create_tracer(field, name, tracer, rc) + @assert_that(rc, is(equal_to(0))) + call check_tracer(field, tracer, name, f_array, t_array, i) + end do + end subroutine test_create_tracer_real64 +end module test_NOAA_TracerMap diff --git a/ESMF/Aerosol_GridComp/Aerosol_GridComp.F90 b/ESMF/Aerosol_GridComp/Aerosol_GridComp.F90 new file mode 100644 index 00000000..1771b352 --- /dev/null +++ b/ESMF/Aerosol_GridComp/Aerosol_GridComp.F90 @@ -0,0 +1,166 @@ +#include "MAPL_Generic.h" + +module Aerosol_GridComp_mod + use ESMF + use MAPL + + implicit none + private + + public SetServices + + type Aerosol_GridCompState + integer :: nbins + end type Aerosol_GridCompState + + type :: Aerosol_GridCompState_Wrapper + type(Aerosol_GridCompState), pointer :: ptr => null() + end type Aerosol_GridCompState_Wrapper + + character(*), parameter :: internal_name = "Aerosol_GridCompState" + +contains + subroutine SetServices(gc, rc) + type(ESMF_GridComp), intent(inout) :: gc + integer, intent( out) :: rc + + type(Aerosol_GridCompState_Wrapper) :: wrap + type(Aerosol_GridCompState), pointer :: self + + character(len=ESMF_MAXSTR) :: comp_name + + __Iam__('SetServices') + + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + allocate(self, __STAT__) + wrap%ptr => self + + call MAPL_GridCompSetEntryPoint(gc, ESMF_METHOD_INITIALIZE, Initialize, __RC__) + call MAPL_GridCompSetEntryPoint(gc, ESMF_METHOD_RUN, Run, __RC__) + + call ESMF_UserCompSetInternalState(gc, internal_name, wrap, status) + VERIFY_(status) + + ! declare imports and exports based on StateSpecs.rc tables +#include "Aerosol_Internal___.h" +#include "Aerosol_Export___.h" +#include "Aerosol_Import___.h" + + call MAPL_GenericSetServices(gc, __RC__) + + _RETURN(_SUCCESS) + end subroutine SetServices + + subroutine Initialize(gc, import, export, clock, rc) + type(ESMF_GridComp), intent(inout) :: gc + type(ESMF_State), intent(inout) :: import + type(ESMF_State), intent(inout) :: export + type(ESMF_Clock), intent(inout) :: clock + integer, optional, intent( out) :: rc + + character(len=ESMF_MAXSTR) :: comp_name + + type(Aerosol_GridCompState_Wrapper) :: wrap + type(Aerosol_GridCompState), pointer :: self + type(MAPL_MetaComp), pointer :: MAPL + + __Iam__('Initialize') + + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + call MAPL_GetObjectFromgc(gc, MAPL, __RC__) + + call ESMF_UserCompGetInternalState(gc, internal_name, wrap, status) + VERIFY_(status) + self => wrap%ptr + + call MAPL_GridCreate(gc, __RC__) + + call MAPL_GenericInitialize(gc, import, export, clock, __RC__) + + ! Temporary measure + call ForceAllocation(export, __RC__) + + _RETURN(_SUCCESS) + end subroutine Initialize + + subroutine Run(gc, import, export, clock, rc) + type(ESMF_GridComp), intent(inout) :: gc + type(ESMF_State), intent(inout) :: import + type(ESMF_State), intent(inout) :: export + type(ESMF_Clock), intent(inout) :: clock + integer, optional, intent( out) :: rc + + character(len=ESMF_MAXSTR) :: comp_name + + type(ESMF_State) :: internal + type(MAPL_MetaComp), pointer :: MAPL + + ! declare pointers to Aerosol_StateSpecs table entries +#include "Aerosol_DeclarePointer___.h" + + __Iam__('Run') + + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + call MAPL_GetObjectFromGc(gc, MAPL, __RC__) + call MAPL_Get(mapl, internal_ESMF_State=internal, __RC__) + + ! Get/set field information from MAPL for fields in Aerosol_StateSpecs table entries +#include "Aerosol_GetPointer___.h" + + !!! Do run step + + ZLE = ZLE + 1.0 + print*, "The value ZLE is set to is:", minval(ZLE), maxval(ZLE) + + _RETURN(_SUCCESS) + end subroutine Run + + subroutine ForceAllocation(state, rc) + type(ESMF_State), intent(inout) :: state + integer, optional, intent( out) :: rc + + integer :: itemCount, i, dims + character(len=ESMF_MAXSTR), allocatable :: itemNameList(:) + type(ESMF_StateItem_FLAG), allocatable :: itemTypeList(:) + + type(ESMF_Field) :: field + real, pointer :: ptr2d(:,:), ptr3d(:,:,:) + + __Iam__('ForceAllocation') + + call ESMF_StateGet(state, itemCount=itemCount, __RC__) + allocate(itemNameList(itemCount), stat=status) + VERIFY_(status) + allocate(itemTypeList(itemCount), stat=status) + VERIFY_(status) + + call ESMF_StateGet(state, itemNameList=itemNameList, & + itemTypeList=itemTypeList, __RC__) + + if (itemCount /= 0) then + do i=1, itemCount + if (itemTypeList(i) == ESMF_STATEITEM_FIELD) then + call ESMF_StateGet(state, trim(itemNameList(i)), field, __RC__) + call ESMF_AttributeGet(field, name='DIMS', value=dims, __RC__) + if (dims == MAPL_DimsHorzOnly) then + call MAPL_GetPointer(state, ptr2d, trim(itemNameList(i)), & + alloc=.true., __RC__) + else if (dims == MAPL_DimsHorzVert) then + call MAPL_GetPointer(state, ptr3d, trim(itemNameList(i)), & + alloc=.true., __RC__) + else + _ASSERT((1 == 2), "invalid field for test defined") + end if + end if + end do + end if + + _RETURN(_SUCCESS) + end subroutine ForceAllocation +end module Aerosol_GridComp_mod diff --git a/ESMF/Aerosol_GridComp/Aerosol_StateSpecs.rc b/ESMF/Aerosol_GridComp/Aerosol_StateSpecs.rc new file mode 100644 index 00000000..208337cf --- /dev/null +++ b/ESMF/Aerosol_GridComp/Aerosol_StateSpecs.rc @@ -0,0 +1,108 @@ +schema_version: 2.0.0 +component: Aerosol + +category: IMPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS| Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC| COND | LONG NAME +#---------------------------------------------------------------------------------------- +#inst_geop_interface | m2 s-2 | xyz | E | | inst_geop_interface +#DU_SRC | 1 | xy | N | | erod +#FRLAKE | 1 | xy | N | | fraction_of_lake +#WET1 | 1 | xy | N | | surface_soil_wetness +#LWI | 1 | xy | N | | land-ocean-ice_mask +#U10M | m s-1 | xy | N | | 10-meter_eastward_wind +#V10M | m s-1 | xy | N | | 10-meter_northward_wind +#AREA | m^2 | xy | N | | agrid_cell_area +#USTAR | m s-1 | xy | N | | equivalent_neutral_10-meter_northward_wind +#CN_PRCP |kg/m^2/s| xy | N | | surface_conv._rain_flux_needed_by_land +#NCN_PRCP |kg/m^2/s| xy | N | | Non-convective precipitation +#ZPBL | m | xy | N | | planetary_boundary_layer_height +#SH | w m-2 | xy | N | | sensible_heat_flux_from_turbulence +#Z0H | m | xy | N | | surface_roughness_for_heat +#........................................................................................ +#AIRDENS | kg/m^3 | xyz | C | | moist_air_density +#DELP | Pa | xyz | C | | pressure_thickness +#RH2 | 1 | xyz | C | | Rel_Hum_after_moist +#T | K | xyz | C | | air_temperature +#ZLE | m | xyz | E | | geopotential_height +#PLE | Pa | xyz | E | | air_pressure +#PFL_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_liquid_nonconvective_precipitation +#PFI_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_ice_nonconvective_precipitation +#U | m s-1 | xyz | C | | eastward_wind +#V | m s-1 | xyz | C | | northward_wind + +category: EXPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS| VLOC| UNGRIDDED | LONG_NAME +#---------------------------------------------------------------------------------------- +ZLE | m | xyz | E | | Geopotential Height +#DUMASS | kg kg-1 | xyz | C | | Dust Mass Mixing Ratio __ENSEMBLE__ +#DUMASS25 | kg kg-1 | xyz | C | | Dust Mass Mixing Ratio __ENSEMBLE__ +#DUCONC | kg m-3 | xyz | C | | Dust Mass Concentration __ENSEMBLE__ +#DUEXTCOEF | m-1 | xyz | C | | Dust Extinction Coefficient [550 nm] __ENSEMBLE__ +#DUSCACOEF | m-1 | xyz | C | | Dust Scattering Coefficient [550 nm] __ENSEMBLE__ +#........................................................................................ +#DUSMASS | kg m-3 | xy | N | | Dust Surface Mass Concentration __ENSEMBLE__ +#DUCMASS | kg m-2 | xy | N | | Dust Column Mass Density __ENSEMBLE__ +#DUEXTTAU | 1 | xy | N | | Dust Extinction AOT [550 nm] __ENSEMBLE__ +#DUSCATAU | 1 | xy | N | | Dust Scattering AOT [550 nm] __ENSEMBLE__ +#DUSMASS25 | kg m-3 | xy | N | | Dust Surface Mass Concentration - PM 2.5 __ENSEMBLE__ +#DUCMASS25 | kg m-2 | xy | N | | Dust Column Mass Density - PM 2.5 __ENSEMBLE__ +#DUEXTT25 | 1 | xy | N | | Dust Extinction AOT [550 nm] - PM 2.5 __ENSEMBLE__ +#DUSCAT25 | 1 | xy | N | | Dust Scattering AOT [550 nm] - PM 2.5 __ENSEMBLE__ +#DUAERIDX | 1 | xy | N | | Dust TOMS UV Aerosol Index __ENSEMBLE__ +#DUFLUXU | kg m-1 s-1 | xy | N | | Dust column u-wind mass flux __ENSEMBLE__ +#DUFLUXV | kg m-1 s-1 | xy | N | | Dust column v-wind mass flux __ENSEMBLE__ +#DUEXTTFM | 1 | xy | N | | Dust Extinction AOT [550 nm] - PM 1.0 um __ENSEMBLE__ +#DUSCATFM | 1 | xy | N | | Dust Scattering AOT [550 nm] - PM 1.0 um __ENSEMBLE__ +#DUANGSTR | 1 | xy | N | | Dust Angstrom parameter [470-870 nm] __ENSEMBLE__ +#DUEM | kg m-2 s-1 | xy | N | self%nbins | Dust Emission All Bins __ENSEMBLE__ +#DUSD | kg m-2 s-1 | xy | N | self%nbins | Dust Sedimentation All Bins __ENSEMBLE__ +#DUDP | kg m-2 s-1 | xy | N | self%nbins | Dust Dry Deposition All Bins __ENSEMBLE__ +#DUWT | kg m-2 s-1 | xy | N | self%nbins | Dust Wet Deposition All Bins __ENSEMBLE__ +#DUSV | kg m-2 s-1 | xy | N | self%nbins | Dust Convective Scavenging All Bins __ENSEMBLE__ + + +category: INTERNAL +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSION | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC | UNGRIDDED | RESTART | ADD2EXPORT | FRIENDLYTO | LONG NAME +#---------------------------------------------------------------------------------------- +#DU |kg kg-1| xyz | C | self%nbins | MAPL_RestartOptional | .true. | DYNAMICS:TURBULENCE:MOIST | Dust Mixing Ratio all bins + + + +#******************************************************** +# +# Legend +# +#------------------------------------------------------------------ +# Column label | MAPL keyword/interpretation | Default +#--------------|--------------------------------------------------- +# NAME | short_name | +# UNITS | units | +# DIMS | dims | +# VLOC | VLocation | MAPL_VLocationNone +# LONG NAME | long_name | +# COND | if () then | .FALSE. +# NUM_SUBTILES | num_subtiles +# ... +#------------------------------------------------------------------ +# +#-------------------------------------------- +# Entry alias | Column | MAPL keyword/interpretation +#--------------|----------------------------- +# xyz | DIMS | MAPL_HorzVert +# xy | DIMS | MAPL_HorzOnly +# z | DIMS | MAPL_VertOnly (plus ungridded) +# C | VLOC | MAPL_VlocationCenter +# E | VLOC | MAPL_VlocationEdge +# N | VLOC | MAPL_VlocationNone +#-------------------------------------------- + + diff --git a/ESMF/Aerosol_GridComp/CMakeLists.txt b/ESMF/Aerosol_GridComp/CMakeLists.txt new file mode 100644 index 00000000..1b47e489 --- /dev/null +++ b/ESMF/Aerosol_GridComp/CMakeLists.txt @@ -0,0 +1,23 @@ +esma_set_this() + +set (alldirs + AeroCinderella_GridComp + ) + +if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Aerosol_GridComp.F90) + + esma_add_library (${this} + SRCS Aerosol_GridComp.F90 + SUBCOMPONENTS ${alldirs} + DEPENDENCIES MAPL GEOS_Shared + INCLUDES ${INC_ESMF}) + + mapl_acg (${this} Aerosol_StateSpecs.rc + IMPORT_SPECS EXPORT_SPECS INTERNAL_SPECS + GET_POINTERS DECLARE_POINTERS) + +else () + + esma_add_subdirectories (${alldirs}) + +endif() diff --git a/ESMF/Apps/AerosolDriver.F90 b/ESMF/Apps/AerosolDriver.F90 new file mode 100644 index 00000000..1506a013 --- /dev/null +++ b/ESMF/Apps/AerosolDriver.F90 @@ -0,0 +1,165 @@ +#include "MAPL_Generic.h" +#include "NUOPC_ErrLog.h" + +module aerosol_driver + use ESMF + use NUOPC + + use NUOPC_Driver, & + driverSS => SetServices, & + modelSS => label_SetModelServices, & + runSS => label_SetRunSequence + + use MAPL + use MAPL_NUOPCWrapperMod, only: wrapperSS => SetServices, init_wrapper + use NUOPC_Connector, only: cplSS => SetServices + + use Aerosol_GridComp_mod, only: aerosolSS => SetServices + + implicit none + private + + public SetServices +contains + subroutine SetServices(driver, rc) + type(ESMF_GridComp) :: driver + integer, intent(out) :: rc + + type(ESMF_Config) :: config + + ! Register NUOPC generic methods + call NUOPC_CompDerive(driver, driverSS, rc=rc) + VERIFY_NUOPC_(rc) + + ! Attach specializing methods + call NUOPC_CompSpecialize(driver, specLabel=modelSS, & + specRoutine=SetModelServices, rc=rc) + VERIFY_NUOPC_(rc) + +! call NUOPC_CompSpecialize(driver, specLabel=runSS, & +! specRoutine=SetRunSequence, rc=rc) +! VERIFY_NUOPC_(rc) + + ! Set the NUOPC configuration file + config = ESMF_ConfigCreate(rc=rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigLoadFile(config, "NUOPC_run_config.txt", rc=rc) + VERIFY_NUOPC_(rc) + call ESMF_GridCompSet(driver, config=config, rc=rc) + VERIFY_NUOPC_(rc) + + _RETURN(_SUCCESS) + end subroutine SetServices + + subroutine SetModelServices(driver, rc) + type(ESMF_GridComp) :: driver + integer, intent(out) :: rc + + type(ESMF_VM) :: vm + type(ESMF_Config) :: config + type(ESMF_GridComp) :: comp + + integer :: i, n_pes + integer, allocatable :: petlist(:) + + call set_clock(driver) + + ! Read GridComp configuration + call ESMF_GridCompGet(driver, vm=vm, config=config, rc=rc) + VERIFY_NUOPC_(rc) + call ESMF_VMGet(vm, petCount=n_pes, rc=rc) + VERIFY_NUOPC_(rc) + + allocate(petlist(n_pes)) + petlist = [(i, i = 0, n_pes - 1)] + + ! Create the MAPL grid_comp + call NUOPC_DriverAddComp(driver, "aerosol", wrapperSS, comp=comp, & + petlist=petlist, rc=rc) + VERIFY_NUOPC_(rc) + call init_wrapper(wrapper_gc=comp, name="aerosol", & + cap_rc_file="AEROSOL_CAP.rc", root_set_services=aerosolSS, rc=rc) + VERIFY_NUOPC_(rc) + + _RETURN(_SUCCESS) + end subroutine SetModelServices + + subroutine set_clock(driver) + type(ESMF_GridComp), intent(inout) :: driver + + type(ESMF_Time) :: startTime + type(ESMF_Time) :: stopTime + type(ESMF_TimeInterval) :: timeStep + type(ESMF_Clock) :: internalClock + type(ESMF_Config) :: config + + integer :: start_date_and_time(2), end_date_and_time(2), dt, file_unit, yy, mm, dd, h, m, s, rc + + ! Read the start time + open(newunit = file_unit, file = "cap_restart", form = 'formatted', & + status = 'old', action = 'read') + read(file_unit, *) start_date_and_time + close(file_unit) + + ! Set the start time + call UnpackDateTime(start_date_and_time, yy, mm, dd, h, m, s) + call ESMF_TimeSet(startTime, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, & + calkindflag=ESMF_CALKIND_GREGORIAN, rc=rc) + VERIFY_NUOPC_(rc) + + ! Read the end time + call ESMF_GridCompGet(driver, config = config, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_ConfigGetAttribute(config, end_date_and_time(1), label = "end_date:", rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_ConfigGetAttribute(config, end_date_and_time(2), label = "end_time:", rc = rc) + VERIFY_NUOPC_(rc) + + ! Set the end time + call UnpackDateTime(end_date_and_time, yy, mm, dd, h, m, s) + call ESMF_TimeSet(stopTime, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, & + calkindflag=ESMF_CALKIND_GREGORIAN, rc=rc) + VERIFY_NUOPC_(rc) + + ! Read the interpolation time interval + call ESMF_ConfigGetAttribute(config, dt, label = "interpolation_dt:", rc = rc) + VERIFY_NUOPC_(rc) + + ! Create the driver clock + call ESMF_TimeIntervalSet(timeStep, s=dt, rc=rc) + VERIFY_NUOPC_(rc) + + internalClock = ESMF_ClockCreate(name="Driver Clock", timeStep = timeStep, & + startTime=startTime, stopTime=stopTime, rc=rc) + VERIFY_NUOPC_(rc) + + ! set the driver clock + call ESMF_GridCompSet(driver, clock=internalClock, rc=rc) + VERIFY_NUOPC_(rc) + + contains + + subroutine UnpackDateTime(DATETIME, YY, MM, DD, H, M, S) + integer, intent(IN) :: DATETIME(:) + integer, intent(OUT) :: YY, MM, DD, H, M, S + + YY = datetime(1)/10000 + MM = mod(datetime(1),10000)/100 + DD = mod(datetime(1),100) + H = datetime(2)/10000 + M = mod(datetime(2),10000)/100 + S = mod(datetime(2),100) + return + end subroutine UnpackDateTime + + end subroutine set_clock +! +! subroutine SetRunSequence(driver, rc) +! type(ESMF_GridComp) :: driver +! integer, intent(out) :: rc +! +! rc = ESMF_SUCCESS +! +! end subroutine SetRunSequence +end module aerosol_driver \ No newline at end of file diff --git a/ESMF/Apps/AerosolMain.F90 b/ESMF/Apps/AerosolMain.F90 new file mode 100644 index 00000000..d65e7a3d --- /dev/null +++ b/ESMF/Apps/AerosolMain.F90 @@ -0,0 +1,79 @@ +#include "NUOPC_ErrLog.h" + +program AerosolMain + use ESMF + use NUOPC + use, intrinsic :: iso_fortran_env, only: INT64 + + use aerosol_driver, only: driverSS => SetServices + use MAPL_Profiler, only: BaseProfiler, TimeProfiler, get_global_time_profiler + + implicit none + include "mpif.h" + + integer :: rank, file_unit, rc, urc + integer(kind=INT64) :: t0, t1, count_rate + real :: elapsed_time + + type(ESMF_GridComp) :: driver_gridcomp + + call mpi_init(rc) + VERIFY_ESMF_(rc) + + call mpi_comm_rank(MPI_COMM_WORLD, rank, rc) + VERIFY_ESMF_(rc) + + if (rank == 0) then + call system_clock(t0) + end if + + ! Initialize ESMF + call ESMF_Initialize(LogKindFlag=ESMF_LOGKIND_MULTI, rc=rc) + VERIFY_ESMF_(rc) + + call ESMF_LogWrite("Aerosol Test App STARTING", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + ! Create the model + driver_gridcomp = ESMF_GridCompCreate(name="driver", rc=rc) + VERIFY_ESMF_(rc) + + call ESMF_GridCompSetServices(driver_gridcomp, driverSS, userRc=urc, rc=rc) + VERIFY_ALL_ESMF_(rc, urc) + + ! Initialize the model + call ESMF_GridCompInitialize(driver_gridcomp, userRc=urc, rc=rc) + VERIFY_ALL_ESMF_(rc, urc) + + ! Run the Model + call ESMF_GridCompRun(driver_gridcomp, userRc=urc, rc=rc) + VERIFY_ALL_ESMF_(rc, urc) + + ! Get the run time + if (rank == 0) then + call system_clock(t1, count_rate) + open(newunit=file_unit, file="elapsed_time.txt", & + status="replace", action="write") + elapsed_time = (t1 - t0) / real(count_rate) + write(file_unit, '(f0.0)') elapsed_time + close(file_unit) + end if + + ! Finalize the model + call ESMF_GridCompFinalize(driver_gridcomp, userRc=urc, rc=rc) + VERIFY_ALL_ESMF_(rc, urc) + + ! Destroy the model + call ESMF_GridCompDestroy(driver_gridcomp, rc=rc) + VERIFY_ESMF_(rc) + + ! Write MPI errors + call MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN, rc) + VERIFY_ESMF_(rc) + + call ESMF_LogWrite("Aerosol Test App FINISHED", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + ! Finalize ESMF + call ESMF_Finalize() +end program AerosolMain diff --git a/ESMF/Apps/CMakeLists.txt b/ESMF/Apps/CMakeLists.txt new file mode 100644 index 00000000..016d28b1 --- /dev/null +++ b/ESMF/Apps/CMakeLists.txt @@ -0,0 +1,13 @@ +ecbuild_add_executable( + TARGET SyntheticApp.x + SOURCES SyntheticApp.F90 Synthetic_Driver.F90 Provider_GridComp.F90 Reciever_GridComp.F90 UFS_TestingCap.F90 + LIBS gftl-shared MAPL MAPL.NUOPC + INCLUDES ${esma_include}/MAPL +) + +ecbuild_add_executable( + TARGET AerosolApp.x + SOURCES AerosolMain.F90 AerosolDriver.F90 + LIBS gftl-shared MAPL MAPL.NUOPC Aerosol_GridComp + INCLUDES ${esma_include}/MAPL +) diff --git a/ESMF/Apps/Mediator.F90 b/ESMF/Apps/Mediator.F90 new file mode 100644 index 00000000..d1ea8607 --- /dev/null +++ b/ESMF/Apps/Mediator.F90 @@ -0,0 +1,1458 @@ +#include "MAPL_Generic.h" +#include "NUOPC_ErrLog.h" + +module VarSpecMod + use MAPL_Mod + use ESMF + use NUOPC + implicit none + + integer, parameter :: NUM_GEOS_LEVELS = 72 + private + public :: VarSpec, get_var_spec_from_transferred_field + + type VarSpec + character(len=:), allocatable :: name + type(ESMF_TypeKind_Flag) :: typekind + integer, allocatable :: grid_to_field_map(:), ungridded_lbound(:), ungridded_ubound(:) + integer :: dims, vlocation + contains + procedure :: complete_field_in_state + procedure :: create_field + end type VarSpec + +contains + + function get_var_spec_from_transferred_field(field) result(spec) + type(VarSpec) :: spec + type(ESMF_Field), intent(in) :: field + + integer :: count + integer :: typekind_int, rc + character(len=ESMF_MAXSTR) :: field_name + + call ESMF_FieldGet(field, name = field_name, rc = rc) + VERIFY_NUOPC_(rc) + spec%name = field_name + + call ESMF_AttributeGet(field, name = "TypeKind", convention = "NUOPC", & + purpose = "Instance", value = typekind_int, rc = rc) + VERIFY_NUOPC_(rc) + + spec%typekind = typekind_int + + call NUOPC_GetAttribute(field, name = "GridToFieldMap", itemCount = count, rc = rc) + VERIFY_NUOPC_(rc) + + if (count > 0) then + allocate(spec%grid_to_field_map(count)) + + call ESMF_AttributeGet(field, name = "GridToFieldMap", & + convention = "NUOPC", purpose = "Instance", & + valueList = spec%grid_to_field_map, rc = rc) + VERIFY_NUOPC_(rc) + end if + + _ASSERT(allocated(spec%grid_to_field_map), "grid_to_field_map on transferred field must be present") + + + call NUOPC_GetAttribute(field, name = "UngriddedLBound", itemCount = count, rc = rc) + VERIFY_NUOPC_(rc) + + if (count > 0) then + allocate(spec%ungridded_lbound(count)) + + call ESMF_AttributeGet(field, name = "UngriddedLBound", & + convention = "NUOPC", purpose = "Instance", & + valueList = spec%ungridded_lbound, rc = rc) + VERIFY_NUOPC_(rc) + end if + + + call NUOPC_GetAttribute(field, name = "UngriddedUBound", itemCount = count, rc = rc) + VERIFY_NUOPC_(rc) + + if (count > 0) then + allocate(spec%ungridded_ubound(count)) + + call ESMF_AttributeGet(field, name = "UngriddedUBound", & + convention = "NUOPC", purpose = "Instance", & + valueList = spec%ungridded_ubound, rc = rc) + VERIFY_NUOPC_(rc) + end if + + end function get_var_spec_from_transferred_field + + + subroutine complete_field_in_state(spec, state, rc) + class(VarSpec), intent(in) :: spec + type(ESMF_State), intent(inout) :: state + integer, intent(out) :: rc + + type(ESMF_Field) :: field + + rc = ESMF_SUCCESS + + call ESMF_StateGet(state, field = field, itemName = spec%name, rc = rc) + VERIFY_NUOPC_(rc) + + call complete_field(spec, field, rc) + VERIFY_NUOPC_(rc) + + end subroutine complete_field_in_state + + + subroutine complete_field(spec, field, rc) + class(VarSpec), intent(in) :: spec + type(ESMF_Field), intent(inout) :: field + integer, intent(out) :: rc + + rc = ESMF_SUCCESS + + if (allocated(spec%ungridded_lbound) .and. allocated(spec%ungridded_ubound)) then + call ESMF_FieldEmptyComplete(field, typekind = spec%typekind, & + gridToFieldMap = spec%grid_to_field_map, & + ungriddedLBound = spec%ungridded_lbound, & + ungriddedUBound = spec%ungridded_ubound, rc = rc) + VERIFY_NUOPC_(rc) + else + call ESMF_FieldEmptyComplete(field, spec%typekind, & + gridToFieldMap = spec%grid_to_field_map, rc = rc) + VERIFY_NUOPC_(rc) + end if + + call set_MAPL_field_attributes(spec, field, rc = rc) + VERIFY_NUOPC_(rc) + + end subroutine complete_field + + + function create_field(spec, grid, rc) result(field) + class(VarSpec), intent(in) :: spec + type(ESMF_Grid), intent(in) :: grid + integer, intent(out) :: rc + + type(ESMF_Field) :: field + + rc = ESMF_SUCCESS + + if (allocated(spec%ungridded_lbound) .and. allocated(spec%ungridded_ubound)) then + field = ESMF_FieldCreate(grid, name = spec%name, & + typeKind = spec%typekind, & + gridToFieldMap = spec%grid_to_field_map, & + ungriddedLBound = spec%ungridded_lbound, & + ungriddedUBound = spec%ungridded_ubound, rc = rc) + VERIFY_NUOPC_(rc) + else + field = ESMF_FieldCreate(grid, spec%typekind, & + gridToFieldMap = spec%grid_to_field_map, name = spec%name, rc = rc) + VERIFY_NUOPC_(rc) + end if + + call set_MAPL_field_attributes(spec, field, rc) + VERIFY_NUOPC_(rc) + + end function create_field + + + subroutine set_MAPL_field_attributes(spec, field, rc) + type(VarSpec), intent(in) :: spec + type(ESMF_Field), intent(inout) :: field + integer, intent(out) :: rc + + integer :: num_levels + rc = ESMF_SUCCESS + + if (allocated(spec%ungridded_lbound) .and. allocated(spec%ungridded_ubound)) then + num_levels = spec%ungridded_ubound(1) - spec%ungridded_lbound(1) + 1 + call ESMF_AttributeSet(field, name = "DIMS", value = MAPL_DimsHorzVert, rc = rc) + VERIFY_NUOPC_(rc) + if (num_levels == NUM_GEOS_LEVELS) then + call ESMF_AttributeSet(field, name = "VLOCATION", value = MAPL_VLocationCenter, rc = rc) + VERIFY_NUOPC_(rc) + else if(num_levels == NUM_GEOS_LEVELS+1) then + call ESMF_AttributeSet(field, name = "VLOCATION", value = MAPL_VLocationEdge, rc = rc) + VERIFY_NUOPC_(rc) + end if + else + call ESMF_AttributeSet(field, name = "DIMS", value = MAPL_DimsHorzOnly, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_AttributeSet(field, name = "VLOCATION", value = MAPL_VLocationNone, rc = rc) + VERIFY_NUOPC_(rc) + end if + + call ESMF_AttributeSet(field, name = "LONG_NAME", value = spec%name, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_AttributeSet(field, name = "UNITS", value = "1", rc = rc) + VERIFY_NUOPC_(rc) + + end subroutine set_MAPL_field_attributes + + +end module VarSpecMod + + +module agcm_ctm_mediator + use ESMF + use MAPL_Mod + use NUOPC + use NUOPC_Mediator, & + mediator_routine_SS => SetServices, & + mediator_label_Advance => label_Advance, & + mediator_label_DataInitialize => label_DataInitialize, & + mediator_label_CheckImport => label_CheckImport, & + mediator_label_TimestampExport => label_TimestampExport, & + mediator_routine_run => routine_run, & + mediator_label_set_run_clock => label_SetRunClock + + use Mediator_InterpolatorMod + use VarSpecMod + + use, intrinsic :: iso_fortran_env, only: real32, real64, int64 + + implicit none + + private + + public SetServices + + + type mediator_internal_state + type(ESMF_State) :: prev_state, regridded_import_state + type(ESMF_Config) :: config + logical :: use_interpolation, create_restart, use_regridding ! interpolate, or directly copy states from import to export + type(mediator_interpolator) :: interpolator + type(ESMF_Clock) :: slow_clock, fast_clock, regrid_clock + type(ESMF_Grid) :: agcm_grid, ctm_grid + class(AbstractRegridder), pointer :: regridder => null() + integer :: regrid_method = REGRID_METHOD_BILINEAR + end type mediator_internal_state + + type mediator_internal_state_wrapper + type(mediator_internal_state), pointer :: ptr + end type mediator_internal_state_wrapper + + integer :: mpi_rank, de_count + +#include "mpif.h" + +contains + + subroutine SetServices(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + rc = ESMF_SUCCESS + + ! the NUOPC model component will register the generic methods + call NUOPC_CompDerive(mediator, mediator_routine_SS, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_GridCompSetEntryPoint(mediator, ESMF_METHOD_INITIALIZE, & + userRoutine = initialize_p0, phase = 0, rc = rc) + VERIFY_NUOPC_(rc) + + call MPI_Comm_rank(MPI_COMM_WORLD, mpi_rank, rc) + + + ! set entry point for methods that require specific implementation + call NUOPC_CompSetEntryPoint(mediator, ESMF_METHOD_INITIALIZE, & + phaseLabelList=["IPDv05p1"], userRoutine = advertise_fields, rc=rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSetEntryPoint(mediator, ESMF_METHOD_INITIALIZE, & + phaseLabelList=["IPDv05p5"], userRoutine = modify_decomposition, rc=rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSetEntryPoint(mediator, ESMF_METHOD_INITIALIZE, & + phaseLabelList=["IPDv05p6"], userRoutine = realize_fields, rc=rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel = mediator_label_DataInitialize, & + specRoutine = initialize_data, rc=rc) + VERIFY_NUOPC_(rc) + + + + call NUOPC_CompSetEntryPoint(mediator, ESMF_METHOD_RUN, phaseLabelList = ["interpolate"], & + userRoutine = mediator_routine_run, rc = rc) + VERIFY_NUOPC_(rc) + + ! attach specializing method(s) + call NUOPC_CompSpecialize(mediator, specLabel=mediator_label_advance, & + specPhaseLabel = "interpolate", specRoutine = interpolate, rc=rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel = mediator_label_set_run_clock, & + specPhaseLabel = "interpolate", specRoutine = set_run_clock_fast, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_MethodRemove(mediator, label=mediator_label_CheckImport, rc=rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel=mediator_label_CheckImport, & + specRoutine=CheckImport, specPhaseLabel = "interpolate", rc=rc) + VERIFY_NUOPC_(rc) + + + + call NUOPC_CompSetEntryPoint(mediator, ESMF_METHOD_RUN, & + phaseLabelList = ["update_interpolator"], userRoutine = mediator_routine_run, rc = rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel=mediator_label_advance, & + specPhaseLabel = "update_interpolator", specRoutine = update_interpolator, rc=rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel = mediator_label_TimestampExport, & + specPhaseLabel = "update_interpolator", specRoutine = timestamp_update_interpolator, rc = rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel = mediator_label_set_run_clock, & + specPhaseLabel = "update_interpolator", specRoutine = set_run_clock_slow, rc = rc) + VERIFY_NUOPC_(rc) + + + + call NUOPC_CompSetEntryPoint(mediator, ESMF_METHOD_RUN, phaseLabelList = ["regrid_import_state"], & + userRoutine = mediator_routine_run, rc = rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel=mediator_label_advance, & + specPhaseLabel = "regrid_import_state", specRoutine = regrid_import_state, rc=rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel = mediator_label_TimestampExport, & + specPhaseLabel = "regrid_import_state", specRoutine = timestamp_regrid, rc = rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel = mediator_label_set_run_clock, & + specPhaseLabel = "regrid_import_state", specRoutine = set_run_clock_regrid, rc = rc) + VERIFY_NUOPC_(rc) + + + + call NUOPC_CompSetEntryPoint(mediator, ESMF_METHOD_RUN, phaseLabelList = ["write_restart"], & + userRoutine = mediator_routine_run, rc = rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel=mediator_label_advance, & + specPhaseLabel = "write_restart", specRoutine = write_restart, rc=rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel = mediator_label_TimestampExport, & + specPhaseLabel = "write_restart", specRoutine = timestamp_regrid, rc = rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(mediator, specLabel = mediator_label_set_run_clock, & + specPhaseLabel = "write_restart", specRoutine = set_run_clock_fast, rc = rc) + VERIFY_NUOPC_(rc) + + + call NUOPC_CompSpecialize(mediator, specLabel = label_Finalize, & + specRoutine = mediator_finalize, rc = rc) + VERIFY_NUOPC_(rc) + + + end subroutine SetServices + + + subroutine initialize_p0(mediator, import_state, export_state, clock, rc) + type(ESMF_GridComp) :: mediator + type(ESMF_State) :: import_state, export_state + type(ESMF_Clock) :: clock + integer, intent(out) :: rc + + type(mediator_internal_state_wrapper) :: wrapper + + type(ESMF_TimeInterval) :: fast_interval, interp_interval + type(ESMF_Time) :: current_time + character(len=ESMF_MAXSTR) :: grid_type_attr + + type(ESMF_Config) :: cap_config + integer :: agcm_dt + integer(int64) :: id + + _UNUSED_DUMMY(import_state) + _UNUSED_DUMMY(export_state) + + call NUOPC_CompFilterPhaseMap(mediator, ESMF_METHOD_INITIALIZE, & + acceptStringList=["IPDv05p"], rc=rc) + + allocate(wrapper%ptr) + + wrapper%ptr%prev_state = ESMF_StateCreate(name = "interpolation_fields", rc = rc) + VERIFY_NUOPC_(rc) + + wrapper%ptr%slow_clock = ESMF_ClockCreate(clock, rc = rc) + VERIFY_NUOPC_(rc) + wrapper%ptr%regrid_clock = ESMF_ClockCreate(clock, rc = rc) + VERIFY_NUOPC_(rc) + wrapper%ptr%fast_clock = ESMF_ClockCreate(clock, rc = rc) + VERIFY_NUOPC_(rc) + + cap_config = ESMF_ConfigCreate(rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_ConfigLoadFile(cap_config, "CTM_CAP.rc", rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_ConfigGetAttribute(cap_config, agcm_dt, label = "HEARTBEAT_DT:", rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_TimeIntervalSet(fast_interval, s = agcm_dt, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_ClockSet(wrapper%ptr%fast_clock, timeStep = fast_interval, rc = rc) + VERIFY_NUOPC_(rc) + + + call ESMF_ClockGet(clock, currTime = current_time, timeStep = interp_interval, rc = rc) + VERIFY_NUOPC_(rc) + + wrapper%ptr%interpolator = mediator_interpolator(start_time = current_time, & + interp_interval = interp_interval) + + wrapper%ptr%config = ESMF_ConfigCreate(rc=rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigLoadFile(wrapper%ptr%config, "NUOPC_run_config.txt", rc=rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigGetAttribute(wrapper%ptr%config, wrapper%ptr%use_interpolation, & + label = "use_time_interpolation:", default = .false., rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigGetAttribute(wrapper%ptr%config, wrapper%ptr%create_restart, & + label = "create_restart:", default = .false., rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigGetAttribute(wrapper%ptr%config, wrapper%ptr%use_regridding, & + label = "use_regridding:", default = .false., rc = rc) + VERIFY_NUOPC_(rc) + + + wrapper%ptr%agcm_grid = make_grid_from_config("GEOSCTM.rc", "AGCM", rc) + VERIFY_NUOPC_(rc) + wrapper%ptr%ctm_grid = make_grid_from_config("GEOSCTM.rc", "GEOSctm", rc) + VERIFY_NUOPC_(rc) + + if (wrapper%ptr%use_regridding) then + wrapper%ptr%regridded_import_state = ESMF_StateCreate(name = "regridded_import_state", rc = rc) + VERIFY_NUOPC_(rc) + end if + + call ESMF_UserCompSetInternalState(mediator, "internal_state", wrapper, rc) + VERIFY_NUOPC_(rc) + + end subroutine initialize_p0 + + !----------------------------------------------------------------------------- + + subroutine advertise_fields(mediator, import_state, export_state, clock, rc) + type(ESMF_GridComp) :: mediator + type(ESMF_State) :: import_state, export_state + type(ESMF_Clock) :: clock + integer, intent(out) :: rc + + !type(StringVarSpecIterator) :: iter + type(mediator_internal_state), pointer :: med_state + + _UNUSED_DUMMY(mediator) + _UNUSED_DUMMY(clock) + + rc = ESMF_SUCCESS + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + call NUOPC_SetAttribute(import_state, "FieldTransferPolicy", "transferAll", rc = rc) + VERIFY_NUOPC_(rc) + + call NUOPC_SetAttribute(export_state, "FieldTransferPolicy", "transferAll", rc = rc) + VERIFY_NUOPC_(rc) + + ! iter = var_specs%begin() + ! do while(iter /= var_specs%end()) + ! call NUOPC_Advertise(import_state, standardName = iter%key(), & + ! transferOfferGeomObject = "cannot provide", rc = rc) + ! VERIFY_NUOPC_(rc) + + ! call NUOPC_Advertise(export_state, standardName = iter%key(), & + ! transferOfferGeomObject = "cannot provide", rc = rc) + ! VERIFY_NUOPC_(rc) + ! call iter%next() + ! end do + + end subroutine advertise_fields + + + + subroutine modify_decomposition(mediator, import_state, export_state, clock, rc) + type(ESMF_GridComp) :: mediator + type(ESMF_State) :: import_state, export_state + type(ESMF_Clock) :: clock + integer, intent(out) :: rc + + type(mediator_internal_state), pointer :: med_state + + integer :: i + type(ESMF_Field) :: import_field, export_field + + character(len=ESMF_MAXSTR), allocatable :: field_names(:) + + _UNUSED_DUMMY(clock) + _UNUSED_DUMMY(export_state) + + rc = ESMF_SUCCESS + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + if (.not. med_state%use_regridding) then + return + end if + + field_names = get_state_names(import_state, rc) + VERIFY_NUOPC_(rc) + + do i = 1, size(field_names) + call ESMF_StateGet(import_state, field_names(i), import_field, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldEmptySet(import_field, grid = med_state%agcm_grid, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_StateGet(export_state, field_names(i), export_field, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldEmptySet(export_field, grid = med_state%ctm_grid, rc = rc) + VERIFY_NUOPC_(rc) + end do + + end subroutine modify_decomposition + + + function make_grid_from_config(config_name, comp_name, rc) result(grid) + use MAPL_GridManagerMod, only: grid_manager + type(ESMF_Grid) :: grid + character(len=*), intent(in) :: config_name, comp_name + integer, intent(out) :: rc + + character(len=*), parameter :: CF_COMPONENT_SEPARATOR = '.' + integer :: ny, nn + type(ESMF_Config) :: config + character(len=ESMF_MAXSTR) :: grid_name + character(len=2) :: dateline + + config = ESMF_ConfigCreate(rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigLoadFile(config, config_name, rc = rc) + VERIFY_NUOPC_(rc) + + call MAPL_ConfigPrepend(config, COMP_NAME, CF_COMPONENT_SEPARATOR, 'NX:', rc = rc) + VERIFY_NUOPC_(rc) + call MAPL_ConfigPrepend(config, COMP_NAME, CF_COMPONENT_SEPARATOR, 'NY:', rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigGetAttribute(config, grid_name, label = COMP_NAME//CF_COMPONENT_SEPARATOR//'GRIDNAME:', rc = rc) + VERIFY_NUOPC_(rc) + nn = len_trim(grid_name) + dateline = grid_name(nn-1:nn) + if (dateline == 'CF') then + call ESMF_ConfigGetAttribute(config, ny, label = COMP_NAME//CF_COMPONENT_SEPARATOR//'NY:', rc = rc) + VERIFY_NUOPC_(rc) + call MAPL_ConfigSetAttribute(config, value = ny/6, label = COMP_NAME//CF_COMPONENT_SEPARATOR//'NY:', rc = rc) + VERIFY_NUOPC_(rc) + end if + + grid = grid_manager%make_grid(config, prefix = COMP_NAME//CF_COMPONENT_SEPARATOR, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigDestroy(config, rc = rc) + VERIFY_NUOPC_(rc) + + contains + + subroutine MAPL_ConfigPrepend(cf,prefix,separator,label,rc) + type(ESMF_Config), intent(inout) :: cf + character(len=*) , intent(in ) :: prefix + character(len=*) , intent(in ) :: separator + character(len=*) , intent(in ) :: label + integer, optional , intent(out ) :: rc + + integer :: status + character(len=ESMF_MAXSTR) :: Iam = "MAPL_ConfigPrepend" + integer :: val + + call ESMF_ConfigGetAttribute( cf, val, label=trim(prefix)//trim(separator)//trim(label), rc = status ) + if (status /= ESMF_SUCCESS) then + call ESMF_ConfigGetAttribute(CF,val,label=trim(label),rc=status) + _VERIFY(status) + call MAPL_ConfigSetAttribute(CF, val, label=trim(prefix)//trim(separator)//trim(label),rc=status) + _VERIFY(status) + end if + + _RETURN(ESMF_SUCCESS) + + end subroutine MAPL_ConfigPrepend + + end function make_grid_from_config + + + subroutine realize_fields(mediator, import_state, export_state, clock, rc) + type(ESMF_GridComp) :: mediator + type(ESMF_State) :: import_state, export_state + type(ESMF_Clock) :: clock + integer, intent(out) :: rc + + type(mediator_internal_state), pointer :: med_state + character(len=ESMF_MAXSTR), allocatable :: export_names(:) + integer :: i + type(VarSpec) :: export_spec, import_spec + type(ESMF_Grid) :: import_grid, export_grid + type(ESMF_Field) :: interpolation_field, regridded_field, export_field, import_field + + _UNUSED_DUMMY(clock) + + rc = ESMF_SUCCESS + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + export_names = get_state_names(export_state, rc) + VERIFY_NUOPC_(rc) + + export_grid = get_grid_from_state(export_state, rc) + VERIFY_NUOPC_(rc) + import_grid = get_grid_from_state(import_state, rc) + VERIFY_NUOPC_(rc) + + do i = 1, size(export_names) + + call ESMF_StateGet(export_state, export_names(i), export_field, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_StateGet(export_state, export_names(i), import_field, rc = rc) + VERIFY_NUOPC_(rc) + + export_spec = get_var_spec_from_transferred_field(export_field) + import_spec = get_var_spec_from_transferred_field(import_field) + + call import_spec%complete_field_in_state(import_state, rc) + VERIFY_NUOPC_(rc) + call export_spec%complete_field_in_state(export_state, rc) + VERIFY_NUOPC_(rc) + + if (med_state%use_interpolation) then + interpolation_field = export_spec%create_field(med_state%ctm_grid, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_StateAdd(med_state%prev_state, [interpolation_field], rc = rc) + VERIFY_NUOPC_(rc) + end if + + if (med_state%use_regridding) then + regridded_field = export_spec%create_field(med_state%ctm_grid, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_StateAdd(med_state%regridded_import_state, [regridded_field], rc = rc) + VERIFY_NUOPC_(rc) + end if + + end do + + if (med_state%use_regridding) then + med_state%regridder => new_regridder_manager%make_regridder(& + grid_in = med_state%agcm_grid, & + grid_out = med_state%ctm_grid, & + regrid_method = med_state%regrid_method, rc = rc) + VERIFY_NUOPC_(rc) + end if + + end subroutine realize_fields + + + subroutine set_run_clock_slow(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + type(mediator_internal_state), pointer :: med_state + type(ESMF_Clock) :: driver_clock + + rc = ESMF_SUCCESS + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + call NUOPC_MediatorGet(mediator, driverClock=driver_clock, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_GridCompSet(mediator, clock = med_state%slow_clock, rc = rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompCheckSetClock(mediator, driver_clock, rc = rc) + VERIFY_NUOPC_(rc) + + end subroutine set_run_clock_slow + + + subroutine set_run_clock_regrid(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + type(mediator_internal_state), pointer :: med_state + type(ESMF_Clock) :: driver_clock + + rc = ESMF_SUCCESS + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + call NUOPC_MediatorGet(mediator, driverClock=driver_clock, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_GridCompSet(mediator, clock = med_state%regrid_clock, rc = rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompCheckSetClock(mediator, driver_clock, rc = rc) + VERIFY_NUOPC_(rc) + + end subroutine set_run_clock_regrid + + + subroutine set_run_clock_fast(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + type(mediator_internal_state), pointer :: med_state + type(ESMF_Clock) :: driver_clock + + rc = ESMF_SUCCESS + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + call NUOPC_MediatorGet(mediator, driverClock=driver_clock, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_GridCompSet(mediator, clock = med_state%fast_clock, rc = rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompCheckSetClock(mediator, driver_clock, rc = rc) + VERIFY_NUOPC_(rc) + + end subroutine set_run_clock_fast + + + subroutine initialize_data(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + type(ESMF_State) :: import_state, export_state + type(ESMF_Clock) :: clock + + type(ESMF_VM) :: vm + type(ArrDescr) :: descriptor + integer :: comm, im_world, jm_world, lm_world, nx, ny, num_readers, num_writers, is, ie, js, je + type(ESMF_Grid) :: grid + + type(mediator_internal_state), pointer :: med_state + + rc = ESMF_SUCCESS + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + call ESMF_GridCompGet(mediator, clock = clock, importState = import_state, & + exportState = export_state, vm = vm, rc = rc) + VERIFY_NUOPC_(rc) + + + call ESMF_VMGet(vm, mpicommunicator = comm, rc = rc) + VERIFY_NUOPC_(rc) + + grid = get_grid_from_state(export_state, rc) + VERIFY_NUOPC_(rc) + + call MAPL_grid_interior(grid, is, ie, js, je) + + num_writers = 1 + num_readers = 1 + + call get_decomp(nx, ny, im_world, jm_world, lm_world) + + call ArrDescrInit(descriptor, comm, im_world, jm_world, lm_world, nx, ny, & + num_readers, num_writers, is, ie, js, je, rc = rc) + VERIFY_NUOPC_(rc) + + descriptor%grid = grid + descriptor%tile = .false. + + if (med_state%use_interpolation) then + call MAPL_VarReadNCPar(filename = "mediator_import_rst", & + state = med_state%prev_state, arrdes = descriptor, bootstrapable = .false., rc = rc) + VERIFY_NUOPC_(rc) + end if + + call NUOPC_CompAttributeSet(mediator, & + name="InitializeDataComplete", value="true", rc=rc) + VERIFY_NUOPC_(rc) + + end subroutine initialize_data + + + + subroutine write_restart(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + type(ESMF_State) :: import_state, export_state + type(ESMF_Clock) :: clock, write_clock + + type(ESMF_VM) :: vm + type(ArrDescr) :: descriptor + integer :: comm, im_world, jm_world, lm_world, nx, ny, num_readers, num_writers, is, ie, js, je + type(ESMF_Grid) :: grid + + type(mediator_internal_state), pointer :: med_state + + rc = ESMF_SUCCESS + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + call ESMF_GridCompGet(mediator, clock = clock, importState = import_state, & + exportState = export_state, vm = vm, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_VMGet(vm, mpicommunicator = comm, rc = rc) + VERIFY_NUOPC_(rc) + + grid = get_grid_from_state(export_state, rc) + VERIFY_NUOPC_(rc) + + call MAPL_grid_interior(grid, is, ie, js, je) + + num_writers = 1 + num_readers = 1 + + call get_decomp(nx, ny, im_world, jm_world, lm_world) + + call ArrDescrInit(descriptor, comm, im_world, jm_world, lm_world, nx, ny, & + num_readers, num_writers, is, ie, js, je, rc = rc) + VERIFY_NUOPC_(rc) + + descriptor%grid = grid + descriptor%tile = .false. + + write_clock = ESMF_ClockCreate(clock) + call ESMF_ClockAdvance(write_clock) + + if (MAPL_AM_I_ROOT()) then + print *, "Writting mediator resetart" + end if + + if (.not. med_state%use_regridding) then + call MAPL_VarWriteNCPar(filename = "mediator_import_rst", & + state = import_state, arrdes = descriptor, clock = write_clock, rc = rc) + VERIFY_NUOPC_(rc) + else + call MAPL_VarWriteNCPar(filename = "mediator_import_rst", & + state = med_state%regridded_import_state, arrdes = descriptor, clock = write_clock, rc = rc) + VERIFY_NUOPC_(rc) + end if + + + end subroutine write_restart + + + subroutine get_decomp(nx, ny, im, jm, lm) + integer, intent(out) :: nx, ny, im, jm, lm + integer :: rc + + type(ESMF_Config) :: config + + config = ESMF_ConfigCreate(rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigLoadFile(config, "GEOSCTM.rc", rc=rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigGetAttribute(config, nx, label = "NX:", rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_ConfigGetAttribute(config, ny, label = "NY:", rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_ConfigGetAttribute(config, im, label = "GEOSCTM_IM:", rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_ConfigGetAttribute(config, jm, label = "GEOSCTM_JM:", rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_ConfigGetAttribute(config, lm, label = "GEOSCTM_LM:", rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_ConfigDestroy(config, rc = rc) + VERIFY_NUOPC_(rc) + + end subroutine get_decomp + + + subroutine CheckImport(model, rc) + type(ESMF_GridComp) :: model + integer, intent(out) :: rc + + _UNUSED_DUMMY(model) + + rc = ESMF_SUCCESS + + end subroutine CheckImport + + + subroutine timestamp_update_interpolator(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + _UNUSED_DUMMY(mediator) + rc = ESMF_SUCCESS + + end subroutine timestamp_update_interpolator + + + subroutine timestamp_regrid(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + !type(ESMF_Clock) :: mediator_clock + !type(ESMF_State) :: import_state, export_state + !type(ESMF_TimeInterval) :: time_step + + _UNUSED_DUMMY(mediator) + rc = ESMF_SUCCESS + + VERIFY_NUOPC_(rc) + + end subroutine timestamp_regrid + + + subroutine update_interpolator(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + type(mediator_internal_state), pointer :: med_state + + type(ESMF_State) :: import_state, export_state + + rc = ESMF_SUCCESS + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + _ASSERT(med_state%use_interpolation, "Can't use setup_interpolation if have use_interpolation is not enabled") + + call ESMF_GridCompGet(mediator, importState = import_state, & + exportState = export_state, rc = rc) + VERIFY_NUOPC_(rc) + + call med_state%interpolator%update() + + if (.not. med_state%use_regridding) then + call copy_state(import_state, med_state%prev_state) + else + !call regrid_state(med_state%regridder, src_state = import_state, dst_state = med_state%prev_state, rc = rc) + call copy_state(med_state%regridded_import_state, med_state%prev_state) + VERIFY_NUOPC_(rc) + end if + + end subroutine update_interpolator + + + subroutine check_fields_and_get_rank_typekind(field1, field2, rank, typekind, rc) + type(ESMF_Field), intent(in) :: field1, field2 + integer, intent(out) :: rank + type(ESMF_TypeKind_Flag), intent(out) :: typekind + integer, intent(out) :: rc + + type(ESMF_TypeKind_Flag) :: typekind1, typekind2 + integer :: rank1, rank2 + + rc = ESMF_SUCCESS + + call ESMF_FieldGet(field1, typeKind = typekind1, rank = rank1, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(field2, typeKind = typekind2, rank = rank2, rc = rc) + VERIFY_NUOPC_(rc) + + _ASSERT(rank1 == rank2, "Field Ranks must match!") + _ASSERT(typekind1 == typekind2, "Fields must have same typekind") + + rank = rank1 + typekind = typekind1 + end subroutine check_fields_and_get_rank_typekind + + + function get_state_names(state, rc) result(names) + type(ESMF_State), intent(in) :: state + character(len=ESMF_MAXSTR), allocatable :: names(:) + integer, intent(out) :: rc + integer :: num_fields + + rc = ESMF_SUCCESS + + call ESMF_StateGet(state, itemCount = num_fields, rc = rc) + VERIFY_NUOPC_(rc) + + allocate(names(num_fields)) + + call ESMF_StateGet(state, itemNameList = names, rc = rc) + VERIFY_NUOPC_(rc) + + end function get_state_names + + + subroutine interpolate(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + type(ESMF_Clock) :: mediator_clock + type(ESMF_State) :: import_state, export_state + + type(mediator_internal_state), pointer :: med_state + character(len=ESMF_MAXSTR), allocatable :: field_names(:) + integer :: i + + type(ESMF_Field) :: import_field, export_field, prev_field + type(ESMF_Time) :: current_time + + rc = ESMF_SUCCESS + + call NUOPC_MediatorGet(mediator, mediatorClock = mediator_clock, & + importState = import_state, exportState = export_state, rc = rc) + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + call ESMF_ClockGet(mediator_clock, currTime = current_time, rc = rc) + VERIFY_NUOPC_(rc) + + field_names = get_state_names(import_state, rc) + VERIFY_NUOPC_(rc) + + + if (med_state%use_interpolation) then + do i = 1, size(field_names) + + ! choose whether to use the import state directly or the re-gridded import state + if (.not. med_state%use_regridding) then + call ESMF_StateGet(import_state, field_names(i), import_field, rc = rc) + VERIFY_NUOPC_(rc) + else + call ESMF_StateGet(med_state%regridded_import_state, field_names(i), import_field, rc = rc) + VERIFY_NUOPC_(rc) + end if + + call ESMF_StateGet(med_state%prev_state, field_names(i), prev_field, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_StateGet(export_state, field_names(i), export_field, rc = rc) + VERIFY_NUOPC_(rc) + + call med_state%interpolator%interpolate(current_time = current_time, & + in_field0 = prev_field, in_field1 = import_field, out_field = export_field) + end do + else + ! copy data from agcm to ctm without interpolation + ! re-grid if they are on different grids + if (.not. med_state%use_regridding) then + call copy_state(import_state, export_state) + else + call regrid_state(med_state%regridder, import_state, export_state, rc) + VERIFY_NUOPC_(rc) + end if + end if + + + end subroutine interpolate + + + subroutine regrid_import_state(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + type(ESMF_State) :: import_state, export_state + type(mediator_internal_state), pointer :: med_state + + call NUOPC_MediatorGet(mediator, & + importState = import_state, exportState = export_state, rc = rc) + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + _ASSERT(med_state%use_regridding, "Re-gridding must be enabled using mediator label regrid_import_state") + + call regrid_state(med_state%regridder, import_state, med_state%regridded_import_state, rc) + VERIFY_NUOPC_(rc) + end subroutine regrid_import_state + + + subroutine mediator_finalize(mediator, rc) + type(ESMF_GridComp) :: mediator + integer, intent(out) :: rc + + type(mediator_internal_state), pointer :: med_state + + med_state => get_internal_state(mediator, rc) + VERIFY_NUOPC_(rc) + + if (med_state%create_restart) then + call write_restart(mediator, rc) + VERIFY_NUOPC_(rc) + end if + + end subroutine mediator_finalize + + + subroutine regrid_state(regridder, src_state, dst_state, rc) + class(AbstractRegridder), intent(inout) :: regridder + type(ESMF_State), intent(in) :: src_state + type(ESMF_State), intent(inout) :: dst_state + integer, intent(out) :: rc + + integer :: i + character(len=ESMF_MAXSTR), allocatable :: field_names(:) + type(ESMF_Field) :: src_field, dst_field + + type(ESMF_Field) :: x_src_field, y_src_field, x_dst_field, y_dst_field + + character(len=ESMF_MAXSTR), allocatable :: vector_components(:) + vector_components = ["U ", "V ", "U10M", "V10M", "U10N", "V10N", "MFX ", "MFY ", "CX ", "CY "] + + rc = ESMF_SUCCESS + + field_names = get_state_names(src_state, rc) + VERIFY_NUOPC_(rc) + + do i = 1, size(field_names) + + if (.not. is_vector_component(field_names(i), vector_components)) then + + call ESMF_StateGet(src_state, field_names(i), src_field, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_StateGet(dst_state, field_names(i), dst_field, rc = rc) + VERIFY_NUOPC_(rc) + + call regrid_field_scalar(regridder, src_field, dst_field, rc) + VERIFY_NUOPC_(rc) + end if + + end do + + do i = 1, size(vector_components), 2 + call ESMF_StateGet(src_state, trim(vector_components(i)), x_src_field, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_StateGet(src_state, trim(vector_components(i+1)), y_src_field, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_StateGet(dst_state, trim(vector_components(i)), x_dst_field, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_StateGet(dst_state, trim(vector_components(i+1)), y_dst_field, rc = rc) + VERIFY_NUOPC_(rc) + + call regrid_field_vector(regridder, x_src_field, y_src_field, x_dst_field, y_dst_field, rc = rc) + VERIFY_NUOPC_(rc) + end do + + end subroutine regrid_state + + + pure logical function is_vector_component(name, vector_components) + character(len=*), intent(in) :: name + character(len=ESMF_MAXSTR), intent(in) :: vector_components(:) + integer :: i + + is_vector_component = .false. + + do i = 1, size(vector_components) + if (trim(name) == trim(vector_components(i))) then + is_vector_component = .true. + exit + end if + end do + + end function is_vector_component + + + subroutine regrid_field_scalar(regridder, src_field, dst_field, rc) + class(AbstractRegridder), intent(inout) :: regridder + type(ESMF_Field), intent(in) :: src_field + type(ESMF_Field), intent(inout) :: dst_field + integer, intent(out) :: rc + + type(ESMF_TypeKind_Flag) :: typekind + + real(real32), pointer :: src_2d_r4(:,:), dst_2d_r4(:,:) + real(real32), pointer :: src_3d_r4(:,:,:), dst_3d_r4(:,:,:) + + real(real64), pointer :: src_2d_r8(:,:), dst_2d_r8(:,:) + real(real64), pointer :: src_3d_r8(:,:,:), dst_3d_r8(:,:,:) + + integer :: rank + + call check_fields_and_get_rank_typekind(src_field, dst_field, rank, typekind, rc) + VERIFY_NUOPC_(rc) + + select case(rank) + case(2) + if (typekind == ESMF_TYPEKIND_R4) then + call ESMF_FieldGet(src_field, farrayPtr = src_2d_r4, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(dst_field, farrayPtr = dst_2d_r4, rc = rc) + VERIFY_NUOPC_(rc) + + call regridder%regrid(src_2d_r4, dst_2d_r4, rc = rc) + VERIFY_NUOPC_(rc) + else if(typekind == ESMF_TYPEKIND_R8) then + call ESMF_FieldGet(src_field, farrayPtr = src_2d_r8, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(dst_field, farrayPtr = dst_2d_r8, rc = rc) + VERIFY_NUOPC_(rc) + + call regridder%regrid(src_2d_r8, dst_2d_r8, rc = rc) + VERIFY_NUOPC_(rc) + else + _ASSERT(.false., "Typekind must be real32 or real64") + end if + case(3) + if (typekind == ESMF_TYPEKIND_R4) then + call ESMF_FieldGet(src_field, farrayPtr = src_3d_r4, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(dst_field, farrayPtr = dst_3d_r4, rc = rc) + VERIFY_NUOPC_(rc) + + call regridder%regrid(src_3d_r4, dst_3d_r4, rc = rc) + VERIFY_NUOPC_(rc) + else if(typekind == ESMF_TYPEKIND_R8) then + call ESMF_FieldGet(src_field, farrayPtr = src_3d_r8, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(dst_field, farrayPtr = dst_3d_r8, rc = rc) + VERIFY_NUOPC_(rc) + + call regridder%regrid(src_3d_r8, dst_3d_r8, rc = rc) + VERIFY_NUOPC_(rc) + else + _ASSERT(.false., "Typekind must be real32 or real64") + end if + case default + _ASSERT(.false., "Field rank must be 2 or 3") + end select + + end subroutine regrid_field_scalar + + + + subroutine regrid_field_vector(regridder, x_src_field, y_src_field, x_dst_field, y_dst_field, rc) + class(AbstractRegridder), intent(inout) :: regridder + type(ESMF_Field), intent(in) :: x_src_field, y_src_field + type(ESMF_Field), intent(inout) :: x_dst_field, y_dst_field + integer, intent(out) :: rc + + type(ESMF_TypeKind_Flag) :: typekind + + real(real32), pointer :: x_src_2d_r4(:,:), y_src_2d_r4(:,:), x_dst_2d_r4(:,:), y_dst_2d_r4(:,:) + real(real32), pointer :: x_src_3d_r4(:,:,:), y_src_3d_r4(:,:,:), x_dst_3d_r4(:,:,:), y_dst_3d_r4(:,:,:) + + real(real64), pointer :: x_src_2d_r8(:,:), y_src_2d_r8(:,:), x_dst_2d_r8(:,:), y_dst_2d_r8(:,:) + real(real64), pointer :: x_src_3d_r8(:,:,:), y_src_3d_r8(:,:,:), x_dst_3d_r8(:,:,:), y_dst_3d_r8(:,:,:) + + integer :: rank + + call check_fields_and_get_rank_typekind(x_src_field, x_dst_field, rank, typekind, rc) + VERIFY_NUOPC_(rc) + + select case(rank) + case(2) + if (typekind == ESMF_TYPEKIND_R4) then + call ESMF_FieldGet(x_src_field, farrayPtr = x_src_2d_r4, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(y_src_field, farrayPtr = y_src_2d_r4, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_FieldGet(x_dst_field, farrayPtr = x_dst_2d_r4, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(y_dst_field, farrayPtr = y_dst_2d_r4, rc = rc) + VERIFY_NUOPC_(rc) + + call regridder%regrid(x_src_2d_r4, y_src_2d_r4, x_dst_2d_r4, y_dst_2d_r4, rc = rc) + VERIFY_NUOPC_(rc) + else if(typekind == ESMF_TYPEKIND_R8) then + call ESMF_FieldGet(x_src_field, farrayPtr = x_src_2d_r8, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(y_src_field, farrayPtr = y_src_2d_r8, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_FieldGet(x_dst_field, farrayPtr = x_dst_2d_r8, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(y_dst_field, farrayPtr = y_dst_2d_r8, rc = rc) + VERIFY_NUOPC_(rc) + + call regridder%regrid(x_src_2d_r8, y_src_2d_r8, x_dst_2d_r8, y_dst_2d_r8, rc = rc) + VERIFY_NUOPC_(rc) + else + _ASSERT(.false., "Typekind must be real32 or real64") + end if + case(3) + if (typekind == ESMF_TYPEKIND_R4) then + call ESMF_FieldGet(x_src_field, farrayPtr = x_src_3d_r4, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(y_src_field, farrayPtr = y_src_3d_r4, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_FieldGet(x_dst_field, farrayPtr = x_dst_3d_r4, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(y_dst_field, farrayPtr = y_dst_3d_r4, rc = rc) + VERIFY_NUOPC_(rc) + + call regridder%regrid(x_src_3d_r4, y_src_3d_r4, x_dst_3d_r4, y_dst_3d_r4, rc = rc) + VERIFY_NUOPC_(rc) + else if(typekind == ESMF_TYPEKIND_R8) then + call ESMF_FieldGet(x_src_field, farrayPtr = x_src_3d_r8, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(y_src_field, farrayPtr = y_src_3d_r8, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_FieldGet(x_dst_field, farrayPtr = x_dst_3d_r8, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(y_dst_field, farrayPtr = y_dst_3d_r8, rc = rc) + VERIFY_NUOPC_(rc) + + call regridder%regrid(x_src_3d_r8, y_src_3d_r8, x_dst_3d_r8, y_dst_3d_r8, rc = rc) + VERIFY_NUOPC_(rc) + else + _ASSERT(.false., "Typekind must be real32 or real64") + end if + case default + _ASSERT(.false., "Field rank must be 2 or 3") + end select + + end subroutine regrid_field_vector + + + ! copy field data from state1 to state2 + subroutine copy_state(src_state, dst_state) + type(ESMF_State) :: src_state, dst_state + + integer :: i, rc + character(len=ESMF_MAXSTR), allocatable :: field_names(:) + type(ESMF_Field) :: src_field, dst_field + + field_names = get_state_names(src_state, rc) + VERIFY_NUOPC_(rc) + + do i = 1, size(field_names) + call ESMF_StateGet(src_state, field_names(i), src_field, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_StateGet(dst_state, field_names(i), dst_field, rc = rc) + VERIFY_NUOPC_(rc) + + call copy_field(src_field, dst_field, rc) + VERIFY_NUOPC_(rc) + end do + + end subroutine copy_state + + + subroutine copy_field(src_field, dst_field, rc) + type(ESMF_Field) :: src_field, dst_field + integer, intent(out) :: rc + integer :: field_rank_in, field_rank_out + type(ESMF_TypeKind_Flag) :: typekind_in, typekind_out + + real, pointer :: ptr2d_r4_in(:,:), ptr2d_r4_out(:,:) + real, pointer :: ptr3d_r4_in(:,:,:), ptr3d_r4_out(:,:,:) + + real(real64), pointer :: ptr2d_r8_in(:,:), ptr2d_r8_out(:,:) + real(real64), pointer :: ptr3d_r8_in(:,:,:), ptr3d_r8_out(:,:,:) + + rc = ESMF_SUCCESS + ! add check to make sure that fields match + call ESMF_FieldGet(src_field, typeKind = typekind_in, rank = field_rank_in, rc = rc) + call ESMF_FieldGet(dst_field, typeKind = typekind_out, rank = field_rank_out, rc = rc) + + _ASSERT(field_rank_in == field_rank_out, "Field ranks must match") + + select case(field_rank_in) + case(2) + if (typekind_in == ESMF_TYPEKIND_R4) then + call ESMF_FieldGet(src_field, farrayPtr = ptr2d_r4_in, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(dst_field, farrayPtr = ptr2d_r4_out, rc = rc) + VERIFY_NUOPC_(rc) + ptr2d_r4_out = ptr2d_r4_in + else if (typekind_in == ESMF_TYPEKIND_R8) then + call ESMF_FieldGet(src_field, farrayPtr = ptr2d_r8_in, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(dst_field, farrayPtr = ptr2d_r8_out, rc = rc) + VERIFY_NUOPC_(rc) + ptr2d_r8_out = ptr2d_r8_in + else + print *, "unknown 2d typekind in mediator" + stop + end if + case(3) + if (typekind_in == ESMF_TYPEKIND_R4) then + call ESMF_FieldGet(src_field, farrayPtr = ptr3d_r4_in, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(dst_field, farrayPtr = ptr3d_r4_out, rc = rc) + VERIFY_NUOPC_(rc) + ptr3d_r4_out = ptr3d_r4_in + else if (typekind_in == ESMF_TYPEKIND_R8) then + call ESMF_FieldGet(src_field, farrayPtr = ptr3d_r8_in, rc = rc) + VERIFY_NUOPC_(rc) + call ESMF_FieldGet(dst_field, farrayPtr = ptr3d_r8_out, rc = rc) + VERIFY_NUOPC_(rc) + ptr3d_r8_out = ptr3d_r8_in + else + print *, "unknown type kind in mediator" + stop + end if + end select + end subroutine copy_field + + + function get_internal_state(mediator, rc) result(state) + type(ESMF_GridComp), intent(in) :: mediator + integer, intent(out) :: rc + type(mediator_internal_state), pointer :: state + type(mediator_internal_state_wrapper) :: wrapper + + call ESMF_UserCompGetInternalState(mediator, "internal_state", wrapper, rc) + VERIFY_NUOPC_(rc) + + state => wrapper%ptr + end function get_internal_state + + + function get_grid_from_state(state, rc) result(grid) + type(ESMF_State), intent(in) :: state + integer, intent(out) :: rc + type(ESMF_Grid) :: grid + + integer :: item_count + character(len=ESMF_MAXSTR), allocatable :: item_names(:) + type(ESMF_Field) :: field + + rc = ESMF_SUCCESS + + call ESMF_StateGet(state, itemCount = item_count, rc = rc) + VERIFY_NUOPC_(rc) + + _ASSERT(item_count /= 0, "State has no fields to get state from") + + allocate(item_names(item_count)) + + call ESMF_StateGet(state, itemnamelist = item_names, rc = rc) + VERIFY_NUOPC_(rc) + + ! take the grid from the first item in the state + call ESMF_StateGet(state, item_names(1), field, rc = rc) + VERIFY_NUOPC_(rc) + + call ESMF_FieldGet(field, grid = grid, rc = rc) + VERIFY_NUOPC_(rc) + + end function get_grid_from_state + +end module agcm_ctm_mediator + diff --git a/ESMF/Apps/Mediator_Interpolator.F90 b/ESMF/Apps/Mediator_Interpolator.F90 new file mode 100644 index 00000000..d73ad4ff --- /dev/null +++ b/ESMF/Apps/Mediator_Interpolator.F90 @@ -0,0 +1,119 @@ +module Mediator_InterpolatorMod + use ESMF + use MAPL_Mod + + use, intrinsic :: iso_fortran_env, only: real32, real64 + + implicit none + + private + public Mediator_Interpolator + + type Mediator_Interpolator + type(ESMF_Time) :: t0, t1 ! interpolation window + type(ESMF_State) :: state0, state1 !states to interpolate between + type(ESMF_TimeInterval) :: interval + contains + procedure :: update + procedure :: interpolate + end type Mediator_Interpolator + + interface Mediator_Interpolator + module procedure new_Mediator_Interpolator + end interface Mediator_Interpolator + + interface lerp + module procedure lerp_r4, lerp_r8 + end interface lerp + +contains + + function new_Mediator_Interpolator(start_time, interp_interval) result(interpolator) + type(mediator_interpolator) :: interpolator + type(ESMF_Time), intent(in) :: start_time + type(ESMF_TimeInterval), intent(in) :: interp_interval + interpolator%interval = interp_interval + interpolator%t0 = start_time + interpolator%t1 = start_time + interpolator%interval + end function new_mediator_interpolator + + subroutine update(this) + class(mediator_interpolator) :: this + ! update the time window for interpolation + this%t0 = this%t0 + this%interval + this%t1 = this%t0 + this%interval + end subroutine update + + + subroutine interpolate(this, current_time, in_field0, in_field1, out_field) + class(mediator_interpolator) :: this + type(ESMF_Time) :: current_time + + type(ESMF_Field) :: in_field0, in_field1, out_field + integer :: field_rank + type(ESMF_TypeKind_Flag) :: field_type_kind + integer :: rc + real(real32) :: t + + real(real32), pointer :: in0_ptr2d_r4(:,:), in1_ptr2d_r4(:,:), out_ptr2d_r4(:,:) + real(real32), pointer :: in0_ptr3d_r4(:,:,:), in1_ptr3d_r4(:,:,:), out_ptr3d_r4(:,:,:) + + real(real64), pointer :: in0_ptr2d_r8(:,:), in1_ptr2d_r8(:,:), out_ptr2d_r8(:,:) + real(real64), pointer :: in0_ptr3d_r8(:,:,:), in1_ptr3d_r8(:,:,:), out_ptr3d_r8(:,:,:) + + character(len=ESMF_MAXSTR) :: field_name + + if (current_time < this%t0 .or. current_time > this%t1) then + print *, "interpolation time outside interpolation range" + stop + end if + + call ESMF_FieldGet(in_field0, name = field_name, rc = rc) + + ! add checks that all fields match + call ESMF_FieldGet(in_field0, rank = field_rank, typekind = field_type_kind, rc = rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, & + file=__FILE__)) & + return ! bail out + + t = (current_time - this%t0) / (this%t1 - this%t0) + + if (field_rank == 2 .and. field_type_kind == ESMF_TYPEKIND_R4) then + call ESMF_FieldGet(in_field0, farrayPtr = in0_ptr2d_r4, rc = rc) + call ESMF_FieldGet(in_field1, farrayPtr = in1_ptr2d_r4, rc = rc) + call ESMF_FieldGet(out_field, farrayPtr = out_ptr2d_r4, rc = rc) + call lerp(in0_ptr2d_r4, in1_ptr2d_r4, t, out_ptr2d_r4) + else if(field_rank == 3 .and. field_type_kind == ESMF_TYPEKIND_R4) then + call ESMF_FieldGet(in_field0, farrayPtr = in0_ptr3d_r4, rc = rc) + call ESMF_FieldGet(in_field1, farrayPtr = in1_ptr3d_r4, rc = rc) + call ESMF_FieldGet(out_field, farrayPtr = out_ptr3d_r4, rc = rc) + call lerp(in0_ptr3d_r4, in1_ptr3d_r4, t, out_ptr3d_r4) + else if (field_rank == 2 .and. field_type_kind == ESMF_TYPEKIND_R8) then + call ESMF_FieldGet(in_field0, farrayPtr = in0_ptr2d_r8, rc = rc) + call ESMF_FieldGet(in_field1, farrayPtr = in1_ptr2d_r8, rc = rc) + call ESMF_FieldGet(out_field, farrayPtr = out_ptr2d_r8, rc = rc) + call lerp(in0_ptr2d_r8, in1_ptr2d_r8, t, out_ptr2d_r8) + else if(field_rank == 3 .and. field_type_kind == ESMF_TYPEKIND_R8) then + call ESMF_FieldGet(in_field0, farrayPtr = in0_ptr3d_r8, rc = rc) + call ESMF_FieldGet(in_field1, farrayPtr = in1_ptr3d_r8, rc = rc) + call ESMF_FieldGet(out_field, farrayPtr = out_ptr3d_r8, rc = rc) + call lerp(in0_ptr3d_r8, in1_ptr3d_r8, t, out_ptr3d_r8) + end if + + end subroutine interpolate + + elemental subroutine lerp_r4(v0, v1, t, v_out) + real(real32), intent(in) :: v0, v1, t + real(real32), intent(out) :: v_out + v_out = (1.0 - t) * v0 + t * v1 + end subroutine lerp_r4 + + elemental subroutine lerp_r8(v0, v1, t, v_out) + real(real64), intent(in) :: v0, v1 + real(real32), intent(in) :: t + real(real64), intent(out) :: v_out + v_out = (1.0 - t) * v0 + t * v1 + end subroutine lerp_r8 + +end module Mediator_InterpolatorMod diff --git a/ESMF/Apps/Provider_GridComp.F90 b/ESMF/Apps/Provider_GridComp.F90 new file mode 100644 index 00000000..b1af045c --- /dev/null +++ b/ESMF/Apps/Provider_GridComp.F90 @@ -0,0 +1,205 @@ +#include "MAPL_Generic.h" +#include "NUOPC_ErrLog.h" + +module Provider_GridCompMod + use ESMF + use MAPL + + implicit none + private + + public SetServices + + include "mpif.h" +contains + subroutine SetServices(gc,rc) + type(ESMF_GridComp), intent(INOUT) :: gc + integer, intent( OUT) :: rc + + character(len=ESMF_MAXSTR) :: comp_name + + __Iam__('SetServices') + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + print*, "Provider start SetServices" + call ESMF_LogWrite("Provider start SetServices", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + print*, "Provider SetEntryPoints" + call ESMF_LogWrite("Provider SetEntryPoints", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call MAPL_GridCompSetEntryPoint(gc, ESMF_METHOD_INITIALIZE, Initialize, __RC__) + call MAPL_GridCompSetEntryPoint(gc, ESMF_METHOD_RUN, Run, __RC__) + + print*, "Provider add exports" + call ESMF_LogWrite("Provider add exports", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call MAPL_AddExportSpec(GC,& + short_name='var1', & + long_name='var1' , & + units = 'na', & + dims = MAPL_DimsHorzOnly, & + vlocation = MAPL_VLocationNone, __RC__) + + print*, "Provider Call Generic Set Services" + call MAPL_GenericSetServices(gc, __RC__) + + print*, "Provider finish SetServices" + call ESMF_LogWrite("Provider finish SetServices", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + _RETURN(_SUCCESS) + end subroutine SetServices + + subroutine Initialize(gc, import, export, clock, rc) + type(ESMF_GridComp), intent(inout) :: gc + type(ESMF_State), intent(inout) :: import + type(ESMF_State), intent(inout) :: export + type(ESMF_Clock), intent(inout) :: clock + integer, optional, intent( out) :: rc + + character(len=ESMF_MAXSTR) :: comp_name + + __Iam__('Initialize') + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + print*, "Provider start Initialize" + call ESMF_LogWrite("Provider start Initialize", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + print*, "Provider run MAPL_GridCreate" + call ESMF_LogWrite("Provider run MAPL_GridCreate", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call MAPL_GridCreate(gc, __RC__) + + print*, "Provider run GenericInitialize" + call ESMF_LogWrite("Provider run GenericInitialize", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call MAPL_GenericInitialize(gc, import, export, clock, __RC__) + print*, "Provider run ForceAllocation" + call ESMF_LogWrite("Provider run ForceAllocation", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ForceAllocation(export, __RC__) + + print*, "Provider finish Initialize" + call ESMF_LogWrite("Provider finish Initialize", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + _RETURN(_SUCCESS) + end subroutine Initialize + + subroutine Run(gc, import, export, clock, rc) + type(ESMF_GridComp), intent(inout) :: gc + type(ESMF_State), intent(inout) :: import + type(ESMF_State), intent(inout) :: export + type(ESMF_Clock), intent(inout) :: clock + integer, optional, intent( out) :: rc + + character(len=ESMF_MAXSTR) :: comp_name + real, pointer :: ptr2d(:,:) + + integer :: num_import, num_export + character(len=ESMF_MAXSTR), allocatable :: names_import(:), names_export(:) + character(len=ESMF_MAXSTR) :: name + + type(ESMF_Field) :: field + type(ESMF_Grid) :: grid + + __Iam__('Run') + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + print*, "Provider start Run" + + print*,"Provider set export value" + call MAPL_GetPointer(export, ptr2d, 'var1', __RC__) + ptr2d = ptr2d + 1.0 + print*, "The value var1 is set to is:", minval(ptr2d), maxval(ptr2d) + + print*,"Provider get number of imports" + call ESMF_StateGet(import, itemcount=num_import, rc=rc) + VERIFY_NUOPC_(rc) + print*, "Provider num import:", num_import + + allocate(names_import(num_import)) + print*,"Provider get import names" + call ESMF_StateGet(import, itemnamelist=names_import, rc=rc) + VERIFY_NUOPC_(rc) + print*,"Provider import names are:", names_import + + print*,"Provider get number of exports" + call ESMF_StateGet(export, itemcount=num_export, rc=rc) + VERIFY_NUOPC_(rc) + print*, "Provider num export:", num_export + + allocate(names_export(num_export)) + print*,"Provider get export names" + call ESMF_StateGet(export, itemnamelist=names_export, rc=rc) + VERIFY_NUOPC_(rc) + print*,"Provider export names are:", names_export + + call ESMF_StateGet(export, field=field, itemName="var1", rc=rc) + VERIFY_NUOPC_(rc) + + call ESMF_FieldGet(field, grid=grid, rc=rc) + VERIFY_NUOPC_(rc) + + call ESMF_GridGet(grid, name=name, rc=rc) + print*,"Var1 grid name:", name + + print*, "Provider finish Run" + _RETURN(_SUCCESS) + end subroutine Run + + subroutine ForceAllocation(state, rc) + type(ESMF_State), intent(inout) :: state + integer, optional, intent( out) :: rc + + integer :: itemCount, i, dims + character(len=ESMF_MAXSTR), allocatable :: itemNameList(:) + type(ESMF_StateItem_FLAG), allocatable :: itemTypeList(:) + + type(ESMF_Field) :: field + real, pointer :: ptr2d(:,:), ptr3d(:,:,:) + + __Iam__('ForceAllocation') + + print*, "Provider start ForceAllocation" + call ESMF_LogWrite("Provider start ForceAllocation", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + call ESMF_StateGet(state, itemCount=itemCount, __RC__) + allocate(itemNameList(itemCount), stat=status) + VERIFY_(status) + allocate(itemTypeList(itemCount), stat=status) + VERIFY_(status) + + call ESMF_StateGet(state, itemNameList=itemNameList, & + itemTypeList=itemTypeList, __RC__) + + if (itemCount /= 0) then + do i=1, itemCount + if (itemTypeList(i) == ESMF_STATEITEM_FIELD) then + call ESMF_StateGet(state, trim(itemNameList(i)), field, __RC__) + call ESMF_AttributeGet(field, name='DIMS', value=dims, __RC__) + if (dims == MAPL_DimsHorzOnly) then + call MAPL_GetPointer(state, ptr2d, trim(itemNameList(i)), & + alloc=.true., __RC__) + else if (dims == MAPL_DimsHorzVert) then + call MAPL_GetPointer(state, ptr3d, trim(itemNameList(i)), & + alloc=.true., __RC__) + else + _ASSERT((1 == 2), "invalid field for test defined") + end if + end if + end do + end if + + print*, "Provider finish ForceAllocation" + call ESMF_LogWrite("Provider finish ForceAllocation", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + _RETURN(_SUCCESS) + end subroutine ForceAllocation +end module Provider_GridCompMod + diff --git a/ESMF/Apps/Reciever_GridComp.F90 b/ESMF/Apps/Reciever_GridComp.F90 new file mode 100644 index 00000000..c692d4c4 --- /dev/null +++ b/ESMF/Apps/Reciever_GridComp.F90 @@ -0,0 +1,171 @@ +#include "MAPL_Generic.h" +#include "NUOPC_ErrLog.h" + +module Reciever_GridCompMod + use ESMF + use MAPL + + implicit none + private + + public SetServices + + include "mpif.h" +contains + subroutine SetServices(gc, rc) + type(ESMF_GridComp), intent(inout) :: gc + integer, intent( out) :: rc + + character(len=ESMF_MAXSTR) :: comp_name + + __Iam__('SetServices') + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + print*, "Reciever start Set Services" + + print*, "Reciever Entry Points" + call MAPL_GridCompSetEntryPoint(gc, ESMF_METHOD_INITIALIZE, Initialize, __RC__) + call MAPL_GridCompSetEntryPoint(gc, ESMF_METHOD_RUN, Run, __RC__) + + print*, "Reciever set import" + call MAPL_AddImportSpec(gc, & + short_name='var1', & + long_name='var1', & + units='na', & + dims=MAPL_DimsHorzOnly, & + vlocation=MAPL_VLocationNone, __RC__) +! call MAPL_AddImportSpec(gc, & +! short_name='var2', & +! long_name='var2', & +! units='na', & +! dims=MAPL_DimsHorzOnly, & +! vlocation=MAPL_VLocationNone, __RC__) + + print*, "Reciever Call Generic Set Services" + call MAPL_GenericSetServices(gc, __RC__) + + print*, "Reciever finish Set Services" + _RETURN(_SUCCESS) + end subroutine SetServices + + subroutine Initialize(gc, import, export, clock, rc) + type(ESMF_GridComp), intent(inout) :: gc + type(ESMF_State), intent(inout) :: import + type(ESMF_State), intent(inout) :: export + type(ESMF_Clock), intent(inout) :: clock + integer, optional, intent( out) :: rc + + character(len=ESMF_MAXSTR) :: comp_name + + __Iam__('Initialize') + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + print*, "Reciever start Initialize" + + print*, "Provider MAPL_GridCreate" + call MAPL_GridCreate(gc, __RC__) + + print*, "Reciever Generic initialize" + call MAPL_GenericInitialize(gc, import, export, clock, __RC__) + + print*, "Reciever Force allocate" + call ForceAllocation(import, __RC__) + + print*, "Reciever finish Initialize" + _RETURN(_SUCCESS) + end subroutine Initialize + + subroutine Run(gc, import, export, clock, rc) + type(ESMF_GridComp), intent(inout) :: gc + type(ESMF_State), intent(inout) :: import + type(ESMF_State), intent(inout) :: export + type(ESMF_Clock), intent(inout) :: clock + integer, optional, intent( out) :: rc + + character(len=ESMF_MAXSTR) :: comp_name + real, pointer :: ptr2d(:,:) + + integer :: num_import, num_export + character(len=ESMF_MAXSTR), allocatable :: names_import(:), names_export(:) + + __Iam__('Run') + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + + print*, "Reciever start Run" + + print*,"Reciever get import value" + call MAPL_GetPointer(import, ptr2d, 'var1', __RC__) + print*, 'The value of var1 is:', minval(ptr2d), maxval(ptr2d) + + print*,"Reciever get number of imports" + call ESMF_StateGet(import, itemcount=num_import, rc=rc) + VERIFY_NUOPC_(rc) + print*, "Reciever num import:", num_import + + allocate(names_import(num_import)) + print*,"Reciever get import names" + call ESMF_StateGet(import, itemnamelist=names_import, rc=rc) + VERIFY_NUOPC_(rc) + print*,"Reciever import names are:", names_import + + print*,"Reciever get number of exports" + call ESMF_StateGet(export, itemcount=num_export, rc=rc) + VERIFY_NUOPC_(rc) + print*, "Reciever num export:", num_export + + allocate(names_export(num_export)) + print*,"Reciever get export names" + call ESMF_StateGet(export, itemnamelist=names_export, rc=rc) + VERIFY_NUOPC_(rc) + print*,"Reciever export names are:", names_export + + print*, "Reciever finish Run" + _RETURN(_SUCCESS) + end subroutine Run + + subroutine ForceAllocation(state, rc) + type(ESMF_State), intent(inout) :: state + integer, optional, intent( out) :: rc + + integer :: itemCount, i, dims + character(len=ESMF_MAXSTR), allocatable :: itemNameList(:) + type(ESMF_StateItem_FLAG), allocatable :: itemTypeList(:) + + type(ESMF_Field) :: field + real, pointer :: ptr2d(:,:), ptr3d(:,:,:) + + __Iam__('ForceAllocation') + + call ESMF_StateGet(state, itemCount=itemCount, __RC__) + allocate(itemNameList(itemCount), stat=status) + VERIFY_(status) + allocate(itemTypeList(itemCount), stat=status) + VERIFY_(status) + + call ESMF_StateGet(state, itemNameList=itemNameList, & + itemTypeList=itemTypeList, __RC__) + + if (itemCount /= 0) then + do i=1, itemCount + if (itemTypeList(i) == ESMF_STATEITEM_FIELD) then + call ESMF_StateGet(state, trim(itemNameList(i)), field, __RC__) + call ESMF_AttributeGet(field, name='DIMS', value=dims, __RC__) + if (dims == MAPL_DimsHorzOnly) then + call MAPL_GetPointer(state, ptr2d, trim(itemNameList(i)), & + alloc=.true., __RC__) + else if (dims == MAPL_DimsHorzVert) then + call MAPL_GetPointer(state, ptr3d, trim(itemNameList(i)), & + alloc=.true., __RC__) + else + _ASSERT((1 == 2), "invalid field for test defined") + end if + end if + end do + end if + + _RETURN(_SUCCESS) + end subroutine ForceAllocation +end module Reciever_GridCompMod diff --git a/ESMF/Apps/SyntheticApp.F90 b/ESMF/Apps/SyntheticApp.F90 new file mode 100644 index 00000000..ab2796f7 --- /dev/null +++ b/ESMF/Apps/SyntheticApp.F90 @@ -0,0 +1,100 @@ +#include "NUOPC_ErrLog.h" + +program SyntheticApp + use ESMF + use NUOPC + use, intrinsic :: iso_fortran_env, only: INT64 + + use synthetic_driver, only: driverSS => SetServices + + implicit none + include "mpif.h" + + integer :: rc, urc, rank, file_unit + integer(kind=INT64) :: t0, t1, count_rate + real :: elapsed_time + type(ESMF_GridComp) :: esmComp + + print*,"start" + + call mpi_init(rc) + VERIFY_ESMF_(rc) + + call mpi_comm_rank(MPI_COMM_WORLD, rank, rc) + VERIFY_ESMF_(rc) + + if (rank == 0) then + call system_clock(t0) + end if + + ! Initialize ESMF + print*,"ESMF initialize" + call ESMF_Initialize(logkindflag=ESMF_LOGKIND_MULTI, rc=rc) + VERIFY_ESMF_(rc) + + print*,"ESMF log start" + call ESMF_LogWrite("esmApp STARTING", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + ! Create the earth system Component + print*,"ESMF create ESM" + call ESMF_LogWrite("esmApp create ESM", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + esmComp = ESMF_GridCompCreate(name="esm", rc=rc) + VERIFY_ESMF_(rc) + + ! SetServices for the earth system Component + print*,"ESM Set Services" + call ESMF_LogWrite("esmApp ESM Set Services", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_GridCompSetServices(esmComp, driverSS, userRc=urc, rc=rc) + VERIFY_ALL_ESMF_(rc, urc) + + ! Call Initialize for the earth system Component + print*,"ESM Initialize" + call ESMF_LogWrite("esmApp ESM Initalize", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_GridCompInitialize(esmComp, userRc=urc, rc=rc) + VERIFY_ALL_ESMF_(rc, urc) + + ! Call Run for earth the system Component + print*,"ESM Run" + call ESMF_LogWrite("esmApp ESM Run", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_GridCompRun(esmComp, userRc=urc, rc=rc) + VERIFY_ALL_ESMF_(rc, urc) + + if (rank == 0) then + call system_clock(t1, count_rate) + open(newunit = file_unit, file = "elapsed_time.txt", & + status = "replace", action = "write") + elapsed_time = (t1 - t0) / real(count_rate) + write(file_unit, '(f0.0)') elapsed_time + close(file_unit) + end if + + ! Call Finalize for the earth system Component + print*,"ESM Finalize" + call ESMF_LogWrite("esmApp ESM Finalize", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_GridCompFinalize(esmComp, userRc=urc, rc=rc) + VERIFY_ALL_ESMF_(rc, urc) + + ! Destroy the earth system Component + print*,"ESM Destroy" + call ESMF_LogWrite("esmApp ESM Destroy", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_GridCompDestroy(esmComp, rc=rc) + VERIFY_ESMF_(rc) + + CALL MPI_Comm_set_errhandler(MPI_COMM_WORLD,MPI_ERRORS_RETURN,rc) + print*,"ESMF log finish" + call ESMF_LogWrite("esmApp FINISHED", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + ! Finalize ESMF + print*,"ESMF finalize" + call ESMF_Finalize() + + print*,"complete" +end program SyntheticApp diff --git a/ESMF/Apps/Synthetic_Driver.F90 b/ESMF/Apps/Synthetic_Driver.F90 new file mode 100644 index 00000000..0684b9fc --- /dev/null +++ b/ESMF/Apps/Synthetic_Driver.F90 @@ -0,0 +1,377 @@ +#include "MAPL_Generic.h" +#include "NUOPC_ErrLog.h" + +module synthetic_driver + use ESMF + use NUOPC + use NUOPC_Driver, & + driverSS => SetServices, & + modelSS => label_SetModelServices, & + runSS => label_SetRunSequence + + use MAPL + ! use MAPL_NUOPCWrapperMod, only: wrapperSS => SetServices, init_wrapper + use NUOPC_MAPLcapMod, only: wrapperSS => SetServices, init_internal_wrapper + use NUOPC_Connector, only: cplSS => SetServices + + use Provider_GridCompMod, only: providerSS => SetServices + use Reciever_GridCompMod, only: recieverSS => SetServices + + use UFS_Testing_Cap, only: ufsSS => SetServices + + implicit none + private + + public SetServices +contains + subroutine SetServices(driver, rc) + type(ESMF_GridComp) :: driver + integer, intent(out) :: rc + type(ESMF_Config) :: config + + print*, "Driver start SetServices" + call ESMF_LogWrite("Driver start SetServices", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + ! NUOPC_Driver registers the generic methods + print*,"Driver add Generic SetServices" + call ESMF_LogWrite("Driver add Generic SetServices", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call NUOPC_CompDerive(driver, driverSS, rc=rc) + VERIFY_NUOPC_(rc) + + ! attach specializing method(s) + print*,"Driver add SetModelServices" + call ESMF_LogWrite("Driver add SetModelServices", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call NUOPC_CompSpecialize(driver, specLabel=modelSS, & + specRoutine=SetModelServices, rc=rc) + VERIFY_NUOPC_(rc) + + print*,"Driver add Set Run Sequence" + call ESMF_LogWrite("Driver add Set Run Sequence", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call NUOPC_CompSpecialize(driver, specLabel=runSS, & + specRoutine=SetRunSequence, rc=rc) + VERIFY_NUOPC_(rc) + + print*,"Driver create config" + call ESMF_LogWrite("Driver create config", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + config = ESMF_ConfigCreate(rc=rc) + VERIFY_NUOPC_(rc) + print*,"Driver read config" + call ESMF_LogWrite("Driver read config", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_ConfigLoadFile(config, "NUOPC_run_config.txt", rc=rc) + VERIFY_NUOPC_(rc) + print*,"Driver add config" + call ESMF_LogWrite("Driver add config", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_GridCompSet(driver, config=config, rc=rc) + VERIFY_NUOPC_(rc) + + print*, "Driver finish SetServices" + call ESMF_LogWrite("Driver finish SetServices", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + _RETURN(_SUCCESS) + end subroutine SetServices + + subroutine SetModelServices(driver, rc) + type(ESMF_GridComp) :: driver + integer, intent(out) :: rc + + type(ESMF_GridComp) :: provider, reciever, ufs + type(ESMF_CplComp) :: connector + type(ESMF_VM) :: vm + type(ESMF_Config) :: config + + logical :: seq + integer :: i, npes, n_provider_pes, n_reciever_pes, n_ufs_pes + integer, allocatable :: provider_petlist(:), reciever_petlist(:), ufs_petlist(:) + + print*, "Driver start Set Model Services" + call ESMF_LogWrite("Driver start SetModelServices", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + print*,"Driver run set_clock" + call ESMF_LogWrite("Driver run set_clock", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call set_clock(driver) + + print*,"Driver read the config" + call ESMF_LogWrite("Driver read the config", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_GridCompGet(driver, vm=vm, config=config, rc=rc) + VERIFY_NUOPC_(rc) + print*,"Driver read npes" + call ESMF_LogWrite("Driver read npes", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_VMGet(vm, petCount=npes, rc=rc) + VERIFY_NUOPC_(rc) + + print*,"Driver read values from config" + call ESMF_LogWrite("Driver values from config", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_ConfigGetAttribute(config, seq, label="sequential:", rc=rc) + VERIFY_NUOPC_(rc) + call ESMF_ConfigGetAttribute(config, n_provider_pes, & + label="provider_pets:", rc=rc) + VERIFY_NUOPC_(rc) + ! call ESMF_ConfigGetAttribute(config, n_reciever_pes, & + ! label="reciever_pets:", rc=rc) + ! VERIFY_NUOPC_(rc) +! call ESMF_ConfigGetAttribute(config, n_ufs_pes, & +! label="ufs_pets:", rc=rc) +! VERIFY_NUOPC_(rc) + + ! call NUOPC_CompAttributeSet(driver, 'Diagnostic', 'max', rc=rc) + ! VERIFY_NUOPC_(rc) + + print*,"Driver create pet lists" + call ESMF_LogWrite("Driver create pet lists", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + allocate(provider_petlist(n_provider_pes)) + ! allocate(reciever_petlist(n_reciever_pes)) +! allocate(ufs_petlist(n_ufs_pes)) + + if (seq) then + ! _ASSERT((n_provider_pes == n_reciever_pes), "provider_pets must be equal to reciever_pets in sequential") +! _ASSERT((n_provider_pes == n_ufs_pes), "provider_pets must be equal to ufs_pets in sequential") + _ASSERT((n_provider_pes == npes), "provider_pets must be equal to number of pets in sequential") + + provider_petlist = [(i, i = 0, n_provider_pes - 1)] + ! reciever_petlist = [(i, i = 0, n_reciever_pes - 1)] +! ufs_petlist = [(i, i = 0, n_ufs_pes - 1)] + else +! _ASSERT(((n_provider_pes + n_reciever_pes + n_ufs_pes) == npes), "provider_pets + reciever_pets + ufs_pets must be equal to number of pets") + ! _ASSERT(((n_provider_pes + n_reciever_pes) == npes), "provider_pets + reciever_pets must be equal to number of pets") + + provider_petlist = [(i, i = 0, n_provider_pes - 1)] + ! reciever_petlist = [(i, i = n_provider_pes, npes - 1)] +! reciever_petlist = [(i, i = n_provider_pes, n_provider_pes + n_reciever_pes - 1)] +! ufs_petlist = [(i, i = n_provider_pes + n_reciever_pes, npes - 1)] + + print*,"Conncurrent mode" + end if + + print*, "Sequential? :", seq + print*, "Provider_petlist:", provider_petlist + ! print*, "Reciever_petlist:", reciever_petlist +! print*, "UFS_petlist:", ufs_petlist + + print*,"Driver add provider" + call ESMF_LogWrite("Driver add provider", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call NUOPC_DriverAddComp(driver, "provider", wrapperSS, comp=provider, & + petlist=provider_petlist, rc=rc) + VERIFY_NUOPC_(rc) + print*,"Driver wrap provider MAPL" + call ESMF_LogWrite("Driver wrap provider MAPL", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + call NUOPC_CompAttributeSet(provider, 'Verbosity', 'high', rc=rc) + VERIFY_NUOPC_(rc) + call NUOPC_CompAttributeSet(provider, 'Diagnostic', 'max', rc=rc) + VERIFY_NUOPC_(rc) + + ! call init_wrapper(wrapper_gc=provider, name="provider", & + ! cap_rc_file="PROVIDER_CAP.rc", root_set_services=providerSS, rc=rc) + ! VERIFY_NUOPC_(rc) + call init_internal_wrapper(gc=provider, name="provider", & + rc_file="PROVIDER_CAP.rc", root_set_services=providerSS, rc=rc) + VERIFY_NUOPC_(rc) + + ! print*,"Driver add reciever" + ! call NUOPC_DriverAddComp(driver, "reciever", wrapperSS, comp=reciever, & + ! petlist=reciever_petlist, rc=rc) + ! VERIFY_NUOPC_(rc) + ! print*,"Driver wrap reciever MAPL" + ! ! call init_wrapper(wrapper_gc=reciever, name="reciever", & + ! ! cap_rc_file="RECIEVER_CAP.rc", root_set_services=recieverSS, rc=rc) + ! ! VERIFY_NUOPC_(rc) + ! call init_internal_wrapper(gc=reciever, name="reciever", & + ! rc_file="RECIEVER_CAP.rc", root_set_services=recieverSS, rc=rc) + ! VERIFY_NUOPC_(rc) + +! print*,"Driver add ufs" +! call NUOPC_DriverAddComp(driver, "ufs", ufsSS, comp=ufs, & +! petlist=ufs_petlist, rc=rc) +! VERIFY_NUOPC_(rc) + + ! print*,"Driver connect compoinents" + ! call NUOPC_DriverAddComp(driver, srcCompLabel="provider", dstCompLabel="reciever", & + ! compSetServicesRoutine=cplSS, comp=connector, rc=rc) + ! VERIFY_NUOPC_(rc) + ! call NUOPC_DriverAddComp(driver, srcCompLabel="provider", dstCompLabel="ufs", & + ! compSetServicesRoutine=cplSS, comp=connector, rc=rc) + ! VERIFY_NUOPC_(rc) +! call NUOPC_DriverAddComp(driver, srcCompLabel="ufs", dstCompLabel="reciever", & +! compSetServicesRoutine=cplSS, comp=connector, rc=rc) +! VERIFY_NUOPC_(rc) + + print*, "Driver finish SetModelServices" + call ESMF_LogWrite("Driver finish SetModelServices", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + _RETURN(_SUCCESS) + end subroutine SetModelServices + + subroutine set_clock(driver) + type(ESMF_GridComp), intent(inout) :: driver + + type(ESMF_Time) :: startTime + type(ESMF_Time) :: stopTime + type(ESMF_TimeInterval) :: timeStep + type(ESMF_Clock) :: internalClock + type(ESMF_Config) :: config + + integer :: start_date_and_time(2), end_date_and_time(2), dt, file_unit, yy, mm, dd, h, m, s, rc + + print*, "Driver start set_clock" + call ESMF_LogWrite("Driver start set_clock", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + print*, "Driver read start time" + call ESMF_LogWrite("Driver read start time", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + ! Read the start time + open(newunit = file_unit, file = "cap_restart", form = 'formatted', & + status = 'old', action = 'read') + read(file_unit, *) start_date_and_time + close(file_unit) + + print*, "Driver unpack start time" + call ESMF_LogWrite("Driver unpack start time", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call UnpackDateTime(start_date_and_time, yy, mm, dd, h, m, s) + ! Set the start time + print*, "Driver set start time" + call ESMF_LogWrite("Driver set start time", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_TimeSet(startTime, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, & + calkindflag=ESMF_CALKIND_GREGORIAN, rc=rc) + VERIFY_NUOPC_(rc) + + print*, "Driver read the config" + call ESMF_LogWrite("Driver read the config", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_GridCompGet(driver, config = config, rc = rc) + VERIFY_NUOPC_(rc) + + ! Read the end time + print*, "Driver read end time" + call ESMF_LogWrite("Driver read end time", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_ConfigGetAttribute(config, end_date_and_time(1), & + label="end_date:", rc=rc) + VERIFY_NUOPC_(rc) + call ESMF_ConfigGetAttribute(config, end_date_and_time(2), & + label="end_time:", rc=rc) + VERIFY_NUOPC_(rc) + + print*, "Driver unpack end time" + call ESMF_LogWrite("Driver unpack end time", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call UnpackDateTime(end_date_and_time, yy, mm, dd, h, m, s) + ! Set the end time + print*, "Driver set end time" + call ESMF_LogWrite("Driver set end time", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_TimeSet(stopTime, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, & + calkindflag=ESMF_CALKIND_GREGORIAN, rc=rc) + VERIFY_NUOPC_(rc) + + ! Read the interpolation time interval + print*, "Driver read interpolation interval" + call ESMF_LogWrite("Driver read interpolation interval", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_ConfigGetAttribute(config, dt, label="interpolation_dt:", rc = rc) + VERIFY_NUOPC_(rc) + + ! Set the time interval + print*, "Driver create time interval" + call ESMF_LogWrite("Driver create time interval", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_TimeIntervalSet(timeStep, s=dt, rc=rc) + VERIFY_NUOPC_(rc) + + print*, "Driver create the clock" + call ESMF_LogWrite("Driver create the clock", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + internalClock = ESMF_ClockCreate(name="Driver Clock", timeStep=timeStep, & + startTime=startTime, stopTime=stopTime, rc=rc) + VERIFY_NUOPC_(rc) + + ! Set the driver clock + print*, "Driver set the clock" + call ESMF_LogWrite("Driver set the clock", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_GridCompSet(driver, clock=internalClock, rc=rc) + VERIFY_NUOPC_(rc) + + print*, "Driver finish set_clock" + call ESMF_LogWrite("Driver finish set_clock", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + contains + subroutine UnpackDateTime(DATETIME, YY, MM, DD, H, M, S) + integer, intent(IN ) :: DATETIME(:) + integer, intent( OUT) :: YY, MM, DD, H, M, S + + YY = datetime(1)/10000 + MM = mod(datetime(1),10000)/100 + DD = mod(datetime(1),100) + H = datetime(2)/10000 + M = mod(datetime(2),10000)/100 + S = mod(datetime(2),100) + return + end subroutine UnpackDateTime + end subroutine set_clock + + subroutine SetRunSequence(driver, rc) + type(ESMF_GridComp) :: driver + integer, intent(out) :: rc + + ! local variables + type(ESMF_Time) :: startTime, stopTime + type(ESMF_TimeInterval) :: timeStep + type(ESMF_Config) :: config + type(NUOPC_FreeFormat) :: run_sequence_ff + + print*, "Driver start SetRunSequence" + call ESMF_LogWrite("Driver start SetRunSequence", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + print*,"Driver read the config" + call ESMF_LogWrite("Driver read the config", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call ESMF_GridCompGet(driver, config=config, rc=rc) + VERIFY_NUOPC_(rc) + + print*,"Driver read run sequence" + call ESMF_LogWrite("Driver read run sequence", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + run_sequence_ff = NUOPC_FreeFormatCreate(config, label="run_sequence::", rc=rc) + VERIFY_NUOPC_(rc) + + ! ingest FreeFormat run sequence + print*,"Driver ingest run sequence" + call ESMF_LogWrite("Driver ingest run sequence", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call NUOPC_DriverIngestRunSequence(driver, run_sequence_ff, rc=rc) + VERIFY_NUOPC_(rc) + + print*,"Driver destroy run sequence" + call ESMF_LogWrite("Driver destroy run sequence", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + call NUOPC_FreeFormatDestroy(run_sequence_ff, rc=rc) + VERIFY_NUOPC_(rc) + + print*, "Driver finish SetRunSequence" + call ESMF_LogWrite("Driver finish SetRunSequence", ESMF_LOGMSG_INFO, rc=rc) + VERIFY_ESMF_(rc) + + _RETURN(_SUCCESS) + end subroutine SetRunSequence +end module synthetic_driver diff --git a/ESMF/Apps/UFS_TestingCap.F90 b/ESMF/Apps/UFS_TestingCap.F90 new file mode 100644 index 00000000..0e8ff4f2 --- /dev/null +++ b/ESMF/Apps/UFS_TestingCap.F90 @@ -0,0 +1,432 @@ +#include "NUOPC_ErrLog.h" +#include "MAPL_Generic.h" + +module UFS_Testing_Cap + use ESMF + use NUOPC + use NUOPC_Model, & + ufsSS => SetServices, & + ufsDI => label_DataInitialize, & + ufsLA => label_Advance + + use MAPL + + implicit none + private + + public SetServices + + integer, parameter :: ImportFieldCount = 1 + character(len=*), dimension(ImportFieldCount), parameter :: & + ImportFieldNames = [ & + "var1" & + ] + + ! integer, parameter :: ExportFieldCount = 1 + ! character(len=*), dimension(ExportFieldCount), parameter :: & + ! ExportFieldNames = [ & + ! "var2" & + ! ] + + type FieldSpec + character(len=:), allocatable :: name + type(ESMF_TYPEKIND_Flag) :: typekind + integer, allocatable :: grid_to_field_map(:), & + ungridded_lbound(:), & + ungridded_ubound(:) + integer :: dims, vlocation + contains + procedure :: populate_from_field + procedure :: complete_field_in_state + procedure :: complete_field + procedure :: create_field + end type FieldSpec +contains + subroutine populate_from_field(this, field, rc) + class(FieldSpec), intent(inout) :: this + type(ESMF_Field), intent(in ) :: field + integer, intent( out) :: rc + + integer :: typekind_int, item_count + character(len=ESMF_MAXSTR) :: field_name + + rc = ESMF_SUCCESS + + ! Get the field's name + call ESMF_FieldGet(field, name=field_name, rc=rc) + VERIFY_NUOPC_(rc) + this%name = trim(field_name) + + ! Get the field's typekind + call ESMF_AttributeGet(field, name='TypeKind', convention='NUOPC', & + purpose='Instance', value=typekind_int, rc=rc) + VERIFY_NUOPC_(rc) + this%typekind = typekind_int + + ! Get the field's grid_to_field_map + call NUOPC_GetAttribute(field, name='GridToFieldMap', & + itemCount=item_count, rc=rc) + VERIFY_NUOPC_(rc) + if (item_count > 0) then + allocate(this%grid_to_field_map(item_count)) + call ESMF_AttributeGet(field, name='GridToFieldMap', & + convention='NUOPC', purpose='Instance', & + valueList=this%grid_to_field_map, rc=rc) + VERIFY_NUOPC_(rc) + end if + + ! Get the field's ungridded lbound + call NUOPC_GetAttribute(field, name='UngriddedLBound', & + itemCount=item_count, rc=rc) + VERIFY_NUOPC_(rc) + if (item_count > 0) then + allocate(this%grid_to_field_map(item_count)) + call ESMF_AttributeGet(field, name='UngriddedLBound', & + convention='NUOPC', purpose='Instance', & + valueList=this%ungridded_lbound, rc=rc) + VERIFY_NUOPC_(rc) + end if + + ! Get the field's ungridded ubound + call NUOPC_GetAttribute(field, name='UngriddedUBound', & + itemCount=item_count, rc=rc) + VERIFY_NUOPC_(rc) + if (item_count > 0) then + allocate(this%grid_to_field_map(item_count)) + call ESMF_AttributeGet(field, name='UngriddedUBound', & + convention='NUOPC', purpose='Instance', & + valueList=this%ungridded_ubound, rc=rc) + VERIFY_NUOPC_(rc) + end if + end subroutine populate_from_field + + subroutine complete_field_in_state(this, state, rc) + class(FieldSpec), intent(in ) :: this + type(ESMF_State), intent(inout) :: state + integer, intent( out) :: rc + + type(ESMF_Field) :: field + + rc = ESMF_SUCCESS + + call ESMF_StateGet(state, field=field, itemName=this%name, rc=rc) + VERIFY_NUOPC_(rc) + + call this%complete_field(field, rc=rc) + VERIFY_NUOPC_(rc) + end subroutine complete_field_in_state + + subroutine complete_field(this, field, rc) + class(FieldSpec), intent(in ) :: this + type(ESMF_Field), intent(inout) :: field + integer, intent( out) :: rc + + rc = ESMF_SUCCESS + + if (allocated(this%ungridded_lbound) .and. & + allocated(this%ungridded_ubound)) then + call ESMF_FieldEmptyComplete(field, typekind=this%typekind, & + gridToFieldMap=this%grid_to_field_map, & + ungriddedLBound=this%ungridded_lbound, & + ungriddedUBound=this%ungridded_ubound, & + rc=rc) + VERIFY_NUOPC_(rc) + else + call ESMF_FieldEmptyComplete(field, this%typekind, & + gridToFieldMap=this%grid_to_field_map, rc=rc) + VERIFY_NUOPC_(rc) + end if + end subroutine complete_field + + function create_field(this, grid, rc) result(field) + class(FieldSpec), intent(in ) :: this + type(ESMF_Grid), intent(in ) :: grid + integer, intent( out) :: rc + type(ESMF_Field) :: field + + rc = ESMF_SUCCESS + + if (allocated(this%ungridded_lbound) .and. & + allocated(this%ungridded_ubound)) then + field = ESMF_FieldCreate(grid, name=this%name, & + typekind=this%typekind, & + gridToFieldMap=this%grid_to_field_map, & + ungriddedLBound=this%ungridded_lbound, & + ungriddedUBound=this%ungridded_ubound, & + rc=rc) + VERIFY_NUOPC_(rc) + else +! call ESMF_FieldCreate(grid, name=this%name, & +! typekind=this%typekind, & +! gridToFieldMap=this%grid_to_field_map, rc=rc) +! VERIFY_NUOPC_(rc) + end if + end function create_field + + subroutine SetServices(model, rc) + type(ESMF_GridComp) :: model + integer, intent(out) :: rc + + rc = ESMF_SUCCESS + + print*,"UFS start SetServices" + + ! Register NUOPC generic methods + call NUOPC_CompDerive(model, ufsSS, rc=rc) + VERIFY_NUOPC_(rc) + + call ESMF_GridCompSetEntryPoint(model, ESMF_METHOD_INITIALIZE, & + userRoutine=initialize_p0, phase=0, rc=rc) + VERIFY_NUOPC_(rc) + + ! set entry point for methods that require specific implementation + print*,"UFS register advertise fields" + call NUOPC_CompSetEntryPoint(model, ESMF_METHOD_INITIALIZE,& + phaseLabelList=["IPDv05p1"], userRoutine=AdvertiseFields, rc=rc) + VERIFY_NUOPC_(rc) + + print*,"UFS register realize fields" + call NUOPC_CompSetEntryPoint(model, ESMF_METHOD_INITIALIZE,& + phaseLabelList=["IPDv05p6"], userRoutine=RealizeFields, rc=rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(model, specLabel=ufsDI, & + specRoutine=initialize_data, rc=rc) + VERIFY_NUOPC_(rc) + + ! attach specializing method + call NUOPC_CompSpecialize(model, specLabel=ufsLA, & + specRoutine=ModelAdvance, rc=rc) + VERIFY_NUOPC_(rc) + + call NUOPC_CompSpecialize(model, specLabel=label_Finalize, & + specRoutine=model_finalize, rc=rc) + VERIFY_NUOPC_(rc) + + print*,"UFS finish SetServices" + end subroutine SetServices + + subroutine initialize_p0(model, import_state, export_state, clock, rc) + type(ESMF_GridComp) :: model + type(ESMF_State) :: import_state, export_state + type(ESMF_Clock) :: clock + integer, intent(out) :: rc + + rc = ESMF_SUCCESS + + print*,"UFS start initialize_p0" + + call NUOPC_CompFilterPhaseMap(model, ESMF_METHOD_INITIALIZE, & + acceptStringList=(/"IPDv05p"/), rc=rc) + VERIFY_NUOPC_(rc) + + print*,"UFS finish initialize_p0" + end subroutine initialize_p0 + + subroutine AdvertiseFields(model, import_state, export_state, clock, rc) + type(ESMF_GridComp) :: model + type(ESMF_State) :: import_state, export_state + type(ESMF_Clock) :: clock + integer, intent(out) :: rc + + _UNUSED_DUMMY(clock) + + print*,"UFS start advertise" + + rc = ESMF_SUCCESS + + ! if (ImportFieldCount > 0) then + + ! print*,"UFS adding imports to dictionary" + ! if (.not. NUOPC_FieldDictionaryHasEntry("var1")) then + ! call NUOPC_FieldDictionaryAddEntry(standardName="var1", & + ! canonicalUnits="na", rc=rc) + ! VERIFY_NUOPC_(rc) + ! end if + + ! print*,"UFS advertising imports" + ! call NUOPC_Advertise(import_state, StandardName="var1", & + ! TransferOfferGeomObject="cannot provide", rc=rc) + ! ! call NUOPC_Advertise(import_state, ImportFieldNames, & + ! ! ! TransferOfferGeomObject="cannot provide", & + ! ! ! SharePolicyField="share", & + ! ! rc=rc) + ! print*,"UFS advertising imports rc:", rc + ! VERIFY_NUOPC_(rc) + ! end if + + print*,"UFS adding exports to dictionary" + if (.not. NUOPC_FieldDictionaryHasEntry("var2")) then + call NUOPC_FieldDictionaryAddEntry(standardName="var2", & + canonicalUnits="na", rc=rc) + VERIFY_NUOPC_(rc) + end if + print*,"UFS advertising exports" + call NUOPC_Advertise(export_state, StandardName="var2", & + TransferOfferGeomObject="cannot provide", rc=rc) + + print*,"UFS finish advertise" + end subroutine AdvertiseFields + + subroutine RealizeFields(model, import_state, export_state, clock, rc) + type(ESMF_GridComp) :: model + type(ESMF_State) :: import_state, export_state + type(ESMF_Clock) :: clock + integer, intent(out) :: rc + + integer :: num_items_import, num_items_export + character(len=ESMF_MAXSTR), allocatable :: item_names_import(:), item_names_export(:) + type(ESMF_Field) :: field_export, field_to_export + type(ESMF_Grid) :: grid_export + + _UNUSED_DUMMY(clock) + + rc = ESMF_SUCCESS + + print*,"UFS start realize" + + print*, "UFS get number of import items" + call ESMF_StateGet(import_state, itemcount=num_items_import, rc=rc) + VERIFY_NUOPC_(rc) + print*, "UFS num import:", num_items_import + + allocate(item_names_import(num_items_import)) + print*, "UFS get import names" + call ESMF_StateGet(import_state, itemnamelist=item_names_import, rc=rc) + VERIFY_NUOPC_(rc) + print*, "UFS import names are:", item_names_import + + ! ! call ESMF_StateGet(import_state, field=field_import, & + ! ! itemName="var1", rc=rc) + ! ! VERIFY_NUOPC_(rc) + ! ! call NUOPC_Realize(import_state, field_import, rc=rc) + ! ! VERIFY_NUOPC_(rc) + + print*, "UFS get number of export items" + call ESMF_StateGet(export_state, itemcount=num_items_export, rc=rc) + VERIFY_NUOPC_(rc) + print*, "UFS num export:", num_items_export + + allocate(item_names_export(num_items_export)) + print*, "UFS get export names" + call ESMF_StateGet(export_state, itemnamelist=item_names_export, rc=rc) + VERIFY_NUOPC_(rc) + print*, "UFS export names are:", item_names_export + + print*, "UFS create grid for var2" + grid_export = ESMF_GridCreateNoPeriDimUfrm(maxIndex=(/10, 100/), & + minCornerCoord=(/10._ESMF_KIND_R8, 20._ESMF_KIND_R8/), & + maxCornerCoord=(/100._ESMF_KIND_R8, 200._ESMF_KIND_R8/), & + coordSys=ESMF_COORDSYS_CART, & + staggerLocList=(/ESMF_STAGGERLOC_CENTER/), & + rc=rc) + VERIFY_NUOPC_(rc) + + print*, "UFS create field for var2" + field_to_export = ESMF_FieldCreate(name="var2", grid=grid_export, & + typekind=ESMF_TYPEKIND_R8, rc=rc) + VERIFY_NUOPC_(rc) + + ! print*, "UFS complete var2" + ! call ESMF_FieldEmptyComplete(field_to_export, grid_export, rc=rc) + ! VERIFY_NUOPC_(rc) + + print*, "UFS realize var2" + call NUOPC_realize(export_state, field_to_export, rc=rc) + VERIFY_NUOPC_(rc) + + ! ! print*,"UFS create import grid" + ! ! grid_import = ESMF_GridEmptyCreate(rc=rc) + ! ! VERIFY_NUOPC_(rc) + + ! ! print*,"UFS create import grid rc:", rc + + ! ! print*,"UFS create import field" + ! ! field_import = ESMF_FieldCreate(name='var1', grid=grid_import, typekind=ESMF_TYPEKIND_R8, rc=rc) + ! ! VERIFY_NUOPC_(rc) + + ! ! print*,"UFS create import field rc:", rc + + ! ! print*,"UFS nuopc realize import field" + ! ! call NUOPC_Realize(import_state, field_import, rc=rc) + ! ! VERIFY_NUOPC_(rc) + + print*,"UFS finish realize" + end subroutine RealizeFields + + subroutine initialize_data(model, rc) + type(ESMF_GridComp) :: model + integer, intent(out) :: rc + + rc = ESMF_SUCCESS + + call NUOPC_CompAttributeSet(model, name="InitializeDataComplete", & + value="true", rc=rc) + VERIFY_NUOPC_(rc) + + end subroutine initialize_data + + subroutine ModelAdvance(model, rc) + type(ESMF_GridComp) :: model + integer, intent(out) :: rc + + integer :: i, num_items_import, num_items_export + type(ESMF_State) :: import_state, export_state + type(ESMF_Field) :: field + real, pointer :: ptr2d_in(:,:), ptr2d_out(:,:) + + character(len=ESMF_MAXSTR), allocatable :: item_names_import(:), item_names_export(:) + + rc = ESMF_SUCCESS + + print*,"UFS start advance" + + print*, "UFS get import and export states" + call NUOPC_ModelGet(model, importState=import_state, & + exportState=export_state, rc=rc) + VERIFY_NUOPC_(rc) + + print*, "UFS get number of import items" + call ESMF_StateGet(import_state, itemcount=num_items_import, rc=rc) + VERIFY_NUOPC_(rc) + print*, "UFS num import:", num_items_import + + allocate(item_names_import(num_items_import)) + print*, "UFS get import names" + call ESMF_StateGet(import_state, itemnamelist=item_names_import, rc=rc) + VERIFY_NUOPC_(rc) + print*, "UFS import names are:", item_names_import + + print*, "UFS get number of export items" + call ESMF_StateGet(export_state, itemcount=num_items_export, rc=rc) + VERIFY_NUOPC_(rc) + print*, "UFS num export:", num_items_export + + allocate(item_names_export(num_items_export)) + print*, "UFS get export names" + call ESMF_StateGet(export_state, itemnamelist=item_names_export, rc=rc) + VERIFY_NUOPC_(rc) + print*, "UFS export names are:", item_names_export + +! print*, "UFS get imports" +! do i=1, ImportFieldCount +! print*, "UFS get field" +! call ESMF_StateGet(import_state, field=field, & +! itemName=trim(ImportFieldNames(i)), rc=rc) +! VERIFY_NUOPC_(rc) +! print*, "UFS get ptr" +! call ESMF_FieldGet(field, localDE=0, farrayPtr=ptr2d_in, rc=rc) +! VERIFY_NUOPC_(rc) +! +! print*, 'The value of ', trim(ImportFieldNames(i)), ' is:', minval(ptr2d_in), maxval(ptr2d_in) +! end do + print*,"UFS finish advance" + end subroutine ModelAdvance + + subroutine model_finalize(model, rc) + type(ESMF_GridComp) :: model + integer, intent(out) :: rc + + rc = ESMF_SUCCESS + end subroutine model_finalize +end module UFS_Testing_Cap diff --git a/ESMF/Apps/experiment/AEROSOL_CAP.rc b/ESMF/Apps/experiment/AEROSOL_CAP.rc new file mode 100755 index 00000000..8cae7f8b --- /dev/null +++ b/ESMF/Apps/experiment/AEROSOL_CAP.rc @@ -0,0 +1,36 @@ + +MAPLROOT_COMPNAME: AGCM + ROOT_NAME: AGCM +ROOT_CF: AGCM.rc +HIST_CF: AGCM_HISTORY.rc +EXTDATA_CF: AGCM_ExtData.rc + +BEG_DATE: 18910301 000000 +END_DATE: 20201006 000000 +JOB_SGMT: 00010000 000000 +NUM_SGMT: 1 +HEARTBEAT_DT: 900 + +REPORT_THROUGHPUT: .false. + +USE_SHMEM: 0 + +# Parameters for Cycled REPLAY Forecasts +# -------------------------------------- + BEG_REPDATE: YYYYMMDD + END_REPDATE: YYYYMMDD +FCST_SEGMENT: 00000000 + +#PERPETUAL_YEAR: YYYY +#PERPETUAL_MONTH: MM +#PERPETUAL_DAY: DD + +MAPL_ENABLE_TIMERS: YES +MAPL_ENABLE_MEMUTILS: NO +PRINTSPEC: 0 # (0: OFF, 1: IMPORT & EXPORT, 2: IMPORT, 3: EXPORT) + + +CAP_EXPORTS: + ZLE,AGCM +:: + diff --git a/ESMF/Apps/experiment/AGCM.rc b/ESMF/Apps/experiment/AGCM.rc new file mode 100644 index 00000000..f9d10355 --- /dev/null +++ b/ESMF/Apps/experiment/AGCM.rc @@ -0,0 +1,17 @@ + NX: 1 + NY: 1 +# Atmospheric Model Configuration Parameters +# ------------------------------------------ +IOSERVER_NODES: 0 + + DYCORE: NONE + AGCM.NX: 1 + AGCM.NY: 1 + AGCM.GRID_TYPE: LatLon + AGCM.GRIDNAME: PE180x91-DE + AGCM.IM_WORLD: 180 + AGCM.JM_WORLD: 91 + AGCM.DATELINE: 'DC' + AGCM.POLE: 'PC' + AGCM.LM: 72 + diff --git a/ESMF/Apps/experiment/AGCM_ExtData.rc b/ESMF/Apps/experiment/AGCM_ExtData.rc new file mode 100644 index 00000000..e5f9c3bf --- /dev/null +++ b/ESMF/Apps/experiment/AGCM_ExtData.rc @@ -0,0 +1,599 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# QFED-v2.x: emission file provides kg BC m-2 s-1 +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_bc.005.%y4%m2%d2.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA N Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/AeroCom/sfc/AeroCom.noship_BC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 /dev/null + +# EDGAR based ship emissions +BC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/MERRA2/sfc/edgar-v41.emis_bc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CFC12 NA N Y - none none CFC-12_EMISSION ExtData/g5chem/sfc/ARCTAS.CFC12.emission.x540_y361.2008.hdf +%% + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CH4_sfcFluxanimls NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_ANIMLS /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxcoal NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_COAL /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxleak NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_LEAK /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxgasvnt NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_GASVNT /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxhydz NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_HYDZ /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxmsw NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_MSW /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxsoilab NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_SOILAB /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxtrmite NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_TRMITE /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxbogs NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_BOGS /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxburn NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_BURN /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxricec NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_RICEC /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxswamps NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_SWAMPS /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxtundra NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_TUNDRA /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxbf NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_BF /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxtot NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_TOT /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_ohanimls NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohcoal NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohleak NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohgasvnt NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohhydz NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohmsw NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohsoilab NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohtrmite NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohbogs NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohburn NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohricec NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohswamps NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohtundra NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohbf NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohtot NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +# +CH4_regionMask NA N v - none none REGION_MASK ExtData/g5chem/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO2_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 +CO2_FF NA N Y %y4-%m2-%d2t12:00:00 none none emco2ff ExtData/MERRA2/sfc/edgar-v42.emis_co2.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 +CO2_NEP NA Y Y %y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc +CO2_OCN NA Y Y %y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc +CO2_CMS_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/CMS/em.daily.1x1.25.%y4.nc +CO2_CMS_FF NA N Y %y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/CMS/ORNL_TRANSCOM.co2_ff_nep_ocn.x288_y181_t12.%y4.nc +CO2_CMS_NEP NA N Y P0000-00-00T03:00 none none emco2nep ExtData/PIESA/sfc/CMS/casa.3hr.1x1.25.%y4.nc +CO2_CMS_OCN NA N Y %y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/CMS/NOBM_fco2.daily.1x1.25.%y4.nc +CO2_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_co.005.%y4%m2%d2.nc4 +CO_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_CH4 NA N Y %y4-%m2-%d2t12:00:00 none none CH4 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_BF NA Y Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf /dev/null +CO_FS NA N Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/MERRA2/sfc/edgar-v42.emis_co.anthropogenic.x1152_y721.19700703T12z_20200703T00z.w1A4.nc4 +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +DU_SRC NA N Y - none none du_src ExtData/PIESA/sfc/gocart.dust_source.v5a.x1152_y721.nc +%% +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +# GOCART.data - 3D +climdu001 'kg kg-1' Y N 0 0.0 1.0 du001 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu002 'kg kg-1' Y N 0 0.0 1.0 du002 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu003 'kg kg-1' Y N 0 0.0 1.0 du003 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu004 'kg kg-1' Y N 0 0.0 1.0 du004 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu005 'kg kg-1' Y N 0 0.0 1.0 du005 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 + +climss001 'kg kg-1' Y N 0 0.0 1.0 ss001 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss002 'kg kg-1' Y N 0 0.0 1.0 ss002 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss003 'kg kg-1' Y N 0 0.0 1.0 ss003 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss004 'kg kg-1' Y N 0 0.0 1.0 ss004 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss005 'kg kg-1' Y N 0 0.0 1.0 ss005 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 + +climSO4 'kg kg-1' Y N 0 0.0 1.0 SO4 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climDMS 'kg kg-1' Y N - 0.0 1.0 none /dev/null +climMSA 'kg kg-1' Y N - 0.0 1.0 none /dev/null +climSO2 'kg kg-1' Y N - 0.0 1.0 none /dev/null + +climBCphobic 'kg kg-1' Y N 0 0.0 1.0 BCphobic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climBCphilic 'kg kg-1' Y N 0 0.0 1.0 BCphilic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climOCphobic 'kg kg-1' Y N 0 0.0 1.0 OCphobic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climOCphilic 'kg kg-1' Y N 0 0.0 1.0 OCphilic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 + +# GOCART.data - 2D +climDUDP001 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT001 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD001 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV001 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP002 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT002 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD002 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV002 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP003 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT003 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD003 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV003 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP004 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT004 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD004 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV004 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP005 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT005 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD005 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV005 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climBCDP001 'kg m-2 s-1' Y N 0 0.0 1.0 BCDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCWT001 'kg m-2 s-1' Y N 0 0.0 1.0 BCWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCSD001 'kg m-2 s-1' Y N 0 0.0 1.0 BCSD001 /dev/null +climBCSV001 'kg m-2 s-1' Y N 0 0.0 1.0 BCSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climBCDP002 'kg m-2 s-1' Y N 0 0.0 1.0 BCDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCWT002 'kg m-2 s-1' Y N 0 0.0 1.0 BCWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCSD002 'kg m-2 s-1' Y N 0 0.0 1.0 BCSD002 /dev/null +climBCSV002 'kg m-2 s-1' Y N 0 0.0 1.0 BCSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climOCDP001 'kg m-2 s-1' Y N 0 0.0 1.0 OCDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCWT001 'kg m-2 s-1' Y N 0 0.0 1.0 OCWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCSD001 'kg m-2 s-1' Y N 0 0.0 1.0 OCSD001 /dev/null +climOCSV001 'kg m-2 s-1' Y N 0 0.0 1.0 OCSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climOCDP002 'kg m-2 s-1' Y N 0 0.0 1.0 OCDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCWT002 'kg m-2 s-1' Y N 0 0.0 1.0 OCWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCSD002 'kg m-2 s-1' Y N 0 0.0 1.0 OCSD002 /dev/null +climOCSV002 'kg m-2 s-1' Y N 0 0.0 1.0 OCSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP001 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT001 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD001 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD001 /dev/null +climSUSV001 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP002 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT002 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD002 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD002 /dev/null +climSUSV002 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP003 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT003 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD003 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD003 /dev/null +climSUSV003 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP004 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT004 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD004 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD004 /dev/null +climSUSV004 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP001 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT001 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD001 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV001 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP002 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT002 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD002 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV002 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP003 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT003 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD003 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV003 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP004 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT004 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD004 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV004 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP005 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT005 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD005 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV005 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Nitrates +EMI_NH3_BB 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_nh3.005.%y4%m2%d2.nc4 +EMI_NH3_AG 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_EN 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none emi_nh3 ExtData/MERRA2/sfc/edgar-v42.emis_nh3.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 +EMI_NH3_IN 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_RE 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_TR 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_OC 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none emiss_ocn ExtData/PIESA/sfc/GEIA.emis_NH3.ocean.x576_y361.t12.20080715_12z.nc4 + +NITRATE_HNO3 'mol mol-1' Y N %y4-%m2-%d2T12:00:00 none 0.20 hno3 ExtData/PIESA/L72/GMI.vmr_HNO3.x144_y91.t12.2006.nc4 +NI_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +O3_ireg NA Y Y - none none ireg ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID001 NA Y Y - none none iuseVegID001 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID002 NA Y Y - none none iuseVegID002 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID003 NA Y Y - none none iuseVegID003 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID004 NA Y Y - none none iuseVegID004 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID005 NA Y Y - none none iuseVegID005 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID006 NA Y Y - none none iuseVegID006 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID007 NA Y Y - none none iuseVegID007 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID008 NA Y Y - none none iuseVegID008 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID009 NA Y Y - none none iuseVegID009 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID010 NA Y Y - none none iuseVegID010 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID011 NA Y Y - none none iuseVegID011 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID012 NA Y Y - none none iuseVegID012 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID013 NA Y Y - none none iuseVegID013 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID014 NA Y Y - none none iuseVegID014 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID015 NA Y Y - none none iuseVegID015 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID001 NA Y Y - none none ilandVegID001 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID002 NA Y Y - none none ilandVegID002 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID003 NA Y Y - none none ilandVegID003 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID004 NA Y Y - none none ilandVegID004 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID005 NA Y Y - none none ilandVegID005 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID006 NA Y Y - none none ilandVegID006 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID007 NA Y Y - none none ilandVegID007 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID008 NA Y Y - none none ilandVegID008 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID009 NA Y Y - none none ilandVegID009 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID010 NA Y Y - none none ilandVegID010 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID011 NA Y Y - none none ilandVegID011 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID012 NA Y Y - none none ilandVegID012 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID013 NA Y Y - none none ilandVegID013 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID014 NA Y Y - none none ilandVegID014 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID015 NA Y Y - none none ilandVegID015 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_laiVegID001 NA Y Y - none none laiVegID001 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID002 NA Y Y - none none laiVegID002 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID003 NA Y Y - none none laiVegID003 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID004 NA Y Y - none none laiVegID004 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID005 NA Y Y - none none laiVegID005 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID006 NA Y Y - none none laiVegID006 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID007 NA Y Y - none none laiVegID007 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID008 NA Y Y - none none laiVegID008 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID009 NA Y Y - none none laiVegID009 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID010 NA Y Y - none none laiVegID010 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID011 NA Y Y - none none laiVegID011 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID012 NA Y Y - none none laiVegID012 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID013 NA Y Y - none none laiVegID013 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID014 NA Y Y - none none laiVegID014 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID015 NA Y Y - none none laiVegID015 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +%% +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/AeroCom/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA N Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/AeroCom/sfc/AeroCom.noship_OC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +OC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/MERRA2/sfc/edgar-v41.emis_oc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +Rn_EMISSION NA Y Y %y4-%m2-%d2t12:00:00 none none Rn_EMISSION ExtData/g5chem/sfc/gocart.radon.x540_y361.nc +RN_regionMask NA N V - none none REGION_MASK ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc +%% + +DerivedExports%% +Rn_EMISSIONAfri regionmask(Rn_EMISSION,Rn_regionMask;5) %y4-%m2-%d2t12:00:00 +Rn_EMISSIONAsia regionmask(Rn_EMISSION,Rn_regionMask;4) %y4-%m2-%d2t12:00:00 +Rn_EMISSIONAust regionmask(Rn_EMISSION,Rn_regionMask;7) %y4-%m2-%d2t12:00:00 +Rn_EMISSIONEuro regionmask(Rn_EMISSION,Rn_regionMask;3) %y4-%m2-%d2t12:00:00 +Rn_EMISSIONSoAm regionmask(Rn_EMISSION,Rn_regionMask;6) %y4-%m2-%d2t12:00:00 +Rn_EMISSIONNoAm regionmask(Rn_EMISSION,Rn_regionMask;1,2) %y4-%m2-%d2t12:00:00 +%% +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_so2.005.%y4%m2%d2.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA N Y %y4-%m2-%d2t12:00:00 none none sanl1 ExtData/MERRA2/sfc/edgar-v42.emis_so2.non_energy.x1152_y721.19700703T12z_20200703T00z.nc4 +SU_ANTHROL2 NA N Y %y4-%m2-%d2t12:00:00 none none sanl2 ExtData/MERRA2/sfc/edgar-v42.emis_so2.energy.x1152_y721.19700703T12z_20200703T00z.nc4 + +# Ship emissions +SU_SHIPSO2 NA N Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/MERRA2/sfc/edgar-v41.emis_so2.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 +SU_SHIPSO4 NA N Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/MERRA2/sfc/edgar-v41.emis_so4.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aircraft fuel consumption +SU_AIRCRAFT NA N Y %y4-%m2-%d2t12:00:00 none none fuel ExtData/AeroCom/L72/AeroCom.aircraft_fuel.eta.x288_y181_z72_t14.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/MERRA2/sfc/DMSclim_sfcconcentration.x360_y181_t12.Lana2011.nc4 + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none H2O2 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none NO3 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +# +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +# + + +PrimaryExports%% +# -------------|--------------|----|---|----------------------|--------|-----------|----------------------------------------- +# Export | | |Con|_______ Refresh ______|____ Factors _______|____________ External File __________ +# Name | Units |Clim|Rgr| Time Template | Offset | Scale | Variable | Template +# -------------|--------------|----|---|----------------------|--------|-----------|------------------|---------------------- +SRC_2D_CO_25 'kg m-2 s-1' Y Y %y4-%m2-%d2t12:00:00 none none emission_flux ExtData/g5chem/sfc/RETRO.co.x144_y91_t12.2000.nc +SRC_2D_CO_50 'kg m-2 s-1' Y Y %y4-%m2-%d2t12:00:00 none none emission_flux ExtData/g5chem/sfc/RETRO.co.x144_y91_t12.2000.nc +SRC_2D_CO_50_na 'kg m-2 s-1' Y Y %y4-%m2-%d2t12:00:00 none none emission_flux ExtData/g5chem/sfc/RETRO.co.x144_y91_t12.2000.nc +SRC_2D_CO_50_eu 'kg m-2 s-1' Y Y %y4-%m2-%d2t12:00:00 none none emission_flux ExtData/g5chem/sfc/RETRO.co.x144_y91_t12.2000.nc +SRC_2D_CO_50_ea 'kg m-2 s-1' Y Y %y4-%m2-%d2t12:00:00 none none emission_flux ExtData/g5chem/sfc/RETRO.co.x144_y91_t12.2000.nc +SRC_2D_CO_50_sa 'kg m-2 s-1' Y Y %y4-%m2-%d2t12:00:00 none none emission_flux ExtData/g5chem/sfc/RETRO.co.x144_y91_t12.2000.nc +SRC_2D_SF6 'kg m-2 s-1' N Y %y4-%m2-%d2t12:00:00 none none sf6 /discover/nobackup/mmanyin/CCM/EXT_DATA/SF6/EDGAR_IPCC.sf6.x144_y91_t12.%y4.nc +SRC_2D_Rn222 'kg m-2 s-1' N Y - none none Rn222_emissions ExtData/g5chem/sfc/Rn222_Jacob_et_al.x540_y361.nc +SRC_2D_CH3I 'kg m-2 s-1' N N - none 2.35694e-21 unity_array ExtData/g5chem/sfc/unity.x144_y91.nc +# +SRC_3D_Be7 'mol mol-1 s-1' N Y - none none koch_be7_mr ExtData/g5chem/L72/Koch.beryllium.x144_y91_z72.nc4 +SRC_3D_Be10 'mol mol-1 s-1' N Y - none none koch_be10_mr ExtData/g5chem/L72/Koch.beryllium.x144_y91_z72.nc4 +# +# For tracers using dry deposition: +TR_VEG_FRAC 'mil' N N %y4-%m2-%d2t12:00:00 none none VEG_FRAC /discover/nobackup/mmanyin/CCM/emissions/LAI/half_degree/veg_fraction_x720_y360_t12_%y4.nc +TR_LAI_FRAC '1' N N %y4-%m2-%d2t12:00:00 none none LAI_FRAC /discover/nobackup/mmanyin/CCM/emissions/LAI/half_degree/lai_x720_y360_v72_t12_%y4.nc +# +TR_regionMask NA N V - none none REGION_MASK ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc +TR_regionMask2 NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +# -------------|--------------|-----|----|----|---|----------------------|--------|-----------|------------------|---------------------- +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +WSUB_NATURE 'm2 s2' Y N 0 0.0 1.0 w_var_masked ExtData/g5gcm/moist/L72/Wvar_positive_05hrdeg_2006%m2.nc4 +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + diff --git a/ESMF/Apps/experiment/AGCM_HISTORY.rc b/ESMF/Apps/experiment/AGCM_HISTORY.rc new file mode 100644 index 00000000..4a596f99 --- /dev/null +++ b/ESMF/Apps/experiment/AGCM_HISTORY.rc @@ -0,0 +1,1158 @@ +VERSION: 1 +EXPID: ctmgcm_fromscratch +EXPDSC: test +EXPSRC: Jason-3_1 + +COLLECTIONS: +:: + +################################################## +# The GRID_LABELS section must be after the main # +# list of COLLECTIONS for scripting purposes. # +################################################## + +GRID_LABELS: PC360x181-DC +:: + +PC360x181-DC.GRID_TYPE: LatLon +PC360x181-DC.IM_WORLD: 360 +PC360x181-DC.JM_WORLD: 181 +PC360x181-DC.POLE: PC +PC360x181-DC.DATELINE: DC +PC360x181-DC.LM: 72 + + geosgcm_prog.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_prog.archive: '%c/Y%y4', + geosgcm_prog.format: 'CFIO', + geosgcm_prog.frequency: 060000, + geosgcm_prog.grid_label: PC360x181-DC + geosgcm_prog.vscale: 100.0, + geosgcm_prog.vunit: 'hPa', + geosgcm_prog.vvars: 'log(PLE)' , 'DYN' , + geosgcm_prog.levels: 1000 975 950 925 900 875 850 825 800 775 750 725 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 40 30 20 10 7 5 4 3 2 1 0.7 0.5 0.4 0.3 0.2 0.1 0.07 0.05 0.04 0.03 0.02, + geosgcm_prog.fields: 'PHIS' , 'AGCM' , + 'SLP' , 'DYN' , + 'U;V' , 'DYN' , + 'T' , 'DYN' , + 'PS' , 'DYN' , + 'ZLE' , 'DYN' , 'H' , + 'OMEGA' , 'DYN' , + 'Q' , 'MOIST' , 'QV' , + 'QITOT' , 'AGCM' , 'QI' , + 'QLTOT' , 'AGCM' , 'QL' , + 'RH2' , 'MOIST' , 'RH' , + 'O3' , 'CHEMISTRY' , + :: + + geosgcm_surf.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_surf.archive: '%c/Y%y4', + geosgcm_surf.format: 'CFIO', + geosgcm_surf.mode: 'time-averaged', + geosgcm_surf.frequency: 030000, + geosgcm_surf.ref_time: 210000, + geosgcm_surf.grid_label: PC360x181-DC + geosgcm_surf.fields: 'PHIS' , 'AGCM' , + 'SGH' , 'AGCM' , + 'VARFLT' , 'AGCM' , + 'TROPP_EPV' , 'AGCM' , 'TROPPV' , + 'TROPP_THERMAL' , 'AGCM' , 'TROPPT' , + 'TROPP_BLENDED' , 'AGCM' , 'TROPPB' , + 'TROPT' , 'AGCM' , + 'TROPQ' , 'AGCM' , + 'QVFILL' , 'AGCM' , + 'OXFILL' , 'AGCM' , + 'TA' , 'DYN' , + 'QA' , 'DYN' , + 'US;VS' , 'DYN' , + 'PS' , 'DYN' , + 'SPEED' , 'DYN' , + 'ZPBL' , 'TURBULENCE' , 'PBLH' , + 'TS' , 'SURFACE' , + 'QS' , 'SURFACE' , + 'THAT' , 'SURFACE' , + 'QHAT' , 'SURFACE' , + 'CU2DRAINMOVE' , 'MOIST' , + 'CU2DSNOWMOVE' , 'MOIST' , + 'RAS_TIME' , 'MOIST' , + 'CN_PRCP' , 'MOIST' , 'CNPRCP' , + 'LS_PRCP' , 'MOIST' , 'LSPRCP' , + 'AN_PRCP' , 'MOIST' , 'ANPRCP' , + 'LS_PRCP+CU2DRAINMOVE+CU2DSNOWMOVE' , 'MOIST' , 'LSORIG' , + 'CN_PRCP-CU2DRAINMOVE-CU2DSNOWMOVE' , 'MOIST' , 'CNORIG' , + 'SNO' , 'MOIST' , + 'PLS' , 'MOIST' , + 'PCU' , 'MOIST' , + 'LWP' , 'MOIST' , + 'CCWP' , 'MOIST' , + 'TAUTT' , 'SOLAR' , + 'TAULO' , 'SOLAR' , + 'TAUMD' , 'SOLAR' , + 'TAUHI' , 'SOLAR' , + 'CLDTT' , 'SOLAR' , + 'CLDLO' , 'SOLAR' , + 'CLDMD' , 'SOLAR' , + 'CLDHI' , 'SOLAR' , + 'SPLAND' , 'SURFACE' , + 'SPWATR' , 'SURFACE' , + 'RUNSURF' , 'SURFACE' , 'RUNOFF' , + 'BASEFLOW' , 'SURFACE' , + 'EMIS' , 'SURFACE' , + 'CT' , 'SURFACE' , + 'CQ' , 'SURFACE' , + 'CN' , 'SURFACE' , + 'CM' , 'SURFACE' , + 'RI' , 'SURFACE' , 'RISFC' , + 'LAI' , 'SURFACE' , + 'GRN' , 'SURFACE' , + 'SNOMAS' , 'SURFACE' , + 'ITY' , 'SURFACE' , 'VEGTYPE' , + 'WET1' , 'SURFACE' , + 'WET2' , 'SURFACE' , + 'WET3' , 'SURFACE' , + 'TSOIL1' , 'SURFACE' , + 'TSOIL2' , 'SURFACE' , + 'FRLAND' , 'SURFACE' , + 'FRLANDICE', 'SURFACE' , + 'FRLAKE' , 'SURFACE' , + 'FRACI' , 'SURFACE' , 'FRSEAICE' , + 'FROCEAN' , 'SURFACE' , + 'USTAR' , 'SURFACE' , + 'Z0' , 'SURFACE' , + 'Z0H' , 'SURFACE' , + 'LHFX' , 'SURFACE' , + 'SH' , 'SURFACE' , 'SHFX' , + 'EVAP' , 'SURFACE' , + 'TAUX;TAUY', 'SURFACE' , + 'RHOS' , 'SURFACE' , + 'U2M;V2M' , 'SURFACE' , + 'T2M' , 'SURFACE' , + 'Q2M' , 'SURFACE' , + 'U10N;V10N', 'SURFACE' , + 'U10M;V10M', 'SURFACE' , + 'T10M' , 'SURFACE' , + 'Q10M' , 'SURFACE' , + 'U50M;V50M', 'SURFACE' , + 'GUST' , 'SURFACE' , + 'VENT' , 'SURFACE' , + 'ASNOW' , 'SURFACE' , + 'RADSRF' , 'RADIATION' , + 'TBISCCP' , 'SATSIM' , + 'FLNS' , 'IRRAD' , + 'FLNSC' , 'IRRAD' , + 'FLNSA' , 'IRRAD' , 'FLNSCNA' , + 'OLR' , 'IRRAD' , + 'OLC' , 'IRRAD' , 'OLRC' , + 'OLCC5' , 'IRRAD' , 'OLRCC5' , + 'OLA' , 'IRRAD' , 'OLRCNA' , + 'LWS' , 'IRRAD' , + 'LCS' , 'IRRAD' , 'LWSC' , + 'LCSC5' , 'IRRAD' , 'LWSCC5' , + 'LAS' , 'IRRAD' , 'LWSCNA' , + 'SFCEM' , 'IRRAD' , + 'CLDTMP' , 'SOLAR' , 'SWCLDTMP' , + 'CLDPRS' , 'SOLAR' , 'SWCLDPRS' , + 'OSR' , 'SOLAR' , + 'OSRCLR' , 'SOLAR' , + 'RSR' , 'SOLAR' , 'SWTNET' , + 'RSC' , 'SOLAR' , 'SWTNETC' , + 'RSCNA' , 'SOLAR' , 'SWTNETCNA' , + 'RSRNA' , 'SOLAR' , 'SWTNETNA' , + 'SLRTP' , 'SOLAR' , 'RADSWT' , + 'SLRSF' , 'SOLAR' , 'SWGDWN' , + 'SLRSFC' , 'SOLAR' , 'SWGDWNC' , + 'RSRS' , 'SOLAR' , 'SWGNET' , + 'RSCS' , 'SOLAR' , 'SWGNETC' , + 'RSRSNA' , 'SOLAR' , 'SWGNETNA' , + 'RSCSNA' , 'SOLAR' , 'SWGNETCNA' , + 'ALBEDO' , 'SOLAR' , + 'ALBVR' , 'SOLAR' , + 'ALBVF' , 'SOLAR' , + 'ALBNR' , 'SOLAR' , + 'ALBNF' , 'SOLAR' , + 'EVLAND' , 'SURFACE' , + 'LHLAND' , 'SURFACE' , + 'SHLAND' , 'SURFACE' , + 'SWLAND' , 'SURFACE' , + 'LWLAND' , 'SURFACE' , + 'GHLAND' , 'SURFACE' , + 'SMLAND' , 'SURFACE' , + 'TWLAND' , 'SURFACE' , + 'TELAND' , 'SURFACE' , +# additonal exports for skin SST + 'EVAPOUT' , 'SURFACE' , + 'COSZ' , 'SOLAR' , + 'DCOOL' , 'SURFACE' , + 'DWARM' , 'SURFACE' , + 'TDROP' , 'SURFACE' , 'DELT_COOL' , + 'TS_FOUND' , 'SURFACE' , 'BULK_SST' , + 'TDEL' , 'SURFACE' , + 'BCOOL' , 'SURFACE' , + 'LCOOL' , 'SURFACE' , + 'TBAR' , 'SURFACE' , + 'USTARW' , 'SURFACE' , + 'SWCOOL' , 'SURFACE' , + 'QCOOL' , 'SURFACE' , + 'DELTS' , 'SURFACE' , + 'QWARM' , 'SURFACE' , + 'SWWARM' , 'SURFACE' , + 'LANGM' , 'SURFACE' , + 'PHIW' , 'SURFACE' , + 'TAUTW' , 'SURFACE' , + 'ZETA_W' , 'SURFACE' , + :: + + geosgcm_meltwtr.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_meltwtr.archive: '%c/Y%y4', + geosgcm_meltwtr.format: 'CFIO', + geosgcm_meltwtr.mode: 'time-averaged', + geosgcm_meltwtr.frequency: 240000, + geosgcm_meltwtr.ref_time: 210000, + geosgcm_meltwtr.regrid_name: 'PE90x540-CF' + geosgcm_meltwtr.regrid_exch: 'tile.bin', + geosgcm_meltwtr.grid_label: PC360x181-DC + geosgcm_meltwtr.fields: 'MELTWTR' , 'LANDICE' , + :: + + geosgcm_landice.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_landice.archive: '%c/Y%y4', + geosgcm_landice.format: 'CFIO', + geosgcm_landice.mode: 'time-averaged', + geosgcm_landice.frequency: 240000, + geosgcm_landice.ref_time: 210000, + geosgcm_landice.regrid_name: 'PE90x540-CF' + geosgcm_landice.regrid_exch: 'tile.bin', + geosgcm_landice.grid_label: PC360x181-DC + geosgcm_landice.fields: 'SNOMAS_GL' , 'LANDICE' , + 'SNOWDP_GL' , 'LANDICE' , + 'TST' , 'LANDICE' , + 'ASNOW_GL' , 'LANDICE' , + 'RUNOFF' , 'LANDICE' , + 'WESNSC' , 'LANDICE' , + 'SNDZSC' , 'LANDICE' , + 'WESNPREC' , 'LANDICE' , + 'SNDZPREC' , 'LANDICE' , + 'SNDZ1PERC' , 'LANDICE' , + 'WESNBOT' , 'LANDICE' , + 'IMELT' , 'LANDICE' , + 'SNOWALB' , 'LANDICE' , + 'SNICEALB' , 'LANDICE' , + 'ACCUM' , 'LANDICE' , + 'RAINRFZ' , 'LANDICE' , + 'SHOUT' , 'LANDICE' , + 'HLATN' , 'LANDICE' , + 'HLWUP' , 'LANDICE' , + 'LWNDSRF' , 'LANDICE' , + 'SWNDSRF' , 'LANDICE' , + :: + + geosgcm_snowlayer.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_snowlayer.archive: '%c/Y%y4', + geosgcm_snowlayer.format: 'CFIO', + geosgcm_snowlayer.mode: 'time-averaged', + geosgcm_snowlayer.frequency: 240000, + geosgcm_snowlayer.ref_time: 210000, + geosgcm_snowlayer.regrid_name: 'PE90x540-CF' + geosgcm_snowlayer.regrid_exch: 'tile.bin', + geosgcm_snowlayer.grid_label: PC360x181-DC + geosgcm_snowlayer.fields: 'RHOSNOW' , 'LANDICE' , + 'TSNOW' , 'LANDICE' , + 'WSNOW' , 'LANDICE' , + 'ZSNOW' , 'LANDICE' , + 'DRHOS0' , 'LANDICE' , + 'WESNEX' , 'LANDICE' , + 'WESNPERC' , 'LANDICE' , + 'WESNDENS' , 'LANDICE' , + 'WESNREPAR' , 'LANDICE' , + 'TICE0' , 'LANDICE' , + :: + + geosgcm_moist.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_moist.archive: '%c/Y%y4', + geosgcm_moist.format: 'CFIO', + geosgcm_moist.mode: 'time-averaged', + geosgcm_moist.frequency: 240000, + geosgcm_moist.ref_time: 210000, + geosgcm_moist.grid_label: PC360x181-DC + geosgcm_moist.vscale: 100.0, + geosgcm_moist.vunit: 'hPa', + geosgcm_moist.vvars: 'log(PLE)' , 'DYN' , + geosgcm_moist.levels: 1000 975 950 925 900 875 850 825 800 775 750 725 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 40 30 20 10 7 5 4 3 2 1 0.7 0.5 0.4 0.3 0.2 0.1 0.07 0.05 0.04 0.03 0.02, + geosgcm_moist.fields: 'PHIS' , 'AGCM' , + 'QL' , 'MOIST' , + 'QI' , 'MOIST' , + 'QR' , 'MOIST' , + 'RI' , 'MOIST' , 'RICE' , + 'RL' , 'MOIST' , 'RLIQ' , + 'RH1' , 'MOIST' , + 'CNV_MF0' , 'MOIST' , 'CNVMF0' , + 'CNV_MFD' , 'MOIST' , 'CNVMFD' , + 'CNV_MFC' , 'MOIST' , 'CNVMFC' , + 'REV_CN' , 'MOIST' , 'REVCN' , + 'REV_AN' , 'MOIST' , 'REVAN' , + 'REV_LS' , 'MOIST' , 'REVLS' , + 'RSU_CN' , 'MOIST' , 'RSUCN' , + 'RSU_AN' , 'MOIST' , 'RSUAN' , + 'RSU_LS' , 'MOIST' , 'RSULS' , + 'THIM' , 'PHYSICS' , + 'EVAPC' , 'MOIST' , + 'SUBLC' , 'MOIST' , + 'FCLD' , 'MOIST' , + 'CLCN' , 'MOIST' , + 'CLLS' , 'MOIST' , + 'QICN' , 'MOIST' , + 'QILS' , 'MOIST' , + 'QLCN' , 'MOIST' , + 'QLLS' , 'MOIST' , + :: + + geosgcm_turb.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_turb.archive: '%c/Y%y4', + geosgcm_turb.format: 'CFIO', + geosgcm_turb.mode: 'time-averaged', + geosgcm_turb.frequency: 240000, + geosgcm_turb.ref_time: 210000, + geosgcm_turb.grid_label: PC360x181-DC + geosgcm_turb.vscale: 100.0, + geosgcm_turb.vunit: 'hPa', + geosgcm_turb.vvars: 'log(PLE)' , 'DYN' , + geosgcm_turb.levels: 1000 975 950 925 900 875 850 825 800 775 750 725 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 40 30 20 10 7 5 4 3 2 1 0.7 0.5 0.4 0.3 0.2 0.1 0.07 0.05 0.04 0.03 0.02, + geosgcm_turb.fields: 'INTDIS' , 'TURBULENCE' , + 'TOPDIS' , 'TURBULENCE' , + 'SRFDIS' , 'TURBULENCE' , + 'DBUOY' , 'TURBULENCE' , + 'WERAD' , 'TURBULENCE' , + 'KH' , 'TURBULENCE' , + 'KM' , 'TURBULENCE' , + 'KHLS' , 'TURBULENCE' , + 'KMLS' , 'TURBULENCE' , + 'EKH' , 'TURBULENCE' , + 'EKM' , 'TURBULENCE' , + 'KHSFC' , 'TURBULENCE' , + 'KHRAD' , 'TURBULENCE' , + 'RI' , 'TURBULENCE' , + 'DU' , 'TURBULENCE' , + :: + + geosgcm_gwd.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_gwd.archive: '%c/Y%y4', + geosgcm_gwd.format: 'CFIO', + geosgcm_gwd.mode: 'time-averaged', + geosgcm_gwd.frequency: 240000, + geosgcm_gwd.ref_time: 210000, + geosgcm_gwd.grid_label: PC360x181-DC + geosgcm_gwd.vscale: 100.0, + geosgcm_gwd.vunit: 'hPa', + geosgcm_gwd.vvars: 'log(PLE)' , 'DYN' , + geosgcm_gwd.levels: 1000 975 950 925 900 875 850 825 800 775 750 725 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 40 30 20 10 7 5 4 3 2 1 0.7 0.5 0.4 0.3 0.2 0.1 0.07 0.05 0.04 0.03 0.02, + geosgcm_gwd.fields: 'DUDT_ORO;DVDT_ORO', 'GWD', 'DUDTORO;DVDTORO' , + 'DUDT_BKG;DVDT_BKG', 'GWD', 'DUDTBKG;DVDTBKG' , + 'DUDT_RAY;DVDT_RAY', 'GWD', 'DUDTRAY;DVDTRAY' , + 'TAUOROX;TAUOROY' , 'GWD', + 'TAUBKGX;TAUBKGY' , 'GWD', + 'DTDT_ORO', 'GWD', 'DTDTORO' , + 'DTDT_BKG', 'GWD', 'DTDTBKG' , + 'DTDT_RAY', 'GWD', 'DTDTRAY' , + :: + + geosgcm_tend.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_tend.archive: '%c/Y%y4', + geosgcm_tend.format: 'CFIO', + geosgcm_tend.mode: 'time-averaged', + geosgcm_tend.frequency: 240000, + geosgcm_tend.ref_time: 210000, + geosgcm_tend.grid_label: PC360x181-DC + geosgcm_tend.vscale: 100.0, + geosgcm_tend.vunit: 'hPa', + geosgcm_tend.vvars: 'log(PLE)' , 'DYN' , + geosgcm_tend.levels: 1000 975 950 925 900 875 850 825 800 775 750 725 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 40 30 20 10 7 5 4 3 2 1 0.7 0.5 0.4 0.3 0.2 0.1 0.07 0.05 0.04 0.03 0.02, + geosgcm_tend.fields: 'DUDTDYN;DVDTDYN', 'DYN' , + 'UIT;VIT' , 'PHYSICS' , 'DUDTTRB;DVDTTRB' , + 'DUDT;DVDT' , 'MOIST' , 'DUDTMST;DVDTMST' , + 'DUDT;DVDT' , 'GWD' , 'DUDTGWD;DVDTGWD' , + 'DTDTDYN' , 'DYN' , + 'TIM' , 'PHYSICS' , 'DTDTMST' , + 'TIT' , 'PHYSICS' , 'DTDTTRB' , + 'TTMGW' , 'GWD' , 'DTDTGWD' , + 'RADLW' , 'RADIATION' , 'DTDTLW' , + 'RADLWC' , 'RADIATION' , 'DTDTLWC' , + 'RADLWCNA' , 'RADIATION' , 'DTDTLWCNA' , + 'RADSW' , 'RADIATION' , 'DTDTSW' , + 'RADSWC' , 'RADIATION' , 'DTDTSWC' , + 'RADSWNA' , 'RADIATION' , 'DTDTSWNA' , + 'RADSWCNA' , 'RADIATION' , 'DTDTSWCNA' , + 'TIF' , 'PHYSICS' , 'DTDTFRI' , + 'DQVDTDYN' , 'DYN' , + 'DQDT' , 'MOIST' , 'DQVDTMST' , + 'QVIT' , 'PHYSICS' , 'DQVDTTRB' , + 'H2O_TEND' , 'CHEMISTRY' , 'DQVDTCHM' , + 'DPDTPHY' , 'PHYSICS' , + :: + + geosgcm_budi.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_budi.archive: '%c/Y%y4', + geosgcm_budi.format: 'CFIO', + geosgcm_budi.conservative: 1, + geosgcm_budi.frequency: 030000, + geosgcm_budi.grid_label: PC360x181-DC + geosgcm_budi.fields: 'TQV' , 'AGCM' , + 'TQI' , 'AGCM' , + 'TQL' , 'AGCM' , + 'TOX' , 'AGCM' , + 'MASS' , 'AGCM' , + :: + + geosgcm_buda.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_buda.archive: '%c/Y%y4', + geosgcm_buda.format: 'CFIO', + geosgcm_buda.mode: 'time-averaged', + geosgcm_buda.conservative: 1, + geosgcm_buda.frequency: 030000, + geosgcm_buda.grid_label: PC360x181-DC + geosgcm_buda.fields: 'DMDTDYN' , 'DYN' , 'DMDTDYN' , + 'DMDTANA' , 'DYN' , 'DMDTANA' , + 'DMDT' , 'PHYSICS' , 'DMDTPHY' , + 'DQVDTDYNINT' , 'DYN' , 'DQVDTDYN' , + 'DQVDTPHYINT' , 'PHYSICS' , 'DQVDTPHY' , + 'DQVDTANAINT' , 'DYN' , 'DQVDTANA' , + 'DQVDTMSTINT' , 'PHYSICS' , 'DQVDTMST' , + 'DQVDTTRBINT' , 'PHYSICS' , 'DQVDTTRB' , + 'DQVDTCHMINT' , 'PHYSICS' , 'DQVDTCHM' , + 'DQLDTDYNINT' , 'DYN' , 'DQLDTDYN' , + 'DQLDTPHYINT' , 'PHYSICS' , 'DQLDTPHY' , + 'DQLDTANAINT' , 'DYN' , 'DQLDTANA' , + 'DQLDTMSTINT' , 'PHYSICS' , 'DQLDTMST' , + 'DQIDTDYNINT' , 'DYN' , 'DQIDTDYN' , + 'DQIDTPHYINT' , 'PHYSICS' , 'DQIDTPHY' , + 'DQIDTANAINT' , 'DYN' , 'DQIDTANA' , + 'DQIDTMSTINT' , 'PHYSICS' , 'DQIDTMST' , + 'DOXDTDYNINT' , 'DYN' , 'DOXDTDYN' , + 'DOXDTPHYINT' , 'PHYSICS' , 'DOXDTPHY' , + 'DOXDTANAINT' , 'DYN' , 'DOXDTANA' , + 'DOXDTCHMINT' , 'PHYSICS' , 'DOXDTCHM' , + :: + + geosgcm_iau.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_iau.archive: '%c/Y%y4', + geosgcm_iau.format: 'CFIO', + geosgcm_iau.mode: 'time-averaged', + geosgcm_iau.frequency: 060000, + geosgcm_iau.ref_time: 030000, + geosgcm_iau.grid_label: PC360x181-DC + geosgcm_iau.vscale: 100.0, + geosgcm_iau.vunit: 'hPa', + geosgcm_iau.vvars: 'log(PLE)' , 'DYN' , + geosgcm_iau.levels: 1000 975 950 925 900 875 850 825 800 775 750 725 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 40 30 20 10 7 5 4 3 2 1 0.7 0.5 0.4 0.3 0.2 0.1 0.07 0.05 0.04 0.03 0.02, + geosgcm_iau.fields: 'DUDT_ANA;DVDT_ANA' , 'AGCM' , 'DUDTANA;DVDTANA' , + 'DTDT_ANA' , 'AGCM' , 'DTDTANA' , + 'DQVDT_ANA' , 'AGCM' , 'DQDTANA' , + 'DMDTANA' , 'DYN' , 'DMDTANA' , +# 'VINTDIV_ANA' , 'AIAU' , +# 'VINTDIV_BKG' , 'AIAU' , +# 'VINTDIV_COR' , 'AIAU' , +# 'DUWINDFIX;DVWINDFIX' , 'AIAU' , +# 'DTSDT_ANA' , 'AGCM' , +# 'UBKG;VBKG' , 'AIAU' , +# 'TVBKG' , 'AIAU' , +# 'QVBKG' , 'AIAU' , + :: + +# Note: Be Sure to ADD: USE_SATSIM_MODIS: 1 in AGCM.rc for this Collection +# ------------------------------------------------------------------------ + geosgcm_conv.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_conv.archive: '%c/Y%y4', + geosgcm_conv.format: 'CFIO', + geosgcm_conv.frequency: 010000, + geosgcm_conv.grid_label: PC360x181-DC + geosgcm_conv.fields: 'TQV' , 'AGCM' , + 'TQI' , 'AGCM' , + 'TQL' , 'AGCM' , + 'CWP' , 'MOIST' , + 'LWP' , 'MOIST' , + 'IWP' , 'MOIST' , + 'SNO' , 'MOIST' , 'PRECSNO' , + 'TPREC' , 'MOIST' , 'PRECTOT' , + 'AN_PRCP' , 'MOIST' , 'PRECANV' , + 'CN_PRCP' , 'MOIST' , 'PRECCON' , + 'LS_PRCP' , 'MOIST' , 'PRECLSC' , + 'CAPE' , 'MOIST' , + 'INHB' , 'MOIST' , 'CIN' , + 'TBISCCP' , 'SATSIM' , + 'MDSCLDSZWTR', 'SATSIM' , + 'MDSCLDSZICE', 'SATSIM' , + :: + + geosgcm_bud.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_bud.archive: '%c/Y%y4', + geosgcm_bud.format: 'CFIO' , + geosgcm_bud.mode: 'time-averaged', + geosgcm_bud.frequency: 240000, + geosgcm_bud.ref_time: 210000, + geosgcm_bud.grid_label: PC360x181-DC + geosgcm_bud.fields: 'PHIS' , 'AGCM' , + 'PS' , 'DYN' , + 'KEDYN' , 'DYN' , + 'PEDYN' , 'DYN' , + 'TEDYN' , 'DYN' , + 'KEPHY' , 'DYN' , + 'PEPHY' , 'DYN' , + 'TEPHY' , 'DYN' , + 'KEANA' , 'DYN' , + 'PEANA' , 'DYN' , + 'TEANA' , 'DYN' , + 'KEGEN' , 'DYN' , + 'KEGWD' , 'GWD' , + 'KERAY' , 'GWD' , + 'KEBKG' , 'GWD' , + 'KEORO' , 'GWD' , + 'KETRB' , 'TURBULENCE' , + 'KESRF' , 'TURBULENCE' , + 'KEINT' , 'TURBULENCE' , + 'KETOP' , 'TURBULENCE' , + 'KEMST' , 'MOIST' , + 'KECDCOR' , 'DYN' , + 'PECDCOR' , 'DYN' , + 'TECDCOR' , 'DYN' , + 'KEREMAP' , 'DYN' , + 'PEREMAP' , 'DYN' , + 'TEREMAP' , 'DYN' , + 'CONVKE' , 'DYN' , + 'CONVCPT' , 'DYN' , + 'CONVPHI' , 'DYN' , + 'CONVTHV' , 'DYN' , + 'KEADV' , 'DYN' , + 'KEPG' , 'DYN' , + 'KEDP' , 'DYN' , + 'KEHOT' , 'DYN' , + 'DKERESIN' , 'DYN' , + 'DKERESPG' , 'DYN' , + 'QFIXER' , 'DYN' , + 'DTHVDTREMAP' , 'DYN' , + 'DTHVDTCONSV' , 'DYN' , + :: + + goswim_catch.template: '%y4%m2%d2_%h2%n2z.nc4', + goswim_catch.archive: '%c/Y%y4', + goswim_catch.format: 'CFIO', + goswim_catch.mode: 'time-averaged', + goswim_catch.frequency: 240000, + goswim_catch.ref_time: 210000, + goswim_catch.regrid_name: 'PE90x540-CF' + goswim_catch.regrid_exch: 'tile.bin', + goswim_catch.grid_label: PC360x181-DC, + goswim_catch.fields: 'SNDZN1' , 'CATCH' , + 'SNDZN2' , 'CATCH' , + 'SNDZN3' , 'CATCH' , + 'WESNN1' , 'CATCH' , + 'WESNN2' , 'CATCH' , + 'WESNN3' , 'CATCH' , + 'ASNOW' , 'CATCH' , + 'ALBVR' , 'CATCH' , + 'ALBVF' , 'CATCH' , + 'ALBNR' , 'CATCH' , + 'ALBNF' , 'CATCH' , + 'RUNSURF' , 'CATCH' , + 'BASEFLOW' , 'CATCH' , + 'SMELT' , 'CATCH' , + 'SMLAND' , 'CATCH' , + 'TPSNOW' , 'CATCH' , + 'TST' , 'CATCH' , + 'WET1' , 'CATCH' , + 'Z0' , 'CATCH' , + 'SWLAND' , 'CATCH' , + 'SWNDSRF' , 'CATCH' , + :: + + goswim_land.template: '%y4%m2%d2_%h2%n2z.nc4', + goswim_land.archive: '%c/Y%y4', + goswim_land.format: 'CFIO', + goswim_land.mode: 'time-averaged', + goswim_land.frequency: 240000, + goswim_land.ref_time: 210000, + goswim_land.grid_label: PC360x181-DC, + goswim_land.fields: 'RDU001' , 'SURFACE' , + 'RDU002' , 'SURFACE' , + 'RDU003' , 'SURFACE' , + 'RDU004' , 'SURFACE' , + 'RDU005' , 'SURFACE' , + 'RBC001' , 'SURFACE' , + 'RBC002' , 'SURFACE' , + 'ROC001' , 'SURFACE' , + 'ROC002' , 'SURFACE' , + 'RMELTDU001' , 'SURFACE' , + 'RMELTDU002' , 'SURFACE' , + 'RMELTDU003' , 'SURFACE' , + 'RMELTDU004' , 'SURFACE' , + 'RMELTDU005' , 'SURFACE' , + 'RMELTBC001' , 'SURFACE' , + 'RMELTBC002' , 'SURFACE' , + 'RMELTOC001' , 'SURFACE' , + 'RMELTOC002' , 'SURFACE' , + :: + + goswim_landice.template: '%y4%m2%d2_%h2%n2z.nc4', + goswim_landice.archive: '%c/Y%y4', + goswim_landice.format: 'CFIO', + goswim_landice.mode: 'time-averaged', + goswim_landice.frequency: 240000, + goswim_landice.ref_time: 210000, + goswim_landice.regrid_name: 'PE90x540-CF' + goswim_landice.regrid_exch: 'tile.bin', + goswim_landice.grid_label: PC360x181-DC, + goswim_landice.fields: 'IRDU001' , 'LANDICE' , + 'IRDU002' , 'LANDICE' , + 'IRDU003' , 'LANDICE' , + 'IRDU004' , 'LANDICE' , + 'IRDU005' , 'LANDICE' , + 'IRBC001' , 'LANDICE' , + 'IRBC002' , 'LANDICE' , + 'IROC001' , 'LANDICE' , + 'IROC002' , 'LANDICE' , + :: + +# --------------------- +# Aerosols/Constituents +# --------------------- +# +# +#### GOCART + tavg2d_aer_x.format: 'CFIO', + tavg2d_aer_x.template: '%y4%m2%d2_%h2%n2z.nc4', + tavg2d_aer_x.archive: '%c/Y%y4', + tavg2d_aer_x.mode: 'time-averaged', + tavg2d_aer_x.frequency: 240000, + tavg2d_aer_x.ref_time: 210000, + tavg2d_aer_x.grid_label: PC360x181-DC + tavg2d_aer_x.fields: 'LWI' , 'SURFACE' , + 'TOTEXTTAU' , 'GOCART' , + 'TOTSCATAU' , 'GOCART' , + 'TOTANGSTR' , 'GOCART' , + 'DUEM001' , 'GOCART' , + 'DUEM002' , 'GOCART' , + 'DUEM003' , 'GOCART' , + 'DUEM004' , 'GOCART' , + 'DUEM005' , 'GOCART' , + 'DUSD001' , 'GOCART' , + 'DUSD002' , 'GOCART' , + 'DUSD003' , 'GOCART' , + 'DUSD004' , 'GOCART' , + 'DUSD005' , 'GOCART' , + 'DUDP001' , 'GOCART' , + 'DUDP002' , 'GOCART' , + 'DUDP003' , 'GOCART' , + 'DUDP004' , 'GOCART' , + 'DUDP005' , 'GOCART' , + 'DUWT001' , 'GOCART' , + 'DUWT002' , 'GOCART' , + 'DUWT003' , 'GOCART' , + 'DUWT004' , 'GOCART' , + 'DUWT005' , 'GOCART' , + 'DUSV001' , 'GOCART' , + 'DUSV002' , 'GOCART' , + 'DUSV003' , 'GOCART' , + 'DUSV004' , 'GOCART' , + 'DUSV005' , 'GOCART' , + 'DUSMASS' , 'GOCART' , + 'DUCMASS' , 'GOCART' , + 'DUEXTTAU' , 'GOCART' , + 'DUSCATAU' , 'GOCART' , + 'DUANGSTR' , 'GOCART' , + 'DUEXTTFM' , 'GOCART' , + 'DUSCATFM' , 'GOCART' , + 'DUSMASS25' , 'GOCART' , + 'DUCMASS25' , 'GOCART' , + 'DUEXTT25' , 'GOCART' , + 'DUSCAT25' , 'GOCART' , + 'DUAERIDX' , 'GOCART' , + 'DUFLUXU' , 'GOCART' , + 'DUFLUXV' , 'GOCART' , + 'SSEM001' , 'GOCART' , + 'SSEM002' , 'GOCART' , + 'SSEM003' , 'GOCART' , + 'SSEM004' , 'GOCART' , + 'SSEM005' , 'GOCART' , + 'SSSD001' , 'GOCART' , + 'SSSD002' , 'GOCART' , + 'SSSD003' , 'GOCART' , + 'SSSD004' , 'GOCART' , + 'SSSD005' , 'GOCART' , + 'SSDP001' , 'GOCART' , + 'SSDP002' , 'GOCART' , + 'SSDP003' , 'GOCART' , + 'SSDP004' , 'GOCART' , + 'SSDP005' , 'GOCART' , + 'SSWT001' , 'GOCART' , + 'SSWT002' , 'GOCART' , + 'SSWT003' , 'GOCART' , + 'SSWT004' , 'GOCART' , + 'SSWT005' , 'GOCART' , + 'SSSV001' , 'GOCART' , + 'SSSV002' , 'GOCART' , + 'SSSV003' , 'GOCART' , + 'SSSV004' , 'GOCART' , + 'SSSV005' , 'GOCART' , + 'SSSMASS' , 'GOCART' , + 'SSCMASS' , 'GOCART' , + 'SSEXTTAU' , 'GOCART' , + 'SSSCATAU' , 'GOCART' , + 'SSANGSTR' , 'GOCART' , + 'SSEXTTFM' , 'GOCART' , + 'SSSCATFM' , 'GOCART' , + 'SSSMASS25' , 'GOCART' , + 'SSCMASS25' , 'GOCART' , + 'SSEXTT25' , 'GOCART' , + 'SSSCAT25' , 'GOCART' , + 'SSAERIDX' , 'GOCART' , + 'SSFLUXU' , 'GOCART' , + 'SSFLUXV' , 'GOCART' , + 'SUEM001' , 'GOCART' , + 'SUEM002' , 'GOCART' , + 'SUEM003' , 'GOCART' , + 'SUEM004' , 'GOCART' , + 'SUDP001' , 'GOCART' , + 'SUDP002' , 'GOCART' , + 'SUDP003' , 'GOCART' , + 'SUDP004' , 'GOCART' , + 'SUWT001' , 'GOCART' , + 'SUWT002' , 'GOCART' , + 'SUWT003' , 'GOCART' , + 'SUWT004' , 'GOCART' , + 'SUSV001' , 'GOCART' , + 'SUSV002' , 'GOCART' , + 'SUSV003' , 'GOCART' , + 'SUSV004' , 'GOCART' , + 'SO2SMASS' , 'GOCART' , + 'SO2CMASS' , 'GOCART' , + 'SO4SMASS' , 'GOCART' , + 'SO4CMASS' , 'GOCART' , + 'DMSSMASS' , 'GOCART' , + 'DMSCMASS' , 'GOCART' , + 'SUPSO2' , 'GOCART' , + 'SUPSO4G' , 'GOCART' , + 'SUPSO4AQ' , 'GOCART' , + 'SUPSO4WT' , 'GOCART' , + 'SUPMSA' , 'GOCART' , + 'SUEXTTAU' , 'GOCART' , + 'SUSCATAU' , 'GOCART' , + 'SUANGSTR' , 'GOCART' , + 'SO4EMAN' , 'GOCART' , + 'SO2EMAN' , 'GOCART' , + 'SO2EMBB' , 'GOCART' , + 'SO2EMVN' , 'GOCART' , + 'SO2EMVE' , 'GOCART' , + 'SUFLUXU' , 'GOCART' , + 'SUFLUXV' , 'GOCART' , + 'BCEM001' , 'GOCART' , + 'BCEM002' , 'GOCART' , + 'BCDP001' , 'GOCART' , + 'BCDP002' , 'GOCART' , + 'BCSV001' , 'GOCART' , + 'BCSV002' , 'GOCART' , + 'BCWT001' , 'GOCART' , + 'BCWT002' , 'GOCART' , + 'BCSMASS' , 'GOCART' , + 'BCCMASS' , 'GOCART' , + 'BCEXTTAU' , 'GOCART' , + 'BCSCATAU' , 'GOCART' , + 'BCANGSTR' , 'GOCART' , + 'BCHYPHIL' , 'GOCART' , + 'BCEMBB' , 'GOCART' , + 'BCEMBF' , 'GOCART' , + 'BCEMAN' , 'GOCART' , + 'BCFLUXU' , 'GOCART' , + 'BCFLUXV' , 'GOCART' , + 'OCEM001' , 'GOCART' , + 'OCEM002' , 'GOCART' , + 'OCDP001' , 'GOCART' , + 'OCDP002' , 'GOCART' , + 'OCSV001' , 'GOCART' , + 'OCSV002' , 'GOCART' , + 'OCWT001' , 'GOCART' , + 'OCWT002' , 'GOCART' , + 'OCSMASS' , 'GOCART' , + 'OCCMASS' , 'GOCART' , + 'OCEXTTAU' , 'GOCART' , + 'OCSCATAU' , 'GOCART' , + 'OCANGSTR' , 'GOCART' , + 'OCEMBB' , 'GOCART' , + 'OCEMBF' , 'GOCART' , + 'OCEMAN' , 'GOCART' , + 'OCEMBG' , 'GOCART' , + 'OCHYPHIL' , 'GOCART' , + 'OCFLUXU' , 'GOCART' , + 'OCFLUXV' , 'GOCART' , + 'HNO3SMASS' , 'GOCART' , + 'NH3SMASS' , 'GOCART' , + 'NH4SMASS' , 'GOCART' , + 'NISMASS' , 'GOCART' , + 'NISMASS25' , 'GOCART' , + 'HNO3CMASS' , 'GOCART' , + 'NH3CMASS' , 'GOCART' , + 'NH4CMASS' , 'GOCART' , + 'NICMASS' , 'GOCART' , + 'NICMASS25' , 'GOCART' , + 'NIEXTTFM' , 'GOCART' , + 'NISCATFM' , 'GOCART' , + 'NIEXTTAU' , 'GOCART' , + 'NISCATAU' , 'GOCART' , + 'NIANGSTR' , 'GOCART' , + 'NIPNO3AQ' , 'GOCART' , + 'NIPNH4AQ' , 'GOCART' , + 'NIPNH3AQ' , 'GOCART' , + 'NIHT001' , 'GOCART' , + 'NIHT002' , 'GOCART' , + 'NIHT003' , 'GOCART' , + 'NISD001' , 'GOCART' , + 'NISD002' , 'GOCART' , + 'NISD003' , 'GOCART' , + 'NIDP001' , 'GOCART' , + 'NIDP002' , 'GOCART' , + 'NIDP003' , 'GOCART' , + 'NIWT001' , 'GOCART' , + 'NIWT002' , 'GOCART' , + 'NIWT003' , 'GOCART' , + 'NISV001' , 'GOCART' , + 'NISV002' , 'GOCART' , + 'NISV003' , 'GOCART' , + 'NH3EM' , 'GOCART' , + 'NH3DP' , 'GOCART' , + 'NH3WT' , 'GOCART' , + 'NH3SV' , 'GOCART' , + 'NH4SD' , 'GOCART' , + 'NH4DP' , 'GOCART' , + 'NH4WT' , 'GOCART' , + 'NH4SV' , 'GOCART' , + 'NIFLUXU' , 'GOCART' , + 'NIFLUXV' , 'GOCART' , + 'DDUDT' , 'MOIST' , 'DUSV' , + 'DSSDT' , 'MOIST' , 'SSSV' , + 'DOCDT' , 'MOIST' , 'OCSV' , + 'DBCDT' , 'MOIST' , 'BCSV' , + 'DSUDT' , 'MOIST' , 'SUSV' , + :: + + tavg3d_aer_p.format: 'CFIO' , + tavg3d_aer_p.template: '%y4%m2%d2_%h2%n2z.nc4', + tavg3d_aer_p.archive: '%c/Y%y4', + tavg3d_aer_p.frequency: 240000, + tavg3d_aer_p.ref_time: 210000, + tavg3d_aer_p.grid_label: PC360x181-DC + tavg3d_aer_p.mode: 'time-averaged', + tavg3d_aer_p.vscale: 100.0, + tavg3d_aer_p.vunit: 'hPa', + tavg3d_aer_p.vvars: 'log(PLE)' , 'DYN' , + tavg3d_aer_p.levels: 1000 975 950 925 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 30 20 10, + tavg3d_aer_p.fields: 'PS' , 'DYN' , 'PS' , + 'LWI' , 'SURFACE' , 'LWI' , + 'AIRDENS' , 'CHEMENV' , + 'DUMASS' , 'GOCART' , 'DU' , + 'SSMASS' , 'GOCART' , 'SS' , + 'BCMASS' , 'GOCART' , 'BC' , + 'OCMASS' , 'GOCART' , 'OC' , + 'GOCART::SO2' , 'GOCART' , 'SO2' , + 'GOCART::SO4' , 'GOCART' , 'SO4' , + 'NH3MASS' , 'GOCART' , 'NH3' , + 'NH4MASS' , 'GOCART' , 'NH4' , + 'NIMASS' , 'GOCART' , 'NI' , + 'HNO3CONC' , 'GOCART' , + 'NICONC' , 'GOCART' , + :: + + geosgcm_tracer.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_tracer.archive: '%c/Y%y4', + geosgcm_tracer.format: 'CFIO', + geosgcm_tracer.mode: 'time-averaged', + geosgcm_tracer.frequency: 030000, + geosgcm_tracer.ref_time: 030000, + geosgcm_tracer.grid_label: PC360x181-DC + geosgcm_tracer.vscale: 100.0, + geosgcm_tracer.vunit: 'hPa', + geosgcm_tracer.vvars: 'log(PLE)' , 'DYN' , + geosgcm_tracer.levels: 1000 975 950 925 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100 85 70 50 30 20 10 7 5 3 2 1 0.7 0.5 0.3 0.2 0.1, + geosgcm_tracer.fields: 'PS' , 'DYN' , + 'AIRDENS' , 'CHEMENV' , + 'e90' , 'TR' , + 'Rn222' , 'TR' , + 'aoa' , 'TR' , + 'CH3I' , 'TR' , +# 'Be7' , 'TR' , +# 'EM_Be7' , 'TR' , +# 'STtend_Be7' , 'TR' , +# 'DDtend_Be7*(-1)' , 'TR' , 'DD_Be7' , +# 'WRtend_Be7' , 'TR' , +# 'WRtendVsum_Be7*(-1)' , 'TR' , 'WD_Be7' , +# 'DKtend_Be7*(-1)' , 'TR' , 'DK_Be7' , +# 'CVtend_Be7' , 'TR' , + :: + + geosgcm_lidar.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_lidar.archive: '%c/Y%y4', + geosgcm_lidar.format: 'CFIO', + geosgcm_lidar.mode: 'time-averaged', + geosgcm_lidar.frequency: 030000, + geosgcm_lidar.ref_time: 210000, + geosgcm_lidar.grid_label: PC360x181-DC + geosgcm_lidar.vunit: 'm', + geosgcm_lidar.vvars: 'ZL' , 'DYN' , + geosgcm_lidar.levels: 240 720 1200 1680 2160 2640 3120 3600 4080 4560 5040 5520 6000 6480 6960 7440 7920 8400 8880 9360 9840 10320 10800 11280 11760 12240 12720 13200 13680 14160 14640 15120 15600 16080 16560 17040 17520 18000 18480 18960, + geosgcm_lidar.fields: 'LIDARPMOL' , 'SATSIM' , + 'LIDARPTOT' , 'SATSIM' , + 'LIDARTAUTOT' , 'SATSIM' , + 'CLLS' , 'MOIST' , + 'FCLD' , 'MOIST' , + 'CLCALIPSO2' , 'SATSIM' , + 'CLLCALIPSO' , 'SATSIM' , + 'CLMCALIPSO' , 'SATSIM' , + 'CLHCALIPSO' , 'SATSIM' , + 'CLTCALIPSO' , 'SATSIM' , + 'CFADLIDARSR532_01' , 'SATSIM' , 'CFADLDRSR532_01' + 'CFADLIDARSR532_02' , 'SATSIM' , 'CFADLDRSR532_02' + 'CFADLIDARSR532_03' , 'SATSIM' , 'CFADLDRSR532_03' + 'CFADLIDARSR532_04' , 'SATSIM' , 'CFADLDRSR532_04' + 'CFADLIDARSR532_05' , 'SATSIM' , 'CFADLDRSR532_05' + 'CFADLIDARSR532_06' , 'SATSIM' , 'CFADLDRSR532_06' + 'CFADLIDARSR532_07' , 'SATSIM' , 'CFADLDRSR532_07' + 'CFADLIDARSR532_08' , 'SATSIM' , 'CFADLDRSR532_08' + 'CFADLIDARSR532_09' , 'SATSIM' , 'CFADLDRSR532_09' + 'CFADLIDARSR532_10' , 'SATSIM' , 'CFADLDRSR532_10' + 'CFADLIDARSR532_11' , 'SATSIM' , 'CFADLDRSR532_11' + 'CFADLIDARSR532_12' , 'SATSIM' , 'CFADLDRSR532_12' + 'CFADLIDARSR532_13' , 'SATSIM' , 'CFADLDRSR532_13' + 'CFADLIDARSR532_14' , 'SATSIM' , 'CFADLDRSR532_14' + 'CFADLIDARSR532_15' , 'SATSIM' , 'CFADLDRSR532_15' + 'CLDTMP' , 'SOLAR' , 'SWCLDTMP' , + 'CLDPRS' , 'SOLAR' , 'SWCLDPRS' , + 'OSR' , 'SOLAR' , + 'SLRTP' , 'SOLAR' , 'RADSWT' , + :: + + geosgcm_parasol.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_parasol.archive: '%c/Y%y4', + geosgcm_parasol.format: 'CFIO', + geosgcm_parasol.mode: 'time-averaged', + geosgcm_parasol.frequency: 030000, + geosgcm_parasol.grid_label: PC360x181-DC + geosgcm_parasol.ref_time: 210000, + geosgcm_parasol.fields: 'PARASOLREFL1' , 'SATSIM' , + 'PARASOLREFL2' , 'SATSIM' , + 'PARASOLREFL3' , 'SATSIM' , + 'PARASOLREFL4' , 'SATSIM' , + 'PARASOLREFL5' , 'SATSIM' , + :: + + geosgcm_radar.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_radar.archive: '%c/Y%y4', + geosgcm_radar.format: 'CFIO', + geosgcm_radar.mode: 'time-averaged', + geosgcm_radar.frequency: 030000, + geosgcm_radar.ref_time: 210000, + geosgcm_radar.grid_label: PC360x181-DC + geosgcm_radar.vunit: 'm', + geosgcm_radar.vvars: 'ZL' , 'DYN' , + geosgcm_radar.levels: 240 720 1200 1680 2160 2640 3120 3600 4080 4560 5040 5520 6000 6480 6960 7440 7920 8400 8880 9360 9840 10320 10800 11280 11760 12240 12720 13200 13680 14160 14640 15120 15600 16080 16560 17040 17520 18000 18480 18960 + geosgcm_radar.fields: 'RADARLTCC' , 'SATSIM' , + 'CLCALIPSO2' , 'SATSIM' , + 'CLCALIPSO' , 'SATSIM' , + 'CLOUDSATCFAD01' , 'SATSIM' , + 'CLOUDSATCFAD02' , 'SATSIM' , + 'CLOUDSATCFAD03' , 'SATSIM' , + 'CLOUDSATCFAD04' , 'SATSIM' , + 'CLOUDSATCFAD05' , 'SATSIM' , + 'CLOUDSATCFAD06' , 'SATSIM' , + 'CLOUDSATCFAD07' , 'SATSIM' , + 'CLOUDSATCFAD08' , 'SATSIM' , + 'CLOUDSATCFAD09' , 'SATSIM' , + 'CLOUDSATCFAD10' , 'SATSIM' , + 'CLOUDSATCFAD11' , 'SATSIM' , + 'CLOUDSATCFAD12' , 'SATSIM' , + 'CLOUDSATCFAD13' , 'SATSIM' , + 'CLOUDSATCFAD14' , 'SATSIM' , + 'CLOUDSATCFAD15' , 'SATSIM' , + 'CLLS' , 'MOIST' , + 'FCLD' , 'MOIST' , + 'QLLS' , 'MOIST' , + 'QILS' , 'MOIST' , + 'RI' , 'MOIST' , 'RDFI' , + 'RL' , 'MOIST' , 'RDFL' , + 'SGFCLD' , 'SATSIM' , + 'CLDTMP' , 'SOLAR' , 'SWCLDTMP' , + 'CLDPRS' , 'SOLAR' , 'SWCLDPRS' , + 'OSR' , 'SOLAR' , + 'SLRTP' , 'SOLAR' , 'RADSWT' , + :: + + geosgcm_isccp.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_isccp.archive: '%c/Y%y4', + geosgcm_isccp.format: 'CFIO', + geosgcm_isccp.mode: 'time-averaged', + geosgcm_isccp.frequency: 030000, + geosgcm_isccp.grid_label: PC360x181-DC + geosgcm_isccp.ref_time: 210000, + geosgcm_isccp.fields: 'SGFCLD' , 'SATSIM' , + 'TCLISCCP' , 'SATSIM' , + 'ALBISCCP' , 'SATSIM' , + 'CTPISCCP' , 'SATSIM' , + 'ISCCP_CU_OA' , 'SATSIM' , + 'ISCCP_CU_OB' , 'SATSIM' , + 'ISCCP_CU_UA' , 'SATSIM' , + 'ISCCP_CU_UB' , 'SATSIM' , + 'ISCCP_STCU_OA' , 'SATSIM' , + 'ISCCP_STCU_OB' , 'SATSIM' , + 'ISCCP_STCU_UA' , 'SATSIM' , + 'ISCCP_STCU_UB' , 'SATSIM' , + 'ISCCP_ST_OA' , 'SATSIM' , + 'ISCCP_ST_OB' , 'SATSIM' , + 'ISCCP_ST_UA' , 'SATSIM' , + 'ISCCP_ST_UB' , 'SATSIM' , + 'ISCCP_ACU_OA' , 'SATSIM' , + 'ISCCP_ACU_OB' , 'SATSIM' , + 'ISCCP_ACU_UA' , 'SATSIM' , + 'ISCCP_ACU_UB' , 'SATSIM' , + 'ISCCP_AST_OA' , 'SATSIM' , + 'ISCCP_AST_OB' , 'SATSIM' , + 'ISCCP_AST_UA' , 'SATSIM' , + 'ISCCP_AST_UB' , 'SATSIM' , + 'ISCCP_NST_OA' , 'SATSIM' , + 'ISCCP_NST_OB' , 'SATSIM' , + 'ISCCP_NST_UA' , 'SATSIM' , + 'ISCCP_NST_UB' , 'SATSIM' , + 'ISCCP_CI_OA' , 'SATSIM' , + 'ISCCP_CI_OB' , 'SATSIM' , + 'ISCCP_CI_MA' , 'SATSIM' , + 'ISCCP_CI_MB' , 'SATSIM' , + 'ISCCP_CI_UA' , 'SATSIM' , + 'ISCCP_CI_UB' , 'SATSIM' , + 'ISCCP_CIST_OA' , 'SATSIM' , + 'ISCCP_CIST_OB' , 'SATSIM' , + 'ISCCP_CIST_MA' , 'SATSIM' , + 'ISCCP_CIST_MB' , 'SATSIM' , + 'ISCCP_CIST_UA' , 'SATSIM' , + 'ISCCP_CIST_UB' , 'SATSIM' , + 'ISCCP_CB_OA' , 'SATSIM' , + 'ISCCP_CB_OB' , 'SATSIM' , + 'ISCCP_CB_MA' , 'SATSIM' , + 'ISCCP_CB_MB' , 'SATSIM' , + 'ISCCP_CB_UA' , 'SATSIM' , + 'ISCCP_CB_UB' , 'SATSIM' , + 'ISCCP_SUBV1' , 'SATSIM' , + 'ISCCP_SUBV2' , 'SATSIM' , + 'ISCCP_SUBV3' , 'SATSIM' , + 'ISCCP_SUBV4' , 'SATSIM' , + 'ISCCP_SUBV5' , 'SATSIM' , + 'ISCCP_SUBV6' , 'SATSIM' , + 'ISCCP_SUBV7' , 'SATSIM' , + 'CLLS' , 'MOIST' , + 'FCLD' , 'MOIST' , + 'CLDTMP' , 'SOLAR' , 'SWCLDTMP' , + 'CLDPRS' , 'SOLAR' , 'SWCLDPRS' , + 'OSR' , 'SOLAR' , + 'SLRTP' , 'SOLAR' , 'RADSWT' , + :: + + geosgcm_modis.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_modis.archive: '%c/Y%y4', + geosgcm_modis.format: 'CFIO', + geosgcm_modis.mode: 'time-averaged', + geosgcm_modis.frequency: 030000, + geosgcm_modis.ref_time: 210000, + geosgcm_modis.grid_label: PC360x181-DC + geosgcm_modis.fields: 'TCLISCCP' , 'SATSIM' , + 'MDSCLDFRCTTL' , 'SATSIM' , + 'MDSCLDFRCWTR' , 'SATSIM' , + 'MDSCLDFRCICE' , 'SATSIM' , + 'MDSCLDFRCHI' , 'SATSIM' , + 'MDSCLDFRCMID' , 'SATSIM' , + 'MDSCLDFRCLO' , 'SATSIM' , + 'MDSOPTHCKTTL' , 'SATSIM' , + 'MDSOPTHCKWTR' , 'SATSIM' , + 'MDSOPTHCKICE' , 'SATSIM' , + 'MDSOPTHCKTTLLG' , 'SATSIM' , + 'MDSOPTHCKWTRLG' , 'SATSIM' , + 'MDSOPTHCKICELG' , 'SATSIM' , + 'MDSCLDSZWTR' , 'SATSIM' , + 'MDSCLDSZICE' , 'SATSIM' , + 'MDSCLDTOPPS' , 'SATSIM' , + 'MDSWTRPATH' , 'SATSIM' , + 'MDSICEPATH' , 'SATSIM' , + 'MDSTAUPRSHIST11' , 'SATSIM' , + 'MDSTAUPRSHIST12' , 'SATSIM' , + 'MDSTAUPRSHIST13' , 'SATSIM' , + 'MDSTAUPRSHIST14' , 'SATSIM' , + 'MDSTAUPRSHIST15' , 'SATSIM' , + 'MDSTAUPRSHIST16' , 'SATSIM' , + 'MDSTAUPRSHIST17' , 'SATSIM' , + 'MDSTAUPRSHIST21' , 'SATSIM' , + 'MDSTAUPRSHIST22' , 'SATSIM' , + 'MDSTAUPRSHIST23' , 'SATSIM' , + 'MDSTAUPRSHIST24' , 'SATSIM' , + 'MDSTAUPRSHIST25' , 'SATSIM' , + 'MDSTAUPRSHIST26' , 'SATSIM' , + 'MDSTAUPRSHIST27' , 'SATSIM' , + 'MDSTAUPRSHIST31' , 'SATSIM' , + 'MDSTAUPRSHIST32' , 'SATSIM' , + 'MDSTAUPRSHIST33' , 'SATSIM' , + 'MDSTAUPRSHIST34' , 'SATSIM' , + 'MDSTAUPRSHIST35' , 'SATSIM' , + 'MDSTAUPRSHIST36' , 'SATSIM' , + 'MDSTAUPRSHIST37' , 'SATSIM' , + 'MDSTAUPRSHIST41' , 'SATSIM' , + 'MDSTAUPRSHIST42' , 'SATSIM' , + 'MDSTAUPRSHIST43' , 'SATSIM' , + 'MDSTAUPRSHIST44' , 'SATSIM' , + 'MDSTAUPRSHIST45' , 'SATSIM' , + 'MDSTAUPRSHIST46' , 'SATSIM' , + 'MDSTAUPRSHIST47' , 'SATSIM' , + 'MDSTAUPRSHIST51' , 'SATSIM' , + 'MDSTAUPRSHIST52' , 'SATSIM' , + 'MDSTAUPRSHIST53' , 'SATSIM' , + 'MDSTAUPRSHIST54' , 'SATSIM' , + 'MDSTAUPRSHIST55' , 'SATSIM' , + 'MDSTAUPRSHIST56' , 'SATSIM' , + 'MDSTAUPRSHIST57' , 'SATSIM' , + 'MDSTAUPRSHIST61' , 'SATSIM' , + 'MDSTAUPRSHIST62' , 'SATSIM' , + 'MDSTAUPRSHIST63' , 'SATSIM' , + 'MDSTAUPRSHIST64' , 'SATSIM' , + 'MDSTAUPRSHIST65' , 'SATSIM' , + 'MDSTAUPRSHIST66' , 'SATSIM' , + 'MDSTAUPRSHIST67' , 'SATSIM' , + 'MDSTAUPRSHIST71' , 'SATSIM' , + 'MDSTAUPRSHIST72' , 'SATSIM' , + 'MDSTAUPRSHIST73' , 'SATSIM' , + 'MDSTAUPRSHIST74' , 'SATSIM' , + 'MDSTAUPRSHIST75' , 'SATSIM' , + 'MDSTAUPRSHIST76' , 'SATSIM' , + 'MDSTAUPRSHIST77' , 'SATSIM' , + 'CLDTMP' , 'SOLAR' , 'SWCLDTMP' , + 'CLDPRS' , 'SOLAR' , 'SWCLDPRS' , + 'OSR' , 'SOLAR' , + 'SLRTP' , 'SOLAR' , 'RADSWT' , + :: + + geosgcm_misr.template: '%y4%m2%d2_%h2%n2z.nc4', + geosgcm_misr.archive: '%c/Y%y4', + geosgcm_misr.format: 'CFIO', + geosgcm_misr.mode: 'time-averaged', + geosgcm_misr.frequency: 030000, + geosgcm_misr.ref_time: 210000, + geosgcm_misr.grid_label: PC360x181-DC + geosgcm_misr.fields: 'TCLISCCP' , 'SATSIM' , + 'MISRMNCLDTP' , 'SATSIM' , + 'MISRCLDAREA' , 'SATSIM' , + 'MISRLYRTP0' , 'SATSIM' , + 'MISRLYRTP250' , 'SATSIM' , + 'MISRLYRTP750' , 'SATSIM' , + 'MISRLYRTP1250' , 'SATSIM' , + 'MISRLYRTP1750' , 'SATSIM' , + 'MISRLYRTP2250' , 'SATSIM' , + 'MISRLYRTP2750' , 'SATSIM' , + 'MISRLYRTP3500' , 'SATSIM' , + 'MISRLYRTP4500' , 'SATSIM' , + 'MISRLYRTP6000' , 'SATSIM' , + 'MISRLYRTP8000' , 'SATSIM' , + 'MISRLYRTP10000' , 'SATSIM' , + 'MISRLYRTP12000' , 'SATSIM' , + 'MISRLYRTP14000' , 'SATSIM' , + 'MISRLYRTP16000' , 'SATSIM' , + 'MISRLYRTP18000' , 'SATSIM' , + :: + diff --git a/ESMF/Apps/experiment/CTM_GridComp.rc b/ESMF/Apps/experiment/CTM_GridComp.rc new file mode 100644 index 00000000..9144d741 --- /dev/null +++ b/ESMF/Apps/experiment/CTM_GridComp.rc @@ -0,0 +1,37 @@ + +#--------------------------- +# Setting for Passive Tracer +#--------------------------- +ENABLE_pTracers: F + +online_ctm: T + +#---------------------------------------- +# Do you want to output few forcing data? +#---------------------------------------- +output_forcingData: F + +#----------------------- +# Setting for Convection +#----------------------- +do_ctmConvection: T + convec_opt: 2 + met_opt: 3 + chem_opt: 2 + do_drydep: T + do_wetdep: T + convecType: 1 + # 2: for GMI only (default) + # 1: generic with no scaveging (for GOCART, pTracer, ...) +#---------------------- +# Setting for Diffusion +#---------------------- +do_ctmDiffusion: T + diffu_opt: 1 +vert_diffu_coef: 1.0d0 + +#--------------------------- +# Setting for metFields Type +#--------------------------- +metType: MERRA2 + # MERRA2 (default) or MERRA1 or FPIT or FP diff --git a/ESMF/Apps/experiment/CTM_HISTORY.rc b/ESMF/Apps/experiment/CTM_HISTORY.rc new file mode 100644 index 00000000..80c761f2 --- /dev/null +++ b/ESMF/Apps/experiment/CTM_HISTORY.rc @@ -0,0 +1,528 @@ +azunyan: 12 +VERSION: 1 +EXPID: online_ctm +EXPDSC: setup_test +EXPSRC: Icarus-1_0_p2_CTM-r7 + + +COLLECTIONS: + :: + + + +GRID_LABELS: PC180x91-DC +:: + +PC180x91-DC.GRID_TYPE: LatLon +PC180x91-DC.IM_WORLD: 180 +PC180x91-DC.JM_WORLD: 91 +PC180x91-DC.POLE: PC +PC180x91-DC.DATELINE: DC +PC180x91-DC.LM: 72 + + + + + + gocart_chem.format: 'CFIO' , + gocart_chem.template: '%y4%m2%d2_%h2%n2z.nc4' , + gocart_chem.mode: 'instantaneous' , + gocart_chem.frequency: 001500 , + gocart_chem.duration: 000000 , + gocart_chem.ref_time: 000000 , + gocart_chem.fields: 'GOCART::CO' , 'GOCART' , 'CO' , + 'GOCART::CO2' , 'GOCART' , 'CO2' , + 'GOCART::COBBAE' , 'GOCART' , 'CObbae' , + 'GOCART::COBBAF' , 'GOCART' , 'CObbaf' , + 'GOCART::COBBGL' , 'GOCART' , 'CObbgl' , + 'GOCART::COBBLA' , 'GOCART' , 'CObbla' , + 'GOCART::COBBNA' , 'GOCART' , 'CObbna' , + 'GOCART::CONBAS' , 'GOCART' , 'COnbas' , + 'GOCART::CONBEU' , 'GOCART' , 'COnbeu' , + 'GOCART::CONBGL' , 'GOCART' , 'COnbgl' , + 'GOCART::CONBNA' , 'GOCART' , 'COnbna' , + :: + + + ctm_test.template: '%y4%m2%d2_%h2%n2z.nc4', + ctm_test.archive: '%c/Y%y4', + ctm_test.format: 'CFIO', + ctm_test.frequency: 001500, + ctm_test.duration: 000000, + ctm_test.ref_time: 000000, + ctm_test.fields: 'ITY' , 'CTMenv' , + 'BYNCY' , 'CTMenv' , + 'CNV_QC' , 'CTMenv' , + 'QCTOT' , 'CTMenv' , + 'LFR' , 'CTMenv' , + 'QLCN' , 'CTMenv' , + 'QICN' , 'CTMenv' , + 'TROPP' , 'CTMenv' , + 'LWI' , 'CTMenv' , + 'MASS' , 'CTMenv' , + 'TH' , 'CTMenv' , + 'MFXr8' , 'CTMenv' , + 'MFYr8' , 'CTMenv' , + 'CYr8' , 'CTMenv' , + 'CXr8' , 'CTMenv' , + :: + + + + + + + + + + + + + +# ------------------------ +# Idealized Passive Tracer +# ------------------------ + idealPT.template: '%y4%m2%d2_%h2%n2z.nc4', + idealPT.archive: '%c/Y%y4', + idealPT.format: 'CFIO', + idealPT.mode: 'instantaneous', + idealPT.frequency: 060000, + idealPT.duration: 000000, + idealPT.ref_time: 000000, + idealPT.vscale: 100.0, + idealPT.grid_label: PC180x91-DC, + idealPT.vunit: 'hPa', + idealPT.vvars: 'log(PLE)' , 'CTMenv' , + idealPT.levels: 1000 975 950 925 900 875 850 825 800 775 750 725 700 650 600 550 500 450 400 350 300 250 200 150 100, + idealPT.resolution: 360 181, + idealPT.fields: 'Q01' , 'PTRACERS' , + 'Q02' , 'PTRACERS' , + 'Q03' , 'PTRACERS' , + 'Q04' , 'PTRACERS' , + :: + + +# ----------------- +# TR Passive tracer +# ----------------- + pTracerTR.template: '%y4%m2%d2_%h2%n2z.nc4', + pTracerTR.archive: '%c/Y%y4', + pTracerTR.format: 'CFIO', + pTracerTR.mode: 'instantaneous', + pTracerTR.frequency: 030000, + pTracerTR.ref_time: 000000, + pTracerTR.vscale: 100.0, + pTracerTR.vunit: 'hPa', + pTracerTR.vvars: 'log(PLE)' , 'CTMenv' , + pTracerTR.levels: 1000 975 950 925 900 875 850 825 800 775 750 725 700 650 600 550 500 450 400 350 300 250 200 150 100, + pTracerTR.resolution: 360 181, + pTracerTR.fields: 'aoa' , 'TR' , + 'e90' , 'TR' , + 'Rn222' , 'TR' , + 'CH3I' , 'TR' , + :: + + +# --------------------- +# Aerosols/Constituents +# --------------------- +# +# +#### GOCART + tavg2d_aer_x.format: 'CFIO', + tavg2d_aer_x.template: '%y4%m2%d2_%h2%n2z.nc4', + tavg2d_aer_x.archive: '%c/Y%y4', + tavg2d_aer_x.mode: 'time-averaged', + tavg2d_aer_x.frequency: 030000, + tavg2d_aer_x.duration: 030000, + tavg2d_aer_x.ref_time: 210000, + tavg2d_aer_x.resolution: 180 91, + tavg2d_aer_x.fields: 'TOTEXTTAU' , 'GOCART' , + 'TOTSCATAU' , 'GOCART' , + 'TOTANGSTR' , 'GOCART' , + 'DUEM001' , 'GOCART' , + 'DUEM002' , 'GOCART' , + 'DUEM003' , 'GOCART' , + 'DUEM004' , 'GOCART' , + 'DUEM005' , 'GOCART' , + 'DUSD001' , 'GOCART' , + 'DUSD002' , 'GOCART' , + 'DUSD003' , 'GOCART' , + 'DUSD004' , 'GOCART' , + 'DUSD005' , 'GOCART' , + 'DUDP001' , 'GOCART' , + 'DUDP002' , 'GOCART' , + 'DUDP003' , 'GOCART' , + 'DUDP004' , 'GOCART' , + 'DUDP005' , 'GOCART' , + 'DUWT001' , 'GOCART' , + 'DUWT002' , 'GOCART' , + 'DUWT003' , 'GOCART' , + 'DUWT004' , 'GOCART' , + 'DUWT005' , 'GOCART' , + 'DUSMASS' , 'GOCART' , + 'DUCMASS' , 'GOCART' , + 'DUEXTTAU' , 'GOCART' , + 'DUSCATAU' , 'GOCART' , + 'DUANGSTR' , 'GOCART' , + 'DUEXTTFM' , 'GOCART' , + 'DUSCATFM' , 'GOCART' , + 'DUSMASS25' , 'GOCART' , + 'DUCMASS25' , 'GOCART' , + 'DUEXTT25' , 'GOCART' , + 'DUSCAT25' , 'GOCART' , + 'DUAERIDX' , 'GOCART' , + 'DUFLUXU' , 'GOCART' , + 'DUFLUXV' , 'GOCART' , + 'SSEM001' , 'GOCART' , + 'SSEM002' , 'GOCART' , + 'SSEM003' , 'GOCART' , + 'SSEM004' , 'GOCART' , + 'SSEM005' , 'GOCART' , + 'SSSD001' , 'GOCART' , + 'SSSD002' , 'GOCART' , + 'SSSD003' , 'GOCART' , + 'SSSD004' , 'GOCART' , + 'SSSD005' , 'GOCART' , + 'SSDP001' , 'GOCART' , + 'SSDP002' , 'GOCART' , + 'SSDP003' , 'GOCART' , + 'SSDP004' , 'GOCART' , + 'SSDP005' , 'GOCART' , + 'SSWT001' , 'GOCART' , + 'SSWT002' , 'GOCART' , + 'SSWT003' , 'GOCART' , + 'SSWT004' , 'GOCART' , + 'SSWT005' , 'GOCART' , + 'SSSMASS' , 'GOCART' , + 'SSCMASS' , 'GOCART' , + 'SSEXTTAU' , 'GOCART' , + 'SSSCATAU' , 'GOCART' , + 'SSANGSTR' , 'GOCART' , + 'SSEXTTFM' , 'GOCART' , + 'SSSCATFM' , 'GOCART' , + 'SSSMASS25' , 'GOCART' , + 'SSCMASS25' , 'GOCART' , + 'SSEXTT25' , 'GOCART' , + 'SSSCAT25' , 'GOCART' , + 'SSAERIDX' , 'GOCART' , + 'SSFLUXU' , 'GOCART' , + 'SSFLUXV' , 'GOCART' , + 'SUEM001' , 'GOCART' , + 'SUEM002' , 'GOCART' , + 'SUEM003' , 'GOCART' , + 'SUEM004' , 'GOCART' , + 'SUDP001' , 'GOCART' , + 'SUDP002' , 'GOCART' , + 'SUDP003' , 'GOCART' , + 'SUDP004' , 'GOCART' , + 'SUWT001' , 'GOCART' , + 'SUWT002' , 'GOCART' , + 'SUWT003' , 'GOCART' , + 'SUWT004' , 'GOCART' , + 'SO2SMASS' , 'GOCART' , + 'SO2CMASS' , 'GOCART' , + 'SO4SMASS' , 'GOCART' , + 'SO4CMASS' , 'GOCART' , + 'DMSSMASS' , 'GOCART' , + 'DMSCMASS' , 'GOCART' , + 'SUPSO2' , 'GOCART' , + 'SUPSO4G' , 'GOCART' , + 'SUPSO4AQ' , 'GOCART' , + 'SUPSO4WT' , 'GOCART' , + 'SUPMSA' , 'GOCART' , + 'SUEXTTAU' , 'GOCART' , + 'SUSCATAU' , 'GOCART' , + 'SUANGSTR' , 'GOCART' , + 'SO4EMAN' , 'GOCART' , + 'SO2EMAN' , 'GOCART' , + 'SO2EMBB' , 'GOCART' , + 'SO2EMVN' , 'GOCART' , + 'SO2EMVE' , 'GOCART' , + 'SUFLUXU' , 'GOCART' , + 'SUFLUXV' , 'GOCART' , + 'BCEM001' , 'GOCART' , + 'BCEM002' , 'GOCART' , + 'BCDP001' , 'GOCART' , + 'BCDP002' , 'GOCART' , + 'BCWT001' , 'GOCART' , + 'BCWT002' , 'GOCART' , + 'BCSMASS' , 'GOCART' , + 'BCCMASS' , 'GOCART' , + 'BCEXTTAU' , 'GOCART' , + 'BCSCATAU' , 'GOCART' , + 'BCANGSTR' , 'GOCART' , + 'BCHYPHIL' , 'GOCART' , + 'BCEMBB' , 'GOCART' , + 'BCEMBF' , 'GOCART' , + 'BCEMAN' , 'GOCART' , + 'BCFLUXU' , 'GOCART' , + 'BCFLUXV' , 'GOCART' , + 'OCEM001' , 'GOCART' , + 'OCEM002' , 'GOCART' , + 'OCDP001' , 'GOCART' , + 'OCDP002' , 'GOCART' , + 'OCWT001' , 'GOCART' , + 'OCWT002' , 'GOCART' , + 'OCSMASS' , 'GOCART' , + 'OCCMASS' , 'GOCART' , + 'OCEXTTAU' , 'GOCART' , + 'OCSCATAU' , 'GOCART' , + 'OCANGSTR' , 'GOCART' , + 'OCEMBB' , 'GOCART' , + 'OCEMBF' , 'GOCART' , + 'OCEMAN' , 'GOCART' , + 'OCEMBG' , 'GOCART' , + 'OCHYPHIL' , 'GOCART' , + 'OCFLUXU' , 'GOCART' , + 'OCFLUXV' , 'GOCART' , + :: + + tavg3d_aer_p.format: 'CFIO' , + tavg3d_aer_p.template: '%y4%m2%d2_%h2%n2z.nc4', + tavg3d_aer_p.archive: '%c/Y%y4', + tavg3d_aer_p.frequency: 030000 , + tavg3d_aer_p.duration: 030000 , + tavg3d_aer_p.ref_time: 210000 , + tavg3d_aer_p.resolution: 180 91, + tavg3d_aer_p.mode: 'time-averaged', + tavg3d_aer_p.vscale: 100.0, + tavg3d_aer_p.vunit: 'hPa', + tavg3d_aer_p.vvars: 'log(PLE)' , 'CTMenv' , + tavg3d_aer_p.levels: 1000 975 950 925 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 30 20 10, + tavg3d_aer_p.fields: 'AIRDENS' , 'CHEMENV' , + 'DUMASS' , 'GOCART' , 'DU' , + 'SSMASS' , 'GOCART' , 'SS' , + 'BCMASS' , 'GOCART' , 'BC' , + 'OCMASS' , 'GOCART' , 'OC' , + 'GOCART::SO2' , 'GOCART' , 'SO2' , + 'GOCART::SO4' , 'GOCART' , 'SO4' , + :: +# ---------------------------------------- +# GMI Collections +# ---------------------------------------- + + gmi_edge.template: '%y4%m2%d2_%h2%n2z.nc4', + gmi_edge.archive: '%c/Y%y4', + gmi_edge.format: 'CFIO', + gmi_edge.mode: 'time-averaged', + gmi_edge.conservative: 1, + gmi_edge.frequency: 240000, + gmi_edge.duration: 240000, + gmi_edge.ref_time: 000000, + gmi_edge.resolution: 180 91, + gmi_edge.fields: 'PLE' , 'CTMenv' , + :: + + + gmi_inst.template: '%y4%m2%d2_%h2%n2z.nc4', + gmi_inst.archive: '%c/Y%y4', + gmi_inst.format: 'CFIO', + gmi_inst.mode: 'instantaneous', + gmi_inst.conservative: 1, + gmi_inst.frequency: 030000, + gmi_inst.ref_time: 000000, + gmi_inst.resolution: 180 91, + gmi_inst.fields: 'MASS' , 'CTMenv' , 'csMASS' , + 'AOADAYS' , 'GMICHEM' , + 'O3' , 'GMICHEM' , + 'N2O5' , 'GMICHEM' , + 'ClONO2' , 'GMICHEM' , 'CLONO2' , + 'HCl' , 'GMICHEM' , 'HCL' , + 'HOCl' , 'GMICHEM' , 'HOCL' , + 'N2O' , 'GMICHEM' , + 'Cl2' , 'GMICHEM' , 'CL2' , + 'OClO' , 'GMICHEM' , 'OCLO' , + 'BrCl' , 'GMICHEM' , 'BRCL' , + 'HBr' , 'GMICHEM' , 'HBR' , + 'BrONO2' , 'GMICHEM' , 'BRONO2' , + 'CH4' , 'GMICHEM' , + 'HOBr' , 'GMICHEM' , 'HOBR' , + 'CO' , 'GMICHEM' , + 'HNO3COND' , 'GMICHEM' , + 'HNO3' , 'GMICHEM' , 'HNO3GAS' , + 'CFC11' , 'GMICHEM' , 'F11' , + 'CFC12' , 'GMICHEM' , 'F12' , + 'CFC113' , 'GMICHEM' , 'F113' , + 'CCl4' , 'GMICHEM' , 'CCL4' , + 'CH3CCl3' , 'GMICHEM' , 'CH3CCL3' , + 'CH3Cl' , 'GMICHEM' , 'CH3CL' , + 'CH3Br' , 'GMICHEM' , 'CH3BR' , + 'H2402' , 'GMICHEM' , + 'O' , 'GMICHEM' , + 'O1D' , 'GMICHEM' , + 'N' , 'GMICHEM' , + 'NO' , 'GMICHEM' , + 'NO2' , 'GMICHEM' , + 'NO3' , 'GMICHEM' , + 'H' , 'GMICHEM' , 'HATOMIC' , + 'H2' , 'GMICHEM' , + 'OH' , 'GMICHEM' , + 'MO2' , 'GMICHEM' , + 'MP' , 'GMICHEM' , + 'HO2' , 'GMICHEM' , + 'Cl' , 'GMICHEM' , 'CL' , + 'ClO' , 'GMICHEM' , 'CLO' , + 'BrO' , 'GMICHEM' , 'BRO' , + 'Br' , 'GMICHEM' , 'BR' , + 'Cl2O2' , 'GMICHEM' , 'CL2O2' , + 'CH2O' , 'GMICHEM' , + 'PAN' , 'GMICHEM' , + 'ISOP' , 'GMICHEM' , 'ISOPRENE' , + 'ALD2' , 'GMICHEM' , + 'ALK4' , 'GMICHEM' , + 'C2H6' , 'GMICHEM' , + 'C3H8' , 'GMICHEM' , + 'PRPE' , 'GMICHEM' , + 'RCOOH' , 'GMICHEM' , + 'ACET' , 'GMICHEM' , + 'EMISOPSFC' , 'GMICHEM' , + 'EMMONOT' , 'GMICHEM' , + 'EMNOX' , 'GMICHEM' , + 'EMBIOCOMETH' , 'GMICHEM' , + 'EMBIOCOMONOT' , 'GMICHEM' , + 'EMBIOPROPENE' , 'GMICHEM' , + 'EMSOILNOX' , 'GMICHEM' , + 'EM_NO' , 'GMICHEM' , + 'EM_CO' , 'GMICHEM' , + 'EM_MEK' , 'GMICHEM' , + 'EM_PRPE' , 'GMICHEM' , + 'EM_C2H6' , 'GMICHEM' , + 'EM_C3H8' , 'GMICHEM' , + 'EM_ALK4' , 'GMICHEM' , + 'EM_ALD2' , 'GMICHEM' , + 'EM_CH2O' , 'GMICHEM' , + 'EM_ACET' , 'GMICHEM' , + 'GMITO3' , 'GMICHEM' , + 'GMITTO3' , 'GMICHEM' , + 'AIRDENS' , 'CHEMENV' , + :: + + gmi_avrg.template: '%y4%m2%d2_%h2%n2z.nc4', + gmi_avrg.archive: '%c/Y%y4', + gmi_avrg.format: 'CFIO', + gmi_avrg.mode: 'time-averaged', + gmi_avrg.conservative: 1, + gmi_avrg.frequency: 240000, + gmi_avrg.duration: 240000, + gmi_avrg.ref_time: 000000, + gmi_avrg.resolution: 180 91, + gmi_avrg.fields: 'MASS' , 'CTMenv' , 'csMASS' , + 'AOADAYS' , 'GMICHEM' , + 'O3' , 'GMICHEM' , + 'N2O5' , 'GMICHEM' , + 'ClONO2' , 'GMICHEM' , 'CLONO2' , + 'HCl' , 'GMICHEM' , 'HCL' , + 'HOCl' , 'GMICHEM' , 'HOCL' , + 'N2O' , 'GMICHEM' , + 'Cl2' , 'GMICHEM' , 'CL2' , + 'OClO' , 'GMICHEM' , 'OCLO' , + 'BrCl' , 'GMICHEM' , 'BRCL' , + 'HBr' , 'GMICHEM' , 'HBR' , + 'BrONO2' , 'GMICHEM' , 'BRONO2' , + 'CH4' , 'GMICHEM' , + 'HOBr' , 'GMICHEM' , 'HOBR' , + 'CO' , 'GMICHEM' , + 'HNO3COND' , 'GMICHEM' , + 'HNO3' , 'GMICHEM' , 'HNO3GAS' , + 'CFC11' , 'GMICHEM' , 'F11' , + 'CFC12' , 'GMICHEM' , 'F12' , + 'CFC113' , 'GMICHEM' , 'F113' , + 'CCl4' , 'GMICHEM' , 'CCL4' , + 'CH3CCl3' , 'GMICHEM' , 'CH3CCL3' , + 'CH3Cl' , 'GMICHEM' , 'CH3CL' , + 'CH3Br' , 'GMICHEM' , 'CH3BR' , + 'H2402' , 'GMICHEM' , + 'O' , 'GMICHEM' , + 'O1D' , 'GMICHEM' , + 'N' , 'GMICHEM' , + 'NO' , 'GMICHEM' , + 'NO2' , 'GMICHEM' , + 'NO3' , 'GMICHEM' , + 'H' , 'GMICHEM' , 'HATOMIC' , + 'H2' , 'GMICHEM' , + 'OH' , 'GMICHEM' , + 'MO2' , 'GMICHEM' , + 'MP' , 'GMICHEM' , + 'HO2' , 'GMICHEM' , + 'Cl' , 'GMICHEM' , 'CL' , + 'ClO' , 'GMICHEM' , 'CLO' , + 'BrO' , 'GMICHEM' , 'BRO' , + 'Br' , 'GMICHEM' , 'BR' , + 'Cl2O2' , 'GMICHEM' , 'CL2O2' , + 'CH2O' , 'GMICHEM' , + 'PAN' , 'GMICHEM' , + 'ISOP' , 'GMICHEM' , 'ISOPRENE' , + 'ALD2' , 'GMICHEM' , + 'ALK4' , 'GMICHEM' , + 'C2H6' , 'GMICHEM' , + 'C3H8' , 'GMICHEM' , + 'PRPE' , 'GMICHEM' , + 'RCOOH' , 'GMICHEM' , + 'ACET' , 'GMICHEM' , + 'EMISOPSFC' , 'GMICHEM' , + 'EMMONOT' , 'GMICHEM' , + 'EMNOX' , 'GMICHEM' , + 'EMBIOCOMETH' , 'GMICHEM' , + 'EMBIOCOMONOT' , 'GMICHEM' , + 'EMBIOPROPENE' , 'GMICHEM' , + 'EMSOILNOX' , 'GMICHEM' , + 'EM_NO' , 'GMICHEM' , + 'EM_CO' , 'GMICHEM' , + 'EM_MEK' , 'GMICHEM' , + 'EM_PRPE' , 'GMICHEM' , + 'EM_C2H6' , 'GMICHEM' , + 'EM_C3H8' , 'GMICHEM' , + 'EM_ALK4' , 'GMICHEM' , + 'EM_ALD2' , 'GMICHEM' , + 'EM_CH2O' , 'GMICHEM' , + 'EM_ACET' , 'GMICHEM' , + 'GMITO3' , 'GMICHEM' , + 'GMITTO3' , 'GMICHEM' , + 'AIRDENS' , 'CHEMENV' , + :: + + tavg1_2d_chm_Nx.template: '%y4%m2%d2_%h2%n2z.nc4', + tavg1_2d_chm_Nx.archive: '%c/Y%y4', + tavg1_2d_chm_Nx.descr: '2d,1-Hourly,Time-Averaged,Surface-Layer,Chemistry Fields', + tavg1_2d_chm_Nx.format: 'CFIO', + tavg1_2d_chm_Nx.mode: 'time-averaged', + tavg1_2d_chm_Nx.frequency: 010000, + tavg1_2d_chm_Nx.duration: 010000, + tavg1_2d_chm_Nx.ref_time: 000000, + tavg1_2d_chm_Nx.nbits: 10, + tavg1_2d_chm_Nx.resolution: 144 91, + tavg1_2d_chm_Nx.levels: 72, + tavg1_2d_chm_Nx.fields: 'TRC_NO' , 'GEOSCHEMCHEM' , 'NO' , + 'NO2dry' , 'GEOSCHEMCHEM' , 'NO2' , + 'O3dry' , 'GEOSCHEMCHEM' , 'O3' , + 'TRC_SO2' , 'GEOSCHEMCHEM' , 'SO2GC' , + 'TRC_CO' , 'GEOSCHEMCHEM' , 'COGC' , +# 'NOdry' , 'GEOSCHEMCHEM' , + 'COdry' , 'GEOSCHEMCHEM' , +# 'SO2dry' , 'GEOSCHEMCHEM' , + 'GOCART::SO2' , 'GOCART' , 'SO2' , + 'COSC' , 'GOCART' , 'CO' , + :: + + inst_geoschem.format: 'CFIO' , + inst_geoschem.descr: '2d,15-minute,Instantaneous,Single-Level,Hyperwall', + inst_geoschem.template: '%y4%m2%d2_%h2%n2z.nc4', + inst_geoschem.archive: '%c/Y%y4', + inst_geoschem.mode: 'instantaneous', + inst_geoschem.resolution: 144 91, + inst_geoschem.conservative: 1, + inst_geoschem.frequency: 001500 , + inst_geoschem.duration: 001500 , + inst_geoschem.ref_time: 000000 , +# inst_geoschem.levels: 72, +# inst_geoschem.nbits: 10, + inst_geoschem.fields: 'GCC_JVAL_001' , 'GEOSCHEMCHEM' , + 'GCC_JVAL_002' , 'GEOSCHEMCHEM' , + 'GCC_JVAL_006' , 'GEOSCHEMCHEM' , + 'GCC_JVAL_036' , 'GEOSCHEMCHEM' , + 'GCC_RR_413' , 'GEOSCHEMCHEM' , + 'GCC_RR_001' , 'GEOSCHEMCHEM' , + 'GCC_RR_231' , 'GEOSCHEMCHEM' , + :: + diff --git a/ESMF/Apps/experiment/GEOSCTM.rc b/ESMF/Apps/experiment/GEOSCTM.rc new file mode 100644 index 00000000..a316d994 --- /dev/null +++ b/ESMF/Apps/experiment/GEOSCTM.rc @@ -0,0 +1,24 @@ + NX: 1 + NY: 1 +# Model Resolution and Timestep Parameters +# ---------------------------------------- + DYCORE: NONE + GEOSctm.NX: 1 + GEOSctm.NY: 1 + GEOSctm.GRID_TYPE: LatLon + GEOSctm.GRIDNAME: DC180x91-PE + GEOSctm.LM: 72 + GEOSctm.IM_WORLD: 180 + GEOSctm.JM_WORLD: 91 + GEOSctm.POLE: 'PC' + GEOSctm.DATELINE: 'DC' + + AGCM.NX: 1 + AGCM.NY: 1 + AGCM.GRID_TYPE: LatLon + AGCM.GRIDNAME: PE180x91-DE + AGCM.IM_WORLD: 180 + AGCM.JM_WORLD: 91 + AGCM.DATELINE: 'DC' + AGCM.POLE: 'PC' + AGCM.LM: 72 diff --git a/ESMF/Apps/experiment/NUOPC_run_config.txt b/ESMF/Apps/experiment/NUOPC_run_config.txt new file mode 100644 index 00000000..3a6814a7 --- /dev/null +++ b/ESMF/Apps/experiment/NUOPC_run_config.txt @@ -0,0 +1,26 @@ +run_sequence:: + @900 + provider +# provider -> reciever +# ufs +# ufs -> reciever +# reciever + @ +:: + +provider_pets: 1 +reciever_pets: 1 +ufs_pets: 1 +sequential: false + +interpolation_dt: 1800 + +end_date: 20000417 +end_time: 210000 + +# requires a mediator restart file for one timestep ahead of the model start time + +use_regridding: false +use_time_interpolation: false +create_restart: false + diff --git a/ESMF/Apps/experiment/PROVIDER_CAP.rc b/ESMF/Apps/experiment/PROVIDER_CAP.rc new file mode 100755 index 00000000..90ceedb1 --- /dev/null +++ b/ESMF/Apps/experiment/PROVIDER_CAP.rc @@ -0,0 +1,36 @@ + +MAPLROOT_COMPNAME: AGCM + ROOT_NAME: AGCM +ROOT_CF: AGCM.rc +HIST_CF: AGCM_HISTORY.rc +EXTDATA_CF: AGCM_ExtData.rc + +BEG_DATE: 18910301 000000 +END_DATE: 20201006 000000 +JOB_SGMT: 00010000 000000 +NUM_SGMT: 1 +HEARTBEAT_DT: 900 + +REPORT_THROUGHPUT: .false. + +USE_SHMEM: 0 + +# Parameters for Cycled REPLAY Forecasts +# -------------------------------------- + BEG_REPDATE: YYYYMMDD + END_REPDATE: YYYYMMDD +FCST_SEGMENT: 00000000 + +#PERPETUAL_YEAR: YYYY +#PERPETUAL_MONTH: MM +#PERPETUAL_DAY: DD + +MAPL_ENABLE_TIMERS: YES +MAPL_ENABLE_MEMUTILS: NO +PRINTSPEC: 0 # (0: OFF, 1: IMPORT & EXPORT, 2: IMPORT, 3: EXPORT) + + +CAP_EXPORTS: + var1,AGCM +:: + diff --git a/ESMF/Apps/experiment/RECIEVER_CAP.rc b/ESMF/Apps/experiment/RECIEVER_CAP.rc new file mode 100755 index 00000000..bf4bbfd7 --- /dev/null +++ b/ESMF/Apps/experiment/RECIEVER_CAP.rc @@ -0,0 +1,33 @@ + +MAPLROOT_COMPNAME: GEOSctm + ROOT_NAME: GEOSctm + ROOT_CF: GEOSCTM.rc + HIST_CF: CTM_HISTORY.rc + #EXTDATA_CF: MAPL_ExtData.rc + EXTDATA_CF: AGCM_ExtData.rc + +BEG_DATE: 18910301 000000 +END_DATE: 20201006 000000 +JOB_SGMT: 00010000 000000 +NUM_SGMT: 1 +HEARTBEAT_DT: 900 + +REPORT_THROUGHPUT: .false. + +FCST_SEGMENT: 00000000 + +USE_SHMEM: 0 + +#PERPETUAL_YEAR: YYYY +#PERPETUAL_MONTH: MM +#PERPETUAL_DAY: DD + +MAPL_ENABLE_TIMERS: YES +MAPL_ENABLE_MEMUTILS: NO +PRINTSPEC: 0 # (0: OFF, 1: IMPORT & EXPORT, 2: IMPORT, 3: EXPORT) + + +CAP_IMPORTS: + var1 +:: + diff --git a/ESMF/Apps/experiment/cap_restart b/ESMF/Apps/experiment/cap_restart new file mode 100644 index 00000000..d099b220 --- /dev/null +++ b/ESMF/Apps/experiment/cap_restart @@ -0,0 +1 @@ +20000414 210000 diff --git a/ESMF/Apps/experiment/cap_restart.orig b/ESMF/Apps/experiment/cap_restart.orig new file mode 100644 index 00000000..d099b220 --- /dev/null +++ b/ESMF/Apps/experiment/cap_restart.orig @@ -0,0 +1 @@ +20000414 210000 diff --git a/ESMF/Apps/experiment/fvcore_layout.rc b/ESMF/Apps/experiment/fvcore_layout.rc new file mode 100755 index 00000000..c93f9094 --- /dev/null +++ b/ESMF/Apps/experiment/fvcore_layout.rc @@ -0,0 +1,77 @@ +&fv_core_nml + fill = .F. + / + + &main_nml +/ + + &test_case_nml + test_case = 13 + / + + &fms_io_nml +/ + + &fms_nml + print_memory_usage=.false. + domains_stack_size = 24000000 +/ + +&gfdl_cloud_microphysics_nml + sedi_transport = .true. + do_sedi_heat = .false. + rad_snow = .true. + rad_graupel = .true. + rad_rain = .true. + const_vi = .F. + const_vs = .F. + const_vg = .F. + const_vr = .F. + vi_fac = 2. + vs_fac = 20. + vg_fac = 1. + vr_fac = 20. + vi_max = 120. + vs_max = 120. + vg_max = 120. + vr_max = 120. + qi_lim = 1. + prog_ccn = .true. + do_qa = .true. + fast_sat_adj = .true. + tau_r2g = 900. + tau_smlt = 900. + tau_g2r = 600. + tau_imlt = 600. + tau_i2s = 1000. + tau_l2r = 150. + tau_v2l = 150. + tau_l2v = 900. + tau_g2v = 900. + tau_v2g = 21600. + rthresh = 10.e-6 + dw_land = 0.32 + dw_ocean = 0.10 + ql_gen = 1.0e-3 + ql_mlt = 1.0e-3 + qi0_crt = 8.0E-5 + qs0_crt = 1.0e-3 + c_psaci = 0.05 + c_pgacs = 0.01 + rh_inc = 0.30 + rh_inr = 0.30 + rh_ins = 0.30 + ccn_l = 150. + ccn_o = 30. + c_paut = 1.0 + c_cracw = 0.8 + use_ppm = .false. + use_ccn = .true. + mono_prof = .true. + z_slope_liq = .true. + z_slope_ice = .true. + de_ice = .false. + fix_negative = .true. + icloud_f = 0 + mp_time = 150 +/ diff --git a/ESMF/Apps/experiment/logging.yaml b/ESMF/Apps/experiment/logging.yaml new file mode 100644 index 00000000..20f91ede --- /dev/null +++ b/ESMF/Apps/experiment/logging.yaml @@ -0,0 +1,108 @@ +schema_version: 1 + +locks: + mpi: + class: MpiLock + comm: MPI_COMM_WORLD + +formatters: + basic: + class: Formatter + format: '%(name)a~: %(level_name)a~: %(message)a' + mpi: + class: MpiFormatter + format: '%(mpi_rank)i4.4~: %(name)~: %(level_name)a~: %(message)a' + comm: MPI_COMM_WORLD + column: + class: Formatter + format: '(%(i)i3.3,%(j)i3.3): %(level_name)' + +handlers: + console: + class: streamhandler + formatter: basic + unit: OUTPUT_UNIT + level: WARNING + + + warnings: + class: FileHandler + filename: warnings_and_errors.log + lock: mpi + level: WARNING + formatter: basic + + errors: + class: StreamHandler + formatter: basic + unit: ERROR_UNIT + level: ERROR + + mpi_shared: + class: FileHandler + filename: allPEs.log + formatter: mpi + comm: MPI_COMM_WORLD + lock: mpi + rank_keyword: rank + level: DEBUG + + uwshcu_shared: + class: FileHandler + filename: uwshcu.log + formatter: mpi + comm: MPI_COMM_WORLD + lock: mpi + rank_keyword: rank + level: DEBUG + + mpi_debug: + class: MpiFileHandler + formatter: basic + filename: debug_%(rank)i3.3~.log + comm: MPI_COMM_WORLD + rank_prefix: rank + level: DEBUG + +root: + parallel: true + handlers: [warnings,errors] + level: WARNING + +loggers: + + parallel: + parallel: true + handlers: [mpi_debug,mpi_shared] + lock: mpi + propagate: false + level: DEBUG + + CAP.GCM.AGCM.PHYSICS: + parallel: true + handlers: [mpi_shared] + lock: mpi + level: WARNING + root_level: INFO + + MAPL: + parallel: true + handlers: [mpi_shared] + lock: mpi +# propagate: false + level: INFO + root_level: DEBUG + + uwshcu: + handlers: [uwshcu_shared] + lock: mpi + propagate: false + level: DEBUG + root_level: DEBUG + + + errors: + handlers: [errors] + parallel: true + lock: mpi + level: ERROR diff --git a/ESMF/CMakeLists.txt b/ESMF/CMakeLists.txt new file mode 100644 index 00000000..1bfb633c --- /dev/null +++ b/ESMF/CMakeLists.txt @@ -0,0 +1,12 @@ +set (HEMCO_EXTERNAL_CONFIG TRUE) +set (MAPL_ESMF TRUE) +set (BUILD_GEOS_INTERFACE TRUE) + +esma_add_subdirectories( + Apps + Shared + Aerosol_GridComp + GOCART_GridComp + GOCART2G_GridComp + # HEMCO_GridComp +) diff --git a/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridCompMod.F90 new file mode 100644 index 00000000..8b3a3563 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridCompMod.F90 @@ -0,0 +1,1285 @@ +#include "MAPL_Generic.h" + +!============================================================================= +!BOP + +! !MODULE: CA2G_GridCompMod - GOCART Carbonaceous Aerosol gridded component + +! !INTERFACE: +module CA2G_GridCompMod + +! !USES: + use ESMF + use MAPL + use Chem_MieTableMod2G + use Chem_AeroGeneric + use iso_c_binding, only: c_loc, c_f_pointer, c_ptr + + use GOCART2G_Process ! GOCART2G process library + use GA_GridCompMod + use m_StrTemplate ! string templates + + implicit none + private + + integer, parameter :: instanceComputational = 1 + integer, parameter :: instanceData = 2 + +! !PUBLIC MEMBER FUNCTIONS: + public SetServices + +real, parameter :: chemgrav = 9.80616 +real, parameter :: undefval = 1.e15 ! missing value + +! !DESCRIPTION: This module implements GOCART2G's Carbonaceous Aerosol (CA) Gridded Component. + +! !REVISION HISTORY: +! 15June2020 Sherman, da Silva, Darmenov, Clune - First attempt at refactoring. + +!EOP +!=========================================================================== + +! !Carbonaceous aerosol state + type, extends(GA_GridComp) :: CA2G_GridComp + integer :: myDOW = -1 ! my Day of the week: Sun=1, Mon=2,...,Sat=7 + real :: ratPOM = 1.0 ! Ratio of POM to OC mass + real :: fTerpene = 0.0 ! Fraction of terpene emissions -> aerosol + real :: fHydrophobic ! Initially hydrophobic portion + logical :: diurnal_bb ! diurnal biomass burning + real :: aviation_layers(4) ! heights of the LTO, CDS and CRS layers +! !Workspae for point emissions + logical :: doing_point_emissions = .false. + character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions + integer :: nPts = -1 + integer, allocatable, dimension(:) :: pstart, pend + real, allocatable, dimension(:) :: pLat, & + pLon, & + pBase, & + pTop, & + pEmis + + end type CA2G_GridComp + + type wrap_ + type (CA2G_GridComp), pointer :: PTR => null() + end type wrap_ + +contains + +!============================================================================ +!BOP + +! !IROUTINE: SetServices + +! !INTERFACE: + subroutine SetServices (GC, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(INOUT) :: GC ! gridded component + integer, intent( OUT) :: RC ! return code + +! !DESCRIPTION: This version uses MAPL_GenericSetServices, which sets +! the Initialize and Finalize services to generic versions. It also +! allocates our instance of a generic state and puts it in the +! gridded component (GC). Here we only set the two-stage run method +! and declare the data services. + +! !REVISION HISTORY: +! june2019 E.Sherman, A.Da Silva, A.Darmenov, T.Clune First attempt at refactoring + +!EOP +!============================================================================ + +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (ESMF_Config) :: cfg + type (wrap_) :: wrap + type (CA2G_GridComp), pointer :: self + + character (len=ESMF_MAXSTR) :: field_name, GCsuffix + + integer :: i, nbins + real :: DEFVAL + logical :: data_driven = .true. + + __Iam__('SetServices') + +!**************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'// Iam + + if (comp_name(1:5) == 'CA.oc') then + GCsuffix = 'OC' + else if (comp_name(1:5) == 'CA.bc') then + GCsuffix = 'BC' + else if (comp_name(1:5) == 'CA.br') then + GCsuffix = 'BR' + end if + +! Wrap internal state for storing in GC +! ------------------------------------- + allocate (self, __STAT__) + wrap%ptr => self + +! Load resource file +! ------------------- + cfg = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (cfg, 'CA2G_GridComp_'//trim(COMP_NAME)//'.rc', rc=status) + if (status /= 0) then + if (mapl_am_i_root()) print*,'CA2G_GridComp_'//trim(COMP_NAME)//'.rc does not exist! & + Loading CA2G_GridComp_CA.oc.rc instead' + call ESMF_ConfigLoadFile (cfg, 'CA2G_GridComp_CA.oc.rc', __RC__) + end if + +! process generic config items + call self%GA_GridComp%load_from_config( cfg, __RC__) + + call ESMF_ConfigGetAttribute (cfg, self%nbins, label='nbins:', __RC__) + nbins = self%nbins + +! Parse config file into private internal state +! ---------------------------------------------- + call ESMF_ConfigGetAttribute (cfg, self%myDOW, label='my_day_of_week:', default=-1, __RC__) + call ESMF_ConfigGetAttribute (cfg, self%fhydrophobic, label='hydrophobic_fraction:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%ratPOM, label='pom_oc_ratio:', default=1.0, __RC__) + call ESMF_ConfigGetAttribute (cfg, self%fTerpene, label='terpene_emission_fraction:', default=0.0, __RC__) + + call ESMF_ConfigFindLabel (cfg, 'aviation_vertical_layers:', __RC__) + do i=1,size(self%aviation_layers) + call ESMF_ConfigGetAttribute (cfg, self%aviation_layers(i), __RC__) + end do + + call ESMF_ConfigGetAttribute (cfg, self%point_emissions_srcfilen, & + label='point_emissions_srcfilen:', default='/dev/null', __RC__) + if ( (index(self%point_emissions_srcfilen,'/dev/null')>0) ) then + self%doing_point_emissions = .false. ! disable it if no file specified + else + self%doing_point_emissions = .true. ! we are good to go + end if + +! Is CA data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Set entry points +! ------------------------ + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Initialize, Initialize, __RC__) + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Run, Run, __RC__) + if (data_driven .neqv. .true.) then + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Run, Run2, __RC__) + end if + + DEFVAL = 0.0 + +! IMPORT STATE +! ------------- + if (data_driven) then + +! Pressure at layer edges +! ----------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'PLE', & + LONG_NAME = 'air_pressure', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + +! RH: is between 0 and 1 +! ---------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'RH2', & + LONG_NAME = 'Rel_Hum_after_moist', & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddInternalSpec(GC, & + short_name = 'CAphobic', & + long_name = trim(GCsuffix)//' phobic Mixing Ratio',& + units = 'kg kg-1', & + restart = MAPL_RestartOptional, & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, __RC__) + + call MAPL_AddInternalSpec(GC, & + short_name = 'CAphilic', & + long_name = trim(GCsuffix)//' philic Mixing Ratio',& + units = 'kg kg-1', & + restart = MAPL_RestartOptional, & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, __RC__) + + call MAPL_AddImportSpec(GC, & + short_name = 'clim'//trim(GCsuffix)//'phobic', & + long_name = trim(GCsuffix)//' phobic Mixing Ratio',& + units = 'kg kg-1', & + restart = MAPL_RestartOptional, & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, __RC__) + + call MAPL_AddImportSpec(GC, & + short_name = 'clim'//trim(GCsuffix)//'philic', & + long_name = trim(GCsuffix)//' philic Mixing Ratio',& + units = 'kg kg-1', & + restart = MAPL_RestartOptional, & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, __RC__) + + do i = 1, self%nbins + write (field_name, '(A, I0.3)') '', i +! !dry deposition + call MAPL_AddImportSpec(GC, & + short_name = 'clim'//trim(GCsuffix)//'DP'//trim(field_name), & + long_name = 'Organic Carbon Mixing Ratio (bin '//trim(field_name)//')', & + units = 'kg kg-1', & + dims = MAPL_DimsHorzOnly, & + vlocation = MAPL_VLocationCenter, & + restart = MAPL_RestartSkip, __RC__) + +! !wet deposition + call MAPL_AddImportSpec(GC, & + short_name = 'clim'//trim(GCsuffix)//'WT'//trim(field_name), & + long_name = 'Organic Carbon Mixing Ratio (bin '//trim(field_name)//')', & + units = 'kg kg-1', & + dims = MAPL_DimsHorzOnly, & + vlocation = MAPL_VLocationCenter, & + restart = MAPL_RestartSkip, __RC__) + +! !gravitational settling + call MAPL_AddImportSpec(GC, & + short_name = 'clim'//trim(GCsuffix)//'SD'//trim(field_name), & + long_name = 'Organic Carbon Mixing Ratio (bin '//trim(field_name)//')', & + units = 'kg kg-1', & + dims = MAPL_DimsHorzOnly, & + vlocation = MAPL_VLocationCenter, & + restart = MAPL_RestartSkip, __RC__) + +! !convective scavenging + call MAPL_AddImportSpec(GC, & + short_name = 'clim'//trim(GCsuffix)//'SV'//trim(field_name), & + long_name = 'Organic Carbon Mixing Ratio (bin '//trim(field_name)//')', & + units = 'kg kg-1', & + dims = MAPL_DimsHorzOnly, & + vlocation = MAPL_VLocationCenter, & + restart = MAPL_RestartSkip, __RC__) +! end if + end do + end if ! (data_driven) + + +! Computational Import and Export states +! -------------------------------------- + if (.not. data_driven) then +#include "CA2G_Export___.h" +#include "CA2G_Import___.h" +#include "CA2G_Internal___.h" + end if + +! This state holds fields needed by radiation +! --------------------------------------------- + call MAPL_AddExportSpec (GC, & + short_name = trim(COMP_NAME)//'_AERO', & + long_name = 'aerosols_from_'//trim(COMP_NAME), & + units = 'kg kg-1', & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, & + datatype = MAPL_StateItem, __RC__) + +! This state is needed by MOIST - It will contain aerosols +! ---------------------------------------------------------- + call MAPL_AddExportSpec (GC, & + short_name = trim(COMP_NAME)//'_AERO_ACI', & + long_name = 'aerosol_cloud_interaction_aerosols_from_'//trim(COMP_NAME), & + units = 'kg kg-1', & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, & + datatype = MAPL_StateItem, __RC__) + +! This bundle is needed by surface for snow albedo modification +! by aerosol settling and deposition +! ~~~DEVELOPERS NOTE~~~ Change to StateItem when possible +! --------------------------------------------------------------- + call MAPL_AddExportSpec (GC, & + short_name = trim(COMP_NAME)//'_AERO_DP', & + long_name = 'aerosol_deposition_from_'//trim(COMP_NAME), & + units = 'kg m-2 s-1', & + dims = MAPL_DimsHorzOnly, & + datatype = MAPL_BundleItem, __RC__) + +! Store internal state in GC +! -------------------------- + call ESMF_UserCompSetInternalState ( GC, 'CA2G_GridComp', wrap, STATUS ) + VERIFY_(STATUS) + +! Set generic services +! ---------------------------------- + call MAPL_GenericSetServices (GC, __RC__) + + RETURN_(ESMF_SUCCESS) + + end subroutine SetServices + +!============================================================================ +!BOP + +! !IROUTINE: Initialize + +! !INTERFACE: + subroutine Initialize (GC, import, export, clock, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code + +! !DESCRIPTION: This initializes CA's Grid Component. It primaryily fills +! GOCART's AERO states with its carbonaceous aerosol fields. + +! !REVISION HISTORY: +! june2019 E.Sherman First attempt at refactoring + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_Grid) :: grid + type (ESMF_State) :: internal + type (ESMF_State) :: aero, aero_aci + type (ESMF_State) :: providerState + type (ESMF_Config) :: cfg, cf + type (ESMF_FieldBundle) :: Bundle_DP + type (wrap_) :: wrap + type (CA2G_GridComp), pointer :: self + + integer, allocatable :: mieTable_pointer(:) + integer :: i, dims(3), km + integer :: instance + type (ESMF_Field) :: field, fld + character (len=ESMF_MAXSTR) :: prefix, GCsuffix, diurnal_bb, bin_index + character (len=ESMF_MAXSTR),allocatable :: aerosol_names(:) + real, pointer, dimension(:,:,:) :: int_ptr + real :: CDT ! chemistry timestep (secs) + integer :: HDT ! model timestep (secs) + real, pointer, dimension(:,:,:) :: ple + real, pointer, dimension(:,:) :: area + logical :: data_driven + integer :: NUM_BANDS + + __Iam__('Initialize') + +!**************************************************************************** +! Begin... + +! Get the target components name and set-up traceback handle. +! ----------------------------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, name=COMP_NAME, config=cf, __RC__) + Iam = trim(COMP_NAME) // '::' //trim(Iam) + + if (comp_name(1:5) == 'CA.oc') then + GCsuffix = 'OC' + else if (comp_name(1:5) == 'CA.bc') then + GCsuffix = 'BC' + else if (comp_name(1:5) == 'CA.br') then + GCsuffix = 'BR' + end if + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get my internal private state +! ----------------------------- + call ESMF_UserCompGetInternalState(GC, 'CA2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Get dimensions +! --------------- + call MAPL_GridGet (grid, globalCellCountPerDim=dims, __RC__ ) + km = dims(3) + self%km = km + +! Get DTs +! ------- + call MAPL_GetResource(mapl, HDT, Label='RUN_DT:', __RC__) + call MAPL_GetResource(mapl, CDT, Label='GOCART_DT:', default=real(HDT), __RC__) + self%CDT = CDT + +! Check whether to de-activate diurnal biomass burning (default is *on*) +! ---------------------------------------------------------------------- + call ESMF_ConfigGetAttribute(cf, diurnal_bb, label='DIURNAL_BIOMASS_BURNING:', & + default='YES', __RC__) + diurnal_bb = ESMF_UtilStringUpperCase(diurnal_bb, __RC__) + if (trim(diurnal_bb) == 'YES') then + self%diurnal_bb = .true. + else + self%diurnal_bb = .false. + end if + +! Load resource file +! ------------------- + cfg = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (cfg, 'CA2G_GridComp_'//trim(COMP_NAME)//'.rc', rc=status) + if (status /= 0) then + if (mapl_am_i_root()) print*,'ERROR: CA2G_GridComp_'//trim(COMP_NAME)//'.rc does not exist!' + return + end if + +! Call Generic Initialize +! ------------------------ + call MAPL_GenericInitialize (GC, import, export, clock, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=internal, __RC__) + +! Is CA data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! If this is a data component, the data is provided in the import +! state via ExtData instead of the actual GOCART children +! ---------------------------------------------------------------- + if ( data_driven ) then + providerState = import + prefix = 'clim' + else + providerState = export + prefix = '' + end if + +! Fill AERO States with carbon fields +! ------------------------------------ + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO' , aero , __RC__) + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO_ACI', aero_aci, __RC__) + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO_DP' , Bundle_DP, __RC__) + + call ESMF_StateGet (internal, 'CAphobic', field, __RC__) + call ESMF_AttributeSet (field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(1), __RC__) + fld = MAPL_FieldCreate (field, 'CAphobic', __RC__) + call MAPL_StateAdd (aero, fld, __RC__) + call MAPL_StateAdd (aero_aci, fld, __RC__) + + self%klid = 1 ! temporary value +! Set internal CAphobic values to 0 where above klid + call MAPL_GetPointer (internal, int_ptr, 'CAphobic', __RC__) + call setZeroKlid(self%km, self%klid, int_ptr) + + call ESMF_StateGet (internal, 'CAphilic', field, __RC__) + call ESMF_AttributeSet (field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(2), __RC__) + fld = MAPL_FieldCreate (field, 'CAphilic', __RC__) + call MAPL_StateAdd (aero, fld, __RC__) + call MAPL_StateAdd (aero_aci, fld, __RC__) + + if (.not. data_driven) then +! Set klid + call MAPL_GetPointer(import, ple, 'PLE', __RC__) + call findKlid (self%klid, self%plid, ple, __RC__) +! Set internal CAphilic values to 0 where above klid + call MAPL_GetPointer (internal, int_ptr, 'CAphilic', __RC__) + call setZeroKlid(self%km, self%klid, int_ptr) + end if + + if (data_driven) then + instance = instanceData + + do i = 1, self%nbins + write (bin_index, '(A, I0.3)') '', i +! Dry deposition + call append_to_bundle(trim(GCsuffix)//'DP'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition (Convective scavenging) + call append_to_bundle(trim(GCsuffix)//'SV'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition + call append_to_bundle(trim(GCsuffix)//'WT'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + +! Gravitational Settling + call append_to_bundle(trim(GCsuffix)//'SD'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + end do + else + instance = instanceComputational + +! Dry deposition + call append_to_bundle('CADP'//trim(comp_name), providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition (Convective scavenging) + call append_to_bundle('CASV'//trim(comp_name), providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition + call append_to_bundle('CAWT'//trim(comp_name), providerState, prefix, Bundle_DP, __RC__) + +! Gravitational Settling + call append_to_bundle('CASD'//trim(comp_name), providerState, prefix, Bundle_DP, __RC__) + end if + + self%instance = instance + +! Create Radiation Mie Table +! -------------------------- + call MAPL_GetResource (MAPL, NUM_BANDS, 'NUM_BANDS:', __RC__) + +! Get file names for the optical tables + call ESMF_ConfigGetAttribute (cfg, self%rad_MieTable(instance)%optics_file, & + label="aerosol_radBands_optics_file:", __RC__ ) + + allocate (self%rad_MieTable(instance)%channels(NUM_BANDS), __STAT__ ) + + call ESMF_ConfigGetAttribute (cfg, self%rad_MieTable(instance)%channels, label= "BANDS:", & + count=self%rad_MieTable(instance)%nch, rc=status) + + if (rc /= 0) then + do i = 1, NUM_BANDS + self%rad_MieTable(instance)%channels(i) = i + end do + end if + + allocate (self%rad_MieTable(instance)%mie_aerosol, __STAT__) + self%rad_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%rad_MieTable(instance)%optics_file, rc) + call Chem_MieTableRead (self%rad_MieTable(instance)%mie_aerosol, NUM_BANDS, self%rad_MieTable(instance)%channels, rc) + +! Create Diagnostics Mie Table +! ----------------------------- +! Get file names for the optical tables + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%optics_file, & + label="aerosol_monochromatic_optics_file:", __RC__ ) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%nch, label="n_channels:", __RC__) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%nmom, label="n_moments:", default=0, __RC__) + allocate (self%diag_MieTable(instance)%channels(self%diag_MieTable(instance)%nch), __STAT__ ) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%channels, & + label= "aerosol_monochromatic_optics_wavelength:", __RC__) + + allocate (self%diag_MieTable(instance)%mie_aerosol, __STAT__) + self%diag_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%diag_MieTable(instance)%optics_file, __RC__ ) + call Chem_MieTableRead (self%diag_MieTable(instance)%mie_aerosol, self%diag_MieTable(instance)%nch, & + self%diag_MieTable(instance)%channels, rc, nmom=self%diag_MieTable(instance)%nmom) + +! Finish creating AERO state +! -------------------------- + ! Mie Table instance/index + call ESMF_AttributeSet(aero, name='mie_table_instance', value=instance, __RC__) + + ! Add variables to CA instance's aero state. This is used in aerosol optics calculations + call add_aero (aero, label='air_pressure_for_aerosol_optics', label2='PLE', grid=grid, typekind=MAPL_R4, __RC__) + call add_aero (aero, label='relative_humidity_for_aerosol_optics', label2='RH', grid=grid, typekind=MAPL_R4,__RC__) +! call ESMF_StateGet (import, 'PLE', field, __RC__) +! call MAPL_StateAdd (aero, field, __RC__) +! call ESMF_StateGet (import, 'RH2', field, __RC__) +! call MAPL_StateAdd (aero, field, __RC__) + + call add_aero (aero, label='extinction_in_air_due_to_ambient_aerosol', label2='EXT', grid=grid, typekind=MAPL_R8,__RC__) + call add_aero (aero, label='single_scattering_albedo_of_ambient_aerosol', label2='SSA', grid=grid, typekind=MAPL_R8,__RC__) + call add_aero (aero, label='asymmetry_parameter_of_ambient_aerosol', label2='ASY', grid=grid, typekind=MAPL_R8,__RC__) + + call ESMF_AttributeSet(aero, name='band_for_aerosol_optics', value=0, __RC__) + + mieTable_pointer = transfer(c_loc(self), [1]) + call ESMF_AttributeSet(aero, name='mieTable_pointer', valueList=mieTable_pointer, itemCount=size(mieTable_pointer), __RC__) + + allocate(aerosol_names(self%nbins), __STAT__) + aerosol_names(1) = 'CAphobic' + aerosol_names(2) = 'CAphilic' + call ESMF_AttributeSet(aero, name='internal_varaible_name', valueList=aerosol_names, & + itemCount=size(aerosol_names), __RC__) + + call ESMF_MethodAdd(AERO, label='aerosol_optics', userRoutine=aerosol_optics, __RC__) + + RETURN_(ESMF_SUCCESS) + + end subroutine Initialize + +!============================================================================ + +!BOP +! !IROUTINE: Run + +! !INTERFACE: + subroutine Run (GC, import, export, clock, rc) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: rc ! Error code: + +! !DESCRIPTION: Run method for the Sea Salt Grid Component. Determines whether to run +! data or computational run method. + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_State) :: internal + + logical :: data_driven + + __Iam__('Run') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'// Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=internal, __RC__) + +! Is SS data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Update INTERNAL state variables with ExtData +! --------------------------------------------- + if (data_driven) then + call Run_data (GC, import, export, internal, __RC__) + else + call Run1 (GC, import, export, clock, __RC__) + end if + + RETURN_(ESMF_SUCCESS) + + end subroutine Run + + +!============================================================================ +!BOP +! !IROUTINE: Run1 + +! !INTERFACE: + subroutine Run1 (GC, import, export, clock, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Computes emissions/sources for Sea Salt + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: mapl + type (ESMF_State) :: internal + type (ESMF_Grid) :: grid + type (wrap_) :: wrap + type (CA2G_GridComp), pointer :: self + type(ESMF_Time) :: time + + character(len=3) :: cdow + integer :: idow + integer :: nymd, nhms, iyr, imm, idd, ihr, imn, isc + real, pointer, dimension(:,:) :: lats + real, pointer, dimension(:,:) :: lons + real, dimension(:,:), allocatable :: biomass_src, terpene_src, biofuel_src, & + eocant1_src, eocant2_src, oc_ship_src, aviation_lto_src, aviation_cds_src, & + aviation_crs_src, biomass_src_ + real, dimension(:,:,:), allocatable :: emissions_point + integer, pointer, dimension(:) :: iPoint, jPoint + character (len=ESMF_MAXSTR) :: fname ! file name for point source emissions + character(len=2) :: GCsuffix + +#include "CA2G_DeclarePointer___.h" + + __Iam__('Run1') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'// Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, mapl, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (mapl, INTERNAL_ESMF_STATE=internal, & + LONS = LONS, & + LATS = LATS, __RC__ ) + +#include "CA2G_GetPointer___.h" + + if (comp_name(1:5) == 'CA.oc') then + GCsuffix = 'OC' + else if (comp_name(1:5) == 'CA.bc') then + GCsuffix = 'BC' + else if (comp_name(1:5) == 'CA.br') then + GCsuffix = 'BR' + end if + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'CA2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + + allocate(emissions_point, mold=delp, __STAT__) + emissions_point = 0.0 + +! Extract nymd(yyyymmdd) from clock +! --------------------------------- + call ESMF_ClockGet (clock, currTime=time, __RC__) + call ESMF_TimeGet (time ,YY=iyr, MM=imm, DD=idd, H=ihr, M=imn, S=isc, __RC__) + call MAPL_PackTime (nymd, iyr, imm , idd) + call MAPL_PackTime (nhms, ihr, imn, isc) + +! Reset tracer to zero at 0Z on specific day of week +! -------------------------------------------------- + idow = Chem_UtilIdow(nymd) + if ( (nhms==0) .and. (idow == self%myDOW) ) then + cdow = Chem_UtilCdow(nymd) + CAphobic = tiny(1.) ! avoid division by zero + CAphilic = tiny(1.) ! avoid division by zero + if ( MAPL_AM_I_ROOT() ) then + print *, '<> CA '//cdow//' tracer being set to zero on ', nymd, nhms + end if + end if + +! Implicit allocation with Fortran 2003 + if (trim(comp_name) == 'CA.oc') then + biomass_src = OC_BIOMASS + terpene_src = OC_TERPENE + biofuel_src = OC_BIOFUEL + eocant1_src = OC_ANTEOC1 + eocant2_src = OC_ANTEOC2 + oc_ship_src = OC_SHIP + aviation_lto_src = OC_AVIATION_LTO + aviation_cds_src = OC_AVIATION_CDS + aviation_crs_src = OC_AVIATION_CRS + else if (trim(comp_name) == 'CA.bc') then + biomass_src = BC_BIOMASS + biofuel_src = BC_BIOFUEL + eocant1_src = BC_ANTEBC1 + eocant2_src = BC_ANTEBC2 + oc_ship_src = BC_SHIP + aviation_lto_src = BC_AVIATION_LTO + aviation_cds_src = BC_AVIATION_CDS + aviation_crs_src = BC_AVIATION_CRS + allocate(terpene_src, mold=BC_BIOMASS, __STAT__) + terpene_src = 1.0 + else if (trim(comp_name) == 'CA.br') then + biomass_src = BRC_BIOMASS + terpene_src = BRC_TERPENE + biofuel_src = BRC_BIOFUEL + eocant1_src = BRC_ANTEBRC1 + eocant2_src = BRC_ANTEBRC2 + oc_ship_src = BRC_SHIP + aviation_lto_src = BRC_AVIATION_LTO + aviation_cds_src = BRC_AVIATION_CDS + aviation_crs_src = BRC_AVIATION_CRS + end if + +! As a safety check, where value is undefined set to 0 + where(1.01*biomass_src > undefval) biomass_src = 0. + where(1.01*terpene_src > undefval) terpene_src = 0. + where(1.01*biofuel_src > undefval) biofuel_src = 0. + where(1.01*eocant1_src > undefval) eocant1_src = 0. + where(1.01*eocant2_src > undefval) eocant2_src = 0. + where(1.01*oc_ship_src > undefval) oc_ship_src = 0. + where(1.01*aviation_lto_src > undefval) aviation_lto_src = 0. + where(1.01*aviation_cds_src > undefval) aviation_cds_src = 0. + where(1.01*aviation_crs_src > undefval) aviation_crs_src = 0. + +! Save this in case we need to apply diurnal cycle +! ------------------------------------------------ + if ( self%diurnal_bb ) then + biomass_src_ = biomass_src + end if + +! Apply diurnal cycle if so desired +! --------------------------------- + if ( self%diurnal_bb ) then + call Chem_BiomassDiurnal (biomass_src, biomass_src_, & + lons(:,:)*real(MAPL_RADIANS_TO_DEGREES), & + lats(:,:)*real(MAPL_RADIANS_TO_DEGREES), & + nhms, self%cdt) + end if + + call CAEmission (self%diag_MieTable(self%instance), self%km, self%nbins, self%cdt, chemgrav, GCsuffix, self%ratPOM, & + self%fTerpene, aviation_lto_src, aviation_cds_src, aviation_crs_src, self%fHydrophobic, & + zpbl, t, airdens, rh2, CAphilic, CAphobic, delp, self%aviation_layers, biomass_src, & + terpene_src, eocant1_src, eocant2_src, oc_ship_src, biofuel_src, & + CAEM, CAEMAN, CAEMBB, CAEMBF, CAEMBG, __RC__ ) + +! Read any pointwise emissions, if requested +! ------------------------------------------ + if(self%doing_point_emissions) then + call StrTemplate (fname, self%point_emissions_srcfilen, xid='unknown', & + nymd=nymd, nhms=120000 ) + call ReadPointEmissions (nymd, fname, self%nPts, self%pLat, self%pLon, & + self%pBase, self%pTop, self%pEmis, self%pStart, & + self%pEnd, label='source') + endif + +! Get indices for point emissions +! ------------------------------- + if (self%nPts > 0) then + allocate(iPoint(self%nPts), jPoint(self%nPts), __STAT__) + call MAPL_GetHorzIJIndex(self%nPts, iPoint, jPoint, & + grid = grid, & + lon = self%pLon/real(MAPL_RADIANS_TO_DEGREES), & + lat = self%pLat/real(MAPL_RADIANS_TO_DEGREES), & + rc = status) + if ( status /= 0 ) then + if (mapl_am_i_root()) print*, trim(Iam), ' - cannot get indices for point emissions' + VERIFY_(status) + end if + + call updatePointwiseEmissions (self%km, self%pBase, self%pTop, self%pEmis, self%nPts, & + self%pStart, self%pEnd, zle, & + area, iPoint, jPoint, nhms, emissions_point, __RC__) + + CAphobic = CAphobic + self%fHydrophobic * self%cdt * chemgrav / delp * emissions_point + CAphilic = CAphilic + (1-self%fHydrophobic) * self%cdt * chemgrav / delp * emissions_point + end if + + RETURN_(ESMF_SUCCESS) + + end subroutine Run1 + +!============================================================================ +!BOP +! !IROUTINE: Run2 + +! !INTERFACE: + + subroutine Run2 (GC, import, export, clock, RC) + + ! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Run2 method for the CA Grid Component. + +!EOP +!============================================================================ +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_State) :: internal + type (wrap_) :: wrap + type (CA2G_GridComp), pointer :: self + type(MAPL_VarSpec), pointer :: InternalSpec(:) + + integer :: n + real, allocatable, dimension(:,:) :: drydepositionfrequency, dqa + real :: fwet + logical :: KIN + real, allocatable, dimension(:,:,:) :: pSOA_VOC + real, pointer, dimension(:,:,:) :: int_ptr + real, allocatable, dimension(:,:,:,:) :: int_arr + character(len=2) :: GCsuffix + character(len=ESMF_MAXSTR) :: short_name + + real, parameter :: cpd = 1004.16 + +#include "CA2G_DeclarePointer___.h" + + __Iam__('Run2') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' // Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=internal, & + INTERNALSPEC = InternalSpec, __RC__) + +#include "CA2G_GetPointer___.h" + + if (comp_name(1:5) == 'CA.oc') then + GCsuffix = 'OC' + else if (comp_name(1:5) == 'CA.bc') then + GCsuffix = 'BC' + else if (comp_name(1:5) == 'CA.br') then + GCsuffix = 'BR' + end if + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'CA2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Add on SOA from Anthropogenic VOC oxidation +! ------------------------------------------- + if (trim(comp_name) == 'CA.oc') then + pSOA_VOC = pSOA_ANTHRO_VOC + where (1.01 * pSOA_VOC > undefval) pSOA_VOC = 0.0 + + CAphilic = CAphilic + self%cdt * pSOA_VOC/airdens + if (associated(CAPSOA)) & + CAPSOA = CAPSOA+sum(self%cdt*pSOA_VOC*delp/airdens/chemgrav, 3) + end if + + if (trim(comp_name) == 'CA.br') then + pSOA_VOC = pSOA_BIOB_VOC + where (1.01 * pSOA_VOC > undefval) pSOA_VOC = 0.0 + + CAphilic = CAphilic + self%cdt * pSOA_VOC/airdens + if (associated(CAPSOA)) & + CAPSOA = sum(self%cdt*pSOA_VOC*delp/airdens/chemgrav, 3) + end if + + +! Ad Hoc transfer of hydrophobic to hydrophilic aerosols +! Following Chin's parameterization, the rate constant is +! k = 4.63e-6 s-1 (.4 day-1; e-folding time = 2.5 days) + call phobicTophilic (CAphobic, CAphilic, CAHYPHIL, self%km, self%cdt, chemgrav, delp, __RC__) + +! CA Settling +! ----------- + do n = 1, self%nbins + call MAPL_VarSpecGet(InternalSpec(n), SHORT_NAME=short_name, __RC__) + call MAPL_GetPointer(internal, NAME=short_name, ptr=int_ptr, __RC__) + + call Chem_Settling2Gorig (self%km, self%klid, self%rhFlag, n, int_ptr, CHEMgrav, delp, & + self%radius(n)*1.e-6, self%rhop(n), self%cdt, t, airdens, & + rh2, zle, CASD, __RC__) + end do + +! CA Deposition +! ----------- + allocate(dqa, mold=lwi, __STAT__) + allocate(drydepositionfrequency, mold=lwi, __STAT__) + + drydepositionfrequency = 0. + call DryDeposition(self%km, t, airdens, zle, lwi, ustar, zpbl, sh,& + MAPL_KARMAN, cpd, chemGRAV, z0h, drydepositionfrequency, __RC__ ) + + do n = 1, self%nbins + call MAPL_VarSpecGet(InternalSpec(n), SHORT_NAME=short_name, __RC__) + call MAPL_GetPointer(internal, NAME=short_name, ptr=int_ptr, __RC__) + dqa = 0. + dqa = max(0.0, int_ptr(:,:,self%km)*(1.-exp(-drydepositionfrequency*self%cdt))) + int_ptr(:,:,self%km) = int_ptr(:,:,self%km) - dqa + if (associated(CADP)) then + CADP(:,:,n) = dqa * delp(:,:,self%km) / chemGRAV / self%cdt + end if + end do + +! Large-scale Wet Removal +! ------------------------------- +! Hydrophobic mode (first tracer) is not removed + if (associated(CAWT)) CAWT(:,:,1)=0.0 + KIN = .true. +! Hydrophilic mode (second tracer) is removed + fwet = 1. + call WetRemovalGOCART2G (self%km, self%klid, self%nbins, self%nbins, 2, self%cdt, GCsuffix, & + KIN, chemGRAV, fwet, CAphilic, ple, t, airdens, & + pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, CAWT, rc) + +! Compute diagnostics +! ------------------- + allocate(int_arr((ubound(CAphobic,1)), (ubound(CAphobic,2)), self%km, self%nbins), __STAT__) + int_arr(:,:,:,1) = CAphobic + int_arr(:,:,:,2) = CAphilic + + call Aero_Compute_Diags (mie_table=self%diag_MieTable(self%instance), km=self%km, klid=self%klid, nbegin=1, nbins=2, & + channels=self%diag_MieTable(self%instance)%channels, aerosol=int_arr, grav=chemgrav, & + tmpu=t, rhoa=airdens, rh=rh2, u=u, v=v, delp=delp, sfcmass=CASMASS, colmass=CACMASS, & + mass=CAMASS, exttau=CAEXTTAU, scatau=CASCATAU, fluxu=CAFLUXU, fluxv=CAFLUXV, & + conc=CACONC, extcoef=CAEXTCOEF, scacoef=CASCACOEF, angstrom=CAANGSTR, aerindx=CAAERIDX,& + __RC__) + +if (trim(comp_name) == 'CA.oc') then + if(mapl_am_i_root()) print*,'CA2G Run2 E sum(OCphobic) = ',sum(CAphobic) + if(mapl_am_i_root()) print*,'CA2G Run2 E sum(OCphilic) = ',sum(CAphilic) +! if(mapl_am_i_root()) print*,'CA2G Run2 E array OCphobic = ',CAphobic +! if(mapl_am_i_root()) print*,'CA2G Run2 E array OCphilic = ',CAphilic +!if(mapl_am_i_root()) print*,'CA2G OC CASMASS = ',sum(CASMASS) +!if(mapl_am_i_root()) print*,'CA2G OC CAMASS = ',sum(CAMASS) +!if(mapl_am_i_root()) print*,'CA2G OC CAEXTTAU = ',sum(CAEXTTAU) +!if(mapl_am_i_root()) print*,'CA2G OC CASCATAU = ',sum(CASCATAU) +else if (trim(comp_name) == 'CA.bc') then + if(mapl_am_i_root()) print*,'CA2G Run2 E sum(BCphobic) = ',sum(CAphobic) + if(mapl_am_i_root()) print*,'CA2G Run2 E sum(BCphilic) = ',sum(CAphilic) +! if(mapl_am_i_root()) print*,'CA2G Run2 E array BCphobic = ',CAphobic +! if(mapl_am_i_root()) print*,'CA2G Run2 E array BCphilic = ',CAphilic +!if(mapl_am_i_root()) print*,'CA2G BC CASMASS = ',sum(CASMASS) +!if(mapl_am_i_root()) print*,'CA2G BC CAMASS = ',sum(CAMASS) +!if(mapl_am_i_root()) print*,'CA2G BC CAEXTTAU = ',sum(CAEXTTAU) +!if(mapl_am_i_root()) print*,'CA2G BC CASCATAU = ',sum(CASCATAU) +else if (trim(comp_name) == 'CA.br') then + if(mapl_am_i_root()) print*,'CA2G Run2 E sum(BRphobic) = ',sum(CAphobic) + if(mapl_am_i_root()) print*,'CA2G Run2 E sum(BRphilic) = ',sum(CAphilic) +end if + + + RETURN_(ESMF_SUCCESS) + + end subroutine Run2 + +!============================================================================ +!BOP +! !IROUTINE: Run_data -- ExtData Sea Salt Grid Component + +! !INTERFACE: + + subroutine Run_data (GC, IMPORT, EXPORT, INTERNAL, RC) + + ! !ARGUMENTS: + + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: IMPORT ! Import state + type (ESMF_State), intent(inout) :: EXPORT ! Export state + type (ESMF_State), intent(inout) :: INTERNAL ! Interal state + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. + +!EOP +!============================================================================ +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (wrap_) :: wrap + type (CA2G_GridComp), pointer :: self + + character (len=ESMF_MAXSTR) :: GCsuffix + + real, pointer, dimension(:,:,:) :: ptr3d_int_phobic, ptr3d_int_philic + real, pointer, dimension(:,:,:) :: ptr3d_imp + + __Iam__('Run_data') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'//Iam + + if (comp_name(1:5) == 'CA.oc') then + GCsuffix = 'OC' + else if (comp_name(1:5) == 'CA.bc') then + GCsuffix = 'BC' + else if (comp_name(1:5) == 'CA.br') then + GCsuffix = 'BR' + end if + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'CA2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Update interal data pointers with ExtData +! ----------------------------------------- + call MAPL_GetPointer (internal, NAME='CAphobic', ptr=ptr3d_int_phobic, __RC__) + call MAPL_GetPointer (internal, NAME='CAphilic', ptr=ptr3d_int_philic, __RC__) + + call MAPL_GetPointer (import, NAME='clim'//trim(GCsuffix)//'phobic', ptr=ptr3d_imp, __RC__) + ptr3d_int_phobic = ptr3d_imp + + call MAPL_GetPointer (import, NAME='clim'//trim(GCsuffix)//'philic', ptr=ptr3d_imp, __RC__) + ptr3d_int_philic = ptr3d_imp + + RETURN_(ESMF_SUCCESS) + + end subroutine Run_data + +!------------------------------------------------------------------------------------- + subroutine aerosol_optics(state, rc) + + implicit none + +! !ARGUMENTS: + type (ESMF_State) :: state + integer, intent(out) :: rc + +! !Local + integer, parameter :: DP=kind(1.0d0) + real, dimension(:,:,:), pointer :: ple, rh + real(kind=DP), dimension(:,:,:), pointer :: var + real, dimension(:,:,:), pointer :: q + real, dimension(:,:,:,:), pointer :: q_4d + integer, allocatable :: opaque_self(:) + type(C_PTR) :: address + type(CA2G_GridComp), pointer :: self + + character (len=ESMF_MAXSTR) :: fld_name + type(ESMF_Field) :: fld + character (len=ESMF_MAXSTR),allocatable :: aerosol_names(:) + + real(kind=DP), dimension(:,:,:), allocatable :: ext_s, ssa_s, asy_s ! (lon:,lat:,lev:) + real :: x + integer :: instance + integer :: n, nbins + integer :: i1, j1, i2, j2, km + integer :: band, offset + integer, parameter :: n_bands = 1 + + integer :: i, j, k + + __Iam__('CA2G::aerosol_optics') + +! Begin... + +! Mie Table instance/index +! ------------------------ + call ESMF_AttributeGet(state, name='mie_table_instance', value=instance, __RC__) + +! Get aerosol names +! ----------------- + call ESMF_AttributeGet (state, name='internal_varaible_name', itemCount=nbins, __RC__) + allocate (aerosol_names(nbins), __STAT__) + call ESMF_AttributeGet (state, name='internal_varaible_name', valueList=aerosol_names, __RC__) + +! Radiation band +! -------------- + band = 0 + call ESMF_AttributeGet(state, name='band_for_aerosol_optics', value=band, __RC__) + offset = band - n_bands + +! Pressure at layer edges +! ------------------------ + call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, ple, trim(fld_name), __RC__) + +! call MAPL_GetPointer (state, ple, 'PLE', __RC__) + + i1 = lbound(ple, 1); i2 = ubound(ple, 1) + j1 = lbound(ple, 2); j2 = ubound(ple, 2) + km = ubound(ple, 3) + +! Relative humidity +! ----------------- + call ESMF_AttributeGet(state, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, rh, trim(fld_name), __RC__) + +! call MAPL_GetPointer (state, rh, 'RH2', __RC__) + + allocate(ext_s(i1:i2, j1:j2, km), & + ssa_s(i1:i2, j1:j2, km), & + asy_s(i1:i2, j1:j2, km), __STAT__) + + allocate(q_4d(i1:i2, j1:j2, km, nbins), __STAT__) + + do n = 1, nbins + call ESMF_StateGet (state, trim(aerosol_names(n)), field=fld, __RC__) + call ESMF_FieldGet (fld, farrayPtr=q, __RC__) + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + x = ((ple(i,j,k) - ple(i,j,k-1))*0.01)*(100./MAPL_GRAV) + q_4d(i,j,k,n) = x * q(i,j,k) + end do + end do + end do + end do + + call ESMF_AttributeGet(state, name='mieTable_pointer', itemCount=n, __RC__) + allocate (opaque_self(n), __STAT__) + call ESMF_AttributeGet(state, name='mieTable_pointer', valueList=opaque_self, __RC__) + + address = transfer(opaque_self, address) + call c_f_pointer(address, self) + + call mie_ (self%rad_MieTable(instance), nbins, n_bands, offset, q_4d, rh, ext_s, ssa_s, asy_s, __RC__) + + call ESMF_AttributeGet(state, name='extinction_in_air_due_to_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ext_s(:,:,:) + end if + + call ESMF_AttributeGet(state, name='single_scattering_albedo_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ssa_s(:,:,:) + end if + + call ESMF_AttributeGet(state, name='asymmetry_parameter_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = asy_s(:,:,:) + end if + + deallocate(ext_s, ssa_s, asy_s, __STAT__) + deallocate(q_4d, __STAT__) + + RETURN_(ESMF_SUCCESS) + + contains + + subroutine mie_(mie_table, nbins, nb, offset, q, rh, bext_s, bssa_s, basym_s, rc) + + implicit none + + type(Chem_Mie), intent(inout) :: mie_table ! mie table + integer, intent(in ) :: nbins ! number of bins + integer, intent(in ) :: nb ! number of bands + integer, intent(in ) :: offset ! bands offset + real, intent(in ) :: q(:,:,:,:) ! aerosol mass mixing ratio, kg kg-1 + real, intent(in ) :: rh(:,:,:) ! relative humidity + real(kind=8), intent( out) :: bext_s (size(ext_s,1),size(ext_s,2),size(ext_s,3)) + real(kind=8), intent( out) :: bssa_s (size(ext_s,1),size(ext_s,2),size(ext_s,3)) + real(kind=8), intent( out) :: basym_s(size(ext_s,1),size(ext_s,2),size(ext_s,3)) + integer, intent(out) :: rc + ! local + integer :: l + real :: bext (size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! extinction + real :: bssa (size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! SSA + real :: gasym(size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! asymmetry parameter + + __Iam__('CA2G::aerosol_optics::mie_') + + bext_s = 0.0d0 + bssa_s = 0.0d0 + basym_s = 0.0d0 + + do l = 1, nbins + call Chem_MieQuery(mie_table, l, real(offset+1.), q(:,:,:,l), rh, bext, gasym=gasym, ssa=bssa) + + bext_s = bext_s + bext ! extinction + bssa_s = bssa_s + (bssa*bext) ! scattering extinction + basym_s = basym_s + gasym*(bssa*bext) ! asymetry parameter multiplied by scatering extiction + + end do + + RETURN_(ESMF_SUCCESS) + + end subroutine mie_ + + end subroutine aerosol_optics + +end module CA2G_GridCompMod + + diff --git a/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_CA.bc.rc b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_CA.bc.rc new file mode 100644 index 00000000..2fa230c3 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_CA.bc.rc @@ -0,0 +1,41 @@ +# +# Resource file for Black Carbon parameters. +# + +nbins: 2 + +aerosol_radBands_optics_file: ExtData/MERRA2/x/opticsBands_BC.v1_3.RRTMG.nc + +aerosol_monochromatic_optics_file: ExtData/AeroCom/x/optics_BC.v1_3.nc +aerosol_monochromatic_optics_wavelength: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 ! units: nm +n_channels: 4 + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_microns: 0.35 0.35 + +rhFlag: 0 +particle_density: 1800 1800 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + +pressure_lid_in_hPa: 0.01 + diff --git a/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_CA.br.rc b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_CA.br.rc new file mode 100644 index 00000000..a25983d5 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_CA.br.rc @@ -0,0 +1,51 @@ +# +# Resource file for BR parameters. +# + + +aerosol_radBands_optics_file: ExtData/MERRA2/x/opticsBands_BRC.v1_5.RRTMG.nc + +aerosol_monochromatic_optics_file: ExtData/AeroCom/x/optics_BRC.v1_5.nc +aerosol_monochromatic_optics_wavelength: 470 550 670 870 ! units: nm +n_channels: 4 +r_channels: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# particle radius +particle_radius_microns: 0.35 0.35 + +radius_lower: 0 0 +radius_upper: 0 0 +soil_density: 1800 1800 +rhFlag: 0 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + +nbins: 2 diff --git a/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_CA.oc.rc b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_CA.oc.rc new file mode 100755 index 00000000..100a6c6c --- /dev/null +++ b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_CA.oc.rc @@ -0,0 +1,49 @@ +# +# Resource file for Organic Carbon parameters. +# + +aerosol_radBands_optics_file: ExtData/MERRA2/x/opticsBands_OC.v1_3.RRTMG.nc + +aerosol_monochromatic_optics_file: ExtData/AeroCom/x/optics_OC.v1_3.nc +aerosol_monochromatic_optics_wavelength: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 ! units: nm +n_channels: 4 + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# particle radius +particle_radius_microns: 0.35 0.35 + +particle_density: 1800 1800 + +rhFlag: 0 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + +pressure_lid_in_hPa: 0.01 + +#point_emissions_srcfilen: /gpfsm/dnb32/esherman/gocartRefactor/RC/CA2G_point_src_test.rc + +nbins: 2 diff --git a/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_ExtData.rc b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_ExtData.rc new file mode 100644 index 00000000..9bf8c9e6 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridComp_ExtData.rc @@ -0,0 +1,110 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +#========== Data Instance ========================================================== + +climBCphobic 'kg kg-1' Y N 0 0.0 1.0 BCphobic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climBCphilic 'kg kg-1' Y N 0 0.0 1.0 BCphilic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climOCphobic 'kg kg-1' Y N 0 0.0 1.0 OCphobic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climOCphilic 'kg kg-1' Y N 0 0.0 1.0 OCphilic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 + +climBCDP001 'kg m-2 s-1' Y N 0 0.0 1.0 BCDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCWT001 'kg m-2 s-1' Y N 0 0.0 1.0 BCWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCSD001 'kg m-2 s-1' Y N 0 0.0 1.0 BCSD001 /dev/null +climBCSV001 'kg m-2 s-1' Y N 0 0.0 1.0 BCSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climBCDP002 'kg m-2 s-1' Y N 0 0.0 1.0 BCDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCWT002 'kg m-2 s-1' Y N 0 0.0 1.0 BCWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCSD002 'kg m-2 s-1' Y N 0 0.0 1.0 BCSD002 /dev/null +climBCSV002 'kg m-2 s-1' Y N 0 0.0 1.0 BCSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climOCDP001 'kg m-2 s-1' Y N 0 0.0 1.0 OCDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCWT001 'kg m-2 s-1' Y N 0 0.0 1.0 OCWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCSD001 'kg m-2 s-1' Y N 0 0.0 1.0 OCSD001 /dev/null +climOCSV001 'kg m-2 s-1' Y N 0 0.0 1.0 OCSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climOCDP002 'kg m-2 s-1' Y N 0 0.0 1.0 OCDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCWT002 'kg m-2 s-1' Y N 0 0.0 1.0 OCWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCSD002 'kg m-2 s-1' Y N 0 0.0 1.0 OCSD002 /dev/null +climOCSV002 'kg m-2 s-1' Y N 0 0.0 1.0 OCSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + + +#=========== Carbonaceous aerosol sources =========================================== +# ORGANIC CARBON +# --------------- +# Biomass burning -- QFED-v2.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_oc.006.%y4%m2%d2.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/PIESA/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.surface.x3600_y1800_t12.2010.nc4 +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.elevated.x3600_y1800_t12.2010.nc4 + +# EDGAR based ship emissions +OC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.ships.x3600_y1800_t12.2010.nc4 + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.aviation_lto.x3600_y1800_t12.2010.nc4 +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.aviation_cds.x3600_y1800_t12.2010.nc4 +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.aviation_crs.x3600_y1800_t12.2010.nc4 + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +#============================================================================================================ +# BLACK CARBON +# ------------ +# QFED v2.x +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_bc.006.%y4%m2%d2.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.surface.x3600_y1800_t12.2010.nc4 +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.elevated.x3600_y1800_t12.2010.nc4 + +# EDGAR based ship emissions +BC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.ships.x3600_y1800_t12.2010.nc4 + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none bc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.aviation_lto.x3600_y1800_t12.2010.nc4 +BC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none bc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.aviation_cds.x3600_y1800_t12.2010.nc4 +BC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none bc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.aviation_crs.x3600_y1800_t12.2010.nc4 + +#============================================================================================================ +# BROWN CARBON +# ------------ +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_oc.006.%y4%m2%d2.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +%% diff --git a/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_StateSpecs.rc b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_StateSpecs.rc new file mode 100644 index 00000000..4fde7f90 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_StateSpecs.rc @@ -0,0 +1,135 @@ +schema_version: 2.0.0 +component: CA + +category: IMPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS| Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC| COND | LONG NAME +#---------------------------------------------------------------------------------------- + FROCEAN | 1 | xy | N | | fraction_of_ocean + FRACI | 1 | xy | N | | ice_covered_fraction_of_tile + LWI | 1 | xy | N | | land-ocean-ice_mask + U10M | m s-1 | xy | N | | 10-meter_eastward_wind + V10M | m s-1 | xy | N | | 10-meter_northward_wind + USTAR | m s-1 | xy | N | | surface_velocity_scale +# TS | K | xy | N | | surface skin temperature +# DZ | m | xy | N | | surface_layer_height + FRLAKE | 1 | xy | N | | fraction_of_lake + AREA | m^2 | xy | N | | agrid_cell_area + ZPBL | m | xy | N | | planetary_boundary_layer_height + SH | w m-2 | xy | N | | sensible_heat_flux_from_turbulence + Z0H | m | xy | N | | surface_roughness_for_heat + CN_PRCP |kg/m^2/s| xy | N | | surface_conv._rain_flux_needed_by_land + NCN_PRCP |kg/m^2/s| xy | N | | Non-convective precipitation +#........................................................................................ + AIRDENS | kg/m^3 | xyz | C | | moist_air_density + DELP | Pa | xyz | C | | pressure_thickness + T | K | xyz | C | | air_temperature + RH2 | 1 | xyz | C | | Rel_Hum_after_moist + ZLE | m | xyz | E | | geopotential_height + PLE | Pa | xyz | E | | air_pressure + PFL_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_liquid_nonconvective_precipitation + PFI_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_ice_nonconvective_precipitation + U | m s-1 | xyz | C | | eastward_wind + V | m s-1 | xyz | C | | northward_wind + pSOA_ANTHRO_VOC | kg m-3 s-1 | xyz | C | | SOA from Anthropogenic and biomass burning VOC + pSOA_BIOB_VOC | kg m-3 s-1 | xyz | C | | SOA from Anthropogenic and biomass burning VOC +#........................................................................................ + OC_BIOMASS | 1 | xy | N | | source species + OC_TERPENE | 1 | xy | N | | source species + OC_BIOFUEL | 1 | xy | N | | source species + OC_ANTEOC1 | 1 | xy | N | | source species + OC_ANTEOC2 | 1 | xy | N | | source species + OC_SHIP | 1 | xy | N | | source species + OC_AVIATION_LTO | 1 | xy | N | | source species + OC_AVIATION_CDS | 1 | xy | N | | source species + OC_AVIATION_CRS | 1 | xy | N | | source species + BC_BIOMASS | 1 | xy | N | | source species + BC_BIOFUEL | 1 | xy | N | | source species + BC_ANTEBC1 | 1 | xy | N | | source species + BC_ANTEBC2 | 1 | xy | N | | source species + BC_SHIP | 1 | xy | N | | source species + BC_AVIATION_LTO | 1 | xy | N | | source species + BC_AVIATION_CDS | 1 | xy | N | | source species + BC_AVIATION_CRS | 1 | xy | N | | source species + BRC_BIOMASS | 1 | xy | N | | source species + BRC_TERPENE | 1 | xy | N | | source species + BRC_BIOFUEL | 1 | xy | N | | source species + BRC_ANTEBRC1 | 1 | xy | N | | source species + BRC_ANTEBRC2 | 1 | xy | N | | source species + BRC_SHIP | 1 | xy | N | | source species + BRC_AVIATION_LTO | 1 | xy | N | | source species + BRC_AVIATION_CDS | 1 | xy | N | | source species + BRC_AVIATION_CRS | 1 | xy | N | | source species + +category: EXPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS| VLOC| UNGRIDDED | LONG_NAME +#---------------------------------------------------------------------------------------- + CAMASS* | kg kg-1 | xyz | C | | Carbonaceous Aerosol Mass Mixing Ratio + CACONC* | kg m-3 | xyz | C | | Carbonaceous Aerosol Mass Concentration + CAEXTCOEF* | m-1 | xyz | C | | Carbonaceous Aerosol Extinction Coefficient [550 nm] + CASCACOEF* | m-1 | xyz | C | | Carbonaceous Aerosol Scattering Coefficient [550 nm] +#...........|............|.....|.....|.......|............................................ + CAEM* | kg m-2 s-1 | xy | N | nbins | Carbonaceous Aerosol Emission All Bins + CASD* | kg m-2 s-1 | xy | N | nbins | Carbonaceous Aerosol Sedimentation All Bins + CADP* | kg m-2 s-1 | xy | N | nbins | Carbonaceous Aerosol Dry Deposition All Bins + CAWT* | kg m-2 s-1 | xy | N | nbins | Carbonaceous Aerosol Wet Deposition All Bins + CASV* | kg m-2 s-1 | xy | N | nbins | Carbonaceous Aerosol Convective Scavenging All Bins + CAEMAN* | kg m-2 s-1 | xy | N | | Carbonaceous Aerosol Anthropogenic Emissions + CAEMBB* | kg m-2 s-1 | xy | N | | Carbonaceous Aerosol Biomass Burning Emissions + CAEMBF* | kg m-2 s-1 | xy | N | | Carbonaceous Aerosol Biofuel Emissions + CAEMBG* | kg m-2 s-1 | xy | N | | Carbonaceous Aerosol Biogenic Emissions + CAHYPHIL* | kg m-2 s-1 | xy | N | | Carbonaceous Aerosol Hydrophobic to Hydrophilic + CAPSOA* | kg m-2 s-1 | xy | N | | Carbonaceous Aerosol SOA Production + CASMASS* | kg m-3 | xy | N | | Carbonaceous Aerosol Surface Mass Concentration + CACMASS* | kg m-2 | xy | N | | Carbonaceous Aerosol Column Mass Density + CAEXTTAU* | 1 | xy | N | | Carbonaceous Aerosol Extinction AOT [550 nm] + CASCATAU* | 1 | xy | N | | Carbonaceous Aerosol Scattering AOT [550 nm] + CAANGSTR* | 1 | xy | N | | Carbonaceous Aerosol Angstrom parameter [470-870 nm] + CAFLUXU* | kg m-1 s-1 | xy | N | | Carbonaceous Aerosol column u-wind mass flux + CAFLUXV* | kg m-1 s-1 | xy | N | | Carbonaceous Aerosol column v-wind mass flux + CAAERIDX* | 1 | xy | N | | Carbonaceous Aerosol TOMS UV Aerosol Index + + + +category: INTERNAL +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSION | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC | RESTART | ADD2EXPORT | FRIENDLYTO | LONG NAME +#---------------------------------------------------------------------------------------- + CAphobic |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Carbonaceous Aerosol Mixing Ratio all bins + CAphilic |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Carbonaceous Aerosol Mixing Ratio all bins + +#******************************************************** +# +# Legend +# +#------------------------------------------------------------------ +# Column label | MAPL keyword/interpretation | Default +#--------------|--------------------------------------------------- +# NAME | short_name | +# UNITS | units | +# DIMS | dims | +# VLOC | VLocation | MAPL_VLocationNone +# LONG NAME | long_name | +# COND | if () then | .FALSE. +# NUM_SUBTILES | num_subtiles +# ... +#------------------------------------------------------------------ +# +#-------------------------------------------- +# Entry alias | Column | MAPL keyword/interpretation +#--------------|----------------------------- +# xyz | DIMS | MAPL_HorzVert +# xy | DIMS | MAPL_HorzOnly +# z | DIMS | MAPL_VertOnly (plus ungridded) +# C | VLOC | MAPL_VlocationCenter +# E | VLOC | MAPL_VlocationEdge +# N | VLOC | MAPL_VlocationNone +#-------------------------------------------- + diff --git a/ESMF/GOCART2G_GridComp/CA2G_GridComp/CMakeLists.txt b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CMakeLists.txt new file mode 100644 index 00000000..89216180 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CMakeLists.txt @@ -0,0 +1,18 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES GA_GridComp Chem_Shared2G GMAO_mpeu Process_Library) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +mapl_acg (${this} CA2G_StateSpecs.rc + IMPORT_SPECS EXPORT_SPECS INTERNAL_SPECS + GET_POINTERS DECLARE_POINTERS) + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() + + diff --git a/ESMF/GOCART2G_GridComp/CMakeLists.txt b/ESMF/GOCART2G_GridComp/CMakeLists.txt new file mode 100644 index 00000000..53135edc --- /dev/null +++ b/ESMF/GOCART2G_GridComp/CMakeLists.txt @@ -0,0 +1,30 @@ +esma_set_this () + +set (alldirs + GA_GridComp + DU2G_GridComp + SS2G_GridComp + CA2G_GridComp + NI2G_GridComp + SU2G_GridComp + ) + +set (srcs + GOCART2G_GridCompMod.F90 + ) + +set (resource_files + GOCART2G_GridComp.rc + ) + +install( FILES ${resource_files} + DESTINATION etc + ) + +set (dependencies MAPL Chem_Shared2G Process_Library) +esma_add_library (${this} + SRCS ${srcs} + SUBCOMPONENTS ${alldirs} + DEPENDENCIES ${dependencies} + INCLUDES ${INC_ESMF}) + diff --git a/ESMF/GOCART2G_GridComp/DU2G_GridComp/CMakeLists.txt b/ESMF/GOCART2G_GridComp/DU2G_GridComp/CMakeLists.txt new file mode 100644 index 00000000..d5af49b4 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/DU2G_GridComp/CMakeLists.txt @@ -0,0 +1,16 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES GA_GridComp MAPL Chem_Shared2G GMAO_mpeu Process_Library) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +mapl_acg (${this} DU2G_StateSpecs.rc + IMPORT_SPECS EXPORT_SPECS INTERNAL_SPECS + GET_POINTERS DECLARE_POINTERS) + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridCompMod.F90 new file mode 100644 index 00000000..6c9d01eb --- /dev/null +++ b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridCompMod.F90 @@ -0,0 +1,1101 @@ +#include "MAPL_Generic.h" + +!============================================================================= +!BOP + +! !MODULE: DU2G_GridCompMod - GOCART refactoring of the DU gridded component + +! !INTERFACE: +module DU2G_GridCompMod + +! !USES: + use ESMF + use MAPL + use Chem_MieTableMod2G + use Chem_AeroGeneric + use iso_c_binding, only: c_loc, c_f_pointer, c_ptr + + use GOCART2G_Process ! GOCART2G process library + use GA_GridCompMod + use m_StrTemplate ! string templates + + implicit none + private + + integer, parameter :: instanceComputational = 1 + integer, parameter :: instanceData = 2 + +! !PUBLIC MEMBER FUNCTIONS: + public SetServices + + +! !DESCRIPTION: This module implements GOCART's Dust (DU) Gridded Component. + +! !REVISION HISTORY: +! 16Oct2019 Sherman, da Silva, Darmenov, Clune - First attempt at refactoring + +!EOP +!=========================================================================== + + integer, parameter :: NHRES = 6 + +! !Dust state + type, extends(GA_GridComp) :: DU2G_GridComp + real, allocatable :: rlow(:) ! particle effective radius lower bound [um] + real, allocatable :: rup(:) ! particle effective radius upper bound [um] + real, allocatable :: sfrac(:) ! fraction of total source + real :: Ch_DU_res(NHRES) ! resolutions used for Ch_DU + real :: Ch_DU ! dust emission tuning coefficient [kg s2 m-5]. + logical :: maringFlag=.false. ! maring settling velocity correction + integer :: day_save = -1 +! !Workspae for point emissions + logical :: doing_point_emissions = .false. + character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions + integer :: nPts = -1 + integer, allocatable, dimension(:) :: pstart, pend + real, allocatable, dimension(:) :: pLat, & + pLon, & + pBase, & + pTop, & + pEmis + end type DU2G_GridComp + + type wrap_ + type (DU2G_GridComp), pointer :: PTR => null() + end type wrap_ + +contains + +!============================================================================ +!BOP + +! !IROUTINE: SetServices + +! !INTERFACE: + subroutine SetServices (GC, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(INOUT) :: GC ! gridded component + integer, intent( OUT) :: RC ! return code + +! !DESCRIPTION: This version uses MAPL_GenericSetServices, which sets +! the Initialize and Finalize services to generic versions. It also +! allocates our instance of a generic state and puts it in the +! gridded component (GC). Here we only set the two-stage run method +! and declare the data services. + +! !REVISION HISTORY: +! 16oct2019 E.Sherman, A.Da Silva, A.Darmenov, T.Clune First attempt at refactoring + +!EOP +!============================================================================ + +! +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (ESMF_Config) :: cfg + type (wrap_) :: wrap + type (DU2G_GridComp), pointer :: self + + character (len=ESMF_MAXSTR) :: field_name + integer :: i + real :: DEFVAL + logical :: data_driven = .true. + + __Iam__('SetServices') + +!**************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'// Iam + +! Wrap internal state for storing in GC +! ------------------------------------- + allocate (self, __STAT__) + wrap%ptr => self + +! Load resource file +! ------------------- + cfg = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (cfg, 'DU2G_GridComp_'//trim(COMP_NAME)//'.rc', rc=status) + + if (status /= 0) then + if (mapl_am_i_root()) print*,'DU2G_GridComp_'//trim(COMP_NAME)//'.rc does not exist! Loading DU2G_GridComp_DU.rc instead' + call ESMF_ConfigLoadFile (cfg, 'DU2G_GridComp_DU.rc', __RC__) + end if + + ! process generic config items + call self%GA_GridComp%load_from_config(cfg, __RC__) + + allocate(self%sfrac(self%nbins), self%rlow(self%nbins), self%rup(self%nbins), __STAT__) + ! process DU-specific items + call ESMF_ConfigGetAttribute (cfg, self%maringFlag, label='maringFlag:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%sfrac, label='source_fraction:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%Ch_DU_res, label='Ch_DU:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%rlow, label='radius_lower:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%rup, label='radius_upper:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%point_emissions_srcfilen, & + label='point_emissions_srcfilen:', default='/dev/null', __RC__) + if ( (index(self%point_emissions_srcfilen,'/dev/null')>0) ) then + self%doing_point_emissions = .false. ! disable it if no file specified + else + self%doing_point_emissions = .true. ! we are good to go + end if + +! Is DU data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Set entry points +! ------------------------ + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Initialize, Initialize, __RC__) + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Run, Run, __RC__) + if (data_driven .neqv. .true.) then + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Run, Run2, __RC__) + end if + + DEFVAL = 0.0 + + +! IMPORT STATE +! ------------- + if (data_driven) then + + call MAPL_AddInternalSpec(gc,& + short_name='DU', & + long_name='Dust Mixing Ratio all bins', & + units='kg kg-1', & + dims=MAPL_DimsHorzVert, & + vlocation=MAPL_VlocationCenter, & + restart=MAPL_RestartOptional, & + ungridded_dims=[self%nbins], & + friendlyto='DYNAMICS:TURBULENCE:MOIST', & + add2export=.true., __RC__) + +! Pressure at layer edges +! ----------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'PLE', & + LONG_NAME = 'air_pressure', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + +! RH: is between 0 and 1 +! ---------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'RH2', & + LONG_NAME = 'Rel_Hum_after_moist', & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + do i = 1, self%nbins + write (field_name, '(A, I0.3)') '', i + call MAPL_AddImportSpec(GC, & + short_name = 'climdu'//trim(field_name), & + long_name = 'Dust Mixing Ratio (bin '//trim(field_name)//')', & + units = 'kg kg-1', & + restart = MAPL_RestartSkip, & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, __RC__) + +! !dry deposition + call MAPL_AddImportSpec(GC, & + short_name = 'climDUDP'//trim(field_name), & + long_name = 'Dust Mixing Ratio (bin '//trim(field_name)//')', & + units = 'kg kg-1', & + dims = MAPL_DimsHorzOnly, & + vlocation = MAPL_VLocationCenter, & + restart = MAPL_RestartSkip, __RC__) + +! !wet deposition + call MAPL_AddImportSpec(GC, & + short_name = 'climDUWT'//trim(field_name), & + long_name = 'Dust Mixing Ratio (bin '//trim(field_name)//')', & + units = 'kg kg-1', & + dims = MAPL_DimsHorzOnly, & + vlocation = MAPL_VLocationCenter, & + restart = MAPL_RestartSkip, __RC__) + +! !gravitational settling + call MAPL_AddImportSpec(GC, & + short_name = 'climDUSD'//trim(field_name), & + long_name = 'Dust Mixing Ratio (bin '//trim(field_name)//')', & + units = 'kg kg-1', & + dims = MAPL_DimsHorzOnly, & + vlocation = MAPL_VLocationCenter, & + restart = MAPL_RestartSkip, __RC__) + +! !convective scavenging + call MAPL_AddImportSpec(GC, & + short_name = 'climDUSV'//trim(field_name), & + long_name = 'Dust Mixing Ratio (bin '//trim(field_name)//')', & + units = 'kg kg-1', & + dims = MAPL_DimsHorzOnly, & + vlocation = MAPL_VLocationCenter, & + restart = MAPL_RestartSkip, __RC__) + end do + end if ! (data_driven) + +! Computational Instance +! ---------------------- + if (.not. data_driven) then +#include "DU2G_Export___.h" +#include "DU2G_Import___.h" +#include "DU2G_Internal___.h" + end if + +! This state holds fields needed by radiation +! --------------------------------------------- + call MAPL_AddExportSpec (GC, & + short_name = trim(COMP_NAME)//'_AERO', & + long_name = 'aerosols_from_'//trim(COMP_NAME), & + units = 'kg kg-1', & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, & + datatype = MAPL_StateItem, __RC__) + +! This state is needed by MOIST - It will contain aerosols +! ---------------------------------------------------------- + call MAPL_AddExportSpec (GC, & + short_name = trim(COMP_NAME)//'_AERO_ACI', & + long_name = 'aerosol_cloud_interaction_aerosols_from_'//trim(COMP_NAME), & + units = 'kg kg-1', & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, & + datatype = MAPL_StateItem, __RC__) + +! This bundle is needed by surface for snow albedo modification +! by aerosol settling and deposition +! ~~~DEVELOPERS NOTE~~~ Change to StateItem when possible +! --------------------------------------------------------------- + call MAPL_AddExportSpec (GC, & + short_name = trim(COMP_NAME)//'_AERO_DP', & + long_name = 'aerosol_deposition_from_'//trim(COMP_NAME), & + units = 'kg m-2 s-1', & + dims = MAPL_DimsHorzOnly, & + datatype = MAPL_BundleItem, __RC__) + +! Store internal state in GC +! -------------------------- + call ESMF_UserCompSetInternalState ( GC, 'DU2G_GridComp', wrap, STATUS ) + VERIFY_(STATUS) + +! Set generic services +! ---------------------------------- + call MAPL_GenericSetServices (GC, __RC__) + + RETURN_(ESMF_SUCCESS) + + end subroutine SetServices + +!============================================================================ +!BOP + +! !IROUTINE: Initialize + +! !INTERFACE: + subroutine Initialize (GC, import, export, clock, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code + +! !DESCRIPTION: This initializes DU's Grid Component. It primaryily fills +! GOCART's AERO states with its dust fields. + +! !REVISION HISTORY: +! 16oct2019 E.Sherman, A.da Silva, T.Clune, A.Darmenov - First attempt at refactoring + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_Grid) :: grid + type (ESMF_State) :: internal + type (ESMF_State) :: aero, aero_aci + type (ESMF_State) :: providerState + type (ESMF_Config) :: cfg + type (ESMF_FieldBundle) :: Bundle_DP + type (wrap_) :: wrap + type (DU2G_GridComp), pointer :: self + + integer, allocatable :: mieTable_pointer(:) + integer :: i, dims(3), km + integer :: instance + type (ESMF_Field) :: field, fld + character (len=ESMF_MAXSTR) :: bin_index, prefix + real :: CDT ! chemistry timestep (secs) + integer :: HDT ! model timestep (secs) + real, pointer, dimension(:,:,:,:) :: int_ptr + real, pointer, dimension(:,:,:) :: ple + real, pointer, dimension(:,:) :: area + logical :: data_driven + integer :: NUM_BANDS + + __Iam__('Initialize') + +!**************************************************************************** +! Begin... + +! Get the target components name and set-up traceback handle. +! ----------------------------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, name=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' //trim(Iam) + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get my internal private state +! ----------------------------- + call ESMF_UserCompGetInternalState(GC, 'DU2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + + call MAPL_GridGet ( grid, globalCellCountPerDim=dims, __RC__ ) + +! Dust emission tuning coefficient [kg s2 m-5]. NOT bin specific. +! --------------------------------------------------------------- + self%Ch_DU = Chem_UtilResVal(dims(1), dims(2), self%Ch_DU_res(:), __RC__) + self%Ch_DU = self%Ch_DU * 1.00E-09 + +! Get dimensions +! --------------- + km = dims(3) + self%km = km + +! Get DTs +! ------- + call MAPL_GetResource(mapl, HDT, Label='RUN_DT:', __RC__) + call MAPL_GetResource(mapl, CDT, Label='GOCART_DT:', default=real(HDT), __RC__) + self%CDT = CDT + +! Load resource file +! ------------------- + cfg = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (cfg, 'DU2G_GridComp_'//trim(COMP_NAME)//'.rc', RC=STATUS) + if (status /= 0) then + if (mapl_am_i_root()) print*,'DU2G_GridComp_'//trim(COMP_NAME)//'.rc does not exist! & + loading DU2G_GridComp_DU.rc instead' + call ESMF_ConfigLoadFile (cfg, 'DU2G_GridComp_DU.rc', __RC__) + end if + +! Call Generic Initialize +! ------------------------ + call MAPL_GenericInitialize (GC, import, export, clock, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=internal, __RC__) + +! Is DU data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! If this is a data component, the data is provided in the import +! state via ExtData instead of the actual GOCART children +! ---------------------------------------------------------------- + if ( data_driven ) then + providerState = import + prefix = 'clim' + else + providerState = export + prefix = '' + end if + +! Add attribute information for DU export. Used in NI hetergenous chemistry. + call ESMF_StateGet (export, 'DU', field, __RC__) + call ESMF_AttributeSet(field, NAME='radius', valueList=self%radius, itemCount=self%nbins, __RC__) + call ESMF_AttributeSet(field, NAME='fnum', valueList=self%fnum, itemCount=self%nbins, __RC__) +! call ESMF_AttributeSet(field, NAME='klid', value=self%klid, __RC__) + +! Add attribute information to internal state varaibles +! ----------------------------------------------------- +! Fill AERO States with dust fields +! ------------------------------------ + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO' , aero , __RC__) + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO_ACI', aero_aci, __RC__) + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO_DP' , Bundle_DP, __RC__) + + call ESMF_StateGet (internal, 'DU', field, __RC__) + fld = MAPL_FieldCreate (field, 'DU', __RC__) + call MAPL_StateAdd (aero, fld, __RC__) + call MAPL_StateAdd (aero_aci, fld, __RC__) + + if (.not. data_driven) then +! Set klid + call MAPL_GetPointer(import, ple, 'PLE', __RC__) + call findKlid (self%klid, self%plid, ple, __RC__) +! Set internal DU values to 0 where above klid + call MAPL_GetPointer (internal, int_ptr, 'DU', __RC__) + call setZeroKlid4d (self%km, self%klid, int_ptr) + end if + + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', value=self%fscav(1), __RC__) + + if (data_driven) then + instance = instanceData + + do i = 1, self%nbins + write (bin_index, '(A, I0.3)') '', i +! Dry deposition + call append_to_bundle('DUDP'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition (Convective scavenging) + call append_to_bundle('DUSV'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition + call append_to_bundle('DUWT'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + +! Gravitational Settling + call append_to_bundle('DUSD'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + end do + else + instance = instanceComputational + +! Dry deposition + call append_to_bundle('DUDP', providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition (Convective scavenging) + call append_to_bundle('DUSV', providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition + call append_to_bundle('DUWT', providerState, prefix, Bundle_DP, __RC__) + +! Gravitational Settling + call append_to_bundle('DUSD', providerState, prefix, Bundle_DP, __RC__) + end if + + self%instance = instance + +! Create Radiation Mie Table +! -------------------------- + call MAPL_GetResource (MAPL, NUM_BANDS, 'NUM_BANDS:', __RC__) + +! Get file names for the optical tables + call ESMF_ConfigGetAttribute (cfg, self%rad_MieTable(instance)%optics_file, & + label="aerosol_radBands_optics_file:", __RC__ ) + + allocate (self%rad_MieTable(instance)%channels(NUM_BANDS), __STAT__ ) + + call ESMF_ConfigGetAttribute (cfg, self%rad_MieTable(instance)%channels, label= "BANDS:", & + count=self%rad_MieTable(instance)%nch, rc=status) + + if (rc /= 0) then + do i = 1, NUM_BANDS + self%rad_MieTable(instance)%channels(i) = i + end do + end if + + allocate (self%rad_MieTable(instance)%mie_aerosol, __STAT__) + self%rad_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%rad_MieTable(instance)%optics_file, rc) + call Chem_MieTableRead (self%rad_MieTable(instance)%mie_aerosol, NUM_BANDS, self%rad_MieTable(instance)%channels, rc) + +! Create Diagnostics Mie Table +! ----------------------------- +! Get file names for the optical tables + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%optics_file, & + label="aerosol_monochromatic_optics_file:", __RC__ ) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%nch, label="n_channels:", __RC__) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%nmom, label="n_moments:", default=0, __RC__) + allocate (self%diag_MieTable(instance)%channels(self%diag_MieTable(instance)%nch), __STAT__ ) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%channels, & + label= "aerosol_monochromatic_optics_wavelength:", __RC__) + + allocate (self%diag_MieTable(instance)%mie_aerosol, __STAT__) + self%diag_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%diag_MieTable(instance)%optics_file, __RC__ ) + call Chem_MieTableRead (self%diag_MieTable(instance)%mie_aerosol, self%diag_MieTable(instance)%nch, & + self%diag_MieTable(instance)%channels, rc, nmom=self%diag_MieTable(instance)%nmom) + +! Mie Table instance/index + call ESMF_AttributeSet (aero, name='mie_table_instance', value=instance, __RC__) + +! Add variables to DU instance's aero state. This is used in aerosol optics calculations + call add_aero (aero, label='air_pressure_for_aerosol_optics', label2='PLE', grid=grid, typekind=MAPL_R4, __RC__) + call add_aero (aero, label='relative_humidity_for_aerosol_optics', label2='RH', grid=grid, typekind=MAPL_R4, __RC__) +! call ESMF_StateGet (import, 'PLE', field, __RC__) +! call MAPL_StateAdd (aero, field, __RC__) +! call ESMF_StateGet (import, 'RH2', field, __RC__) +! call MAPL_StateAdd (aero, field, __RC__) + + call add_aero (aero, label='extinction_in_air_due_to_ambient_aerosol', label2='EXT', grid=grid, typekind=MAPL_R8, __RC__) + call add_aero (aero, label='single_scattering_albedo_of_ambient_aerosol', label2='SSA', grid=grid, typekind=MAPL_R8, __RC__) + call add_aero (aero, label='asymmetry_parameter_of_ambient_aerosol', label2='ASY', grid=grid, typekind=MAPL_R8, __RC__) + + call ESMF_AttributeSet(aero, name='band_for_aerosol_optics', value=0, __RC__) + + mieTable_pointer = transfer(c_loc(self), [1]) + call ESMF_AttributeSet(aero, name='mieTable_pointer', valueList=mieTable_pointer, itemCount=size(mieTable_pointer), __RC__) + + call ESMF_AttributeSet(aero, name='internal_varaible_name', value='DU', __RC__) + + call ESMF_MethodAdd (aero, label='aerosol_optics', userRoutine=aerosol_optics, __RC__) + + + RETURN_(ESMF_SUCCESS) + + end subroutine Initialize + + +!============================================================================ +!BOP +! !IROUTINE: Run + +! !INTERFACE: + subroutine Run (GC, import, export, clock, rc) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: rc ! Error code: + +! !DESCRIPTION: Run method for the Dust Grid Component. Determines whether to +! run data or computational run method. + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_State) :: internal + + logical :: data_driven + + __Iam__('Run') + +!***************************************************************************** +! Begin... +!if(mapl_am_i_root()) print*,'DU2G Run BEGIN' + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'// Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=internal, __RC__) + +! Is DU data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Update INTERNAL state variables with ExtData +! --------------------------------------------- + if (data_driven) then + call Run_data (GC, import, export, internal, __RC__) + else + call Run1 (GC, import, export, clock, __RC__) + end if + + RETURN_(ESMF_SUCCESS) + + end subroutine Run + +!============================================================================ +!BOP +! !IROUTINE: Run1 + +! !INTERFACE: + subroutine Run1 (GC, import, export, clock, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Computes emissions/sources for Dust + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: mapl + type (ESMF_State) :: internal + type (ESMF_Grid) :: grid + type (wrap_) :: wrap + type (DU2G_GridComp), pointer :: self + type(ESMF_Time) :: time + + integer :: nymd, nhms, iyr, imm, idd, ihr, imn, isc + integer :: import_shape(2), i2, j2 + real, dimension(:,:), pointer :: emissions_surface + real, dimension(:,:,:,:), allocatable :: emissions + real, dimension(:,:,:), allocatable :: emissions_point + character (len=ESMF_MAXSTR) :: fname ! file name for point source emissions + integer, pointer, dimension(:) :: iPoint, jPoint + real, parameter :: UNDEF = 1.e15 + + +real, allocatable, dimension(:,:) :: dqa + +#include "DU2G_DeclarePointer___.h" + + __Iam__('Run1') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'// Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, mapl, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (mapl, INTERNAL_ESMF_STATE=internal, __RC__) + +#include "DU2G_GetPointer___.h" + +! Set du_src to 0 where undefined +! -------------------------------- + where (1.01*du_src > UNDEF) du_src = 0. + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'DU2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Extract nymd(yyyymmdd) from clock +! --------------------------------- + call ESMF_ClockGet (clock, currTime=time, __RC__) + call ESMF_TimeGet (time ,YY=iyr, MM=imm, DD=idd, H=ihr, M=imn, S=isc, __RC__) + call MAPL_PackTime (nymd, iyr, imm , idd) + call MAPL_PackTime (nhms, ihr, imn, isc) + +! Get dimensions +! --------------- + import_shape = shape(wet1) + i2 = import_shape(1) + j2 = import_shape(2) + + allocate(emissions(i2,j2,self%km,self%nbins), __STAT__) + emissions = 0.0 + allocate(emissions_point, mold=delp, __STAT__) + emissions_point = 0.0 + allocate(emissions_surface(i2,j2), __STAT__) !if use mold, then crashes. Compiler issue? + emissions_surface = 0.0 + allocate(dqa, mold=lwi, __STAT__) + +! Get surface gridded emissions +! ----------------------------- + call DustEmissionGOCART2G(self%radius*1.e-6, frlake, wet1, lwi, u10m, v10m, & + self%Ch_DU, du_src, MAPL_GRAV, & + emissions_surface, __RC__) + +! Read point emissions file once per day +! -------------------------------------- + if (self%doing_point_emissions) then + if (self%day_save /= idd) then + self%day_save = idd + call StrTemplate (fname, self%point_emissions_srcfilen, xid='unknown', & + nymd=nymd, nhms=120000 ) + call ReadPointEmissions (nymd, fname, self%nPts, self%pLat, self%pLon, & + self%pBase, self%pTop, self%pEmis, self%pStart, & + self%pEnd, label='source') + end if + end if + +! Get indices for point emissions +! ------------------------------- + if (self%nPts > 0) then + allocate(iPoint(self%nPts), jPoint(self%nPts), __STAT__) + call MAPL_GetHorzIJIndex(self%nPts, iPoint, jPoint, & + grid = grid, & + lon = self%pLon/real(MAPL_RADIANS_TO_DEGREES), & + lat = self%pLat/real(MAPL_RADIANS_TO_DEGREES), & + rc = status) + if ( status /= 0 ) then + if (mapl_am_i_root()) print*, trim(Iam), ' - cannot get indices for point emissions' + VERIFY_(status) + end if + + call updatePointwiseEmissions (self%km, self%pBase, self%pTop, self%pEmis, self%nPts, & + self%pStart, self%pEnd, zle, & + area, iPoint, jPoint, nhms, emissions_point, __RC__) + end if + +! Update aerosol state +! -------------------- + call UpdateAerosolState (emissions, emissions_surface, emissions_point, & + self%sfrac, self%nPts, self%km, self%CDT, MAPL_GRAV, & + self%nbins, delp, DU, rc) + + if (associated(DUEM)) then + DUEM = sum(emissions, dim=3) + end if + +! Clean up +! -------- + deallocate(emissions, emissions_surface, emissions_point, __STAT__) + if (self%nPts > 0) then + deallocate(iPoint, jPoint, __STAT__) + end if + + RETURN_(ESMF_SUCCESS) + + end subroutine Run1 + +!============================================================================ +!BOP +! !IROUTINE: Run2 + +! !INTERFACE: + + subroutine Run2 (GC, import, export, clock, RC) + + ! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Run2 method for the Dust Grid Component. + +!EOP +!============================================================================ +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_State) :: internal + type (wrap_) :: wrap + type (DU2G_GridComp), pointer :: self + + integer :: import_shape(2), i2, j2 + integer :: n + real, allocatable, dimension(:,:) :: drydepositionfrequency, dqa + real :: fwet + logical :: KIN + + real, parameter :: cpd = 1004.16 + +#include "DU2G_DeclarePointer___.h" + + __Iam__('Run2') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' // Iam + +!if(mapl_am_i_root()) print*,'DU2G Run2 BEGIN' + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=internal, __RC__) + +#include "DU2G_GetPointer___.h" + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'DU2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + + allocate(dqa, mold=wet1, __STAT__) + allocate(drydepositionfrequency, mold=wet1, __STAT__) + +! Get dimensions +! --------------- + import_shape = shape(wet1) + i2 = import_shape(1) + j2 = import_shape(2) + +! Dust Settling +! ----------- + do n = 1, self%nbins + call Chem_Settling2Gorig (self%km, self%klid, self%rhFlag, n, DU(:,:,:,n), MAPL_grav, delp, & + self%radius(n)*1.e-6, self%rhop(n), self%cdt, t, airdens, & + rh2, zle, DUSD, correctionMaring=self%maringFlag, __RC__) + end do + +! Dust Deposition +! ---------------- + do n = 1, self%nbins + drydepositionfrequency = 0. + call DryDeposition(self%km, t, airdens, zle, lwi, ustar, zpbl, sh,& + MAPL_KARMAN, cpd, MAPL_GRAV, z0h, drydepositionfrequency, rc, & + self%radius(n)*1.e-6, self%rhop(n), u10m, v10m, frlake, wet1) + + dqa = 0. + dqa = max(0.0, DU(:,:,self%km,n)*(1.-exp(-drydepositionfrequency*self%cdt))) + DU(:,:,self%km,n) = DU(:,:,self%km,n) - dqa + + if (associated(DUDP)) then + DUDP(:,:,n) = dqa*delp(:,:,self%km)/MAPL_GRAV/self%cdt + end if + end do + +! Dust Large-scale Wet Removal +! ---------------------------- + KIN = .TRUE. + do n = 1, self%nbins + fwet = 0.3 + call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, n, self%cdt, 'dust', & + KIN, MAPL_GRAV, fwet, DU(:,:,:,n), ple, t, airdens, & + pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, DUWT, __RC__) + end do + + call Aero_Compute_Diags (self%diag_MieTable(self%instance), self%km, self%klid, 1, self%nbins, self%rlow, & + self%rup, self%diag_MieTable(self%instance)%channels, DU, MAPL_GRAV, t, airdens, & + rh2, u, v, delp, DUSMASS, DUCMASS, DUMASS, DUEXTTAU, DUSCATAU, & + DUSMASS25, DUCMASS25, DUMASS25, DUEXTT25, DUSCAT25, & + DUFLUXU, DUFLUXV, DUCONC, DUEXTCOEF, DUSCACOEF, & + DUEXTTFM, DUSCATFM, DUANGSTR, DUAERIDX, __RC__ ) + + RETURN_(ESMF_SUCCESS) + + end subroutine Run2 + +!============================================================================ +!BOP +! !IROUTINE: Run_data -- ExtData Dust Grid Component + +! !INTERFACE: + subroutine Run_data (GC, import, export, internal, RC) + + ! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_State), intent(inout) :: internal ! Interal state + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. + +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (wrap_) :: wrap + type (DU2G_GridComp), pointer :: self + + integer :: i + character (len=ESMF_MAXSTR) :: field_name + + real, pointer, dimension(:,:,:,:) :: ptr4d_int + real, pointer, dimension(:,:,:) :: ptr3d_imp + + __Iam__('Run_data') + +!EOP +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'//Iam + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'DU2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Update interal data pointers with ExtData +! ----------------------------------------- + call MAPL_GetPointer (internal, NAME='DU', ptr=ptr4d_int, __RC__) + + do i = 1, self%nbins + write (field_name, '(A, I0.3)') 'du', i + call MAPL_GetPointer (import, NAME='clim'//trim(field_name), ptr=ptr3d_imp, __RC__) + + ptr4d_int(:,:,:,i) = ptr3d_imp + end do + + RETURN_(ESMF_SUCCESS) + + end subroutine Run_data + +!------------------------------------------------------------------------------------- + subroutine aerosol_optics(state, rc) + + implicit none + +! !ARGUMENTS: + type (ESMF_State) :: state + integer, intent(out) :: rc + +! !Local + integer, parameter :: DP=kind(1.0d0) + real, dimension(:,:,:), pointer :: ple, rh + real(kind=DP), dimension(:,:,:), pointer :: var + real, dimension(:,:,:,:), pointer :: q, q_4d + integer, allocatable :: opaque_self(:) + type(C_PTR) :: address + type(DU2G_GridComp), pointer :: self + + character (len=ESMF_MAXSTR) :: fld_name + type(ESMF_Field) :: fld + + real(kind=DP), dimension(:,:,:), allocatable :: ext_s, ssa_s, asy_s ! (lon:,lat:,lev:) + real, dimension(:,:,:), allocatable :: x + integer :: instance + integer :: n, nbins + integer :: i1, j1, i2, j2, km + integer :: band, offset + integer, parameter :: n_bands = 1 + + integer :: k + + __Iam__('DU2G::aerosol_optics') + +! Begin... + +! Mie Table instance/index +! ------------------------ + call ESMF_AttributeGet (state, name='mie_table_instance', value=instance, __RC__) + +! Radiation band +! -------------- + band = 0 + call ESMF_AttributeGet (state, name='band_for_aerosol_optics', value=band, __RC__) + offset = band - n_bands + +! Pressure at layer edges +! ------------------------ + call ESMF_AttributeGet (state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer (state, ple, trim(fld_name), __RC__) + +! call MAPL_GetPointer (state, ple, 'PLE', __RC__) + + i1 = lbound(ple, 1); i2 = ubound(ple, 1) + j1 = lbound(ple, 2); j2 = ubound(ple, 2) + km = ubound(ple, 3) + +! Relative humidity +! ----------------- + call ESMF_AttributeGet (state, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer (state, rh, trim(fld_name), __RC__) + +! call MAPL_GetPointer (state, rh, 'RH2', __RC__) + + allocate(ext_s(i1:i2, j1:j2, km), & + ssa_s(i1:i2, j1:j2, km), & + asy_s(i1:i2, j1:j2, km), & + x(i1:i2, j1:j2, km),__STAT__) + + call ESMF_StateGet (state, 'DU', field=fld, __RC__) + call ESMF_FieldGet (fld, farrayPtr=q, __RC__) + + nbins = size(q,4) + + allocate(q_4d(i1:i2, j1:j2, km, nbins), __STAT__) + + do n = 1, nbins + do k = 1, km + x(:,:,k) = ((PLE(:,:,k) - PLE(:,:,k-1))*0.01)*(100./MAPL_GRAV) + q_4d(:,:,k,n) = x(:,:,k) * q(:,:,k,n) + end do + end do + + call ESMF_AttributeGet(state, name='mieTable_pointer', itemCount=n, __RC__) + allocate (opaque_self(n), __STAT__) + call ESMF_AttributeGet(state, name='mieTable_pointer', valueList=opaque_self, __RC__) + + address = transfer(opaque_self, address) + call c_f_pointer(address, self) + + call mie_ (self%rad_MieTable(instance), nbins, n_bands, offset, q_4d, rh, ext_s, ssa_s, asy_s, __RC__) + + call ESMF_AttributeGet (state, name='extinction_in_air_due_to_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer (state, var, trim(fld_name), __RC__) + var = ext_s(:,:,:) + end if + + call ESMF_AttributeGet (state, name='single_scattering_albedo_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer (state, var, trim(fld_name), __RC__) + var = ssa_s(:,:,:) + end if + + call ESMF_AttributeGet (state, name='asymmetry_parameter_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer (state, var, trim(fld_name), __RC__) + var = asy_s(:,:,:) + end if + + deallocate(ext_s, ssa_s, asy_s, __STAT__) + deallocate(q_4d, __STAT__) + + RETURN_(ESMF_SUCCESS) + + contains + + subroutine mie_(mie_table, nbins, nb, offset, q, rh, bext_s, bssa_s, basym_s, rc) + + implicit none + + type(Chem_Mie), intent(inout) :: mie_table ! mie table + integer, intent(in ) :: nbins ! number of bins + integer, intent(in ) :: nb ! number of bands + integer, intent(in ) :: offset ! bands offset + real, intent(in ) :: q(:,:,:,:) ! aerosol mass mixing ratio, kg kg-1 + real, intent(in ) :: rh(:,:,:) ! relative humidity + real(kind=DP), intent( out) :: bext_s (size(ext_s,1),size(ext_s,2),size(ext_s,3)) + real(kind=DP), intent( out) :: bssa_s (size(ext_s,1),size(ext_s,2),size(ext_s,3)) + real(kind=DP), intent( out) :: basym_s(size(ext_s,1),size(ext_s,2),size(ext_s,3)) + integer, intent( out) :: rc + + ! local + integer :: l + real :: bext (size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! extinction + real :: bssa (size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! SSA + real :: gasym(size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! asymmetry parameter + + __Iam__('DU2G::aerosol_optics::mie_') + + bext_s = 0.0d0 + bssa_s = 0.0d0 + basym_s = 0.0d0 + + do l = 1, nbins + call Chem_MieQuery(mie_table, l, real(offset+1.), q(:,:,:,l), rh, bext, gasym=gasym, ssa=bssa) + + bext_s = bext_s + bext ! extinction + bssa_s = bssa_s + (bssa*bext) ! scattering extinction + basym_s = basym_s + gasym*(bssa*bext) ! asymetry parameter multiplied by scatering extiction + end do + + RETURN_(ESMF_SUCCESS) + + end subroutine mie_ + + end subroutine aerosol_optics + +!--------------------------------------------------------------------------------------- + +end module DU2G_GridCompMod + diff --git a/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridComp_DU.data.rc b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridComp_DU.data.rc new file mode 100644 index 00000000..59749955 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridComp_DU.data.rc @@ -0,0 +1,45 @@ +# +# Resource file Dust parameters. +# + +aerosol_radBands_optics_file: ExtData/MERRA2/x/opticsBands_DU.v15_3.RRTMG.nc + +aerosol_monochromatic_optics_file:ExtData/AeroCom/x/optics_DU.v15_3.nc +aerosol_monochromatic_optics_wavelength: 470 550 670 870 ! units: nm + +particle_radius_microns: 0.73 1.4 2.4 4.5 8.0 + +radius_lower: 0.1 1.0 1.8 3.0 6.0 + +radius_upper: 1.0 1.8 3.0 6.0 10.0 + +source_fraction: 0.1 0.25 0.25 0.25 0.25 + +# units [kg/m-3] +soil_density: 2500. 2650. 2650. 2650. 2650. + +# Resolution dependent tuning constant for emissions (a,b,c,d,e,f) +Ch_DU: 0.2 0.2 0.07 0.07 0.07 0.056 + +# Scavenging efficiency per bin [km-1] +fscav: 0.2 0.2 0.2 0.2 0.2 # + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.1 0.1 0.1 0.1 0.1 + +# Number of particles per kg mass +fnum: 2.45e14 3.28e13 6.52e12 9.89e11 1.76e11 + +rhFlag: 0 + +# Maring settling velocity correction +maringFlag: .true. + +n_channels: 4 + +r_channels: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 + +nbins: 5 + +#point_emissions_srcfilen: /gpfsm/dnb32/esherman/GOCART_REFACTOR_develop1/RC/dust_point_src_test.rc + diff --git a/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridComp_DU.rc b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridComp_DU.rc new file mode 100644 index 00000000..98e8adeb --- /dev/null +++ b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridComp_DU.rc @@ -0,0 +1,44 @@ +# +# Resource file Dust parameters. +# + +aerosol_radBands_optics_file: ExtData/MERRA2/x/opticsBands_DU.v15_3.RRTMG.nc + +aerosol_monochromatic_optics_file:ExtData/AeroCom/x/optics_DU.v15_3.nc +aerosol_monochromatic_optics_wavelength: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 ! units: nm +n_channels: 4 + +particle_radius_microns: 0.73 1.4 2.4 4.5 8.0 + +radius_lower: 0.1 1.0 1.8 3.0 6.0 + +radius_upper: 1.0 1.8 3.0 6.0 10.0 + +source_fraction: 0.1 0.25 0.25 0.25 0.25 + +# units [kg/m-3] +particle_density: 2500. 2650. 2650. 2650. 2650. + +# Resolution dependent tuning constant for emissions (a,b,c,d,e,f) +Ch_DU: 0.2 0.2 0.07 0.07 0.07 0.056 + +# Scavenging efficiency per bin [km-1] +fscav: 0.2 0.2 0.2 0.2 0.2 # + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.1 0.1 0.1 0.1 0.1 + +# Number of particles per kg mass +fnum: 2.45e14 3.28e13 6.52e12 9.89e11 1.76e11 + +rhFlag: 0 + +# Maring settling velocity correction +maringFlag: .true. + +nbins: 5 + +pressure_lid_in_hPa: 0.01 + +#point_emissions_srcfilen: /gpfsm/dnb32/esherman/gocartRefactor/RC/CA2G_point_src_test.rc + diff --git a/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridComp_ExtData.rc b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridComp_ExtData.rc new file mode 100644 index 00000000..e1846dbb --- /dev/null +++ b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridComp_ExtData.rc @@ -0,0 +1,42 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +DU_SRC NA N Y - none none du_src ExtData/PIESA/sfc/gocart.dust_source.v5a.x1152_y721.nc + +# DU data - 3D +climdu001 'kg kg-1' Y N 0 0.0 1.0 du001 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu002 'kg kg-1' Y N 0 0.0 1.0 du002 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu003 'kg kg-1' Y N 0 0.0 1.0 du003 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu004 'kg kg-1' Y N 0 0.0 1.0 du004 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu005 'kg kg-1' Y N 0 0.0 1.0 du005 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 + +# DU data - 2D +climDUDP001 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT001 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD001 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV001 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP002 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT002 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD002 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV002 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP003 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT003 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD003 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV003 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP004 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT004 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD004 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV004 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP005 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT005 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD005 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV005 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +%% + diff --git a/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_Registry.rc b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_Registry.rc new file mode 100644 index 00000000..a57b9289 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_Registry.rc @@ -0,0 +1,115 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: DU2G + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl| Sub | Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- + DUMASS | kg kg-1 | xyz | C | | | | | Dust Mass Mixing Ratio __ENSEMBLE__ + DUMASS25 | kg kg-1 | xyz | C | | | | | Dust Mass Mixing Ratio - PM 2.5 __ENSEMBLE__ + DUCONC | kg m-3 | xyz | C | | | | | Dust Mass Concentration __ENSEMBLE__ + DUEXTCOEF | m-1 | xyz | C | | | | | Dust Extinction Coefficient [550 nm] __ENSEMBLE__ + DUSCACOEF | m-1 | xyz | C | | | | | Dust Scattering Coefficient [550 nm] __ENSEMBLE__ +# ............|............|.....|...|....|...|...|.....|.................................. + DUEM001 | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 001 __ENSEMBLE__ + DUEM002 | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 002 __ENSEMBLE__ + DUEM003 | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 003 __ENSEMBLE__ + DUEM004 | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 004 __ENSEMBLE__ + DUEM005 | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 005 __ENSEMBLE__ + DUSD001 | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 001 __ENSEMBLE__ + DUSD002 | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 002 __ENSEMBLE__ + DUSD003 | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 003 __ENSEMBLE__ + DUSD004 | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 004 __ENSEMBLE__ + DUSD005 | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 005 __ENSEMBLE__ + DUDP001 | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 001 __ENSEMBLE__ + DUDP002 | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 002 __ENSEMBLE__ + DUDP003 | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 003 __ENSEMBLE__ + DUDP004 | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 004 __ENSEMBLE__ + DUDP005 | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 005 __ENSEMBLE__ + DUWT001 | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 001 __ENSEMBLE__ + DUWT002 | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 002 __ENSEMBLE__ + DUWT003 | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 003 __ENSEMBLE__ + DUWT004 | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 004 __ENSEMBLE__ + DUWT005 | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 005 __ENSEMBLE__ + DUSV001 | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 001 __ENSEMBLE__ + DUSV002 | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 002 __ENSEMBLE__ + DUSV003 | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 003 __ENSEMBLE__ + DUSV004 | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 004 __ENSEMBLE__ + DUSV005 | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 005 __ENSEMBLE__ + DUSMASS | kg m-3 | xy | | | | | | Dust Surface Mass Concentration __ENSEMBLE__ + DUCMASS | kg m-2 | xy | | | | | | Dust Column Mass Density __ENSEMBLE__ + DUEXTTAU | 1 | xy | | | | | | Dust Extinction AOT [550 nm] __ENSEMBLE__ + DUSCATAU | 1 | xy | | | | | | Dust Scattering AOT [550 nm] __ENSEMBLE__ + DUSMASS25 | kg m-3 | xy | | | | | | Dust Surface Mass Concentration - PM 2.5 __ENSEMBLE__ + DUCMASS25 | kg m-2 | xy | | | | | | Dust Column Mass Density - PM 2.5 __ENSEMBLE__ + DUEXTT25 | 1 | xy | | | | | | Dust Extinction AOT [550 nm] - PM 2.5 __ENSEMBLE__ + DUSCAT25 | 1 | xy | | | | | | Dust Scattering AOT [550 nm] - PM 2.5 __ENSEMBLE__ + DUAERIDX | 1 | xy | | | | | | Dust TOMS UV Aerosol Index __ENSEMBLE__ + DUFLUXU | kg m-1 s-1 | xy | | | | | | Dust column u-wind mass flux __ENSEMBLE__ + DUFLUXV | kg m-1 s-1 | xy | | | | | | Dust column v-wind mass flux __ENSEMBLE__ + DUEXTTFM | 1 | xy | | | | | | Dust Extinction AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + DUSCATFM | 1 | xy | | | | | | Dust Scattering AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + DUANGSTR | 1 | xy | | | | | | Dust Angstrom parameter [470-870 nm] __ENSEMBLE__ +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- + DUMASSash | kg kg-1 | xyz | C | | | | | Dust Mass Mixing Ratio ash + DUMASS25ash | kg kg-1 | xyz | C | | | | | Dust Mass Mixing Ratio - PM 2.5 ash + DUCONCash | kg m-3 | xyz | C | | | | | Dust Mass Concentration ash + DUEXTCOEFash | m-1 | xyz | C | | | | | Dust Extinction Coefficient [550 nm] ash + DUSCACOEFash | m-1 | xyz | C | | | | | Dust Scattering Coefficient [550 nm] ash +# ............|............|.....|...|....|...|...|.....|.................................. + DUEM001ash | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 001 ash + DUEM002ash | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 002 ash + DUEM003ash | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 003 ash + DUEM004ash | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 004 ash + DUEM005ash | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 005 ash + DUSD001ash | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 001 ash + DUSD002ash | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 002 ash + DUSD003ash | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 003 ash + DUSD004ash | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 004 ash + DUSD005ash | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 005 ash + DUDP001ash | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 001 ash + DUDP002ash | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 002 ash + DUDP003ash | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 003 ash + DUDP004ash | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 004 ash + DUDP005ash | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 005 ash + DUWT001ash | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 001 ash + DUWT002ash | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 002 ash + DUWT003ash | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 003 ash + DUWT004ash | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 004 ash + DUWT005ash | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 005 ash + DUSV001ash | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 001 ash + DUSV002ash | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 002 ash + DUSV003ash | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 003 ash + DUSV004ash | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 004 ash + DUSV005ash | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 005 ash + DUSMASSash | kg m-3 | xy | | | | | | Dust Surface Mass Concentration ash + DUCMASSash | kg m-2 | xy | | | | | | Dust Column Mass Density ash + DUEXTTAUash | 1 | xy | | | | | | Dust Extinction AOT [550 nm] ash + DUSCATAUash | 1 | xy | | | | | | Dust Scattering AOT [550 nm] ash + DUSMASS25ash | kg m-3 | xy | | | | | | Dust Surface Mass Concentration - PM 2.5 ash + DUCMASS25ash | kg m-2 | xy | | | | | | Dust Column Mass Density - PM 2.5 ash + DUEXTT25ash | 1 | xy | | | | | | Dust Extinction AOT [550 nm] - PM 2.5 ash + DUSCAT25ash | 1 | xy | | | | | | Dust Scattering AOT [550 nm] - PM 2.5 ash + DUAERIDXash | 1 | xy | | | | | | Dust TOMS UV Aerosol Index ash + DUFLUXUash | kg m-1 s-1 | xy | | | | | | Dust column u-wind mass flux ash + DUFLUXVash | kg m-1 s-1 | xy | | | | | | Dust column v-wind mass flux ash + DUEXTTFMash | 1 | xy | | | | | | Dust Extinction AOT [550 nm] - PM 1.0 um ash + DUSCATFMash | 1 | xy | | | | | | Dust Scattering AOT [550 nm] - PM 1.0 um ash + DUANGSTRash | 1 | xy | | | | | | Dust Angstrom parameter [470-870 nm] ash +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- + diff --git a/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_StateSpecs.rc b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_StateSpecs.rc new file mode 100644 index 00000000..301975f5 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_StateSpecs.rc @@ -0,0 +1,106 @@ +schema_version: 2.0.0 +component: DU + +category: IMPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS| Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC| COND | LONG NAME +#---------------------------------------------------------------------------------------- + DU_SRC | 1 | xy | N | | erod + FRLAKE | 1 | xy | N | | fraction_of_lake + WET1 | 1 | xy | N | | surface_soil_wetness + LWI | 1 | xy | N | | land-ocean-ice_mask + U10M | m s-1 | xy | N | | 10-meter_eastward_wind + V10M | m s-1 | xy | N | | 10-meter_northward_wind + AREA | m^2 | xy | N | | agrid_cell_area + USTAR | m s-1 | xy | N | | equivalent_neutral_10-meter_northward_wind + CN_PRCP |kg/m^2/s| xy | N | | surface_conv._rain_flux_needed_by_land + NCN_PRCP |kg/m^2/s| xy | N | | Non-convective precipitation + ZPBL | m | xy | N | | planetary_boundary_layer_height + SH | w m-2 | xy | N | | sensible_heat_flux_from_turbulence + Z0H | m | xy | N | | surface_roughness_for_heat +#........................................................................................ + AIRDENS | kg/m^3 | xyz | C | | moist_air_density + DELP | Pa | xyz | C | | pressure_thickness + RH2 | 1 | xyz | C | | Rel_Hum_after_moist + T | K | xyz | C | | air_temperature + ZLE | m | xyz | E | | geopotential_height + PLE | Pa | xyz | E | | air_pressure + PFL_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_liquid_nonconvective_precipitation + PFI_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_ice_nonconvective_precipitation + U | m s-1 | xyz | C | | eastward_wind + V | m s-1 | xyz | C | | northward_wind + +category: EXPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS| VLOC| UNGRIDDED | LONG_NAME +#---------------------------------------------------------------------------------------- + DUMASS | kg kg-1 | xyz | C | | Dust Mass Mixing Ratio __ENSEMBLE__ + DUMASS25 | kg kg-1 | xyz | C | | Dust Mass Mixing Ratio __ENSEMBLE__ + DUCONC | kg m-3 | xyz | C | | Dust Mass Concentration __ENSEMBLE__ + DUEXTCOEF | m-1 | xyz | C | | Dust Extinction Coefficient [550 nm] __ENSEMBLE__ + DUSCACOEF | m-1 | xyz | C | | Dust Scattering Coefficient [550 nm] __ENSEMBLE__ +#........................................................................................ + DUSMASS | kg m-3 | xy | N | | Dust Surface Mass Concentration __ENSEMBLE__ + DUCMASS | kg m-2 | xy | N | | Dust Column Mass Density __ENSEMBLE__ + DUEXTTAU | 1 | xy | N | | Dust Extinction AOT [550 nm] __ENSEMBLE__ + DUSCATAU | 1 | xy | N | | Dust Scattering AOT [550 nm] __ENSEMBLE__ + DUSMASS25 | kg m-3 | xy | N | | Dust Surface Mass Concentration - PM 2.5 __ENSEMBLE__ + DUCMASS25 | kg m-2 | xy | N | | Dust Column Mass Density - PM 2.5 __ENSEMBLE__ + DUEXTT25 | 1 | xy | N | | Dust Extinction AOT [550 nm] - PM 2.5 __ENSEMBLE__ + DUSCAT25 | 1 | xy | N | | Dust Scattering AOT [550 nm] - PM 2.5 __ENSEMBLE__ + DUAERIDX | 1 | xy | N | | Dust TOMS UV Aerosol Index __ENSEMBLE__ + DUFLUXU | kg m-1 s-1 | xy | N | | Dust column u-wind mass flux __ENSEMBLE__ + DUFLUXV | kg m-1 s-1 | xy | N | | Dust column v-wind mass flux __ENSEMBLE__ + DUEXTTFM | 1 | xy | N | | Dust Extinction AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + DUSCATFM | 1 | xy | N | | Dust Scattering AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + DUANGSTR | 1 | xy | N | | Dust Angstrom parameter [470-870 nm] __ENSEMBLE__ + DUEM | kg m-2 s-1 | xy | N | self%nbins | Dust Emission All Bins __ENSEMBLE__ + DUSD | kg m-2 s-1 | xy | N | self%nbins | Dust Sedimentation All Bins __ENSEMBLE__ + DUDP | kg m-2 s-1 | xy | N | self%nbins | Dust Dry Deposition All Bins __ENSEMBLE__ + DUWT | kg m-2 s-1 | xy | N | self%nbins | Dust Wet Deposition All Bins __ENSEMBLE__ + DUSV | kg m-2 s-1 | xy | N | self%nbins | Dust Convective Scavenging All Bins __ENSEMBLE__ + + +category: INTERNAL +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSION | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC | UNGRIDDED | RESTART | ADD2EXPORT | FRIENDLYTO | LONG NAME +#---------------------------------------------------------------------------------------- + DU |kg kg-1| xyz | C | self%nbins | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Dust Mixing Ratio all bins + + + +#******************************************************** +# +# Legend +# +#------------------------------------------------------------------ +# Column label | MAPL keyword/interpretation | Default +#--------------|--------------------------------------------------- +# NAME | short_name | +# UNITS | units | +# DIMS | dims | +# VLOC | VLocation | MAPL_VLocationNone +# LONG NAME | long_name | +# COND | if () then | .FALSE. +# NUM_SUBTILES | num_subtiles +# ... +#------------------------------------------------------------------ +# +#-------------------------------------------- +# Entry alias | Column | MAPL keyword/interpretation +#--------------|----------------------------- +# xyz | DIMS | MAPL_HorzVert +# xy | DIMS | MAPL_HorzOnly +# z | DIMS | MAPL_VertOnly (plus ungridded) +# C | VLOC | MAPL_VlocationCenter +# E | VLOC | MAPL_VlocationEdge +# N | VLOC | MAPL_VlocationNone +#-------------------------------------------- + + diff --git a/ESMF/GOCART2G_GridComp/GA_GridComp/CMakeLists.txt b/ESMF/GOCART2G_GridComp/GA_GridComp/CMakeLists.txt new file mode 100644 index 00000000..0580ae0f --- /dev/null +++ b/ESMF/GOCART2G_GridComp/GA_GridComp/CMakeLists.txt @@ -0,0 +1,7 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES MAPL Chem_Shared2G Process_Library + ) + diff --git a/ESMF/GOCART2G_GridComp/GA_GridComp/GA_GridComp.F90~ b/ESMF/GOCART2G_GridComp/GA_GridComp/GA_GridComp.F90~ new file mode 100644 index 00000000..b66716cd --- /dev/null +++ b/ESMF/GOCART2G_GridComp/GA_GridComp/GA_GridComp.F90~ @@ -0,0 +1,40 @@ +module GA_GridCompMod + + implicit none + private + + public :: GA + + type :: GA + type(Chem_Mie), dimension(2) :: rad_MieTable, diag_MieTable + real, allocatable :: radius(:) ! particle effective radius [um] + real, allocatable :: rlow(:) ! particle effective radius lower bound [um] + real, allocatable :: rup(:) ! particle effective radius upper bound [um] + real, allocatable :: rhop(:) ! soil class density [kg m-3] + real, allocatable :: fscav(:) ! scavenging efficiency + real, allocatable :: molwght(:) ! molecular weight + real, allocatable :: fnum(:) ! number of particles per kg mass + integer :: rhFlag + logical :: maringFlag=.false. ! maring settling velocity correction + integer :: nbins + integer :: km ! vertical grid dimension + real :: CDT ! chemistry timestep (secs) + integer :: instance ! data or computational instance +! THe following are only in DU: +!!$ real, allocatable :: sfrac(:) ! fraction of total source +!!$ real :: Ch_DU_res(NHRES) ! resolutions used for Ch_DU +!!$ real :: Ch_DU ! dust emission tuning coefficient [kg s2 m-5]. +!!$ integer :: day_save = -1 +! !Workspae for point emissions +!!$ logical :: doing_point_emissions = .false. +!!$ character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions +!!$ integer :: nPts = -1 +!!$ integer, pointer, dimension(:) :: pstart => null(), pend => null() +!!$ real, pointer, dimension(:) :: pLat => null(), & +!!$ pLon => null(), & +!!$ pBase => null(), & +!!$ pTop => null(), & +!!$ pEmis => null() + end type GA + +end module GA_GridCompMod diff --git a/ESMF/GOCART2G_GridComp/GA_GridComp/GA_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/GA_GridComp/GA_GridCompMod.F90 new file mode 100644 index 00000000..9b377e23 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/GA_GridComp/GA_GridCompMod.F90 @@ -0,0 +1,67 @@ +#include "MAPL_Generic.h" + +module GA_GridCompMod + + use ESMF + use MAPL + use Chem_MieTableMod2G + + implicit none + private + + public :: GA_GridComp + + type :: GA_GridComp + type(Chem_Mie), dimension(2) :: rad_MieTable, diag_MieTable + real, allocatable :: radius(:) ! particle effective radius [um] + real, allocatable :: rhop(:) ! soil class density [kg m-3] + real, allocatable :: fscav(:) ! scavenging efficiency +! logical :: scav_byColdCloud ! new flag example + real, allocatable :: molwght(:) ! molecular weight !NOT UNIVERSAL ONLY FOR GASES, + real, allocatable :: fnum(:) ! number of particles per kg mass + integer :: rhFlag + integer :: nbins + integer :: km ! vertical grid dimension + real :: CDT ! chemistry timestep (secs) + integer :: instance ! data or computational instance + real :: plid ! pressure lid [hPa] + integer :: klid ! vertical index of pressure lid + contains + procedure :: load_from_config + end type GA_GridComp + + + !LOCALS + integer :: status + integer :: nbins + + contains + + + subroutine load_from_config(self, cfg, rc) + class(GA_GridComp), intent(inout) :: self + type(ESMF_Config), intent(inout) :: cfg + integer, optional, intent(out) :: rc + + ! Get nbins from cfg + call ESMF_ConfigGetAttribute (cfg, self%nbins, label='nbins:', __RC__) + nbins = self%nbins + + ! Parse config file into private internal state + ! ---------------------------------------------- + allocate(self%radius(nbins), self%rhop(nbins), self%fscav(nbins), & + self%molwght(nbins), self%fnum(nbins), & + __STAT__) + + call ESMF_ConfigGetAttribute (cfg, self%radius, label='particle_radius_microns:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%rhop, label='particle_density:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%fscav, label='fscav:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%molwght, label='molecular_weight:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%fnum, label='fnum:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%rhFlag, label='rhFlag:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%plid, label='pressure_lid_in_hPa:', __RC__) + + end subroutine load_from_config + + +end module GA_GridCompMod diff --git a/ESMF/GOCART2G_GridComp/GOCART2G_GridComp.rc b/ESMF/GOCART2G_GridComp/GOCART2G_GridComp.rc new file mode 100644 index 00000000..e7ed3c0c --- /dev/null +++ b/ESMF/GOCART2G_GridComp/GOCART2G_GridComp.rc @@ -0,0 +1,37 @@ +# +# !RESOURCE: GOCART2G_GridComp.rc --- GOCART2G resource file +# +# DESCRIPTION: +# The GOCART2G resource file is used to control basic +# properties of the GOCART2G Grid Components. Instances are +# defined here. Default is the data component. +# +# Only the FIRST entry in the ACTIVE_INSTANCE_XX is given as +# the AERO_PROVIDER. +# +# !REVISION HISTORY: +# +# 11Oct2019 E.Sherman GOCART2G resource file has been created +#-------------------------------------------------------------------- + + + # &Label Active Constituents + +# Include the constituent in the simulation? +# ---------------------------------------------------- +ACTIVE_INSTANCES_DU: DU # DU.data +PASSIVE_INSTANCES_DU: + +ACTIVE_INSTANCES_SS: SS # SS.data +PASSIVE_INSTANCES_SS: + +ACTIVE_INSTANCES_SU: +PASSIVE_INSTANCES_SU: + +ACTIVE_INSTANCES_CA: CA.oc CA.bc #CA.oc.data CA.bc.datac +PASSIVE_INSTANCES_CA: + +ACTIVE_INSTANCES_NI: NI #NI.data +PASSIVE_INSTANCES_NI: + + diff --git a/ESMF/GOCART2G_GridComp/GOCART2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/GOCART2G_GridCompMod.F90 new file mode 100644 index 00000000..4efe28e4 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/GOCART2G_GridCompMod.F90 @@ -0,0 +1,786 @@ +#include "MAPL_Generic.h" + +!============================================================================= +!BOP + +! !MODULE: GOCART2G_GridCompMod - The GOCART 2nd Generation Aerosol Grid Component + +! !INTERFACE: + +module GOCART2G_GridCompMod + +! !USES: + + use ESMF + use MAPL + use Chem_AeroGeneric + +! !Establish the Childen's SetServices + !----------------------------------- + use DU2G_GridCompMod, only : DU2G_setServices => SetServices + use SS2G_GridCompMod, only : SS2G_setServices => SetServices + use SU2G_GridCompMod, only : SU2G_setServices => SetServices + use CA2G_GridCompMod, only : CA2G_setServices => SetServices + use NI2G_GridCompMod, only : NI2G_setServices => SetServices + + implicit none + private + +! !PUBLIC MEMBER FUNCTIONS: + public SetServices + + ! Private State + type :: Instance + integer :: id = -1 + logical :: is_active + character(:), allocatable :: name + end type Instance + + type Constituent + type(Instance), allocatable :: instances(:) + integer :: n_active + end type Constituent + + type GOCART_State + private + type(Constituent) :: DU + type(Constituent) :: SS + type(Constituent) :: SU + type(Constituent) :: CA + type(Constituent) :: NI + end type GOCART_State + + type wrap_ + type (GOCART_State), pointer :: PTR => null() + end type wrap_ + +! !DESCRIPTION: +! +! {\tt GOCART} is a gridded component from the GOCART model and includes +! dust, sea salt, sulfates, nitrate, organic and black carbon. +! +! +! !REVISION HISTORY: +! +! 25feb2005 da Silva First crack. +! 19jul2006 da Silva First separate GOCART component. +! 14Oct2019 E.Sherman, A.Darmenov, A. da Silva, T. Clune First attempt at refactoring. +! +!EOP +!============================================================================ + +contains + +!BOP + +! !IROUTINE: SetServices -- Sets ESMF services for this component + +! !INTERFACE: + + subroutine SetServices (GC, RC) + +! !ARGUMENTS: + + type (ESMF_GridComp), intent(INOUT) :: GC ! gridded component + integer, optional :: RC ! return code + +! !DESCRIPTION: This version uses MAPL_GenericSetServices, which sets +! the Initialize and Finalize services to generic versions. It also +! allocates our instance of a generic state and puts it in the +! gridded component (GC). Here we only set the two-stage run method and +! declare the data services. + +! !REVISION HISTORY: +! 14oct2019 Sherman, da Silva, Darmenov, Clune - First attempt at refactoring for ESMF compatibility + + +!EOP +!============================================================================ +! +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (ESMF_Config) :: myCF + type (GOCART_State), pointer :: self + type (wrap_) :: wrap + + __Iam__('SetServices') + +!**************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME)//'::'//'SetServices' + +! Wrap internal state for storing in GC +! ------------------------------------- + allocate (self, __STAT__) + wrap%ptr => self + +! Set the Initialize, Run, Finalize entry points +! ------------------------------------------------ + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Initialize, Initialize, __RC__) + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Run, Run1, __RC__) + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Run, Run2, __RC__) + +! Store internal state in GC +! -------------------------- + call ESMF_UserCompSetInternalState (GC, 'GOCART_State', wrap, STATUS) + VERIFY_(STATUS) + +! Get instances to determine what children will be born +! ----------------------------------------------------- + myCF = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (myCF, 'GOCART2G_GridComp.rc', __RC__) + + call getInstances_('DU', myCF, species=self%DU, __RC__) + call getInstances_('SS', myCF, species=self%SS, __RC__) + call getInstances_('SU', myCF, species=self%SU, __RC__) + call getInstances_('CA', myCF, species=self%CA, __RC__) + call getInstances_('NI', myCF, species=self%NI, __RC__) + +! Nitrate currently only supports one active instance + if (self%NI%n_active > 1) then + if(mapl_am_i_root()) print*,'WARNING: GOCART can only support one active nitrate instance. Check the RC/GOCART2G_GridComp.rc' + end if + + call ESMF_ConfigDestroy(myCF, __RC__) + +! Create children`s gridded components and invoke their SetServices +! Active instances are created first +! ----------------------------------------------------------------- + call createInstances_(self, GC, __RC__) + +! Define EXPORT states +! This state is needed by radiation - It will contain +! aerosols and aerosol optics +! -------------------------------------------------------- + call MAPL_AddExportSpec(GC, & + short_name = 'AERO2G_RAD', & + long_name = 'aerosol_mass_mixing_ratios_ng', & + units = 'kg kg-1', & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, & + datatype = MAPL_StateItem, __RC__) + +! This state is needed by MOIST - It will contain +! aerosols +! -------------------------------------------------------- + call MAPL_AddExportSpec(GC, & + short_name = 'AERO2G_ACI', & + long_name = 'aerosol_cloud_interaction_ng', & + units = 'kg kg-1', & + dims = MAPL_DimsHorzVert, & + vlocation = MAPL_VLocationCenter, & + datatype = MAPL_StateItem, __RC__) + +! This bundle is needed by surface for snow albedo modification +! by aerosol settling and deposition +! ~~~DEVELOPERS NOTE~~~ Change to StateItem when possible +! This will require refactoring Radiation +! -------------------------------------------------------- + call MAPL_AddExportSpec(GC, & + short_name = 'AERO2G_DP', & + long_name = 'aerosol_deposition_ng', & + units = 'kg m-2 s-1', & + dims = MAPL_DimsHorzOnly, & + datatype = MAPL_BundleItem, __RC__) + +! Add connectivities for Nitrate component +! Nitrate currently only supports one Nitrate component. Nitrate only +! uses the first active dust and sea salt instance. + if (size(self%NI%instances) > 0) then + if ((self%DU%instances(1)%is_active)) then + call MAPL_AddConnectivity (GC, SHORT_NAME = ["DU"], & + DST_ID=self%NI%instances(1)%id, & + SRC_ID=self%DU%instances(1)%id, __RC__) + end if + + if ((self%SS%instances(1)%is_active)) then + call MAPL_AddConnectivity (GC, SHORT_NAME = ["SS"] , & + DST_ID=self%NI%instances(1)%id, & + SRC_ID=self%SS%instances(1)%id, __RC__) + end if + + if ((self%SU%instances(1)%is_active)) then + call MAPL_AddConnectivity (GC, SHORT_NAME = ["SO4"] , & + DST_ID=self%NI%instances(1)%id, & + SRC_ID=self%SU%instances(1)%id, __RC__) + end if + end if + +! Set generic services +! ---------------------------------- + call MAPL_GenericSetServices (GC, __RC__) + + + RETURN_(ESMF_SUCCESS) + + end subroutine SetServices + + +!============================================================================ +!BOP + +! !IROUTINE: Initialize -- Initialize method for the composite Gridded Component + +! !INTERFACE: + + subroutine Initialize (GC, import, export, clock, RC) + +! !ARGUMENTS: + + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code + +! !DESCRIPTION: This initializes the GOCART Grid Component. It primarily creates +! its exports and births its children. + +! !REVISION HISTORY: +! 14oct2019 E.Sherman First attempt at refactoring + +!EOP +!============================================================================ + +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_GridComp), pointer :: gcs(:) + type (ESMF_State), pointer :: gex(:) + type (ESMF_Grid) :: grid + + type (ESMF_State) :: aero, aero_aci + type (ESMF_FieldBundle) :: aero_dp + + type (GOCART_State), pointer :: self + type (wrap_) :: wrap + + __Iam__('Initialize') + +!**************************************************************************** +! Begin... + +! Get the target components name and set-up traceback handle. +! ----------------------------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, name=COMP_NAME, __RC__) + Iam = trim(COMP_NAME)//'::'//'Initialize' + + if (mapl_am_i_root()) then + print *, TRIM(Iam)//': Starting...' + print *,' ' + end if + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Call Generic Initialize +! ---------------------------------------- + call MAPL_GenericInitialize (GC, import, export, clock, __RC__) + +! Get my internal state +! --------------------- + call ESMF_UserCompGetInternalState (GC, 'GOCART_State', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Get children and their export states from my generic state +! ----------------------------------------------------------- + call MAPL_Get (MAPL, gcs=gcs, gex=gex, __RC__ ) + + +! Fill AERO2G_RAD, AERO2G_ACI, and AERO2G_DP with the children's states +! ------------------------------------------------------------ + call ESMF_StateGet (export, 'AERO2G_RAD' , aero , __RC__) + call ESMF_StateGet (export, 'AERO2G_ACI' , aero_aci , __RC__) + call ESMF_StateGet (export, 'AERO2G_DP' , aero_dp , __RC__) + + +! Add children's AERO states to GOCART2G's AERO states +! Only active instances are passed to radiation +! ------------------------------------------------------ +! Active instances were created before passive instance. Summing the number of +! active instances will provide the last index for active instances within gcs +! ----------------------------------------------------------------------- + +! tot = self%n_DU + self%n_SS + ... + + call add_aero_states_(self%DU%instances(:)) + call add_aero_states_(self%SS%instances(:)) + call add_aero_states_(self%SU%instances(:)) + call add_aero_states_(self%CA%instances(:)) + call add_aero_states_(self%NI%instances(:)) + + + ! Add variables to AERO_RAD state. Used in aerosol optics calculations + call add_aero (aero, label='air_pressure_for_aerosol_optics', label2='PLE', grid=grid, typekind=MAPL_R4, __RC__) + call add_aero (aero, label='relative_humidity_for_aerosol_optics', label2='RH', grid=grid, typekind=MAPL_R4, __RC__) + call add_aero (aero, label='extinction_in_air_due_to_ambient_aerosol', label2='EXT', grid=grid, typekind=MAPL_R4, __RC__) + call add_aero (aero, label='single_scattering_albedo_of_ambient_aerosol', label2='SSA', grid=grid, typekind=MAPL_R4, __RC__) + call add_aero (aero, label='asymmetry_parameter_of_ambient_aerosol', label2='ASY', grid=grid, typekind=MAPL_R4, __RC__) + + call ESMF_AttributeSet(aero, name='band_for_aerosol_optics', value=0, __RC__) + + ! Attach the aerosol optics method + call ESMF_MethodAdd (aero, label='run_aerosol_optics', userRoutine=run_aerosol_optics, __RC__) + + RETURN_(ESMF_SUCCESS) + + contains + + subroutine add_aero_states_(instances) + type(Instance), intent(in) :: instances(:) + + type (ESMF_State) :: child_state + type (ESMF_FieldBundle) :: child_bundle + type (ESMF_Field), allocatable :: fieldList(:) + + integer :: i + integer :: id + integer :: fieldCount + __Iam__('Initialize::ad_aero_states_') + + do i = 1, size(instances) + if (.not. instances(i)%is_active) cycle + id = instances(i)%id + + call ESMF_GridCompGet (gcs(id), __RC__ ) + + call ESMF_StateGet (gex(id), trim(instances(i)%name)//'_AERO', child_state, __RC__) + call ESMF_StateAdd (aero, [child_state], __RC__) + + if (instances(i)%name(1:2) /= 'NI') then + call ESMF_StateGet (gex(id), trim(instances(i)%name)//'_AERO_ACI', child_state, __RC__) + call ESMF_StateAdd (aero_ACI, [child_state], __RC__) + call ESMF_StateGet (gex(id), trim(instances(i)%name)//'_AERO_DP', child_bundle, __RC__) + call ESMF_FieldBundleGet (child_bundle, fieldCount=fieldCount, __RC__) + allocate (fieldList(fieldCount), __STAT__) + call ESMF_FieldBundleGet (child_bundle, fieldList=fieldList, __RC__) + call ESMF_FieldBundleAdd (aero_dp, fieldList, multiflag=.true., __RC__) + deallocate(fieldList, __STAT__) + end if + end do + RETURN_(ESMF_SUCCESS) + end subroutine add_aero_states_ + + end subroutine Initialize + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!BOP +! !IROUTINE: RUN -- Run method for GOCART2G + +! !INTERFACE: + + subroutine Run1 (GC, import, export, clock, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Run method + +!EOP +!============================================================================ + +! Locals + character(len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_GridComp), pointer :: gcs(:) + type (ESMF_State), pointer :: gim(:) + type (ESMF_State), pointer :: gex(:) + type (ESMF_State) :: internal + + integer :: i + + __Iam__('Run1') + +!**************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet( GC, NAME=COMP_NAME, __RC__ ) + Iam = trim(COMP_NAME)//'::'//Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC ( GC, MAPL, RC=STATUS ) + VERIFY_(STATUS) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get ( MAPL, gcs=gcs, gim=gim, gex=gex, INTERNAL_ESMF_STATE=internal, __RC__ ) + +! Run the children +! ----------------- + do i = 1, size(gcs) + call ESMF_GridCompRun (gcs(i), importState=gim(i), exportState=gex(i), phase=1, clock=clock, __RC__) + end do + + + RETURN_(ESMF_SUCCESS) + + end subroutine Run1 + +!============================================================================ +!BOP +! !IROUTINE: RUN2 -- Run2 method for GOCART2G component + +! !INTERFACE: + + subroutine Run2 (GC, import, export, clock, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: This version uses the MAPL\_GenericSetServices. This function sets +! the Initialize and Finalize services, as well as allocating + +!EOP +!============================================================================ + +! Locals + character(len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_GridComp), pointer :: gcs(:) + type (ESMF_State), pointer :: gim(:) + type (ESMF_State), pointer :: gex(:) + type (ESMF_State) :: internal + + character(len=ESMF_MAXSTR) :: child_name + integer :: i + + __Iam__('Run2') + +!**************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet( GC, NAME=COMP_NAME, __RC__ ) + Iam = trim(COMP_NAME)//'::'//Iam + + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC ( GC, MAPL, RC=STATUS ) + VERIFY_(STATUS) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get ( MAPL, gcs=gcs, gim=gim, gex=gex, INTERNAL_ESMF_STATE=internal, __RC__ ) + +! Run the children +! ----------------- + do i = 1, size(gcs) + call ESMF_GridCompGet (gcs(i), NAME=child_name, __RC__ ) + if ((index(child_name, 'data')) == 0) then ! only execute Run2 method if a computational instance + call ESMF_GridCompRun (gcs(i), importState=gim(i), exportState=gex(i), phase=2, clock=clock, __RC__) + end if + end do + + RETURN_(ESMF_SUCCESS) + + end subroutine Run2 + + +!=============================================================================== + + subroutine getInstances_ (aerosol, myCF, species, rc) + +! Description: Fills the GOCART_State (aka, self%instance_XX) with user +! defined instances from the GOCART2G_GridComp.rc. + + implicit none + + character (len=*), intent(in ) :: aerosol + type (ESMF_Config), intent(inout) :: myCF + type(Constituent), intent(inout) :: species + integer, intent( out) :: rc + + +! locals + integer :: i + integer :: n_active + integer :: n_passive + integer :: n_instances + character (len=ESMF_MAXSTR) :: inst_name + + __Iam__('GOCART2G::getInstances_') + +!-------------------------------------------------------------------------------------- + +! Begin... + n_active = ESMF_ConfigGetLen (myCF, label='ACTIVE_INSTANCES_'//trim(aerosol)//':', __RC__) + n_passive = ESMF_ConfigGetLen (myCF, label='PASSIVE_INSTANCES_'//trim(aerosol)//':', __RC__) + n_instances = n_active + n_passive + allocate (species%instances(n_instances), __STAT__) + +! !Fill the instances list with active instances first + call ESMF_ConfigFindLabel (myCF, 'ACTIVE_INSTANCES_'//trim(aerosol)//':', __RC__) + do i = 1, n_active + call ESMF_ConfigGetAttribute (myCF, inst_name, __RC__) + species%instances(i)%name = inst_name + species%instances(i)%is_active = .true. + end do + species%n_active = n_active + +! !Now fill instances list with passive instances + call ESMF_ConfigFindLabel (myCF, 'PASSIVE_INSTANCES_'//trim(aerosol)//':', __RC__) + do i = n_active+1, n_active+n_passive + call ESMF_ConfigGetAttribute (myCF, inst_name, __RC__) + species%instances(i)%name = inst_name + species%instances(i)%is_active = .false. + end do + + + RETURN_(ESMF_SUCCESS) + + end subroutine getInstances_ + + +!==================================================================================== + subroutine createInstances_ (self, GC, rc) + +! Description: Creates GOCART2G children. Active instances must be created first. If +! additional GOCART2G children are added, this subroutine will need to be updated. + + implicit none + + type (GOCART_State), pointer, intent(in ) :: self + type (ESMF_GridComp), intent(inout) :: GC + integer, intent( out) :: rc + + ! locals + integer :: i + + __Iam__('GOCART2G::createInstances_') + +!----------------------------------------------------------------------------------- +! Begin... + +! Active instances must be created first! This ordering is necessary for +! filing the AERO states that are passed to radiation. +! This is achieved by arranging the names of the active instances first. + + call addChildren__ (gc, self%DU, setServices=DU2G_setServices, __RC__) + call addChildren__ (gc, self%SS, setServices=SS2G_setServices, __RC__) + call addChildren__ (gc, self%CA, setServices=CA2G_setServices, __RC__) + call addChildren__ (gc, self%SU, setServices=SU2G_setServices, __RC__) + call addChildren__ (gc, self%NI, setServices=NI2G_setServices, __RC__) + + RETURN_(ESMF_SUCCESS) + + contains + + subroutine addChildren__ (gc, species, setServices, rc) + + type (ESMF_GridComp), intent(inout) :: gc + type(Constituent), intent(inout) :: species + external :: setServices + integer, intent( out) :: rc + + ! local + integer :: n + + __Iam__('GOCART2G::createInstances_::addChildren__') + + n=size(species%instances) + + do i = 1, n + species%instances(i)%id = MAPL_AddChild(gc, name=species%instances(i)%name, SS=SetServices, __RC__) + end do + + RETURN_(ESMF_SUCCESS) + + end subroutine addChildren__ + + end subroutine createInstances_ + + +!=================================================================================== + subroutine run_aerosol_optics (state, rc) + + implicit none + +! !ARGUMENTS: + type (ESMF_State) :: state + integer, intent(out) :: rc + +! !Local + real, dimension(:,:,:), pointer :: ple + real, dimension(:,:,:), pointer :: rh + real, dimension(:,:,:), pointer :: var + + character (len=ESMF_MAXSTR) :: fld_name + + real(kind=8), dimension(:,:,:),pointer :: ext_, ssa_, asy_ ! (lon:,lat:,lev:) + real(kind=8), dimension(:,:,:), allocatable :: ext, ssa, asy ! (lon:,lat:,lev:) + + integer :: i, n, b, j + integer :: i1, j1, i2, j2, km + integer :: band + integer, parameter :: n_bands = 1 + + character (len=ESMF_MAXSTR), allocatable :: itemList(:), aeroList(:) + type (ESMF_State) :: child_state + real, pointer, dimension(:,:,:) :: as_ptr_3d + + type (ESMF_StateItem_Flag), allocatable :: itemTypes(:) + + __Iam__('GOCART2G::run_aerosol_optics') + + +! Begin... + +! Radiation band +! -------------- + call ESMF_AttributeGet(state, name='band_for_aerosol_optics', value=band, __RC__) + +! Relative humidity +! ----------------- + call ESMF_AttributeGet(state, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, RH, trim(fld_name), __RC__) + +! Pressure at layer edges +! ------------------------ + call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, PLE, trim(fld_name), __RC__) + + i1 = lbound(ple, 1); i2 = ubound(ple, 1) + j1 = lbound(ple, 2); j2 = ubound(ple, 2) + km = ubound(ple, 3) + + + allocate(ext(i1:i2,j1:j2,km), & + ssa(i1:i2,j1:j2,km), & + asy(i1:i2,j1:j2,km), __STAT__) + + +! Get list of child states within state and add to aeroList +! --------------------------------------------------------- + call ESMF_StateGet (state, itemCount=n, __RC__) + allocate (itemList(n), __STAT__) + allocate (itemTypes(n), __STAT__) + call ESMF_StateGet (state, itemNameList=itemList, itemTypeList=itemTypes, __RC__) + + b=0 + do i = 1, n + if (itemTypes(i) == ESMF_StateItem_State) then + b = b + 1 + end if + end do + + allocate (aeroList(b), __STAT__) + + j = 1 + do i = 1, n + if (itemTypes(i) == ESMF_StateItem_State) then + aeroList(j) = trim(itemList(i)) + j = j + 1 + end if + end do + + ext = 0.0d0 + ssa = 0.0d0 + asy = 0.0d0 + +! ! Get aerosol optic properties from children + do i = 1, size(aeroList) + call ESMF_StateGet(state, trim(aeroList(i)), child_state, __RC__) + +! ! set RH in child's aero state + call ESMF_AttributeGet(child_state, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) + + if (fld_name /= '') then + call MAPL_GetPointer(child_state, as_ptr_3d, trim(fld_name), __RC__) + as_ptr_3d = rh + end if + +! ! set PLE in child's aero state + call ESMF_AttributeGet(child_state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) + + if (fld_name /= '') then + call MAPL_GetPointer(child_state, as_ptr_3d, trim(fld_name), __RC__) + as_ptr_3d = ple + end if + +! ! set band in child's aero state + call ESMF_AttributeSet(child_state, name='band_for_aerosol_optics', value=band, __RC__) + +! ! execute the aerosol optics method + call ESMF_MethodExecute(child_state, label="aerosol_optics", __RC__) + +! ! Retrieve extinction from each child + call ESMF_AttributeGet(child_state, name='extinction_in_air_due_to_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(child_state, ext_, trim(fld_name), __RC__) + end if + +! ! Retrieve scattering extinction from each child + call ESMF_AttributeGet(child_state, name='single_scattering_albedo_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(child_state, ssa_, trim(fld_name), __RC__) + end if + +! ! Retrieve asymetry parameter multiplied by scatering extiction from each child + call ESMF_AttributeGet(child_state, name='asymmetry_parameter_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(child_state, asy_, trim(fld_name), __RC__) + end if + +! ! Sum aerosol optic properties from each child + ext = ext + ext_ + ssa = ssa + ssa_ + asy = asy + asy_ + + end do + + +! ! Set ext, ssa, asy to equal the sum of ext, ssa, asy from the children. This is what is passed to radiation. + call ESMF_AttributeGet(state, name='extinction_in_air_due_to_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ext(:,:,:) + end if + + call ESMF_AttributeGet(state, name='single_scattering_albedo_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ssa(:,:,:) + end if + + call ESMF_AttributeGet(state, name='asymmetry_parameter_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = asy(:,:,:) + end if + + deallocate(ext, ssa, asy, __STAT__) + + + + RETURN_(ESMF_SUCCESS) + + end subroutine run_aerosol_optics + + +end module GOCART2G_GridCompMod + + + + + + diff --git a/ESMF/GOCART2G_GridComp/NI2G_GridComp/CMakeLists.txt b/ESMF/GOCART2G_GridComp/NI2G_GridComp/CMakeLists.txt new file mode 100644 index 00000000..67ab876a --- /dev/null +++ b/ESMF/GOCART2G_GridComp/NI2G_GridComp/CMakeLists.txt @@ -0,0 +1,17 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES GA_GridComp MAPL Chem_Shared2G Process_Library) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +#esma_generate_gocart_code (${this} "-B\;-E\;-N\;DU2G") +mapl_acg (${this} NI2G_StateSpecs.rc + IMPORT_SPECS EXPORT_SPECS INTERNAL_SPECS + GET_POINTERS DECLARE_POINTERS) + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridCompMod.F90 new file mode 100644 index 00000000..adf21c46 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridCompMod.F90 @@ -0,0 +1,1356 @@ +#include "MAPL_Generic.h" + +!============================================================================= +!BOP + +! !MODULE: NI2G_GridCompMod - GOCART Nitrate gridded component + +! !INTERFACE: +module NI2G_GridCompMod + +! !USES: + use ESMF + use MAPL + use Chem_MieTableMod2G + use Chem_AeroGeneric + use iso_c_binding, only: c_loc, c_f_pointer, c_ptr + + use GOCART2G_Process ! GOCART2G process library + use GA_GridCompMod + + implicit none + private + + integer, parameter :: instanceComputational = 1 + integer, parameter :: instanceData = 2 + + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + real, parameter :: fMassHNO3 = 63., fMassNO3 = 62., fMassAir = 29. + integer, parameter :: nNH3 = 1 + integer, parameter :: nNH4a = 2 + integer, parameter :: nNO3an1 = 3 + integer, parameter :: nNO3an2 = 4 + integer, parameter :: nNO3an3 = 5 + +! !PUBLIC MEMBER FUNCTIONS: + PUBLIC SetServices + +real, parameter :: chemgrav = 9.80616 +real, parameter :: cpd = 1004.16 + +! !DESCRIPTION: This module implements GOCART's Nitrate (NI) Gridded Component. + +! !REVISION HISTORY: +! 01July2020 Sherman, da Silva, Darmenov, Clune - First attempt at refactoring. + +!EOP +!=========================================================================== + +! !Nitrate state + type, extends(GA_GridComp) :: NI2G_GridComp + logical :: first + logical :: recycle_HNO3 = .false. + real, allocatable :: xhno3(:,:,:) ! buffer for NITRATE_HNO3 [kg/(m^2 sec)] + real, allocatable :: rmedDU(:), rmedSS(:) ! DU and SS radius + real, allocatable :: fnumDU(:), fnumSS(:) ! DU and SS particles per kg mass + end type NI2G_GridComp + + type wrap_ + type (NI2G_GridComp), pointer :: PTR => null() + end type wrap_ + +contains + +!============================================================================ +!BOP + +! !IROUTINE: SetServices + +! !INTERFACE: + subroutine SetServices ( GC, RC ) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(INOUT) :: GC ! gridded component + integer, intent( OUT) :: RC ! return code + +! DESCRIPTION: This version uses MAPL_GenericSetServices, which sets +! the Initialize and Finalize services to generic versions. It also +! allocates our instance of a generic state and puts it in the +! gridded component (GC). Here we only set the two-stage run method +! and declare the data services. + +! !REVISION HISTORY: +! 24oct2019 E.Sherman, A.Da Silva, A.Darmenov, T.Clune First attempt at refactoring + +!EOP +!============================================================================ +! + +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (ESMF_Config) :: cfg + type (wrap_) :: wrap + type (NI2G_GridComp), pointer :: self + + real :: DEFVAL + logical :: data_driven=.true. + + __Iam__('SetServices') + +!**************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' // Iam + +if(mapl_am_i_root()) print*,trim(comp_name),' SetServices BEGIN' + +! Wrap internal state for storing in GC +! ------------------------------------- + allocate (self, __STAT__) + wrap%ptr => self + +! Load resource file +! ------------------- + cfg = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (cfg, 'NI2G_GridComp_'//trim(COMP_NAME)//'.rc', rc=status) + if (status /= 0) then + if (mapl_am_i_root()) print*,'NI2G_GridComp_'//trim(COMP_NAME)//'.rc does not exist! Loading NI2G_GridComp_NI.rc instead' + call ESMF_ConfigLoadFile (cfg, 'NI2G_GridComp_NI.rc', __RC__) + end if + + ! process generic config items + call self%GA_GridComp%load_from_config( cfg, __RC__) + +! Is NI data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Set entry points +! ------------------------ + call MAPL_GridCompSetEntryPoint (GC, ESMF_METHOD_INITIALIZE, Initialize, __RC__) + call MAPL_GridCompSetEntryPoint (GC, ESMF_METHOD_RUN, Run, __RC__) + if (data_driven .neqv. .true.) then + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Run, Run2, __RC__) + end if + + DEFVAL = 0.0 + +! Import and Internal states if data instance +! ------------------------------------------- + if (data_driven) then + +! Pressure at layer edges +! ----------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'PLE', & + LONG_NAME = 'air_pressure', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + +! RH: is between 0 and 1 +! ---------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'RH2', & + LONG_NAME = 'Rel_Hum_after_moist', & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddInternalSpec(gc,& + & short_name='NO3an1', & + & long_name='Nitrate size bin 001', & + & units='kg kg-1', & + & dims=MAPL_DimsHorzVert, & + & vlocation=MAPL_VlocationCenter, & + & restart=MAPL_RestartOptional, & + & friendlyto='DYNAMICS:TURBULENCE:MOIST', & + & add2export=.true., __RC__) + + call MAPL_AddInternalSpec(gc,& + & short_name='NO3an2', & + & long_name='Nitrate size bin 002', & + & units='kg kg-1', & + & dims=MAPL_DimsHorzVert, & + & vlocation=MAPL_VlocationCenter, & + & restart=MAPL_RestartOptional, & + & friendlyto='DYNAMICS:TURBULENCE:MOIST', & + & add2export=.true., __RC__) + + call MAPL_AddInternalSpec(gc,& + & short_name='NO3an3', & + & long_name='Nitrate size bin 003', & + & units='kg kg-1', & + & dims=MAPL_DimsHorzVert, & + & vlocation=MAPL_VlocationCenter, & + & restart=MAPL_RestartOptional, & + & friendlyto='DYNAMICS:TURBULENCE:MOIST', & + & add2export=.true., __RC__) + + call MAPL_AddImportSpec(gc,& + short_name='climNO3an1', & + long_name='Nitrate size bin 001', & + units='kg kg-1', & + dims=MAPL_DimsHorzVert, & + vlocation=MAPL_VlocationCenter, & + restart=MAPL_RestartOptional, __RC__) + + call MAPL_AddImportSpec(gc,& + short_name='climNO3an2', & + long_name='Nitrate size bin 002', & + units='kg kg-1', & + dims=MAPL_DimsHorzVert, & + vlocation=MAPL_VlocationCenter, & + restart=MAPL_RestartOptional, __RC__) + + call MAPL_AddImportSpec(gc,& + short_name='climNO3an3', & + long_name='Nitrate size bin 003', & + units='kg kg-1', & + dims=MAPL_DimsHorzVert, & + vlocation=MAPL_VlocationCenter, & + restart=MAPL_RestartOptional, __RC__) + end if ! (data_driven) + + +! Import, Export, Internal states for computational instance +! ---------------------------------------------------------- + if (.not. data_driven) then +#include "NI2G_Export___.h" +#include "NI2G_Import___.h" +#include "NI2G_Internal___.h" + end if + + +! This state holds fields needed by radiation +! --------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME = trim(COMP_NAME)//'_AERO', & + LONG_NAME = 'aerosols_from_'//trim(COMP_NAME), & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + DATATYPE = MAPL_StateItem, __RC__) + +! This state is needed by MOIST - It will contain aerosols +! ---------------------------------------------------------- +! call MAPL_AddExportSpec(GC, & +! SHORT_NAME = trim(COMP_NAME)//'_AERO_ACI', & +! LONG_NAME = 'aerosol_cloud_interaction_aerosols_from_'//trim(COMP_NAME), & +! UNITS = 'kg kg-1', & +! DIMS = MAPL_DimsHorzVert, & +! VLOCATION = MAPL_VLocationCenter, & +! DATATYPE = MAPL_StateItem, __RC__) + +! This bundle is needed by surface for snow albedo modification +! by aerosol settling and deposition +! DEVELOPMENT NOTE - Change to StateItem in future +! --------------------------------------------------------------- +! call MAPL_AddExportSpec(GC, & +! SHORT_NAME = trim(COMP_NAME)//'_AERO_DP', & +! LONG_NAME = 'aerosol_deposition_from_'//trim(COMP_NAME), & +! UNITS = 'kg m-2 s-1', & +! DIMS = MAPL_DimsHorzOnly, & +! DATATYPE = MAPL_BundleItem, __RC__) + + +! Store internal state in GC +! -------------------------- + call ESMF_UserCompSetInternalState ( GC, 'NI2G_GridComp', wrap, STATUS ) + VERIFY_(STATUS) + +! Set generic services +! ---------------------------------- + call MAPL_GenericSetServices (GC, __RC__) + + +if(mapl_am_i_root()) print*,trim(comp_name),' SetServices END' + + RETURN_(ESMF_SUCCESS) + + end subroutine SetServices + + + +!============================================================================ +!BOP + +! !IROUTINE: Initialize + +! !INTERFACE: + subroutine Initialize (GC, IMPORT, EXPORT, CLOCK, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: IMPORT ! Import state + type (ESMF_State), intent(inout) :: EXPORT ! Export state + type (ESMF_Clock), intent(inout) :: CLOCK ! The clock + integer, optional, intent( out) :: RC ! Error code + +! !DESCRIPTION: This initializes the Nitrate gridded component. It primaryily +! fills GOCART's AERO states with its nitrate fields. + +! !REVISION HISTORY: +! 30June2020 E.Sherman First attempt at refactoring + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_Grid) :: grid + type (ESMF_State) :: internal + type (ESMF_State) :: aero, aero_aci + type (ESMF_State) :: providerState + type (ESMF_Config) :: cfg + type (ESMF_FieldBundle) :: Bundle_DP + type (wrap_) :: wrap + type (NI2G_GridComp), pointer :: self + + integer, allocatable :: mieTable_pointer(:) + integer :: i, dims(3), km + integer :: instance + type (ESMF_Field) :: field, fld + character (len=ESMF_MAXSTR) :: prefix + real :: CDT ! chemistry timestep (secs) + integer :: HDT ! model timestep (secs) + real, pointer, dimension(:,:,:) :: int_ptr + logical :: data_driven + integer :: NUM_BANDS + character (len=ESMF_MAXSTR), allocatable :: aerosol_names(:) + real, pointer, dimension(:,:,:) :: ple + real, pointer, dimension(:,:) :: area + + type(ESMF_Calendar) :: calendar + type(ESMF_Time) :: currentTime + type(ESMF_Alarm) :: alarm_HNO3 + type(ESMF_Time) :: ringTime + type(ESMF_TimeInterval) :: ringInterval + integer :: year, month, day, hh, mm, ss + + real, dimension(4) :: Vect_Hcts +! real, allocatable, dimension(:) :: rmedDU, rmedSS, fnumDU, fnumSS + integer :: itemCount + + __Iam__('Initialize') + +!**************************************************************************** +! Begin... + +! Get the target components name and set-up traceback handle. +! ----------------------------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, name=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' //trim(Iam) + +if(mapl_am_i_root()) print*,trim(comp_name),' Init BEGIN' + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get my internal private state +! ----------------------------- + call ESMF_UserCompGetInternalState(GC, 'NI2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Get dimensions +! --------------- + call MAPL_GridGet (grid, globalCellCountPerDim=dims, __RC__ ) + km = dims(3) + self%km = km + + allocate(self%xhno3(dims(1),dims(2),dims(3)), __STAT__) + +! Get DTs +! ------- + call MAPL_GetResource(mapl, HDT, Label='RUN_DT:', __RC__) + call MAPL_GetResource(mapl, CDT, Label='GOCART_DT:', default=real(HDT), __RC__) + self%CDT = CDT + +! Load resource file and get number of bins +! ------------------------------------------- + cfg = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (cfg, 'NI2G_GridComp_'//trim(COMP_NAME)//'.rc', rc=status) + if (status /= 0) then + if (mapl_am_i_root()) print*,'NI2G_GridComp_'//trim(COMP_NAME)//'.rc does not exist! & + loading NI2G_GridComp_NI.rc instead' + call ESMF_ConfigLoadFile( cfg, 'NI2G_GridComp_NI.rc', __RC__) + end if + + self%first = .true. + +! Call Generic Initialize +! ---------------------------------------- + call MAPL_GenericInitialize (GC, import, export, clock, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get ( mapl, INTERNAL_ESMF_STATE = internal, __RC__) + +! Is NI data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Get DU and SS attribute information for use in heterogenous chemistry + if (.not. data_driven) then + call ESMF_StateGet(import, 'DU', field, __RC__) + call ESMF_AttributeGet(field, name='radius', itemCount=itemCount, __RC__) + allocate(self%rmedDU(itemCount), __STAT__) + allocate(self%fnumDU(itemCount), __STAT__) + call ESMF_AttributeGet(field, name='radius', valueList=self%rmedDU, __RC__) + call ESMF_AttributeGet(field, name='fnum', valueList=self%fnumDU, __RC__) + + call ESMF_StateGet(import, 'SS', field, __RC__) + call ESMF_AttributeGet(field, name='radius', itemCount=itemCount, __RC__) + allocate(self%rmedSS(itemCount), __STAT__) + allocate(self%fnumSS(itemCount), __STAT__) + call ESMF_AttributeGet(field, name='radius', valueList=self%rmedSS, __RC__) + call ESMF_AttributeGet(field, name='fnum', valueList=self%fnumSS, __RC__) + end if + +! Se HNO3 recycle alarm + if (.not. data_driven) then + call ESMF_ClockGet(clock, calendar=calendar, currTime=currentTime, __RC__) + call ESMF_TimeGet(currentTime, YY=year, MM=month, DD=day, H=hh, M=mm, S=ss, __RC__) + call ESMF_TimeSet(ringTime, YY=year, MM=month, DD=day, H=0, M=0, S=0, __RC__) + call ESMF_TimeIntervalSet(ringInterval, H=3, calendar=calendar, __RC__) + + do while (ringTime < currentTime)! DO WE NEED THIS? + ringTime = currentTime + ringInterval + end do + + alarm_HNO3 = ESMF_AlarmCreate(Clock = clock, & + Name = 'HNO3_RECYCLE_ALARM', & + RingInterval = ringInterval, & + RingTime = currentTime, & + Enabled = .true. , & + Sticky = .false. , __RC__) + end if + +! If this is a data component, the data is provided in the import +! state via ExtData instead of the actual GOCART children +! ---------------------------------------------------------------- + if ( data_driven ) then + providerState = import + prefix = 'clim' + else + providerState = export + prefix = '' + end if + + if (.not. data_driven) then + call ESMF_StateGet (internal, 'NH3', field, __RC__) + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(1), __RC__) + call get_HenrysLawCts('NH3',Vect_Hcts(1),Vect_Hcts(2),Vect_Hcts(3),Vect_Hcts(4),__RC__) + call ESMF_AttributeSet(field, 'SetofHenryLawCts', Vect_Hcts, __RC__) + + call ESMF_StateGet (internal, 'NH4a', field, __RC__) + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(2), __RC__) +! end if + +! Set klid + call MAPL_GetPointer(import, ple, 'PLE', __RC__) + call findKlid (self%klid, self%plid, ple, __RC__) + end if + +! Fill AERO State with N03an(1,2,3) fields +! ---------------------------------------- + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO' , aero , __RC__) + + call ESMF_StateGet (internal, 'NO3an1', field, __RC__) + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(3), __RC__) + fld = MAPL_FieldCreate (field, 'NO3an1', __RC__) + call MAPL_StateAdd (aero, fld, __RC__) + + if (.not. data_driven) then +! Set internal NO3an1 values to 0 where above klid + call MAPL_GetPointer (internal, int_ptr, 'NO3an1', __RC__) + call setZeroKlid(self%km, self%klid, int_ptr) + end if + + call ESMF_StateGet (internal, 'NO3an2', field, __RC__) + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(4), __RC__) + fld = MAPL_FieldCreate (field, 'NO3an2', __RC__) + call MAPL_StateAdd (aero, fld, __RC__) + + if (.not. data_driven) then +! Set internal NO3an2 values to 0 where above klid + call MAPL_GetPointer (internal, int_ptr, 'NO3an2', __RC__) + call setZeroKlid(self%km, self%klid, int_ptr) + end if + + call ESMF_StateGet (internal, 'NO3an3', field, __RC__) + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(5), __RC__) + fld = MAPL_FieldCreate (field, 'NO3an3', __RC__) + call MAPL_StateAdd (aero, fld, __RC__) + + if (.not. data_driven) then +! Set internal NO3an3 values to 0 where above klid + call MAPL_GetPointer (internal, int_ptr, 'NO3an3', __RC__) + call setZeroKlid(self%km, self%klid, int_ptr) + end if + + if (data_driven) then + instance = instanceData + else + instance = instanceComputational + end if + + self%instance = instance + +! Create Radiation Mie Table +! -------------------------- + call MAPL_GetResource (MAPL, NUM_BANDS, 'NUM_BANDS:', __RC__) + +! Get file names for the optical tables + call ESMF_ConfigGetAttribute (cfg, self%rad_MieTable(instance)%optics_file, & + label="aerosol_radBands_optics_file:", __RC__ ) + + allocate (self%rad_MieTable(instance)%channels(NUM_BANDS), __STAT__ ) + + call ESMF_ConfigGetAttribute (cfg, self%rad_MieTable(instance)%channels, label= "BANDS:", & + count=self%rad_MieTable(instance)%nch, rc=status) + + if (rc /= 0) then + do i = 1, NUM_BANDS + self%rad_MieTable(instance)%channels(i) = i + end do + end if + + allocate (self%rad_MieTable(instance)%mie_aerosol, __STAT__) + self%rad_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%rad_MieTable(instance)%optics_file, rc) + call Chem_MieTableRead (self%rad_MieTable(instance)%mie_aerosol, NUM_BANDS, self%rad_MieTable(instance)%channels, rc) + +! Create Diagnostics Mie Table +! ----------------------------- +! Get file names for the optical tables + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%optics_file, & + label="aerosol_monochromatic_optics_file:", __RC__ ) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%nch, label="n_channels:", __RC__) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%nmom, label="n_moments:", default=0, __RC__) + allocate (self%diag_MieTable(instance)%channels(self%diag_MieTable(instance)%nch), __STAT__ ) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%channels, & + label="aerosol_monochromatic_optics_wavelength:", __RC__) + allocate (self%diag_MieTable(instance)%mie_aerosol, __STAT__) + self%diag_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%diag_MieTable(instance)%optics_file, __RC__ ) + call Chem_MieTableRead (self%diag_MieTable(instance)%mie_aerosol, self%diag_MieTable(instance)%nch, & + self%diag_MieTable(instance)%channels, rc, nmom=self%diag_MieTable(instance)%nmom) + + ! Mie Table instance/index + call ESMF_AttributeSet(aero, name='mie_table_instance', value=instance, __RC__) + + ! Add variables to NI instance's aero state. This is used in aerosol optics calculations + call add_aero (aero, label='air_pressure_for_aerosol_optics', label2='PLE', grid=grid, typekind=MAPL_R4, __RC__) + call add_aero (aero, label='relative_humidity_for_aerosol_optics', label2='RH', grid=grid, typekind=MAPL_R4,__RC__) +! call ESMF_StateGet (import, 'PLE', field, __RC__) +! call MAPL_StateAdd (aero, field, __RC__) +! call ESMF_StateGet (import, 'RH2', field, __RC__) +! call MAPL_StateAdd (aero, field, __RC__) + + call add_aero (aero, label='extinction_in_air_due_to_ambient_aerosol', label2='EXT', grid=grid, typekind=MAPL_R8,__RC__) + call add_aero (aero, label='single_scattering_albedo_of_ambient_aerosol', label2='SSA', grid=grid, typekind=MAPL_R8,__RC__) + call add_aero (aero, label='asymmetry_parameter_of_ambient_aerosol', label2='ASY', grid=grid, typekind=MAPL_R8,__RC__) + + call ESMF_AttributeSet(aero, name='band_for_aerosol_optics', value=0, __RC__) + + mieTable_pointer = transfer(c_loc(self), [1]) + call ESMF_AttributeSet(aero, name='mieTable_pointer', valueList=mieTable_pointer, itemCount=size(mieTable_pointer), __RC__) + +! call ESMF_AttributeSet(aero, name='internal_varaible_name', value='SS', __RC__) + allocate(aerosol_names(3), __STAT__) + aerosol_names(1) = 'NO3an1' + aerosol_names(2) = 'NO3an2' + aerosol_names(3) = 'NO3an3' + call ESMF_AttributeSet(aero, name='internal_varaible_name', valueList=aerosol_names, & + itemCount=size(aerosol_names), __RC__) + + call ESMF_MethodAdd(AERO, label='aerosol_optics', userRoutine=aerosol_optics, __RC__) + + RETURN_(ESMF_SUCCESS) + + end subroutine Initialize + +!============================================================================ + +!BOP +! !IROUTINE: Run + +! !INTERFACE: + subroutine Run (GC, import, export, clock, rc) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: rc ! Error code: + +! !DESCRIPTION: Run method for the Sea Salt Grid Component. Determines whether to run +! data or computational run method. + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_State) :: internal + + logical :: data_driven + + __Iam__('Run') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'// Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=internal, __RC__) + +! Is NI data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Update INTERNAL state variables with ExtData +! --------------------------------------------- + if (data_driven) then + call Run_data (GC, import, export, internal, __RC__) + else + call Run1 (GC, import, export, clock, __RC__) + end if + + RETURN_(ESMF_SUCCESS) + + end subroutine Run + +!============================================================================ +!BOP +! !IROUTINE: Run1 + +! !INTERFACE: + subroutine Run1 (GC, import, export, clock, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Computes emissions/sources for Nitrate + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: mapl + type (ESMF_State) :: internal + type (ESMF_Grid) :: grid + type (wrap_) :: wrap + type (NI2G_GridComp), pointer :: self + +#include "NI2G_DeclarePointer___.h" + + __Iam__('Run1') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, NAME=comp_name, __RC__) + Iam = trim(comp_name) //'::'// Iam + +!if(mapl_am_i_root()) print*,trim(comp_name),'2G Run1 BEGIN' + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, mapl, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (mapl, INTERNAL_ESMF_STATE=internal, __RC__) + +#include "NI2G_GetPointer___.h" + +!if(mapl_am_i_root()) print*,'NI2G Run1 BEGIN sum(NH3) = ',sum(NH3) +!if(mapl_am_i_root()) print*,'NI2G Run1 BEGIN sum(NH4a) = ',sum(NH4a) + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'NI2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +!if(mapl_am_i_root()) print*,'NI2G Run1 BEGIN sum(self%xhno3) = ',sum(self%xhno3) + +! NH3 Emissions +! ------------- + if (associated(NH3EM)) then + NH3EM = 0. + if (associated(EMI_NH3_BB)) NH3EM = NH3EM + EMI_NH3_BB + if (associated(EMI_NH3_AG)) NH3EM = NH3EM + EMI_NH3_AG + if (associated(EMI_NH3_EN)) NH3EM = NH3EM + EMI_NH3_EN + if (associated(EMI_NH3_RE)) NH3EM = NH3EM + EMI_NH3_RE + if (associated(EMI_NH3_TR)) NH3EM = NH3EM + EMI_NH3_TR + if (associated(EMI_NH3_IN)) NH3EM = NH3EM + EMI_NH3_IN + if (associated(EMI_NH3_OC)) NH3EM = NH3EM + EMI_NH3_OC + end if + + if (associated(EMI_NH3_BB)) & + NH3(:,:,self%km) = NH3(:,:,self%km)+self%cdt*chemgrav/delp(:,:,self%km)*EMI_NH3_BB + if (associated(EMI_NH3_AG)) & + NH3(:,:,self%km) = NH3(:,:,self%km)+self%cdt*chemgrav/delp(:,:,self%km)*EMI_NH3_AG + if (associated(EMI_NH3_EN)) & + NH3(:,:,self%km) = NH3(:,:,self%km)+self%cdt*chemgrav/delp(:,:,self%km)*EMI_NH3_EN + if (associated(EMI_NH3_IN)) & + NH3(:,:,self%km) = NH3(:,:,self%km)+self%cdt*chemgrav/delp(:,:,self%km)*EMI_NH3_IN + if (associated(EMI_NH3_RE)) & + NH3(:,:,self%km) = NH3(:,:,self%km)+self%cdt*chemgrav/delp(:,:,self%km)*EMI_NH3_RE + if (associated(EMI_NH3_TR)) & + NH3(:,:,self%km) = NH3(:,:,self%km)+self%cdt*chemgrav/delp(:,:,self%km)*EMI_NH3_TR + if (associated(EMI_NH3_OC)) & + NH3(:,:,self%km) = NH3(:,:,self%km)+self%cdt*chemgrav/delp(:,:,self%km)*EMI_NH3_OC + + +!if(mapl_am_i_root()) print*,'NI2G sum(DU)',sum(DU) + +!if(mapl_am_i_root()) print*,'NI2G Run1 END sum(NH3) = ',sum(NH3) +!if(mapl_am_i_root()) print*,'NI2G Run1 END sum(NH4a) = ',sum(NH4a) +!if(mapl_am_i_root()) print*,'NI2G Run1 END sum(self%xhno3) = ',sum(self%xhno3) +!if(mapl_am_i_root()) print*,trim(comp_name),'2G Run1 END' + + + RETURN_(ESMF_SUCCESS) + + end subroutine Run1 + + +!============================================================================ +!BOP +! !IROUTINE: Run2 + +! !INTERFACE: + + subroutine Run2 (GC, import, export, clock, RC) + + ! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Run2 method for the Dust Grid Component. + +!EOP +!============================================================================ +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_State) :: internal + type (wrap_) :: wrap + type (NI2G_GridComp), pointer :: self + + real, allocatable, dimension(:,:) :: drydepositionfrequency, dqa + real :: fwet + logical :: KIN + real, pointer, dimension(:,:) :: fluxout + real, pointer, dimension(:,:,:) :: fluxoutWT + real, allocatable, dimension(:,:,:,:) :: aerosol + +! character(len=15) :: ind + + type (ESMF_ALARM) :: alarm + logical :: alarm_is_ringing + + integer :: rhFlag + +integer :: i,j +!real :: rmedDU(5), rmedSS(5), fnumDU(5), fnumSS(5) + +#include "NI2G_DeclarePointer___.h" + + __Iam__('Run2') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' // Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=INTERNAL, __RC__) + +#include "NI2G_GetPointer___.h" + +!if(mapl_am_i_root()) print*,trim(comp_name),'2G Run2 BEGIN' + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'NI2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + + allocate(dqa, mold=lwi, __STAT__) + allocate(drydepositionfrequency, mold=lwi, __STAT__) + +! check hno3 alarm + call ESMF_ClockGetAlarm(clock, 'HNO3_RECYCLE_ALARM', alarm, __RC__) + alarm_is_ringing = ESMF_AlarmIsRinging(alarm, __RC__) + +! Save local copy of HNO3 for first pass through run method regardless + if (self%first) then + self%xhno3 = MAPL_UNDEF + self%first = .false. +!if(mapl_am_i_root()) print*,'NI2G TEST1' + end if + +! Recycle HNO3 every 3 hours + if (alarm_is_ringing) then + self%xhno3 = NITRATE_HNO3 + call ESMF_AlarmRingerOff(alarm, __RC__) +!if(mapl_am_i_root()) print*,'NI2G recycle alarm TRUE' +!if(mapl_am_i_root()) print*,'NI recycle alarm sum(self%xhno3)',sum(self%xhno3) + end if + +!if(mapl_am_i_root()) print*,'NI2G Run2 BEGIN sum(NH3) = ',sum(NH3) +!if(mapl_am_i_root()) print*,'NI2G Run2 BEGIN sum(NH4a) = ',sum(NH4a) +!if(mapl_am_i_root()) print*,'NI2G Run2 BEGIN sum(hno3) = ',sum(nitrate_hno3) +!if(mapl_am_i_root()) print*,'NI2G Run2 BEGIN before sum(self%xhno3) = ',sum(self%xhno3) +!if(mapl_am_i_root()) print*,'NI2G sum(DU) = ',sum(DU) +!if(mapl_am_i_root()) print*,'NI2G sum(SS) = ',sum(SS) + +! This could be in incorrect alarm. This alarm is currently for HNO3_RECYCLE_ALARM, but a +! new alarm might need to be created just for this GC, or all of gocart2g? +!RUN_ALARM: if (alarm_is_ringing) then + + if (associated(NIPNO3AQ)) NIPNO3AQ(:,:) = 0. + if (associated(NIPNH4AQ)) NIPNH4AQ(:,:) = 0. + if (associated(NIPNH3AQ)) NIPNH3AQ(:,:) = 0. + +!if(mapl_am_i_root()) print*,'NI2G before thermo sum(NH3) = ',sum(NH3) +!if(mapl_am_i_root()) print*,'NI2G before thermo sum(NO3an1) = ',sum(NO3an1) +!if(mapl_am_i_root()) print*,'NI2G before thermo sum(NH4a) = ',sum(NH4a) +!if(mapl_am_i_root()) print*,'NI2G before sum(SO4) = ',sum(SO4) + + call NIthermo (self%km, self%klid, self%cdt, chemgrav, delp, airdens, t, rh2, fMassHNO3, fMassAir, & + SO4, NH3, NO3an1, NH4a, self%xhno3, NIPNO3AQ, NIPNH4AQ, NIPNH3AQ, rc) + +!if(mapl_am_i_root()) print*,'NI2G after thermo sum(NH3) = ',sum(NH3) +!if(mapl_am_i_root()) print*,'NI2G after thermo sum(NO3an1) = ',sum(NO3an1) +!if(mapl_am_i_root()) print*,'NI2G after thermo sum(NH4a) = ',sum(NH4a) +!if(mapl_am_i_root()) print*,'NI2G after thermo sum(xhno3) = ',sum(self%xhno3) +!if(mapl_am_i_root()) print*,'NI2G sum(NIPNO3AQ) = ',sum(NIPNO3AQ) +!if(mapl_am_i_root()) print*,'NI2G sum(NIPNH4AQ) = ',sum(NIPNH4AQ) +!if(mapl_am_i_root()) print*,'NI2G sum(NIPNH3AQ) = ',sum(NIPNH3AQ) + +! call NIheterogenousChem (NIHT, self%xhno3, MAPL_AVOGAD, MAPL_AIRMW, MAPL_PI, MAPL_RUNIV, & + call NIheterogenousChem (NIHT, self%xhno3, MAPL_AVOGAD, MAPL_AIRMW, MAPL_PI, MAPL_RUNIV/1000., & + airdens, t, rh2, delp, DU, SS, self%rmedDU*1.e-6, self%rmedSS*1.e-6, & + self%fnumDU, self%fnumSS, 5, 5, self%km, self%klid, self%cdt, chemgrav, fMassHNO3, & + fMassNO3, fmassair, NO3an1, NO3an2, NO3an3, HNO3CONC, HNO3SMASS, & + HNO3CMASS, rc) + +!if(mapl_am_i_root()) print*,'NI2G sum(NIHT(:,:,1)) = ',sum(NIHT(:,:,1)) +!if(mapl_am_i_root()) print*,'NI2G sum(NIHT(:,:,2)) = ',sum(NIHT(:,:,2)) +!if(mapl_am_i_root()) print*,'NI2G sum(NIHT(:,:,3)) = ',sum(NIHT(:,:,3)) +!if(mapl_am_i_root()) print*,'NI2G sum(NO3an1) = ',sum(NO3an1) +!if(mapl_am_i_root()) print*,'NI2G sum(NO3an2) = ',sum(NO3an2) +!if(mapl_am_i_root()) print*,'NI2G sum(NO3an3) = ',sum(NO3an3) +!if(mapl_am_i_root()) print*,'NI2G sum(HNO3CONC) = ',sum(HNO3CONC) +!if(mapl_am_i_root()) print*,'NI2G sum(HNO3SMASS) = ',sum(HNO3SMASS) +!if(mapl_am_i_root()) print*,'NI2G sum(HNO3CMASS) = ',sum(HNO3CMASS) + +!if(mapl_am_i_root()) print*,'NI2G after hetchem sum(NH3) = ',sum(NH3) +!if(mapl_am_i_root()) print*,'NI2G after hetchem sum(NH4a) = ',sum(NH4a) +!if(mapl_am_i_root()) print*,'NI2G after hetchem sum(xhno3) = ',sum(self%xhno3) + +!if(mapl_am_i_root()) print*,'NI2G NH4a array = ',NH4a + +! NI Settling +! ----------- +! Because different bins having different swelling coefficients I need to +! handle the call to settling differently. + +! Ammonium - settles like ammonium sulfate (rhflag = 3) + rhflag = 3 + call Chem_SettlingSimpleOrig (self%km, self%klid, rhflag, chemgrav, self%cdt, & + 1.e-6*self%radius(nNH4a), self%rhop(nNH4a), & + NH4a, t, airdens, rh2, delp, zle, NH4SD, rc) + +!if(mapl_am_i_root()) print*,'NI2G sum(NH4SD) = ',sum(NH4SD) +!if(mapl_am_i_root()) print*,'NI2G sum(NH4a) = ',sum(NH4a) +!if(mapl_am_i_root()) print*,'NI2G NH4a array = ',NH4a +!if(mapl_am_i_root()) print*,'NI2G NH4SD array = ',NH4SD + + + allocate(fluxout, mold=lwi, __STAT__) +! Nitrate bin 1 - settles like ammonium sulfate (rhflag = 3) + rhflag = 3 + fluxout = 0. + call Chem_SettlingSimpleOrig (self%km, self%klid, rhFlag, chemgrav, self%cdt, & + 1.e-6*self%radius(nNO3an1), self%rhop(nNO3an1), & + NO3an1, t, airdens, rh2, delp, zle, fluxout, rc) + if (associated(NISD)) NISD(:,:,1) = fluxout +!if(mapl_am_i_root()) print*,'NI2G sum(NISD(:,:,1)) = ',sum(NISD(:,:,1)) +!if(mapl_am_i_root()) print*,'NI2G sum(NO3an1) = ',sum(NO3an1) + +! Nitrate bin 2 - settles like sea salt (rhflag = 2) + rhflag = 2 + fluxout = 0. + call Chem_SettlingSimpleOrig (self%km, self%klid, rhFlag, chemgrav, self%cdt, & + 1.e-6*self%radius(nNO3an2), self%rhop(nNO3an2), & + NO3an2, t, airdens, rh2, delp, zle, fluxout, rc) + if (associated(NISD)) NISD(:,:,2) = fluxout +!if(mapl_am_i_root()) print*,'NI2G sum(NISD(:,:,2)) = ',sum(NISD(:,:,2)) +!if(mapl_am_i_root()) print*,'NI2G sum(NO3an2) = ',sum(NO3an2) + +! Nitrate bin 1 - settles like dust (rhflag = 0) + rhflag = 0 + fluxout = 0. + call Chem_SettlingSimpleOrig (self%km, self%klid, rhFlag, chemgrav, self%cdt, & + 1.e-6*self%radius(nNO3an3), self%rhop(nNO3an3), & + NO3an3, t, airdens, rh2, delp, zle, fluxout, rc) + if (associated(NISD)) NISD(:,:,3) = fluxout +!if(mapl_am_i_root()) print*,'NI2G sum(NISD(:,:,3)) = ',sum(NISD(:,:,3)) +!if(mapl_am_i_root()) print*,'NI2G sum(NO3an3) = ',sum(NO3an3) + + +!if(mapl_am_i_root()) print*,'NI2G after chemset sum(NH3) = ',sum(NH3) +!if(mapl_am_i_root()) print*,'NI2G after chemset sum(NH4a) = ',sum(NH4a) + +! NI Deposition +! ----------- + drydepositionfrequency = 0. + call DryDeposition(self%km, t, airdens, zle, lwi, ustar, zpbl, sh,& + MAPL_KARMAN, cpd, chemGRAV, z0h, drydepositionfrequency, __RC__ ) +!if(mapl_am_i_root()) print"(g25.17)",'NI2G drydep = ',drydepositionfrequency +!if(mapl_am_i_root()) print*,'NI2G NH3 array = ',NH3 +!if(mapl_am_i_root()) print*,'NI2G lwi array = ',lwi + +! NH3 + dqa = 0. +! where (abs(lwi - OCEAN) < 0.5) +! dqa = max(0.0, NH3(:,:,self%km)*(1.-exp(-10.0*drydepositionfrequency*self%cdt))) +! elsewhere +! dqa = max(0.0, NH3(:,:,self%km)*(1.-exp( -3.0*drydepositionfrequency*self%cdt))) +! end where + + do i=1,ubound(lwi,1) + do j =1,ubound(lwi,2) + if (abs(lwi(i,j) - OCEAN) < 0.5) then + dqa(i,j) = max(0.0, NH3(i,j,self%km)*(1.-exp(-10.0*drydepositionfrequency(i,j)*self%cdt))) + else + dqa(i,j) = max(0.0, NH3(i,j,self%km)*(1.-exp( -3.0*drydepositionfrequency(i,j)*self%cdt))) + end if + end do + end do + + NH3(:,:,self%km) = NH3(:,:,self%km) - dqa + if( associated(NH3DP) ) NH3DP = dqa*delp(:,:,self%km)/chemgrav/self%cdt +!if(mapl_am_i_root()) print*,'NI2G sum(NH3) = ',sum(NH3) +!if(mapl_am_i_root()) print*,'NI2G sum(NH3DP) = ',sum(NH3DP) +!if(mapl_am_i_root()) print*,'NI2G dqa array = ',dqa +!if(mapl_am_i_root()) print"(g25.17)",'NI2G NH3 array = ',NH3 + + +! NH4a + dqa = 0. + dqa = max(0.0, NH4a(:,:,self%km)*(1.-exp(-drydepositionfrequency*self%cdt))) + NH4a(:,:,self%km) = NH4a(:,:,self%km) - dqa + if( associated(NH4DP) ) NH4DP = dqa*delp(:,:,self%km)/chemgrav/self%cdt +!if(mapl_am_i_root()) print*,'NI2G sum(NH4a) = ',sum(NH4a) +!if(mapl_am_i_root()) print*,'NI2G sum(NH4DP) = ',sum(NH4DP) + +! NO3anx + dqa = 0. + dqa = max(0.0, NO3an1(:,:,self%km)*(1.-exp(-drydepositionfrequency*self%cdt))) + NO3an1(:,:,self%km) = NO3an1(:,:,self%km) - dqa + if( associated(NIDP) ) NIDP(:,:,1) = dqa*delp(:,:,self%km)/chemgrav/self%cdt +!if(mapl_am_i_root()) print*,'NI2G sum(NO3an1) = ',sum(NO3an1) +!if(mapl_am_i_root()) print*,'NI2G sum(NIDP(:,:,1)) = ',sum(NIDP(:,:,1)) + + dqa = 0. + dqa = max(0.0, NO3an2(:,:,self%km)*(1.-exp(-drydepositionfrequency*self%cdt))) + NO3an2(:,:,self%km) = NO3an2(:,:,self%km) - dqa + if( associated(NIDP) ) NIDP(:,:,2) = dqa*delp(:,:,self%km)/chemgrav/self%cdt +!if(mapl_am_i_root()) print*,'NI2G sum(NO3an2) = ',sum(NO3an2) +!if(mapl_am_i_root()) print*,'NI2G sum(NIDP(:,:,2)) = ',sum(NIDP(:,:,2)) + + dqa = 0. + dqa = max(0.0, NO3an3(:,:,self%km)*(1.-exp(-drydepositionfrequency*self%cdt))) + NO3an3(:,:,self%km) = NO3an3(:,:,self%km) - dqa + if( associated(NIDP) ) NIDP(:,:,3) = dqa*delp(:,:,self%km)/chemgrav/self%cdt +!if(mapl_am_i_root()) print*,'NI2G sum(NO3an3) = ',sum(NO3an3) +!if(mapl_am_i_root()) print*,'NI2G sum(NIDP(:,:,3)) = ',sum(NIDP(:,:,3)) + +! NI Large-scale Wet Removal +! -------------------------- + allocate(fluxoutWT(ubound(t,1), ubound(t,2), 1), __STAT__) + fluxoutWT = 0. +! NH3 + KIN = .false. + fwet = 1. + call WetRemovalGOCART2G (self%km, self%klid, self%nbins, self%nbins, 1, self%cdt, 'NH3', & + KIN, chemGRAV, fwet, NH3, ple, t, airdens, & + pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, fluxoutWT, rc) + if (associated(NH3WT)) NH3WT = fluxoutWT(:,:,1) +!if(mapl_am_i_root()) print*,'NI2G sum(NH3WT) = ',sum(NH3WT) +!if(mapl_am_i_root()) print*,'NI2G sum(NH3) = ',sum(NH3) + +! NH4a + fluxoutWT = 0. + KIN = .true. + fwet = 1. + call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, 1, self%cdt, 'NH4a', & + KIN, chemGRAV, fwet, NH4a, ple, t, airdens, & + pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, fluxoutWT, rc) + if (associated(NH4WT)) NH4WT = fluxoutWT(:,:,1) +!if(mapl_am_i_root()) print*,'NI2G sum(NH4WT) = ',sum(NH4WT) +!if(mapl_am_i_root()) print*,'NI2G sum(NH4) = ',sum(NH4a) + + KIN = .true. + fwet = 1. + call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, 1, self%cdt, 'nitrate', & + KIN, chemGRAV, fwet, NO3an1, ple, t, airdens, & + pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, NIWT, rc) +!if(mapl_am_i_root()) print*,'NI2G sum(NIWT(:,:,1)) = ',sum(NIWT(:,:,1)) + KIN = .true. + fwet = 1. + call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, 2, self%cdt, 'nitrate', & + KIN, chemGRAV, fwet, NO3an2, ple, t, airdens, & + pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, NIWT, rc) +!if(mapl_am_i_root()) print*,'NI2G sum(NIWT(:,:,2)) = ',sum(NIWT(:,:,2)) + + KIN = .true. + fwet = 1. + call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, 3, self%cdt, 'nitrate', & + KIN, chemGRAV, fwet, NO3an3, ple, t, airdens, & + pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, NIWT, rc) +!if(mapl_am_i_root()) print*,'NI2G sum(NIWT(:,:,3)) = ',sum(NIWT(:,:,3)) + +! Compute desired output diagnostics +! ---------------------------------- + allocate(aerosol(ubound(NH4a,1), ubound(NH4a,2), ubound(NH4a,3), 3), __STAT__) + aerosol(:,:,:,:) = 0.0 + aerosol(:,:,:,1) = NH4a + call Aero_Compute_Diags (mie_table=self%diag_MieTable(self%instance), km=self%km, klid=self%klid, nbegin=1, & + nbins=1, channels=self%diag_MieTable(self%instance)%channels, & + aerosol=aerosol, grav=chemgrav, tmpu=t, rhoa=airdens, rh=rh2, u=u, v=v, & + delp=delp, sfcmass=NH4SMASS, colmass=NH4CMASS, mass=NH4MASS, conc=NH4CONC, __RC__) +!if(mapl_am_i_root()) print*,'NI2G sum(NH4SMASS) = ',sum(NH4SMASS) +!if(mapl_am_i_root()) print*,'NI2G sum(NH4CMASS) = ',sum(NH4CMASS) +!if(mapl_am_i_root()) print*,'NI2G sum(NH4MASS) = ',sum(NH4MASS) +!if(mapl_am_i_root()) print*,'NI2G sum(NH4CONC) = ',sum(NH4CONC) + + aerosol(:,:,:,1) = NH3 + call Aero_Compute_Diags (mie_table=self%diag_MieTable(self%instance), km=self%km, klid=self%klid, nbegin=1, & + nbins=1, channels=self%diag_MieTable(self%instance)%channels, & + aerosol=aerosol, grav=chemgrav, tmpu=t, rhoa=airdens, rh=rh2, u=u, v=v, & + delp=delp, sfcmass=NH3SMASS, colmass=NH3CMASS, mass=NH3MASS, conc=NH3CONC, __RC__) +!if(mapl_am_i_root()) print*,'NI2G sum(NH3SMASS) = ',sum(NH3SMASS) +!if(mapl_am_i_root()) print*,'NI2G sum(NH3CMASS) = ',sum(NH3CMASS) +!if(mapl_am_i_root()) print*,'NI2G sum(NH3MASS) = ',sum(NH3MASS) +!if(mapl_am_i_root()) print*,'NI2G sum(NH3CONC) = ',sum(NH3CONC) + + aerosol(:,:,:,1) = NO3an1 + call Aero_Compute_Diags (mie_table=self%diag_MieTable(self%instance), km=self%km, klid=self%klid, nbegin=1, & + nbins=1, channels=self%diag_MieTable(self%instance)%channels, & + aerosol=aerosol, grav=chemgrav, tmpu=t, rhoa=airdens, rh=rh2, u=u, v=v, & + delp=delp, sfcmass=NISMASS25, colmass=NICMASS25, mass=NIMASS25, conc=NICONC25, __RC__) +!if(mapl_am_i_root()) print*,'NI2G sum(NISMASS25) = ',sum(NISMASS25) +!if(mapl_am_i_root()) print*,'NI2G sum(NICMASS25) = ',sum(NICMASS25) +!if(mapl_am_i_root()) print*,'NI2G sum(NIMASS25) = ',sum(NIMASS25) +!if(mapl_am_i_root()) print*,'NI2G sum(NICONC25) = ',sum(NICONC25) + +!#if 0 + aerosol(:,:,:,1) = NO3an1 + aerosol(:,:,:,2) = NO3an2 + aerosol(:,:,:,3) = NO3an3 + call Aero_Compute_Diags (mie_table=self%diag_MieTable(self%instance), km=self%km, klid=self%klid, nbegin=1, & + nbins=3, channels=self%diag_MieTable(self%instance)%channels, & + aerosol=aerosol, grav=chemgrav, tmpu=t, rhoa=airdens, rh=rh2, u=u, v=v, & + delp=delp, sfcmass=NISMASS, colmass=NICMASS, mass=NIMASS, conc=NICONC, & + exttau=NIEXTTAU, scatau=NISCATAU, exttau25=NIEXTT25, scatau25=NISCAT25, & + fluxu=NIFLUXU, fluxv=NIFLUXV, extcoef=NIEXTCOEF, scacoef=NISCACOEF, & + exttaufm=NIEXTTFM, scataufm=NISCATFM, angstrom=NIANGSTR, __RC__ ) +!#endif +!if(mapl_am_i_root()) print*,'NI2G sum(NIEXTTAU) = ',sum(NIEXTTAU) +!if(mapl_am_i_root()) print*,'NI2G sum(NISCATAU) = ',sum(NISCATAU) +!if(mapl_am_i_root()) print*,'NI2G sum(NIMASS) = ',sum(NIMASS) +!if(mapl_am_i_root()) print*,'NI2G sum(NIFLUXU) = ',sum(NIFLUXU) + +!if(mapl_am_i_root()) print*,'NI2G Run2 END sum(NIANGSTR) = ',sum(NIANGSTR) +!if(mapl_am_i_root()) print*,'NI2G Run2 END sum(NH3) = ',sum(NH3) +!if(mapl_am_i_root()) print*,'NI2G Run2 END sum(NH4a) = ',sum(NH4a) +!if(mapl_am_i_root()) print*,'NI2G Run2 END sum(self%xhno3) = ',sum(self%xhno3) + +!if(mapl_am_i_root()) print*,'NI2G Run2 END array NH3 = ',NH3 +!if(mapl_am_i_root()) print*,'NI2G Run2 END array NH4a = ',NH4a +!if(mapl_am_i_root()) print*,'NI2G Run2 END sum(NO3an1) = ',sum(NO3an1) +!if(mapl_am_i_root()) print*,'NI2G Run2 END sum(NO3an2) = ',sum(NO3an2) +!if(mapl_am_i_root()) print*,'NI2G Run2 END sum(NO3an3) = ',sum(NO3an3) + + +if(mapl_am_i_root()) print*,trim(comp_name),'2G Run2 END' + + RETURN_(ESMF_SUCCESS) + + end subroutine Run2 + + +!============================================================================ +!BOP +! !IROUTINE: Run_data -- ExtData Sea Salt Grid Component + +! !INTERFACE: + + subroutine Run_data (GC, IMPORT, EXPORT, INTERNAL, RC) + + ! !ARGUMENTS: + + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: IMPORT ! Import state + type (ESMF_State), intent(inout) :: EXPORT ! Export state + type (ESMF_State), intent(inout) :: INTERNAL ! Interal state + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. + +!EOP +!============================================================================ +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (wrap_) :: wrap + type (NI2G_GridComp), pointer :: self + + real, pointer, dimension(:,:,:) :: ptr3d_int, ptr3d_imp + + __Iam__('Run_data') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'//Iam + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'NI2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Update interal data pointers with ExtData +! ----------------------------------------- + call MAPL_GetPointer (internal, name='NO3an1', ptr=ptr3d_int, __RC__) + call MAPL_GetPointer (import, name='climNO3an1', ptr=ptr3d_imp, __RC__) + ptr3d_int = ptr3d_imp + call MAPL_GetPointer (internal, name='NO3an2', ptr=ptr3d_int, __RC__) + call MAPL_GetPointer (import, name='climNO3an2', ptr=ptr3d_imp, __RC__) + ptr3d_int = ptr3d_imp + call MAPL_GetPointer (internal, name='NO3an3', ptr=ptr3d_int, __RC__) + call MAPL_GetPointer (import, name='climNO3an3', ptr=ptr3d_imp, __RC__) + ptr3d_int = ptr3d_imp + +if(mapl_am_i_root())print*,'NI2G Run_data END' + + RETURN_(ESMF_SUCCESS) + + end subroutine Run_data + +!------------------------------------------------------------------------------------- + + subroutine aerosol_optics(state, rc) + + implicit none + +! !ARGUMENTS: + type (ESMF_State) :: state + integer, intent(out) :: rc + +! !Local + integer, parameter :: DP=kind(1.0d0) + real, dimension(:,:,:), pointer :: ple, rh + real(kind=DP), dimension(:,:,:), pointer :: var + real, dimension(:,:,:), pointer :: q + real, dimension(:,:,:,:), pointer :: q_4d + integer, allocatable :: opaque_self(:) + type(C_PTR) :: address + type(NI2G_GridComp), pointer :: self + + character (len=ESMF_MAXSTR) :: fld_name + type(ESMF_Field) :: fld + character (len=ESMF_MAXSTR),allocatable :: aerosol_names(:) + + real(kind=DP), dimension(:,:,:), allocatable :: ext_s, ssa_s, asy_s ! (lon:,lat:,lev:) + real :: x + integer :: instance + integer :: n, nbins + integer :: i1, j1, i2, j2, km + integer :: band, offset + integer, parameter :: n_bands = 1 + + integer :: i, j, k + + __Iam__('NI2G::aerosol_optics') + +! Begin... + +! Mie Table instance/index +! ------------------------ + call ESMF_AttributeGet(state, name='mie_table_instance', value=instance, __RC__) + +! Get aerosol names +! ----------------- + call ESMF_AttributeGet (state, name='internal_varaible_name', itemCount=nbins, __RC__) + allocate (aerosol_names(nbins), __STAT__) + call ESMF_AttributeGet (state, name='internal_varaible_name', valueList=aerosol_names, __RC__) + +! Radiation band +! -------------- + band = 0 + call ESMF_AttributeGet(state, name='band_for_aerosol_optics', value=band, __RC__) + offset = band - n_bands + +! Pressure at layer edges +! ------------------------ + call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, ple, trim(fld_name), __RC__) + +! call MAPL_GetPointer (state, ple, 'PLE', __RC__) + + i1 = lbound(ple, 1); i2 = ubound(ple, 1) + j1 = lbound(ple, 2); j2 = ubound(ple, 2) + km = ubound(ple, 3) + +! Relative humidity +! ----------------- + call ESMF_AttributeGet(state, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, rh, trim(fld_name), __RC__) + +! call MAPL_GetPointer (state, rh, 'RH2', __RC__) + + allocate(ext_s(i1:i2, j1:j2, km), & + ssa_s(i1:i2, j1:j2, km), & + asy_s(i1:i2, j1:j2, km), __STAT__) + + allocate(q_4d(i1:i2, j1:j2, km, nbins), __STAT__) + + do n = 1, nbins + call ESMF_StateGet (state, trim(aerosol_names(n)), field=fld, __RC__) + call ESMF_FieldGet (fld, farrayPtr=q, __RC__) + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + x = ((ple(i,j,k) - ple(i,j,k-1))*0.01)*(100./MAPL_GRAV) + q_4d(i,j,k,n) = x * q(i,j,k) + end do + end do + end do + end do + + call ESMF_AttributeGet(state, name='mieTable_pointer', itemCount=n, __RC__) + allocate (opaque_self(n), __STAT__) + call ESMF_AttributeGet(state, name='mieTable_pointer', valueList=opaque_self, __RC__) + + address = transfer(opaque_self, address) + call c_f_pointer(address, self) + + call mie_ (self%rad_MieTable(instance), nbins, n_bands, offset, q_4d, rh, ext_s, ssa_s, asy_s, __RC__) + + call ESMF_AttributeGet(state, name='extinction_in_air_due_to_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ext_s(:,:,:) + end if + + call ESMF_AttributeGet(state, name='single_scattering_albedo_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ssa_s(:,:,:) + end if + + call ESMF_AttributeGet(state, name='asymmetry_parameter_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = asy_s(:,:,:) + end if + + deallocate(ext_s, ssa_s, asy_s, __STAT__) + deallocate(q_4d, __STAT__) + + RETURN_(ESMF_SUCCESS) + + contains + +! subroutine mie_(mie_table, aerosol_names, nb, offset, q, rh, bext_s, bssa_s, basym_s, rc) + subroutine mie_(mie_table, nbins, nb, offset, q, rh, bext_s, bssa_s, basym_s, rc) + + implicit none + + type(Chem_Mie), intent(inout) :: mie_table ! mie table + integer, intent(in ) :: nbins ! number of bins + integer, intent(in ) :: nb ! number of bands + integer, intent(in ) :: offset ! bands offset + real, intent(in ) :: q(:,:,:,:) ! aerosol mass mixing ratio, kg kg-1 + real, intent(in ) :: rh(:,:,:) ! relative humidity + real(kind=8), intent( out) :: bext_s (size(ext_s,1),size(ext_s,2),size(ext_s,3)) + real(kind=8), intent( out) :: bssa_s (size(ext_s,1),size(ext_s,2),size(ext_s,3)) + real(kind=8), intent( out) :: basym_s(size(ext_s,1),size(ext_s,2),size(ext_s,3)) + integer, intent(out) :: rc + ! local + integer :: l + real :: bext (size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! extinction + real :: bssa (size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! SSA + real :: gasym(size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! asymmetry parameter + + __Iam__('NI2G::aerosol_optics::mie_') + + bext_s = 0.0d0 + bssa_s = 0.0d0 + basym_s = 0.0d0 + + do l = 1, nbins + call Chem_MieQuery(mie_table, l, real(offset+1.), q(:,:,:,l), rh, bext, gasym=gasym, ssa=bssa) + + bext_s = bext_s + bext ! extinction + bssa_s = bssa_s + (bssa*bext) ! scattering extinction + basym_s = basym_s + gasym*(bssa*bext) ! asymetry parameter multiplied by scatering extiction + + end do + + RETURN_(ESMF_SUCCESS) + + end subroutine mie_ + + end subroutine aerosol_optics + + + + +end module NI2G_GridCompMod diff --git a/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridComp_ExtData.rc b/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridComp_ExtData.rc new file mode 100644 index 00000000..71af1971 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridComp_ExtData.rc @@ -0,0 +1,31 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------|---------- +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | File +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | Frequency +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------|----------- + +# ======= Nitrate Data Instance ========== +climNO3an1 'kg kg-1' N Y F0 none none NO3AN1 /home/adasilva/opendap/fp/das/Y%y4/M%m2/D%d2/GEOS.fp.asm.inst3_3d_aer_Nv.%y4%m2%d2_%h2%n2.V01.nc4 2017-02-01T00:00:00P03:00 +climNO3an2 'kg kg-1' N Y F0 none none NO3AN2 /home/adasilva/opendap/fp/das/Y%y4/M%m2/D%d2/GEOS.fp.asm.inst3_3d_aer_Nv.%y4%m2%d2_%h2%n2.V01.nc4 2017-02-01T00:00:00P03:00 +climNO3an3 'kg kg-1' N Y F0 none none NO3AN3 /home/adasilva/opendap/fp/das/Y%y4/M%m2/D%d2/GEOS.fp.asm.inst3_3d_aer_Nv.%y4%m2%d2_%h2%n2.V01.nc4 2017-02-01T00:00:00P03:00 + +#climNO3an1 'kg kg-1' Y Y %y4-%m2-%d2T12:00:00 none none NO3AN1 /home/adasilva/opendap/fp/das/Y2017/M02/D01/GEOS.fp.asm.inst3_3d_aer_Nv.20170201_0000.V01.nc4 +#climNO3an2 'kg kg-1' Y Y %y4-%m2-%d2T12:00:00 none none NO3AN2 /home/adasilva/opendap/fp/das/Y2017/M02/D01/GEOS.fp.asm.inst3_3d_aer_Nv.20170201_0000.V01.nc4 +#climNO3an3 'kg kg-1' Y Y %y4-%m2-%d2T12:00:00 none none NO3AN3 /home/adasilva/opendap/fp/das/Y2017/M02/D01/GEOS.fp.asm.inst3_3d_aer_Nv.20170201_0000.V01.nc4 + +# ======= Nitrate Sources ======== +EMI_NH3_BB 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_nh3.006.%y4%m2%d2.nc4 +EMI_NH3_AG 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none nh3_emis ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_nh3.agriculture.x3600_y1800_t12.2010.nc4 +EMI_NH3_EN 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none nh3_emis ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_nh3.energy.x3600_y1800_t12.2010.nc4 +EMI_NH3_IN 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none nh3_emis ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_nh3.industry.x3600_y1800_t12.2010.nc4 +EMI_NH3_RE 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none nh3_emis ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_nh3.residential.x3600_y1800_t12.2010.nc4 +EMI_NH3_TR 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none nh3_emis ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_nh3.transport.x3600_y1800_t12.2010.nc4 +EMI_NH3_OC 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none emiss_ocn ExtData/PIESA/sfc/GEIA.emis_NH3.ocean.x576_y361.t12.20080715_12z.nc4 + +NITRATE_HNO3 'mol mol-1' Y N %y4-%m2-%d2T12:00:00 none 0.20 hno3 ExtData/PIESA/L72/GMI.vmr_HNO3.x144_y91.t12.2006.nc4 + +NI_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc + +#DU kg kg-1 N N - none none DU /dev/null +%% + diff --git a/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridComp_NI.rc b/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridComp_NI.rc new file mode 100644 index 00000000..9ffc1cf2 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridComp_NI.rc @@ -0,0 +1,37 @@ +# +# Resource file Nitrate parameters. +# + +nbins: 5 + +aerosol_radBands_optics_file: ExtData/MERRA2/x/opticsBands_NI.v2_5.RRTMG.nc + +aerosol_monochromatic_optics_file: ExtData/AeroCom/x/optics_NI.v2_5.nc +aerosol_monochromatic_optics_wavelength: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 +n_channels: 4 + +# Scavenging efficiency per bin [km-1] +fscav: 0.0 0.4 0.4 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius_microns: 0.0 0.2695 0.2695 2.1 7.57 + +# Dry particle density [kg m-3] +particle_density: 1000 1769 1725 2200 2650 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 0.18 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 1.50e19 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 0.0118 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 2.0 2.0 2.0 + +pressure_lid_in_hPa: 0.01 + +particle_density: 1000 1769 1725 2200 2650 +rhFlag: 0 diff --git a/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_StateSpecs.rc b/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_StateSpecs.rc new file mode 100644 index 00000000..cfaa1251 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_StateSpecs.rc @@ -0,0 +1,136 @@ +schema_version: 2.0.0 +component: NI + +category: IMPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS| Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC | UNGRIDDED | LONG NAME +#---------------------------------------------------------------------------------------- + LWI | 1 | xy | N | | land-ocean-ice_mask + USTAR | m s-1 | xy | N | | surface_velocity_scale + ZPBL | m | xy | N | | planetary_boundary_layer_height + SH | w m-2 | xy | N | | sensible_heat_flux_from_turbulence + Z0H | m | xy | N | | surface_roughness_for_heat + CN_PRCP |kg/m^2/s | xy | N | | surface_conv._rain_flux_needed_by_land + NCN_PRCP |kg/m^2/s | xy | N | | Non-convective precipitation + AREA | m^2 | xy | N | | agrid_cell_area +#........................................................................................ + AIRDENS | kg/m^3 | xyz | C | | moist_air_density + DELP | Pa | xyz | C | | pressure_thickness + T | K | xyz | C | | air_temperature + RH2 | 1 | xyz | C | | Rel_Hum_after_moist + ZLE | m | xyz | E | | geopotential_height + PLE | Pa | xyz | E | | air_pressure + PFL_LSAN | kg/m2/s | xyz | E | | 3D_flux_of_liquid_nonconvective_precipitation + PFI_LSAN | kg/m2/s | xyz | E | | 3D_flux_of_ice_nonconvective_precipitation + U | m s-1 | xyz | C | | eastward_wind + V | m s-1 | xyz | C | | northward_wind +#......................................................................................... + EMI_NH3_AG |kg m-2 s-1| xy | N | | source species + EMI_NH3_BB |kg m-2 s-1| xy | N | | source species + EMI_NH3_EN |kg m-2 s-1| xy | N | | source species + EMI_NH3_IN |kg m-2 s-1| xy | N | | source species + EMI_NH3_OC |kg m-2 s-1| xy | N | | source species + EMI_NH3_RE |kg m-2 s-1| xy | N | | source species + EMI_NH3_TR |kg m-2 s-1| xy | N | | source species + NITRATE_HNO3 |kg m-2 s-1| xyz | C | | source species + DU | kg kg-1 | xyz | C | 5 | Dust Mixing Ratio all bins + SS | kg kg-1 | xyz | C | 5 | Sea Salt Mixing Ratio all bins + SO4 | kg kg-1 | xyz | C | | Sulfate + +category: EXPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS| VLOC| UNGRIDDED | LONG_NAME +#---------------------------------------------------------------------------------------- + NH3MASS | kg/kg | xyz | C | | Ammonia Mass Mixing Ratio + NH4MASS | kg/kg | xyz | C | | Ammonium Aerosol Mass Mixing Ratio + NIMASS | kg/kg | xyz | C | | Nitrate Mass Mixing Ratio + NIMASS25 | kg/kg | xyz | C | | Nitrate Mass Mixing Ratio [PM2.5] + HNO3CONC | kg m-3 | xyz | C | | Nitric Acid Mass Concentration + NH3CONC | kg m-3 | xyz | C | | Ammonia Mass Concentration + NH4CONC | kg m-3 | xyz | C | | Ammonium Mass Concentration + NICONC | kg m-3 | xyz | C | | Nitrate Mass Concentration + NICONC25 | kg m-3 | xyz | C | | Nitrate Mass Concentration [PM2.5] + NIEXTCOEF | m-1 | xyz | C | | Nitrate Extinction Coefficient [550 nm] + NISCACOEF | m-1 | xyz | C | | Nitrate Scattering Coefficient [550 nm] +# ..........|............|.....|.....|...........|.................................. + NIPNO3AQ | kg m-2 s-1 | xy | N | | Nitrate Production from Aqueous Chemistry + NIPNH4AQ | kg m-2 s-1 | xy | N | | Ammonium Production from Aqueous Chemistry + NIPNH3AQ | kg m-2 s-1 | xy | N | | Ammonia Change from Aqueous Chemistry + NIHT | kg m-2 s-1 | xy | N | 3 | Nitrate Production from Het Chem All Bins + NISD | kg m-2 s-1 | xy | N | 3 | Nitrate Sedimentation All Bins + NIDP | kg m-2 s-1 | xy | N | 3 | Nitrate Dry Deposition All Bins + NIWT | kg m-2 s-1 | xy | N | 3 | Nitrate Wet Deposition All Bins + NISV | kg m-2 s-1 | xy | N | 3 | Nitrate Convective Scavenging All Bins + NH3EM | kg m-2 s-1 | xy | N | | Ammonia Emission + NH3DP | kg m-2 s-1 | xy | N | | Ammonia Dry Deposition + NH3WT | kg m-2 s-1 | xy | N | | Ammonia Wet Deposition + NH3SV | kg m-2 s-1 | xy | N | | Ammonia Convective Scavenging + NH4SD | kg m-2 s-1 | xy | N | | Ammonium Settling + NH4DP | kg m-2 s-1 | xy | N | | Ammonium Dry Deposition + NH4WT | kg m-2 s-1 | xy | N | | Ammonium Wet Deposition + NH4SV | kg m-2 s-1 | xy | N | | Ammonium Convective Scavenging + HNO3SMASS | kg m-3 | xy | N | | Nitric Acid Surface Mass Concentration + NH3SMASS | kg m-3 | xy | N | | Ammonia Surface Mass Concentration + NH4SMASS | kg m-3 | xy | N | | Ammonium Surface Mass Concentration + NISMASS | kg m-3 | xy | N | | Nitrate Surface Mass Concentration + NISMASS25 | kg m-3 | xy | N | | Nitrate Surface Mass Concentration [PM2.5] + HNO3CMASS | kg m-3 | xy | N | | Nitric Acid Column Mass Density + NH3CMASS | kg m-3 | xy | N | | Ammonia Column Mass Density + NH4CMASS | kg m-3 | xy | N | | Ammonium Column Mass Density + NICMASS | kg m-2 | xy | N | | Nitrate Column Mass Density + NICMASS25 | kg m-2 | xy | N | | Nitrate Column Mass Density [PM2.5] + NIEXTTFM | 1 | xy | N | | Nitrate Extinction AOT [550 nm] - PM 1.0 um + NISCATFM | 1 | xy | N | | Nitrate Scattering AOT [550 nm] - PM 1.0 um + NIEXTT25 | 1 | xy | N | | Nitrate Extinction AOT [550 nm] - PM 2.5 um + NISCAT25 | 1 | xy | N | | Nitrate Scattering AOT [550 nm] - PM 2.5 um + NIEXTTAU | 1 | xy | N | | Nitrate Extinction AOT [550 nm] + NISCATAU | 1 | xy | N | | Nitrate Scattering AOT [550 nm] + NIANGSTR | 1 | xy | N | | Nitrate Angstrom parameter [470-870 nm] + NIFLUXU | kg m-1 s-1 | xy | N | | Nitrate column u-wind mass flux + NIFLUXV | kg m-1 s-1 | xy | N | | Nitrate column v-wind mass flux + +category: INTERNAL +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSION | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC | RESTART | ADD2EXPORT | FRIENDLYTO | LONG NAME +#---------------------------------------------------------------------------------------- + NH3 |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Ammonia (NH3, gas phase) + NH4a |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Ammonium ion (NH4+, aerosol phase) + NO3an1 |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Nitrate size bin 001 + NO3an2 |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Nitrate size bin 002 + NO3an3 |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Nitrate size bin 003 + + +#******************************************************** +# +# Legend +# +#------------------------------------------------------------------ +# Column label | MAPL keyword/interpretation | Default +#--------------|--------------------------------------------------- +# NAME | short_name | +# UNITS | units | +# DIMS | dims | +# VLOC | VLocation | MAPL_VLocationNone +# LONG NAME | long_name | +# COND | if () then | .FALSE. +# NUM_SUBTILES | num_subtiles +# ... +#------------------------------------------------------------------ +# +#-------------------------------------------- +# Entry alias | Column | MAPL keyword/interpretation +#--------------|----------------------------- +# xyz | DIMS | MAPL_HorzVert +# xy | DIMS | MAPL_HorzOnly +# z | DIMS | MAPL_VertOnly (plus ungridded) +# C | VLOC | MAPL_VlocationCenter +# E | VLOC | MAPL_VlocationEdge +# N | VLOC | MAPL_VlocationNone +#-------------------------------------------- + diff --git a/ESMF/GOCART2G_GridComp/SS2G_GridComp/CMakeLists.txt b/ESMF/GOCART2G_GridComp/SS2G_GridComp/CMakeLists.txt new file mode 100644 index 00000000..72a87700 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SS2G_GridComp/CMakeLists.txt @@ -0,0 +1,18 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES GA_GridComp Chem_Shared2G Process_Library) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +mapl_acg (${this} SS2G_StateSpecs.rc + IMPORT_SPECS EXPORT_SPECS INTERNAL_SPECS + GET_POINTERS DECLARE_POINTERS) + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() + + diff --git a/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridCompMod.F90 new file mode 100644 index 00000000..38a0991e --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridCompMod.F90 @@ -0,0 +1,1088 @@ +#include "MAPL_Generic.h" + +!============================================================================= +!BOP + +! !MODULE: SS2G_GridCompMod - GOCART refactoring of the SS gridded component + +! !INTERFACE: +module SS2G_GridCompMod + +! !USES: + use ESMF + use MAPL + use Chem_MieTableMod2G + use Chem_AeroGeneric + use iso_c_binding, only: c_loc, c_f_pointer, c_ptr + + use GOCART2G_Process ! GOCART2G process library + use GA_GridCompMod + + implicit none + private + + integer, parameter :: instanceComputational = 1 + integer, parameter :: instanceData = 2 + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + integer, parameter :: DP=kind(1.0d0) + +! !PUBLIC MEMBER FUNCTIONS: + PUBLIC SetServices + +real, parameter :: chemgrav = 9.80616 +real, parameter :: cpd = 1004.16 + +! !DESCRIPTION: This module implements GOCART's Sea Salt (SS) Gridded Component. + +! !REVISION HISTORY: +! 24Oct2019 E.Sherman First attempt at refactoring. + +!EOP +!=========================================================================== + integer, parameter :: NHRES = 6 ! DEV NOTE!!! should this be allocatable, and not a parameter? + +! !Sea Salt state + type, extends(GA_GridComp) :: SS2G_GridComp + real, allocatable :: rlow(:) ! particle effective radius lower bound [um] + real, allocatable :: rup(:) ! particle effective radius upper bound [um] + integer :: sstEmisFlag ! Choice of SST correction to emissions: +! 0 - none; 1 - Jaegle et al. 2011; 2 - GEOS5 + logical :: hoppelFlag ! Apply the Hoppel correction to emissions (Fan and Toon, 2011) + logical :: weibullFlag ! Apply the Weibull distribution to wind speed for emissions (Fan and Toon, 2011) + real, allocatable :: deep_lakes_mask(:,:) + integer :: emission_scheme + real :: emission_scale ! global scaling factor + real :: emission_scale_res(NHRES) ! global scaling factor + end type SS2G_GridComp + + type wrap_ + type (SS2G_GridComp), pointer :: PTR => null() + end type wrap_ + +contains + +!============================================================================ +!BOP + +! !IROUTINE: SetServices + +! !INTERFACE: + subroutine SetServices ( GC, RC ) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(INOUT) :: GC ! gridded component + integer, intent( OUT) :: RC ! return code + +! DESCRIPTION: This version uses MAPL_GenericSetServices, which sets +! the Initialize and Finalize services to generic versions. It also +! allocates our instance of a generic state and puts it in the +! gridded component (GC). Here we only set the two-stage run method +! and declare the data services. + +! !REVISION HISTORY: +! 24oct2019 E.Sherman, A.Da Silva, A.Darmenov, T.Clune First attempt at refactoring + +!EOP +!============================================================================ + +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (ESMF_Config) :: cfg + type (wrap_) :: wrap + type (SS2G_GridComp), pointer :: self + + character (len=ESMF_MAXSTR) :: field_name + integer :: i + real :: DEFVAL + logical :: data_driven=.true. + + __Iam__('SetServices') + +!**************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' // Iam + +! Wrap internal state for storing in GC +! ------------------------------------- + allocate (self, __STAT__) + wrap%ptr => self + +! Load resource file +! ------------------- + cfg = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (cfg, 'SS2G_GridComp_'//trim(COMP_NAME)//'.rc', rc=status) + if (status /= 0) then + if (mapl_am_i_root()) print*,'SS2G_GridComp_'//trim(COMP_NAME)//'.rc does not exist! loading SS2G_GridComp_SS.data.rc instead' + call ESMF_ConfigLoadFile (cfg, 'SS2G_GridComp_SS.rc', __RC__) + end if + + ! process generic config items + call self%GA_GridComp%load_from_config( cfg, __RC__) + + allocate(self%rlow(self%nbins), self%rup(self%nbins), __STAT__) + + ! process SS-specific items +! call ESMF_ConfigGetAttribute (cfg, self%fscav, label='fscav:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%sstEmisFlag, label='sstEmisFlag:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%weibullFlag, label='weibullFlag:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%hoppelFlag, label='hoppelFlag:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%emission_scheme, label='emission_scheme:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%emission_scale_res, label='emission_scale:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%rlow, label='radius_lower:', __RC__) + call ESMF_ConfigGetAttribute (cfg, self%rup, label='radius_upper:', __RC__) + +! Is SS data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Set entry points +! ------------------------ + call MAPL_GridCompSetEntryPoint (GC, ESMF_METHOD_INITIALIZE, Initialize, __RC__) + call MAPL_GridCompSetEntryPoint (GC, ESMF_METHOD_RUN, Run, __RC__) + if (data_driven .neqv. .true.) then + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Run, Run2, __RC__) + end if + + DEFVAL = 0.0 + +! Import and Internal states if data instance +! ------------------------------------------- + if (data_driven) then + + call MAPL_AddInternalSpec(gc,& + short_name='SS', & + long_name='Sea Salt Mixing Ratio all bins', & + units='kg kg-1', & + dims=MAPL_DimsHorzVert, & + vlocation=MAPL_VlocationCenter, & + restart=MAPL_RestartOptional, & + ungridded_dims=[self%nbins], & +! friendlyto='DYNAMICS:TURBULENCE:MOIST', & + add2export=.true., __RC__) + + +! Pressure at layer edges +! ----------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'PLE', & + LONG_NAME = 'air_pressure', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + +! RH: is between 0 and 1 +! ---------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'RH2', & + LONG_NAME = 'Rel_Hum_after_moist', & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + do i = 1, self%nbins + write(field_name, '(A, I0.3)') '', i + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'climss'//trim(field_name), & + LONG_NAME = 'Sea Salt Mixing Ratio (bin '//trim(field_name)//')', & + UNITS = 'kg kg-1 s-1', & + RESTART = MAPL_RestartSkip, & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, __RC__) + +! ! dry deposition + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'climSSDP'//trim(field_name), & + LONG_NAME = 'Sea Salt Mixing Ratio (bin '//trim(field_name)//')', & + UNITS = 'kg kg-1 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! ! wet deposition + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'climSSWT'//trim(field_name), & + LONG_NAME = 'Sea Salt wet removal (bin '//trim(field_name)//')', & + UNITS = 'kg kg-1 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! ! gravitational settling + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'climSSSD'//trim(field_name), & + LONG_NAME = 'Sea Salt Mixing Ratio (bin '//trim(field_name)//')', & + UNITS = 'kg kg-1 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! ! convective scavenging + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'climSSSV'//trim(field_name), & + LONG_NAME = 'Sea Salt Mixing Ratio (bin '//trim(field_name)//')', & + UNITS = 'kg kg-1 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + end do + end if ! (data_driven) + + +! Import, Export, Internal states for computational instance +! ---------------------------------------------------------- + if (.not. data_driven) then +#include "SS2G_Export___.h" +#include "SS2G_Import___.h" +#include "SS2G_Internal___.h" + end if + +! This state holds fields needed by radiation +! --------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME = trim(COMP_NAME)//'_AERO', & + LONG_NAME = 'aerosols_from_'//trim(COMP_NAME), & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + DATATYPE = MAPL_StateItem, __RC__) + +! This state is needed by MOIST - It will contain aerosols +! ---------------------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME = trim(COMP_NAME)//'_AERO_ACI', & + LONG_NAME = 'aerosol_cloud_interaction_aerosols_from_'//trim(COMP_NAME), & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + DATATYPE = MAPL_StateItem, __RC__) + +! This bundle is needed by surface for snow albedo modification +! by aerosol settling and deposition +! DEVELOPMENT NOTE - Change to StateItem in future +! --------------------------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME = trim(COMP_NAME)//'_AERO_DP', & + LONG_NAME = 'aerosol_deposition_from_'//trim(COMP_NAME), & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + DATATYPE = MAPL_BundleItem, __RC__) + + +! Store internal state in GC +! -------------------------- + call ESMF_UserCompSetInternalState ( GC, 'SS2G_GridComp', wrap, STATUS ) + VERIFY_(STATUS) + +! Set generic services +! ---------------------------------- + call MAPL_GenericSetServices (GC, __RC__) + + RETURN_(ESMF_SUCCESS) + + end subroutine SetServices + +!============================================================================ +!BOP + +! !IROUTINE: Initialize + +! !INTERFACE: + subroutine Initialize (GC, IMPORT, EXPORT, CLOCK, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: IMPORT ! Import state + type (ESMF_State), intent(inout) :: EXPORT ! Export state + type (ESMF_Clock), intent(inout) :: CLOCK ! The clock + integer, optional, intent( out) :: RC ! Error code + +! !DESCRIPTION: This initializes SS' Grid Component. It primaryily fills +! GOCART's AERO states with its sea salt fields. + +! !REVISION HISTORY: +! 24oct2019 E.Sherman First attempt at refactoring + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_Grid) :: grid + type (ESMF_State) :: internal + type (ESMF_State) :: aero, aero_aci + type (ESMF_State) :: providerState + type (ESMF_Config) :: cfg + type (ESMF_FieldBundle) :: Bundle_DP + type (wrap_) :: wrap + type (SS2G_GridComp), pointer :: self + + integer, allocatable :: mieTable_pointer(:) + integer :: i, dims(3), km + integer :: instance + type (ESMF_Field) :: field, fld + character (len=ESMF_MAXSTR) :: prefix, bin_index + real, pointer, dimension(:,:) :: lats + real, pointer, dimension(:,:) :: lons + real :: CDT ! chemistry timestep (secs) + integer :: HDT ! model timestep (secs) + real, pointer, dimension(:,:,:,:) :: int_ptr + logical :: data_driven + integer :: NUM_BANDS + real, pointer, dimension(:,:,:) :: ple + real, pointer, dimension(:,:) :: area + +integer :: n + + __Iam__('Initialize') + +!**************************************************************************** +! Begin... + +! Get the target components name and set-up traceback handle. +! ----------------------------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, name=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' //trim(Iam) + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get my internal private state +! ----------------------------- + call ESMF_UserCompGetInternalState(GC, 'SS2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Get dimensions +! --------------- + call MAPL_GridGet (grid, globalCellCountPerDim=dims, __RC__ ) + km = dims(3) + self%km = km + +! Scaling factor to multiply calculated +! emissions by. Applies to all size bins. +! ---------------------------------------- + self%emission_scale = Chem_UtilResVal(dims(1), dims(2), self%emission_scale_res(:), __RC__) + +! Get DTs +! ------- + call MAPL_GetResource(mapl, HDT, Label='RUN_DT:', __RC__) + call MAPL_GetResource(mapl, CDT, Label='GOCART_DT:', default=real(HDT), __RC__) + self%CDT = CDT + +! Load resource file and get number of bins +! ------------------------------------------- + cfg = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (cfg, 'SS2G_GridComp_'//trim(COMP_NAME)//'.rc', rc=status) + if (status /= 0) then + if (mapl_am_i_root()) print*,'SS2G_GridComp_'//trim(COMP_NAME)//'.rc does not exist! & + loading SS2G_GridComp_SS.rc instead' + call ESMF_ConfigLoadFile( cfg, 'SS2G_GridComp_SS.rc', __RC__) + end if + +! Call Generic Initialize +! ---------------------------------------- + call MAPL_GenericInitialize (GC, import, export, clock, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get ( mapl, INTERNAL_ESMF_STATE = internal, & + LONS = LONS, & + LATS = LATS, __RC__ ) + +! Is SS data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! If this is a data component, the data is provided in the import +! state via ExtData instead of the actual GOCART children +! ---------------------------------------------------------------- + if ( data_driven ) then + providerState = import + prefix = 'clim' + else + providerState = export + prefix = '' + end if + +! Add attribute information for SS export. Used in NI hetergenous chemistry. + call ESMF_StateGet (export, 'SS', field, __RC__) + call ESMF_AttributeSet(field, NAME='radius', valueList=self%radius, itemCount=self%nbins, __RC__) + call ESMF_AttributeSet(field, NAME='fnum', valueList=self%fnum, itemCount=self%nbins, __RC__) + +! Fill AERO State with sea salt fields +! ---------------------------------------- + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO' , aero , __RC__) + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO_ACI', aero_aci, __RC__) + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO_DP' , Bundle_DP, __RC__) + + call ESMF_StateGet (internal, 'SS', field, __RC__) + call ESMF_AttributeSet(field, NAME='klid', value=self%klid, __RC__) + fld = MAPL_FieldCreate (field, 'SS', __RC__) + call MAPL_StateAdd (aero, fld, __RC__) + call MAPL_StateAdd (aero_aci, fld, __RC__) + + if (.not. data_driven) then +! Set klid + call MAPL_GetPointer(import, ple, 'PLE', __RC__) + call findKlid (self%klid, self%plid, ple, __RC__) +! Set SS values to 0 where above klid + call MAPL_GetPointer (internal, int_ptr, 'SS', __RC__) + call setZeroKlid4d (self%km, self%klid, int_ptr) + end if + +do i = 1, 5 + if(mapl_am_i_root()) print*,'n = ', n,' : INIT SS2G sum(ss00n) = ',sum(int_ptr(:,:,:,i)) +end do + + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', value=self%fscav(1), __RC__) + + if (data_driven) then + instance = instanceData + + do i = 1, self%nbins + write (bin_index, '(A, I0.3)') '', i +! Dry deposition + call append_to_bundle('SSDP'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition (Convective scavenging) + call append_to_bundle('SSSV'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition + call append_to_bundle('SSWT'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + +! Gravitational Settling + call append_to_bundle('SSSD'//trim(bin_index), providerState, prefix, Bundle_DP, __RC__) + end do + else + instance = instanceComputational + +! Dry deposition + call append_to_bundle('SSDP', providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition (Convective scavenging) + call append_to_bundle('SSSV', providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition + call append_to_bundle('SSWT', providerState, prefix, Bundle_DP, __RC__) + +! Gravitational Settling + call append_to_bundle('SSSD', providerState, prefix, Bundle_DP, __RC__) + end if + + self%instance = instance + +! Create Radiation Mie Table +! -------------------------- + call MAPL_GetResource (MAPL, NUM_BANDS, 'NUM_BANDS:', __RC__) + +! Get file names for the optical tables + call ESMF_ConfigGetAttribute (cfg, self%rad_MieTable(instance)%optics_file, & + label="aerosol_radBands_optics_file:", __RC__ ) + + allocate (self%rad_MieTable(instance)%channels(NUM_BANDS), __STAT__ ) + + call ESMF_ConfigGetAttribute (cfg, self%rad_MieTable(instance)%channels, label= "BANDS:", & + count=self%rad_MieTable(instance)%nch, rc=status) + + if (rc /= 0) then + do i = 1, NUM_BANDS + self%rad_MieTable(instance)%channels(i) = i + end do + end if + + allocate (self%rad_MieTable(instance)%mie_aerosol, __STAT__) + self%rad_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%rad_MieTable(instance)%optics_file, rc) + call Chem_MieTableRead (self%rad_MieTable(instance)%mie_aerosol, NUM_BANDS, self%rad_MieTable(instance)%channels, rc) + +! Create Diagnostics Mie Table +! ----------------------------- +! Get file names for the optical tables + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%optics_file, & + label="aerosol_monochromatic_optics_file:", __RC__ ) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%nch, label="n_channels:", __RC__) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%nmom, label="n_moments:", default=0, __RC__) + allocate (self%diag_MieTable(instance)%channels(self%diag_MieTable(instance)%nch), __STAT__ ) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%channels, & + label= "aerosol_monochromatic_optics_wavelength:", __RC__) + + allocate (self%diag_MieTable(instance)%mie_aerosol, __STAT__) + self%diag_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%diag_MieTable(instance)%optics_file, __RC__ ) + call Chem_MieTableRead (self%diag_MieTable(instance)%mie_aerosol, self%diag_MieTable(instance)%nch, & + self%diag_MieTable(instance)%channels, rc, nmom=self%diag_MieTable(instance)%nmom) + + ! Mie Table instance/index + call ESMF_AttributeSet(aero, name='mie_table_instance', value=instance, __RC__) + + ! Add variables to SS instance's aero state. This is used in aerosol optics calculations + call add_aero (aero, label='air_pressure_for_aerosol_optics', label2='PLE', grid=grid, typekind=MAPL_R4, __RC__) + call add_aero (aero, label='relative_humidity_for_aerosol_optics', label2='RH', grid=grid, typekind=MAPL_R4,__RC__) +! call ESMF_StateGet (import, 'PLE', field, __RC__) +! call MAPL_StateAdd (aero, field, __RC__) +! call ESMF_StateGet (import, 'RH2', field, __RC__) +! call MAPL_StateAdd (aero, field, __RC__) + + call add_aero (aero, label='extinction_in_air_due_to_ambient_aerosol', label2='EXT', grid=grid, typekind=MAPL_R8,__RC__) + call add_aero (aero, label='single_scattering_albedo_of_ambient_aerosol', label2='SSA', grid=grid, typekind=MAPL_R8,__RC__) + call add_aero (aero, label='asymmetry_parameter_of_ambient_aerosol', label2='ASY', grid=grid, typekind=MAPL_R8,__RC__) + + call ESMF_AttributeSet(aero, name='band_for_aerosol_optics', value=0, __RC__) + + mieTable_pointer = transfer(c_loc(self), [1]) + call ESMF_AttributeSet(aero, name='mieTable_pointer', valueList=mieTable_pointer, itemCount=size(mieTable_pointer), __RC__) + + call ESMF_AttributeSet(aero, name='internal_varaible_name', value='SS', __RC__) + + call ESMF_MethodAdd(AERO, label='aerosol_optics', userRoutine=aerosol_optics, __RC__) + +! Mask to prevent emissions from the Great Lakes and the Caspian Sea +! ------------------------------------------------------------------ + allocate(self%deep_lakes_mask(ubound(lons, 1),ubound(lons, 2)), __STAT__) + call deepLakesMask (lons, lats, real(MAPL_RADIANS_TO_DEGREES), self%deep_lakes_mask, rc) + + RETURN_(ESMF_SUCCESS) + + end subroutine Initialize + +!============================================================================ + +!BOP +! !IROUTINE: Run + +! !INTERFACE: + subroutine Run (GC, import, export, clock, rc) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: rc ! Error code: + +! !DESCRIPTION: Run method for the Sea Salt Grid Component. Determines whether to run +! data or computational run method. + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_State) :: internal + + logical :: data_driven + + __Iam__('Run') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'// Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=internal, __RC__) + +! Is SS data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Update INTERNAL state variables with ExtData +! --------------------------------------------- + if (data_driven) then + call Run_data (GC, import, export, internal, __RC__) + else + call Run1 (GC, import, export, clock, __RC__) + end if + + RETURN_(ESMF_SUCCESS) + + end subroutine Run + +!============================================================================ +!BOP +! !IROUTINE: Run1 + +! !INTERFACE: + subroutine Run1 (GC, import, export, clock, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Computes emissions/sources for Sea Salt + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: mapl + type (ESMF_State) :: internal + type (ESMF_Grid) :: grid + type (wrap_) :: wrap + type (SS2G_GridComp), pointer :: self + + real, allocatable, dimension(:,:) :: fgridefficiency + real, allocatable, dimension(:,:) :: fsstemis + real, allocatable, dimension(:,:) :: fhoppel + real, allocatable, dimension(:,:) :: memissions, nemissions, dqa + + real(kind=DP), allocatable, dimension(:,:) :: gweibull + + integer :: n + +#include "SS2G_DeclarePointer___.h" + + __Iam__('Run1') + +!***************************************************************************** +! Begin... + +!if(mapl_am_i_root()) print*,'SS2G Run1 BEGIN' + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'// Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, mapl, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (mapl, INTERNAL_ESMF_STATE=internal, __RC__) + +#include "SS2G_GetPointer___.h" + +do n=1,5 + if(mapl_am_i_root()) print*,'n = ', n,' : Run1 B SS2G sum(ss00n) = ',sum(SS(:,:,:,n)) +end do + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'SS2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Sea Salt Source (and modifications) +! ----------------------------------- +! Grid box efficiency to emission (fraction of sea water) + allocate(fgridefficiency, mold=frocean, __STAT__ ) + fgridefficiency = min(max(0.,(frocean-fraci)*self%deep_lakes_mask),1.) + +! Apply SST correction following Jaegle et al. 2011 if needed +! ------------------------------------------------------------ + allocate(fsstemis, mold=frocean, __STAT__ ) + call jeagleSSTcorrection(self%sstEmisFlag, fsstemis, ts, __RC__) + +! Apply a Weibull distribution to emissions wind speeds +! ----------------------------------------------------- + allocate(gweibull(ubound(u10m,1), ubound(u10m,2)), __STAT__ ) + call weibullDistribution (gweibull, self%weibullFlag, u10m, v10m, __RC__) + +! Loop over bins and do emission calculation +! Possibly apply the Hoppel correction based on fall speed (Fan and Toon, 2011) +! ----------------------------------------------- + allocate(fhoppel, mold=frocean, __STAT__ ) + allocate(memissions, mold=frocean, __STAT__ ) + allocate(nemissions, mold=frocean, __STAT__ ) + allocate(dqa, mold=frocean, __STAT__ ) + + fhoppel = 1.0 + + do n = 1, self%nbins + memissions = 0. + nemissions = 0. + dqa = 0. + + call SeasaltEmission (self%rlow(n), self%rup(n), self%emission_scheme, u10m, & + v10m, ustar, memissions, nemissions, __RC__ ) + +! For the Hoppel correction need to compute the wet radius and settling velocity +! in the surface + if (self%hoppelFlag) then + call hoppelCorrection (self%radius(n)*1.e-6, self%rhop(n), rh2(:,:,self%km), & + dz, ustar, self%rhFlag, airdens(:,:,self%km), t(:,:,self%km), & + chemGRAV, MAPL_KARMAN, fhoppel, __RC__) + end if + + memissions = self%emission_scale * fgridefficiency * fsstemis * fhoppel * gweibull * memissions + dqa = memissions * self%cdt * chemgrav / delp(:,:,self%km) + SS(:,:,self%km,n) = SS(:,:,self%km,n) + dqa + + if (associated(SSEM)) then + SSEM(:,:,n) = memissions + end if + end do !n = 1 + +do n=1,5 + if(mapl_am_i_root()) print*,'n = ', n,' : Run1 E SS2G sum(ss00n) = ',sum(SS(:,:,:,n)) +end do + + deallocate(fhoppel, memissions, nemissions, dqa, gweibull, & + fsstemis, fgridefficiency, __STAT__) + + RETURN_(ESMF_SUCCESS) + + end subroutine Run1 + +!============================================================================ +!BOP +! !IROUTINE: Run2 + +! !INTERFACE: + + subroutine Run2 (GC, import, export, clock, RC) + + ! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Run2 method for the Dust Grid Component. + +!EOP +!============================================================================ +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_State) :: internal + type (wrap_) :: wrap + type (SS2G_GridComp), pointer :: self + + integer :: n + real, allocatable, dimension(:,:) :: drydepositionfrequency, dqa + real :: fwet + logical :: KIN + + +#include "SS2G_DeclarePointer___.h" + + __Iam__('Run2') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' // Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=INTERNAL, __RC__) + +#include "SS2G_GetPointer___.h" + +do n=1,5 + if(mapl_am_i_root()) print*,'n = ', n,' : Run2 B SS2G sum(ss00n) = ',sum(SS(:,:,:,n)) +end do + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'SS2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + + allocate(dqa, mold=lwi, __STAT__) + allocate(drydepositionfrequency, mold=lwi, __STAT__) + +! Sea Salt Settling +! ----------------- + do n = 1, self%nbins + call Chem_Settling2Gorig (self%km, self%klid, self%rhFlag, n, SS(:,:,:,n), CHEMgrav, delp, & + self%radius(n)*1.e-6, self%rhop(n), self%cdt, t, airdens, & + rh2, zle, SSSD, __RC__) + end do + +! Deposition +! ----------- + drydepositionfrequency = 0. + call DryDeposition(self%km, t, airdens, zle, lwi, ustar, zpbl, sh,& + MAPL_KARMAN, cpd, chemGRAV, z0h, drydepositionfrequency, __RC__ ) + + ! increase deposition velocity over land + where (abs(lwi - LAND) < 0.5) + drydepositionfrequency = 5.0 * drydepositionfrequency + end where + + do n = 1, self%nbins + dqa = 0. + dqa = max(0.0, SS(:,:,self%km,n)*(1.-exp(-drydepositionfrequency*self%cdt))) + SS(:,:,self%km,n) = SS(:,:,self%km,n) - dqa + if (associated(SSDP)) then + SSDP(:,:,n) = dqa * delp(:,:,self%km) / chemGRAV / self%cdt + end if + end do + +! Large-scale Wet Removal +! ------------------------ + KIN = .TRUE. + do n = 1, self%nbins + fwet = 1. + call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, n, self%cdt, 'sea_salt', & + KIN, chemGRAV, fwet, SS(:,:,:,n), ple, t, airdens, & + pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, SSWT, rc) + end do + +! Compute diagnostics +! ------------------- + call Aero_Compute_Diags (self%diag_MieTable(self%instance), self%km, self%klid, 1, self%nbins, self%rlow,& + self%rup, self%diag_MieTable(self%instance)%channels, SS, chemGRAV, t, airdens, & + rh2, u, v, delp, SSSMASS, SSCMASS, SSMASS, SSEXTTAU, SSSCATAU, & + SSSMASS25, SSCMASS25, SSMASS25, SSEXTT25, SSSCAT25, & + SSFLUXU, SSFLUXV, SSCONC, SSEXTCOEF, SSSCACOEF, & + SSEXTTFM, SSSCATFM ,SSANGSTR, SSAERIDX, __RC__) + +do n=1,5 + if(mapl_am_i_root()) print*,'n = ', n,' : Run2 E SS2G sum(ss00n) = ',sum(SS(:,:,:,n)) +end do + + RETURN_(ESMF_SUCCESS) + + end subroutine Run2 + +!============================================================================ +!BOP +! !IROUTINE: Run_data -- ExtData Sea Salt Grid Component + +! !INTERFACE: + + subroutine Run_data (GC, IMPORT, EXPORT, INTERNAL, RC) + + ! !ARGUMENTS: + + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: IMPORT ! Import state + type (ESMF_State), intent(inout) :: EXPORT ! Export state + type (ESMF_State), intent(inout) :: INTERNAL ! Interal state + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. + +!EOP +!============================================================================ +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (wrap_) :: wrap + type (SS2G_GridComp), pointer :: self + + integer :: i + character (len=ESMF_MAXSTR) :: field_name + + real, pointer, dimension(:,:,:,:) :: ptr4d_int + real, pointer, dimension(:,:,:) :: ptr3d_imp + + __Iam__('Run_data') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'//Iam + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'SS2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Update interal data pointers with ExtData +! ----------------------------------------- + call MAPL_GetPointer (internal, NAME='SS', ptr=ptr4d_int, __RC__) + + do i = 1, self%nbins + write(field_name, '(A, I0.3)') 'ss', i + call MAPL_GetPointer (import, NAME='clim'//trim(field_name), ptr=ptr3d_imp, __RC__) + + ptr4d_int(:,:,:,i) = ptr3d_imp + end do + + RETURN_(ESMF_SUCCESS) + + end subroutine Run_data + + +!------------------------------------------------------------------------------------- + subroutine aerosol_optics(state, rc) + + implicit none + +! !ARGUMENTS: + type (ESMF_State) :: state + integer, intent(out) :: rc + +! !Local + integer, parameter :: DP=kind(1.0d0) + real, dimension(:,:,:), pointer :: ple, rh + real(kind=DP), dimension(:,:,:), pointer :: var + real, dimension(:,:,:,:), pointer :: q, q_4d + integer, allocatable :: opaque_self(:) + type(C_PTR) :: address + type(SS2G_GridComp), pointer :: self + + character (len=ESMF_MAXSTR) :: fld_name, int_fld_name + type(ESMF_Field) :: fld + + real(kind=DP), dimension(:,:,:), allocatable :: ext_s, ssa_s, asy_s ! (lon:,lat:,lev:) + real, dimension(:,:,:), allocatable :: x + integer :: instance + integer :: n, nbins + integer :: i1, j1, i2, j2, km + integer :: band, offset + integer, parameter :: n_bands = 1 + integer :: k + + __Iam__('SS2G::aerosol_optics') + +! Begin... + +! Mie Table instance/index +! ------------------------ + call ESMF_AttributeGet(state, name='mie_table_instance', value=instance, __RC__) + +! Radiation band +! -------------- + band = 0 + call ESMF_AttributeGet(state, name='band_for_aerosol_optics', value=band, __RC__) + offset = band - n_bands + +! Pressure at layer edges +! ------------------------ + call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, ple, trim(fld_name), __RC__) + +! call MAPL_GetPointer (state, ple, 'PLE', __RC__) + + i1 = lbound(ple, 1); i2 = ubound(ple, 1) + j1 = lbound(ple, 2); j2 = ubound(ple, 2) + km = ubound(ple, 3) + +! Relative humidity +! ----------------- + call ESMF_AttributeGet(state, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, rh, trim(fld_name), __RC__) + +! call MAPL_GetPointer (state, rh, 'RH2', __RC__) + + allocate(ext_s(i1:i2, j1:j2, km), & + ssa_s(i1:i2, j1:j2, km), & + asy_s(i1:i2, j1:j2, km), & + x(i1:i2, j1:j2, km), __STAT__) + + call ESMF_AttributeGet(state, name='internal_varaible_name', value=int_fld_name, __RC__) + call ESMF_StateGet (state, trim(int_fld_name), field=fld, __RC__) !add as attribute - dont hard code? + call ESMF_FieldGet (fld, farrayPtr=q, __RC__) + + nbins = size(q,4) + + allocate(q_4d(i1:i2, j1:j2, km, nbins), __STAT__) + + do n = 1, nbins + do k = 1, km + x(:,:,k) = ((PLE(:,:,k) - PLE(:,:,k-1))*0.01)*(100./MAPL_GRAV) + q_4d(:,:,k,n) = x(:,:,k) * q(:,:,k,n) + end do + end do + + call ESMF_AttributeGet(state, name='mieTable_pointer', itemCount=n, __RC__) + allocate (opaque_self(n), __STAT__) + call ESMF_AttributeGet(state, name='mieTable_pointer', valueList=opaque_self, __RC__) + + address = transfer(opaque_self, address) + call c_f_pointer(address, self) + + call mie_ (self%rad_MieTable(instance), nbins, n_bands, offset, q_4d, rh, ext_s, ssa_s, asy_s, __RC__) + + call ESMF_AttributeGet(state, name='extinction_in_air_due_to_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ext_s(:,:,:) + end if + + call ESMF_AttributeGet(state, name='single_scattering_albedo_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ssa_s(:,:,:) + end if + + call ESMF_AttributeGet(state, name='asymmetry_parameter_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = asy_s(:,:,:) + end if + + deallocate(ext_s, ssa_s, asy_s, __STAT__) + deallocate(q_4d, __STAT__) + + RETURN_(ESMF_SUCCESS) + + contains + + subroutine mie_(mie_table, nbins, nb, offset, q, rh, bext_s, bssa_s, basym_s, rc) + + implicit none + + type(Chem_Mie), intent(inout) :: mie_table ! mie table + integer, intent(in ) :: nbins ! number of bins + integer, intent(in ) :: nb ! number of bands + integer, intent(in ) :: offset ! bands offset + real, intent(in ) :: q(:,:,:,:) ! aerosol mass mixing ratio, kg kg-1 + real, intent(in ) :: rh(:,:,:) ! relative humidity + real(kind=8), intent( out) :: bext_s (size(ext_s,1),size(ext_s,2),size(ext_s,3)) + real(kind=8), intent( out) :: bssa_s (size(ext_s,1),size(ext_s,2),size(ext_s,3)) + real(kind=8), intent( out) :: basym_s(size(ext_s,1),size(ext_s,2),size(ext_s,3)) + integer, intent(out) :: rc + + ! local + integer :: l + real :: bext (size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! extinction + real :: bssa (size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! SSA + real :: gasym(size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! asymmetry parameter + + __Iam__('SS2G::aerosol_optics::mie_') + + bext_s = 0.0d0 + bssa_s = 0.0d0 + basym_s = 0.0d0 + + do l = 1, nbins + call Chem_MieQuery(mie_table, l, real(offset+1.), q(:,:,:,l), rh, bext, gasym=gasym, ssa=bssa) + + bext_s = bext_s + bext ! extinction + bssa_s = bssa_s + (bssa*bext) ! scattering extinction + basym_s = basym_s + gasym*(bssa*bext) ! asymetry parameter multiplied by scatering extiction + end do + + RETURN_(ESMF_SUCCESS) + + end subroutine mie_ + + end subroutine aerosol_optics + +end module SS2G_GridCompMod + diff --git a/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridComp_ExtData.rc b/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridComp_ExtData.rc new file mode 100644 index 00000000..0582c647 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridComp_ExtData.rc @@ -0,0 +1,44 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +# SS.data - 3D +climss001 'kg kg-1' Y N 0 0.0 1.0 ss001 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss002 'kg kg-1' Y N 0 0.0 1.0 ss002 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss003 'kg kg-1' Y N 0 0.0 1.0 ss003 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss004 'kg kg-1' Y N 0 0.0 1.0 ss004 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss005 'kg kg-1' Y N 0 0.0 1.0 ss005 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 + + +# SS.data - 2D + + +climSSDP001 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT001 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD001 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV001 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP002 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT002 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD002 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV002 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP003 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT003 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD003 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV003 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP004 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT004 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD004 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV004 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP005 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT005 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD005 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV005 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +%% + diff --git a/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridComp_SS.data.rc b/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridComp_SS.data.rc new file mode 100755 index 00000000..0beb49e7 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridComp_SS.data.rc @@ -0,0 +1,54 @@ +# +# Resource file for SS parameters. +# + +bins: 5 + + +variable_table:: + +# Name Units Long Name +# ----- ------ ---------------------- +ss001 'kg kg-1' 'Sea Salt Mixing Ratio (bin001)' +ss002 'kg kg-1' 'Sea Salt Mixing Ratio (bin002)' +ss003 'kg kg-1' 'Sea Salt Mixing Ratio (bin003)' +ss004 'kg kg-1' 'Sea Salt Mixing Ratio (bin004)' +ss005 'kg kg-1' 'Sea Salt Mixing Ratio (bin005)' +:: + + +OPTICS_FILE: ExtData/MERRA2/x/opticsBands_SS.v3_3.RRTMG.nc + +NUM_BANDS: 30 + + +particle_radius: 0.079 0.316 1.119 2.818 7.772 + +radius_lower: 0.03 0.1 0.5 1.5 5.0 + +radius_upper: 0.1 0.5 1.5 5.0 10.0 + +SS_density: 2200. 2200. 2200. 2200. 2200. + +# Scavenging efficiency per bin [km-1] +fscav: 0.4 0.4 0.4 0.4 0.4 # + +# Emissions methods and scaling +emission_scheme: 3 # 1 for Gong 2003, 2 for ... +emission_scale: 0.875 0.875 0.875 0.612 0.612 0.612 # a global scaling factor +sstemisFlag: 2 # Apply a correction to emissions based on SST (see code) +hoppelFlag: 0 # Apply Hoppel correction (set non-zero, see Fan and Toon 2011) +weibullFlag: 0 # Apply Weibull distribution (set non-zero, see Fan and Toon 2011) + +# Method of apply relative humidity to particle radius +rhFlag: 2 # RH swelling of Seasalt (1 for Fitzgerald 1975, + # 2 for Gerber 1985 method) + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.058 0.058 0.058 0.058 0.058 + +# Number of particles per kg mass +fnum: 3.017e17 1.085e16 1.207e14 9.391e12 2.922e11 + +# Number median radius [um] +particle_radius_number: 0.066 0.176 0.885 2.061 6.901 diff --git a/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridComp_SS.rc b/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridComp_SS.rc new file mode 100644 index 00000000..d02da9dc --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridComp_SS.rc @@ -0,0 +1,46 @@ +# +# Resource file Sea Salt parameters +# + +aerosol_radBands_optics_file: ExtData/MERRA2/x/opticsBands_SS.v3_3.RRTMG.nc + +aerosol_monochromatic_optics_file: ExtData/AeroCom/x/optics_SS.v3_3.nc +aerosol_monochromatic_optics_wavelength: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 ! units: nm +n_channels: 4 + +particle_radius_microns: 0.079 0.316 1.119 2.818 7.772 + +radius_lower: 0.03 0.1 0.5 1.5 5.0 + +radius_upper: 0.1 0.5 1.5 5.0 10.0 + +particle_density: 2200. 2200. 2200. 2200. 2200. + +# Scavenging efficiency per bin [km-1] +fscav: 0.4 0.4 0.4 0.4 0.4 + +# Emissions methods and scaling +emission_scheme: 3 # 1 for Gong 2003, 2 for ... +emission_scale: 0.613 0.613 0.613 0.429 0.429 0.429 # a global scaling factor +sstEmisFlag: 2 # Apply a correction to emissions based on SST (see code) +hoppelFlag: .true. # Apply Hoppel correction (set non-zero, see Fan and Toon 2011) +weibullFlag: .true. # Apply Weibull distribution (set non-zero, see Fan and Toon 2011) + +# Method of apply relative humidity to particle radius +rhFlag: 2 # RH swelling of Seasalt (1 for Fitzgerald 1975, + # 2 for Gerber 1985 method) + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.058 0.058 0.058 0.058 0.058 + +# Number of particles per kg mass +fnum: 3.017e17 1.085e16 1.207e14 9.391e12 2.922e11 + +# Number median radius [um] +particle_radius_number: 0.066 0.176 0.885 2.061 6.901 + +nbins: 5 + +pressure_lid_in_hPa: 0.01 + + diff --git a/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_StateSpecs.rc b/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_StateSpecs.rc new file mode 100644 index 00000000..f97d3015 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_StateSpecs.rc @@ -0,0 +1,106 @@ +schema_version: 2.0.0 +component: SS + +category: IMPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS| Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC| COND | LONG NAME +#---------------------------------------------------------------------------------------- + FROCEAN | 1 | xy | N | | fraction_of_ocean + FRACI | 1 | xy | N | | ice_covered_fraction_of_tile + LWI | 1 | xy | N | | land-ocean-ice_mask + U10M | m s-1 | xy | N | | 10-meter_eastward_wind + V10M | m s-1 | xy | N | | 10-meter_northward_wind + USTAR | m s-1 | xy | N | | surface_velocity_scale + TS | K | xy | N | | surface skin temperature + DZ | m | xy | N | | surface_layer_height + FRLAKE | 1 | xy | N | | fraction_of_lake + AREA | m^2 | xy | N | | agrid_cell_area + ZPBL | m | xy | N | | planetary_boundary_layer_height + SH | w m-2 | xy | N | | sensible_heat_flux_from_turbulence + Z0H | m | xy | N | | surface_roughness_for_heat + CN_PRCP |kg/m^2/s| xy | N | | surface_conv._rain_flux_needed_by_land + NCN_PRCP |kg/m^2/s| xy | N | | Non-convective precipitation +#........................................................................................ + AIRDENS | kg/m^3 | xyz | C | | moist_air_density + DELP | Pa | xyz | C | | pressure_thickness + T | K | xyz | C | | air_temperature + RH2 | 1 | xyz | C | | Rel_Hum_after_moist + ZLE | m | xyz | E | | geopotential_height + PLE | Pa | xyz | E | | air_pressure + PFL_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_liquid_nonconvective_precipitation + PFI_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_ice_nonconvective_precipitation + U | m s-1 | xyz | C | | eastward_wind + V | m s-1 | xyz | C | | northward_wind + +category: EXPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS| VLOC| UNGRIDDED | LONG_NAME +#---------------------------------------------------------------------------------------- + SSMASS | kg kg-1 | xyz | C | | Sea Salt Mass Mixing Ratio __ENSEMBLE__ + SSMASS25 | kg kg-1 | xyz | C | | Sea Salt Mass Mixing Ratio - PM 2.5 __ENSEMBLE__ + SSCONC | kg m-3 | xyz | C | | Sea Salt Mass Concentration __ENSEMBLE__ + SSEXTCOEF | m-1 | xyz | C | | Sea Salt Extinction Coefficient [550 nm] __ENSEMBLE__ + SSSCACOEF | m-1 | xyz | C | | Sea Salt Scattering Coefficient [550 nm] __ENSEMBLE__ +#..........|............|.....|.....|............|.................................. + SSEM | kg m-2 s-1 | xy | N | self%nbins | Sea Salt Emission All Bins __ENSEMBLE__ + SSSD | kg m-2 s-1 | xy | N | self%nbins | Sea Salt Sedimentation All Bins __ENSEMBLE__ + SSDP | kg m-2 s-1 | xy | N | self%nbins | Sea Salt Dry Deposition All Bins __ENSEMBLE__ + SSWT | kg m-2 s-1 | xy | N | self%nbins | Sea Salt Wet Deposition All Bins __ENSEMBLE__ + SSSV | kg m-2 s-1 | xy | N | self%nbins | Sea Salt Convective Scavenging All Bins __ENSEMBLE__ + SSSMASS | kg m-3 | xy | N | | Sea Salt Surface Mass Concentration __ENSEMBLE__ + SSCMASS | kg m-2 | xy | N | | Sea Salt Column Mass Density __ENSEMBLE__ + SSEXTTAU | 1 | xy | N | | Sea Salt Extinction AOT [550 nm] __ENSEMBLE__ + SSSCATAU | 1 | xy | N | | Sea Salt Scattering AOT [550 nm] __ENSEMBLE__ + SSSMASS25 | kg m-3 | xy | N | | Sea Salt Surface Mass Concentration - PM 2.5 __ENSEMBLE__ + SSCMASS25 | kg m-2 | xy | N | | Sea Salt Column Mass Density - PM 2.5 __ENSEMBLE__ + SSEXTT25 | 1 | xy | N | | Sea Salt Extinction AOT [550 nm] - PM 2.5 __ENSEMBLE__ + SSSCAT25 | 1 | xy | N | | Sea Salt Scattering AOT [550 nm] - PM 2.5 __ENSEMBLE__ + SSAERIDX | 1 | xy | N | | Sea Salt TOMS UV Aerosol Index __ENSEMBLE__ + SSEXTTFM | 1 | xy | N | | Sea Salt Extinction AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + SSSCATFM | 1 | xy | N | | Sea Salt Scattering AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + SSANGSTR | 1 | xy | N | | Sea Salt Angstrom parameter [470-870 nm] __ENSEMBLE__ + SSFLUXU | kg m-1 s-1 | xy | N | | Sea Salt column u-wind mass flux __ENSEMBLE__ + SSFLUXV | kg m-1 s-1 | xy | N | | Sea Salt column v-wind mass flux __ENSEMBLE__ + + +category: INTERNAL +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSION | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC | UNGRIDDED | RESTART | ADD2EXPORT | FRIENDLYTO | LONG NAME +#---------------------------------------------------------------------------------------- + SS |kg kg-1| xyz | C | self%nbins | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Sea Salt Mixing Ratio all bins + + +#******************************************************** +# +# Legend +# +#------------------------------------------------------------------ +# Column label | MAPL keyword/interpretation | Default +#--------------|--------------------------------------------------- +# NAME | short_name | +# UNITS | units | +# DIMS | dims | +# VLOC | VLocation | MAPL_VLocationNone +# LONG NAME | long_name | +# COND | if () then | .FALSE. +# NUM_SUBTILES | num_subtiles +# ... +#------------------------------------------------------------------ +# +#-------------------------------------------- +# Entry alias | Column | MAPL keyword/interpretation +#--------------|----------------------------- +# xyz | DIMS | MAPL_HorzVert +# xy | DIMS | MAPL_HorzOnly +# z | DIMS | MAPL_VertOnly (plus ungridded) +# C | VLOC | MAPL_VlocationCenter +# E | VLOC | MAPL_VlocationEdge +# N | VLOC | MAPL_VlocationNone +#-------------------------------------------- + diff --git a/ESMF/GOCART2G_GridComp/SU2G_GridComp/CMakeLists.txt b/ESMF/GOCART2G_GridComp/SU2G_GridComp/CMakeLists.txt new file mode 100644 index 00000000..0a73300c --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SU2G_GridComp/CMakeLists.txt @@ -0,0 +1,16 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES GA_GridComp MAPL Chem_Shared2G GMAO_mpeu Process_Library) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +mapl_acg (${this} SU2G_StateSpecs.rc + IMPORT_SPECS EXPORT_SPECS INTERNAL_SPECS + GET_POINTERS DECLARE_POINTERS) + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 new file mode 100644 index 00000000..c4414903 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 @@ -0,0 +1,1362 @@ +#include "MAPL_Generic.h" + +!============================================================================= +!BOP + +! !MODULE: SU2G_GridCompMod - GOCART refactoring of the SU gridded component + +! !INTERFACE: +module SU2G_GridCompMod + +! !USES: + use ESMF + use MAPL + use Chem_MieTableMod2G + use Chem_AeroGeneric + use iso_c_binding, only: c_loc, c_f_pointer, c_ptr + + use GOCART2G_Process ! GOCART2G process library + use GA_GridCompMod + use m_StrTemplate ! string templates + + implicit none + private + + integer, parameter :: instanceComputational = 1 + integer, parameter :: instanceData = 2 + + integer, parameter :: DP=kind(1.0d0) + +! gram molecular weights of species + real, parameter :: fMassSulfur = 32., fMassSO2 = 64., fMassSO4 = 96., & + fMassDMS = 62., fMassMSA = 96. + + real, parameter :: airmw = 28.97 ! molecular weight of air + real, parameter :: nAvogadro = 6.022e23 ! molecules per mole of air + + real, parameter :: cpd = 1004.16 + real, parameter :: undefval = 1.e15 ! missing value + real, parameter :: chemgrav = 9.80616 + +! relative position of sulfate tracers + integer, parameter :: nDMS = 1, & + nSO2 = 2, & + nSO4 = 3, & + nMSA = 4 + +! !PUBLIC MEMBER FUNCTIONS: + PUBLIC SetServices + + +! !DESCRIPTION: This module implements GOCART's Sulfer (SU) Gridded Component. + +! !REVISION HISTORY: +! 08July2020 Sherman, da Silva, Darmenov, Clune - First attempt at refactoring. + +!EOP +!=========================================================================== +! !Sulfer state + type, extends(GA_GridComp) :: SU2G_GridComp + integer :: myDOW = -1 ! my Day of the week: Sun=1, Mon=2,...,Sat=7 + logical :: using_GMI_OH + logical :: using_GMI_NO3 + logical :: using_GMI_H2O2 + logical :: diurnal_bb ! diurnal biomass burning + integer :: nymd_last = -1 ! Previous nymd. Updated daily + integer :: nymd_oxidants = -1 ! Update the oxidant files? + real :: eAircraftFuel ! Aircraft emission factor: go from kg fuel to kg SO2 + real :: aviation_layers(4) ! heights of the LTO, CDS and CRS layers + real :: fSO4anth ! Fraction of anthropogenic emissions that are SO4 + logical :: recycle_H2O2 = .false. + logical :: firstRun = .true. + real, allocatable :: sigma(:) ! Sigma of lognormal number distribution + real, pointer :: h2o2_init(:,:,:) + +! Special handling for volcanic emissions + character(len=255) :: volcano_srcfilen + integer :: nVolc = 0 + real, allocatable, dimension(:) :: vLat, & + vLon, & + vSO2, & + vElev, & + vCloud + integer, allocatable, dimension(:) :: vStart, & + vEnd +! !Workspae for point emissions + logical :: doing_point_emissions = .false. + character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions + integer :: nPts = -1 + integer, allocatable, dimension(:) :: pstart, pend + real, allocatable, dimension(:) :: pLat, & + pLon, & + pBase, & + pTop, & + pEmis + end type SU2G_GridComp + + type wrap_ + type (SU2G_GridComp), pointer :: PTR => null() + end type wrap_ + +contains + +!============================================================================ +!BOP + +! !IROUTINE: SetServices + +! !INTERFACE: + subroutine SetServices ( GC, RC ) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(INOUT) :: GC ! gridded component + integer, intent( OUT) :: RC ! return code + +! DESCRIPTION: This version uses MAPL_GenericSetServices, which sets +! the Initialize and Finalize services to generic versions. It also +! allocates our instance of a generic state and puts it in the +! gridded component (GC). Here we only set the two-stage run method +! and declare the data services. + +! !REVISION HISTORY: +! 08July2020 E.Sherman, A.Da Silva, A.Darmenov, T.Clune First attempt at refactoring + +!EOP +!============================================================================ +! + +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (ESMF_Config) :: cfg + type (wrap_) :: wrap + type (SU2G_GridComp), pointer :: self + + character (len=ESMF_MAXSTR) :: field_name + + integer :: i + real :: DEFVAL + logical :: data_driven=.true. + + __Iam__('SetServices') + +!**************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' // Iam + +if(mapl_am_i_root()) print*,trim(comp_name),'2G SetServices BEGIN' + +! Wrap internal state for storing in GC +! ------------------------------------- + allocate (self, __STAT__) + wrap%ptr => self + +! Load resource file +! ------------------- + cfg = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (cfg, 'SU2G_GridComp_'//trim(COMP_NAME)//'.rc', rc=status) + if (status /= 0) then + if (mapl_am_i_root()) print*,'SU2G_GridComp_'//trim(COMP_NAME)//'.rc does not exist! loading SU2G_GridComp_SU.data.rc instead' + call ESMF_ConfigLoadFile (cfg, 'SU2G_GridComp_SU.rc', __RC__) + end if + +! process generic config items + call self%GA_GridComp%load_from_config( cfg, __RC__) + + allocate(self%sigma(self%nbins), __STAT__) + +! process SU-specific items + call ESMF_ConfigGetAttribute(cfg, self%using_GMI_H2O2, label='using_GMI_H2O2:', __RC__) + call ESMF_ConfigGetAttribute(cfg, self%using_GMI_OH, label='using_GMI_OH:', __RC__) + call ESMF_ConfigGetAttribute(cfg, self%using_GMI_NO3, label='using_GMI_NO3:', __RC__) + call ESMF_ConfigGetAttribute(cfg, self%volcano_srcfilen, label='volcano_srcfilen:', __RC__) + call ESMF_ConfigGetAttribute(cfg, self%eAircraftFuel, label='aircraft_fuel_emission_factor:', __RC__) + call ESMF_ConfigGetAttribute(cfg, self%fSO4anth, label='so4_anthropogenic_fraction:', __RC__) + call ESMF_ConfigGetAttribute(cfg, self%sigma, label='sigma:', __RC__) + call ESMF_ConfigFindLabel (cfg, 'aviation_vertical_layers:', __RC__) + do i=1,size(self%aviation_layers) + call ESMF_ConfigGetAttribute (cfg, self%aviation_layers(i), __RC__) + end do + + call ESMF_ConfigGetAttribute (cfg, self%point_emissions_srcfilen, & + label='point_emissions_srcfilen:', default='/dev/null', __RC__) + if ( (index(self%point_emissions_srcfilen,'/dev/null')>0) ) then + self%doing_point_emissions = .false. ! disable it if no file specified + else + self%doing_point_emissions = .true. ! we are good to go + end if + +! Is SU data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Set entry points +! ------------------------ + call MAPL_GridCompSetEntryPoint (GC, ESMF_METHOD_INITIALIZE, Initialize, __RC__) + call MAPL_GridCompSetEntryPoint (GC, ESMF_METHOD_RUN, Run, __RC__) + if (data_driven .neqv. .true.) then + call MAPL_GridCompSetEntryPoint (GC, ESMF_Method_Run, Run2, __RC__) + end if + + DEFVAL = 0.0 + +! Import and Internal states if data instance +! ------------------------------------------- + if (data_driven) then + +! Pressure at layer edges +! ----------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'PLE', & + LONG_NAME = 'air_pressure', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + +! RH: is between 0 and 1 +! ---------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'RH2', & + LONG_NAME = 'Rel_Hum_after_moist', & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddInternalSpec(gc,& + short_name='SO4', & + long_name='Sulphate aerosol', & + units='kg kg-1', & + dims=MAPL_DimsHorzVert, & + vlocation=MAPL_VlocationCenter, & + restart=MAPL_RestartOptional, & +! friendlyto='DYNAMICS:TURBULENCE:MOIST', & + add2export=.true., __RC__) + + call MAPL_AddImportSpec(gc,& + short_name='climSO4', & + long_name='Sulphate aerosol', & + units='kg kg-1', & + dims=MAPL_DimsHorzVert, & + vlocation=MAPL_VlocationCenter, & + restart=MAPL_RestartOptional, __RC__) + + do i = 1, self%nbins + write(field_name, '(A, I0.3)') '', i +! ! dry deposition + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'climSUDP'//trim(field_name), & + LONG_NAME = 'Sulfate dry deposition (bin '//trim(field_name)//')', & + UNITS = 'kg kg-1 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! ! wet deposition + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'climSUWT'//trim(field_name), & + LONG_NAME = 'Sulfate wet deposition (bin '//trim(field_name)//')', & + UNITS = 'kg kg-1 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! ! gravitational settling + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'climSUSD'//trim(field_name), & + LONG_NAME = 'Sulfate settling (bin '//trim(field_name)//')', & + UNITS = 'kg kg-1 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! ! convective scavenging + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'climSUSV'//trim(field_name), & + LONG_NAME = 'Sulfate convective scavenging (bin '//trim(field_name)//')', & + UNITS = 'kg kg-1 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + end do + end if ! (data_driven) + + + if (.not. data_driven) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_H2O2', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_OH', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_NO3', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + end if + +! Import, Export, Internal states for computational instance +! ---------------------------------------------------------- + if (.not. data_driven) then +#include "SU2G_Export___.h" +#include "SU2G_Import___.h" +#include "SU2G_Internal___.h" + end if + +! This state holds fields needed by radiation +! --------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME = trim(COMP_NAME)//'_AERO', & + LONG_NAME = 'aerosols_from_'//trim(COMP_NAME), & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + DATATYPE = MAPL_StateItem, __RC__) + +! This state is needed by MOIST - It will contain aerosols +! ---------------------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME = trim(COMP_NAME)//'_AERO_ACI', & + LONG_NAME = 'aerosol_cloud_interaction_aerosols_from_'//trim(COMP_NAME), & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + DATATYPE = MAPL_StateItem, __RC__) + +! This bundle is needed by surface for snow albedo modification +! by aerosol settling and deposition +! DEVELOPMENT NOTE - Change to StateItem in future +! --------------------------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME = trim(COMP_NAME)//'_AERO_DP', & + LONG_NAME = 'aerosol_deposition_from_'//trim(COMP_NAME), & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + DATATYPE = MAPL_BundleItem, __RC__) + + +! Store internal state in GC +! -------------------------- + call ESMF_UserCompSetInternalState ( GC, 'SU2G_GridComp', wrap, STATUS ) + VERIFY_(STATUS) + +! Set generic services +! ---------------------------------- + call MAPL_GenericSetServices (GC, __RC__) + + RETURN_(ESMF_SUCCESS) + + end subroutine SetServices + +!============================================================================ +!BOP + +! !IROUTINE: Initialize + +! !INTERFACE: + subroutine Initialize (GC, IMPORT, EXPORT, CLOCK, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: IMPORT ! Import state + type (ESMF_State), intent(inout) :: EXPORT ! Export state + type (ESMF_Clock), intent(inout) :: CLOCK ! The clock + integer, optional, intent( out) :: RC ! Error code + +! !DESCRIPTION: This initializes SU Grid Component. + +! !REVISION HISTORY: +! 08July2019 E.Sherman First attempt at refactoring + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_Grid) :: grid + type (ESMF_State) :: internal + type (ESMF_State) :: aero, aero_aci + type (ESMF_State) :: providerState + type (ESMF_Config) :: cfg, cf + type (ESMF_FieldBundle) :: Bundle_DP + type (wrap_) :: wrap + type (SU2G_GridComp), pointer :: self + type (ESMF_Alarm) :: alarm_H2O2 + + integer, allocatable :: mieTable_pointer(:) + integer :: i, dims(3), km + integer :: instance + type (ESMF_Field) :: field, fld + character (len=ESMF_MAXSTR) :: prefix, diurnal_bb + real, pointer, dimension(:,:) :: lats + real, pointer, dimension(:,:) :: lons + real :: CDT ! chemistry timestep (secs) + integer :: HDT ! model timestep (secs) + real, pointer, dimension(:,:,:) :: int_ptr + logical :: data_driven + integer :: NUM_BANDS + real, pointer, dimension(:,:,:) :: ple + real, pointer, dimension(:,:) :: area + + type(ESMF_Calendar) :: calendar + type(ESMF_Time) :: currentTime + type(ESMF_Time) :: ringTime + type(ESMF_TimeInterval) :: ringInterval + integer :: year, month, day, hh, mm, ss + + real, dimension(4) :: Vect_Hcts + + __Iam__('Initialize') + +!**************************************************************************** +! Begin... + +! Get the target components name and set-up traceback handle. +! ----------------------------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, name=COMP_NAME, config=cf, __RC__) + Iam = trim(COMP_NAME) // '::' //trim(Iam) + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get my internal private state +! ----------------------------- + call ESMF_UserCompGetInternalState(GC, 'SU2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Get dimensions +! --------------- + call MAPL_GridGet (grid, globalCellCountPerDim=dims, __RC__ ) + km = dims(3) + self%km = km + +! Get DTs +! ------- + call MAPL_GetResource(mapl, HDT, Label='RUN_DT:', __RC__) + call MAPL_GetResource(mapl, CDT, Label='GOCART_DT:', default=real(HDT), __RC__) + self%CDT = CDT + +! Check whether to de-activate diurnal biomass burning (default is *on*) +! ---------------------------------------------------------------------- + call ESMF_ConfigGetAttribute(cf, diurnal_bb, label='DIURNAL_BIOMASS_BURNING:', & + default='YES', __RC__) + diurnal_bb = ESMF_UtilStringUpperCase(diurnal_bb, __RC__) + if (trim(diurnal_bb) == 'YES') then + self%diurnal_bb = .true. + else + self%diurnal_bb = .false. + end if + +! Load resource file and get number of bins +! ------------------------------------------- + cfg = ESMF_ConfigCreate (__RC__) + call ESMF_ConfigLoadFile (cfg, 'SU2G_GridComp_'//trim(COMP_NAME)//'.rc', rc=status) + if (status /= 0) then + if (mapl_am_i_root()) print*,'SU2G_GridComp_'//trim(COMP_NAME)//'.rc does not exist! & + loading SU2G_GridComp_SU.rc instead' + call ESMF_ConfigLoadFile( cfg, 'SU2G_GridComp_SU.rc', __RC__) + end if + +! Call Generic Initialize +! ---------------------------------------- + call MAPL_GenericInitialize (GC, import, export, clock, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get ( mapl, INTERNAL_ESMF_STATE = internal, & + LONS = LONS, & + LATS = LATS, __RC__ ) + + allocate(self%h2o2_init(size(lats,1),size(lats,2),self%km), __STAT__) + +! Is SU data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Set H2O2 recycle alarm +! ---------------------- + if (.not. data_driven) then + call ESMF_ClockGet(clock, calendar=calendar, currTime=currentTime, __RC__) + call ESMF_TimeGet(currentTime, YY=year, MM=month, DD=day, H=hh, M=mm, S=ss, __RC__) + call ESMF_TimeSet(ringTime, YY=year, MM=month, DD=day, H=0, M=0, S=0, __RC__) + call ESMF_TimeIntervalSet(ringInterval, H=3, calendar=calendar, __RC__) + + do while (ringTime < currentTime)! DO WE NEED THIS? + ringTime = currentTime + ringInterval + end do + + alarm_H2O2 = ESMF_AlarmCreate(Clock = clock, & + Name = 'H2O2_RECYCLE_ALARM', & + RingInterval = ringInterval, & + RingTime = currentTime, & + Enabled = .true. , & + Sticky = .false. , __RC__) + end if + +! If this is a data component, the data is provided in the import +! state via ExtData instead of the actual GOCART children +! ---------------------------------------------------------------- + if ( data_driven ) then + providerState = import + prefix = 'clim' + else + providerState = export + prefix = '' + end if + +! Add attribute information + if (.not. data_driven) then + call ESMF_StateGet (internal, 'DMS', field, __RC__) + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(1), __RC__) +! Vect_Hcts=(/0.56, 3500.0, 0.0, 0.0/) + call get_HenrysLawCts('DMS',Vect_Hcts(1),Vect_Hcts(2),Vect_Hcts(3),Vect_Hcts(4),__RC__) + call ESMF_AttributeSet(field, 'SetofHenryLawCts', Vect_Hcts, __RC__) + + call ESMF_StateGet (internal, 'SO2', field, __RC__) + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(2), __RC__) +! Vect_Hcts=(/1.4, 2900.0, 1.3E-02, 2000.0/) + call get_HenrysLawCts('SO2',Vect_Hcts(1),Vect_Hcts(2),Vect_Hcts(3),Vect_Hcts(4),__RC__) + call ESMF_AttributeSet(field, 'SetofHenryLawCts', Vect_Hcts, __RC__) + + call ESMF_StateGet (internal, 'MSA', field, __RC__) + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(4), __RC__) + end if + +! Fill AERO State with SO4 +! ---------------------------------------- + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO' , aero , __RC__) + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO_ACI', aero_aci, __RC__) + call ESMF_StateGet (export, trim(COMP_NAME)//'_AERO_DP' , Bundle_DP, __RC__) + + call ESMF_StateGet (internal, 'SO4', field, __RC__) + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', VALUE=self%fscav(3), __RC__) + fld = MAPL_FieldCreate (field, 'SO4', __RC__) + call MAPL_StateAdd (aero, fld, __RC__) + call MAPL_StateAdd (aero_aci, fld, __RC__) + + if (.not. data_driven) then +! Set klid + call MAPL_GetPointer(import, ple, 'PLE', __RC__) + call findKlid (self%klid, self%plid, ple, __RC__) +! Set internal SO4 values to 0 where above klid + call MAPL_GetPointer (internal, int_ptr, 'SO4', __RC__) + call setZeroKlid (self%km, self%klid, int_ptr) + end if + + if (data_driven) then + instance = instanceData + +! (SO4; only aerosol component; bin 003) +! Dry deposition + call append_to_bundle('SUDP003', providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition (Convective scavenging) + call append_to_bundle('SUSV003', providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition + call append_to_bundle('SUWT003', providerState, prefix, Bundle_DP, __RC__) + +! Gravitational Settling + call append_to_bundle('SUSD003', providerState, prefix, Bundle_DP, __RC__) + else + instance = instanceComputational + +! Dry deposition + call append_to_bundle('SUDP', providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition (Convective scavenging) + call append_to_bundle('SUSV', providerState, prefix, Bundle_DP, __RC__) + +! Wet deposition + call append_to_bundle('SUWT', providerState, prefix, Bundle_DP, __RC__) + +! Gravitational Settling + call append_to_bundle('SUSD', providerState, prefix, Bundle_DP, __RC__) + end if + + self%instance = instance + +! Create Radiation Mie Table +! -------------------------- + call MAPL_GetResource (MAPL, NUM_BANDS, 'NUM_BANDS:', __RC__) + +! Get file names for the optical tables + call ESMF_ConfigGetAttribute (cfg, self%rad_MieTable(instance)%optics_file, & + label="aerosol_radBands_optics_file:", __RC__ ) + + allocate (self%rad_MieTable(instance)%channels(NUM_BANDS), __STAT__ ) + + call ESMF_ConfigGetAttribute (cfg, self%rad_MieTable(instance)%channels, label= "BANDS:", & + count=self%rad_MieTable(instance)%nch, rc=status) + + if (rc /= 0) then + do i = 1, NUM_BANDS + self%rad_MieTable(instance)%channels(i) = i + end do + end if + + allocate (self%rad_MieTable(instance)%mie_aerosol, __STAT__) + self%rad_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%rad_MieTable(instance)%optics_file, rc) + call Chem_MieTableRead (self%rad_MieTable(instance)%mie_aerosol, NUM_BANDS, self%rad_MieTable(instance)%channels, rc) + +! Create Diagnostics Mie Table +! ----------------------------- +! Get file names for the optical tables + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%optics_file, & + label="aerosol_monochromatic_optics_file:", __RC__ ) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%nch, label="n_channels:", __RC__) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%nmom, label="n_moments:", default=0, __RC__) + allocate (self%diag_MieTable(instance)%channels(self%diag_MieTable(instance)%nch), __STAT__ ) + call ESMF_ConfigGetAttribute (cfg, self%diag_MieTable(instance)%channels, & + label= "aerosol_monochromatic_optics_wavelength:", __RC__) + + allocate (self%diag_MieTable(instance)%mie_aerosol, __STAT__) + self%diag_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%diag_MieTable(instance)%optics_file, __RC__ ) + call Chem_MieTableRead (self%diag_MieTable(instance)%mie_aerosol, self%diag_MieTable(instance)%nch, & + self%diag_MieTable(instance)%channels, rc, nmom=self%diag_MieTable(instance)%nmom) + + ! Mie Table instance/index + call ESMF_AttributeSet(aero, name='mie_table_instance', value=instance, __RC__) + + ! Add variables to SU instance's aero state. This is used in aerosol optics calculations + call add_aero (aero, label='air_pressure_for_aerosol_optics', label2='PLE', grid=grid, typekind=MAPL_R4, __RC__) + call add_aero (aero, label='relative_humidity_for_aerosol_optics', label2='RH', grid=grid, typekind=MAPL_R4,__RC__) +! call ESMF_StateGet (import, 'PLE', field, __RC__) +! call MAPL_StateAdd (aero, field, __RC__) +! call ESMF_StateGet (import, 'RH2', field, __RC__) +! call MAPL_StateAdd (aero, field, __RC__) + + call add_aero (aero, label='extinction_in_air_due_to_ambient_aerosol', label2='EXT', grid=grid, typekind=MAPL_R8,__RC__) + call add_aero (aero, label='single_scattering_albedo_of_ambient_aerosol', label2='SSA', grid=grid, typekind=MAPL_R8,__RC__) + call add_aero (aero, label='asymmetry_parameter_of_ambient_aerosol', label2='ASY', grid=grid, typekind=MAPL_R8,__RC__) + + call ESMF_AttributeSet(aero, name='band_for_aerosol_optics', value=0, __RC__) + + mieTable_pointer = transfer(c_loc(self), [1]) + call ESMF_AttributeSet(aero, name='mieTable_pointer', valueList=mieTable_pointer, itemCount=size(mieTable_pointer), __RC__) + + call ESMF_AttributeSet(aero, name='internal_varaible_name', value='SO4', __RC__) + + call ESMF_MethodAdd(AERO, label='aerosol_optics', userRoutine=aerosol_optics, __RC__) + + RETURN_(ESMF_SUCCESS) + + end subroutine Initialize + +!============================================================================ + +!BOP +! !IROUTINE: Run + +! !INTERFACE: + subroutine Run (GC, import, export, clock, rc) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: rc ! Error code: + +! !DESCRIPTION: Run method for the Sea Salt Grid Component. Determines whether to run +! data or computational run method. + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_State) :: internal + + logical :: data_driven + + __Iam__('Run') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'// Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=internal, __RC__) + +! Is SU data driven? +! ------------------ + call determine_data_driven (COMP_NAME, data_driven, __RC__) + +! Update INTERNAL state variables with ExtData +! --------------------------------------------- + if (data_driven) then + call Run_data (GC, import, export, internal, __RC__) + else + call Run1 (GC, import, export, clock, __RC__) + end if + + RETURN_(ESMF_SUCCESS) + + end subroutine Run + +!============================================================================ +!BOP +! !IROUTINE: Run1 + +! !INTERFACE: + subroutine Run1 (GC, import, export, clock, RC) + +! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Computes emissions/sources for Sea Salt + +!EOP +!============================================================================ +! !Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: mapl + type (ESMF_State) :: internal + type (ESMF_Grid) :: grid + type (wrap_) :: wrap + type (SU2G_GridComp), pointer :: self + type(ESMF_Time) :: time + + character(len=3) :: cdow + integer :: idow + integer :: nymd, nhms, iyr, imm, idd, ihr, imn, isc + real, pointer, dimension(:,:) :: lats + real, pointer, dimension(:,:) :: lons + real, dimension(:,:,:), allocatable :: aircraft_fuel_src + real, dimension(:,:), allocatable :: so2biomass_src, so2biomass_src_, so2anthro_l1_src, & + so2anthro_l2_src, so2ship_src, so4ship_src, dmso_conc, & + aviation_lto_src, aviation_cds_src, aviation_crs_src + integer, dimension(:), allocatable :: iPointVolc, jPointVolc, iPoint, jPoint + real, dimension(:,:,:), allocatable :: emissions_point + character (len=ESMF_MAXSTR) :: fname ! file name for point source emissions + +#include "SU2G_DeclarePointer___.h" + + __Iam__('Run1') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, grid=grid, NAME=COMP_NAME, __RC__) + Iam = trim(comp_name) //'::'// Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, mapl, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (mapl, INTERNAL_ESMF_STATE=internal, & + LONS = LONS, & + LATS = LATS, __RC__ ) + +#include "SU2G_GetPointer___.h" + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'SU2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Extract nymd(yyyymmdd) from clock +! --------------------------------- + call ESMF_ClockGet (clock, currTime=time, __RC__) + call ESMF_TimeGet (time ,YY=iyr, MM=imm, DD=idd, H=ihr, M=imn, S=isc, __RC__) + call MAPL_PackTime (nymd, iyr, imm , idd) + call MAPL_PackTime (nhms, ihr, imn, isc) + +! Reset tracer to zero at 0Z on specific day of week +! -------------------------------------------------- + idow = Chem_UtilIdow(nymd) + if ( (nhms==0) .and. (idow == self%myDOW) ) then + cdow = Chem_UtilCdow(nymd) + DMS = tiny(1.) ! avoid division by zero + SO2 = tiny(1.) ! avoid division by zero + SO4 = tiny(1.) ! avoid division by zero + MSA = tiny(1.) ! avoid division by zero + if ( MAPL_AM_I_ROOT() ) then + print *, '<> SU '//cdow//' tracer being set to zero on ', nymd, nhms + end if + end if + +! Implicit allocation with Fortran 2003 + so2anthro_l1_src = SU_ANTHROL1 + so2anthro_l2_src = SU_ANTHROL2 + so2ship_src = SU_SHIPSO2 + so4ship_src = SU_SHIPSO4 + +! As a safety check, where value is undefined set to 0 + where(1.01*so2anthro_l1_src > undefval) so2anthro_l1_src = 0. + where(1.01*so2anthro_l2_src > undefval) so2anthro_l2_src = 0. + where(1.01*so2ship_src > undefval) so2ship_src = 0. + where(1.01*so4ship_src > undefval) so4ship_src = 0. + + aircraft_fuel_src = SU_AIRCRAFT + so2biomass_src = SU_BIOMASS + dmso_conc = SU_DMSO + aviation_lto_src = SU_AVIATION_LTO + aviation_cds_src = SU_AVIATION_CDS + aviation_crs_src = SU_AVIATION_CRS + +! As a safety check, where value is undefined set to 0 + where(1.01*so2biomass_src > undefval) so2biomass_src = 0. + where(1.01*dmso_conc > undefval) dmso_conc = 0. + where(1.01*aircraft_fuel_src > undefval) aircraft_fuel_src = 0. + where(1.01*aviation_lto_src > undefval ) aviation_lto_src = 0. + where(1.01*aviation_cds_src > undefval ) aviation_cds_src = 0. + where(1.01*aviation_crs_src > undefval ) aviation_crs_src = 0. + +! Update emissions/production if necessary (daily) +! ----------------------------------------------- + if(self%nymd_last /= nymd) then + self%nymd_last = nymd + +! Get pointwise SO2 and altitude of volcanoes from a daily file data base + if(index(self%volcano_srcfilen,'volcanic_') /= 0) then + call StrTemplate (fname, self%volcano_srcfilen, xid='unknown', & + nymd=nymd, nhms=120000 ) + call ReadPointEmissions (nymd, fname, self%nVolc, self%vLat, self%vLon, & + self%vElev, self%vCloud, self%vSO2, self%vStart, & + self%vEnd, label='volcano') + self%vSO2 = self%vSO2 * fMassSO2 / fMassSulfur +! Special possible case + if(self%volcano_srcfilen(1:9) == '/dev/null') self%nVolc = 0 + end if + end if + +! Apply volcanic emissions +! ------------------------ + if (self%nVolc > 0) then + if (associated(SO2EMVE)) SO2EMVE=0.0 + if (associated(SO2EMVN)) SO2EMVN=0.0 + allocate(iPointVolc(self%nVolc), jPointVolc(self%nVolc), __STAT__) + call MAPL_GetHorzIJIndex(self%nVolc, iPointVolc, jPointVolc, & + grid = grid, & + lon = self%vLon/real(MAPL_RADIANS_TO_DEGREES), & + lat = self%vLat/real(MAPL_RADIANS_TO_DEGREES), & + rc = status) + if ( status /= 0 ) then + if (mapl_am_i_root()) print*, trim(Iam), ' - cannot get indices for point emissions' + VERIFY_(status) + end if + + call SUvolcanicEmissions (self%nVolc, self%vStart, self%vEnd, self%vSO2, self%vElev, & + self%vCloud, iPointVolc, jPointVolc, nhms, SO2EMVN, SO2EMVE, SO2, & + self%km, self%cdt, chemgrav, zle, delp, area, self%vLat, self%vLon, __RC__) + end if + +! Apply diurnal cycle if so desired + if ( self%diurnal_bb ) then + so2biomass_src_ = so2biomass_src + call Chem_BiomassDiurnal (so2biomass_src, so2biomass_src_, & + lons(:,:)*real(MAPL_RADIANS_TO_DEGREES), & + lats(:,:)*real(MAPL_RADIANS_TO_DEGREES), & + nhms, self%cdt) + end if + +! Apply sulfate emissions +! ----------------------- + call SulfateDistributeEmissions ( self%km, self%nbins, self%cdt, chemgrav, nymd, nhms, & + fMassSO4, fMassSO2, self%fSO4anth, self%eAircraftFuel, & + nSO2, nSO4, & + so2anthro_l1_src, so2anthro_l2_src, & + so2biomass_src, dmso_conc, & + so2ship_src, so4ship_src, & + aircraft_fuel_src, & + SO2, SO4, & + lwi, u10m, v10m, zle, zpbl, & + t, airdens, delp, & + SUEM, SO4EMAN, SO2EMAN, SO2EMBB, & + self%aviation_layers, & + aviation_lto_src, & + aviation_cds_src, & + aviation_crs_src, rc) + + if (associated(dms)) then + call DMSemission (self%km, self%cdt, chemgrav, t, u10m, v10m, lwi, delp, & + fMassDMS, SU_DMSO, dms, SUEM, ndms, rc) + end if + +! Read any pointwise emissions, if requested +! ------------------------------------------ + if(self%doing_point_emissions) then + call StrTemplate (fname, self%point_emissions_srcfilen, xid='unknown', & + nymd=nymd, nhms=120000 ) + call ReadPointEmissions (nymd, fname, self%nPts, self%pLat, self%pLon, & + self%pBase, self%pTop, self%pEmis, self%pStart, & + self%pEnd, label='source') + + endif + +! Get indices for point emissions +! ------------------------------- + if (self%nPts > 0) then + allocate(emissions_point, mold=delp, __STAT__) + emissions_point = 0.0 + allocate(iPoint(self%nPts), jPoint(self%nPts), __STAT__) + call MAPL_GetHorzIJIndex(self%nPts, iPoint, jPoint, & + grid = grid, & + lon = self%pLon/real(MAPL_RADIANS_TO_DEGREES), & + lat = self%pLat/real(MAPL_RADIANS_TO_DEGREES), & + rc = status) + if ( status /= 0 ) then + if (mapl_am_i_root()) print*, trim(Iam), ' - cannot get indices for point emissions' + VERIFY_(status) + end if + + call updatePointwiseEmissions (self%km, self%pBase, self%pTop, self%pEmis, self%nPts, & + self%pStart, self%pEnd, zle, & + area, iPoint, jPoint, nhms, emissions_point, __RC__) + + SO4 = SO4 + self%cdt * MAPL_GRAV / delp * emissions_point + end if + + RETURN_(ESMF_SUCCESS) + + end subroutine Run1 + +!============================================================================ +!BOP +! !IROUTINE: Run2 + +! !INTERFACE: + + subroutine Run2 (GC, import, export, clock, RC) + + ! !ARGUMENTS: + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: import ! Import state + type (ESMF_State), intent(inout) :: export ! Export state + type (ESMF_Clock), intent(inout) :: clock ! The clock + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Run2 method for the Dust Grid Component. + +!EOP +!============================================================================ +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (MAPL_MetaComp), pointer :: MAPL + type (ESMF_State) :: internal + type (wrap_) :: wrap + type (SU2G_GridComp), pointer :: self + type (ESMF_Time) :: time + type (ESMF_Alarm) :: ALARM + type(MAPL_VarSpec), pointer :: InternalSpec(:) + + integer :: nymd, nhms, iyr, imm, idd, ihr, imn, isc + integer :: n + logical :: KIN + real, pointer, dimension(:,:) :: lats + real, pointer, dimension(:,:) :: lons + character(len=ESMF_MAXSTR) :: short_name + real, pointer, dimension(:,:,:) :: int_ptr + + real, pointer, dimension(:,:,:) :: oh, no3, h2o2 + real, dimension(:,:,:), allocatable :: xoh, xno3, xh2o2 + + real, dimension(:,:), allocatable :: drydepositionf + +#include "SU2G_DeclarePointer___.h" + + __Iam__('Run2') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) // '::' // Iam + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC (GC, MAPL, __RC__) + +! Get parameters from generic state. +! ----------------------------------- + call MAPL_Get (MAPL, INTERNAL_ESMF_STATE=INTERNAL, & + INTERNALSPEC = InternalSpec, & + LONS = LONS, & + LATS = LATS, __RC__ ) + +#include "SU2G_GetPointer___.h" + +! Extract nymd(yyyymmdd) from clock +! --------------------------------- + call ESMF_ClockGet (clock, currTime=time, __RC__) + call ESMF_TimeGet (time ,YY=iyr, MM=imm, DD=idd, H=ihr, M=imn, S=isc, __RC__) + call MAPL_PackTime (nymd, iyr, imm , idd) + call MAPL_PackTime (nhms, ihr, imn, isc) + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'SU2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + + call ESMF_ClockGetAlarm(clock, 'H2O2_RECYCLE_ALARM', alarm, __RC__) + self%recycle_h2o2 = ESMF_AlarmIsRinging(alarm, __RC__) + +! Get oxidant pointers from specified provider +! ---------------------------------------------- + call GetOxidant (self%using_GMI_OH, oh, 'OH', __RC__) + call GetOxidant (self%using_GMI_OH, no3, 'NO3', __RC__) + call GetOxidant (self%using_GMI_OH, h2o2, 'H2O2', __RC__) + + allocate(xoh, mold=airdens, __STAT__) + allocate(xno3, mold=airdens, __STAT__) + allocate(xh2o2, mold=airdens, __STAT__) + xoh = 0.0 + xno3 = 0.0 + + if (self%firstRun) then + xh2o2 = MAPL_UNDEF + self%h2o2_init = MAPL_UNDEF + self%firstRun = .false. + end if + + xh2o2 = self%h2o2_init + + call SulfateUpdateOxidants (nymd, nhms, LONS, LATS, & + airdens, self%km, self%cdt, & + self%nymd_oxidants, undefval, & + oh, no3, h2o2, & + xoh, xno3, xh2o2, self%recycle_h2o2, rc) + +! SU Settling +! ----------- + do n = 1, self%nbins + call MAPL_VarSpecGet(InternalSpec(n), SHORT_NAME=short_name, __RC__) + call MAPL_GetPointer(internal, NAME=short_name, ptr=int_ptr, __RC__) + + call Chem_Settling2Gorig (self%km, self%klid, self%rhFlag, n, int_ptr, CHEMgrav, delp, & + self%radius(n)*1.e-6, self%rhop(n), self%cdt, t, airdens, & + rh2, zle, SUSD, rc=rc) + end do + + allocate(drydepositionf, mold=lwi, __STAT__) + call SulfateChemDriver (self%km, self%klid, self%cdt, MAPL_PI, real(MAPL_RADIANS_TO_DEGREES), MAPL_karman, & + airmw, nAvogadro, cpd, chemgrav, & + fMassMSA, fMassDMS, fMassSO2, fMassSO4, & + nymd, nhms, lons, lats, & + dms, so2, so4, msa, & + nDMS, nSO2, nSO4, nMSA, & + xoh, xno3, xh2o2, self%h2o2_init, & + delp, t, fcld, airdens, zle, & + ustar, sh, lwi, zpbl, z0h, & + SUDP, SUPSO2, SUPMSA, & + SUPSO4, SUPSO4g, SUPSO4aq, & + pso2, pmsa, pso4, pso4g, pso4aq, drydepositionf, & ! 3d diagnostics + rc) + KIN = .true. + call SU_Wet_Removal ( self%km, self%nbins, self%klid, self%cdt, kin, chemgrav, airMW, & + delp, fMassSO4, fMassSO2, & + self%h2o2_init, ple, airdens, cn_prcp, ncn_prcp, pfl_lsan, pfi_lsan, t, & + nDMS, nSO2, nSO4, nMSA, DMS, SO2, SO4, MSA, & + SUWT, SUPSO4, SUPSO4WT, PSO4, PSO4WET, rc ) + + call SU_Compute_Diags ( self%km, self%klid, self%radius(nSO4), self%sigma(nSO4), self%rhop(nSO4), & + chemgrav, MAPL_pi, nSO4, self%diag_MieTable(self%instance), & + self%diag_MieTable(self%instance)%channels, & + t, airdens, delp, rh2, u, v, DMS, SO2, SO4, MSA, & + DMSSMASS, DMSCMASS, & + MSASMASS, MSACMASS, & + SO2SMASS, SO2CMASS, & + SO4SMASS, SO4CMASS, & + SUEXTTAU, SUSCATAU, SO4MASS, SUCONC, SUEXTCOEF, & + SUSCACOEF, SUANGSTR, SUFLUXU, SUFLUXV, SO4SAREA, SO4SNUM, rc) + +if(mapl_am_i_root()) print*,'SU2G Run2 E sum(SO2) = ',sum(SO2) +if(mapl_am_i_root()) print*,'SU2G Run2 E sum(SO4) = ',sum(SO4) +if(mapl_am_i_root()) print*,'SU2G Run2 E sum(DMS) = ',sum(DMS) +if(mapl_am_i_root()) print*,'SU2G Run2 E sum(MSA) = ',sum(MSA) + + RETURN_(ESMF_SUCCESS) + + contains +!.................................................................. + subroutine GetOxidant (using_GMI, ptr, ptr_name, rc) + + logical, intent(in) :: using_GMI + real, pointer, dimension(:,:,:), intent(inout) :: ptr + character(len=*), intent(in) :: ptr_name + integer, optional, intent(out) :: rc + +! Begin... + rc = 0 + if (using_GMI) then + call MAPL_GetPointer(import, ptr, trim(ptr_name), __RC__) + else + call MAPL_GetPointer(import, ptr, 'SU_'//trim(ptr_name), __RC__) + end if + + end subroutine GetOxidant +!.................................................................. + + + end subroutine Run2 + +!============================================================================ +!BOP +! !IROUTINE: Run_data -- ExtData Sea Salt Grid Component + +! !INTERFACE: + + subroutine Run_data (GC, IMPORT, EXPORT, INTERNAL, RC) + + ! !ARGUMENTS: + + type (ESMF_GridComp), intent(inout) :: GC ! Gridded component + type (ESMF_State), intent(inout) :: IMPORT ! Import state + type (ESMF_State), intent(inout) :: EXPORT ! Export state + type (ESMF_State), intent(inout) :: INTERNAL ! Interal state + integer, optional, intent( out) :: RC ! Error code: + +! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. + +!EOP +!============================================================================ +! Locals + character (len=ESMF_MAXSTR) :: COMP_NAME + type (wrap_) :: wrap + type (SU2G_GridComp), pointer :: self + + real, pointer, dimension(:,:,:) :: ptr3d_int, ptr3d_imp + + __Iam__('Run_data') + +!***************************************************************************** +! Begin... + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet (GC, NAME=COMP_NAME, __RC__) + Iam = trim(COMP_NAME) //'::'//Iam + +if (mapl_am_I_root()) print*,trim(comp_name),' Run_data BEGIN' + +! Get my private internal state +! ------------------------------ + call ESMF_UserCompGetInternalState(GC, 'SU2G_GridComp', wrap, STATUS) + VERIFY_(STATUS) + self => wrap%ptr + +! Update interal data pointers with ExtData +! ----------------------------------------- + call MAPL_GetPointer (internal, NAME='SO4', ptr=ptr3d_int, __RC__) + call MAPL_GetPointer (import, NAME='climSO4', ptr=ptr3d_imp, __RC__) + ptr3d_int = ptr3d_imp + +if (mapl_am_I_root()) print*,trim(comp_name),' Run_data END' + + RETURN_(ESMF_SUCCESS) + + end subroutine Run_data + + +!----------------------------------------------------------------------------------- + subroutine aerosol_optics(state, rc) + + implicit none + +! !ARGUMENTS: + type (ESMF_State) :: state + integer, intent(out) :: rc + +! !Local + integer, parameter :: DP=kind(1.0d0) + real, dimension(:,:,:), pointer :: ple, rh + real(kind=DP), dimension(:,:,:), pointer :: var + real, dimension(:,:,:), pointer :: q + real, dimension(:,:,:,:), pointer :: q_4d + integer, allocatable :: opaque_self(:) + type(C_PTR) :: address + type(SU2G_GridComp), pointer :: self + + character (len=ESMF_MAXSTR) :: fld_name + type(ESMF_Field) :: fld + character (len=ESMF_MAXSTR),allocatable :: aerosol_names(:) + + real(kind=DP), dimension(:,:,:), allocatable :: ext_s, ssa_s, asy_s ! (lon:,lat:,lev:) + real :: x + integer :: instance + integer :: n, nbins + integer :: i1, j1, i2, j2, km + integer :: band, offset + integer, parameter :: n_bands = 1 + + integer :: i, j, k + + __Iam__('SU2G::aerosol_optics') + +! Begin... + +! Mie Table instance/index +! ------------------------ + call ESMF_AttributeGet(state, name='mie_table_instance', value=instance, __RC__) + +! Get aerosol names +! ----------------- + call ESMF_AttributeGet (state, name='internal_varaible_name', itemCount=nbins, __RC__) + allocate (aerosol_names(nbins), __STAT__) + call ESMF_AttributeGet (state, name='internal_varaible_name', valueList=aerosol_names, __RC__) + +! Radiation band +! -------------- + band = 0 + call ESMF_AttributeGet(state, name='band_for_aerosol_optics', value=band, __RC__) + offset = band - n_bands + +! Pressure at layer edges +! ------------------------ + call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, ple, trim(fld_name), __RC__) + +! call MAPL_GetPointer (state, ple, 'PLE', __RC__) + + i1 = lbound(ple, 1); i2 = ubound(ple, 1) + j1 = lbound(ple, 2); j2 = ubound(ple, 2) + km = ubound(ple, 3) + +! Relative humidity +! ----------------- + call ESMF_AttributeGet(state, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, rh, trim(fld_name), __RC__) + +! call MAPL_GetPointer (state, rh, 'RH2', __RC__) + + allocate(ext_s(i1:i2, j1:j2, km), & + ssa_s(i1:i2, j1:j2, km), & + asy_s(i1:i2, j1:j2, km), __STAT__) + + allocate(q_4d(i1:i2, j1:j2, km, nbins), __STAT__) + + do n = 1, nbins + call ESMF_StateGet (state, trim(aerosol_names(n)), field=fld, __RC__) + call ESMF_FieldGet (fld, farrayPtr=q, __RC__) + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + x = ((ple(i,j,k) - ple(i,j,k-1))*0.01)*(100./MAPL_GRAV) + q_4d(i,j,k,n) = x * q(i,j,k) + end do + end do + end do + end do + + call ESMF_AttributeGet(state, name='mieTable_pointer', itemCount=n, __RC__) + allocate (opaque_self(n), __STAT__) + call ESMF_AttributeGet(state, name='mieTable_pointer', valueList=opaque_self, __RC__) + + address = transfer(opaque_self, address) + call c_f_pointer(address, self) + + call mie_ (self%rad_MieTable(instance), nbins, n_bands, offset, q_4d, rh, ext_s, ssa_s, asy_s, __RC__) + + call ESMF_AttributeGet(state, name='extinction_in_air_due_to_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ext_s(:,:,:) + end if + + call ESMF_AttributeGet(state, name='single_scattering_albedo_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ssa_s(:,:,:) + end if + + call ESMF_AttributeGet(state, name='asymmetry_parameter_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = asy_s(:,:,:) + end if + + deallocate(ext_s, ssa_s, asy_s, __STAT__) + deallocate(q_4d, __STAT__) + + RETURN_(ESMF_SUCCESS) + + contains + +! subroutine mie_(mie_table, aerosol_names, nb, offset, q, rh, bext_s, bssa_s, basym_s, rc) + subroutine mie_(mie_table, nbins, nb, offset, q, rh, bext_s, bssa_s, basym_s, rc) + + implicit none + + type(Chem_Mie), intent(inout) :: mie_table ! mie table + integer, intent(in ) :: nbins ! number of bins + integer, intent(in ) :: nb ! number of bands + integer, intent(in ) :: offset ! bands offset + real, intent(in ) :: q(:,:,:,:) ! aerosol mass mixing ratio, kg kg-1 + real, intent(in ) :: rh(:,:,:) ! relative humidity + real(kind=8), intent( out) :: bext_s (size(ext_s,1),size(ext_s,2),size(ext_s,3)) + real(kind=8), intent( out) :: bssa_s (size(ext_s,1),size(ext_s,2),size(ext_s,3)) + real(kind=8), intent( out) :: basym_s(size(ext_s,1),size(ext_s,2),size(ext_s,3)) + integer, intent(out) :: rc + ! local + integer :: l + real :: bext (size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! extinction + real :: bssa (size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! SSA + real :: gasym(size(ext_s,1),size(ext_s,2),size(ext_s,3)) ! asymmetry parameter + + + __Iam__('SU2G::aerosol_optics::mie_') + + bext_s = 0.0d0 + bssa_s = 0.0d0 + basym_s = 0.0d0 + + do l = 1, nbins + call Chem_MieQuery(mie_table, l, real(offset+1.), q(:,:,:,l), rh, bext, gasym=gasym, ssa=bssa) + + bext_s = bext_s + bext ! extinction + bssa_s = bssa_s + (bssa*bext) ! scattering extinction + basym_s = basym_s + gasym*(bssa*bext) ! asymetry parameter multiplied by scatering extiction + + end do + + RETURN_(ESMF_SUCCESS) + + end subroutine mie_ + + end subroutine aerosol_optics + +end module SU2G_GridCompMod + diff --git a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridComp_ExtData.rc b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridComp_ExtData.rc new file mode 100644 index 00000000..f8881a00 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridComp_ExtData.rc @@ -0,0 +1,67 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +#===== Sulfate Data Instance ========================================== +climSO4 'kg kg-1' Y N 0 0.0 1.0 SO4 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +#climDMS 'kg kg-1' Y N - 0.0 1.0 none /dev/null +#climMSA 'kg kg-1' Y N - 0.0 1.0 none /dev/null +#climSO2 'kg kg-1' Y N - 0.0 1.0 none /dev/null + +climSUDP001 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT001 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD001 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD001 /dev/null +climSUSV001 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP002 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT002 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD002 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD002 /dev/null +climSUSV002 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP003 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT003 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD003 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD003 /dev/null +climSUSV003 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP004 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT004 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD004 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD004 /dev/null +climSUSV004 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + + +#====== Sulfate Sources ================================================= +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_so2.006.%y4%m2%d2.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA Y Y %y4-%m2-%d2t12:00:00 none none sanl1 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.surface.x3600_y1800_t12.2010.nc4 +SU_ANTHROL2 NA Y Y %y4-%m2-%d2t12:00:00 none none sanl2 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.elevated.x3600_y1800_t12.2010.nc4 + +# Ship emissions +SU_SHIPSO2 NA Y Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.ships.x3600_y1800_t12.2010.nc4 +SU_SHIPSO4 NA Y Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so4.ships.x3600_y1800_t12.2010.nc4 + +# Aircraft fuel consumption +SU_AIRCRAFT NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/MERRA2/sfc/DMSclim_sfcconcentration.x360_y181_t12.Lana2011.nc4 + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none so2_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.aviation_lto.x3600_y1800_t12.2010.nc4 +SU_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none so2_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.aviation_cds.x3600_y1800_t12.2010.nc4 +SU_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none so2_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.aviation_crs.x3600_y1800_t12.2010.nc4 + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none h2o2 ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none oh ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none no3 ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc + +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +#SU_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + diff --git a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridComp_SU.rc b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridComp_SU.rc new file mode 100644 index 00000000..be7397f2 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridComp_SU.rc @@ -0,0 +1,62 @@ +# +# Resource file for Sulfer parameters. +# + +aerosol_radBands_optics_file: ExtData/MERRA2/x/opticsBands_SU.v1_3.RRTMG.nc + +aerosol_monochromatic_optics_file: ExtData/AeroCom/x/optics_SU.v1_3.nc +aerosol_monochromatic_optics_wavelength: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 +n_channels: 4 + +nbins: 4 + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius_microns: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +pressure_lid_in_hPa: 0.01 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +#point_emissions_srcfilen: /gpfsm/dnb32/esherman/gocartRefactor/RC/CA2G_point_src_test.rc + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +#using_GMI_OH: no +#using_GMI_NO3: no +#using_GMI_H2O2: no +export_H2O2: no +using_GMI_OH: .false. +using_GMI_NO3: .false. +using_GMI_H2O2: .false. + diff --git a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_StateSpecs.rc b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_StateSpecs.rc new file mode 100644 index 00000000..237093d2 --- /dev/null +++ b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_StateSpecs.rc @@ -0,0 +1,141 @@ +schema_version: 2.0.0 +component: SU + +category: IMPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS| Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC | LONG NAME +#---------------------------------------------------------------------------------------- + FROCEAN | 1 | xy | N | fraction_of_ocean +# FRACI | 1 | xy | N | ice_covered_fraction_of_tile + LWI | 1 | xy | N | land-ocean-ice_mask + U10M | m s-1 | xy | N | 10-meter_eastward_wind + V10M | m s-1 | xy | N | 10-meter_northward_wind +# USTAR | m s-1 | xy | N | surface_velocity_scale +# TS | K | xy | N | surface skin temperature +# DZ | m | xy | N | surface_layer_height +# FRLAKE | 1 | xy | N | fraction_of_lake + AREA | m^2 | xy | N | agrid_cell_area + ZPBL | m | xy | N | planetary_boundary_layer_height + USTAR | m s-1 | xy | N | surface velocity scale + SH | w m-2 | xy | N | sensible_heat_flux_from_turbulence + Z0H | m | xy | N | surface_roughness_for_heat + CN_PRCP |kg/m^2/s| xy | N | surface_conv._rain_flux_needed_by_land + NCN_PRCP |kg/m^2/s| xy | N | Non-convective precipitation + SU_regionMask | 1 | xy | N | source species +#........................................................................................ + AIRDENS | kg/m^3 | xyz | C | moist_air_density + DELP | Pa | xyz | C | pressure_thickness + T | K | xyz | C | air_temperature + RH2 | 1 | xyz | C | Rel_Hum_after_moist + ZLE | m | xyz | E | geopotential_height + PLE | Pa | xyz | E | air_pressure + PFL_LSAN | kg/m2/s| xyz | E | 3D_flux_of_liquid_nonconvective_precipitation + PFI_LSAN | kg/m2/s| xyz | E | 3D_flux_of_ice_nonconvective_precipitation + U | m s-1 | xyz | C | eastward_wind + V | m s-1 | xyz | C | northward_wind + FCLD | 1 | xyz | C | Cloud fraction for radiation + pSO2_OCS | 1 | xyz | C | source species + SU_AIRCRAFT | 1 | xyz | C | fuel source species +# SU_NO3 | 1 | xyz | C | climatological NO3 source +# SU_OH | 1 | xyz | C | climatological OH source +# SU_H2O2 | 1 | xyz | C | climatological H2O2 source +#........................................................................................ + SU_BIOMASS | 1 | xy | N | biomass burning source species + SU_ANTHROL1 | 1 | xy | N | source species + SU_ANTHROL2 | 1 | xy | N | source species + SU_SHIPSO2 | 1 | xy | N | source species + SU_SHIPSO4 | 1 | xy | N | source species + SU_DMSO | 1 | xy | N | source species + SU_AVIATION_LTO | 1 | xy | N | Landing/Take-off aircraft source species + SU_AVIATION_CDS | 1 | xy | N | Climb/Descent aircraft source species + SU_AVIATION_CRS | 1 | xy | N | Cruise aircraft source species + +category: EXPORT +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSIONS | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS| VLOC | UNGRIDDED | LONG NAME +#---------------------------------------------------------------------------------------- + SUEM | kg m-2 s-1 | xy | N | self%nbins | Sulfer Emission All Bins + SUDP | kg m-2 s-1 | xy | N | self%nbins | Sulfate Dry Deposition All Bins + SUSD | kg m-2 s-1 | xy | N | self%nbins | Sulfate Settling All Bins + SUWT | kg m-2 s-1 | xy | N | self%nbins | Sulfate Wet Deposition All Bins + SUSV | kg m-2 s-1 | xy | N | self%nbins | Sulfate Convective Scavenging All Bins + SO4EMAN | kg m-2 s-1 | xy | N | | SO4 Anthropogenic Emissions + SO2EMAN | kg m-2 s-1 | xy | N | | SO2 Anthropogenic Emissions + SO2EMBB | kg m-2 s-1 | xy | N | | SO2 Biomass Burning Emissions + SO2EMVN | kg m-2 s-1 | xy | N | | SO2 Volcanic (non-explosive) Emissions + SO2EMVE | kg m-2 s-1 | xy | N | | SO2 Volcanic (explosive) Emissions + PSO2 | kg m-2 s-1 | xyz | C | | SO2 Prod from DMS oxidation + PMSA | kg m-2 s-1 | xyz | C | | MSA Prod from DMS oxidation + PSO4 | kg m-2 s-1 | xyz | C | | SO4 Prod from all SO2 oxidation + PSO4G | kg m-2 s-1 | xyz | C | | SO4 Prod from gaseous SO2 oxidation + PSO4WET | kg m-2 s-1 | xyz | C | | SO4 Prod from wet SO2 oxidation + PSO4AQ | kg m-2 s-1 | xyz | C | | SO4 Prod from aqueous SO2 oxidation + SUPSO2 | kg m-2 s-1 | xy | N | | SO2 Prod from DMS Oxidation [column] + SUPSO4 | kg m-2 s-1 | xy | N | | SO4 Prod from All SO2 Oxidation [column] + SUPSO4G | kg m-2 s-1 | xy | N | | SO4 Prod from Gaseous SO2 Oxidation [column] + SUPSO4AQ | kg m-2 s-1 | xy | N | | SO4 Prod from Aqueous SO2 Oxidation [column] + SUPSO4WT | kg m-2 s-1 | xy | N | | SO4 Prod from Aqueous SO2 Oxidation (wet dep) + SUPMSA | kg m-2 s-1 | xy | N | | MSA Prod from DMS Oxidation [column] + SO2SMASS | kg m-3 | xy | N | | SO2 Surface Mass Concentration + SO2CMASS | kg m-2 | xy | N | | SO2 Column Mass Density + SO4SMASS | kg m-3 | xy | N | | SO4 Surface Mass Concentration + SO4CMASS | kg m-2 | xy | N | | SO4 Column Mass Density + DMSSMASS | kg m-3 | xy | N | | DMS Surface Mass Concentration + DMSCMASS | kg m-2 | xy | N | | DMS Column Mass Density + MSASMASS | kg m-3 | xy | N | | MSA Surface Mass Concentration + MSACMASS | kg m-2 | xy | N | | MSA Column Mass Density + SUCONC | kg m-3 | xyz | C | | SO4 Aerosol Mass Concentration + SUEXTCOEF | m-1 | xyz | C | | SO4 Extinction Coefficient [550 nm] + SUSCACOEF | m-1 | xyz | C | | SO4 Scattering Coefficient [550 nm] + SUANGSTR | 1 | xy | N | | SO4 Angstrom parameter [470-870 nm] + SUFLUXU | kg m-1 s-1 | xy | N | | SO4 column u-wind mass flux + SUFLUXV | kg m-1 s-1 | xy | N | | SO4 column v-wind mass flux + SO4MASS | kg kg-1 | xyz | C | | SO4 Aerosol Mass Mixing Ratio + SUEXTTAU | 1 | xy | N | | SO4 Extinction AOT [550 nm] + SUSCATAU | 1 | xy | N | | SO4 Scattering AOT [550 nm] + SO4SAREA | m2 m-3 | xyz | C | | SO4 Surface Area Density + SO4SNUM | m-3 | xyz | C | | SO4 Number Density + +category: INTERNAL +#---------------------------------------------------------------------------------------- +# VARIABLE | DIMENSION | Additional Metadata +#---------------------------------------------------------------------------------------- + NAME | UNITS | DIMS | VLOC | RESTART | ADD2EXPORT | FRIENDLYTO | LONG NAME +#---------------------------------------------------------------------------------------- + DMS |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Dimethylsulphide + SO2 |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Sulphur dioxide + SO4 |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Sulphate aerosol + MSA |kg kg-1| xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Methanesulphonic acid + + +#******************************************************** +# +# Legend +# +#------------------------------------------------------------------ +# Column label | MAPL keyword/interpretation | Default +#--------------|--------------------------------------------------- +# NAME | short_name | +# UNITS | units | +# DIMS | dims | +# VLOC | VLocation | MAPL_VLocationNone +# LONG NAME | long_name | +# COND | if () then | .FALSE. +# NUM_SUBTILES | num_subtiles +# ... +#------------------------------------------------------------------ +# +#-------------------------------------------- +# Entry alias | Column | MAPL keyword/interpretation +#--------------|----------------------------- +# xyz | DIMS | MAPL_HorzVert +# xy | DIMS | MAPL_HorzOnly +# z | DIMS | MAPL_VertOnly (plus ungridded) +# C | VLOC | MAPL_VlocationCenter +# E | VLOC | MAPL_VlocationEdge +# N | VLOC | MAPL_VlocationNone +#-------------------------------------------- diff --git a/ESMF/GOCART_GridComp/Aero_GridCompMod.F90 b/ESMF/GOCART_GridComp/Aero_GridCompMod.F90 new file mode 100644 index 00000000..cadf83ba --- /dev/null +++ b/ESMF/GOCART_GridComp/Aero_GridCompMod.F90 @@ -0,0 +1,1051 @@ +#include "MAPL_Generic.h" +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Aero_GridCompMod --- Legacy GOCART GridComponent +! +! !INTERFACE: +! + + module Aero_GridCompMod + +! !USES: + + use ESMF + use MAPL + + use Chem_Mod ! Chemistry Base Class + use Chem_StateMod ! Chemistry State + use Chem_MieMod ! Aerosol LU Tables + + Use Chem_UtilMod, only: pmaxmin + + use O3_GridCompMod ! Ozone + use CO_GridCompMod ! Carbon monoxide + use CO2_GridCompMod ! Carbon dioxide + use BC_GridCompMod ! Black Carbon + use DU_GridCompMod ! Dust + use OC_GridCompMod ! Organic Carbon + use BRC_GridCompMod ! Brown Carbon + use SS_GridCompMod ! Sea Salt + use SU_GridCompMod ! Sulfates + use NI_GridCompMod ! Nitrate + use CFC_GridCompMod ! CFCs + use Rn_GridCompMod ! Radon + use CH4_GridCompMod ! Methane + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC Aero_GridComp ! The Legacy GOCART Object + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC Aero_GridCompSetServices + PUBLIC Aero_GridCompInitialize + PUBLIC Aero_GridCompRun1 + PUBLIC Aero_GridCompRun2 + PUBLIC Aero_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) GOCART Grid Component. This is +! a composite component which delegates the real work to its +! sub-components. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! 24Jan2004 da Silva Added expChem/cdt to interfaces. +! 24Mar2005 da Silva Requires RH and saves it under w_c%rh +! 29Mar2005 da Silva Initializes AOD LUTs. +! 18Oct2005 da Silva Added CO2. +! 24Jul2006 da Silva Adapted from Chem_GridComp. +! +!EOP +!------------------------------------------------------------------------- + + type Aero_GridComp + character(len=255) :: name + type(Chem_Mie), pointer :: mie_tables + type(O3_GridComp) :: gcO3 + type(CO_GridComp) :: gcCO + type(CO2_GridComp) :: gcCO2 + type(DU_GridComp) :: gcDU + type(SS_GridComp) :: gcSS + type(BC_GridComp) :: gcBC + type(OC_GridComp) :: gcOC + type(BRC_GridComp) :: gcBRC + type(SU_GridComp) :: gcSU + type(CFC_GridComp) :: gcCFC + type(Rn_GridComp) :: gcRn + type(CH4_GridComp) :: gcCH4 + type(NI_GridComp) :: gcNI + end type Aero_GridComp + +CONTAINS + + subroutine Aero_GridCompSetServices(GC,chemReg,rc) + + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + Iam = "Aero_GridCompSetServices" + +! Carbon Monoxide +! --------------- + if ( chemReg%doing_DU ) then +# include "DU_ExportSpec___.h" + call DU_GridCompSetServices(GC, chemReg, __RC__) + end if + + if ( chemReg%doing_CO ) then +# include "CO_ExportSpec___.h" + call CO_GridCompSetServices(GC,chemReg, __RC__) + end if + + if ( chemReg%doing_BC ) then +# include "BC_ExportSpec___.h" + call BC_GridCompSetServices(GC,chemReg, __RC__) + end if + + if ( chemReg%doing_OC ) then +# include "OC_ExportSpec___.h" + call OC_GridCompSetServices(GC,chemReg, __RC__) + end if + + if ( chemReg%doing_BRC ) then +# include "BRC_ExportSpec___.h" + call BRC_GridCompSetServices(GC,chemReg, __RC__) + end if + + if ( chemReg%doing_SS ) then +# include "SS_ExportSpec___.h" + end if + + if ( chemReg%doing_SU ) then +# include "SU_ExportSpec___.h" + call SU_GridCompSetServices(GC, chemReg, __RC__) + end if + + if ( chemReg%doing_CO2 ) then +# include "CO2_ExportSpec___.h" + call CO2_GridCompSetServices(GC, chemReg, __RC__) + end if + + if ( chemReg%doing_CFC ) then +# include "CFC_ExportSpec___.h" + call CFC_GridCompSetServices(GC, chemReg, __RC__) + end if + + if ( chemReg%doing_O3 ) then +# include "O3_ExportSpec___.h" + call O3_GridCompSetServices(GC, chemReg, __RC__) + endif + + if ( chemReg%doing_Rn ) then +# include "Rn_ExportSpec___.h" + call Rn_GridCompSetServices(GC, chemReg, __RC__) + endif + + if ( chemReg%doing_CH4 ) then +# include "CH4_ExportSpec___.h" + call CH4_GridCompSetServices(GC, chemReg, __RC__) + endif + + if ( chemReg%doing_NI ) then +# include "NI_ExportSpec___.h" + call NI_GridCompSetServices(GC, chemReg, __RC__) + endif + + RETURN_(ESMF_SUCCESS) + + end subroutine Aero_GridCompSetServices + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Aero_GridCompInitialize --- Initialize Aero_GridComp +! +! !INTERFACE: +! + + subroutine Aero_GridCompInitialize ( gcThis, w_c, gc, impChem, expChem, & + nymd, nhms, cdt, data_driven, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + type(ESMF_GridComp), intent(inout) :: gc + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + logical, intent(in) :: data_driven ! GOCART data instance flag + + +! !OUTPUT PARAMETERS: + + type(Aero_GridComp), intent(out) :: gcThis ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the GOCART Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: Iam = 'Aero_GridCompInit' + + gcThis%name = 'Composite Constituent Package' + + +! Require Relative Humidity +! ------------------------- + call Chem_StateSetNeeded ( impChem, iRELHUM, .true., rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': failed StateSetNeeded' + return + end if + +! Initialize AOD tables +! --------------------- + if ( w_c%reg%doing_DU .or. w_c%reg%doing_SS .or. w_c%reg%doing_SU .or. & + w_c%reg%doing_BC .or. w_c%reg%doing_OC .or. w_c%reg%doing_NI .or. & + w_C%reg%doing_BRC ) then + allocate ( gcThis%mie_tables, stat = rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': cannot allocate Mie tables' + return + end if +! Here we are assuming the mie tables to use +! In future, pass a registry file + gcThis%mie_tables = Chem_MieCreate ( 'Aod_Registry.rc', rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': MieCreate failed ', rc + return + end if + end if + +! Ozone & friends +! --------------- + if ( w_c%reg%doing_O3 ) then + call O3_GridCompInitialize ( gcThis%gcO3, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': O3 failed to initialize ', rc + rc = 1000 + rc + return + end if + end if + +! Carbon Monoxide +! --------------- + if ( w_c%reg%doing_CO ) then + if (.not. data_driven) then + call CO_GridCompInitialize ( gcThis%gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': CO failed to initialize ', rc + rc = 2000 + rc + return + end if + end if + end if ! + +! Carbon Dioxide +! --------------- + if ( w_c%reg%doing_CO2 ) then + if (.not. data_driven) then + call CO2_GridCompInitialize ( gcThis%gcCO2, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': CO2 failed to initialize ', rc + rc = 2500 + rc + return + end if + end if + end if + +! Dust +! ---- + if ( w_c%reg%doing_DU ) then + gcThis%gcDU%mie_tables => gcThis%mie_tables + + if (.not. data_driven) then + call DU_GridCompInitialize ( gcThis%gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': DU failed to initialize ', rc + rc = 3000 + rc + return + end if + end if + end if + +! Sea Salt +! -------- + if ( w_c%reg%doing_SS ) then + gcThis%gcSS%mie_tables => gcThis%mie_tables + + if (.not. data_driven) then + call SS_GridCompInitialize ( gcThis%gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': SS failed to initialize ', rc + rc = 4000 + rc + return + end if + end if + end if + +! Black carbon +! ------------ + if ( w_c%reg%doing_BC ) then + gcThis%gcBC%mie_tables => gcThis%mie_tables + + if (.not. data_driven) then + call BC_GridCompInitialize ( gcThis%gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': BC failed to initialize ', rc + rc = 5000 + rc + return + end if + end if + end if + +! Organic Carbon +! -------------- + if ( w_c%reg%doing_OC ) then + gcThis%gcOC%mie_tables => gcThis%mie_tables + + if (.not. data_driven) then + call OC_GridCompInitialize ( gcThis%gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': OC failed to initialize ', rc + rc = 6000 + rc + return + end if + end if + end if + +! Brown Carbon +! ------------ + if ( w_c%reg%doing_BRC ) then + gcThis%gcBRC%mie_tables => gcThis%mie_tables + + if (.not. data_driven) then + call BRC_GridCompInitialize ( gcThis%gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': BRC failed to initialize ', rc + rc = 6000 + rc + return + end if + end if + end if + +! Sulfates +! -------- + if ( w_c%reg%doing_SU ) then + gcThis%gcSU%mie_tables => gcThis%mie_tables + + if (.not. data_driven) then + call SU_GridCompInitialize ( gcThis%gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': SU failed to initialize ', rc + rc = 7000 + rc + return + end if + end if + end if + +! CFCs +! ---- + if ( w_c%reg%doing_CFC ) then + call CFC_GridCompInitialize ( gcThis%gcCFC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': CFC failed to initialize ', rc + rc = 8000 + rc + return + end if + end if + +! Radon +! ----- + if ( w_c%reg%doing_Rn ) then + call Rn_GridCompInitialize ( gcThis%gcRn, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': Rn failed to initialize ', rc + rc = 8500 + rc + return + end if + end if + +! Methane +! ------- + if ( w_c%reg%doing_CH4 ) then + call CH4_GridCompInitialize ( gcThis%gcCH4, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': CH4 failed to initialize ', rc + rc = 8800 + rc + return + end if + end if + +! Nitrate +! ------- + if ( w_c%reg%doing_NI ) then + gcThis%gcNI%mie_tables => gcThis%mie_tables + + if (.not. data_driven) then + call NI_GridCompInitialize ( gcThis%gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + if (MAPL_AM_I_ROOT()) print *, Iam//': NI failed to initialize ', rc + rc = 8900 + rc + return + end if + end if + end if + + call print_init_() + + return + +CONTAINS + + subroutine print_init_() + + integer :: i1, i2, j1, j2, ijl, km, n + real :: qmin, qmax + + i1 = w_c%grid%i1; i2 = w_c%grid%i2 + j1 = w_c%grid%j1; j2 = w_c%grid%j2 + km = w_c%grid%km + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + +#ifdef DEBUG + do n = w_c%reg%i_GOCART, w_c%reg%j_GOCART + call pmaxmin('Init::'//trim(w_c%reg%vname(n)), & + w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + end subroutine print_init_ + + end subroutine Aero_GridCompInitialize + + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Aero_GridCompRun1 --- The GOCART Driver +! +! !INTERFACE: +! + + subroutine Aero_GridCompRun1 ( gcThis, w_c, gc, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(Aero_GridComp), intent(inout) :: gcThis ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + type(ESMF_GridComp), intent(inout) :: gc + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + type(MAPL_MetaComp), pointer :: state + +! !DESCRIPTION: This routine implements the so-called GOCART Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 19May2005 da Silva Phased execution option. +! +!EOP +!------------------------------------------------------------------------- + + call MAPL_GetObjectFromGC(gc,state,rc) +! Dust +! ---- + if ( w_c%reg%doing_DU ) then + call MAPL_TimerOn(state,"DU") + call DU_GridCompRun1 ( gcThis%gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"DU") + if ( rc /= 0 ) then + rc = 3000 + rc + return + end if + end if + +! Sea Salt +! -------- + if ( w_c%reg%doing_SS ) then + call MAPL_TimerOn(state,"SS") + call SS_GridCompRun1 ( gcThis%gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"SS") + if ( rc /= 0 ) then + rc = 4000 + rc + return + end if + end if + +! Black carbon +! ------------ + if ( w_c%reg%doing_BC ) then + call MAPL_TimerOn(state,"BC") + call BC_GridCompRun1 ( gcThis%gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"BC") + if ( rc /= 0 ) then + rc = 5000 + rc + return + end if + end if + +! Organic Carbon +! -------------- + if ( w_c%reg%doing_OC ) then + call MAPL_TimerOn(state,"OC") + call OC_GridCompRun1 ( gcThis%gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"OC") + if ( rc /= 0 ) then + rc = 6000 + rc + return + end if + end if + +! Brown Carbon +! ------------ + if ( w_c%reg%doing_BRC ) then + call MAPL_TimerOn(state,"BRC") + call BRC_GridCompRun1 ( gcThis%gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"BRC") + if ( rc /= 0 ) then + rc = 6100 + rc + return + end if + end if + +! Sulfates +! -------- + if ( w_c%reg%doing_SU ) then + call MAPL_TimerOn(state,"SU") + call SU_GridCompRun1 ( gcThis%gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"SU") + if ( rc /= 0 ) then + rc = 7000 + rc + return + end if + end if + +! Nitrate +! ------- + if ( w_c%reg%doing_NI ) then + call MAPL_TimerOn(state,"NI") + call NI_GridCompRun1 ( gcThis%gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"NI") + if ( rc /= 0 ) then + rc = 8900 + rc + return + end if + end if + + + return + + end subroutine Aero_GridCompRun1 + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Aero_GridCompRun --- The GOCART Driver +! +! !INTERFACE: +! + + subroutine Aero_GridCompRun2 ( gcThis, w_c, gc, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(Aero_GridComp), intent(inout) :: gcThis ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + type(ESMF_GridComp), intent(inout) :: gc + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + logical :: run_alarm ! run alarm + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + type(MAPL_MetaComp), pointer :: state + +! !DESCRIPTION: This routine implements the so-called GOCART Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 19May2005 da Silva Phased execution option. +! +!EOP +!------------------------------------------------------------------------- + + call MAPL_GetObjectFromGC(gc,state) +! Ozone & friends +! --------------- + if ( w_c%reg%doing_O3 ) then + call MAPL_TimerOn(state,"O3") + call O3_GridCompRun( gcThis%gcO3, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"O3") + if ( rc /= 0 ) then + rc = 1000 + rc + return + end if + end if + +! Carbon Monoxide +! --------------- + if ( w_c%reg%doing_CO ) then + call MAPL_TimerOn(state,"CO") + call CO_GridCompRun ( gcThis%gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"CO") + if ( rc /= 0 ) then + rc = 2000 + rc + return + end if + end if + +! Carbon Dioxide +! -------------- + if ( w_c%reg%doing_CO2 ) then + call MAPL_TimerOn(state,"CO2") + call CO2_GridCompRun ( gcThis%gcCO2, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"CO2") + if ( rc /= 0 ) then + rc = 2500 + rc + return + end if + end if + +! Dust +! ---- + if ( w_c%reg%doing_DU ) then + call MAPL_TimerOn(state,"DU") + call DU_GridCompRun2 ( gcThis%gcDU, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"DU") + if ( rc /= 0 ) then + rc = 3000 + rc + return + end if + end if + +! Sea Salt +! -------- + call MAPL_TimerOn(state,"SS") + if ( w_c%reg%doing_SS ) then + call SS_GridCompRun2 ( gcThis%gcSS, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 4000 + rc + return + end if + end if + call MAPL_TimerOff(state,"SS") + +! Black carbon +! ------------ + if ( w_c%reg%doing_BC ) then + call MAPL_TimerOn(state,"BC") + call BC_GridCompRun2 ( gcThis%gcBC, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"BC") + if ( rc /= 0 ) then + rc = 5000 + rc + return + end if + end if + +! Organic Carbon +! -------------- + if ( w_c%reg%doing_OC ) then + call MAPL_TimerOn(state,"OC") + call OC_GridCompRun2 ( gcThis%gcOC, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"OC") + if ( rc /= 0 ) then + rc = 6000 + rc + return + end if + end if + +! Brown Carbon +! ------------ + if ( w_c%reg%doing_BRC ) then + call MAPL_TimerOn(state,"BRC") + call BRC_GridCompRun2 ( gcThis%gcBRC, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"BRC") + if ( rc /= 0 ) then + rc = 6100 + rc + return + end if + end if + +! Sulfates +! -------- + if ( w_c%reg%doing_SU ) then + call MAPL_TimerOn(state,"SU") + call SU_GridCompRun2 ( gcThis%gcSU, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"SU") + if ( rc /= 0 ) then + rc = 7000 + rc + return + end if + end if + +! CFCs +! ---- + if ( w_c%reg%doing_CFC ) then + call MAPL_TimerOn(state,"CFC") + call CFC_GridCompRun ( gcThis%gcCFC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"CFC") + if ( rc /= 0 ) then + rc = 8000 + rc + return + end if + end if + +! Radon +! ----- + if ( w_c%reg%doing_Rn ) then + call Rn_GridCompRun ( gcThis%gcRn, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 8500 + rc + return + end if + end if + +! Methane +! ------- + if ( w_c%reg%doing_CH4 ) then + call MAPL_TimerOn(state,"CH4") + call CH4_GridCompRun ( gcThis%gcCH4, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"CH4") + if ( rc /= 0 ) then + rc = 8800 + rc + return + end if + end if + +! Nitrate +! ------- + if ( w_c%reg%doing_NI ) then + call MAPL_TimerOn(state,"NI") + call NI_GridCompRun2 ( gcThis%gcNI, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + call MAPL_TimerOff(state,"NI") + if ( rc /= 0 ) then + rc = 8900 + rc + return + end if + end if + + return + + end subroutine Aero_GridCompRun2 + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Aero_GridCompFinalize --- Finalizes the GOCART Component +! +! !INTERFACE: +! + + subroutine Aero_GridCompFinalize ( gcThis, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(Aero_GridComp), intent(inout) :: gcThis ! Grid Component + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + +! Finalize AOD tables +! ------------------- + if ( w_c%reg%doing_DU .or. w_c%reg%doing_SS .or. w_c%reg%doing_SU .or. & + w_c%reg%doing_BC .or. w_c%reg%doing_OC .or. w_c%reg%doing_NI .or. & + w_c%reg%doing_BRC ) then + call Chem_MieDestroy ( gcThis%mie_tables, rc ) + if ( rc /= 0 ) return + deallocate ( gcThis%mie_tables, stat = rc ) + if ( rc /= 0 ) return + end if + + +! Ozone & friends +! --------------- + if ( w_c%reg%doing_O3 ) then + call O3_GridCompFinalize ( gcThis%gcO3, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 1000 + rc + return + end if + end if + +! Carbon Monoxide +! --------------- + if ( w_c%reg%doing_CO ) then + call CO_GridCompFinalize ( gcThis%gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 2000 + rc + return + end if + end if + +! Carbon Dioxide +! -------------- + if ( w_c%reg%doing_CO2 ) then + call CO2_GridCompFinalize ( gcThis%gcCO2, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 2500 + rc + return + end if + end if + +! Dust +! ---- + if ( w_c%reg%doing_DU ) then + call DU_GridCompFinalize ( gcThis%gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 3000 + rc + return + end if + end if + +! Sea Salt +! -------- + if ( w_c%reg%doing_SS ) then + call SS_GridCompFinalize ( gcThis%gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 4000 + rc + return + end if + end if + +! Black carbon +! ------------ + if ( w_c%reg%doing_BC ) then + call BC_GridCompFinalize ( gcThis%gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 5000 + rc + return + end if + end if + +! Organic Carbon +! -------------- + if ( w_c%reg%doing_OC ) then + call OC_GridCompFinalize ( gcThis%gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 6000 + rc + return + end if + end if + +! Brown Carbon +! ------------ + if ( w_c%reg%doing_BRC ) then + call BRC_GridCompFinalize ( gcThis%gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 6000 + rc + return + end if + end if + +! Sulfates +! -------- + if ( w_c%reg%doing_SU ) then + call SU_GridCompFinalize ( gcThis%gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 7000 + rc + return + end if + end if + +! CFCs +! ---- + if ( w_c%reg%doing_CFC ) then + call CFC_GridCompFinalize ( gcThis%gcCFC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 8000 + rc + return + end if + end if + +! Radon +! ----- + if ( w_c%reg%doing_Rn ) then + call Rn_GridCompFinalize ( gcThis%gcRn, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 8500 + rc + return + end if + end if + +! Methane +! ------- + if ( w_c%reg%doing_CH4 ) then + call CH4_GridCompFinalize ( gcThis%gcCH4, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 8800 + rc + return + end if + end if + +! Nitrate +! ------- + if ( w_c%reg%doing_NI ) then + call NI_GridCompFinalize ( gcThis%gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + if ( rc /= 0 ) then + rc = 8900 + rc + return + end if + end if + + return + + end subroutine Aero_GridCompFinalize + + end module Aero_GridCompMod + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/BC_GridComp---full.rc new file mode 100755 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/BC_GridComp.rc new file mode 100755 index 00000000..48db7572 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/BC_GridComp/BC_GridCompMod.F90 b/ESMF/GOCART_GridComp/BC_GridComp/BC_GridCompMod.F90 new file mode 100644 index 00000000..5dab0101 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/BC_GridCompMod.F90 @@ -0,0 +1,2592 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: BC_GridCompMod --- BC Grid Component Class +! +! !INTERFACE: +! + + module BC_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + + use Chem_Mod ! Chemistry Base Class + use Chem_StateMod ! Chemistry State + use Chem_ConstMod, only: grav, von_karman, cpd, & + undefval => undef ! Constants ! + use Chem_UtilMod ! I/O + use Chem_MieMod ! Aerosol LU Tables, calculator + use m_inpak90 ! Resource file management + use m_die, only: die + use Chem_SettlingMod ! Settling + use DryDepositionMod ! Dry Deposition + use WetRemovalMod ! Large-scale Wet Removal + use ConvectionMod ! Offline convective mixing/scavenging + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC BC_GridComp ! The BC object + PUBLIC BC_GridComp1 ! Single instance BC object + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC BC_GridCompSetServices + PUBLIC BC_GridCompInitialize + PUBLIC BC_GridCompRun1 + PUBLIC BC_GridCompRun2 + PUBLIC BC_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) BC Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + type BC_GridComp1 + character(len=255) :: name + character(len=255) :: iname ! instance name + character(len=255) :: rcfilen ! resource file name + character(len=255) :: regionsString ! Comma-delimited string of regions + + integer :: instance ! instance number + + logical :: run_alarm=.false. ! run alarm + + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + real, pointer :: biofuel_src(:,:) + real, pointer :: biomass_src_(:,:) ! before diurnal + real, pointer :: biomass_src(:,:) + real, pointer :: ebcant1_src(:,:) ! level 1 + real, pointer :: ebcant2_src(:,:) ! level 2 + real, pointer :: bc_ship_src(:,:) + real, pointer :: aviation_lto_src(:,:) ! aviation - landing and takeoff + real, pointer :: aviation_cds_src(:,:) ! aviation - climbing and descent + real, pointer :: aviation_crs_src(:,:) ! aviation - cruise + real :: aviation_layers(4) ! heights of the LTO, CDS and CRS layers + real :: fHydrophobic ! Fraction of emissions hydrophobic + integer :: myDOW = -1 ! my Day of the week: Sun=1, Mon=2,...,Sat=7 + logical :: doing_nei=.FALSE. ! NEI08: National Emission Inventory (US+Canada) + real :: nei_lon(2), nei_lat(2) ! NEI bounding box; superseeds eocant1/2 inside +! Workspace for any requested point emissions +! ------------------------------------------- + logical :: doing_point_emissions=.FALSE. ! Providing pointwise emissions + character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions + integer :: nPts = -1 + integer, pointer, dimension(:) :: vstart => null(), vend => null() + real, pointer, dimension(:) :: vLat => null(), & + vLon => null(), & + vBase => null(), & + vTop => null(), & + vEmis => null() + end type BC_GridComp1 + + type BC_GridComp + integer :: n = 0 ! number of instances + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + type(BC_GridComp1), pointer :: gcs(:) => null() ! instances + end type BC_GridComp + + character(len=*), parameter :: rc_basename = 'BC_GridComp' + + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + real, parameter :: radToDeg = 57.2957795 + +CONTAINS + + subroutine BC_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: ier,n,i + + type(ESMF_Config) :: cfg + + Iam = "BC_GridCompSetServices" + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(rc=status) + VERIFY_(STATUS) + call ESMF_ConfigLoadFile(cfg,trim(rc_basename)//'.rc',rc=status) + VERIFY_(STATUS) + +! Parse resource file +! ------------------- + n = ESMF_ConfigGetLen(cfg,label='BC_instances:',rc=status) + VERIFY_(STATUS) + + +! We have 2 tracers for each instance of BC +! We cannot have fewer instances than half the number of +! BC bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( n .LT. chemReg%n_BC/2 ) then + rc = 35 + return + else if ( n .GT. chemReg%n_BC/2 ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(Iam)// & + ': fewer BC bins than possible BC instances: ',& + n, chemReg%n_BC/2 + end if + n = min(n,chemReg%n_BC/2 ) + +! Record name of each instance +! ---------------------------- + call ESMF_ConfigFindLabel(cfg,'BC_instances:',rc=status) + VERIFY_(STATUS) + do i = 1, n + call ESMF_ConfigGetAttribute(cfg,name,rc=status) + VERIFY_(STATUS) + ! resource file name + IF(TRIM(name) == "full" ) THEN + name = " " ! blank instance name for full (1) + ELSE + name = TRIM(name) ! instance name for others + END IF + call BC_GridCompSetServices1_(gc,chemReg,name,rc=status) + VERIFY_(STATUS) + end do + + RETURN_(ESMF_SUCCESS) + end subroutine BC_GridCompSetServices + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_GridCompInitialize --- Initialize BC_GridComp +! +! !INTERFACE: +! + + subroutine BC_GridCompInitialize ( gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(BC_GridComp), intent(inout) :: gcBC ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the BC Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'BC_GridCompInitialize' + CHARACTER(LEN=255) :: name + + integer :: i, ier, n + +! Load resource file +! ------------------ + call i90_loadf ( trim(rc_basename)//'.rc', ier ) + if ( ier .NE. 0 ) then + rc = 10 + return + end if + +! Parse resource file +! ------------------- + CALL I90_label ( 'BC_instances:', ier ) + if ( ier .NE. 0 ) then + rc = 20 + return + end if + +! First determine how many instances we have +! ------------------------------------------ + n = 0 + do while ( ier .EQ. 0 ) + CALL I90_gtoken( name, ier ) + if (ier .eq. 0) n = n + 1 + end do + if ( n .EQ. 0 ) then + rc = 30 + return + end if + +! We have 2 tracers for each instance of BC +! We cannot have fewer instances than half the number of +! BC bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( n .LT. w_c%reg%n_BC/2 ) then + rc = 35 + return + else if ( n .GT. w_c%reg%n_BC/2 ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(myname)// & + ': fewer BC bin sets than possible BC instances'//& + ' (2 bins per instance): ',& + n, w_c%reg%n_BC + end if + n = min(n,w_c%reg%n_BC/2 ) + gcBC%n = n + +! Next allocate necessary memory +! ------------------------------ + allocate ( gcBC%gcs(n), stat=ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + +! Record name of each instance +! ---------------------------- + CALL I90_label ( 'BC_instances:', ier ) + do i = 1, n + CALL I90_gtoken( name, ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + ! resource file name + gcBC%gcs(i)%rcfilen = trim(rc_basename)//'---'//trim(name)//'.rc' + gcBC%gcs(i)%instance = i ! instance number + IF(TRIM(name) == "full" ) THEN + gcBC%gcs(i)%iname = " " ! blank instance name for full (1) + ELSE + gcBC%gcs(i)%iname = TRIM(name) ! instance name for others + END IF + end do + +! Next initialize each instance +! ----------------------------- + do i = 1, gcBC%n + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,myname,": Initializing instance ",TRIM(gcBC%gcs(i)%iname)," [",gcBC%gcs(i)%instance,"]" + END IF + call BC_SingleInstance_ ( BC_GridCompInitialize1_, i, & + gcBC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = 1000+ier + return + end if + gcBC%gcs(i)%mie_tables => gcBC%mie_tables + end do + +! All done +! -------- + CALL I90_FullRelease( ier ) + IF( ier /= 0 ) THEN + PRINT *,myname,": I90_FullRelease not successful." + rc = 40 + END IF + + + end subroutine BC_GridCompInitialize + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_GridCompRun1 --- Run BC_GridComp +! +! !INTERFACE: +! + + subroutine BC_GridCompRun1 ( gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(BC_GridComp), INTENT(INOUT) :: gcBC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the BC Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcBC%n + call BC_SingleInstance_ ( BC_GridCompRun1_, i, & + gcBC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine BC_GridCompRun1 + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_GridCompRun2 --- Run BC_GridComp +! +! !INTERFACE: +! + + subroutine BC_GridCompRun2 ( gcBC, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + LOGICAL, INTENT(IN) :: run_alarm ! run alarm + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(BC_GridComp), INTENT(INOUT) :: gcBC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the BC Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcBC%n + gcBC%gcs(i)%run_alarm = run_alarm + + call BC_SingleInstance_ ( BC_GridCompRun2_, i, & + gcBC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine BC_GridCompRun2 + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_GridCompFinalize --- Initialize BC_GridComp +! +! !INTERFACE: +! + + subroutine BC_GridCompFinalize ( gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(BC_GridComp), INTENT(INOUT) :: gcBC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the BC Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcBC%n + call BC_SingleInstance_ ( BC_GridCompFinalize1_, i, & + gcBC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + if (associated(gcBC%gcs)) deallocate ( gcBC%gcs, stat=ier ) + gcBC%n = -1 + + end subroutine BC_GridCompFinalize + + + subroutine BC_GridCompSetServices1_( gc, chemReg, iname, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + character(len=*), intent(IN ) :: iname + integer, intent(OUT ) :: rc + + ! local + logical:: doing_nei + + integer :: Status + character(len=ESMF_MAXSTR) :: Iam + + Iam ="BC_GridCOmpSetServices1_" + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BC_BIOMASS'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BC_BIOFUEL'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BC_ANTEBC1'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BC_ANTEBC2'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BC_SHIP'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BC_AVIATION_LTO'//trim(iname), & + LONG_NAME = 'bc_aviation_lto' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BC_AVIATION_CDS'//trim(iname), & + LONG_NAME = 'bc_aviation_cds' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BC_AVIATION_CRS'//trim(iname), & + LONG_NAME = 'bc_aviation_crs' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + +! Parse the resource file to see if NEI imports are required +! ---------------------------------------------------------- + call doing_nei_(trim(rc_basename), trim(iname), doing_nei, __RC__) + + NEI_EMISSIONS: if (doing_nei) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BC_NEI_BOT'//trim(iname), & + LONG_NAME = 'bc_nei_bot' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BC_NEI_TOP'//trim(iname), & + LONG_NAME = 'bc_nei_top' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + end if NEI_EMISSIONS + + + RETURN_(ESMF_SUCCESS) + + contains + subroutine doing_nei_(rcbasen, iname, result, rc) + + character(len=*), intent(in) :: rcbasen + character(len=*), intent(in) :: iname + logical, intent(out) :: result + integer, intent(out) :: rc + + ! local + type(ESMF_Config) :: cfg + character(len=255) :: name + integer :: status + logical :: isPresent + character(len=255) :: Iam + + Iam = 'BC_GridCOmpSetServices1_::doing_nei_' + + if (iname == '') then + name = 'full' + else + name = trim(iname) + end if + + name = trim(rcbasen)//'---'//trim(name)//'.rc' + + cfg = ESMF_ConfigCreate(__RC__) + call ESMF_ConfigLoadFile(cfg, trim(name), __RC__) + call ESMF_ConfigFindLabel(cfg, 'nei_boundingbox:', isPresent=isPresent, __RC__) + + if (isPresent) then + result = .true. + else + result = .false. + end if + + RETURN_(ESMF_SUCCESS) + end subroutine doing_nei_ + + end subroutine BC_GridCompSetServices1_ + + +! Single Instance Methods + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_GridCompInitialize --- Initialize BC_GridComp +! +! !INTERFACE: +! + + subroutine BC_GridCompInitialize1_ ( gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(BC_GridComp1), intent(inout) :: gcBC ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the BC Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'BC_GridCompInitialize1' + + + character(len=255) :: rcfilen + integer :: n + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, nbins_rc + integer, allocatable :: ier(:) + LOGICAL :: NoRegionalConstraint + + + + rcfilen = gcBC%rcfilen + gcBC%name = 'BC Constituent Package' + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + nbins = w_c%reg%n_BC + n1 = w_c%reg%i_BC + n2 = w_c%reg%j_BC + + call init_() + if ( rc /= 0 ) return + + +! ------------------- +! Parse resource file +! ------------------- + +! Load resource file +! ------------------ + call i90_loadf ( rcfilen, ier(1) ) + if ( ier(1) .ne. 0 ) then + call final_(10) + return + end if + + call i90_label ( 'number_bc_classes:', ier(1) ) + nbins_rc = i90_gint ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(20) + return + end if + if ( nbins_rc /= nbins ) then + call final_(25) + return + end if + +! Aircraft emissions +! ------------------ + ier(:) = 0 + call i90_label ( 'aviation_vertical_layers:', ier(1) ) + gcBC%aviation_layers(1) = i90_gfloat(ier(2)) + gcBC%aviation_layers(2) = i90_gfloat(ier(3)) + gcBC%aviation_layers(3) = i90_gfloat(ier(4)) + gcBC%aviation_layers(4) = i90_gfloat(ier(5)) + + if ( any(ier(1:5) /= 0) ) then + call final_(77) + return + end if + +! Handle Point-wise Emission Sources Specified in a Text File +! ----------------------------------------------------------- + ier(:) = 0 + call i90_label ( 'point_emissions_srcfilen:', ier(1) ) + call i90_gtoken ( gcBC%point_emissions_srcfilen, ier(2) ) + if ( ier(1) /= 0 ) then + gcBC%doing_point_emissions = .FALSE. ! if rc is missing, don't fuss + else if ( any(ier(2:2) /= 0) ) then + call final_(42) ! this means point emissions info is messed up, abort + return + else + if ( (index(gcBC%point_emissions_srcfilen,'/dev/null')>0) ) then + gcBC%doing_point_emissions = .FALSE. ! disable it if no file specified + else + gcBC%doing_point_emissions = .TRUE. ! we are good to go + end if + end if + +! Handle NEI08 Emissions +! ---------------------- + ier(:) = 0 + call i90_label ( 'nei_boundingbox:', ier(1) ) + gcBC%nei_lon(1) = i90_gfloat(ier(2)) + gcBC%nei_lon(2) = i90_gfloat(ier(3)) + gcBC%nei_lat(1) = i90_gfloat(ier(4)) + gcBC%nei_lat(2) = i90_gfloat(ier(5)) + if ( ier(1) /= 0 ) then + gcBC%doing_nei = .FALSE. ! if rc is missing, don't fuss + else if ( any(ier(2:5) /= 0) ) then + call final_(42) ! this means NEI info is messed up, abort + return + else +! -------------------------------------------------------------------------- +! if ( (index(gcBC%nei_srcfilen(1),'/dev/null')>0) .or. & +! (index(gcBC%nei_srcfilen(2),'/dev/null')>0) ) then +! gcBC%doing_nei = .FALSE. ! disable it if no file specified +! else +! gcBC%doing_nei = .TRUE. ! we are good to go +! end if +! -------------------------------------------------------------------------- +! TODO: Need to parse the ExtData file to replicate the above logic, +! until then do not include the NOI datasets in the ExtData primary +! export tables +! -------------------------------------------------------------------------- + + gcBC%doing_nei = .TRUE. ! we are good to go + end if + + if ( MAPL_AM_I_ROOT() ) then + if ( gcBC%doing_nei ) then + print *, 'BC_GridComp: using NEI08 Emissions over North America' + else + print *, 'BC_GridComp: skipping NEI08 Emissions over North America' + end if + end if + +! ------- + +! Day of the week to reset tracer to zero +! --------------------------------------- + call i90_label ( 'my_day_of_the_week:',ier(1)) + if ( ier(1) /= 0 ) then + gcBC%myDOW = -1 ! by default never reset tracer to zero + else + gcBC%myDOW = i90_gint (ier(1)) + if ( ier(1) /= 0 ) then + call final_(60) + return + end if + end if + +! ------- + +! Hydrophobic fraction +! --------------- + call i90_label ( 'hydrophobic_fraction:', ier(1) ) + gcBC%fHydrophobic = i90_gfloat ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + + +! ------- + + +! Scavenging Efficiency +! To be used in convtran.F90, this parameter +! is the scavenging efficiency of the tracer [km -1] +! --------------- + call i90_label ( 'fscav:', ier(1) ) + do n = 1, nbins + w_c%reg%fscav(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Particle density +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_density:', ier(1) ) + do n = 1, nbins + w_c%reg%rhop(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Number median radius +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_radius_number:', ier(1) ) + do n = 1, nbins + w_c%reg%rmed(n1+n-1) = i90_gfloat ( ier(n+1) ) * 1e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Sigma (lognormal mode width) +! To be used in droplet activation code +! --------------- + call i90_label ( 'sigma:', ier(1) ) + do n = 1, nbins + w_c%reg%sigma(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Number to mass conversion factor +! To be used in droplet activation code +! --------------- + call i90_label ( 'fnum:', ier(1) ) + do n = 1, nbins + w_c%reg%fnum(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Molecular weight +! To be used in droplet activation code +! --------------- + call i90_label ( 'molecular_weight:', ier(1) ) + do n = 1, nbins + w_c%reg%molwght(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! ------- + +! Grab the region string. +! ----------------------- + ier(:)=0 + call i90_label ( 'BC_regions_indices:', ier(1) ) + CALL I90_gtoken( gcBC%regionsString, ier(2) ) + IF( ANY(ier(1:2) < 0 ) ) THEN + CALL final_(51) + RETURN + END IF + +! Is this instantiation a global case? +! ----------------------------------- + IF(gcBC%regionsString(1:2) == "-1") THEN + NoRegionalConstraint = .TRUE. + ELSE + SELECT CASE (ESMF_UtilStringLowerCase(gcBC%regionsString(1:2))) + CASE ("gl") + NoRegionalConstraint = .TRUE. + CASE ("al") + NoRegionalConstraint = .TRUE. + CASE DEFAULT + NoRegionalConstraint = .FALSE. + END SELECT + END IF + +! Set regionsString to "-1" for the global case +! --------------------------------------------- + IF(NoRegionalConstraint) gcBC%regionsString = "-1" + + IF(MAPL_AM_I_ROOT()) THEN + IF(NoRegionalConstraint) THEN + PRINT *,myname,": This instantiation has no regional constraints." + ELSE + PRINT *,myname,": This instantiation is regionally constrained." + PRINT *,myname,": List of region numbers included: ",TRIM(gcBC%regionsString) + END IF + END IF + +! All done +! -------- + call i90_release() + deallocate(ier) + + return + + +CONTAINS + + subroutine init_() + integer ios, nerr + nerr = max ( 32, nbins+1 ) + allocate ( gcBC%biomass_src(i1:i2,j1:j2), gcBC%biofuel_src(i1:i2,j1:j2), & + gcBC%biomass_src_(i1:i2,j1:j2), & + gcBC%ebcant1_src(i1:i2,j1:j2), gcBC%ebcant2_src(i1:i2,j1:j2), & + gcBC%bc_ship_src(i1:i2,j1:j2), & + gcBC%aviation_lto_src(i1:i2,j1:j2), & + gcBC%aviation_cds_src(i1:i2,j1:j2), & + gcBC%aviation_crs_src(i1:i2,j1:j2), ier(nerr), stat=ios ) + if ( ios /= 0 ) rc = 100 + end subroutine init_ + + subroutine final_(ierr) + integer :: ierr + integer ios + deallocate ( gcBC%biomass_src, gcBC%biofuel_src, & + gcBC%biomass_src_, & + gcBC%ebcant1_src, gcBC%ebcant2_src, & + gcBC%bc_ship_src, & + gcBC%aviation_lto_src, & + gcBC%aviation_cds_src, & + gcBC%aviation_crs_src, ier, stat=ios ) + call i90_release() + rc = ierr + end subroutine final_ + + end subroutine BC_GridCompInitialize1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_GridCompRun1_ --- The Chem Driver, run phase 1 +! +! !INTERFACE: +! + + subroutine BC_GridCompRun1_ ( gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(BC_GridComp1), intent(inout) :: gcBC ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called BC Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'BC_GridCompRun1_' + character(len=*), parameter :: Iam = myname + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n + integer :: i, j, ijl, ijkl, ijk1l + real :: qmax, qmin + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: pblh + real, pointer, dimension(:,:,:) :: tmpu, rhoa, ple + +! Workspace for NEI emissions +! --------------------------- + real, pointer, dimension(:,:) :: nei_src1, nei_src2 + + + integer :: idow + character(len=3) :: cdow + + real, pointer :: var2D(:,:) => null() + +#define EXPORT expChem +#define iNAME TRIM(gcBC%iname) + +#define ptrBCEM BC_emis + +#define ptrBCEMAN BC_emisAN +#define ptrBCEMBB BC_emisBB +#define ptrBCEMBF BC_emisBF + + + integer :: STATUS + +#include "BC_GetPointer___.h" + + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_BC + n1 = w_c%reg%i_BC + n2 = w_c%reg%j_BC + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + +! Reset tracer to zero at 0Z on specific day of week +! -------------------------------------------------- + idow = Chem_UtilIdow(nymd) + if ( (nhms==0) .and. (idow == gcBC%myDOW) ) then + cdow = Chem_UtilCdow(nymd) + do n = n1, n2 + w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) = tiny(1.) ! avoid division by zero + end do + if ( MAPL_AM_I_ROOT() ) then + print *, '<> BC '//cdow//' tracer being set to zero on ', nymd, nhms + end if + end if + +! Update emissions/production if necessary (daily) +! ----------------------------------------------- + +! Biomass Burning -- select on known inventories +! ---------------------------------------------- + + call MAPL_GetPointer(impChem,var2d,'BC_BIOMASS'//iNAME,rc=status) + VERIFY_(STATUS) + gcBC%biomass_src = var2d + +! Biofuel and anthropogenic emissions (inventories) +! ------------------------------------------------- + call MAPL_GetPointer(impChem,var2d,'BC_BIOFUEL'//iNAME,rc=status) + VERIFY_(STATUS) + gcBC%biofuel_src = var2d + + call MAPL_GetPointer(impChem,var2d,'BC_ANTEBC1'//iNAME,rc=status) + VERIFY_(STATUS) + gcBC%ebcant1_src = var2d + + call MAPL_GetPointer(impChem,var2d,'BC_ANTEBC2'//iNAME,rc=status) + VERIFY_(STATUS) + gcBC%ebcant2_src = var2d + +! Ship based BC emissions + call MAPL_GetPointer(impChem,var2d,'BC_SHIP'//iNAME,rc=status) + VERIFY_(STATUS) + gcBC%bc_ship_src = var2d + +! Aircraft emissions during LTO, CDS and CRS phases of flight + call MAPL_GetPointer(impChem,var2d,'BC_AVIATION_LTO'//iNAME,rc=status) + VERIFY_(STATUS) + gcBC%aviation_lto_src = var2d + + call MAPL_GetPointer(impChem,var2d,'BC_AVIATION_CDS'//iNAME,rc=status) + VERIFY_(STATUS) + gcBC%aviation_cds_src = var2d + + call MAPL_GetPointer(impChem,var2d,'BC_AVIATION_CRS'//iNAME,rc=status) + VERIFY_(STATUS) + gcBC%aviation_crs_src = var2d + +! As a safety check, where value is undefined set to 0 + do j = j1, j2 + do i = i1, i2 + if(1.01*gcBC%biomass_src(i,j) .gt. undefval) gcBC%biomass_src(i,j) = 0. + if(1.01*gcBC%biofuel_src(i,j) .gt. undefval) gcBC%biofuel_src(i,j) = 0. + if(1.01*gcBC%ebcant1_src(i,j) .gt. undefval) gcBC%ebcant1_src(i,j) = 0. + if(1.01*gcBC%ebcant2_src(i,j) .gt. undefval) gcBC%ebcant2_src(i,j) = 0. + if(1.01*gcBC%bc_ship_src(i,j) .gt. undefval) gcBC%bc_ship_src(i,j) = 0. + if(1.01*gcBC%aviation_lto_src(i,j) .gt. undefval) gcBC%aviation_lto_src(i,j) = 0. + if(1.01*gcBC%aviation_cds_src(i,j) .gt. undefval) gcBC%aviation_cds_src(i,j) = 0. + if(1.01*gcBC%aviation_crs_src(i,j) .gt. undefval) gcBC%aviation_crs_src(i,j) = 0. + enddo + enddo + + +#ifdef DEBUG + call pmaxmin ( 'BC: biomass', gcBC%biomass_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin ( 'BC: biofuel', gcBC%biofuel_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin ( 'BC: ebcant1', gcBC%ebcant1_src, qmin, qmax, ijl,1,1.) + call pmaxmin ( 'BC: ebcant2', gcBC%ebcant2_src, qmin, qmax, ijl,1,1.) + call pmaxmin ( 'BC: bc_ship', gcBC%bc_ship_src, qmin, qmax, ijl,1,1.) + call pmaxmin ( 'BC: avi_lto', gcBC%aviation_lto_src, qmin, qmax, ijl,1,1.) + call pmaxmin ( 'BC: avi_cds', gcBC%aviation_cds_src, qmin, qmax, ijl,1,1.) + call pmaxmin ( 'BC: avi_crs', gcBC%aviation_crs_src, qmin, qmax, ijl,1,1.) +#endif + +! Save this in case we need to apply diurnal cycle +! ------------------------------------------------ + if ( w_c%diurnal_bb ) then + gcBC%biomass_src_(:,:) = gcBC%biomass_src(:,:) + end if + +! Apply diurnal cycle if so desired +! --------------------------------- + if ( w_c%diurnal_bb ) then + call Chem_BiomassDiurnal ( gcBC%biomass_src, gcBC%biomass_src_, & + w_c%grid%lon(:,:)*radToDeg, & + w_c%grid%lat(:,:)*radToDeg, nhms, cdt ) + end if + +! Read any pointwise emissions, if requested +! ------------------------------------------ + if(gcBC%doing_point_emissions) then + call Chem_UtilPointEmissions( nymd, gcBC%point_emissions_srcfilen, & + gcBC%nPts, gcBC%vLat, gcBC%vLon, & + gcBC%vBase, gcBC%vTop, gcBC%vEmis, & + gcBC%vStart, gcBC%vEnd ) + +! In case vStart or vEnd were not specified in the file set to defaults + where(gcBC%vStart < 0) gcBC%vStart = 000000 + where(gcBC%vEnd < 0) gcBC%vEnd = 240000 + endif + + +! Apply NEI emissions over North America if so desired +! ---------------------------------------------------- + if (gcBC%doing_NEI) then + + allocate(nei_src1(i1:i2,j1:j2), nei_src2(i1:i2,j1:j2), __STAT__) + + call MAPL_GetPointer(impChem,var2d,'BC_NEI_BOT'//iNAME, __RC__) + nei_src1 = var2d + + call MAPL_GetPointer(impChem,var2d,'BC_NEI_TOP'//iNAME, __RC__) + nei_src2 = var2d + + where ( (w_c%grid%lon.ge.gcBC%nei_lon(1)) .and. & + (w_c%grid%lon.le.gcBC%nei_lon(2)) .and. & + (w_c%grid%lat.ge.gcBC%nei_lat(1)) .and. & + (w_c%grid%lat.le.gcBC%nei_lat(2)) ) + + gcBC%ebcant1_src = nei_src1 + gcBC%ebcant2_src = nei_src2 + end where + +#ifdef DEBUG + call pmaxmin('BC: nei_bot', nei_src1, qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: nei_top', nei_src2, qmin, qmax, ijl,1, 1. ) +#endif + + deallocate(nei_src1, nei_src2) + + end if ! doing NEI + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin ( 'BC: q_beg', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, ple, 'PLE', __RC__ ) + + + +#ifdef DEBUG + + call pmaxmin('BC: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + + call pmaxmin('BC: tmpu ', tmpu , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BC: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + +#endif + +! BC Source +! ----------- + call BC_Emission ( i1, i2, j1, j2, km, nbins, cdt, gcBC, w_c, & + pblh, tmpu, rhoa, BC_emis, & + BC_emisAN, BC_emisBB, BC_emisBF, rc ) + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('BC: q_emi', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), & + qmin, qmax, ijl, km, 1. ) + end do +#endif + + return + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_Emission - Adds Black Carbon emission for one timestep +! We have emissions from 5 sources, which are distributed +! differently in the vertical +! 1) biomass burning - uniformly mixed in PBL +! 2) biofuel sources - emitted into lowest 100 m +! 3) anthropogenic l1 - emitted into lowest 100 m +! 4) anthropogenic l2 - emitted into 100 - 500 m levels +! 5) point sources - emitted in altitudes specified in input +! +! !INTERFACE: +! + + subroutine BC_Emission ( i1, i2, j1, j2, km, nbins, cdt, gcBC, w_c, & + pblh, tmpu, rhoa, BC_emis, & + BC_emisAN, BC_emisBB, BC_emisBF, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km, nbins + real, intent(in) :: cdt + type(BC_GridComp1), intent(in) :: gcBC ! BC Grid Component + real, pointer, dimension(:,:) :: pblh + real, pointer, dimension(:,:,:) :: tmpu + real, pointer, dimension(:,:,:) :: rhoa + +! !OUTPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + type(Chem_Array), intent(inout) :: BC_emis(nbins) ! BC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: BC_emisAN ! BC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: BC_emisBB ! BC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: BC_emisBF ! BC emissions, kg/m2/s + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'BC_Emission' + +! !DESCRIPTION: Updates the BC concentration with emissions every timestep +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k, m, n, ios, ijl, ii + integer :: n1, n2 + ! pressure at 100m, 500m, & PBLH + real, dimension(i1:i2,j1:j2) :: p100, p500, pPblh + real, dimension(i1:i2,j1:j2) :: p0, z0, ps + real :: p1, z1, dz, delz, delp, f100, f500, fPblh + real :: qmax, qmin + + real, dimension(i1:i2,j1:j2) :: factor, srcHydrophobic, srcHydrophilic + real, dimension(i1:i2,j1:j2) :: srcBiofuel, srcBiomass, srcAnthro + real :: srcAll, zpbl, maxAll + + real, dimension(i1:i2,j1:j2,km) :: emis_aviation + real, dimension(i1:i2,j1:j2,km) :: srcAviation + real :: z_lto_bot, z_lto_top + real :: z_cds_bot, z_cds_top + real :: z_crs_bot, z_crs_top + +! Indices for point emissions + integer, pointer, dimension(:) :: iPoint, jPoint + real, dimension(km) :: point_column_emissions + +! Initialize local variables +! -------------------------- + n1 = w_c%reg%i_BC + n2 = w_c%reg%j_BC + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + +! Zero diagnostic accumulators + do n = 1, nbins + if( associated(BC_emis(n)%data2d) ) BC_emis(n)%data2d = 0.0 + end do + if(associated(BC_emisAN%data2d) ) BC_emisAN%data2d = 0.0 + if(associated(BC_emisBF%data2d) ) BC_emisBF%data2d = 0.0 + if(associated(BC_emisBB%data2d) ) BC_emisBB%data2d = 0.0 + +! Distribute aircraft emissions from LTO, CDS and CRS layers +! ---------------------------------------------------------- + z_lto_bot = max(1e-3, gcBC%aviation_layers(1)) + z_lto_top = max(2e-3, gcBC%aviation_layers(2)) + + z_cds_bot = max(2e-3, gcBC%aviation_layers(2)) + z_cds_top = max(3e-3, gcBC%aviation_layers(3)) + + z_crs_bot = max(3e-3, gcBC%aviation_layers(3)) + z_crs_top = max(4e-3, gcBC%aviation_layers(4)) + + emis_aviation = 0.0 + srcAviation = 0.0 + + call distribute_aviation_emissions(w_c%delp, rhoa, z_lto_bot, z_lto_top, gcBC%aviation_lto_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(w_c%delp, rhoa, z_cds_bot, z_cds_top, gcBC%aviation_cds_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(w_c%delp, rhoa, z_crs_bot, z_crs_top, gcBC%aviation_crs_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + +! Determine surface pressure +! AMS Note: pass this in +! -------------------------- + ps = 0.0 + do k = 1, km + ps(i1:i2,j1:j2) = ps(i1:i2,j1:j2) + w_c%delp(i1:i2,j1:j2,k) + end do + +! Find the pressure of the 100m, 500m, and PBLH altitudes +! AMS Note: this could be greatly simplified by using ze/zm and having a +! generic routine from the bottom up with an early exit condition +! ----------------------------------------------------------------------- + p0 = ps + z0(i1:i2,j1:j2) = 0. + do k = km, 1, -1 + do j = j1, j2 + do i = i1, i2 + p1 = p0(i,j) - w_c%delp(i,j,k) + dz = w_c%delp(i,j,k)/rhoa(i,j,k)/grav + z1 = z0(i,j)+dz + if(z0(i,j) .lt. 100 .and. z1 .ge. 100.) then + delz = z1-100. + delp = delz*rhoa(i,j,k)*grav + p100(i,j) = p1+delp + endif + if(z0(i,j) .lt. 500 .and. z1 .ge. 500.) then + delz = z1-500. + delp = delz*rhoa(i,j,k)*grav + p500(i,j) = p1+delp + endif + zpbl = max ( pblh(i,j), 100. ) + if(z0(i,j) .lt. zpbl .and. z1 .ge. zpbl ) then + delz = z1-zpbl + delp = delz*rhoa(i,j,k)*grav + pPblh(i,j) = p1+delp + endif + p0(i,j) = p1 + z0(i,j) = z1 + end do + end do + end do + +#if 0 + call pmaxmin ( 'BC: p100 ', p100, qmin, qmax, ijl, 1, 1. ) + call pmaxmin ( 'BC: p500 ', p500, qmin, qmax, ijl, 1, 1. ) + call pmaxmin ( 'BC: pPBL ', pPBLh, qmin, qmax, ijl, 1, 1. ) +#endif + +! Now update the tracer mixing ratios with the aerosol sources +! ------------------------------------------------------------ + p0 = ps +K_LOOP: do k = km, 1, -1 + +!!! print *, 'BC_Emissions: getting emissions for layer ', k + +! First determine emissions for this layer +! ---------------------------------------- + do j = j1, j2 + do i = i1, i2 + + p1 = p0(i,j) - w_c%delp(i,j,k) + +! Pressure @ 100m +! --------------- + f100 = 0. + if(p1 .ge. p100(i,j)) f100 = w_c%delp(i,j,k)/(ps(i,j)-p100(i,j)) + if(p1 .lt. p100(i,j) .and. p0(i,j) .ge. p100(i,j)) & + f100 = (p0(i,j)-p100(i,j))/(ps(i,j)-p100(i,j)) + +! Pressure @ 500m +! --------------- + f500 = 0. + if ( p0(i,j) .ge. p100(i,j) .and. p1 .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = (p100(i,j)-p1)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = w_c%delp(i,j,k)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .ge. p500(i,j) .and. p1 .lt. p500(i,j)) & + f500 = (p0(i,j)-p500(i,j))/(p100(i,j)-p500(i,j)) + +! Pressure @ PBL height +! --------------------- + fPblh = 0. + if(p1 .ge. pPblh(i,j)) fPblh = w_c%delp(i,j,k)/(ps(i,j)-pPblh(i,j)) + if(p1 .lt. pPblh(i,j) .and. p0(i,j) .ge. pPblh(i,j)) & + fPblh = (p0(i,j)-pPblh(i,j))/(ps(i,j)-pPblh(i,j)) + +! Sources by class in kg m-2 s-1 +! ------------------------------ + srcBiofuel(i,j) = f100 * gcBC%biofuel_src(i,j) + srcAnthro(i,j) = f100 * gcBC%ebcant1_src(i,j) & + + f500 * gcBC%ebcant2_src(i,j) & + + f100 * gcBC%bc_ship_src(i,j) & + + srcAviation(i,j,k) + + srcBiomass(i,j) = fPblh*gcBC%biomass_src(i,j) + + srcAll = srcBiofuel(i,j) + srcAnthro(i,j) + srcBiomass(i,j) + srcHydrophobic(i,j) = gcBC%fHydrophobic * srcAll + srcHydrophilic(i,j) = (1.-gcBC%fHydrophobic) * srcAll + +! Update pressure of lower level +! ------------------------------ + p0(i,j) = p1 + + end do ! i + end do ! j + +! Determine global max/min +! ------------------------ + call pmaxmin ( 'BC: Phobic ', srcHydrophobic, qmin, qmax, ijl, 1, 0. ) + maxAll = abs(qmax) + abs(qmin) + call pmaxmin ( 'BC: Philic ', srcHydrophilic, qmin, qmax, ijl, 1, 0. ) + maxAll = max ( maxAll, abs(qmax) + abs(qmin) ) + +! If emissions are zero at this level (globally), we are done +! ----------------------------------------------------------- + if ( maxAll .eq. 0.0 ) exit K_LOOP + +! Update concentrations at this layer +! The "1" element is hydrophobic +! The "2" element is hydrophilic +! ----------------------------------- + factor = cdt * grav / w_c%delp(:,:,k) + + w_c%qa(n1)%data3d(:,:,k) = w_c%qa(n1)%data3d(:,:,k) & + + factor * srcHydrophobic + + w_c%qa(n2)%data3d(:,:,k) = w_c%qa(n2)%data3d(:,:,k) & + + factor * srcHydrophilic + +! Fill in diagnostics if requested +! -------------------------------- + if ( associated(BC_emis(1)%data2d)) & + BC_emis(1)%data2d = BC_emis(1)%data2d + srcHydrophobic + + if ( associated(BC_emis(2)%data2d)) & + BC_emis(2)%data2d = BC_emis(2)%data2d + srcHydrophilic + + if ( associated(BC_emisBF%data2d)) & + BC_emisBF%data2d = BC_emisBF%data2d + srcBiofuel + + if ( associated(BC_emisBB%data2d)) & + BC_emisBB%data2d = BC_emisBB%data2d + srcBiomass + + if ( associated(BC_emisAN%data2d)) & + BC_emisAN%data2d = BC_emisAN%data2d + srcAnthro + + end do K_LOOP + +! Distribute pointwise sources if requested +! ----------------------------------------- + if( gcBC%doing_point_emissions .and. gcBC%nPts > 0) then + +! Get indices for point emissions +! ------------------------------- + allocate(iPoint(gcBC%nPts), jPoint(gcBC%nPts), stat=ios) + + call MAPL_GetHorzIJIndex(gcBC%nPts, iPoint, jPoint, & + grid = w_c%grid_esmf, & + lon = gcBC%vLon/radToDeg, & + lat = gcBC%vLat/radToDeg, & + rc = rc) + + if ( rc /= 0 ) call die(myname,'cannot get indices for point emissions') + + do ii = 1, gcBC%nPts + i = iPoint(ii) + j = jPoint(ii) + if( i<1 .OR. j<1 ) cycle ! point emission not in this sub-domain +! if( gcBC%regionMask(i,j) == 0 ) cycle ! masked by region mask + +! Emissions not occurring in current time step +! -------------------------------------------- + if(nhms < gcBC%vStart(ii) .or. nhms >= gcBC%vEnd(ii)) cycle + + call distribute_point_emissions(w_c%delp(i,j,:), rhoa(i,j,:), & + gcBC%vBase(ii), gcBC%vTop(ii), gcBC%vEmis(ii), & + point_column_emissions, km) + w_c%qa(n1)%data3d(i,j,:) = w_c%qa(n1)%data3d(i,j,:) & + + gcBC%fHydrophobic * cdt * grav / w_c%delp(i,j,:) & + * point_column_emissions / w_c%grid%cell_area(i,j) + w_c%qa(n2)%data3d(i,j,:) = w_c%qa(n2)%data3d(i,j,:) & + + (1-gcBC%fHydrophobic) * cdt * grav / w_c%delp(i,j,:) & + * point_column_emissions / w_c%grid%cell_area(i,j) + + enddo + deallocate(iPoint, jPoint, stat=ios) + endif + + + + rc = 0 + + end subroutine BC_Emission + + subroutine distribute_aviation_emissions(delp, rhoa, z_bot, z_top, emissions_layer, emissions, i1, i2, j1, j2, km) + + implicit none + + integer, intent(in) :: i1, i2, j1, j2, km + + real, dimension(:,:,:), intent(in) :: delp + real, dimension(:,:,:), intent(in) :: rhoa + real, dimension(:,:), intent(in) :: emissions_layer + real, intent(in) :: z_bot + real, intent(in) :: z_top + real, dimension(:,:,:), intent(out):: emissions + +! local + integer :: i, j, k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ + + do j = j1, j2 + do i = i1, i2 + ! find level height + z = 0.0 + z_= 0.0 + + do k = km, 1, -1 + dz(k) = delp(i,j,k)/rhoa(i,j,k)/grav + z_ = z_ + dz(k) + z(k) = z_ + end do + + ! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + + ! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + + ! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot .eq. k_top) then + w_(k_bot) = z_top - z_bot + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + + ! distribute emissions in the vertical + emissions(i,j,:) = (w_ / sum(w_)) * emissions_layer(i,j) + end do + end do + + end subroutine distribute_aviation_emissions + + +! Abstracted from distribute_aviation_emissions above, but called per column + subroutine distribute_point_emissions(delp, rhoa, z_bot, z_top, emissions_point, & + emissions, km) + + implicit none + + integer, intent(in) :: km + + real, dimension(:), intent(in) :: delp + real, dimension(:), intent(in) :: rhoa + real, intent(in) :: emissions_point + real, intent(in) :: z_bot + real, intent(in) :: z_top + real, dimension(:), intent(out):: emissions + +! local + integer :: k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ + +! find level height + z = 0.0 + z_= 0.0 + + do k = km, 1, -1 + dz(k) = delp(k)/rhoa(k)/grav + z_ = z_ + dz(k) + z(k) = z_ + end do + +! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + +! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + +! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot .eq. k_top) then + w_(k_bot) = z_top - z_bot + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + +! distribute emissions in the vertical + emissions(:) = (w_ / sum(w_)) * emissions_point + + end subroutine distribute_point_emissions + + end subroutine BC_GridCompRun1_ + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_GridCompRun2_ --- The Chem Driver, run phase 2 +! +! !INTERFACE: +! + + subroutine BC_GridCompRun2_ ( gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(BC_GridComp1), intent(inout) :: gcBC ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called BC Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'BC_GridCompRun2_' + character(len=*), parameter :: Iam = myname + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n, ios + integer :: i, j, k, ijl, ijkl, ijk1l + real :: qmax, qmin + real :: qUpdate, delq + real, pointer :: dqa(:,:), drydepositionfrequency(:,:) + type(Chem_Array), pointer :: fluxout + logical :: KIN + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: frlake, frocean, frseaice, & + oro, u10m, v10m, & + ustar, precc, precl, & + pblh, shflux, z0h, hsurf + real, pointer, dimension(:,:,:) :: tmpu, rhoa, u, v, hghte, ple + real, pointer, dimension(:,:,:) :: pfllsan, pfilsan + + +! Additional needs for GOCART convective diagnostic + real, pointer, dimension(:,:,:) :: cmfmc, qlcn, qicn, dtrain + real, pointer, dimension(:,:) :: area + real*8, allocatable, dimension(:,:,:) :: cmfmc_, qccu_, dtrain_, & + airmass_, airmol_, vud_, & + delz_, delp_, tmpu_, ple_ + real*8, allocatable :: tc_(:,:,:,:), bcnv_(:,:,:) + real*8, allocatable :: area_(:,:), frlake_(:,:), & + frocean_(:,:), frseaice_(:,:) + integer*4 :: icdt + + real, pointer :: BC_radius(:), BC_rhop(:) + integer :: rhFlag + + +#define EXPORT expChem +#define iNAME TRIM(gcBC%iname) + +#define ptrBCWT BC_wet +#define ptrBCSV BC_conv +#define ptrBCEM BC_emis +#define ptrBCDP BC_dep +#define ptrBCSD BC_set + +#define ptrBCMASS BC_mass +#define ptrBCEMAN BC_emisAN +#define ptrBCEMBB BC_emisBB +#define ptrBCEMBF BC_emisBF +#define ptrBCHYPHIL BC_toHydrophilic +#define ptrBCSMASS BC_sfcmass +#define ptrBCCMASS BC_colmass +#define ptrBCEXTTAU BC_exttau +#define ptrBCSCATAU BC_scatau +#define ptrBCCONC BC_conc +#define ptrBCEXTCOEF BC_extcoef +#define ptrBCSCACOEF BC_scacoef +#define ptrBCANGSTR BC_angstrom +#define ptrBCFLUXU BC_fluxu +#define ptrBCFLUXV BC_fluxv + + + + integer :: STATUS + +#include "BC_GetPointer___.h" + + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_BC + n1 = w_c%reg%i_BC + n2 = w_c%reg%j_BC + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin ( 'BC: q_beg', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, frlake, 'FRLAKE', __RC__ ) + call MAPL_GetPointer ( impChem, oro, 'LWI', __RC__ ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', __RC__ ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', __RC__ ) + call MAPL_GetPointer ( impChem, ustar, 'USTAR', __RC__ ) + call MAPL_GetPointer ( impChem, precc, 'CN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, precl, 'NCN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + call MAPL_GetPointer ( impChem, shflux, 'SH', __RC__ ) + call MAPL_GetPointer ( impChem, z0h, 'Z0H', __RC__ ) + call MAPL_GetPointer ( impChem, area, 'AREA', __RC__ ) + call MAPL_GetPointer ( impChem, frocean, 'FROCEAN', __RC__ ) + call MAPL_GetPointer ( impChem, frseaice, 'FRACI', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, u, 'U', __RC__ ) + call MAPL_GetPointer ( impChem, v, 'V', __RC__ ) + call MAPL_GetPointer ( impChem, hghte, 'ZLE', __RC__ ) + call MAPL_GetPointer ( impChem, ple, 'PLE', __RC__ ) + call MAPL_GetPointer ( impChem, qlcn, 'QLCN', __RC__ ) + call MAPL_GetPointer ( impChem, qicn, 'QICN', __RC__ ) + call MAPL_GetPointer ( impChem, cmfmc, 'CNV_MFC', __RC__ ) + call MAPL_GetPointer ( impChem, dtrain, 'CNV_MFD', __RC__ ) + call MAPL_GetPointer ( impChem, pfllsan, 'PFL_LSAN', __RC__ ) + call MAPL_GetPointer ( impChem, pfilsan, 'PFI_LSAN', __RC__ ) + +! Unlike GEOS-4 hghte is defined for km+1 +! --------------------------------------- + hsurf => hghte(i1:i2,j1:j2,km) ! Recall: GEOS-5 has edges with k in [0,km] + + + +#ifdef DEBUG + + call pmaxmin('BC: frlake ', frlake , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: frocean ', frocean , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: frseaice ', frseaice, qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: area ', area , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: oro ', oro , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: u10m ', u10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: v10m ', v10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: ustar ', ustar , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: precc ', precc , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: precl ', precl , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: shflux ', shflux , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: z0h ', z0h , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BC: hsurf ', hsurf , qmin, qmax, ijl,1, 1. ) + + call pmaxmin('BC: tmpu ', tmpu , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BC: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BC: u ', u , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BC: v ', v , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BC: hghte ', hghte , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BC: qlcn ', qlcn , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BC: qicn ', qicn , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BC: cmfmc ', cmfmc , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BC: dtrain ', dtrain , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BC: pfllsan ', pfllsan , qmin, qmax, ijk1l,1, 1. ) + call pmaxmin('BC: pfilsan ', pfilsan , qmin, qmax, ijk1l,1, 1. ) + +#endif + +RUN_ALARM: if (gcBC%run_alarm) then + + allocate( fluxout ) + allocate( fluxout%data2d(i1:i2,j1:j2), dqa(i1:i2,j1:j2), & + drydepositionfrequency(i1:i2,j1:j2), stat=STATUS) + VERIFY_(STATUS) + + + +! Ad Hoc transfer of hydrophobic to hydrophilic aerosols +! Following Chin's parameterization, the rate constant is +! k = 4.63e-6 s-1 (.4 day-1; e-folding time = 2.5 days) + if(associated(BC_toHydrophilic%data2d)) & + BC_toHydrophilic%data2d(i1:i2,j1:j2) = 0.0 + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + qUpdate = w_c%qa(n1)%data3d(i,j,k)*exp(-4.63e-6*cdt) + qUpdate = max(qUpdate,1e-32) + delq = max(0.,w_c%qa(n1)%data3d(i,j,k)-qUpdate) + w_c%qa(n1)%data3d(i,j,k) = qUpdate + w_c%qa(n2)%data3d(i,j,k) = w_c%qa(n2)%data3d(i,j,k)+delq + if(associated(BC_toHydrophilic%data2d)) & + BC_toHydrophilic%data2d(i,j) = BC_toHydrophilic%data2d(i,j) & + + delq*w_c%delp(i,j,k)/grav/cdt + end do + end do + end do + +! BC Settling +! ----------- + allocate( BC_radius(nbins), BC_rhop(nbins) ) + BC_radius(:) = 0.35e-6 ! radius for settling [m] + BC_rhop(:) = 1800. ! density for setting [kg m-3] + rhFlag = 0 ! settle like dry particles + call Chem_Settling ( i1, i2, j1, j2, km, n1, n2, nbins, rhFlag, & + BC_radius, BC_rhop, cdt, w_c, tmpu, rhoa, hsurf, & + hghte, BC_set, rc ) + deallocate( BC_radius, BC_rhop) + +! BC Deposition +! ----------- + drydepositionfrequency = 0. + call DryDepositionGOCART( i1, i2, j1, j2, km, & + tmpu, rhoa, hghte, oro, ustar, & + pblh, shflux, z0h, drydepositionfrequency, rc ) + + do n = 1, nbins + dqa = 0. + dqa = max(0.0, w_c%qa(n1+n-1)%data3d(:,:,km)*(1.-exp(-drydepositionfrequency*cdt))) + w_c%qa(n1+n-1)%data3d(:,:,km) = & + w_c%qa(n1+n-1)%data3d(:,:,km) - dqa + if( associated(BC_dep(n)%data2d) ) & + BC_dep(n)%data2d = dqa*w_c%delp(:,:,km)/grav/cdt + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('BC: q_dry', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! BC Large-scale Wet Removal +! -------------------------- +! Hydrophobic mode (first tracer) is not removed + if(associated(BC_wet(1)%data2d)) BC_wet(1)%data2d = 0. +! Hydrophilic mode (second tracer) is removed + KIN = .TRUE. + do n = nbins, nbins + w_c%qa(n1+n-1)%fwet = 1. + call WetRemovalGOCART(i1, i2, j1, j2, km, n1+n-1, n1+n-1, cdt, 'BC', KIN, & + w_c%qa, ple, tmpu, rhoa, pfllsan, pfilsan, & + precc, precl, fluxout, rc ) + if(associated(BC_wet(n)%data2d)) BC_wet(n)%data2d = fluxout%data2d + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('BC: q_wet', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! Black Carbon Convective-scale Mixing and Wet Removal +! ---------------------------------------------------- + KIN = .TRUE. + icdt = cdt + allocate(cmfmc_(i1:i2,j1:j2,km+1), qccu_(i1:i2,j1:j2,km), & + dtrain_(i1:i2,j1:j2,km), airmass_(i1:i2,j1:j2,km), & + delz_(i1:i2,j1:j2,km), vud_(i1:i2,j1:j2,km), & + tc_(i1:i2,j1:j2,km,n1:n2), delp_(i1:i2,j1:j2,km), ple_(i1:i2,j1:j2,km+1), & + airmol_(i1:i2,j1:j2,km), tmpu_(i1:i2,j1:j2,km), bcnv_(i1:i2,j1:j2,n1:n2), & + area_(i1:i2,j1:j2), frlake_(i1:i2,j1:j2), & + frocean_(i1:i2,j1:j2), frseaice_(i1:i2,j1:j2), __STAT__ ) + + bcnv_ = 0.0 + area_ = area + frlake_ = frlake + frocean_ = frocean + frseaice_ = frseaice + do k = 1, km+1 + cmfmc_(:,:,k) = cmfmc(:,:,km-k+1) + ple_(:,:,k) = ple(:,:,km-k+1) + end do + do k = 1, km + dtrain_(:,:,k) = dtrain(:,:,km-k+1) + qccu_(:,:,k) = qlcn(:,:,km-k+1) + qicn(:,:,km-k+1) + delp_(:,:,k) = w_c%delp(:,:,km-k+1)/100. + airmass_(:,:,k) = w_c%delp(:,:,km-k+1)/grav*area_ + airmol_(:,:,k) = airmass_(:,:,k)*1000./28.966 + delz_(:,:,k) = w_c%delp(:,:,km-k+1)/grav/rhoa(:,:,km-k+1) + tmpu_(:,:,k) = tmpu(:,:,km-k+1) + enddo + do n = n1, n2 + do k = 1, km + tc_(:,:,k,n) = w_c%qa(n)%data3d(:,:,km-k+1) + enddo + enddo + call set_vud(i1, i2, j1, j2, km, frlake_, frocean_, frseaice_, cmfmc_, qccu_, & + airmass_, delz_, area_, vud_) + call convection(i1, i2, j1, j2, km, n1, n2, icdt, 'BC', kin, & + tc_, cmfmc_, dtrain_, area_, delz_, delp_, vud_, & + airmass_, airmol_, tmpu_, ple_, & + bcnv_) +! Return adjusted tracer to mixing ratio + do n = n1, n2 + do k = 1, km + w_c%qa(n)%data3d(:,:,km-k+1) = tc_(:,:,k,n) + enddo + enddo + +! Note GOCART returns bcnv_ as negative, recast for my diagnostic + if(associated(BC_conv(1)%data2d)) BC_conv(1)%data2d = 0.0 + if(associated(BC_conv(2)%data2d)) BC_conv(2)%data2d = -bcnv_(:,:,n2)/area_/icdt + + +! Clean up +! -------- + deallocate(cmfmc_, qccu_, dtrain_, tc_, airmass_, & + delz_, vud_, delp_, airmol_, tmpu_, bcnv_, ple_, & + area_, frlake_, frocean_, frseaice_, __STAT__ ) + + deallocate(fluxout%data2d) + deallocate(fluxout, dqa, drydepositionfrequency, stat=ios ) + + end if RUN_ALARM + +! Compute the desired output diagnostics here +! Ideally this will go where chemout is called in fvgcm.F since that +! will reflect the distributions after transport, etc. +! ------------------------------------------------------------------ + call BC_Compute_Diags(i1, i2, j1, j2, km, nbins, gcBC, w_c, tmpu, rhoa, u, v, & + BC_sfcmass, BC_colmass, BC_mass, BC_exttau, & + BC_scatau, BC_conc, BC_extcoef, BC_scacoef, BC_angstrom, & + BC_fluxu, BC_fluxv, rc) + + return + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_Compute_Diags - Calculate dust 2D diagnostics +! +! !INTERFACE: +! + + subroutine BC_Compute_Diags ( i1, i2, j1, j2, km, nbins, gcBC, w_c, tmpu, rhoa, u, v, & + sfcmass, colmass, mass, exttau, scatau, & + conc, extcoef, scacoef, angstrom, fluxu, fluxv, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2, km, nbins + type(BC_GridComp1), intent(inout):: gcBC ! BC Grid Component + type(Chem_Bundle), intent(in) :: w_c ! Chem Bundle + real, pointer, dimension(:,:,:) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:,:) :: u ! east-west wind [m s-1] + real, pointer, dimension(:,:,:) :: v ! north-south wind [m s-1] + +! !OUTPUT PARAMETERS: + type(Chem_Array), intent(inout) :: sfcmass ! sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: colmass ! col mass density kg/m2 + type(Chem_Array), intent(inout) :: mass ! 3d mass mixing ratio kg/kg + type(Chem_Array), intent(inout) :: exttau ! ext. AOT at 550 nm + type(Chem_Array), intent(inout) :: scatau ! sct. AOT at 550 nm + type(Chem_Array), intent(inout) :: conc ! 3d mass concentration, kg/m3 + type(Chem_Array), intent(inout) :: extcoef ! 3d ext. coefficient, 1/m + type(Chem_Array), intent(inout) :: scacoef ! 3d scat.coefficient, 1/m + type(Chem_Array), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter + type(Chem_Array), intent(inout) :: fluxu ! Column mass flux in x direction + type(Chem_Array), intent(inout) :: fluxv ! Column mass flux in y direction + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Calculates some simple 2d diagnostics from the BC fields +! Surface concentration (dry) +! Column mass load (dry) +! Extinction aot 550 (wet) +! Scattering aot 550 (wet) +! For the moment, this is hardwired. +! +! !REVISION HISTORY: +! +! 16APR2004, Colarco +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + character(len=*), parameter :: myname = 'BC_Compute_Diags' + integer :: i, j, k, n, n1, n2, ios, nch, idx + real :: tau, ssa + character(len=255) :: qname + real, dimension(i1:i2,j1:j2) :: tau470, tau870 + real :: ilam550, ilam470, ilam870 + logical :: do_angstrom + + +! Initialize local variables +! -------------------------- + n1 = w_c%reg%i_BC + n2 = w_c%reg%j_BC + nch = gcBC%mie_tables%nch + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + ilam470 = 0. + ilam870 = 0. + if(nch .gt. 1) then + do i = 1, nch + if ( gcBC%mie_tables%channels(i) .ge. 5.49e-7 .and. & + gcBC%mie_tables%channels(i) .le. 5.51e-7) ilam550 = i + if ( gcBC%mie_tables%channels(i) .ge. 4.69e-7 .and. & + gcBC%mie_tables%channels(i) .le. 4.71e-7) ilam470 = i + if ( gcBC%mie_tables%channels(i) .ge. 8.69e-7 .and. & + gcBC%mie_tables%channels(i) .le. 8.71e-7) ilam870 = i + enddo + endif + +! Determine if going to do Angstrom parameter calculation +! ------------------------------------------------------- + do_angstrom = .false. +! If both 470 and 870 channels provided (and not the same) then +! possibly will do Angstrom parameter calculation + if(ilam470 .ne. 0. .and. & + ilam870 .ne. 0. .and. & + ilam470 .ne. ilam870) do_angstrom = .true. + + +! Calculate the diagnostic variables if requested +! ----------------------------------------------- + +! Calculate the surface mass concentration + if( associated(sfcmass%data2d) ) then + sfcmass%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + sfcmass%data2d(i1:i2,j1:j2) & + = sfcmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + end do + endif + +! Calculate the dust column loading + if( associated(colmass%data2d) ) then + colmass%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + colmass%data2d(i1:i2,j1:j2) & + = colmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + end do + end do + endif + +! Calculate the total mass concentration + if( associated(conc%data3d) ) then + conc%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + conc%data3d(i1:i2,j1:j2,1:km) & + = conc%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km)*rhoa(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the total mass mixing ratio + if( associated(mass%data3d) ) then + mass%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + mass%data3d(i1:i2,j1:j2,1:km) & + = mass%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the column mass flux in x direction + if( associated(fluxu%data2d) ) then + fluxu%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + fluxu%data2d(i1:i2,j1:j2) & + = fluxu%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*u(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the column mass flux in y direction + if( associated(fluxv%data2d) ) then + fluxv%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + fluxv%data2d(i1:i2,j1:j2) & + = fluxv%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*v(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the extinction and/or scattering AOD + if( associated(exttau%data2d) .or. associated(scatau%data2d) ) then + + if( associated(exttau%data2d) ) then + exttau%data2d(i1:i2,j1:j2) = 0. + endif + if( associated(scatau%data2d) ) then + scatau%data2d(i1:i2,j1:j2) = 0. + endif + + if( associated(extcoef%data3d)) then + extcoef%data3d(i1:i2,j1:j2,1:km) = 0. + endif + if( associated(scacoef%data3d)) then + scacoef%data3d(i1:i2,j1:j2,1:km) = 0. + endif + + do n = 1, nbins + +! Select the name for species + qname = trim(w_c%reg%vname(n+n1-1)) + idx = Chem_MieQueryIdx(gcBC%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(gcBC%mie_tables, idx, ilam550, & + w_c%qa(n1+n-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau, ssa=ssa) + +! Calculate the total ext. and scat. coefficients + if( associated(extcoef%data3d) ) then + extcoef%data3d(i,j,k) = extcoef%data3d(i,j,k) + & + tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + if( associated(scacoef%data3d) ) then + scacoef%data3d(i,j,k) = scacoef%data3d(i,j,k) + & + ssa * tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + +! Integrate in the vertical + if( associated(exttau%data2d) ) then + exttau%data2d(i,j) = exttau%data2d(i,j) + tau + endif + if( associated(scatau%data2d) ) then + scatau%data2d(i,j) = scatau%data2d(i,j) + tau*ssa + endif + + enddo + enddo + enddo + + enddo ! nbins + + endif + + +! Calculate the 470-870 Angstrom parameter + if( associated(angstrom%data2d) .and. do_angstrom ) then + + angstrom%data2d(i1:i2,j1:j2) = 0. +! Set tau to small number by default + tau470(i1:i2,j1:j2) = tiny(1.0) + tau870(i1:i2,j1:j2) = tiny(1.0) + + do n = 1, nbins + +! Select the name for species + qname = trim(w_c%reg%vname(n+n1-1)) + idx = Chem_MieQueryIdx(gcBC%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + + call Chem_MieQuery(gcBC%mie_tables, idx, ilam470, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau470(i,j) = tau470(i,j) + tau + + call Chem_MieQuery(gcBC%mie_tables, idx, ilam870, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau870(i,j) = tau870(i,j) + tau + + enddo + enddo + enddo + + enddo ! nbins + angstrom%data2d(i1:i2,j1:j2) = & + -log(tau470(i1:i2,j1:j2)/tau870(i1:i2,j1:j2)) / & + log(470./870.) + endif + + + rc = 0 + + end subroutine BC_Compute_Diags + + end subroutine BC_GridCompRun2_ + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + subroutine BC_GridCompFinalize1_ ( gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(BC_GridComp1), intent(inout) :: gcBC ! Grid Component + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Import State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + integer :: ios + character(len=*), parameter :: myname = 'BC_GridCompFinalize' + +! If initialized pointwise emissions from daily tables, clean-up + if(associated(gcBC%vLat)) deallocate(gcBC%vLat, stat=ios) + if(associated(gcBC%vLon)) deallocate(gcBC%vLon, stat=ios) + if(associated(gcBC%vEmis)) deallocate(gcBC%vEmis, stat=ios) + if(associated(gcBC%vBase)) deallocate(gcBC%vBase, stat=ios) + if(associated(gcBC%vTop)) deallocate(gcBC%vTop, stat=ios) + if(associated(gcBC%vStart)) deallocate(gcBC%vStart, stat=ios) + if(associated(gcBC%vEnd)) deallocate(gcBC%vEnd, stat=ios) + + rc=0 + return + + end subroutine BC_GridCompFinalize1_ + + end module BC_GridCompMod + + +!----------------------------------------------------------------------- + +! Single Instance Wrapper + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BC_SingleInstance_ --- Runs single instance of method +! +! !INTERFACE: +! + subroutine BC_SingleInstance_ ( Method_, instance, & + gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + Use BC_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! Input "function pointer" +! ----------------------- + interface + subroutine Method_ (gc, w, imp, exp, ymd, hms, dt, rcode ) + Use BC_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + type(BC_GridComp1), intent(inout) :: gc + type(Chem_Bundle), intent(in) :: w + type(ESMF_State), intent(inout) :: imp + type(ESMF_State), intent(inout) :: exp + integer, intent(in) :: ymd, hms + real, intent(in) :: dt + integer, intent(out) :: rcode + end subroutine Method_ + end interface + + integer, intent(in) :: instance ! instance number + + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(BC_GridComp1), INTENT(INOUT) :: gcBC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the BC Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer n_BC, i_BC, j_BC + character(len=255) :: i_qname, j_qname + +! Save overall BC indices +! ----------------------- + n_BC = w_c%reg%n_BC + i_BC = w_c%reg%i_BC + j_BC = w_c%reg%j_BC + +! Save the name of the variables in this instance +! ----------------------------------------------- + i_qname = trim(w_c%reg%vname(i_BC + 2*(instance - 1))) + j_qname = trim(w_c%reg%vname(i_BC + 2*(instance - 1) + 1)) + +! Customize indices for this particular instance +! ---------------------------------------------- + w_c%reg%n_BC = 2 + w_c%reg%i_BC = i_BC + 2*(instance - 1) + w_c%reg%j_BC = i_BC + 2*(instance - 1) + 1 + w_c%reg%vname(i_BC + 2*(instance - 1)) = w_c%reg%vname(i_BC) + w_c%reg%vname(i_BC + 2*(instance - 1) + 1) = w_c%reg%vname(i_BC + 1) + +! Execute the instance method +! --------------------------- + call Method_ ( gcBC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! Restore the overall BC indices +! ------------------------------ + w_c%reg%vname(i_BC + 2*(instance - 1)) = i_qname + w_c%reg%vname(i_BC + 2*(instance - 1) + 1) = j_qname + w_c%reg%n_BC = n_BC + w_c%reg%i_BC = i_BC + w_c%reg%j_BC = j_BC + + end subroutine BC_SingleInstance_ + +!----------------------------------------------------------------------- diff --git a/ESMF/GOCART_GridComp/BC_GridComp/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..657908a4 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/BC_GridComp_ExtData.rc @@ -0,0 +1,24 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# QFED v2.x +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_bc.006.%y4%m2%d2.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.surface.x3600_y1800_t12.2010.nc4 +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.elevated.x3600_y1800_t12.2010.nc4 + +# EDGAR based ship emissions +BC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.ships.x3600_y1800_t12.2010.nc4 + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none bc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.aviation_lto.x3600_y1800_t12.2010.nc4 +BC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none bc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.aviation_cds.x3600_y1800_t12.2010.nc4 +BC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none bc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_bc.aviation_crs.x3600_y1800_t12.2010.nc4 +%% + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/BC_Registry.rc b/ESMF/GOCART_GridComp/BC_GridComp/BC_Registry.rc new file mode 100644 index 00000000..83537caa --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/BC_Registry.rc @@ -0,0 +1,104 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: BC + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# -------------|------------|-----|---|----|---|---|-----|----------------------------------------------------- +# Short | | | V |Item|Intervl|# Sub| Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# -------------|------------|-----|---|----|---|---|-----|----------------------------------------------------- + BCMASS | kg/kg | xyz | C | | | | | Black Carbon Mass Mixing Ratio __ENSEMBLE__ + BCCONC | kg m-3 | xyz | C | | | | | Black Carbon Mass Concentration __ENSEMBLE__ + BCEXTCOEF | m-1 | xyz | C | | | | | Black Carbon Extinction Coefficient [550 nm] __ENSEMBLE__ + BCSCACOEF | m-1 | xyz | C | | | | | Black Carbon Scattering Coefficient [550 nm] __ENSEMBLE__ +# -------------|------------|-----|---|----|---|---|-----|----------------------------------------------------- + BCEM001 | kg m-2 s-1 | xy | | | | | | Black Carbon Emission Bin 001 __ENSEMBLE__ + BCEM002 | kg m-2 s-1 | xy | | | | | | Black Carbon Emission Bin 002 __ENSEMBLE__ + BCSD001 | kg m-2 s-1 | xy | | | | | | Black Carbon Sedimentation Bin 001 __ENSEMBLE__ + BCSD002 | kg m-2 s-1 | xy | | | | | | Black Carbon Sedimentation Bin 002 __ENSEMBLE__ + BCDP001 | kg m-2 s-1 | xy | | | | | | Black Carbon Dry Deposition Bin 001 __ENSEMBLE__ + BCDP002 | kg m-2 s-1 | xy | | | | | | Black Carbon Dry Deposition Bin 002 __ENSEMBLE__ + BCWT001 | kg m-2 s-1 | xy | | | | | | Black Carbon Wet Deposition Bin 001 __ENSEMBLE__ + BCWT002 | kg m-2 s-1 | xy | | | | | | Black Carbon Wet Deposition Bin 002 __ENSEMBLE__ + BCSV001 | kg m-2 s-1 | xy | | | | | | Black Carbon Convective Scavenging Bin 001 __ENSEMBLE__ + BCSV002 | kg m-2 s-1 | xy | | | | | | Black Carbon Convective Scavenging Bin 002 __ENSEMBLE__ + BCHYPHIL | kg m-2 s-1 | xy | | | | | | Black Carbon Hydrophobic to Hydrophilic __ENSEMBLE__ + BCEMAN | kg m-2 s-1 | xy | | | | | | Black Carbon Anthropogenic Emissions __ENSEMBLE__ + BCEMBB | kg m-2 s-1 | xy | | | | | | Black Carbon Biomass Burning Emissions __ENSEMBLE__ + BCEMBF | kg m-2 s-1 | xy | | | | | | Black Carbon Biofuel Emissions __ENSEMBLE__ + BCSMASS | kg m-3 | xy | | | | | | Black Carbon Surface Mass Concentration __ENSEMBLE__ + BCCMASS | kg m-2 | xy | | | | | | Black Carbon Column Mass Density __ENSEMBLE__ + BCEXTTAU | 1 | xy | | | | | | Black Carbon Extinction AOT [550 nm] __ENSEMBLE__ + BCSCATAU | 1 | xy | | | | | | Black Carbon Scattering AOT [550 nm] __ENSEMBLE__ + BCANGSTR | 1 | xy | | | | | | Black Carbon Angstrom parameter [470-870 nm] __ENSEMBLE__ + BCFLUXU | kg m-1 s-1 | xy | | | | | | Black Carbon column u-wind mass flux __ENSEMBLE__ + BCFLUXV | kg m-1 s-1 | xy | | | | | | Black Carbon column v-wind mass flux __ENSEMBLE__ +# -------------|------------|-----|---|----|---|---|-----|----------------------------------------------------- + BCMASSbiob | kg/kg | xyz | C | | | | | Black Carbon Mass Mixing Ratio biob + BCCONCbiob | kg m-3 | xyz | C | | | | | Black Carbon Mass Concentration biob + BCEXTCOEFbiob| m-1 | xyz | C | | | | | Black Carbon Extinction Coefficient [550 nm] biob + BCSCACOEFbiob| m-1 | xyz | C | | | | | Black Carbon Scattering Coefficient [550 nm] biob +# -------------|------------|-----|---|----|---|---|-----|----------------------------------------------------- + BCEM001biob | kg m-2 s-1 | xy | | | | | | Black Carbon Emission Bin 001 biob + BCEM002biob | kg m-2 s-1 | xy | | | | | | Black Carbon Emission Bin 002 biob + BCSD001biob | kg m-2 s-1 | xy | | | | | | Black Carbon Sedimentation Bin 001 biob + BCSD002biob | kg m-2 s-1 | xy | | | | | | Black Carbon Sedimentation Bin 002 biob + BCDP001biob | kg m-2 s-1 | xy | | | | | | Black Carbon Dry Deposition Bin 001 biob + BCDP002biob | kg m-2 s-1 | xy | | | | | | Black Carbon Dry Deposition Bin 002 biob + BCWT001biob | kg m-2 s-1 | xy | | | | | | Black Carbon Wet Deposition Bin 001 biob + BCWT002biob | kg m-2 s-1 | xy | | | | | | Black Carbon Wet Deposition Bin 002 biob + BCSV001biob | kg m-2 s-1 | xy | | | | | | Black Carbon Convective Scavenging Bin 001 biob + BCSV002biob | kg m-2 s-1 | xy | | | | | | Black Carbon Convective Scavenging Bin 002 biob + BCHYPHILbiob | kg m-2 s-1 | xy | | | | | | Black Carbon Hydrophobic to Hydrophilic biob + BCEMANbiob | kg m-2 s-1 | xy | | | | | | Black Carbon Anthropogenic Emissions biob + BCEMBBbiob | kg m-2 s-1 | xy | | | | | | Black Carbon Biomass Burning Emissions biob + BCEMBFbiob | kg m-2 s-1 | xy | | | | | | Black Carbon Biofuel Emissions biob + BCSMASSbiob | kg m-3 | xy | | | | | | Black Carbon Surface Mass Concentration biob + BCCMASSbiob | kg m-2 | xy | | | | | | Black Carbon Column Mass Density biob + BCEXTTAUbiob | 1 | xy | | | | | | Black Carbon Extinction AOT [550 nm] biob + BCSCATAUbiob | 1 | xy | | | | | | Black Carbon Scattering AOT [550 nm] biob + BCANGSTRbiob | 1 | xy | | | | | | Black Carbon Angstrom parameter [470-870 nm] biob + BCFLUXUbiob | kg m-1 s-1 | xy | | | | | | Black Carbon column u-wind mass flux biob + BCFLUXVbiob | kg m-1 s-1 | xy | | | | | | Black Carbon column v-wind mass flux biob +# -------------|------------|-----|---|----|---|---|-----|----------------------------------------------------- + BCMASSanth | kg/kg | xyz | C | | | | | Black Carbon Mass Mixing Ratio anth + BCCONCanth | kg m-3 | xyz | C | | | | | Black Carbon Mass Concentration anth + BCEXTCOEFanth| m-1 | xyz | C | | | | | Black Carbon Extinction Coefficient [550 nm] anth + BCSCACOEFanth| m-1 | xyz | C | | | | | Black Carbon Scattering Coefficient [550 nm] anth +# -------------|------------|-----|---|----|---|---|-----|----------------------------------------------------- + BCEM001anth | kg m-2 s-1 | xy | | | | | | Black Carbon Emission Bin 001 anth + BCEM002anth | kg m-2 s-1 | xy | | | | | | Black Carbon Emission Bin 002 anth + BCSD001anth | kg m-2 s-1 | xy | | | | | | Black Carbon Sedimentation Bin 001 anth + BCSD002anth | kg m-2 s-1 | xy | | | | | | Black Carbon Sedimentation Bin 002 anth + BCDP001anth | kg m-2 s-1 | xy | | | | | | Black Carbon Dry Deposition Bin 001 anth + BCDP002anth | kg m-2 s-1 | xy | | | | | | Black Carbon Dry Deposition Bin 002 anth + BCWT001anth | kg m-2 s-1 | xy | | | | | | Black Carbon Wet Deposition Bin 001 anth + BCWT002anth | kg m-2 s-1 | xy | | | | | | Black Carbon Wet Deposition Bin 002 anth + BCSV001anth | kg m-2 s-1 | xy | | | | | | Black Carbon Convective Scavenging Bin 001 anth + BCSV002anth | kg m-2 s-1 | xy | | | | | | Black Carbon Convective Scavenging Bin 002 anth + BCHYPHILanth | kg m-2 s-1 | xy | | | | | | Black Carbon Hydrophobic to Hydrophilic anth + BCEMANanth | kg m-2 s-1 | xy | | | | | | Black Carbon Anthropogenic Emissions anth + BCEMBBanth | kg m-2 s-1 | xy | | | | | | Black Carbon Biomass Burning Emissions anth + BCEMBFanth | kg m-2 s-1 | xy | | | | | | Black Carbon Biofuel Emissions anth + BCSMASSanth | kg m-3 | xy | | | | | | Black Carbon Surface Mass Concentration anth + BCCMASSanth | kg m-2 | xy | | | | | | Black Carbon Column Mass Density anth + BCEXTTAUanth | 1 | xy | | | | | | Black Carbon Extinction AOT [550 nm] anth + BCSCATAUanth | 1 | xy | | | | | | Black Carbon Scattering AOT [550 nm] anth + BCANGSTRanth | 1 | xy | | | | | | Black Carbon Angstrom parameter [470-870 nm] anth + BCFLUXUanth | kg m-1 s-1 | xy | | | | | | Black Carbon column u-wind mass flux anth + BCFLUXVanth | kg m-1 s-1 | xy | | | | | | Black Carbon column v-wind mass flux anth +# -------------|------------|-----|---|----|---|---|-----|--------------------------------------------------------- + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C1/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C1/BC_GridComp---full.rc new file mode 100755 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C1/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C1/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C1/BC_GridComp.rc new file mode 100755 index 00000000..0ea10efa --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C1/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full diff --git a/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C1/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C1/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..f24c2198 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C1/BC_GridComp_ExtData.rc @@ -0,0 +1,22 @@ +PrimaryExports%% +# -------------|-----------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-----------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning +BC_BIOMASS kgBC/m2/s N Y %y4-%m2-%d2t12:00:00 none none biomass /discover/nobackup/mmanyin/CCM/EXT_DATA/BC/CCMI/CCMI_REF-C1.bioburn_BC.x720_y361_t12.%y4.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA N N %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 kgBC/m2/s N Y %y4-%m2-%d2t12:00:00 none none antebc1 /discover/nobackup/mmanyin/CCM/EXT_DATA/BC/CCMI/CCMI_REF-C1.nonenergy_anth_BC.x720_y361_t12.%y4.nc +BC_ANTEBC2 kgBC/m2/s N Y %y4-%m2-%d2t12:00:00 none none antebc2 /discover/nobackup/mmanyin/CCM/EXT_DATA/BC/CCMI/CCMI_REF-C1.energy_BC.x720_y361_t12.%y4.nc + +# EDGAR based ship emissions of BC +BC_SHIP NA N N %y4-%m2-%d2t12:00:00 none none bc_ship /dev/null + +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% diff --git a/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C2/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C2/BC_GridComp---full.rc new file mode 100755 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C2/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C2/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C2/BC_GridComp.rc new file mode 100755 index 00000000..0ea10efa --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C2/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full diff --git a/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C2/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C2/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..e808862f --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/CCMI_REF-C2/BC_GridComp_ExtData.rc @@ -0,0 +1,22 @@ +PrimaryExports%% +# -------------|-----------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-----------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning +BC_BIOMASS kgBC/m2/s N Y %y4-%m2-%d2t12:00:00 none none biomass /discover/nobackup/mmanyin/CCM/EXT_DATA/BC/CCMI/CCMI_REF-C2.bioburn_BC.x720_y361_t12.%y4.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA N N %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 kgBC/m2/s N Y %y4-%m2-%d2t12:00:00 none none antebc1 /discover/nobackup/mmanyin/CCM/EXT_DATA/BC/CCMI/CCMI_REF-C2.nonenergy_anth_BC.x720_y361_t12.%y4.nc +BC_ANTEBC2 kgBC/m2/s N Y %y4-%m2-%d2t12:00:00 none none antebc2 /discover/nobackup/mmanyin/CCM/EXT_DATA/BC/CCMI/CCMI_REF-C2.energy_BC.x720_y361_t12.%y4.nc + +# EDGAR based ship emissions of BC +BC_SHIP NA N N %y4-%m2-%d2t12:00:00 none none bc_ship /dev/null + +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% diff --git a/ESMF/GOCART_GridComp/BC_GridComp/CMIP/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/CMIP/BC_GridComp---full.rc new file mode 100755 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/CMIP/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/CMIP/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/CMIP/BC_GridComp.rc new file mode 100755 index 00000000..95e2c09c --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/CMIP/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/BC_GridComp/CMIP/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/CMIP/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..b2ff6cb9 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/CMIP/BC_GridComp_ExtData.rc @@ -0,0 +1,17 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/CMIP/sfc/BC/cmip5.BC_bioburn.x720_y361_t14.%y4.nc + +# Anthropogenic emissions +BC_BIOFUEL NA N Y %y4-%m2-%d2t12:00:00 none none biofuel ExtData/CMIP/sfc/BC/cmip5.bf_BC_src.sfc.x720_y361_t14.%y4.nc +BC_ANTEBC1 NA N Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/CMIP/sfc/BC/cmip5.noship_BC_src.sfc.x720_y361_t14.%y4.nc +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 /dev/null +BC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/CMIP/sfc/BC/cmip5.ship_BC_src.sfc.x720_y361_t14.%y4.nc +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% diff --git a/ESMF/GOCART_GridComp/BC_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/BC_GridComp/CMakeLists.txt new file mode 100644 index 00000000..77dee41e --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-E\;-C\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/19600101-20000331/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/19600101-20000331/BC_GridComp---full.rc new file mode 100644 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/19600101-20000331/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/19600101-20000331/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/19600101-20000331/BC_GridComp.rc new file mode 100644 index 00000000..88a7be64 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/19600101-20000331/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/19600101-20000331/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/19600101-20000331/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..5c533a46 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/19600101-20000331/BC_GridComp_ExtData.rc @@ -0,0 +1,24 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# QFED-v2.x: emission file provides kg BC m-2 s-1 +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_bc.x576_y361_t14.%y4.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA N Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/MERRA2/sfc/AeroCom.noship_BC_src.sfc.x3600_y1800_t44.19780703_12z_20210703_12z.nc4 +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 /dev/null + +# EDGAR based ship emissions +BC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/MERRA2/sfc/edgar-v41.emis_bc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/20000401-present/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/20000401-present/BC_GridComp---full.rc new file mode 100644 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/20000401-present/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/20000401-present/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/20000401-present/BC_GridComp.rc new file mode 100644 index 00000000..88a7be64 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/20000401-present/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/20000401-present/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/20000401-present/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..838bc96f --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/20000401-present/BC_GridComp_ExtData.rc @@ -0,0 +1,24 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# QFED-v2.x: emission file provides kg BC m-2 s-1 +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_bc.005.%y4%m2%d2.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA N Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/MERRA2/sfc/AeroCom.noship_BC_src.sfc.x3600_y1800_t44.19780703_12z_20210703_12z.nc4 +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 /dev/null + +# EDGAR based ship emissions +BC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/MERRA2/sfc/edgar-v41.emis_bc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/BC_GridComp---full.rc new file mode 100644 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/BC_GridComp.rc new file mode 100644 index 00000000..88a7be64 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..838bc96f --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2-DD/BC_GridComp_ExtData.rc @@ -0,0 +1,24 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# QFED-v2.x: emission file provides kg BC m-2 s-1 +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_bc.005.%y4%m2%d2.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA N Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/MERRA2/sfc/AeroCom.noship_BC_src.sfc.x3600_y1800_t44.19780703_12z_20210703_12z.nc4 +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 /dev/null + +# EDGAR based ship emissions +BC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/MERRA2/sfc/edgar-v41.emis_bc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/19600101-20000331/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/19600101-20000331/BC_GridComp---full.rc new file mode 100644 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/19600101-20000331/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/19600101-20000331/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/19600101-20000331/BC_GridComp.rc new file mode 100644 index 00000000..88a7be64 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/19600101-20000331/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/19600101-20000331/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/19600101-20000331/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..030c9c9f --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/19600101-20000331/BC_GridComp_ExtData.rc @@ -0,0 +1,24 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# QFED-v2.x: emission file provides kg BC m-2 s-1 +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_bc.x576_y361_t14.%y4.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA N Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/AeroCom/sfc/AeroCom.noship_BC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 /dev/null + +# EDGAR based ship emissions +BC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/MERRA2/sfc/edgar-v41.emis_bc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/20000401-present/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/20000401-present/BC_GridComp---full.rc new file mode 100644 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/20000401-present/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/20000401-present/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/20000401-present/BC_GridComp.rc new file mode 100644 index 00000000..95e2c09c --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/20000401-present/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/20000401-present/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/20000401-present/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..d8193b2f --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/20000401-present/BC_GridComp_ExtData.rc @@ -0,0 +1,24 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# QFED-v2.x: emission file provides kg BC m-2 s-1 +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_bc.005.%y4%m2%d2.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA N Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/AeroCom/sfc/AeroCom.noship_BC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 /dev/null + +# EDGAR based ship emissions +BC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/MERRA2/sfc/edgar-v41.emis_bc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/BC_GridComp---full.rc new file mode 100644 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/BC_GridComp.rc new file mode 100644 index 00000000..88a7be64 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..d8193b2f --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/MERRA2/BC_GridComp_ExtData.rc @@ -0,0 +1,24 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# QFED-v2.x: emission file provides kg BC m-2 s-1 +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_bc.005.%y4%m2%d2.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA N Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/AeroCom/sfc/AeroCom.noship_BC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 /dev/null + +# EDGAR based ship emissions +BC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/MERRA2/sfc/edgar-v41.emis_bc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/NR/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/NR/BC_GridComp---full.rc new file mode 100644 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/NR/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/NR/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/NR/BC_GridComp.rc new file mode 100644 index 00000000..88a7be64 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/NR/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/BC_GridComp/NR/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/NR/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..23f221df --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/NR/BC_GridComp_ExtData.rc @@ -0,0 +1,24 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# QFED v2.x - emission file provides kg BC m-2 s-1 +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/NR/Y%y4/M%m2/qfed2.emis_bc.005.%y4%m2%d2.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA N Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/NR/sfc/AeroCom_EDGAR.emis_BC.ff_bf_noship.x3600_y1800.t5.20040703_20080703_12z.nc4 +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 /dev/null + +# EDGAR based ship emissions +BC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/NR/sfc/AeroCom_EDGAR.emis_BC.ship.x3600_y1800.t5.20040703_20080703_12z.nc4 + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---anth.rc b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---anth.rc new file mode 100644 index 00000000..9b433606 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---anth.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---bbbo.rc b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---bbbo.rc new file mode 100644 index 00000000..cfd6c09c --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---bbbo.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---biob.rc b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---biob.rc new file mode 100644 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---biob.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---full.rc b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---full.rc new file mode 100644 index 00000000..b09890ca --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp---full.rc @@ -0,0 +1,35 @@ +# +# Resource file for BC parameters. +# + +number_bc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.8 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 # + +# Dry particle density [kg m-3] +particle_density: 1000 1000 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp.rc b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp.rc new file mode 100644 index 00000000..48db7572 --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp_ExtData.rc new file mode 100644 index 00000000..97f0c0bc --- /dev/null +++ b/ESMF/GOCART_GridComp/BC_GridComp/PIESA/BC_GridComp_ExtData.rc @@ -0,0 +1,28 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# QFED v2.x +BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_bc.005.%y4%m2%d2.nc4 + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BC_ANTEBC1 NA N Y %y4-%m2-%d2t12:00:00 none none antebc1 ExtData/PIESA/sfc/AeroCom.noship_BC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +BC_ANTEBC2 NA Y Y %y4-%m2-%d2t12:00:00 none none antebc2 /dev/null + +# EDGAR based ship emissions +BC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none bc_ship ExtData/PIESA/sfc/AeroCom.ship_BC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc + +# Aviation emissions during the LTO, SDC and CRS phases of flight +BC_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +BC_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# Anthropogenic emissions from NEI08 (National Emission Inventory, only US and Canada) +# BC_NEI_BOT NA N Y 0 none none BC /discover/nobackup/projects/gmao/share/dasilva/fvInput/AeroCom/sfc/NEI08.bot.x1152_y721_t8760.2010.nc4 +# BC_NEI_TOP NA N Y 0 none none BC /discover/nobackup/projects/gmao/share/dasilva/fvInput/AeroCom/sfc/NEI08.top.x1152_y721_t8760.2010.nc4 +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridCompMod.F90 b/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridCompMod.F90 new file mode 100644 index 00000000..d8fd1a43 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridCompMod.F90 @@ -0,0 +1,2808 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: BRC_GridCompMod --- BRC Grid Component Class +! +! !INTERFACE: +! + + module BRC_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + + use Chem_Mod ! Chemistry Base Class + use Chem_StateMod ! Chemistry State + use Chem_ConstMod, only: grav, von_karman, cpd, & + undefval => undef ! Constants ! + use Chem_UtilMod ! I/O + use Chem_MieMod ! Aerosol LU Tables, calculator + use m_inpak90 ! Resource file management + use m_die, only: die + use Chem_SettlingMod ! Settling + use DryDepositionMod ! Dry Deposition + use WetRemovalMod ! Large-scale Wet Removal + use ConvectionMod ! Offline convective mixing/scavenging + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC BRC_GridComp ! The BRC object + PUBLIC BRC_GridComp1 ! Single instance BRC object + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC BRC_GridCompSetServices + PUBLIC BRC_GridCompInitialize + PUBLIC BRC_GridCompRun1 + PUBLIC BRC_GridCompRun2 + PUBLIC BRC_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) BRC Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + type BRC_GridComp1 + character(len=255) :: name + character(len=255) :: iname ! instance name + character(len=255) :: rcfilen ! resource file name + character(len=255) :: regionsString ! Comma-delimited string of regions + + integer :: instance ! instance number + + logical :: run_alarm = .false. ! run alarm + + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + real, pointer :: biofuel_src(:,:) + real, pointer :: biomass_src(:,:) + real, pointer :: biomass_src_(:,:) + real, pointer :: ebrcantt1_src(:,:) ! level 1 + real, pointer :: ebrcantt2_src(:,:) ! level 2 + real, pointer :: terpene_src(:,:) ! level 2 + real, pointer :: brc_ship_src(:,:) + real, pointer :: psoa_biob_voc(:,:,:) ! production of SOA from anthropogenic VOC + real, pointer :: aviation_lto_src(:,:) ! aviation - landing and takeoff + real, pointer :: aviation_cds_src(:,:) ! aviation - climbing and descent + real, pointer :: aviation_crs_src(:,:) ! aviation - cruise + real :: aviation_layers(4) ! heights of the LTO, CDS and CRS layers + + real :: ratPOM ! Ratio of POM to BRC mass + real :: fHydrophobic ! Fraction of emissions hydrophobic + real :: fTerpene ! Fraction of terpene emissions -> aerosol + integer :: myDOW = -1 ! my Day of the week: Sun=1, Mon=2,...,Sat=7 + logical :: doing_nei=.FALSE. ! NEI08: National Emission Inventory (US+Canada) + real :: nei_lon(2), nei_lat(2) ! NEI bounding box; superseeds ebrcantt1/2 inside +! Workspace for any requested point emissions +! ------------------------------------------- + logical :: doing_point_emissions=.FALSE. ! Providing pointwise emissions + character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions + integer :: nPts = -1 + integer, pointer, dimension(:) :: vstart => null(), vend => null() + real, pointer, dimension(:) :: vLat => null(), & + vLon => null(), & + vBase => null(), & + vTop => null(), & + vEmis => null() + end type BRC_GridComp1 + + type BRC_GridComp + integer :: n = 0 ! number of instances + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + type(BRC_GridComp1), pointer :: gcs(:) => null() ! instances + end type BRC_GridComp + + character(len=*), parameter :: rc_basename = 'BRC_GridComp' + + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + real, parameter :: radToDeg = 57.2957795 + +CONTAINS + + subroutine BRC_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: n,i + + type(ESMF_Config) :: cfg + + Iam = "BRC_GridCompSetServices" + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(rc=status) + VERIFY_(STATUS) + call ESMF_ConfigLoadFile(cfg,trim(rc_basename)//'.rc',rc=status) + VERIFY_(STATUS) + +! Parse resource file +! ------------------- + n = ESMF_ConfigGetLen(cfg,label='BRC_instances:',rc=status) + VERIFY_(STATUS) + + +! We have 2 tracers for each instance of BRC +! We cannot have fewer instances than half the number of +! BRC bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( n .LT. chemReg%n_BRC/2 ) then + rc = 35 + return + else if ( n .GT. chemReg%n_BRC/2 ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(Iam)// & + ': fewer BRC bins than possible BRC instances: ',& + n, chemReg%n_BRC/2 + end if + n = min(n,chemReg%n_BRC/2 ) + +! Record name of each instance +! ---------------------------- + call ESMF_ConfigFindLabel(cfg,'BRC_instances:',rc=status) + VERIFY_(STATUS) + do i = 1, n + call ESMF_ConfigGetAttribute(cfg,name,rc=status) + VERIFY_(STATUS) + ! resource file name + IF(TRIM(name) == "full" ) THEN + name = " " ! blank instance name for full (1) + ELSE + name = TRIM(name) ! instance name for others + END IF + call BRC_GridCompSetServices1_(gc,chemReg,name,rc=status) + VERIFY_(STATUS) + end do + + RETURN_(ESMF_SUCCESS) + end subroutine BRC_GridCompSetServices + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_GridCompInitialize --- Initialize BRC_GridComp +! +! !INTERFACE: +! + + subroutine BRC_GridCompInitialize ( gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(BRC_GridComp), intent(inout) :: gcBRC ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the BRC Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'BRC_GridCompInitialize' + CHARACTER(LEN=255) :: name + + integer :: i, ier, n + +! Load resource file +! ------------------ + call i90_loadf ( trim(rc_basename)//'.rc', ier ) + if ( ier .NE. 0 ) then + rc = 10 + return + end if + +! Parse resource file +! ------------------- + CALL I90_label ( 'BRC_instances:', ier ) + if ( ier .NE. 0 ) then + rc = 20 + return + end if + +! First determine how many instances we have +! ------------------------------------------ + n = 0 + do while ( ier .EQ. 0 ) + CALL I90_gtoken( name, ier ) + if(ier .eq. 0) n = n + 1 + end do + if ( n .EQ. 0 ) then + rc = 30 + return + end if + +! We have 2 tracers for each instance of BRC +! We cannot have fewer instances than half the number of +! BRC bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( n .LT. w_c%reg%n_BRC/2 ) then + rc = 35 + return + else if ( n .GT. w_c%reg%n_BRC/2 ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(myname)// & + ': fewer BRC bin sets than possible BRC instances'//& + ' (2 bins per instance): ',& + n, w_c%reg%n_BRC + end if + n = min(n,w_c%reg%n_BRC/2 ) + gcBRC%n = n + +! Next allocate necessary memory +! ------------------------------ + allocate ( gcBRC%gcs(n), stat=ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + +! Record name of each instance +! ---------------------------- + CALL I90_label ( 'BRC_instances:', ier ) + do i = 1, n + CALL I90_gtoken( name, ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + ! resource file name + gcBRC%gcs(i)%rcfilen = trim(rc_basename)//'---'//trim(name)//'.rc' + gcBRC%gcs(i)%instance = i ! instance number + IF(TRIM(name) == "full" ) THEN + gcBRC%gcs(i)%iname = " " ! blank instance name for full (1) + ELSE + gcBRC%gcs(i)%iname = TRIM(name) ! instance name for others + END IF + end do + +! Next initialize each instance +! ----------------------------- + do i = 1, gcBRC%n + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,myname,": Initializing instance ",TRIM(gcBRC%gcs(i)%iname)," [",gcBRC%gcs(i)%instance,"]" + END IF + call BRC_SingleInstance_ ( BRC_GridCompInitialize1_, i, & + gcBRC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = 1000+ier + return + end if + gcBRC%gcs(i)%mie_tables => gcBRC%mie_tables + end do + +! All done +! -------- + CALL I90_FullRelease( ier ) + IF( ier /= 0 ) THEN + PRINT *,myname,": I90_FullRelease not successful." + rc = 40 + END IF + + + end subroutine BRC_GridCompInitialize + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_GridCompRun1 --- Run BRC_GridComp +! +! !INTERFACE: +! + + subroutine BRC_GridCompRun1 ( gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(BRC_GridComp), INTENT(INOUT) :: gcBRC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcBRC%n + call BRC_SingleInstance_ ( BRC_GridCompRun1_, i, & + gcBRC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine BRC_GridCompRun1 + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_GridCompRun2 --- Run BRC_GridComp +! +! !INTERFACE: +! + + subroutine BRC_GridCompRun2 ( gcBRC, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + LOGICAL, INTENT(IN) :: run_alarm ! run alarm + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(BRC_GridComp), INTENT(INOUT) :: gcBRC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcBRC%n + gcBRC%gcs(i)%run_alarm = run_alarm + + call BRC_SingleInstance_ ( BRC_GridCompRun2_, i, & + gcBRC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine BRC_GridCompRun2 + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_GridCompFinalize --- Initialize BRC_GridComp +! +! !INTERFACE: +! + + subroutine BRC_GridCompFinalize ( gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(BRC_GridComp), INTENT(INOUT) :: gcBRC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the BRC Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer i, ier + + do i = 1, gcBRC%n + call BRC_SingleInstance_ ( BRC_GridCompFinalize1_, i, & + gcBRC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + if (associated(gcBRC%gcs)) deallocate ( gcBRC%gcs, stat=ier ) + gcBRC%n = -1 + + end subroutine BRC_GridCompFinalize + + + subroutine BRC_GridCompSetServices1_( gc, chemReg, iname, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + character(len=*), intent(IN ) :: iname + integer, intent(OUT ) :: rc + + ! local + logical:: doing_nei + + integer :: Status + character(len=ESMF_MAXSTR) :: Iam + + Iam ="BRC_GridCompSetServices1_" + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_BIOMASS'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_TERPENE'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_BIOFUEL'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_ANTEBRC1'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_ANTEBRC2'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_SHIP'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_AVIATION_LTO'//trim(iname), & + LONG_NAME = 'brc_aviation_lto' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_AVIATION_CDS'//trim(iname), & + LONG_NAME = 'brc_aviation_cds' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_AVIATION_CRS'//trim(iname), & + LONG_NAME = 'brc_aviation_crs' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'pSOA_BIOB_VOC'//trim(iname), & + LONG_NAME = 'SOA from Anthropogenic and biomass burning VOC' , & + UNITS = 'kg m-3 s-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + +! Parse the resource file to see if NEI imports are required +! ---------------------------------------------------------- + call doing_nei_(trim(rc_basename), trim(iname), doing_nei, __RC__) + + NEI_EMISSIONS: if (doing_nei) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_NEI_BOT'//trim(iname), & + LONG_NAME = 'brc_nei_bot' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'BRC_NEI_TOP'//trim(iname), & + LONG_NAME = 'brc_nei_top' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + end if NEI_EMISSIONS + + + RETURN_(ESMF_SUCCESS) + + contains + subroutine doing_nei_(rcbasen, iname, result, rc) + + character(len=*), intent(in) :: rcbasen + character(len=*), intent(in) :: iname + logical, intent(out) :: result + integer, intent(out) :: rc + + ! local + type(ESMF_Config) :: cfg + character(len=255) :: name + logical :: isPresent + integer :: status + character(len=255) :: Iam + + Iam = 'BRC_GridCOmpSetServices1_::doing_nei_' + + if (iname == '') then + name = 'full' + else + name = trim(iname) + end if + + name = trim(rcbasen)//'---'//trim(name)//'.rc' + + cfg = ESMF_ConfigCreate(__RC__) + call ESMF_ConfigLoadFile(cfg, trim(name), __RC__) + call ESMF_ConfigFindLabel(cfg, 'nei_boundingbox:', isPresent=isPresent, __RC__) + + if (isPresent) then + result = .true. + else + result = .false. + end if + + RETURN_(ESMF_SUCCESS) + end subroutine doing_nei_ + + end subroutine BRC_GridCompSetServices1_ + +!-------------------------------------------------------------------------- + +! Single Instance Methods + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_GridCompInitialize --- Initialize BRC_GridComp +! +! !INTERFACE: +! + + subroutine BRC_GridCompInitialize1_ ( gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(BRC_GridComp1), intent(inout) :: gcBRC ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the BRC Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'BRC_GridCompInitialize1' + + + character(len=255) :: rcfilen + integer :: n + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, nbins_rc, km + integer, allocatable :: ier(:) + real :: qmax, qmin + LOGICAL :: NoRegionalConstraint + + rcfilen = gcBRC%rcfilen + gcBRC%name = 'BRC Constituent Package' + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + km = w_c%grid%km + nbins = w_c%reg%n_BRC + n1 = w_c%reg%i_BRC + n2 = w_c%reg%j_BRC + + call init_() + if ( rc /= 0 ) return + + +! ------------------- +! Parse resource file +! ------------------- + +! Load resource file +! ------------------ + call i90_loadf ( rcfilen, ier(1) ) + if ( ier(1) .ne. 0 ) then + call final_(10) + return + end if + + call i90_label ( 'number_brc_classes:', ier(1) ) + nbins_rc = i90_gint ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(20) + return + end if + if ( nbins_rc /= nbins ) then + call final_(25) + return + end if + +! Aircraft emissions +! ------------------ + ier(:) = 0 + call i90_label ( 'aviation_vertical_layers:', ier(1) ) + gcBRC%aviation_layers(1) = i90_gfloat(ier(2)) + gcBRC%aviation_layers(2) = i90_gfloat(ier(3)) + gcBRC%aviation_layers(3) = i90_gfloat(ier(4)) + gcBRC%aviation_layers(4) = i90_gfloat(ier(5)) + + if ( any(ier(1:5) /= 0) ) then + call final_(77) + return + end if + +! Handle Point-wise Emission Sources Specified in a Text File +! ----------------------------------------------------------- + ier(:) = 0 + call i90_label ( 'point_emissions_srcfilen:', ier(1) ) + call i90_gtoken ( gcBRC%point_emissions_srcfilen, ier(2) ) + if ( ier(1) /= 0 ) then + gcBRC%doing_point_emissions = .FALSE. ! if rc is missing, don't fuss + else if ( any(ier(2:2) /= 0) ) then + call final_(42) ! this means point emissions info is messed up, abort + return + else + if ( (index(gcBRC%point_emissions_srcfilen,'/dev/null')>0) ) then + gcBRC%doing_point_emissions = .FALSE. ! disable it if no file specified + else + gcBRC%doing_point_emissions = .TRUE. ! we are good to go + end if + end if + +! Handle NEI08 Emissions +! ---------------------- + ier(:) = 0 + call i90_label ( 'nei_boundingbox:', ier(1) ) + gcBRC%nei_lon(1) = i90_gfloat(ier(2)) + gcBRC%nei_lon(2) = i90_gfloat(ier(3)) + gcBRC%nei_lat(1) = i90_gfloat(ier(4)) + gcBRC%nei_lat(2) = i90_gfloat(ier(5)) + if ( ier(1) /= 0 ) then + gcBRC%doing_nei = .FALSE. ! if rc is missing, don't fuss + else if ( any(ier(2:5) /= 0) ) then + call final_(42) ! this means NEI info is messed up, abort + return + else +! -------------------------------------------------------------------------- +! if ( (index(gcBRC%nei_srcfilen(1),'/dev/null')>0) .or. & +! (index(gcBRC%nei_srcfilen(2),'/dev/null')>0) ) then +! gcBRC%doing_nei = .FALSE. ! disable it if no file specified +! else +! gcBRC%doing_nei = .TRUE. ! we are good to go +! end if +! -------------------------------------------------------------------------- +! TODO: Need to parse the ExtData file to replicate the above logic, +! until then do not include the NOI datasets in the ExtData primary +! export tables +! -------------------------------------------------------------------------- + + gcBRC%doing_nei = .TRUE. ! we are good to go + end if + + if ( MAPL_AM_I_ROOT() ) then + if ( gcBRC%doing_nei ) then + print *, 'BRC_GridComp: using NEI08 Emissions over North America' + else + print *, 'BRC_GridComp: skipping NEI08 Emissions over North America' + end if + end if + +! ------- + +! Day of the week to reset tracer to zero +! --------------------------------------- + call i90_label ( 'my_day_of_the_week:',ier(1)) + if ( ier(1) /= 0 ) then + gcBRC%myDOW = -1 ! by default never reset tracer to zero + else + gcBRC%myDOW = i90_gint (ier(1)) + if ( ier(1) /= 0 ) then + call final_(60) + return + end if + end if + +! ------- + + +! Ratio of POM to BRC mass +! ----------------------- + call i90_label ( 'pom_brc_ratio:', ier(1) ) + gcBRC%ratPOM = i90_gfloat ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + + +! Hydrophilic fraction +! --------------- + call i90_label ( 'hydrophobic_fraction:', ier(1) ) + gcBRC%fHydrophobic = i90_gfloat ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + + +! Terpene Emission Factor +! --------------- + call i90_label ( 'terpene_emission_fraction:', ier(1) ) + gcBRC%fTerpene = i90_gfloat ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + + +! ------- + + +! Scavenging Efficiency +! To be used in convtran.F90, this parameter +! is the scavenging efficiency of the tracer [km -1] +! --------------- + call i90_label ( 'fscav:', ier(1) ) + do n = 1, nbins + w_c%reg%fscav(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Particle density +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_density:', ier(1) ) + do n = 1, nbins + w_c%reg%rhop(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Number median radius +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_radius_number:', ier(1) ) + do n = 1, nbins + w_c%reg%rmed(n1+n-1) = i90_gfloat ( ier(n+1) ) * 1e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Sigma (lognormal mode width) +! To be used in droplet activation code +! --------------- + call i90_label ( 'sigma:', ier(1) ) + do n = 1, nbins + w_c%reg%sigma(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Number to mass conversion factor +! To be used in droplet activation code +! --------------- + call i90_label ( 'fnum:', ier(1) ) + do n = 1, nbins + w_c%reg%fnum(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Molecular weight +! To be used in droplet activation code +! --------------- + call i90_label ( 'molecular_weight:', ier(1) ) + do n = 1, nbins + w_c%reg%molwght(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! ------- + +! Grab the region string. +! ----------------------- + ier(:)=0 + call i90_label ( 'BRC_regions_indices:', ier(1) ) + CALL I90_gtoken( gcBRC%regionsString, ier(2) ) + IF( ANY(ier(1:2) < 0 ) ) THEN + CALL final_(51) + RETURN + END IF + +! Is this instantiation a global case? +! ----------------------------------- + IF(gcBRC%regionsString(1:2) == "-1") THEN + NoRegionalConstraint = .TRUE. + ELSE + SELECT CASE (ESMF_UtilStringLowerCase(gcBRC%regionsString(1:2))) + CASE ("gl") + NoRegionalConstraint = .TRUE. + CASE ("al") + NoRegionalConstraint = .TRUE. + CASE DEFAULT + NoRegionalConstraint = .FALSE. + END SELECT + END IF + +! Set regionsString to "-1" for the global case +! --------------------------------------------- + IF(NoRegionalConstraint) gcBRC%regionsString = "-1" + + IF(MAPL_AM_I_ROOT()) THEN + IF(NoRegionalConstraint) THEN + PRINT *,myname,": This instantiation has no regional constraints." + ELSE + PRINT *,myname,": This instantiation is regionally constrained." + PRINT *,myname,": List of region numbers included: ",TRIM(gcBRC%regionsString) + END IF + END IF + +! All done +! -------- + call i90_release() + deallocate(ier) + + return + + +CONTAINS + + subroutine init_() + integer ios, nerr + nerr = max ( 32, nbins+1 ) + allocate ( gcBRC%biomass_src(i1:i2,j1:j2), gcBRC%biofuel_src(i1:i2,j1:j2), & + gcBRC%biomass_src_(i1:i2,j1:j2), & + gcBRC%ebrcantt1_src(i1:i2,j1:j2), gcBRC%ebrcantt2_src(i1:i2,j1:j2), & + gcBRC%terpene_src(i1:i2,j1:j2), gcBRC%brc_ship_src(i1:i2,j1:j2), & + gcBRC%psoa_biob_voc(i1:i2,j1:j2,km), & + gcBRC%aviation_lto_src(i1:i2,j1:j2), & + gcBRC%aviation_cds_src(i1:i2,j1:j2), & + gcBRC%aviation_crs_src(i1:i2,j1:j2), ier(nerr), stat=ios ) + if ( ios /= 0 ) rc = 100 + end subroutine init_ + + subroutine final_(ierr) + integer :: ierr + integer ios + deallocate ( gcBRC%biomass_src, gcBRC%biofuel_src, & + gcBRC%biomass_src_, & + gcBRC%ebrcantt1_src, gcBRC%ebrcantt2_src, & + gcBRC%terpene_src, gcBRC%brc_ship_src, & + gcBRC%psoa_biob_voc, & + gcBRC%aviation_lto_src, & + gcBRC%aviation_cds_src, & + gcBRC%aviation_crs_src, ier, stat=ios ) + call i90_release() + rc = ierr + end subroutine final_ + + end subroutine BRC_GridCompInitialize1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_GridCompRun1_ --- The Chem Driver, run phase 1 +! +! !INTERFACE: +! + + subroutine BRC_GridCompRun1_ ( gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(BRC_GridComp1), intent(inout) :: gcBRC ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called BRC Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'BRC_GridCompRun1_' + character(len=*), parameter :: Iam = myname + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n + integer :: i, j, ijl, ijkl, ijk1l + real :: qmax, qmin + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: pblh + real, pointer, dimension(:,:,:) :: tmpu, rhoa, ple + +! Workspace for NEI emissions +! --------------------------- + real, pointer, dimension(:,:) :: nei_src1, nei_src2 + + integer :: idow + character(len=3) :: cdow + + real, pointer :: var2d(:,:) => null() + + +#define EXPORT expChem +#define iNAME TRIM(gcBRC%iname) + +#define ptrBRCEM BRC_emis + +#define ptrBRCEMAN BRC_emisAN +#define ptrBRCEMBB BRC_emisBB +#define ptrBRCEMBF BRC_emisBF +#define ptrBRCEMBG BRC_emisBG + + integer :: STATUS + +#include "BRC_GetPointer___.h" + + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_BRC + n1 = w_c%reg%i_BRC + n2 = w_c%reg%j_BRC + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + +! Reset tracer to zero at 0Z on specific day of week +! -------------------------------------------------- + idow = Chem_UtilIdow(nymd) + if ( (nhms==0) .and. (idow == gcBRC%myDOW) ) then + cdow = Chem_UtilCdow(nymd) + do n = n1, n2 + w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) = tiny(1.) ! avoid division by zero + end do + if ( MAPL_AM_I_ROOT() ) then + print *, '<> BRC '//cdow//' tracer being set to zero on ', nymd, nhms + end if + end if + +! Update emissions/production if necessary (daily) +! ------------------------------------------ + +! Biomass Burning -- select on known inventories +! ---------------------------------------------- + + call MAPL_GetPointer(impChem, var2d, 'BRC_BIOMASS'//iNAME, __RC__) + gcBRC%biomass_src = var2d + + +! Terpene, biofuel and anthropogenic emissions (inventories) +! ---------------------------------------------------------- + call MAPL_GetPointer(impChem, var2d, 'BRC_TERPENE'//iNAME, __RC__) + gcBRC%terpene_src = var2d + + call MAPL_GetPointer(impChem, var2d, 'BRC_BIOFUEL'//iNAME, __RC__) + gcBRC%biofuel_src = var2d + + call MAPL_GetPointer(impChem, var2d, 'BRC_ANTEBRC1'//iNAME, __RC__) + gcBRC%ebrcantt1_src = var2d + + call MAPL_GetPointer(impChem, var2d, 'BRC_ANTEBRC2'//iNAME, __RC__) + gcBRC%ebrcantt2_src = var2d + +! Ship based BRC emissions + call MAPL_GetPointer(impChem, var2d, 'BRC_SHIP'//iNAME, __RC__) + gcBRC%brc_ship_src = var2d + +! Aircraft emissions during the three phases of flight + call MAPL_GetPointer(impChem, var2d, 'BRC_AVIATION_LTO'//iNAME, __RC__) + gcBRC%aviation_lto_src = var2d + + call MAPL_GetPointer(impChem, var2d, 'BRC_AVIATION_CDS'//iNAME, __RC__) + gcBRC%aviation_cds_src = var2d + + call MAPL_GetPointer(impChem, var2d, 'BRC_AVIATION_CRS'//iNAME, __RC__) + gcBRC%aviation_crs_src = var2d + + +! As a safety check, where value is undefined set to 0 + do j = j1, j2 + do i = i1, i2 + if(1.01*gcBRC%biomass_src(i,j) .gt. undefval) gcBRC%biomass_src(i,j) = 0. + if(1.01*gcBRC%terpene_src(i,j) .gt. undefval) gcBRC%terpene_src(i,j) = 0. + if(1.01*gcBRC%biofuel_src(i,j) .gt. undefval) gcBRC%biofuel_src(i,j) = 0. + if(1.01*gcBRC%ebrcantt1_src(i,j) .gt. undefval) gcBRC%ebrcantt1_src(i,j) = 0. + if(1.01*gcBRC%ebrcantt2_src(i,j) .gt. undefval) gcBRC%ebrcantt2_src(i,j) = 0. + if(1.01*gcBRC%brc_ship_src(i,j) .gt. undefval) gcBRC%brc_ship_src(i,j) = 0. + if(1.01*gcBRC%aviation_lto_src(i,j) .gt. undefval) gcBRC%aviation_lto_src(i,j) = 0. + if(1.01*gcBRC%aviation_cds_src(i,j) .gt. undefval) gcBRC%aviation_cds_src(i,j) = 0. + if(1.01*gcBRC%aviation_crs_src(i,j) .gt. undefval) gcBRC%aviation_crs_src(i,j) = 0. + enddo + enddo + + +#ifdef DEBUG + call pmaxmin('BRC: biomass', gcBRC%biomass_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: biofuel', gcBRC%biofuel_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: ebrcantt1', gcBRC%ebrcantt1_src, qmin, qmax, ijl,1,1.) + call pmaxmin('BRC: ebrcantt2', gcBRC%ebrcantt2_src, qmin, qmax, ijl,1,1.) + call pmaxmin('BRC: terpene', gcBRC%terpene_src, qmin, qmax, ijl,1, 1.) + call pmaxmin('BRC: brc_ship', gcBRC%brc_ship_src, qmin, qmax, ijl,1, 1.) + call pmaxmin('BRC: avi_lto', gcBRC%aviation_lto_src, qmin, qmax, ijl,1,1.) + call pmaxmin('BRC: avi_cds', gcBRC%aviation_cds_src, qmin, qmax, ijl,1,1.) + call pmaxmin('BRC: avi_crs', gcBRC%aviation_crs_src, qmin, qmax, ijl,1,1.) +#endif + +! Save this in case we need to apply diurnal cycle +! ------------------------------------------------ + if ( w_c%diurnal_bb ) then + gcBRC%biomass_src_(:,:) = gcBRC%biomass_src(:,:) + end if + +! Apply diurnal cycle if so desired +! --------------------------------- + if ( w_c%diurnal_bb ) then + call Chem_BiomassDiurnal ( gcBRC%biomass_src, gcBRC%biomass_src_, & + w_c%grid%lon(:,:)*radToDeg, & + w_c%grid%lat(:,:)*radToDeg, nhms, cdt ) + end if + +! Read any pointwise emissions, if requested +! ------------------------------------------ + if(gcBRC%doing_point_emissions) then + call Chem_UtilPointEmissions( nymd, gcBRC%point_emissions_srcfilen, & + gcBRC%nPts, gcBRC%vLat, gcBRC%vLon, & + gcBRC%vBase, gcBRC%vTop, gcBRC%vEmis, & + gcBRC%vStart, gcBRC%vEnd ) + +! In case vStart or vEnd were not specified in the file set to defaults + where(gcBRC%vStart < 0) gcBRC%vStart = 000000 + where(gcBRC%vEnd < 0) gcBRC%vEnd = 240000 + endif + + +! Apply NEI emissions over North America if so desired +! ---------------------------------------------------- + if (gcBRC%doing_NEI) then + + allocate(nei_src1(i1:i2,j1:j2), nei_src2(i1:i2,j1:j2), __STAT__) + + call MAPL_GetPointer(impChem,var2d,'BRC_NEI_BOT'//iNAME, __RC__) + nei_src1 = var2d + + call MAPL_GetPointer(impChem,var2d,'BRC_NEI_TOP'//iNAME, __RC__) + nei_src2 = var2d + + where ( (w_c%grid%lon >= gcBRC%nei_lon(1)) .and. & + (w_c%grid%lon <= gcBRC%nei_lon(2)) .and. & + (w_c%grid%lat >= gcBRC%nei_lat(1)) .and. & + (w_c%grid%lat <= gcBRC%nei_lat(2)) ) + + gcBRC%ebrcantt1_src = nei_src1 + gcBRC%ebrcantt2_src = nei_src2 + end where + +#ifdef DEBUG + call pmaxmin('BRC: nei_bot', nei_src1, qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: nei_top', nei_src2, qmin, qmax, ijl,1, 1. ) +#endif + + deallocate(nei_src1, nei_src2) + + end if ! doing NEI + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('BRC: q_beg', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, ple, 'PLE', __RC__ ) + + + +#ifdef DEBUG + + call pmaxmin('BRC: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + + call pmaxmin('BRC: tmpu ', tmpu , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: hghte ', hghte , qmin, qmax, ijkl,1, 1. ) + +#endif + +! BRC Source +! ----------- + call BRC_Emission ( i1, i2, j1, j2, km, nbins, cdt, gcBRC, w_c, & + pblh, tmpu, rhoa, BRC_emis, & + BRC_emisAN, BRC_emisBB, BRC_emisBF, BRC_emisBG, rc ) +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('BRC: q_emi', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + return + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_Emission - Adds Organic Carbon emission for one timestep +! We have emissions from 6 sources, which are distributed +! differently in the vertical +! 1) biomass burning - uniformly mixed in PBL +! 2) biofuel sources - emitted into lowest 100 m +! 3) anthropogenic l1 - emitted into lowest 100 m +! 4) anthropogenic l2 - emitted into 100 - 500 m levels +! 5) terpene - emitted to surface (hydrophilic only) +! 6) point sources - emitted in altitudes specified in input +! +! !INTERFACE: +! + + subroutine BRC_Emission ( i1, i2, j1, j2, km, nbins, cdt, gcBRC, w_c, & + pblh, tmpu, rhoa, BRC_emis, & + BRC_emisAN, BRC_emisBB, BRC_emisBF, BRC_emisBG, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km, nbins + real, intent(in) :: cdt + type(BRC_GridComp1), intent(in) :: gcBRC ! BRC Grid Component + real, pointer, dimension(:,:) :: pblh + real, pointer, dimension(:,:,:) :: tmpu + real, pointer, dimension(:,:,:) :: rhoa + +! !OUTPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + type(Chem_Array), intent(inout) :: BRC_emis(nbins) ! BRC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: BRC_emisAN ! BRC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: BRC_emisBB ! BRC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: BRC_emisBF ! BRC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: BRC_emisBG ! BRC emissions, kg/m2/s + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'BRC_Emission' + +! !DESCRIPTION: Updates the BRC concentration with emissions every timestep +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k, m, n, ios, ijl, ii + integer :: n1, n2 +! pressure at 100m, 500m, & PBLH + real, dimension(i1:i2,j1:j2) :: p100, p500, pPBL + real, dimension(i1:i2,j1:j2) :: p0, z0, ps + real :: p1, z1, dz, delz, delp, f100, f500, fPBL, fBot + real :: qmax, qmin, eBiofuel, eBiomass, eTerpene, eAnthro + + real, dimension(i1:i2,j1:j2) :: factor, srcHydrophobic, srcHydrophilic + real, dimension(i1:i2,j1:j2) :: srcBiofuel, srcBiomass, srcAnthro, srcBiogenic + real :: srcTmp, zpbl, maxAll + + real, dimension(i1:i2,j1:j2,km) :: emis_aviation + real, dimension(i1:i2,j1:j2,km) :: srcAviation + real :: z_lto_bot, z_lto_top + real :: z_cds_bot, z_cds_top + real :: z_crs_bot, z_crs_top + + real, dimension(i1:i2,j1:j2) :: f_bb_ ! scaling factor for BB emissions based on maximum allowed exttau + real, dimension(i1:i2,j1:j2) :: exttau_bb_ ! increment of exttau due to BB during the current time step + real, allocatable, dimension(:,:,:,:) :: qa_bb_ ! increment of qa due to BB during the current time step (nbins,i1:i2,j1:j2:km) + real :: cutoff_bb_exttau + integer :: nch, idx + real :: ilam550 + real :: tau, ssa + character(len=255) :: qname + real, parameter :: max_bb_exttau = 30.0 + +! Indices for point emissions + integer, pointer, dimension(:) :: iPoint, jPoint + real, dimension(km) :: point_column_emissions + +! Source function terms for SOA from Anthropogenic VOCs + real :: srcSOAanthro = 0.0 + +! Initialize local variables +! -------------------------- + n1 = w_c%reg%i_BRC + n2 = w_c%reg%j_BRC + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + +! Emission factors scaling from source files to desired mass quantity + eBiomass = gcBRC%ratPOM + eBiofuel = gcBRC%ratPOM + eTerpene = gcBRC%ratPOM * gcBRC%fTerpene + eAnthro = gcBRC%ratPOM + +! Zero diagnostic accumulators + do n = 1, nbins + if( associated(BRC_emis(n)%data2d) ) BRC_emis(n)%data2d = 0.0 + end do + if(associated(BRC_emisAN%data2d) ) BRC_emisAN%data2d = 0.0 + if(associated(BRC_emisBF%data2d) ) BRC_emisBF%data2d = 0.0 + if(associated(BRC_emisBB%data2d) ) BRC_emisBB%data2d = 0.0 + if(associated(BRC_emisBG%data2d) ) BRC_emisBG%data2d = 0.0 + +! Distribute aircraft emissions from LTO, CDS and CRS layers +! ---------------------------------------------------------- + z_lto_bot = max(1e-3, gcBRC%aviation_layers(1)) + z_lto_top = max(2e-3, gcBRC%aviation_layers(2)) + + z_cds_bot = max(2e-3, gcBRC%aviation_layers(2)) + z_cds_top = max(3e-3, gcBRC%aviation_layers(3)) + + z_crs_bot = max(3e-3, gcBRC%aviation_layers(3)) + z_crs_top = max(4e-3, gcBRC%aviation_layers(4)) + + emis_aviation = 0.0 + srcAviation = 0.0 + + call distribute_aviation_emissions(w_c%delp, rhoa, z_lto_bot, z_lto_top, gcBRC%aviation_lto_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(w_c%delp, rhoa, z_cds_bot, z_cds_top, gcBRC%aviation_cds_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(w_c%delp, rhoa, z_crs_bot, z_crs_top, gcBRC%aviation_crs_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + +! Determine surface pressure +! AMS Note: pass this in +! -------------------------- + ps = 0.0 + do k = 1, km + ps(i1:i2,j1:j2) = ps(i1:i2,j1:j2) + w_c%delp(i1:i2,j1:j2,k) + end do + +! Find the pressure of the 100m, 500m, and PBLH altitudes +! AMS Note: this could be greatly simplified by using ze/zm and having a +! generic routine from the bottom up with an early exit condition +! ----------------------------------------------------------------------- + p0 = ps + z0(i1:i2,j1:j2) = 0. + do k = km, 1, -1 + do j = j1, j2 + do i = i1, i2 + p1 = p0(i,j) - w_c%delp(i,j,k) + dz = w_c%delp(i,j,k)/rhoa(i,j,k)/grav + z1 = z0(i,j)+dz + if(z0(i,j) .lt. 100 .and. z1 .ge. 100.) then + delz = z1-100. + delp = delz*rhoa(i,j,k)*grav + p100(i,j) = p1+delp + endif + if(z0(i,j) .lt. 500 .and. z1 .ge. 500.) then + delz = z1-500. + delp = delz*rhoa(i,j,k)*grav + p500(i,j) = p1+delp + endif + zpbl = max ( pblh(i,j), 100. ) + if(z0(i,j) .lt. zpbl .and. z1 .ge. zpbl ) then + delz = z1-zpbl + delp = delz*rhoa(i,j,k)*grav + pPBL(i,j) = p1+delp + endif + p0(i,j) = p1 + z0(i,j) = z1 + end do + end do + end do + +#if 0 + call pmaxmin ( 'BRC: p100 ', p100, qmin, qmax, ijl, 1, 1. ) + call pmaxmin ( 'BRC: p500 ', p500, qmin, qmax, ijl, 1, 1. ) + call pmaxmin ( 'BRC: pPBL ', pPBLh, qmin, qmax, ijl, 1, 1. ) +#endif + + +! Limit biomass burning emissions +! ------------------------------- + allocate(qa_bb_(nbins,i1:i2,j1:j2,km), __STAT__) + qa_bb_ = 0.0 + + p0 = ps +K_LOOP_BB: do k = km, 1, -1 + +! First determine emissions for this layer +! ---------------------------------------- + maxAll = 0.0 + do j = j1, j2 + do i = i1, i2 + + p1 = p0(i,j) - w_c%delp(i,j,k) + +! Pressure @ PBL height +! --------------------- + fPBL = 0. + if(p1 .ge. pPBL(i,j)) fPBL = w_c%delp(i,j,k)/(ps(i,j)-pPBL(i,j)) + if(p1 .lt. pPBL(i,j) .and. p0(i,j) .ge. pPBL(i,j)) fPBL = (p0(i,j)-pPBL(i,j))/(ps(i,j)-pPBL(i,j)) + +! Sources by class in kg m-2 s-1 +! ------------------------------ + srcBiomass(i,j) = fPBL * eBiomass * gcBRC%biomass_src(i,j) + + srcHydrophobic(i,j) = gcBRC%fHydrophobic * srcBiomass(i,j) + srcHydrophilic(i,j) = (1.-gcBRC%fHydrophobic) * srcBiomass(i,j) + +! Update pressure of lower level +! ------------------------------ + p0(i,j) = p1 + + end do ! i + end do ! j + +! Determine global max/min +! ------------------------ + call pmaxmin ( 'BRC: Phobic ', srcHydrophobic, qmin, qmax, ijl, 1, 0. ) + maxAll = abs(qmax) + abs(qmin) + call pmaxmin ( 'BRC: Philic ', srcHydrophilic, qmin, qmax, ijl, 1, 0. ) + maxAll = max ( maxAll, abs(qmax) + abs(qmin) ) + +! If emissions are zero at this level (globally), we are done +! ----------------------------------------------------------- + if ( maxAll .eq. 0.0 ) exit K_LOOP_BB + +! Update concentrations at this layer +! The "1" element is hydrophobic +! The "2" element is hydrophilic +! ----------------------------------- + factor = cdt * grav / w_c%delp(:,:,k) + + qa_bb_(1,:,:,k) = factor * srcHydrophobic + qa_bb_(2,:,:,k) = factor * srcHydrophilic + + end do K_LOOP_BB + + + nch = gcBRC%mie_tables%nch + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + if(nch .gt. 1) then + do i = 1, nch + if ( gcBRC%mie_tables%channels(i) .ge. 5.49e-7 .and. & + gcBRC%mie_tables%channels(i) .le. 5.51e-7) ilam550 = i + enddo + endif + +! Calculate the extinction and/or scattering AOD + + exttau_bb_(i1:i2,j1:j2) = 0.0 + + do n = 1, nbins + +! Select the name for species and the index + qname = trim(w_c%reg%vname(n1+n-1)) + idx = Chem_MieQueryIdx(gcBRC%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(gcBRC%mie_tables, idx, ilam550, & + qa_bb_(n,i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau, ssa=ssa) + +! Integrate in the vertical + exttau_bb_(i,j) = exttau_bb_(i,j) + tau + + enddo + enddo + enddo + + enddo ! nbins + + + f_bb_ = 1.0 + cutoff_bb_exttau = (cdt / (24 * 3600.0)) * max_bb_exttau + + do j = j1, j2 + do i = i1, i2 + if (exttau_bb_(i,j) > cutoff_bb_exttau) then + f_bb_(i,j) = cutoff_bb_exttau / exttau_bb_(i,j) + end if + enddo + enddo + + deallocate(qa_bb_, __STAT__) + + +! Now update the tracer mixing ratios with the aerosol sources +! ------------------------------------------------------------ + p0 = ps +K_LOOP: do k = km, 1, -1 + +!!! print *, 'BRC_Emissions: getting emissions for layer ', k + +! First determine emissions for this layer +! ---------------------------------------- + maxAll = 0.0 + do j = j1, j2 + do i = i1, i2 + + p1 = p0(i,j) - w_c%delp(i,j,k) + +! Pressure @ 100m +! --------------- + f100 = 0. + if(p1 .ge. p100(i,j)) f100 = w_c%delp(i,j,k)/(ps(i,j)-p100(i,j)) + if(p1 .lt. p100(i,j) .and. p0(i,j) .ge. p100(i,j)) & + f100 = (p0(i,j)-p100(i,j))/(ps(i,j)-p100(i,j)) + +! Pressure @ 500m +! --------------- + f500 = 0. + if ( p0(i,j) .ge. p100(i,j) .and. p1 .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = (p100(i,j)-p1)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = w_c%delp(i,j,k)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .ge. p500(i,j) .and. p1 .lt. p500(i,j)) & + f500 = (p0(i,j)-p500(i,j))/(p100(i,j)-p500(i,j)) + +! Pressure @ PBL height +! --------------------- + fPBL = 0. + if(p1 .ge. pPBL(i,j)) fPBL = w_c%delp(i,j,k)/(ps(i,j)-pPBL(i,j)) + if(p1 .lt. pPBL(i,j) .and. p0(i,j) .ge. pPBL(i,j)) & + fPBL = (p0(i,j)-pPBL(i,j))/(ps(i,j)-pPBL(i,j)) + +! Terpene is tree-top emission; only add in bottom layer +! ------------------------------------------------------ + if ( k .eq. km ) then + fBot = 1.0 + else + fBot = 0.0 + end if + +! Sources by class in kg m-2 s-1 +! ------------------------------ + srcBiofuel(i,j) = f100 * eBiofuel * gcBRC%biofuel_src(i,j) + srcAnthro(i,j) = f100 * eAnthro * gcBRC%ebrcantt1_src(i,j) & + + f500 * eAnthro * gcBRC%ebrcantt2_src(i,j) & + + f100 * eAnthro * gcBRC%brc_ship_src(i,j) & + + eAnthro * srcAviation(i,j,k) + srcBiomass(i,j) = fPBL * eBiomass * gcBRC%biomass_src(i,j) * f_bb_(i,j) + srcBiogenic(i,j) = fBot * eTerpene * gcBRC%terpene_src(i,j) + + srcTmp = srcBiofuel(i,j) + srcAnthro(i,j) + srcBiomass(i,j) + + srcHydrophobic(i,j) = gcBRC%fHydrophobic * srcTmp + srcHydrophilic(i,j) = (1.-gcBRC%fHydrophobic) * srcTmp + srcBiogenic(i,j) + +! Update pressure of lower level +! ------------------------------ + p0(i,j) = p1 + + end do ! i + end do ! j + +! Determine global max/min +! ------------------------ + call pmaxmin ( 'BRC: Phobic ', srcHydrophobic, qmin, qmax, ijl, 1, 0. ) + maxAll = abs(qmax) + abs(qmin) + call pmaxmin ( 'BRC: Philic ', srcHydrophilic, qmin, qmax, ijl, 1, 0. ) + maxAll = max ( maxAll, abs(qmax) + abs(qmin) ) + +! If emissions are zero at this level (globally), we are done +! ----------------------------------------------------------- + if ( maxAll .eq. 0.0 ) exit K_LOOP + +! Update concentrations at this layer +! The "1" element is hydrophobic +! The "2" element is hydrophilic +! ----------------------------------- + factor = cdt * grav / w_c%delp(:,:,k) + + w_c%qa(n1)%data3d(:,:,k) = w_c%qa(n1)%data3d(:,:,k) & + + factor * srcHydrophobic + + w_c%qa(n2)%data3d(:,:,k) = w_c%qa(n2)%data3d(:,:,k) & + + factor * srcHydrophilic + +! Fill in diagnostics if requested +! -------------------------------- + if ( associated(BRC_emis(1)%data2d)) & + BRC_emis(1)%data2d = BRC_emis(1)%data2d + srcHydrophobic + + if ( associated(BRC_emis(2)%data2d)) & + BRC_emis(2)%data2d = BRC_emis(2)%data2d + srcHydrophilic + + if ( associated(BRC_emisBF%data2d)) & + BRC_emisBF%data2d = BRC_emisBF%data2d + srcBiofuel + + if ( associated(BRC_emisBB%data2d)) & + BRC_emisBB%data2d = BRC_emisBB%data2d + srcBiomass + + if ( associated(BRC_emisAN%data2d)) & + BRC_emisAN%data2d = BRC_emisAN%data2d + srcAnthro + + if ( associated(BRC_emisBG%data2d)) & + BRC_emisBG%data2d = BRC_emisBG%data2d + srcBiogenic + + end do K_LOOP + +! Distribute pointwise sources if requested +! ----------------------------------------- + if( gcBRC%doing_point_emissions .and. gcBRC%nPts > 0) then + +! Get indices for point emissions +! ------------------------------- + allocate(iPoint(gcBRC%nPts), jPoint(gcBRC%nPts), stat=ios) + + call MAPL_GetHorzIJIndex(gcBRC%nPts, iPoint, jPoint, & + grid = w_c%grid_esmf, & + lon = gcBRC%vLon/radToDeg, & + lat = gcBRC%vLat/radToDeg, & + rc = rc) + + if ( rc /= 0 ) call die(myname,'cannot get indices for point emissions') + + do ii = 1, gcBRC%nPts + i = iPoint(ii) + j = jPoint(ii) + if( i<1 .OR. j<1 ) cycle ! point emission not in this sub-domain +! if( gcBRC%regionMask(i,j) == 0 ) cycle ! masked by region mask + +! Emissions not occurring in current time step +! -------------------------------------------- + if(nhms < gcBRC%vStart(ii) .or. nhms >= gcBRC%vEnd(ii)) cycle + + call distribute_point_emissions(w_c%delp(i,j,:), rhoa(i,j,:), & + gcBRC%vBase(ii), gcBRC%vTop(ii), gcBRC%vEmis(ii), & + point_column_emissions, km) + w_c%qa(n1)%data3d(i,j,:) = w_c%qa(n1)%data3d(i,j,:) & + + gcBRC%fHydrophobic * cdt * grav / w_c%delp(i,j,:) & + * point_column_emissions / w_c%grid%cell_area(i,j) + w_c%qa(n2)%data3d(i,j,:) = w_c%qa(n2)%data3d(i,j,:) & + + (1-gcBRC%fHydrophobic) * cdt * grav / w_c%delp(i,j,:) & + * point_column_emissions / w_c%grid%cell_area(i,j) + + enddo + deallocate(iPoint, jPoint, stat=ios) + endif + + + rc = 0 + + end subroutine BRC_Emission + + subroutine distribute_aviation_emissions(delp, rhoa, z_bot, z_top, emissions_layer, emissions, i1, i2, j1, j2, km) + + implicit none + + integer, intent(in) :: i1, i2, j1, j2, km + + real, dimension(:,:,:), intent(in) :: delp + real, dimension(:,:,:), intent(in) :: rhoa + real, dimension(:,:), intent(in) :: emissions_layer + real, intent(in) :: z_bot + real, intent(in) :: z_top + real, dimension(:,:,:), intent(out):: emissions + +! local + integer :: i, j, k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ + + do j = j1, j2 + do i = i1, i2 + ! find level height + z = 0.0 + z_= 0.0 + + do k = km, 1, -1 + dz(k) = delp(i,j,k)/rhoa(i,j,k)/grav + z_ = z_ + dz(k) + z(k) = z_ + end do + + ! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + + ! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + + ! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot .eq. k_top) then + w_(k_bot) = z_top - z_bot + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + + ! distribute emissions in the vertical + emissions(i,j,:) = (w_ / sum(w_)) * emissions_layer(i,j) + end do + end do + + end subroutine distribute_aviation_emissions + + +! Abstracted from distribute_aviation_emissions above, but called per column + subroutine distribute_point_emissions(delp, rhoa, z_bot, z_top, emissions_point, & + emissions, km) + + implicit none + + integer, intent(in) :: km + + real, dimension(:), intent(in) :: delp + real, dimension(:), intent(in) :: rhoa + real, intent(in) :: emissions_point + real, intent(in) :: z_bot + real, intent(in) :: z_top + real, dimension(:), intent(out):: emissions + +! local + integer :: k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ + +! find level height + z = 0.0 + z_= 0.0 + + do k = km, 1, -1 + dz(k) = delp(k)/rhoa(k)/grav + z_ = z_ + dz(k) + z(k) = z_ + end do + +! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + +! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + +! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot .eq. k_top) then + w_(k_bot) = z_top - z_bot + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + +! distribute emissions in the vertical + emissions(:) = (w_ / sum(w_)) * emissions_point + + end subroutine distribute_point_emissions + + + end subroutine BRC_GridCompRun1_ + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_GridCompRun2_ --- The Chem Driver, run phase 2 +! +! !INTERFACE: +! + + subroutine BRC_GridCompRun2_ ( gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(BRC_GridComp1), intent(inout) :: gcBRC ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called BRC Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'BRC_GridCompRun2_' + character(len=*), parameter :: Iam = myname + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n, ios + integer :: i, j, k, ijl, ijkl, ijk1l + real :: qmax, qmin + real :: qUpdate, delq + real, pointer :: dqa(:,:), drydepositionfrequency(:,:) + type(Chem_Array), pointer :: fluxout + logical :: KIN + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: frlake, frocean, frseaice, & + oro, u10m, v10m, & + ustar, precc, precl, & + pblh, shflux, z0h, hsurf + real, pointer, dimension(:,:,:) :: tmpu, rhoa, u, v, hghte, ple + real, pointer, dimension(:,:,:) :: pfllsan, pfilsan + + +! Additional needs for GOCART convective diagnostic + real, pointer, dimension(:,:,:) :: cmfmc, qlcn, qicn, dtrain + real, pointer, dimension(:,:) :: area + real*8, allocatable, dimension(:,:,:) :: cmfmc_, qccu_, dtrain_, & + airmass_, airmol_, vud_, & + delz_, delp_, tmpu_, ple_ + real*8, allocatable :: tc_(:,:,:,:), bcnv_(:,:,:) + real*8, allocatable :: area_(:,:), frlake_(:,:), & + frocean_(:,:), frseaice_(:,:) + integer*4 :: icdt + + real, pointer :: BRC_radius(:), BRC_rhop(:) + integer :: rhFlag + + real, pointer :: var3d(:,:,:) => null() + + +#define EXPORT expChem +#define iNAME TRIM(gcBRC%iname) + +#define ptrBRCWT BRC_wet +#define ptrBRCSV BRC_conv +#define ptrBRCEM BRC_emis +#define ptrBRCDP BRC_dep +#define ptrBRCSD BRC_set + +#define ptrBRCMASS BRC_mass +#define ptrBRCEMAN BRC_emisAN +#define ptrBRCEMBB BRC_emisBB +#define ptrBRCEMBF BRC_emisBF +#define ptrBRCEMBG BRC_emisBG +#define ptrBRCPSOA BRC_pSOA +#define ptrBRCHYPHIL BRC_toHydrophilic +#define ptrBRCSMASS BRC_sfcmass +#define ptrBRCCMASS BRC_colmass +#define ptrBRCEXTTAU BRC_exttau +#define ptrBRCSCATAU BRC_scatau +#define ptrBRCCONC BRC_conc +#define ptrBRCEXTCOEF BRC_extcoef +#define ptrBRCSCACOEF BRC_scacoef +#define ptrBRCANGSTR BRC_angstrom +#define ptrBRCFLUXU BRC_fluxu +#define ptrBRCFLUXV BRC_fluxv + + integer :: STATUS + +#include "BRC_GetPointer___.h" + + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_BRC + n1 = w_c%reg%i_BRC + n2 = w_c%reg%j_BRC + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('BRC: q_beg', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, frlake, 'FRLAKE', __RC__ ) + call MAPL_GetPointer ( impChem, oro, 'LWI', __RC__ ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', __RC__ ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', __RC__ ) + call MAPL_GetPointer ( impChem, ustar, 'USTAR', __RC__ ) + call MAPL_GetPointer ( impChem, precc, 'CN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, precl, 'NCN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + call MAPL_GetPointer ( impChem, shflux, 'SH', __RC__ ) + call MAPL_GetPointer ( impChem, z0h, 'Z0H', __RC__ ) + call MAPL_GetPointer ( impChem, area, 'AREA', __RC__ ) + call MAPL_GetPointer ( impChem, frocean, 'FROCEAN', __RC__ ) + call MAPL_GetPointer ( impChem, frseaice, 'FRACI', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, u, 'U', __RC__ ) + call MAPL_GetPointer ( impChem, v, 'V', __RC__ ) + call MAPL_GetPointer ( impChem, hghte, 'ZLE', __RC__ ) + call MAPL_GetPointer ( impChem, ple, 'PLE', __RC__ ) + call MAPL_GetPointer ( impChem, qlcn, 'QLCN', __RC__ ) + call MAPL_GetPointer ( impChem, qicn, 'QICN', __RC__ ) + call MAPL_GetPointer ( impChem, cmfmc, 'CNV_MFC', __RC__ ) + call MAPL_GetPointer ( impChem, dtrain, 'CNV_MFD', __RC__ ) + call MAPL_GetPointer ( impChem, pfllsan, 'PFL_LSAN', __RC__ ) + call MAPL_GetPointer ( impChem, pfilsan, 'PFI_LSAN', __RC__ ) + +! Unlike GEOS-4 hghte is defined for km+1 +! --------------------------------------- + hsurf => hghte(i1:i2,j1:j2,km) ! Recall: GEOS-5 has edges with k in [0,km] + + + +#ifdef DEBUG + + call pmaxmin('BRC: frlake ', frlake , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: frocean ', frocean , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: frseaice ', frseaice, qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: area ', area , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: oro ', oro , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: u10m ', u10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: v10m ', v10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: ustar ', ustar , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: precc ', precc , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: precl ', precl , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: shflux ', shflux , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: z0h ', z0h , qmin, qmax, ijl,1, 1. ) + call pmaxmin('BRC: hsurf ', hsurf , qmin, qmax, ijl,1, 1. ) + + call pmaxmin('BRC: tmpu ', tmpu , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: u ', u , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: v ', v , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: hghte ', hghte , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: qlcn ', qlcn , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: qicn ', qicn , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: cmfmc ', cmfmc , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: dtrain ', dtrain , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('BRC: pfllsan ', pfllsan , qmin, qmax, ijk1l,1, 1. ) + call pmaxmin('BRC: pfilsan ', pfilsan , qmin, qmax, ijk1l,1, 1. ) + +#endif + +RUN_ALARM: if (gcBRC%run_alarm) then + + allocate( fluxout ) + allocate( fluxout%data2d(i1:i2,j1:j2), dqa(i1:i2,j1:j2), & + drydepositionfrequency(i1:i2,j1:j2), stat=STATUS) + VERIFY_(STATUS) + + +! SOA production from oxidation of anthropogenic VOC + call MAPL_GetPointer(impChem, var3d, 'pSOA_BIOB_VOC'//iNAME, __RC__) + gcBRC%psoa_biob_voc = var3d + + where( 1.01 * gcBRC%psoa_biob_voc .gt. undefval) gcBRC%psoa_biob_voc = 0.0 + + +! Add on SOA from Anthropogenic VOC oxidation +! ------------------------------------------- + w_c%qa(n2)%data3d = w_c%qa(n2)%data3d + cdt*gcBRC%psoa_biob_voc/rhoa ! hydrophilic + + if ( associated(BRC_pSOA%data2d)) & + BRC_pSOA%data2d = sum(cdt*gcBRC%psoa_biob_voc*w_c%delp/rhoa/grav, 3) + + +! Ad Hoc transfer of hydrophobic to hydrophilic aerosols +! Following Chin's parameterization, the rate constant is +! k = 4.63e-6 s-1 (.4 day-1; e-folding time = 2.5 days) + if(associated(BRC_toHydrophilic%data2d)) & + BRC_toHydrophilic%data2d(i1:i2,j1:j2) = 0.0 + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + qUpdate = w_c%qa(n1)%data3d(i,j,k)*exp(-4.63e-6*cdt) + qUpdate = max(qUpdate,1.e-32) + delq = max(0.,w_c%qa(n1)%data3d(i,j,k)-qUpdate) + w_c%qa(n1)%data3d(i,j,k) = qUpdate + w_c%qa(n2)%data3d(i,j,k) = w_c%qa(n2)%data3d(i,j,k)+delq + if(associated(BRC_toHydrophilic%data2d)) & + BRC_toHydrophilic%data2d(i,j) = BRC_toHydrophilic%data2d(i,j) & + + delq*w_c%delp(i,j,k)/grav/cdt + end do + end do + end do + +! BRC Settling +! ----------- + allocate( BRC_radius(nbins), BRC_rhop(nbins) ) + BRC_radius(:) = 0.35e-6 ! radius for settling [m] + BRC_rhop(:) = 1800. ! density for setting [kg m-3] + rhFlag = 0 ! settle like dry particles + call Chem_Settling ( i1, i2, j1, j2, km, n1, n2, nbins, rhFlag, & + BRC_radius, BRC_rhop, cdt, w_c, tmpu, rhoa, hsurf, & + hghte, BRC_set, rc ) + deallocate( BRC_radius, BRC_rhop) + +! BRC Deposition +! ----------- + drydepositionfrequency = 0. + call DryDepositionGOCART( i1, i2, j1, j2, km, & + tmpu, rhoa, hghte, oro, ustar, & + pblh, shflux, z0h, drydepositionfrequency, rc ) + + do n = 1, nbins + dqa = 0. + dqa = max(0.0, w_c%qa(n1+n-1)%data3d(:,:,km)*(1.-exp(-drydepositionfrequency*cdt))) + w_c%qa(n1+n-1)%data3d(:,:,km) = & + w_c%qa(n1+n-1)%data3d(:,:,km) - dqa + if( associated(BRC_dep(n)%data2d) ) & + BRC_dep(n)%data2d = dqa*w_c%delp(:,:,km)/grav/cdt + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('BRC: q_dry', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Organic Carbon Large-scale Wet Removal +! -------------------------------------- +! Hydrophobic mode (first tracer) is not removed + if(associated(BRC_wet(1)%data2d)) BRC_wet(1)%data2d = 0. +! Hydrophilic mode (second tracer) is removed + KIN = .TRUE. + do n = nbins, nbins + w_c%qa(n1+n-1)%fwet = 1. + call WetRemovalGOCART(i1, i2, j1, j2, km, n1+n-1, n1+n-1, cdt, 'OC', KIN, & + w_c%qa, ple, tmpu, rhoa, pfllsan, pfilsan, & + precc, precl, fluxout, rc ) + if(associated(BRC_wet(n)%data2d)) BRC_wet(n)%data2d = fluxout%data2d + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('BRC: q_wet', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! Organic Carbon Convective-scale Mixing and Wet Removal +! ------------------------------------------------------ + KIN = .TRUE. + icdt = cdt + allocate(cmfmc_(i1:i2,j1:j2,km+1), qccu_(i1:i2,j1:j2,km), & + dtrain_(i1:i2,j1:j2,km), airmass_(i1:i2,j1:j2,km), & + delz_(i1:i2,j1:j2,km), vud_(i1:i2,j1:j2,km), & + tc_(i1:i2,j1:j2,km,n1:n2), delp_(i1:i2,j1:j2,km), & + airmol_(i1:i2,j1:j2,km), tmpu_(i1:i2,j1:j2,km), & + bcnv_(i1:i2,j1:j2,n1:n2), ple_(i1:i2,j1:j2,km+1), & + area_(i1:i2,j1:j2), frlake_(i1:i2,j1:j2), & + frocean_(i1:i2,j1:j2), frseaice_(i1:i2,j1:j2), __STAT__ ) + + bcnv_ = 0.0 + area_ = area + frlake_ = frlake + frocean_ = frocean + frseaice_ = frseaice + do k = 1, km+1 + cmfmc_(:,:,k) = cmfmc(:,:,km-k+1) + ple_(:,:,k) = ple(:,:,km-k+1) + end do + do k = 1, km + dtrain_(:,:,k) = dtrain(:,:,km-k+1) + qccu_(:,:,k) = qlcn(:,:,km-k+1) + qicn(:,:,km-k+1) + delp_(:,:,k) = w_c%delp(:,:,km-k+1)/100. + airmass_(:,:,k) = w_c%delp(:,:,km-k+1)/grav*area_ + airmol_(:,:,k) = airmass_(:,:,k)*1000./28.966 + delz_(:,:,k) = w_c%delp(:,:,km-k+1)/grav/rhoa(:,:,km-k+1) + tmpu_(:,:,k) = tmpu(:,:,km-k+1) + enddo + do n = n1, n2 + do k = 1, km + tc_(:,:,k,n) = w_c%qa(n)%data3d(:,:,km-k+1) + enddo + enddo + call set_vud(i1, i2, j1, j2, km, frlake_, frocean_, frseaice_, cmfmc_, qccu_, & + airmass_, delz_, area_, vud_) + call convection(i1, i2, j1, j2, km, n1, n2, icdt, 'OC', kin, & + tc_, cmfmc_, dtrain_, area_, delz_, delp_, vud_, & + airmass_, airmol_, tmpu_, ple_, & + bcnv_) + +! Return adjusted tracer to mixing ratio + do n = n1, n2 + do k = 1, km + w_c%qa(n)%data3d(:,:,km-k+1) = tc_(:,:,k,n) + enddo + enddo + +! Note GOCART returns bcnv_ as negative, recast for my diagnostic + if(associated(BRC_conv(1)%data2d)) BRC_conv(1)%data2d = 0.0 + if(associated(BRC_conv(2)%data2d)) BRC_conv(2)%data2d = -bcnv_(:,:,n2)/area_/icdt + +! Clean up +! -------- + deallocate(cmfmc_, qccu_, dtrain_, tc_, airmass_, & + delz_, vud_, delp_, airmol_, tmpu_, bcnv_, ple_, & + area_, frlake_, frocean_, frseaice_, __STAT__ ) + + deallocate(fluxout%data2d) + deallocate(fluxout, dqa, drydepositionfrequency, stat=ios ) + + end if RUN_ALARM + + +! Compute the desired output diagnostics here +! Ideally this will go where chemout is called in fvgcm.F since that +! will reflect the distributions after transport, etc. +! ----------- + call BRC_Compute_Diags(i1, i2, j1, j2, km, nbins, gcBRC, w_c, tmpu, rhoa, u, v, & + BRC_sfcmass, BRC_colmass, BRC_mass, BRC_exttau, & + BRC_scatau, BRC_conc, BRC_extcoef, BRC_scacoef, BRC_angstrom, & + BRC_fluxu, BRC_fluxv, rc) + + return + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_Compute_Diags - Calculate dust 2D diagnostics +! +! !INTERFACE: +! + + subroutine BRC_Compute_Diags ( i1, i2, j1, j2, km, nbins, gcBRC, w_c, tmpu, rhoa, u, v, & + sfcmass, colmass, mass, exttau, scatau, & + conc, extcoef, scacoef, angstrom, fluxu, fluxv, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2, km, nbins + type(BRC_GridComp1), intent(inout):: gcBRC ! BRC Grid Component + type(Chem_Bundle), intent(in) :: w_c ! Chem Bundle + real, pointer, dimension(:,:,:) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:,:) :: u ! east-west wind [m s-1] + real, pointer, dimension(:,:,:) :: v ! north-south wind [m s-1] + +! !OUTPUT PARAMETERS: + type(Chem_Array), intent(inout) :: sfcmass ! sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: colmass ! col mass density kg/m2 + type(Chem_Array), intent(inout) :: mass ! 3d mass mixing ratio kg/kg + type(Chem_Array), intent(inout) :: exttau ! ext. AOT at 550 nm + type(Chem_Array), intent(inout) :: scatau ! sct. AOT at 550 nm + type(Chem_Array), intent(inout) :: conc ! 3d mass concentration, kg/m3 + type(Chem_Array), intent(inout) :: extcoef ! 3d ext. coefficient, 1/m + type(Chem_Array), intent(inout) :: scacoef ! 3d scat.coefficient, 1/m + type(Chem_Array), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter + type(Chem_Array), intent(inout) :: fluxu ! Column mass flux in x direction + type(Chem_Array), intent(inout) :: fluxv ! Column mass flux in y direction + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Calculates some simple 2d diagnostics from the BRC fields +! Surface concentration (dry) +! Column mass load (dry) +! Extinction aot 550 (wet) +! Scattering aot 550 (wet) +! For the moment, this is hardwired. +! +! !REVISION HISTORY: +! +! 16APR2004, Colarco +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + character(len=*), parameter :: myname = 'BRC_Compute_Diags' + integer :: i, j, k, n, n1, n2, ios, nch, idx + real :: tau, ssa + character(len=255) :: qname + real, dimension(i1:i2,j1:j2) :: tau470, tau870 + real :: ilam550, ilam470, ilam870 + logical :: do_angstrom + + +! Initialize local variables +! -------------------------- + n1 = w_c%reg%i_BRC + n2 = w_c%reg%j_BRC + nch = gcBRC%mie_tables%nch + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + ilam470 = 0. + ilam870 = 0. + if(nch .gt. 1) then + do i = 1, nch + if ( gcBRC%mie_tables%channels(i) .ge. 5.49e-7 .and. & + gcBRC%mie_tables%channels(i) .le. 5.51e-7) ilam550 = i + if ( gcBRC%mie_tables%channels(i) .ge. 4.69e-7 .and. & + gcBRC%mie_tables%channels(i) .le. 4.71e-7) ilam470 = i + if ( gcBRC%mie_tables%channels(i) .ge. 8.69e-7 .and. & + gcBRC%mie_tables%channels(i) .le. 8.71e-7) ilam870 = i + enddo + endif + +! Determine if going to do Angstrom parameter calculation +! ------------------------------------------------------- + do_angstrom = .false. +! If both 470 and 870 channels provided (and not the same) then +! possibly will do Angstrom parameter calculation + if(ilam470 .ne. 0. .and. & + ilam870 .ne. 0. .and. & + ilam470 .ne. ilam870) do_angstrom = .true. + + +! Calculate the diagnostic variables if requested +! ----------------------------------------------- + +! Calculate the surface mass concentration + if( associated(sfcmass%data2d) ) then + sfcmass%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + sfcmass%data2d(i1:i2,j1:j2) & + = sfcmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + end do + endif + +! Calculate the dust column loading + if( associated(colmass%data2d) ) then + colmass%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + colmass%data2d(i1:i2,j1:j2) & + = colmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + end do + end do + endif + +! Calculate the total mass concentration + if( associated(conc%data3d) ) then + conc%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + conc%data3d(i1:i2,j1:j2,1:km) & + = conc%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km)*rhoa(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the total mass mixing ratio + if( associated(mass%data3d) ) then + mass%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + mass%data3d(i1:i2,j1:j2,1:km) & + = mass%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the column mass flux in x direction + if( associated(fluxu%data2d) ) then + fluxu%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + fluxu%data2d(i1:i2,j1:j2) & + = fluxu%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*u(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the column mass flux in y direction + if( associated(fluxv%data2d) ) then + fluxv%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + fluxv%data2d(i1:i2,j1:j2) & + = fluxv%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*v(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the extinction and/or scattering AOD + if( associated(exttau%data2d) .or. associated(scatau%data2d) ) then + + if( associated(exttau%data2d) ) then + exttau%data2d(i1:i2,j1:j2) = 0. + endif + if( associated(scatau%data2d) ) then + scatau%data2d(i1:i2,j1:j2) = 0. + endif + + if( associated(extcoef%data3d)) then + extcoef%data3d(i1:i2,j1:j2,1:km) = 0. + endif + if( associated(scacoef%data3d)) then + scacoef%data3d(i1:i2,j1:j2,1:km) = 0. + endif + + do n = 1, nbins + +! Select the name for species and the index + qname = trim(w_c%reg%vname(n1+n-1)) + idx = Chem_MieQueryIdx(gcBRC%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(gcBRC%mie_tables, idx, ilam550, & + w_c%qa(n1+n-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau, ssa=ssa) + +! Calculate the total ext. and scat. coefficients + if( associated(extcoef%data3d) ) then + extcoef%data3d(i,j,k) = extcoef%data3d(i,j,k) + & + tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + if( associated(scacoef%data3d) ) then + scacoef%data3d(i,j,k) = scacoef%data3d(i,j,k) + & + ssa * tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + +! Integrate in the vertical + if( associated(exttau%data2d) ) then + exttau%data2d(i,j) = exttau%data2d(i,j) + tau + endif + if( associated(scatau%data2d) ) then + scatau%data2d(i,j) = scatau%data2d(i,j) + tau*ssa + endif + + enddo + enddo + enddo + + enddo ! nbins + + endif + +! Calculate the 470-870 Angstrom parameter + if( associated(angstrom%data2d) .and. do_angstrom ) then + + angstrom%data2d(i1:i2,j1:j2) = 0. +! Set tau to small number by default + tau470(i1:i2,j1:j2) = tiny(1.0) + tau870(i1:i2,j1:j2) = tiny(1.0) + + do n = 1, nbins + +! Select the name for species + qname = trim(w_c%reg%vname(n+n1-1)) + idx = Chem_MieQueryIdx(gcBRC%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + + call Chem_MieQuery(gcBRC%mie_tables, idx, ilam470, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau470(i,j) = tau470(i,j) + tau + + call Chem_MieQuery(gcBRC%mie_tables, idx, ilam870, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau870(i,j) = tau870(i,j) + tau + + enddo + enddo + enddo + + enddo ! nbins + angstrom%data2d(i1:i2,j1:j2) = & + -log(tau470(i1:i2,j1:j2)/tau870(i1:i2,j1:j2)) / & + log(470./870.) + endif + + + rc = 0 + + end subroutine BRC_Compute_Diags + + end subroutine BRC_GridCompRun2_ + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + subroutine BRC_GridCompFinalize1_ ( gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(BRC_GridComp1), intent(inout) :: gcBRC ! Grid Component + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Import State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + integer :: ios + character(len=*), parameter :: myname = 'BRC_GridCompFinalize' + +! If initialized pointwise emissions from daily tables, clean-up + if(associated(gcBRC%vLat)) deallocate(gcBRC%vLat, stat=ios) + if(associated(gcBRC%vLon)) deallocate(gcBRC%vLon, stat=ios) + if(associated(gcBRC%vEmis)) deallocate(gcBRC%vEmis, stat=ios) + if(associated(gcBRC%vBase)) deallocate(gcBRC%vBase, stat=ios) + if(associated(gcBRC%vTop)) deallocate(gcBRC%vTop, stat=ios) + if(associated(gcBRC%vStart)) deallocate(gcBRC%vStart, stat=ios) + if(associated(gcBRC%vEnd)) deallocate(gcBRC%vEnd, stat=ios) + + rc=0 + return + + end subroutine BRC_GridCompFinalize1_ + + end module BRC_GridCompMod + + +!----------------------------------------------------------------------- + +! Single Instance Wrapper + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: BRC_SingleInstance_ --- Runs single instance of method +! +! !INTERFACE: +! + subroutine BRC_SingleInstance_ ( Method_, instance, & + gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + Use BRC_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! Input "function pointer" +! ----------------------- + interface + subroutine Method_ (gc, w, imp, exp, ymd, hms, dt, rcode ) + Use BRC_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + type(BRC_GridComp1), intent(inout) :: gc + type(Chem_Bundle), intent(in) :: w + type(ESMF_State), intent(inout) :: imp + type(ESMF_State), intent(inout) :: exp + integer, intent(in) :: ymd, hms + real, intent(in) :: dt + integer, intent(out) :: rcode + end subroutine Method_ + end interface + + integer, intent(in) :: instance ! instance number + + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(BRC_GridComp1), INTENT(INOUT) :: gcBRC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer n_BRC, i_BRC, j_BRC + character(len=255) :: i_qname, j_qname + +! Save overall CO indices +! ----------------------- + n_BRC = w_c%reg%n_BRC + i_BRC = w_c%reg%i_BRC + j_BRC = w_c%reg%j_BRC + +! Save the name of the variables in this instance +! ----------------------------------------------- + i_qname = trim(w_c%reg%vname(i_BRC + 2*(instance - 1))) + j_qname = trim(w_c%reg%vname(i_BRC + 2*(instance - 1) + 1)) + +! Customize indices for this particular instance +! ---------------------------------------------- + w_c%reg%n_BRC = 2 + w_c%reg%i_BRC = i_BRC + 2*(instance - 1) + w_c%reg%j_BRC = i_BRC + 2*(instance - 1) + 1 + w_c%reg%vname(i_BRC + 2*(instance - 1)) = w_c%reg%vname(i_BRC) + w_c%reg%vname(i_BRC + 2*(instance - 1) + 1) = w_c%reg%vname(i_BRC + 1) + +! Execute the instance method +! --------------------------- + call Method_ ( gcBRC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! Restore the overall BRC indices +! ------------------------------ + w_c%reg%vname(i_BRC + 2*(instance - 1)) = i_qname + w_c%reg%vname(i_BRC + 2*(instance - 1) + 1) = j_qname + w_c%reg%n_BRC = n_BRC + w_c%reg%i_BRC = i_BRC + w_c%reg%j_BRC = j_BRC + + end subroutine BRC_SingleInstance_ + +!----------------------------------------------------------------------- diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..172619f5 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_oc.006.%y4%m2%d2.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/BRC_Registry.rc b/ESMF/GOCART_GridComp/BRC_GridComp/BRC_Registry.rc new file mode 100644 index 00000000..4a80659c --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/BRC_Registry.rc @@ -0,0 +1,50 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: BRC + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl|# Sub| Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + BRCMASS | kg kg-1 | xyz | C | | | | | Brown Carbon Particulate Matter Mass Mixing Ratio __ENSEMBLE__ + BRCCONC | kg m-3 | xyz | C | | | | | Brown Carbon Particulate Matter Mass Concentration __ENSEMBLE__ + BRCEXTCOEF| m-1 | xyz | C | | | | | Brown Carbon Particulate Matter Ext. Coefficient [550 nm] __ENSEMBLE__ + BRCSCACOEF| m-1 | xyz | C | | | | | Brown Carbon Particulate Matter Scatt. Coefficient [550 nm] __ENSEMBLE__ +# .........|............|.....|...|....|...|...|.....|.................................. + BRCEM001 | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Emission Bin 001 __ENSEMBLE__ + BRCEM002 | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Emission Bin 002 __ENSEMBLE__ + BRCSD001 | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Sedimentation Bin 001 __ENSEMBLE__ + BRCSD002 | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Sedimentation Bin 002 __ENSEMBLE__ + BRCDP001 | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Dry Deposition Bin 001 __ENSEMBLE__ + BRCDP002 | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Dry Deposition Bin 002 __ENSEMBLE__ + BRCWT001 | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Wet Deposition Bin 001 __ENSEMBLE__ + BRCWT002 | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Wet Deposition Bin 002 __ENSEMBLE__ + BRCSV001 | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Convective Scavenging Bin 001 __ENSEMBLE__ + BRCSV002 | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Convective Scavenging Bin 002 __ENSEMBLE__ + BRCHYPHIL | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Hydrophobic to Hydrophilic __ENSEMBLE__ + BRCEMAN | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Anthropogenic Emissions __ENSEMBLE__ + BRCEMBB | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Biomass Burning Emissions __ENSEMBLE__ + BRCEMBF | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Biofuel Emissions __ENSEMBLE__ + BRCEMBG | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter Biogenic Emissions __ENSEMBLE__ + BRCPSOA | kg m-2 s-1 | xy | | | | | | Brown Carbon Particulate Matter SOA Production __ENSEMBLE__ + BRCSMASS | kg m-3 | xy | | | | | | Brown Carbon Particulate Matter Surface Mass Concentration __ENSEMBLE__ + BRCCMASS | kg m-2 | xy | | | | | | Brown Carbon Particulate Matter Column Mass Density __ENSEMBLE__ + BRCEXTTAU | 1 | xy | | | | | | Brown Carbon Particulate Matter Extinction AOT [550 nm] __ENSEMBLE__ + BRCSCATAU | 1 | xy | | | | | | Brown Carbon Particulate Matter Scattering AOT [550 nm] __ENSEMBLE__ + BRCANGSTR | 1 | xy | | | | | | Brown Carbon Particulate Matter Angstrom parameter [470-870 nm] __ENSEMBLE__ + BRCFLUXU | kg m-1 s-1 | xy | | | | | | Brown Carbon Particulate Matter column u-wind mass flux __ENSEMBLE__ + BRCFLUXV | kg m-1 s-1 | xy | | | | | | Brown Carbon Particulate Matter column v-wind mass flux __ENSEMBLE__ + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C1/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C1/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C1/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C1/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C1/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C1/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C1/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C1/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..f3140caf --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C1/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass /discover/nobackup/mmanyin/CCM/EXT_DATA/OC/CCMI/CCMI_REF-C1.bioburn_OC.x720_y361_t12.%y4.nc + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C2/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C2/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C2/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C2/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C2/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C2/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C2/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C2/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..ef0ece00 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/CCMI_REF-C2/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass /discover/nobackup/mmanyin/CCM/EXT_DATA/OC/CCMI/CCMI_REF-C2.bioburn_OC.x720_y361_t12.%y4.nc + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/CMIP/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/CMIP/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/CMIP/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/CMIP/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/CMIP/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/CMIP/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/CMIP/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/CMIP/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..04a361ee --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/CMIP/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/CMIP/sfc/OC/cmip5.OC_bioburn.x720_y361_t14.%y4.nc + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/BRC_GridComp/CMakeLists.txt new file mode 100644 index 00000000..23831f99 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/CMakeLists.txt @@ -0,0 +1,18 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-E\;-C\;-N\;GOCART") + +#mapl_acg (${this} BRC_Registry.rc +# IMPORT_SPECS EXPORT_SPECS INTERNAL_SPECS +# GET_POINTERS DECLARE_POINTERS) + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/19600101-20000331/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/19600101-20000331/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/19600101-20000331/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/19600101-20000331/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/19600101-20000331/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/19600101-20000331/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/19600101-20000331/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/19600101-20000331/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..d68c774a --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/19600101-20000331/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_oc.x576_y361_t14.%y4.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/20000401-present/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/20000401-present/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/20000401-present/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/20000401-present/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/20000401-present/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/20000401-present/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/20000401-present/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/20000401-present/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..33b3c699 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/20000401-present/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..33b3c699 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2-DD/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/19600101-20000331/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/19600101-20000331/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/19600101-20000331/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/19600101-20000331/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/19600101-20000331/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/19600101-20000331/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/19600101-20000331/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/19600101-20000331/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..d68c774a --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/19600101-20000331/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_oc.x576_y361_t14.%y4.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/20000401-present/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/20000401-present/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/20000401-present/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/20000401-present/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/20000401-present/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/20000401-present/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/20000401-present/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/20000401-present/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..80898317 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/20000401-present/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..80898317 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/MERRA2/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/NR/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/NR/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/NR/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/NR/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/NR/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/NR/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/NR/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/NR/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..37d5f95c --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/NR/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/NR/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/PIESA/BRC_GridComp---full.rc b/ESMF/GOCART_GridComp/BRC_GridComp/PIESA/BRC_GridComp---full.rc new file mode 100755 index 00000000..e3c30109 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/PIESA/BRC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for BRC parameters. +# + +number_brc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +BRC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/BRC -> convert source masses from carbon to POM +pom_brc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/PIESA/BRC_GridComp.rc b/ESMF/GOCART_GridComp/BRC_GridComp/PIESA/BRC_GridComp.rc new file mode 100755 index 00000000..e01348e8 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/PIESA/BRC_GridComp.rc @@ -0,0 +1,19 @@ +# +# BRC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +BRC_instances: full diff --git a/ESMF/GOCART_GridComp/BRC_GridComp/PIESA/BRC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/BRC_GridComp/PIESA/BRC_GridComp_ExtData.rc new file mode 100644 index 00000000..80898317 --- /dev/null +++ b/ESMF/GOCART_GridComp/BRC_GridComp/PIESA/BRC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +BRC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +BRC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene /dev/null + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +BRC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +BRC_ANTEBRC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 /dev/null +BRC_ANTEBRC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +BRC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +BRC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null +BRC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation /dev/null + +# SOA production +pSOA_BIOB_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridComp.rc b/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridComp.rc new file mode 100755 index 00000000..c44d3f18 --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridComp.rc @@ -0,0 +1,9 @@ +# +# Resource file for CFC parameters. +# + +number_CFC_bins: 1 +photolysisFile: ExtData/g5chem/x/SC.J_20_12_79_72_200_38.nc4 +phot_Equation_number: 25 + +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridCompMod.F90 b/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridCompMod.F90 new file mode 100644 index 00000000..0cb45e3d --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridCompMod.F90 @@ -0,0 +1,1001 @@ +#include "MAPL_Generic.h" +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: CFC_GridCompMod --- CFC Grid Component Class +! +! !INTERFACE: +! + + MODULE CFC_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + USE Chem_Mod ! Chemistry Base Class + USE Chem_StateMod ! Chemistry State + USE Chem_ConstMod, ONLY: grav + USE Chem_UtilMod ! I/O + USE m_inpak90 ! Resource file management + + IMPLICIT NONE + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC CFC_GridComp ! The CFC object + + include "netcdf.inc" + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC CFC_GridCompSetServices + PUBLIC CFC_GridCompInitialize + PUBLIC CFC_GridCompRun + PUBLIC CFC_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the CFC Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! 01Aug2006 da Silva Extensions for GEOS-5. +! 12Feb2005 Nielsen 8 regions for INTEX-B 2006 +! 1Jan2008 Nielsen CFC-12 configuration for ARCTAS. +! 8Feb2008 Nielsen Standard configuration call(s) from AeroChem. +! 1Nov2012 Nielsen Accomodate cubed sphere for GEOS-5 Ganymed releases +! 27Jun2014 Nielsen Added CFC-12 photorate to the export state +! +!EOP +!------------------------------------------------------------------------- + + TYPE CFC_GridComp + + CHARACTER(LEN=255) :: name + +! For CFC-12 photolysis +! --------------------- + INTEGER :: nlam + INTEGER :: nsza + INTEGER :: numo3 + INTEGER :: nx + INTEGER :: nxdo + INTEGER :: nts + INTEGER :: photEquNumber + + REAL, POINTER :: sdat(:,:,:,:) + REAL, POINTER :: sza_tab(:) + REAL, POINTER :: o3_tab(:,:) + REAL, POINTER :: xtab(:,:,:) + + REAL, POINTER :: CFCsfcFlux(:,:) ! CFC-12 surface flux kg m^-2 s^-1 + REAL, POINTER :: CFCloss(:,:,:,:) ! CFC loss due to photolysis m^-3 s^-1 + + LOGICAL :: DebugIsOn + + END TYPE CFC_GridComp + +CONTAINS + + subroutine CFC_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: rcbasen = 'CFC_GridComp' + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + Iam = "CFC_GridCompSetServices" + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CFC12', & + LONG_NAME = 'CFC 12 Emissions', & + UNITS = 'kg s-1 m-2', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + RETURN_(ESMF_SUCCESS) + end subroutine CFC_GridCompSetServices + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CFC_GridCompInitialize --- Initialize CFC_GridComp +! +! !INTERFACE: +! + + SUBROUTINE CFC_GridCompInitialize( gcCFC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CFC_GridComp), INTENT(INOUT) :: gcCFC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the CFC Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 31May2005 Nielsen Mods for 7 CO bins, 5 region masks +! 04Nov2005 Bian CO tagged to 4 regions +! (global, North America, South America, and Africa) +! for CR-AVE +! 12Feb2005 Nielsen 8 regions for INTEX-B 2006 +! 1Jan2008 Nielsen CFC-12 configuration for ARCTAS +! 1Nov2012 Nielsen Accomodate cubed sphere for GEOS-5 Ganymed releases +! +!EOP +!------------------------------------------------------------------------- +#include "mpif.h" + + CHARACTER(LEN=*), PARAMETER :: Iam = 'CFC_GridCompInitialize' + TYPE(ESMF_VM) :: vm + + CHARACTER(LEN=255) :: rcfilen = 'CFC_GridComp.rc' + + CHARACTER(LEN=255) :: fnPhoto, fileName + + REAL :: x + REAL, ALLOCATABLE :: w(:) + + INTEGER :: i, i1, i2, im, j, j1, j2, jm, k, km, kr, n, nbins, status + + gcCFC%name = 'CFC-12 Chemistry for ARCTAS' + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + im = w_c%grid%im + + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jm = w_c%grid%jm + + km = w_c%grid%km + + nbins = w_c%reg%n_CFC + +! Grab the virtual machine +! ------------------------ + CALL ESMF_VMGetCurrent(vm, RC=status) + VERIFY_(status) + +! Load resource file +! ------------------ + CALL I90_loadf ( TRIM(rcfilen), status ) + VERIFY_(status) + + CALL I90_label ( 'photolysisFile:', status ) + VERIFY_(status) + CALL I90_Gtoken( fnPhoto, status ) + VERIFY_(status) + + CALL I90_Label ( 'phot_Equation_number:', status ) + VERIFY_(status) + gcCFC%photEquNumber = I90_Gint( status ) + VERIFY_(status) + +! Run-time debug switch +! --------------------- + CALL I90_label ( 'DEBUG:', status ) + VERIFY_(status) + n = I90_gint ( status ) + VERIFY_(status) + IF(n /= 0) THEN + gcCFC%DebugIsOn = .TRUE. + ELSE + gcCFC%DebugIsOn = .FALSE. + END IF + +! Allocate space +! -------------- + ALLOCATE(gcCFC%CFCsfcFlux(i1:i2,j1:j2), STAT=status ) + VERIFY_(status) + ALLOCATE(gcCFC%CFCloss(i1:i2,j1:j2,1:km,nbins), STAT=status ) + VERIFY_(status) + +! Photolysis tables: Initialize from NetCDF file +! ---------------------------------------------- + fileName = TRIM(fnPhoto) + CALL readPhotTables(fileName, status) + VERIFY_(status) + +! Reverse vertical ordering of the radiative +! source function and the overhead O3 reference +! --------------------------------------------- + DO n = 1,gcCFC%nlam + DO j = 1,gcCFC%numo3 + DO i = 1,gcCFC%nsza + DO k = 1,km/2 + kr = km-k+1 + x = gcCFC%sdat(i,j,k,n) + gcCFC%sdat(i,j,k,n) = gcCFC%sdat(i,j,kr,n) + gcCFC%sdat(i,j,kr,n) = x + END DO + END DO + END DO + END DO + + ALLOCATE(w(gcCFC%numo3), STAT=status) + VERIFY_(status) + + DO k = 1,km/2 + kr = km-k+1 + w(1:gcCFC%numo3) = gcCFC%o3_tab(1:gcCFC%numo3,k) + gcCFC%o3_tab(1:gcCFC%numo3,k) = gcCFC%o3_tab(1:gcCFC%numo3,kr) + gcCFC%o3_tab(1:gcCFC%numo3,kr) = w(1:gcCFC%numo3) + END DO + + DEALLOCATE(w, STAT=status) + VERIFY_(status) + + RETURN + CONTAINS +!------------------------------------------------------------------------- +!NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1, GEOS/DAS! +!------------------------------------------------------------------------- +!BOP +! +! !INTERFACE: + + SUBROUTINE readPhotTables(fileName, rc) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: +! + CHARACTER(LEN=*), INTENT(IN) :: fileName +! +! !OUTPUT PARAMETERS: +! + INTEGER, INTENT(OUT) :: rc + +! !DESCRIPTION: +! +! Read tables for photolysis in StratChem ... from a NetCDF file +! +! Restrictions: +! ASSERT that the number of pressure layers in the dataset equals km. +! +! !REVISION HISTORY: +! Nielsen 11 May 2012: First crack. +! +!EOP +!----------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR) :: Iam = "CFC::readPhotTables" + + INTEGER :: comm, info, unit, status + INTEGER :: dimid, i, n + + INTEGER :: length + + INTEGER, PARAMETER :: nD = 6 + CHARACTER(LEN=ESMF_MAXSTR) :: dimName(nD)= (/"nsza ", & + "numO3 ", "layers", "nlam ", "nts ", "nxdo " /) + + INTEGER, PARAMETER :: nV = 4 + CHARACTER(LEN=ESMF_MAXSTR) :: varName(nV)= (/"sza ", & + "O3TAB", "SDAT ", "XTAB " /) + + rc = 0 + + CALL ESMF_VMGet(vm, MPICOMMUNICATOR=comm, rc=status) + VERIFY_(status) + +#undef H5_HAVE_PARALLEL +#ifdef H5_HAVE_PARALLEL + + CALL MPI_Info_create(info, status) + CALL MPI_Info_set(info, "romio_cb_read", "automatic", status) + VERIFY_(status) + +#ifdef NETCDF_NEED_NF_MPIIO + status = NF_OPEN_PAR(TRIM(fileName), IOR(NF_NOWRITE,NF_MPIIO), comm, info, unit) +#else + status = NF_OPEN_PAR(TRIM(fileName), NF_NOWRITE, comm, info, unit) +#endif + +#else + + IF(MAPL_AM_I_ROOT(vm)) THEN + status = NF_OPEN(TRIM(fileName), NF_NOWRITE, unit) + +#endif + + IF(status /= NF_NOERR) THEN + PRINT *,'Error opening file ',TRIM(fileName), status + PRINT *, NF_STRERROR(status) + VERIFY_(status) + END IF + + DO i = 1,nD + + status = NF_INQ_DIMID(unit, TRIM(dimName(i)), dimid) + IF(status /= NF_NOERR) THEN + PRINT *,"Error inquiring dimension ID for ", TRIM(dimName(i)), status + PRINT *, NF_STRERROR(status) + VERIFY_(status) + END IF + + status = NF_INQ_DIMLEN(unit, dimid, n) + IF(status /= NF_NOERR) THEN + PRINT *,"Error inquiring dimension length for ", TRIM(dimName(i)), status + PRINT *, NF_STRERROR(status) + END IF + + SELECT CASE (i) + CASE (1) + gcCFC%nsza = n + CASE (2) + gcCFC%numO3 = n + CASE (3) + _ASSERT(n == km,'needs informative message') + CASE (4) + gcCFC%nlam = n + CASE (5) + gcCFC%nts = n + CASE (6) + gcCFC%nxdo = n + CASE DEFAULT + END SELECT + + END DO + +#ifndef H5_HAVE_PARALLEL + + END IF ! MAPL_AM_I_ROOT + + CALL MAPL_CommsBcast(vm, gcCFC%nsza, 1, 0, RC=status) + VERIFY_(status) + CALL MAPL_CommsBcast(vm, gcCFC%numO3, 1, 0, RC=status) + VERIFY_(status) + CALL MAPL_CommsBcast(vm, gcCFC%nlam, 1, 0, RC=status) + VERIFY_(status) + CALL MAPL_CommsBcast(vm, gcCFC%nts, 1, 0, RC=status) + VERIFY_(status) + CALL MAPL_CommsBcast(vm, gcCFC%nxdo, 1, 0, RC=status) + VERIFY_(status) + +#endif + + ALLOCATE(gcCFC%sdat(gcCFC%nsza,gcCFC%numo3,km,gcCFC%nlam), STAT=status) + VERIFY_(status) + ALLOCATE(gcCFC%o3_tab(gcCFC%numo3,km), STAT=status) + VERIFY_(status) + ALLOCATE(gcCFC%xtab(gcCFC%nlam,gcCFC%nxdo,gcCFC%nts), STAT=status) + VERIFY_(status) + ALLOCATE(gcCFC%sza_tab(gcCFC%nsza), STAT=status) + VERIFY_(status) + +#ifndef H5_HAVE_PARALLEL + + IF(MAPL_AM_I_ROOT(vm)) THEN + +#endif + + DO i = 1,nV + + status = NF_INQ_VARID(unit, TRIM(varName(i)), n) + IF(status /= NF_NOERR) THEN + PRINT *,"Error getting varid for ", TRIM(varName(i)), status + PRINT *, NF_STRERROR(status) + VERIFY_(status) + END IF + + SELECT CASE (i) + CASE (1) + status = NF_GET_VAR_REAL(unit, n, gcCFC%sza_tab) + CASE (2) + status = NF_GET_VAR_REAL(unit, n, gcCFC%o3_tab) + CASE (3) + status = NF_GET_VAR_REAL(unit, n, gcCFC%sdat) + CASE (4) + status = NF_GET_VAR_REAL(unit, n, gcCFC%xtab) + CASE DEFAULT + END SELECT + + IF(status /= NF_NOERR) THEN + PRINT *,"Error getting values for ", TRIM(varName(i)), status + PRINT *, NF_STRERROR(status) + VERIFY_(status) + END IF + + END DO + +#ifdef H5_HAVE_PARALLEL + + CALL MPI_Info_free(info, status) + VERIFY_(status) + +#else + + status = NF_CLOSE(unit) + VERIFY_(status) + + END IF ! MAPL_AM_I_ROOT + + length = SIZE(gcCFC%sza_tab) + CALL MPI_Bcast(gcCFC%sza_tab, length, MPI_REAL, 0, comm, status) + VERIFY_(status) + + length = SIZE(gcCFC%o3_tab) + CALL MPI_Bcast(gcCFC%o3_tab, length, MPI_REAL, 0, comm, status) + VERIFY_(status) + + length = SIZE(gcCFC%sdat) + CALL MPI_Bcast(gcCFC%sdat, length, MPI_REAL, 0, comm, status) + VERIFY_(status) + + length = SIZE(gcCFC%xtab) + CALL MPI_Bcast(gcCFC%xtab, length, MPI_REAL, 0, comm, status) + VERIFY_(status) + +#endif + + RETURN + END SUBROUTINE readPhotTables + + END SUBROUTINE CFC_GridCompInitialize + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CFC_GridCompRun --- The CFC Driver +! +! !INTERFACE: +! + + SUBROUTINE CFC_GridCompRun( gcCFC, w_c, impChem, expChem, nymd, nhms, & + cdt, rc) + +! !USES: + + IMPLICIT NONE + +! !INPUT/OUTPUT PARAMETERS: + + TYPE(CFC_GridComp), INTENT(INOUT) :: gcCFC ! Grid Component + TYPE(Chem_Bundle), INTENT(INOUT) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + +! !OUTPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - +!EOP + + CHARACTER(LEN=*), PARAMETER :: Iam = 'CFC_GridCompRun' + + INTEGER :: i1, i2, im, iXj, j1, j2, jm, km, status + INTEGER :: i, indt, j, k, m, n, nbeg, nbins, nend + REAL :: o3c, qmin, qmax, r, rg, szan + +! Imports +! ------- + REAL, POINTER, DIMENSION(:,:,:) :: T => null() + REAL, POINTER, DIMENSION(:,:,:) :: O3 => null() + REAL, POINTER, DIMENSION(:,:) :: tropp => null() + +! Local Variables +! --------------- + REAL, PARAMETER :: badVal=2.00E+05 + REAL, PARAMETER :: grav=9.80 + REAL, PARAMETER :: mwtAir=28.97 + REAL, PARAMETER :: mwtCFC12=120.917 + REAL, PARAMETER :: Nsuba=6.022E+26 + REAL, PARAMETER :: rstar=8.3143E+03 + REAL, PARAMETER :: O3abv80km = 1.10E+15 !m^{-2} + + REAL, ALLOCATABLE :: emit2vmr(:,:) + REAL, ALLOCATABLE :: tropPa(:,:) + REAL, ALLOCATABLE :: pPa(:,:,:) + REAL, ALLOCATABLE :: nd(:,:,:) + REAL, ALLOCATABLE :: O3Col(:,:,:) + REAL, ALLOCATABLE :: photoRate(:,:,:) + REAL, ALLOCATABLE :: s(:,:,:,:) + +! Disable the ACG'd CFC_GetPointer___.h for now. [Maybe fix it soon.] +! ------------------------------------------------------------------- +#define EXPORT expChem +#define ptrCFCEM CFC_emis +#define ptrCFCPH CFC_phot +#define ptrCFCLS CFC_loss +#define ptrCFCCL CFC_column + +!JEN#include "CFC_GetPointer___.h" + +! Bin sizes +! --------- + integer, parameter :: NBIN_CFCEM = 1 ! CFC Emission + integer, parameter :: NBIN_CFCPH = 1 ! CFC Photorate + integer, parameter :: NBIN_CFCLS = 2 ! CFC Loss due to photolysis + integer, parameter :: NBIN_CFCCL = 2 ! CFC Column + +! Bin-indexed Chem Arrays +! ----------------------- + type(Chem_Array), target :: CFCEM(NBIN_CFCEM) ! Export: CFC Surface flux + type(Chem_Array), pointer :: ptrCFCEM(:) ! Export: CFC Surface flux + type(Chem_Array), target :: CFCPH(NBIN_CFCPH) ! Export: CFC Photorate + type(Chem_Array), pointer :: ptrCFCPH(:) ! Export: CFC Photorate + type(Chem_Array), target :: CFCLS(NBIN_CFCLS) ! Export: CFC Loss due to photolysis + type(Chem_Array), pointer :: ptrCFCLS(:) ! Export: CFC Loss due to photolysis + type(Chem_Array), target :: CFCCL(NBIN_CFCCL) ! Export: CFC Column + type(Chem_Array), pointer :: ptrCFCCL(:) ! Export: CFC Column + +! Local array referencing the Import/Export states +! ------------------------------------------------ + type(Chem_Array), target :: CFC12S ! Export: Stratospheric CFC-12 (CCl2F2) + type(Chem_Array), pointer :: ptrCFC12S ! Export: Stratospheric CFC-12 (CCl2F2) + type(Chem_Array), target :: CFC12T ! Export: Tropospheric CFC-12 (CCl2F2) + type(Chem_Array), pointer :: ptrCFC12T ! Export: Tropospheric CFC-12 (CCl2F2) + real, pointer :: ptr2d(:,:) => null() + +! Get pointers to data in state +! ----------------------------- + call MAPL_GetPointer ( impChem,ptr2d,'CFC12', RC=STATUS) + VERIFY_(STATUS) + gcCFC%CFCsfcFlux = ptr2d + + ptrCFC12S => CFC12S ! Stratospheric CFC-12 (CCl2F2) + call MAPL_GetPointer ( EXPORT, CFC12S%data3d, 'CFC12S', RC=STATUS ) + VERIFY_(STATUS) + + ptrCFC12T => CFC12T ! Tropospheric CFC-12 (CCl2F2) + call MAPL_GetPointer ( EXPORT, CFC12T%data3d, 'CFC12T', RC=STATUS ) + VERIFY_(STATUS) + + ptrCFCEM => CFCEM ! CFC-12 Surface flux + call MAPL_GetPointer ( EXPORT, CFCEM(1)%data2d, 'CFC12EM', RC=STATUS ) + VERIFY_(STATUS) + + ptrCFCPH => CFCPH ! CFC-12 Photorate + call MAPL_GetPointer ( EXPORT, CFCPH(1)%data3d, 'CFC12PH', RC=STATUS ) + VERIFY_(STATUS) + + ptrCFCLS => CFCLS ! CFC-12 Loss due to photolysis + call MAPL_GetPointer ( EXPORT, CFCLS(1)%data3d, 'CFC12SLS', RC=STATUS ) + VERIFY_(STATUS) + call MAPL_GetPointer ( EXPORT, CFCLS(2)%data3d, 'CFC12TLS', RC=STATUS ) + VERIFY_(STATUS) + + ptrCFCCL => CFCCL ! CFC-12 Column mass density + call MAPL_GetPointer ( EXPORT, CFCCL(1)%data2d, 'CFC12SCL', RC=STATUS ) + VERIFY_(STATUS) + call MAPL_GetPointer ( EXPORT, CFCCL(2)%data2d, 'CFC12TCL', RC=STATUS ) + VERIFY_(STATUS) + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + im = w_c%grid%im + + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jm = w_c%grid%jm + + km = w_c%grid%km + + iXj = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + + nbins = w_c%reg%n_CFC + nbeg = w_c%reg%i_CFC + nend = w_c%reg%j_CFC + +! Imports +! ------- + CALL MAPL_GetPointer( impChem, T, 'T', RC=status ) + VERIFY_(status) + CALL MAPL_GetPointer( impChem, O3, 'O3', RC=status ) + VERIFY_(status) + CALL MAPL_GetPointer( impChem, tropp, 'TROPP', RC=status ) + VERIFY_(status) + + IF(gcCFC%DebugIsOn) THEN + CALL pmaxmin('CFC: T', T, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CFC: O3', O3, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CFC: TROPP', tropp, qmin, qmax, iXj, 1, 1. ) + END IF + +! Allocate temporary workspace +! ---------------------------- + ALLOCATE( emit2vmr(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + ALLOCATE( tropPa(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + ALLOCATE( pPa(i1:i2,j1:j2,km), STAT=status) + VERIFY_(status) + ALLOCATE( nd(i1:i2,j1:j2,km), STAT=status) + VERIFY_(status) + ALLOCATE( O3Col(i1:i2,j1:j2,km), STAT=status) + VERIFY_(status) + ALLOCATE(photoRate(i1:i2,j1:j2,km), STAT=status) + VERIFY_(status) + +! Fix bad tropopause pressure values if they exist. +! ------------------------------------------------- + CALL Chem_UtilTroppFixer(i2, j2, tropp, VERBOSE=.TRUE., NEWTROPP=tropPa, RC=status) + VERIFY_(status) + +! Find the pressure at mid-layer +! ------------------------------ + pPa(i1:i2,j1:j2,1) = w_c%grid%ptop + 0.50*w_c%delp(i1:i2,j1:j2,1) + DO k = 2, km + pPa(i1:i2,j1:j2,k) = pPa(i1:i2,j1:j2,k-1) + 0.50* & + (w_c%delp(i1:i2,j1:j2,k-1)+w_c%delp(i1:i2,j1:j2,k)) + END DO + +! Number density +! -------------- + nd(i1:i2,j1:j2,1:km)= nsuba*pPa(i1:i2,j1:j2,1:km)/(rstar*T(i1:i2,j1:j2,1:km)) + +! Compute the overlying ozone from mole fraction. Result: m^{-2} +! --------------------------------------------------------------- + r = Nsuba*0.50/(mwtAir*grav) + O3col(i1:i2,j1:j2,1) = O3abv80km + O3(i1:i2,j1:j2,1)*w_c%delp(i1:i2,j1:j2,1)*r + DO k=2,km + O3col(i1:i2,j1:j2,k) = O3col(i1:i2,j1:j2,k-1) + & + (O3(i1:i2,j1:j2,k-1) * w_c%delp(i1:i2,j1:j2,k-1) + & + O3(i1:i2,j1:j2, k) * w_c%delp(i1:i2,j1:j2, k))*r + END DO + +! Enable the conversion from emission [kg CFC m^{-2} s^{-1}] +! to an incremental change in the mixing ratio [s^{-1}]. +! ---------------------------------------------------------- + emit2vmr(i1:i2,j1:j2) = mwtAir*grav/(mwtCFC12*w_c%delp(i1:i2,j1:j2,km)) + +! Increment mixing ratio in surface layer of tropospheric CFC-12 +! -------------------------------------------------------------- + w_c%qa(nbeg+1)%data3d(i1:i2,j1:j2,km) = w_c%qa(nbeg+1)%data3d(i1:i2,j1:j2,km)+cdt* & + gcCFC%CFCsfcFlux(i1:i2,j1:j2)*emit2vmr(i1:i2,j1:j2) + +! When tropospheric CFC-12 migrates to the stratosphere, reassign it +! ------------------------------------------------------------------ + DO k = 1, km + WHERE(pPa(i1:i2,j1:j2,k) < tropPa(i1:i2,j1:j2) .AND. & + w_c%qa(nbeg+1)%data3d(i1:i2,j1:j2,k) > 0.00 ) + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k) + & + w_c%qa(nbeg+1)%data3d(i1:i2,j1:j2,k) + w_c%qa(nbeg+1)%data3d(i1:i2,j1:j2,k) = 0.00 + END WHERE + END DO + +! Convert CFC-12 to number density +! -------------------------------- + DO n=nbeg,nend + w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) = w_c%qa(n)%data3d(i1:i2,j1:j2,1:km)* & + nd(i1:i2,j1:j2,1:km) + END DO + + ALLOCATE(s(gcCFC%nlam,i1:i2,j1:j2,1:km), STAT=status) + VERIFY_(status) + +! Photolysis: Loop over horizontal domain +! ---------------------------------------- + DO j=j1,j2 + DO i=i1,i2 + +! Solar zenith angle (radians). w_c%cosz has no negative values, +! which are required for correct interpolation in the S-dat tables. +! ----------------------------------------------------------------- + IF(w_c%cosz(i,j) <= 1.00E-06) THEN + szan = ACOS(-0.50) + ELSE if(w_c%cosz(i,j) < 1.0 ) THEN + szan = ACOS(w_c%cosz(i,j)) + ELSE + szan = 0.0 + END IF + + DO k=1,km + o3c = O3Col(i,j,k)*1.00E-04 !to cm^{-2} + +! Interpolate radiative flux function values. +! Call getS even when sun is below the horizon. +! --------------------------------------------- + CALL getS(k,km,szan,o3c,s(:,i,j,k)) + indt = T(i,j,k)-148.5 + indt = MAX(1,indt) + indt = MIN(indt,200) + +! Rate constant is sum over wavelengths +! ------------------------------------- + photoRate(i,j,k) = SUM(s(1:gcCFC%nlam,i,j,k)*gcCFC%xtab(1:gcCFC%nlam,gcCFC%photEquNumber,indt)) + + END DO ! Layer + END DO ! Longitude + END DO ! Latitude + + DEALLOCATE(s, STAT=status) + VERIFY_(status) + m = 0 + +! Apply photolysis +! ---------------- + DO n=nbeg,nend + m = m+1 + w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) = w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) - cdt * & + w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) * & + photoRate(i1:i2,j1:j2,1:km) + gcCFC%CFCloss(i1:i2,j1:j2,1:km,m) = w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) * & + photoRate(i1:i2,j1:j2,1:km) + END DO + +! Return CFC-12 to mole fraction +! ------------------------------ + DO n=nbeg,nend + w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) = w_c%qa(n)%data3d(i1:i2,j1:j2,1:km)/ & + nd(i1:i2,j1:j2,1:km) + END DO + +! Fill the export states. + +! CFC-12 Surface emission in kg m^{-2} s^{-1} +! ------------------------------------------- + IF(ASSOCIATED(CFC_emis(1)%data2d)) & + CFC_emis(1)%data2d(i1:i2,j1:j2) = gcCFC%CFCsfcFlux(i1:i2,j1:j2) + +! CFC-12 photorate s^{-1} +! ----------------------- + IF(ASSOCIATED(CFC_phot(1)%data3d)) & + CFC_phot(1)%data3d(i1:i2,j1:j2,1:km) = photoRate(i1:i2,j1:j2,1:km) + +! Loss due to photolysis: Currently m^{-3} s^(-1), and positive for loss. +! ----------------------------------------------------------------------- + DO n = 1, nbins + IF(ASSOCIATED(CFC_loss(n)%data3d)) & + CFC_loss(n)%data3d(i1:i2,j1:j2,1:km) = gcCFC%CFCloss(i1:i2,j1:j2,1:km,n) + END DO + +! Column burden in kg m(^-2) +! -------------------------- + DO n = 1, nbins + IF(ASSOCIATED(CFC_column(n)%data2d)) THEN + CFC_column(n)%data2d(i1:i2,j1:j2) = 0. + DO k = 1, km + CFC_column(n)%data2d(i1:i2,j1:j2) & + = CFC_column(n)%data2d(i1:i2,j1:j2) & + + w_c%qa(nbeg+n-1)%data3d(i1:i2,j1:j2,k)*mwtCFC12/mwtAir & + * w_c%delp(i1:i2,j1:j2,k)/grav + END DO + END IF + END DO + +! Clean up +! -------- + DEALLOCATE( emit2vmr, STAT=status) + VERIFY_(status) + DEALLOCATE( tropPa, STAT=status) + VERIFY_(status) + DEALLOCATE( pPa, STAT=status) + VERIFY_(status) + DEALLOCATE( nd, STAT=status) + VERIFY_(status) + DEALLOCATE( O3Col, STAT=status) + VERIFY_(status) + DEALLOCATE(photoRate, STAT=status) + VERIFY_(status) + + RETURN + + CONTAINS + + SUBROUTINE getS(ik,levels,sza,o3column,s) +! -------------------------------------------------------------------------- +! NAME: +! interp_s +! PURPOSE: +! Interpolate s values for each wavelength in table to specified O3 +! col and zenith angles +! CATEGORY: +! CALLING SEQUENCE: +! Call interp_s(nlam,sza,o3column,s) +! INPUTS: +! nlam -- number of wavelength intervals used +! sza -- zenith angle +! o3column -- overhead o3 column value +! OPTIONAL INPUT PARAMETERS: +! OUTPUTS: +! s -- array of s values (nlam) for each wavelength +! at model p-level interpolated to o3column and sza values +! INTERNAL VARIABLES +! sza_tab -- values of sza corresponding to sdat table values +! o3_tab -- array of overhead O3 values at each p-level (numo3s,np_ctm) +! used to index sdat +! sdat -- input array of values of radiative source function +! (nzens,numo3,np_ctm,nlam) gridded to ctm p layers +! COMMON BLOCKS: +! SIDE EFFECTS: +! PROCEDURE: +! bi-linear interpolation, for sza>94 s=0, for o3 out of range use min/max +! RESTRICTIONS: +! REQUIRED ROUTINES: +! MODIFICATION HISTORY: +! Created 930825 - SR Kawa +! Modified 960710 for 28 levels and to handle J(O2) separately +! 1Jan2008 Nielsen CFC-12 configuration for ARCTAS. +! 1Nov2012 Nielsen Accomodate cubed sphere for GEOS-5 Ganymed releases +! -------------------------------------------------------------------------- + + IMPLICIT NONE + + INTEGER, INTENT(IN) :: ik,levels + REAL, INTENT(IN) :: sza,o3column + REAL, INTENT(OUT) :: s(gcCFC%nlam) + + INTEGER :: ijj,ikk,ikkm,il,is + REAL :: omt,omu,t,u + +! For each input solar zenith angle, find the first element of +! tabled sza_tab values that is greater than it. Use this +! table element and previous table element to determined +! interpolated value. +! ------------------------------------------------------------ + DO is=1,gcCFC%nsza + ijj = is + if(gcCFC%sza_tab(is) > sza) EXIT + END DO + +! Location is dark, set s/jo2=0 +! ----------------------------- + IF(sza > gcCFC%sza_tab(gcCFC%nsza)) THEN + s(1:gcCFC%nlam) = 0. + ELSE + t = (sza-gcCFC%sza_tab(ijj-1))/(gcCFC%sza_tab(ijj)-gcCFC%sza_tab(ijj-1)) + omt = 1.-t + +! For each input overhead o3 column find the first element +! of tabled o3_tab values that is > than it. Use this +! table element and previous table element to determine +! interpolated value +! -------------------------------------------------------- + DO is=1,gcCFC%numo3 + ikk = is + IF (gcCFC%o3_tab(is,ik) > o3column) EXIT + END DO + + ikkm = ikk-1 + + IF(ikk > 1 .AND. o3column <= gcCFC%o3_tab(gcCFC%numo3,ik)) THEN + u = (o3column-gcCFC%o3_tab(ikkm,ik))/ & + (gcCFC%o3_tab(ikk,ik)-gcCFC%o3_tab(ikkm,ik)) + omu = 1.-u + +! Bilinear interpolation at ik for each wavelength +! ------------------------------------------------ + DO il=1,gcCFC%nlam + s(il) = omt*omu*gcCFC%sdat(ijj-1,ikkm,ik,il) & + +t*omu*gcCFC%sdat(ijj,ikkm,ik,il) & + +t*u*gcCFC%sdat(ijj,ikk,ik,il) & + +omt*u*gcCFC%sdat(ijj-1,ikk,ik,il) + END DO + +! Extrapolate before table +! ------------------------ + ELSE IF (ikk == 1) THEN + DO il=1,gcCFC%nlam + s(il) = omt*gcCFC%sdat(ijj-1,1,ik,il)+t*gcCFC%sdat(ijj,1,ik,il) + END DO + +! Extrapolate past table +! ---------------------- + ELSE + DO il=1,gcCFC%nlam + s(il) = omt*gcCFC%sdat(ijj-1,gcCFC%numo3,ik,il)+ & + t*gcCFC%sdat(ijj,gcCFC%numo3,ik,il) + END DO + END IF + END IF + + RETURN + END SUBROUTINE getS + + END SUBROUTINE CFC_GridCompRun + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CFC_GridCompFinalize +! +! !INTERFACE: +! + + SUBROUTINE CFC_GridCompFinalize( gcCFC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT/OUTPUT PARAMETERS: + + TYPE(CFC_GridComp), INTENT(INOUT) :: gcCFC ! Grid Component + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), INTENT(IN) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Import State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=*), PARAMETER :: Iam = 'CFC_GridCompFinalize' + INTEGER :: status + + rc = 0 + + DEALLOCATE(gcCFC%sdat, gcCFC%xtab, gcCFC%o3_tab, gcCFC%sza_tab, & + gcCFC%CFCloss, gcCFC%CFCsfcFlux, STAT=status ) + VERIFY_(status) + + RETURN + END SUBROUTINE CFC_GridCompFinalize + + END MODULE CFC_GridCompMod + diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridComp_ExtData.rc new file mode 100644 index 00000000..7035706f --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridComp_ExtData.rc @@ -0,0 +1,8 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CFC12 NA N Y - none none CFC-12_EMISSION ExtData/g5chem/sfc/ARCTAS.CFC12.emission.x540_y361.2008.hdf +%% + diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/CFC_Registry.rc b/ESMF/GOCART_GridComp/CFC_GridComp/CFC_Registry.rc new file mode 100644 index 00000000..0bc1e637 --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/CFC_Registry.rc @@ -0,0 +1,35 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# 27Jun2014 Nielsen Added CFC-12 photorate export state. +# +# ----------------------------------------------------------------- + + COMP_NAME: CFC + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl|# Sub| Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + CFC12S | mol mol-1 | xyz | C | | | | | Stratospheric CFC-12 (CCl2F2) + CFC12T | mol mol-1 | xyz | C | | | | | Tropospheric CFC-12 (CCl2F2) +# .........|............|.....|...|....|...|...|.....|.................................. + CFC12EM | kg m-2 s-1 | xy | | | | | | CFC-12 Emission + CFC12SLS | m-3 s-1 | xyz | C | | | | | Stratospheric CFC-12 Loss + CFC12TLS | m-3 s-1 | xyz | C | | | | | Tropospheric CFC-12 Loss + CFC12SCL | kg m-2 | xy | | | | | | Stratospheric CFC-12 Column + CFC12TCL | kg m-2 | xy | | | | | | Tropospheric CFC-12 Column + CFC12PH | s-1 | xyz | C | | | | | CFC-12 Photorate +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + + diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/CMIP/CFC_GridComp.rc b/ESMF/GOCART_GridComp/CFC_GridComp/CMIP/CFC_GridComp.rc new file mode 100644 index 00000000..c44d3f18 --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/CMIP/CFC_GridComp.rc @@ -0,0 +1,9 @@ +# +# Resource file for CFC parameters. +# + +number_CFC_bins: 1 +photolysisFile: ExtData/g5chem/x/SC.J_20_12_79_72_200_38.nc4 +phot_Equation_number: 25 + +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/CMIP/CFC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CFC_GridComp/CMIP/CFC_GridComp_ExtData.rc new file mode 100644 index 00000000..7035706f --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/CMIP/CFC_GridComp_ExtData.rc @@ -0,0 +1,8 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CFC12 NA N Y - none none CFC-12_EMISSION ExtData/g5chem/sfc/ARCTAS.CFC12.emission.x540_y361.2008.hdf +%% + diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/CFC_GridComp/CMakeLists.txt new file mode 100644 index 00000000..49cbf323 --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-C\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/MERRA2/CFC_GridComp.rc b/ESMF/GOCART_GridComp/CFC_GridComp/MERRA2/CFC_GridComp.rc new file mode 100644 index 00000000..c44d3f18 --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/MERRA2/CFC_GridComp.rc @@ -0,0 +1,9 @@ +# +# Resource file for CFC parameters. +# + +number_CFC_bins: 1 +photolysisFile: ExtData/g5chem/x/SC.J_20_12_79_72_200_38.nc4 +phot_Equation_number: 25 + +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/MERRA2/CFC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CFC_GridComp/MERRA2/CFC_GridComp_ExtData.rc new file mode 100644 index 00000000..7035706f --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/MERRA2/CFC_GridComp_ExtData.rc @@ -0,0 +1,8 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CFC12 NA N Y - none none CFC-12_EMISSION ExtData/g5chem/sfc/ARCTAS.CFC12.emission.x540_y361.2008.hdf +%% + diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/NR/CFC_GridComp.rc b/ESMF/GOCART_GridComp/CFC_GridComp/NR/CFC_GridComp.rc new file mode 100644 index 00000000..c44d3f18 --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/NR/CFC_GridComp.rc @@ -0,0 +1,9 @@ +# +# Resource file for CFC parameters. +# + +number_CFC_bins: 1 +photolysisFile: ExtData/g5chem/x/SC.J_20_12_79_72_200_38.nc4 +phot_Equation_number: 25 + +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/NR/CFC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CFC_GridComp/NR/CFC_GridComp_ExtData.rc new file mode 100644 index 00000000..7035706f --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/NR/CFC_GridComp_ExtData.rc @@ -0,0 +1,8 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CFC12 NA N Y - none none CFC-12_EMISSION ExtData/g5chem/sfc/ARCTAS.CFC12.emission.x540_y361.2008.hdf +%% + diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/PIESA/CFC_GridComp.rc b/ESMF/GOCART_GridComp/CFC_GridComp/PIESA/CFC_GridComp.rc new file mode 100644 index 00000000..c44d3f18 --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/PIESA/CFC_GridComp.rc @@ -0,0 +1,9 @@ +# +# Resource file for CFC parameters. +# + +number_CFC_bins: 1 +photolysisFile: ExtData/g5chem/x/SC.J_20_12_79_72_200_38.nc4 +phot_Equation_number: 25 + +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/PIESA/CFC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CFC_GridComp/PIESA/CFC_GridComp_ExtData.rc new file mode 100644 index 00000000..7035706f --- /dev/null +++ b/ESMF/GOCART_GridComp/CFC_GridComp/PIESA/CFC_GridComp_ExtData.rc @@ -0,0 +1,8 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CFC12 NA N Y - none none CFC-12_EMISSION ExtData/g5chem/sfc/ARCTAS.CFC12.emission.x540_y361.2008.hdf +%% + diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridComp---animls.rc b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridComp---animls.rc new file mode 100644 index 00000000..a7b6a3d6 --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridComp---animls.rc @@ -0,0 +1,34 @@ +# +# Resource file for CH4 parameters. +# + +number_CH4_bins: 1 + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +CH4_regions_indices: -1 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Apply methane tendency (loss) from CH4 + hv => 2H2O + CO (0 no, 1 yes) +# ---------------------------------------------------------------------- +CH4_Feedback: 0 + +# Apply water tendency (source) from photolysis of CH4 (0 no, 1 yes) +# ------------------------------------------------------------------ +H2O_Feedback: 0 + +# Largest solar zenith angle (degrees) allowed as daytime +# ------------------------------------------------------- +solar_ZA_cutoff: 94.00 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridComp.rc b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridComp.rc new file mode 100644 index 00000000..519e00fb --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridComp.rc @@ -0,0 +1,14 @@ +# +# CH4 main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# All instances | full | -1 +# ------------------|-------|------------ + +CH4_instances: animls coal leak gasvnt hydz msw soilab trmite bogs burn ricec swamps tundra bf tot diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridCompMod.F90 b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridCompMod.F90 new file mode 100644 index 00000000..1aa436ad --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridCompMod.F90 @@ -0,0 +1,1316 @@ +#include "MAPL_Generic.h" +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: CH4_GridCompMod --- CH4 Grid Component Class +! +! !INTERFACE: +! + + MODULE CH4_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + USE Chem_Mod ! Chemistry Base Class + USE Chem_StateMod ! Chemistry State + USE Chem_UtilMod ! I/O + USE m_inpak90 ! Resource file management + USE Henrys_law_ConstantsMod, ONLY: get_HenrysLawCts + + IMPLICIT NONE + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC CH4_GridComp ! Multiple instance CH4 object + PUBLIC CH4_GridComp1 ! Single instance CH4 object + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC CH4_GridCompSetServices + PUBLIC CH4_GridCompInitialize + PUBLIC CH4_GridCompRun + PUBLIC CH4_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the CH4 Grid Component. +! +! !REVISION HISTORY: +! +! 24 Jun 2010 Nielsen: First crack. +! 25 Oct 2012 Nielsen: Added photolysis. +! +!EOP +!------------------------------------------------------------------------- + + TYPE CH4_GridComp1 + + CHARACTER(LEN=ESMF_MAXSTR) :: name ! generic name of the package + CHARACTER(LEN=ESMF_MAXSTR) :: iname ! instance name + CHARACTER(LEN=ESMF_MAXSTR) :: rcfilen ! resource file name + CHARACTER(LEN=ESMF_MAXSTR) :: regionsString ! Comma-delimited string of regions + CHARACTER(LEN=ESMF_MAXSTR) :: CH4Source ! Source name on emission file (CH4_ANIMLS, for example) + + INTEGER :: instance ! Instantiation number + INTEGER :: nymd_oh + INTEGER :: nymd_ch4 + INTEGER :: BCnymd ! Date of last emissions/prodction read + + REAL, POINTER :: regionMask(:,:) ! regional mask + REAL, POINTER :: CH4(:,:,:) ! CH4 mixing ratio mol/mol + REAL, POINTER :: OHnd(:,:,:) ! OH number density (cm^{-3}) + REAL, POINTER :: CH4sfcFlux(:,:) ! CH4 surface flux kg m^-2 s^-1 + + LOGICAL :: DebugIsOn ! Run-time debug switch + LOGICAL :: CH4FeedBack ! Permit increments to CH4 from CH4 + hv => 2H2O + CO + LOGICAL :: H2OFeedBack ! Permit increments to Q from CH4 + hv => 2H2O + CO + + REAL :: szaCutoff ! Largest solar zenith angle (degrees) allowed as daytime + + END TYPE CH4_GridComp1 + + TYPE CH4_GridComp + INTEGER :: n ! number of instances + TYPE(CH4_GridComp1), pointer :: gcs(:) ! instances + END TYPE CH4_GridComp + +CONTAINS + + subroutine CH4_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: rcbasen = 'CH4_GridComp' + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: ier,n,i + + type(ESMF_Config) :: cfg + + Iam = "CH4_GridCompSetServices" + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(rc=status) + VERIFY_(STATUS) + call ESMF_ConfigLoadFile(cfg,TRIM(rcbasen)//'.rc',rc=status) + VERIFY_(STATUS) + +! Parse resource file +! ------------------- + n = ESMF_ConfigGetLen(cfg,label='CH4_instances:',rc=status) + VERIFY_(STATUS) + +! We cannot have fewer instances than the number of +! CH4 bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( n .LT. chemReg%n_CH4 ) then + rc = 35 + return + else if ( n .GT. chemReg%n_CH4 ) then + if (MAPL_AM_I_ROOT()) & + PRINT *, TRIM(Iam)//": Bins = ",chemReg%n_CH4," of ",n," expected." + end if + n = min(n,chemReg%n_CH4 ) + +! Record name of each instance +! ---------------------------- + call ESMF_ConfigFindLabel(cfg,'CH4_instances:',rc=status) + VERIFY_(STATUS) + do i = 1, n + call ESMF_ConfigGetAttribute(cfg,name,rc=status) + VERIFY_(STATUS) + ! resource file name + IF(TRIM(name) == "full" ) THEN + name = " " ! blank instance name for full (1) + ELSE + name = TRIM(name) ! instance name for others + END IF + call CH4_GridCompSetServices1_(gc,chemReg,name,rc=status) + VERIFY_(STATUS) + end do + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CH4_regionMask', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + RETURN_(ESMF_SUCCESS) + + end subroutine CH4_GridCompSetServices + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CH4_GridCompInitialize --- Initialize CH4_GridComp +! +! !INTERFACE: +! + + SUBROUTINE CH4_GridCompInitialize ( gcCH4, w_c, impChem, expChem, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CH4_GridComp), INTENT(INOUT) :: gcCH4 ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the CH4 Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 24 Jun 2010 Nielsen: First crack. +! 25 Oct 2012 Nielsen: Added photolysis. +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=*), PARAMETER :: Iam = 'CH4_GridCompInitialize' + CHARACTER(LEN=ESMF_MAXSTR) :: rcbasen = 'CH4_GridComp' + CHARACTER(LEN=ESMF_MAXSTR) :: name + + INTEGER :: i, n, status + REAL :: c1,c2,c3,c4 + +! Load resource file +! ------------------ + CALL I90_loadf ( TRIM(rcbasen)//'.rc', status ) + VERIFY_(status) + +! Parse resource file +! ------------------- + CALL I90_label ( 'CH4_instances:', status ) + VERIFY_(status) + +! First determine how many instances we have +! ------------------------------------------ + n = 0 + status = 0 + + DO WHILE ( status == 0 ) + CALL I90_gtoken( name, status ) + IF(status == 0) n = n + 1 + END DO + IF ( n == 0 ) THEN + status = 1 + VERIFY_(status) + END IF + +! We cannot have fewer instances than the number of +! CH4 bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + IF ( n < w_c%reg%n_CH4 ) THEN + status = 1 + VERIFY_(status) + ELSE IF ( n >= w_c%reg%n_CH4 ) THEN + IF(MAPL_AM_I_ROOT()) PRINT *, TRIM(Iam)//": Bins = ",w_c%reg%n_CH4," of ",n," expected." + END IF + n = min(n,w_c%reg%n_CH4 ) + gcCH4%n = n + +! Next allocate necessary memory +! ------------------------------ + ALLOCATE ( gcCH4%gcs(n), STAT=status ) + VERIFY_(status) + +! Record name of each instance +! ---------------------------- + CALL I90_label ( 'CH4_instances:', status ) + VERIFY_(status) + DO i = 1, n + CALL I90_gtoken( name, status ) + VERIFY_(status) + ! resource file name + gcCH4%gcs(i)%rcfilen = trim(rcbasen)//'---'//trim(name)//'.rc' + gcCH4%gcs(i)%instance = i ! instance number + IF(TRIM(name) == "full" ) THEN + gcCH4%gcs(i)%iname = " " ! blank instance name for full (1) + ELSE + gcCH4%gcs(i)%iname = TRIM(name) ! instance name for others + END IF + END DO + +! Next initialize each instance +! ----------------------------- + DO i = 1, gcCH4%n + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,TRIM(Iam)//": Initializing instance ",TRIM(gcCH4%gcs(i)%iname)," [",gcCH4%gcs(i)%instance,"]" + END IF + CALL CH4_SingleInstance_ ( CH4_GridCompInitialize1_, i, & + gcCH4%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, status ) + VERIFY_(status) + END DO + +! Get Henrys Law cts for the parameterized convective wet removal +! ----------------------------------------------------------- + CALL get_HenrysLawCts('CH4',c1,c2,c3,c4) + w_c%reg%Hcts(1,w_c%reg%i_CH4 : w_c%reg%j_CH4)=c1 + w_c%reg%Hcts(2,w_c%reg%i_CH4 : w_c%reg%j_CH4)=c2 + w_c%reg%Hcts(3,w_c%reg%i_CH4 : w_c%reg%j_CH4)=c3 + w_c%reg%Hcts(4,w_c%reg%i_CH4 : w_c%reg%j_CH4)=c4 + +! All done +! -------- + CALL I90_FullRelease( status ) + VERIFY_(status) + + END SUBROUTINE CH4_GridCompInitialize + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CH4_GridCompRun --- Run CH4_GridComp +! +! !INTERFACE: +! + + SUBROUTINE CH4_GridCompRun ( gcCH4, w_c, impChem, expChem, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CH4_GridComp), INTENT(INOUT) :: gcCH4 ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the CH4 Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 24 Jun 2010 Nielsen: First crack. +! 25 Oct 2012 Nielsen: Added photolysis. +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'CH4_GridCompRun' + INTEGER :: i, status + + DO i = 1, gcCH4%n + CALL CH4_SingleInstance_ ( CH4_GridCompRun1_, i, & + gcCH4%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, status ) + VERIFY_(status) + END DO + + END SUBROUTINE CH4_GridCompRun + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CH4_GridCompFinalize --- Initialize CH4_GridComp +! +! !INTERFACE: +! + + SUBROUTINE CH4_GridCompFinalize ( gcCH4, w_c, impChem, expChem, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CH4_GridComp), INTENT(INOUT) :: gcCH4 ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the CH4 Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'CH4_GridCompFinalize' + INTEGER :: i, status + + DO i = 1, gcCH4%n + CALL CH4_SingleInstance_ ( CH4_GridCompFinalize1_, i, & + gcCH4%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, status ) + VERIFY_(status) + END DO + + DEALLOCATE ( gcCH4%gcs, stat=status ) + gcCH4%n = -1 + + END SUBROUTINE CH4_GridCompFinalize + + subroutine CH4_GridCompSetServices1_( gc, chemReg, iname, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + character(len=*), intent(IN ) :: iname + integer, intent(OUT ) :: rc + + integer :: Status + character(len=ESMF_MAXSTR) :: Iam + + Iam ="CH4_GridCOmpSetServices1_" + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CH4_sfcFlux'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CH4_oh'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RC = STATUS) + VERIFY_(STATUS) + + RETURN_(ESMF_SUCCESS) + + end subroutine CH4_GridCompSetServices1_ + +!-------------------------------------------------------------------------- + +! Single Instance Methods + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CH4_GridCompInitialize --- Initialize CH4_GridComp +! +! !INTERFACE: +! + + SUBROUTINE CH4_GridCompInitialize1_ ( gcCH4, w_c, impChem, expChem, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CH4_GridComp1), INTENT(INOUT) :: gcCH4 ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the CH4 Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 31May2005 Nielsen Mods for 7 CH4 bins, 5 region masks +! 04Nov2005 Bian CO tagged to 4 regions +! (global, North America, South America, and Africa) +! for CR-AVE +! 25Oct2012 Nielsen Added photolysis. +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=*), PARAMETER :: Iam = 'CH4_GridCompInitialize1_' + + CHARACTER(LEN=ESMF_MAXSTR) :: rcfilen + + INTEGER :: j, n, status + INTEGER :: i1, i2, im, j1, j2, jm, km + INTEGER :: nTimes, begTime, incSecs + INTEGER :: nbeg, nend, nymd1, nhms1 + LOGICAL :: NoRegionalConstraint + + REAL :: limitN, limitS, radTODeg + REAL, ALLOCATABLE :: var2D(:,:) + real, pointer :: ptr2d(:,:) => null() + + rcfilen = gcCH4%rcfilen + gcCH4%name = 'GEOS-5/GOCART Parameterized CH4 Package' + gcCH4%BCnymd = -1 + radTODeg = 57.2957795 + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + im = w_c%grid%im + + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jm = w_c%grid%jm + + km = w_c%grid%km + + nbeg = w_c%reg%i_CH4 + nend = w_c%reg%j_CH4 + +! It requires 1 bin +! ----------------- + if ( nbeg /= nend ) then + IF(MAPL_AM_I_ROOT()) PRINT *,TRIM(Iam)//": Must have only 1 bin at the single instance level" + status = 1 + VERIFY_(status) + end if + +! Allocate memory, etc +! -------------------- + ALLOCATE ( gcCH4%CH4sfcFlux(i1:i2,j1:j2), & + gcCH4%regionMask(i1:i2,j1:j2), & + gcCH4%OHnd(i1:i2,j1:j2,km), STAT=status ) + VERIFY_(status) + +! Load resource file +! ------------------ + CALL I90_loadf ( TRIM(rcfilen), status ) + VERIFY_(status) + +! Maximum allowed solar zenith angle for "daylight" +! ------------------------------------------------- + CALL I90_label ( 'solar_ZA_cutoff:', status ) + VERIFY_(status) + gcCH4%szaCutoff = I90_gfloat( status ) + VERIFY_(status) + +! Run-time debug switch +! --------------------- + CALL I90_label ( 'DEBUG:', status ) + VERIFY_(status) + n = I90_gint ( status ) + VERIFY_(status) + IF(n /= 0) THEN + gcCH4%DebugIsOn = .TRUE. + ELSE + gcCH4%DebugIsOn = .FALSE. + END IF + +! Methane photolysis feedback switch +! ---------------------------------- + CALL I90_label ( 'CH4_Feedback:', status ) + VERIFY_(status) + n = I90_gint ( status ) + VERIFY_(status) + IF(n /= 0) THEN + gcCH4%CH4FeedBack = .TRUE. + ELSE + gcCH4%CH4FeedBack = .FALSE. + END IF + +! Water vapor feedback switch +! --------------------------- + CALL I90_label ( 'H2O_Feedback:', status ) + VERIFY_(status) + n = I90_gint ( status ) + VERIFY_(status) + IF(n /= 0) THEN + gcCH4%H2OFeedBack = .TRUE. + ELSE + gcCH4%H2OFeedBack = .FALSE. + END IF + + call MAPL_GetPointer(impChem,ptr2D,'CH4_regionMask',rc=status) + VERIFY_(STATUS) + +! Grab the region string. +! ----------------------- + CALL I90_label ( 'CH4_regions_indices:', status ) + VERIFY_(status) + CALL I90_gtoken( gcCH4%regionsString, status ) + VERIFY_(status) + +! Is this instantiation a global case? +! ----------------------------------- + IF(gcCH4%regionsString(1:2) == "-1") THEN + NoRegionalConstraint = .TRUE. + ELSE + SELECT CASE (ESMF_UtilStringLowerCase(gcCH4%regionsString(1:2))) + CASE ("gl") + NoRegionalConstraint = .TRUE. + CASE ("al") + NoRegionalConstraint = .TRUE. + CASE DEFAULT + NoRegionalConstraint = .FALSE. + END SELECT + END IF + +! Set regionsString to "-1" for the global case +! --------------------------------------------- + IF(NoRegionalConstraint) gcCH4%regionsString = "-1" + + IF(MAPL_AM_I_ROOT()) THEN + IF(NoRegionalConstraint) THEN + PRINT *,TRIM(Iam)//": This instantiation has no regional constraints." + ELSE + PRINT *,TRIM(Iam)//": This instantiation is regionally constrained." + PRINT *,TRIM(Iam)//": List of region numbers included: ",TRIM(gcCH4%regionsString) + END IF + END IF + +! Set the initial CH4 surface fluxes to zero +! ------------------------------------------ + gcCH4%CH4sfcFlux(i1:i2,j1:j2) = 0.00 + +! Use instance name as key to CH4 emission source +! ----------------------------------------------- + gcCH4%CH4Source = "CH4_"//TRIM(ESMF_UtilStringUpperCase(gcCH4%iname)) + + RETURN + + END SUBROUTINE CH4_GridCompInitialize1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CH4_GridCompRun +! +! !INTERFACE: +! + + SUBROUTINE CH4_GridCompRun1_ ( gcCH4, w_c, impChem, expChem, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT/OUTPUT PARAMETERS: + + TYPE(CH4_GridComp1), INTENT(INOUT) :: gcCH4 ! Grid Component + TYPE(Chem_Bundle), INTENT(INOUT) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(inout) :: impChem ! Import State + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(ESMF_State), intent(inout) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the CH4 Driver for GOCART. +! +! !REVISION HISTORY: +! +! 24 Jun 2010 Nielsen: First crack. +! 25 Oct 2012 Nielsen: Added photolysis. +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=*), PARAMETER :: Iam = 'CH4_GridCompRun1_' + +! Input fields from fvGCM +! ----------------------- + REAL, POINTER, DIMENSION(:,:) :: cellArea => null() + REAL, POINTER, DIMENSION(:,:,:) :: T => null() + REAL, POINTER, DIMENSION(:,:,:) :: Q => null() + REAL, POINTER, DIMENSION(:,:,:) :: rhoWet => null() + REAL, POINTER, DIMENSION(:,:,:) :: rhoDry => null() + REAL, POINTER, DIMENSION(:,:,:) :: ple => null() + + INTEGER :: i1, i2, im, j1, j2, jm, km, idiag, iXj + INTEGER :: i, j, k, kReverse, n, nbeg, nend + INTEGER :: nymd1, nhms1, status + + REAL, PARAMETER :: mwtCH4 = 16.043 + + REAL :: qmin, qmax + + REAL, ALLOCATABLE :: cellDepth(:,:,:), cellVolume(:,:,:), rkoh(:,:,:) + REAL, ALLOCATABLE :: p(:,:,:), ndWet(:,:,:), ndDry(:,:,:) + REAL, ALLOCATABLE :: dCH4nd(:,:,:), photJ(:,:,:), dCH4Phot(:,:,:) + + CHARACTER(LEN=256) :: CH4Source + + REAL, POINTER :: ptr2d(:,:) => null() + REAL, POINTER :: ptr3d(:,:,:) => null() + +#define EXPORT expChem +#define iNAME TRIM(gcCH4%iname) + +#define CH4EM CH4_emis +#define CH4CL CH4_column +#define CH4SC CH4_surface +#define CH4PD CH4_prod +#define CH4LS CH4_loss +#define CH4JL CH4_phot +#define CH4QP CH4_qprod +#define CH4DRY CH4_dry + +#include "CH4_GetPointer___.h" + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + im = w_c%grid%im + + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jm = w_c%grid%jm + km = w_c%grid%km + + iXj = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + + nbeg = w_c%reg%i_CH4 + nend = w_c%reg%j_CH4 + +! It requires 1 bin +! ----------------- + IF ( nbeg /= nend ) THEN + IF(MAPL_AM_I_ROOT()) PRINT *,TRIM(Iam)//": Must have only 1 bin at the single instance level" + status = 1 + VERIFY_(status) + END IF + +! Get imports +! ----------- + CALL MAPL_GetPointer(impChem, T, 'T', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, Q, 'Q', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, rhoWet, 'AIRDENS', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, rhoDry, 'AIRDENS_DRYP',RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, cellArea, 'AREA', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, ple, 'PLE', RC=status) + VERIFY_(status) + + IF(gcCH4%DebugIsOn) THEN + CALL pmaxmin('CH4:AREA', cellArea, qmin, qmax, iXj, 1, 1. ) + CALL pmaxmin('CH4:T', T, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CH4:Q', q, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CH4:rhoWet', rhoWet, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CH4:rhoDry', rhoDry, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CH4:ple', ple, qmin, qmax, iXj, km+1, 1. ) + END IF + +! Update CH4 emissions and OH number density once each day. +! The latter appears to be in molecules cm^-3. +! --------------------------------------------------------- + call MAPL_GetPointer(impChem,ptr2d,'CH4_sfcFlux'//trim(iNAME),rc=status) + VERIFY_(STATUS) + gcCH4%CH4sfcFlux=ptr2d + + call MAPL_GetPointer(impChem,ptr3d,'CH4_oh'//trim(iNAME),rc=status) + VERIFY_(STATUS) + gcCH4%OHnd=ptr3d + +! OH number density from molecules cm^-3 to molecules m^-3 +! -------------------------------------------------------- + gcCH4%OHnd(i1:i2,j1:j2,1:km) = gcCH4%OHnd(i1:i2,j1:j2,1:km)*1.00E+06 + +! Allocate temporary workspace +! ---------------------------- + ALLOCATE( p(i1:i2,j1:j2,km), & + ndWet(i1:i2,j1:j2,km), & + ndDry(i1:i2,j1:j2,km), & + rkoh(i1:i2,j1:j2,km), & + dCH4nd(i1:i2,j1:j2,km), & + cellVolume(i1:i2,j1:j2,km), & + cellDepth(i1:i2,j1:j2,km), STAT=status) + VERIFY_(status) + +! Layer mean pressures +! -------------------- + DO k=1,km + p(i1:i2,j1:j2,k) = (ple(i1:i2,j1:j2,k-1)+ple(i1:i2,j1:j2,k))*0.50 + END DO + +! Moist air number density +! ------------------------ + ndWet(i1:i2,j1:j2,1:km) = rhoWet(i1:i2,j1:j2,1:km)*MAPL_AVOGAD/MAPL_AIRMW + +! Dry air number density +! ---------------------- + ndDry(i1:i2,j1:j2,1:km) = rhoDry(i1:i2,j1:j2,1:km)*MAPL_AVOGAD/MAPL_AIRMW + +! Cell depth and volume +! --------------------- + DO k=1,km + cellDepth(i1:i2,j1:j2,k) = (ple(i1:i2,j1:j2,k)-ple(i1:i2,j1:j2,k-1))/(rhoWet(i1:i2,j1:j2,k)*MAPL_GRAV) + cellVolume(i1:i2,j1:j2,k) = cellArea(i1:i2,j1:j2)*cellDepth(i1:i2,j1:j2,k) + END DO + + IF(gcCH4%DebugIsOn) THEN + CALL pmaxmin('CH4: SfcFlux', gcCH4%CH4sfcFlux, qmin, qmax, iXj, 1, 1. ) + CALL pmaxmin('CH4: OH Conc', gcCH4%OHnd, qmin, qmax, iXj, 1, 1. ) + CALL pmaxmin('CH4: Cell Vol', cellVolume, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CH4: Cell Depth', cellDepth, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CH4: Wet air nd', ndWet, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CH4: Dry air nd', ndDry, qmin, qmax, iXj, km, 1. ) + END IF + +! Convert methane from mole fraction to number density +! ---------------------------------------------------- + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km) = & + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)*ndWet(i1:i2,j1:j2,1:km) + +! Loss rate [m^{3} s^{-1}] for OH + CH4 => CH3 + H2O +! -------------------------------------------------- + rkoh(i1:i2,j1:j2,1:km) = 2.45e-12*1.00E-06*exp(-1775./T(i1:i2,j1:j2,1:km)) + +! Change in CH4 number density [m^{-3} s^{-1}] due to oxydation +! ------------------------------------------------------------- + dCH4nd(i1:i2,j1:j2,1:km) = rkoh(i1:i2,j1:j2,1:km)*gcCH4%OHnd(i1:i2,j1:j2,1:km)*w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km) + +! Increment the CH4 number density +! -------------------------------- + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)-cdt*dCH4nd(i1:i2,j1:j2,1:km) + +! Calculate photolytic loss rates, J [s^{-1}], for CH4 + hv => 2H2O + CO. +! Notice that J and the losses are always computed. However, the setting +! of the feedback switch(es) determines if the increments are actually applied. +! ----------------------------------------------------------------------------- + ALLOCATE(photJ(i1:i2,j1:j2,1:km), STAT=status) + VERIFY_(STATUS) + photJ(:,:,:) = 0.00 + + CALL getJRates(status) + VERIFY_(status) + +! Change in CH4 number density [m^{-3} s^{-1}] due to photolysis +! -------------------------------------------------------------- + ALLOCATE(dCH4Phot(i1:i2,j1:j2,1:km), STAT=status) + VERIFY_(STATUS) + + dCH4Phot(i1:i2,j1:j2,1:km) = photJ(i1:i2,j1:j2,1:km)*w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km) + + IF(ASSOCIATED(CH4_phot)) THEN + CH4_phot(i1:i2,j1:j2,1:km) = dCH4Phot(i1:i2,j1:j2,1:km) + END IF + + DEALLOCATE(photJ, STAT=status) + VERIFY_(STATUS) + +! Increment the CH4 number density when the switch is on +! ------------------------------------------------------ + IF(gcCH4%CH4FeedBack) & + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)-cdt*dCH4Phot(i1:i2,j1:j2,1:km) + +! Vertically integrated CH4 loss due to oxydation (only) +! ------------------------------------------------------ + IF(ASSOCIATED(CH4_loss)) THEN + CH4_loss(i1:i2,j1:j2) = 0. + DO k = 1, km + CH4_loss(i1:i2,j1:j2) = CH4_loss(i1:i2,j1:j2) & + + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)*rkoh(i1:i2,j1:j2,k) & + * gcCH4%OHnd(i1:i2,j1:j2,k)/ndWet(i1:i2,j1:j2,k) & + * mwtCH4/MAPL_AIRMW*w_c%delp(i1:i2,j1:j2,k)/MAPL_GRAV + END DO + END IF + +! CH4 production (None) +! --------------------- + IF(ASSOCIATED(CH4_prod)) CH4_prod(i1:i2,j1:j2) = 0.00 + +! CH4 Emission: kg cell^{-1} s^{-1}. Convert to m^{-3} s^{-1}, +! multiply by dt, and add to the number density. Note: No need +! for regionMask when using a B. Duncan GMI emission dataset. +! ------------------------------------------------------------- + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km) + cdt*MAPL_AVOGAD*gcCH4%CH4sfcFlux(i1:i2,j1:j2)/ & + (mwtCH4 * cellVolume(i1:i2,j1:j2,km) ) + +! Column burden [kg m^{-2}] +! ------------------------- + IF(ASSOCIATED(CH4_column)) THEN + CH4_column(i1:i2,j1:j2) = 0.00 + DO k = 1, km + CH4_column(i1:i2,j1:j2) = CH4_column(i1:i2,j1:j2) + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)* & + cellDepth(i1:i2,j1:j2,k)*mwtCH4/MAPL_AVOGAD + END DO + END IF + +! Fill export state for CH4 mole fraction in dry air +! -------------------------------------------------- + IF(ASSOCIATED(CH4_dry)) THEN + CH4_dry(i1:i2,j1:j2,1:km) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)/ndDry(i1:i2,j1:j2,1:km) + END IF + +! Return internal state CH4 to moist-air mole fraction +! ---------------------------------------------------- + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)/ndWet(i1:i2,j1:j2,1:km) + +! Surface concentration in ppmv +! ----------------------------- + IF(ASSOCIATED(CH4_surface)) & + CH4_surface(i1:i2,j1:j2) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km)*1.00E+06 + +! CH4 surface flux [kg m^{-2} s^{-1}] diagnostic +! ---------------------------------------------- + IF(ASSOCIATED(CH4_emis)) & + CH4_emis(i1:i2,j1:j2) = gcCH4%CH4sfcFlux(i1:i2,j1:j2)/cellArea(i1:i2,j1:j2) + +! Allow changes to water vapor when the switch is on +! -------------------------------------------------- + ChangeH2O: IF(gcCH4%CH4FeedBack .AND. gcCH4%H2OFeedBack) THEN + +! Convert water vapor to number density +! ------------------------------------- + Q(i1:i2,j1:j2,1:km) = Q(i1:i2,j1:j2,1:km)*rhoWet(i1:i2,j1:j2,1:km)*MAPL_AVOGAD/MAPL_H2OMW + +! Increment the water vapor number density by +! adding two molecules for each CH4 molecule lost. +! ------------------------------------------------ + Q(i1:i2,j1:j2,1:km) = Q(i1:i2,j1:j2,1:km)+2.00*cdt*dCH4Phot(i1:i2,j1:j2,1:km) + +! Convert water vapor back to mass mixing ratio +! --------------------------------------------- + Q(i1:i2,j1:j2,1:km) = Q(i1:i2,j1:j2,1:km)*MAPL_H2OMW/(rhoWet(i1:i2,j1:j2,1:km)*MAPL_AVOGAD) + + END IF ChangeH2O + +! Water vapor tendency [kg kg^{-1} s^{-1}] +! ---------------------------------------- + IF(ASSOCIATED(CH4_qprod)) THEN + CH4_qprod(i1:i2,j1:j2,1:km) = 2.00*dCH4Phot(i1:i2,j1:j2,1:km)*MAPL_H2OMW/(ndWet(i1:i2,j1:j2,1:km)*MAPL_AIRMW) + END IF + + IF(gcCH4%DebugIsOn) THEN + IF(ASSOCIATED(CH4_emis)) CALL pmaxmin( 'CH4: emis', CH4_emis, qmin, qmax, iXj, 1, 1. ) + IF(ASSOCIATED(CH4_loss)) CALL pmaxmin( 'CH4: loss', CH4_loss, qmin, qmax, iXj, 1, 1. ) + IF(ASSOCIATED(CH4_prod)) CALL pmaxmin( 'CH4: prod', CH4_prod, qmin, qmax, iXj, 1, 1. ) + IF(ASSOCIATED(CH4_column)) CALL pmaxmin( 'CH4: column', CH4_column, qmin, qmax, iXj, 1, 1. ) + IF(ASSOCIATED(CH4_surface)) CALL pmaxmin( 'CH4: surface', CH4_surface, qmin, qmax, iXj, 1, 1. ) + IF(ASSOCIATED(CH4_qprod)) CALL pmaxmin('CH4: H2O_prod', CH4_qprod, qmin, qmax, iXj, km, 1. ) + IF(ASSOCIATED(CH4_phot)) CALL pmaxmin('CH4: dCH4phot', dCH4phot, qmin, qmax, iXj, km, 1. ) + IF(ASSOCIATED(CH4_dry)) CALL pmaxmin( 'CH4: dry', CH4_dry, qmin, qmax, iXj, km, 1. ) + END IF + +! Housekeeping +! ------------ + DEALLOCATE(ndDry, ndWet, p, rkoh, dCH4nd, cellDepth, cellVolume, STAT=status) + VERIFY_(status) + DEALLOCATE(dCH4Phot, STAT=status) + VERIFY_(status) + + RETURN + + CONTAINS + + SUBROUTINE getJRates(rc) + +! Borrowed from meso_phot.F of StratChem, where number densities are cgs [cm^{-3}] +! -------------------------------------------------------------------------------- + IMPLICIT NONE + + INTEGER, INTENT(out) :: rc + + REAL, ALLOCATABLE :: o2Column(:,:,:) + REAL, ALLOCATABLE :: SZARad(:,:) + REAL, ALLOCATABLE :: SZADeg(:,:) + REAL, ALLOCATABLE :: sinSZA(:,:) + REAL, ALLOCATABLE :: zgrz(:,:) + REAL, ALLOCATABLE :: sfaca(:,:) + REAL, ALLOCATABLE :: arg(:,:) + + REAL, PARAMETER :: wavel = 1215.7 + REAL, PARAMETER :: O2xs = 1.000E-20 + REAL, PARAMETER :: CH4xs = 2.000E-17 + REAL, PARAMETER :: sflux = 4.006E+11 + +! Constants for Chapman function at high solar zenith angle +! --------------------------------------------------------- + REAL, PARAMETER :: hbar = 6.79 + REAL, PARAMETER :: zbar = 30.0 + REAL, PARAMETER :: r0 = 6.371E+03 + REAL, PARAMETER :: zp = 60.0 + + REAL, PARAMETER :: d1 = 1.060693 + REAL, PARAMETER :: d2 = 0.55643831 + REAL, PARAMETER :: d3 = 1.0619896 + REAL, PARAMETER :: d4 = 1.7245609 + REAL, PARAMETER :: d5 = 0.56498823 + REAL, PARAMETER :: d6 = 0.06651874 + + REAL, PARAMETER :: O2Abv80km = 7.072926E+19 ![cm^{-2}] + REAL, PARAMETER :: O2VMR = 0.20946 + + REAL :: b + REAL :: f + REAL :: r, radToDeg + REAL :: s + + INTEGER :: status + + CHARACTER(LEN=ESMF_MAXSTR) :: Iam = "CH4::getJRates" + + radToDeg = 180.00/MAPL_PI + rc = 0 + b = SQRT(0.50*r0/hbar) + +! O2 overhead number density profile [cm^{-2}] +! -------------------------------------------- + ALLOCATE(O2Column(i1:i2,j1:j2,1:km), STAT=status) + VERIFY_(status) + + f = O2VMR*5.00E-05 + O2Column(:,:,1) = O2Abv80km+cellDepth(:,:,1)*ndWet(:,:,1)*f + + DO k = 2,km + O2Column(:,:,k) = O2Column(:,:,k-1)+(cellDepth(:,:,k-1)*ndWet(:,:,k-1)+ & + cellDepth(:,:, k)*ndWet(:,:, k))*f + END DO + + IF(gcCH4%DebugIsOn) THEN + CALL pmaxmin('CH4: O2Column', O2Column, qmin, qmax, iXj, km, 1. ) + END IF + +! Grab some memory +! ---------------- + ALLOCATE(SZARad(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + ALLOCATE(SZADeg(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + ALLOCATE(sinSZA(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + + WHERE(w_c%cosz(i1:i2,j1:j2) > 1.00) + SZARad(i1:i2,j1:j2) = 0.00 + ELSEWHERE + SZARad(i1:i2,j1:j2) = ACOS(w_c%cosz(i1:i2,j1:j2)) + ENDWHERE + SZADeg(i1:i2,j1:j2) = SZARad(i1:i2,j1:j2)*radToDeg + sinSZA(i1:i2,j1:j2) = SIN(SZARad(i1:i2,j1:j2)) + + ALLOCATE(zgrz(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + + WHERE(SZADeg(i1:i2,j1:j2) <= 90.00) + zgrz(i1:i2,j1:j2) = 1000.00 + ELSEWHERE + zgrz(i1:i2,j1:j2) = sinSZA(i1:i2,j1:j2)*(zp+r0)-r0 + ENDWHERE + + IF(gcCH4%DebugIsOn) THEN + CALL pmaxmin('CH4: zgrz', zgrz, qmin, qmax, iXj, 1, 1. ) + CALL pmaxmin('CH4: cosz', w_c%cosz, qmin, qmax, iXj, 1, 1. ) + END IF + + ALLOCATE(sfaca(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + sfaca(i1:i2,j1:j2) = 0.00 + +! Chapman function calculation from ACDB 2-D model +! ------------------------------------------------ + DO j = j1,j2 + DO i = i1,i2 + + Daytime: IF(SZADeg(i,j) < gcCH4%szaCutoff) THEN + + IF(SZADeg(i,j) < 70.00) THEN + + sfaca(i,j) = 1.00/w_c%cosz(i,j) + + ELSE IF(zgrz(i,j) > 0.00) THEN + + s = b*ABS(w_c%cosz(i,j)) + + IF(s <= 8.00) THEN + s = (d1+d2*s)/(d3+d4*s+s**2) + ELSE + s = d5/(d6+s) + END IF + + r = b*SQRT(MAPL_PI) + sfaca(i,j) = r*s + + IF(SZADeg(i,j) > 90.00) THEN + sfaca(i,j) = 2.00*r*EXP((r0+zbar)*(1.00-sinSZA(i,j))/hbar)-sfaca(i,j) + END IF + + END IF + + END IF Daytime + + END DO + END DO + + IF(gcCH4%DebugIsOn) THEN + CALL pmaxmin('CH4: sfaca', sfaca, qmin, qmax, iXj, 1, 1. ) + END IF + + ALLOCATE(arg(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + +! At each layer, compute the rate constant, J [s^{-1}], if the sun is up +! ---------------------------------------------------------------------- + DO k = 1,km + + WHERE(SZADeg(i1:i2,j1:j2) < gcCH4%szaCutoff) + arg(i1:i2,j1:j2) = O2Column(i1:i2,j1:j2,k)*O2xs*sfaca(i1:i2,j1:j2) + photJ(i1:i2,j1:j2,k) = sflux*EXP(-arg(i1:i2,j1:j2))*CH4xs + END WHERE + + END DO + + IF(gcCH4%DebugIsOn) THEN + CALL pmaxmin('CH4: photJ', photJ, qmin, qmax, iXj, km, 1. ) + END IF + + DEALLOCATE(SZARad, STAT=status) + VERIFY_(status) + DEALLOCATE(SZADeg, STAT=status) + VERIFY_(status) + DEALLOCATE(sinSZA, STAT=status) + VERIFY_(status) + DEALLOCATE(zgrz, STAT=status) + VERIFY_(status) + DEALLOCATE(sfaca, STAT=status) + VERIFY_(status) + DEALLOCATE(arg, STAT=status) + VERIFY_(status) + DEALLOCATE(O2Column, STAT=status) + VERIFY_(status) + + RETURN + + END SUBROUTINE getJRates + + END SUBROUTINE CH4_GridCompRun1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CH4_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + SUBROUTINE CH4_GridCompFinalize1_ ( gcCH4, w_c, impChem, expChem, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT/OUTPUT PARAMETERS: + + TYPE(CH4_GridComp1), INTENT(INOUT) :: gcCH4 ! Grid Component + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), INTENT(IN) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Import State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=*), PARAMETER :: Iam = 'CH4_GridCompFinalize1_' + INTEGER :: status + rc = 0 + + DEALLOCATE ( gcCH4%CH4sfcFlux, gcCH4%regionMask, gcCH4%OHnd, STAT=status ) + rc = status + VERIFY_(status) + + RETURN + + END SUBROUTINE CH4_GridCompFinalize1_ + + END MODULE CH4_GridCompMod + +!----------------------------------------------------------------------- + +! Single Instance Wrapper + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CH4_SingleInstance_ --- Runs single instance of method +! +! !INTERFACE: +! + SUBROUTINE CH4_SingleInstance_ ( Method_, instance, & + gcCH4, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + Use CH4_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! Input "function pointer" +! ----------------------- + interface + subroutine Method_ (gc, w, imp, exp, ymd, hms, dt, rcode ) + Use CH4_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + type(CH4_GridComp1), intent(inout) :: gc + type(Chem_Bundle), intent(in) :: w + type(ESMF_State), intent(inout) :: imp + type(ESMF_State), intent(inout) :: exp + integer, intent(in) :: ymd, hms + real, intent(in) :: dt + integer, intent(out) :: rcode + end subroutine Method_ + end interface + + integer, intent(in) :: instance ! instance number + + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CH4_GridComp1), INTENT(INOUT) :: gcCH4 ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the CH4 Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer n_CH4, i_CH4, j_CH4 + +! Save overall CH4 indices +! ----------------------- + n_CH4 = w_c%reg%n_CH4 + i_CH4 = w_c%reg%i_CH4 + j_CH4 = w_c%reg%j_CH4 + +! Customize indices for this particular instance +! ---------------------------------------------- + w_c%reg%n_CH4 = 1 + w_c%reg%i_CH4 = i_CH4 + instance - 1 + w_c%reg%j_CH4 = i_CH4 + instance - 1 + +! Execute the instance method +! --------------------------- + call Method_ ( gcCH4, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! Restore the overall CH4 indices +! ------------------------------ + w_c%reg%n_CH4 = n_CH4 + w_c%reg%i_CH4 = i_CH4 + w_c%reg%j_CH4 = j_CH4 + + END SUBROUTINE CH4_SingleInstance_ + +!----------------------------------------------------------------------- diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridComp_ExtData.rc new file mode 100644 index 00000000..cd77dc88 --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridComp_ExtData.rc @@ -0,0 +1,39 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CH4_sfcFluxanimls NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_ANIMLS /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxcoal NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_COAL /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxleak NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_LEAK /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxgasvnt NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_GASVNT /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxhydz NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_HYDZ /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxmsw NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_MSW /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxsoilab NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_SOILAB /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxtrmite NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_TRMITE /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxbogs NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_BOGS /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxburn NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_BURN /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxricec NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_RICEC /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxswamps NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_SWAMPS /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxtundra NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_TUNDRA /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxbf NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_BF /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_sfcFluxtot NA Y Y %y4-%m2-%d2t12:00:00 none none CH4_TOT /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/emist_plusCH4WangAposteriori.x288_y181_z72_t12.2006.nc +CH4_ohanimls NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohcoal NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohleak NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohgasvnt NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohhydz NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohmsw NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohsoilab NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohtrmite NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohbogs NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohburn NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohricec NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohswamps NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohtundra NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohbf NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CH4_ohtot NA Y Y %y4-%m2-%d2t12:00:00 none none oh /discover/nobackup/projects/gmao/share/dasilva/fvInput/g5chem/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +# +CH4_regionMask NA N v - none none REGION_MASK ExtData/g5chem/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/CH4_Registry.rc b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_Registry.rc new file mode 100644 index 00000000..68530598 --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_Registry.rc @@ -0,0 +1,153 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: CH4 + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl|# Sub| Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- + CH4EM | kg m-2 s-1 | xy | | | | | | CH4 Emission __ENSEMBLE__ + CH4EManimls | kg m-2 s-1 | xy | | | | | | CH4 Emission animals + CH4EMcoal | kg m-2 s-1 | xy | | | | | | CH4 Emission coal + CH4EMleak | kg m-2 s-1 | xy | | | | | | CH4 Emission leakage + CH4EMgasvnt | kg m-2 s-1 | xy | | | | | | CH4 Emission gas venting + CH4EMhydz | kg m-2 s-1 | xy | | | | | | CH4 Emission ocean HYDZ + CH4EMmsw | kg m-2 s-1 | xy | | | | | | CH4 Emission municipal sewers + CH4EMsoilab | kg m-2 s-1 | xy | | | | | | CH4 Emission soil absorption + CH4EMtrmite | kg m-2 s-1 | xy | | | | | | CH4 Emission termites + CH4EMbogs | kg m-2 s-1 | xy | | | | | | CH4 Emission bogs + CH4EMburn | kg m-2 s-1 | xy | | | | | | CH4 Emission biomass burning + CH4EMricec | kg m-2 s-1 | xy | | | | | | CH4 Emission rice cultivation + CH4EMswamps | kg m-2 s-1 | xy | | | | | | CH4 Emission swamps + CH4EMtundra | kg m-2 s-1 | xy | | | | | | CH4 Emission tundra + CH4EMbf | kg m-2 s-1 | xy | | | | | | CH4 Emission biofuel + CH4EMtot | kg m-2 s-1 | xy | | | | | | CH4 Emission total + CH4PD | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production __ENSEMBLE__ + CH4PDanimls | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production animals + CH4PDcoal | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production coal + CH4PDleak | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production leakage + CH4PDgasvnt | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production gas venting + CH4PDhydz | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production ocean HYDZ + CH4PDmsw | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production municipal sewers + CH4PDsoilab | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production soil absorption + CH4PDtrmite | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production termites + CH4PDbogs | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production bogs + CH4PDburn | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production biomass burning + CH4PDricec | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production rice cultivation + CH4PDswamps | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production swamps + CH4PDtundra | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production tundra + CH4PDbf | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production biofuel + CH4PDtot | kg m-2 s-1 | xy | | | | | | CH4 Chemical Production total + CH4LS | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss __ENSEMBLE__ + CH4LSanimls | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss animals + CH4LScoal | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss coal + CH4LSleak | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss leakage + CH4LSgasvnt | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss gas venting + CH4LShydz | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss ocean HYDZ + CH4LSmsw | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss municipal sewers + CH4LSsoilab | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss soil absorption + CH4LStrmite | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss termites + CH4LSbogs | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss bogs + CH4LSburn | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss biomass burning + CH4LSricec | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss rice cultivation + CH4LSswamps | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss swamps + CH4LStundra | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss tundra + CH4LSbf | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss biofuel + CH4LStot | kg m-2 s-1 | xy | | | | | | CH4 Chemical Loss total + CH4SC | ppbv | xy | | | | | | CH4 Surface Concentration __ENSEMBLE__ + CH4SCanimls | ppbv | xy | | | | | | CH4 Surface Concentration animals + CH4SCcoal | ppbv | xy | | | | | | CH4 Surface Concentration coal + CH4SCleak | ppbv | xy | | | | | | CH4 Surface Concentration leakage + CH4SCgasvnt | ppbv | xy | | | | | | CH4 Surface Concentration gas venting + CH4SChydz | ppbv | xy | | | | | | CH4 Surface Concentration ocean HYDZ + CH4SCmsw | ppbv | xy | | | | | | CH4 Surface Concentration municipal sewers + CH4SCsoilab | ppbv | xy | | | | | | CH4 Surface Concentration soil absorption + CH4SCtrmite | ppbv | xy | | | | | | CH4 Surface Concentration termites + CH4SCbogs | ppbv | xy | | | | | | CH4 Surface Concentration bogs + CH4SCburn | ppbv | xy | | | | | | CH4 Surface Concentration biomass burning + CH4SCricec | ppbv | xy | | | | | | CH4 Surface Concentration rice cultivation + CH4SCswamps | ppbv | xy | | | | | | CH4 Surface Concentration swamps + CH4SCtundra | ppbv | xy | | | | | | CH4 Surface Concentration tundra + CH4SCbf | ppbv | xy | | | | | | CH4 Surface Concentration biofuel + CH4SCtot | ppbv | xy | | | | | | CH4 Surface Concentration total + CH4CL | kg m-2 | xy | | | | | | CH4 Column Burden __ENSEMBLE__ + CH4CLanimls | kg m-2 | xy | | | | | | CH4 Column Burden animals + CH4CLcoal | kg m-2 | xy | | | | | | CH4 Column Burden coal + CH4CLleak | kg m-2 | xy | | | | | | CH4 Column Burden leakage + CH4CLgasvnt | kg m-2 | xy | | | | | | CH4 Column Burden gas venting + CH4CLhydz | kg m-2 | xy | | | | | | CH4 Column Burden ocean HYDZ + CH4CLmsw | kg m-2 | xy | | | | | | CH4 Column Burden municipal sewers + CH4CLsoilab | kg m-2 | xy | | | | | | CH4 Column Burden soil absorption + CH4CLtrmite | kg m-2 | xy | | | | | | CH4 Column Burden termites + CH4CLbogs | kg m-2 | xy | | | | | | CH4 Column Burden bogs + CH4CLburn | kg m-2 | xy | | | | | | CH4 Column Burden biomass burning + CH4CLricec | kg m-2 | xy | | | | | | CH4 Column Burden rice cultivation + CH4CLswamps | kg m-2 | xy | | | | | | CH4 Column Burden swamps + CH4CLtundra | kg m-2 | xy | | | | | | CH4 Column Burden tundra + CH4CLbf | kg m-2 | xy | | | | | | CH4 Column Burden biofuel + CH4CLtot | kg m-2 | xy | | | | | | CH4 Column Burden total + CH4JL | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss __ENSEMBLE__ + CH4JLanimls | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss animals + CH4JLcoal | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss coal + CH4JLleak | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss leakage + CH4JLgasvnt | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss gas venting + CH4JLhydz | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss ocean HYDZ + CH4JLmsw | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss municipal sewers + CH4JLsoilab | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss soil absorption + CH4JLtrmite | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss termites + CH4JLbogs | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss bogs + CH4JLburn | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss biomass burning + CH4JLricec | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss rice cultivation + CH4JLswamps | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss swamps + CH4JLtundra | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss tundra + CH4JLbf | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss biofuel + CH4JLtot | m-3 s-1 | xyz | C | | | | | CH4 Photolytic Loss total + CH4QP | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis __ENSEMBLE__ + CH4QPanimls | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis animals + CH4QPcoal | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis coal + CH4QPleak | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis leakage + CH4QPgasvnt | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis gas venting + CH4QPhydz | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis ocean HYDZ + CH4QPmsw | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis municipal sewers + CH4QPsoilab | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis soil absorption + CH4QPtrmite | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis termites + CH4QPbogs | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis bogs + CH4QPburn | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis biomass burning + CH4QPricec | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis rice cultivation + CH4QPswamps | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis swamps + CH4QPtundra | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis tundra + CH4QPbf | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis biofuel + CH4QPtot | kg kg-1 s-1 | xyz | C | | | | | H2O tendency from CH4 photolysis total + CH4DRY | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction __ENSEMBLE__ + CH4DRYanimls | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_animals + CH4DRYcoal | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_coal + CH4DRYleak | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_leakage + CH4DRYgasvnt | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_gas_venting + CH4DRYhydz | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_ocean_HYDZ + CH4DRYmsw | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_municipal_sewers + CH4DRYsoilab | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_soil_absorption + CH4DRYtrmite | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_termites + CH4DRYbogs | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_bogs + CH4DRYburn | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_biomass_burning + CH4DRYricec | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_rice_cultivation + CH4DRYswamps | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_swamps + CH4DRYtundra | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_tundra + CH4DRYbf | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_biofuel + CH4DRYtot | mol mol-1 | xyz | C | | | | | CH4_dry_air_mole_fraction_total +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- + + diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/CMIP/CH4_GridComp---animls.rc b/ESMF/GOCART_GridComp/CH4_GridComp/CMIP/CH4_GridComp---animls.rc new file mode 100644 index 00000000..a7b6a3d6 --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/CMIP/CH4_GridComp---animls.rc @@ -0,0 +1,34 @@ +# +# Resource file for CH4 parameters. +# + +number_CH4_bins: 1 + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +CH4_regions_indices: -1 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Apply methane tendency (loss) from CH4 + hv => 2H2O + CO (0 no, 1 yes) +# ---------------------------------------------------------------------- +CH4_Feedback: 0 + +# Apply water tendency (source) from photolysis of CH4 (0 no, 1 yes) +# ------------------------------------------------------------------ +H2O_Feedback: 0 + +# Largest solar zenith angle (degrees) allowed as daytime +# ------------------------------------------------------- +solar_ZA_cutoff: 94.00 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/CMIP/CH4_GridComp.rc b/ESMF/GOCART_GridComp/CH4_GridComp/CMIP/CH4_GridComp.rc new file mode 100644 index 00000000..519e00fb --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/CMIP/CH4_GridComp.rc @@ -0,0 +1,14 @@ +# +# CH4 main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# All instances | full | -1 +# ------------------|-------|------------ + +CH4_instances: animls coal leak gasvnt hydz msw soilab trmite bogs burn ricec swamps tundra bf tot diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/CH4_GridComp/CMakeLists.txt new file mode 100644 index 00000000..934817f9 --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL + ) +target_include_directories (${this} PUBLIC ${INC_NETCDF}) +esma_generate_gocart_code (${this} "-B\;-E\;-F\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/MERRA2/CH4_GridComp---animls.rc b/ESMF/GOCART_GridComp/CH4_GridComp/MERRA2/CH4_GridComp---animls.rc new file mode 100644 index 00000000..a7b6a3d6 --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/MERRA2/CH4_GridComp---animls.rc @@ -0,0 +1,34 @@ +# +# Resource file for CH4 parameters. +# + +number_CH4_bins: 1 + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +CH4_regions_indices: -1 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Apply methane tendency (loss) from CH4 + hv => 2H2O + CO (0 no, 1 yes) +# ---------------------------------------------------------------------- +CH4_Feedback: 0 + +# Apply water tendency (source) from photolysis of CH4 (0 no, 1 yes) +# ------------------------------------------------------------------ +H2O_Feedback: 0 + +# Largest solar zenith angle (degrees) allowed as daytime +# ------------------------------------------------------- +solar_ZA_cutoff: 94.00 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/MERRA2/CH4_GridComp.rc b/ESMF/GOCART_GridComp/CH4_GridComp/MERRA2/CH4_GridComp.rc new file mode 100644 index 00000000..519e00fb --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/MERRA2/CH4_GridComp.rc @@ -0,0 +1,14 @@ +# +# CH4 main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# All instances | full | -1 +# ------------------|-------|------------ + +CH4_instances: animls coal leak gasvnt hydz msw soilab trmite bogs burn ricec swamps tundra bf tot diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/NR/CH4_GridComp---animls.rc b/ESMF/GOCART_GridComp/CH4_GridComp/NR/CH4_GridComp---animls.rc new file mode 100644 index 00000000..a7b6a3d6 --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/NR/CH4_GridComp---animls.rc @@ -0,0 +1,34 @@ +# +# Resource file for CH4 parameters. +# + +number_CH4_bins: 1 + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +CH4_regions_indices: -1 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Apply methane tendency (loss) from CH4 + hv => 2H2O + CO (0 no, 1 yes) +# ---------------------------------------------------------------------- +CH4_Feedback: 0 + +# Apply water tendency (source) from photolysis of CH4 (0 no, 1 yes) +# ------------------------------------------------------------------ +H2O_Feedback: 0 + +# Largest solar zenith angle (degrees) allowed as daytime +# ------------------------------------------------------- +solar_ZA_cutoff: 94.00 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/NR/CH4_GridComp.rc b/ESMF/GOCART_GridComp/CH4_GridComp/NR/CH4_GridComp.rc new file mode 100644 index 00000000..519e00fb --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/NR/CH4_GridComp.rc @@ -0,0 +1,14 @@ +# +# CH4 main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# All instances | full | -1 +# ------------------|-------|------------ + +CH4_instances: animls coal leak gasvnt hydz msw soilab trmite bogs burn ricec swamps tundra bf tot diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/PIESA/CH4_GridComp---animls.rc b/ESMF/GOCART_GridComp/CH4_GridComp/PIESA/CH4_GridComp---animls.rc new file mode 100644 index 00000000..a7b6a3d6 --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/PIESA/CH4_GridComp---animls.rc @@ -0,0 +1,34 @@ +# +# Resource file for CH4 parameters. +# + +number_CH4_bins: 1 + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +CH4_regions_indices: -1 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Apply methane tendency (loss) from CH4 + hv => 2H2O + CO (0 no, 1 yes) +# ---------------------------------------------------------------------- +CH4_Feedback: 0 + +# Apply water tendency (source) from photolysis of CH4 (0 no, 1 yes) +# ------------------------------------------------------------------ +H2O_Feedback: 0 + +# Largest solar zenith angle (degrees) allowed as daytime +# ------------------------------------------------------- +solar_ZA_cutoff: 94.00 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/PIESA/CH4_GridComp.rc b/ESMF/GOCART_GridComp/CH4_GridComp/PIESA/CH4_GridComp.rc new file mode 100644 index 00000000..519e00fb --- /dev/null +++ b/ESMF/GOCART_GridComp/CH4_GridComp/PIESA/CH4_GridComp.rc @@ -0,0 +1,14 @@ +# +# CH4 main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# All instances | full | -1 +# ------------------|-------|------------ + +CH4_instances: animls coal leak gasvnt hydz msw soilab trmite bogs burn ricec swamps tundra bf tot diff --git a/ESMF/GOCART_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/CMakeLists.txt new file mode 100644 index 00000000..641b73fe --- /dev/null +++ b/ESMF/GOCART_GridComp/CMakeLists.txt @@ -0,0 +1,39 @@ +esma_set_this () + +set (alldirs + O3_GridComp + CO_GridComp + CO2_GridComp + CFC_GridComp + DU_GridComp + SS_GridComp + BC_GridComp + OC_GridComp + SU_GridComp + Rn_GridComp + CH4_GridComp + NI_GridComp + BRC_GridComp + ) + +set (srcs + GOCART_GridCompMod.F90 + Aero_GridCompMod.F90 + ) + +set (resource_files + GOCARTdata_AerRegistry.rc + GOCARTdata_ExtData.rc + ) + +install( FILES ${resource_files} + DESTINATION etc + ) + +set (dependencies Chem_Base Chem_Shared MAPL GMAO_mpeu) +esma_add_library (${this} + SRCS ${srcs} + SUBCOMPONENTS ${alldirs} + DEPENDENCIES ${dependencies} + INCLUDES ${INC_ESMF}) + diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/CMIP/CO2_GridComp.rc b/ESMF/GOCART_GridComp/CO2_GridComp/CMIP/CO2_GridComp.rc new file mode 100644 index 00000000..69b0459d --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/CMIP/CO2_GridComp.rc @@ -0,0 +1,50 @@ +# +# Resource file for CO2 parameters. +# + +number_CO2_bins: 1 +CO2_regions_indices: -1 1 2 5 + +# Run year-specific CMS emissions (0 runs climatological monthly mean emissions, 1 runs CMS) +# ------------------------------------------------------------------------------------------ +CMS_EMIS: 0 + +# Biosphere drawdown enhancement factor used for climatological emissions. +# Range: < 0 invalid, < 1 reduce sink, 1 neutral, > 1 enhance sink. +# ------------------------------------------------------------------------ +Biosphere_drawdown_factor: 1.2448 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + + + +# Deprecated options +# ------------------ +# NOTES: 1) The filename variables are all unused because they are now read from +# CO2_GridComp_ExtData.rc. However, some versions of the CO2 GridComp require +# these fields to be present in this file and have a time wildcard (here %y4). +# +# 2) The emissions factors are read and applied. However, scale factors can be +# specified in CO2_GridComp_ExtData.rc, so for clarity, we now apply them there. + +CO2_regions: name_set_in_extdata_rc + +CO2_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CO2_biomass_emission_factor: 1. + +CO2_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_fossilfuel_emissions_factor: 1. + +CO2_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_ocean_emissions_filename: name_set_in_extdata_rc_%y4 + +CMS_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CMS_biomass_emission_factor: 1. + +CMS_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_fossilfuel_emissions_factor: 1. + +CMS_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_ocean_emissions_filename: name_set_in_extdata_rc_%y4 diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/CMIP/CO2_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO2_GridComp/CMIP/CO2_GridComp_ExtData.rc new file mode 100644 index 00000000..e0ec1064 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/CMIP/CO2_GridComp_ExtData.rc @@ -0,0 +1,19 @@ +PrimaryExports%% +# A = Climatology? Y/N; B = Conservative regridding? Y/N +#---------------+-------------------+-+-+---------------------+--------+--------+------------------------------------ +# Export | | | |_______ Refresh _____|____ Factors ____|_______ External File __________ +# Name | Units |A|B| Time Template | Offset | Scale | Variable | Template +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- + CO2_BIOMASS 'kg CO2 m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED-v2_4r1/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 + CO2_FF 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_NEP 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_OCN 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + + CO2_CMS_BIOMASS 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/CMS/em.daily.1x1.25.%y4.nc + CO2_CMS_FF 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/CMS/ORNL_TRANSCOM.co2_ff_nep_ocn.x288_y181_t12.%y4.nc + CO2_CMS_NEP 'kg C m-2 s-1' N Y P0000-00-00T03:00 none none emco2nep ExtData/PIESA/sfc/CMS/casa.3hr.1x1.25.%y4.nc + CO2_CMS_OCN 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/CMS/NOBM_fco2.daily.1x1.25.%y4.nc + + CO2_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- +%% diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/CO2_GridComp/CMakeLists.txt new file mode 100644 index 00000000..49cbf323 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-C\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridComp.rc b/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridComp.rc new file mode 100644 index 00000000..69b0459d --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridComp.rc @@ -0,0 +1,50 @@ +# +# Resource file for CO2 parameters. +# + +number_CO2_bins: 1 +CO2_regions_indices: -1 1 2 5 + +# Run year-specific CMS emissions (0 runs climatological monthly mean emissions, 1 runs CMS) +# ------------------------------------------------------------------------------------------ +CMS_EMIS: 0 + +# Biosphere drawdown enhancement factor used for climatological emissions. +# Range: < 0 invalid, < 1 reduce sink, 1 neutral, > 1 enhance sink. +# ------------------------------------------------------------------------ +Biosphere_drawdown_factor: 1.2448 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + + + +# Deprecated options +# ------------------ +# NOTES: 1) The filename variables are all unused because they are now read from +# CO2_GridComp_ExtData.rc. However, some versions of the CO2 GridComp require +# these fields to be present in this file and have a time wildcard (here %y4). +# +# 2) The emissions factors are read and applied. However, scale factors can be +# specified in CO2_GridComp_ExtData.rc, so for clarity, we now apply them there. + +CO2_regions: name_set_in_extdata_rc + +CO2_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CO2_biomass_emission_factor: 1. + +CO2_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_fossilfuel_emissions_factor: 1. + +CO2_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_ocean_emissions_filename: name_set_in_extdata_rc_%y4 + +CMS_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CMS_biomass_emission_factor: 1. + +CMS_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_fossilfuel_emissions_factor: 1. + +CMS_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_ocean_emissions_filename: name_set_in_extdata_rc_%y4 diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridCompMod.F90 b/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridCompMod.F90 new file mode 100644 index 00000000..1a8da2ef --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridCompMod.F90 @@ -0,0 +1,1028 @@ +#include "MAPL_Generic.h" +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 610.1, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: CO2_GridCompMod --- CO2 Grid Component Class +! +! !INTERFACE: +! + + module CO2_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + + use Chem_Mod ! Chemistry Base Class + use Chem_StateMod ! Chemistry State + use Chem_UtilMod + use m_inpak90 ! Resource file management + USE Henrys_law_ConstantsMod, ONLY: get_HenrysLawCts + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC CO2_GridComp ! The CO2 object + +! +! !PUBLIIC MEMBER FUNCTIONS: +! + + PUBLIC CO2_GridCompSetServices + PUBLIC CO2_GridCompInitialize + PUBLIC CO2_GridCompRun + PUBLIC CO2_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) CO2 Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! 24Oct2005 Bian tag CO2 to 4 regions +! (total, north america, south america, africa) +! 19Dec2005 da Silva Activated 3D diags for output +! 26Nov2010 Nielsen Simplified PBL partitioning for biomass burning emissions +! +!EOP +!------------------------------------------------------------------------- + + type CO2_GridComp + character(len=255) :: name + + real :: BBconFac ! conversion factor of BB emissions to C + real :: FFconFac ! conversion factor of FF emissions to C + real :: BioDrawDownFactor ! Biosphere drawdown factor + + real, pointer :: eCO2_FF(:,:) ! kgC/m2/s, Earth surface + real, pointer :: eCO2_NEP(:,:) ! kgC/m2/s, Earth surface + real, pointer :: eCO2_OCN(:,:) ! kgC/m2/s, Earth surface + real, pointer :: eCO2_BB_(:,:) ! kgC/m2/s, PBL (before diurnal) + real, pointer :: eCO2_BB(:,:) ! kgC/m2/s, PBL + real, pointer :: regionMask(:,:) ! regional mask + real, pointer :: SST(:,:) ! SST, C, for CMS ocean flux calc + real, pointer :: SSS(:,:) ! Salinty, PSU, for CMS ocean flux calc + real, pointer :: pco2(:,:) ! Ocean pCO2, for CMS ocean flux calc + real, pointer :: pice(:,:) ! % grid covered by ice, for CMS ocean flux calc + integer, pointer :: regionIndex(:) ! desired regions from mask + + logical :: DBG ! Run-time debug switch + logical :: CMS_EMIS ! Run-time switch to use CMS emissions + logical :: OCN_FLUX_CALC ! Method of ocean flux calculation from input file name + end type CO2_GridComp + + real, parameter :: radToDeg = 57.2957795 + + real, parameter :: mwtCO2 = 44.00 + real, parameter :: mwtC = 12.00 + +CONTAINS + + subroutine CO2_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: rcbasen = 'CO2_GridComp' + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: ier,doingCMS,ocnFlux + + type(ESMF_Config) :: cfg + + Iam = "CO2_GridCompSetServices" + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(rc=status) + VERIFY_(STATUS) + call ESMF_ConfigLoadFile(cfg,TRIM(rcbasen)//'.rc',rc=status) + VERIFY_(STATUS) + + call ESMF_ConfigGetAttribute(cfg, value=doingCMS, label='CMS_EMIS:', rc=status) + VERIFY_(STATUS) + call ESMF_ConfigGetAttribute(cfg, value=ocnFlux, label='OCN_FLUX_CALC:', default= 0, rc=status) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_regionMask', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + if (doingCMS == 0) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_BIOMASS', & + LONG_NAME = 'source species' , & + UNITS = 'kg CO2 m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_FF', & + LONG_NAME = 'source species' , & + UNITS = 'kg C m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_NEP', & + LONG_NAME = 'source species' , & + UNITS = 'kg C m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_OCN', & + LONG_NAME = 'source species' , & + UNITS = 'kg C m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + else + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_CMS_BIOMASS', & + LONG_NAME = 'source species' , & + UNITS = 'kg C m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_CMS_FF', & + LONG_NAME = 'source species' , & + UNITS = 'kg C m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_CMS_NEP', & + LONG_NAME = 'source species' , & + UNITS = 'kg C m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + if (ocnFlux /=0) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_CMS_T', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_CMS_S', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_CMS_PICE', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_CMS_PCO2', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + else + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO2_CMS_OCN', & + LONG_NAME = 'source species' , & + UNITS = 'kg C m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + end if + end if + + RETURN_(ESMF_SUCCESS) + + end subroutine CO2_GridCompSetServices + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CO2_GridCompInitialize --- Initialize CO2_GridComp +! +! !INTERFACE: +! + + subroutine CO2_GridCompInitialize ( gcCO2, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(CO2_GridComp), intent(inout) :: gcCO2 ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the CO2 Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 24OCT2005 Bian Mods for 5 tagged CO2 +! (total, fossil fuel, ecosystem, oceanic, and biomass) +! 25OCT2005 Bian Mods for 5 regions +! 01SEP2015 Weir Added dry-air mole fraction export + +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'CO2_GridCompInitialize' + + + character(len=255) :: rcfilen = 'CO2_GridComp.rc' + integer :: ios, n + integer, allocatable :: ier(:) + integer :: i1, i2, im, j1, j2, jm, km, ijl + integer :: nbins, nbeg, nend, nbins_rc, nymd1, nhms1 + integer :: nTimes, begTime, incSecs + real :: qmin, qmax + REAL :: c1,c2,c3,c4 + + gcCO2%name = 'CO2 Constituent Package' + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + km = w_c%grid%km + nbins = w_c%reg%n_CO2; nbeg = w_c%reg%i_CO2; nend = w_c%reg%j_CO2 + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + + call init_() + if ( rc /= 0 ) return + + ier(:) =0 + +! ------------------- +! Parse resource file +! ------------------- + +! Load resource file +! ------------------ + call i90_loadf ( TRIM(rcfilen), ier(1) ) + if ( ier(1) .ne. 0 ) then + call final_(10) + return + end if + ier(:)=0 + + call i90_label ( 'number_CO2_bins:', ier(1) ) + nbins_rc = i90_gint ( ier(2) ) + if ( nbins_rc /= nbins ) then + call final_(11) + return + end if + +! Run-time switch to use CMS emissions +! ------------------------------------ + CALL I90_label ( 'CMS_EMIS:', ier(3) ) + n = I90_gint ( ier(4) ) + IF(n /= 0) THEN + gcCO2%CMS_EMIS = .TRUE. + if ( MAPL_AM_I_ROOT() ) then + print *, 'CO2_GridComp: Reading C M S Emissions' + end if + ELSE + gcCO2%CMS_EMIS = .FALSE. + if ( MAPL_AM_I_ROOT() ) then + print *, 'CO2_GridComp: Reading CLIMATOLOGICAL Emissions' + end if + END IF + + IF (gcCO2%CMS_EMIS) THEN + CALL I90_label ( 'CMS_biomass_emission_factor:', ier(5) ) + gcCO2%BBconFac = i90_gfloat ( ier(6) ) + + CALL I90_label ( 'CMS_fossilfuel_emissions_factor:', ier(7) ) + gcCO2%FFconFac = i90_gfloat ( ier(8) ) + ELSE + CALL I90_label ( 'CO2_biomass_emission_factor:', ier(5) ) + gcCO2%BBconFac = i90_gfloat ( ier(6) ) + + CALL I90_label ( 'CO2_fossilfuel_emissions_factor:', ier(7) ) + gcCO2%FFconFac = i90_gfloat ( ier(8) ) + END IF + +! Biosphere drawdown factor, used for adjusting biosphere drawdown. +! Valid range: >0. If < 1, reduces sink. If = 1, neutral. If > 1, enhances sink. +! --------------------------------------------------------------------------------- + gcCO2%BioDrawDownFactor = -1.00 + CALL I90_label ( 'Biosphere_drawdown_factor:', ier(9) ) + gcCO2%BioDrawDownFactor = I90_gfloat ( ier(10) ) + IF(gcCO2%BioDrawDownFactor < 0.00) THEN + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,TRIM(myname)//": Invalid biosphere drawdown factor." + END IF + CALL final_(12) + RETURN + END IF + + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,TRIM(myname)//": " + PRINT *," Biomass emission factor: ", gcCO2%BBconFac + PRINT *," Fossil fuel emission factor: ", gcCO2%FFconFac + PRINT *," Biosphere drawdown factor: ", gcCO2%BioDrawDownFactor + END IF + +! Run-time debug switch +! --------------------- + CALL I90_label ( 'DEBUG:', ier(11) ) + n = I90_gint ( ier(12) ) + IF(n /= 0) THEN + gcCO2%DBG = .TRUE. + ELSE + gcCO2%DBG = .FALSE. + END IF + +! Get the desired regions to run on +! --------------------------------- + call i90_label ( 'CO2_regions_indices:', ier(13) ) + do n = 1, nbins + gcCO2%regionIndex(n) = i90_gint ( ier(13+n) ) + end do + + IF( ANY( ier(:) /= 0 ) ) THEN + CALL final_(13) + RETURN + END IF + ier(:)=0 + + call I90_label ( 'OCN_FLUX_CALC:' , ier(1)) + if (ier(1) == 0) then + n = I90_gint( ier(2) ) + else + n =0 + end if + if(n /= 0) then + gcCO2%OCN_FLUX_CALC=.true. + else + gcCO2%OCN_FLUX_CALC=.false. + end if + +! Get Henrys Law cts for the parameterized convective wet removal +! ----------------------------------------------------------- + CALL get_HenrysLawCts('CO2',c1,c2,c3,c4) + w_c%reg%Hcts(1,w_c%reg%i_CO2 : w_c%reg%j_CO2)=c1 + w_c%reg%Hcts(2,w_c%reg%i_CO2 : w_c%reg%j_CO2)=c2 + w_c%reg%Hcts(3,w_c%reg%i_CO2 : w_c%reg%j_CO2)=c3 + w_c%reg%Hcts(4,w_c%reg%i_CO2 : w_c%reg%j_CO2)=c4 + + DEALLOCATE(ier) + + return + +CONTAINS + + subroutine init_() + integer ios, nerr + nerr = max ( 100, nbins+27 ) + allocate ( gcCO2%eCO2_FF(i1:i2,j1:j2), & + gcCO2%eCO2_NEP(i1:i2,j1:j2), & + gcCO2%eCO2_OCN(i1:i2,j1:j2), & + gcCO2%eCO2_BB(i1:i2,j1:j2), & + gcCO2%eCO2_BB_(i1:i2,j1:j2), & + gcCO2%regionMask(i1:i2,j1:j2), & + gcCO2%regionIndex(nbins), & + gcCO2%SST(i1:i2,j1:j2), & + gcCO2%SSS(i1:i2,j1:j2), & + gcCO2%pCO2(i1:i2,j1:j2), & + gcCO2%pice(i1:i2,j1:j2), & + ier(nerr), stat=ios ) + + if ( ios /= 0 ) rc = 100 + end subroutine init_ + + subroutine final_(ierr) + integer :: ierr + integer ios + deallocate ( gcCO2%eCO2_FF, gcCO2%eCO2_NEP, gcCO2%eCO2_OCN, & + gcCO2%eCO2_BB, gcCO2%regionMask, gcCO2%regionIndex, & + gcCO2%eCO2_BB_, gcCO2%SST, gcCO2%SSS, gcCO2%pCO2, & + gcCO2%pice, ier, stat=ios ) + call i90_release() + rc = ierr + end subroutine final_ + + end subroutine CO2_GridCompInitialize + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CO2_GridCompRun --- The Chem Driver +! +! !INTERFACE: +! + + subroutine CO2_GridCompRun ( gcCO2, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(CO2_GridComp), intent(inout) :: gcCO2 ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called CO2 Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 24OCT2005 Bian Mods for 5 tagged CO2 +! (total, fossil fuel, ecosystem, oceanic, and biomass) +! 25OCT2005 Bian Mods for 5 regions +! 29SEP2017 Weir Lots of zero diff (hopefully) changes to make +! understandable + +! Mask Region +! ---- ------------- +! 1 North America +! 2 Mexico +! 3 Europe +! 4 Asia +! 5 Africa +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'CO2_GridCompRun' + character(len=*), parameter :: Iam = myname + +! Input fields from fvGCM +! ----------------------- + REAL, POINTER, DIMENSION(:,:) :: pblh => null() + REAL, POINTER, DIMENSION(:,:) :: ps => null() + REAL, POINTER, DIMENSION(:,:) :: v10m => null() + REAL, POINTER, DIMENSION(:,:) :: u10m => null() + REAL, POINTER, DIMENSION(:,:,:) :: T => null() + REAL, POINTER, DIMENSION(:,:,:) :: zle => null() + REAL, POINTER, DIMENSION(:,:,:) :: q => null() + REAL, POINTER, DIMENSION(:,:,:) :: qctot => null() + REAL, POINTER, DIMENSION(:,:,:) :: qtot => null() + + integer :: i1, i2, im, j1, j2, jm, km, idiag, ios, ijl + integer :: i, j, k, n, nbins, nbeg, nend + INTEGER :: nymd1, nhms1, ier(9) + + REAL :: qmin, qmax, c2co2 + + REAL, POINTER, DIMENSION(:,:) :: ptr2d => null() + REAL, POINTER, DIMENSION(:,:,:) :: ptr3d => null() + +#define EXPORT expChem + +#define ptrCO2EM CO2_emis +#define ptrCO2CL CO2_column +#define ptrCO2SC CO2_surface +#define ptrCO2DRY CO2_dry + + integer :: STATUS + +#include "CO2_GetPointer___.h" + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + km = w_c%grid%km + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + +! Retreive mask +! ------------- + call MAPL_GetPointer(impChem,ptr2d,'CO2_regionMask',rc=status) + VERIFY_(STATUS) + gcCO2%regionMask=ptr2d + + nbins = w_c%reg%n_CO2; nbeg = w_c%reg%i_CO2; nend = w_c%reg%j_CO2 + + c2co2 = mwtCO2 / mwtC + + if ( any((/NBIN_CO2CL,NBIN_CO2SC/)/=NBIN_CO2EM)) then + call die(myname,'all emissions in registry must have same number of bins') + endif + if ( nbins > NBIN_CO2EM ) then + call die(myname,'nbins in chem registry must be <= those in component registry') + end if + +! Read climatological emissions, if specified +! ------------------------------------------- + IF ( .NOT. gcCO2%CMS_EMIS ) THEN + +! Biomass burning +! --------------- + call MAPL_GetPointer(impChem, ptr2d, 'CO2_BIOMASS',rc=status) + VERIFY_(STATUS) + gcCO2%eCO2_BB = ptr2d + +! Fossil fuel emissions +! --------------------- + call MAPL_GetPointer(impChem, ptr2d, 'CO2_FF',rc=status) + VERIFY_(STATUS) + gcCO2%eCO2_FF = ptr2d + +! Biosphere flux +! -------------- + call MAPL_GetPointer(impChem, ptr2d, 'CO2_NEP',rc=status) + VERIFY_(STATUS) + gcCO2%eCO2_NEP = ptr2d + +! Ocean flux +! ---------- + call MAPL_GetPointer(impChem, ptr2d, 'CO2_OCN',rc=status) + VERIFY_(STATUS) + gcCO2%eCO2_OCN = ptr2d + +! Bian says that we need to adjust the uptake flux of CO2 in the +! ecosystem database to reflect the emissions from biomass burning. +! In principle this adds a factor that needs to be balanced on an +! interannual basis. For year 2000 TRMM (GFED v 1.2) emissions this +! factor is 1.2448 +! ------------------------------------------------------------------ + WHERE(gcCO2%eCO2_NEP(i1:i2,j1:j2) .le. 0.0) & + gcCO2%eCO2_NEP(i1:i2,j1:j2) = gcCO2%eCO2_NEP(i1:i2,j1:j2)*gcCO2%BioDrawDownFactor + + ELSE ! TYPE OF EMISS IS CMS + + call MAPL_GetPointer(impChem, ptr2d, 'CO2_CMS_BIOMASS',rc=status) + VERIFY_(STATUS) + gcCO2%eCO2_BB = ptr2d + + call MAPL_GetPointer(impChem, ptr2d, 'CO2_CMS_FF',rc=status) + VERIFY_(STATUS) + gcCO2%eCO2_FF = ptr2d + + call MAPL_GetPointer(impChem, ptr2d, 'CO2_CMS_NEP',rc=status) + VERIFY_(STATUS) + gcCO2%eCO2_NEP = ptr2d + + IF( gcCO2%OCN_FLUX_CALC ) THEN + call MAPL_GetPointer(impChem, ptr2d, 'CO2_CMS_T',rc=status) + VERIFY_(STATUS) + gcCO2%sst = ptr2d + call MAPL_GetPointer(impChem, ptr2d, 'CO2_CMS_S',rc=status) + VERIFY_(STATUS) + gcCO2%sss = ptr2d + call MAPL_GetPointer(impChem, ptr2d, 'CO2_CMS_PICE',rc=status) + VERIFY_(STATUS) + gcCO2%pice = ptr2d + call MAPL_GetPointer(impChem, ptr2d, 'CO2_CMS_PCO2',rc=status) + VERIFY_(STATUS) + gcCO2%pco2 = ptr2d + else + call MAPL_GetPointer(impChem, ptr2d, 'CO2_CMS_OCN',rc=status) + VERIFY_(STATUS) + gcCO2%eCO2_OCN = ptr2d + end if + + END IF ! type of emiss + +! Apply conversion factors +! ------------------------ + gcCO2%eCO2_BB(i1:i2,j1:j2) = gcCO2%eCO2_BB(i1:i2,j1:j2) * gcCO2%BBconFac + gcCO2%eCO2_FF(i1:i2,j1:j2) = gcCO2%eCO2_FF(i1:i2,j1:j2) * gcCO2%FFconFac + +! Units for surface flux must be kgCO2 m^-2 s^-1 +! ---------------------------------------------- + gcCO2%eCO2_NEP(i1:i2,j1:j2) = gcCO2%eCO2_NEP(i1:i2,j1:j2) * c2co2 + gcCO2%eCO2_OCN(i1:i2,j1:j2) = gcCO2%eCO2_OCN(i1:i2,j1:j2) * c2co2 + gcCO2%eCO2_FF(i1:i2,j1:j2) = gcCO2%eCO2_FF(i1:i2,j1:j2) * c2co2 +! Mimicking original code: only convert biomass burning for CMS emissions case + IF ( gcCO2%CMS_EMIS ) THEN + gcCO2%eCO2_BB(i1:i2,j1:j2) = gcCO2%eCO2_BB(i1:i2,j1:j2) * c2co2 + END IF + +! Apply diurnal cycle if so desired +! --------------------------------- + if ( w_c%diurnal_bb ) then + gcCO2%eCO2_BB_(:,:) = gcCO2%eCO2_BB(:,:) + + call Chem_BiomassDiurnal ( gcCO2%eCO2_BB, gcCO2%eCO2_BB_, & + w_c%grid%lon(:,:)*radToDeg, & + w_c%grid%lat(:,:)*radToDeg, nhms, cdt ) + end if + +! Get imports +! ----------- + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', rc=ier(1) ) + call MAPL_GetPointer ( impChem, T, 'T', rc=ier(2) ) + call MAPL_GetPointer ( impChem, zle, 'ZLE', rc=ier(4) ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', rc=ier(5) ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', rc=ier(6) ) + call MAPL_GetPointer ( impChem, ps, 'PS', rc=ier(7) ) + call MAPL_GetPointer ( impChem, q, 'Q', rc=ier(8) ) + call MAPL_GetPointer ( impChem, qctot,'QCTOT', rc=ier(9) ) + + IF(gcCO2%DBG) THEN + CALL pmaxmin('CO2: e_ff', gcCO2%eCO2_FF, qmin, qmax, ijl, 1, 1. ) + CALL pmaxmin('CO2: e_nep', gcCO2%eCO2_NEP, qmin, qmax, ijl, 1, 1. ) + CALL pmaxmin('CO2: e_ocn', gcCO2%eCO2_OCN, qmin, qmax, ijl, 1, 1. ) + CALL pmaxmin('CO2: e_bb', gcCO2%eCO2_BB, qmin, qmax, ijl, 1, 1. ) + + CALL pmaxmin('CO2: pblh', pblh, qmin, qmax, ijl, 1, 1. ) + CALL pmaxmin('CO2: ps', ps, qmin, qmax, ijl, 1, 1. ) + CALL pmaxmin('CO2: u10m', u10m, qmin, qmax, ijl, 1, 1. ) + CALL pmaxmin('CO2: v10m', v10m, qmin, qmax, ijl, 1, 1. ) + CALL pmaxmin('CO2: T', T, qmin, qmax, ijl, km, 1. ) + CALL pmaxmin('CO2: zle', zle, qmin, qmax, ijl, km+1, 1. ) + CALL pmaxmin('CO2: q', q, qmin, qmax, ijl, km, 1. ) + CALL pmaxmin('CO2: qc', qctot,qmin, qmax, ijl, km, 1. ) + END IF + +! CO2 Emissions +! ------------- + CALL CO2_Emission(rc) + + +! Fill the export states +! ---------------------- +! Surface concentration in ppmv + do n = 1, nbins + if(associated(CO2_surface(n)%data2d)) & + CO2_surface(n)%data2d(i1:i2,j1:j2) = w_c%qa(nbeg+n-1)%data3d(i1:i2,j1:j2,km)*1.e6 + enddo + +! Column burden in kg m-2 +! ----------------------- + do n = 1, nbins + if(associated(CO2_column(n)%data2d)) then + CO2_column(n)%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + CO2_column(n)%data2d(i1:i2,j1:j2) & + = CO2_column(n)%data2d(i1:i2,j1:j2) & + + w_c%qa(nbeg+n-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k) + enddo + CO2_column(n)%data2d(i1:i2,j1:j2)=CO2_column(n)%data2d(i1:i2,j1:j2)/(ps(i1:i2,j1:j2)-w_c%grid%ptop) + endif + enddo + +! Dry-air molar mixing ratio +! -------------------------- + ALLOCATE(qtot(i1:i2,j1:j2,1:km),STAT=ios) + qtot(i1:i2,j1:j2,1:km) = q(i1:i2,j1:j2,1:km)+qctot(i1:i2,j1:j2,1:km) + do n = 1, nbins + if(associated(CO2_dry(n)%data3d)) then + CO2_dry(n)%data3d(i1:i2,j1:j2,1:km) = w_c%qa(nbeg+n-1)%data3d(i1:i2,j1:j2,1:km) / & + (1.0 - qtot(i1:i2,j1:j2,1:km)) + endif + enddo + DEALLOCATE(qtot,STAT=ios) + +! Fill the export state with current mixing ratios +! ------------------------------------------------ + if(associated(CO2%data3d)) & + CO2%data3d(i1:i2,j1:j2,1:km) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km) + if(associated(CO2NAMER%data3d)) & + CO2NAMER%data3d(i1:i2,j1:j2,1:km) = w_c%qa(nbeg+1)%data3d(i1:i2,j1:j2,1:km) + if(associated(CO2SAMER%data3d)) & + CO2SAMER%data3d(i1:i2,j1:j2,1:km) = w_c%qa(nbeg+2)%data3d(i1:i2,j1:j2,1:km) + if(associated(CO2AFRIC%data3d)) & + CO2AFRIC%data3d(i1:i2,j1:j2,1:km) = w_c%qa(nbeg+3)%data3d(i1:i2,j1:j2,1:km) + + return + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! !IROUTINE: CO2_Emission - Adds emissions for CO2 for one timestep +! We have emissions from 4 sources, which are distributed +! differently in the vertical +! 1) fossil fuel - emitted at surface +! 2) ecosystem - fluxes at surface +! 3) oceanic - fluxes at surface +! 4) biomass burning - uniformly mixed in PBL +! +! !DESCRIPTION: Updates the CO2 concentration with emissions every timestep +! +! !REVISION HISTORY: +! +! 24Oct2005, Bian +! 26Nov2010, Nielsen Simplified PBL partitioning for biomass burning emissions +! +! !INTERFACE: +! +!EOP +!------------------------------------------------------------------------- + SUBROUTINE CO2_Emission ( rc ) +!------------------------------------------------------------------------- + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! !OUTPUT PARAMETERS: + + INTEGER, INTENT(OUT) :: rc ! Error return code + +! !LOCAL VARIABLES + + CHARACTER(LEN=*), PARAMETER :: myname = 'CO2_Emission' + + INTEGER :: i, j, k, kt, minkPBL + INTEGER, ALLOCATABLE :: index(:) + + REAL, ALLOCATABLE :: pblLayer(:,:),sfcFlux(:,:),myMask(:,:) + REAL, ALLOCATABLE :: fPBL(:,:,:) + + real :: scco2, scco2arg,wssq,rkwco2,tk,tk100,tk1002,ff + real :: ffuatm,xco2,deltco2,wspd,flxmolm2 + + rc = 0 + +! Grab some memory for manipulating emissions, ... +! ------------------------------------------------ + ALLOCATE(sfcFlux(i1:i2,j1:j2),STAT=ios) + +! ... for the partitioning of BB, ... +! ----------------------------------- + ALLOCATE(fPBL(i1:i2,j1:j2,1:km),STAT=ios) + fPBL(i1:i2,j1:j2,1:km)=0.00 + +! ... and for local copy of the region mask. +! ------------------------------------------ + ALLOCATE(myMask(i1:i2,j1:j2),STAT=ios) + +! Find the layer that contains the PBL. +! Layer thicknesses are ZLE(:,:,0:km). +! ------------------------------------- + ALLOCATE(index(0:km),STAT=ios) + ALLOCATE(pblLayer(i1:i2,j1:j2),STAT=ios) + DO j=j1,j2 + DO i=i1,i2 + index(0:km)=0 + WHERE(zle(i,j,0:km)-zle(i,j,km) > pblh(i,j)) index(0:km)=1 + pblLayer(i,j)=SUM(index) + END DO + END DO + minkPBL=MINVAL(pblLayer) + +! Determine partitioning fraction based on layer thicknesses +! ---------------------------------------------------------- + DO j=j1,j2 + DO i=i1,i2 + kt=pblLayer(i,j) + DO k=kt,km + fPBL(i,j,k)=(zle(i,j,k-1)-zle(i,j,k))/(zle(i,j,kt-1)-zle(i,j,km)) + END DO + END DO + END DO + +! Calculate NOBM fluxes using archived ocean fields. +! -------------------------------------------------- + IF (gcCO2%OCN_FLUX_CALC ) then + if ( gcCO2%sst(i,j) .lt. 1000.) THEN + scco2 = 2073.1 - 125.62*gcCO2%sst(i,j) + 3.6276*gcCO2%sst(i,j)**2. - & + 0.043219*gcCO2%sst(i,j)**3. + scco2arg = (scco2/660.0)**(-0.5) + wspd = (u10m(i,j)**2 + v10m(i,j)**2)**0.5 + wssq = wspd*wspd + rkwco2 = wssq*scco2arg*0.337/(3.6E5) + tk = gcCO2%sst(i,j) + 273.15 + tk100 = tk*0.01 + tk1002 = tk100*tk100 + ff = exp(-162.8301 + 218.2968/tk100 + & + 90.9241*log(tk100) - 1.47696*tk1002 + & + gcCO2%sss(i,j) * (.025695 - .025225*tk100 + & + 0.0049867*tk1002)) + ffuatm = ff*1.0E-6 + xco2 = w_c%qa(nbeg)%data3d(i,j,km)*ps(i,j)*1.0E4/1013.25 + deltco2 = (xco2-gcCO2%pco2(i,j))*ffuatm*1024.5 ! mol/m3 + flxmolm2 = rkwco2*deltco2 ! units of mol/m2/s + gcCO2%eCO2_OCN(i,j) = -flxmolm2*mwtC*1E-3*(100.-gcCO2%pice(i,j))/100. + ELSE ! SST must be undef + gcCO2%eCO2_OCN(i,j) = 0. + END IF + END IF + +! Release memory +! -------------- + DEALLOCATE(index,STAT=ios) + DEALLOCATE(pblLayer,STAT=ios) + +! For each CO2 bin ... +! -------------------- + CO2_Bin: DO n=1,nbins + +! Finalize the mask. Update CO2 globally if the region index is -1. +! Otherwise update only where the mask's value is the region index. +! ----------------------------------------------------------------- + IF(gcCO2%regionIndex(n) == -1) THEN + myMask(i1:i2,j1:j2)=gcCO2%regionIndex(n) + ELSE + myMask(i1:i2,j1:j2)=gcCO2%regionMask(i1:i2,j1:j2) + END IF + +! Establish range of layers on which to work +! ------------------------------------------ + kt=minkPBL + +! For each layer ... +! -------------------- + Layer: DO k=kt,km + +! Emissions: Weighted biomass burning if active +! --------------------------------------------- + sfcFlux(i1:i2,j1:j2)=gcCO2%eCO2_BB(i1:i2,j1:j2)*fPBL(i1:i2,j1:j2,k) + +! Add Fossil fuel, net ecosystem production, and ocean source when in surface layer +! --------------------------------------------------------------------------------- + IF(k == km) sfcFlux(i1:i2,j1:j2)= sfcFlux(i1:i2,j1:j2)+ & + gcCO2%eCO2_FF(i1:i2,j1:j2)+ & + gcCO2%eCO2_NEP(i1:i2,j1:j2)+ & + gcCO2%eCO2_OCN(i1:i2,j1:j2) + +! Update CO2 for this bin +! ----------------------- + WHERE(myMask(i1:i2,j1:j2) == gcCO2%regionIndex(n)) & + w_c%qa(nbeg+n-1)%data3d(i1:i2,j1:j2,k) = w_c%qa(nbeg+n-1)%data3d(i1:i2,j1:j2,k)+ & + cdt*sfcFlux(i1:i2,j1:j2)* & + (MAPL_AIRMW/mwtCO2)/(w_c%delp(i1:i2,j1:j2,k)/MAPL_GRAV) +! Next layer +! ---------- + END DO Layer + +! Update Surface flux diagnostic for this bin +! ------------------------------------------- + IF(ASSOCIATED(CO2_emis(n)%data2d)) THEN + CO2_emis(n)%data2d(i1:i2,j1:j2)=0.00 + + sfcFlux(i1:i2,j1:j2)=gcCO2%eCO2_FF(i1:i2,j1:j2) + gcCO2%eCO2_NEP(i1:i2,j1:j2) + & + gcCO2%eCO2_OCN(i1:i2,j1:j2) + gcCO2%eCO2_BB(i1:i2,j1:j2) + + WHERE(myMask(i1:i2,j1:j2) == gcCO2%regionIndex(n)) & + CO2_emis(n)%data2d(i1:i2,j1:j2)=sfcFlux(i1:i2,j1:j2) + END IF + +! Next bin +! -------- + END DO CO2_Bin + +! Release memory +! -------------- + DEALLOCATE(fPBL,STAT=ios) + DEALLOCATE(myMask,STAT=ios) + DEALLOCATE(sfcFlux,STAT=ios) + + RETURN + END SUBROUTINE CO2_Emission + + END SUBROUTINE CO2_GridCompRun + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CO2_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + subroutine CO2_GridCompFinalize ( gcCO2, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(CO2_GridComp), intent(inout) :: gcCO2 ! Grid Component + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Import State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'CO2_GridCompFinalize' + INTEGER :: ios + + DEALLOCATE ( gcCO2%eCO2_FF, gcCO2%eCO2_NEP, gcCO2%eCO2_OCN, & + gcCO2%eCO2_BB, gcCO2%regionMask, gcCO2%SST, & + gcCO2%SSS, gcCO2%pCO2, gcCO2%pice, STAT=ios ) + rc = 0 + IF ( ios /= 0 ) rc = 1 + + return + + end subroutine CO2_GridCompFinalize + + end module CO2_GridCompMod + diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridComp_ExtData.rc new file mode 100644 index 00000000..c1244ab9 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridComp_ExtData.rc @@ -0,0 +1,19 @@ +PrimaryExports%% +# A = Climatology? Y/N; B = Conservative regridding? Y/N +#---------------+-------------------+-+-+---------------------+--------+--------+------------------------------------ +# Export | | | |_______ Refresh _____|____ Factors ____|_______ External File __________ +# Name | Units |A|B| Time Template | Offset | Scale | Variable | Template +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- + CO2_BIOMASS 'kg CO2 m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/climatology/qfed2.emis_co2.005.x1152_y721_t12.2003_2012.2007.nc4 + CO2_FF 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_NEP 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_OCN 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + + CO2_CMS_BIOMASS 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/CMS/em.daily.1x1.25.%y4.nc + CO2_CMS_FF 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/CMS/ORNL_TRANSCOM.co2_ff_nep_ocn.x288_y181_t12.%y4.nc + CO2_CMS_NEP 'kg C m-2 s-1' N Y P0000-00-00T03:00 none none emco2nep ExtData/PIESA/sfc/CMS/casa.3hr.1x1.25.%y4.nc + CO2_CMS_OCN 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/CMS/NOBM_fco2.daily.1x1.25.%y4.nc + + CO2_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- +%% diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/CO2_Registry.rc b/ESMF/GOCART_GridComp/CO2_GridComp/CO2_Registry.rc new file mode 100644 index 00000000..5db5c3a1 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/CO2_Registry.rc @@ -0,0 +1,47 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: CO2 + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl| Sub | Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + CO2 | mol/mol | xyz | C | | | | | Carbon Dioxide + CO2NAMER | mol/mol | xyz | C | | | | | North American Carbon Dioxide + CO2SAMER | mol/mol | xyz | C | | | | | South American Carbon Dioxide + CO2AFRIC | mol/mol | xyz | C | | | | | African Carbon Dioxide +# .........|............|.....|...|....|...|...|.....|.................................. + CO2EM001 | kg m-2 s-1 | xy | | | | | | CO2 Emission Bin 001 + CO2EM002 | kg m-2 s-1 | xy | | | | | | CO2 Emission Bin 002 + CO2EM003 | kg m-2 s-1 | xy | | | | | | CO2 Emission Bin 003 + CO2EM004 | kg m-2 s-1 | xy | | | | | | CO2 Emission Bin 004 + CO2CL001 | 1 | xy | | | | | | CO2 Bulk Mixing Ratio (Column Mass/ps) Bin 001 + CO2CL002 | 1 | xy | | | | | | CO2 Bulk Mixing Ratio (Column Mass/ps) Bin 002 + CO2CL003 | 1 | xy | | | | | | CO2 Bulk Mixing Ratio (Column Mass/ps) Bin 003 + CO2CL004 | 1 | xy | | | | | | CO2 Bulk Mixing Ratio (Column Mass/ps) Bin 004 + CO2SC001 | 1e-6 | xy | | | | | | CO2 Surface Concentration Bin 001 + CO2SC002 | 1e-6 | xy | | | | | | CO2 Surface Concentration Bin 002 + CO2SC003 | 1e-6 | xy | | | | | | CO2 Surface Concentration Bin 003 + CO2SC004 | 1e-6 | xy | | | | | | CO2 Surface Concentration Bin 004 + CO2DRY001| mol/mol | xyz | C | | | | | Dry-air Molar Carbon Dioxide Bin 001 + CO2DRY002| mol/mol | xyz | C | | | | | Dry-air Molar Carbon Dioxide Bin 002 + CO2DRY003| mol/mol | xyz | C | | | | | Dry-air Molar Carbon Dioxide Bin 003 + CO2DRY004| mol/mol | xyz | C | | | | | Dry-air Molar Carbon Dioxide Bin 004 +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + + + diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/19600101-20000331/CO2_GridComp.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/19600101-20000331/CO2_GridComp.rc new file mode 100644 index 00000000..c91fb646 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/19600101-20000331/CO2_GridComp.rc @@ -0,0 +1,50 @@ +# +# Resource file for CO2 parameters. +# + +number_CO2_bins: 1 +CO2_regions_indices: -1 1 2 5 + +# Run year-specific CMS emissions (0 runs climatological monthly mean emissions, 1 runs CMS) +# ------------------------------------------------------------------------------------------ +CMS_EMIS: 0 + +# Biosphere drawdown enhancement factor used for climatological emissions. +# Range: < 0 invalid, < 1 reduce sink, 1 neutral, > 1 enhance sink. +# ------------------------------------------------------------------------ +Biosphere_drawdown_factor: 1.2448 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + + + +# Deprecated options +# ------------------ +# NOTES: 1) The filename variables are all unused because they are now read from +# CO2_GridComp_ExtData.rc. However, some versions of the CO2 GridComp require +# these fields to be present in this file and have a time wildcard (here, %y4). +# +# 2) The emissions factors are read and applied. However, scale factors can be +# specified in CO2_GridComp_ExtData.rc, so for clarity, we now apply them there. + +CO2_regions: name_set_in_extdata_rc + +CO2_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CO2_biomass_emission_factor: 1. + +CO2_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_fossilfuel_emissions_factor: 1. + +CO2_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_ocean_emissions_filename: name_set_in_extdata_rc_%y4 + +CMS_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CMS_biomass_emission_factor: 1. + +CMS_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_fossilfuel_emissions_factor: 1. + +CMS_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_ocean_emissions_filename: name_set_in_extdata_rc_%y4 diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/19600101-20000331/CO2_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/19600101-20000331/CO2_GridComp_ExtData.rc new file mode 100644 index 00000000..39314b70 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/19600101-20000331/CO2_GridComp_ExtData.rc @@ -0,0 +1,19 @@ +PrimaryExports%% +# A = Climatology? Y/N; B = Conservative regridding? Y/N +#---------------+-------------------+-+-+---------------------+--------+--------+------------------------------------ +# Export | | | |_______ Refresh _____|____ Factors ____|_______ External File __________ +# Name | Units |A|B| Time Template | Offset | Scale | Variable | Template +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- + CO2_BIOMASS 'kg CO2 m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_co2.x576_y361_t14.%y4.nc4 + CO2_FF 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none 0.27273 emco2ff ExtData/MERRA2/sfc/edgar-v42.emis_co2.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 + CO2_NEP 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_OCN 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + + CO2_CMS_BIOMASS 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none 0.27273 biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_co2.x576_y361_t14.%y4.nc4 + CO2_CMS_FF 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/MERRA2/sfc/EDGAR.emis_co2.x3600_y1800.t14.%y4.nc4 + CO2_CMS_NEP 'kg C m-2 s-1' N Y P0000-00-00T03:00 none none emco2nep ExtData/MERRA2/sfc/daily_CO2_bio/Y%y4/M%m2/CASA_CO2.3hr.NEE.x3600_y1800.t8.%y4%m2%d2.nc4 + CO2_CMS_OCN 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/CMS/NOBM_fco2.daily.1x1.25.%y4.nc + + CO2_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- +%% diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/20000401-present/CO2_GridComp.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/20000401-present/CO2_GridComp.rc new file mode 100644 index 00000000..104a5dea --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/20000401-present/CO2_GridComp.rc @@ -0,0 +1,50 @@ +# +# Resource file for CO2 parameters. +# + +number_CO2_bins: 1 +CO2_regions_indices: -1 1 2 5 + +# Run year-specific CMS emissions (0 runs climatological monthly mean emissions, 1 runs CMS) +# ------------------------------------------------------------------------------------------ +CMS_EMIS: 1 + +# Biosphere drawdown enhancement factor used for climatological emissions. +# Range: < 0 invalid, < 1 reduce sink, 1 neutral, > 1 enhance sink. +# ------------------------------------------------------------------------ +Biosphere_drawdown_factor: 1.2448 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + + + +# Deprecated options +# ------------------ +# NOTES: 1) The filename variables are all unused because they are now read from +# CO2_GridComp_ExtData.rc. However, some versions of the CO2 GridComp require +# these fields to be present in this file and have a time wildcard (here, %y4). +# +# 2) The emissions factors are read and applied. However, scale factors can be +# specified in CO2_GridComp_ExtData.rc, so for clarity, we now apply them there. + +CO2_regions: name_set_in_extdata_rc + +CO2_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CO2_biomass_emission_factor: 1. + +CO2_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_fossilfuel_emissions_factor: 1. + +CO2_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_ocean_emissions_filename: name_set_in_extdata_rc_%y4 + +CMS_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CMS_biomass_emission_factor: 1. + +CMS_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_fossilfuel_emissions_factor: 1. + +CMS_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_ocean_emissions_filename: name_set_in_extdata_rc_%y4 diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/20000401-present/CO2_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/20000401-present/CO2_GridComp_ExtData.rc new file mode 100644 index 00000000..604bb5c3 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/20000401-present/CO2_GridComp_ExtData.rc @@ -0,0 +1,19 @@ +PrimaryExports%% +# A = Climatology? Y/N; B = Conservative regridding? Y/N +#---------------+-------------------+-+-+---------------------+--------+--------+------------------------------------ +# Export | | | |_______ Refresh _____|____ Factors ____|_______ External File __________ +# Name | Units |A|B| Time Template | Offset | Scale | Variable | Template +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- + CO2_BIOMASS 'kg CO2 m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 + CO2_FF 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none 0.27273 emco2ff ExtData/MERRA2/sfc/edgar-v42.emis_co2.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 + CO2_NEP 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_OCN 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + + CO2_CMS_BIOMASS 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none 0.27273 biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 + CO2_CMS_FF 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/MERRA2/sfc/EDGAR.emis_co2.x3600_y1800.t14.%y4.nc4 + CO2_CMS_NEP 'kg C m-2 s-1' N Y P0000-00-00T03:00 none none emco2nep ExtData/MERRA2/sfc/daily_CO2_bio/Y%y4/M%m2/CASA_CO2.3hr.NEE.x3600_y1800.t8.%y4%m2%d2.nc4 + CO2_CMS_OCN 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/CMS/NOBM_fco2.daily.1x1.25.%y4.nc + + CO2_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- +%% diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/CO2_GridComp.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/CO2_GridComp.rc new file mode 100644 index 00000000..104a5dea --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/CO2_GridComp.rc @@ -0,0 +1,50 @@ +# +# Resource file for CO2 parameters. +# + +number_CO2_bins: 1 +CO2_regions_indices: -1 1 2 5 + +# Run year-specific CMS emissions (0 runs climatological monthly mean emissions, 1 runs CMS) +# ------------------------------------------------------------------------------------------ +CMS_EMIS: 1 + +# Biosphere drawdown enhancement factor used for climatological emissions. +# Range: < 0 invalid, < 1 reduce sink, 1 neutral, > 1 enhance sink. +# ------------------------------------------------------------------------ +Biosphere_drawdown_factor: 1.2448 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + + + +# Deprecated options +# ------------------ +# NOTES: 1) The filename variables are all unused because they are now read from +# CO2_GridComp_ExtData.rc. However, some versions of the CO2 GridComp require +# these fields to be present in this file and have a time wildcard (here, %y4). +# +# 2) The emissions factors are read and applied. However, scale factors can be +# specified in CO2_GridComp_ExtData.rc, so for clarity, we now apply them there. + +CO2_regions: name_set_in_extdata_rc + +CO2_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CO2_biomass_emission_factor: 1. + +CO2_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_fossilfuel_emissions_factor: 1. + +CO2_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_ocean_emissions_filename: name_set_in_extdata_rc_%y4 + +CMS_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CMS_biomass_emission_factor: 1. + +CMS_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_fossilfuel_emissions_factor: 1. + +CMS_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_ocean_emissions_filename: name_set_in_extdata_rc_%y4 diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/CO2_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/CO2_GridComp_ExtData.rc new file mode 100644 index 00000000..604bb5c3 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2-DD/CO2_GridComp_ExtData.rc @@ -0,0 +1,19 @@ +PrimaryExports%% +# A = Climatology? Y/N; B = Conservative regridding? Y/N +#---------------+-------------------+-+-+---------------------+--------+--------+------------------------------------ +# Export | | | |_______ Refresh _____|____ Factors ____|_______ External File __________ +# Name | Units |A|B| Time Template | Offset | Scale | Variable | Template +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- + CO2_BIOMASS 'kg CO2 m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 + CO2_FF 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none 0.27273 emco2ff ExtData/MERRA2/sfc/edgar-v42.emis_co2.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 + CO2_NEP 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_OCN 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + + CO2_CMS_BIOMASS 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none 0.27273 biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 + CO2_CMS_FF 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/MERRA2/sfc/EDGAR.emis_co2.x3600_y1800.t14.%y4.nc4 + CO2_CMS_NEP 'kg C m-2 s-1' N Y P0000-00-00T03:00 none none emco2nep ExtData/MERRA2/sfc/daily_CO2_bio/Y%y4/M%m2/CASA_CO2.3hr.NEE.x3600_y1800.t8.%y4%m2%d2.nc4 + CO2_CMS_OCN 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/CMS/NOBM_fco2.daily.1x1.25.%y4.nc + + CO2_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- +%% diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/19600101-20000331/CO2_GridComp.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/19600101-20000331/CO2_GridComp.rc new file mode 100644 index 00000000..c91fb646 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/19600101-20000331/CO2_GridComp.rc @@ -0,0 +1,50 @@ +# +# Resource file for CO2 parameters. +# + +number_CO2_bins: 1 +CO2_regions_indices: -1 1 2 5 + +# Run year-specific CMS emissions (0 runs climatological monthly mean emissions, 1 runs CMS) +# ------------------------------------------------------------------------------------------ +CMS_EMIS: 0 + +# Biosphere drawdown enhancement factor used for climatological emissions. +# Range: < 0 invalid, < 1 reduce sink, 1 neutral, > 1 enhance sink. +# ------------------------------------------------------------------------ +Biosphere_drawdown_factor: 1.2448 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + + + +# Deprecated options +# ------------------ +# NOTES: 1) The filename variables are all unused because they are now read from +# CO2_GridComp_ExtData.rc. However, some versions of the CO2 GridComp require +# these fields to be present in this file and have a time wildcard (here, %y4). +# +# 2) The emissions factors are read and applied. However, scale factors can be +# specified in CO2_GridComp_ExtData.rc, so for clarity, we now apply them there. + +CO2_regions: name_set_in_extdata_rc + +CO2_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CO2_biomass_emission_factor: 1. + +CO2_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_fossilfuel_emissions_factor: 1. + +CO2_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_ocean_emissions_filename: name_set_in_extdata_rc_%y4 + +CMS_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CMS_biomass_emission_factor: 1. + +CMS_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_fossilfuel_emissions_factor: 1. + +CMS_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_ocean_emissions_filename: name_set_in_extdata_rc_%y4 diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/19600101-20000331/CO2_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/19600101-20000331/CO2_GridComp_ExtData.rc new file mode 100644 index 00000000..ec3953b6 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/19600101-20000331/CO2_GridComp_ExtData.rc @@ -0,0 +1,19 @@ +PrimaryExports%% +# A = Climatology? Y/N; B = Conservative regridding? Y/N +#---------------+-------------------+-+-+---------------------+--------+--------+------------------------------------ +# Export | | | |_______ Refresh _____|____ Factors ____|_______ External File __________ +# Name | Units |A|B| Time Template | Offset | Scale | Variable | Template +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- + CO2_BIOMASS 'kg CO2 m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_co2.x576_y361_t14.%y4.nc4 + CO2_FF 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none 0.27273 emco2ff ExtData/MERRA2/sfc/edgar-v42.emis_co2.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 + CO2_NEP 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_OCN 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + + CO2_CMS_BIOMASS 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/CMS/em.daily.1x1.25.%y4.nc + CO2_CMS_FF 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/CMS/ORNL_TRANSCOM.co2_ff_nep_ocn.x288_y181_t12.%y4.nc + CO2_CMS_NEP 'kg C m-2 s-1' N Y P0000-00-00T03:00 none none emco2nep ExtData/PIESA/sfc/CMS/casa.3hr.1x1.25.%y4.nc + CO2_CMS_OCN 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/CMS/NOBM_fco2.daily.1x1.25.%y4.nc + + CO2_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- +%% diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/20000401-present/CO2_GridComp.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/20000401-present/CO2_GridComp.rc new file mode 100644 index 00000000..c91fb646 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/20000401-present/CO2_GridComp.rc @@ -0,0 +1,50 @@ +# +# Resource file for CO2 parameters. +# + +number_CO2_bins: 1 +CO2_regions_indices: -1 1 2 5 + +# Run year-specific CMS emissions (0 runs climatological monthly mean emissions, 1 runs CMS) +# ------------------------------------------------------------------------------------------ +CMS_EMIS: 0 + +# Biosphere drawdown enhancement factor used for climatological emissions. +# Range: < 0 invalid, < 1 reduce sink, 1 neutral, > 1 enhance sink. +# ------------------------------------------------------------------------ +Biosphere_drawdown_factor: 1.2448 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + + + +# Deprecated options +# ------------------ +# NOTES: 1) The filename variables are all unused because they are now read from +# CO2_GridComp_ExtData.rc. However, some versions of the CO2 GridComp require +# these fields to be present in this file and have a time wildcard (here, %y4). +# +# 2) The emissions factors are read and applied. However, scale factors can be +# specified in CO2_GridComp_ExtData.rc, so for clarity, we now apply them there. + +CO2_regions: name_set_in_extdata_rc + +CO2_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CO2_biomass_emission_factor: 1. + +CO2_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_fossilfuel_emissions_factor: 1. + +CO2_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_ocean_emissions_filename: name_set_in_extdata_rc_%y4 + +CMS_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CMS_biomass_emission_factor: 1. + +CMS_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_fossilfuel_emissions_factor: 1. + +CMS_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_ocean_emissions_filename: name_set_in_extdata_rc_%y4 diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/20000401-present/CO2_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/20000401-present/CO2_GridComp_ExtData.rc new file mode 100644 index 00000000..4f44ee86 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/20000401-present/CO2_GridComp_ExtData.rc @@ -0,0 +1,19 @@ +PrimaryExports%% +# A = Climatology? Y/N; B = Conservative regridding? Y/N +#---------------+-------------------+-+-+---------------------+--------+--------+------------------------------------ +# Export | | | |_______ Refresh _____|____ Factors ____|_______ External File __________ +# Name | Units |A|B| Time Template | Offset | Scale | Variable | Template +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- + CO2_BIOMASS 'kg CO2 m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 + CO2_FF 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none 0.27273 emco2ff ExtData/MERRA2/sfc/edgar-v42.emis_co2.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 + CO2_NEP 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_OCN 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + + CO2_CMS_BIOMASS 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/CMS/em.daily.1x1.25.%y4.nc + CO2_CMS_FF 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/CMS/ORNL_TRANSCOM.co2_ff_nep_ocn.x288_y181_t12.%y4.nc + CO2_CMS_NEP 'kg C m-2 s-1' N Y P0000-00-00T03:00 none none emco2nep ExtData/PIESA/sfc/CMS/casa.3hr.1x1.25.%y4.nc + CO2_CMS_OCN 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/CMS/NOBM_fco2.daily.1x1.25.%y4.nc + + CO2_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- +%% diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/CO2_GridComp.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/CO2_GridComp.rc new file mode 100644 index 00000000..c91fb646 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/CO2_GridComp.rc @@ -0,0 +1,50 @@ +# +# Resource file for CO2 parameters. +# + +number_CO2_bins: 1 +CO2_regions_indices: -1 1 2 5 + +# Run year-specific CMS emissions (0 runs climatological monthly mean emissions, 1 runs CMS) +# ------------------------------------------------------------------------------------------ +CMS_EMIS: 0 + +# Biosphere drawdown enhancement factor used for climatological emissions. +# Range: < 0 invalid, < 1 reduce sink, 1 neutral, > 1 enhance sink. +# ------------------------------------------------------------------------ +Biosphere_drawdown_factor: 1.2448 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + + + +# Deprecated options +# ------------------ +# NOTES: 1) The filename variables are all unused because they are now read from +# CO2_GridComp_ExtData.rc. However, some versions of the CO2 GridComp require +# these fields to be present in this file and have a time wildcard (here, %y4). +# +# 2) The emissions factors are read and applied. However, scale factors can be +# specified in CO2_GridComp_ExtData.rc, so for clarity, we now apply them there. + +CO2_regions: name_set_in_extdata_rc + +CO2_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CO2_biomass_emission_factor: 1. + +CO2_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_fossilfuel_emissions_factor: 1. + +CO2_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_ocean_emissions_filename: name_set_in_extdata_rc_%y4 + +CMS_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CMS_biomass_emission_factor: 1. + +CMS_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_fossilfuel_emissions_factor: 1. + +CMS_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_ocean_emissions_filename: name_set_in_extdata_rc_%y4 diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/CO2_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/CO2_GridComp_ExtData.rc new file mode 100644 index 00000000..4f44ee86 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/MERRA2/CO2_GridComp_ExtData.rc @@ -0,0 +1,19 @@ +PrimaryExports%% +# A = Climatology? Y/N; B = Conservative regridding? Y/N +#---------------+-------------------+-+-+---------------------+--------+--------+------------------------------------ +# Export | | | |_______ Refresh _____|____ Factors ____|_______ External File __________ +# Name | Units |A|B| Time Template | Offset | Scale | Variable | Template +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- + CO2_BIOMASS 'kg CO2 m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 + CO2_FF 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none 0.27273 emco2ff ExtData/MERRA2/sfc/edgar-v42.emis_co2.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 + CO2_NEP 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_OCN 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + + CO2_CMS_BIOMASS 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/CMS/em.daily.1x1.25.%y4.nc + CO2_CMS_FF 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/CMS/ORNL_TRANSCOM.co2_ff_nep_ocn.x288_y181_t12.%y4.nc + CO2_CMS_NEP 'kg C m-2 s-1' N Y P0000-00-00T03:00 none none emco2nep ExtData/PIESA/sfc/CMS/casa.3hr.1x1.25.%y4.nc + CO2_CMS_OCN 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/CMS/NOBM_fco2.daily.1x1.25.%y4.nc + + CO2_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- +%% diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/NR/CO2_GridComp.rc b/ESMF/GOCART_GridComp/CO2_GridComp/NR/CO2_GridComp.rc new file mode 100644 index 00000000..0ef06449 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/NR/CO2_GridComp.rc @@ -0,0 +1,51 @@ +# +# Resource file for CO2 parameters. +# + +number_CO2_bins: 1 +CO2_regions_indices: -1 1 2 5 + +# Run year-specific CMS emissions (0 runs climatological monthly mean emissions, 1 runs CMS) +# ------------------------------------------------------------------------------------------ +CMS_EMIS: 1 +OCN_FLUX_CALC: 1 + +# Biosphere drawdown enhancement factor used for climatological emissions. +# Range: < 0 invalid, < 1 reduce sink, 1 neutral, > 1 enhance sink. +# ------------------------------------------------------------------------ +Biosphere_drawdown_factor: 1.2448 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + + + +# Deprecated options +# ------------------ +# NOTES: 1) The filename variables are all unused because they are now read from +# CO2_GridComp_ExtData.rc. However, some versions of the CO2 GridComp require +# these fields to be present in this file and have a time wildcard (here, %y4). +# +# 2) The emissions factors are read and applied. However, scale factors can be +# specified in CO2_GridComp_ExtData.rc, so for clarity, we now apply them there. + +CO2_regions: name_set_in_extdata_rc + +CO2_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CO2_biomass_emission_factor: 1. + +CO2_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_fossilfuel_emissions_factor: 1. + +CO2_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_ocean_emissions_filename: name_set_in_extdata_rc_%y4 + +CMS_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CMS_biomass_emission_factor: 1. + +CMS_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_fossilfuel_emissions_factor: 1. + +CMS_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_ocean_emissions_filename: name_set_in_extdata_rc_%y4 diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/NR/CO2_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO2_GridComp/NR/CO2_GridComp_ExtData.rc new file mode 100644 index 00000000..aa1efb9c --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/NR/CO2_GridComp_ExtData.rc @@ -0,0 +1,23 @@ +PrimaryExports%% +# A = Climatology? Y/N; B = Conservative regridding? Y/N +#---------------+-------------------+-+-+---------------------+--------+--------+------------------------------------ +# Export | | | |_______ Refresh _____|____ Factors ____|_______ External File __________ +# Name | Units |A|B| Time Template | Offset | Scale | Variable | Template +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- + CO2_BIOMASS 'kg CO2 m-2 s-1' N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/NR/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 + CO2_FF 'kg C m-2 s-1' Y Y %y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_NEP 'kg C m-2 s-1' Y Y %y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_OCN 'kg C m-2 s-1' Y Y %y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + + CO2_CMS_BIOMASS 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none 0.27 biomass ExtData/PIESA/sfc/QFED/v2.4r6/NR/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 + CO2_CMS_FF 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/NR/sfc/EDGAR.emis_co2.x3600_y1800.t14.%y4.nc4 + CO2_CMS_NEP 'kg C m-2 s-1' N Y P0000-00-00T03:00 none none emco2nep ExtData/NR/sfc/daily_co2_biosphere/CASA_CO2.3hr.NEE.x3600_y1800.t8.%y4%m2%d2.nc4 + + CO2_CMS_T NA N Y F%y4-%m2-%d2t12:00:00 none none T ExtData/PIESA/sfc/CMS/NOBM_tspi.1x1.25.%y4_rev.nc + CO2_CMS_S NA N Y F%y4-%m2-%d2t12:00:00 none none S ExtData/PIESA/sfc/CMS/NOBM_tspi.1x1.25.%y4_rev.nc + CO2_CMS_PICE NA N Y F%y4-%m2-%d2t12:00:00 none none pice ExtData/PIESA/sfc/CMS/NOBM_tspi.1x1.25.%y4_rev.nc + CO2_CMS_PCO2 NA N Y F%y4-%m2-%d2t12:00:00 none none pco ExtData/PIESA/sfc/CMS/NOBM_tspi.1x1.25.%y4_rev.nc + + CO2_regionMask NA N v - none none REGION_MASK ExtData/g5chem/sfc/ARCTAS.region_mask.x540_y361.2008.nc +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- +%% diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/PIESA/CO2_GridComp.rc b/ESMF/GOCART_GridComp/CO2_GridComp/PIESA/CO2_GridComp.rc new file mode 100644 index 00000000..c91fb646 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/PIESA/CO2_GridComp.rc @@ -0,0 +1,50 @@ +# +# Resource file for CO2 parameters. +# + +number_CO2_bins: 1 +CO2_regions_indices: -1 1 2 5 + +# Run year-specific CMS emissions (0 runs climatological monthly mean emissions, 1 runs CMS) +# ------------------------------------------------------------------------------------------ +CMS_EMIS: 0 + +# Biosphere drawdown enhancement factor used for climatological emissions. +# Range: < 0 invalid, < 1 reduce sink, 1 neutral, > 1 enhance sink. +# ------------------------------------------------------------------------ +Biosphere_drawdown_factor: 1.2448 + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + + + +# Deprecated options +# ------------------ +# NOTES: 1) The filename variables are all unused because they are now read from +# CO2_GridComp_ExtData.rc. However, some versions of the CO2 GridComp require +# these fields to be present in this file and have a time wildcard (here, %y4). +# +# 2) The emissions factors are read and applied. However, scale factors can be +# specified in CO2_GridComp_ExtData.rc, so for clarity, we now apply them there. + +CO2_regions: name_set_in_extdata_rc + +CO2_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CO2_biomass_emission_factor: 1. + +CO2_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_fossilfuel_emissions_factor: 1. + +CO2_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CO2_ocean_emissions_filename: name_set_in_extdata_rc_%y4 + +CMS_biomass_emission_filename: name_set_in_extdata_rc_%y4 +CMS_biomass_emission_factor: 1. + +CMS_fossilfuel_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_fossilfuel_emissions_factor: 1. + +CMS_biosphere_emissions_filename: name_set_in_extdata_rc_%y4 +CMS_ocean_emissions_filename: name_set_in_extdata_rc_%y4 diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/PIESA/CO2_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO2_GridComp/PIESA/CO2_GridComp_ExtData.rc new file mode 100644 index 00000000..2b0f1cc0 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO2_GridComp/PIESA/CO2_GridComp_ExtData.rc @@ -0,0 +1,19 @@ +PrimaryExports%% +# A = Climatology? Y/N; B = Conservative regridding? Y/N +#---------------+-------------------+-+-+---------------------+--------+--------+------------------------------------ +# Export | | | |_______ Refresh _____|____ Factors ____|_______ External File __________ +# Name | Units |A|B| Time Template | Offset | Scale | Variable | Template +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- + CO2_BIOMASS 'kg CO2 m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_co2.005.%y4%m2%d2.nc4 + CO2_FF 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_NEP 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2nep ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + CO2_OCN 'kg C m-2 s-1' Y Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/bian.co2.x288_y181_t12.2001.nc + + CO2_CMS_BIOMASS 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/CMS/em.daily.1x1.25.%y4.nc + CO2_CMS_FF 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ff ExtData/PIESA/sfc/CMS/ORNL_TRANSCOM.co2_ff_nep_ocn.x288_y181_t12.%y4.nc + CO2_CMS_NEP 'kg C m-2 s-1' N Y P0000-00-00T03:00 none none emco2nep ExtData/PIESA/sfc/CMS/casa.3hr.1x1.25.%y4.nc + CO2_CMS_OCN 'kg C m-2 s-1' N Y F%y4-%m2-%d2t12:00:00 none none emco2ocn ExtData/PIESA/sfc/CMS/NOBM_fco2.daily.1x1.25.%y4.nc + + CO2_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +#---------------+-------------------+-+-+---------------------+--------+--------+-------------+---------------------- +%% diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CMIP/CO_GridComp---full.rc b/ESMF/GOCART_GridComp/CO_GridComp/CMIP/CO_GridComp---full.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CMIP/CO_GridComp---full.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CMIP/CO_GridComp.rc b/ESMF/GOCART_GridComp/CO_GridComp/CMIP/CO_GridComp.rc new file mode 100755 index 00000000..f079fc36 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CMIP/CO_GridComp.rc @@ -0,0 +1,27 @@ +# +# CO main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Biomass burning +# ------------------|-------|------------ +# Asia and Europe | bbae | 3, 9, 10 # no longer includes SE Asia +# North America | bbna | 1 +# Cen. & S. America | bbla | 2, 6 +# Africa | bbaf | 5 +# Global | bbgl | Global +# ------------------|-------|------------ +# Non-biomass burning +# ------------------|-------|------------ +# Asia | nbas | 4, 10 +# North America | nbna | 1 +# Europe | nbeu | 3, 9 +# Global | nbgl | Global +# ------------------|-------|------------ + +CO_instances: full bbae bbna bbla bbaf bbgl nbas nbna nbeu nbgl diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CMIP/CO_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO_GridComp/CMIP/CO_GridComp_ExtData.rc new file mode 100755 index 00000000..f92dca08 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CMIP/CO_GridComp_ExtData.rc @@ -0,0 +1,111 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/CMIP/sfc/CO/cmip5.co_bioburn.x720_y361_t14.%y4.nc +CO_OH NA Y Y %y4-%m2-%d2t12:00:00 none none oh ExtData/CMIP/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CO_CH4 NA Y Y %y4-%m2-%d2t12:00:00 none none ch4 ExtData/CMIP/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CO_BF NA N Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf ExtData/CMIP/sfc/CO/cmip5.co_biofuel.x720_y361_t14.%y4.nc +CO_FS NA N Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/CMIP/sfc/CO/cmip5.co_fossilfuel.x720_y361_t14.%y4.nc +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/CMIP/sfc/CO/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/CMIP/sfc/CO/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/CMIP/sfc/CO/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/CMIP/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/CO_GridComp/CMakeLists.txt new file mode 100644 index 00000000..61bcc3ab --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-E\;-F\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbae.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbae.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbae.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbaf.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbaf.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbaf.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbbo.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbbo.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbbo.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbgl.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbla.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbla.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbla.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbna.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbnb.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbnb.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---bbnb.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffas.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffas.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffeu.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffna.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffna.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffru.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffru.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---ffru.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---full.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---full.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---full.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbas.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbas.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbeu.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbgl.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbna.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp---nbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp.rc new file mode 100755 index 00000000..f079fc36 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp.rc @@ -0,0 +1,27 @@ +# +# CO main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Biomass burning +# ------------------|-------|------------ +# Asia and Europe | bbae | 3, 9, 10 # no longer includes SE Asia +# North America | bbna | 1 +# Cen. & S. America | bbla | 2, 6 +# Africa | bbaf | 5 +# Global | bbgl | Global +# ------------------|-------|------------ +# Non-biomass burning +# ------------------|-------|------------ +# Asia | nbas | 4, 10 +# North America | nbna | 1 +# Europe | nbeu | 3, 9 +# Global | nbgl | Global +# ------------------|-------|------------ + +CO_instances: full bbae bbna bbla bbaf bbgl nbas nbna nbeu nbgl diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridCompMod.F90 b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridCompMod.F90 new file mode 100644 index 00000000..ff7ef7f8 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridCompMod.F90 @@ -0,0 +1,1395 @@ +#include "MAPL_Generic.h" + +!!! TO DO: Please revise Prologues!!!! + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: CO_GridCompMod --- CO Grid Component Class +! +! !INTERFACE: +! + + MODULE CO_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + + USE Chem_Mod ! Chemistry Base Class + USE Chem_StateMod ! Chemistry State + USE Chem_ConstMod, only: grav + USE Chem_UtilMod ! I/O + + USE m_inpak90 ! Resource file management + USE m_die, ONLY: die + USE Henrys_law_ConstantsMod, ONLY: get_HenrysLawCts + + IMPLICIT NONE + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC CO_GridComp ! Multiple instance CO object + PUBLIC CO_GridComp1 ! Single instance CO object + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC CO_GridCompSetServices + PUBLIC CO_GridCompInitialize + PUBLIC CO_GridCompRun + PUBLIC CO_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) CO Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! 31May2005 Nielsen Mods for 7 CO bins, 5 region masks +! 31May2005 da Silva Seperate file for biomass emissions; option for +! daily templatable files +! 31May2005 da Silva Moved reading of region mask to init, specified +! fixed time. +! 17Oct2005 Bian add biogenic emission and CH4 oxidation, two options +! for updating emissions +! 19dec2005 da Silva Activated 3D diags for output +! 14Apr2006 Bian Add CO tagged to fossil fuel, biofuel, biomass burning +! and biogenic +! Oct2006 Bian Evaluate total and tagged CO performace in GEOS4 system +! with emissions and oxident fields described in +! Bian et al., [2007]. The observations included GMD ground +! surface and aircraft measurements, TRACE-P aircraft +! measurements, and satellite MOPITT and AIRS retrieves. +! 01Aug2006 da Silva Extensions for GEOS-5. +! 10Mar2008 da Silva Multiple instances for ARCTAS. +! 18Mar2011 Nielsen Simplified PBL partitioning for biomass burning emissions +! 12May2015 Thompson Bring units into state (Fix for gfortran) +! +!EOP +!------------------------------------------------------------------------- + + TYPE CO_GridComp1 + + CHARACTER(LEN=255) :: name ! generic name of the package + CHARACTER(LEN=255) :: iname ! instance name + CHARACTER(LEN=255) :: rcfilen ! resource file name + + INTEGER :: instance ! instance number + + REAL, POINTER :: eCO_bioburn_(:,:) ! molec/cm2/s (before diurnal) + REAL, POINTER :: eCO_bioburn(:,:) ! molec/cm2/s + REAL, POINTER :: eCO_biofuel(:,:) ! molec/cm2/s + REAL, POINTER :: eCO_fosfuel(:,:) ! molec/cm2/s + REAL, POINTER :: eCO_iso(:,:) ! mgC/m2/s, Earth surface + REAL, POINTER :: eCO_mon(:,:) ! mgC/m2/s, Earth surface + REAL, POINTER :: eCO_mtn(:,:) ! mgC/m2/s, Earth surface + + REAL, POINTER :: CH4(:,:,:) ! CH4 mixing ratio (ppb) + REAL, POINTER :: OHnd(:,:,:) ! OH number density (#/cm3 or mol mol-1) + + REAL, POINTER :: COsfcFlux(:,:) ! CO surface flux kg m^-2 s^-1 + + LOGICAL :: DBG ! Run-time debug switch + LOGICAL :: doingBB = .true. ! Switch to consider biomass burning + CHARACTER(LEN=ESMF_MAXSTR) :: units_oh ! Units for OH + CHARACTER(LEN=ESMF_MAXSTR) :: units_ff ! Units for fossil fuel + CHARACTER(LEN=ESMF_MAXSTR) :: units_bf ! Units for biofuel + + END TYPE CO_GridComp1 + + TYPE CO_GridComp + INTEGER :: n ! number of instances + TYPE(CO_GridComp1), POINTER :: gcs(:) ! instances + END TYPE CO_GridComp + + REAL, PARAMETER :: radToDeg = 57.2957795 + +CONTAINS + + subroutine CO_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: rcbasen = 'CO_GridComp' + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: ier,n,i + + type(ESMF_Config) :: cfg + + Iam = "CO_GridCompSetServices" + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(rc=status) + VERIFY_(STATUS) + call ESMF_ConfigLoadFile(cfg,TRIM(rcbasen)//'.rc',rc=status) + VERIFY_(STATUS) + +! Parse resource file +! ------------------- + n = ESMF_ConfigGetLen(cfg,label='CO_instances:',rc=status) + VERIFY_(STATUS) + +! We cannot have fewer instances than the number of +! CO bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( n .LT. chemReg%n_CO ) then + rc = 35 + return + else if ( n .GT. chemReg%n_CO ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(Iam)// & + ': fewer CO bins than possible CO instances: ',& + n, chemReg%n_CO + end if + n = min(n,chemReg%n_CO ) + +! Record name of each instance +! ---------------------------- + call ESMF_ConfigFindLabel(cfg,'CO_instances:',rc=status) + VERIFY_(STATUS) + do i = 1, n + call ESMF_ConfigGetAttribute(cfg,name,rc=status) + VERIFY_(STATUS) + ! resource file name + IF(TRIM(name) == "full" ) THEN + name = " " ! blank instance name for full (1) + ELSE + name = TRIM(name) ! instance name for others + END IF + call CO_GridCompSetServices1_(gc,chemReg,name,rc=status) + VERIFY_(STATUS) + end do + + RETURN_(ESMF_SUCCESS) + + end subroutine CO_GridCompSetServices + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CO_GridCompInitialize --- Initialize CO_GridComp +! +! !INTERFACE: +! + + subroutine CO_GridCompInitialize ( gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CO_GridComp), INTENT(INOUT) :: gcCO ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=*), PARAMETER :: myname = 'CO_GridCompInitialize' + CHARACTER(LEN=255) :: rcbasen = 'CO_GridComp' + CHARACTER(LEN=255) :: name + + integer i, ier, n + REAL :: c1,c2,c3,c4 + +! Load resource file +! ------------------ + CALL I90_loadf ( TRIM(rcbasen)//'.rc', ier ) + if ( ier .NE. 0 ) then + rc = 10 + return + end if + +! Parse resource file +! ------------------- + CALL I90_label ( 'CO_instances:', ier ) + if ( ier .NE. 0 ) then + rc = 20 + return + end if + +! First determine how many instances we have +! ------------------------------------------ + n = 0 + do while ( ier .EQ. 0 ) + CALL I90_gtoken( name, ier ) + n = n + 1 + end do + if ( n .EQ. 0 ) then + rc = 30 + return + end if + +! We cannot have fewer instances than the number of +! CO bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( n .LT. w_c%reg%n_CO ) then + rc = 35 + return + else if ( n .GT. w_c%reg%n_CO ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(myname)// & + ': fewer CO bins than possible CO instances: ',& + n, w_c%reg%n_CO + end if + n = min(n,w_c%reg%n_CO ) + gcCO%n = n + +! Next allocate necessary memory +! ------------------------------ + allocate ( gcCO%gcs(n), stat=ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + +! Record name of each instance +! ---------------------------- + CALL I90_label ( 'CO_instances:', ier ) + do i = 1, n + CALL I90_gtoken( name, ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + ! resource file name + gcCO%gcs(i)%rcfilen = trim(rcbasen)//'---'//trim(name)//'.rc' + gcCO%gcs(i)%instance = i ! instance number + IF(TRIM(name) == "full" ) THEN + gcCO%gcs(i)%iname = " " ! blank instance name for full (1) + ELSE + gcCO%gcs(i)%iname = TRIM(name) ! instance name for others + END IF + end do + +! Next initialize each instance +! ----------------------------- + do i = 1, gcCO%n + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,myname,": Initializing instance ",TRIM(gcCO%gcs(i)%iname)," [",gcCO%gcs(i)%instance,"]" + END IF + call CO_SingleInstance_ ( CO_GridCompInitialize1_, i, & + gcCO%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = 1000+ier + return + end if + end do + +! Get Henrys Law cts for the parameterized convective wet removal +! ----------------------------------------------------------- + CALL get_HenrysLawCts('CO',c1,c2,c3,c4) + w_c%reg%Hcts(1,w_c%reg%i_CO : w_c%reg%j_CO)=c1 + w_c%reg%Hcts(2,w_c%reg%i_CO : w_c%reg%j_CO)=c2 + w_c%reg%Hcts(3,w_c%reg%i_CO : w_c%reg%j_CO)=c3 + w_c%reg%Hcts(4,w_c%reg%i_CO : w_c%reg%j_CO)=c4 + + +! All done +! -------- + CALL I90_FullRelease( ier ) + IF( ier /= 0 ) THEN + PRINT *,myname,": I90_FullRelease not successful." + rc = 40 + END IF + + + end subroutine CO_GridCompInitialize + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CO_GridCompRun --- Run CO_GridComp +! +! !INTERFACE: +! + + subroutine CO_GridCompRun ( gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CO_GridComp), INTENT(INOUT) :: gcCO ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer i, ier + + do i = 1, gcCO%n + call CO_SingleInstance_ ( CO_GridCompRun1_, i, & + gcCO%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine CO_GridCompRun + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CO_GridCompFinalize --- Initialize CO_GridComp +! +! !INTERFACE: +! + + subroutine CO_GridCompFinalize ( gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CO_GridComp), INTENT(INOUT) :: gcCO ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer i, ier + + do i = 1, gcCO%n + call CO_SingleInstance_ ( CO_GridCompFinalize1_, i, & + gcCO%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + deallocate ( gcCO%gcs, stat=ier ) + gcCO%n = -1 + + end subroutine CO_GridCompFinalize + + subroutine CO_GridCompSetServices1_( gc, chemReg, iname, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + character(len=*), intent(IN ) :: iname + integer, intent(OUT ) :: rc + + integer :: Status + character(len=ESMF_MAXSTR) :: Iam + + Iam ="CO_GridCOmpSetServices1_" + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO_OH'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO_CH4'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO_BF'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO_FS'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO_ISOP'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO_NVOC'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO_TERP'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CO_BIOMASS'//iname,& + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + RETURN_(ESMF_SUCCESS) + + end subroutine CO_GridCompSetServices1_ + +!-------------------------------------------------------------------------- + +! Single Instance Methods + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CO_GridCompInitialize --- Initialize CO_GridComp +! +! !INTERFACE: +! + + subroutine CO_GridCompInitialize1_ ( gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CO_GridComp1), INTENT(INOUT) :: gcCO ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the CO Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 31May2005 Nielsen Mods for 7 CO bins, 5 region masks +! 04Nov2005 Bian CO tagged to 4 regions +! (global, North America, South America, and Africa) +! for CR-AVE +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=*), PARAMETER :: myname = 'CO_GridCompInitialize1' + + CHARACTER(LEN=255) :: rcfilen + + INTEGER :: ios, j, n + INTEGER, ALLOCATABLE :: ier(:) + INTEGER :: i1, i2, im, j1, j2, jm, km + INTEGER :: nTimes, begTime, incSecs + INTEGER :: nbeg, nend, nymd1, nhms1 + + REAL :: limitN, limitS + REAL, ALLOCATABLE :: var2d(:,:) + + rcfilen = gcCO%rcfilen + gcCO%name = 'GEOS-5/GOCART Parameterized CO Package' + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + im = w_c%grid%im + + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jm = w_c%grid%jm + + km = w_c%grid%km + + nbeg = w_c%reg%i_CO + nend = w_c%reg%j_CO + +! It requires 1 bin +! ----------------- + if ( nbeg /= nend ) then + IF(MAPL_AM_I_ROOT()) PRINT *,myname,": Must have only 1 bin at the single instance level" + rc = 1 + return + end if + +! Allocate memory, etc +! -------------------- + CALL INIT_() + IF ( rc /= 0 ) RETURN + +! Load resource file +! ------------------ + CALL I90_loadf ( TRIM(rcfilen), ier(1) ) + IF ( ier(1) .NE. 0 ) THEN + CALL final_(10) + RETURN + END IF + ier(:)=0 + + +! Run-time debug switch +! --------------------- + call i90_label ( 'DEBUG:', ier(1) ) + n = i90_gint ( ier(2) ) + if(n /= 0) then + gcco%dbg = .true. + else + gcco%dbg = .false. + end if + +! Possibly OH is in a different unit +! Allowable choices are: "mol/mol" or "mol mol-1" +! or else behavior is as though input in +! "molecules cm-3" +! Should this checking be done now in ExtData? +! -------------------------------------------- + CALL i90_label ('units_oh:',ier(3) ) + if (ier(3) /= 0) then + gcCO%units_oh = " " + ier(3) = 0 + else + CALL I90_gtoken(gcCO%units_oh,ier(4) ) + end if + + IF( ANY( ier(:) /= 0 ) ) THEN + CALL final_(21) + RETURN + END IF + +! Set the initial CO surface fluxes to zero +! ----------------------------------------- + gcCO%COsfcFlux(i1:i2,j1:j2) = 0.00 + + DEALLOCATE(ier) + + RETURN + +CONTAINS + + SUBROUTINE init_() + + INTEGER ios, nerr + nerr = 128 + ALLOCATE ( gcCO%eCO_bioburn(i1:i2,j1:j2), & + gcCO%eCO_bioburn_(i1:i2,j1:j2), & + gcCO%eCO_biofuel(i1:i2,j1:j2), & + gcCO%eCO_fosfuel(i1:i2,j1:j2), & + gcCO%COsfcFlux(i1:i2,j1:j2), & + gcCO%eCO_iso(i1:i2,j1:j2), & + gcCO%eCO_mon(i1:i2,j1:j2), & + gcCO%eCO_mtn(i1:i2,j1:j2), & + gcCO%CH4(i1:i2,j1:j2,km), & + gcCO%OHnd(i1:i2,j1:j2,km), & + ier(nerr),STAT=ios ) + ier = 0 + IF ( ios /= 0 ) rc = 100 + END SUBROUTINE init_ + + SUBROUTINE final_(ierr) + INTEGER :: ierr + INTEGER ios + DEALLOCATE ( gcCO%eCO_bioburn, gcCO%eCO_biofuel, gcCO%eCO_fosfuel, & + gcCO%eCO_bioburn_, & + gcCO%COsfcFlux, gcCO%eCO_iso, gcCO%eCO_mon, & + gcCO%eCO_mtn, gcCO%CH4, gcCO%OHnd, & + ier, STAT=ios ) + CALL I90_release() + rc = ierr + END SUBROUTINE final_ + + END SUBROUTINE CO_GridCompInitialize1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CO_GridCompRun --- The Chem Driver +! +! !INTERFACE: +! + + SUBROUTINE CO_GridCompRun1_ ( gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +#define MR_PBL +!#define SFLUX_PBL + +! !USES: + + IMPLICIT NONE + +! !INPUT/OUTPUT PARAMETERS: + + TYPE(CO_GridComp1), INTENT(INOUT) :: gcCO ! Grid Component + TYPE(Chem_Bundle), INTENT(INOUT) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(inout) :: impChem ! Import State + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(ESMF_State), intent(inout) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the CO Driver for INTEX. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 31May2005 Nielsen Mods for 7 tags, 5 regions +! 04Nov2005 Bian CO tagged to 4 regions +! 13Apr2005 Bian CO tagged to emissions +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=*), PARAMETER :: myname = 'CO_GridCompRun' + CHARACTER(LEN=*), PARAMETER :: Iam = myname + +! Input fields from fvGCM +! ----------------------- + REAL, POINTER, DIMENSION(:,:) :: pblh => null() + REAL, POINTER, DIMENSION(:,:,:) :: T => null() + REAL, POINTER, DIMENSION(:,:,:) :: rhoa => null() + REAL, POINTER, DIMENSION(:,:,:) :: zle => null() + + INTEGER :: i1, i2, im, j1, j2, jm, km, ios, idiag, iXj + INTEGER :: i, j, k, kReverse, n, nbeg, nend + INTEGER :: nymd1, nhms1, ier(8) + integer :: iregWant + + REAL, PARAMETER :: nsuba=6.022E+26 + REAL, PARAMETER :: mwtAir=28.97 + REAL, PARAMETER :: mwtCO=28.01 + REAL, PARAMETER :: rstar=8.3143E+03 + REAL, PARAMETER :: rpstd=1.00E-05 + + REAL :: qmin, qmax, toMass, c2co + REAL :: fiso, fmtn, fmon + + REAL, ALLOCATABLE :: CH4nd(:,:,:) + REAL, ALLOCATABLE :: OHnd(:,:,:) + REAL, ALLOCATABLE :: pe(:,:,:),p(:,:,:),nd(:,:,:) + REAL, ALLOCATABLE :: rkoh(:,:,:),rkch4(:,:,:) + + real, pointer, dimension(:,:,:) :: ptr3d => null() + real, pointer, dimension(:,:) :: ptr2d => null() + +#define EXPORT expChem +#define iNAME TRIM(gcCO%iname) + +#define COEM CO_emis +#define COCL CO_column +#define COSC CO_surface +#define COPD CO_prod +#define COLS CO_loss + + integer :: STATUS + +#include "CO_GetPointer___.h" + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + im = w_c%grid%im + + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jm = w_c%grid%jm + km = w_c%grid%km + + iXj = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + + nbeg = w_c%reg%i_CO + nend = w_c%reg%j_CO + +! It requires 1 bin +! ----------------- + if ( nbeg /= nend ) then + IF(MAPL_AM_I_ROOT()) PRINT *,myname,": Must have only 1 bin at the single instance level" + rc = 1 + return + end if + +! Conversion factor, molecules CO cm^-2 s^-1 to kg CO m^-2 s^-1 +! ------------------------------------------------------------- + toMass = 1.00E+04*mwtCO/nsuba + c2co = mwtCO/12.00 + +! Update emissions and OH number density once each day. +! The latter appears to be in molecules cm^-3. +! ----------------------------------------------------- + +! Selections based on biomass burning emission set chosen +! Currently, parse on: +! harvard -> molecules cm-2 s-1, need to convert to mass +! modisfire -> kg CO m-2 s-1 +! else -> based on dry matter consumed + +! Biomass Burning -- select on known inventories +! ---------------------------------------------- + +! Harvard biomass burning climatology, is in molecules cm^-2 s^-1 +! --------------------------------------------------------------- + call MAPL_GetPointer(impChem, ptr2d, 'CO_BIOMASS'//iNAME,rc=status) + VERIFY_(STATUS) + gcCO%eCO_bioburn = ptr2d + +! Background OH, for loss term +! ---------------------------- + call MAPL_GetPointer(impChem, ptr3d, 'CO_OH'//iNAME,rc=status) + VERIFY_(STATUS) + gcCO%OHnd = ptr3d + +! Background CH4, for source term. +! NOTE: Return zeroes in all but the global instantiation. +! -------------------------------------------------------- + call MAPL_GetPointer(impChem, ptr3d, 'CO_CH4'//iNAME,rc=status) + VERIFY_(STATUS) + gcCO%CH4 = ptr3d + +! Biofuel source +! -------------- + call MAPL_GetPointer(impChem, ptr2d, 'CO_BF'//iNAME,rc=status) + VERIFY_(STATUS) + gcCO%eCO_biofuel = ptr2d + +! Fossil fuel source +! ------------------ + call MAPL_GetPointer(impChem, ptr2d, 'CO_FS'//iNAME,rc=status) + VERIFY_(STATUS) + gcCO%eCO_fosfuel = ptr2d + +! Isoprene source +! --------------- + call MAPL_GetPointer(impChem, ptr2d, 'CO_ISOP'//iNAME,rc=status) + VERIFY_(STATUS) + gcCO%eCO_iso = ptr2d + +! VOC source +! ---------- + call MAPL_GetPointer(impChem, ptr2d, 'CO_NVOC'//iNAME,rc=status) + VERIFY_(STATUS) + gcCO%eCO_mon = ptr2d + +! Monoterpene source +! ------------------ + call MAPL_GetPointer(impChem, ptr2d, 'CO_TERP'//iNAME,rc=status) + VERIFY_(STATUS) + gcCO%eCO_mtn = ptr2d + + IF(gcCO%DBG) THEN + CALL pmaxmin('CO: eCO_bioburn', gcCO%eCO_bioburn, qmin, qmax, iXj,1, 1. ) + CALL pmaxmin('CO: eCO_biofuel', gcCO%eCO_biofuel, qmin, qmax, iXj,1, 1. ) + CALL pmaxmin('CO: eCO_fosfuel', gcCO%eCO_fosfuel, qmin, qmax, iXj,1, 1. ) + CALL pmaxmin('CO: eCO_iso', gcCO%eCO_iso, qmin, qmax, iXj,1, 1. ) + CALL pmaxmin('CO: eCO_mon', gcCO%eCO_mon, qmin, qmax, iXj,1, 1. ) + CALL pmaxmin('CO: eCO_mtn', gcCO%eCO_mtn, qmin, qmax, iXj,1, 1. ) + END IF + +! Save this in case we need to apply diurnal cycle +! ------------------------------------------------ + if ( w_c%diurnal_bb ) then + gcCO%eCO_bioburn_(:,:) = gcCO%eCO_bioburn(:,:) + end if + +! Apply diurnal cycle if so desired +! --------------------------------- + if ( w_c%diurnal_bb ) then + call Chem_BiomassDiurnal ( gcCO%eCO_bioburn, gcCO%eCO_bioburn_, & + w_c%grid%lon(:,:)*radToDeg, & + w_c%grid%lat(:,:)*radToDeg, nhms, cdt ) + end if + + +! Allocate temporary workspace +! ---------------------------- + allocate ( pe(i1:i2,j1:j2,km+1), p(i1:i2,j1:j2,km), nd(i1:i2,j1:j2,km), & + rkoh(i1:i2,j1:j2,km), rkch4(i1:i2,j1:j2,km), & + CH4nd(i1:i2,j1:j2,km), OHnd(i1:i2,j1:j2,km), stat = ios ) + + if ( ios /= 0 ) then + rc = 3 + return + end if + +! Layer interface pressures +! ------------------------- + pe(i1:i2,j1:j2,1)=w_c%grid%ptop + DO k=2,km+1 + pe(i1:i2,j1:j2,k)=pe(i1:i2,j1:j2,k-1)+w_c%delp(i1:i2,j1:j2,k-1) + END DO + +! Layer mean pressures +! -------------------- + DO k=1,km + p(i1:i2,j1:j2,k)=(pe(i1:i2,j1:j2,k)+pe(i1:i2,j1:j2,k+1))*0.50 + END DO + +! Get imports +! ----------- + call MAPL_GetPointer( impChem, pblh, 'ZPBL', rc=ier(1) ) + call MAPL_GetPointer( impChem, T, 'T', rc=ier(2) ) + call MAPL_GetPointer( impChem, rhoa, 'AIRDENS', rc=ier(3) ) + call MAPL_GetPointer( impChem, zle, 'ZLE', rc=ier(4) ) + + if ( any(ier(1:4) /= 0) ) then + rc = 10 + return + end if + + IF(gcCO%DBG) THEN + CALL pmaxmin('CO: pblh', pblh, qmin, qmax, iXj, 1, 1. ) + CALL pmaxmin('CO: T', T, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CO: rhoa', rhoa, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('CO: zle', zle, qmin, qmax, iXj, km+1, 1. ) + END IF + +! Number density +! -------------- + nd(i1:i2,j1:j2,1:km)= nsuba*p(i1:i2,j1:j2,1:km)/ & + (rstar*t(i1:i2,j1:j2,1:km)) + +! CH4 number density. CH4 on file is in mole fraction. +! ----------------------------------------------------- + CH4nd(i1:i2,j1:j2,1:km)=gcCO%CH4(i1:i2,j1:j2,1:km)* & + nd(i1:i2,j1:j2,1:km) + +! OH number density. Handle mole fraction or number density. +! ---------------------------------------------------------- + if ( (trim(gcCO%units_oh) .eq. 'mol/mol') .or. (trim(gcCO%units_oh) .eq. 'mol mol-1') ) then + OHnd(i1:i2,j1:j2,1:km) = gcCO%OHnd(i1:i2,j1:j2,1:km)* & + nd(i1:i2,j1:j2,1:km) + else + ! assume that units are 'molecules cm-3' and convert to 'molecules m^-3' + OHnd(i1:i2,j1:j2,1:km) = gcCO%OHnd(i1:i2,j1:j2,1:km)*1.00E+06 + end if + +! Clear surface flux array +! ------------------------ + gcCO%COsfcFlux(i1:i2,j1:j2) = 0.0 + +#if defined( MR_PBL) +! Emissions, direct update of mixing ratio +! ---------------------------------------- + call CO_Emission(rc) +#endif + +! Convert carbon monoxide from mole fraction to number density +! ------------------------------------------------------------ + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km) = & + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)*nd(i1:i2,j1:j2,1:km) + +! Loss due to OH. +! --------------- + rkoh(i1:i2,j1:j2,1:km) = & + 1.5E-13*1.00E-06*(1.00+0.6*p(i1:i2,j1:j2,1:km)*rpstd) + n = gcCO%instance + IF(ASSOCIATED(CO_loss)) CO_loss(i1:i2,j1:j2) = 0. + DO k = 1, km + + IF(ASSOCIATED(CO_loss)) CO_loss(i1:i2,j1:j2) = CO_loss(i1:i2,j1:j2) & + + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)*rkoh(i1:i2,j1:j2,k) & + * OHnd(i1:i2,j1:j2,k)/nd(i1:i2,j1:j2,k) & + * mwtCO/mwtAir*w_c%delp(i1:i2,j1:j2,k)/grav + + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k) = & + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)*(1.00-cdt* & + rkoh(i1:i2,j1:j2,k)*OHnd(i1:i2,j1:j2,k)) + + END DO ! Next layer, k + +! CH4 production +! -------------- + rkch4(i1:i2,j1:j2,1:km)= & + 2.45e-12*1.00E-06*exp(-1775./t(i1:i2,j1:j2,1:km)) + n = gcCO%instance + IF(ASSOCIATED(CO_prod)) CO_prod(i1:i2,j1:j2) = 0. + DO k = 1, km + + IF(ASSOCIATED(CO_prod)) CO_prod(i1:i2,j1:j2) = CO_prod(i1:i2,j1:j2) & + + rkch4(i1:i2,j1:j2,k)*OHnd(i1:i2,j1:j2,k)*CH4nd(i1:i2,j1:j2,k) & + / nd(i1:i2,j1:j2,k) * mwtCO/mwtAir*w_c%delp(i1:i2,j1:j2,k)/grav + + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)=w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)+cdt* & + rkch4(i1:i2,j1:j2,k)*OHnd(i1:i2,j1:j2,k)* & + CH4nd(i1:i2,j1:j2,k) + + END DO ! Next layer, k + +! Return to mole fraction +! ----------------------- + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)=w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)/nd(i1:i2,j1:j2,1:km) + +! Surface concentration in ppbv +! ----------------------------- + n = gcCO%instance + if(associated(CO_surface)) & + CO_surface(i1:i2,j1:j2) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km)*1.e9 + +! Column burden in kg m-2 +! ----------------------- + n = gcCO%instance + if(associated(CO_column)) then + CO_column(i1:i2,j1:j2) = 0. + do k = 1, km + CO_column(i1:i2,j1:j2) & + = CO_column(i1:i2,j1:j2) & + + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)*mwtCO/mwtAir & + * w_c%delp(i1:i2,j1:j2,k)/grav + enddo + endif + +! CO Surface Emission Flux in kg m-2 s-1 +! -------------------------------------- + n = gcCO%instance + if(associated(CO_emis)) & + CO_emis(i1:i2,j1:j2) = gcCO%COsfcFlux(i1:i2,j1:j2) + + IF(gcCO%DBG) THEN + n = gcCO%instance + if(associated(CO_emis)) & + CALL pmaxmin('CO: emis', CO_emis(i1:i2,j1:j2), qmin, qmax, & + iXj,1, 1. ) + if(associated(CO_loss)) & + CALL pmaxmin('CO: loss', CO_loss(i1:i2,j1:j2), qmin, qmax, & + iXj,1, 1. ) + if(associated(CO_prod)) & + CALL pmaxmin('CO: prod', CO_prod(i1:i2,j1:j2), qmin, qmax, & + iXj,1, 1. ) + if(associated(CO_column)) & + CALL pmaxmin('CO: column', CO_column(i1:i2,j1:j2), qmin, qmax, & + iXj,1, 1. ) + if(associated(CO_surface)) & + CALL pmaxmin('CO: surface', CO_surface(i1:i2,j1:j2), qmin, qmax,& + iXj,1, 1. ) + END IF + +! Housekeeping +! ------------ + DEALLOCATE(nd,p,pe,rkoh,rkch4,CH4nd,OHnd,STAT=ier(1)) + + RETURN + +CONTAINS +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! !DESCRIPTION: Updates the CO concentration with emissions every timestep +! +! !IROUTINE: CO_Emission - Adds emissions for CO for one timestep +! We have emissions from 4 sources, which are distributed +! differently in the vertical +! 1) fossil fuel - emitted at surface +! 2) biofuel sources - emitted at surface +! 3) biomass burning - uniformly mixed in PBL +! 4) biogenic - emitted at surface +! include: isoprene, converting factor 0.15 +! terpene, converting factor 0.2 +! nvoc, converting factor 0.2 +! !REVISION HISTORY: +! +! 17Oct2005, Bian! +! 14Apr2006, Bian: Add indirect NMHC from FF (0.20), BF (0.19), BB (0.11) +! Add seasonality for FF +! Modify FF & BF over Asia region (1.39) for Streets' data +! 18Mar2011, Nielsen: Simplified PBL partitioning for biomass burning emissions +! +! !INTERFACE: +! +!EOP +!------------------------------------------------------------------------- + SUBROUTINE CO_Emission ( rc ) +!------------------------------------------------------------------------- + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! !OUTPUT PARAMETERS: + + INTEGER, INTENT(OUT) :: rc ! Error return code + +! !LOCAL VARIABLES + + CHARACTER(LEN=*), PARAMETER :: myname = 'CO_Emission' + + INTEGER :: i, j, k, kt, minkPBL + INTEGER, ALLOCATABLE :: index(:) + + REAL, PARAMETER :: mwtAir=28.97 + REAL, PARAMETER :: mwtCO=28.01 + REAL, ALLOCATABLE :: pblLayer(:,:),sfcFlux(:,:),fPBL(:,:,:) + + rc = 0 + +! Grab some memory for manipulating surface fluxes +! ------------------------------------------------ + ALLOCATE(sfcFlux(i1:i2,j1:j2),STAT=ios) + +! Biomass burning +! --------------- + BioBurn: IF(gcCO%doingBB) THEN + + sfcFlux(i1:i2,j1:j2)=gcCO%eCO_bioburn(i1:i2,j1:j2) + gcCO%COsfcFlux(i1:i2,j1:j2)=gcCO%COsfcFlux(i1:i2,j1:j2)+sfcFlux(i1:i2,j1:j2) + +! Find the layer that contains the PBL. +! Layer thicknesses are ZLE(:,:,0:km). +! ------------------------------------- + ALLOCATE(index(0:km),STAT=ios) + ALLOCATE(pblLayer(i1:i2,j1:j2),STAT=ios) + DO j=j1,j2 + DO i=i1,i2 + index(0:km)=0 + WHERE(zle(i,j,0:km)-zle(i,j,km) > pblh(i,j)) index(0:km)=1 + pblLayer(i,j)=SUM(index) + END DO + END DO + DEALLOCATE(index,STAT=ios) + minkPBL=MINVAL(pblLayer) + +! Determine partitioning fraction based on layer thicknesses +! ---------------------------------------------------------- + ALLOCATE(fPBL(i1:i2,j1:j2,1:km),STAT=ios) + fPBL(i1:i2,j1:j2,1:km)=0.00 + DO j=j1,j2 + DO i=i1,i2 + kt=pblLayer(i,j) + DO k=kt,km + fPBL(i,j,k)=(zle(i,j,k-1)-zle(i,j,k))/(zle(i,j,kt-1)-zle(i,j,km)) + END DO + END DO + END DO + +! Partition surface flux into layers within the PBL +! ------------------------------------------------- + DO k=minkPBL,km + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)+ & + sfcFlux(i1:i2,j1:j2)*fPBL(i1:i2,j1:j2,k)*cdt* & + (mwtAir/mwtCO)/(w_c%delp(i1:i2,j1:j2,k)/grav) + END DO + +! Release memory +! -------------- + DEALLOCATE(fPBL,STAT=ios) + DEALLOCATE(pblLayer,STAT=ios) + + END IF BioBurn + +! Biogenic +! -------- + sfcFlux(i1:i2,j1:j2) = gcCO%eCO_iso(i1:i2,j1:j2)+gcCO%eCO_mon(i1:i2,j1:j2)+gcCO%eCO_mtn(i1:i2,j1:j2) + gcCO%COsfcFlux(i1:i2,j1:j2) = gcCO%COsfcFlux(i1:i2,j1:j2)+sfcFlux(i1:i2,j1:j2) + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km)+sfcFlux(i1:i2,j1:j2)*cdt* & + (mwtAir/mwtCO)/(w_c%delp(i1:i2,j1:j2,km)/grav) +! Fossil fuel and biofuel +! ----------------------- + sfcFlux(i1:i2,j1:j2) = gcCO%eCO_fosfuel(i1:i2,j1:j2)+gcCO%eCO_biofuel(i1:i2,j1:j2) + gcCO%COsfcFlux(i1:i2,j1:j2) = gcCO%COsfcFlux(i1:i2,j1:j2)+sfcFlux(i1:i2,j1:j2) + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km)+sfcFlux(i1:i2,j1:j2)*cdt* & + (mwtAir/mwtCO)/(w_c%delp(i1:i2,j1:j2,km)/grav) +! Release memory +! -------------- + DEALLOCATE(sfcFlux,STAT=ios) + + RETURN + END SUBROUTINE CO_Emission + + END SUBROUTINE CO_GridCompRun1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CO_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + SUBROUTINE CO_GridCompFinalize1_ ( gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT/OUTPUT PARAMETERS: + + TYPE(CO_GridComp1), INTENT(INOUT) :: gcCO ! Grid Component + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), INTENT(IN) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Import State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=*), PARAMETER :: myname = 'CO_GridCompFinalize' + INTEGER :: ios + + DEALLOCATE ( gcCO%eCO_bioburn, gcCO%eCO_biofuel, gcCO%eCO_fosfuel, & + gcCO%COsfcFlux, gcCO%eCO_iso, gcCO%eCO_mon, & + gcCO%eCO_mtn, gcCO%CH4, gcCO%OHnd, & + STAT=ios ) + rc = 0 + IF ( ios /= 0 ) rc = 1 + + RETURN + + END SUBROUTINE CO_GridCompFinalize1_ + + END MODULE CO_GridCompMod + +!----------------------------------------------------------------------- + +! Single Instance Wrapper + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: CO_SingleInstance_ --- Runs single instance of method +! +! !INTERFACE: +! + subroutine CO_SingleInstance_ ( Method_, instance, & + gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + Use CO_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! Input "function pointer" +! ----------------------- + interface + subroutine Method_ (gc, w, imp, exp, ymd, hms, dt, rcode ) + Use CO_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + type(CO_GridComp1), intent(inout) :: gc + type(Chem_Bundle), intent(in) :: w + type(ESMF_State), intent(inout) :: imp + type(ESMF_State), intent(inout) :: exp + integer, intent(in) :: ymd, hms + real, intent(in) :: dt + integer, intent(out) :: rcode + end subroutine Method_ + end interface + + integer, intent(in) :: instance ! instance number + + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(CO_GridComp1), INTENT(INOUT) :: gcCO ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer n_CO, i_CO, j_CO + +! Save overall CO indices +! ----------------------- + n_CO = w_c%reg%n_CO + i_CO = w_c%reg%i_CO + j_CO = w_c%reg%j_CO + +! Customize indices for this particular instance +! ---------------------------------------------- + w_c%reg%n_CO = 1 + w_c%reg%i_CO = i_CO + instance - 1 + w_c%reg%j_CO = i_CO + instance - 1 + +! Execute the instance method +! --------------------------- + call Method_ ( gcCO, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! Restore the overall CO indices +! ------------------------------ + w_c%reg%n_CO = n_CO + w_c%reg%i_CO = i_CO + w_c%reg%j_CO = j_CO + + end subroutine CO_SingleInstance_ + +!----------------------------------------------------------------------- diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp_ExtData.rc new file mode 100755 index 00000000..27809101 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridComp_ExtData.rc @@ -0,0 +1,112 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_co.006.%y4%m2%d2.nc4 +CO_OH NA Y Y %y4-%m2-%d2t12:00:00 none none oh ExtData/PIESA/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CO_CH4 NA Y Y %y4-%m2-%d2t12:00:00 none none ch4 ExtData/PIESA/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CO_BF NA Y Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf ExtData/PIESA/sfc/co_biofuel_v2.x360_y181_t12.2001.nc +CO_FS NA Y Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/PIESA/sfc/co_fossilfuel_v2.x360_y181_t12.2001.nc +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/PIESA/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/PIESA/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/PIESA/sfc/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_Registry.rc b/ESMF/GOCART_GridComp/CO_GridComp/CO_Registry.rc new file mode 100644 index 00000000..cd225bbc --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_Registry.rc @@ -0,0 +1,105 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: CO + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl|# Sub| Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + COEM | kg m-2 s-1 | xy | | | | | | CO Emission __ENSEMBLE__ + COEMbbbo | kg m-2 s-1 | xy | | | | | | CO Emission (Boreal Biomass Burning) + COEMbbnb | kg m-2 s-1 | xy | | | | | | CO Emission (Non-Boreal Biomass Burning) + COEMffru | kg m-2 s-1 | xy | | | | | | CO Emission (Anthopogenic Emissions Northern Asia) + COEMffas | kg m-2 s-1 | xy | | | | | | CO Emission (Anthopogenic Emissions Southern Asia) + COEMffeu | kg m-2 s-1 | xy | | | | | | CO Emission (Anthopogenic Emissions Europe) + COEMffna | kg m-2 s-1 | xy | | | | | | CO Emission (Anthopogenic Emissions North America) + COEMbbae | kg m-2 s-1 | xy | | | | | | CO Emission (Asia and Europe Biomass Burning) + COEMbbna | kg m-2 s-1 | xy | | | | | | CO Emission (North America Biomass Burning) + COEMbbla | kg m-2 s-1 | xy | | | | | | CO Emission (Central and South America Biomass Burning) + COEMbbaf | kg m-2 s-1 | xy | | | | | | CO Emission (Africa Biomass Burning) + COEMbbgl | kg m-2 s-1 | xy | | | | | | CO Emission (Global Biomass Burning) + COEMnbas | kg m-2 s-1 | xy | | | | | | CO Emission (Asia Non-Biomass Burning) + COEMnbeu | kg m-2 s-1 | xy | | | | | | CO Emission (European Non-Biomass Burning) + COEMnbna | kg m-2 s-1 | xy | | | | | | CO Emission (North American Non-Biomass Burning) + COEMnbgl | kg m-2 s-1 | xy | | | | | | CO Emission (Global Non-Biomass Burning) + COPD | kg m-2 s-1 | xy | | | | | | CO Chemical Production __ENSEMBLE__ + COPDbbbo | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Boreal Biomass Burning) + COPDbbnb | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Non-Boreal Biomass Burning) + COPDffru | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Anthopogenic Emissions Northern Asia) + COPDffas | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Anthopogenic Emissions Southern Asia) + COPDffeu | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Anthopogenic Emissions Europe) + COPDffna | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Anthopogenic Emissions North America) + COPDbbae | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Asia and Europe Biomass Burning) + COPDbbna | kg m-2 s-1 | xy | | | | | | CO Chemical Production (North America Biomass Burning) + COPDbbla | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Central and South America Biomass Burning) + COPDbbaf | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Africa Biomass Burning) + COPDbbgl | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Global Biomass Burning) + COPDnbas | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Asia Non-Biomass Burning) + COPDnbeu | kg m-2 s-1 | xy | | | | | | CO Chemical Production (European Non-Biomass Burning) + COPDnbna | kg m-2 s-1 | xy | | | | | | CO Chemical Production (North American Non-Biomass Burning) + COPDnbgl | kg m-2 s-1 | xy | | | | | | CO Chemical Production (Global Non-Biomass Burning) + COLS | kg m-2 s-1 | xy | | | | | | CO Chemical Loss __ENSEMBLE__ + COLSbbbo | km m-2 s-1 | xy | | | | | | CO Chemical Loss (Boreal Biomass Burning) + COLSbbnb | km m-2 s-1 | xy | | | | | | CO Chemical Loss (Non-Boreal Biomass Burning) + COLSffru | km m-2 s-1 | xy | | | | | | CO Chemical Loss (Anthopogenic Emissions Northern Asia) + COLSffas | km m-2 s-1 | xy | | | | | | CO Chemical Loss (Anthopogenic Emissions Southern Asia) + COLSffeu | km m-2 s-1 | xy | | | | | | CO Chemical Loss (Anthopogenic Emissions Europe) + COLSffna | km m-2 s-1 | xy | | | | | | CO Chemical Loss (Anthopogenic Emissions North America) + COLSbbae | km m-2 s-1 | xy | | | | | | CO Chemical Loss (Asia and Europe Biomass Burning) + COLSbbna | km m-2 s-1 | xy | | | | | | CO Chemical Loss (North America Biomass Burning) + COLSbbla | km m-2 s-1 | xy | | | | | | CO Chemical Loss (Central and South America Biomass Burning) + COLSbbaf | km m-2 s-1 | xy | | | | | | CO Chemical Loss (Africa Biomass Burning) + COLSbbgl | km m-2 s-1 | xy | | | | | | CO Chemical Loss (Global Biomass Burning) + COLSnbas | kg m-2 s-1 | xy | | | | | | CO Chemical Loss (Asia Non-Biomass Burning) + COLSnbeu | kg m-2 s-1 | xy | | | | | | CO Chemical Loss (European Non-Biomass Burning) + COLSnbna | kg m-2 s-1 | xy | | | | | | CO Chemical Loss (North American Non-Biomass Burning) + COLSnbgl | kg m-2 s-1 | xy | | | | | | CO Chemical Loss (Global Non-Biomass Burning) + COSC | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv __ENSEMBLE__ + COSCbbbo | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Boreal Biomass Burning) + COSCbbnb | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Non-Boreal Biomass Burning) + COSCffru | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Anthopogenic Emissions Northern Asia) + COSCffas | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Anthopogenic Emissions Southern Asia) + COSCffeu | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Anthopogenic Emissions Europe) + COSCffna | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Anthopogenic Emissions North America) + COSCbbae | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Asia and Europe Biomass Burning) + COSCbbna | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (North America Biomass Burning) + COSCbbla | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Central and South America Biomass Burning) + COSCbbaf | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Africa Biomass Burning) + COSCbbgl | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Global Biomass Burning) + COSCnbas | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Asia Non-Biomass Burning) + COSCnbeu | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (European Non-Biomass Burning) + COSCnbna | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (North American Non-Biomass Burning) + COSCnbgl | 1e-9 | xy | | | | | | CO Surface Concentration in ppbv (Global Non-Biomass Burning) + COCL | kg m-2 | xy | | | | | | CO Column Burden __ENSEMBLE__ + COCLbbbo | kg m-2 | xy | | | | | | CO Column Burden (Boreal Biomass Burning) + COCLbbnb | kg m-2 | xy | | | | | | CO Column Burden (Non-Boreal Biomass Burning) + COCLffru | kg m-2 | xy | | | | | | CO Column Burden (Anthopogenic Emissions Northern Asia) + COCLffas | kg m-2 | xy | | | | | | CO Column Burden (Anthopogenic Emissions Southern Asia) + COCLffeu | kg m-2 | xy | | | | | | CO Column Burden (Anthopogenic Emissions Europe) + COCLffna | kg m-2 | xy | | | | | | CO Column Burden (Anthopogenic Emissions North America) + COCLbbae | kg m-2 | xy | | | | | | CO Column Burden (Asia and Europe Biomass Burning) + COCLbbna | kg m-2 | xy | | | | | | CO Column Burden (North America Biomass Burning) + COCLbbla | kg m-2 | xy | | | | | | CO Column Burden (Central and South America Biomass Burning) + COCLbbaf | kg m-2 | xy | | | | | | CO Column Burden (Africa Biomass Burning) + COCLbbgl | kg m-2 | xy | | | | | | CO Column Burden (Global Biomass Burning) + COCLnbas | kg m-2 | xy | | | | | | CO Column Burden (Asia Non-Biomass Burning) + COCLnbeu | kg m-2 | xy | | | | | | CO Column Burden (European Non-Biomass Burning) + COCLnbna | kg m-2 | xy | | | | | | CO Column Burden (North American Non-Biomass Burning) + COCLnbgl | kg m-2 | xy | | | | | | CO Column Burden (Global Non-Biomass Burning) +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + + diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbae.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbae.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbae.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbaf.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbaf.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbaf.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbbo.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbbo.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbbo.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbla.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbla.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbla.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbnb.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbnb.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---bbnb.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffru.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffru.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---ffru.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---full.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---full.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---full.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp---nbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp.rc new file mode 100644 index 00000000..f079fc36 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp.rc @@ -0,0 +1,27 @@ +# +# CO main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Biomass burning +# ------------------|-------|------------ +# Asia and Europe | bbae | 3, 9, 10 # no longer includes SE Asia +# North America | bbna | 1 +# Cen. & S. America | bbla | 2, 6 +# Africa | bbaf | 5 +# Global | bbgl | Global +# ------------------|-------|------------ +# Non-biomass burning +# ------------------|-------|------------ +# Asia | nbas | 4, 10 +# North America | nbna | 1 +# Europe | nbeu | 3, 9 +# Global | nbgl | Global +# ------------------|-------|------------ + +CO_instances: full bbae bbna bbla bbaf bbgl nbas nbna nbeu nbgl diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp_ExtData.rc new file mode 100755 index 00000000..55038f19 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/19600101-20000331/CO_GridComp_ExtData.rc @@ -0,0 +1,111 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_co.x576_y361_t14.%y4.nc4 +CO_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_CH4 NA N Y %y4-%m2-%d2t12:00:00 none none CH4 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_BF NA Y Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf /dev/null +CO_FS NA N Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/MERRA2/sfc/edgar-v42.emis_co.anthropogenic.x3600_y1800.19700703T12z_20200703T00z.w1A4.nc4 +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbae.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbae.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbae.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbaf.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbaf.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbaf.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbbo.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbbo.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbbo.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbla.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbla.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbla.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbnb.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbnb.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---bbnb.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffru.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffru.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---ffru.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---full.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---full.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---full.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp---nbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp.rc new file mode 100644 index 00000000..f079fc36 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp.rc @@ -0,0 +1,27 @@ +# +# CO main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Biomass burning +# ------------------|-------|------------ +# Asia and Europe | bbae | 3, 9, 10 # no longer includes SE Asia +# North America | bbna | 1 +# Cen. & S. America | bbla | 2, 6 +# Africa | bbaf | 5 +# Global | bbgl | Global +# ------------------|-------|------------ +# Non-biomass burning +# ------------------|-------|------------ +# Asia | nbas | 4, 10 +# North America | nbna | 1 +# Europe | nbeu | 3, 9 +# Global | nbgl | Global +# ------------------|-------|------------ + +CO_instances: full bbae bbna bbla bbaf bbgl nbas nbna nbeu nbgl diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp_ExtData.rc new file mode 100755 index 00000000..dd7f21bd --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/20000401-present/CO_GridComp_ExtData.rc @@ -0,0 +1,111 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_co.005.%y4%m2%d2.nc4 +CO_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_CH4 NA N Y %y4-%m2-%d2t12:00:00 none none CH4 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_BF NA Y Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf /dev/null +CO_FS NA N Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/MERRA2/sfc/edgar-v42.emis_co.anthropogenic.x3600_y1800.19700703T12z_20200703T00z.w1A4.nc4 +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbae.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbae.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbae.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbaf.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbaf.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbaf.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbbo.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbbo.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbbo.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbla.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbla.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbla.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbnb.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbnb.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---bbnb.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffru.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffru.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---ffru.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---full.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---full.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---full.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp---nbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp.rc new file mode 100644 index 00000000..f079fc36 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp.rc @@ -0,0 +1,27 @@ +# +# CO main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Biomass burning +# ------------------|-------|------------ +# Asia and Europe | bbae | 3, 9, 10 # no longer includes SE Asia +# North America | bbna | 1 +# Cen. & S. America | bbla | 2, 6 +# Africa | bbaf | 5 +# Global | bbgl | Global +# ------------------|-------|------------ +# Non-biomass burning +# ------------------|-------|------------ +# Asia | nbas | 4, 10 +# North America | nbna | 1 +# Europe | nbeu | 3, 9 +# Global | nbgl | Global +# ------------------|-------|------------ + +CO_instances: full bbae bbna bbla bbaf bbgl nbas nbna nbeu nbgl diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp_ExtData.rc new file mode 100755 index 00000000..dd7f21bd --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2-DD/CO_GridComp_ExtData.rc @@ -0,0 +1,111 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_co.005.%y4%m2%d2.nc4 +CO_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_CH4 NA N Y %y4-%m2-%d2t12:00:00 none none CH4 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_BF NA Y Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf /dev/null +CO_FS NA N Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/MERRA2/sfc/edgar-v42.emis_co.anthropogenic.x3600_y1800.19700703T12z_20200703T00z.w1A4.nc4 +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbae.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbae.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbae.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbaf.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbaf.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbaf.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbbo.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbbo.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbbo.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbla.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbla.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbla.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbnb.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbnb.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---bbnb.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffru.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffru.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---ffru.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---full.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---full.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---full.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp---nbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp.rc new file mode 100644 index 00000000..f079fc36 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp.rc @@ -0,0 +1,27 @@ +# +# CO main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Biomass burning +# ------------------|-------|------------ +# Asia and Europe | bbae | 3, 9, 10 # no longer includes SE Asia +# North America | bbna | 1 +# Cen. & S. America | bbla | 2, 6 +# Africa | bbaf | 5 +# Global | bbgl | Global +# ------------------|-------|------------ +# Non-biomass burning +# ------------------|-------|------------ +# Asia | nbas | 4, 10 +# North America | nbna | 1 +# Europe | nbeu | 3, 9 +# Global | nbgl | Global +# ------------------|-------|------------ + +CO_instances: full bbae bbna bbla bbaf bbgl nbas nbna nbeu nbgl diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp_ExtData.rc new file mode 100755 index 00000000..03873e78 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/19600101-20000331/CO_GridComp_ExtData.rc @@ -0,0 +1,111 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_co.x576_y361_t14.%y4.nc4 +CO_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_CH4 NA N Y %y4-%m2-%d2t12:00:00 none none CH4 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_BF NA Y Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf /dev/null +CO_FS NA N Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/MERRA2/sfc/edgar-v42.emis_co.anthropogenic.x1152_y721.19700703T12z_20200703T00z.w1A4.nc4 +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbae.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbae.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbae.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbaf.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbaf.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbaf.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbbo.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbbo.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbbo.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbla.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbla.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbla.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbnb.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbnb.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---bbnb.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffru.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffru.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---ffru.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---full.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---full.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---full.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp---nbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp.rc new file mode 100644 index 00000000..f079fc36 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp.rc @@ -0,0 +1,27 @@ +# +# CO main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Biomass burning +# ------------------|-------|------------ +# Asia and Europe | bbae | 3, 9, 10 # no longer includes SE Asia +# North America | bbna | 1 +# Cen. & S. America | bbla | 2, 6 +# Africa | bbaf | 5 +# Global | bbgl | Global +# ------------------|-------|------------ +# Non-biomass burning +# ------------------|-------|------------ +# Asia | nbas | 4, 10 +# North America | nbna | 1 +# Europe | nbeu | 3, 9 +# Global | nbgl | Global +# ------------------|-------|------------ + +CO_instances: full bbae bbna bbla bbaf bbgl nbas nbna nbeu nbgl diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp_ExtData.rc new file mode 100755 index 00000000..7f928435 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/20000401-present/CO_GridComp_ExtData.rc @@ -0,0 +1,111 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_co.005.%y4%m2%d2.nc4 +CO_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_CH4 NA N Y %y4-%m2-%d2t12:00:00 none none CH4 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_BF NA Y Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf /dev/null +CO_FS NA N Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/MERRA2/sfc/edgar-v42.emis_co.anthropogenic.x1152_y721.19700703T12z_20200703T00z.w1A4.nc4 +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbae.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbae.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbae.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbaf.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbaf.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbaf.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbbo.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbbo.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbbo.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbla.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbla.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbla.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbnb.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbnb.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---bbnb.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffru.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffru.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---ffru.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---full.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---full.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---full.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbas.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbgl.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp---nbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp.rc new file mode 100644 index 00000000..f079fc36 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp.rc @@ -0,0 +1,27 @@ +# +# CO main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Biomass burning +# ------------------|-------|------------ +# Asia and Europe | bbae | 3, 9, 10 # no longer includes SE Asia +# North America | bbna | 1 +# Cen. & S. America | bbla | 2, 6 +# Africa | bbaf | 5 +# Global | bbgl | Global +# ------------------|-------|------------ +# Non-biomass burning +# ------------------|-------|------------ +# Asia | nbas | 4, 10 +# North America | nbna | 1 +# Europe | nbeu | 3, 9 +# Global | nbgl | Global +# ------------------|-------|------------ + +CO_instances: full bbae bbna bbla bbaf bbgl nbas nbna nbeu nbgl diff --git a/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp_ExtData.rc new file mode 100755 index 00000000..7f928435 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/MERRA2/CO_GridComp_ExtData.rc @@ -0,0 +1,111 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_co.005.%y4%m2%d2.nc4 +CO_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_CH4 NA N Y %y4-%m2-%d2t12:00:00 none none CH4 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +CO_BF NA Y Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf /dev/null +CO_FS NA N Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/MERRA2/sfc/edgar-v42.emis_co.anthropogenic.x1152_y721.19700703T12z_20200703T00z.w1A4.nc4 +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + diff --git a/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp---bbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp---bbgl.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp---bbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp---full.rc b/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp---full.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp---full.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp.rc b/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp.rc new file mode 100644 index 00000000..f079fc36 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp.rc @@ -0,0 +1,27 @@ +# +# CO main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Biomass burning +# ------------------|-------|------------ +# Asia and Europe | bbae | 3, 9, 10 # no longer includes SE Asia +# North America | bbna | 1 +# Cen. & S. America | bbla | 2, 6 +# Africa | bbaf | 5 +# Global | bbgl | Global +# ------------------|-------|------------ +# Non-biomass burning +# ------------------|-------|------------ +# Asia | nbas | 4, 10 +# North America | nbna | 1 +# Europe | nbeu | 3, 9 +# Global | nbgl | Global +# ------------------|-------|------------ + +CO_instances: full bbae bbna bbla bbaf bbgl nbas nbna nbeu nbgl diff --git a/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp_ExtData.rc new file mode 100755 index 00000000..97f93b83 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/NR/CO_GridComp_ExtData.rc @@ -0,0 +1,111 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/PIESA/sfc/QFED/v2.4r6/NR/Y%y4/M%m2/qfed2.emis_co.005.%y4%m2%d2.nc4 +CO_OH NA Y Y %y4-%m2-%d2t12:00:00 none none oh ExtData/AeroCom/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CO_CH4 NA Y Y %y4-%m2-%d2t12:00:00 none none ch4 ExtData/AeroCom/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CO_BF NA Y Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf /dev/null +CO_FS NA N Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/NR/sfc/EDGAR.co_fossilfuel_biofuel.x3600_y1800.t14.%y4.nc4 +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbae.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbae.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbae.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbaf.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbaf.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbaf.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbbo.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbbo.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbbo.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbgl.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbla.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbla.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbla.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbna.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbnb.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbnb.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---bbnb.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffas.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffas.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffeu.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffna.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffna.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffru.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffru.rc new file mode 100644 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---ffru.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---full.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---full.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---full.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbas.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbas.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbas.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbeu.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbeu.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbeu.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbgl.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbgl.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbgl.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbna.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbna.rc new file mode 100755 index 00000000..ddf34b47 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp---nbna.rc @@ -0,0 +1,13 @@ +# +# Resource file for CO parameters. +# + +# Run-time debug switch (0 off, 1 on) +# ----------------------------------- +DEBUG: 0 + +# Run-time switch on OH provider units +# Permissable string is "mol/mol" or "mol mol-1" +# else resorts to assuming "molecules cm-3" +#------------------------------------------ +units_oh: 0 diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp.rc new file mode 100644 index 00000000..f079fc36 --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp.rc @@ -0,0 +1,27 @@ +# +# CO main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Biomass burning +# ------------------|-------|------------ +# Asia and Europe | bbae | 3, 9, 10 # no longer includes SE Asia +# North America | bbna | 1 +# Cen. & S. America | bbla | 2, 6 +# Africa | bbaf | 5 +# Global | bbgl | Global +# ------------------|-------|------------ +# Non-biomass burning +# ------------------|-------|------------ +# Asia | nbas | 4, 10 +# North America | nbna | 1 +# Europe | nbeu | 3, 9 +# Global | nbgl | Global +# ------------------|-------|------------ + +CO_instances: full bbae bbna bbla bbaf bbgl nbas nbna nbeu nbgl diff --git a/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp_ExtData.rc new file mode 100755 index 00000000..89c0ea3f --- /dev/null +++ b/ESMF/GOCART_GridComp/CO_GridComp/PIESA/CO_GridComp_ExtData.rc @@ -0,0 +1,113 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +CO_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 1.11 biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_co.005.%y4%m2%d2.nc4 +CO_OH NA Y Y %y4-%m2-%d2t12:00:00 none none oh ExtData/AeroCom/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CO_CH4 NA Y Y %y4-%m2-%d2t12:00:00 none none ch4 ExtData/AeroCom/L72/gmi_oh_ch4_h2o2_no3.x144_y91_z72_t12.2006.nc +CO_BF NA Y Y %y4-%m2-%d2t12:00:00 none 1.19 emcobf ExtData/AeroCom/sfc/co_biofuel_v2.x360_y181_t12.2001.nc +CO_FS NA Y Y %y4-%m2-%d2t12:00:00 none 1.20 emcofs ExtData/AeroCom/sfc/co_fossilfuel_v2.x360_y181_t12.2001.nc +CO_ISOP NA Y Y %y4-%m2-%d2t12:00:00 none 0.2 emcoisop ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_NVOC NA Y Y %y4-%m2-%d2t12:00:00 none none emconvoc ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc +CO_TERP NA Y Y %y4-%m2-%d2t12:00:00 none none emcoterp ExtData/AeroCom/sfc/co_biogenic.x288_y181_t12.2006.nc + +CO_CH4bbae NA Y Y - none none ch4 /dev/null +CO_BFbbae NA Y Y - none none bf /dev/null +CO_FSbbae NA Y Y - none none fs /dev/null +CO_ISOPbbae NA Y Y - none none isop /dev/null +CO_NVOCbbae NA Y Y - none none nvoc /dev/null +CO_TERPbbae NA Y Y - none none terp /dev/null +# +CO_CH4bbna NA Y Y - none none ch4 /dev/null +CO_BFbbna NA Y Y - none none bf /dev/null +CO_FSbbna NA Y Y - none none fs /dev/null +CO_ISOPbbna NA Y Y - none none isop /dev/null +CO_NVOCbbna NA Y Y - none none nvoc /dev/null +CO_TERPbbna NA Y Y - none none terp /dev/null +# +CO_CH4bbla NA Y Y - none none ch4 /dev/null +CO_BFbbla NA Y Y - none none bf /dev/null +CO_FSbbla NA Y Y - none none fs /dev/null +CO_ISOPbbla NA Y Y - none none isop /dev/null +CO_NVOCbbla NA Y Y - none none nvoc /dev/null +CO_TERPbbla NA Y Y - none none terp /dev/null +# +CO_CH4bbaf NA Y Y - none none ch4 /dev/null +CO_BFbbaf NA Y Y - none none bf /dev/null +CO_FSbbaf NA Y Y - none none fs /dev/null +CO_ISOPbbaf NA Y Y - none none isop /dev/null +CO_NVOCbbaf NA Y Y - none none nvoc /dev/null +CO_TERPbbaf NA Y Y - none none terp /dev/null +# +CO_CH4bbgl NA Y Y - none none ch4 /dev/null +CO_BFbbgl NA Y Y - none none bf /dev/null +CO_FSbbgl NA Y Y - none none fs /dev/null +CO_ISOPbbgl NA Y Y - none none isop /dev/null +CO_NVOCbbgl NA Y Y - none none nvoc /dev/null +CO_TERPbbgl NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbna NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbeu NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbas NA Y Y - none none terp /dev/null +# +CO_BIOMASSnbgl NA Y Y - none none terp /dev/null +# +CO_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + + + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +CO_BIOMASSbbae regionmask(CO_BIOMASS,CO_regionMask;3,9,10) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbna regionmask(CO_BIOMASS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbla regionmask(CO_BIOMASS,CO_regionMask;2,6) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbaf regionmask(CO_BIOMASS,CO_regionMask;5) %y4-%m2-%d2t12:00:00 +CO_BIOMASSbbgl CO_BIOMASS %y4-%m2-%d2t12:00:00 +# +CO_CH4nbna regionmask(CO_CH4,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_BFnbna regionmask(CO_BF,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_FSnbna regionmask(CO_FS,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_ISOPnbna regionmask(CO_ISOP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_NVOCnbna regionmask(CO_NVOC,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +CO_TERPnbna regionmask(CO_TERP,CO_regionMask;1) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbeu regionmask(CO_CH4,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_BFnbeu regionmask(CO_BF,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_FSnbeu regionmask(CO_FS,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_ISOPnbeu regionmask(CO_ISOP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_NVOCnbeu regionmask(CO_NVOC,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +CO_TERPnbeu regionmask(CO_TERP,CO_regionMask;3,9) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbas regionmask(CO_CH4,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_BFnbas regionmask(CO_BF,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_FSnbas regionmask(CO_FS,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_ISOPnbas regionmask(CO_ISOP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_NVOCnbas regionmask(CO_NVOC,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +CO_TERPnbas regionmask(CO_TERP,CO_regionMask;4,10) %y4-%m2-%d2t12:00:00 +# +CO_CH4nbgl CO_CH4 %y4-%m2-%d2t12:00:00 +CO_BFnbgl CO_BF %y4-%m2-%d2t12:00:00 +CO_FSnbgl CO_FS %y4-%m2-%d2t12:00:00 +CO_ISOPnbgl CO_ISOP %y4-%m2-%d2t12:00:00 +CO_NVOCnbgl CO_NVOC %y4-%m2-%d2t12:00:00 +CO_TERPnbgl CO_TERP %y4-%m2-%d2t12:00:00 +# +CO_OHbbae CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbla CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbaf CO_OH %y4-%m2-%d2t12:00:00 +CO_OHbbgl CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbna CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbeu CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbas CO_OH %y4-%m2-%d2t12:00:00 +CO_OHnbgl CO_OH %y4-%m2-%d2t12:00:00 +%% + diff --git a/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C1/DU_GridComp---full.rc b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C1/DU_GridComp---full.rc new file mode 100755 index 00000000..4bb69220 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C1/DU_GridComp---full.rc @@ -0,0 +1,32 @@ +# +# Resource file Dust parameters. +# + +number_dust_bins: 5 + +particle_radius: 0.73 1.4 2.4 4.5 8.0 + +radius_lower: 0.1 1.0 1.8 3.0 6.0 + +radius_upper: 1.0 1.8 3.0 6.0 10.0 + +source_fraction: 0.1 0.25 0.25 0.25 0.25 + +soil_density: 2500. 2650. 2650. 2650. 2650. + +# Resolution dependent tuning constant for emissions (a,b,c,d,e,f) +Ch_DU: 0.2 0.2 0.08 0.08 0.08 0.067 + +# Scavenging efficiency per bin [km-1] +fscav: 0.2 0.2 0.2 0.2 0.2 # + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.1 0.1 0.1 0.1 0.1 + +# Number of particles per kg mass +fnum: 2.45e14 3.28e13 6.52e12 9.89e11 1.76e11 + +rhFlag: 0 + +# Maring settling velocity correction +maringFlag: 0 diff --git a/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C1/DU_GridComp.rc b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C1/DU_GridComp.rc new file mode 100755 index 00000000..0cd052e7 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C1/DU_GridComp.rc @@ -0,0 +1,22 @@ +# +# DU main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bo | [45N,90N] +# Non-Boreal | nb | [90S,45N) +# Northern Asia | nas | 9, 10 +# Southern Asian | sas | 4 +# Europe | eur | 3 +# North America | nam | 1, 2 +# South America | sam | 6 +# Australia | aus | 7 +# Africa | afr | 5 +# ------------------|-------|------------ + +DU_instances: full diff --git a/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C1/DU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C1/DU_GridComp_ExtData.rc new file mode 100644 index 00000000..2787d3e9 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C1/DU_GridComp_ExtData.rc @@ -0,0 +1,7 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +DU_SRC NA N Y - none none du_src ExtData/PIESA/sfc/gocart.dust_source.v5a.x1152_y721.nc +%% diff --git a/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C2/DU_GridComp---full.rc b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C2/DU_GridComp---full.rc new file mode 100755 index 00000000..4bb69220 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C2/DU_GridComp---full.rc @@ -0,0 +1,32 @@ +# +# Resource file Dust parameters. +# + +number_dust_bins: 5 + +particle_radius: 0.73 1.4 2.4 4.5 8.0 + +radius_lower: 0.1 1.0 1.8 3.0 6.0 + +radius_upper: 1.0 1.8 3.0 6.0 10.0 + +source_fraction: 0.1 0.25 0.25 0.25 0.25 + +soil_density: 2500. 2650. 2650. 2650. 2650. + +# Resolution dependent tuning constant for emissions (a,b,c,d,e,f) +Ch_DU: 0.2 0.2 0.08 0.08 0.08 0.067 + +# Scavenging efficiency per bin [km-1] +fscav: 0.2 0.2 0.2 0.2 0.2 # + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.1 0.1 0.1 0.1 0.1 + +# Number of particles per kg mass +fnum: 2.45e14 3.28e13 6.52e12 9.89e11 1.76e11 + +rhFlag: 0 + +# Maring settling velocity correction +maringFlag: 0 diff --git a/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C2/DU_GridComp.rc b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C2/DU_GridComp.rc new file mode 100755 index 00000000..0cd052e7 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C2/DU_GridComp.rc @@ -0,0 +1,22 @@ +# +# DU main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bo | [45N,90N] +# Non-Boreal | nb | [90S,45N) +# Northern Asia | nas | 9, 10 +# Southern Asian | sas | 4 +# Europe | eur | 3 +# North America | nam | 1, 2 +# South America | sam | 6 +# Australia | aus | 7 +# Africa | afr | 5 +# ------------------|-------|------------ + +DU_instances: full diff --git a/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C2/DU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C2/DU_GridComp_ExtData.rc new file mode 100644 index 00000000..2787d3e9 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/CCMI_REF-C2/DU_GridComp_ExtData.rc @@ -0,0 +1,7 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +DU_SRC NA N Y - none none du_src ExtData/PIESA/sfc/gocart.dust_source.v5a.x1152_y721.nc +%% diff --git a/ESMF/GOCART_GridComp/DU_GridComp/CMIP/DU_GridComp---full.rc b/ESMF/GOCART_GridComp/DU_GridComp/CMIP/DU_GridComp---full.rc new file mode 100644 index 00000000..2130c313 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/CMIP/DU_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file Dust parameters. +# + +number_dust_bins: 5 + + +particle_radius: 0.73 1.4 2.4 4.5 8.0 + +radius_lower: 0.1 1.0 1.8 3.0 6.0 + +radius_upper: 1.0 1.8 3.0 6.0 10.0 + +source_fraction: 0.1 0.25 0.25 0.25 0.25 + +soil_density: 2500. 2650. 2650. 2650. 2650. + +# Resolution dependent tuning constant for emissions (a,b,c,d,e,f) +Ch_DU: 0.2 0.2 0.08 0.08 0.08 0.067 + +# Scavenging efficiency per bin [km-1] +fscav: 0.2 0.2 0.2 0.2 0.2 # + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.1 0.1 0.1 0.1 0.1 + +# Number of particles per kg mass +fnum: 2.45e14 3.28e13 6.52e12 9.89e11 1.76e11 + +rhFlag: 0 + +# Maring settling velocity correction +maringFlag: 1 diff --git a/ESMF/GOCART_GridComp/DU_GridComp/CMIP/DU_GridComp.rc b/ESMF/GOCART_GridComp/DU_GridComp/CMIP/DU_GridComp.rc new file mode 100755 index 00000000..14ba946b --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/CMIP/DU_GridComp.rc @@ -0,0 +1,22 @@ +# +# DU main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bo | [45N,90N] +# Non-Boreal | nb | [90S,45N) +# Northern Asia | nas | 9, 10 +# Southern Asian | sas | 4 +# Europe | eur | 3 +# North America | nam | 1, 2 +# South America | sam | 6 +# Australia | aus | 7 +# Africa | afr | 5 +# ------------------|-------|------------ + +DU_instances: full afr sas aus diff --git a/ESMF/GOCART_GridComp/DU_GridComp/CMIP/DU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/DU_GridComp/CMIP/DU_GridComp_ExtData.rc new file mode 100644 index 00000000..854ae394 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/CMIP/DU_GridComp_ExtData.rc @@ -0,0 +1,7 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +DU_SRC NA N Y - none none du_src ExtData/CMIP/sfc/DU/gocart.dust_source.v5a_1x1inp.x360_y181.nc +%% diff --git a/ESMF/GOCART_GridComp/DU_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/DU_GridComp/CMakeLists.txt new file mode 100644 index 00000000..de2df990 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-E\;-C\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/DU_GridComp/DU_GridComp---full.rc b/ESMF/GOCART_GridComp/DU_GridComp/DU_GridComp---full.rc new file mode 100644 index 00000000..f2c21240 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/DU_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file Dust parameters. +# + +number_dust_bins: 5 + + +particle_radius: 0.73 1.4 2.4 4.5 8.0 + +radius_lower: 0.1 1.0 1.8 3.0 6.0 + +radius_upper: 1.0 1.8 3.0 6.0 10.0 + +source_fraction: 0.1 0.25 0.25 0.25 0.25 + +soil_density: 2500. 2650. 2650. 2650. 2650. + +# Resolution dependent tuning constant for emissions (a,b,c,d,e,f) +Ch_DU: 0.2 0.2 0.07 0.07 0.07 0.056 + +# Scavenging efficiency per bin [km-1] +fscav: 0.2 0.2 0.2 0.2 0.2 # + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.1 0.1 0.1 0.1 0.1 + +# Number of particles per kg mass +fnum: 2.45e14 3.28e13 6.52e12 9.89e11 1.76e11 + +rhFlag: 0 + +# Maring settling velocity correction +maringFlag: 1 diff --git a/ESMF/GOCART_GridComp/DU_GridComp/DU_GridComp.rc b/ESMF/GOCART_GridComp/DU_GridComp/DU_GridComp.rc new file mode 100755 index 00000000..0cd052e7 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/DU_GridComp.rc @@ -0,0 +1,22 @@ +# +# DU main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bo | [45N,90N] +# Non-Boreal | nb | [90S,45N) +# Northern Asia | nas | 9, 10 +# Southern Asian | sas | 4 +# Europe | eur | 3 +# North America | nam | 1, 2 +# South America | sam | 6 +# Australia | aus | 7 +# Africa | afr | 5 +# ------------------|-------|------------ + +DU_instances: full diff --git a/ESMF/GOCART_GridComp/DU_GridComp/DU_GridCompMod.F90 b/ESMF/GOCART_GridComp/DU_GridComp/DU_GridCompMod.F90 new file mode 100644 index 00000000..34792246 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/DU_GridCompMod.F90 @@ -0,0 +1,2075 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: DU_GridCompMod --- DU Grid Component Class +! +! !INTERFACE: +! + + module DU_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + + use Chem_Mod ! Chemistry Base Class + use Chem_StateMod ! Chemistry State + use Chem_ConstMod, only: grav, undefval => undef ! Constants + use Chem_UtilMod ! I/O + use Chem_MieMod ! Aerosol LU Tables, calculator + use m_inpak90 ! Resource file management + use m_die, only: die + use DustEmissionMod ! Emissions + use Chem_SettlingMod ! Settling + use DryDepositionMod ! Dry deposition + use WetRemovalMod ! Large-scale wet removal + use ConvectionMod ! Offline convective mixing/scavenging + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC DU_GridComp ! The DU object + PUBLIC DU_GridComp1 ! Single instance DU object + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC DU_GridCompSetServices + PUBLIC DU_GridCompInitialize + PUBLIC DU_GridCompRun1 + PUBLIC DU_GridCompRun2 + PUBLIC DU_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) DU Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! 16Aug2005 da Silva Passed ESMF grid to MPread(). +! +!EOP +!------------------------------------------------------------------------- + + type DU_GridComp1 + character(len=255) :: name + character(len=255) :: iname ! instance name + character(len=255) :: rcfilen ! resource file name + + integer :: instance ! instance number + + logical :: run_alarm = .false. ! run alarm + + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + integer :: rhFlag ! choice of relative humidity parameterization for radius + logical :: maringFlag ! settling velocity correction + real, pointer :: src(:,:) ! Ginoux dust sources + real, pointer :: radius(:) ! particle effective radius [um] + real, pointer :: rlow(:) ! particle effective radius lower bound [um] + real, pointer :: rup(:) ! particle effective radius upper bound [um] + real, pointer :: sfrac(:) ! fraction of total source + real, pointer :: rhop(:) ! soil class density [kg m-3] + integer :: nymd + real :: Ch_DU ! dust emission tuning coefficient [kg s2 m-5]. + +! Workspace for any requested point emissions (handled in run) +! ------------------------------------------------------------ + logical :: doing_point_emissions=.FALSE. ! providing pointwise emissions + character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions + integer :: nPts = -1 + integer, pointer, dimension(:) :: pstart => null(), pend => null() + real, pointer, dimension(:) :: pLat => null(), & + pLon => null(), & + pBase => null(), & + pTop => null(), & + pEmis => null() + end type DU_GridComp1 + + type DU_GridComp + integer :: n = 0 ! number of instances + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + type(DU_GridComp1), pointer :: gcs(:) => null() ! instances + end type DU_GridComp + + character(len=*), parameter :: rc_basename = 'DU_GridComp' + + + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + real, parameter :: radTODeg = 57.2957795 + +CONTAINS + + subroutine DU_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: n, i + + type(ESMF_Config) :: cfg + + Iam = "DU_GridCompSetServices" + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(rc=status) + VERIFY_(STATUS) + call ESMF_ConfigLoadFile(cfg,trim(rc_basename)//'.rc',rc=status) + VERIFY_(STATUS) + +! Parse resource file +! ------------------- + n = ESMF_ConfigGetLen(cfg,label='DU_instances:',rc=status) + VERIFY_(STATUS) + + +! We have 5 tracers for each instance of DU +! We cannot have fewer instances than half the number of +! DU bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( 5*n .LT. chemReg%n_DU ) then + rc = 35 + return + else if ( 5*n .GT. chemReg%n_DU ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(Iam)// & + ': fewer DU bins than possible DU instances: ',& + n, chemReg%n_DU/5 + end if + n = min(n,chemReg%n_DU/5 ) + +! Record name of each instance +! ---------------------------- + call ESMF_ConfigFindLabel(cfg,'DU_instances:',rc=status) + VERIFY_(STATUS) + do i = 1, n + call ESMF_ConfigGetAttribute(cfg,name,rc=status) + VERIFY_(STATUS) + ! resource file name + IF(TRIM(name) == "full" ) THEN + name = " " ! blank instance name for full (1) + ELSE + name = TRIM(name) ! instance name for others + END IF + call DU_GridCompSetServices1_(gc,chemReg,name,rc=status) + VERIFY_(STATUS) + end do + + RETURN_(ESMF_SUCCESS) + end subroutine DU_GridCompSetServices + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_GridCompInitialize --- Initialize DU_GridComp +! +! !INTERFACE: +! + + subroutine DU_GridCompInitialize ( gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(DU_GridComp), intent(inout) :: gcDU ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the DU Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'DU_GridCompInitialize' + CHARACTER(LEN=255) :: name + + integer i, ier, n + +! Load resource file +! ------------------ + call i90_loadf ( trim(rc_basename)//'.rc', ier ) + if ( ier .NE. 0 ) then + rc = 10 + return + end if + +! Parse resource file +! ------------------- + CALL I90_label ( 'DU_instances:', ier ) + if ( ier .NE. 0 ) then + rc = 20 + return + end if + +! First determine how many instances we have +! ------------------------------------------ + n = 0 + do while ( ier .EQ. 0 ) + CALL I90_gtoken( name, ier ) + n = n + 1 + end do + if ( n .EQ. 0 ) then + rc = 30 + return + end if + +! We have 5 tracers for each instance of DU +! We cannot have fewer instances than half the number of +! DU bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( 5*n .LT. w_c%reg%n_DU ) then + rc = 35 + return + else if ( 5*n .GT. w_c%reg%n_DU ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(myname)// & + ': fewer DU bin sets than possible DU instances'//& + ' (5 bins per instance): ',& + n, w_c%reg%n_DU + end if + n = min(n,w_c%reg%n_DU/5) + gcDU%n = n + +! Next allocate necessary memory +! ------------------------------ + allocate ( gcDU%gcs(n), stat=ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + +! Record name of each instance +! ---------------------------- + CALL I90_label ( 'DU_instances:', ier ) + do i = 1, n + CALL I90_gtoken( name, ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + ! resource file name + gcDU%gcs(i)%rcfilen = trim(rc_basename)//'---'//trim(name)//'.rc' + gcDU%gcs(i)%instance = i ! instance number + IF(TRIM(name) == "full" ) THEN + gcDU%gcs(i)%iname = " " ! blank instance name for full (1) + ELSE + gcDU%gcs(i)%iname = TRIM(name) ! instance name for others + END IF + end do + +! Next initialize each instance +! ----------------------------- + do i = 1, gcDU%n + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,myname,": Initializing instance ",TRIM(gcDU%gcs(i)%iname)," [",gcDU%gcs(i)%instance,"]" + END IF + call DU_SingleInstance_ ( DU_GridCompInitialize1_, i, & + gcDU%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = 1000+ier + return + end if + gcDU%gcs(i)%mie_tables => gcDU%mie_tables + end do + +! All done +! -------- + CALL I90_FullRelease( ier ) + IF( ier /= 0 ) THEN + PRINT *,myname,": I90_FullRelease not successful." + rc = 40 + END IF + + end subroutine DU_GridCompInitialize + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_GridCompRun1 --- Run DU_GridComp +! +! !INTERFACE: +! + + subroutine DU_GridCompRun1 ( gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(DU_GridComp), INTENT(INOUT) :: gcDU ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the DU Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcDU%n + call DU_SingleInstance_ ( DU_GridCompRun1_, i, & + gcDU%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine DU_GridCompRun1 + + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_GridCompRun2 --- Run DU_GridComp +! +! !INTERFACE: +! + + subroutine DU_GridCompRun2 ( gcDU, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + LOGICAL, INTENT(IN) :: run_alarm ! run alarm + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(DU_GridComp), INTENT(INOUT) :: gcDU ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the DU Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcDU%n + gcDU%gcs(i)%run_alarm = run_alarm + + call DU_SingleInstance_ ( DU_GridCompRun2_, i, & + gcDU%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine DU_GridCompRun2 + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_GridCompFinalize --- Finalize DU_GridComp +! +! !INTERFACE: +! + + subroutine DU_GridCompFinalize ( gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(DU_GridComp), INTENT(INOUT) :: gcDU ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the DU Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcDU%n + call DU_SingleInstance_ ( DU_GridCompFinalize1_, i, & + gcDU%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + if (associated(gcDU%gcs)) deallocate ( gcDU%gcs, stat=ier ) + gcDU%n = -1 + + end subroutine DU_GridCompFinalize + + + subroutine DU_GridCompSetServices1_( gc, chemReg, iname, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + character(len=*), intent(IN ) :: iname + integer, intent(OUT ) :: rc + + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + Iam = "DU_GridCompSetServices1_" + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'DU_SRC'//trim(iname), & + LONG_NAME = 'erod' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + RETURN_(ESMF_SUCCESS) + + end subroutine DU_GridCompSetServices1_ + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_GridCompInitialize --- Initialize DU_GridComp +! +! !INTERFACE: +! + + subroutine DU_GridCompInitialize1_ ( gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(DU_GridComp1), intent(inout) :: gcDU ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the DU Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'DU_GridCompInitialize1_' + + + character(len=255) :: rcfilen + integer :: n + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, nbins_rc + integer, allocatable :: ier(:) + real :: qmax, qmin + real :: radius, rlow, rup, rhop, fscav, fnum, molwght + integer :: irhFlag + integer :: imaringFlag + + integer, parameter :: nhres = 6 ! number of horizontal model resolutions: a,b,c,d,e + real :: Ch_DU(nhres) ! emission tuning coefficient buffer + + + rcfilen = trim(gcDU%rcfilen) + gcDU%name = 'DU Constituent Package' + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + nbins = w_c%reg%n_DU + n1 = w_c%reg%i_DU + n2 = w_c%reg%j_DU + + call init_() + if ( rc /= 0 ) return + + +! ------------------- +! Parse resource file +! ------------------- + +! Load resource file +! ------------------ + call i90_loadf ( rcfilen, ier(1) ) + if ( ier(1) .ne. 0 ) then + call final_(10) + return + end if + + call i90_label ( 'number_dust_bins:', ier(1) ) + nbins_rc = i90_gint ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(20) + return + end if + if ( nbins_rc /= nbins ) then + call final_(25) + return + end if + +! Particle radius +! --------------- + call i90_label ( 'particle_radius:', ier(1) ) + do n = 1, nbins + radius = i90_gfloat ( ier(n+1) ) + gcDU%radius(n) = radius + w_c%reg%rmed(n1+n-1) = radius * 1.e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Particle radius (lower bound) +! --------------- + call i90_label ( 'radius_lower:', ier(1) ) + do n = 1, nbins + rlow = i90_gfloat ( ier(n+1) ) + gcDU%rlow(n) = rlow + w_c%reg%rlow(n1+n-1) = rlow * 1.e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Particle radius (upper bound) +! --------------- + call i90_label ( 'radius_upper:', ier(1) ) + do n = 1, nbins + rup = i90_gfloat ( ier(n+1) ) + gcDU%rup(n) = rup + w_c%reg%rup(n1+n-1) = rup * 1.e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Source fraction +! --------------- + call i90_label ( 'source_fraction:', ier(1) ) + do n = 1, nbins + gcDU%sfrac(n) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Soil Density +! --------------- + call i90_label ( 'soil_density:', ier(1) ) + do n = 1, nbins + rhop = i90_gfloat ( ier(n+1) ) + gcDU%rhop(n) = rhop + w_c%reg%rhop(n1+n-1) = rhop + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Scavenging Efficiency +! To be used in convtran.F90, this parameter +! is the scavenging efficiency of the tracer [km -1] +! --------------- + call i90_label ( 'fscav:', ier(1) ) + do n = 1, nbins + fscav = i90_gfloat ( ier(n+1) ) + w_c%reg%fscav(n1+n-1) = fscav + w_c%qa(n1+n-1)%fscav = fscav + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Number to mass conversion factor +! To be used in droplet activation code +! --------------- + call i90_label ( 'fnum:', ier(1) ) + do n = 1, nbins + fnum = i90_gfloat ( ier(n+1) ) + w_c%reg%fnum(n1+n-1) = fnum + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Molecular weight +! To be used in droplet activation code +! --------------- + call i90_label ( 'molecular_weight:', ier(1) ) + do n = 1, nbins + molwght = i90_gfloat ( ier(n+1) ) + w_c%reg%molwght(n1+n-1) = molwght + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Particle affected by relative humidity? +! --------------- + call i90_label ( 'rhFlag:', ier(1) ) + irhFlag = i90_gint ( ier(2) ) + gcDU%rhFlag = irhFlag + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Dust emission tuning coefficient [kg s2 m-5]. NOT bin specific. +! --------------------------------------------------------------- + CALL I90_Label ( 'Ch_DU:', ier(1) ) + do n = 1, nhres + Ch_DU(n) = i90_gfloat ( ier(n+1) ) + end do + gcDU%Ch_DU = Chem_UtilResVal(im, jm, Ch_DU(:), ier(nhres + 2)) + gcDU%Ch_DU = gcDU%Ch_DU * 1.00E-09 + if ( any(ier(1:nhres+2) /= 0) ) then + call final_(50) + return + end if + +! Settling velocity correction following Maring et al, 2003 +! --------------- + call i90_label ( 'maringFlag:', ier(1) ) + imaringFlag = i90_gint ( ier(2) ) + if (imaringFlag /= 0) then + gcDU%maringFlag = .True. + else + gcDU%maringFlag = .False. + end if + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + +! Handle Point-wise Emission Sources Specified in a Text File +! ----------------------------------------------------------- + ier(:) = 0 + call i90_label ( 'point_emissions_srcfilen:', ier(1) ) + call i90_gtoken ( gcDU%point_emissions_srcfilen, ier(2) ) + if ( ier(1) /= 0 ) then + gcDU%doing_point_emissions = .FALSE. ! if rc is missing, don't fuss + else if ( any(ier(2:2) /= 0) ) then + call final_(42) ! this means point emissions info is messed up, abort + return + else + if ( (index(gcDU%point_emissions_srcfilen,'/dev/null')>0) ) then + gcDU%doing_point_emissions = .FALSE. ! disable it if no file specified + else + gcDU%doing_point_emissions = .TRUE. ! we are good to go + end if + end if + + +! ------- +! Initialize date for BCs +! ----------------------- + gcDU%nymd = -1 ! nothing read yet + +! All done +! -------- + call i90_release() + deallocate(ier) + + return + + +CONTAINS + + subroutine init_() + integer ios, nerr + nerr = max ( 32, nbins+1 ) + allocate ( gcDU%radius(nbins), gcDU%src(i1:i2,j1:j2), & + gcDU%rlow(nbins), gcDU%rup(nbins), & + gcDU%sfrac(nbins), gcDU%rhop(nbins), ier(nerr), & + stat=ios ) + if ( ios /= 0 ) rc = 100 + end subroutine init_ + + subroutine final_(ierr) + integer :: ierr + integer ios + deallocate ( gcDU%radius, gcDU%src, gcDU%sfrac, gcDU%rhop, & + gcDU%rlow, gcDU%rup, ier, stat=ios ) + call i90_release() + rc = ierr + end subroutine final_ + + end subroutine DU_GridCompInitialize1_ + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_GridCompRun1_ --- The Chem Driver, run phase 1 +! +! !INTERFACE: +! + + subroutine DU_GridCompRun1_ ( gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(DU_GridComp1), intent(inout) :: gcDU ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called DU Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'DU_GridCompRun1_' + character(len=*), parameter :: Iam = myname + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n + integer :: i, j, ijl, ijkl + real :: qmax, qmin + real, pointer :: DU_radius(:), DU_rhop(:) + real, pointer :: emissions(:,:), dqa(:,:) + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: gwettop, oro, u10m, v10m, & + ustar + real, pointer, dimension(:,:,:) :: rhoa + real, pointer, dimension(:,:) :: frlake + real, pointer, dimension(:,:) :: du_src => null() + +#define EXPORT expChem +#define iNAME TRIM(gcDU%iname) + +#define ptrDUEM DU_emis + + integer :: STATUS + +! Indices for point emissions + integer, pointer, dimension(:) :: iPoint, jPoint + real, dimension(w_c%grid%km) :: point_column_emissions + integer :: ios, ii + + +#include "DU_GetPointer___.h" + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_DU + n1 = w_c%reg%i_DU + n2 = w_c%reg%j_DU + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + + if ( nbins /= NBIN_DUEM .OR. nbins /= NBIN_DUWT .OR. & + nbins /= NBIN_DUDP .OR. nbins /= NBIN_DUSD ) then + call die(myname,'inconsistent bins in resource file and registry') + endif + +! Update emissions/production if necessary (daily) +! ------------------------------------------ + if(gcDU%nymd < 0) then + + call MAPL_GetPointer( impChem, du_src, 'DU_SRC'//iNAME, rc=status) + VERIFY_(STATUS) + gcDU%src = du_src + +! As a safety check, where du_src is undefined set to 0 +! ----------------------------------------------------- + do j = j1, j2 + do i = i1, i2 + if(1.01*gcDU%src(i,j) .gt. undefval) gcDU%src(i,j) = 0. + enddo + enddo + +#ifdef DEBUG + call pmaxmin('DU: src', gcDU%src, qmin, qmax, ijl, 1, 1. ) +#endif + + gcDU%nymd = nymd + + endif + +! Read any pointwise emissions, if requested +! ------------------------------------------ + if(gcDU%doing_point_emissions) then + call Chem_UtilPointEmissions( nymd, gcDU%point_emissions_srcfilen, & + gcDU%nPts, gcDU%pLat, gcDU%pLon, & + gcDU%pBase, gcDU%pTop, gcDU%pEmis, & + gcDU%pStart, gcDU%pEnd ) + +! In case pStart or pEnd were not specified in the file set to defaults + where(gcDU%pStart < 0) gcDU%pStart = 000000 + where(gcDU%pEnd < 0) gcDU%pEnd = 240000 + endif + + +! Dust particle radius [m] and density [kg m-3] +! --------------------------------------------- + allocate( DU_radius(nbins), DU_rhop(nbins) ) + DU_radius = 1.e-6*gcDU%radius + DU_rhop = gcDU%rhop + allocate( emissions(i1:i2,j1:j2), dqa(i1:i2,j1:j2), stat=STATUS) + VERIFY_(STATUS) + + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('DU: q_beg', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, frlake, 'FRLAKE', __RC__ ) + call MAPL_GetPointer ( impChem, gwettop, 'WET1', __RC__ ) + call MAPL_GetPointer ( impChem, oro, 'LWI', __RC__ ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', __RC__ ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', __RC__ ) + call MAPL_GetPointer ( impChem, ustar, 'USTAR', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + +#ifdef DEBUG + + call pmaxmin('DU: frlake ', frlake , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: gwtop ', gwettop , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: oro ', oro , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: u10m ', u10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: v10m ', v10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: ustar ', ustar , qmin, qmax, ijl,1, 1. ) + +#endif + +! Dust Source +! ----------- + do n = 1, nbins + emissions = 0.0 + dqa = 0.0 + + call DustEmissionGOCART( i1, i2, j1, j2, km, DU_radius(n), & + frlake, gwettop, oro, u10m, v10m, & + emissions, rc ) + + dqa = gcDU%Ch_DU * gcDU%sfrac(n)*gcDU%src * emissions * cdt * grav / w_c%delp(:,:,km) + + w_c%qa(n1+n-1)%data3d(:,:,km) = w_c%qa(n1+n-1)%data3d(:,:,km) + dqa + + if (associated(DU_emis(n)%data2d)) then + DU_emis(n)%data2d = gcDU%Ch_DU*gcDU%sfrac(n)*gcDU%src * emissions + end if + end do + + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('DU: q_emi', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Distribute pointwise sources if requested +! ----------------------------------------- + POINTWISE_SOURCES: if( gcDU%doing_point_emissions .and. gcDU%nPts > 0) then + +! Get indices for point emissions +! ------------------------------- + allocate(iPoint(gcDU%nPts), jPoint(gcDU%nPts), stat=ios) + + call MAPL_GetHorzIJIndex(gcDU%nPts, iPoint, jPoint, & + grid = w_c%grid_esmf, & + lon = gcDU%pLon/radToDeg, & + lat = gcDU%pLat/radToDeg, & + rc = rc) + + if ( rc /= 0 ) call die(myname,'cannot get indices for point emissions') + + do ii = 1, gcDU%nPts + i = iPoint(ii) + j = jPoint(ii) + if( i<1 .OR. j<1 ) cycle ! point emission not in this sub-domain +! if( gcDU%regionMask(i,j) == 0 ) cycle ! masked by region mask + +! Emissions not occurring in current time step +! -------------------------------------------- + if(nhms < gcDU%pStart(ii) .or. nhms >= gcDU%pEnd(ii)) cycle + + call distribute_point_emissions(w_c%delp(i,j,:), rhoa(i,j,:), & + gcDU%pBase(ii), gcDU%pTop(ii), gcDU%pEmis(ii), & + point_column_emissions, km) + do n = 1, nbins + + w_c%qa(n1+n-1)%data3d(i,j,:) = w_c%qa(n1+n-1)%data3d(i,j,:) & + + cdt * grav / w_c%delp(i,j,:) & + * gcDU%sfrac(n) * point_column_emissions / w_c%grid%cell_area(i,j) + enddo + + enddo + + deallocate(iPoint, jPoint, stat=ios) + + endif POINTWISE_SOURCES + + +! Clean up +! -------- + deallocate ( DU_radius, DU_rhop, emissions, dqa, stat=STATUS ) + + return + +CONTAINS + +! Abstracted from distribute_aviation_emissions, but called per column + subroutine distribute_point_emissions(delp, rhoa, z_bot, z_top, emissions_point, & + emissions, km) + + implicit none + + integer, intent(in) :: km + + real, dimension(:), intent(in) :: delp + real, dimension(:), intent(in) :: rhoa + real, intent(in) :: emissions_point + real, intent(in) :: z_bot + real, intent(in) :: z_top + real, dimension(:), intent(out):: emissions + +! local + integer :: k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ + +! find level height + z = 0.0 + z_= 0.0 + + do k = km, 1, -1 + dz(k) = delp(k)/rhoa(k)/grav + z_ = z_ + dz(k) + z(k) = z_ + end do + +! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + +! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + +! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot .eq. k_top) then + w_(k_bot) = z_top - z_bot + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + +! distribute emissions in the vertical + emissions(:) = (w_ / sum(w_)) * emissions_point + + end subroutine distribute_point_emissions + + end subroutine DU_GridCompRun1_ + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_GridCompRun2_ --- The Chem Driver, run phase 2 +! +! !INTERFACE: +! + + subroutine DU_GridCompRun2_ ( gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(DU_GridComp1), intent(inout) :: gcDU ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called DU Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'DU_GridCompRun2_' + character(len=*), parameter :: Iam = myname + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n + integer :: k, ijl, ijkl + real :: qmax, qmin + real, pointer :: DU_radius(:), DU_rhop(:) + real, pointer :: dqa(:,:), drydepositionfrequency(:,:) + type(Chem_Array), pointer :: fluxout + logical :: KIN + + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: gwettop, oro, u10m, v10m, & + ustar, precc, precl, pblh, & + shflux, z0h, hsurf, frocean, frseaice + real, pointer, dimension(:,:,:) :: tmpu, rhoa, u, v, hghte, ple + real, pointer, dimension(:,:,:) :: pfllsan, pfilsan + +! Additional needs for GOCART convective diagnostic + real, pointer, dimension(:,:,:) :: cmfmc, qlcn, qicn, dtrain + real, pointer, dimension(:,:) :: frlake, area + real*8, allocatable, dimension(:,:,:) :: cmfmc_, qccu_, dtrain_, & + airmass_, airmol_, vud_, & + delz_, delp_, tmpu_, ple_ + real*8, allocatable :: tc_(:,:,:,:), bcnv_(:,:,:) + real*8, allocatable :: area_(:,:), frlake_(:,:), & + frocean_(:,:), frseaice_(:,:) + integer*4 :: icdt + +#define EXPORT expChem +#define iNAME TRIM(gcDU%iname) + +#define ptrDUWT DU_wet +#define ptrDUSV DU_conv +#define ptrDUEM DU_emis +#define ptrDUDP DU_dep +#define ptrDUSD DU_set + +#define DUSMASS DU_sfcmass +#define DUCMASS DU_colmass +#define DUMASS DU_mass +#define DUEXTTAU DU_exttau +#define DUSCATAU DU_scatau +#define DUSMASS25 DU_sfcmass25 +#define DUCMASS25 DU_colmass25 +#define DUMASS25 DU_mass25 +#define DUEXTT25 DU_exttau25 +#define DUSCAT25 DU_scatau25 +#define DUAERIDX DU_aeridx +#define DUFLUXU DU_fluxu +#define DUFLUXV DU_fluxv +#define DUCONC DU_conc +#define DUEXTCOEF DU_extcoef +#define DUSCACOEF DU_scacoef +#define DUEXTTFM DU_exttaufm +#define DUSCATFM DU_scataufm +#define DUANGSTR DU_angstrom + + integer :: STATUS + +#include "DU_GetPointer___.h" + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_DU + n1 = w_c%reg%i_DU + n2 = w_c%reg%j_DU + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + + if ( nbins /= NBIN_DUEM .OR. nbins /= NBIN_DUWT .OR. & + nbins /= NBIN_DUDP .OR. nbins /= NBIN_DUSD ) then + call die(myname,'inconsistent bins in resource file and registry') + endif + + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('DU: q_beg', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, frlake, 'FRLAKE', __RC__ ) + call MAPL_GetPointer ( impChem, gwettop, 'WET1', __RC__ ) + call MAPL_GetPointer ( impChem, oro, 'LWI', __RC__ ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', __RC__ ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', __RC__ ) + call MAPL_GetPointer ( impChem, ustar, 'USTAR', __RC__ ) + call MAPL_GetPointer ( impChem, precc, 'CN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, precl, 'NCN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + call MAPL_GetPointer ( impChem, shflux, 'SH', __RC__ ) + call MAPL_GetPointer ( impChem, z0h, 'Z0H', __RC__ ) + call MAPL_GetPointer ( impChem, area, 'AREA', __RC__ ) + call MAPL_GetPointer ( impChem, frocean, 'FROCEAN', __RC__ ) + call MAPL_GetPointer ( impChem, frseaice, 'FRACI', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, u, 'U', __RC__ ) + call MAPL_GetPointer ( impChem, v, 'V', __RC__ ) + call MAPL_GetPointer ( impChem, hghte, 'ZLE', __RC__ ) + call MAPL_GetPointer ( impChem, ple, 'PLE', __RC__ ) + call MAPL_GetPointer ( impChem, qlcn, 'QLCN', __RC__ ) + call MAPL_GetPointer ( impChem, qicn, 'QICN', __RC__ ) + call MAPL_GetPointer ( impChem, cmfmc, 'CNV_MFC', __RC__ ) + call MAPL_GetPointer ( impChem, dtrain, 'CNV_MFD', __RC__ ) + call MAPL_GetPointer ( impChem, pfllsan, 'PFL_LSAN', __RC__ ) + call MAPL_GetPointer ( impChem, pfilsan, 'PFI_LSAN', __RC__ ) + +! Unlike GEOS-4 hghte is defined for km+1 +! --------------------------------------- + hsurf => hghte(i1:i2,j1:j2,km) ! Recall: GEOS-5 has edges with k in [0,km] + + +#ifdef DEBUG + + call pmaxmin('DU: frlake ', frlake , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: gwtop ', gwettop , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: oro ', oro , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: u10m ', u10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: v10m ', v10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: ustar ', ustar , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: precc ', precc , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: precl ', precl , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: shfflux ', shflux , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: z0h ', z0h , qmin, qmax, ijl,1, 1. ) + call pmaxmin('DU: hsurf ', hsurf , qmin, qmax, ijl,1, 1. ) + + call pmaxmin('DU: tmpu ', tmpu , qmin, qmax, ijl,km, 1. ) + call pmaxmin('DU: rhoa ', rhoa , qmin, qmax, ijl,km, 1. ) + call pmaxmin('DU: u ', u , qmin, qmax, ijl,km, 1. ) + call pmaxmin('DU: v ', v , qmin, qmax, ijl,km, 1. ) + call pmaxmin('DU: hghte ', hghte , qmin, qmax, ijl,km, 1. ) + call pmaxmin('DU: rh ', w_c%rh , qmin, qmax, ijl,km, 1. ) + call pmaxmin('DU: pfllsan ', pfllsan , qmin, qmax, ijl,km+1, 1. ) + call pmaxmin('DU: pfilsan ', pfilsan , qmin, qmax, ijl,km+1, 1. ) + +#endif + + +RUN_ALARM: if (gcDU%run_alarm) then + +! Dust particle radius [m] and density [kg m-3] +! --------------------------------------------- + allocate( DU_radius(nbins), DU_rhop(nbins) ) + DU_radius = 1.e-6*gcDU%radius + DU_rhop = gcDU%rhop + + allocate( fluxout ) + allocate( fluxout%data2d(i1:i2,j1:j2), dqa(i1:i2,j1:j2), & + drydepositionfrequency(i1:i2,j1:j2), stat=STATUS) + VERIFY_(STATUS) + +! Dust Settling +! ----------- + call Chem_Settling ( i1, i2, j1, j2, km, n1, n2, nbins, gcDU%rhFlag, & + DU_radius, DU_rhop, cdt, w_c, tmpu, rhoa, hsurf, & + hghte, DU_set, rc, correctionMaring=gcDU%maringFlag ) + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('DU: q_set', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! Dust Deposition +! ----------- + do n = 1, nbins + drydepositionfrequency = 0. + call DryDepositionGOCART( i1, i2, j1, j2, km, & + tmpu, rhoa, hghte, oro, ustar, & + pblh, shflux, z0h, drydepositionfrequency, rc, & + DU_radius(n), DU_rhop(n), u10m, v10m, frlake, gwettop ) + + dqa = 0. + dqa = max(0.0, w_c%qa(n1+n-1)%data3d(:,:,km)*(1.-exp(-drydepositionfrequency*cdt))) + w_c%qa(n1+n-1)%data3d(:,:,km) = & + w_c%qa(n1+n-1)%data3d(:,:,km) - dqa + if( associated(DU_dep(n)%data2d) ) & + DU_dep(n)%data2d = dqa*w_c%delp(:,:,km)/grav/cdt + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('DU: q_dry', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! Dust Large-scale Wet Removal +! ---------------------------- + KIN = .TRUE. + do n = 1, nbins + !w_c%qa(n1+n-1)%fwet = 1.0 ! GEOS-Chem + w_c%qa(n1+n-1)%fwet = 0.3 + call WetRemovalGOCART(i1, i2, j1, j2, km, n1+n-1, n1+n-1, cdt, 'dust', KIN, & + w_c%qa, ple, tmpu, rhoa, pfllsan, pfilsan, & + precc, precl, fluxout, rc ) + if(associated(DU_wet(n)%data2d)) DU_wet(n)%data2d = fluxout%data2d + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('DU: q_wet', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! Dust Convective-scale Mixing and Wet Removal +! -------------------------------------------- + KIN = .TRUE. + icdt = cdt + + allocate(cmfmc_(i1:i2,j1:j2,km+1), qccu_(i1:i2,j1:j2,km), & + dtrain_(i1:i2,j1:j2,km), airmass_(i1:i2,j1:j2,km), & + delz_(i1:i2,j1:j2,km), vud_(i1:i2,j1:j2,km), & + tc_(i1:i2,j1:j2,km,n1:n2), delp_(i1:i2,j1:j2,km), & + airmol_(i1:i2,j1:j2,km), tmpu_(i1:i2,j1:j2,km),& + bcnv_(i1:i2,j1:j2,n1:n2), ple_(i1:i2,j1:j2,km+1), & + area_(i1:i2,j1:j2), frlake_(i1:i2,j1:j2), & + frocean_(i1:i2,j1:j2), frseaice_(i1:i2,j1:j2), __STAT__ ) + + bcnv_ = 0.0 + area_ = area + frlake_ = frlake + frocean_ = frocean + frseaice_ = frseaice + do k = 1, km+1 + cmfmc_(:,:,k) = cmfmc(:,:,km-k+1) + ple_(:,:,k) = ple(:,:,km-k+1) + end do + do k = 1, km + dtrain_(:,:,k) = dtrain(:,:,km-k+1) + qccu_(:,:,k) = qlcn(:,:,km-k+1) + qicn(:,:,km-k+1) + delp_(:,:,k) = w_c%delp(:,:,km-k+1)/100. + airmass_(:,:,k) = w_c%delp(:,:,km-k+1)/grav*area_ + airmol_(:,:,k) = airmass_(:,:,k)*1000./28.966 + delz_(:,:,k) = w_c%delp(:,:,km-k+1)/grav/rhoa(:,:,km-k+1) + tmpu_(:,:,k) = tmpu(:,:,km-k+1) + enddo + do n = n1, n2 + do k = 1, km + tc_(:,:,k,n) = w_c%qa(n)%data3d(:,:,km-k+1) + enddo + enddo + call set_vud(i1, i2, j1, j2, km, frlake_, frocean_, frseaice_, cmfmc_, qccu_, & + airmass_, delz_, area_, vud_) + call convection(i1, i2, j1, j2, km, n1, n2, icdt, 'dust', kin, & + tc_, cmfmc_, dtrain_, area_, delz_, delp_, vud_, & + airmass_, airmol_, tmpu_, ple_, & + bcnv_) +! Return adjusted tracer to mixing ratio + do n = n1, n2 + do k = 1, km + w_c%qa(n)%data3d(:,:,km-k+1) = tc_(:,:,k,n) + enddo + enddo + +! Note GOCART returns bcnv_ as negative, recast for my diagnostic + do n = 1, nbins + if(associated(DU_conv(n)%data2d)) DU_conv(n)%data2d = -bcnv_(:,:,n1+n-1)/area_/icdt + end do + +! Clean up +! -------- + deallocate(cmfmc_, qccu_, dtrain_, tc_, airmass_, & + delz_, vud_, delp_, airmol_, tmpu_, bcnv_, ple_, & + area_, frlake_, frocean_, frseaice_, __STAT__ ) + + deallocate ( fluxout%data2d ) + deallocate ( fluxout, DU_radius, DU_rhop, & + dqa, drydepositionfrequency, stat=STATUS ) + + end if RUN_ALARM + +! Compute the desired output diagnostics here +! Ideally this will go where chemout is called in fvgcm.F since that +! will reflect the distributions after transport, etc. +! ----------- + call DU_Compute_Diags(i1, i2, j1, j2, km, nbins, gcDU, w_c, tmpu, rhoa, & + u, v, DU_sfcmass, DU_colmass, DU_mass, DU_exttau, & + DU_scatau, DU_sfcmass25, DU_colmass25, DU_mass25, & + DU_exttau25, DU_scatau25, DU_aeridx, DU_fluxu, & + DU_fluxv, DU_conc, DU_extcoef, DU_scacoef, & + DU_exttaufm, DU_scataufm, DU_angstrom, rc) + + return + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_Compute_Diags - Calculate dust 2D diagnostics +! +! !INTERFACE: +! + + subroutine DU_Compute_Diags ( i1, i2, j1, j2, km, nbins, gcDU, w_c, tmpu, rhoa, & + u, v, sfcmass, colmass, mass, exttau, scatau, & + sfcmass25, colmass25, mass25, exttau25, scatau25, & + aerindx, fluxu, fluxv, conc, extcoef, scacoef, & + exttaufm, scataufm, angstrom, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2, km, nbins + type(DU_GridComp1), intent(inout) :: gcDU ! DU Grid Component + type(Chem_Bundle), intent(in) :: w_c ! Chem Bundle + real, pointer, dimension(:,:,:) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:,:) :: u ! east-west wind [m s-1] + real, pointer, dimension(:,:,:) :: v ! north-south wind [m s-1] + + +! !OUTPUT PARAMETERS: +! Total mass + type(Chem_Array), intent(inout) :: sfcmass ! sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: colmass ! col mass density kg/m2 + type(Chem_Array), intent(inout) :: mass ! 3d mass mixing ratio kg/kg +! Total optical properties + type(Chem_Array), intent(inout) :: exttau ! ext. AOT at 550 nm + type(Chem_Array), intent(inout) :: scatau ! sct. AOT at 550 nm + type(Chem_Array), intent(inout) :: sfcmass25 ! sfc mass concentration kg/m3 (pm2.5) + type(Chem_Array), intent(inout) :: colmass25 ! col mass density kg/m2 (pm2.5) + type(Chem_Array), intent(inout) :: mass25 ! 3d mass mixing ratio kg/kg (pm2.5) + type(Chem_Array), intent(inout) :: exttau25 ! ext. AOT at 550 nm (pm2.5) + type(Chem_Array), intent(inout) :: scatau25 ! sct. AOT at 550 nm (pm2.5) + type(Chem_Array), intent(inout) :: aerindx ! TOMS UV AI + type(Chem_Array), intent(inout) :: fluxu ! Column mass flux in x direction + type(Chem_Array), intent(inout) :: fluxv ! Column mass flux in y direction + type(Chem_Array), intent(inout) :: conc ! 3d mass concentration, kg/m3 + type(Chem_Array), intent(inout) :: extcoef ! 3d ext. coefficient, 1/m + type(Chem_Array), intent(inout) :: scacoef ! 3d scat.coefficient, 1/m + type(Chem_Array), intent(inout) :: exttaufm ! fine mode (sub-micron) ext. AOT at 550 nm + type(Chem_Array), intent(inout) :: scataufm ! fine mode (sub-micron) sct. AOT at 550 nm + type(Chem_Array), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Calculates some simple 2d diagnostics from the dust fields +! +! !REVISION HISTORY: +! +! 16APR2004, Colarco +! 11MAR2010, Nowottnick +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + character(len=*), parameter :: myname = 'DU_Compute_Diags' + integer :: i, j, k, n, n1, n2, ios, nch, idx + real :: ilam550, ilam470, ilam870 + real :: tau, ssa + real :: fPMfm(nbins) ! fraction of bin with particles diameter < 1.0 um + real :: fPM25(nbins) ! fraction of bin with particles diameter < 2.5 um + character(len=255) :: qname + logical :: do_angstrom + real, dimension(i1:i2,j1:j2) :: tau470, tau870 + +! Initialize local variables +! -------------------------- + n1 = w_c%reg%i_DU + n2 = w_c%reg%j_DU + nch = gcDU%mie_tables%nch + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + ilam470 = 0. + ilam870 = 0. + if(nch .gt. 1) then + do i = 1, nch + if ( gcDU%mie_tables%channels(i) .ge. 5.49e-7 .and. & + gcDU%mie_tables%channels(i) .le. 5.51e-7) ilam550 = i + if ( gcDU%mie_tables%channels(i) .ge. 4.69e-7 .and. & + gcDU%mie_tables%channels(i) .le. 4.71e-7) ilam470 = i + if ( gcDU%mie_tables%channels(i) .ge. 8.69e-7 .and. & + gcDU%mie_tables%channels(i) .le. 8.71e-7) ilam870 = i + enddo + endif + + do_angstrom = .false. +! If both 470 and 870 channels provided (and not the same) then +! possibly will do Angstrom parameter calculation + if(ilam470 .ne. 0. .and. & + ilam870 .ne. 0. .and. & + ilam470 .ne. ilam870) do_angstrom = .true. + +! Compute the fine mode (sub-micron) and PM2.5 bin-wise fractions +! ------------------------------------ + call DU_Binwise_PM_Fractions(fPMfm, 0.50, gcDU%rlow, gcDU%rup, nbins) ! 2*r < 1.0 um + call DU_Binwise_PM_Fractions(fPM25, 1.25, gcDU%rlow, gcDU%rup, nbins) ! 2*r < 2.5 um + + + if ( associated(aerindx%data2d) ) aerindx%data2d = 0.0 ! for now + +! Calculate the diagnostic variables if requested +! ----------------------------------------------- + +! Calculate the surface mass concentration + if( associated(sfcmass%data2d) ) then + sfcmass%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + sfcmass%data2d(i1:i2,j1:j2) & + = sfcmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + end do + endif + if( associated(sfcmass25%data2d) ) then + sfcmass25%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + sfcmass25%data2d(i1:i2,j1:j2) & + = sfcmass25%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km)*fPM25(n) + end do + endif + +! Calculate the dust column loading + if( associated(colmass%data2d) ) then + colmass%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + colmass%data2d(i1:i2,j1:j2) & + = colmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + end do + end do + endif + if( associated(colmass25%data2d)) then + colmass25%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + colmass25%data2d(i1:i2,j1:j2) & + = colmass25%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*fPM25(n) + end do + end do + endif + +! Calculate the total mass concentration + if( associated(conc%data3d) ) then + conc%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + conc%data3d(i1:i2,j1:j2,1:km) & + = conc%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km)*rhoa(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the total mass mixing ratio + if( associated(mass%data3d) ) then + mass%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + mass%data3d(i1:i2,j1:j2,1:km) & + = mass%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km) + end do + endif + if( associated(mass25%data3d) ) then + mass25%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + mass25%data3d(i1:i2,j1:j2,1:km) & + = mass25%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km)*fPM25(n) + end do + endif + +! Calculate the column mass flux in x direction + if( associated(fluxu%data2d) ) then + fluxu%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + fluxu%data2d(i1:i2,j1:j2) & + = fluxu%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*u(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the column mass flux in y direction + if( associated(fluxv%data2d) ) then + fluxv%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + fluxv%data2d(i1:i2,j1:j2) & + = fluxv%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*v(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the extinction and/or scattering AOD + if( associated(exttau%data2d) .or. associated(scatau%data2d) ) then + + if( associated(exttau%data2d)) exttau%data2d(i1:i2,j1:j2) = 0. + if( associated(scatau%data2d)) scatau%data2d(i1:i2,j1:j2) = 0. + + if( associated(exttau25%data2d)) exttau25%data2d(i1:i2,j1:j2) = 0. + if( associated(scatau25%data2d)) scatau25%data2d(i1:i2,j1:j2) = 0. + + if( associated(exttaufm%data2d)) exttaufm%data2d(i1:i2,j1:j2) = 0. + if( associated(scataufm%data2d)) scataufm%data2d(i1:i2,j1:j2) = 0. + + if( associated(extcoef%data3d)) extcoef%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(scacoef%data3d)) scacoef%data3d(i1:i2,j1:j2,1:km) = 0. + + do n = 1, nbins + +! Select the name for species + qname = trim(w_c%reg%vname(w_c%reg%i_DU+n-1)) + idx = Chem_MieQueryIdx(gcDU%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(gcDU%mie_tables, idx, ilam550, & + w_c%qa(n1+n-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau, ssa=ssa) + +! Calculate the total ext. and scat. coefficients + if( associated(extcoef%data3d) ) then + extcoef%data3d(i,j,k) = extcoef%data3d(i,j,k) + & + tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + if( associated(scacoef%data3d) ) then + scacoef%data3d(i,j,k) = scacoef%data3d(i,j,k) + & + ssa * tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + +! Integrate in the vertical + if( associated(exttau%data2d) ) exttau%data2d(i,j) = exttau%data2d(i,j) + tau + if( associated(exttaufm%data2d)) & + exttaufm%data2d(i,j) = exttaufm%data2d(i,j) + tau*fPMfm(n) + if( associated(exttau25%data2d)) & + exttau25%data2d(i,j) = exttau25%data2d(i,j) + tau*fPM25(n) + + if( associated(scatau%data2d) ) scatau%data2d(i,j) = scatau%data2d(i,j) + tau*ssa + if( associated(scataufm%data2d) ) & + scataufm%data2d(i,j) = scataufm%data2d(i,j) + tau*ssa*fPMfm(n) + if( associated(scatau25%data2d) ) & + scatau25%data2d(i,j) = scatau25%data2d(i,j) + tau*ssa*fPM25(n) + + enddo + enddo + enddo + + enddo ! nbins + + endif + +! Calculate the 470-870 Angstrom parameter + if( associated(angstrom%data2d) .and. do_angstrom ) then + + angstrom%data2d(i1:i2,j1:j2) = 0. +! Set tau to small number by default + tau470(i1:i2,j1:j2) = tiny(1.0) + tau870(i1:i2,j1:j2) = tiny(1.0) + + do n = 1, nbins + +! Select the name for species + qname = trim(w_c%reg%vname(w_c%reg%i_DU+n-1)) + idx = Chem_MieQueryIdx(gcDU%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + + call Chem_MieQuery(gcDU%mie_tables, idx, ilam470, & + w_c%qa(n1+n-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau470(i,j) = tau470(i,j) + tau + + call Chem_MieQuery(gcDU%mie_tables, idx, ilam870, & + w_c%qa(n1+n-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau870(i,j) = tau870(i,j) + tau + + enddo + enddo + enddo + + enddo ! nbins + + angstrom%data2d(i1:i2,j1:j2) = & + -log(tau470(i1:i2,j1:j2)/tau870(i1:i2,j1:j2)) / & + log(470./870.) + endif + + rc = 0 + + end subroutine DU_Compute_Diags + + +!############################################################################## +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_Binwise_PM_Fractions - Calculate bin-wise PM fractions +! +! !INTERFACE: +! + + subroutine DU_Binwise_PM_Fractions(fPM, rPM, r_low, r_up, nbins) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + real, dimension(:), intent(inout) :: fPM ! bin-wise PM fraction (r < rPM) + +! !INPUT PARAMETERS: + + real, intent(in) :: rPM ! PM radius + integer, intent(in) :: nbins ! number of bins + real, dimension(:), intent(in) :: r_low ! bin radii - low bounds + real, dimension(:), intent(in) :: r_up ! bin radii - upper bounds + +! !OUTPUT PARAMETERS: +!EOP + +! !Local Variables + + integer :: n + + character(len=*), parameter :: myname = 'DU_Binwise_PM_Fractions' + + do n = 1, nbins + if(r_up(n) < rPM) then + fPM(n) = 1.0 + else + if(r_low(n) < rPM) then +! Assume dm/dlnr = constant, i.e., dm/dr ~ 1/r + fPM(n) = log(rPM/r_low(n)) / log(r_up(n)/r_low(n)) + else + fPM(n) = 0.0 + endif + endif + enddo + + end subroutine DU_Binwise_PM_Fractions + + end subroutine DU_GridCompRun2_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + subroutine DU_GridCompFinalize1_ ( gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(DU_GridComp1), intent(inout) :: gcDU ! Grid Component + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + rc=0 +! integer :: ios + +! deallocate ( gcDU%radius, gcDU%src, stat=ios ) +! if ( ios /= 0 ) then +! rc = 1 +! return +! end if + + return + + end subroutine DU_GridCompFinalize1_ + + end module DU_GridCompMod + +!----------------------------------------------------------------------- + +! Single Instance Wrapper + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DU_SingleInstance_ --- Runs single instance of method +! +! !INTERFACE: +! + subroutine DU_SingleInstance_ ( Method_, instance, & + gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + Use DU_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! Input "function pointer" +! ----------------------- + interface + subroutine Method_ (gc, w, imp, exp, ymd, hms, dt, rcode ) + Use DU_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + type(DU_GridComp1), intent(inout) :: gc + type(Chem_Bundle), intent(in) :: w + type(ESMF_State), intent(inout) :: imp + type(ESMF_State), intent(inout) :: exp + integer, intent(in) :: ymd, hms + real, intent(in) :: dt + integer, intent(out) :: rcode + end subroutine Method_ + end interface + + integer, intent(in) :: instance ! instance number + + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(DU_GridComp1), INTENT(INOUT) :: gcDU ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the DU Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: n, n_DU, i_DU, j_DU + integer :: status + character(len=255), allocatable :: qname(:) + character(len=ESMF_MAXSTR) :: Iam + integer, parameter :: n_bins = 5 + + Iam = 'DU_SingleInstance_' + +! Save overall DU indices +! ----------------------- + n_DU = w_c%reg%n_DU + i_DU = w_c%reg%i_DU + j_DU = w_c%reg%j_DU + +! Save the name of the variables in this instance +! ----------------------------------------------- + allocate(qname(n_bins), __STAT__) + + do n = 1, n_bins + qname(n) = trim(w_c%reg%vname(i_DU + n_bins*(instance - 1) + n - 1)) + end do + +! Customize indices for this particular instance +! ---------------------------------------------- + w_c%reg%n_DU = n_bins + w_c%reg%i_DU = i_DU + n_bins*(instance - 1) + w_c%reg%j_DU = i_DU + n_bins*(instance - 1) + (n_bins - 1) + + do n = 1, n_bins + w_c%reg%vname(i_DU + n_bins*(instance - 1) + n - 1) = w_c%reg%vname(i_DU + n - 1) + end do + +! Execute the instance method +! --------------------------- + call Method_ ( gcDU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! Restore the overall DU indices +! ------------------------------ + do n = 1, n_bins + w_c%reg%vname(i_DU + n_bins*(instance - 1) + n - 1) = qname(n) + end do + + w_c%reg%n_DU = n_DU + w_c%reg%i_DU = i_DU + w_c%reg%j_DU = j_DU + + deallocate(qname, __STAT__) + + end subroutine DU_SingleInstance_ + +!----------------------------------------------------------------------- + diff --git a/ESMF/GOCART_GridComp/DU_GridComp/DU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/DU_GridComp/DU_GridComp_ExtData.rc new file mode 100644 index 00000000..2f20046d --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/DU_GridComp_ExtData.rc @@ -0,0 +1,8 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +DU_SRC NA N Y - none none du_src ExtData/PIESA/sfc/gocart.dust_source.v5a.x1152_y721.nc +%% + diff --git a/ESMF/GOCART_GridComp/DU_GridComp/DU_Registry.rc b/ESMF/GOCART_GridComp/DU_GridComp/DU_Registry.rc new file mode 100644 index 00000000..6301c89a --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/DU_Registry.rc @@ -0,0 +1,115 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: DU + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl| Sub | Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- + DUMASS | kg kg-1 | xyz | C | | | | | Dust Mass Mixing Ratio __ENSEMBLE__ + DUMASS25 | kg kg-1 | xyz | C | | | | | Dust Mass Mixing Ratio - PM 2.5 __ENSEMBLE__ + DUCONC | kg m-3 | xyz | C | | | | | Dust Mass Concentration __ENSEMBLE__ + DUEXTCOEF | m-1 | xyz | C | | | | | Dust Extinction Coefficient [550 nm] __ENSEMBLE__ + DUSCACOEF | m-1 | xyz | C | | | | | Dust Scattering Coefficient [550 nm] __ENSEMBLE__ +# ............|............|.....|...|....|...|...|.....|.................................. + DUEM001 | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 001 __ENSEMBLE__ + DUEM002 | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 002 __ENSEMBLE__ + DUEM003 | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 003 __ENSEMBLE__ + DUEM004 | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 004 __ENSEMBLE__ + DUEM005 | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 005 __ENSEMBLE__ + DUSD001 | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 001 __ENSEMBLE__ + DUSD002 | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 002 __ENSEMBLE__ + DUSD003 | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 003 __ENSEMBLE__ + DUSD004 | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 004 __ENSEMBLE__ + DUSD005 | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 005 __ENSEMBLE__ + DUDP001 | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 001 __ENSEMBLE__ + DUDP002 | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 002 __ENSEMBLE__ + DUDP003 | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 003 __ENSEMBLE__ + DUDP004 | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 004 __ENSEMBLE__ + DUDP005 | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 005 __ENSEMBLE__ + DUWT001 | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 001 __ENSEMBLE__ + DUWT002 | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 002 __ENSEMBLE__ + DUWT003 | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 003 __ENSEMBLE__ + DUWT004 | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 004 __ENSEMBLE__ + DUWT005 | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 005 __ENSEMBLE__ + DUSV001 | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 001 __ENSEMBLE__ + DUSV002 | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 002 __ENSEMBLE__ + DUSV003 | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 003 __ENSEMBLE__ + DUSV004 | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 004 __ENSEMBLE__ + DUSV005 | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 005 __ENSEMBLE__ + DUSMASS | kg m-3 | xy | | | | | | Dust Surface Mass Concentration __ENSEMBLE__ + DUCMASS | kg m-2 | xy | | | | | | Dust Column Mass Density __ENSEMBLE__ + DUEXTTAU | 1 | xy | | | | | | Dust Extinction AOT [550 nm] __ENSEMBLE__ + DUSCATAU | 1 | xy | | | | | | Dust Scattering AOT [550 nm] __ENSEMBLE__ + DUSMASS25 | kg m-3 | xy | | | | | | Dust Surface Mass Concentration - PM 2.5 __ENSEMBLE__ + DUCMASS25 | kg m-2 | xy | | | | | | Dust Column Mass Density - PM 2.5 __ENSEMBLE__ + DUEXTT25 | 1 | xy | | | | | | Dust Extinction AOT [550 nm] - PM 2.5 __ENSEMBLE__ + DUSCAT25 | 1 | xy | | | | | | Dust Scattering AOT [550 nm] - PM 2.5 __ENSEMBLE__ + DUAERIDX | 1 | xy | | | | | | Dust TOMS UV Aerosol Index __ENSEMBLE__ + DUFLUXU | kg m-1 s-1 | xy | | | | | | Dust column u-wind mass flux __ENSEMBLE__ + DUFLUXV | kg m-1 s-1 | xy | | | | | | Dust column v-wind mass flux __ENSEMBLE__ + DUEXTTFM | 1 | xy | | | | | | Dust Extinction AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + DUSCATFM | 1 | xy | | | | | | Dust Scattering AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + DUANGSTR | 1 | xy | | | | | | Dust Angstrom parameter [470-870 nm] __ENSEMBLE__ +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- + DUMASSash | kg kg-1 | xyz | C | | | | | Dust Mass Mixing Ratio ash + DUMASS25ash | kg kg-1 | xyz | C | | | | | Dust Mass Mixing Ratio - PM 2.5 ash + DUCONCash | kg m-3 | xyz | C | | | | | Dust Mass Concentration ash + DUEXTCOEFash | m-1 | xyz | C | | | | | Dust Extinction Coefficient [550 nm] ash + DUSCACOEFash | m-1 | xyz | C | | | | | Dust Scattering Coefficient [550 nm] ash +# ............|............|.....|...|....|...|...|.....|.................................. + DUEM001ash | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 001 ash + DUEM002ash | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 002 ash + DUEM003ash | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 003 ash + DUEM004ash | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 004 ash + DUEM005ash | kg m-2 s-1 | xy | | | | | | Dust Emission Bin 005 ash + DUSD001ash | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 001 ash + DUSD002ash | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 002 ash + DUSD003ash | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 003 ash + DUSD004ash | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 004 ash + DUSD005ash | kg m-2 s-1 | xy | | | | | | Dust Sedimentation Bin 005 ash + DUDP001ash | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 001 ash + DUDP002ash | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 002 ash + DUDP003ash | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 003 ash + DUDP004ash | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 004 ash + DUDP005ash | kg m-2 s-1 | xy | | | | | | Dust Dry Deposition Bin 005 ash + DUWT001ash | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 001 ash + DUWT002ash | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 002 ash + DUWT003ash | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 003 ash + DUWT004ash | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 004 ash + DUWT005ash | kg m-2 s-1 | xy | | | | | | Dust Wet Deposition Bin 005 ash + DUSV001ash | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 001 ash + DUSV002ash | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 002 ash + DUSV003ash | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 003 ash + DUSV004ash | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 004 ash + DUSV005ash | kg m-2 s-1 | xy | | | | | | Dust Convective Scavenging Bin 005 ash + DUSMASSash | kg m-3 | xy | | | | | | Dust Surface Mass Concentration ash + DUCMASSash | kg m-2 | xy | | | | | | Dust Column Mass Density ash + DUEXTTAUash | 1 | xy | | | | | | Dust Extinction AOT [550 nm] ash + DUSCATAUash | 1 | xy | | | | | | Dust Scattering AOT [550 nm] ash + DUSMASS25ash | kg m-3 | xy | | | | | | Dust Surface Mass Concentration - PM 2.5 ash + DUCMASS25ash | kg m-2 | xy | | | | | | Dust Column Mass Density - PM 2.5 ash + DUEXTT25ash | 1 | xy | | | | | | Dust Extinction AOT [550 nm] - PM 2.5 ash + DUSCAT25ash | 1 | xy | | | | | | Dust Scattering AOT [550 nm] - PM 2.5 ash + DUAERIDXash | 1 | xy | | | | | | Dust TOMS UV Aerosol Index ash + DUFLUXUash | kg m-1 s-1 | xy | | | | | | Dust column u-wind mass flux ash + DUFLUXVash | kg m-1 s-1 | xy | | | | | | Dust column v-wind mass flux ash + DUEXTTFMash | 1 | xy | | | | | | Dust Extinction AOT [550 nm] - PM 1.0 um ash + DUSCATFMash | 1 | xy | | | | | | Dust Scattering AOT [550 nm] - PM 1.0 um ash + DUANGSTRash | 1 | xy | | | | | | Dust Angstrom parameter [470-870 nm] ash +# ------------|------------|-----|---|----|---|---|-----|--------------------------------- + diff --git a/ESMF/GOCART_GridComp/DU_GridComp/MERRA2-DD/DU_GridComp---full.rc b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2-DD/DU_GridComp---full.rc new file mode 100644 index 00000000..2130c313 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2-DD/DU_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file Dust parameters. +# + +number_dust_bins: 5 + + +particle_radius: 0.73 1.4 2.4 4.5 8.0 + +radius_lower: 0.1 1.0 1.8 3.0 6.0 + +radius_upper: 1.0 1.8 3.0 6.0 10.0 + +source_fraction: 0.1 0.25 0.25 0.25 0.25 + +soil_density: 2500. 2650. 2650. 2650. 2650. + +# Resolution dependent tuning constant for emissions (a,b,c,d,e,f) +Ch_DU: 0.2 0.2 0.08 0.08 0.08 0.067 + +# Scavenging efficiency per bin [km-1] +fscav: 0.2 0.2 0.2 0.2 0.2 # + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.1 0.1 0.1 0.1 0.1 + +# Number of particles per kg mass +fnum: 2.45e14 3.28e13 6.52e12 9.89e11 1.76e11 + +rhFlag: 0 + +# Maring settling velocity correction +maringFlag: 1 diff --git a/ESMF/GOCART_GridComp/DU_GridComp/MERRA2-DD/DU_GridComp.rc b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2-DD/DU_GridComp.rc new file mode 100644 index 00000000..14ba946b --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2-DD/DU_GridComp.rc @@ -0,0 +1,22 @@ +# +# DU main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bo | [45N,90N] +# Non-Boreal | nb | [90S,45N) +# Northern Asia | nas | 9, 10 +# Southern Asian | sas | 4 +# Europe | eur | 3 +# North America | nam | 1, 2 +# South America | sam | 6 +# Australia | aus | 7 +# Africa | afr | 5 +# ------------------|-------|------------ + +DU_instances: full afr sas aus diff --git a/ESMF/GOCART_GridComp/DU_GridComp/MERRA2-DD/DU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2-DD/DU_GridComp_ExtData.rc new file mode 100644 index 00000000..581d5baa --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2-DD/DU_GridComp_ExtData.rc @@ -0,0 +1,7 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +DU_SRC NA N Y - none none du_src ExtData/PIESA/sfc/gocart.dust_source.v5a.x1152_y721.nc +%% diff --git a/ESMF/GOCART_GridComp/DU_GridComp/MERRA2/DU_GridComp---full.rc b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2/DU_GridComp---full.rc new file mode 100644 index 00000000..f2c21240 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2/DU_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file Dust parameters. +# + +number_dust_bins: 5 + + +particle_radius: 0.73 1.4 2.4 4.5 8.0 + +radius_lower: 0.1 1.0 1.8 3.0 6.0 + +radius_upper: 1.0 1.8 3.0 6.0 10.0 + +source_fraction: 0.1 0.25 0.25 0.25 0.25 + +soil_density: 2500. 2650. 2650. 2650. 2650. + +# Resolution dependent tuning constant for emissions (a,b,c,d,e,f) +Ch_DU: 0.2 0.2 0.07 0.07 0.07 0.056 + +# Scavenging efficiency per bin [km-1] +fscav: 0.2 0.2 0.2 0.2 0.2 # + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.1 0.1 0.1 0.1 0.1 + +# Number of particles per kg mass +fnum: 2.45e14 3.28e13 6.52e12 9.89e11 1.76e11 + +rhFlag: 0 + +# Maring settling velocity correction +maringFlag: 1 diff --git a/ESMF/GOCART_GridComp/DU_GridComp/MERRA2/DU_GridComp.rc b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2/DU_GridComp.rc new file mode 100644 index 00000000..14ba946b --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2/DU_GridComp.rc @@ -0,0 +1,22 @@ +# +# DU main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bo | [45N,90N] +# Non-Boreal | nb | [90S,45N) +# Northern Asia | nas | 9, 10 +# Southern Asian | sas | 4 +# Europe | eur | 3 +# North America | nam | 1, 2 +# South America | sam | 6 +# Australia | aus | 7 +# Africa | afr | 5 +# ------------------|-------|------------ + +DU_instances: full afr sas aus diff --git a/ESMF/GOCART_GridComp/DU_GridComp/MERRA2/DU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2/DU_GridComp_ExtData.rc new file mode 100644 index 00000000..581d5baa --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/MERRA2/DU_GridComp_ExtData.rc @@ -0,0 +1,7 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +DU_SRC NA N Y - none none du_src ExtData/PIESA/sfc/gocart.dust_source.v5a.x1152_y721.nc +%% diff --git a/ESMF/GOCART_GridComp/DU_GridComp/NR/DU_GridComp---full.rc b/ESMF/GOCART_GridComp/DU_GridComp/NR/DU_GridComp---full.rc new file mode 100644 index 00000000..2130c313 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/NR/DU_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file Dust parameters. +# + +number_dust_bins: 5 + + +particle_radius: 0.73 1.4 2.4 4.5 8.0 + +radius_lower: 0.1 1.0 1.8 3.0 6.0 + +radius_upper: 1.0 1.8 3.0 6.0 10.0 + +source_fraction: 0.1 0.25 0.25 0.25 0.25 + +soil_density: 2500. 2650. 2650. 2650. 2650. + +# Resolution dependent tuning constant for emissions (a,b,c,d,e,f) +Ch_DU: 0.2 0.2 0.08 0.08 0.08 0.067 + +# Scavenging efficiency per bin [km-1] +fscav: 0.2 0.2 0.2 0.2 0.2 # + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.1 0.1 0.1 0.1 0.1 + +# Number of particles per kg mass +fnum: 2.45e14 3.28e13 6.52e12 9.89e11 1.76e11 + +rhFlag: 0 + +# Maring settling velocity correction +maringFlag: 1 diff --git a/ESMF/GOCART_GridComp/DU_GridComp/NR/DU_GridComp.rc b/ESMF/GOCART_GridComp/DU_GridComp/NR/DU_GridComp.rc new file mode 100644 index 00000000..14ba946b --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/NR/DU_GridComp.rc @@ -0,0 +1,22 @@ +# +# DU main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bo | [45N,90N] +# Non-Boreal | nb | [90S,45N) +# Northern Asia | nas | 9, 10 +# Southern Asian | sas | 4 +# Europe | eur | 3 +# North America | nam | 1, 2 +# South America | sam | 6 +# Australia | aus | 7 +# Africa | afr | 5 +# ------------------|-------|------------ + +DU_instances: full afr sas aus diff --git a/ESMF/GOCART_GridComp/DU_GridComp/NR/DU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/DU_GridComp/NR/DU_GridComp_ExtData.rc new file mode 100644 index 00000000..581d5baa --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/NR/DU_GridComp_ExtData.rc @@ -0,0 +1,7 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +DU_SRC NA N Y - none none du_src ExtData/PIESA/sfc/gocart.dust_source.v5a.x1152_y721.nc +%% diff --git a/ESMF/GOCART_GridComp/DU_GridComp/PIESA/DU_GridComp---full.rc b/ESMF/GOCART_GridComp/DU_GridComp/PIESA/DU_GridComp---full.rc new file mode 100644 index 00000000..967ced22 --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/PIESA/DU_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file Dust parameters. +# + +number_dust_bins: 5 + + +particle_radius: 0.73 1.4 2.4 4.5 8.0 + +radius_lower: 0.1 1.0 1.8 3.0 6.0 + +radius_upper: 1.0 1.8 3.0 6.0 10.0 + +source_fraction: 0.1 0.25 0.25 0.25 0.25 + +soil_density: 2500. 2650. 2650. 2650. 2650. + +# Resolution dependent tuning constant for emissions (a,b,c,d,e,f) +Ch_DU: 0.2 0.112 0.095 0.08 0.08 0.067 + +# Scavenging efficiency per bin [km-1] +fscav: 0.2 0.2 0.2 0.2 0.2 # + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.1 0.1 0.1 0.1 0.1 + +# Number of particles per kg mass +fnum: 2.45e14 3.28e13 6.52e12 9.89e11 1.76e11 + +rhFlag: 0 + +# Maring settling velocity correction +maringFlag: 1 diff --git a/ESMF/GOCART_GridComp/DU_GridComp/PIESA/DU_GridComp.rc b/ESMF/GOCART_GridComp/DU_GridComp/PIESA/DU_GridComp.rc new file mode 100644 index 00000000..14ba946b --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/PIESA/DU_GridComp.rc @@ -0,0 +1,22 @@ +# +# DU main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bo | [45N,90N] +# Non-Boreal | nb | [90S,45N) +# Northern Asia | nas | 9, 10 +# Southern Asian | sas | 4 +# Europe | eur | 3 +# North America | nam | 1, 2 +# South America | sam | 6 +# Australia | aus | 7 +# Africa | afr | 5 +# ------------------|-------|------------ + +DU_instances: full afr sas aus diff --git a/ESMF/GOCART_GridComp/DU_GridComp/PIESA/DU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/DU_GridComp/PIESA/DU_GridComp_ExtData.rc new file mode 100644 index 00000000..581d5baa --- /dev/null +++ b/ESMF/GOCART_GridComp/DU_GridComp/PIESA/DU_GridComp_ExtData.rc @@ -0,0 +1,7 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +DU_SRC NA N Y - none none du_src ExtData/PIESA/sfc/gocart.dust_source.v5a.x1152_y721.nc +%% diff --git a/ESMF/GOCART_GridComp/GOCART_GridCompMod.F90 b/ESMF/GOCART_GridComp/GOCART_GridCompMod.F90 new file mode 100644 index 00000000..2d08e096 --- /dev/null +++ b/ESMF/GOCART_GridComp/GOCART_GridCompMod.F90 @@ -0,0 +1,3841 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: GOCART_GridCompMod - The GOCART Aerosol Grid Component +! +! !INTERFACE: +! + Module GOCART_GridCompMod +! +! !USES: +! + use ESMF + use MAPL + + use Chem_Mod ! Chemistry Base Class + use Chem_UtilMod, only: Chem_UtilNegFiller + use Aero_GridCompMod ! Parent Aerosol component with IRF methods but no SetServices() + + use ConvectionMod, only: Disable_Convection + + implicit none + private + + type(Chem_Mie), dimension(2), save :: gocartMieTable + integer, parameter :: instanceComputational = 1 + integer, parameter :: instanceData = 2 + + character(len=*), parameter :: H2O2_RECYCLE_ALARM = 'GOCART::RECYCLE_H2O2' + character(len=*), parameter :: HNO3_RECYCLE_ALARM = 'GOCART::RECYCLE_HNO3' + +! +! !PUBLIC MEMBER FUNCTIONS: + + public SetServices +! +! !DESCRIPTION: +! +! {\tt GOCART} is a gridded component from the GOCART model and includes +! dust, sea salt, sulfates, organic and black carbon. In addition, we +! also include closely related components for CO and CO2 with relatively +! simple parameterization of the chemical processes, but sharing +! consistent emissions with the aerosols. +! +! This code derives from the pre-ESMF Chem component from GEOS-4. This +! GEOS-4 Chem "component" used ESMF like constructs (Chem component class, +! import/export states, etc) but no ESMF specific data types because of +! an odd incompatibility with the fvGCM code (the so-called +! {\tt oldworld} library. Unlike GEOS-4, the Stratospheric Chemistry +! component is treated separately here. +! +! !REVISION HISTORY: +! +! 25feb2005 da Silva First crack. +! 19jul2006 da Silva First separate GOCART component. +! +!EOP +!------------------------------------------------------------------------- + + type GOCART_State + private + type(Chem_Registry), pointer :: chemReg => null() + type(Aero_GridComp), pointer :: gcChem => null() + type(Chem_Bundle), pointer :: w_c => null() + logical :: data_driven = .false. + end type GOCART_State + + type GOCART_WRAP + type (GOCART_State), pointer :: PTR => null() + end type GOCART_WRAP + +CONTAINS + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SetServices --- Sets IRF services for GOCART Grid Component +! +! !INTERFACE: + + subroutine SetServices ( GC, RC ) + +! !ARGUMENTS: + + type(ESMF_GridComp), intent(INOUT) :: GC ! gridded component + integer, optional :: RC ! return code + +! !DESCRIPTION: Sets Initialize, Run and Finalize services. +! +! !REVISION HISTORY: +! +! 25feb2005 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + +! ErrLog Variables +! ---------------- + character(len=ESMF_MAXSTR) :: IAm = 'SetServices' + integer :: STATUS + character(len=ESMF_MAXSTR) :: COMP_NAME + +! Local derived type aliases +! -------------------------- + type (ESMF_Config) :: CF + type (GOCART_State), pointer :: state ! internal, that is + type (GOCART_wrap) :: wrap + type(Chem_Registry), pointer :: r + + integer :: n, nq + integer :: DO_CO2CNNEE + character(len=ESMF_MAXSTR) :: FRIENDLIES + character(len=ESMF_MAXSTR) :: AEROFRIENDLY + character(len=ESMF_MAXSTR) :: providerName + character(len=ESMF_MAXSTR) :: short_name + real :: DEFVAL + real :: DEFVAL_CO2 + + character(len=ESMF_MAXSTR) :: field_name + character(len=ESMF_MAXSTR) :: chem_registry_file + +! ------------ + + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet( GC, NAME=COMP_NAME, CONFIG=CF, __RC__ ) + + Iam = TRIM(COMP_NAME) // '::' // 'SetServices' + +! Wrap internal state for storing in GC; rename legacyState +! ------------------------------------- + allocate ( state, __STAT__ ) + wrap%ptr => state + +! Is the component data driven +! ---------------------------- + state%data_driven = IsDataDrivenGC_(GC, __RC__) + +! Start by loading the Chem Registry +! ---------------------------------- + allocate ( state%chemReg ) + + if (state%data_driven) then + state%chemReg = Chem_RegistryCreate(STATUS, rcfile='GOCARTdata_AerRegistry.rc') + VERIFY_(STATUS) + else + call ESMF_ConfigGetAttribute(cf, chem_registry_file, label = "Chem_Registry_File:", & + default = "Chem_Registry.rc", rc = status) + VERIFY_(status) + state%chemReg = Chem_RegistryCreate(STATUS, rcfile=chem_registry_file) + VERIFY_(STATUS) + end if + + r => state%chemReg ! short hand + + +! ------------------------ +! ESMF Functional Services +! ------------------------ + +! Set the Initialize, Run, Finalize entry points +! ---------------------------------------------- + if ( r%doing_GOCART ) then + + if(MAPL_AM_I_ROOT()) then + print *, trim(Iam)//': ACTIVE' + print *,' ' + end if + + call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_INITIALIZE, Initialize_, __RC__ ) + call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_RUN, Run1_, __RC__ ) + call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_RUN, Run2_, __RC__ ) + + call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_FINALIZE, Finalize_, __RC__ ) + +! Store internal state in GC +! -------------------------- + call ESMF_UserCompSetInternalState ( GC, 'GOCART_state', wrap, STATUS ) + VERIFY_(STATUS) + + else + + if (MAPL_AM_I_ROOT()) then + print *, trim(Iam)//': NOT ACTIVE, defaulting to Generic No-op stubs' + end if + + call MAPL_GenericSetServices ( GC, __RC__ ) + RETURN_(ESMF_SUCCESS) + + endif + + +! ------------------ +! GEOS Data Services +! ------------------ + +! NOTE: For now, always define import state to avoid breaking connectivities. + +!!BOS +! +! !IMPORT STATE: + +GOCARTdata_IMPORTS: if (state%data_driven) then + +! Pressure at layer edges +! ----------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'PLE', & + LONG_NAME = 'air_pressure', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + +! Pressure thickness +! ------------------ + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'DELP', & + LONG_NAME = 'pressure_thickness', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! RH: is between 0 and 1 +! ---------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'RH2', & + LONG_NAME = 'Rel_Hum_after_moist', & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! T +! - + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'T', & + LONG_NAME = 'air_temperature', & + UNITS = 'K', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + nq = r%nq ! total number of chemical tracers + +! Loop over all constituents on registry +! -------------------------------------- + do n = r%i_GOCART, r%j_GOCART + +! 3D mass mixing ratios +! --------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//trim(r%vname(n)), & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + end do + + +! 2D deposition fluxes +! -------------------- + IMPORT_DUST_DEP_FLUXES: if (r%doing_DU) then + do n = 1, r%n_DU + ! dry deposition + write (field_name, '(A, I0.3)') 'DUDP', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! wet deposition + write (field_name, '(A, I0.3)') 'DUWT', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! gravitational settling + write (field_name, '(A, I0.3)') 'DUSD', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! convective scavenging + write (field_name, '(A, I0.3)') 'DUSV', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + end do + end if IMPORT_DUST_DEP_FLUXES + + +! Black Carbon +! ------------ + IMPORT_BC_DEP_FLUXES: if (r%doing_BC) then + do n = 1, r%n_BC + ! dry deposition + write (field_name, '(A, I0.3)') 'BCDP', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! wet deposition + write (field_name, '(A, I0.3)') 'BCWT', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! gravitational settling + write (field_name, '(A, I0.3)') 'BCSD', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! convective scavenging + write (field_name, '(A, I0.3)') 'BCSV', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + end do + end if IMPORT_BC_DEP_FLUXES + +! Organic Carbon +! -------------- + IMPORT_OC_DEP_FLUXES: if (r%doing_OC) then + do n = 1, r%n_OC + ! dry deposition + write (field_name, '(A, I0.3)') 'OCDP', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! wet deposition + write (field_name, '(A, I0.3)') 'OCWT', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! gravitational settling + write (field_name, '(A, I0.3)') 'OCSD', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! convective scavenging + write (field_name, '(A, I0.3)') 'OCSV', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + end do + end if IMPORT_OC_DEP_FLUXES + +! Sulfate +! -------- + IMPORT_SU_DEP_FLUXES: if (r%doing_SU) then + do n = 1, r%n_SU + ! dry deposition + write (field_name, '(A, I0.3)') 'SUDP', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! wet deposition + write (field_name, '(A, I0.3)') 'SUWT', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! gravitational settling + write (field_name, '(A, I0.3)') 'SUSD', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! convective scavenging + write (field_name, '(A, I0.3)') 'SUSV', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + end do + end if IMPORT_SU_DEP_FLUXES + +! Sea Salt +! -------- + IMPORT_SS_DEP_FLUXES: if (r%doing_SS) then + do n = 1, r%n_SS + ! dry deposition + write (field_name, '(A, I0.3)') 'SSDP', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! wet deposition + write (field_name, '(A, I0.3)') 'SSWT', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! gravitational settling + write (field_name, '(A, I0.3)') 'SSSD', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + ! convective scavenging + write (field_name, '(A, I0.3)') 'SSSV', n + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'clim'//field_name, & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + end do + end if IMPORT_SS_DEP_FLUXES + +else + +! 3-D Quantities +! -------------- + +! GMICHEM species +! --------------- + GMI_on: if (state%chemReg%doing_GMI) then + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OH', & + LONG_NAME = 'Hydroxyl_radical', & + UNITS = 'mol/mol', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CH4', & + LONG_NAME = 'Methane', & + UNITS = 'mol/mol', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'H2O2', & + LONG_NAME = 'Hydrogen_peroxide', & + UNITS = 'mol/mol', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'NO3', & + LONG_NAME = 'Nitrogen_trioxide', & + UNITS = 'mol/mol', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + end if GMI_on + +! Pressure at layer edges +! ----------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'PLE', & + LONG_NAME = 'air_pressure', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + +! Pressure thickness +! ------------------ + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'DELP', & + LONG_NAME = 'pressure_thickness', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! Height at the edges +! ------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'ZLE', & + LONG_NAME = 'geopotential_height', & + UNITS = 'm', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + +! AIRDENS: moist air density +! -------------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'AIRDENS', & + LONG_NAME = 'moist_air_density', & + UNITS = 'kg/m^3', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! AIRDENS_DRY: dry air density +! ---------------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'AIRDENS_DRYP', & + LONG_NAME = 'partial_dry_air_density', & + UNITS = 'kg dry m-3 tot', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! CLOUD +! ----- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'FCLD' , & + LONG_NAME = 'Cloud fraction for radiation', & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + +! T +! - + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'T', & + LONG_NAME = 'air_temperature', & + UNITS = 'K', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! U +! - + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'U', & + LONG_NAME = 'eastward_wind', & + UNITS = 'm s-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! V +! - + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'V', & + LONG_NAME = 'northward_wind', & + UNITS = 'm s-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! Q +! - + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'Q', & + LONG_NAME = 'specific_humidity', & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! QITOT + QITOT +! ------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'QCTOT', & + LONG_NAME = 'mass_fraction_of_total_cloud_water', & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, __RC__) + +! RH: is between 0 and 1 +! ---------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'RH2', & + LONG_NAME = 'Rel_Hum_after_moist', & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + +! PFI_LAAN: this is nonconvective precipition +! ---------------------------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME='PFI_LSAN', & + LONG_NAME ='3D_flux_of_ice_nonconvective_precipitation', & + UNITS ='kg/m2/s', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + +! PFL_LAAN: this is nonconvective precipition +! ---------------------------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME='PFL_LSAN', & + LONG_NAME ='3D_flux_of_liquid_nonconvective_precipitation', & + UNITS ='kg/m2/s', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + +! Ozone from PCHEM for CFC-12 photolysis +! -------------------------------------- + CFC_on: if (state%chemReg%doing_CFC) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'O3', & + LONG_NAME = 'ozone_mass_mixing_ratio', & + UNITS = 'kg/kg', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + end if CFC_on + +! 2-D Quantities +! -------------- + +! TROPP - Connectivity from SDYN to PHYS is TROPP_BLENDED to TROPP +! ---------------------------------------------------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'TROPP', & + LONG_NAME = 'tropopause_pressure_based_on_blended_estimate', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! LWI +! --- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'LWI', & + LONG_NAME = 'land-ocean-ice_mask', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + ! RESTART = MAPL_RestartSkip, & + __RC__) + +! PBL +! --- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'ZPBL', & + LONG_NAME = 'Planetary boundary layer height', & + UNITS = 'm', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! FRACLAKE +! -------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'FRLAKE', & + LONG_NAME = 'fraction_of_lake', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! FROCEAN +! ------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'FROCEAN', & + LONG_NAME = 'fraction_of_ocean', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! FRACI +! ----- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'FRACI', & + LONG_NAME = 'ice_covered_fraction_of_tile', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + ! RESTART = MAPL_RestartSkip, & + __RC__) + +! GWETTOP +! ------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'WET1', & + LONG_NAME = 'surface_soil_wetness', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + +! LAI +! --- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'LAI', & + LONG_NAME = 'leaf_area_index', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! This could be useful, but it is not needed now +! ----------------------------------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'GRN', & + LONG_NAME = 'greeness_fraction', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! PRECC: I hope this is defined over oceans +! ----------------------------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CN_PRCP', & + LONG_NAME = 'Surface Conv. rain flux needed by land', & + UNITS = 'kg/m^2/s', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! PRECL: Non-convective precip, provided by Cinderella +! ---------------------------------------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'NCN_PRCP', & + LONG_NAME = 'Non-convective precipitation', & + UNITS = 'kg/m^2/s', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! PS: from where??? +! ----------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'PS', & + LONG_NAME = 'surface_pressure', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! SHFX (pos is up) - why not evap, Ri, ??? +! ---------------------------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SH', & + LONG_NAME = 'sensible_heat_flux_from_turbulence', & + UNITS = 'W m-2', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! TA -- Surface Air Temperature +! ---- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'TA', & + LONG_NAME = 'surface_temperature_from_surface', & + UNITS = 'K', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! DZ -- Surface Mid-layer Height +! ---- + call MAPL_AddImportSpec(GC, & + LONG_NAME = 'surface_layer_height', & + UNITS = 'm', & + SHORT_NAME = 'DZ', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! TSOIL1, from SURFACE +! -------------------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'TSOIL1', & + LONG_NAME = 'soil_temperatures_layer_1', & + UNITS = 'K', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! U10M +! ---- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'U10M', & + LONG_NAME = '10-meter_eastward_wind', & + UNITS = 'm s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! V10M +! ---- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'V10M', & + LONG_NAME = '10-meter_northward_wind', & + UNITS = 'm s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! U10N +! ---- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'U10N', & + LONG_NAME = 'equivalent_neutral_10-meter_eastward_wind', & + UNITS = 'm s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! V10N +! ---- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'V10N', & + LONG_NAME = 'equivalent_neutral_10-meter_northward_wind', & + UNITS = 'm s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! USTAR +! ----- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'USTAR', & + LONG_NAME = 'surface_velocity_scale', & + UNITS = 'm s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! Z0H +! --- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'Z0H', & + LONG_NAME = 'surface_roughness_for_heat', & + UNITS = 'm', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + +! Cell area +! --------- + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'AREA', & + LONG_NAME = 'agrid_cell_area', & + UNITS = 'm^2', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'TS', & + LONG_NAME = 'surface skin temperature', & + UNITS = 'K', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CNV_MFD', & + LONG_NAME = 'detraining_mass_flux', & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CNV_MFC', & + LONG_NAME = 'cumulative_mass_flux', & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationEdge, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'QLCN', & + LONG_NAME = 'mass_fraction_of_convective_cloud_liquid_water', & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'QICN', & + LONG_NAME = 'mass_fraction_of_convective_cloud_ice_water', & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SWNDSRF', & + LONG_NAME = 'surface_net_downward_shortwave_flux', & + UNITS = 'W m^-2', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CLDTT', & + LONG_NAME = 'total_cloud_area_fraction', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, __RC__) + + + call ESMF_ConfigGetAttribute(CF, DO_CO2CNNEE, label='USE_CNNEE:', default=0, __RC__) + + if (DO_CO2CNNEE == 1) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CNNEE', & + LONG_NAME = 'CN_net_ecosystem_exchange', & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + endif + +end if GOCARTdata_IMPORTS + + +if ( r%doing_GOCART ) then + + +! !INTERNAL STATE: + +! +! NOTES: +! 1) vtitle as it stands is as the CF definition of long name. +! I may need to create a "standard name" in chemReg and pass +! this to GEOS Generic +! 2) Host model MUST provide convective transport as well +! + + nq = r%nq ! total number of chemical tracers + +! Get BOOTSTRAP Default Values for GOCART INTERNAL +! ------------------------------------------------ + CALL ESMF_ConfigGetAttribute(CF, DEFVAL_CO2, Default=380.0e-6, Label='DEFVAL_CO2:', __RC__) + +! Is GOCART providing O3 to the ANALYSIS bundle? +! ---------------------------------------------- + CALL ESMF_ConfigGetAttribute(CF, providerName, Default="PCHEM", Label='ANALYSIS_OX_PROVIDER:', __RC__) + +! r%doing_O3 must be TRUE if the ANALYSIS_OX_PROVIDER is GOCART. +! -------------------------------------------------------------- + IF (providerName == 'GOCART' .AND. .NOT. r%doing_O3) THEN + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,TRIM(Iam)//": Set doing_O3 to yes in Chem_Registry.rc if GOCART " + PRINT *," is the ANALYSIS_OX_PROVIDER." + PRINT *," " + END IF + STATUS = 1 + VERIFY_(STATUS) + END IF + +! Loop over all constituents on registry +! -------------------------------------- + do n = r%i_GOCART, r%j_GOCART + + if (state%data_driven) then + FRIENDLIES = trim(COMP_NAME) + + call ESMF_ConfigGetAttribute(CF, AEROFRIENDLY, Label='AERO_FRIENDLIES:', default=FRIENDLIES, __RC__) + else + if (trim(r%vname(n)) == 'OX' .and. trim(providerName) == 'GOCART') then + FRIENDLIES = 'ANALYSIS:DYNAMICS:TURBULENCE:MOIST' + else + FRIENDLIES = 'DYNAMICS:TURBULENCE:MOIST' + end if + +! Set aerosol friendly attribute to MOIST as function of Convective Parameterization +! ---------------------------------------------------------------------------------- + + short_name = ESMF_UtilStringUpperCase(trim(r%vname(n))) + if ( short_name(1:2) .eq. 'DU' .or. & + short_name(1:2) .eq. 'SS' .or. & + short_name(1:2) .eq. 'OC' .or. & + short_name(1:3) .eq. 'BRC' .or. & + short_name(1:2) .eq. 'BC' .or. & + short_name(1:3) .eq. 'DMS' .or. & + short_name(1:3) .eq. 'SO2' .or. & + short_name(1:3) .eq. 'SO4' .or. & + short_name(1:3) .eq. 'MSA' .or. & + short_name(1:3) .eq. 'NH3' .or. & + short_name(1:4) .eq. 'NH4A' .or. & + short_name(1:5) .eq. 'NO3AN' ) then + + FRIENDLIES = 'DYNAMICS:TURBULENCE:MOIST' + call ESMF_ConfigGetAttribute(CF, AEROFRIENDLY, Label='AERO_FRIENDLIES:', default=trim(FRIENDLIES), __RC__) + + if (index(trim(FRIENDLIES), 'MOIST') > 0) call Disable_Convection + endif + + end if ! data or computational GC + + DEFVAL = 0.0 + if ( short_name(1:3) .eq. 'CO2' ) DEFVAL = DEFVAL_CO2 + +! Aerosol Tracers to be transported +! --------------------------------- + + call MAPL_AddInternalSpec(GC, & + SHORT_NAME = trim(COMP_NAME)//'::'//trim(r%vname(n)), & + LONG_NAME = r%vtitle(n), & + UNITS = r%vunits(n), & + FRIENDLYTO = FRIENDLIES, & + RESTART = MAPL_RestartOptional, & + DEFAULT = DEFVAL, & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, __RC__) + + end do + +! This state is needed by radiation - It will contain +! aerosols and aerosol optics +! -------------------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'AERO', & + LONG_NAME = 'aerosol_mass_mixing_ratios', & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + DATATYPE = MAPL_StateItem, __RC__) + +! This state is needed by MOIST - It will contain +! aerosols +! -------------------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'AERO_ACI', & + LONG_NAME = 'aerosol_cloud_interaction', & + UNITS = 'kg kg-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + DATATYPE = MAPL_StateItem, __RC__) + +! This bundle is needed by surface for snow albedo modification +! by aerosol settling and deposition +! -------------------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'AERO_DP', & + LONG_NAME = 'aerosol_deposition', & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + DATATYPE = MAPL_BundleItem, __RC__) + +! Export RH and DELP used in GOCART calculations +! ---------------------------------------------- + call MAPL_AddExportSpec(GC, & + SHORT_NAME='RH2', & + LONG_NAME ='relative_humidity_after_moist', & + UNITS ='1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, RC=STATUS ) + VERIFY_(STATUS) + + call MAPL_AddExportSpec ( gc, & + SHORT_NAME = 'DELP', & + LONG_NAME = 'pressure_thickness', & + UNITS = 'Pa', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, RC=STATUS ) + VERIFY_(STATUS) + +! Diagnostic Exports over all aerosol tracers +! ------------------------------------------- + +GOCART_COMPUTATIONAL_EXPORTS: if (.not. state%data_driven) then + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'PSO4TOT', & + LONG_NAME = 'Total Sulfate Produced in GOCART', & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'TOTEXTTAU', & + LONG_NAME = 'Total Aerosol Extinction AOT [550 nm]', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'TOTSCATAU', & + LONG_NAME = 'Total Aerosol Scattering AOT [550 nm]', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'TOTEXTT25', & + LONG_NAME = 'Total Aerosol Extinction AOT [550 nm] - PM2.5', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'TOTSCAT25', & + LONG_NAME = 'Total Aerosol Scattering AOT [550 nm] - PM2.5', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'TOTEXTTFM', & + LONG_NAME = 'Total Aerosol Extinction AOT [550 nm] - PM1.0', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'TOTSCATFM', & + LONG_NAME = 'Total Aerosol Scattering AOT [550 nm] - PM1.0', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'TOTANGSTR', & + LONG_NAME = 'Total Aerosol Angstrom parameter [470-870 nm]', & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'PM', & + LONG_NAME = 'Total reconstructed PM', & + UNITS = 'kg m-3', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'PM_RH35', & + LONG_NAME = 'Total reconstructed PM(RH=35%)', & + UNITS = 'kg m-3', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'PM_RH50', & + LONG_NAME = 'Total reconstructed PM(RH=50%)', & + UNITS = 'kg m-3', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'PM25', & + LONG_NAME = 'Total reconstructed PM2.5', & + UNITS = 'kg m-3', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'PM25_RH35', & + LONG_NAME = 'Total reconstructed PM2.5(RH=35%)', & + UNITS = 'kg m-3', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + + call MAPL_AddExportSpec(GC, & + SHORT_NAME = 'PM25_RH50', & + LONG_NAME = 'Total reconstructed PM2.5(RH=50%)', & + UNITS = 'kg m-3', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, __RC__) + +end if GOCART_COMPUTATIONAL_EXPORTS + + +! Call Legacy Set Services +! ---------------------- + if (.not.state%data_driven) then + call Aero_GridCompSetServices ( gc, r, __RC__) + end if + + +!!EOS + +! Set the Profiling timers +! ------------------------ + call MAPL_TimerAdd ( GC, name = 'RUN', __RC__ ) + call MAPL_TimerAdd ( GC, name = 'INITIALIZE', __RC__ ) + call MAPL_TimerAdd ( GC, name = 'FINALIZE', __RC__ ) + call MAPL_TimerAdd ( GC, name = 'AERO1', __RC__ ) + call MAPL_TimerAdd ( GC, name = 'AERO2', __RC__ ) + + call MAPL_TimerAdd (GC, name = 'SS', __RC__) + call MAPL_TimerAdd (GC, name = 'O3', __RC__) + call MAPL_TimerAdd (GC, name = 'DU', __RC__) + call MAPL_TimerAdd (GC, name = 'BC', __RC__) + call MAPL_TimerAdd (GC, name = 'OC', __RC__) + call MAPL_TimerAdd (GC, name = 'SU', __RC__) + call MAPL_TimerAdd (GC, name = 'CO', __RC__) + call MAPL_TimerAdd (GC, name = 'CO2', __RC__) + call MAPL_TimerAdd (GC, name = 'NI', __RC__) + call MAPL_TimerAdd (GC, name = 'BRC', __RC__) + call MAPL_TimerAdd (GC, name = 'CH4', __RC__) + call MAPL_TimerAdd (GC, name = 'CFC', __RC__) + +end if ! doing GOCART + + +! Generic Set Services +! -------------------- + call MAPL_GenericSetServices ( GC, __RC__ ) + +! All done +! -------- + + RETURN_(ESMF_SUCCESS) + + end subroutine SetServices + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Initialize_ --- Initialize Aero_GridComp (ESMF) +! +! !INTERFACE: +! + + subroutine Initialize_ ( gc, impChem, expChem, clock, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(ESMF_Clock), intent(inout) :: clock ! The clock + +! !OUTPUT PARAMETERS: + + type(ESMF_GridComp), intent(inout) :: gc ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This is a simple ESMF wrapper. +! +! !REVISION HISTORY: +! +! 27Feb2005 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + +! ErrLog Variables +! ---------------- + character(len=ESMF_MAXSTR) :: IAm = 'Initialize_' + integer :: STATUS + character(len=ESMF_MAXSTR) :: COMP_NAME + + type(Chem_Registry), pointer :: chemReg + type(Aero_GridComp), pointer :: gcChem ! Grid Component + type(Chem_Bundle), pointer :: w_c ! Chemical tracer fields + integer :: nymd, nhms ! time + real :: cdt ! chemistry timestep (secs) + integer :: hdt ! model timestep (secs) + integer :: rft + + type(ESMF_Grid) :: grid + + integer :: i1=1, i2, ig=0, im ! dist grid indices + integer :: j1=1, j2, jg=0, jm ! dist grid indices + integer :: km, nq ! dist grid indices + integer :: n, dims(3), l + + type(ESMF_Config) :: CF + character(len=ESMF_MAXSTR) :: diurnal_bb + + type(MAPL_MetaComp), pointer :: ggState ! GEOS Generic State + type(GOCART_state), pointer :: myState ! GOCART state + type(ESMF_State) :: internal + type(ESMF_Field) :: field + type(ESMF_Field) :: fld + type(ESMF_FieldBundle) :: bundle + type(ESMF_State) :: aero + type(ESMF_FieldBundle) :: aero_state_aerosols + type(ESMF_State) :: aero_aci + type(ESMF_FieldBundle) :: aero_aci_aerosols + character(len=ESMF_MAXSTR) :: fld_name + integer :: n_aerosols + integer :: n_modes + integer, parameter :: n_gocart_modes = 13 + character(len=ESMF_MAXSTR) :: aero_aci_modes(n_gocart_modes) + character(len=ESMF_MAXSTR) :: short_name + real :: f_aci_seasalt, maxclean, ccntuning + character(LEN=ESMF_MAXSTR) :: CLDMICRO + + type(MAPL_VarSpec), pointer :: InternalSpec(:) + integer :: instance + + real(ESMF_KIND_R4), pointer, dimension(:,:) :: LATS + real(ESMF_KIND_R4), pointer, dimension(:,:) :: LONS + real(ESMF_KIND_R4), pointer, dimension(:,:) :: CELL_AREA + + type(ESMF_Calendar) :: calendar + type(ESMF_Time) :: currentTime + type(ESMF_Alarm) :: alarm_H2O2 + type(ESMF_Alarm) :: alarm_HNO3 + type(ESMF_Time) :: ringTime + type(ESMF_TimeInterval) :: ringInterval + integer :: year, month, day, hh, mm, ss + + type(ESMF_State) :: providerState + character(len=ESMF_MAXSTR) :: prefix + + real(ESMF_KIND_R4), dimension(4) :: Vect_Hcts + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet( GC, NAME=COMP_NAME, CONFIG=CF, __RC__ ) + + Iam = trim(COMP_NAME) // '::' // 'Initialize_' + + if (MAPL_AM_I_ROOT()) then + print *, TRIM(Iam)//': Starting...' + print *,' ' + end if + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC ( GC, ggState, __RC__ ) + + call MAPL_TimerOn(ggState, 'INITIALIZE') + +! Compute proper REFERENCE_TIME if not explicitly specified +! --------------------------------------------------------- + call MAPL_GetResource( ggState, hdt, Label='RUN_DT:', __RC__ ) + call MAPL_GetResource( ggState, cdt, Label='GOCART_DT:', default=real(hdt), __RC__ ) + call MAPL_GetResource( ggState, rft, Label='GOCART_REFERENCE_TIME:', default=-999, __RC__ ) + + if (rft == -999 .and. int(cdt) /= hdt) then + hh = int( hdt/3600 ) + mm = int( (hdt-hh*3600)/60 ) + ss = int( hdt-hh*3600-mm*60 ) + rft = hh*10000 + mm*100 + ss + + call MAPL_ConfigSetAttribute(cf, value=rft, Label="GOCART_REFERENCE_TIME:", __RC__ ) + if (MAPL_AM_I_ROOT()) write(*,"(21x,'Re-Setting GOCART_REFERENCE_TIME: ',i6.6)") rft + endif + + +! Initialize GEOS Generic +! ------------------------ + call MAPL_GenericInitialize ( gc, impChem, expChem, clock, __RC__ ) + + call MAPL_TimerOn(ggState, 'TOTAL') + +! Get pre-ESMF parameters from gc and clock +! ----------------------------------------- + call extract_ ( gc, clock, chemReg, gcChem, w_c, nymd, nhms, cdt, STATUS, state=myState ) + VERIFY_(STATUS) + + +! Create Chem Bundle +! ------------------ + call ESMF_GridCompGet ( GC, grid=grid, __RC__ ) + + call MAPL_GridGet ( grid, globalCellCountPerDim=DIMS, __RC__ ) + + im = dims(1) + jm = dims(2) + nq = chemReg%nq + + call ESMF_GridGet(GRID, localDE = 0, & + staggerloc = ESMF_STAGGERLOC_CENTER, & + computationalCount = DIMS, __RC__) + +! Associate the Internal State fields with our legacy state +! --------------------------------------------------------- + call MAPL_Get ( ggSTATE, INTERNALSPEC = InternalSpec, & + INTERNAL_ESMF_STATE = internal, & + LONS = LONS, & + LATS = LATS, __RC__ ) + +! A-Grid cell area +! ---------------- + if (myState%data_driven) then + CELL_AREA => null() + else + call MAPL_GetPointer(impChem, NAME='AREA', ptr=CELL_AREA, __RC__) + end if + +! Local sizes of three dimensions +!-------------------------------- + i2 = dims(1) + j2 = dims(2) + km = dims(3) + +! Initalize the legacy state but do not allocate memory for arrays +! ---------------------------------------------------------------- + call Chem_BundleCreate_ ( chemReg, i1, i2, ig, im, j1, j2, jg, jm, km, & + w_c, lon=LONS(:,:), lat=LATS(:,:), cell_area=CELL_AREA, & + skipAlloc=.true., __RC__ ) + + w_c%grid_esmf = grid ! Will need this for I/O later + +! Check whether to de-activate diurnal biomass burning (default is *on*) +! ---------------------------------------------------------------------- + call ESMF_ConfigGetAttribute(CF, diurnal_bb, label='DIURNAL_BIOMASS_BURNING:', default='yes', __RC__) + + if ( diurnal_bb(1:3) .eq. 'yes' .or. & + diurnal_bb(1:3) .eq. 'YES' .or. & + diurnal_bb(1:3) .eq. 'Yes' ) then + if (MAPL_AM_I_ROOT()) print *, trim(Iam)//': Diurnal Biomass Burning is ON' + w_c%diurnal_bb = .true. + else + if (MAPL_AM_I_ROOT()) print *, trim(Iam)//': Diurnal Biomass Burning is OFF' + w_c%diurnal_bb = .false. + endif + +! Allocate these because they are not friendly tracers +! ---------------------------------------------------- + allocate(w_c%delp(i1:i2,j1:j2,km), w_c%rh(i1:i2,j1:j2,km), __STAT__) + + _ASSERT( size(InternalSpec) == chemReg%n_GOCART, 'needs informative message' ) + + do L = 1, size(InternalSpec) + + call MAPL_VarSpecGet(InternalSpec(L), SHORT_NAME=short_name, __RC__) + + N = chemReg%i_GOCART + L - 1 + call MAPL_GetPointer(internal, NAME=short_name, ptr=w_c%qa(N)%data3d, __RC__) + + end do + +#ifdef PRINT_STATES + + if (MAPL_AM_I_ROOT()) then + print *, trim(Iam)//': INTERNAL State during Initialize():' + call ESMF_StatePrint ( internal ) + print *, trim(Iam)//': IMPORT State during Initialize():' + call ESMF_StatePrint ( impChem ) + print *, trim(Iam)//': EXPORT State during Initialize():' + call ESMF_StatePrint ( expChem ) + end if + +#endif + +! Call Legacy Initialize +! ---------------------- + call Aero_GridCompInitialize ( gcChem, w_c, gc, impChem, expChem, & + nymd, nhms, cdt, myState%data_driven, STATUS ) + VERIFY_(STATUS) + + +! Create H2O2 and HNO3 alarms +! --------------------------- + if (.not. myState%data_driven .and. w_c%reg%doing_SU) then + + call ESMF_ClockGet(clock, calendar=calendar, currTime=currentTime, RC=STATUS) + VERIFY_(STATUS) + + call ESMF_TimeGet(currentTime, YY=year, MM=month, DD=day, H=hh, M=mm, S=ss, RC=STATUS) + VERIFY_(STATUS) + + call ESMF_TimeSet(ringTime, YY=year, MM=month, DD=day, H=0, M=0, S=0, RC=STATUS) + VERIFY_(STATUS) + + call ESMF_TimeIntervalSet(ringInterval, H=3, calendar=calendar, RC=STATUS) + VERIFY_(STATUS) + + do while (ringTime < currentTime) + ringTime = currentTime + ringInterval + end do + + alarm_H2O2 = ESMF_AlarmCreate(Clock = clock, & + Name = trim(H2O2_RECYCLE_ALARM), & + RingInterval = ringInterval, & + RingTime = currentTime, & + Enabled = .true. , & + Sticky = .false. , & + RC = STATUS) + VERIFY_(STATUS) + end if + + + if (.not. myState%data_driven .and. w_c%reg%doing_NI) then + call ESMF_ClockGet(clock, calendar=calendar, currTime=currentTime, RC=STATUS) + VERIFY_(STATUS) + + call ESMF_TimeGet(currentTime, YY=year, MM=month, DD=day, H=hh, M=mm, S=ss, RC=STATUS) + VERIFY_(STATUS) + + call ESMF_TimeSet(ringTime, YY=year, MM=month, DD=day, H=0, M=0, S=0, RC=STATUS) + VERIFY_(STATUS) + + call ESMF_TimeIntervalSet(ringInterval, H=3, calendar=calendar, RC=STATUS) + VERIFY_(STATUS) + + do while (ringTime < currentTime) + ringTime = currentTime + ringInterval + end do + + alarm_HNO3 = ESMF_AlarmCreate(Clock = clock, & + Name = trim(HNO3_RECYCLE_ALARM), & + RingInterval = ringInterval, & + RingTime = currentTime, & + Enabled = .true. , & + Sticky = .false. , & + RC = STATUS) + VERIFY_(STATUS) + end if + + +! Only at this point we have the scavenging coefficients filled, +! so annotate the convection friendly internal state +! Note: Move this to AddInternalSpec but first we need to have +! the subcomponents as bonafide ESMF components +!-srf added Henrys law constants +! -------------------------------------------------------------- + do n = ChemReg%i_GOCART, ChemReg%j_GOCART + call ESMF_StateGet(internal, trim(COMP_NAME)//'::'//trim(ChemReg%vname(n)), field, __RC__) + call ESMF_AttributeSet(field, NAME='ScavengingFractionPerKm', VALUE=ChemReg%fscav(n), __RC__) + Vect_Hcts(1:4)= ChemReg%hcts(1:4,n) + + call ESMF_AttributeSet(field, 'SetofHenryLawCts', Vect_Hcts, __RC__) + end do + +! Now that the internal state is nice and ready, add its contents and +! attach aerosol optics method to the AERO state needed by radiation +! --------------------------------------------------------------------- + call ESMF_StateGet(expChem, 'AERO', aero, __RC__) + + ! This attribute indicates if the aerosol optics method is implemented or not. + ! Radiation will not call the aerosol optics method unless this attribute is + ! explicitly set to true. + call ESMF_AttributeSet(aero, name='implements_aerosol_optics_method', value=.true., __RC__) + + aero_state_aerosols = ESMF_FieldBundleCreate(name='AEROSOLS', __RC__) + call MAPL_StateAdd(aero, aero_state_aerosols, __RC__) + + do n = ChemReg%i_GOCART, ChemReg%j_GOCART + + short_name = ESMF_UtilStringUpperCase(trim(ChemReg%vname(n))) + + if ( short_name .eq. 'DU001' .or. & + short_name .eq. 'DU002' .or. & + short_name .eq. 'DU003' .or. & + short_name .eq. 'DU004' .or. & + short_name .eq. 'DU005' .or. & + short_name .eq. 'SS001' .or. & + short_name .eq. 'SS002' .or. & + short_name .eq. 'SS003' .or. & + short_name .eq. 'SS004' .or. & + short_name .eq. 'SS005' .or. & + short_name .eq. 'NO3AN1' .or. & + short_name .eq. 'NO3AN2' .or. & + short_name .eq. 'NO3AN3' .or. & + short_name .eq. 'OCPHOBIC' .or. & + short_name .eq. 'OCPHILIC' .or. & + short_name .eq. 'BRCPHOBIC' .or. & + short_name .eq. 'BRCPHILIC' .or. & + short_name .eq. 'BCPHOBIC' .or. & + short_name .eq. 'BCPHILIC' .or. & + short_name .eq. 'SO4' .or. & + short_name .eq. 'SO4V' ) & + then + call ESMF_StateGet(INTERNAL, & + trim(COMP_NAME) // '::'// & + trim(ChemReg%vname(n)), & + FIELD, __RC__ ) + + fld = MAPL_FieldCreate(FIELD, name=ChemReg%vname(n), __RC__) + call MAPL_FieldBundleAdd(aero_state_aerosols, fld, __RC__) + end if + end do + + call ESMF_FieldBundleGet(aero_state_aerosols, fieldCount=n_aerosols, __RC__) + + if (n_aerosols > 0) then + + if (myState%data_driven) then + instance = instanceData + else + instance = instanceComputational + end if + + gocartMieTable(instance) = Chem_MieCreate(CF, __RC__) + + ! Mie Table instance/index + call ESMF_AttributeSet(aero, name='mie_table_instance', value=instance, __RC__) + + ! state of the atmosphere + call ESMF_AttributeSet(aero, name='air_pressure_for_aerosol_optics', value='PLE', __RC__) + call ESMF_AttributeSet(aero, name='relative_humidity_for_aerosol_optics', value='RH', __RC__) + call ESMF_AttributeSet(aero, name='cloud_area_fraction_for_aerosol_optics', value='', __RC__) ! 'cloud_area_fraction_in_atmosphere_layer_for_aerosol_optics' + + ! aerosol optics + call ESMF_AttributeSet(aero, name='band_for_aerosol_optics', value=0, __RC__) + call ESMF_AttributeSet(aero, name='extinction_in_air_due_to_ambient_aerosol', value='EXT', __RC__) + call ESMF_AttributeSet(aero, name='single_scattering_albedo_of_ambient_aerosol', value='SSA', __RC__) + call ESMF_AttributeSet(aero, name='asymmetry_parameter_of_ambient_aerosol', value='ASY', __RC__) + + ! add PLE to aero state + call ESMF_AttributeGet(aero, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationEdge, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero, fld, __RC__) + end if + + ! add RH to Aero state + call ESMF_AttributeGet(aero, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero, fld, __RC__) + end if + + ! add EXT to aero state + call ESMF_AttributeGet(aero, name='extinction_in_air_due_to_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero, fld, __RC__) + end if + + ! add SSA to aero state + call ESMF_AttributeGet(aero, name='single_scattering_albedo_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero, fld, __RC__) + end if + + ! add ASY to aero state + call ESMF_AttributeGet(aero, name='asymmetry_parameter_of_ambient_aerosol', value=fld_name, RC=STATUS) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero, fld, __RC__) + end if + + ! attach the aerosol optics method + call ESMF_MethodAdd(aero, label='aerosol_optics', userRoutine=aerosol_optics, __RC__) + + end if + +#ifdef PRINT_STATES + if (MAPL_AM_I_ROOT()) then + print *, trim(Iam)//': AERO State during Initialize():' + call ESMF_StatePrint(aero, nestedFlag=.true., __RC__) + end if +#endif + + +! Now that the internal state is nice and ready, add its contents and +! attach aerosol-cloud interaction method to the AERO_ACI state needed by moist +! --------------------------------------------------------------------- + call ESMF_StateGet(expChem, 'AERO_ACI', aero_aci, __RC__) + + ! This attribute indicates if the aerosol optics method is implemented or not. + ! Radiation will not call the aerosol optics method unless this attribute is + ! explicitly set to true. + call ESMF_AttributeSet(aero_aci, name='implements_aerosol_activation_properties_method', value=.true., __RC__) + + aero_aci_aerosols = ESMF_FieldBundleCreate(name='AEROSOLS', __RC__) + call MAPL_StateAdd(aero_aci, aero_aci_aerosols, __RC__) + + do n = ChemReg%i_GOCART, ChemReg%j_GOCART + short_name = ESMF_UtilStringUpperCase(trim(ChemReg%vname(n))) + + if ( short_name .eq. 'DU001' .or. & + short_name .eq. 'DU002' .or. & + short_name .eq. 'DU003' .or. & + short_name .eq. 'DU004' .or. & + short_name .eq. 'DU005' .or. & + short_name .eq. 'SS001' .or. & + short_name .eq. 'SS002' .or. & + short_name .eq. 'SS003' .or. & + short_name .eq. 'SS004' .or. & + short_name .eq. 'SS005' .or. & +!! short_name .eq. 'NO3AN1' .or. & +!! short_name .eq. 'NO3AN2' .or. & +!! short_name .eq. 'NO3AN3' .or. & + short_name .eq. 'OCPHOBIC' .or. & + short_name .eq. 'OCPHILIC' .or. & + short_name .eq. 'BCPHOBIC' .or. & + short_name .eq. 'BCPHILIC' .or. & + short_name .eq. 'SO4' .or. & + short_name .eq. 'SO4V' ) & + then + call ESMF_StateGet(INTERNAL, & + trim(COMP_NAME) // '::'// & + trim(ChemReg%vname(n)), & + FIELD, __RC__ ) + + fld = MAPL_FieldCreate(FIELD, name=ChemReg%vname(n), __RC__) + call MAPL_FieldBundleAdd(aero_aci_aerosols, fld, __RC__) + end if + end do + + ! + ! NOTE: The implementation of aerosol-cloud interaction in case of GOCART aerosols + ! treats every aerosol tracer as a distinctive aerosol mode. + ! + + ! Following the aerosol-cloud-interaction state protocol, next steps are: + ! - attach a list with the aerosol modes + ! - attach required met fields + ! - attach method that computes the aerosol activation properties + + call ESMF_FieldBundleGet(aero_aci_aerosols, fieldCount=n_aerosols, __RC__) + + aero_aci_modes = (/'du001 ', 'du002 ', 'du003 ', & + 'du004 ', 'du005 ', & + 'ss001 ', 'ss002 ', 'ss003 ', & + 'sulforg01', 'sulforg02', 'sulforg03', & + 'bcphilic ', 'ocphilic '/) + + n_modes = size(aero_aci_modes) + + + if (n_modes > 0 .and. n_aerosols > 0) then + + call ESMF_AttributeSet(aero_aci, name='number_of_aerosol_modes', value=n_modes, __RC__) + call ESMF_AttributeSet(aero_aci, name='aerosol_modes', itemcount=n_modes, valuelist=aero_aci_modes, __RC__) + + + ! met fields and land fraction + call ESMF_AttributeSet(aero_aci, name='air_pressure', value='PLE', __RC__) + call ESMF_AttributeSet(aero_aci, name='air_temperature', value='T', __RC__) + call ESMF_AttributeSet(aero_aci, name='fraction_of_land_type', value='FRLAND', __RC__) + + ! max mixing ratio before switching to "polluted" size distributions + call ESMF_ConfigGetAttribute(CF, maxclean, default=1.0e-9, label='MAXCLEAN:', __RC__) + call ESMF_AttributeSet(aero_aci, name='max_q_clean', value=maxclean, __RC__) + + call ESMF_ConfigGetAttribute(CF, CCNtuning, default=1.8, label='CCNTUNING:', __RC__) + call ESMF_AttributeSet(aero_aci, name='ccn_tuning', value=CCNtuning, __RC__) + + call ESMF_ConfigGetAttribute( CF, CLDMICRO, Label='CLDMICRO:', default="1MOMENT", RC=STATUS) + call ESMF_AttributeSet(aero_aci, name='cldmicro', value=CLDMICRO, __RC__) + + ! scaling factor for sea salt + if(adjustl(CLDMICRO)=="2MOMENT") then + call ESMF_ConfigGetAttribute(CF, f_aci_seasalt, default=4.0, label='SS_SCALE:', __RC__) + call ESMF_AttributeSet(aero_aci, name='seasalt_scaling_factor', value=f_aci_seasalt, __RC__) + else + ! scaling factor for sea salt + call ESMF_ConfigGetAttribute(CF, f_aci_seasalt, default=14.0, label='SS_SCALE:', __RC__) + call ESMF_AttributeSet(aero_aci, name='seasalt_scaling_factor', value=f_aci_seasalt, __RC__) + endif + + ! aerosol activation properties + call ESMF_AttributeSet(aero_aci, name='width_of_aerosol_mode', value='SIGMA', __RC__) + call ESMF_AttributeSet(aero_aci, name='aerosol_number_concentration', value='NUM', __RC__) + call ESMF_AttributeSet(aero_aci, name='aerosol_dry_size', value='DGN', __RC__) + call ESMF_AttributeSet(aero_aci, name='aerosol_density', value='density', __RC__) + call ESMF_AttributeSet(aero_aci, name='aerosol_hygroscopicity', value='KAPPA', __RC__) + call ESMF_AttributeSet(aero_aci, name='fraction_of_dust_aerosol', value='FDUST', __RC__) + call ESMF_AttributeSet(aero_aci, name='fraction_of_soot_aerosol', value='FSOOT', __RC__) + call ESMF_AttributeSet(aero_aci, name='fraction_of_organic_aerosol', value='FORGANIC', __RC__) + + + ! add PLE to ACI state + call ESMF_AttributeGet(aero_aci, name='air_pressure', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationEdge, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + ! add T to ACI state + call ESMF_AttributeGet(aero_aci, name='air_temperature', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + ! add FRLAND to ACI state + call ESMF_AttributeGet(aero_aci, name='fraction_of_land_type', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzOnly, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + + ! add aerosol activation properties to ACI state + call ESMF_AttributeGet(aero_aci, name='width_of_aerosol_mode', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + call ESMF_AttributeGet(aero_aci, name='aerosol_number_concentration', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + call ESMF_AttributeGet(aero_aci, name='aerosol_dry_size', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + call ESMF_AttributeGet(aero_aci, name='aerosol_density', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + call ESMF_AttributeGet(aero_aci, name='aerosol_hygroscopicity', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + call ESMF_AttributeGet(aero_aci, name='fraction_of_dust_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + call ESMF_AttributeGet(aero_aci, name='fraction_of_soot_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + call ESMF_AttributeGet(aero_aci, name='fraction_of_organic_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + fld = MAPL_FieldCreateEmpty(trim(fld_name), w_c%grid_esmf, __RC__) + + call MAPL_FieldAllocCommit(fld, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=MAPL_R4, hw=0, __RC__) + call MAPL_StateAdd(aero_aci, fld, __RC__) + end if + + ! attach the aerosol optics method + call ESMF_MethodAdd(aero_aci, label='aerosol_activation_properties', userRoutine=aerosol_activation_properties, __RC__) + end if + + +! Add settling and deposition to the AERO_DP bundle +! ------------------------------------------------- + call ESMF_StateGet(expChem, 'AERO_DP', bundle, __RC__ ) + +! If using GOCART.data, the data is provided in the import +! state via ExtData versus the actual GOCART children +! -------------------------------------------------------- + if ( myState%data_driven ) then + providerState = impChem + prefix = 'clim' + else + providerState = expChem + prefix = '' + end if + +! Dust +! ---- + if ( ChemReg%doing_DU ) then + +! Dry deposition +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUDP001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUDP002', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUDP003', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUDP004', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUDP005', __RC__) + +! Wet deposition (Convective scavenging) +! -------------------------------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUSV001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUSV002', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUSV003', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUSV004', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUSV005', __RC__) + +! Wet deposition +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUWT001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUWT002', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUWT003', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUWT004', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUWT005', __RC__) + +! Gravitational Settling +! ---------------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUSD001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUSD002', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUSD003', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUSD004', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'DUSD005', __RC__) + + end if + +! Black Carbon +! ------------ + if ( ChemReg%doing_BC ) then + +! Dry deposition +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'BCDP001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'BCDP002', __RC__) + +! Wet deposition (Convective scavenging) +! -------------------------------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'BCSV001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'BCSV002', __RC__) + +! Wet deposition +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'BCWT001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'BCWT002', __RC__) + +! Gravitational Settling +! ---------------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'BCSD001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'BCSD002', __RC__) + + end if + +! Organic Carbon +! -------------- + if ( ChemReg%doing_OC ) then + +! Dry deposition +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'OCDP001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'OCDP002', __RC__) + +! Wet deposition (Convective scavenging) +! -------------------------------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'OCSV001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'OCSV002', __RC__) + +! Wet deposition +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'OCWT001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'OCWT002', __RC__) + +! Gravitational Settling +! ---------------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'OCSD001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'OCSD002', __RC__) + + end if + +! Sulfate (SO4; only aerosol component; bin 003) +! ---------------------------------------------- + if ( ChemReg%doing_SU ) then + +! Dry deposition +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SUDP003', __RC__) + +! Wet deposition (Convective scavenging) +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SUSV003', __RC__) + +! Wet deposition +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SUWT003', __RC__) + +! Gravitational Settling +! ---------------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SUSD003', __RC__) + + end if + +! Sea Salt +! -------- + if ( ChemReg%doing_SS ) then + +! Dry deposition +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSDP001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSDP002', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSDP003', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSDP004', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSDP005', __RC__) + +! Wet deposition (Convective scavenging) +! -------------------------------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSSV001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSSV002', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSSV003', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSSV004', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSSV005', __RC__) + +! Wet deposition +! -------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSWT001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSWT002', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSWT003', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSWT004', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSWT005', __RC__) + +! Gravitational Settling +! ---------------------- + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSSD001', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSSD002', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSSD003', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSSD004', __RC__) + call AddFromExportToBundle_(providerState, bundle, trim(prefix)//'SSSD005', __RC__) + + end if + +#ifdef PRINT_STATES + + if (MAPL_AM_I_ROOT()) then + print *, trim(Iam)//': AERO_DP Bundle during Initialize():' + call ESMF_FieldBundlePrint ( bundle ) + end if + +#endif + + call MAPL_TimerOff(ggState, 'TOTAL') + call MAPL_TimerOff(ggState, 'INITIALIZE') + + RETURN_(ESMF_SUCCESS) + +CONTAINS + + subroutine AddFromExportToBundle_(STATE, BUNDLE, NAME, RC) + type(ESMF_State) :: STATE + type(ESMF_FieldBundle) :: BUNDLE + CHARACTER(LEN=*) :: NAME + integer, optional :: RC + type(ESMF_Field) :: FIELD + __Iam__('AddFromExportToBundle_') + call ESMF_StateGet( STATE, NAME, FIELD, __RC__ ) + call MAPL_AllocateCoupling( FIELD, __RC__ ) + call MAPL_FieldBundleAdd ( BUNDLE, FIELD, __RC__ ) + RETURN_(ESMF_SUCCESS) + end subroutine AddFromExportToBundle_ + + end subroutine Initialize_ + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Run1_ --- Runs Aero_GridComp (ESMF) +! +! !INTERFACE: +! + + subroutine Run1_ ( gc, impChem, expChem, clock, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(ESMF_Clock), intent(inout) :: clock ! The clock + +! !OUTPUT PARAMETERS: + + type(ESMF_GridComp), intent(inout) :: gc ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This is a simple ESMF wrapper. +! +! !REVISION HISTORY: +! +! 27Feb2005 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + +! ErrLog Variables +! ---------------- + character(len=ESMF_MAXSTR) :: IAm + integer :: STATUS + character(len=ESMF_MAXSTR) :: COMP_NAME + + type(Chem_Registry), pointer :: chemReg + type(Aero_GridComp), pointer :: gcChem ! Grid Component + type(Chem_Bundle), pointer :: w_c ! Chemical tracer fields + integer :: nymd, nhms ! time + real :: cdt ! chemistry timestep (secs) + real :: hdt ! heartbeat time step (secs) + real, pointer :: var(:,:,:) + integer :: n + + type(ESMF_Config) :: CF + + type(MAPL_MetaComp), pointer :: ggState ! GEOS Generic State + type(ESMF_Alarm) :: ALARM + + real(ESMF_KIND_R4), pointer, dimension(:,:) :: LATS + real(ESMF_KIND_R4), pointer, dimension(:,:) :: LONS + + type (MAPL_SunOrbit) :: ORBIT + real, allocatable, target :: ZTH(:,:) ! can be R8 + real(ESMF_KIND_R4), allocatable :: r4ZTH(:,:) + real(ESMF_KIND_R4), allocatable :: SLR(:,:) + + real, pointer :: rh2(:,:,:) + integer :: in, jn + + type(GOCART_state), pointer :: myState + + +! --- + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet( GC, NAME=COMP_NAME, CONFIG=CF, __RC__ ) + Iam = trim(COMP_NAME) // '::' // 'Run1_' + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC ( GC, ggState, __RC__) + + call MAPL_TimerOn(ggState, 'TOTAL') + call MAPL_TimerOn(ggState, 'RUN') + +! Get parameters from generic state. +! ---------------------------------- + call MAPL_Get(ggState, LONS=LONS, LATS=LATS, ORBIT=ORBIT, RUNALARM=ALARM, __RC__) + +! Get heartbeat time step +! ----------------------- + call MAPL_GetResource(ggState, hdt, label='RUN_DT:', __RC__) + +! Get pre-ESMF parameters from gc and clock +! ----------------------------------------- + call extract_ ( gc, clock, chemReg, gcChem, w_c, nymd, nhms, cdt, STATUS, state=myState ) + VERIFY_(STATUS) + +! Until all the gas phase species handle GOCART_DT correctly, we must run at the heartbeat +! ---------------------------------------------------------------------------------------- +! Assume that DT is always an integral number of seconds +! Add a fraction to both (and then truncate to int), to avoid cases like 900 /= 899.999999 + _ASSERT(abs(cdt-hdt) < 0.1, 'Implementation of GOCART_DT is problematic; set GOCART_DT = HEARTBEAT_DT') + + allocate(r4ZTH(SIZE(LATS,1), SIZE(LATS,2)), __STAT__) + allocate( ZTH(SIZE(LATS,1), SIZE(LATS,2)), __STAT__) + allocate( SLR(SIZE(LATS,1), SIZE(LATS,2)), __STAT__) + +! Update solar zenith angle +! -------------------------- + call MAPL_SunGetInsolation(LONS, LATS, ORBIT, r4ZTH, SLR, CLOCK=CLOCK, __RC__) + +! Set pointers for sine/cosine zenith angle +! ----------------------------------------- + +! w_c%sinz => ... + ZTH = r4ZTH + w_c%cosz => zth + +! Fill in delp +! ------------ + call MAPL_GetPointer ( impChem, var, 'DELP', __RC__ ) + w_c%delp = var(:,:,:) + +! Fill in RH +! ---------- + call MAPL_GetPointer ( impChem, rh2, 'RH2', __RC__ ) + w_c%rh = rh2 + +! Make sure tracers remain positive +! --------------------------------- + in = size(w_c%delp,1); jn = size(w_c%delp,2) + do n = ChemReg%i_GOCART, ChemReg%j_GOCART + call Chem_UtilNegFiller ( w_c%qa(n)%data3d, w_c%delp, in, jn, & + qmin=tiny(1.0) ) + end do + +! Call pre-ESMF version: runs at the heartbeat +! -------------------------------------------- + call MAPL_TimerOn(ggState,'AERO1') + call Aero_GridCompRun1 ( gcChem, w_c, gc, impChem, expChem, & + nymd, nhms, hdt, STATUS ) + VERIFY_(STATUS) + call MAPL_TimerOff(ggState,'AERO1') + + deallocate(SLR, __STAT__) + deallocate(ZTH, __STAT__) + deallocate(r4ZTH, __STAT__) + + call MAPL_TimerOff(ggState, 'RUN') + call MAPL_TimerOff(ggState, 'TOTAL') + + RETURN_(ESMF_SUCCESS) + + end subroutine Run1_ + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Run_ --- Runs Aero_GridComp (ESMF) +! +! !INTERFACE: +! + + subroutine Run2_ ( gc, impChem, expChem, clock, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(ESMF_Clock), intent(inout) :: clock ! The clock + +! !OUTPUT PARAMETERS: + + type(ESMF_GridComp), intent(inout) :: gc ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This is a simple ESMF wrapper. +! +! !REVISION HISTORY: +! +! 27Feb2005 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + +! ErrLog Variables +! ---------------- + character(len=ESMF_MAXSTR) :: IAm + integer :: STATUS + character(len=ESMF_MAXSTR) :: COMP_NAME + + type(Chem_Registry), pointer :: chemReg + type(Aero_GridComp), pointer :: gcChem ! Grid Component + type(Chem_Bundle), pointer :: w_c ! Chemical tracer fields + integer :: nymd, nhms ! time + real :: hdt ! heartbeat timestep (secs) + real :: cdt ! chemistry timestep (secs) + real, pointer :: var(:,:,:) + integer :: n + + type(ESMF_Config) :: CF + + type(MAPL_MetaComp), pointer :: ggState ! GEOS Generic State + type(ESMF_Alarm) :: ALARM + + real(ESMF_KIND_R4), pointer, dimension(:,:) :: LATS + real(ESMF_KIND_R4), pointer, dimension(:,:) :: LONS + + type (MAPL_SunOrbit) :: ORBIT + real, allocatable, target :: ZTH(:,:) ! can be R8 + real(ESMF_KIND_R4), allocatable :: r4ZTH(:,:) + real(ESMF_KIND_R4), allocatable :: SLR(:,:) + + real, pointer :: rh2(:,:,:) + integer :: in, jn + + type(ESMF_State) :: internal + type(GOCART_state), pointer :: myState + real, pointer, dimension(:,:,:) :: ptr3d_int + real, pointer, dimension(:,:,:) :: ptr3d_imp + + logical :: run_alarm + logical :: alarm_is_ringing + + +! Diagnostics + real, pointer, dimension(:,:) :: totexttau, totscatau, & + totextt25, totscat25, & + totexttfm, totscatfm, & + totangstr + real, pointer, dimension(:,:) :: pm, pm25, & + pm_rh35, pm25_rh35, & + pm_rh50, pm25_rh50 + real, pointer, dimension(:,:) :: duexttau, duscatau, & + duextt25, duscat25, & + duexttfm, duscatfm, & + duangstr, dusmass, & + dusmass25 + real, pointer, dimension(:,:) :: ssexttau, ssscatau, & + ssextt25, ssscat25, & + ssexttfm, ssscatfm, & + ssangstr, sssmass, & + sssmass25 + real, pointer, dimension(:,:) :: niexttau, niscatau, & + niextt25, niscat25, & + niexttfm, niscatfm, & + niangstr, nismass, & + nismass25 + real, pointer, dimension(:,:) :: nh4smass + real, pointer, dimension(:,:) :: suexttau, suscatau, & + suangstr, susmass + real, pointer, dimension(:,:) :: suexttauvolc, suscatauvolc, & + suangstrvolc, susmassvolc + real, pointer, dimension(:,:) :: bcexttau, bcscatau, & + bcangstr, bcsmass + real, pointer, dimension(:,:) :: ocexttau, ocscatau, & + ocangstr, ocsmass + real, pointer, dimension(:,:) :: brcexttau, brcscatau, & + brcangstr, brcsmass + real, pointer, dimension(:,:,:) :: rh2x, delpx + real, pointer, dimension(:,:,:) :: pso4, pso4v, pso4t + real, allocatable :: tau1(:,:), tau2(:,:) + real :: c1, c2, c3 + +! --- + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet( GC, NAME=COMP_NAME, CONFIG=CF, __RC__ ) + Iam = trim(COMP_NAME) // '::' // 'Run2_' + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC ( GC, ggState, __RC__) + + call MAPL_TimerOn(ggState, 'TOTAL') + call MAPL_TimerOn(ggState, 'RUN') + +! Get heartbeat time step +! ----------------------- + call MAPL_GetResource(ggState, hdt, label='RUN_DT:', __RC__) + +! Is time to recycle H2O2 and HNO3? +! --------------------------------- + call extract_ ( gc, clock, chemReg, gcChem, w_c, nymd, nhms, cdt, STATUS, state=myState ) + VERIFY_(STATUS) + + if (.not. myState%data_driven) then + + if (w_c%reg%doing_SU) then + call ESMF_ClockGetAlarm(clock, trim(H2O2_RECYCLE_ALARM), alarm, __RC__) + + alarm_is_ringing = ESMF_AlarmIsRinging(alarm, __RC__) + + if (alarm_is_ringing) then + do n = 1, gcChem%gcSU%n + if (.not. gcChem%gcSU%gcs(n)%using_GMI_H2O2) then + gcChem%gcSU%gcs(n)%recycle_H2O2 = .true. + end if + end do + + call ESMF_AlarmRingerOff(alarm, __RC__) + end if + end if + + if (w_c%reg%doing_NI) then + call ESMF_ClockGetAlarm(clock, trim(HNO3_RECYCLE_ALARM), alarm, __RC__) + + alarm_is_ringing = ESMF_AlarmIsRinging(alarm, __RC__) + + if (alarm_is_ringing) then + do n = 1, gcChem%gcNI%n + gcChem%gcNI%gcs(n)%recycle_HNO3 = .true. + end do + + call ESMF_AlarmRingerOff(alarm, __RC__) + end if + end if + + end if + +! Get parameters from generic state. +! ---------------------------------- + call MAPL_Get(ggState, LONS=LONS, LATS=LATS, ORBIT=ORBIT, RUNALARM=ALARM, __RC__) + +! Get pre-ESMF parameters from gc and clock +! ----------------------------------------- + call extract_ ( gc, clock, chemReg, gcChem, w_c, nymd, nhms, cdt, STATUS, state=myState ) + VERIFY_(STATUS) + + if (myState%data_driven) then + + call MAPL_Get ( ggState, INTERNAL_ESMF_STATE=internal, __RC__ ) + + do n = chemReg%i_GOCART, chemReg%j_GOCART + call MAPL_GetPointer ( internal, NAME=trim(COMP_NAME)//'::'//trim(chemReg%vname(n)), ptr=ptr3d_int, __RC__ ) + call MAPL_GetPointer ( impChem, NAME='clim'//trim(chemReg%vname(n)), ptr=ptr3d_imp, __RC__ ) + + ptr3d_int = ptr3d_imp + end do + + call MAPL_TimerOff(ggState, 'RUN') + call MAPL_TimerOff(ggState, 'TOTAL') + + RETURN_(ESMF_SUCCESS) + end if + + + allocate(r4ZTH(SIZE(LATS,1), SIZE(LATS,2)), __STAT__) + allocate( ZTH(SIZE(LATS,1), SIZE(LATS,2)), __STAT__) + allocate( SLR(SIZE(LATS,1), SIZE(LATS,2)), __STAT__) + +! Update solar zenith angle +! -------------------------- + call MAPL_SunGetInsolation(LONS, LATS, ORBIT, r4ZTH, SLR, CLOCK=CLOCK, __RC__) + +! Set pointers for sine/cosine zenith angle +! ----------------------------------------- + +! w_c%sinz => ... + ZTH = r4ZTH + w_c%cosz => zth + +! Fill in delp +! ------------ + call MAPL_GetPointer ( impChem, var, 'DELP', __RC__ ) + w_c%delp = var(:,:,:) + +! Fill in RH +! ---------- + call MAPL_GetPointer ( impChem, rh2, 'RH2', __RC__ ) + w_c%rh = rh2 + +! Make sure tracers remain positive +! --------------------------------- + in = size(w_c%delp,1); jn = size(w_c%delp,2) + do n = ChemReg%i_GOCART, ChemReg%j_GOCART + call Chem_UtilNegFiller ( w_c%qa(n)%data3d, w_c%delp, in, jn, & + qmin=tiny(1.0) ) + end do + +! Call pre-ESMF version +! --------------------- + run_alarm = ESMF_AlarmIsRinging(ALARM, RC=STATUS) + + call MAPL_TimerOn(ggState,'AERO2') + call Aero_GridCompRun2 ( gcChem, w_c, gc, impChem, expChem, & + run_alarm, nymd, nhms, cdt, STATUS ) + VERIFY_(STATUS) + call MAPL_TimerOff(ggState,'AERO2') + + if (run_alarm) then + call ESMF_AlarmRingerOff(ALARM, __RC__) + end if + +! Get the diagnostics + call MAPL_GetPointer (expChem, totexttau, 'TOTEXTTAU', __RC__) + call MAPL_GetPointer (expChem, totscatau, 'TOTSCATAU', __RC__) + call MAPL_GetPointer (expChem, totextt25, 'TOTEXTT25', __RC__) + call MAPL_GetPointer (expChem, totscat25, 'TOTSCAT25', __RC__) + call MAPL_GetPointer (expChem, totexttfm, 'TOTEXTTFM', __RC__) + call MAPL_GetPointer (expChem, totscatfm, 'TOTSCATFM', __RC__) + call MAPL_GetPointer (expChem, totangstr, 'TOTANGSTR', __RC__) + + ! dry PM + call MAPL_GetPointer (expChem, pm25, 'PM25', __RC__) + call MAPL_GetPointer (expChem, pm, 'PM', __RC__) + call MAPL_GetPointer (expChem, rh2x, 'RH2', __RC__) + call MAPL_GetPointer (expChem, delpx, 'DELP', __RC__) + + ! PM at RH=35% + call MAPL_GetPointer (expChem, pm25_rh35, 'PM25_RH35', __RC__) + call MAPL_GetPointer (expChem, pm_rh35, 'PM_RH35', __RC__) + + ! PM at RH=50% + call MAPL_GetPointer (expChem, pm25_rh50, 'PM25_RH50', __RC__) + call MAPL_GetPointer (expChem, pm_rh50, 'PM_RH50', __RC__) + + ! Sulfate produced (SO4-) in GOCART sulfur chemistry [kg m-2 s-1] + call MAPL_GetPointer (expChem, pso4t, 'PSO4TOT', __RC__) + + if(associated(totexttau)) totexttau(:,:) = 0. + if(associated(totscatau)) totscatau(:,:) = 0. + if(associated(totextt25)) totextt25(:,:) = 0. + if(associated(totscat25)) totscat25(:,:) = 0. + if(associated(totexttfm)) totexttfm(:,:) = 0. + if(associated(totscatfm)) totscatfm(:,:) = 0. + + if(associated(pm)) pm(:,:) = 0. + if(associated(pm25)) pm25(:,:) = 0. + if(associated(pm_rh35)) pm_rh35(:,:) = 0. + if(associated(pm25_rh35)) pm25_rh35(:,:) = 0. + if(associated(pm_rh50)) pm_rh50(:,:) = 0. + if(associated(pm25_rh50)) pm25_rh50(:,:) = 0. + + if(associated(rh2x)) rh2x = w_c%rh + if(associated(delpx)) delpx = w_c%delp + + if(associated(pso4t)) pso4t(:,:,:) = 0. + + if(w_c%reg%doing_du) then + call MAPL_GetPointer (expChem, duexttau, 'DUEXTTAU', __RC__) + call MAPL_GetPointer (expChem, duscatau, 'DUSCATAU', __RC__) + call MAPL_GetPointer (expChem, duextt25, 'DUEXTT25', __RC__) + call MAPL_GetPointer (expChem, duscat25, 'DUSCAT25', __RC__) + call MAPL_GetPointer (expChem, duexttfm, 'DUEXTTFM', __RC__) + call MAPL_GetPointer (expChem, duscatfm, 'DUSCATFM', __RC__) + call MAPL_GetPointer (expChem, duangstr, 'DUANGSTR', __RC__) + if(associated(totexttau) .and. associated(duexttau)) totexttau = totexttau+duexttau + if(associated(totscatau) .and. associated(duscatau)) totscatau = totscatau+duscatau + if(associated(totextt25) .and. associated(duextt25)) totextt25 = totextt25+duextt25 + if(associated(totscat25) .and. associated(duscat25)) totscat25 = totscat25+duscat25 + if(associated(totexttfm) .and. associated(duexttfm)) totexttfm = totexttfm+duexttfm + if(associated(totscatfm) .and. associated(duscatfm)) totscatfm = totscatfm+duscatfm + + call MAPL_GetPointer (expChem, dusmass, 'DUSMASS', __RC__) + call MAPL_GetPointer (expChem, dusmass25, 'DUSMASS25', __RC__) + if(associated(pm) .and. associated(dusmass)) pm = pm + dusmass + if(associated(pm25) .and. associated(dusmass25)) pm25 = pm25 + dusmass25 + if(associated(pm_rh35) .and. associated(dusmass)) pm_rh35 = pm_rh35 + dusmass + if(associated(pm25_rh35) .and. associated(dusmass25)) pm25_rh35 = pm25_rh35 + dusmass25 + if(associated(pm_rh50) .and. associated(dusmass)) pm_rh50 = pm_rh50 + dusmass + if(associated(pm25_rh50) .and. associated(dusmass25)) pm25_rh50 = pm25_rh50 + dusmass25 + endif + + if(w_c%reg%doing_ss) then + call MAPL_GetPointer (expChem, ssexttau, 'SSEXTTAU', __RC__) + call MAPL_GetPointer (expChem, ssscatau, 'SSSCATAU', __RC__) + call MAPL_GetPointer (expChem, ssextt25, 'SSEXTT25', __RC__) + call MAPL_GetPointer (expChem, ssscat25, 'SSSCAT25', __RC__) + call MAPL_GetPointer (expChem, ssexttfm, 'SSEXTTFM', __RC__) + call MAPL_GetPointer (expChem, ssscatfm, 'SSSCATFM', __RC__) + call MAPL_GetPointer (expChem, ssangstr, 'SSANGSTR', __RC__) + if(associated(totexttau) .and. associated(ssexttau)) totexttau = totexttau+ssexttau + if(associated(totscatau) .and. associated(ssscatau)) totscatau = totscatau+ssscatau + if(associated(totextt25) .and. associated(ssextt25)) totextt25 = totextt25+ssextt25 + if(associated(totscat25) .and. associated(ssscat25)) totscat25 = totscat25+ssscat25 + if(associated(totexttfm) .and. associated(ssexttfm)) totexttfm = totexttfm+ssexttfm + if(associated(totscatfm) .and. associated(ssscatfm)) totscatfm = totscatfm+ssscatfm + + call MAPL_GetPointer (expChem, sssmass, 'SSSMASS', __RC__) + call MAPL_GetPointer (expChem, sssmass25, 'SSSMASS25', __RC__) + if(associated(pm) .and. associated(sssmass)) pm = pm + sssmass + if(associated(pm25) .and. associated(sssmass25)) pm25 = pm25 + sssmass25 + if(associated(pm_rh35) .and. associated(sssmass)) pm_rh35 = pm_rh35 + 1.86*sssmass + if(associated(pm25_rh35) .and. associated(sssmass25)) pm25_rh35 = pm25_rh35 + 1.86*sssmass25 + if(associated(pm_rh50) .and. associated(sssmass)) pm_rh50 = pm_rh50 + 2.42*sssmass + if(associated(pm25_rh50) .and. associated(sssmass25)) pm25_rh50 = pm25_rh50 + 2.42*sssmass25 + endif + + if(w_c%reg%doing_ni) then + call MAPL_GetPointer (expChem, niexttau, 'NIEXTTAU', __RC__) + call MAPL_GetPointer (expChem, niscatau, 'NISCATAU', __RC__) + call MAPL_GetPointer (expChem, niextt25, 'NIEXTT25', __RC__) + call MAPL_GetPointer (expChem, niscat25, 'NISCAT25', __RC__) + call MAPL_GetPointer (expChem, niexttfm, 'NIEXTTFM', __RC__) + call MAPL_GetPointer (expChem, niscatfm, 'NISCATFM', __RC__) + call MAPL_GetPointer (expChem, niangstr, 'NIANGSTR', __RC__) + if(associated(totexttau) .and. associated(niexttau)) totexttau = totexttau+niexttau + if(associated(totscatau) .and. associated(niscatau)) totscatau = totscatau+niscatau + if(associated(totextt25) .and. associated(niextt25)) totextt25 = totextt25+niextt25 + if(associated(totscat25) .and. associated(niscat25)) totscat25 = totscat25+niscat25 + if(associated(totexttfm) .and. associated(niexttfm)) totexttfm = totexttfm+niexttfm + if(associated(totscatfm) .and. associated(niscatfm)) totscatfm = totscatfm+niscatfm + + call MAPL_GetPointer (expChem, nismass, 'NISMASS', __RC__) + call MAPL_GetPointer (expChem, nismass25, 'NISMASS25', __RC__) + call MAPL_GetPointer (expChem, nh4smass, 'NH4SMASS', __RC__) + if(associated(pm) .and. associated(nismass) .and. associated(nh4smass)) pm = pm + nismass + nh4smass + if(associated(pm25) .and. associated(nismass25) .and. associated(nh4smass)) pm25 = pm25 + nismass25 + nh4smass + if(associated(pm_rh35) .and. associated(nismass) .and. associated(nh4smass)) pm_rh35 = pm_rh35 + 1.33*(nismass + nh4smass) + if(associated(pm25_rh35) .and. associated(nismass25) .and. associated(nh4smass)) pm25_rh35 = pm25_rh35 + 1.33*(nismass25 + nh4smass) + if(associated(pm_rh50) .and. associated(nismass) .and. associated(nh4smass)) pm_rh50 = pm_rh50 + 1.51*(nismass + nh4smass) + if(associated(pm25_rh50) .and. associated(nismass25) .and. associated(nh4smass)) pm25_rh50 = pm25_rh50 + 1.51*(nismass25 + nh4smass) + endif + + if(w_c%reg%doing_su) then + call MAPL_GetPointer (expChem, suexttau, 'SUEXTTAU', __RC__) + call MAPL_GetPointer (expChem, suscatau, 'SUSCATAU', __RC__) + call MAPL_GetPointer (expChem, suangstr, 'SUANGSTR', __RC__) + call MAPL_GetPointer (expChem, suexttauvolc, 'SUEXTTAUvolc', __RC__) + call MAPL_GetPointer (expChem, suscatauvolc, 'SUSCATAUvolc', __RC__) + call MAPL_GetPointer (expChem, suangstrvolc, 'SUANGSTRvolc', __RC__) + if(associated(totexttau) .and. associated(suexttau)) totexttau = totexttau+suexttau + if(associated(totscatau) .and. associated(suscatau)) totscatau = totscatau+suscatau + if(associated(totextt25) .and. associated(suexttau)) totextt25 = totextt25+suexttau + if(associated(totscat25) .and. associated(suscatau)) totscat25 = totscat25+suscatau + if(associated(totexttfm) .and. associated(suexttau)) totexttfm = totexttfm+suexttau + if(associated(totscatfm) .and. associated(suscatau)) totscatfm = totscatfm+suscatau +! Volcanic tracer is additive if present (should it go into PM2.5 as below?) + if(associated(totexttau) .and. associated(suexttauvolc)) totexttau = totexttau+suexttauvolc + if(associated(totscatau) .and. associated(suscatauvolc)) totscatau = totscatau+suscatauvolc + if(associated(totextt25) .and. associated(suexttauvolc)) totextt25 = totextt25+suexttauvolc + if(associated(totscat25) .and. associated(suscatauvolc)) totscat25 = totscat25+suscatauvolc + if(associated(totexttfm) .and. associated(suexttauvolc)) totexttfm = totexttfm+suexttauvolc + if(associated(totscatfm) .and. associated(suscatauvolc)) totscatfm = totscatfm+suscatauvolc + +! Sulfate production by GOCART chemistry (SO4-, kg m-2 s-1) +! Philosophy here is there is always "full" sulfate instance +! This "full" instance may be accompanied by "volc" instance +! in which volcanoes are broken out from rest of "full" and +! the sulfur is additive. Other tagged instances do not get +! added. + call MAPL_GetPointer (expChem, pso4, 'PSO4', __RC__) + call MAPL_GetPointer (expChem, pso4v, 'PSO4volc', __RC__) + if(associated(pso4t)) then + if(associated(pso4)) pso4t = pso4t + pso4 + if(associated(pso4v)) pso4t = pso4t + pso4v + endif + + call MAPL_GetPointer (expChem, susmass, 'SO4SMASS', __RC__) + if (w_c%reg%doing_ni) then + if(associated(pm) .and. associated(susmass)) pm = pm + susmass + if(associated(pm25) .and. associated(susmass)) pm25 = pm25 + susmass + if(associated(pm_rh35) .and. associated(susmass)) pm_rh35 = pm_rh35 + 1.33*susmass + if(associated(pm25_rh35) .and. associated(susmass)) pm25_rh35 = pm25_rh35 + 1.33*susmass + if(associated(pm_rh50) .and. associated(susmass)) pm_rh50 = pm_rh50 + 1.51*susmass + if(associated(pm25_rh50) .and. associated(susmass)) pm25_rh50 = pm25_rh50 + 1.51*susmass + else + if(associated(pm) .and. associated(susmass)) pm = pm + (132.14/96.06)*susmass + if(associated(pm25) .and. associated(susmass)) pm25 = pm25 + (132.14/96.06)*susmass + if(associated(pm_rh35) .and. associated(susmass)) pm_rh35 = pm_rh35 + 1.33*(132.14/96.06)*susmass + if(associated(pm25_rh35) .and. associated(susmass)) pm25_rh35 = pm25_rh35 + 1.33*(132.14/96.06)*susmass + if(associated(pm_rh50) .and. associated(susmass)) pm_rh50 = pm_rh50 + 1.51*(132.14/96.06)*susmass + if(associated(pm25_rh50) .and. associated(susmass)) pm25_rh50 = pm25_rh50 + 1.51*(132.14/96.06)*susmass + endif + endif + + if(w_c%reg%doing_bc) then + call MAPL_GetPointer (expChem, bcexttau, 'BCEXTTAU', __RC__) + call MAPL_GetPointer (expChem, bcscatau, 'BCSCATAU', __RC__) + call MAPL_GetPointer (expChem, bcangstr, 'BCANGSTR', __RC__) + if(associated(totexttau) .and. associated(bcexttau)) totexttau = totexttau+bcexttau + if(associated(totscatau) .and. associated(bcscatau)) totscatau = totscatau+bcscatau + if(associated(totextt25) .and. associated(bcexttau)) totextt25 = totextt25+bcexttau + if(associated(totscat25) .and. associated(bcscatau)) totscat25 = totscat25+bcscatau + if(associated(totexttfm) .and. associated(bcexttau)) totexttfm = totexttfm+bcexttau + if(associated(totscatfm) .and. associated(bcscatau)) totscatfm = totscatfm+bcscatau + + call MAPL_GetPointer (expChem, bcsmass, 'BCSMASS', __RC__) + if(associated(pm) .and. associated(bcsmass)) pm = pm + bcsmass + if(associated(pm25) .and. associated(bcsmass)) pm25 = pm25 + bcsmass + if(associated(pm_rh35) .and. associated(bcsmass)) pm_rh35 = pm_rh35 + bcsmass + if(associated(pm25_rh35) .and. associated(bcsmass)) pm25_rh35 = pm25_rh35 + bcsmass + if(associated(pm_rh50) .and. associated(bcsmass)) pm_rh50 = pm_rh50 + bcsmass + if(associated(pm25_rh50) .and. associated(bcsmass)) pm25_rh50 = pm25_rh50 + bcsmass + endif + + if(w_c%reg%doing_oc) then + call MAPL_GetPointer (expChem, ocexttau, 'OCEXTTAU', __RC__) + call MAPL_GetPointer (expChem, ocscatau, 'OCSCATAU', __RC__) + call MAPL_GetPointer (expChem, ocangstr, 'OCANGSTR', __RC__) + if(associated(totexttau) .and. associated(ocexttau)) totexttau = totexttau+ocexttau + if(associated(totscatau) .and. associated(ocscatau)) totscatau = totscatau+ocscatau + if(associated(totextt25) .and. associated(ocexttau)) totextt25 = totextt25+ocexttau + if(associated(totscat25) .and. associated(ocscatau)) totscat25 = totscat25+ocscatau + if(associated(totexttfm) .and. associated(ocexttau)) totexttfm = totexttfm+ocexttau + if(associated(totscatfm) .and. associated(ocscatau)) totscatfm = totscatfm+ocscatau + + call MAPL_GetPointer (expChem, ocsmass, 'OCSMASS', __RC__) + if(associated(pm) .and. associated(ocsmass)) pm = pm + ocsmass + if(associated(pm25) .and. associated(ocsmass)) pm25 = pm25 + ocsmass + if(associated(pm_rh35) .and. associated(ocsmass)) pm_rh35 = pm_rh35 + 1.16*ocsmass ! needs to be revisited: OCpho + 1.16 OCphi + if(associated(pm25_rh35) .and. associated(ocsmass)) pm25_rh35 = pm25_rh35 + 1.16*ocsmass ! + if(associated(pm_rh50) .and. associated(ocsmass)) pm_rh50 = pm_rh50 + 1.24*ocsmass ! needs to be revisited: OCpho + 1.24 OCphi + if(associated(pm25_rh50) .and. associated(ocsmass)) pm25_rh50 = pm25_rh50 + 1.24*ocsmass ! + endif + + if(w_c%reg%doing_brc) then + call MAPL_GetPointer (expChem, brcexttau, 'BRCEXTTAU', __RC__) + call MAPL_GetPointer (expChem, brcscatau, 'BRCSCATAU', __RC__) + call MAPL_GetPointer (expChem, brcangstr, 'BRCANGSTR', __RC__) + if(associated(totexttau) .and. associated(brcexttau)) totexttau = totexttau+brcexttau + if(associated(totscatau) .and. associated(brcscatau)) totscatau = totscatau+brcscatau + if(associated(totextt25) .and. associated(brcexttau)) totextt25 = totextt25+brcexttau + if(associated(totscat25) .and. associated(brcscatau)) totscat25 = totscat25+brcscatau + if(associated(totexttfm) .and. associated(brcexttau)) totexttfm = totexttfm+brcexttau + if(associated(totscatfm) .and. associated(brcscatau)) totscatfm = totscatfm+brcscatau + + call MAPL_GetPointer (expChem, brcsmass, 'BRCSMASS', __RC__) + if(associated(pm) .and. associated(brcsmass)) pm = pm + brcsmass + if(associated(pm25) .and. associated(brcsmass)) pm25 = pm25 + brcsmass + if(associated(pm_rh35) .and. associated(brcsmass)) pm_rh35 = pm_rh35 + 1.16*brcsmass ! needs to be revisited: BRCpho + 1.16 BRCphi + if(associated(pm25_rh35) .and. associated(brcsmass)) pm25_rh35 = pm25_rh35 + 1.16*brcsmass ! + if(associated(pm_rh50) .and. associated(brcsmass)) pm_rh50 = pm_rh50 + 1.24*brcsmass ! needs to be revisited: BRCpho + 1.24 BRCphi + if(associated(pm25_rh50) .and. associated(brcsmass)) pm25_rh50 = pm25_rh50 + 1.24*brcsmass ! + endif + + if(associated(totangstr)) then + totangstr(:,:) = 0.0 + + allocate(tau1(SIZE(LATS,1), SIZE(LATS,2)), & + tau2(SIZE(LATS,1), SIZE(LATS,2)), __STAT__) + + tau1(:,:) = tiny(1.0) + tau2(:,:) = tiny(1.0) + c1 = -log(470./550.) + c2 = -log(870./550.) + c3 = -log(470./870.) + if(w_c%reg%doing_du .and. associated(duexttau) .and. associated(duangstr)) then + tau1 = tau1 + duexttau*exp(c1*duangstr) + tau2 = tau2 + duexttau*exp(c2*duangstr) + endif + if(w_c%reg%doing_ss .and. associated(ssexttau) .and. associated(ssangstr)) then + tau1 = tau1 + ssexttau*exp(c1*ssangstr) + tau2 = tau2 + ssexttau*exp(c2*ssangstr) + endif + if(w_c%reg%doing_ni .and. associated(niexttau) .and. associated(niangstr)) then + tau1 = tau1 + niexttau*exp(c1*niangstr) + tau2 = tau2 + niexttau*exp(c2*niangstr) + endif + if(w_c%reg%doing_su .and. associated(suexttau) .and. associated(suangstr)) then + tau1 = tau1 + suexttau*exp(c1*suangstr) + tau2 = tau2 + suexttau*exp(c2*suangstr) + endif + if(w_c%reg%doing_su .and. associated(suexttauvolc) .and. associated(suangstrvolc)) then + tau1 = tau1 + suexttauvolc*exp(c1*suangstrvolc) + tau2 = tau2 + suexttauvolc*exp(c2*suangstrvolc) + endif + if(w_c%reg%doing_bc .and. associated(bcexttau) .and. associated(bcangstr)) then + tau1 = tau1 + bcexttau*exp(c1*bcangstr) + tau2 = tau2 + bcexttau*exp(c2*bcangstr) + endif + if(w_c%reg%doing_oc .and. associated(ocexttau) .and. associated(ocangstr)) then + tau1 = tau1 + ocexttau*exp(c1*ocangstr) + tau2 = tau2 + ocexttau*exp(c2*ocangstr) + endif + if(w_c%reg%doing_brc .and. associated(brcexttau) .and. associated(brcangstr)) then + tau1 = tau1 + brcexttau*exp(c1*brcangstr) + tau2 = tau2 + brcexttau*exp(c2*brcangstr) + endif + totangstr = log(tau1/tau2)/c3 + + deallocate(tau1, tau2, __STAT__) + endif + + deallocate(SLR, __STAT__) + deallocate(ZTH, __STAT__) + deallocate(r4ZTH, __STAT__) + + call MAPL_TimerOff(ggState, 'RUN') + call MAPL_TimerOff(ggState, 'TOTAL') + + RETURN_(ESMF_SUCCESS) + + end subroutine Run2_ + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Finalize_ --- Finalize Aero_GridComp (ESMF) +! +! !INTERFACE: +! + + subroutine Finalize_ ( gc, impChem, expChem, clock, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(ESMF_Clock), intent(inout) :: clock ! The clock + +! !OUTPUT PARAMETERS: + + type(ESMF_GridComp), intent(inout) :: gc ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This is a simple ESMF wrapper. +! +! !REVISION HISTORY: +! +! 27Feb2005 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + +! ErrLog Variables +! ---------------- + character(len=ESMF_MAXSTR) :: IAm = 'Finalize_' + integer :: STATUS + character(len=ESMF_MAXSTR) :: COMP_NAME + + type(Chem_Registry), pointer :: chemReg + type(Aero_GridComp), pointer :: gcChem ! Grid Component + type(Chem_Bundle), pointer :: w_c ! Chemical tracer fields + integer :: nymd, nhms ! time + real :: cdt ! chemistry timestep (secs) + type(MAPL_MetaComp), pointer :: ggState ! GEOS Generic State + type(GOCART_state), pointer :: state + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet( GC, NAME=COMP_NAME, RC=STATUS ) + VERIFY_(STATUS) + Iam = trim(COMP_NAME) // '::' // 'Finalize_' + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC ( GC, ggState, __RC__) + + call MAPL_TimerON(ggState, 'TOTAL') + call MAPL_TimerON(ggState, 'FINALIZE') + +! Get pre-ESMF parameters from gc and clock +! ----------------------------------------- + call extract_ ( gc, clock, chemReg, gcChem, w_c, nymd, nhms, cdt, STATUS, & + state = state ) + VERIFY_(STATUS) + +! Call pre-ESMF version +! --------------------- + call Aero_GridCompFinalize ( gcChem, w_c, impChem, expChem, & + nymd, nhms, cdt, STATUS ) + VERIFY_(STATUS) + +! Destroy Chem_Bundle +! ------------------- + call Chem_BundleDestroy ( w_c, STATUS ) + VERIFY_(STATUS) + +! Destroy Chem_Registry +! --------------------- + call Chem_RegistryDestroy ( chemReg, STATUS ) + VERIFY_(STATUS) + +! Destroy Legacy state +! -------------------- + deallocate ( state%chemReg, state%gcChem, state%w_c, stat = STATUS ) + VERIFY_(STATUS) + + call MAPL_TimerOff(ggState, 'FINALIZE') + call MAPL_TimerOff(ggState, 'TOTAL') + +! Finalize GEOS Generic +! --------------------- +!ALT: do not deallocate "foreign objects" + call MAPL_GenericFinalize ( gc, impChem, expChem, clock, __RC__ ) + + RETURN_(ESMF_SUCCESS) + + end subroutine Finalize_ + + +!....................................................................... + + subroutine extract_ ( gc, clock, chemReg, gcChem, w_c, nymd, nhms, cdt, & + rc, state ) + + type(ESMF_GridComp), intent(INout) :: gc + type(ESMF_Clock), intent(in) :: clock + type(Chem_Registry), pointer :: chemReg + type(Aero_GridComp), pointer :: gcChem + type(Chem_Bundle), pointer :: w_c + integer, intent(out) :: nymd, nhms + real, intent(out) :: cdt + integer, intent(out) :: rc + type(MAPL_MetaComp), pointer :: ggState + type(GOCART_state), pointer, optional :: state + + + type(GOCART_state), pointer :: myState + +! ErrLog Variables +! ---------------- + character(len=ESMF_MAXSTR) :: IAm + integer :: STATUS + character(len=ESMF_MAXSTR) :: COMP_NAME + + type(ESMF_Alarm) :: ALARM + type(ESMF_TimeInterval) :: RingInterval + + type(ESMF_Time) :: TIME + type(ESMF_Config) :: CF + type(GOCART_Wrap) :: wrap + integer :: IYR, IMM, IDD, IHR, IMN, ISC + real(ESMF_KIND_R8) :: dt_r8 + +! Get my name and set-up traceback handle +! --------------------------------------- + call ESMF_GridCompGet( GC, NAME=COMP_NAME, RC=STATUS ) + VERIFY_(STATUS) + Iam = trim(COMP_NAME) // '::' // 'extract_' + + rc = 0 + +! Get my internal MAPL_Generic state +! ----------------------------------- + call MAPL_GetObjectFromGC ( GC, ggState, __RC__ ) + + +! Get my internal state +! --------------------- + call ESMF_UserCompGetInternalState(gc, 'GOCART_state', WRAP, STATUS) + VERIFY_(STATUS) + myState => wrap%ptr + if ( present(state) ) then + state => wrap%ptr + end if + +! This is likely to be allocated during initialize only +! ----------------------------------------------------- + if ( .not. associated(myState%chemReg) ) then + allocate ( myState%chemReg, stat=STATUS ) + VERIFY_(STATUS) + end if + if ( .not. associated(myState%gcChem) ) then + allocate ( myState%gcChem, stat=STATUS ) + VERIFY_(STATUS) + end if + if ( .not. associated(myState%w_c) ) then + allocate ( myState%w_c, stat=STATUS ) + VERIFY_(STATUS) + end if + + chemReg => myState%chemReg + gcChem => myState%gcChem + w_c => myState%w_c + +! Get the configuration +! --------------------- + call ESMF_GridCompGet ( GC, CONFIG = CF, RC=STATUS ) + VERIFY_(STATUS) + +! Get time step +! ------------- + call MAPL_Get(ggState, RUNALARM=ALARM, __RC__ ) + call ESMF_AlarmGet(ALARM, ringInterval=RingInterval, __RC__) + + call ESMF_TimeIntervalGet(RingInterval, s_r8=dt_r8, __RC__) + cdt = real(dt_r8) + + +! Need code to extract nymd(20050205), nhms(120000) from clock +! ------------------------------------------ + + call ESMF_ClockGet(CLOCK,currTIME=TIME,rc=STATUS) + VERIFY_(STATUS) + + call ESMF_TimeGet(TIME ,YY=IYR, MM=IMM, DD=IDD, H=IHR, M=IMN, S=ISC, rc=STATUS) + VERIFY_(STATUS) + + call MAPL_PackTime(NYMD,IYR,IMM,IDD) + call MAPL_PackTime(NHMS,IHR,IMN,ISC) + + RETURN_(ESMF_SUCCESS) + + end subroutine extract_ + + +logical function isDataDrivenGC_(gc, rc) + + implicit none + + type(ESMF_GridComp), intent(INout) :: gc + integer, intent(out) :: rc + +! local + character(len=ESMF_MAXSTR) :: IAm + integer :: STATUS + + integer :: i + character(len=ESMF_MAXSTR) :: comp_name + character(len=*), parameter :: modifier = '.data' + + call ESMF_GridCompGet(gc, name=comp_name, __RC__) + i = index(trim(comp_name), trim(modifier), back=.true.) + + if (i > 0) then + ! lets be strict + if (comp_name(i:) == modifier) then + isDataDrivenGC_ = .true. + else + isDataDrivenGC_ = .false. + end if + else + isDataDrivenGC_ = .false. + end if + + RETURN_(ESMF_SUCCESS) + +end function isDataDrivenGC_ + + +subroutine aerosol_optics(state, rc) + + implicit none + +! Arguments +! --------- + type(ESMF_State) :: state + integer, intent(out) :: rc + + +! Local +! --------- + integer :: n_aerosols + character(len=ESMF_MAXSTR), allocatable :: aerosol_names(:) + type(ESMF_FieldBundle) :: aerosols + + real, dimension(:,:,:), pointer :: ple + real, dimension(:,:,:), pointer :: rh + real, dimension(:,:,:), pointer :: var + real, dimension(:,:,:), pointer :: q + real, dimension(:,:,:,:), pointer :: q_4d + + real, dimension(:,:,:), allocatable :: dp, f_p + + character(len=ESMF_MAXSTR) :: fld_name + type(ESMF_Field) :: fld + + real, dimension(:,:,:,:), allocatable :: ext, ssa, asy ! (lon:,lat:,lev:,band:) + + integer :: n + integer :: i1, j1, i2, j2, km + + integer :: band, offset + + integer :: instance + + integer :: STATUS + character(len=ESMF_MAXSTR) :: Iam + + integer, parameter :: n_bands = 1 + + real :: x + integer :: i, j, k + + Iam = 'GOCART::aerosol_optics()' + + +! Mie Table instance/index +! ------------------------ + call ESMF_AttributeGet(state, name='mie_table_instance', value=instance, __RC__) + +! Radiation band +! -------------- + band = 0 + call ESMF_AttributeGet(state, name='band_for_aerosol_optics', value=band, __RC__) + offset = band - n_bands + +! Pressure at layer edges +! ------------------------ + call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, ple, trim(fld_name), __RC__) + + i1 = lbound(ple, 1); i2 = ubound(ple, 1) + j1 = lbound(ple, 2); j2 = ubound(ple, 2) + km = ubound(ple, 3) + +! Relative humidity +! ----------------- + call ESMF_AttributeGet(state, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) + call MAPL_GetPointer(state, rh, trim(fld_name), __RC__) + + i1 = lbound(rh, 1); i2 = ubound(rh, 1) + j1 = lbound(rh, 2); j2 = ubound(rh, 2) + km = ubound(rh, 3) + + call ESMF_StateGet(state, 'AEROSOLS', aerosols, __RC__) + call ESMF_FieldBundleGet(aerosols, fieldCount=n_aerosols, __RC__) + + allocate(aerosol_names(n_aerosols), __STAT__) + + call ESMF_FieldBundleGet(aerosols, itemorderflag=ESMF_ITEMORDER_ADDORDER, & + FieldNameList=aerosol_names, __RC__) + + allocate(ext(i1:i2,j1:j2,km,n_bands), & + ssa(i1:i2,j1:j2,km,n_bands), & + asy(i1:i2,j1:j2,km,n_bands), __STAT__) + + allocate(q_4d(i1:i2,j1:j2,km,n_aerosols), __STAT__) + +#if (0) + allocate(dp(i1:i2,j1:j2,km), f_p(i1:i2,j1:j2,km), __STAT__) + + dp = ple(:,:,1:km) - ple(:,:,0:km-1) + f_p = dp / MAPL_GRAV + + do n = 1, n_aerosols + call ESMF_FieldBundleGet(aerosols, trim(aerosol_names(n)), field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q, __RC__) + + q_4d(:,:,:,n) = f_p * q + end do + + call ESMF_AttributeGet(state, name='mie_table_instance', value=instance, __RC__) + call mie_(gocartMieTable(instance, aerosol_names, n_bands, offset, q_4d, rh, ext, ssa, asy, __RC__) + + deallocate(dp, f_p, __STAT__) +#else + do n = 1, n_aerosols + call ESMF_FieldBundleGet(aerosols, trim(aerosol_names(n)), field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q, __RC__) + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + x = ((PLE(i,j,k) - PLE(i,j,k-1))*0.01)*(100./MAPL_GRAV) + q_4d(i,j,k,n) = x * q(i,j,k) + end do + end do + end do + end do + + call mie_(gocartMieTable(instance), aerosol_names, n_bands, offset, q_4d, rh, ext, ssa, asy, __RC__) +#endif + + call ESMF_AttributeGet(state, name='extinction_in_air_due_to_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ext(:,:,:,1) + end if + + call ESMF_AttributeGet(state, name='single_scattering_albedo_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = ssa(:,:,:,1) + end if + + call ESMF_AttributeGet(state, name='asymmetry_parameter_of_ambient_aerosol', value=fld_name, __RC__) + if (fld_name /= '') then + call MAPL_GetPointer(state, var, trim(fld_name), __RC__) + var = asy(:,:,:,1) + end if + + deallocate(aerosol_names, ext, ssa, asy, q_4d, __STAT__) + + RETURN_(ESMF_SUCCESS) + +contains + + subroutine mie_(mie_table, aerosol, nb, offset, q, rh, ext, ssa, asy, rc) + + implicit none + + type(Chem_Mie), intent(inout):: mie_table ! mie table + character(len=*), intent(in ) :: aerosol(:) ! list of aerosols + integer, intent(in ) :: nb ! number of bands + integer, intent(in ) :: offset ! bands offset + real, intent(in ) :: q(:,:,:,:) ! aerosol mass mixing ratio, kg kg-1 + real, intent(in ) :: rh(:,:,:) ! relative humidity + + real, intent(out) :: ext(:,:,:,:) ! extinction + real, intent(out) :: ssa(:,:,:,:) ! SSA + real, intent(out) :: asy(:,:,:,:) ! asymmetry parameter + + integer, intent(out) :: rc + + ! local + integer :: STATUS + character(len=ESMF_MAXSTR) :: Iam='aerosol_optics::mie_' + + integer :: l, idx, na + + real(kind=8) :: ext_(size(ext,1),size(ext,2),size(ext,3),size(ext,4)) + real(kind=8) :: ssa_(size(ext,1),size(ext,2),size(ext,3),size(ext,4)) + real(kind=8) :: asy_(size(ext,1),size(ext,2),size(ext,3),size(ext,4)) + + na = size(aerosol) + + _ASSERT(na == size(q,4), 'needs informative message') + + ext_ = 0.0d0 + ssa_ = 0.0d0 + asy_ = 0.0d0 + + do l = 1, na + idx = Chem_MieQueryIdx(mie_table, trim(aerosol(l)), __RC__) + + call Chem_MieQueryAllBand4D(mie_table, idx, nb, offset, q(:,:,:,l), rh, ext, ssa, asy, __RC__) + + ext_ = ext_ + ext ! total extinction + ssa_ = ssa_ + (ssa*ext) ! total scattering + asy_ = asy_ + asy*(ssa*ext) ! sum of (asy * sca) + end do + + ext = ext_ + ssa = ssa_ + asy = asy_ + + RETURN_(ESMF_SUCCESS) + + end subroutine mie_ + +end subroutine aerosol_optics + + +subroutine aerosol_activation_properties(state, rc) + + implicit none + +! Arguments +! --------- + type(ESMF_State) :: state + integer, intent(out) :: rc + + +! Local +! --------- + character(len=ESMF_MAXSTR) :: mode ! mode name + character(len=ESMF_MAXSTR) :: mode_ ! lowercase mode name + type(ESMF_FieldBundle) :: aerosols ! field bundle containing the aerosol mass mixing ratios + + real, dimension(:,:,:), pointer :: ple ! pressure at the edges of model layers + real, dimension(:,:,:), pointer :: temperature ! air temperature + real, dimension(:,:), pointer :: f_land ! fraction of land type in a grid cell + + real, dimension(:,:,:), pointer :: f ! correction factor for sea salt + + real, dimension(:,:,:), pointer :: q ! aerosol mass mixing ratio + real, dimension(:,:,:), pointer :: q_ ! aerosol mass mixing ratio (temporary) + + real, dimension(:,:,:), pointer :: num ! number concentration of aerosol particles + real, dimension(:,:,:), pointer :: diameter ! dry size of aerosol + real, dimension(:,:,:), pointer :: sigma ! width of aerosol mode + real, dimension(:,:,:), pointer :: density ! density of aerosol + real, dimension(:,:,:), pointer :: hygroscopicity ! hygroscopicity of aerosol + real, dimension(:,:,:), pointer :: f_dust ! fraction of dust aerosol + real, dimension(:,:,:), pointer :: f_soot ! fraction of soot aerosol + real, dimension(:,:,:), pointer :: f_organic ! fraction of organic aerosol + + real :: ss_scale ! sea salt scaling factor + real :: max_clean ! max mixing ratio before considered polluted + real :: ccn_tuning ! tunes conversion factors for sulfate + character(LEN=ESMF_MAXSTR) :: cld_micro + + character(len=ESMF_MAXSTR) :: fld_name + type(ESMF_Field) :: fld + + integer :: i1, j1, i2, j2, km + + integer :: STATUS + character(len=ESMF_MAXSTR) :: Iam + +! auxilliary parameters +! --------------------- + real, parameter :: densSO4 = 1700.0 + real, parameter :: densORG = 1600.0 + real, parameter :: densSS = 2200.0 + real, parameter :: densDU = 1700.0 + real, parameter :: densBC = 1600.0 + real, parameter :: densOC = 900.0 + real, parameter :: densBRC = 900.0 + + real, parameter :: k_SO4 = 0.65 + real, parameter :: k_ORG = 0.20 + real, parameter :: k_SS = 1.28 + real, parameter :: k_DU = 0.0001 + real, parameter :: k_BC = 0.0001 + real, parameter :: k_OC = 0.0001 + real, parameter :: k_BRC = 0.0001 + + integer, parameter :: UNKNOWN_AEROSOL_MODE = 2015 + + + Iam = 'GOCART::aerosol_activation_properties()' + + +! Aerosol mode +! ------------ + call ESMF_AttributeGet(state, name='aerosol_mode', value=mode, __RC__) + +! Land fraction +! ------------- + call ESMF_AttributeGet(state, name='fraction_of_land_type', value=fld_name, __RC__) + call MAPL_GetPointer(state, f_land, trim(fld_name), __RC__) + +! Pressure at layer edges +! ------------------------ + call ESMF_AttributeGet(state, name='air_pressure', value=fld_name, __RC__) + call MAPL_GetPointer(state, ple, trim(fld_name), __RC__) + +! Temperature +! ----------- + call ESMF_AttributeGet(state, name='air_temperature', value=fld_name, __RC__) + call MAPL_GetPointer(state, temperature, trim(fld_name), __RC__) + + i1 = lbound(temperature, 1); i2 = ubound(temperature, 1) + j1 = lbound(temperature, 2); j2 = ubound(temperature, 2) + km = ubound(temperature, 3) + +! Activation activation properties +! -------------------------------- + call ESMF_AttributeGet(state, name='aerosol_number_concentration', value=fld_name, __RC__) + call MAPL_GetPointer(state, num, trim(fld_name), __RC__) + + call ESMF_AttributeGet(state, name='aerosol_dry_size', value=fld_name, __RC__) + call MAPL_GetPointer(state, diameter, trim(fld_name), __RC__) + + call ESMF_AttributeGet(state, name='width_of_aerosol_mode', value=fld_name, __RC__) + call MAPL_GetPointer(state, sigma, trim(fld_name), __RC__) + + call ESMF_AttributeGet(state, name='aerosol_density', value=fld_name, __RC__) + call MAPL_GetPointer(state, density, trim(fld_name), __RC__) + + call ESMF_AttributeGet(state, name='aerosol_hygroscopicity', value=fld_name, __RC__) + call MAPL_GetPointer(state, hygroscopicity, trim(fld_name), __RC__) + + call ESMF_AttributeGet(state, name='fraction_of_dust_aerosol', value=fld_name, __RC__) + call MAPL_GetPointer(state, f_dust, trim(fld_name), __RC__) + + call ESMF_AttributeGet(state, name='fraction_of_soot_aerosol', value=fld_name, __RC__) + call MAPL_GetPointer(state, f_soot, trim(fld_name), __RC__) + + call ESMF_AttributeGet(state, name='fraction_of_organic_aerosol', value=fld_name, __RC__) + call MAPL_GetPointer(state, f_organic, trim(fld_name), __RC__) + +! Sea salt scaling fctor +! ---------------------- + call ESMF_AttributeGet(state, name='seasalt_scaling_factor', value=ss_scale, __RC__) + call ESMF_AttributeGet(state, name='max_q_clean', value=max_clean, __RC__) + call ESMF_AttributeGet(state, name='cldmicro', value=cld_micro, __RC__) + call ESMF_AttributeGet(state, name='ccn_tuning', value=ccn_tuning, __RC__) + +! Aerosol mass mixing ratios +! -------------------------- + mode_ = trim(mode) + mode_ = ESMF_UtilStringLowerCase(mode_, __RC__) + + call ESMF_StateGet(state, 'AEROSOLS', aerosols, __RC__) !GOCART state + + allocate(q(i1:i2,j1:j2,km), __STAT__) + q = 0.0 + + hygroscopicity = 0.01 + density = 2200.0 + + if (index(mode_, 'du00') > 0) then + ! dust is mapped one-to-one + call ESMF_FieldBundleGet(aerosols, trim(mode), field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) + q = q_ + hygroscopicity = k_DU + density = densDU + + else if (index(mode_, 'ss00') > 0) then + ! compute the total mass mixing ratio and impose a tri-modal size distribution + call ESMF_FieldBundleGet(aerosols, 'ss001', field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) + q = q + q_ + + call ESMF_FieldBundleGet(aerosols, 'ss002', field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) + q = q + q_ + + call ESMF_FieldBundleGet(aerosols, 'ss003', field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) + q = q + q_ + + call ESMF_FieldBundleGet(aerosols, 'ss004', field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) + q = q + q_ + + call ESMF_FieldBundleGet(aerosols, 'ss005', field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) + q = q + q_ + + ! temperature correction over the ocean + allocate(f(i1:i2,j1:j2, km), __STAT__) + call ocean_correction_(f, f_land, temperature(i1:i2,j1:j2,km), ss_scale, i1, i2, j1, j2, km) + + ! apply the correction factor + q = f * q + deallocate(f, __STAT__) + + hygroscopicity = k_SS + density = densSS + + else if (index(mode_, 'sulforg') > 0) then + hygroscopicity = 0.0 + density = 0.0 + + !internally mixed organics and sulfate + call ESMF_FieldBundleGet(aerosols, 'SO4', field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) + q = q + q_ + hygroscopicity = k_SO4*q_ + hygroscopicity + density = densSO4*q_ + density + + call ESMF_FieldBundleGet(aerosols, 'OCphilic', field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) + q = q + q_ + hygroscopicity = k_ORG*q_ + hygroscopicity + density = densORG*q_ + density + + where (q > 2.0e-12 .and. hygroscopicity > tiny(0.0)) + hygroscopicity = hygroscopicity / q + hygroscopicity = max(0.001, hygroscopicity) + + density = density / q + density = min(max(density, densORG), densSO4) + elsewhere + hygroscopicity = k_SO4 + density = densSO4 + end where + + ! required by the aap_(...) + if(adjustl(cld_micro)/="2MOMENT") then ! maintained for compatibility with the single moment + + call ESMF_FieldBundleGet(aerosols, 'SO4', field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) ! only use the mass of sulfate to make the conversion + + end if + + else if (index(mode_, 'bcphilic') > 0) then + call ESMF_FieldBundleGet(aerosols, 'BCphilic', field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) + q = q_ + hygroscopicity = k_BC + density = densBC + + else if (index(mode_, 'ocphilic') > 0) then !this does not activate into droplets, only relevant for ice nuc. + call ESMF_FieldBundleGet(aerosols, 'OCphilic', field=fld, __RC__) + call ESMF_FieldGet(fld, farrayPtr=q_, __RC__) + q = q_ + hygroscopicity = k_OC + density = densOC + + else + __raise__(UNKNOWN_AEROSOL_MODE, "Unknown aerosol mode used in the GOCART aerosol activation properties method: "//trim(mode)) + + end if + +! Obtain aerosol activation properties of this aerosol mode +! --------------------------------------------------------- + call aap_(mode, & + q, & + num, & + diameter, & + sigma, & + f_dust, & + f_soot, & + f_organic, & + density, & + q_, & + i1, i2, j1, j2, km, & + __RC__) + + deallocate(q, __STAT__) + + RETURN_(ESMF_SUCCESS) + +contains + + subroutine aap_(mode, q, num, diameter, sigma, f_dust, f_soot, f_organic, dens_, q_, & + i1, i2, j1, j2, km, rc) + + implicit none + + integer, intent(in) :: i1, i2 ! dimension bounds + integer, intent(in) :: j1, j2 ! ... // .. + integer, intent(in) :: km ! ... // .. + + character(len=*), intent(in ) :: mode ! name of aerosol mode + real, intent(in), dimension(i1:i2,j1:j2,km) :: q ! aerosol mass mixing ratio, kg kg-1 + real, intent(in), dimension(i1:i2,j1:j2,km) :: q_ ! auxiliary mass + real, intent(in), dimension(i1:i2,j1:j2,km) :: dens_ ! density + + + real, intent(out), dimension(i1:i2,j1:j2,km) :: num ! number concentration of aerosol particles + real, intent(out), dimension(i1:i2,j1:j2,km) :: diameter ! dry size of aerosol + real, intent(out), dimension(i1:i2,j1:j2,km) :: sigma ! width of aerosol mode + real, intent(out), dimension(i1:i2,j1:j2,km) :: f_dust ! fraction of dust aerosol + real, intent(out), dimension(i1:i2,j1:j2,km) :: f_soot ! fraction of soot aerosol + real, intent(out), dimension(i1:i2,j1:j2,km) :: f_organic ! fraction of organic aerosol + + integer, intent(out) :: rc ! return code + + ! local + integer :: STATUS + character(len=ESMF_MAXSTR) :: mode_ + character(len=ESMF_MAXSTR) :: Iam = 'GOCART::aerosol_activation_properties::aap_()' + + integer, parameter :: UNKNOWN_AEROSOL_MODE = 2015 + + integer :: kinx + real :: fmassaux, fmassclean + real, dimension(3) :: TPI, DPGI, SIGI + real, dimension(3) :: TPIclean, DPGIclean, SIGIclean + real, dimension(i1:i2,j1:j2,km) :: qaux + !real, parameter :: max_clean = 5.0e-7 !max mixing ratio before considered polluted + + + + + mode_ = trim(mode) + mode_ = ESMF_UtilStringLowerCase(mode_, __RC__) + + num = 0.0 + diameter = 1.0e-9 + sigma = log(2.0) + f_dust = 0.0 + f_soot = 0.0 + f_organic = 0.0 + + if(adjustl(cld_micro)=="2MOMENT") then + qaux=q !this corrects a bug + else + qaux = q_ !keep it to get zero diff with the single moment + max_clean = 5.0e-7 + ccn_tuning = 1.0 + end if + + + if (index(mode_, 'ss00') > 0) then + if(adjustl(cld_micro)=="2MOMENT") then + TPI (1) = 230e6 ! num fraction (reduced 091015) + else + TPI (1) = 100e6 ! num fraction (reduced 091015) + end if + + DPGI (1) = 0.02e-6 ! modal diameter (m) + SIGI (1) = log(1.6) ! geometric dispersion (sigma_g) + ! accumulation + TPI (2) = 60.0e6 ! total concentration (# m-3) + DPGI (2) = 0.071e-6 ! modal diameter (m) + SIGI (2) = log(2.0) ! geometric dispersion (sigma_g) + ! coarse + TPI (3) = 3.1e6 ! total concentration (# m-3) + DPGI (3) = 0.62e-6 ! modal diameter (m) + SIGI (3) = log(2.7) ! geometric dispersion (sigma_g) + + fmassaux = 0.0 + do kinx = 1, 3 + fmassaux = (TPI(kinx)*densSS*MAPL_PI*exp(4.5*SIGI(kinx)*SIGI(kinx))*DPGI(kinx)*DPGI(kinx)*DPGI(kinx))/6.0 + fmassaux + end do + end if + + if (index(mode_, 'sulforg0') > 0) then + TPI (1) = 1.06e11 ! num fraction + DPGI (1) = .014e-6 ! modal diameter (m) + SIGI (1) = log(1.8) ! geometric dispersion (sigma_g) + ! accumulation + TPI (2) = 3.2e10 ! total concentration (# m-3) + DPGI (2) = 0.054e-6 ! modal diameter (m) + SIGI (2) = log(2.16) ! geometric dispersion (sigma_g) + !coarse + TPI (3) = 5.4e6 ! total concentration (# m-3) + DPGI (3) = 0.86e-6 ! modal diameter (m) + SIGI (3) = log(2.21) ! geometric dispersion (sigma_g) + + fmassaux = 0.0 + do kinx = 1, 3 + ! density is multiplied below since this is a case of a 3-d field + fmassaux = (TPI(kinx)*MAPL_PI*exp(4.5*SIGI(kinx)*SIGI(kinx))*DPGI(kinx)*DPGI(kinx)*DPGI(kinx))/6.0 + fmassaux + end do + + ! clean continental polluted plus org + ! fine + TPIclean (1) = 1.0e9 ! total concentration (# m-3) + DPGIclean (1) = 0.016e-6 ! modal diameter (m) + SIGIclean (1) = log(1.6) ! geometric dispersion (sigma_g) + ! accumulation + TPIclean (2) = 8.0e8 ! total concentration (# m-3) + DPGIclean (2) = 0.067e-6 ! modal diameter (m) + SIGIclean (2) = log(2.1) ! geometric dispersion (sigma_g) + !Coarse + TPIclean (3) = 2.0e6 ! total concentration (# m-3) + DPGIclean (3) = 0.93e-6 ! modal diameter (m) + SIGIclean (3) = log(2.2) ! geometric dispersion (sigma_g) + + fmassclean= 0.0 + do kinx = 1, 3 + fmassclean = (TPIclean(kinx)*MAPL_PI*exp(4.5*SIGIclean(kinx)*SIGIclean(kinx))*DPGIclean(kinx)*DPGIclean(kinx)*DPGIclean(kinx))/6.0 + fmassclean ! + end do + end if + + + + select case(mode_) + + case ('du001') + sigma = log(1.8) + f_dust = 1.0 + diameter = 1.46e-6 + num = q / ((MAPL_PI/6.0) * densDU * diameter*diameter*diameter * exp(4.5*sigma*sigma)) + + case ('du002') + sigma = log(1.8) + f_dust = 1.0 + diameter = 2.80e-6 + num = q / ((MAPL_PI/6.0) * densDU * diameter*diameter*diameter * exp(4.5*sigma*sigma)) + + case ('du003') + sigma = log(1.8) + f_dust = 1.0 + diameter = 4.80e-6 + num = q / ((MAPL_PI/6.0) * densDU * diameter*diameter*diameter * exp(4.5*sigma*sigma)) + + case ('du004') + sigma = log(1.8) + f_dust = 1.0 + diameter = 9.0e-6 + num = q / ((MAPL_PI/6.0) * densDU * diameter*diameter*diameter * exp(4.5*sigma*sigma)) + + case ('du005') + sigma = log(1.8) + f_dust = 1.0 + diameter = 16.0e-6 + num = q / ((MAPL_PI/6.0) * densDU * diameter*diameter*diameter * exp(4.5*sigma*sigma)) + + case ('ss001') + sigma = SIGI(1) + diameter = DPGI(1) + num = TPI(1) * q / fmassaux + + case ('ss002') + sigma = SIGI(2) + diameter = DPGI(2) + num = TPI(2) * q / fmassaux + + case ('ss003') + sigma = SIGI(3) + diameter = DPGI(3) + num = TPI(3) * q / fmassaux + + case ('sulforg01') !different distributions for clean and polluted environments + where (q > max_clean) + sigma = SIGI(1) + diameter = DPGI(1) + num = TPI(1) * qaux*ccn_tuning / (dens_*fmassaux) ! only sulfate mass + elsewhere + sigma = SIGIclean(1) + diameter = DPGIclean(1) + num = TPIclean(1) * qaux*ccn_tuning / (dens_*fmassclean) ! only sulfate + end where + + case ('sulforg02') + where (q > max_clean) + sigma = SIGI(2) + diameter = DPGI(2) + num = TPI(2) * qaux*ccn_tuning / (dens_*fmassaux) ! only sulfate mass + elsewhere + sigma = SIGIclean(2) + diameter = DPGIclean(2) + num = TPIclean(2) * qaux*ccn_tuning / (dens_*fmassclean) ! only sulfate + end where + + case ('sulforg03') + where (q > max_clean) + sigma = SIGI(3) + diameter = DPGI(3) + num = TPI(3) * qaux*ccn_tuning / (dens_*fmassaux) ! only sulfate mass + elsewhere + sigma = SIGIclean(3) + diameter = DPGIclean(3) + num = TPIclean(3) * qaux*ccn_tuning / (dens_*fmassclean) ! only sulfate + end where + + case ('bcphilic') + sigma = log(2.0) + f_soot = 1.0 + diameter = 0.0118*2e-6 + num = q / ((MAPL_PI/6.0) * densBC * diameter*diameter*diameter * exp(4.5*sigma*sigma)) + + case ('ocphilic') + sigma = log(2.2) + f_organic = 1.0 + diameter = 0.0212*2.0e-6 + num = q / ((MAPL_PI/6.0) * densOrg * diameter*diameter*diameter * exp(4.5*sigma*sigma)) + + case default + __raise__(UNKNOWN_AEROSOL_MODE,"Unknown aerosol mode used in the GOCART aerosol activation properties method: "//trim(mode)) + + end select + + + RETURN_(ESMF_SUCCESS) + + end subroutine aap_ + + + subroutine ocean_correction_(f, f_land, t_air_sfc, ss_scale, i1, i2, j1, j2, km) + + implicit none + + integer, intent(in) :: i1, i2 ! dimension bounds + integer, intent(in) :: j1, j2 ! ... // .. + integer, intent(in) :: km ! ... // .. + + real, intent(in ), dimension(i1:i2,j1:j2) :: f_land ! fraction of land + real, intent(in ), dimension(i1:i2,j1:j2) :: t_air_sfc ! air temperature in the surface model layer + real, intent(in ) :: ss_scale ! scaling factor for sea salt at low T + + real, intent(out), dimension(i1:i2,j1:j2, km) :: f ! correction factor + + ! local + integer :: i, j + real :: usurf + + f = 1.0 + + do j = j1, j2 + do i = i1, i2 + if (f_land(i,j) < 0.1) then !ocean + + if(adjustl(cld_micro) .ne."2MOMENT") then + usurf = max(min((t_air_sfc(i,j) - 285.0) / 2.0, 10.0), -10.0) !smooth transition around some T value + else + usurf = max(min((t_air_sfc(i,j) - 285.0) / 2.0, 30.0), -30.0) !smooth transition around some T value + end if + usurf = min(ss_scale / (1.0 + exp(usurf)), 20.0) + + f(i,j,:) = (1.0 + usurf) + end if + end do + end do + + end subroutine ocean_correction_ + +end subroutine aerosol_activation_properties + +end module GOCART_GridCompMod + diff --git a/ESMF/GOCART_GridComp/GOCART_StubCompMod.F90 b/ESMF/GOCART_GridComp/GOCART_StubCompMod.F90 new file mode 100644 index 00000000..0dff239e --- /dev/null +++ b/ESMF/GOCART_GridComp/GOCART_StubCompMod.F90 @@ -0,0 +1,63 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: GOCART_GridCompMod - The GOCART Aerosol Grid Component +! +! !INTERFACE: +! + Module GOCART_GridCompMod +! +! !USES: +! + + use ESMF + + implicit none + private +! +! !PUBLIC MEMBER FUNCTIONS: + + public SetServices +! +! !DESCRIPTION: +! +! This is a stub for the {\tt GOCART} gridded component. +! +!EOP +!------------------------------------------------------------------------- + +CONTAINS + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SetServices --- Sets IRF services for GOCART Grid Component +! +! !INTERFACE: + + subroutine SetServices ( GC, RC ) + +! !ARGUMENTS: + + type(ESMF_GridComp), intent(INOUT) :: GC ! gridded component + integer, optional :: RC ! return code + +! !DESCRIPTION: Sets Initialize, Run and Finalize services. +! +! !REVISION HISTORY: +! +! 25feb2005 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + if ( present(rc) ) rc = 0 + + end subroutine SetServices + +end Module GOCART_GridCompMod diff --git a/ESMF/GOCART_GridComp/GOCARTdata_AerRegistry.rc b/ESMF/GOCART_GridComp/GOCARTdata_AerRegistry.rc new file mode 100644 index 00000000..ff1ceadd --- /dev/null +++ b/ESMF/GOCART_GridComp/GOCARTdata_AerRegistry.rc @@ -0,0 +1,417 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# XX lists GMIchem's non-transported species. See Chem_MieRegistry.rc +# for Stratchem's XX (inferred) species list. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to 'mol mol-1' +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + # &Label Active Constituents + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # &YesNo Include carbon monoxide? +doing_CO2: no # &YesNo Include carbon dioxide? +doing_DU: yes # &YesNo Include mineral dust? +doing_SS: yes # &YesNo Include sea salt? +doing_SU: yes # &YesNo Include sulfates? +doing_CFC: no # &YesNo Include CFCs? +doing_BC: yes # &YesNo Include black carbon? +doing_OC: yes # &YesNo Include organic carbon? +doing_Rn: no # &YesNo include Radon? +doing_CH4: no # &YesNo include Methane? +doing_SC: no # &YesNo Include stratospheric chemistry? +doing_GMI: no # &YesNo GMI chemistry (GEOS-5) +doing_XX: no # &YesNo generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 51 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Carbon Monoxide (All Sources) +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide (All Sources) +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +OCphobicbbbo 'kg kg-1' Hydrophobic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphilicbbbo 'kg kg-1' Hydrophilic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphobicbbnb 'kg kg-1' Hydrophobic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +OCphilicbbnb 'kg kg-1' Hydrophilic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +H2OCOND 'mol mol-1' Condensed water vapor in chemistry +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC 'mol mol-1' HCFC +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H12_24 'mol mol-1' Halon 12_24 +Q4AGE 'mol mol-1' SSG for computing age-of-air +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Q4AGE none Age-of-air tracer +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +O3VMR 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4,5 alkanes (C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 m-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +H 'mol mol-1' Ground state atomic hydrogen (2S) +MO2 'mol mol-1' Methylperoxy radical (CH3O2) +N 'mol mol-1' Ground state atomic nitrogen +O 'mol mol-1' Ground state atomic oxygen (3P) +O1D 'mol mol-1' First excited singlet state of atomic oxygen (1D) +A3O2 'mol mol-1' Primary RO2 (C3H7O2) from propane +ATO2 'mol mol-1' RO2 from acetone (C3H6O3) +B3O2 'mol mol-1' Secondary RO2 (C3H7O2) from propane +EOH 'mol mol-1' Ethanol +ETO2 'mol mol-1' Ethylperoxy radical (C2H5O2) +GCO3 'mol mol-1' Hydroxy peroxyacetyl radical (C2H3O4) +GLYC 'mol mol-1' Glycolaldehyde (Hydroxyacetaldehyde C2H4O2) +GLYX 'mol mol-1' Glyoxal (2CHO) +GP 'mol mol-1' Peroxide (C2H4O4) from GCO3 +GPAN 'mol mol-1' Peroxyacylnitrate (C2H3O6N) +IAO2 'mol mol-1' RO2 (C5H9O5) from isoprene oxidation products +INO2 'mol mol-1' RO2 (C5H8O3N) from ISOP+NO3 +INPN 'mol mol-1' Peroxide (C5H8O6N2) from INO2 +ISN1 'mol mol-1' RO2 (C4H7O4N) from ISN2 +ISNP 'mol mol-1' Peroxide (C4H7O4N) from ISN1 +KO2 'mol mol-1' RO2 (C4H7O3) from C3 ketones +MAN2 'mol mol-1' RO2 (C4H6O6N) from MACR+NO3 +MAO3 'mol mol-1' Peroxyacyl (C4H5O3) from MACR and MVK +MAOP 'mol mol-1' Peroxide (C4H6O3) from MAO3 +MAP 'mol mol-1' Peroxyacetic acid (C2H4O3) +MCO3 'mol mol-1' Peroxyacetyl radical (C2H3O3) +MGLY 'mol mol-1' Methylglyoxal (C3H4O2) +MRO2 'mol mol-1' RO2 (C4H7O4) from MACR+OH +MRP 'mol mol-1' Peroxide (C4H8O4) from MRO2 +MVN2 'mol mol-1' C4H6O4N +PO2 'mol mol-1' RO2 (C3H7O3) from propene +PP 'mol mol-1' Peroxide (C3H8O3) from PO2 +PRN1 'mol mol-1' RO2 (C3H6O3N) from propene+NO3 +PRPN 'mol mol-1' Peroxide (C3H6O3N) from PRN1 +R4N1 'mol mol-1' RO2 (C4H9O3N) from R4N2 +R4O2 'mol mol-1' RO2 (C4H9O2) from ALK4 +R4P 'mol mol-1' Peroxide (C4H10O2) from R4O2 +RA3P 'mol mol-1' Peroxy propyl alcohol (C3H8O2) from A3O2 +RB3P 'mol mol-1' Peroxide (C3H8O2) from B3O2 +RCO3 'mol mol-1' Peroxypropionyl radical (C3H5O3) +RIO1 'mol mol-1' RO2 (C5H9O3) from isoprene oxydation products +RIO2 'mol mol-1' RO2 (C5H9O3) from isoprene +RIP 'mol mol-1' Peroxide (C5H10O3) from RIO2 +ROH 'mol mol-1' C2 alcohols +RP 'mol mol-1' Methacrolein peroxy acid (C4H6O3) +VRO2 'mol mol-1' RO2 (C4H7O4) from MVK+OH +VRP 'mol mol-1' Peroxide (C4H8O4) from VRO2 +ACET 'mol mol-1' Acetone +O2 m-3 Molecular oxygen +NUMDENS m-3 Total number density +T2M15d K Daily T2M time average +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) + diff --git a/ESMF/GOCART_GridComp/GOCARTdata_ExtData.rc b/ESMF/GOCART_GridComp/GOCARTdata_ExtData.rc new file mode 100644 index 00000000..5a3543b3 --- /dev/null +++ b/ESMF/GOCART_GridComp/GOCARTdata_ExtData.rc @@ -0,0 +1,136 @@ +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +# GOCART.data - 3D +climdu001 'kg kg-1' Y N 0 0.0 1.0 du001 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu002 'kg kg-1' Y N 0 0.0 1.0 du002 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu003 'kg kg-1' Y N 0 0.0 1.0 du003 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu004 'kg kg-1' Y N 0 0.0 1.0 du004 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climdu005 'kg kg-1' Y N 0 0.0 1.0 du005 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 + +climss001 'kg kg-1' Y N 0 0.0 1.0 ss001 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss002 'kg kg-1' Y N 0 0.0 1.0 ss002 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss003 'kg kg-1' Y N 0 0.0 1.0 ss003 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss004 'kg kg-1' Y N 0 0.0 1.0 ss004 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climss005 'kg kg-1' Y N 0 0.0 1.0 ss005 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 + +climSO4 'kg kg-1' Y N 0 0.0 1.0 SO4 ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climDMS 'kg kg-1' Y N - 0.0 1.0 none /dev/null +climMSA 'kg kg-1' Y N - 0.0 1.0 none /dev/null +climSO2 'kg kg-1' Y N - 0.0 1.0 none /dev/null + +climBCphobic 'kg kg-1' Y N 0 0.0 1.0 BCphobic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climBCphilic 'kg kg-1' Y N 0 0.0 1.0 BCphilic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climOCphobic 'kg kg-1' Y N 0 0.0 1.0 OCphobic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 +climOCphilic 'kg kg-1' Y N 0 0.0 1.0 OCphilic ExtData/PIESA/L72/aero_clm/dR_MERRA-AA-r2.aer_Nv.2003_2014.2008clm.nc4 + +# GOCART.data - 2D +climDUDP001 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT001 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD001 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV001 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP002 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT002 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD002 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV002 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP003 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT003 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD003 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV003 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP004 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT004 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD004 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV004 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climDUDP005 'kg m-2 s-1' Y N 0 0.0 1.0 DUDP005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUWT005 'kg m-2 s-1' Y N 0 0.0 1.0 DUWT005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSD005 'kg m-2 s-1' Y N 0 0.0 1.0 DUSD005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climDUSV005 'kg m-2 s-1' Y N 0 0.0 1.0 DUSV005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climBCDP001 'kg m-2 s-1' Y N 0 0.0 1.0 BCDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCWT001 'kg m-2 s-1' Y N 0 0.0 1.0 BCWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCSD001 'kg m-2 s-1' Y N 0 0.0 1.0 BCSD001 /dev/null +climBCSV001 'kg m-2 s-1' Y N 0 0.0 1.0 BCSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climBCDP002 'kg m-2 s-1' Y N 0 0.0 1.0 BCDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCWT002 'kg m-2 s-1' Y N 0 0.0 1.0 BCWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climBCSD002 'kg m-2 s-1' Y N 0 0.0 1.0 BCSD002 /dev/null +climBCSV002 'kg m-2 s-1' Y N 0 0.0 1.0 BCSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climOCDP001 'kg m-2 s-1' Y N 0 0.0 1.0 OCDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCWT001 'kg m-2 s-1' Y N 0 0.0 1.0 OCWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCSD001 'kg m-2 s-1' Y N 0 0.0 1.0 OCSD001 /dev/null +climOCSV001 'kg m-2 s-1' Y N 0 0.0 1.0 OCSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climOCDP002 'kg m-2 s-1' Y N 0 0.0 1.0 OCDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCWT002 'kg m-2 s-1' Y N 0 0.0 1.0 OCWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climOCSD002 'kg m-2 s-1' Y N 0 0.0 1.0 OCSD002 /dev/null +climOCSV002 'kg m-2 s-1' Y N 0 0.0 1.0 OCSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP001 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT001 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD001 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD001 /dev/null +climSUSV001 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP002 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT002 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD002 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD002 /dev/null +climSUSV002 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP003 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT003 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD003 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD003 /dev/null +climSUSV003 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSUDP004 'kg m-2 s-1' Y N 0 0.0 1.0 SUDP004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUWT004 'kg m-2 s-1' Y N 0 0.0 1.0 SUWT004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSUSD004 'kg m-2 s-1' Y N 0 0.0 1.0 SUSD004 /dev/null +climSUSV004 'kg m-2 s-1' Y N 0 0.0 1.0 SUSV004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP001 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT001 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD001 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV001 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV001 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP002 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT002 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD002 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV002 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV002 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP003 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT003 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD003 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV003 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV003 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP004 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT004 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD004 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV004 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV004 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +climSSDP005 'kg m-2 s-1' Y N 0 0.0 1.0 SSDP005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSWT005 'kg m-2 s-1' Y N 0 0.0 1.0 SSWT005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSD005 'kg m-2 s-1' Y N 0 0.0 1.0 SSSD005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 +climSSSV005 'kg m-2 s-1' Y N 0 0.0 1.0 SSSV005 ExtData/PIESA/sfc/aero_clm/dR_MERRA-AA-r2.aer_Nx.2003_2014.2008clm.nc4 + +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/CMIP/NI_GridComp---full.rc b/ESMF/GOCART_GridComp/NI_GridComp/CMIP/NI_GridComp---full.rc new file mode 100755 index 00000000..a4bc3a6a --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/CMIP/NI_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file for NI parameters. +# Emission factors in kg species / kg emissions (DM or species) +# + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +NI_regions_indices: global + + +# Scavenging efficiency per bin [km-1] +fscav: 0.0 0.4 0.4 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.2695 0.2695 2.1 7.57 + +# Dry particle density [kg m-3] +particle_density: 1000 1769 1725 2200 2650 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 0.18 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 1.50e19 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 0.0118 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 2.0 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/CMIP/NI_GridComp.rc b/ESMF/GOCART_GridComp/NI_GridComp/CMIP/NI_GridComp.rc new file mode 100755 index 00000000..c0375a0e --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/CMIP/NI_GridComp.rc @@ -0,0 +1,19 @@ +# +# NI main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +NI_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/NI_GridComp/CMIP/NI_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/NI_GridComp/CMIP/NI_GridComp_ExtData.rc new file mode 100644 index 00000000..e5cdced9 --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/CMIP/NI_GridComp_ExtData.rc @@ -0,0 +1,34 @@ +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +# Nitrates +EMI_NH3_BB 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_nh3.005.%y4%m2%d2.nc4 +EMI_NH3_AG 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_EN 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none emi_nh3 ExtData/MERRA2/sfc/edgar-v42.emis_nh3.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 +EMI_NH3_IN 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_RE 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_TR 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_OC 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none emiss_ocn ExtData/PIESA/sfc/GEIA.emis_NH3.ocean.x576_y361.t12.20080715_12z.nc4 + +NITRATE_HNO3 'mol mol-1' Y N %y4-%m2-%d2T12:00:00 none 0.20 hno3 ExtData/PIESA/L72/GMI.vmr_HNO3.x144_y91.t12.2006.nc4 +NI_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/NI_GridComp/CMakeLists.txt new file mode 100644 index 00000000..77dee41e --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-E\;-C\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/19600101-20000331/NI_GridComp---full.rc b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/19600101-20000331/NI_GridComp---full.rc new file mode 100755 index 00000000..a4bc3a6a --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/19600101-20000331/NI_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file for NI parameters. +# Emission factors in kg species / kg emissions (DM or species) +# + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +NI_regions_indices: global + + +# Scavenging efficiency per bin [km-1] +fscav: 0.0 0.4 0.4 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.2695 0.2695 2.1 7.57 + +# Dry particle density [kg m-3] +particle_density: 1000 1769 1725 2200 2650 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 0.18 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 1.50e19 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 0.0118 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 2.0 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/19600101-20000331/NI_GridComp.rc b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/19600101-20000331/NI_GridComp.rc new file mode 100755 index 00000000..c0375a0e --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/19600101-20000331/NI_GridComp.rc @@ -0,0 +1,19 @@ +# +# NI main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +NI_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/19600101-20000331/NI_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/19600101-20000331/NI_GridComp_ExtData.rc new file mode 100644 index 00000000..d6c58826 --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/19600101-20000331/NI_GridComp_ExtData.rc @@ -0,0 +1,33 @@ +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +# Nitrates +EMI_NH3_BB 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/climatology/qfed2.emis_nh3.005.x1152_y721_t12.2003_2012.2007.nc4 +EMI_NH3_AG 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_EN 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none emi_nh3 ExtData/MERRA2/sfc/edgar-v42.emis_nh3.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 +EMI_NH3_IN 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_RE 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_TR 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_OC 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none emiss_ocn ExtData/PIESA/sfc/GEIA.emis_NH3.ocean.x576_y361.t12.20080715_12z.nc4 + +NITRATE_HNO3 'mol mol-1' Y N %y4-%m2-%d2T12:00:00 none 0.20 hno3 ExtData/PIESA/L72/GMI.vmr_HNO3.x144_y91.t12.2006.nc4 +NI_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/20000401-present/NI_GridComp---full.rc b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/20000401-present/NI_GridComp---full.rc new file mode 100755 index 00000000..a4bc3a6a --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/20000401-present/NI_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file for NI parameters. +# Emission factors in kg species / kg emissions (DM or species) +# + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +NI_regions_indices: global + + +# Scavenging efficiency per bin [km-1] +fscav: 0.0 0.4 0.4 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.2695 0.2695 2.1 7.57 + +# Dry particle density [kg m-3] +particle_density: 1000 1769 1725 2200 2650 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 0.18 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 1.50e19 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 0.0118 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 2.0 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/20000401-present/NI_GridComp.rc b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/20000401-present/NI_GridComp.rc new file mode 100755 index 00000000..c0375a0e --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/20000401-present/NI_GridComp.rc @@ -0,0 +1,19 @@ +# +# NI main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +NI_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/20000401-present/NI_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/20000401-present/NI_GridComp_ExtData.rc new file mode 100644 index 00000000..e5cdced9 --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/20000401-present/NI_GridComp_ExtData.rc @@ -0,0 +1,34 @@ +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +# Nitrates +EMI_NH3_BB 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_nh3.005.%y4%m2%d2.nc4 +EMI_NH3_AG 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_EN 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none emi_nh3 ExtData/MERRA2/sfc/edgar-v42.emis_nh3.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 +EMI_NH3_IN 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_RE 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_TR 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_OC 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none emiss_ocn ExtData/PIESA/sfc/GEIA.emis_NH3.ocean.x576_y361.t12.20080715_12z.nc4 + +NITRATE_HNO3 'mol mol-1' Y N %y4-%m2-%d2T12:00:00 none 0.20 hno3 ExtData/PIESA/L72/GMI.vmr_HNO3.x144_y91.t12.2006.nc4 +NI_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/NI_GridComp---full.rc b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/NI_GridComp---full.rc new file mode 100755 index 00000000..a4bc3a6a --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/NI_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file for NI parameters. +# Emission factors in kg species / kg emissions (DM or species) +# + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +NI_regions_indices: global + + +# Scavenging efficiency per bin [km-1] +fscav: 0.0 0.4 0.4 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.2695 0.2695 2.1 7.57 + +# Dry particle density [kg m-3] +particle_density: 1000 1769 1725 2200 2650 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 0.18 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 1.50e19 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 0.0118 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 2.0 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/NI_GridComp.rc b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/NI_GridComp.rc new file mode 100755 index 00000000..c0375a0e --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/NI_GridComp.rc @@ -0,0 +1,19 @@ +# +# NI main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +NI_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/NI_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/NI_GridComp_ExtData.rc new file mode 100644 index 00000000..6d5d99a5 --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/MERRA2/NI_GridComp_ExtData.rc @@ -0,0 +1,32 @@ +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Nitrates +EMI_NH3_BB 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_nh3.005.%y4%m2%d2.nc4 +EMI_NH3_AG 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_EN 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none emi_nh3 ExtData/MERRA2/sfc/edgar-v42.emis_nh3.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 +EMI_NH3_IN 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_RE 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_TR 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_OC 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none emiss_ocn ExtData/PIESA/sfc/GEIA.emis_NH3.ocean.x576_y361.t12.20080715_12z.nc4 + +NITRATE_HNO3 'mol mol-1' Y N %y4-%m2-%d2T12:00:00 none 0.20 hno3 ExtData/PIESA/L72/GMI.vmr_HNO3.x144_y91.t12.2006.nc4 +NI_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/NI_GridComp---full.rc b/ESMF/GOCART_GridComp/NI_GridComp/NI_GridComp---full.rc new file mode 100755 index 00000000..a4bc3a6a --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/NI_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file for NI parameters. +# Emission factors in kg species / kg emissions (DM or species) +# + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +NI_regions_indices: global + + +# Scavenging efficiency per bin [km-1] +fscav: 0.0 0.4 0.4 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.2695 0.2695 2.1 7.57 + +# Dry particle density [kg m-3] +particle_density: 1000 1769 1725 2200 2650 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 0.18 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 1.50e19 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 0.0118 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 2.0 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/NI_GridComp.rc b/ESMF/GOCART_GridComp/NI_GridComp/NI_GridComp.rc new file mode 100755 index 00000000..c0375a0e --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/NI_GridComp.rc @@ -0,0 +1,19 @@ +# +# NI main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +NI_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/NI_GridComp/NI_GridCompMod.F90 b/ESMF/GOCART_GridComp/NI_GridComp/NI_GridCompMod.F90 new file mode 100644 index 00000000..e37f0ff4 --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/NI_GridCompMod.F90 @@ -0,0 +1,2284 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: NI_GridCompMod --- NI Grid Component Class +! +! !INTERFACE: +! + + module NI_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + USE MAPL_ConstantsMod, only: MAPL_AIRMW, MAPL_AVOGAD, MAPL_PI + + use Chem_Mod ! Chemistry Base Class + use Chem_StateMod ! Chemistry State + use Chem_ConstMod, only: grav, von_karman, cpd, & + undefval => undef ! Constants ! + use Chem_UtilMod ! I/O + use Chem_MieMod ! Aerosol LU Tables, calculator + use m_inpak90 ! Resource file management + use m_die, only: die + use NitrateChemDriverMod, only: RPMARES, sktrs_hno3, sktrs_sslt + use Chem_SettlingMod ! Settling + use DryDepositionMod ! Dry Deposition + use WetRemovalMod ! Large-scale Wet Removal + use ConvectionMod ! Offline convective mixing/scavenging + USE Henrys_law_ConstantsMod, ONLY: get_HenrysLawCts + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC NI_GridComp ! The NI object + PUBLIC NI_GridComp1 ! Single instance NI object + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC NI_GridCompSetServices + PUBLIC NI_GridCompInitialize + PUBLIC NI_GridCompRun1 + PUBLIC NI_GridCompRun2 + PUBLIC NI_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) NI Grid Component. +! +! !REVISION HISTORY: +! +! 24Sep2014 - Colarco, first crack +! Code here is based on existing GOCART components with Nitrate specific +! functions provided by Huisheng Bian. Turn on "doing_NI" in Chem_Registry. +! As default, we are running 5 tracers under Nitrate (see specification of +! "global"tracer indices below): +! - NH3 - Gas phase ammonia +! - NH4 - Aerosol phase ammonium ion +! - NO3an1 - Aerosol nitrate (radius <= 0.5 um) +! - NO3an2 - Aerosol nitrate (0.5 < radius < 4 um) +! - NO3an3 - Aerosol nitrate (4 < radius < 10 um) +! Needed inputs are mixing ratio of nitric acid (HNO3) and emissions of +! ammonia (NH3). At present we take input of HNO3 from offline file, but +! an unanswered question is how important it is to couple to HNO3 from +! chemistry module. Proper coupling also requires running GOCART +! sulfate, dust, and sea salt (other species neglected at present) +! with compatible assumptions of particle sizes (e.g., typical 5 dust +! size bins and 5 sea salt size bins). +! Pathway is: +! 1) emit HN3 +! 2) Call thermodynamic module RPMARES to compute updates to +! NH3, NH4, and NO3an1 (and potentially update HNO3, SO4, etc.) +! 3) Call heterogeneous reactions to update NO3anX species +! 4) Loss processes via dry deposition, sedimentation, and convective +! and wet removal +! +! Parameters + real*8, parameter :: gamma_seasalt = 0.2 +!EOP +!------------------------------------------------------------------------- + + type NI_GridComp1 + character(len=255) :: name + character(len=255) :: iname ! instance name + character(len=255) :: rcfilen ! resource file name + character(len=255) :: regionsString ! Comma-delimited string of regions + real, pointer :: regionMask(:,:) ! regional mask + integer :: instance ! instance number + logical :: run_alarm = .false. ! run alarm + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + real, pointer :: radius(:) !particle effective radius [um] + real, pointer :: rhop(:) ! NI class density [kg m-3] + !real, pointer :: hno3(:,:,;) + real, pointer :: xhno3(:,:,:) + logical :: first + logical :: recycle_HNO3 = .false. + end type NI_GridComp1 + + type NI_GridComp + integer :: n = 0 ! number of instances + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + type(NI_GridComp1), pointer :: gcs(:) => null() ! instances + end type NI_GridComp + +! Tracer assignments + integer, parameter :: globalnNH3 = 1 + integer, parameter :: globalnNH4a = 2 + integer, parameter :: globalnNO3an1 = 3 + integer, parameter :: globalnNO3an2 = 4 + integer, parameter :: globalnNO3an3 = 5 + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + real, parameter :: radToDeg = 57.2957795 + real, parameter :: fMassHNO3 = 63., fMassNO3 = 62., fMassAir = 29. + +CONTAINS + + subroutine NI_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: rcbasen = 'NI_GridComp' + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: n,i + + type(ESMF_Config) :: cfg + + Iam = "NI_GridCompSetServices" + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(rc=status) + VERIFY_(STATUS) + call ESMF_ConfigLoadFile(cfg,TRIM(rcbasen)//'.rc',rc=status) + VERIFY_(STATUS) + +! Parse resource file +! ------------------- + n = ESMF_ConfigGetLen(cfg,label='NI_instances:',rc=status) + VERIFY_(STATUS) + + +! We have 5 tracers for each instance of BC +! We cannot have fewer instances than half the number of +! BC bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( 5*n .LT. chemReg%n_NI ) then + rc = 35 + return + else if ( 5*n .GT. chemReg%n_NI ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(Iam)// & + ': fewer NI bins than possible NI instances: ',& + n, chemReg%n_NI/5 + end if + n = min(n,chemReg%n_NI/5) + +! Record name of each instance +! ---------------------------- + call ESMF_ConfigFindLabel(cfg,'NI_instances:',rc=status) + VERIFY_(STATUS) + + do i = 1, n + call ESMF_ConfigGetAttribute(cfg,name,rc=status) + VERIFY_(STATUS) + ! resource file name + IF(TRIM(name) == "full" ) THEN + name = " " ! blank instance name for full (1) + ELSE + name = TRIM(name) ! instance name for others + END IF + + call NI_GridCompSetServices1_(gc,chemReg,name,rc=status) + VERIFY_(STATUS) + end do + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'NI_regionMask', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + RETURN_(ESMF_SUCCESS) + end subroutine NI_GridCompSetServices + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: NI_GridCompInitialize --- Initialize NI_GridComp +! +! !INTERFACE: +! + + subroutine NI_GridCompInitialize ( gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(NI_GridComp), intent(inout) :: gcNI ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the NI Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 26Aug2014 Colarco First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'NI_GridCompInitialize' + character(len=255) :: rcbasen = 'NI_GridComp' + CHARACTER(LEN=255) :: name + + integer i, ier, n,i_ + +! Load resource file +! ------------------ + call i90_loadf ( trim(rcbasen)//'.rc', ier ) + if ( ier .NE. 0 ) then + rc = 10 + return + end if + +! Parse resource file +! ------------------- + CALL I90_label ( 'NI_instances:', ier ) + if ( ier .NE. 0 ) then + rc = 20 + return + end if + +! First determine how many instances we have +! ------------------------------------------ + n = 0 + do while ( ier .EQ. 0 ) + CALL I90_gtoken( name, ier ) + if(ier .eq. 0) n = n + 1 + end do + if ( n .EQ. 0 ) then + rc = 30 + return + end if + +! We have 5 tracers for each instance of NI +! Chem_Registry provides the number (total) +! of tracers to be run. Therefore n*5 must +! be >= to that number or else we don't have +! enough instances requested. +! -------------------------------------------------------- + if ( n*5 .lt. w_c%reg%n_NI ) then + rc = 35 + return + end if + n = min(n,w_c%reg%n_NI/5 ) + gcNI%n = n + +! Next allocate necessary memory +! ------------------------------ + allocate ( gcNI%gcs(n), stat=ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + +! Record name of each instance +! ---------------------------- + CALL I90_label ( 'NI_instances:', ier ) + do i = 1, n + CALL I90_gtoken( name, ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + ! resource file name + gcNI%gcs(i)%rcfilen = trim(rcbasen)//'---'//trim(name)//'.rc' + gcNI%gcs(i)%instance = i ! instance number + IF(TRIM(name) == "full" ) THEN + gcNI%gcs(i)%iname = " " ! blank instance name for full (1) + ELSE + gcNI%gcs(i)%iname = TRIM(name) ! instance name for others + END IF + end do + +! Next initialize each instance +! ----------------------------- + do i = 1, gcNI%n + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,myname,": Initializing instance ",TRIM(gcNI%gcs(i)%iname)," [",gcNI%gcs(i)%instance,"]" + END IF + call NI_SingleInstance_ ( NI_GridCompInitialize1_, i, & + gcNI%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = 1000+ier + return + end if + gcNI%gcs(i)%mie_tables => gcNI%mie_tables + end do + +! Get Henrys Law cts for the parameterized convective wet removal +! ----------------------------------------------------------- + do i = 1, gcNI%n + !- NH3 + i_ = w_c%reg%i_NI + 4*(i - 1) + CALL get_HenrysLawCts('NH3',w_c%reg%Hcts(1,i_),w_c%reg%Hcts(2,i_)& + ,w_c%reg%Hcts(3,i_),w_c%reg%Hcts(4,i_)) + !IF(MAPL_AM_I_ROOT()) THEN + ! print*,"NH3=",i,w_c%reg%Hcts(1,i_),w_c%reg%Hcts(2,i_),w_c%reg%Hcts(3,i_),w_c%reg%Hcts(4,i_) + ! call FLUSH(6) + !ENDIF + end do + +! All done +! -------- + CALL I90_FullRelease( ier ) + IF( ier /= 0 ) THEN + PRINT *,myname,": I90_FullRelease not successful." + rc = 40 + END IF + + + end subroutine NI_GridCompInitialize + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: NI_GridCompRun1 --- Run NI_GridComp +! +! !INTERFACE: +! + + subroutine NI_GridCompRun1 ( gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(NI_GridComp), INTENT(INOUT) :: gcNI ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the NI Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer i, ier + + do i = 1, gcNI%n + call NI_SingleInstance_ ( NI_GridCompRun1_, i, & + gcNI%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine NI_GridCompRun1 + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: NI_GridCompRun2 --- Run NI_GridComp +! +! !INTERFACE: +! + + subroutine NI_GridCompRun2 ( gcNI, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + LOGICAL, INTENT(IN) :: run_alarm ! run alarm + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(NI_GridComp), INTENT(INOUT) :: gcNI ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the NI Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer i, ier + + do i = 1, gcNI%n + gcNI%gcs(i)%run_alarm = run_alarm + + call NI_SingleInstance_ ( NI_GridCompRun2_, i, & + gcNI%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine NI_GridCompRun2 + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: NI_GridCompFinalize --- Initialize NI_GridComp +! +! !INTERFACE: +! + + subroutine NI_GridCompFinalize ( gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(NI_GridComp), INTENT(INOUT) :: gcNI ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the NI Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer i, ier + + do i = 1, gcNI%n + call NI_SingleInstance_ ( NI_GridCompFinalize1_, i, & + gcNI%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + deallocate ( gcNI%gcs, stat=ier ) + gcNI%n = -1 + + end subroutine NI_GridCompFinalize + + + subroutine NI_GridCompSetServices1_( gc, chemReg, iname, rc) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + character(len=*), intent(IN ) :: iname + integer, intent(OUT ) :: rc + + integer :: Status + character(len=ESMF_MAXSTR) :: Iam + + Iam ="NI_GridCOmpSetServices1_" + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'EMI_NH3_AG'//trim(iname), & + LONG_NAME = '' , & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'EMI_NH3_BB'//trim(iname), & + LONG_NAME = '' , & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'EMI_NH3_EN'//trim(iname), & + LONG_NAME = '' , & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'EMI_NH3_IN'//trim(iname), & + LONG_NAME = '' , & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'EMI_NH3_OC'//trim(iname), & + LONG_NAME = '' , & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'EMI_NH3_RE'//trim(iname), & + LONG_NAME = '' , & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'EMI_NH3_TR'//trim(iname), & + LONG_NAME = '' , & + UNITS = 'kg m-2 s-1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'NITRATE_HNO3'//trim(iname), & + LONG_NAME = '' , & + UNITS = '', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + RETURN_(ESMF_SUCCESS) + + end subroutine NI_GridCompSetServices1_ + + +!-------------------------------------------------------------------------- + +! Single Instance Methods + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: NI_GridCompInitialize --- Initialize NI_GridComp +! +! !INTERFACE: +! + + subroutine NI_GridCompInitialize1_ ( gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(NI_GridComp1), intent(inout) :: gcNI ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the NI Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'NI_GridCompInitialize1' + + + character(len=255) :: rcfilen + integer :: n + integer :: i1, i2, im, j1, j2, jm, km, nbins, n1, n2 + integer, allocatable :: ier(:) + real :: qmax, qmin + LOGICAL :: NoRegionalConstraint + + + rcfilen = gcNI%rcfilen + gcNI%name = 'NI Constituent Package' + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + km = w_c%grid%km + nbins = w_c%reg%n_NI + n1 = w_c%reg%i_NI + n2 = w_c%reg%j_NI + + gcNI%first = .True. + + call init_() + if ( rc /= 0 ) return + + +! ------------------- +! Parse resource file +! ------------------- + +! Load resource file +! ------------------ + call i90_loadf ( rcfilen, ier(1) ) + if ( ier(1) .ne. 0 ) then + call final_(10) + return + end if + +! Scavenging Efficiency +! To be used in convtran.F90, this parameter +! is the scavenging efficiency of the tracer [km -1] +! --------------- + call i90_label ( 'fscav:', ier(1) ) + do n = 1, nbins + w_c%reg%fscav(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(20) + return + end if +! ------- + +! Particle radius [um] +! To be used in settling code +! --------------- + call i90_label ( 'particle_radius:', ier(1) ) + do n = 1, nbins + gcNI%radius(n) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(30) + return + end if +! ------- + +! Particle density +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_density:', ier(1) ) + do n = 1, nbins + w_c%reg%rhop(n1+n-1) = i90_gfloat ( ier(n+1) ) + gcNI%rhop(n) = w_c%reg%rhop(n1+n-1) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(40) + return + end if +! ------- + +! Number median radius +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_radius_number:', ier(1) ) + do n = 1, nbins + w_c%reg%rmed(n1+n-1) = i90_gfloat ( ier(n+1) ) * 1e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Sigma (lognormal mode width) +! To be used in droplet activation code +! --------------- + call i90_label ( 'sigma:', ier(1) ) + do n = 1, nbins + w_c%reg%sigma(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(60) + return + end if +! ------- + +! Number to mass conversion factor +! To be used in droplet activation code +! --------------- + call i90_label ( 'fnum:', ier(1) ) + do n = 1, nbins + w_c%reg%fnum(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(70) + return + end if +! ------- + +! Molecular weight +! To be used in droplet activation code +! --------------- + call i90_label ( 'molecular_weight:', ier(1) ) + do n = 1, nbins + w_c%reg%molwght(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(80) + return + end if +! ------- + +! Grab the region string. +! ----------------------- + call i90_label ( 'NI_regions_indices:', ier(1) ) + CALL I90_gtoken( gcNI%regionsString, ier(2) ) + IF( ANY(ier(1:2) < 0 ) ) THEN + CALL final_(90) + RETURN + END IF + +! Is this instantiation a global case? +! ----------------------------------- + IF(gcNI%regionsString(1:2) == "-1") THEN + NoRegionalConstraint = .TRUE. + ELSE + SELECT CASE (ESMF_UtilStringLowerCase(gcNI%regionsString(1:2))) + CASE ("gl") + NoRegionalConstraint = .TRUE. + CASE ("al") + NoRegionalConstraint = .TRUE. + CASE DEFAULT + NoRegionalConstraint = .FALSE. + END SELECT + END IF + +! Set regionsString to "-1" for the global case +! --------------------------------------------- + IF(NoRegionalConstraint) gcNI%regionsString = "-1" + + IF(MAPL_AM_I_ROOT()) THEN + IF(NoRegionalConstraint) THEN + PRINT *,myname,": This instantiation has no regional constraints." + ELSE + PRINT *,myname,": This instantiation is regionally constrained." + PRINT *,myname,": List of region numbers included: ",TRIM(gcNI%regionsString) + END IF + END IF + +! All done +! -------- + call i90_release() + deallocate(ier) + + return + + +CONTAINS + + subroutine init_() + integer ios, nerr + nerr = max ( 32, nbins+1 ) + allocate( gcNI%regionmask(i1:i2,j1:j2), ier(nerr), & + gcNI%radius(nbins), gcNI%rhop(nbins), & + gcNI%xhno3(i1:i2,j1:j2,km), stat=ios ) + if ( ios /= 0 ) rc = 100 + end subroutine init_ + + subroutine final_(ierr) + integer :: ierr + integer ios + deallocate( gcNI%regionmask, ier, & + gcNI%radius, gcNI%rhop, & + gcNI%xhno3, stat=ios ) + call i90_release() + rc = ierr + end subroutine final_ + + end subroutine NI_GridCompInitialize1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: NI_GridCompRun1_ --- The Chem Driver, run phase 1 +! +! !INTERFACE: +! + + subroutine NI_GridCompRun1_ ( gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(NI_GridComp1), intent(inout) :: gcNI ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called NI Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'NI_GridCompRun1_' + character(len=*), parameter :: Iam = myname + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km + integer :: ijl, ijkl, ijk1l + real :: qmax, qmin + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: emi_nh3_ag, emi_nh3_en, emi_nh3_tr, & + emi_nh3_oc, emi_nh3_in, emi_nh3_re, & + emi_nh3_bb + + + real, pointer :: var2D(:,:) => null() + +! Tracer assignments (local) + integer :: nNH3, nNH4a, nNO3an1, nNO3an2, nNO3an3 + + +#define EXPORT expChem +#define iNAME TRIM(gcNI%iname) + +#define ptrNH3EM NH3_emis +#define ptrNIEM NI_emis + + + integer :: STATUS + +#include "NI_GetPointer___.h" + + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_NI + n1 = w_c%reg%i_NI + n2 = w_c%reg%j_NI + + nNH3 = n1 + globalnNH3 - 1 + nNH4a = n1 + globalnNH4a - 1 + nNO3an1 = n1 + globalnNO3an1 - 1 + nNO3an2 = n1 + globalnNO3an2 - 1 + nNO3an3 = n1 + globalnNO3an3 - 1 + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + + call MAPL_GetPointer(impChem, var2D, 'NI_regionMask', __RC__) + gcNI%regionMask = var2D + + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin ( 'NI: q_beg', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Emissions +! --------- + call MAPL_GetPointer ( impChem, emi_nh3_bb, 'EMI_NH3_BB'//iNAME, __RC__ ) + call MAPL_GetPointer ( impChem, emi_nh3_ag, 'EMI_NH3_AG'//iNAME, __RC__ ) + call MAPL_GetPointer ( impChem, emi_nh3_en, 'EMI_NH3_EN'//iNAME, __RC__ ) + call MAPL_GetPointer ( impChem, emi_nh3_re, 'EMI_NH3_RE'//iNAME, __RC__ ) + call MAPL_GetPointer ( impChem, emi_nh3_tr, 'EMI_NH3_TR'//iNAME, __RC__ ) + call MAPL_GetPointer ( impChem, emi_nh3_in, 'EMI_NH3_IN'//iNAME, __RC__ ) + call MAPL_GetPointer ( impChem, emi_nh3_oc, 'EMI_NH3_OC'//iNAME, __RC__ ) + + +! NH3 Emissions +! ------------- + if(associated(NH3_emis%data2d)) then + NH3_emis%data2d = 0. + if(associated(emi_nh3_bb)) NH3_emis%data2d = NH3_emis%data2d + emi_nh3_bb + if(associated(emi_nh3_ag)) NH3_emis%data2d = NH3_emis%data2d + emi_nh3_ag + if(associated(emi_nh3_en)) NH3_emis%data2d = NH3_emis%data2d + emi_nh3_en + if(associated(emi_nh3_tr)) NH3_emis%data2d = NH3_emis%data2d + emi_nh3_tr + if(associated(emi_nh3_re)) NH3_emis%data2d = NH3_emis%data2d + emi_nh3_re + if(associated(emi_nh3_in)) NH3_emis%data2d = NH3_emis%data2d + emi_nh3_in + if(associated(emi_nh3_oc)) NH3_emis%data2d = NH3_emis%data2d + emi_nh3_oc + endif + + if(associated(emi_nh3_bb)) & + w_c%qa(nNH3)%data3d(:,:,km) = w_c%qa(nNH3)%data3d(:,:,km) & + + cdt * grav / w_c%delp(:,:,km) * emi_nh3_bb + if(associated(emi_nh3_ag)) & + w_c%qa(nNH3)%data3d(:,:,km) = w_c%qa(nNH3)%data3d(:,:,km) & + + cdt * grav / w_c%delp(:,:,km) * emi_nh3_ag + if(associated(emi_nh3_en)) & + w_c%qa(nNH3)%data3d(:,:,km) = w_c%qa(nNH3)%data3d(:,:,km) & + + cdt * grav / w_c%delp(:,:,km) * emi_nh3_en + if(associated(emi_nh3_in)) & + w_c%qa(nNH3)%data3d(:,:,km) = w_c%qa(nNH3)%data3d(:,:,km) & + + cdt * grav / w_c%delp(:,:,km) * emi_nh3_in + if(associated(emi_nh3_re)) & + w_c%qa(nNH3)%data3d(:,:,km) = w_c%qa(nNH3)%data3d(:,:,km) & + + cdt * grav / w_c%delp(:,:,km) * emi_nh3_re + if(associated(emi_nh3_tr)) & + w_c%qa(nNH3)%data3d(:,:,km) = w_c%qa(nNH3)%data3d(:,:,km) & + + cdt * grav / w_c%delp(:,:,km) * emi_nh3_tr + if(associated(emi_nh3_oc)) & + w_c%qa(nNH3)%data3d(:,:,km) = w_c%qa(nNH3)%data3d(:,:,km) & + + cdt * grav / w_c%delp(:,:,km) * emi_nh3_oc + + return + + end subroutine NI_GridCompRun1_ + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: NI_GridCompRun2 --- The Chem Driver, run phase 2 +! +! !INTERFACE: +! + + subroutine NI_GridCompRun2_ ( gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(NI_GridComp1), intent(inout) :: gcNI ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called NI Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'NI_GridCompRun2_' + character(len=*), parameter :: Iam = myname + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n, ios + integer :: i, j, k, ijl, ijkl, ijk1l + real :: qmax, qmin + real, pointer :: dqa(:,:), drydepositionfrequency(:,:) + type(Chem_Array), pointer :: fluxout + logical :: KIN + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: frlake, frocean, frseaice, & + oro, u10m, v10m, & + ustar, precc, precl, & + pblh, shflux, z0h, hsurf + real, pointer, dimension(:,:,:) :: tmpu, rhoa, u, v, hghte, ple + real, pointer, dimension(:,:,:) :: pfllsan, pfilsan + real, pointer, dimension(:,:,:) :: hno3 + +! Additional needs for GOCART convective diagnostic + real, pointer, dimension(:,:,:) :: cmfmc, qlcn, qicn, dtrain + real, pointer, dimension(:,:) :: area + real*8, allocatable, dimension(:,:,:) :: cmfmc_, qccu_, dtrain_, & + airmass_, airmol_, vud_, & + delz_, delp_, tmpu_, ple_ + real*8, allocatable :: tc_(:,:,:,:), bcnv_(:,:,:) + real*8, allocatable :: area_(:,:), frlake_(:,:), & + frocean_(:,:), frseaice_(:,:) + integer*4 :: icdt + + real :: NI_radius, NI_rhop + integer :: rhFlag + + real, pointer :: var2D(:,:) => null() + +! Tracer assignments (local) + integer :: nNH3, nNH4a, nNO3an1, nNO3an2, nNO3an3, nSO4, na + +! variables for call to RPMARES + real :: fmmr_to_conc + real*8 :: SO4, GNO3, GNH3, RH, TEMP, ASO4, AHSO4, AH2O, ANO3, ANH4 + +! variables for call to heterogeneous chemistry + real*8 :: kan1, kan2, kan3, sad, ad, rad, deltahno3 + + character(len=5), allocatable :: duname(:) + character(len=5), allocatable :: ssname(:) + +#define EXPORT expChem +#define iNAME TRIM(gcNI%iname) + +#define ptrNH3EM NH3_emis +#define ptrNH3WT NH3_wet +#define ptrNH3SV NH3_conv +#define ptrNH3DP NH3_dep +#define ptrNH3MASS NH3_mass +#define ptrNH4WT NH4_wet +#define ptrNH4SV NH4_conv +#define ptrNH4DP NH4_dep +#define ptrNH4SD NH4_set +#define ptrNH4MASS NH4_mass +#define ptrNIPNO3AQ NI_pno3aq +#define ptrNIPNH4AQ NI_pnh4aq +#define ptrNIPNH3AQ NI_pnh3aq +#define ptrNIWT NI_wet +#define ptrNISV NI_conv +#define ptrNIEM NI_emis +#define ptrNIDP NI_dep +#define ptrNISD NI_set +#define ptrNIHT NI_phet + +#define ptrHNO3SMASS HNO3_sfcmass +#define ptrHNO3CMASS HNO3_colmass +#define ptrHNO3CONC HNO3_conc +#define ptrNH3SMASS NH3_sfcmass +#define ptrNH3CMASS NH3_colmass +#define ptrNH3CONC NH3_conc +#define ptrNH4SMASS NH4_sfcmass +#define ptrNH4CMASS NH4_colmass +#define ptrNH4CONC NH4_conc +#define ptrNISMASS25 NI_sfcmass25 +#define ptrNICMASS25 NI_colmass25 +#define ptrNISMASS NI_sfcmass +#define ptrNICMASS NI_colmass +#define ptrNIEXTT25 NI_exttau25 +#define ptrNISCAT25 NI_scatau25 +#define ptrNIEXTTFM NI_exttaufm +#define ptrNISCATFM NI_scataufm +#define ptrNIEXTTAU NI_exttau +#define ptrNISCATAU NI_scatau +#define ptrNIMASS25 NI_mass25 +#define ptrNICONC25 NI_conc25 +#define ptrNIMASS NI_mass +#define ptrNICONC NI_conc +#define ptrNIEXTCOEF NI_extcoef +#define ptrNISCACOEF NI_scacoef +#define ptrNIANGSTR NI_angstrom +#define ptrNIFLUXU NI_fluxu +#define ptrNIFLUXV NI_fluxv + + + + integer :: STATUS + +#include "NI_GetPointer___.h" + + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_NI + n1 = w_c%reg%i_NI + n2 = w_c%reg%j_NI + + nNH3 = n1 + globalnNH3 - 1 + nNH4a = n1 + globalnNH4a - 1 + nNO3an1 = n1 + globalnNO3an1 - 1 + nNO3an2 = n1 + globalnNO3an2 - 1 + nNO3an3 = n1 + globalnNO3an3 - 1 + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + + call MAPL_GetPointer(impChem, var2D, 'NI_regionMask', __RC__) + gcNI%regionMask = var2D + + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin ( 'NI: q_beg', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, frlake, 'FRLAKE', __RC__ ) + call MAPL_GetPointer ( impChem, oro, 'LWI', __RC__ ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', __RC__ ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', __RC__ ) + call MAPL_GetPointer ( impChem, ustar, 'USTAR', __RC__ ) + call MAPL_GetPointer ( impChem, precc, 'CN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, precl, 'NCN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + call MAPL_GetPointer ( impChem, shflux, 'SH', __RC__ ) + call MAPL_GetPointer ( impChem, z0h, 'Z0H', __RC__ ) + call MAPL_GetPointer ( impChem, area, 'AREA', __RC__ ) + call MAPL_GetPointer ( impChem, frocean, 'FROCEAN', __RC__ ) + call MAPL_GetPointer ( impChem, frseaice, 'FRACI', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, u, 'U', __RC__ ) + call MAPL_GetPointer ( impChem, v, 'V', __RC__ ) + call MAPL_GetPointer ( impChem, hghte, 'ZLE', __RC__ ) + call MAPL_GetPointer ( impChem, ple, 'PLE', __RC__ ) + call MAPL_GetPointer ( impChem, qlcn, 'QLCN', __RC__ ) + call MAPL_GetPointer ( impChem, qicn, 'QICN', __RC__ ) + call MAPL_GetPointer ( impChem, cmfmc, 'CNV_MFC', __RC__ ) + call MAPL_GetPointer ( impChem, dtrain, 'CNV_MFD', __RC__ ) + call MAPL_GetPointer ( impChem, pfllsan, 'PFL_LSAN', __RC__ ) + call MAPL_GetPointer ( impChem, pfilsan, 'PFI_LSAN', __RC__ ) + +#ifdef DEBUG + + call pmaxmin('NI: frlake ', frlake , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: frocean ', frocean , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: frseaice ', frseaice, qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: area ', area , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: oro ', oro , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: u10m ', u10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: v10m ', v10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: ustar ', ustar , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: precc ', precc , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: precl ', precl , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: shflux ', shflux , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: z0h ', z0h , qmin, qmax, ijl,1, 1. ) + call pmaxmin('NI: hsurf ', hsurf , qmin, qmax, ijl,1, 1. ) + + call pmaxmin('NI: tmpu ', tmpu , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('NI: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('NI: u ', u , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('NI: v ', v , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('NI: hghte ', hghte , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('NI: qlcn ', qlcn , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('NI: qicn ', qicn , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('NI: cmfmc ', cmfmc , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('NI: dtrain ', dtrain , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('NI: pfllsan ', pfllsan , qmin, qmax, ijk1l,1, 1. ) + call pmaxmin('NI: pfilsan ', pfilsan , qmin, qmax, ijk1l,1, 1. ) + +#endif + + + +! Nitric Acid +! ----------- + call MAPL_GetPointer ( impChem, hno3, 'NITRATE_HNO3'//iNAME, __RC__ ) + +! Save local copy of HNO3 for first pass through run method regardless + if (gcNI%first) then + gcNI%xhno3 = MAPL_UNDEF + gcNI%first = .False. + end if + + ! Recycle HNO3 every 3 hours + if (gcNI%recycle_HNO3) then + gcNI%xhno3 = hno3 + gcNI%recycle_HNO3 = .false. + end if + + +RUN_ALARM: if (gcNI%run_alarm) then + + allocate( fluxout ) + allocate( fluxout%data2d(i1:i2,j1:j2), dqa(i1:i2,j1:j2), & + drydepositionfrequency(i1:i2,j1:j2), stat=STATUS) + VERIFY_(STATUS) + + +! Unlike GEOS-4 hghte is defined for km+1 +! --------------------------------------- + hsurf => hghte(i1:i2,j1:j2,km) ! Recall: GEOS-5 has edges with k in [0,km] + + +! Nitrate Chemistry +! ----------------- + if(associated(NI_pno3aq%data2d)) NI_pno3aq%data2d(:,:) = 0. + if(associated(NI_pnh4aq%data2d)) NI_pnh4aq%data2d(:,:) = 0. + if(associated(NI_pnh3aq%data2d)) NI_pnh3aq%data2d(:,:) = 0. + +! RPMARES - thermodynamic module +! ------------------------------ +! Take as input GOCART provided SO4, model provided RH, +! and HNO3, NH3, NH4, and fine-mode nitrate (NO3an1). +! At present we update NH3, NH4, and NO3an1. +! Check we are running GOCART sulfate + nSO4 = -1 + if(w_c%reg%doing_SU) then + do n = w_c%reg%i_SU, w_c%reg%j_SU + if(trim(w_c%reg%vname(n)) .eq. 'SO4') nSO4 = n + enddo + endif + do k = 1, km + do j = j1, j2 + do i = i1, i2 + +! Conversion of mass mixing ratio to concentration (ug m-3) + fmmr_to_conc = 1.e9 * rhoa(i,j,k) + +! Unit conversion for input to thermodynamic module +! Per grid box call to RPMARES thermodynamic module +! We do not presently treat chemistry of sulfate completely, +! hence we ignore terms for ASO4, AHSO4, AH2O, and we do +! not update SO4 on output from RPMARES. +! At present we are importing HNO3 from offline file, so we +! do not update on return. + SO4 = 1.d-32 + if(nSO4 > 0) SO4 = max(1.d-32,w_c%qa(nSO4)%data3d(i,j,k) * fmmr_to_conc) + GNO3 = max(1.d-32,gcNI%xhno3(i,j,k) * fMassHNO3 / fMassAir * fmmr_to_conc) + GNH3 = max(1.d-32,w_c%qa(nNH3)%data3d(i,j,k) * fmmr_to_conc) + RH = w_c%rh(i,j,k) + TEMP = tmpu(i,j,k) + ASO4 = 1.d-32 + AHSO4 = 1.d-32 + ANO3 = max(1.d-32,w_c%qa(nNO3an1)%data3d(i,j,k) * fmmr_to_conc) + AH2O = 1.d-32 + ANH4 = max(1.d-32,w_c%qa(nNH4a)%data3d(i,j,k) * fmmr_to_conc) + + call RPMARES ( SO4, GNO3, GNH3, RH, TEMP, & + ASO4, AHSO4, ANO3, AH2O, ANH4 ) + +! Diagnostic terms + if(associated(NI_pno3aq%data2d)) & + NI_pno3aq%data2d(i,j) = NI_pno3aq%data2d(i,j) & + + (ANO3 / fmmr_to_conc - w_c%qa(nNO3an1)%data3d(i,j,k)) & + * w_c%delp(i,j,k)/grav/cdt + if(associated(NI_pnh4aq%data2d)) & + NI_pnh4aq%data2d(i,j) = NI_pnh4aq%data2d(i,j) & + + (ANH4 / fmmr_to_conc - w_c%qa(nNH4a)%data3d(i,j,k)) & + * w_c%delp(i,j,k)/grav/cdt + if(associated(NI_pnh3aq%data2d)) & + NI_pnh3aq%data2d(i,j) = NI_pnh3aq%data2d(i,j) & + + (GNH3 / fmmr_to_conc - w_c%qa(nNH3)%data3d(i,j,k)) & + * w_c%delp(i,j,k)/grav/cdt + +! Unit conversion back on return from thermodynamic module + w_c%qa(nNH3)%data3d(i,j,k) = GNH3 / fmmr_to_conc + w_c%qa(nNO3an1)%data3d(i,j,k) = ANO3 / fmmr_to_conc + w_c%qa(nNH4a)%data3d(i,j,k) = ANH4 / fmmr_to_conc + gcNI%xhno3(i,j,k) = max(1.d-32, GNO3 * fMassAir / fMassHNO3 / fmmr_to_conc) + + enddo + enddo + enddo + + ! prepare the variable names for comparison + if(w_c%reg%doing_DU) then + allocate(duname(w_c%reg%i_DU:w_c%reg%j_DU)) + do n = w_c%reg%i_DU, w_c%reg%j_DU + duname(n) = ESMF_UtilStringUpperCase(trim(w_c%reg%vname(n))) + end do + end if + + if(w_c%reg%doing_SS) then + allocate(ssname(w_c%reg%i_SS:w_c%reg%j_SS)) + do n = w_c%reg%i_SS, w_c%reg%j_SS + ssname(n) = ESMF_UtilStringUpperCase(trim(w_c%reg%vname(n))) + end do + end if + +! Heterogeneous chemistry +! ----------------------- +! Heterogeneous chemistry wants to know about GOCART dust and sea +! salt tracers. This code is not at the moment generalized as it +! seems very wedded to the traditional GOCART arrangement (5 dust, +! 5 sea salt) and the particulars of the nitrate aerosol arrangement. + if(associated(NI_phet(1)%data2d)) NI_phet(1)%data2d = 0. + if(associated(NI_phet(2)%data2d)) NI_phet(2)%data2d = 0. + if(associated(NI_phet(3)%data2d)) NI_phet(3)%data2d = 0. + do k = 1, km + do j = j1, j2 + do i = i1, i2 + kan1 = 0. + kan2 = 0. + kan3 = 0. + ad = 1.e-6*rhoa(i,j,k)*MAPL_AVOGAD/MAPL_AIRMW ! air number density # cm-3 + temp = tmpu(i,j,k) + rh = w_c%rh(i,j,k) +! Dust + if(w_c%reg%doing_DU) then + do n = w_c%reg%i_DU, w_c%reg%j_DU + sad = 0.01*4.*MAPL_PI*w_c%reg%rmed(n)**2.*w_c%reg%fnum(n) * & + rhoa(i,j,k) * w_c%qa(n)%data3d(i,j,k) ! surface area density cm2 cm-3 + rad = 100.*w_c%reg%rmed(n) ! radius cm + + if (sad > 0.) then + if(duname(n) .eq. 'DU001') & + kan1 = kan1 + sktrs_hno3(temp,rh,sad,ad,rad) + if(duname(n) .eq. 'DU002') & + kan2 = kan2 + sktrs_hno3(temp,rh,sad,ad,rad) + if(duname(n) .eq. 'DU003') & + kan2 = kan2 + sktrs_hno3(temp,rh,sad,ad,rad) + if(duname(n) .eq. 'DU004') & + kan3 = kan3 + sktrs_hno3(temp,rh,sad,ad,rad) + if(duname(n) .eq. 'DU005') & + kan3 = kan3 + sktrs_hno3(temp,rh,sad,ad,rad) + end if + + enddo + endif + +! Sea salt + if(w_c%reg%doing_SS) then + do n = w_c%reg%i_SS, w_c%reg%j_SS + sad = 0.01*4.*MAPL_PI*w_c%reg%rmed(n)**2.*w_c%reg%fnum(n) * & + rhoa(i,j,k) * w_c%qa(n)%data3d(i,j,k) ! surface area density cm2 cm-3 + rad = 100.*w_c%reg%rmed(n) ! radius cm + + if (sad > 0.) then + if(ssname(n) .eq. 'SS001') & + kan1 = kan1 + sktrs_sslt(temp,rh,sad,ad,rad) + if(ssname(n) .eq. 'SS002') & + kan1 = kan1 + sktrs_sslt(temp,rh,sad,ad,rad) + if(ssname(n) .eq. 'SS003') & + kan2 = kan2 + sktrs_sslt(temp,rh,sad,ad,rad) + if(ssname(n) .eq. 'SS004') & + kan2 = kan2 + sktrs_sslt(temp,rh,sad,ad,rad) + if(ssname(n) .eq. 'SS005') & + kan3 = kan3 + sktrs_sslt(temp,rh,sad,ad,rad) + end if + + enddo + endif + +! Compute the nitric acid loss (but don't actually update) + if( (kan1+kan2+kan3) > 0.) then + deltahno3 = gcNI%xhno3(i,j,k) * fMassHNO3 / fMassAir * (1.-exp(-(kan1+kan2+kan3)*cdt)) + gcNI%xhno3(i,j,k) = gcNI%xhno3(i,j,k) - deltahno3 * fMassAir / fMassHNO3 + w_c%qa(nNO3an1)%data3d(i,j,k) = & + w_c%qa(nNO3an1)%data3d(i,j,k) + kan1/(kan1+kan2+kan3)*deltahno3*fMassNO3/fMassHNO3 + w_c%qa(nNO3an2)%data3d(i,j,k) = & + w_c%qa(nNO3an2)%data3d(i,j,k) + kan2/(kan1+kan2+kan3)*deltahno3*fMassNO3/fMassHNO3 + w_c%qa(nNO3an3)%data3d(i,j,k) = & + w_c%qa(nNO3an3)%data3d(i,j,k) + kan3/(kan1+kan2+kan3)*deltahno3*fMassNO3/fMassHNO3 + if(associated(NI_phet(1)%data2d)) & + NI_phet(1)%data2d(i,j) = NI_phet(1)%data2d(i,j) + kan1/(kan1+kan2+kan3)*deltahno3*w_c%delp(i,j,k)/grav/cdt + if(associated(NI_phet(2)%data2d)) & + NI_phet(2)%data2d(i,j) = NI_phet(2)%data2d(i,j) + kan2/(kan1+kan2+kan3)*deltahno3*w_c%delp(i,j,k)/grav/cdt + if(associated(NI_phet(3)%data2d)) & + NI_phet(3)%data2d(i,j) = NI_phet(3)%data2d(i,j) + kan3/(kan1+kan2+kan3)*deltahno3*w_c%delp(i,j,k)/grav/cdt + endif + enddo + enddo + enddo + + if(w_c%reg%doing_DU) deallocate(duname) + if(w_c%reg%doing_SS) deallocate(ssname) + + +! Output diagnostic HNO3 +! ---------------------- +! Calculate the HNO3 mass concentration + if( associated(HNO3_conc%data3d) ) then + HNO3_conc%data3d = gcNI%xhno3 * fMassHNO3 / fMassAir*rhoa + endif +! Calculate the HNO3 surface mass concentration + if( associated(HNO3_sfcmass%data2d) ) then + HNO3_sfcmass%data2d(i1:i2,j1:j2) = gcNI%xhno3(i1:i2,j1:j2,km) * fMassHNO3 / fMassAir*rhoa(i1:i2,j1:j2,km) + endif +! Calculate the HNO3 column loading + if( associated(HNO3_colmass%data2d) ) then + HNO3_colmass%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + HNO3_colmass%data2d(i1:i2,j1:j2) & + = HNO3_colmass%data2d(i1:i2,j1:j2) + gcNI%xhno3(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + end do + endif + + +! NI Settling +! ----------- +! Because different bins having different swelling coefficients I need to +! handle the call to settling differently. + +! Ammonium - settles like ammonium sulfate (rhflag = 3) + n = globalnNH4a + rhflag = 3 + NI_radius = 1.e-6*gcNI%radius(n) ! radius in [m] + NI_rhop = gcNI%rhop(n) + call Chem_SettlingSimple ( i1, i2, j1, j2, km, nNH4a, rhFlag, & + NI_radius, NI_rhop, cdt, w_c, tmpu, rhoa, hsurf, & + hghte, fluxout, rc ) + if(associated(NH4_set%data2d)) NH4_set%data2d = fluxout%data2d + +! Nitrate bin 1 - settles like ammonium sulfate (rhflag = 3) + n = globalnNO3an1 + rhflag = 3 + NI_radius = 1.e-6*gcNI%radius(n) ! radius in [m] + NI_rhop = gcNI%rhop(n) + call Chem_SettlingSimple ( i1, i2, j1, j2, km, nNO3an1, rhFlag, & + NI_radius, NI_rhop, cdt, w_c, tmpu, rhoa, hsurf, & + hghte, fluxout, rc ) + if(associated(NI_set(1)%data2d)) NI_set(1)%data2d = fluxout%data2d + +! Nitrate bin 2 - settles like sea salt (rhflag = 2) + n = globalnNO3an2 + rhflag = 2 + NI_radius = 1.e-6*gcNI%radius(n) ! radius in [m] + NI_rhop = gcNI%rhop(n) + call Chem_SettlingSimple ( i1, i2, j1, j2, km, nNO3an2, rhFlag, & + NI_radius, NI_rhop, cdt, w_c, tmpu, rhoa, hsurf, & + hghte, fluxout, rc ) + if(associated(NI_set(2)%data2d)) NI_set(2)%data2d = fluxout%data2d + +! Nitrate bin 3 - settles like dust (rhflag = 0) + n = globalnNO3an3 + rhflag = 0 + NI_radius = 1.e-6*gcNI%radius(n) ! radius in [m] + NI_rhop = gcNI%rhop(n) + call Chem_SettlingSimple ( i1, i2, j1, j2, km, nNO3an3, rhFlag, & + NI_radius, NI_rhop, cdt, w_c, tmpu, rhoa, hsurf, & + hghte, fluxout, rc ) + if(associated(NI_set(3)%data2d)) NI_set(3)%data2d = fluxout%data2d + + +! NI Deposition +! ----------- + drydepositionfrequency = 0. + call DryDepositionGOCART( i1, i2, j1, j2, km, & + tmpu, rhoa, hghte, oro, ustar, & + pblh, shflux, z0h, drydepositionfrequency, rc ) + + n = globalnNH3 + dqa = 0. + where (abs(oro - OCEAN) < 0.5) + dqa = max(0.0, w_c%qa(n1+n-1)%data3d(:,:,km)*(1.-exp(-10.0*drydepositionfrequency*cdt))) + elsewhere + dqa = max(0.0, w_c%qa(n1+n-1)%data3d(:,:,km)*(1.-exp( -3.0*drydepositionfrequency*cdt))) + end where + w_c%qa(n1+n-1)%data3d(:,:,km) = w_c%qa(n1+n-1)%data3d(:,:,km) - dqa + if( associated(NH3_dep%data2d) ) NH3_dep%data2d = dqa*w_c%delp(:,:,km)/grav/cdt + + n = globalnNH4a + dqa = 0. + dqa = max(0.0, w_c%qa(n1+n-1)%data3d(:,:,km)*(1.-exp(-drydepositionfrequency*cdt))) + w_c%qa(n1+n-1)%data3d(:,:,km) = w_c%qa(n1+n-1)%data3d(:,:,km) - dqa + if( associated(NH4_dep%data2d) ) NH4_dep%data2d = dqa*w_c%delp(:,:,km)/grav/cdt + + do n = globalnNO3an1, globalnNO3an3 + dqa = 0. + dqa = max(0.0, w_c%qa(n1+n-1)%data3d(:,:,km)*(1.-exp(-drydepositionfrequency*cdt))) + w_c%qa(n1+n-1)%data3d(:,:,km) = w_c%qa(n1+n-1)%data3d(:,:,km) - dqa + if( associated(NI_dep(n-2)%data2d) ) NI_dep(n-2)%data2d = dqa*w_c%delp(:,:,km)/grav/cdt + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('NI: q_dry', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! NI Large-scale Wet Removal +! -------------------------- + w_c%qa(nNH3)%fwet = 1. + KIN = .FALSE. ! treat ammonia as gas + call WetRemovalGOCART(i1, i2, j1, j2, km, nNH3, nNH3, cdt, 'NH3', KIN, & + w_c%qa, ple, tmpu, rhoa, pfllsan, pfilsan, & + precc, precl, fluxout, rc ) + if(associated(NH3_wet%data2d)) NH3_wet%data2d = fluxout%data2d + + w_c%qa(nNH4a)%fwet = 1. + KIN = .TRUE. + call WetRemovalGOCART(i1, i2, j1, j2, km, nNH4a, nNH4a, cdt, 'NH4a', KIN, & + w_c%qa, ple, tmpu, rhoa, pfllsan, pfilsan, & + precc, precl, fluxout, rc ) + if(associated(NH4_wet%data2d)) NH4_wet%data2d = fluxout%data2d + + do n = nNO3an1, nNO3an3 + w_c%qa(n)%fwet = 1. + if(n .eq. nNO3an3) w_c%qa(n)%fwet = 0.3 ! treat coarse mode like dust + KIN = .TRUE. + call WetRemovalGOCART(i1, i2, j1, j2, km, n, n, cdt, 'nitrate', KIN, & + w_c%qa, ple, tmpu, rhoa, pfllsan, pfilsan, & + precc, precl, fluxout, rc ) + na = n - n1 - 1 + if(associated(NI_wet(na)%data2d)) NI_wet(na)%data2d = fluxout%data2d + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('NI: q_wet', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Nitrate Convective-scale Mixing and Wet Removal +! ----------------------------------------------- + KIN = .TRUE. + icdt = cdt + allocate(cmfmc_(i1:i2,j1:j2,km+1), qccu_(i1:i2,j1:j2,km), & + dtrain_(i1:i2,j1:j2,km), airmass_(i1:i2,j1:j2,km), & + delz_(i1:i2,j1:j2,km), vud_(i1:i2,j1:j2,km), & + tc_(i1:i2,j1:j2,km,n1:n2), delp_(i1:i2,j1:j2,km), & + airmol_(i1:i2,j1:j2,km), tmpu_(i1:i2,j1:j2,km), & + bcnv_(i1:i2,j1:j2,n1:n2), ple_(i1:i2,j1:j2,km+1), & + area_(i1:i2,j1:j2), frlake_(i1:i2,j1:j2), & + frocean_(i1:i2,j1:j2), frseaice_(i1:i2,j1:j2), __STAT__ ) + + bcnv_ = 0.0 + area_ = area + frlake_ = frlake + frocean_ = frocean + frseaice_ = frseaice + do k = 1, km+1 + cmfmc_(:,:,k) = cmfmc(:,:,km-k+1) + ple_(:,:,k) = ple(:,:,km-k+1) + end do + do k = 1, km + dtrain_(:,:,k) = dtrain(:,:,km-k+1) + qccu_(:,:,k) = qlcn(:,:,km-k+1) + qicn(:,:,km-k+1) + delp_(:,:,k) = w_c%delp(:,:,km-k+1)/100. + airmass_(:,:,k) = w_c%delp(:,:,km-k+1)/grav*area_ + airmol_(:,:,k) = airmass_(:,:,k)*1000./28.966 + delz_(:,:,k) = w_c%delp(:,:,km-k+1)/grav/rhoa(:,:,km-k+1) + tmpu_(:,:,k) = tmpu(:,:,km-k+1) + enddo + do n = n1, n2 + do k = 1, km + tc_(:,:,k,n) = w_c%qa(n)%data3d(:,:,km-k+1) + enddo + enddo + call set_vud(i1, i2, j1, j2, km, frlake_, frocean_, frseaice_, cmfmc_, qccu_, & + airmass_, delz_, area_, vud_) + call convection(i1, i2, j1, j2, km, n1, n2, icdt, 'nitrate', kin, & + tc_, cmfmc_, dtrain_, area_, delz_, delp_, vud_, & + airmass_, airmol_, tmpu_, ple_, & + bcnv_) + +! Return adjusted tracer to mixing ratio + do n = n1, n2 + do k = 1, km + w_c%qa(n)%data3d(:,:,km-k+1) = tc_(:,:,k,n) + enddo + enddo + +! Note GOCART returns bcnv_ as negative, recast for my diagnostic + if(associated(NH3_conv%data2d)) NH3_conv%data2d = -bcnv_(:,:,nNH3)/area_/icdt + if(associated(NH4_conv%data2d)) NH4_conv%data2d = -bcnv_(:,:,nNH4a)/area_/icdt + if(associated(NI_conv(1)%data2d)) NI_conv(1)%data2d = -bcnv_(:,:,nNO3an1)/area_/icdt + if(associated(NI_conv(2)%data2d)) NI_conv(2)%data2d = -bcnv_(:,:,nNO3an2)/area_/icdt + if(associated(NI_conv(3)%data2d)) NI_conv(3)%data2d = -bcnv_(:,:,nNO3an3)/area_/icdt + +! Clean up +! -------- + deallocate(cmfmc_, qccu_, dtrain_, tc_, airmass_, & + delz_, vud_, delp_, airmol_, tmpu_, bcnv_, ple_, & + area_, frlake_, frocean_, frseaice_, __STAT__ ) + + deallocate(fluxout%data2d) + deallocate(fluxout, dqa, drydepositionfrequency, stat=ios ) + + end if RUN_ALARM + + +! Compute the desired output diagnostics here +! Ideally this will go where chemout is called in fvgcm.F since that +! will reflect the distributions after transport, etc. +! ------------------------------------------------------------------ + call NI_Compute_Diags(i1, i2, j1, j2, km, nbins, gcNI, w_c, tmpu, rhoa, u, v, & + NH3_sfcmass, NH3_colmass, NH3_mass, NH3_conc, & + NH4_sfcmass, NH4_colmass, NH4_mass, NH4_conc, & + NI_sfcmass, NI_colmass, NI_mass, NI_conc, & + NI_sfcmass25, NI_colmass25, NI_mass25, NI_conc25, & + NI_exttau, NI_scatau, NI_extcoef, NI_scacoef, NI_angstrom, & + NI_exttau25, NI_scatau25, NI_exttauFM, NI_scatauFM, & + NI_fluxu, NI_fluxv, rc) + + + return + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: NI_Compute_Diags - Calculate dust 2D diagnostics +! +! !INTERFACE: +! + + subroutine NI_Compute_Diags ( i1, i2, j1, j2, km, nbins, gcNI, w_c, tmpu, rhoa, u, v, & + NH3sfcmass, NH3colmass, NH3mass, NH3conc, & + NH4sfcmass, NH4colmass, NH4mass, NH4conc, & + sfcmass, colmass, mass, conc, & + sfcmass25, colmass25, mass25, conc25, & + exttau, scatau, extcoef, scacoef, angstrom, & + exttau25, scatau25, exttaufm, scataufm, & + fluxu, fluxv, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2, km, nbins + type(NI_GridComp1), intent(inout):: gcNI ! NI Grid Component + type(Chem_Bundle), intent(in) :: w_c ! Chem Bundle + real, pointer, dimension(:,:,:) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:,:) :: u ! east-west wind [m s-1] + real, pointer, dimension(:,:,:) :: v ! north-south wind [m s-1] + +! !OUTPUT PARAMETERS: + type(Chem_Array), intent(inout) :: NH3sfcmass ! NH3 sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: NH3colmass ! NH3 col mass density kg/m2 + type(Chem_Array), intent(inout) :: NH3mass ! NH3 3d mass mixing ratio kg/kg + type(Chem_Array), intent(inout) :: NH3conc ! NH3 3d mass concentration, kg/m3 + type(Chem_Array), intent(inout) :: NH4sfcmass ! NH4 sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: NH4colmass ! NH4 col mass density kg/m2 + type(Chem_Array), intent(inout) :: NH4mass ! NH4 3d mass mixing ratio kg/kg + type(Chem_Array), intent(inout) :: NH4conc ! NH4 3d mass concentration, kg/m3 + type(Chem_Array), intent(inout) :: sfcmass ! nitrate sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: colmass ! nitrate col mass density kg/m2 + type(Chem_Array), intent(inout) :: conc ! nitrate 3d mass concentration, kg/m3 + type(Chem_Array), intent(inout) :: mass ! 3d mass mixing ratio kg/kg + type(Chem_Array), intent(inout) :: sfcmass25 ! nitrate sfc mass concentration kg/m3 [pm2.5] + type(Chem_Array), intent(inout) :: colmass25 ! nitrate col mass density kg/m2 [pm2.5] + type(Chem_Array), intent(inout) :: conc25 ! nitrate 3d mass concentration, kg/m3 [pm2.5] + type(Chem_Array), intent(inout) :: mass25 ! 3d mass mixing ratio kg/kg [pm2.5] + type(Chem_Array), intent(inout) :: exttau25 ! ext. AOT at 550 nm [pm2.5] + type(Chem_Array), intent(inout) :: scatau25 ! sct. AOT at 550 nm [pm2.5] + type(Chem_Array), intent(inout) :: exttaufm ! ext. AOT at 550 nm [pm1.0] + type(Chem_Array), intent(inout) :: scataufm ! sct. AOT at 550 nm [pm1.0] + type(Chem_Array), intent(inout) :: exttau ! ext. AOT at 550 nm + type(Chem_Array), intent(inout) :: scatau ! sct. AOT at 550 nm + type(Chem_Array), intent(inout) :: extcoef ! 3d ext. coefficient, 1/m + type(Chem_Array), intent(inout) :: scacoef ! 3d scat.coefficient, 1/m + type(Chem_Array), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter + type(Chem_Array), intent(inout) :: fluxu ! Column mass flux in x direction + type(Chem_Array), intent(inout) :: fluxv ! Column mass flux in y direction + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Calculates some simple 2d diagnostics from the NI fields +! Surface concentration (dry) +! Column mass load (dry) +! Extinction aot 550 (wet) +! Scattering aot 550 (wet) +! For the moment, this is hardwired. +! +! !REVISION HISTORY: +! +! 16APR2004, Colarco +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + character(len=*), parameter :: myname = 'NI_Compute_Diags' + integer :: i, j, k, n, n1, n2, ios, nch, idx + integer :: nNH3, nNH4a, nNO3an1, nNO3an2, nNO3an3 + real :: tau, ssa +! For now we do not try to explicitly resolve the PM fractions per bin; +! This could be implemented as in dust if we provide bin edges +! For now we simply use the first size bin of nitrate as the PM1 and PM2.5 +! component +! real :: fPMfm(nbins) ! fraction of bin with particles diameter < 1.0 um +! real :: fPM25(nbins) ! fraction of bin with particles diameter < 2.5 um + character(len=255) :: qname + real, dimension(i1:i2,j1:j2) :: tau470, tau870 + real :: ilam550, ilam470, ilam870 + logical :: do_angstrom + + +! Initialize local variables +! -------------------------- + n1 = w_c%reg%i_NI + n2 = w_c%reg%j_NI + + nNH3 = n1 + globalnNH3 - 1 + nNH4a = n1 + globalnNH4a - 1 + nNO3an1 = n1 + globalnNO3an1 - 1 + nNO3an2 = n1 + globalnNO3an2 - 1 + nNO3an3 = n1 + globalnNO3an3 - 1 + + nch = gcNI%mie_tables%nch + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + ilam470 = 0. + ilam870 = 0. + if(nch .gt. 1) then + do i = 1, nch + if ( gcNI%mie_tables%channels(i) .ge. 5.49e-7 .and. & + gcNI%mie_tables%channels(i) .le. 5.51e-7) ilam550 = i + if ( gcNI%mie_tables%channels(i) .ge. 4.69e-7 .and. & + gcNI%mie_tables%channels(i) .le. 4.71e-7) ilam470 = i + if ( gcNI%mie_tables%channels(i) .ge. 8.69e-7 .and. & + gcNI%mie_tables%channels(i) .le. 8.71e-7) ilam870 = i + enddo + endif + +! Determine if going to do Angstrom parameter calculation +! ------------------------------------------------------- + do_angstrom = .false. +! If both 470 and 870 channels provided (and not the same) then +! possibly will do Angstrom parameter calculation + if(ilam470 .ne. 0. .and. & + ilam870 .ne. 0. .and. & + ilam470 .ne. ilam870) do_angstrom = .true. + +! NH3 diagnostics +! --------------- +! Calculate the NH3 mass mixing ratio + if( associated(NH3mass%data3d) ) then + NH3mass%data3d = w_c%qa(nNH3)%data3d + endif +! Calculate the NH3 mass concentration + if( associated(NH3conc%data3d) ) then + NH3conc%data3d = w_c%qa(nNH3)%data3d*rhoa + endif +! Calculate the NH3 surface mass concentration + if( associated(NH3sfcmass%data2d) ) then + NH3sfcmass%data2d(i1:i2,j1:j2) = w_c%qa(nNH3)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + endif +! Calculate the NH3 column loading + if( associated(NH3colmass%data2d) ) then + NH3colmass%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + NH3colmass%data2d(i1:i2,j1:j2) & + = NH3colmass%data2d(i1:i2,j1:j2) + w_c%qa(nNH3)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + end do + endif + +! NH4 diagnostics +! --------------- +! Calculate the NH4 mass mixing ratio + if( associated(NH4mass%data3d) ) then + NH4mass%data3d = w_c%qa(nNH4a)%data3d + endif +! Calculate the NH4 mass concentration + if( associated(NH4conc%data3d) ) then + NH4conc%data3d = w_c%qa(nNH4a)%data3d*rhoa + endif +! Calculate the NH4 surface mass concentration + if( associated(NH4sfcmass%data2d) ) then + NH4sfcmass%data2d(i1:i2,j1:j2) = w_c%qa(nNH4a)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + endif +! Calculate the NH4 column loading + if( associated(NH4colmass%data2d) ) then + NH4colmass%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + NH4colmass%data2d(i1:i2,j1:j2) & + = NH4colmass%data2d(i1:i2,j1:j2) + w_c%qa(nNH4a)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + end do + endif + +! Nitrate mass diagnostics +! ----------------------------------------------- +! Calculate the nitrate surface mass concentration + if( associated(sfcmass%data2d) ) then + sfcmass%data2d(i1:i2,j1:j2) = 0. + do n = globalnNO3an1, globalnNO3an3 + sfcmass%data2d(i1:i2,j1:j2) & + = sfcmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n1+n-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + end do + endif + +! Calculate the nitrate column loading + if( associated(colmass%data2d) ) then + colmass%data2d(i1:i2,j1:j2) = 0. + do n = globalnNO3an1, globalnNO3an3 + do k = 1, km + colmass%data2d(i1:i2,j1:j2) & + = colmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n1+n-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + end do + end do + endif + +! Calculate the nitrate total mass concentration + if( associated(conc%data3d) ) then + conc%data3d(i1:i2,j1:j2,1:km) = 0. + do n = globalnNO3an1, globalnNO3an3 + conc%data3d(i1:i2,j1:j2,1:km) & + = conc%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n1+n-1)%data3d(i1:i2,j1:j2,1:km)*rhoa(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the nitrate total mass mixing ratio + if( associated(mass%data3d) ) then + mass%data3d(i1:i2,j1:j2,1:km) = 0. + do n = globalnNO3an1, globalnNO3an3 + mass%data3d(i1:i2,j1:j2,1:km) & + = mass%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n1+n-1)%data3d(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the PM2.5 diagnostics + n = nNO3an1 + if( associated(sfcmass25%data2d) ) & + sfcmass25%data2d(i1:i2,j1:j2) = w_c%qa(n)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + if( associated(colmass25%data2d) ) then + colmass25%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + colmass25%data2d(i1:i2,j1:j2) & + = colmass25%data2d(i1:i2,j1:j2) & + + w_c%qa(n)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + end do + endif + if( associated(conc25%data3d) ) & + conc25%data3d(i1:i2,j1:j2,1:km) = w_c%qa(n)%data3d(i1:i2,j1:j2,1:km)*rhoa(i1:i2,j1:j2,1:km) + if( associated(mass25%data3d) ) & + mass25%data3d(i1:i2,j1:j2,1:km) = w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) + +! Calculate the nitrate column mass flux in x direction + if( associated(fluxu%data2d) ) then + fluxu%data2d(i1:i2,j1:j2) = 0. + do n = globalnNO3an1, globalnNO3an3 + do k = 1, km + fluxu%data2d(i1:i2,j1:j2) & + = fluxu%data2d(i1:i2,j1:j2) & + + w_c%qa(n1+n-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*u(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the nitrate column mass flux in y direction + if( associated(fluxv%data2d) ) then + fluxv%data2d(i1:i2,j1:j2) = 0. + do n = globalnNO3an1, globalnNO3an3 + do k = 1, km + fluxv%data2d(i1:i2,j1:j2) & + = fluxv%data2d(i1:i2,j1:j2) & + + w_c%qa(n1+n-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*v(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the nitrate optical quantities +! ---------------------------------------- + if( associated(exttau%data2d) .or. associated(scatau%data2d) ) then + + if( associated(exttau%data2d) ) exttau%data2d(i1:i2,j1:j2) = 0. + if( associated(scatau%data2d) ) scatau%data2d(i1:i2,j1:j2) = 0. + + if( associated(exttau25%data2d) ) exttau25%data2d(i1:i2,j1:j2) = 0. + if( associated(scatau25%data2d) ) scatau25%data2d(i1:i2,j1:j2) = 0. + + if( associated(exttaufm%data2d) ) exttaufm%data2d(i1:i2,j1:j2) = 0. + if( associated(scataufm%data2d) ) scataufm%data2d(i1:i2,j1:j2) = 0. + + if( associated(extcoef%data3d)) extcoef%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(scacoef%data3d)) scacoef%data3d(i1:i2,j1:j2,1:km) = 0. + + do n = globalnNO3an1, globalnNO3an3 + +! Select the name for species + qname = trim(w_c%reg%vname(n+n1-1)) + idx = Chem_MieQueryIdx(gcNI%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(gcNI%mie_tables, idx, ilam550, & + w_c%qa(n1+n-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau, ssa=ssa) + +! Calculate the total ext. and scat. coefficients + if( associated(extcoef%data3d) ) then + extcoef%data3d(i,j,k) = extcoef%data3d(i,j,k) + & + tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + if( associated(scacoef%data3d) ) then + scacoef%data3d(i,j,k) = scacoef%data3d(i,j,k) + & + ssa * tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + +! Integrate in the vertical + if( associated(exttau%data2d) ) exttau%data2d(i,j) = exttau%data2d(i,j) + tau + if( associated(scatau%data2d) ) scatau%data2d(i,j) = scatau%data2d(i,j) + tau*ssa + if( n .eq. globalnNO3an1) then + if( associated(exttau25%data2d) ) exttau25%data2d(i,j) = exttau25%data2d(i,j) + tau + if( associated(scatau25%data2d) ) scatau25%data2d(i,j) = scatau25%data2d(i,j) + tau*ssa + if( associated(exttaufm%data2d) ) exttaufm%data2d(i,j) = exttaufm%data2d(i,j) + tau + if( associated(scataufm%data2d) ) scataufm%data2d(i,j) = scataufm%data2d(i,j) + tau*ssa + endif + + + enddo + enddo + enddo + + enddo ! nbins + + endif + + +! Calculate the 470-870 Angstrom parameter + if( associated(angstrom%data2d) .and. do_angstrom ) then + + angstrom%data2d(i1:i2,j1:j2) = 0. +! Set tau to small number by default + tau470(i1:i2,j1:j2) = tiny(1.0) + tau870(i1:i2,j1:j2) = tiny(1.0) + + do n = globalnNO3an1, globalnNO3an3 + +! Select the name for species + qname = trim(w_c%reg%vname(n+n1-1)) + idx = Chem_MieQueryIdx(gcNI%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + + call Chem_MieQuery(gcNI%mie_tables, idx, ilam470, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau470(i,j) = tau470(i,j) + tau + + call Chem_MieQuery(gcNI%mie_tables, idx, ilam870, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau870(i,j) = tau870(i,j) + tau + + enddo + enddo + enddo + + enddo ! nbins + angstrom%data2d(i1:i2,j1:j2) = & + -log(tau470(i1:i2,j1:j2)/tau870(i1:i2,j1:j2)) / & + log(470./870.) + endif + + rc = 0 + + end subroutine NI_Compute_Diags + + end subroutine NI_GridCompRun2_ + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: NI_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + subroutine NI_GridCompFinalize1_ ( gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(NI_GridComp1), intent(inout) :: gcNI ! Grid Component + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Import State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'NI_GridCompFinalize' + rc=0 + return + + end subroutine NI_GridCompFinalize1_ + + end module NI_GridCompMod + + +!----------------------------------------------------------------------- + +! Single Instance Wrapper + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: NI_SingleInstance_ --- Runs single instance of method +! +! !INTERFACE: +! + subroutine NI_SingleInstance_ ( Method_, instance, & + gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + Use NI_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! Input "function pointer" +! ----------------------- + interface + subroutine Method_ (gc, w, imp, exp, ymd, hms, dt, rcode ) + Use NI_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + type(NI_GridComp1), intent(inout) :: gc + type(Chem_Bundle), intent(in) :: w + type(ESMF_State), intent(inout) :: imp + type(ESMF_State), intent(inout) :: exp + integer, intent(in) :: ymd, hms + real, intent(in) :: dt + integer, intent(out) :: rcode + end subroutine Method_ + end interface + + integer, intent(in) :: instance ! instance number + + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(NI_GridComp1), INTENT(INOUT) :: gcNI ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the NI Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer n_NI, i_NI, j_NI + character(len=255) :: nh3_qname, nh4_qname, no3an1_qname, no3an2_qname, no3an3_qname + +! Save overall NI indices +! ----------------------- + n_NI = w_c%reg%n_NI + i_NI = w_c%reg%i_NI + j_NI = w_c%reg%j_NI + +! Save the name of the variables in this instance +! ----------------------------------------------- + nh3_qname = trim(w_c%reg%vname(i_NI + 5*(instance - 1))) + nh4_qname = trim(w_c%reg%vname(i_NI + 5*(instance - 1)+1)) + no3an1_qname = trim(w_c%reg%vname(i_NI + 5*(instance - 1)+2)) + no3an2_qname = trim(w_c%reg%vname(i_NI + 5*(instance - 1)+3)) + no3an3_qname = trim(w_c%reg%vname(i_NI + 5*(instance - 1)+4)) + +! Customize indices for this particular instance +! ---------------------------------------------- + w_c%reg%n_NI = 5 + w_c%reg%i_NI = i_NI + 5*(instance - 1) + w_c%reg%j_NI = i_NI + 5*(instance - 1) + 4 + w_c%reg%vname(i_NI + 5*(instance - 1)) = w_c%reg%vname(i_NI) + w_c%reg%vname(i_NI + 5*(instance - 1)+1) = w_c%reg%vname(i_NI+1) + w_c%reg%vname(i_NI + 5*(instance - 1)+2) = w_c%reg%vname(i_NI+2) + w_c%reg%vname(i_NI + 5*(instance - 1)+3) = w_c%reg%vname(i_NI+3) + w_c%reg%vname(i_NI + 5*(instance - 1)+4) = w_c%reg%vname(i_NI+4) + +! Execute the instance method +! --------------------------- + call Method_ ( gcNI, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! Restore the overall NI indices +! ------------------------------ + w_c%reg%vname(i_NI + 5*(instance - 1)) = nh3_qname + w_c%reg%vname(i_NI + 5*(instance - 1)+1) = nh4_qname + w_c%reg%vname(i_NI + 5*(instance - 1)+2) = no3an1_qname + w_c%reg%vname(i_NI + 5*(instance - 1)+3) = no3an2_qname + w_c%reg%vname(i_NI + 5*(instance - 1)+4) = no3an3_qname + w_c%reg%n_NI = n_NI + w_c%reg%i_NI = i_NI + w_c%reg%j_NI = j_NI + + end subroutine NI_SingleInstance_ + +!----------------------------------------------------------------------- diff --git a/ESMF/GOCART_GridComp/NI_GridComp/NI_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/NI_GridComp/NI_GridComp_ExtData.rc new file mode 100644 index 00000000..b38eb060 --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/NI_GridComp_ExtData.rc @@ -0,0 +1,36 @@ +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Nitrates +EMI_NH3_BB 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_nh3.006.%y4%m2%d2.nc4 + +EMI_NH3_AG 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none nh3_emis ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_nh3.agriculture.x3600_y1800_t12.2010.nc4 +EMI_NH3_EN 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none nh3_emis ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_nh3.energy.x3600_y1800_t12.2010.nc4 +EMI_NH3_IN 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none nh3_emis ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_nh3.industry.x3600_y1800_t12.2010.nc4 +EMI_NH3_RE 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none nh3_emis ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_nh3.residential.x3600_y1800_t12.2010.nc4 +EMI_NH3_TR 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none nh3_emis ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_nh3.transport.x3600_y1800_t12.2010.nc4 + +EMI_NH3_OC 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none emiss_ocn ExtData/PIESA/sfc/GEIA.emis_NH3.ocean.x576_y361.t12.20080715_12z.nc4 + +NITRATE_HNO3 'mol mol-1' Y N %y4-%m2-%d2T12:00:00 none 0.20 hno3 ExtData/PIESA/L72/GMI.vmr_HNO3.x144_y91.t12.2006.nc4 + +NI_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/NI_Registry.rc b/ESMF/GOCART_GridComp/NI_GridComp/NI_Registry.rc new file mode 100644 index 00000000..092dcd8f --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/NI_Registry.rc @@ -0,0 +1,81 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: NI + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# -----------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl|# Sub| Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# -----------|------------|-----|---|----|---|---|-----|--------------------------------- + NH3MASS | kg/kg | xyz | C | | | | | Ammonia Mass Mixing Ratio __ENSEMBLE__ + NH4MASS | kg/kg | xyz | C | | | | | Ammonium Aerosol Mass Mixing Ratio __ENSEMBLE__ + NIMASS | kg/kg | xyz | C | | | | | Nitrate Mass Mixing Ratio __ENSEMBLE__ + NIMASS25 | kg/kg | xyz | C | | | | | Nitrate Mass Mixing Ratio [PM2.5] __ENSEMBLE__ + HNO3CONC | kg m-3 | xyz | C | | | | | Nitric Acid Mass Concentration __ENSEMBLE__ + NH3CONC | kg m-3 | xyz | C | | | | | Ammonia Mass Concentration __ENSEMBLE__ + NH4CONC | kg m-3 | xyz | C | | | | | Ammonium Mass Concentration __ENSEMBLE__ + NICONC | kg m-3 | xyz | C | | | | | Nitrate Mass Concentration __ENSEMBLE__ + NICONC25 | kg m-3 | xyz | C | | | | | Nitrate Mass Concentration [PM2.5] __ENSEMBLE__ + NIEXTCOEF | m-1 | xyz | C | | | | | Nitrate Extinction Coefficient [550 nm] __ENSEMBLE__ + NISCACOEF | m-1 | xyz | C | | | | | Nitrate Scattering Coefficient [550 nm] __ENSEMBLE__ +# ...........|............|.....|...|....|...|...|.....|.................................. + NIPNO3AQ | kg m-2 s-1 | xy | | | | | | Nitrate Production from Aqueous Chemistry __ENSEMBLE__ + NIPNH4AQ | kg m-2 s-1 | xy | | | | | | Ammonium Production from Aqueous Chemistry __ENSEMBLE__ + NIPNH3AQ | kg m-2 s-1 | xy | | | | | | Ammonia Change from Aqueous Chemistry __ENSEMBLE__ + NIHT001 | kg m-2 s-1 | xy | | | | | | Nitrate Production from Het Chem Bin 001 __ENSEMBLE__ + NIHT002 | kg m-2 s-1 | xy | | | | | | Nitrate Production from Het Chem Bin 002 __ENSEMBLE__ + NIHT003 | kg m-2 s-1 | xy | | | | | | Nitrate Production from Het Chem Bin 003 __ENSEMBLE__ + NISD001 | kg m-2 s-1 | xy | | | | | | Nitrate Sedimentation Bin 001 __ENSEMBLE__ + NISD002 | kg m-2 s-1 | xy | | | | | | Nitrate Sedimentation Bin 002 __ENSEMBLE__ + NISD003 | kg m-2 s-1 | xy | | | | | | Nitrate Sedimentation Bin 003 __ENSEMBLE__ + NIDP001 | kg m-2 s-1 | xy | | | | | | Nitrate Dry Deposition Bin 001 __ENSEMBLE__ + NIDP002 | kg m-2 s-1 | xy | | | | | | Nitrate Dry Deposition Bin 002 __ENSEMBLE__ + NIDP003 | kg m-2 s-1 | xy | | | | | | Nitrate Dry Deposition Bin 003 __ENSEMBLE__ + NIWT001 | kg m-2 s-1 | xy | | | | | | Nitrate Wet Deposition Bin 001 __ENSEMBLE__ + NIWT002 | kg m-2 s-1 | xy | | | | | | Nitrate Wet Deposition Bin 002 __ENSEMBLE__ + NIWT003 | kg m-2 s-1 | xy | | | | | | Nitrate Wet Deposition Bin 003 __ENSEMBLE__ + NISV001 | kg m-2 s-1 | xy | | | | | | Nitrate Convective Scavenging Bin 001 __ENSEMBLE__ + NISV002 | kg m-2 s-1 | xy | | | | | | Nitrate Convective Scavenging Bin 002 __ENSEMBLE__ + NISV003 | kg m-2 s-1 | xy | | | | | | Nitrate Convective Scavenging Bin 003 __ENSEMBLE__ + NH3EM | kg m-2 s-1 | xy | | | | | | Ammonia Emission __ENSEMBLE__ + NH3DP | kg m-2 s-1 | xy | | | | | | Ammonia Dry Deposition __ENSEMBLE__ + NH3WT | kg m-2 s-1 | xy | | | | | | Ammonia Wet Deposition __ENSEMBLE__ + NH3SV | kg m-2 s-1 | xy | | | | | | Ammonia Convective Scavenging __ENSEMBLE__ + NH4SD | kg m-2 s-1 | xy | | | | | | Ammonium Settling __ENSEMBLE__ + NH4DP | kg m-2 s-1 | xy | | | | | | Ammonium Dry Deposition __ENSEMBLE__ + NH4WT | kg m-2 s-1 | xy | | | | | | Ammonium Wet Deposition __ENSEMBLE__ + NH4SV | kg m-2 s-1 | xy | | | | | | Ammonium Convective Scavenging __ENSEMBLE__ + HNO3SMASS | kg m-3 | xy | | | | | | Nitric Acid Surface Mass Concentration __ENSEMBLE__ + NH3SMASS | kg m-3 | xy | | | | | | Ammonia Surface Mass Concentration __ENSEMBLE__ + NH4SMASS | kg m-3 | xy | | | | | | Ammonium Surface Mass Concentration __ENSEMBLE__ + NISMASS | kg m-3 | xy | | | | | | Nitrate Surface Mass Concentration __ENSEMBLE__ + NISMASS25 | kg m-3 | xy | | | | | | Nitrate Surface Mass Concentration [PM2.5] __ENSEMBLE__ + HNO3CMASS | kg m-3 | xy | | | | | | Nitric Acid Column Mass Density __ENSEMBLE__ + NH3CMASS | kg m-3 | xy | | | | | | Ammonia Column Mass Density __ENSEMBLE__ + NH4CMASS | kg m-3 | xy | | | | | | Ammonium Column Mass Density __ENSEMBLE__ + NICMASS | kg m-2 | xy | | | | | | Nitrate Column Mass Density __ENSEMBLE__ + NICMASS25 | kg m-2 | xy | | | | | | Nitrate Column Mass Density [PM2.5] __ENSEMBLE__ + NIEXTTFM | 1 | xy | | | | | | Nitrate Extinction AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + NISCATFM | 1 | xy | | | | | | Nitrate Scattering AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + NIEXTT25 | 1 | xy | | | | | | Nitrate Extinction AOT [550 nm] - PM 2.5 um __ENSEMBLE__ + NISCAT25 | 1 | xy | | | | | | Nitrate Scattering AOT [550 nm] - PM 2.5 um __ENSEMBLE__ + NIEXTTAU | 1 | xy | | | | | | Nitrate Extinction AOT [550 nm] __ENSEMBLE__ + NISCATAU | 1 | xy | | | | | | Nitrate Scattering AOT [550 nm] __ENSEMBLE__ + NIANGSTR | 1 | xy | | | | | | Nitrate Angstrom parameter [470-870 nm] __ENSEMBLE__ + NIFLUXU | kg m-1 s-1 | xy | | | | | | Nitrate column u-wind mass flux __ENSEMBLE__ + NIFLUXV | kg m-1 s-1 | xy | | | | | | Nitrate column v-wind mass flux __ENSEMBLE__ +# -----------|------------|-----|---|----|---|---|-----|--------------------------------- + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/NR/NI_GridComp---full.rc b/ESMF/GOCART_GridComp/NI_GridComp/NR/NI_GridComp---full.rc new file mode 100755 index 00000000..a4bc3a6a --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/NR/NI_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file for NI parameters. +# Emission factors in kg species / kg emissions (DM or species) +# + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +NI_regions_indices: global + + +# Scavenging efficiency per bin [km-1] +fscav: 0.0 0.4 0.4 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.2695 0.2695 2.1 7.57 + +# Dry particle density [kg m-3] +particle_density: 1000 1769 1725 2200 2650 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 0.18 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 1.50e19 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 0.0118 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 2.0 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/NR/NI_GridComp.rc b/ESMF/GOCART_GridComp/NI_GridComp/NR/NI_GridComp.rc new file mode 100755 index 00000000..c0375a0e --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/NR/NI_GridComp.rc @@ -0,0 +1,19 @@ +# +# NI main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +NI_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/NI_GridComp/NR/NI_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/NI_GridComp/NR/NI_GridComp_ExtData.rc new file mode 100644 index 00000000..93fb1402 --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/NR/NI_GridComp_ExtData.rc @@ -0,0 +1,33 @@ +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +# Nitrates +EMI_NH3_BB 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/NR/Y%y4/M%m2/qfed2.emis_nh3.005.%y4%m2%d2.nc4 +EMI_NH3_AG 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_EN 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none emi_nh3 ExtData/MERRA2/sfc/edgar-v42.emis_nh3.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 +EMI_NH3_IN 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_RE 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_TR 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_OC 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none emiss_ocn ExtData/PIESA/sfc/GEIA.emis_NH3.ocean.x576_y361.t12.20080715_12z.nc4 + +NITRATE_HNO3 'mol mol-1' Y N %y4-%m2-%d2T12:00:00 none 0.20 hno3 ExtData/PIESA/L72/GMI.vmr_HNO3.x144_y91.t12.2006.nc4 +NI_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/PIESA/NI_GridComp---full.rc b/ESMF/GOCART_GridComp/NI_GridComp/PIESA/NI_GridComp---full.rc new file mode 100755 index 00000000..a4bc3a6a --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/PIESA/NI_GridComp---full.rc @@ -0,0 +1,33 @@ +# +# Resource file for NI parameters. +# Emission factors in kg species / kg emissions (DM or species) +# + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +NI_regions_indices: global + + +# Scavenging efficiency per bin [km-1] +fscav: 0.0 0.4 0.4 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.2695 0.2695 2.1 7.57 + +# Dry particle density [kg m-3] +particle_density: 1000 1769 1725 2200 2650 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 0.18 0.18 0.18 + +# Number of particles per kg mass +fnum: 1.50e19 1.50e19 1.50e19 1.50e19 1.50e19 + +# Number median radius [um] +particle_radius_number: 0.0118 0.0118 0.0118 0.0118 0.0118 + +# Sigma of lognormal number distribution +sigma: 2.0 2.0 2.0 2.0 2.0 + diff --git a/ESMF/GOCART_GridComp/NI_GridComp/PIESA/NI_GridComp.rc b/ESMF/GOCART_GridComp/NI_GridComp/PIESA/NI_GridComp.rc new file mode 100755 index 00000000..c0375a0e --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/PIESA/NI_GridComp.rc @@ -0,0 +1,19 @@ +# +# NI main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +NI_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/NI_GridComp/PIESA/NI_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/NI_GridComp/PIESA/NI_GridComp_ExtData.rc new file mode 100644 index 00000000..4b48ce6c --- /dev/null +++ b/ESMF/GOCART_GridComp/NI_GridComp/PIESA/NI_GridComp_ExtData.rc @@ -0,0 +1,33 @@ +# +# Sample resource file exemplifying the specification of an interface to +# boundary conditions, emissions and other external files. This resource +# file is meant to be read by the MAPL_ExtData Grid Component. +# + +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| + +# Nitrates +EMI_NH3_BB 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_nh3.005.%y4%m2%d2.nc4 +EMI_NH3_AG 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_EN 'kg m-2 s-1' N Y %y4-%m2-%d2T12:00:00 none none emi_nh3 ExtData/MERRA2/sfc/edgar-v42.emis_nh3.anthropogenic.x1152_y721.19700703T12z_20200703T00z.nc4 +EMI_NH3_IN 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_RE 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_TR 'kg m-2 s-1' Y Y - none none emi_nh3 /dev/null +EMI_NH3_OC 'kg m-2 s-1' Y Y %y4-%m2-%d2T12:00:00 none none emiss_ocn ExtData/PIESA/sfc/GEIA.emis_NH3.ocean.x576_y361.t12.20080715_12z.nc4 + +NITRATE_HNO3 'mol mol-1' Y N %y4-%m2-%d2T12:00:00 none 0.20 hno3 ExtData/PIESA/L72/GMI.vmr_HNO3.x144_y91.t12.2006.nc4 +NI_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% + diff --git a/ESMF/GOCART_GridComp/O3_GridComp/CMIP/O3_GridComp.rc b/ESMF/GOCART_GridComp/O3_GridComp/CMIP/O3_GridComp.rc new file mode 100644 index 00000000..2a5d767d --- /dev/null +++ b/ESMF/GOCART_GridComp/O3_GridComp/CMIP/O3_GridComp.rc @@ -0,0 +1,16 @@ +# +# Resource file for GOCART Ozone grid component. +# +# Parameterized chemistry +# ----------------------- +PCHEMs_file_name: /discover/nobackup/ltakacs/bcs/Ganymed-2_0_M/Shared/pchem.species.Clim_Prod_Loss.z_721x72.nc4 +pchem_clim_years: 1 + +# GMI chemistry +# ------------- +veg_file_name: ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +lai_file_name: ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc + +# Debug switch (1=yes or 0=no) +# ---------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/O3_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/O3_GridComp/CMakeLists.txt new file mode 100644 index 00000000..7a9dbb7d --- /dev/null +++ b/ESMF/GOCART_GridComp/O3_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this() + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-C\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/O3_GridComp/MERRA2/O3_GridComp.rc b/ESMF/GOCART_GridComp/O3_GridComp/MERRA2/O3_GridComp.rc new file mode 100644 index 00000000..2a5d767d --- /dev/null +++ b/ESMF/GOCART_GridComp/O3_GridComp/MERRA2/O3_GridComp.rc @@ -0,0 +1,16 @@ +# +# Resource file for GOCART Ozone grid component. +# +# Parameterized chemistry +# ----------------------- +PCHEMs_file_name: /discover/nobackup/ltakacs/bcs/Ganymed-2_0_M/Shared/pchem.species.Clim_Prod_Loss.z_721x72.nc4 +pchem_clim_years: 1 + +# GMI chemistry +# ------------- +veg_file_name: ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +lai_file_name: ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc + +# Debug switch (1=yes or 0=no) +# ---------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/O3_GridComp/NR/O3_GridComp.rc b/ESMF/GOCART_GridComp/O3_GridComp/NR/O3_GridComp.rc new file mode 100644 index 00000000..2a5d767d --- /dev/null +++ b/ESMF/GOCART_GridComp/O3_GridComp/NR/O3_GridComp.rc @@ -0,0 +1,16 @@ +# +# Resource file for GOCART Ozone grid component. +# +# Parameterized chemistry +# ----------------------- +PCHEMs_file_name: /discover/nobackup/ltakacs/bcs/Ganymed-2_0_M/Shared/pchem.species.Clim_Prod_Loss.z_721x72.nc4 +pchem_clim_years: 1 + +# GMI chemistry +# ------------- +veg_file_name: ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +lai_file_name: ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc + +# Debug switch (1=yes or 0=no) +# ---------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/O3_GridComp/O3_GridComp.rc b/ESMF/GOCART_GridComp/O3_GridComp/O3_GridComp.rc new file mode 100755 index 00000000..2a5d767d --- /dev/null +++ b/ESMF/GOCART_GridComp/O3_GridComp/O3_GridComp.rc @@ -0,0 +1,16 @@ +# +# Resource file for GOCART Ozone grid component. +# +# Parameterized chemistry +# ----------------------- +PCHEMs_file_name: /discover/nobackup/ltakacs/bcs/Ganymed-2_0_M/Shared/pchem.species.Clim_Prod_Loss.z_721x72.nc4 +pchem_clim_years: 1 + +# GMI chemistry +# ------------- +veg_file_name: ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +lai_file_name: ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc + +# Debug switch (1=yes or 0=no) +# ---------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/O3_GridComp/O3_GridCompMod.F90 b/ESMF/GOCART_GridComp/O3_GridComp/O3_GridCompMod.F90 new file mode 100644 index 00000000..0873000f --- /dev/null +++ b/ESMF/GOCART_GridComp/O3_GridComp/O3_GridCompMod.F90 @@ -0,0 +1,2510 @@ +#include "MAPL_Generic.h" +!------------------------------------------------------------------------- +!NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1, GEOS/DAS! +!------------------------------------------------------------------------- +!BOP + +! !MODULE: O3_GridCompMod + +! Grid Component class for parameterized Chemistry for ozone: + +! !INTERFACE: +! + + MODULE O3_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + + USE Chem_Mod ! Chemistry Base Class + USE Chem_StateMod ! Chemistry State + Use Chem_UtilMod, ONLY: pmaxmin ! Utilities + USE Chem_UtilMod, ONLY: Chem_UtilTroppFixer ! Fixes bad tropopause pressure values + USE m_inpak90 ! Resource file management + + USE Henrys_law_ConstantsMod, ONLY: get_HenrysLawCts + + IMPLICIT NONE + +! !PUBLIC TYPES: + + PRIVATE +#include "mpif.h" + + include "netcdf.inc" + + PUBLIC O3_GridComp ! The O3 object + +! !PUBLIC MEMBER FUNCTIONS: + + PUBLIC O3_GridCompSetServices + PUBLIC O3_GridCompInitialize + PUBLIC O3_GridCompRun + PUBLIC O3_GridCompFinalize + +! +! !DESCRIPTION: + +! This module implements a parameterized chemistry for ozone that includes +! dry deposition based on the GMIchem handling. + +! !REVISION HISTORY: + +! 2000 Nielsen Initial coding +! 4Mar2005 Nielsen Implementation of parameterized ozone chemistry +! 31Jan2011 Nielsen Add dry deposition and NetCDF reads from PCHEM + +!EOP +!------------------------------------------------------------------------- + + TYPE O3_GridComp + + LOGICAL :: DebugIsOn ! For echoing the state of the states + +! PCHEM climatology particulars +! ----------------------------- + CHARACTER(LEN=ESMF_MAXSTR) :: PCHEMfileName ! NetCDF file borrowed from PCHEM + + INTEGER :: NSPECIES = 7 ! Number of species. Usually in order + ! OX, N2O, CFC-11, CFC-12, CH4, HCFC-22, and H2O. + INTEGER :: climYears ! Number of years + INTEGER :: nlatsPCHEM ! Number of latitudes in climatology + INTEGER :: nlevsPCHEM ! Number of layers in climatology + INTEGER :: begClimYear ! First year in PCHEM climatology + INTEGER :: endClimYear ! Last year + INTEGER :: BCnymd + INTEGER :: PCnymd + + REAL, POINTER, DIMENSION(:) :: lats => null() ! Latitudes + REAL, POINTER, DIMENSION(:) :: levs => null() ! Layers + REAL, POINTER, DIMENSION(:,:,:,:) :: mnpl => null() ! Production rates and loss frequencies, O3 only + REAL, POINTER, DIMENSION(:,:,:) :: mncv => null() ! Concentration (mole fraction), O3 only + +! Dry deposition borrowed from GMIchem +! ------------------------------------ + INTEGER, ALLOCATABLE :: ireg(:,:) + INTEGER, ALLOCATABLE :: iland(:,:,:) + INTEGER, ALLOCATABLE :: iuse(:,:,:) + REAL, ALLOCATABLE :: xlai(:,:,:) + + CHARACTER(LEN=ESMF_MAXSTR) :: GMIvegFileName + CHARACTER(LEN=ESMF_MAXSTR) :: GMIlaiFileName + +! ---------------- +! Ozone parameters +! ---------------- + + REAL :: hstar = 0.01 + REAL :: oxidize = 1.00 + +! ------------------- +! Integer parameters. +! ------------------- + + INTEGER :: NPOLY = 20 ! Number of coefficients for polynomial fits + INTEGER :: NVEGTYPE = 74 ! Maximum number of surface types (Olson) + INTEGER :: NTYPE = 15 ! maximum number of vegetation types in a cell + INTEGER :: NWATER = 6 + +! ---------------- +! Real parameters. +! ---------------- + + REAL :: KGPG = 0.001 ! Kilograms per gram + + LOGICAL :: firstRun + + END TYPE O3_GridComp + +CONTAINS + + subroutine O3_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: rcbasen = 'O3_GridComp' + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + type(O3_GridComp) :: gcO3 + integer :: ic + CHARACTER(LEN= 3 ) :: vegID + CHARACTER(LEN=255) :: vegName + + + Iam = "O3_GridCompSetServices" + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'O3_ireg', & + LONG_NAME = 'O3_emissions' , & + UNITS = 'kg s-1 m-2', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + do ic = 1, gcO3%NTYPE + + WRITE(vegID,'(I3.3)') ic + + vegName = 'O3_iuseVegID'//vegID + call MAPL_AddImportSpec(GC, & + SHORT_NAME = trim(vegName), & + LONG_NAME = 'O3_emissions' , & + UNITS = 'kg s-1 m-2', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + vegName = 'O3_ilandVegID'//vegID + call MAPL_AddImportSpec(GC, & + SHORT_NAME = trim(vegName), & + LONG_NAME = 'O3_emissions' , & + UNITS = 'kg s-1 m-2', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + vegName = 'O3_laiVegID'//vegID + call MAPL_AddImportSpec(GC, & + SHORT_NAME = trim(vegName), & + LONG_NAME = 'O3_emissions' , & + UNITS = 'kg s-1 m-2', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + enddo + + RETURN_(ESMF_SUCCESS) + + end subroutine O3_GridCompSetServices + +!------------------------------------------------------------------------- +!NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1, GEOS/DAS! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: O3_GridCompInitialize --- Initialize O3_GridComp +! +! !INTERFACE: +! + + SUBROUTINE O3_GridCompInitialize ( gcO3, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT none + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), INTENT(IN) :: w_c ! Chemical tracer fields, delp, + + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemistry time step (secs) + +! !OUTPUT PARAMETERS: + + TYPE(O3_GridComp), INTENT(INOUT) :: gcO3 ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + +! !DESCRIPTION: Initializes the O3 Grid Component. + +! !REVISION HISTORY: + +! 18Sep2003 da Silva First crack. +! 4Mar2005 Nielsen Implementation of parameterized ozone chemistry +! 31Jan2011 Nielsen Add dry deposition and NetCDF reads from PCHEM + +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'O3_GridCompInitialize' + CHARACTER(LEN=ESMF_MAXSTR) :: rcFileName = 'O3_GridComp.rc' + + TYPE(ESMF_VM) :: vm + + INTEGER :: n, status + INTEGER :: i, i1, i2, ic, im, j, j1, j2, jm, km + REAL :: c1,c2,c3,c4 + + REAL, ALLOCATABLE :: veg2D(:,:) + CHARACTER(LEN= 3) :: vegID + CHARACTER(LEN=15) :: vegName + + gcO3%BCnymd = -1 + gcO3%PCnymd = -1 + gcO3%firstRun = .true. + +! Grab the virtual machine +! ------------------------ + CALL ESMF_VMGetCurrent(vm, RC=status) + VERIFY_(status) + +! Initialize local variables +! -------------------------- + rc = 0 + status = 0 + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + im = w_c%grid%im + + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jm = w_c%grid%jm + + km = w_c%grid%km + +! Load resource file +! ------------------ + CALL I90_loadf(TRIM(rcFileName), status) + VERIFY_(status) + +! Parse resource file +! ------------------- + CALL I90_label("DEBUG:", status) + VERIFY_(status) + i = I90_gint(status) + VERIFY_(status) + IF(i == 0) THEN + gcO3%DebugIsOn = .FALSE. + ELSE + gcO3%DebugIsOn = .TRUE. + END IF + + CALL I90_label("PCHEMs_file_name:", status) + VERIFY_(status) + CALL I90_Gtoken(gcO3%PCHEMfileName, status) + VERIFY_(status) + + CALL I90_label("pchem_clim_years:", status) + VERIFY_(status) + gcO3%climYears = I90_gint(status) + VERIFY_(status) + +! PCHEM: Perform the initialization for +! establishing the production rates and loss frequencies +! ------------------------------------------------------ + CALL setUpPandL(RC=status) + VERIFY_(status) + _ASSERT(gcO3%nlevsPCHEM == km,'needs informative message') + +! GMIchem: Obtain static vegetation properties for dry deposition +! --------------------------------------------------------------- + CALL I90_label("veg_file_name:", status) + VERIFY_(status) + CALL I90_Gtoken(gcO3%GMIvegFileName, status) + VERIFY_(status) + CALL I90_label("lai_file_name:", status) + VERIFY_(status) + CALL I90_Gtoken(gcO3%GMIlaiFileName, status) + VERIFY_(status) + + ALLOCATE(gcO3%ireg (i1:i2, j1:j2), STAT=status) + VERIFY_(status) + ALLOCATE(gcO3%iland(i1:i2, j1:j2, gcO3%NTYPE), STAT=status) + VERIFY_(status) + ALLOCATE(gcO3%iuse (i1:i2, j1:j2, gcO3%NTYPE), STAT=status) + VERIFY_(status) + ALLOCATE(gcO3%xlai (i1:i2, j1:j2, gcO3%NTYPE), STAT=status) + VERIFY_(status) + gcO3%ireg = 0 + gcO3%iland = 0 + gcO3%iuse = 0 + +! Get Henrys Law cts for parameterized convective wet removal +! ----------------------------------------------------------- + CALL get_HenrysLawCts('O3',c1,c2,c3,c4) + w_c%reg%Hcts(1,w_c%reg%i_O3 : w_c%reg%j_O3)=c1 + w_c%reg%Hcts(2,w_c%reg%i_O3 : w_c%reg%j_O3)=c2 + w_c%reg%Hcts(3,w_c%reg%i_O3 : w_c%reg%j_O3)=c3 + w_c%reg%Hcts(4,w_c%reg%i_O3 : w_c%reg%j_O3)=c4 + + RETURN + +CONTAINS + +!------------------------------------------------------------------------- +!NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1, GEOS/DAS! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: setUpPandL +! +! !INTERFACE: +! + SUBROUTINE setUpPandL(rc) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS + +! !OUTPUT PARAMETERS: + + INTEGER, OPTIONAL, INTENT(OUT) :: rc ! Error return code: + +! !DESCRIPTION: Read PCHEM's NetCDF file and distribute. Code borrowed from +! GEOS\_PChemGridComp.F90 with minor modifications. For use +! with one-year datasets ONLY! + +! !REVISION HISTORY: + +!EOP +!------------------------------------------------------------------------- + + INTEGER :: dimid, varid, nspecies, comm, info, climYears, unit + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'O3_GridCompInitialize::setUpPandL' + + rc = 0 + +! Get the communicator from the virtual machine and open the PCHEM file +! --------------------------------------------------------------------- + CALL ESMF_VMGet(vm, MPICOMMUNICATOR=comm, RC=status) + VERIFY_(status) + +#undef H5_HAVE_PARALLEL +#ifdef H5_HAVE_PARALLEL + + CALL MPI_Info_create(info, status) + VERIFY_(status) + CALL MPI_Info_set(info, "romio_cb_read", "automatic", status) + VERIFY_(status) + +#ifdef NETCDF_NEED_NF_MPIIO + status = NF_OPEN_PAR(TRIM(gcO3%PCHEMfileName), IOR(NF_NOWRITE,NF_MPIIO), comm, info, unit) +#else + status = NF_OPEN_PAR(TRIM(gcO3%PCHEMfileName), NF_NOWRITE, comm, info, unit) +#endif + +#else + + IF(MAPL_AM_I_ROOT(vm) ) THEN + STATUS = NF_OPEN(TRIM(gcO3%PCHEMfileName), NF_NOWRITE, unit) + +#endif + + IF(status /= NF_NOERR) THEN + PRINT *,"Error opening file ",TRIM(gcO3%PCHEMfileName), status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + +! Obtain dimensions of the latitudes, layers, and species in the PCHEM file +! ------------------------------------------------------------------------- + status = NF_INQ_DIMID(unit, 'lat', dimid) + IF(status /= NF_NOERR) THEN + PRINT *,"Error getting dimid for lat", status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + status = NF_INQ_DIMLEN(unit, dimid, gcO3%nlatsPCHEM) + IF(status /= nf_noerr) then + PRINT *,"Error getting dimlen for lat", status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + status = NF_INQ_DIMID(unit, 'lev', dimid) + IF(status /= nf_noerr) THEN + PRINT *,"Error getting dimid for lev", status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + status = NF_INQ_DIMLEN(unit, dimid, gcO3%nlevsPCHEM) + IF(status /= nf_noerr) THEN + PRINT *,"Error getting dimlen for lev", status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + status = NF_GET_ATT_INT(unit, NF_GLOBAL, 'NSPECIES', nspecies) + IF(status /= nf_noerr) THEN + PRINT *,"Error getting nspecies", status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + _ASSERT(gcO3%NSPECIES == nspecies,'needs informative message') + +! Validate the length of the climatology +! -------------------------------------- + gcO3%begClimYear = 1 + gcO3%endClimYear = 1 + +#ifndef H5_HAVE_PARALLEL + END IF ! MAPL_am_I_root + + CALL MAPL_CommsBcast(vm, gcO3%nlatsPCHEM, 1, 0, RC=status) + VERIFY_(status) + CALL MAPL_CommsBcast(vm, gcO3%nlevsPCHEM, 1, 0, RC=status) + VERIFY_(status) + CALL MAPL_CommsBcast(vm, gcO3%begClimYear, 1, 0, RC=status) + VERIFY_(status) + CALL MAPL_CommsBcast(vm, gcO3%endClimYear, 1, 0, RC=status) + VERIFY_(status) + +#endif + +! Allocate and broadcast the latitudes and layers +! ----------------------------------------------- + ALLOCATE(gcO3%lats(gcO3%nlatsPCHEM), STAT=status) + VERIFY_(status) + ALLOCATE(gcO3%levs(gcO3%nlevsPCHEM), STAT=status) + VERIFY_(status) + +#ifndef H5_HAVE_PARALLEL + IF ( MAPL_AM_I_ROOT(vm) ) THEN +#endif + + status = NF_INQ_VARID(unit, 'lat', varid) + IF(status /= NF_NOERR) THEN + PRINT *,"Error getting varid for lat", status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + status = NF_GET_VAR_REAL(unit, varid, gcO3%lats) + IF(status /= NF_NOERR) THEN + PRINT *,'Error getting values for lat', status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + status = NF_INQ_VARID(unit, 'lev', varid) + IF(status /= NF_NOERR) THEN + PRINT *,"Error getting varid for lev", status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + status = NF_GET_VAR_REAL(unit, varid, gcO3%levs) + IF(status /= NF_NOERR) THEN + PRINT *,"Error getting values for lev", status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + +#ifdef H5_HAVE_PARALLEL + + CALL MPI_Info_free(info, status) + VERIFY_(status) + +#else + + status = NF_CLOSE(unit) + VERIFY_(status) + + END IF ! MAPL_am_I_root + + CALL MAPL_CommsBcast(vm, gcO3%lats, SIZE(gcO3%lats), 0, RC=status) + VERIFY_(status) + CALL MAPL_CommsBcast(vm, gcO3%levs, SIZE(gcO3%levs), 0, RC=status) + VERIFY_(status) + +#endif + +! Allocate space for concentration and production rates and +! loss frequencies. Note that we will be working with ozone only. +!---------------------------------------------------------------- + ALLOCATE(gcO3%mncv(gcO3%nlatsPCHEM, gcO3%nlevsPCHEM, 2), STAT=status) + VERIFY_(status) + gcO3%mncv = Z'7FA00000' + + ALLOCATE(gcO3%mnpl(gcO3%nlatsPCHEM, gcO3%nlevsPCHEM, 2, 2), STAT=status) + VERIFY_(status) + gcO3%mnpl = Z'7FA00000' + + rc = 0 + + RETURN + END SUBROUTINE setUpPandL + + END SUBROUTINE O3_GridCompInitialize + +!------------------------------------------------------------------------- +!NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3, GEOS/DAS! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: O3_GridCompRun --- The O3 run method +! +! !INTERFACE: +! + + SUBROUTINE O3_GridCompRun ( gcO3, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT none + +! !INPUT/OUTPUT PARAMETERS: + + TYPE(O3_GridComp), INTENT(INOUT) :: gcO3 ! Grid Component + TYPE(Chem_Bundle), INTENT(INOUT) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements a parameterized chemistry for +! ozone. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 4Mar2005 Nielsen Implementation of parameterized ozone chemistry +! 31Jan2012 Nielsen Revisions for running dry deposition plagarized +! from GMIChem +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'O3_GridCompRun' + TYPE(ESMF_VM) :: vm + +! Local +! ----- + INTEGER :: BCymd, BChms + INTEGER :: i1, i2, ic, im, i, j, j1, j2, jm, km, ixj + INTEGER :: k, n + INTEGER :: nCells + INTEGER :: nFirstO3, numberO3s + INTEGER :: status + + REAL :: qmin, qmax + REAL, PARAMETER :: von_karman = 0.40 ! von Karman constant + REAL, PARAMETER :: DOBSONS_PER_MOLE = MAPL_AVOGAD/2.69E+20 + +! Input fields from fvGCM +! ----------------------- + REAL, POINTER, DIMENSION(:,:) :: cldtt => null() + REAL, POINTER, DIMENSION(:,:) :: lwi => null() + REAL, POINTER, DIMENSION(:,:) :: pblh => null() + REAL, POINTER, DIMENSION(:,:) :: swndsrf => null() + REAL, POINTER, DIMENSION(:,:) :: shFlux => null() + REAL, POINTER, DIMENSION(:,:) :: srfAirT => null() + REAL, POINTER, DIMENSION(:,:) :: tropp => null() + REAL, POINTER, DIMENSION(:,:) :: ustar => null() + REAL, POINTER, DIMENSION(:,:) :: z0h => null() + REAL, POINTER, DIMENSION(:,:,:) :: ple => null() + REAL, POINTER, DIMENSION(:,:,:) :: T => null() + REAL, POINTER, DIMENSION(:,:,:) :: rhoa => null() + REAL, POINTER, DIMENSION(:,:,:) :: zle => null() + +! Quantities to be exported +! ------------------------- + REAL, POINTER, DIMENSION(:,:) :: o3tot => null() + REAL, POINTER, DIMENSION(:,:) :: o3ddp => null() + REAL, POINTER, DIMENSION(:,:) :: o3ddv => null() + REAL, POINTER, DIMENSION(:,:,:) :: o3 => null() + REAL, POINTER, DIMENSION(:,:,:) :: ox => null() + REAL, POINTER, DIMENSION(:,:,:) :: o3ppmv => null() + REAL, POINTER, DIMENSION(:,:,:) :: o3tend => null() + REAL, POINTER, DIMENSION(:,:,:) :: oxtend => null() + + REAL, ALLOCATABLE :: initialO3(:,:,:) + REAL, ALLOCATABLE :: plPa(:,:,:) + REAL, ALLOCATABLE :: cellDepth(:,:) + REAL, ALLOCATABLE :: obk(:,:) + REAL, ALLOCATABLE :: dvel(:,:) + REAL, ALLOCATABLE :: dryDepFreq(:,:) + REAL, ALLOCATABLE :: dO3(:,:) + INTEGER, ALLOCATABLE :: oro(:,:) + + REAL, ALLOCATABLE :: lai2D(:,:) + CHARACTER(LEN= 3) :: laiID + CHARACTER(LEN= 3) :: vegID + CHARACTER(LEN=15) :: laiName + CHARACTER(LEN=255) :: vegName + real, pointer :: ptr2d(:,:) => null() + +! -------------------------------------------------------------------- +! IDEP : deposition surface type for each Olson surface type +! IRAC : resistance that depends on canopy height and density (s^-1) +! IRCLO : resistance for leaves, twig, bark in lower canopy (s^-1) +! IRCLS : resistance for leaves, twig, bark in lower canopy (s^-1) +! IRGSO : ground resistance (s^-1) +! IRGSS : ground resistance (s^-1) +! IRI : internal resistance (s^-1) +! IRLU : cuticular resistance (s^-1) +! IWATER : id's for surface types that are water +! IZO : roughness height (m/10000) +! NWATER : number of Olson's surface types that are water +! -------------------------------------------------------------------- + + INTEGER, PARAMETER :: NPOLY = 20 ! Number of coefficients for polynomial fits + INTEGER, PARAMETER :: NVEGTYPE = 74 ! Maximum number of surface types (Olson) + INTEGER, PARAMETER :: NTYPE = 15 ! maximum number of vegetation types in a cell + + INTEGER, PARAMETER :: IDEP(NVEGTYPE) = (/ & + 11, 10, 5, 1, 1, 1, 2, 1, 8, 1, & + 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, & + 3, 3, 3, 3, 2, 2, 2, 3, 2, 2, & + 4, 4, 2, 6, 1, 1, 9, 4, 4, 4, & + 5, 5, 5, 5, 5, 9, 5, 5, 5, 5, & + 8, 8, 5, 7, 6, 2, 2, 2, 2, 2, & + 3, 3, 3, 5, 5, 11, 11, 11, 11, 8, & + 1, 8, 9, 11 /) + + INTEGER, PARAMETER :: IRAC(NTYPE) = (/ & + 0, 2000, 2000, 200, 100, & + 2000, 0, 0, 300, 100, & + 0, 0, 0, 0, 0 /) + + INTEGER, PARAMETER :: IRCLO(NTYPE) = (/ & + 1000, 1000, 1000, 1000, 1000, & + 9999, 9999, 9999, 1000, 9999, & + 9999, 0, 0, 0, 0 /) + + INTEGER, PARAMETER :: IRCLS(NTYPE) = (/ & + 9999, 2000, 2000, 2000, 2000, & + 9999, 9999, 9999, 2500, 9999, & + 9999, 0, 0, 0, 0 /) + + INTEGER, PARAMETER :: IRGSO(NTYPE) = (/ & + 3500, 200, 200, 150, 200, & + 200, 340, 400, 1000, 300, & + 2000, 0, 0, 0, 0 /) + + INTEGER, PARAMETER :: IRGSS(NTYPE) = (/ & + 100, 500, 500, 150, 350, & + 200, 340, 1000, 0, 400, & + 0, 0, 0, 0, 0 /) + + INTEGER, PARAMETER :: IRI(NTYPE) = (/ & + 9999, 200, 400, 200, 200, & + 200, 200, 9999, 200, 9999, & + 9999, 0, 0, 0, 0 /) + + INTEGER, PARAMETER :: IRLU(NTYPE) = (/ & + 9999, 9000, 9000, 9000, 9000, & + 1000, 4000, 9999, 9000, 9999, & + 9999, 0, 0, 0, 0 /) + + INTEGER, PARAMETER :: IWATER(NVEGTYPE) = (/ & + 1, 66, 67, 68, 69, 74, 0, 0, 0, 0, & + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + 0, 0, 0, 0 /) + + INTEGER, PARAMETER :: IZO(NVEGTYPE) = (/ & + 1,10000, 50, 1000, 1000, 1000,10000, 1000, 1, 1000, & + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1, 1000, 1000, & + 10000,10000,10000,10000,10000,10000,10000,10000, 1000,10000, & + 1000, 1000, 1000,10000, 1000, 1000, 100, 1000, 1000, 1000, & + 100, 100, 100, 100, 100, 100, 1000, 1000, 1000, 1000, & + 100, 100, 100, 50,10000, 1000, 1000, 1000, 1000, 1000, & + 10000,10000,10000, 1000, 50, 1, 1, 1, 1, 10, & + 10, 1, 500, 1 /) + +! ------------------------------------------ +! DRYCOEFF : polynomial fitting coefficients +! ------------------------------------------ + + REAL, PARAMETER :: DRYCOEFF(NPOLY) = (/ & + -3.58E-01, 3.02E+00, 3.85E+00, -9.78E-02, -3.66E+00, & + 1.20E+01, 2.52E-01, -7.80E+00, 2.26E-01, 2.74E-01, & + 1.14E+00, -2.19E+00, 2.61E-01, -4.62E+00, 6.85E-01, & + -2.54E-01, 4.37E+00, -2.66E-01, -1.59E-01, -2.06E-01 /) + +! Grab the virtual machine +! ------------------------ + CALL ESMF_VMGetCurrent(vm, RC=status) + VERIFY_(status) + +! Grid specs from Chem_Bundle%grid +! -------------------------------- + rc = 0 + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + im = w_c%grid%im + + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jm = w_c%grid%jm + + km = w_c%grid%km + + ixj = (i2-i1+1)*(j2-j1+1) + +! Get pointers to imports +! ----------------------- + CALL MAPL_GetPointer(impChem, cldtt, 'CLDTT', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, lwi, 'LWI', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, pblh, 'ZPBL', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, shFlux, 'SH', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, swndsrf, 'SWNDSRF', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, srfAirT, 'TA', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, tropp, 'TROPP', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, ustar, 'USTAR', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, z0h, 'Z0H', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, ple, 'PLE', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, T, 'T', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, rhoa, 'AIRDENS', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(impChem, zle, 'ZLE', RC=status) + VERIFY_(status) + + IF(gcO3%DebugIsOn) THEN + CALL pmaxmin('O3: cldtt', cldtt, qmin, qmax, ixj, 1, 1.) + CALL pmaxmin('O3: lwi', lwi, qmin, qmax, ixj, 1, 1.) + CALL pmaxmin('O3: pblh', pblh, qmin, qmax, ixj, 1, 1.) + CALL pmaxmin('O3: shFlux', shFlux, qmin, qmax, ixj, 1, 1.) + CALL pmaxmin('O3: swndsrf', swndsrf, qmin, qmax, ixj, 1, 1.) + CALL pmaxmin('O3: ustar', ustar, qmin, qmax, ixj, 1, 1.) + CALL pmaxmin('O3: tropp', tropp, qmin, qmax, ixj, 1, 1.) + CALL pmaxmin('O3: z0h', z0h, qmin, qmax, ixj, 1, 1.) + CALL pmaxmin('O3: ple', ple, qmin, qmax, ixj, km+1, 1.) + CALL pmaxmin('O3: T', T, qmin, qmax, ixj, km, 1.) + CALL pmaxmin('O3: rhoa', rhoa, qmin, qmax, ixj, km, 1.) + CALL pmaxmin('O3: zle', zle, qmin, qmax, ixj, km+1, 1.) + CALL pmaxmin('O3: srfAirT', srfAirT, qmin, qmax, ixj, 1, 1.) + END IF + +! Get pointers to exports +! ----------------------- + CALL MAPL_GetPointer(expChem, o3, 'O3', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(expChem, ox, 'OX', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(expChem, o3tot, 'O3TOT', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(expChem, o3ddp, 'O3DDP', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(expChem, o3ddv, 'O3DDV', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(expChem, o3ppmv, 'O3PPMV', RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(expChem, o3tend, 'DO3DT' , RC=status) + VERIFY_(status) + CALL MAPL_GetPointer(expChem, oxtend, 'OX_TEND', RC=status) + VERIFY_(status) + + if (gcO3%firstRun) then + gcO3%firstRun = .false. + + vegName = 'O3_ireg' + call MAPL_GetPointer(impChem,ptr2d,vegName,rc=status) + VERIFY_(STATUS) + + gcO3%ireg(:,:) = INT(ptr2D(:,:)) + + DO ic = 1, gcO3%NTYPE + + WRITE(vegID,'(I3.3)') ic + + vegName = 'O3_iuseVegID'//vegID + call MAPL_GetPointer(impChem,ptr2d,vegName,rc=status) + VERIFY_(STATUS) + gcO3%iuse(:,:,ic) = INT(ptr2D(:,:)) + + vegName = 'O3_ilandVegID'//vegID + call MAPL_GetPointer(impChem,ptr2d,vegName,rc=status) + VERIFY_(STATUS) + gcO3%iland(:,:,ic) = INT(ptr2D(:,:)) + + END DO + +! Until the ireg = -1 issue is resolved, do the following bug fix +! --------------------------------------------------------------- + DO j = j1,j2 + DO i = i1,i2 + IF(gcO3%ireg(i,j) == -1) THEN + gcO3%iuse(i,j,1:gcO3%NTYPE) = 0 + gcO3%iland(i,j,1) = 1000 + gcO3%iland(i,j,2:gcO3%NTYPE) = 0 + END IF + END DO + END DO + WHERE(gcO3%ireg(:,:) == -1) gcO3%ireg(:,:) = 1 + + end if + + DO ic = 1, gcO3%NTYPE + + WRITE(laiID,'(I3.3)') ic + laiName = 'O3_laiVegID'//laiID + call MAPL_GetPointer(impChem,ptr2d,laiName,rc=status) + VERIFY_(STATUS) + gcO3%xlai(:,:,ic) = INT(ptr2D(:,:)) + + END DO + +! Save current O3 +! --------------- + ALLOCATE(initialO3(i1:i2,j1:j2,km),STAT=status) + VERIFY_(status) + n = w_c%reg%i_O3 + initialO3(:,:,:) = w_c%qa(n)%data3d(:,:,:) + +! Middle-layer pressures +! ---------------------- + ALLOCATE(plPa(i1:i2,j1:j2,km),STAT=status) + VERIFY_(status) + plPa = 0.50*(ple(:,:,0:km-1)+ple(:,:,1:km)) + IF(gcO3%DebugIsOn) THEN + CALL pmaxmin('O3: plPa', plPa, qmin, qmax, ixj, km, 1.) + END IF + +! Repair bad tropopause pressures, if any exist +! --------------------------------------------- + CALL Chem_UtilTroppFixer(i2, j2, tropp, VERBOSE=.TRUE., RC=status) + VERIFY_(status) + +! Perform parameterized production and loss chemistry +! --------------------------------------------------- + CALL doProdLoss(status) + VERIFY_(status) + +! Grab some memory +! ---------------- + ALLOCATE(cellDepth(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + ALLOCATE(obk(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + ALLOCATE(oro(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + ALLOCATE(dvel(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + ALLOCATE(dryDepFreq(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + ALLOCATE(dO3(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + +! Thickness of the surface layer +! ------------------------------ + cellDepth(:,:) = zle(:,:,km-1) - zle(:,:,km) + IF(gcO3%DebugIsOn) THEN + CALL pmaxmin('O3: cellDepth', cellDepth, qmin, qmax, ixj, 1, 1.) + END IF + +! Calculate the Obukhov length scale, obk. Code is from Colarco. +! If obk < 0 the air is unstable, and if OBK > 0 the air is stable. +! For sensible heat flux == 0, obk is set to a large value, 1.00E+05. +! ------------------------------------------------------------------- + WHERE(ABS(shflux) > 1.00E-32) + obk(:,:) = - rhoa(:,:,km) * MAPL_CP * T(:,:,km) * ustar**3. / (von_karman * MAPL_GRAV * shFlux) + ELSEWHERE + obk(:,:) = 1.00E+05 + END WHERE + +! Add one to the land-water-ice mask +! ---------------------------------- + oro(:,:) = lwi(:,:)+1 + dvel(:,:) = 0.00 + +! What is the deposition velocity [m s^{-1}]? +! ------------------------------------------- + DO j = j1,j2 + nCells = i2-i1+1 + CALL DeposVelo(nCells, j, swndsrf(:,j), srfAirT(:,j), w_c%cosz(:,j), gcO3%oxidize, & + gcO3%hstar, MAPL_O3MW, ustar(:,j), cellDepth(:,j)*0.50, obk(:,j), & + cldtt(:,j), oro(:,j), rhoa(:,j,km), dvel(:,j), rc) + IF(rc /= 0) THEN + PRINT *,TRIM(Iam)//": ERROR in GOCART::O3 DeposVelo" + status = rc + VERIFY_(status) + END IF + + END DO + + IF(gcO3%DebugIsOn) THEN + CALL pmaxmin('O3: dvel', dvel, qmin, qmax, ixj, 1, 1.) + END IF + +! Set a minimum value +! ------------------- + WHERE(dvel(:,:) < 1.00E-04) dvel(:,:) = 1.00E-04 + +! Fill export state for dry deposition speed [m s^{-1}] +! ----------------------------------------------------- + IF(ASSOCIATED(o3ddv)) o3ddv(:,:) = dvel(:,:) + +! Dry deposition frequency [s^{-1}] for the chemical removal term +! --------------------------------------------------------------- + dryDepFreq(:,:) = dvel(:,:)/cellDepth(:,:) + +! Concentration increment (mol/mol) +! --------------------------------- + n = w_c%reg%i_O3 + dO3(:,:) = w_c%qa(n)%data3d(:,:,km)*(1.00-EXP(-dryDepFreq(:,:)*cdt)) + WHERE(dO3(:,:) < 0.00) dO3(:,:) = 0.00 + +! Update concentration internal state: GOCART::OX, volume mixing ratio +! -------------------------------------------------------------------- + w_c%qa(n)%data3d(:,:,km) = w_c%qa(n)%data3d(:,:,km) - dO3(:,:) + IF(gcO3%DebugIsOn) THEN + CALL pmaxmin('O3: OX(ppmv)', w_c%qa(n)%data3d, qmin, qmax, ixj, km, 1.00E+06) + END IF + +! Fill export state for dry deposition [kg m^{-2} s^{-1}] +! ------------------------------------------------------- + IF(ASSOCIATED(o3ddp)) o3ddp(:,:) = dO3(:,:)*cellDepth(:,:)*rhoa(:,:,km)*MAPL_O3MW/(cdt*MAPL_AIRMW) + +! ------------------------------------------------------ +! Fill export states +! +! Name Units Contents +! ------- ------------------- -------------------------- +! O3 kg kg^{-1} Ozone mass fraction +! OX mol mol^{-1} Ozone volume mixing ratio* +! O3PPMV ppmv OX*1.00E+06 +! OX_TEND mol mol^{-1} s^{-1} Tendency +! O3_TEND kg kg^{-1} s^{-1} Tendency +! +! *OX is necessary so that CHEM sees an ANALYSIS_OX +! with the same name, irregardless of the PROVIDER. +! ------------------------------------------------------ + n = w_c%reg%i_O3 + + IF(ASSOCIATED(ox)) ox(i1:i2,j1:j2,1:km) = w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) + + DO k=1,km + + WHERE(plPa(:,:,k) < 100.00 .AND. w_c%cosz > 0.00) + dvel(:,:) = w_c%qa(n)%data3d(i1:i2,j1:j2,k)*EXP(-1.50*(LOG10(plPa(:,:,k))-2.00)**2) + ELSEWHERE + dvel(:,:) = w_c%qa(n)%data3d(i1:i2,j1:j2,k) + END WHERE + + IF(ASSOCIATED(o3)) o3(i1:i2,j1:j2,k) = dvel(i1:i2,j1:j2)*MAPL_O3MW/MAPL_AIRMW + IF(ASSOCIATED(o3ppmv)) o3ppmv(i1:i2,j1:j2,k) = dvel(i1:i2,j1:j2)*1.00E+06 + + END DO + +! Total ozone (Dobsons) +! --------------------- + IF(ASSOCIATED(o3tot)) THEN + o3tot(:,:) = 0.00 + DO k=1,km + o3tot(:,:) = o3tot(:,:)+w_c%qa(n)%data3d(i1:i2,j1:j2,k)*w_c%delp(:,:,k)*(DOBSONS_PER_MOLE/(MAPL_AIRMW*MAPL_GRAV)) + END DO + END IF + +! Ozone tendency +! -------------- + n = w_c%reg%i_O3 + IF(ASSOCIATED(oxtend)) oxtend(:,:,:) = (w_c%qa(n)%data3d(:,:,:)-initialO3(:,:,:))/cdt + IF(ASSOCIATED(o3tend)) o3tend(:,:,:) = (w_c%qa(n)%data3d(:,:,:)-initialO3(:,:,:))*MAPL_O3MW/(MAPL_AIRMW*cdt) + +! Clean up +! -------- + DEALLOCATE(plPa, STAT=status) + VERIFY_(status) + DEALLOCATE(obk, STAT=status) + VERIFY_(status) + DEALLOCATE(dvel, STAT=status) + VERIFY_(status) + DEALLOCATE(oro, STAT=status) + VERIFY_(status) + DEALLOCATE(dryDepFreq, STAT=status) + VERIFY_(status) + DEALLOCATE(dO3, STAT=status) + VERIFY_(status) + DEALLOCATE(cellDepth, STAT=status) + VERIFY_(status) + DEALLOCATE(initialO3, STAT=status) + VERIFY_(status) + + rc = 0 + + RETURN + +CONTAINS + +!------------------------------------------------------------------------- +!NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1, GEOS/DAS! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: doProdLoss +! +! Run the parameterized chemistry for Ox. Ozone is derived from Ox. +! +! !INTERFACE: +! + SUBROUTINE doProdLoss(rc) + +! !USES: + + IMPLICIT NONE + + INTEGER, OPTIONAL, INTENT(OUT) :: rc + +! !DESCRIPTION: +! +! This module implements a parameterized chemistry for ozone. The NetCDF +! file that contains the production rates and loss frequencies has coefficients +! for seven species, OX, N2O, CFC-11, CFC-12, CH4, HCFC-22, and H2O.\\ +! +! Advection produces the "intermediate" constituent distribution +! before this routine is called.\\ +! +! USAGE NOTES:\\ +! +! The resulting O3 mole fraction is the product of the Ox mole fraction +! multiplied by the O3-to-Ox ratio, ro3ox. At pressures greater than +! approximately 1 hPa, ro3ox = 1 everywhere. At pressures less than +! approximately 0.1 hPa, Ox is mostly O3 at night and ro3ox = 1. During +! the day, ro3ox in this region depends to first order on pressure.\\ +! +! Code is plagarized from GEOS\_PchemGridComp.F90 +! +! !REVISION HISTORY: +! +! 31Jan2011 Nielsen +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'O3_GridCompRun::doProdLoss' + + INTEGER :: i, j, k + INTEGER :: yy, mm, dd, indx1, indx2, daysThisMonth + INTEGER :: dimid, varid, comm, info, start(3), cnt(3), unit + INTEGER :: status + + INTEGER, ALLOCATABLE :: mask(:,:,:) + + REAL :: fac + + REAL, ALLOCATABLE :: Pi(:,:,:) + REAL, ALLOCATABLE :: Li(:,:,:) + REAL, ALLOCATABLE :: Pclim(:,:) + REAL, ALLOCATABLE :: Lclim(:,:) + REAL, ALLOCATABLE :: P1(:,:) + REAL, ALLOCATABLE :: L1(:,:) + + INTEGER, PARAMETER :: monthLength(12) = (/ 31,28,31,30,31,30,31,31,30,31,30,31 /) + + rc = 0 + yy = nymd/10000 + mm = (nymd-yy*10000)/100 + dd = nymd-yy*10000-mm*100 + + IF(dd < 16) THEN + indx1 = mm-1 + indx2 = mm + ELSE + indx1 = mm + indx2 = mm+1 + END IF + + IF(indx1 < 1) indx1 = 12 + IF(indx2 > 12) indx2 = 1 + + IF(mm == 2) THEN + daysThisMonth = 28 + IF(MOD(yy, 4) == 0) daysThisMonth = 29 + IF(MOD(yy,100) == 0) daysThisMonth = 28 + IF(MOD(yy,400) == 0) daysThisMonth = 29 + ELSE + daysThisMonth = monthLength(mm) + END IF + + IF(dd < 16) THEN + fac = 0.50*(1.00+(dd-1.00)/15.00) + ELSE + fac = 0.50*(1.00+(daysThisMonth+1.00-dd)/(daysThisMonth-15.00)) + END IF + + ChangeOfDay: IF(gcO3%PCnymd /= nymd) THEN + gcO3%PCnymd = nymd + + CALL ESMF_VMGet(vm, MPICOMMUNICATOR=comm, RC=status) + VERIFY_(status) + +#undef H5_HAVE_PARALLEL +#ifdef H5_HAVE_PARALLEL + + CALL MPI_Info_create(info, status) + VERIFY_(status) + CALL MPI_Info_set(info, "romio_cb_read", "automatic", status) + VERIFY_(status) + +#ifdef NETCDF_NEED_NF_MPIIO + status = NF_OPEN_PAR(TRIM(gcO3%PCHEMfileName), IOR(NF_NOWRITE,NF_MPIIO), comm, info, unit) +#else + status = NF_OPEN_PAR(TRIM(gcO3%PCHEMfileName), NF_NOWRITE, comm, info, unit) +#endif + +#else + IF(MAPL_AM_I_ROOT(vm) ) THEN + status = NF_OPEN(TRIM(gcO3%PCHEMfileName), NF_NOWRITE, unit) +#endif + IF(status /= NF_NOERR) THEN + PRINT *,"Error opening file ",TRIM(gcO3%PCHEMfileName), status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + + start(1) = 1 + start(2) = 1 + cnt(1) = gcO3%nlatsPCHEM + cnt(2) = gcO3%nlevsPCHEM + cnt(3) = 1 + + status = NF_INQ_VARID(unit, "OX_PROD", varid) + IF(status /= NF_NOERR) THEN + PRINT *,"Error getting varid for variable OX_PROD", status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + start(3) = indx1 + status = NF_GET_VARA_REAL(unit, varid, start, cnt, gcO3%mnpl(:,:,1,1)) + IF(status /= NF_NOERR) THEN + PRINT *,"Error reading lower bracket month for production ",status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + start(3) = indx2 + status = NF_GET_VARA_REAL(unit, varid, start, cnt, gcO3%mnpl(:,:,1,2)) + IF(status /= NF_NOERR) THEN + PRINT *,"Error reading upper bracket month for production ",status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + + status = NF_INQ_VARID(unit, "OX_LOSS", varid) + IF(status /= NF_NOERR) THEN + PRINT *,"Error getting varid for variable OX_LOSS", status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + start(3) = indx1 + status = NF_GET_VARA_REAL(unit, varid, start, cnt, gcO3%mnpl(:,:,2,1)) + IF(status /= NF_NOERR) THEN + PRINT *,"Error reading lower bracket month for loss ",status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + start(3) = indx2 + status = NF_GET_VARA_REAL(unit, varid, start, cnt, gcO3%mnpl(:,:,2,2)) + IF(status /= NF_NOERR) THEN + PRINT *,"Error reading upper bracket month for loss ",status + PRINT *, NF_STRERROR(status) + status = 1 + VERIFY_(status) + END IF + +#ifdef H5_HAVE_PARALLEL + CALL MPI_Info_free(info, status) + VERIFY_(status) +#else + status = NF_CLOSE(unit) + VERIFY_(status) + + END IF ! MAPL_am_I_root + + CALL MPI_Bcast(gcO3%mncv, SIZE(gcO3%mncv), MPI_REAL, 0, comm, status) + VERIFY_(status) + CALL MPI_Bcast(gcO3%mnpl, SIZE(gcO3%mnpl), MPI_REAL, 0, comm, status) + VERIFY_(status) +#endif + + END IF ChangeOfDay + + ALLOCATE(Pclim(gcO3%nlatsPCHEM,gcO3%nlevsPCHEM),STAT=status) + VERIFY_(status) + ALLOCATE(Lclim(gcO3%nlatsPCHEM,gcO3%nlevsPCHEM),STAT=status) + VERIFY_(status) + + ALLOCATE(P1(i1:i2,gcO3%nlevsPCHEM),STAT=status) + VERIFY_(status) + ALLOCATE(L1(i1:i2,gcO3%nlevsPCHEM),STAT=status) + VERIFY_(status) + + ALLOCATE(Pi(i1:i2,j1:j2,km),STAT=status) + VERIFY_(status) + ALLOCATE(Li(i1:i2,j1:j2,km),STAT=status) + VERIFY_(status) + + Pclim(:,:) = gcO3%mnpl(:,:,1,1)*fac + gcO3%mnpl(:,:,1,2)*(1.00-fac) + Lclim(:,:) = gcO3%mnpl(:,:,2,1)*fac + gcO3%mnpl(:,:,2,2)*(1.00-fac) + + DO j=j1,j2 + DO k=1,gcO3%nlevsPCHEM + CALL MAPL_Interp( P1(:,k), w_c%grid%lat(:,j), Pclim(:,k), gcO3%lats) + CALL MAPL_Interp( L1(:,k), w_c%grid%lat(:,j), Lclim(:,k), gcO3%lats) + END DO + DO i=i1,i2 + CALL MAPL_Interp( Pi(i,j,:), plPa(i,j,:), P1(i,:), gcO3%levs) + CALL MAPL_Interp( Li(i,j,:), plPa(i,j,:), L1(i,:), gcO3%levs) + END DO + END DO + +! Turn off in the troposphere +! --------------------------- + ALLOCATE(mask(i1:i2,j1:j2,1:km),STAT=status) + VERIFY_(status) + + mask = 0 + + DO k=1,km + WHERE(plPa(:,:,k) <= tropp(:,:)) mask(:,:,k) = 1 + WHERE(tropp(:,:) == MAPL_UNDEF) mask(:,:,k) = 0 + END DO + + n = w_c%reg%i_O3 + WHERE(mask == 1) w_c%qa(n)%data3d = (w_c%qa(n)%data3d + cdt*Pi)/(1.00 + cdt*Li) + + DEALLOCATE(mask, STAT=status) + VERIFY_(status) + DEALLOCATE(Pclim, STAT=status) + VERIFY_(status) + DEALLOCATE(Lclim, STAT=status) + VERIFY_(status) + DEALLOCATE(Pi, STAT=status) + VERIFY_(status) + DEALLOCATE(Li, STAT=status) + VERIFY_(status) + DEALLOCATE(P1, STAT=status) + VERIFY_(status) + DEALLOCATE(L1, STAT=status) + VERIFY_(status) + + RETURN + END SUBROUTINE doProdLoss + +!----------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DeposVelo +! + + !INTERFACE: + SUBROUTINE DeposVelo(npts, ij, radiat, tempk, suncos, f0, hstar, xmw, & + ustar, cz1, obk, cfrac, lsnow, rhoa, dvel, rc) + + IMPLICIT NONE + +! ---------------------- +! Argument declarations. +! ---------------------- + + !ARGUMENTS: + INTEGER, INTENT(IN) :: npts, ij + REAL, INTENT(IN) :: radiat(npts) + REAL, INTENT(IN) :: tempk (npts) + REAL, INTENT(IN) :: suncos(npts) + REAL, INTENT(IN) :: f0 + REAL, INTENT(IN) :: hstar + REAL, INTENT(IN) :: xmw + REAL, INTENT(IN) :: ustar (npts) ! Cannot be identically zero + REAL, INTENT(IN) :: cz1 (npts) + REAL, INTENT(IN) :: obk (npts) + REAL, INTENT(IN) :: cfrac (npts) + INTEGER, INTENT(IN) :: lsnow (npts) + REAL, INTENT(IN) :: rhoa (npts) + REAL, INTENT(OUT) :: dvel (npts) + INTEGER, INTENT(OUT):: rc + +!DESCRIPTION: +! This routine computes the dry deposition velocities using a +! resistance-in-series model. +! +! Routine reads data which: +! \begin{itemize} +! \item converts land type id to deposition surface type id +! \item gives roughness heights for each land type id +! \item identifies water land type id's, for stability and z0 calculations +! \item reads surface resistance data for each deposition surface type id +! \end{itemize} +! +! Changes from version 3.1 to version 3.2: +! \begin{itemize} +! \item In unstable atmospheres with |zlmo| < zo, as can happen occasionally +! under very low wind conditions with tall canopies, application of +! Monin-Obukhov similarity yields negative values for ra. This was a +! problem in version 3.1. In fact, Monin-Obukhov similarity does not +! apply under such conditions, so we now set ra to zero and let the +! boundary resistance rb define the overall aerodynamic resistance. +! Since rb varies inversely with u*, it will impose a large aerodynamic +! resistance under very low wind conditions. +! \item The range of applicability of stability correction functions to +! Monin-Obukhov similarity has been extended to -2.5 < z/zmo < 1.5, +! based on Figure 2 of Businger et al. [1971]. The range used to be +! -1 < z/zmo < 1 in version 3.1. +! \end{itemize} +! +! Literature cited: +! \begin{enumerate} +! \item Baldocchi, D.D., B.B. Hicks, and P. Camara, A canopy stomatal +! resistance model for gaseous deposition to vegetated surfaces, +! Atmos. Environ. 21, 91-101, 1987. +! \item Brutsaert, W., Evaporation into the Atmosphere, Reidel, 1982. +! Businger, J.A., et al., Flux-profile relationships in the atmospheric +! surface layer, J. Atmos. Sci., 28, 181-189, 1971. +! \item Dwight, H.B., Tables of integrals and other mathematical data, +! MacMillan, 1957. +! \item Guenther, A., and 15 others, A global model of natural volatile +! organic compound emissions, J. Geophys. Res., 100, 8873-8892, 1995. +! \item Hicks, B.B., and P.S. Liss, Transfer of SO2 and other reactive +! gases across the air-sea interface, Tellus, 28, 348-354, 1976. +! \item Jacob, D.J., and S.C. Wofsy, Budgets of reactive nitrogen, +! hydrocarbons, and ozone over the Amazon forest during the wet season, +! J. Geophys. Res., 95, 16737-16754, 1990. +! \item Jacob, D.J., and 9 others, Deposition of ozone to tundra, +! J. Geophys. Res., 97, 16473-16479, 1992. +! \item Levine, I.N., Physical Chemistry, 3rd ed., McGraw-Hill, New York, 1988. +! \item Munger, J.W., and 8 others, Atmospheric deposition of reactive +! nitrogen oxides and ozone in a temperate deciduous forest and a +! sub-arctic woodland, J. Geophys. Res., in press, 1996. +! \item Walcek, C.J., R.A. Brost, J.S. Chang, and M.L. Wesely, SO2, sulfate, +! and HNO3 deposition velocities computed using regional landuse and +! meteorological data, Atmos. Environ., 20, 949-964, 1986. +! \item Wang, Y.H., paper in preparation, 1996. +! \item Wesely, M.L, Improved parameterizations for surface resistance to +! gaseous dry deposition in regional-scale numerical models, +! Environmental Protection Agency Report EPA/600/3-88/025, +! Research Triangle Park (NC), 1988. +! \item Wesely, M.L., same title, Atmos. Environ., 23, 1293-1304, 1989. +! \end{enumerate} +! +!EOP +! +! ARGUMENTS +! npts : (i2-i1+1) from AGCM +! ij : Current value of 2nd index for ireg: range j1 <= ij <= j2 +! radiat : solar radiation (W*m^-2) +! tempk : surface air temperature (degK) +! suncos : cosine of solar zenith angle +! f0 : reactivity factor for oxidation of biological substances +! hstar : Henry's Law constant +! xmw : molecular weights; used to calculate molecular diffusivities +! (kg/mol) +! airosol : 0 => gas-phase species, 1 => aerosol species (0 for O3) +! ustar : friction velocity (m/s) +! cz1 : altitude at which deposition velocity is computed (m) +! obk : Monin-Obukhov length, set to 1.0E5 under neutral conditions (m). Cannot be zero. +! cfrac : fractional cloud cover +! lsnow : integer for snow and sea ice (1=>water, 2=>land, 3=>ice) +! dvel : deposition velocities (m/s) +! ireg : # of landtypes in grid square +! iland : land type id for elements ldt = 1, ireg; +! could be from any source, mapped to deposition surface id +! iuse : fraction of gridbox area occupied by land type elements (mil^-1) +! xlai : leaf area index of land type elements +! delh_298_over_r : temperature scaling term for Henry's law (GMI has 0.00 for O3) +! +!----------------------------------------------------------------------------- + +! ----------------------- +! Parameter declarations. +! ----------------------- + + REAL, PARAMETER :: XCKMAN = 0.40 + REAL, PARAMETER :: PRESS = 1.50E+05 + +! ---------------------- +! Variable declarations. +! ---------------------- + + LOGICAL :: is_found + LOGICAL :: lrgera(npts) ! T -> stable atmosphere; a high aerodynamic + ! resistance (ra = 1.0d4 m/s) is imposed; else + ! ra is calculated + + INTEGER :: idep1 + INTEGER :: ijloop + INTEGER :: iolson + INTEGER :: iw + INTEGER :: k + INTEGER :: ldt + INTEGER :: nwaterx + + REAL :: airden + REAL :: c1 + REAL :: ckustr + REAL :: corr1 + REAL :: cz ! altitude where deposition velocity is computed (m) + REAL :: dair + REAL :: dummy1, dummy2, dummy3, dummy4 + REAL :: md + REAL :: ra, rb + REAL :: rdc + REAL :: reyno + REAL :: schno + REAL :: stono + REAL :: ebr, eim, ein, r1 + REAL :: rix + REAL :: rt + REAL :: tempc1 ! surface air temperatures in degC + REAL :: tempk1 ! surface air temperatures in degK + REAL :: xnu + REAL :: z0obk + + REAL :: c1x ! total resistance to deposition for + ! each species (s/m) + REAL :: vd + REAL :: vk + + REAL :: henry_eff + + REAL :: rac (gcO3%NTYPE) + REAL :: rclo(gcO3%NTYPE) + REAL :: rcls(gcO3%NTYPE) + REAL :: rgso(gcO3%NTYPE) + REAL :: rgss(gcO3%NTYPE) + REAL :: ri (gcO3%NTYPE) + REAL :: rlu (gcO3%NTYPE) + + REAL :: zo (gcO3%NTYPE) ! roughness height for specific surface types (m) + + REAL :: rsurfc(gcO3%NTYPE) ! bulk surface resistance + +! ---------------- +! Begin execution. +! ---------------- + + rc = 0 + + dvel(1:npts) = 0.00 + +! -------------------------------------------------- +! In each grid cell ... +! -------------------------------------------------- + + IJLoopX: DO ijloop = 1, npts + + cz = cz1(ijloop) + airden = rhoa(ijloop) + + tempk1 = tempk(ijloop) + tempc1 = tempk1 - MAPL_TICE + vd = 0.00 + rsurfc(1:gcO3%NTYPE) = 0.00 + +! --------------------------------------------------------------------- +! Calculate the kinematic viscosity xnu (m^2/s) of air as a function of +! temperature. The kinematic viscosity is used to calculate the +! roughness heights over water surfaces and to diagnose whether such +! surfaces are aerodynamically rough or smooth using a Reynolds number +! criterion. The expression for the temperature dependence of xnu is +! from the Fortran code in Appendix II of Wesely [1988]. +! --------------------------------------------------------------------- + + c1 = tempk1 / MAPL_TICE + xnu = 0.151 * (c1**1.77) * 1.00E-04 + +! ----------------------------------------------------------------- +! Compute bulk surface resistance for gases. +! +! Adjust external surface resistances for temperature; +! from Wesely [1989], expression given in text on p. 1296. +! +! There is no evidence that the resistance continues to increase at +! temperatures below -18 C, so at colder temperatures, hold the +! resistance fixed. +! ----------------------------------------------------------------- + + rt = 1000.00 * EXP (-tempc1 - 4.00) + IF (tempc1 < -18.00) rt = 1.20E+09 + +! ------------------------------------------------------------------ +! Get surface resistances - loop over land types ldt. +! +! The land types within each grid square are defined using the Olson +! land type database. Each of the Olson land types is assigned a +! corresponding "deposition land type" with characteristic values of +! surface resistance components. There are 74 Olson land-types, but +! only 11 deposition land types (i.e., many of the Olson land types +! share the same deposition characteristics). Surface resistance +! components for the "deposition land types" are from Wesely [1989], +! except for tropical forests [Jacob and Wofsy, 1990] and for tundra +! [Jacob et. al., 1992]. All surface resistance components are +! normalized to a leaf area index of unity. +! +! Olson land types, deposition land types, and surface resistance +! components are read from the dry deposition file; check that file +! for further details. +! ------------------------------------------------------------------ + + LDTLoop1: DO ldt = 1, gcO3%ireg(ijloop,ij) + + IF (gcO3%iuse(ijloop,ij,ldt) == 0) CYCLE LDTLoop1 + + IF (lsnow(ijloop) == 3) THEN ! snow or ice + idep1 = 1 + ELSE + iolson = gcO3%iland(ijloop,ij,ldt) + 1 + idep1 = IDEP(iolson) + END IF + + CALL SurfaceResist(idep1, rac(ldt), rclo(ldt), rcls(ldt), rgso(ldt), & + rgss(ldt), ri(ldt), rlu(ldt), rt, tempc1, & + cfrac(ijloop), radiat(ijloop), suncos(ijloop), & + gcO3%xlai(ijloop,ij,ldt), rix) + +! ---------------------------------------------------------------- +! Compute aerodynamic resistance to lower elements in lower part +! of the canopy or structure, assuming level terrain; equation (5) +! of Wesely [1989]. +! ---------------------------------------------------------------- + + rdc = 100.00 * (1.00 + (1000.00 / (radiat(ijloop) + 10.00))) + + henry_eff = hstar + +! ----------------------------------------------------- +! Species-dependent corrections to resistances are from +! equations (6)-(9) of Wesely [1989]. +! ----------------------------------------------------- + + CALL CanopyResist(rdc, rix, airden, tempk1, f0, henry_eff, & + xmw, rac(ldt), rclo(ldt), rcls(ldt), rgso(ldt), & + rgss(ldt), rlu(ldt), rsurfc(ldt)) + +! ---------------------------------------------------- +! Set min and max values for bulk surface resistances. +! ---------------------------------------------------- + + rsurfc(ldt) = MAX (1.00, MIN (rsurfc(ldt), 9999.00)) + + END DO LDTLoop1 + + LDTLoop3: DO ldt = 1, gcO3%ireg(ijloop,ij) + +! ------------------------------------------------------- +! Loop through the different landuse types present in the +! grid square. +! ------------------------------------------------------- + + IF (gcO3%iuse(ijloop,ij,ldt) == 0) CYCLE LDTLoop3 + + iolson = gcO3%iland(ijloop,ij,ldt) + 1 + +! ------------------------------------------------------------- +! Get roughness heights; they are specified constants for each +! surface type, except over water where zo = f(u*). The latter +! dependence is from equation (6) of Hicks and Liss [1976]. +! ------------------------------------------------------------- + + nwaterx = gcO3%NWATER + is_found = .FALSE. + + IWLoop: DO iw = 1, nwaterx + + IF (iolson /= iwater(iw)) cycle IWLoop + + zo(ldt) = 1.40E-02 * ustar(ijloop) * ustar(ijloop) / 9.80 + & + 1.10E-01 * xnu / ustar(ijloop) + + is_found = .TRUE. + + EXIT IWLoop + + END DO IWLoop + + IF (.NOT. is_found) THEN + zo(ldt) = izo(iolson) + zo(ldt) = zo(ldt) * 1.00E-04 + END IF + +! ------------------------------------------------------------------ +! Get aerodynamic resistances ra and rb. +! +! The aerodynamic resistance ra is integrated from altitude z0+d up +! to the altitude z1, at which the dry deposition velocity is to be +! referenced. The integration corrects for stability using +! Monin-Obukhov similarity formulas from Businger et. al. [1971], +! which apply over the range -2.5 < z/zMO < 1.5 (see their +! Figure 2). Under very unstable conditions when z1 > -2.5 zMO, we +! assume that there is no resistance to transfer in the convective +! column between zmo and z1. Under very stable conditions when +! z1 > 1.5 zMO, we assume that vertical transfer in the column +! between zmo and z1 is strongly suppressed so that the deposition +! velocity at altitude z1 is very low. Under these conditions, we +! just specify a very large ra=1.0d4 s/m (lrgera = T). +! +! The Reynolds number reyno diagnoses whether a surface is +! aerodynamically rough (reyno > 10) or smooth. +! NOTE: The criterion "reyno > 10" is now replaced by "reyno > 1". + +! Surface is rough in all cases except over water with low wind +! speeds. In the smooth case, vertical transport IN THE SUBLAYER +! near the surface is limited by molecular diffusion and is +! therefore very slow; we assign a large value of ra + rb to +! account for this effect. (djj, hyl, bmy, 5/8/00) +! +! In the aerodynamically rough case, the expression for ra is as +! given in equation (5) of Jacob et. al. [1992]: +! ra = (1/ku*)*int(from z0 to z1) (phi(x)/z)dz +! where x = (z-d)/zmo, z is the height above ground, and d is the +! displacement height, which is typically 70-80% of the canopy +! height [Brutsaert, 1982]. We change the vertical coordinate so +! that z=0 at the displacement height; that's OK since for all +! practical applications, z1 >> d. In this manner, we don't need to +! assume any specific value for the displacement height. Applying +! the variable transformation z -> x = z/zmo, the equation above +! becomes: +! ra = (1/ku*)*int(from x0 to x1) (phi(x)/x)dx with x=z/zmo +! Here phi is a stability correction function originally formulated +! by Businger et. al. [1971] and given in eqns 5a and 5b of Jacob +! et. al. [1992]. +! For unstable conditions: +! phi(x) = a/sqrt(1-bx) where a=0.74, b = 9 +! The analytical solution to the integral is [Dwight, 1957, integral +! 192.11]: +! int(dx/(x*sqrt(1-bx))) = log(abs((sqrt(1-bx)-1)/(sqrt(1-bx)+1))) +! which yields the expression for ra used in the code for unstable +! conditions. +! For stable conditions, +! phi(x) = a + bx where a=0.74, b = 4.7 +! and the analytical solution to the integral is: +! int((a/x)+b)dx = a*ln(x) + bx +! which yields the expression of ra used in the code for stable +! conditions. +! +! The formulation of rb for gases is equation (12) of Walcek et. al. [1986]. +! -------------------------------------------------------------------------- + + ckustr = XCKMAN * ustar(ijloop) + + reyno = ustar(ijloop) * zo(ldt) / xnu + + IF(obk(ijloop) == 0.00) THEN + PRINT *,"Obukhov length scale cannot be zero." + rc = 1 + RETURN + END IF + + corr1 = cz / obk(ijloop) + + z0obk = zo(ldt) / obk(ijloop) + + lrgera(ijloop) = .FALSE. + + IF (corr1 > 1.50) lrgera(ijloop) = .TRUE. + IF (corr1 <= -2.50) corr1 = -2.50 + +! ------------------------------------------------------------------ +! Aerodynamically rough or smooth surface. +! +! In the classic study by Nikuradse (1933) the transition from +! smooth to rough was examined in pipe flow. He introduced a +! roughness Reynolds number rr = u* z0 / nu, and found the flow to +! be smooth for rr < 0.13, and rough for rr > 2.5, with a transition +! regime in between (E.B. Kraus and J.A. Businger, Atmosphere-Ocean +! Interaction, second edition, p.144-145, 1994). Similar statements +! can be found in the books: +! Evaporation into the Atmosphere, by Wilfried Brutsaert, p.59,89, +! 1982; or +! Seinfeld & Pandis, p.858, 1998. +! Here we assume a sudden transition point rr = 1 from smooth to +! rough, following L. Merlivat (1978, The dependence of bulk +! evaporation coefficients on air-water interfacial conditions as +! determined by the isotopic method, J. Geophys. Res., +! Oceans & Atmos., 83, C6, 2977-2980). Also refer to Brutsaert's +! book, p.125. we used to use the criterion "reyno > 10" for +! aerodynamically rough surface and now change to "reyno > 1". +! (hyl, 10/15/99) +! ------------------------------------------------------------------ + + RgeOne: IF (reyno >= 1.00) THEN + +! ------------------------------ +! Aerodynamically rough surface. +! ------------------------------ + + IF ((corr1 <= 0.00) .AND. (z0obk < -1.00)) THEN + +! ---------------------------------------- +! Unstable condition with Abs (zlmo) < Z0; +! set ra to zero (version 3.2). +! ---------------------------------------- + + ra = 0.00 + + ELSE IF ((corr1 <= 0.00) .and. (z0obk >= -1.00)) THEN + +! --------------------------------------------------- +! Unstable conditions; compute ra as described above. +! --------------------------------------------------- + + dummy1 = (1.00 - (9.00 * corr1))**0.50 + dummy2 = (1.00 - (9.00 * z0obk))**0.50 + + IF(ABS(dummy1) == 1.00 .OR. ABS(dummy2) .EQ. 1.00) THEN + ra = 0.00 + ELSE + dummy3 = ABS ((dummy1 - 1.00) / (dummy1 + 1.00)) + dummy4 = ABS ((dummy2 - 1.00) / (dummy2 + 1.00)) + ra = 0.740* (1.00 / ckustr) * LOG (dummy3 / dummy4) + END IF + + ELSE IF ((corr1 > 0.00) .AND. (.NOT. lrgera(ijloop))) THEN + +! ----------------------------------------- +! Moderately stable conditions (z/zmo < 1); +! compute ra as described above +! ----------------------------------------- + IF(ckustr == 0.00 .OR. corr1 == 0.00 .OR. z0obk == 0.00) THEN + rc = 2 + PRINT *,"Cannot calculate ra for moderately stable conditions" + RETURN + END IF + + ra = (1.00 / ckustr) * (0.740 * LOG (corr1 / z0obk) + & + 4.70 * (corr1 - z0obk)) + + ELSE IF (lrgera(ijloop)) THEN + +! ----------------------- +! Very stable conditions. +! ----------------------- + + ra = 1.00E+04 + + END IF + +! ------------------------------------------------------------ +! If ra is negative (as occasionally happened in version 3.1), +! set it to zero +! ------------------------------------------------------------ + + ra = MAX(0.00,ra) + +! ------------------------------------ +! Get total resistance for deposition. +! ------------------------------------ + +! ------------------------------------------------------------ +! dair is the thermal diffusivity of air; value of +! 0.2*1.E-4 m^2/s, cited on p. 16,476 of Jacob et. al. [1992]. +! ------------------------------------------------------------ + + dair = 0.20 * 1.00E-04 + CALL molDiff(tempk1, airden, xmw, md) + + IF(ckustr == 0.00 .OR. md == 0.00) THEN + rc = 3 + PRINT *,"Zero denominator for rb" + RETURN + END IF + + rb = (2.00 / ckustr) * (dair / md)**0.667 + c1x = ra + rb + rsurfc(ldt) + + ELSE + +! ------------------------------- +! Aerodynamically smooth surface. +! ------------------------------- + +! -------------------------------------------------------------- +! Suppress drydep over smooth surfaces by setting ra to a +! large value. This prevents negative dry deposition +! velocities when ustar is very small (djj, bmy, 5/8/00) +! -------------------------------------------------------------- + + ra = 1.00E+04 + c1x = ra + rsurfc(ldt) + + END IF RgeOne + +! ---------------------------------------------------------------- +! iuse is the fraction of the grid square occupied by surface ldt +! in units of mil^-1 (iuse=500 => 50% of the grid square). Add +! the contribution of surface type ldt to the deposition velocity; +! this is a loop over all surface types in the gridbox. +! ---------------------------------------------------------------- + + vd = vd + (0.001 * gcO3%iuse(ijloop,ij,ldt) / c1x) + + END DO LDTLoop3 + + dvel(ijloop) = vd + + END DO IJLoopX + + RETURN + END SUBROUTINE DeposVelo + +!----------------------------------------------------------------------------- +! +! ROUTINE +! CanopyResist +! +! DESCRIPTION +! This routine calculates bulk surface resistance of the canopy from the +! network of resistances in parallel and in series. +! +! ARGUMENTS +! rdc : tbd +! rix : +! airden : +! tempk1 : +! f01 : +! hstar1 : +! xmw1 : +! rac1 : +! rclo1 : +! rcls1 : +! rgso1 : +! rgss1 : +! rlu1 : +! rsurfc1 : +! +!----------------------------------------------------------------------------- + + SUBROUTINE CanopyResist(rdc, rix, airden, tempk1, f01, hstar1, & + xmw1, rac1, rclo1, rcls1, rgso1, rgss1, & + rlu1, rsurfc1) + + IMPLICIT NONE + +! ---------------------- +! Argument declarations. +! ---------------------- + + REAL, INTENT(IN) :: rdc + REAL, INTENT(IN) :: rix + REAL, INTENT(IN) :: airden + REAL, INTENT(IN) :: tempk1 + REAL, INTENT(IN) :: f01 + REAL, INTENT(IN) :: hstar1 + REAL, INTENT(IN) :: xmw1 + REAL, INTENT(IN) :: rac1 + REAL, INTENT(IN) :: rclo1 + REAL, INTENT(IN) :: rcls1 + REAL, INTENT(IN) :: rgso1 + REAL, INTENT(IN) :: rgss1 + REAL, INTENT(IN) :: rlu1 + REAL, INTENT(OUT) :: rsurfc1 + +! ----------------------- +! Parameter declarations. +! ----------------------- + + REAL, PARAMETER :: BIG1 = 1.00E+22 + +! ---------------------- +! Variable declarations. +! ---------------------- + + REAL :: dtmp1, dtmp2, dtmp3, dtmp4 + REAL :: mdw, mdx + REAL :: rclx + REAL :: rgsx + REAL :: rixx + REAL :: rluxx + +! ---------------- +! Begin execution. +! ---------------- + + CALL molDiff (tempk1, airden, MAPL_H2OMW, mdw) + CALL molDiff (tempk1, airden, xmw1, mdx) + + rixx = rix * (mdw/mdx) + 1.00/(hstar1/3000.00 + 100.00 * f01) + + IF (rlu1 < 9999.00) then + rluxx = rlu1 / (hstar1*1.00E-05 + f01) + ELSE + rluxx = BIG1 + END IF + +! --------------------------------------------------------------------- +! To prevent virtually zero resistance to species with huge HSTAR, such +! as HNO3, a minimum value of rluxx needs to be set. The rationality +! of the existence of such a minimum is demonstrated by the observed +! relationship between Vd(NOy-NOx) and ustar in Munger et. al. [1996]; +! Vd(HNO3) never exceeds 2 cm*s^-1 in observations. The corresponding +! minimum resistance is 50 s*m^-1. This correction was introduced by +! J.Y. Liang on 7/9/95. +! --------------------------------------------------------------------- + + rluxx = MAX (rluxx, 50.00) + + rgsx = 1.00 / (hstar1*1.00E-05 / rgss1 + f01 / rgso1) + rclx = 1.00 / (hstar1*1.00E-05 / rcls1 + f01 / rclo1) + +! ----------------------------------------------------------------------- +! Get the bulk surface resistance of the canopy, rsurfc, from the network +! of resistances in parallel and in series (Fig. 1 of Wesely [1989]). +! ----------------------------------------------------------------------- + + dtmp1 = 1.00 / rixx + dtmp2 = 1.00 / rluxx + dtmp3 = 1.00 / (rac1 + rgsx) + dtmp4 = 1.00 / (rdc + rclx) + + rsurfc1 = 1.00 / (dtmp1 + dtmp2 + dtmp3 + dtmp4) + + RETURN + END SUBROUTINE CanopyResist + +!----------------------------------------------------------------------------- +! +! ROUTINE +! SurfaceResist +! +! DESCRIPTION +! This routine tbd +! +! ARGUMENTS +! idep1 : +! rac1 : +! rclo1 : +! rcls1 : +! rgso1 : +! rgss1 : +! ri1 : +! rlu1 : +! rt : +! tempc1 : +! cfrac1 : +! radiat1 : +! suncos1 : +! xlai1 : +! rix : +! +!----------------------------------------------------------------------------- + + SUBROUTINE SurfaceResist(idep1, rac1, rclo1, rcls1, rgso1, rgss1, & + ri1, rlu1, rt, tempc1, cfrac1, radiat1, & + suncos1, xlai1, rix) + + IMPLICIT NONE + +! ---------------------- +! Argument declarations. +! ---------------------- + + INTEGER, INTENT(IN) :: idep1 + REAL, INTENT(OUT) :: rac1 + REAL, INTENT(OUT) :: rclo1 + REAL, INTENT(OUT) :: rcls1 + REAL, INTENT(OUT) :: rgso1 + REAL, INTENT(OUT) :: rgss1 + REAL, INTENT(OUT) :: ri1 + REAL, INTENT(OUT) :: rlu1 + REAL, INTENT(IN) :: rt + REAL, INTENT(IN) :: tempc1 + REAL, INTENT(IN) :: cfrac1 + REAL, INTENT(IN) :: radiat1 + REAL, INTENT(IN) :: suncos1 + REAL, INTENT(IN) :: xlai1 + REAL, INTENT(OUT) :: rix + +! ----------------------- +! Parameter declarations. +! ----------------------- + + REAL, PARAMETER :: BIG1 = 1.00E+06 + REAL, PARAMETER :: BIG2 = 1.00E+22 + +! ---------------------- +! Variable declarations. +! ---------------------- + + REAL :: gfaci, gfact, biofit + REAL :: xdrycoeff(gcO3%NPOLY) + +! ---------------- +! Begin execution. +! ---------------- + +! ---------------------------------------------------------------------- +! Read the internal resistance ri (minimum stomatal resistance for water +! vapor, per unit area of leaf) from the IRI array; a "9999" value means +! no deposition to stomata, so we impose a very large value for ri. +! ---------------------------------------------------------------------- + + ri1 = iri(idep1) + + IF (ri1 >= 9999.00) ri1 = BIG2 + +! ---------------------------------------------------------------------- +! Cuticular resistances IRLU read in from drydep table are per unit area +! of leaf; divide them by the leaf area index to get a cuticular +! resistance for the bulk canopy. If IRLU is "9999", it means there are +! no cuticular surfaces on which to deposit, so we impose a very large +! value for rlu. +! ---------------------------------------------------------------------- + + IF ((irlu(idep1) >= 9999) .OR. (xlai1 <= 0.00)) THEN + + rlu1 = BIG1 + + ELSE + + rlu1 = irlu(idep1) + rlu1 = (rlu1 / xlai1) + rt + + END IF + +! ---------------------------------------------------------- +! The following are the remaining resistances for the Wesely +! resistance-in-series model for a surface canopy +! (see Atmos. Environ. paper, Fig.1). +! ---------------------------------------------------------- + + rac1 = MAX (irac(idep1), 1) + if (rac1 >= 9999.00) rac1 = BIG2 + + rgss1 = irgss(idep1) + rgss1 = MAX (rgss1+rt, 1.00) + + rgso1 = irgso(idep1) + rgso1 = MAX (rgso1+rt, 1.00) + if (rgso1 >= 9999.00) rgso1 = BIG2 + + rcls1 = ircls(idep1) + rcls1 = rcls1 + rt + if (rcls1 >= 9999.00) rcls1 = BIG2 + + rclo1 = irclo(idep1) + rclo1 = rclo1 + rt + if (rclo1 >= 9999.00) rclo1 = BIG2 + +! ---------------------------------------------------------------------- +! Adjust stomatal resistances for insolation and temperature => +! +! Temperature adjustment is from Wesely [1989], equation (3). +! +! Light adjustment by SUBROUTINE lightCorr is described by Wang [1996]. +! It combines: +! - local dependence of stomal resistance on the intensity I of light +! impinging the leaf; this is expressed as a mutliplicative +! factor I/(I+b) to the stomatal resistance where b = 50 W*m^-2 +! (equation (7) of Baldocchi et. al. [1987]); +! - radiative transfer of direct and diffuse radiation in the +! canopy using equations (12)-(16) from Guenther et. al. [1995]; +! - separate accounting of sunlit and shaded leaves using +! equation (12) of Guenther et. al. [1995]; +! - partitioning of the radiation at the top of the canopy into direct +! and diffuse components using a parameterization to results from +! an atmospheric radiative transfer model [Wang, 1996]. +! The dependent variables of SUBROUTINE lightCorr are the leaf area +! index (xylai), the cosine of zenith angle (suncos) and the fractional +! cloud cover (cfrac). The factor gfaci integrates the light +! dependence over the canopy depth; sp even though ri is input per +! unit area of leaf, it need not be scaled by lai to yield a bulk +! canopy value because that is already done in the gfaci formulation. +! ---------------------------------------------------------------------- + + IF (ri1 >= 9999.00) THEN + + rix = ri1 + + ELSE + + IF ((tempc1 > 0.00) .AND. (tempc1 < 40.00)) THEN + gfact = 400.00 / tempc1 / (40.00 - tempc1) + ELSE + gfact = 100.00 + END IF + + IF ((radiat1 > 1.0E-05) .and. (xlai1 > 0.00)) then + xdrycoeff(:) = DRYCOEFF(:) + CALL lightCorr(cfrac1, suncos1, xlai1, xdrycoeff, biofit) + gfaci = 1.00 / biofit + ELSE + gfaci = 100.00 + END IF + + rix = ri1 * gfact * gfaci + + END IF + + RETURN + END SUBROUTINE SurfaceResist + +!----------------------------------------------------------------------------- +! +! ROUTINE +! lightCorr +! +! DESCRIPTION +! This routine calculates the light correction. +! +! Light adjustment by SUBROUTINE lightCorr is described by Wang [1996]. +! It combines: +! * local dependence of stomal resistance on the intensity I of light +! impinging the leaf; this is expressed as a mutliplicative factor +! I/(I+b) to the stomatal resistance where b = 50 (W*m^-2) +! (equation (7) of Baldocchi et al. [1987]) +! * radiative transfer of direct and diffuse radiation in the canopy +! using equations (12)-(16) from Guenther et al. [1995] +! * separate accounting of sunlit and shaded leaves using equation (12) +! of Guenther et al. [1995] +! * partitioning of the radiation at the top of the canopy into direct +! and diffuse components using a parameterization of results from an +! atmospheric radiative transfer model [Wang, 1996]. +! +! ARGUMENTS +! cloud_frac1 : fractional cloud cover +! suncos1 : cosine of the solar zenith angle +! xlai1 : leaf area index of land type for current month +! coeff : factor that integrates the light dependence over the canopy +! depth; "sp" even though "ri" is input per unit area of leaf +! +! REVISION HISTORY +! Unknown date Original from GMIchem +! Jan 2012 Nielsen, revisions for GOCART O3 +! +!----------------------------------------------------------------------------- + + SUBROUTINE lightCorr(cloud_frac1, suncos1, xlai1, coeff, f) + + IMPLICIT NONE + +! ---------------------- +! Argument declarations. +! ---------------------- + + REAL, INTENT(IN) :: cloud_frac1 + REAL, INTENT(IN) :: suncos1 + REAL, INTENT(IN) :: xlai1 + REAL, INTENT(IN) :: coeff(gcO3%NPOLY) + REAL, INTENT(OUT) :: f + +! ----------------------- +! Parameter declarations. +! ----------------------- + + INTEGER, PARAMETER :: BIOFIT_DIM = 4 ! biofit dimension + INTEGER, PARAMETER :: SPDIM = BIOFIT_DIM-1 + +! ---------------------- +! Variable declarations. +! ---------------------- + + INTEGER :: ii, nn + INTEGER :: k0, k1, k2, k3 + + REAL :: bigterm(gcO3%NPOLY) + REAL :: spterm (BIOFIT_DIM-1) + REAL :: term (BIOFIT_DIM) + +! ---------------- +! Begin execution. +! ---------------- + + term(1) = 1.00 + term(2) = xlai1 + term(3) = suncos1 + term(4) = cloud_frac1 + + DO ii = 1, SPDIM + spterm(ii) = term(ii+1) + END DO + + CALL ScaleBiofit(SPDIM, spterm) + + DO ii = 1, SPDIM + term(ii+1) = spterm(ii) + END DO + + k0 = 0 + + DO k3 = 1, BIOFIT_DIM + DO k2 = k3, BIOFIT_DIM + DO k1 = k2, BIOFIT_DIM + + k0 = k0 + 1 + bigterm(k0) = term(k1) * term(k2) * term(k3) + + END DO + END DO + END DO + + f = 0.00 + + DO nn = 1, gcO3%NPOLY + f = f + (coeff(nn) * bigterm(nn)) + END DO + + f = MAX (f, 0.10) + + RETURN + END SUBROUTINE lightCorr + +!----------------------------------------------------------------------------- +! +! ROUTINE +! ScaleBiofit +! +! DESCRIPTION +! This routine scales and constrains xlai, suncos, and cloud_frac; called +! by lightCorr. +! +! ARGUMENTS +! spdim : spterm dimension +! spterm : array of terms containing xlai, suncos, cloud_frac +! +! REVISION HISTORY +! Unknown date Original from GMIchem +! Jan 2012 Nielsen, revisions for GOCART O3 +! +!----------------------------------------------------------------------------- + + SUBROUTINE ScaleBiofit(spdim, spterm) + + IMPLICIT NONE + +! ---------------------- +! Argument declarations. +! ---------------------- + + INTEGER, INTENT(IN) :: spdim + REAL,INTENT(INOUT) :: spterm(spdim) + +! ----------------------- +! Parameter declarations. +! ----------------------- + + INTEGER, PARAMETER :: SPSIZE = 3 + INTEGER :: ND(SPSIZE) = (/ 55, 20, 11 /) ! Scaling factor for each variable + REAL :: XHI(SPSIZE) = (/ 11.00, 1.00, 1.00 /) ! Maximum for each variable + +! ---------------------- +! Variable declarations. +! ---------------------- + + INTEGER :: ii + + REAL :: rnd + REAL :: xlow ! Minimum for each variable + +! ---------------- +! Begin execution. +! ---------------- + + DO ii = 1, spdim + + spterm(ii) = MIN (spterm(ii), XHI(ii)) + + IF (ii /= spdim) THEN + + rnd = ND (ii) + xlow = XHI(ii) / rnd + + ELSE + + xlow = 0.00 + + END IF + + spterm(ii) = MAX (spterm(ii), xlow) + spterm(ii) = spterm(ii) / XHI(ii) + + END DO + + RETURN + END SUBROUTINE ScaleBiofit + +!----------------------------------------------------------------------------- +! +! ROUTINE +! molDiff +! +! DESCRIPTION +! This routine calculates the molecular diffusivity of a gas in air +! (m^2/s). +! +! The molecular radius of air is given in a table on p. 479 of Levine +! [1988]; the table also gives radii for some other molecules. Rather +! than using a specific molecular radius a generic value is used for all +! molecules, which is good enough in terms of calculating the diffusivity +! as long as the molecule is not too big. +! +! ARGUMENTS +! tk : temperature [K] +! airden : air density [kg m^{-3}] +! xm : molecular weight of gas [kg kmol^{-1}] +! radx : hard-sphere molecular radius of the diffusing gas [m] +! +! REVISION HISTORY +! Unknown date Original from GMIchem +! Jan 2012 Nielsen, revisions for GOCART O3 +! +!----------------------------------------------------------------------------- + + SUBROUTINE molDiff(tk, airden, xm, d) + + IMPLICIT NONE + +! ---------------------- +! Argument declarations. +! ---------------------- + + REAL, INTENT(IN) :: tk + REAL, INTENT(IN) :: airden + REAL, INTENT(IN) :: xm + REAL, INTENT(OUT):: d + +! ----------------------- +! Parameter declarations. +! ----------------------- + + REAL, PARAMETER :: RADAIR = 1.2E-10 ! Hard-sphere molecular radii of air (m) + REAL, PARAMETER :: RADX = 1.5E-10 ! Hard-sphere molecular radius of diffusing gas + REAL, PARAMETER :: PI = 3.14159 + +! ---------------------- +! Variable declarations. +! ---------------------- + + REAL :: diam + REAL :: frpath + REAL :: speed + REAL :: zz + +! ---------------- +! Begin execution. +! ---------------- + +! ------------------------------------------------------------------- +! Calculate the mean free path for gas X in air: eq. 8.5 of Seinfeld +! [1986]; diam is the collision diameter for gas X with air. +! ------------------------------------------------------------------- + + zz = xm / MAPL_AIRMW + + diam = radx + RADAIR + + frpath = 1.00 / (PI * SQRT (1.00 + zz ) * airden * (diam * diam)) + +! ------------------------------------------------------------- +! Calculate average speed of gas X; eq. 15.47 of Levine [1988]. +! ------------------------------------------------------------- + + speed = SQRT (8.00 * MAPL_RUNIV * tk / (PI * xm)) + +! -------------------------------------------------------------------- +! Calculate diffusion coefficient of gas X in air; eq. 8.9 of Seinfeld +! [1986]. +! -------------------------------------------------------------------- + + d = (3.00 * PI / 32.00) * (1.00 + zz) * frpath * speed + + RETURN + END SUBROUTINE molDiff + + END SUBROUTINE O3_GridCompRun + +!------------------------------------------------------------------------- +!NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3, GEOS/DAS! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: O3_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + SUBROUTINE O3_GridCompFinalize ( gcO3, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT none + +! !INPUT/OUTPUT PARAMETERS: + + TYPE(O3_GridComp), INTENT(INOUT) :: gcO3 ! Grid Component + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), INTENT(IN) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Import State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 4Mar2005 Nielsen Implementation of parameterized ozone chemistry +! 31Jan2012 Nielsen Add dry deposition and NetCDF reads from PCHEM +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=*), PARAMETER :: Iam = 'O3_GridCompFinalize' + INTEGER :: status + + status = 0 + rc = 0 + + DEALLOCATE(gcO3%ireg, STAT=status) + VERIFY_(status) + DEALLOCATE(gcO3%iland, STAT=status) + VERIFY_(status) + DEALLOCATE(gcO3%iuse, STAT=status) + VERIFY_(status) + DEALLOCATE(gcO3%xlai, STAT=status) + VERIFY_(status) + DEALLOCATE(gcO3%lats, STAT=status) + VERIFY_(status) + DEALLOCATE(gcO3%levs, STAT=status) + VERIFY_(status) + DEALLOCATE(gcO3%mncv, STAT=status) + VERIFY_(status) + DEALLOCATE(gcO3%mnpl, STAT=status) + VERIFY_(status) + + RETURN + + END SUBROUTINE O3_GridCompFinalize + + END MODULE O3_GridCompMod diff --git a/ESMF/GOCART_GridComp/O3_GridComp/O3_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/O3_GridComp/O3_GridComp_ExtData.rc new file mode 100644 index 00000000..3f562311 --- /dev/null +++ b/ESMF/GOCART_GridComp/O3_GridComp/O3_GridComp_ExtData.rc @@ -0,0 +1,52 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +O3_ireg NA Y Y - none none ireg ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID001 NA Y Y - none none iuseVegID001 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID002 NA Y Y - none none iuseVegID002 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID003 NA Y Y - none none iuseVegID003 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID004 NA Y Y - none none iuseVegID004 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID005 NA Y Y - none none iuseVegID005 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID006 NA Y Y - none none iuseVegID006 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID007 NA Y Y - none none iuseVegID007 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID008 NA Y Y - none none iuseVegID008 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID009 NA Y Y - none none iuseVegID009 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID010 NA Y Y - none none iuseVegID010 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID011 NA Y Y - none none iuseVegID011 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID012 NA Y Y - none none iuseVegID012 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID013 NA Y Y - none none iuseVegID013 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID014 NA Y Y - none none iuseVegID014 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_iuseVegID015 NA Y Y - none none iuseVegID015 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID001 NA Y Y - none none ilandVegID001 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID002 NA Y Y - none none ilandVegID002 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID003 NA Y Y - none none ilandVegID003 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID004 NA Y Y - none none ilandVegID004 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID005 NA Y Y - none none ilandVegID005 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID006 NA Y Y - none none ilandVegID006 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID007 NA Y Y - none none ilandVegID007 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID008 NA Y Y - none none ilandVegID008 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID009 NA Y Y - none none ilandVegID009 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID010 NA Y Y - none none ilandVegID010 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID011 NA Y Y - none none ilandVegID011 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID012 NA Y Y - none none ilandVegID012 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID013 NA Y Y - none none ilandVegID013 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID014 NA Y Y - none none ilandVegID014 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_ilandVegID015 NA Y Y - none none ilandVegID015 ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +O3_laiVegID001 NA Y Y - none none laiVegID001 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID002 NA Y Y - none none laiVegID002 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID003 NA Y Y - none none laiVegID003 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID004 NA Y Y - none none laiVegID004 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID005 NA Y Y - none none laiVegID005 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID006 NA Y Y - none none laiVegID006 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID007 NA Y Y - none none laiVegID007 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID008 NA Y Y - none none laiVegID008 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID009 NA Y Y - none none laiVegID009 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID010 NA Y Y - none none laiVegID010 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID011 NA Y Y - none none laiVegID011 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID012 NA Y Y - none none laiVegID012 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID013 NA Y Y - none none laiVegID013 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID014 NA Y Y - none none laiVegID014 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +O3_laiVegID015 NA Y Y - none none laiVegID015 ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc +%% diff --git a/ESMF/GOCART_GridComp/O3_GridComp/O3_Registry.rc b/ESMF/GOCART_GridComp/O3_GridComp/O3_Registry.rc new file mode 100644 index 00000000..b6e8cc7c --- /dev/null +++ b/ESMF/GOCART_GridComp/O3_GridComp/O3_Registry.rc @@ -0,0 +1,32 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: O3 + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# ---------|---------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl|# Sub| Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ---------|---------------|-----|---|----|---|---|-----|--------------------------------- + O3 | kg kg-1 | xyz | C | | | | | Ozone_mass_mixing_ratio + OX | mol mol-1 | xyz | C | | | | | Ozone_volume_mixing_ratio + O3DDV | m s-1 | xy | | | | | | Dry_deposition_speed + O3PPMV | ppmv | xyz | C | | | | | Ozone + O3TOT | Dobsons | xy | | | | | | Total_ozone + O3DDP | kg m-2 s-1 | xy | | | | | | Ozone_dry_deposition + DO3DT | kg kg-1 s-1 | xyz | C | | | | | Ozone_tendency + OX_TEND | mol mol-1 s-1 | xyz | C | | | | | tendency_of_odd_oxygen_mixing_ratio_due_to_chemistry +# ---------|---------------|-----|---|----|---|---|-----|-------------------------------- + diff --git a/ESMF/GOCART_GridComp/O3_GridComp/PIESA/O3_GridComp.rc b/ESMF/GOCART_GridComp/O3_GridComp/PIESA/O3_GridComp.rc new file mode 100644 index 00000000..2a5d767d --- /dev/null +++ b/ESMF/GOCART_GridComp/O3_GridComp/PIESA/O3_GridComp.rc @@ -0,0 +1,16 @@ +# +# Resource file for GOCART Ozone grid component. +# +# Parameterized chemistry +# ----------------------- +PCHEMs_file_name: /discover/nobackup/ltakacs/bcs/Ganymed-2_0_M/Shared/pchem.species.Clim_Prod_Loss.z_721x72.nc4 +pchem_clim_years: 1 + +# GMI chemistry +# ------------- +veg_file_name: ExtData/g5chem/sfc/vegetationType_GMI.x288_y181_t12.2006.nc +lai_file_name: ExtData/g5chem/sfc/leafAreaIndex_GMI.x288_y181_t12.2006.nc + +# Debug switch (1=yes or 0=no) +# ---------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C1/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C1/OC_GridComp---full.rc new file mode 100755 index 00000000..1593938c --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C1/OC_GridComp---full.rc @@ -0,0 +1,48 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 diff --git a/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C1/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C1/OC_GridComp.rc new file mode 100755 index 00000000..0d745e0f --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C1/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N] +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full diff --git a/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C1/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C1/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..c32d9f92 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C1/OC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|---------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|---------|-------|--------|----------------------|--------|--------|-------------|----------| + +# For emissions -- assume the units are kg m-2 s-1 of something +OC_BIOMASS kgOC/m2/s N Y %y4-%m2-%d2t12:00:00 none none biomass /discover/nobackup/mmanyin/CCM/EXT_DATA/OC/CCMI/CCMI_REF-C1.bioburn_OC.x720_y361_t12.%y4.nc + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/AeroCom/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA N N %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 kgOC/m2/s N Y %y4-%m2-%d2t12:00:00 none none anteoc1 /discover/nobackup/mmanyin/CCM/EXT_DATA/OC/CCMI/CCMI_REF-C1.nonenergy_anth_OC.x720_y361_t12.%y4.nc +OC_ANTEOC2 kgOC/m2/s N Y %y4-%m2-%d2t12:00:00 none none anteoc2 /discover/nobackup/mmanyin/CCM/EXT_DATA/OC/CCMI/CCMI_REF-C1.energy_OC.x720_y361_t12.%y4.nc + +# EDGAR based ship emissions +OC_SHIP NA N N %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% diff --git a/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C2/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C2/OC_GridComp---full.rc new file mode 100755 index 00000000..1593938c --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C2/OC_GridComp---full.rc @@ -0,0 +1,48 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 diff --git a/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C2/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C2/OC_GridComp.rc new file mode 100755 index 00000000..0d745e0f --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C2/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N] +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full diff --git a/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C2/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C2/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..40cfa82b --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/CCMI_REF-C2/OC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|---------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|---------|-------|--------|----------------------|--------|--------|-------------|----------| + +# For emissions -- assume the units are kg m-2 s-1 of something +OC_BIOMASS kgOC/m2/s N Y %y4-%m2-%d2t12:00:00 none none biomass /discover/nobackup/mmanyin/CCM/EXT_DATA/OC/CCMI/CCMI_REF-C2.bioburn_OC.x720_y361_t12.%y4.nc + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/AeroCom/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA N N %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 kgOC/m2/s N Y %y4-%m2-%d2t12:00:00 none none anteoc1 /discover/nobackup/mmanyin/CCM/EXT_DATA/OC/CCMI/CCMI_REF-C2.nonenergy_anth_OC.x720_y361_t12.%y4.nc +OC_ANTEOC2 kgOC/m2/s N Y %y4-%m2-%d2t12:00:00 none none anteoc2 /discover/nobackup/mmanyin/CCM/EXT_DATA/OC/CCMI/CCMI_REF-C2.energy_OC.x720_y361_t12.%y4.nc + +# EDGAR based ship emissions +OC_SHIP NA N N %y4-%m2-%d2t12:00:00 none none oc_ship /dev/null + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% diff --git a/ESMF/GOCART_GridComp/OC_GridComp/CMIP/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/CMIP/OC_GridComp---full.rc new file mode 100755 index 00000000..c718f065 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/CMIP/OC_GridComp---full.rc @@ -0,0 +1,41 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/CMIP/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/CMIP/OC_GridComp.rc new file mode 100755 index 00000000..0277ff59 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/CMIP/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full #bbbo bbnb diff --git a/ESMF/GOCART_GridComp/OC_GridComp/CMIP/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/CMIP/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..daa7638a --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/CMIP/OC_GridComp_ExtData.rc @@ -0,0 +1,29 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# For emissions -- assume the units are kg m-2 s-1 of something +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/CMIP/sfc/OC/cmip5.OC_bioburn.x720_y361_t14.%y4.nc + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/CMIP/sfc/OC/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA N Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/CMIP/sfc/OC/cmip5.noship_OC_src.sfc.x720_y361_t14.%y4.nc +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +OC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/CMIP/sfc/OC/cmip5.ship_OC_src.sfc.x720_y361_t14.%y4.nc + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% diff --git a/ESMF/GOCART_GridComp/OC_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/OC_GridComp/CMakeLists.txt new file mode 100644 index 00000000..77dee41e --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-E\;-C\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/19600101-20000331/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/19600101-20000331/OC_GridComp---full.rc new file mode 100644 index 00000000..4a2bddf7 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/19600101-20000331/OC_GridComp---full.rc @@ -0,0 +1,41 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/19600101-20000331/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/19600101-20000331/OC_GridComp.rc new file mode 100644 index 00000000..a9d318a9 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/19600101-20000331/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full bbbo bbnb diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/19600101-20000331/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/19600101-20000331/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..4c39d6fc --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/19600101-20000331/OC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- HFED-v1.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_oc.x576_y361_t14.%y4.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/AeroCom/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA N Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/MERRA2/sfc/AeroCom.noship_OC_src.sfc.x3600_y1800_t44.19780703_12z_20210703_12z.nc4 +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +OC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/MERRA2/sfc/edgar-v41.emis_oc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/20000401-present/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/20000401-present/OC_GridComp---full.rc new file mode 100644 index 00000000..4a2bddf7 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/20000401-present/OC_GridComp---full.rc @@ -0,0 +1,41 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/20000401-present/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/20000401-present/OC_GridComp.rc new file mode 100644 index 00000000..a9d318a9 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/20000401-present/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full bbbo bbnb diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/20000401-present/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/20000401-present/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..9f48bb6b --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/20000401-present/OC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/AeroCom/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA N Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/MERRA2/sfc/AeroCom.noship_OC_src.sfc.x3600_y1800_t44.19780703_12z_20210703_12z.nc4 +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +OC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/MERRA2/sfc/edgar-v41.emis_oc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/OC_GridComp---full.rc new file mode 100644 index 00000000..4a2bddf7 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/OC_GridComp---full.rc @@ -0,0 +1,41 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/OC_GridComp.rc new file mode 100644 index 00000000..a9d318a9 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full bbbo bbnb diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..9f48bb6b --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2-DD/OC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r8/0.1/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/AeroCom/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA N Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/MERRA2/sfc/AeroCom.noship_OC_src.sfc.x3600_y1800_t44.19780703_12z_20210703_12z.nc4 +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +OC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/MERRA2/sfc/edgar-v41.emis_oc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/19600101-20000331/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/19600101-20000331/OC_GridComp---full.rc new file mode 100644 index 00000000..467799cf --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/19600101-20000331/OC_GridComp---full.rc @@ -0,0 +1,41 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/19600101-20000331/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/19600101-20000331/OC_GridComp.rc new file mode 100644 index 00000000..a9d318a9 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/19600101-20000331/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full bbbo bbnb diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/19600101-20000331/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/19600101-20000331/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..7feb544e --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/19600101-20000331/OC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- HFED-v1.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_oc.x576_y361_t14.%y4.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/AeroCom/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA N Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/AeroCom/sfc/AeroCom.noship_OC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +OC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/MERRA2/sfc/edgar-v41.emis_oc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/20000401-present/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/20000401-present/OC_GridComp---full.rc new file mode 100644 index 00000000..4a2bddf7 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/20000401-present/OC_GridComp---full.rc @@ -0,0 +1,41 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/20000401-present/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/20000401-present/OC_GridComp.rc new file mode 100644 index 00000000..a9d318a9 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/20000401-present/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full bbbo bbnb diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/20000401-present/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/20000401-present/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..f9a60d95 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/20000401-present/OC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/AeroCom/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA N Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/AeroCom/sfc/AeroCom.noship_OC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +OC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/MERRA2/sfc/edgar-v41.emis_oc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/OC_GridComp---full.rc new file mode 100644 index 00000000..4a2bddf7 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/OC_GridComp---full.rc @@ -0,0 +1,41 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/OC_GridComp.rc new file mode 100644 index 00000000..a9d318a9 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full bbbo bbnb diff --git a/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..f9a60d95 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/MERRA2/OC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/AeroCom/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA N Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/AeroCom/sfc/AeroCom.noship_OC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +OC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/MERRA2/sfc/edgar-v41.emis_oc.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/NR/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/NR/OC_GridComp---full.rc new file mode 100755 index 00000000..8afff70f --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/NR/OC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/NR/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/NR/OC_GridComp.rc new file mode 100644 index 00000000..a9d318a9 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/NR/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full bbbo bbnb diff --git a/ESMF/GOCART_GridComp/OC_GridComp/NR/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/NR/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..5c7ecd7a --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/NR/OC_GridComp_ExtData.rc @@ -0,0 +1,29 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/NR/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/AeroCom/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA N Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/NR/sfc/AeroCom_EDGAR.emis_OC.ff_bf_noship.x3600_y1800.t5.20040703_20080703_12z.nc4 +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +OC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/NR/sfc/AeroCom_EDGAR.emis_OC.ship.x3600_y1800.t5.20040703_20080703_12z.nc4 + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% diff --git a/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp---bbbo.rc b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp---bbbo.rc new file mode 100755 index 00000000..80614149 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp---bbbo.rc @@ -0,0 +1,44 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp---bbnb.rc b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp---bbnb.rc new file mode 100755 index 00000000..80614149 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp---bbnb.rc @@ -0,0 +1,44 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp---full.rc new file mode 100755 index 00000000..b04e9515 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp---full.rc @@ -0,0 +1,42 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp.rc new file mode 100755 index 00000000..5f507664 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full diff --git a/ESMF/GOCART_GridComp/OC_GridComp/OC_GridCompMod.F90 b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridCompMod.F90 new file mode 100644 index 00000000..4d890d26 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridCompMod.F90 @@ -0,0 +1,2814 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: OC_GridCompMod --- OC Grid Component Class +! +! !INTERFACE: +! + + module OC_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + + use Chem_Mod ! Chemistry Base Class + use Chem_StateMod ! Chemistry State + use Chem_ConstMod, only: grav, von_karman, cpd, & + undefval => undef ! Constants ! + use Chem_UtilMod ! I/O + use Chem_MieMod ! Aerosol LU Tables, calculator + use m_inpak90 ! Resource file management + use m_die, only: die + use Chem_SettlingMod ! Settling + use DryDepositionMod ! Dry Deposition + use WetRemovalMod ! Large-scale Wet Removal + use ConvectionMod ! Offline convective mixing/scavenging + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC OC_GridComp ! The OC object + PUBLIC OC_GridComp1 ! Single instance OC object + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC OC_GridCompSetServices + PUBLIC OC_GridCompInitialize + PUBLIC OC_GridCompRun1 + PUBLIC OC_GridCompRun2 + PUBLIC OC_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) OC Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + type OC_GridComp1 + character(len=255) :: name + character(len=255) :: iname ! instance name + character(len=255) :: rcfilen ! resource file name + character(len=255) :: regionsString ! Comma-delimited string of regions + + integer :: instance ! instance number + + logical :: run_alarm = .false. ! run alarm + + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + real, pointer :: biofuel_src(:,:) + real, pointer :: biomass_src(:,:) + real, pointer :: biomass_src_(:,:) + real, pointer :: eocant1_src(:,:) ! level 1 + real, pointer :: eocant2_src(:,:) ! level 2 + real, pointer :: terpene_src(:,:) ! level 2 + real, pointer :: oc_ship_src(:,:) + real, pointer :: psoa_anthro_voc(:,:,:) ! production of SOA from anthropogenic VOC + real, pointer :: aviation_lto_src(:,:) ! aviation - landing and takeoff + real, pointer :: aviation_cds_src(:,:) ! aviation - climbing and descent + real, pointer :: aviation_crs_src(:,:) ! aviation - cruise + real :: aviation_layers(4) ! heights of the LTO, CDS and CRS layers + + real :: ratPOM ! Ratio of POM to OC mass + real :: fHydrophobic ! Fraction of emissions hydrophobic + real :: fTerpene ! Fraction of terpene emissions -> aerosol + integer :: myDOW = -1 ! my Day of the week: Sun=1, Mon=2,...,Sat=7 + logical :: doing_nei=.FALSE. ! NEI08: National Emission Inventory (US+Canada) + real :: nei_lon(2), nei_lat(2) ! NEI bounding box; superseeds eocant1/2 inside +! Workspace for any requested point emissions +! ------------------------------------------- + logical :: doing_point_emissions=.FALSE. ! Providing pointwise emissions + character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions + integer :: nPts = -1 + integer, pointer, dimension(:) :: vstart => null(), vend => null() + real, pointer, dimension(:) :: vLat => null(), & + vLon => null(), & + vBase => null(), & + vTop => null(), & + vEmis => null() + end type OC_GridComp1 + + type OC_GridComp + integer :: n = 0 ! number of instances + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + type(OC_GridComp1), pointer :: gcs(:) => null() ! instances + end type OC_GridComp + + character(len=*), parameter :: rc_basename = 'OC_GridComp' + + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + real, parameter :: radToDeg = 57.2957795 + +CONTAINS + + subroutine OC_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: n,i + + type(ESMF_Config) :: cfg + + Iam = "OC_GridCompSetServices" + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(rc=status) + VERIFY_(STATUS) + call ESMF_ConfigLoadFile(cfg,trim(rc_basename)//'.rc',rc=status) + VERIFY_(STATUS) + +! Parse resource file +! ------------------- + n = ESMF_ConfigGetLen(cfg,label='OC_instances:',rc=status) + VERIFY_(STATUS) + + +! We have 2 tracers for each instance of OC +! We cannot have fewer instances than half the number of +! OC bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( n .LT. chemReg%n_OC/2 ) then + rc = 35 + return + else if ( n .GT. chemReg%n_OC/2 ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(Iam)// & + ': fewer OC bins than possible OC instances: ',& + n, chemReg%n_OC/2 + end if + n = min(n,chemReg%n_OC/2 ) + +! Record name of each instance +! ---------------------------- + call ESMF_ConfigFindLabel(cfg,'OC_instances:',rc=status) + VERIFY_(STATUS) + do i = 1, n + call ESMF_ConfigGetAttribute(cfg,name,rc=status) + VERIFY_(STATUS) + ! resource file name + IF(TRIM(name) == "full" ) THEN + name = " " ! blank instance name for full (1) + ELSE + name = TRIM(name) ! instance name for others + END IF + call OC_GridCompSetServices1_(gc,chemReg,name,rc=status) + VERIFY_(STATUS) + end do + + RETURN_(ESMF_SUCCESS) + end subroutine OC_GridCompSetServices + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_GridCompInitialize --- Initialize OC_GridComp +! +! !INTERFACE: +! + + subroutine OC_GridCompInitialize ( gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(OC_GridComp), intent(inout) :: gcOC ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the OC Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'OC_GridCompInitialize' + CHARACTER(LEN=255) :: name + + integer :: i, ier, n + +! Load resource file +! ------------------ + call i90_loadf ( trim(rc_basename)//'.rc', ier ) + if ( ier .NE. 0 ) then + rc = 10 + return + end if + +! Parse resource file +! ------------------- + CALL I90_label ( 'OC_instances:', ier ) + if ( ier .NE. 0 ) then + rc = 20 + return + end if + +! First determine how many instances we have +! ------------------------------------------ + n = 0 + do while ( ier .EQ. 0 ) + CALL I90_gtoken( name, ier ) + if(ier .eq. 0) n = n + 1 + end do + if ( n .EQ. 0 ) then + rc = 30 + return + end if + +! We have 2 tracers for each instance of OC +! We cannot have fewer instances than half the number of +! OC bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( n .LT. w_c%reg%n_OC/2 ) then + rc = 35 + return + else if ( n .GT. w_c%reg%n_OC/2 ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(myname)// & + ': fewer OC bin sets than possible OC instances'//& + ' (2 bins per instance): ',& + n, w_c%reg%n_OC + end if + n = min(n,w_c%reg%n_OC/2 ) + gcOC%n = n + +! Next allocate necessary memory +! ------------------------------ + allocate ( gcOC%gcs(n), stat=ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + +! Record name of each instance +! ---------------------------- + CALL I90_label ( 'OC_instances:', ier ) + do i = 1, n + CALL I90_gtoken( name, ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + ! resource file name + gcOC%gcs(i)%rcfilen = trim(rc_basename)//'---'//trim(name)//'.rc' + gcOC%gcs(i)%instance = i ! instance number + IF(TRIM(name) == "full" ) THEN + gcOC%gcs(i)%iname = " " ! blank instance name for full (1) + ELSE + gcOC%gcs(i)%iname = TRIM(name) ! instance name for others + END IF + end do + +! Next initialize each instance +! ----------------------------- + do i = 1, gcOC%n + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,myname,": Initializing instance ",TRIM(gcOC%gcs(i)%iname)," [",gcOC%gcs(i)%instance,"]" + END IF + call OC_SingleInstance_ ( OC_GridCompInitialize1_, i, & + gcOC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = 1000+ier + return + end if + gcOC%gcs(i)%mie_tables => gcOC%mie_tables + end do + +! All done +! -------- + CALL I90_FullRelease( ier ) + IF( ier /= 0 ) THEN + PRINT *,myname,": I90_FullRelease not successful." + rc = 40 + END IF + + + end subroutine OC_GridCompInitialize + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_GridCompRun1 --- Run OC_GridComp +! +! !INTERFACE: +! + + subroutine OC_GridCompRun1 ( gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(OC_GridComp), INTENT(INOUT) :: gcOC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcOC%n + call OC_SingleInstance_ ( OC_GridCompRun1_, i, & + gcOC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine OC_GridCompRun1 + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_GridCompRun2 --- Run OC_GridComp +! +! !INTERFACE: +! + + subroutine OC_GridCompRun2 ( gcOC, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + LOGICAL, INTENT(IN) :: run_alarm ! run alarm + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(OC_GridComp), INTENT(INOUT) :: gcOC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcOC%n + gcOC%gcs(i)%run_alarm = run_alarm + + call OC_SingleInstance_ ( OC_GridCompRun2_, i, & + gcOC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine OC_GridCompRun2 + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_GridCompFinalize --- Initialize OC_GridComp +! +! !INTERFACE: +! + + subroutine OC_GridCompFinalize ( gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(OC_GridComp), INTENT(INOUT) :: gcOC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the OC Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer i, ier + + do i = 1, gcOC%n + call OC_SingleInstance_ ( OC_GridCompFinalize1_, i, & + gcOC%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + if (associated(gcOC%gcs)) deallocate ( gcOC%gcs, stat=ier ) + gcOC%n = -1 + + end subroutine OC_GridCompFinalize + + + subroutine OC_GridCompSetServices1_( gc, chemReg, iname, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + character(len=*), intent(IN ) :: iname + integer, intent(OUT ) :: rc + + ! local + logical:: doing_nei + + integer :: Status + character(len=ESMF_MAXSTR) :: Iam + + Iam ="OC_GridCompSetServices1_" + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_BIOMASS'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_TERPENE'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_BIOFUEL'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_ANTEOC1'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_ANTEOC2'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_SHIP'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_AVIATION_LTO'//trim(iname), & + LONG_NAME = 'oc_aviation_lto' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_AVIATION_CDS'//trim(iname), & + LONG_NAME = 'oc_aviation_cds' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_AVIATION_CRS'//trim(iname), & + LONG_NAME = 'oc_aviation_crs' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'pSOA_ANTHRO_VOC'//trim(iname), & + LONG_NAME = 'SOA from Anthropogenic and biomass burning VOC' , & + UNITS = 'kg m-3 s-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + +! Parse the resource file to see if NEI imports are required +! ---------------------------------------------------------- + call doing_nei_(trim(rc_basename), trim(iname), doing_nei, __RC__) + + NEI_EMISSIONS: if (doing_nei) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_NEI_BOT'//trim(iname), & + LONG_NAME = 'oc_nei_bot' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'OC_NEI_TOP'//trim(iname), & + LONG_NAME = 'oc_nei_top' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + end if NEI_EMISSIONS + + + RETURN_(ESMF_SUCCESS) + + contains + subroutine doing_nei_(rcbasen, iname, result, rc) + + character(len=*), intent(in) :: rcbasen + character(len=*), intent(in) :: iname + logical, intent(out) :: result + integer, intent(out) :: rc + + ! local + type(ESMF_Config) :: cfg + character(len=255) :: name + logical :: isPresent + integer :: status + character(len=255) :: Iam + + Iam = 'OC_GridCOmpSetServices1_::doing_nei_' + + if (iname == '') then + name = 'full' + else + name = trim(iname) + end if + + name = trim(rcbasen)//'---'//trim(name)//'.rc' + + cfg = ESMF_ConfigCreate(__RC__) + call ESMF_ConfigLoadFile(cfg, trim(name), __RC__) + call ESMF_ConfigFindLabel(cfg, 'nei_boundingbox:', isPresent=isPresent, __RC__) + + if (isPresent) then + result = .true. + else + result = .false. + end if + + RETURN_(ESMF_SUCCESS) + end subroutine doing_nei_ + + end subroutine OC_GridCompSetServices1_ + +!-------------------------------------------------------------------------- + +! Single Instance Methods + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_GridCompInitialize --- Initialize OC_GridComp +! +! !INTERFACE: +! + + subroutine OC_GridCompInitialize1_ ( gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(OC_GridComp1), intent(inout) :: gcOC ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the OC Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'OC_GridCompInitialize1' + + + character(len=255) :: rcfilen + integer :: n + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, nbins_rc, km + integer, allocatable :: ier(:) + real :: qmax, qmin + LOGICAL :: NoRegionalConstraint + + rcfilen = gcOC%rcfilen + gcOC%name = 'OC Constituent Package' + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + km = w_c%grid%km + nbins = w_c%reg%n_OC + n1 = w_c%reg%i_OC + n2 = w_c%reg%j_OC + + call init_() + if ( rc /= 0 ) return + + +! ------------------- +! Parse resource file +! ------------------- + +! Load resource file +! ------------------ + call i90_loadf ( rcfilen, ier(1) ) + if ( ier(1) .ne. 0 ) then + call final_(10) + return + end if + + call i90_label ( 'number_oc_classes:', ier(1) ) + nbins_rc = i90_gint ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(20) + return + end if + if ( nbins_rc /= nbins ) then + call final_(25) + return + end if + +! Aircraft emissions +! ------------------ + ier(:) = 0 + call i90_label ( 'aviation_vertical_layers:', ier(1) ) + gcOC%aviation_layers(1) = i90_gfloat(ier(2)) + gcOC%aviation_layers(2) = i90_gfloat(ier(3)) + gcOC%aviation_layers(3) = i90_gfloat(ier(4)) + gcOC%aviation_layers(4) = i90_gfloat(ier(5)) + + if ( any(ier(1:5) /= 0) ) then + call final_(77) + return + end if + +! Handle Point-wise Emission Sources Specified in a Text File +! ----------------------------------------------------------- + ier(:) = 0 + call i90_label ( 'point_emissions_srcfilen:', ier(1) ) + call i90_gtoken ( gcOC%point_emissions_srcfilen, ier(2) ) + if ( ier(1) /= 0 ) then + gcOC%doing_point_emissions = .FALSE. ! if rc is missing, don't fuss + else if ( any(ier(2:2) /= 0) ) then + call final_(42) ! this means point emissions info is messed up, abort + return + else + if ( (index(gcOC%point_emissions_srcfilen,'/dev/null')>0) ) then + gcOC%doing_point_emissions = .FALSE. ! disable it if no file specified + else + gcOC%doing_point_emissions = .TRUE. ! we are good to go + end if + end if + +! Handle NEI08 Emissions +! ---------------------- + ier(:) = 0 + call i90_label ( 'nei_boundingbox:', ier(1) ) + gcOC%nei_lon(1) = i90_gfloat(ier(2)) + gcOC%nei_lon(2) = i90_gfloat(ier(3)) + gcOC%nei_lat(1) = i90_gfloat(ier(4)) + gcOC%nei_lat(2) = i90_gfloat(ier(5)) + if ( ier(1) /= 0 ) then + gcOC%doing_nei = .FALSE. ! if rc is missing, don't fuss + else if ( any(ier(2:5) /= 0) ) then + call final_(42) ! this means NEI info is messed up, abort + return + else +! -------------------------------------------------------------------------- +! if ( (index(gcOC%nei_srcfilen(1),'/dev/null')>0) .or. & +! (index(gcOC%nei_srcfilen(2),'/dev/null')>0) ) then +! gcOC%doing_nei = .FALSE. ! disable it if no file specified +! else +! gcOC%doing_nei = .TRUE. ! we are good to go +! end if +! -------------------------------------------------------------------------- +! TODO: Need to parse the ExtData file to replicate the above logic, +! until then do not include the NOI datasets in the ExtData primary +! export tables +! -------------------------------------------------------------------------- + + gcOC%doing_nei = .TRUE. ! we are good to go + end if + + if ( MAPL_AM_I_ROOT() ) then + if ( gcOC%doing_nei ) then + print *, 'OC_GridComp: using NEI08 Emissions over North America' + else + print *, 'OC_GridComp: skipping NEI08 Emissions over North America' + end if + end if + +! ------- + +! Day of the week to reset tracer to zero +! --------------------------------------- + call i90_label ( 'my_day_of_the_week:',ier(1)) + if ( ier(1) /= 0 ) then + gcOC%myDOW = -1 ! by default never reset tracer to zero + else + gcOC%myDOW = i90_gint (ier(1)) + if ( ier(1) /= 0 ) then + call final_(60) + return + end if + end if + +! ------- + + +! Ratio of POM to OC mass +! ----------------------- + call i90_label ( 'pom_oc_ratio:', ier(1) ) + gcOC%ratPOM = i90_gfloat ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + + +! Hydrophilic fraction +! --------------- + call i90_label ( 'hydrophobic_fraction:', ier(1) ) + gcOC%fHydrophobic = i90_gfloat ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + + +! Terpene Emission Factor +! --------------- + call i90_label ( 'terpene_emission_fraction:', ier(1) ) + gcOC%fTerpene = i90_gfloat ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + + +! ------- + + +! Scavenging Efficiency +! To be used in convtran.F90, this parameter +! is the scavenging efficiency of the tracer [km -1] +! --------------- + call i90_label ( 'fscav:', ier(1) ) + do n = 1, nbins + w_c%reg%fscav(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Particle density +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_density:', ier(1) ) + do n = 1, nbins + w_c%reg%rhop(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Number median radius +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_radius_number:', ier(1) ) + do n = 1, nbins + w_c%reg%rmed(n1+n-1) = i90_gfloat ( ier(n+1) ) * 1e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Sigma (lognormal mode width) +! To be used in droplet activation code +! --------------- + call i90_label ( 'sigma:', ier(1) ) + do n = 1, nbins + w_c%reg%sigma(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Number to mass conversion factor +! To be used in droplet activation code +! --------------- + call i90_label ( 'fnum:', ier(1) ) + do n = 1, nbins + w_c%reg%fnum(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Molecular weight +! To be used in droplet activation code +! --------------- + call i90_label ( 'molecular_weight:', ier(1) ) + do n = 1, nbins + w_c%reg%molwght(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! ------- + +! Grab the region string. +! ----------------------- + ier(:)=0 + call i90_label ( 'OC_regions_indices:', ier(1) ) + CALL I90_gtoken( gcOC%regionsString, ier(2) ) + IF( ANY(ier(1:2) < 0 ) ) THEN + CALL final_(51) + RETURN + END IF + +! Is this instantiation a global case? +! ----------------------------------- + IF(gcOC%regionsString(1:2) == "-1") THEN + NoRegionalConstraint = .TRUE. + ELSE + SELECT CASE (ESMF_UtilStringLowerCase(gcOC%regionsString(1:2))) + CASE ("gl") + NoRegionalConstraint = .TRUE. + CASE ("al") + NoRegionalConstraint = .TRUE. + CASE DEFAULT + NoRegionalConstraint = .FALSE. + END SELECT + END IF + +! Set regionsString to "-1" for the global case +! --------------------------------------------- + IF(NoRegionalConstraint) gcOC%regionsString = "-1" + + IF(MAPL_AM_I_ROOT()) THEN + IF(NoRegionalConstraint) THEN + PRINT *,myname,": This instantiation has no regional constraints." + ELSE + PRINT *,myname,": This instantiation is regionally constrained." + PRINT *,myname,": List of region numbers included: ",TRIM(gcOC%regionsString) + END IF + END IF + +! All done +! -------- + call i90_release() + deallocate(ier) + + return + + +CONTAINS + + subroutine init_() + integer ios, nerr + nerr = max ( 32, nbins+1 ) + allocate ( gcOC%biomass_src(i1:i2,j1:j2), gcOC%biofuel_src(i1:i2,j1:j2), & + gcOC%biomass_src_(i1:i2,j1:j2), & + gcOC%eocant1_src(i1:i2,j1:j2), gcOC%eocant2_src(i1:i2,j1:j2), & + gcOC%terpene_src(i1:i2,j1:j2), gcOC%oc_ship_src(i1:i2,j1:j2), & + gcOC%psoa_anthro_voc(i1:i2,j1:j2,km), & + gcOC%aviation_lto_src(i1:i2,j1:j2), & + gcOC%aviation_cds_src(i1:i2,j1:j2), & + gcOC%aviation_crs_src(i1:i2,j1:j2), ier(nerr), stat=ios ) + if ( ios /= 0 ) rc = 100 + end subroutine init_ + + subroutine final_(ierr) + integer :: ierr + integer ios + deallocate ( gcOC%biomass_src, gcOC%biofuel_src, & + gcOC%biomass_src_, & + gcOC%eocant1_src, gcOC%eocant2_src, & + gcOC%terpene_src, gcOC%oc_ship_src, & + gcOC%psoa_anthro_voc, & + gcOC%aviation_lto_src, & + gcOC%aviation_cds_src, & + gcOC%aviation_crs_src, ier, stat=ios ) + call i90_release() + rc = ierr + end subroutine final_ + + end subroutine OC_GridCompInitialize1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_GridCompRun1_ --- The Chem Driver, run phase 1 +! +! !INTERFACE: +! + + subroutine OC_GridCompRun1_ ( gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(OC_GridComp1), intent(inout) :: gcOC ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called OC Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'OC_GridCompRun1_' + character(len=*), parameter :: Iam = myname + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n + integer :: i, j, ijl, ijkl, ijk1l + real :: qmax, qmin + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: pblh + real, pointer, dimension(:,:,:) :: tmpu, rhoa, ple + +! Workspace for NEI emissions +! --------------------------- + real, pointer, dimension(:,:) :: nei_src1, nei_src2 + + integer :: idow + character(len=3) :: cdow + + real, pointer :: var2d(:,:) => null() + + +#define EXPORT expChem +#define iNAME TRIM(gcOC%iname) + +#define ptrOCEM OC_emis + +#define ptrOCEMAN OC_emisAN +#define ptrOCEMBB OC_emisBB +#define ptrOCEMBF OC_emisBF +#define ptrOCEMBG OC_emisBG + + integer :: STATUS + +#include "OC_GetPointer___.h" + + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_OC + n1 = w_c%reg%i_OC + n2 = w_c%reg%j_OC + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + +! Reset tracer to zero at 0Z on specific day of week +! -------------------------------------------------- + idow = Chem_UtilIdow(nymd) + if ( (nhms==0) .and. (idow == gcOC%myDOW) ) then + cdow = Chem_UtilCdow(nymd) + do n = n1, n2 + w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) = tiny(1.) ! avoid division by zero + end do + if ( MAPL_AM_I_ROOT() ) then + print *, '<> OC '//cdow//' tracer being set to zero on ', nymd, nhms + end if + end if + +! Update emissions/production if necessary (daily) +! ------------------------------------------ + +! Biomass Burning -- select on known inventories +! ---------------------------------------------- + + call MAPL_GetPointer(impChem, var2d, 'OC_BIOMASS'//iNAME, __RC__) + gcOC%biomass_src = var2d + + +! Terpene, biofuel and anthropogenic emissions (inventories) +! ---------------------------------------------------------- + call MAPL_GetPointer(impChem, var2d, 'OC_TERPENE'//iNAME, __RC__) + gcOC%terpene_src = var2d + + call MAPL_GetPointer(impChem, var2d, 'OC_BIOFUEL'//iNAME, __RC__) + gcOC%biofuel_src = var2d + + call MAPL_GetPointer(impChem, var2d, 'OC_ANTEOC1'//iNAME, __RC__) + gcOC%eocant1_src = var2d + + call MAPL_GetPointer(impChem, var2d, 'OC_ANTEOC2'//iNAME, __RC__) + gcOC%eocant2_src = var2d + +! Ship based OC emissions + call MAPL_GetPointer(impChem, var2d, 'OC_SHIP'//iNAME, __RC__) + gcOC%oc_ship_src = var2d + +! Aircraft emissions during the three phases of flight + call MAPL_GetPointer(impChem, var2d, 'OC_AVIATION_LTO'//iNAME, __RC__) + gcOC%aviation_lto_src = var2d + + call MAPL_GetPointer(impChem, var2d, 'OC_AVIATION_CDS'//iNAME, __RC__) + gcOC%aviation_cds_src = var2d + + call MAPL_GetPointer(impChem, var2d, 'OC_AVIATION_CRS'//iNAME, __RC__) + gcOC%aviation_crs_src = var2d + + +! As a safety check, where value is undefined set to 0 + do j = j1, j2 + do i = i1, i2 + if(1.01*gcOC%biomass_src(i,j) .gt. undefval) gcOC%biomass_src(i,j) = 0. + if(1.01*gcOC%terpene_src(i,j) .gt. undefval) gcOC%terpene_src(i,j) = 0. + if(1.01*gcOC%biofuel_src(i,j) .gt. undefval) gcOC%biofuel_src(i,j) = 0. + if(1.01*gcOC%eocant1_src(i,j) .gt. undefval) gcOC%eocant1_src(i,j) = 0. + if(1.01*gcOC%eocant2_src(i,j) .gt. undefval) gcOC%eocant2_src(i,j) = 0. + if(1.01*gcOC%oc_ship_src(i,j) .gt. undefval) gcOC%oc_ship_src(i,j) = 0. + if(1.01*gcOC%aviation_lto_src(i,j) .gt. undefval) gcOC%aviation_lto_src(i,j) = 0. + if(1.01*gcOC%aviation_cds_src(i,j) .gt. undefval) gcOC%aviation_cds_src(i,j) = 0. + if(1.01*gcOC%aviation_crs_src(i,j) .gt. undefval) gcOC%aviation_crs_src(i,j) = 0. + enddo + enddo + + +#ifdef DEBUG + call pmaxmin('OC: biomass', gcOC%biomass_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: biofuel', gcOC%biofuel_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: eocant1', gcOC%eocant1_src, qmin, qmax, ijl,1,1.) + call pmaxmin('OC: eocant2', gcOC%eocant2_src, qmin, qmax, ijl,1,1.) + call pmaxmin('OC: terpene', gcOC%terpene_src, qmin, qmax, ijl,1, 1.) + call pmaxmin('OC: oc_ship', gcOC%oc_ship_src, qmin, qmax, ijl,1, 1.) + call pmaxmin('OC: avi_lto', gcOC%aviation_lto_src, qmin, qmax, ijl,1,1.) + call pmaxmin('OC: avi_cds', gcOC%aviation_cds_src, qmin, qmax, ijl,1,1.) + call pmaxmin('OC: avi_crs', gcOC%aviation_crs_src, qmin, qmax, ijl,1,1.) +#endif + +! Save this in case we need to apply diurnal cycle +! ------------------------------------------------ + if ( w_c%diurnal_bb ) then + gcOC%biomass_src_(:,:) = gcOC%biomass_src(:,:) + end if + +! Apply diurnal cycle if so desired +! --------------------------------- + if ( w_c%diurnal_bb ) then + call Chem_BiomassDiurnal ( gcOC%biomass_src, gcOC%biomass_src_, & + w_c%grid%lon(:,:)*radToDeg, & + w_c%grid%lat(:,:)*radToDeg, nhms, cdt ) + end if + +! Read any pointwise emissions, if requested +! ------------------------------------------ + if(gcOC%doing_point_emissions) then + call Chem_UtilPointEmissions( nymd, gcOC%point_emissions_srcfilen, & + gcOC%nPts, gcOC%vLat, gcOC%vLon, & + gcOC%vBase, gcOC%vTop, gcOC%vEmis, & + gcOC%vStart, gcOC%vEnd ) + +! In case vStart or vEnd were not specified in the file set to defaults + where(gcOC%vStart < 0) gcOC%vStart = 000000 + where(gcOC%vEnd < 0) gcOC%vEnd = 240000 + endif + + +! Apply NEI emissions over North America if so desired +! ---------------------------------------------------- + if (gcOC%doing_NEI) then + + allocate(nei_src1(i1:i2,j1:j2), nei_src2(i1:i2,j1:j2), __STAT__) + + call MAPL_GetPointer(impChem,var2d,'OC_NEI_BOT'//iNAME, __RC__) + nei_src1 = var2d + + call MAPL_GetPointer(impChem,var2d,'OC_NEI_TOP'//iNAME, __RC__) + nei_src2 = var2d + + where ( (w_c%grid%lon >= gcOC%nei_lon(1)) .and. & + (w_c%grid%lon <= gcOC%nei_lon(2)) .and. & + (w_c%grid%lat >= gcOC%nei_lat(1)) .and. & + (w_c%grid%lat <= gcOC%nei_lat(2)) ) + + gcOC%eocant1_src = nei_src1 + gcOC%eocant2_src = nei_src2 + end where + +#ifdef DEBUG + call pmaxmin('OC: nei_bot', nei_src1, qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: nei_top', nei_src2, qmin, qmax, ijl,1, 1. ) +#endif + + deallocate(nei_src1, nei_src2) + + end if ! doing NEI + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('OC: q_beg', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, ple, 'PLE', __RC__ ) + + + +#ifdef DEBUG + + call pmaxmin('OC: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + + call pmaxmin('OC: tmpu ', tmpu , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('OC: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + +#endif + +! OC Source +! ----------- + call OC_Emission ( i1, i2, j1, j2, km, nbins, cdt, gcOC, w_c, & + pblh, tmpu, rhoa, OC_emis, & + OC_emisAN, OC_emisBB, OC_emisBF, OC_emisBG, rc ) +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('OC: q_emi', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + return + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_Emission - Adds Organic Carbon emission for one timestep +! We have emissions from 6 sources, which are distributed +! differently in the vertical +! 1) biomass burning - uniformly mixed in PBL +! 2) biofuel sources - emitted into lowest 100 m +! 3) anthropogenic l1 - emitted into lowest 100 m +! 4) anthropogenic l2 - emitted into 100 - 500 m levels +! 5) terpene - emitted to surface (hydrophilic only) +! 6) point sources - emitted in altitudes specified in input +! +! !INTERFACE: +! + + subroutine OC_Emission ( i1, i2, j1, j2, km, nbins, cdt, gcOC, w_c, & + pblh, tmpu, rhoa, OC_emis, & + OC_emisAN, OC_emisBB, OC_emisBF, OC_emisBG, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km, nbins + real, intent(in) :: cdt + type(OC_GridComp1), intent(in) :: gcOC ! OC Grid Component + real, pointer, dimension(:,:) :: pblh + real, pointer, dimension(:,:,:) :: tmpu + real, pointer, dimension(:,:,:) :: rhoa + +! !OUTPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + type(Chem_Array), intent(inout) :: OC_emis(nbins) ! OC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: OC_emisAN ! OC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: OC_emisBB ! OC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: OC_emisBF ! OC emissions, kg/m2/s + type(Chem_Array), intent(inout) :: OC_emisBG ! OC emissions, kg/m2/s + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'OC_Emission' + +! !DESCRIPTION: Updates the OC concentration with emissions every timestep +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k, m, n, ios, ijl, ii + integer :: n1, n2 +! pressure at 100m, 500m, & PBLH + real, dimension(i1:i2,j1:j2) :: p100, p500, pPBL + real, dimension(i1:i2,j1:j2) :: p0, z0, ps + real :: p1, z1, dz, delz, delp, f100, f500, fPBL, fBot + real :: qmax, qmin, eBiofuel, eBiomass, eTerpene, eAnthro + + real, dimension(i1:i2,j1:j2) :: factor, srcHydrophobic, srcHydrophilic + real, dimension(i1:i2,j1:j2) :: srcBiofuel, srcBiomass, srcAnthro, srcBiogenic + real :: srcTmp, zpbl, maxAll + + real, dimension(i1:i2,j1:j2,km) :: emis_aviation + real, dimension(i1:i2,j1:j2,km) :: srcAviation + real :: z_lto_bot, z_lto_top + real :: z_cds_bot, z_cds_top + real :: z_crs_bot, z_crs_top + + real, dimension(i1:i2,j1:j2) :: f_bb_ ! scaling factor for BB emissions based on maximum allowed exttau + real, dimension(i1:i2,j1:j2) :: exttau_bb_ ! increment of exttau due to BB during the current time step + real, allocatable, dimension(:,:,:,:) :: qa_bb_ ! increment of qa due to BB during the current time step (nbins,i1:i2,j1:j2:km) + real :: cutoff_bb_exttau + integer :: nch, idx + real :: ilam550 + real :: tau, ssa + character(len=255) :: qname + real, parameter :: max_bb_exttau = 30.0 + +! Indices for point emissions + integer, pointer, dimension(:) :: iPoint, jPoint + real, dimension(km) :: point_column_emissions + +! Source function terms for SOA from Anthropogenic VOCs + real :: srcSOAanthro = 0.0 + +! Initialize local variables +! -------------------------- + n1 = w_c%reg%i_OC + n2 = w_c%reg%j_OC + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + +! Emission factors scaling from source files to desired mass quantity + eBiomass = gcOC%ratPOM + eBiofuel = gcOC%ratPOM + eTerpene = gcOC%ratPOM * gcOC%fTerpene + eAnthro = gcOC%ratPOM + +! Zero diagnostic accumulators + do n = 1, nbins + if( associated(OC_emis(n)%data2d) ) OC_emis(n)%data2d = 0.0 + end do + if(associated(OC_emisAN%data2d) ) OC_emisAN%data2d = 0.0 + if(associated(OC_emisBF%data2d) ) OC_emisBF%data2d = 0.0 + if(associated(OC_emisBB%data2d) ) OC_emisBB%data2d = 0.0 + if(associated(OC_emisBG%data2d) ) OC_emisBG%data2d = 0.0 + +! Distribute aircraft emissions from LTO, CDS and CRS layers +! ---------------------------------------------------------- + z_lto_bot = max(1e-3, gcOC%aviation_layers(1)) + z_lto_top = max(2e-3, gcOC%aviation_layers(2)) + + z_cds_bot = max(2e-3, gcOC%aviation_layers(2)) + z_cds_top = max(3e-3, gcOC%aviation_layers(3)) + + z_crs_bot = max(3e-3, gcOC%aviation_layers(3)) + z_crs_top = max(4e-3, gcOC%aviation_layers(4)) + + emis_aviation = 0.0 + srcAviation = 0.0 + + call distribute_aviation_emissions(w_c%delp, rhoa, z_lto_bot, z_lto_top, gcOC%aviation_lto_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(w_c%delp, rhoa, z_cds_bot, z_cds_top, gcOC%aviation_cds_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(w_c%delp, rhoa, z_crs_bot, z_crs_top, gcOC%aviation_crs_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + +! Determine surface pressure +! AMS Note: pass this in +! -------------------------- + ps = 0.0 + do k = 1, km + ps(i1:i2,j1:j2) = ps(i1:i2,j1:j2) + w_c%delp(i1:i2,j1:j2,k) + end do + +! Find the pressure of the 100m, 500m, and PBLH altitudes +! AMS Note: this could be greatly simplified by using ze/zm and having a +! generic routine from the bottom up with an early exit condition +! ----------------------------------------------------------------------- + p0 = ps + z0(i1:i2,j1:j2) = 0. + do k = km, 1, -1 + do j = j1, j2 + do i = i1, i2 + p1 = p0(i,j) - w_c%delp(i,j,k) + dz = w_c%delp(i,j,k)/rhoa(i,j,k)/grav + z1 = z0(i,j)+dz + if(z0(i,j) .lt. 100 .and. z1 .ge. 100.) then + delz = z1-100. + delp = delz*rhoa(i,j,k)*grav + p100(i,j) = p1+delp + endif + if(z0(i,j) .lt. 500 .and. z1 .ge. 500.) then + delz = z1-500. + delp = delz*rhoa(i,j,k)*grav + p500(i,j) = p1+delp + endif + zpbl = max ( pblh(i,j), 100. ) + if(z0(i,j) .lt. zpbl .and. z1 .ge. zpbl ) then + delz = z1-zpbl + delp = delz*rhoa(i,j,k)*grav + pPBL(i,j) = p1+delp + endif + p0(i,j) = p1 + z0(i,j) = z1 + end do + end do + end do + +#if 0 + call pmaxmin ( 'OC: p100 ', p100, qmin, qmax, ijl, 1, 1. ) + call pmaxmin ( 'OC: p500 ', p500, qmin, qmax, ijl, 1, 1. ) + call pmaxmin ( 'OC: pPBL ', pPBLh, qmin, qmax, ijl, 1, 1. ) +#endif + + +! Limit biomass burning emissions +! ------------------------------- + allocate(qa_bb_(nbins,i1:i2,j1:j2,km), __STAT__) + qa_bb_ = 0.0 + + p0 = ps +K_LOOP_BB: do k = km, 1, -1 + +! First determine emissions for this layer +! ---------------------------------------- + maxAll = 0.0 + do j = j1, j2 + do i = i1, i2 + + p1 = p0(i,j) - w_c%delp(i,j,k) + +! Pressure @ PBL height +! --------------------- + fPBL = 0. + if(p1 .ge. pPBL(i,j)) fPBL = w_c%delp(i,j,k)/(ps(i,j)-pPBL(i,j)) + if(p1 .lt. pPBL(i,j) .and. p0(i,j) .ge. pPBL(i,j)) fPBL = (p0(i,j)-pPBL(i,j))/(ps(i,j)-pPBL(i,j)) + +! Sources by class in kg m-2 s-1 +! ------------------------------ + srcBiomass(i,j) = fPBL * eBiomass * gcOC%biomass_src(i,j) + + srcHydrophobic(i,j) = gcOC%fHydrophobic * srcBiomass(i,j) + srcHydrophilic(i,j) = (1.-gcOC%fHydrophobic) * srcBiomass(i,j) + +! Update pressure of lower level +! ------------------------------ + p0(i,j) = p1 + + end do ! i + end do ! j + +! Determine global max/min +! ------------------------ + call pmaxmin ( 'OC: Phobic ', srcHydrophobic, qmin, qmax, ijl, 1, 0. ) + maxAll = abs(qmax) + abs(qmin) + call pmaxmin ( 'OC: Philic ', srcHydrophilic, qmin, qmax, ijl, 1, 0. ) + maxAll = max ( maxAll, abs(qmax) + abs(qmin) ) + +! If emissions are zero at this level (globally), we are done +! ----------------------------------------------------------- + if ( maxAll .eq. 0.0 ) exit K_LOOP_BB + +! Update concentrations at this layer +! The "1" element is hydrophobic +! The "2" element is hydrophilic +! ----------------------------------- + factor = cdt * grav / w_c%delp(:,:,k) + + qa_bb_(1,:,:,k) = factor * srcHydrophobic + qa_bb_(2,:,:,k) = factor * srcHydrophilic + + end do K_LOOP_BB + + + nch = gcOC%mie_tables%nch + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + if(nch .gt. 1) then + do i = 1, nch + if ( gcOC%mie_tables%channels(i) .ge. 5.49e-7 .and. & + gcOC%mie_tables%channels(i) .le. 5.51e-7) ilam550 = i + enddo + endif + +! Calculate the extinction and/or scattering AOD + + exttau_bb_(i1:i2,j1:j2) = 0.0 + + do n = 1, nbins + +! Select the name for species and the index + qname = trim(w_c%reg%vname(n1+n-1)) + idx = Chem_MieQueryIdx(gcOC%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(gcOC%mie_tables, idx, ilam550, & + qa_bb_(n,i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau, ssa=ssa) + +! Integrate in the vertical + exttau_bb_(i,j) = exttau_bb_(i,j) + tau + + enddo + enddo + enddo + + enddo ! nbins + + + f_bb_ = 1.0 + cutoff_bb_exttau = (cdt / (24 * 3600.0)) * max_bb_exttau + + do j = j1, j2 + do i = i1, i2 + if (exttau_bb_(i,j) > cutoff_bb_exttau) then + f_bb_(i,j) = cutoff_bb_exttau / exttau_bb_(i,j) + end if + enddo + enddo + + deallocate(qa_bb_, __STAT__) + + +! Now update the tracer mixing ratios with the aerosol sources +! ------------------------------------------------------------ + p0 = ps +K_LOOP: do k = km, 1, -1 + +!!! print *, 'OC_Emissions: getting emissions for layer ', k + +! First determine emissions for this layer +! ---------------------------------------- + maxAll = 0.0 + do j = j1, j2 + do i = i1, i2 + + p1 = p0(i,j) - w_c%delp(i,j,k) + +! Pressure @ 100m +! --------------- + f100 = 0. + if(p1 .ge. p100(i,j)) f100 = w_c%delp(i,j,k)/(ps(i,j)-p100(i,j)) + if(p1 .lt. p100(i,j) .and. p0(i,j) .ge. p100(i,j)) & + f100 = (p0(i,j)-p100(i,j))/(ps(i,j)-p100(i,j)) + +! Pressure @ 500m +! --------------- + f500 = 0. + if ( p0(i,j) .ge. p100(i,j) .and. p1 .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = (p100(i,j)-p1)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = w_c%delp(i,j,k)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .ge. p500(i,j) .and. p1 .lt. p500(i,j)) & + f500 = (p0(i,j)-p500(i,j))/(p100(i,j)-p500(i,j)) + +! Pressure @ PBL height +! --------------------- + fPBL = 0. + if(p1 .ge. pPBL(i,j)) fPBL = w_c%delp(i,j,k)/(ps(i,j)-pPBL(i,j)) + if(p1 .lt. pPBL(i,j) .and. p0(i,j) .ge. pPBL(i,j)) & + fPBL = (p0(i,j)-pPBL(i,j))/(ps(i,j)-pPBL(i,j)) + +! Terpene is tree-top emission; only add in bottom layer +! ------------------------------------------------------ + if ( k .eq. km ) then + fBot = 1.0 + else + fBot = 0.0 + end if + +! Sources by class in kg m-2 s-1 +! ------------------------------ + srcBiofuel(i,j) = f100 * eBiofuel * gcOC%biofuel_src(i,j) + srcAnthro(i,j) = f100 * eAnthro * gcOC%eocant1_src(i,j) & + + f500 * eAnthro * gcOC%eocant2_src(i,j) & + + f100 * eAnthro * gcOC%oc_ship_src(i,j) & + + eAnthro * srcAviation(i,j,k) + srcBiomass(i,j) = fPBL * eBiomass * gcOC%biomass_src(i,j) * f_bb_(i,j) + srcBiogenic(i,j) = fBot * eTerpene * gcOC%terpene_src(i,j) + + srcTmp = srcBiofuel(i,j) + srcAnthro(i,j) + srcBiomass(i,j) + + srcHydrophobic(i,j) = gcOC%fHydrophobic * srcTmp + srcHydrophilic(i,j) = (1.-gcOC%fHydrophobic) * srcTmp + srcBiogenic(i,j) + +! Update pressure of lower level +! ------------------------------ + p0(i,j) = p1 + + end do ! i + end do ! j + +! Determine global max/min +! ------------------------ + call pmaxmin ( 'OC: Phobic ', srcHydrophobic, qmin, qmax, ijl, 1, 0. ) + maxAll = abs(qmax) + abs(qmin) + call pmaxmin ( 'OC: Philic ', srcHydrophilic, qmin, qmax, ijl, 1, 0. ) + maxAll = max ( maxAll, abs(qmax) + abs(qmin) ) + +! If emissions are zero at this level (globally), we are done +! ----------------------------------------------------------- + if ( maxAll .eq. 0.0 ) exit K_LOOP + +! Update concentrations at this layer +! The "1" element is hydrophobic +! The "2" element is hydrophilic +! ----------------------------------- + factor = cdt * grav / w_c%delp(:,:,k) + + w_c%qa(n1)%data3d(:,:,k) = w_c%qa(n1)%data3d(:,:,k) & + + factor * srcHydrophobic + + w_c%qa(n2)%data3d(:,:,k) = w_c%qa(n2)%data3d(:,:,k) & + + factor * srcHydrophilic + +! Fill in diagnostics if requested +! -------------------------------- + if ( associated(OC_emis(1)%data2d)) & + OC_emis(1)%data2d = OC_emis(1)%data2d + srcHydrophobic + + if ( associated(OC_emis(2)%data2d)) & + OC_emis(2)%data2d = OC_emis(2)%data2d + srcHydrophilic + + if ( associated(OC_emisBF%data2d)) & + OC_emisBF%data2d = OC_emisBF%data2d + srcBiofuel + + if ( associated(OC_emisBB%data2d)) & + OC_emisBB%data2d = OC_emisBB%data2d + srcBiomass + + if ( associated(OC_emisAN%data2d)) & + OC_emisAN%data2d = OC_emisAN%data2d + srcAnthro + + if ( associated(OC_emisBG%data2d)) & + OC_emisBG%data2d = OC_emisBG%data2d + srcBiogenic + + end do K_LOOP + +! Distribute pointwise sources if requested +! ----------------------------------------- + if( gcOC%doing_point_emissions .and. gcOC%nPts > 0) then + +! Get indices for point emissions +! ------------------------------- + allocate(iPoint(gcOC%nPts), jPoint(gcOC%nPts), stat=ios) + + call MAPL_GetHorzIJIndex(gcOC%nPts, iPoint, jPoint, & + grid = w_c%grid_esmf, & + lon = gcOC%vLon/radToDeg, & + lat = gcOC%vLat/radToDeg, & + rc = rc) + + if ( rc /= 0 ) call die(myname,'cannot get indices for point emissions') + + do ii = 1, gcOC%nPts + i = iPoint(ii) + j = jPoint(ii) + if( i<1 .OR. j<1 ) cycle ! point emission not in this sub-domain +! if( gcOC%regionMask(i,j) == 0 ) cycle ! masked by region mask + +! Emissions not occurring in current time step +! -------------------------------------------- + if(nhms < gcOC%vStart(ii) .or. nhms >= gcOC%vEnd(ii)) cycle + + call distribute_point_emissions(w_c%delp(i,j,:), rhoa(i,j,:), & + gcOC%vBase(ii), gcOC%vTop(ii), gcOC%vEmis(ii), & + point_column_emissions, km) + w_c%qa(n1)%data3d(i,j,:) = w_c%qa(n1)%data3d(i,j,:) & + + gcOC%fHydrophobic * cdt * grav / w_c%delp(i,j,:) & + * point_column_emissions / w_c%grid%cell_area(i,j) + w_c%qa(n2)%data3d(i,j,:) = w_c%qa(n2)%data3d(i,j,:) & + + (1-gcOC%fHydrophobic) * cdt * grav / w_c%delp(i,j,:) & + * point_column_emissions / w_c%grid%cell_area(i,j) + + enddo + deallocate(iPoint, jPoint, stat=ios) + endif + + + rc = 0 + + end subroutine OC_Emission + + subroutine distribute_aviation_emissions(delp, rhoa, z_bot, z_top, emissions_layer, emissions, i1, i2, j1, j2, km) + + implicit none + + integer, intent(in) :: i1, i2, j1, j2, km + + real, dimension(:,:,:), intent(in) :: delp + real, dimension(:,:,:), intent(in) :: rhoa + real, dimension(:,:), intent(in) :: emissions_layer + real, intent(in) :: z_bot + real, intent(in) :: z_top + real, dimension(:,:,:), intent(out):: emissions + +! local + integer :: i, j, k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ + + do j = j1, j2 + do i = i1, i2 + ! find level height + z = 0.0 + z_= 0.0 + + do k = km, 1, -1 + dz(k) = delp(i,j,k)/rhoa(i,j,k)/grav + z_ = z_ + dz(k) + z(k) = z_ + end do + + ! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + + ! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + + ! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot .eq. k_top) then + w_(k_bot) = z_top - z_bot + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + + ! distribute emissions in the vertical + emissions(i,j,:) = (w_ / sum(w_)) * emissions_layer(i,j) + end do + end do + + end subroutine distribute_aviation_emissions + + +! Abstracted from distribute_aviation_emissions above, but called per column + subroutine distribute_point_emissions(delp, rhoa, z_bot, z_top, emissions_point, & + emissions, km) + + implicit none + + integer, intent(in) :: km + + real, dimension(:), intent(in) :: delp + real, dimension(:), intent(in) :: rhoa + real, intent(in) :: emissions_point + real, intent(in) :: z_bot + real, intent(in) :: z_top + real, dimension(:), intent(out):: emissions + +! local + integer :: k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ + +! find level height + z = 0.0 + z_= 0.0 + + do k = km, 1, -1 + dz(k) = delp(k)/rhoa(k)/grav + z_ = z_ + dz(k) + z(k) = z_ + end do + +! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + +! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + +! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot .eq. k_top) then + w_(k_bot) = z_top - z_bot + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + +! distribute emissions in the vertical + emissions(:) = (w_ / sum(w_)) * emissions_point + + end subroutine distribute_point_emissions + + + end subroutine OC_GridCompRun1_ + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_GridCompRun2_ --- The Chem Driver, run phase 2 +! +! !INTERFACE: +! + + subroutine OC_GridCompRun2_ ( gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(OC_GridComp1), intent(inout) :: gcOC ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called OC Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'OC_GridCompRun2_' + character(len=*), parameter :: Iam = myname + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n, ios + integer :: i, j, k, ijl, ijkl, ijk1l + real :: qmax, qmin + real :: qUpdate, delq + real, pointer :: dqa(:,:), drydepositionfrequency(:,:) + type(Chem_Array), pointer :: fluxout + logical :: KIN + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: frlake, frocean, frseaice, & + oro, u10m, v10m, & + ustar, precc, precl, & + pblh, shflux, z0h, hsurf + real, pointer, dimension(:,:,:) :: tmpu, rhoa, u, v, hghte, ple + real, pointer, dimension(:,:,:) :: pfllsan, pfilsan + + +! Additional needs for GOCART convective diagnostic + real, pointer, dimension(:,:,:) :: cmfmc, qlcn, qicn, dtrain + real, pointer, dimension(:,:) :: area + real*8, allocatable, dimension(:,:,:) :: cmfmc_, qccu_, dtrain_, & + airmass_, airmol_, vud_, & + delz_, delp_, tmpu_, ple_ + real*8, allocatable :: tc_(:,:,:,:), bcnv_(:,:,:) + real*8, allocatable :: area_(:,:), frlake_(:,:), & + frocean_(:,:), frseaice_(:,:) + integer*4 :: icdt + + real, pointer :: OC_radius(:), OC_rhop(:) + integer :: rhFlag + + real, pointer :: var3d(:,:,:) => null() + + +#define EXPORT expChem +#define iNAME TRIM(gcOC%iname) + +#define ptrOCWT OC_wet +#define ptrOCSV OC_conv +#define ptrOCEM OC_emis +#define ptrOCDP OC_dep +#define ptrOCSD OC_set + +#define ptrOCMASS OC_mass +#define ptrOCEMAN OC_emisAN +#define ptrOCEMBB OC_emisBB +#define ptrOCEMBF OC_emisBF +#define ptrOCEMBG OC_emisBG +#define ptrOCPSOA OC_pSOA +#define ptrOCHYPHIL OC_toHydrophilic +#define ptrOCSMASS OC_sfcmass +#define ptrOCCMASS OC_colmass +#define ptrOCEXTTAU OC_exttau +#define ptrOCSCATAU OC_scatau +#define ptrOCCONC OC_conc +#define ptrOCEXTCOEF OC_extcoef +#define ptrOCSCACOEF OC_scacoef +#define ptrOCANGSTR OC_angstrom +#define ptrOCFLUXU OC_fluxu +#define ptrOCFLUXV OC_fluxv + + integer :: STATUS + +#include "OC_GetPointer___.h" + + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_OC + n1 = w_c%reg%i_OC + n2 = w_c%reg%j_OC + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('OC: q_beg', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, frlake, 'FRLAKE', __RC__ ) + call MAPL_GetPointer ( impChem, oro, 'LWI', __RC__ ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', __RC__ ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', __RC__ ) + call MAPL_GetPointer ( impChem, ustar, 'USTAR', __RC__ ) + call MAPL_GetPointer ( impChem, precc, 'CN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, precl, 'NCN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + call MAPL_GetPointer ( impChem, shflux, 'SH', __RC__ ) + call MAPL_GetPointer ( impChem, z0h, 'Z0H', __RC__ ) + call MAPL_GetPointer ( impChem, area, 'AREA', __RC__ ) + call MAPL_GetPointer ( impChem, frocean, 'FROCEAN', __RC__ ) + call MAPL_GetPointer ( impChem, frseaice, 'FRACI', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, u, 'U', __RC__ ) + call MAPL_GetPointer ( impChem, v, 'V', __RC__ ) + call MAPL_GetPointer ( impChem, hghte, 'ZLE', __RC__ ) + call MAPL_GetPointer ( impChem, ple, 'PLE', __RC__ ) + call MAPL_GetPointer ( impChem, qlcn, 'QLCN', __RC__ ) + call MAPL_GetPointer ( impChem, qicn, 'QICN', __RC__ ) + call MAPL_GetPointer ( impChem, cmfmc, 'CNV_MFC', __RC__ ) + call MAPL_GetPointer ( impChem, dtrain, 'CNV_MFD', __RC__ ) + call MAPL_GetPointer ( impChem, pfllsan, 'PFL_LSAN', __RC__ ) + call MAPL_GetPointer ( impChem, pfilsan, 'PFI_LSAN', __RC__ ) + +! Unlike GEOS-4 hghte is defined for km+1 +! --------------------------------------- + hsurf => hghte(i1:i2,j1:j2,km) ! Recall: GEOS-5 has edges with k in [0,km] + + + +#ifdef DEBUG + + call pmaxmin('OC: frlake ', frlake , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: frocean ', frocean , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: frseaice ', frseaice, qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: area ', area , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: oro ', oro , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: u10m ', u10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: v10m ', v10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: ustar ', ustar , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: precc ', precc , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: precl ', precl , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: shflux ', shflux , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: z0h ', z0h , qmin, qmax, ijl,1, 1. ) + call pmaxmin('OC: hsurf ', hsurf , qmin, qmax, ijl,1, 1. ) + + call pmaxmin('OC: tmpu ', tmpu , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('OC: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('OC: u ', u , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('OC: v ', v , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('OC: hghte ', hghte , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('OC: qlcn ', qlcn , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('OC: qicn ', qicn , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('OC: cmfmc ', cmfmc , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('OC: dtrain ', dtrain , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('OC: pfllsan ', pfllsan , qmin, qmax, ijk1l,1, 1. ) + call pmaxmin('OC: pfilsan ', pfilsan , qmin, qmax, ijk1l,1, 1. ) + +#endif + +RUN_ALARM: if (gcOC%run_alarm) then + + allocate( fluxout ) + allocate( fluxout%data2d(i1:i2,j1:j2), dqa(i1:i2,j1:j2), & + drydepositionfrequency(i1:i2,j1:j2), stat=STATUS) + VERIFY_(STATUS) + + +! SOA production from oxidation of anthropogenic VOC + call MAPL_GetPointer(impChem, var3d, 'pSOA_ANTHRO_VOC'//iNAME, __RC__) + gcOC%psoa_anthro_voc = var3d + + where( 1.01 * gcOC%psoa_anthro_voc .gt. undefval) gcOC%psoa_anthro_voc = 0.0 + + +! Add on SOA from Anthropogenic VOC oxidation +! ------------------------------------------- + do k = 1, km + do j = j1, j2 + do i = i1, i2 + w_c%qa(n2)%data3d(i,j,k) = w_c%qa(n2)%data3d(i,j,k) + cdt*gcOC%psoa_anthro_voc(i,j,k)/rhoa(i,j,k) ! hydrophilic + if ( associated(OC_pSOA%data2d)) & + OC_pSOA%data2d(i,j) = OC_pSOA%data2d(i,j) & + + cdt*gcOC%psoa_anthro_voc(i,j,k)*w_c%delp(i,j,k)/rhoa(i,j,k)/grav + end do + end do + end do + + + +! Ad Hoc transfer of hydrophobic to hydrophilic aerosols +! Following Chin's parameterization, the rate constant is +! k = 4.63e-6 s-1 (.4 day-1; e-folding time = 2.5 days) + if(associated(OC_toHydrophilic%data2d)) & + OC_toHydrophilic%data2d(i1:i2,j1:j2) = 0.0 + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + qUpdate = w_c%qa(n1)%data3d(i,j,k)*exp(-4.63e-6*cdt) + qUpdate = max(qUpdate,1.e-32) + delq = max(0.,w_c%qa(n1)%data3d(i,j,k)-qUpdate) + w_c%qa(n1)%data3d(i,j,k) = qUpdate + w_c%qa(n2)%data3d(i,j,k) = w_c%qa(n2)%data3d(i,j,k)+delq + if(associated(OC_toHydrophilic%data2d)) & + OC_toHydrophilic%data2d(i,j) = OC_toHydrophilic%data2d(i,j) & + + delq*w_c%delp(i,j,k)/grav/cdt + end do + end do + end do + +! OC Settling +! ----------- + allocate( OC_radius(nbins), OC_rhop(nbins) ) + OC_radius(:) = 0.35e-6 ! radius for settling [m] + OC_rhop(:) = 1800. ! density for setting [kg m-3] + rhFlag = 0 ! settle like dry particles + call Chem_Settling ( i1, i2, j1, j2, km, n1, n2, nbins, rhFlag, & + OC_radius, OC_rhop, cdt, w_c, tmpu, rhoa, hsurf, & + hghte, OC_set, rc ) + deallocate( OC_radius, OC_rhop) + +! OC Deposition +! ----------- + drydepositionfrequency = 0. + call DryDepositionGOCART( i1, i2, j1, j2, km, & + tmpu, rhoa, hghte, oro, ustar, & + pblh, shflux, z0h, drydepositionfrequency, rc ) + + do n = 1, nbins + dqa = 0. + dqa = max(0.0, w_c%qa(n1+n-1)%data3d(:,:,km)*(1.-exp(-drydepositionfrequency*cdt))) + w_c%qa(n1+n-1)%data3d(:,:,km) = & + w_c%qa(n1+n-1)%data3d(:,:,km) - dqa + if( associated(OC_dep(n)%data2d) ) & + OC_dep(n)%data2d = dqa*w_c%delp(:,:,km)/grav/cdt + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('OC: q_dry', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Organic Carbon Large-scale Wet Removal +! -------------------------------------- +! Hydrophobic mode (first tracer) is not removed + if(associated(OC_wet(1)%data2d)) OC_wet(1)%data2d = 0. +! Hydrophilic mode (second tracer) is removed + KIN = .TRUE. + do n = nbins, nbins + w_c%qa(n1+n-1)%fwet = 1. + call WetRemovalGOCART(i1, i2, j1, j2, km, n1+n-1, n1+n-1, cdt, 'OC', KIN, & + w_c%qa, ple, tmpu, rhoa, pfllsan, pfilsan, & + precc, precl, fluxout, rc ) + if(associated(OC_wet(n)%data2d)) OC_wet(n)%data2d = fluxout%data2d + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('OC: q_wet', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! Organic Carbon Convective-scale Mixing and Wet Removal +! ------------------------------------------------------ + KIN = .TRUE. + icdt = cdt + allocate(cmfmc_(i1:i2,j1:j2,km+1), qccu_(i1:i2,j1:j2,km), & + dtrain_(i1:i2,j1:j2,km), airmass_(i1:i2,j1:j2,km), & + delz_(i1:i2,j1:j2,km), vud_(i1:i2,j1:j2,km), & + tc_(i1:i2,j1:j2,km,n1:n2), delp_(i1:i2,j1:j2,km), & + airmol_(i1:i2,j1:j2,km), tmpu_(i1:i2,j1:j2,km), & + bcnv_(i1:i2,j1:j2,n1:n2), ple_(i1:i2,j1:j2,km+1), & + area_(i1:i2,j1:j2), frlake_(i1:i2,j1:j2), & + frocean_(i1:i2,j1:j2), frseaice_(i1:i2,j1:j2), __STAT__ ) + + bcnv_ = 0.0 + area_ = area + frlake_ = frlake + frocean_ = frocean + frseaice_ = frseaice + do k = 1, km+1 + cmfmc_(:,:,k) = cmfmc(:,:,km-k+1) + ple_(:,:,k) = ple(:,:,km-k+1) + end do + do k = 1, km + dtrain_(:,:,k) = dtrain(:,:,km-k+1) + qccu_(:,:,k) = qlcn(:,:,km-k+1) + qicn(:,:,km-k+1) + delp_(:,:,k) = w_c%delp(:,:,km-k+1)/100. + airmass_(:,:,k) = w_c%delp(:,:,km-k+1)/grav*area_ + airmol_(:,:,k) = airmass_(:,:,k)*1000./28.966 + delz_(:,:,k) = w_c%delp(:,:,km-k+1)/grav/rhoa(:,:,km-k+1) + tmpu_(:,:,k) = tmpu(:,:,km-k+1) + enddo + do n = n1, n2 + do k = 1, km + tc_(:,:,k,n) = w_c%qa(n)%data3d(:,:,km-k+1) + enddo + enddo + call set_vud(i1, i2, j1, j2, km, frlake_, frocean_, frseaice_, cmfmc_, qccu_, & + airmass_, delz_, area_, vud_) + call convection(i1, i2, j1, j2, km, n1, n2, icdt, 'OC', kin, & + tc_, cmfmc_, dtrain_, area_, delz_, delp_, vud_, & + airmass_, airmol_, tmpu_, ple_, & + bcnv_) + +! Return adjusted tracer to mixing ratio + do n = n1, n2 + do k = 1, km + w_c%qa(n)%data3d(:,:,km-k+1) = tc_(:,:,k,n) + enddo + enddo + +! Note GOCART returns bcnv_ as negative, recast for my diagnostic + if(associated(OC_conv(1)%data2d)) OC_conv(1)%data2d = 0.0 + if(associated(OC_conv(2)%data2d)) OC_conv(2)%data2d = -bcnv_(:,:,n2)/area_/icdt + +! Clean up +! -------- + deallocate(cmfmc_, qccu_, dtrain_, tc_, airmass_, & + delz_, vud_, delp_, airmol_, tmpu_, bcnv_, ple_, & + area_, frlake_, frocean_, frseaice_, __STAT__ ) + + deallocate(fluxout%data2d) + deallocate(fluxout, dqa, drydepositionfrequency, stat=ios ) + + end if RUN_ALARM + + +! Compute the desired output diagnostics here +! Ideally this will go where chemout is called in fvgcm.F since that +! will reflect the distributions after transport, etc. +! ----------- + call OC_Compute_Diags(i1, i2, j1, j2, km, nbins, gcOC, w_c, tmpu, rhoa, u, v, & + OC_sfcmass, OC_colmass, OC_mass, OC_exttau, & + OC_scatau, OC_conc, OC_extcoef, OC_scacoef, OC_angstrom, & + OC_fluxu, OC_fluxv, rc) + + return + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_Compute_Diags - Calculate dust 2D diagnostics +! +! !INTERFACE: +! + + subroutine OC_Compute_Diags ( i1, i2, j1, j2, km, nbins, gcOC, w_c, tmpu, rhoa, u, v, & + sfcmass, colmass, mass, exttau, scatau, & + conc, extcoef, scacoef, angstrom, fluxu, fluxv, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2, km, nbins + type(OC_GridComp1), intent(inout):: gcOC ! OC Grid Component + type(Chem_Bundle), intent(in) :: w_c ! Chem Bundle + real, pointer, dimension(:,:,:) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:,:) :: u ! east-west wind [m s-1] + real, pointer, dimension(:,:,:) :: v ! north-south wind [m s-1] + +! !OUTPUT PARAMETERS: + type(Chem_Array), intent(inout) :: sfcmass ! sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: colmass ! col mass density kg/m2 + type(Chem_Array), intent(inout) :: mass ! 3d mass mixing ratio kg/kg + type(Chem_Array), intent(inout) :: exttau ! ext. AOT at 550 nm + type(Chem_Array), intent(inout) :: scatau ! sct. AOT at 550 nm + type(Chem_Array), intent(inout) :: conc ! 3d mass concentration, kg/m3 + type(Chem_Array), intent(inout) :: extcoef ! 3d ext. coefficient, 1/m + type(Chem_Array), intent(inout) :: scacoef ! 3d scat.coefficient, 1/m + type(Chem_Array), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter + type(Chem_Array), intent(inout) :: fluxu ! Column mass flux in x direction + type(Chem_Array), intent(inout) :: fluxv ! Column mass flux in y direction + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Calculates some simple 2d diagnostics from the OC fields +! Surface concentration (dry) +! Column mass load (dry) +! Extinction aot 550 (wet) +! Scattering aot 550 (wet) +! For the moment, this is hardwired. +! +! !REVISION HISTORY: +! +! 16APR2004, Colarco +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + character(len=*), parameter :: myname = 'OC_Compute_Diags' + integer :: i, j, k, n, n1, n2, ios, nch, idx + real :: tau, ssa + character(len=255) :: qname + real, dimension(i1:i2,j1:j2) :: tau470, tau870 + real :: ilam550, ilam470, ilam870 + logical :: do_angstrom + + +! Initialize local variables +! -------------------------- + n1 = w_c%reg%i_OC + n2 = w_c%reg%j_OC + nch = gcOC%mie_tables%nch + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + ilam470 = 0. + ilam870 = 0. + if(nch .gt. 1) then + do i = 1, nch + if ( gcOC%mie_tables%channels(i) .ge. 5.49e-7 .and. & + gcOC%mie_tables%channels(i) .le. 5.51e-7) ilam550 = i + if ( gcOC%mie_tables%channels(i) .ge. 4.69e-7 .and. & + gcOC%mie_tables%channels(i) .le. 4.71e-7) ilam470 = i + if ( gcOC%mie_tables%channels(i) .ge. 8.69e-7 .and. & + gcOC%mie_tables%channels(i) .le. 8.71e-7) ilam870 = i + enddo + endif + +! Determine if going to do Angstrom parameter calculation +! ------------------------------------------------------- + do_angstrom = .false. +! If both 470 and 870 channels provided (and not the same) then +! possibly will do Angstrom parameter calculation + if(ilam470 .ne. 0. .and. & + ilam870 .ne. 0. .and. & + ilam470 .ne. ilam870) do_angstrom = .true. + + +! Calculate the diagnostic variables if requested +! ----------------------------------------------- + +! Calculate the surface mass concentration + if( associated(sfcmass%data2d) ) then + sfcmass%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + sfcmass%data2d(i1:i2,j1:j2) & + = sfcmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + end do + endif + +! Calculate the dust column loading + if( associated(colmass%data2d) ) then + colmass%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + colmass%data2d(i1:i2,j1:j2) & + = colmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + end do + end do + endif + +! Calculate the total mass concentration + if( associated(conc%data3d) ) then + conc%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + conc%data3d(i1:i2,j1:j2,1:km) & + = conc%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km)*rhoa(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the total mass mixing ratio + if( associated(mass%data3d) ) then + mass%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + mass%data3d(i1:i2,j1:j2,1:km) & + = mass%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the column mass flux in x direction + if( associated(fluxu%data2d) ) then + fluxu%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + fluxu%data2d(i1:i2,j1:j2) & + = fluxu%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*u(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the column mass flux in y direction + if( associated(fluxv%data2d) ) then + fluxv%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + fluxv%data2d(i1:i2,j1:j2) & + = fluxv%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*v(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the extinction and/or scattering AOD + if( associated(exttau%data2d) .or. associated(scatau%data2d) ) then + + if( associated(exttau%data2d) ) then + exttau%data2d(i1:i2,j1:j2) = 0. + endif + if( associated(scatau%data2d) ) then + scatau%data2d(i1:i2,j1:j2) = 0. + endif + + if( associated(extcoef%data3d)) then + extcoef%data3d(i1:i2,j1:j2,1:km) = 0. + endif + if( associated(scacoef%data3d)) then + scacoef%data3d(i1:i2,j1:j2,1:km) = 0. + endif + + do n = 1, nbins + +! Select the name for species and the index + qname = trim(w_c%reg%vname(n1+n-1)) + idx = Chem_MieQueryIdx(gcOC%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(gcOC%mie_tables, idx, ilam550, & + w_c%qa(n1+n-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau, ssa=ssa) + +! Calculate the total ext. and scat. coefficients + if( associated(extcoef%data3d) ) then + extcoef%data3d(i,j,k) = extcoef%data3d(i,j,k) + & + tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + if( associated(scacoef%data3d) ) then + scacoef%data3d(i,j,k) = scacoef%data3d(i,j,k) + & + ssa * tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + +! Integrate in the vertical + if( associated(exttau%data2d) ) then + exttau%data2d(i,j) = exttau%data2d(i,j) + tau + endif + if( associated(scatau%data2d) ) then + scatau%data2d(i,j) = scatau%data2d(i,j) + tau*ssa + endif + + enddo + enddo + enddo + + enddo ! nbins + + endif + +! Calculate the 470-870 Angstrom parameter + if( associated(angstrom%data2d) .and. do_angstrom ) then + + angstrom%data2d(i1:i2,j1:j2) = 0. +! Set tau to small number by default + tau470(i1:i2,j1:j2) = tiny(1.0) + tau870(i1:i2,j1:j2) = tiny(1.0) + + do n = 1, nbins + +! Select the name for species + qname = trim(w_c%reg%vname(n+n1-1)) + idx = Chem_MieQueryIdx(gcOC%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + + call Chem_MieQuery(gcOC%mie_tables, idx, ilam470, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau470(i,j) = tau470(i,j) + tau + + call Chem_MieQuery(gcOC%mie_tables, idx, ilam870, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau870(i,j) = tau870(i,j) + tau + + enddo + enddo + enddo + + enddo ! nbins + angstrom%data2d(i1:i2,j1:j2) = & + -log(tau470(i1:i2,j1:j2)/tau870(i1:i2,j1:j2)) / & + log(470./870.) + endif + + + rc = 0 + + end subroutine OC_Compute_Diags + + end subroutine OC_GridCompRun2_ + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + subroutine OC_GridCompFinalize1_ ( gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(OC_GridComp1), intent(inout) :: gcOC ! Grid Component + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Import State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + integer :: ios + character(len=*), parameter :: myname = 'OC_GridCompFinalize' + +! If initialized pointwise emissions from daily tables, clean-up + if(associated(gcOC%vLat)) deallocate(gcOC%vLat, stat=ios) + if(associated(gcOC%vLon)) deallocate(gcOC%vLon, stat=ios) + if(associated(gcOC%vEmis)) deallocate(gcOC%vEmis, stat=ios) + if(associated(gcOC%vBase)) deallocate(gcOC%vBase, stat=ios) + if(associated(gcOC%vTop)) deallocate(gcOC%vTop, stat=ios) + if(associated(gcOC%vStart)) deallocate(gcOC%vStart, stat=ios) + if(associated(gcOC%vEnd)) deallocate(gcOC%vEnd, stat=ios) + + rc=0 + return + + end subroutine OC_GridCompFinalize1_ + + end module OC_GridCompMod + + +!----------------------------------------------------------------------- + +! Single Instance Wrapper + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: OC_SingleInstance_ --- Runs single instance of method +! +! !INTERFACE: +! + subroutine OC_SingleInstance_ ( Method_, instance, & + gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + Use OC_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! Input "function pointer" +! ----------------------- + interface + subroutine Method_ (gc, w, imp, exp, ymd, hms, dt, rcode ) + Use OC_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + type(OC_GridComp1), intent(inout) :: gc + type(Chem_Bundle), intent(in) :: w + type(ESMF_State), intent(inout) :: imp + type(ESMF_State), intent(inout) :: exp + integer, intent(in) :: ymd, hms + real, intent(in) :: dt + integer, intent(out) :: rcode + end subroutine Method_ + end interface + + integer, intent(in) :: instance ! instance number + + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(OC_GridComp1), INTENT(INOUT) :: gcOC ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer n_OC, i_OC, j_OC + character(len=255) :: i_qname, j_qname + +! Save overall CO indices +! ----------------------- + n_OC = w_c%reg%n_OC + i_OC = w_c%reg%i_OC + j_OC = w_c%reg%j_OC + +! Save the name of the variables in this instance +! ----------------------------------------------- + i_qname = trim(w_c%reg%vname(i_OC + 2*(instance - 1))) + j_qname = trim(w_c%reg%vname(i_OC + 2*(instance - 1) + 1)) + +! Customize indices for this particular instance +! ---------------------------------------------- + w_c%reg%n_OC = 2 + w_c%reg%i_OC = i_OC + 2*(instance - 1) + w_c%reg%j_OC = i_OC + 2*(instance - 1) + 1 + w_c%reg%vname(i_OC + 2*(instance - 1)) = w_c%reg%vname(i_OC) + w_c%reg%vname(i_OC + 2*(instance - 1) + 1) = w_c%reg%vname(i_OC + 1) + +! Execute the instance method +! --------------------------- + call Method_ ( gcOC, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! Restore the overall OC indices +! ------------------------------ + w_c%reg%vname(i_OC + 2*(instance - 1)) = i_qname + w_c%reg%vname(i_OC + 2*(instance - 1) + 1) = j_qname + w_c%reg%n_OC = n_OC + w_c%reg%i_OC = i_OC + w_c%reg%j_OC = j_OC + + end subroutine OC_SingleInstance_ + +!----------------------------------------------------------------------- diff --git a/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..bc479d7d --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/OC_GridComp_ExtData.rc @@ -0,0 +1,30 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_oc.006.%y4%m2%d2.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/PIESA/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.surface.x3600_y1800_t12.2010.nc4 +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.elevated.x3600_y1800_t12.2010.nc4 + +# EDGAR based ship emissions +OC_SHIP NA Y Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.ships.x3600_y1800_t12.2010.nc4 + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.aviation_lto.x3600_y1800_t12.2010.nc4 +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.aviation_cds.x3600_y1800_t12.2010.nc4 +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none oc_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_oc.aviation_crs.x3600_y1800_t12.2010.nc4 + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/OC_Registry.rc b/ESMF/GOCART_GridComp/OC_GridComp/OC_Registry.rc new file mode 100644 index 00000000..6984f504 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/OC_Registry.rc @@ -0,0 +1,340 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: OC + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl|# Sub| Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASS | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio __ENSEMBLE__ + OCCONC | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration __ENSEMBLE__ + OCEXTCOEF| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] __ENSEMBLE__ + OCSCACOEF| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] __ENSEMBLE__ +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001 | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 __ENSEMBLE__ + OCEM002 | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 __ENSEMBLE__ + OCSD001 | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 __ENSEMBLE__ + OCSD002 | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 __ENSEMBLE__ + OCDP001 | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 __ENSEMBLE__ + OCDP002 | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 __ENSEMBLE__ + OCWT001 | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 __ENSEMBLE__ + OCWT002 | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 __ENSEMBLE__ + OCSV001 | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 __ENSEMBLE__ + OCSV002 | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 __ENSEMBLE__ + OCHYPHIL | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic __ENSEMBLE__ + OCEMAN | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions __ENSEMBLE__ + OCEMBB | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions __ENSEMBLE__ + OCEMBF | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions __ENSEMBLE__ + OCEMBG | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions __ENSEMBLE__ + OCPSOA | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production __ENSEMBLE__ + OCSMASS | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration __ENSEMBLE__ + OCCMASS | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density __ENSEMBLE__ + OCEXTTAU | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] __ENSEMBLE__ + OCSCATAU | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] __ENSEMBLE__ + OCANGSTR | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] __ENSEMBLE__ + OCFLUXU | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux __ENSEMBLE__ + OCFLUXV | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux __ENSEMBLE__ +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASSbiob | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio biob + OCCONCbiob | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration biob + OCEXTCOEFbiob| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] biob + OCSCACOEFbiob| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] biob +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001biob | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 biob + OCEM002biob | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 biob + OCSD001biob | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 biob + OCSD002biob | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 biob + OCDP001biob | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 biob + OCDP002biob | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 biob + OCWT001biob | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 biob + OCWT002biob | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 biob + OCSV001biob | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 biob + OCSV002biob | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 biob + OCHYPHILbiob | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic biob + OCEMANbiob | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions biob + OCEMBBbiob | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions biob + OCEMBFbiob | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions biob + OCEMBGbiob | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions biob + OCPSOAbiob | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production biob + OCSMASSbiob | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration biob + OCCMASSbiob | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density biob + OCEXTTAUbiob | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] biob + OCSCATAUbiob | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] biob + OCANGSTRbiob | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] biob + OCFLUXUbiob | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux biob + OCFLUXVbiob | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux biob +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASSanth | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio anth + OCCONCanth | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration anth + OCEXTCOEFanth| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] anth + OCSCACOEFanth| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] anth +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001anth | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 anth + OCEM002anth | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 anth + OCSD001anth | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 anth + OCSD002anth | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 anth + OCDP001anth | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 anth + OCDP002anth | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 anth + OCWT001anth | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 anth + OCWT002anth | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 anth + OCSV001anth | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 anth + OCSV002anth | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 anth + OCHYPHILanth | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic anth + OCEMANanth | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions anth + OCEMBBanth | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions anth + OCEMBFanth | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions anth + OCEMBGanth | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions anth + OCPSOAanth | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production anth + OCSMASSanth | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration anth + OCCMASSanth | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density anth + OCEXTTAUanth | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] anth + OCSCATAUanth | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] anth + OCANGSTRanth | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] anth + OCFLUXUanth | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux anth + OCFLUXVanth | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux anth +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASSbsun | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio bsun + OCCONCbsun | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration bsun + OCEXTCOEFbsun| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] bsun + OCSCACOEFbsun| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] bsun +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001bsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 bsun + OCEM002bsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 bsun + OCSD001bsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 bsun + OCSD002bsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 bsun + OCDP001bsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 bsun + OCDP002bsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 bsun + OCWT001bsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 bsun + OCWT002bsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 bsun + OCSV001bsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 bsun + OCSV002bsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 bsun + OCHYPHILbsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic bsun + OCEMANbsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions bsun + OCEMBBbsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions bsun + OCEMBFbsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions bsun + OCEMBGbsun | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions bsun + OCPSOAbsun | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production bsun + OCSMASSbsun | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration bsun + OCCMASSbsun | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density bsun + OCEXTTAUbsun | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] bsun + OCSCATAUbsun | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] bsun + OCANGSTRbsun | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] bsun + OCFLUXUbsun | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux bsun + OCFLUXVbsun | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux bsun +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASSbmon | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio bmon + OCCONCbmon | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration bmon + OCEXTCOEFbmon| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] bmon + OCSCACOEFbmon| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] bmon +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001bmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 bmon + OCEM002bmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 bmon + OCSD001bmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 bmon + OCSD002bmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 bmon + OCDP001bmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 bmon + OCDP002bmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 bmon + OCWT001bmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 bmon + OCWT002bmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 bmon + OCSV001bmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 bmon + OCSV002bmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 bmon + OCHYPHILbmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic bmon + OCEMANbmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions bmon + OCEMBBbmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions bmon + OCEMBFbmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions bmon + OCEMBGbmon | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions bmon + OCPSOAbmon | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production bmon + OCSMASSbmon | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration bmon + OCCMASSbmon | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density bmon + OCEXTTAUbmon | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] bmon + OCSCATAUbmon | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] bmon + OCANGSTRbmon | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] bmon + OCFLUXUbmon | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux bmon + OCFLUXVbmon | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux bmon +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASSbtue | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio btue + OCCONCbtue | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration btue + OCEXTCOEFbtue| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] btue + OCSCACOEFbtue| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] btue +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001btue | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 btue + OCEM002btue | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 btue + OCSD001btue | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 btue + OCSD002btue | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 btue + OCDP001btue | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 btue + OCDP002btue | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 btue + OCWT001btue | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 btue + OCWT002btue | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 btue + OCSV001btue | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 btue + OCSV002btue | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 btue + OCHYPHILbtue | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic btue + OCEMANbtue | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions btue + OCEMBBbtue | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions btue + OCEMBFbtue | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions btue + OCEMBGbtue | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions btue + OCPSOAbtue | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production btue + OCSMASSbtue | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration btue + OCCMASSbtue | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density btue + OCEXTTAUbtue | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] btue + OCSCATAUbtue | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] btue + OCANGSTRbtue | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] btue + OCFLUXUbtue | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux btue + OCFLUXVbtue | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux btue +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASSbwed | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio bwed + OCCONCbwed | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration bwed + OCEXTCOEFbwed| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] bwed + OCSCACOEFbwed| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] bwed +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001bwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 bwed + OCEM002bwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 bwed + OCSD001bwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 bwed + OCSD002bwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 bwed + OCDP001bwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 bwed + OCDP002bwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 bwed + OCWT001bwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 bwed + OCWT002bwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 bwed + OCSV001bwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 bwed + OCSV002bwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 bwed + OCHYPHILbwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic bwed + OCEMANbwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions bwed + OCEMBBbwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions bwed + OCEMBFbwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions bwed + OCEMBGbwed | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions bwed + OCPSOAbwed | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production bwed + OCSMASSbwed | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration bwed + OCCMASSbwed | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density bwed + OCEXTTAUbwed | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] bwed + OCSCATAUbwed | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] bwed + OCANGSTRbwed | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] bwed + OCFLUXUbwed | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux bwed + OCFLUXVbwed | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux bwed +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASSbthu | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio bthu + OCCONCbthu | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration bthu + OCEXTCOEFbthu| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] bthu + OCSCACOEFbthu| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] bthu +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001bthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 bthu + OCEM002bthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 bthu + OCSD001bthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 bthu + OCSD002bthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 bthu + OCDP001bthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 bthu + OCDP002bthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 bthu + OCWT001bthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 bthu + OCWT002bthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 bthu + OCSV001bthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 bthu + OCSV002bthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 bthu + OCHYPHILbthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic bthu + OCEMANbthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions bthu + OCEMBBbthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions bthu + OCEMBFbthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions bthu + OCEMBGbthu | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions bthu + OCPSOAbthu | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production bthu + OCSMASSbthu | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration bthu + OCCMASSbthu | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density bthu + OCEXTTAUbthu | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] bthu + OCSCATAUbthu | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] bthu + OCANGSTRbthu | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] bthu + OCFLUXUbthu | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux bthu + OCFLUXVbthu | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux bthu +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASSbfri | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio bfri + OCCONCbfri | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration bfri + OCEXTCOEFbfri| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] bfri + OCSCACOEFbfri| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] bfri +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001bfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 bfri + OCEM002bfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 bfri + OCSD001bfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 bfri + OCSD002bfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 bfri + OCDP001bfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 bfri + OCDP002bfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 bfri + OCWT001bfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 bfri + OCWT002bfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 bfri + OCSV001bfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 bfri + OCSV002bfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 bfri + OCHYPHILbfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic bfri + OCEMANbfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions bfri + OCEMBBbfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions bfri + OCEMBFbfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions bfri + OCEMBGbfri | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions bfri + OCPSOAbfri | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production bfri + OCSMASSbfri | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration bfri + OCCMASSbfri | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density bfri + OCEXTTAUbfri | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] bfri + OCSCATAUbfri | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] bfri + OCANGSTRbfri | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] bfri + OCFLUXUbfri | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux bfri + OCFLUXVbfri | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux bfri +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASSbsat | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio bsat + OCCONCbsat | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration bsat + OCEXTCOEFbsat| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] bsat + OCSCACOEFbsat| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] bsat +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001bsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 bsat + OCEM002bsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 bsat + OCSD001bsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 bsat + OCSD002bsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 bsat + OCDP001bsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 bsat + OCDP002bsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 bsat + OCWT001bsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 bsat + OCWT002bsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 bsat + OCSV001bsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 bsat + OCSV002bsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 bsat + OCHYPHILbsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic bsat + OCEMANbsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions bsat + OCEMBBbsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions bsat + OCEMBFbsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions bsat + OCEMBGbsat | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions bsat + OCPSOAbsat | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production bsat + OCSMASSbsat | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration bsat + OCCMASSbsat | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density bsat + OCEXTTAUbsat | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] bsat + OCSCATAUbsat | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] bsat + OCANGSTRbsat | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] bsat + OCFLUXUbsat | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux bsat + OCFLUXVbsat | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux bsat +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + OCMASSbbgl | kg kg-1 | xyz | C | | | | | Organic Carbon Mass Mixing Ratio bbgl + OCCONCbbgl | kg m-3 | xyz | C | | | | | Organic Carbon Mass Concentration bbgl + OCEXTCOEFbbgl| m-1 | xyz | C | | | | | Organic Carbon Ext. Coefficient [550 nm] bbgl + OCSCACOEFbbgl| m-1 | xyz | C | | | | | Organic Carbon Scatt. Coefficient [550 nm] bbgl +# .........|............|.....|...|....|...|...|.....|.................................. + OCEM001bbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 001 bbgl + OCEM002bbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Emission Bin 002 bbgl + OCSD001bbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 001 bbgl + OCSD002bbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Sedimentation Bin 002 bbgl + OCDP001bbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 001 bbgl + OCDP002bbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Dry Deposition Bin 002 bbgl + OCWT001bbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 001 bbgl + OCWT002bbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Wet Deposition Bin 002 bbgl + OCSV001bbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 001 bbgl + OCSV002bbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Convective Scavenging Bin 002 bbgl + OCHYPHILbbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Hydrophobic to Hydrophilic bbgl + OCEMANbbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Anthropogenic Emissions bbgl + OCEMBBbbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Biomass Burning Emissions bbgl + OCEMBFbbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Biofuel Emissions bbgl + OCEMBGbbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon Biogenic Emissions bbgl + OCPSOAbbgl | kg m-2 s-1 | xy | | | | | | Organic Carbon SOA Production bbgl + OCSMASSbbgl | kg m-3 | xy | | | | | | Organic Carbon Surface Mass Concentration bbgl + OCCMASSbbgl | kg m-2 | xy | | | | | | Organic Carbon Column Mass Density bbgl + OCEXTTAUbbgl | 1 | xy | | | | | | Organic Carbon Extinction AOT [550 nm] bbgl + OCSCATAUbbgl | 1 | xy | | | | | | Organic Carbon Scattering AOT [550 nm] bbgl + OCANGSTRbbgl | 1 | xy | | | | | | Organic Carbon Angstrom parameter [470-870 nm] bbgl + OCFLUXUbbgl | kg m-1 s-1 | xy | | | | | | Organic Carbon column u-wind mass flux bbgl + OCFLUXVbbgl | kg m-1 s-1 | xy | | | | | | Organic Carbon column v-wind mass flux bbgl + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp---anth.rc b/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp---anth.rc new file mode 100644 index 00000000..d6d6358e --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp---anth.rc @@ -0,0 +1,40 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 diff --git a/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp---biob.rc b/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp---biob.rc new file mode 100644 index 00000000..0b5f1269 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp---biob.rc @@ -0,0 +1,40 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 diff --git a/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp---full.rc b/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp---full.rc new file mode 100755 index 00000000..e36b3530 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp---full.rc @@ -0,0 +1,47 @@ +# +# Resource file for OC parameters. +# + +number_oc_classes: 2 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +OC_regions_indices: global + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of terpene emissions for SOA production +terpene_emission_fraction: 0.1 + +# Ratio of POM/OC -> convert source masses from carbon to POM +pom_oc_ratio: 1.4 + +# Initially hydrophobic portion +hydrophobic_fraction: 0.5 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.4 + +# Dry particle density [kg m-3] +particle_density: 1800 1800 + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.18 0.18 + +# Number of particles per kg mass +fnum: 9.76e17 9.76e17 + +# Number median radius [um] +particle_radius_number: 0.0212 0.0212 + +# Sigma of lognormal number distribution +sigma: 2.20 2.20 + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + +# Bounding box for cropping NEI08 emissions (US and Canada) +# nei_boundingbox: 130 -60 23.75 56.5 + diff --git a/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp.rc b/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp.rc new file mode 100644 index 00000000..ee1efb53 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp.rc @@ -0,0 +1,19 @@ +# +# OC main resource file defining the particular instances. +# +# For detailed description of the ARCTAS tags consult: +# +# http://geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_ARCTAS +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N,90N] +# Non-Boreal | bbnb | [90S,45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +OC_instances: full biob anth diff --git a/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp_ExtData.rc new file mode 100644 index 00000000..be49a5f1 --- /dev/null +++ b/ESMF/GOCART_GridComp/OC_GridComp/PIESA/OC_GridComp_ExtData.rc @@ -0,0 +1,34 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_oc.005.%y4%m2%d2.nc4 + +# Terpene emission +OC_TERPENE NA Y Y %y4-%m2-%d2t12:00:00 none none terpene ExtData/PIESA/sfc/geia.terpene_biogenic.x144_y91_t12.1971.nc + +# Biofuel Source -- Included in AeroCom anthropogenic emissions +OC_BIOFUEL NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +OC_ANTEOC1 NA N Y %y4-%m2-%d2t12:00:00 none none anteoc1 ExtData/PIESA/sfc/AeroCom.noship_OC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +OC_ANTEOC2 NA Y Y %y4-%m2-%d2t12:00:00 none none anteoc2 /dev/null + +# EDGAR based ship emissions +OC_SHIP NA N Y %y4-%m2-%d2t12:00:00 none none oc_ship ExtData/PIESA/sfc/AeroCom.ship_OC_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc + +# Aviation emissions during the three phases of flight +OC_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null +OC_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# Anthropogenic emissions from NEI08 (National Emission Inventory, only US and Canada) +# OC_NEI_BOT NA N Y 0 none none OC /discover/nobackup/projects/gmao/share/dasilva/fvInput/AeroCom/sfc/NEI08.bot.x1152_y721_t8760.2010.nc4 +# OC_NEI_TOP NA N Y 0 none none OC /discover/nobackup/projects/gmao/share/dasilva/fvInput/AeroCom/sfc/NEI08.top.x1152_y721_t8760.2010.nc4 + +# SOA production +pSOA_ANTHRO_VOC NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null +%% + diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/CMIP/Rn_GridComp.rc b/ESMF/GOCART_GridComp/Rn_GridComp/CMIP/Rn_GridComp.rc new file mode 100644 index 00000000..c1c5eb56 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/CMIP/Rn_GridComp.rc @@ -0,0 +1,16 @@ +# +# Radon main resource file defining the particular instances. +# Regions based on: RADON.region_mask.x540_y361.2008.nc +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Asia | Asia | 4 +# Europe | Euro | 3 +# North America | NoAm | 1,2 +# Sorth America | SoAm | 6 +# Africa | Afri | 5 +# Australia | Aust | 7 +# ------------------|-------|------------ + +Rn_instances: full Asia Euro NoAm SoAm Afri Aust diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/Rn_GridComp/CMakeLists.txt new file mode 100644 index 00000000..61bcc3ab --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-E\;-F\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/MERRA2/Rn_GridComp.rc b/ESMF/GOCART_GridComp/Rn_GridComp/MERRA2/Rn_GridComp.rc new file mode 100644 index 00000000..c1c5eb56 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/MERRA2/Rn_GridComp.rc @@ -0,0 +1,16 @@ +# +# Radon main resource file defining the particular instances. +# Regions based on: RADON.region_mask.x540_y361.2008.nc +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Asia | Asia | 4 +# Europe | Euro | 3 +# North America | NoAm | 1,2 +# Sorth America | SoAm | 6 +# Africa | Afri | 5 +# Australia | Aust | 7 +# ------------------|-------|------------ + +Rn_instances: full Asia Euro NoAm SoAm Afri Aust diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/NR/Rn_GridComp---full.rc b/ESMF/GOCART_GridComp/Rn_GridComp/NR/Rn_GridComp---full.rc new file mode 100644 index 00000000..99ba0ec2 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/NR/Rn_GridComp---full.rc @@ -0,0 +1,32 @@ +# +# Resource file for Radon parameters. +# + +number_Rn_bins: 1 +Rn_regions: ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +Rn_regions_indices: -1 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Half-life and unit, which must be "years", "days", or "seconds". +# ---------------------------------------------------------------- +HalfLife: 3.823 +HalfLifeUnit: days + +# Emission, mBq m^{-2} s^{-1} +# --------------------------- +Rn_emission_file_name: ExtData/g5chem/sfc/gocart.radon.x540_y361.nc + +# Run-time debug switch [0 = off, 1 = on] +# --------------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/NR/Rn_GridComp.rc b/ESMF/GOCART_GridComp/Rn_GridComp/NR/Rn_GridComp.rc new file mode 100644 index 00000000..ba969d58 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/NR/Rn_GridComp.rc @@ -0,0 +1,16 @@ +# +# Radon main resource file defining the particular instances. +# Regions based on: RADON.region_mask.x540_y361.2008.nc +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Asia | Asia | 4 +# Europe | Euro | 3 +# North America | NoAm | 1,2 +# Sorth America | SoAm | 6 +# Africa | Afri | 5 +# Australia | Aust | 7 +# ------------------|-------|------------ + +Rn_instances: full diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/PIESA/Rn_GridComp.rc b/ESMF/GOCART_GridComp/Rn_GridComp/PIESA/Rn_GridComp.rc new file mode 100644 index 00000000..c1c5eb56 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/PIESA/Rn_GridComp.rc @@ -0,0 +1,16 @@ +# +# Radon main resource file defining the particular instances. +# Regions based on: RADON.region_mask.x540_y361.2008.nc +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Asia | Asia | 4 +# Europe | Euro | 3 +# North America | NoAm | 1,2 +# Sorth America | SoAm | 6 +# Africa | Afri | 5 +# Australia | Aust | 7 +# ------------------|-------|------------ + +Rn_instances: full Asia Euro NoAm SoAm Afri Aust diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Afri.rc b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Afri.rc new file mode 100644 index 00000000..4d433242 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Afri.rc @@ -0,0 +1,32 @@ +# +# Resource file for Radon parameters. +# + +number_Rn_bins: 1 +Rn_regions: ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +Rn_regions_indices: 5 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Half-life and unit, which must be "years", "days", or "seconds". +# ---------------------------------------------------------------- +HalfLife: 3.823 +HalfLifeUnit: days + +# Emission, mBq m^{-2} s^{-1} +# --------------------------- +Rn_emission_file_name: ExtData/g5chem/sfc/gocart.radon.x540_y361.nc + +# Run-time debug switch [0 = off, 1 = on] +# --------------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Asia.rc b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Asia.rc new file mode 100644 index 00000000..4ceb66f9 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Asia.rc @@ -0,0 +1,32 @@ +# +# Resource file for Radon parameters. +# + +number_Rn_bins: 1 +Rn_regions: ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +Rn_regions_indices: 4 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Half-life and unit, which must be "years", "days", or "seconds". +# ---------------------------------------------------------------- +HalfLife: 3.823 +HalfLifeUnit: days + +# Emission, mBq m^{-2} s^{-1} +# --------------------------- +Rn_emission_file_name: ExtData/g5chem/sfc/gocart.radon.x540_y361.nc + +# Run-time debug switch [0 = off, 1 = on] +# --------------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Aust.rc b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Aust.rc new file mode 100644 index 00000000..ab37da7e --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Aust.rc @@ -0,0 +1,32 @@ +# +# Resource file for Radon parameters. +# + +number_Rn_bins: 1 +Rn_regions: ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +Rn_regions_indices: 7 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Half-life and unit, which must be "years", "days", or "seconds". +# ---------------------------------------------------------------- +HalfLife: 3.823 +HalfLifeUnit: days + +# Emission, mBq m^{-2} s^{-1} +# --------------------------- +Rn_emission_file_name: ExtData/g5chem/sfc/gocart.radon.x540_y361.nc + +# Run-time debug switch [0 = off, 1 = on] +# --------------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Euro.rc b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Euro.rc new file mode 100644 index 00000000..157be996 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---Euro.rc @@ -0,0 +1,32 @@ +# +# Resource file for Radon parameters. +# + +number_Rn_bins: 1 +Rn_regions: ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +Rn_regions_indices: 3 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Half-life and unit, which must be "years", "days", or "seconds". +# ---------------------------------------------------------------- +HalfLife: 3.823 +HalfLifeUnit: days + +# Emission, mBq m^{-2} s^{-1} +# --------------------------- +Rn_emission_file_name: ExtData/g5chem/sfc/gocart.radon.x540_y361.nc + +# Run-time debug switch [0 = off, 1 = on] +# --------------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---NoAm.rc b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---NoAm.rc new file mode 100644 index 00000000..74d7bae0 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---NoAm.rc @@ -0,0 +1,32 @@ +# +# Resource file for Radon parameters. +# + +number_Rn_bins: 1 +Rn_regions: ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +Rn_regions_indices: 1,2 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Half-life and unit, which must be "years", "days", or "seconds". +# ---------------------------------------------------------------- +HalfLife: 3.823 +HalfLifeUnit: days + +# Emission, mBq m^{-2} s^{-1} +# --------------------------- +Rn_emission_file_name: ExtData/g5chem/sfc/gocart.radon.x540_y361.nc + +# Run-time debug switch [0 = off, 1 = on] +# --------------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---SoAm.rc b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---SoAm.rc new file mode 100644 index 00000000..69e37ca6 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---SoAm.rc @@ -0,0 +1,32 @@ +# +# Resource file for Radon parameters. +# + +number_Rn_bins: 1 +Rn_regions: ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +Rn_regions_indices: 6 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Half-life and unit, which must be "years", "days", or "seconds". +# ---------------------------------------------------------------- +HalfLife: 3.823 +HalfLifeUnit: days + +# Emission, mBq m^{-2} s^{-1} +# --------------------------- +Rn_emission_file_name: ExtData/g5chem/sfc/gocart.radon.x540_y361.nc + +# Run-time debug switch [0 = off, 1 = on] +# --------------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---full.rc b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---full.rc new file mode 100644 index 00000000..99ba0ec2 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp---full.rc @@ -0,0 +1,32 @@ +# +# Resource file for Radon parameters. +# + +number_Rn_bins: 1 +Rn_regions: ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +# ------------------------------------------------------------------------- +Rn_regions_indices: -1 + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Half-life and unit, which must be "years", "days", or "seconds". +# ---------------------------------------------------------------- +HalfLife: 3.823 +HalfLifeUnit: days + +# Emission, mBq m^{-2} s^{-1} +# --------------------------- +Rn_emission_file_name: ExtData/g5chem/sfc/gocart.radon.x540_y361.nc + +# Run-time debug switch [0 = off, 1 = on] +# --------------------------------------- +DEBUG: 0 diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp.rc b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp.rc new file mode 100644 index 00000000..c1c5eb56 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp.rc @@ -0,0 +1,16 @@ +# +# Radon main resource file defining the particular instances. +# Regions based on: RADON.region_mask.x540_y361.2008.nc +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Asia | Asia | 4 +# Europe | Euro | 3 +# North America | NoAm | 1,2 +# Sorth America | SoAm | 6 +# Africa | Afri | 5 +# Australia | Aust | 7 +# ------------------|-------|------------ + +Rn_instances: full Asia Euro NoAm SoAm Afri Aust diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridCompMod.F90 b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridCompMod.F90 new file mode 100644 index 00000000..5a09a884 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridCompMod.F90 @@ -0,0 +1,1124 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Rn_GridCompMod --- Rn Grid Component Class +! +! !INTERFACE: +! + + MODULE Rn_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + + USE Chem_Mod ! Chemistry Base Class + USE Chem_StateMod ! Chemistry State + USE Chem_ConstMod, only: grav + USE Chem_UtilMod ! I/O + + USE m_inpak90 ! Resource file management + USE m_die, ONLY: die + + IMPLICIT NONE + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC Rn_GridComp ! Multiple instance Radon object + PUBLIC Rn_GridComp1 ! Single instance Radon object + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC Rn_GridCompSetServices + PUBLIC Rn_GridCompInitialize + PUBLIC Rn_GridCompRun + PUBLIC Rn_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the Rn Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! 01Aug2006 da Silva Extensions for GEOS-5. +! 10Mar2008 da Silva Multiple instances for ARCTAS. +! 12Apr2008 Nielsen Configured for radon. +! +!EOP +!------------------------------------------------------------------------- + + TYPE Rn_GridComp1 + + CHARACTER(LEN=ESMF_MAXSTR) :: name ! generic name of the package + CHARACTER(LEN=ESMF_MAXSTR) :: iname ! instance name + CHARACTER(LEN=ESMF_MAXSTR) :: rcfilen ! resource file name + CHARACTER(LEN=ESMF_MAXSTR) :: regionsString ! Comma-delimited string of regions + + INTEGER :: instance ! instance number + INTEGER :: BCnymd ! Date of last emissions update + + REAL :: halfLife ! Half-life + CHARACTER(LEN=ESMF_MAXSTR) :: halfLifeUnit ! Half-life unit: years, days, or seconds + REAL :: decayConstant ! Decay constant, inverse seconds. + REAL :: emission ! kg m^{-2} s^{-1} + + REAL, POINTER :: regionMask(:,:) ! regional mask + REAL, POINTER :: RnsfcFlux(:,:) ! Rn surface flux kg m^-2 s^-1 + REAL, POINTER :: ScheryEmission(:,:) ! Monthly mean emission mBq m^{-2} s^{-1} + + LOGICAL :: DebugIsOn ! Run-time debug switch + + END TYPE Rn_GridComp1 + + TYPE Rn_GridComp + integer :: n ! number of instances + TYPE(Rn_GridComp1), pointer :: gcs(:) ! instances + END TYPE Rn_GridComp + +CONTAINS + + subroutine RN_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: rcbasen = 'Rn_GridComp' + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: ier,n,i + CHARACTER(LEN=1) :: sOrP + + type(ESMF_Config) :: cfg + + Iam = "RN_GridCompSetServices" + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(rc=status) + VERIFY_(STATUS) + call ESMF_ConfigLoadFile(cfg,TRIM(rcbasen)//'.rc',rc=status) + VERIFY_(STATUS) + +! Parse resource file +! ------------------- + n = ESMF_ConfigGetLen(cfg,label='Rn_instances:',rc=status) + VERIFY_(STATUS) + +! We cannot have fewer instances than the number of +! Rn bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + IF( n < chemReg%n_Rn ) THEN + status = 1 + VERIFY_(status) + ELSE IF ( n >= chemReg%n_Rn ) THEN + IF(MAPL_AM_I_ROOT()) THEN + sOrP = " " + IF(chemReg%n_Rn > 1) sOrP = "s" + PRINT *, " " + PRINT *, TRIM(Iam)//": Rn has ",chemReg%n_Rn," instantiation"//TRIM(sOrP) + END IF + END IF + n = MIN(n,chemReg%n_Rn) + +! Record name of each instance +! ---------------------------- + call ESMF_ConfigFindLabel(cfg,'Rn_instances:',rc=status) + VERIFY_(STATUS) + do i = 1, n + call ESMF_ConfigGetAttribute(cfg,name,rc=status) + VERIFY_(STATUS) + ! resource file name + IF(TRIM(name) == "full" ) THEN + name = " " ! blank instance name for full (1) + ELSE + name = TRIM(name) ! instance name for others + END IF + call RN_GridCompSetServices1_(gc,chemReg,name,rc=status) + VERIFY_(STATUS) + end do + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'Rn_regionMask', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + RETURN_(ESMF_SUCCESS) + + end subroutine RN_GridCompSetServices + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Rn_GridCompInitialize --- Initialize Rn_GridComp +! +! !INTERFACE: +! + + subroutine Rn_GridCompInitialize ( gcRn, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(Rn_GridComp), INTENT(INOUT) :: gcRn ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the Rn Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! 12Apr2008 Nielsen Configured for radon +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'Rn_GridCompInitialize' + CHARACTER(LEN=ESMF_MAXSTR) :: rcbasen = 'Rn_GridComp' + CHARACTER(LEN=ESMF_MAXSTR) :: name + + INTEGER :: i, n, status + CHARACTER(LEN=1) :: sOrP + +! Load resource file +! ------------------ + CALL I90_loadf ( TRIM(rcbasen)//'.rc', status ) + VERIFY_(status) + +! Parse resource file +! ------------------- + CALL I90_label ( 'Rn_instances:', status ) + VERIFY_(status) + +! First determine how many instances we have +! ------------------------------------------ + n = 0 + status = 0 + DO WHILE( status == 0 ) + CALL I90_gtoken( name, status ) + n = n + 1 + END DO + IF( n == 0 ) THEN + status = 1 + VERIFY_(status) + END IF + +! We cannot have fewer instances than the number of +! Rn bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + IF( n < w_c%reg%n_Rn ) THEN + status = 1 + VERIFY_(status) + ELSE IF ( n >= w_c%reg%n_Rn ) THEN + IF(MAPL_AM_I_ROOT()) THEN + sOrP = " " + IF(w_c%reg%n_Rn > 1) sOrP = "s" + PRINT *, " " + PRINT *, TRIM(Iam)//": Rn has ",w_c%reg%n_Rn," instantiation"//TRIM(sOrP) + END IF + END IF + n = MIN(n,w_c%reg%n_Rn) + gcRn%n = n + +! Next allocate necessary memory +! ------------------------------ + ALLOCATE ( gcRn%gcs(n), STAT=status ) + VERIFY_(status) + +! Record name of each instance +! ---------------------------- + CALL I90_label ( 'Rn_instances:', status ) + VERIFY_(status) + DO i = 1, n + CALL I90_gtoken( name, status ) + VERIFY_(status) + ! resource file name + gcRn%gcs(i)%rcfilen = TRIM(rcbasen)//'---'//TRIM(name)//'.rc' + gcRn%gcs(i)%instance = i ! instance number + IF(TRIM(name) == "full" ) THEN + gcRn%gcs(i)%iname = " " ! blank instance name for full (1) + ELSE + gcRn%gcs(i)%iname = TRIM(name) ! instance name for others + END IF + END DO + +! Next initialize each instance +! ----------------------------- + DO i = 1, gcRn%n + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *, TRIM(Iam)//": Initializing instance ",TRIM(gcRn%gcs(i)%iname)," [",gcRn%gcs(i)%instance,"]" + END IF + CALL Rn_SingleInstance_ ( Rn_GridCompInitialize1_, i, & + gcRn%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, status ) + VERIFY_(status) + END DO + +! All done +! -------- + CALL I90_FullRelease( status ) + VERIFY_(status) + + END SUBROUTINE Rn_GridCompInitialize + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Rn_GridCompRun --- Run Rn_GridComp +! +! !INTERFACE: +! + + SUBROUTINE Rn_GridCompRun ( gcRn, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(Rn_GridComp), INTENT(INOUT) :: gcRn ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the Rn Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! 12Apr2008 Nielsen Configured for radon +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'Rn_GridCompRun' + INTEGER :: i, status + + DO i = 1, gcRn%n + CALL Rn_SingleInstance_ ( Rn_GridCompRun1_, i, & + gcRn%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, status ) + VERIFY_(status) + END DO + + END SUBROUTINE Rn_GridCompRun + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Rn_GridCompFinalize --- Initialize Rn_GridComp +! +! !INTERFACE: +! + + SUBROUTINE Rn_GridCompFinalize ( gcRn, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(Rn_GridComp), INTENT(INOUT) :: gcRn ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the Rn Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! 12Apr2008 Nielsen Configured for radon +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'Rn_GridCompFinalize' + INTEGER :: i, status + + DO i = 1, gcRn%n + CALL Rn_SingleInstance_ ( Rn_GridCompFinalize1_, i, & + gcRn%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, status ) + VERIFY_(status) + END DO + + DEALLOCATE( gcRn%gcs, STAT=status ) + gcRn%n = -1 + + END SUBROUTINE Rn_GridCompFinalize + +subroutine RN_GridCompSetServices1_( gc, chemReg, iname, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + character(len=*), intent(IN ) :: iname + integer, intent(OUT ) :: rc + + integer :: Status + character(len=ESMF_MAXSTR) :: Iam + + Iam ="RN_GridCOmpSetServices1_" + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'Rn_EMISSION'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + RETURN_(ESMF_SUCCESS) + + end subroutine RN_GridCompSetServices1_ + +!-------------------------------------------------------------------------- + +! Single Instance Methods + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Rn_GridCompInitialize --- Initialize Rn_GridComp +! +! !INTERFACE: +! + + subroutine Rn_GridCompInitialize1_ ( gcRn, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(Rn_GridComp1), INTENT(INOUT) :: gcRn ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the Rn Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 31May2005 Nielsen Mods for 7 CO bins, 5 region masks +! 04Nov2005 Bian CO tagged to 4 regions +! (global, North America, South America, and Africa) +! for CR-AVE +! 12Apr2008 Nielsen Configured for radon +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'Rn_GridCompInitialize1_' + CHARACTER(LEN=ESMF_MAXSTR) :: rcfilen + + INTEGER :: i1, i2, im, j, j1, j2, jm, km, n, status + INTEGER :: nTimes, begTime, incSecs + INTEGER :: nbeg, nend, nymd1, nhms1 + LOGICAL :: NoRegionalConstraint + LOGICAL :: unitOK + + REAL :: conFac, limitN, limitS, log10Emission, radTODeg + REAL, ALLOCATABLE :: var2d(:,:) + + rcfilen = gcRn%rcfilen + gcRn%name = 'GEOS-5/GOCART Parameterized Radon Package' + radTODeg = 57.2957795 + gcRn%BCnymd = -1 + +! Initialize local variables +! -------------------------- + rc = 0 + status = 0 + + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + im = w_c%grid%im + + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jm = w_c%grid%jm + + km = w_c%grid%km + + nbeg = w_c%reg%i_Rn + nend = w_c%reg%j_Rn + +! It requires 1 bin +! ----------------- + IF( nbeg /= nend ) THEN + IF(MAPL_AM_I_ROOT()) PRINT *, TRIM(Iam)//": Must have only 1 bin at the single instance level" + status = 1 + VERIFY_(status) + END IF + +! Load resource file +! ------------------ + CALL I90_loadf ( TRIM(rcfilen), status ) + VERIFY_(status) + +! Run-time debug switch +! --------------------- + CALL I90_label ( 'DEBUG:', status ) + VERIFY_(status) + n = I90_gint ( status ) + VERIFY_(status) + IF(n /= 0) THEN + gcRn%DebugIsOn = .TRUE. + ELSE + gcRn%DebugIsOn = .FALSE. + END IF + +! Allocate +! -------- + ALLOCATE( gcRn%RnsfcFlux(i1:i2,j1:j2), gcRn%regionMask(i1:i2,j1:j2), & + gcRn%ScheryEmission(i1:i2,j1:j2), STAT=status ) + VERIFY_(status) + +! Obtain half life. Unit must be "years", "days", or "seconds". +! -------------------------------------------------------------- + CALL I90_label ( 'HalfLife:', status ) + VERIFY_(status) + gcRn%halfLife = I90_gfloat ( status ) + VERIFY_(status) + CALL I90_label ( 'HalfLifeUnit:', status ) + VERIFY_(status) + CALL I90_gtoken( gcRn%halfLifeUnit, status ) + VERIFY_(status) + +! Validate the specified half-life and units, and find +! the constant needed to convert half-life to seconds. +! ---------------------------------------------------- + unitOK = .FALSE. + IF(TRIM(gcRn%halfLifeUnit) == "years") THEN + unitOK = .TRUE. + conFac = 86400.00*365.25 + END IF + IF(TRIM(gcRn%halfLifeUnit) == "days") THEN + unitOK = .TRUE. + conFac = 86400.00 + END IF + IF(TRIM(gcRn%halfLifeUnit) == "seconds") THEN + unitOK = .TRUE. + conFac = 1.00 + END IF + IF( .NOT. unitOK ) THEN + IF(MAPL_AM_I_ROOT()) PRINT *, TRIM(Iam)//": Invalid unit specified for radon half-life." + status = 1 + VERIFY_(status) + END IF + IF(gcRn%halfLife <= 0.00) THEN + IF(MAPL_AM_I_ROOT()) PRINT *, TRIM(Iam)//": Radon half-life must be greater than zero." + VERIFY_(status) + END IF + +! Compute the decay constant (inverse seconds) from the half-life: +! ln(N/No) = ln(1/2) = -decayConstant * halfLife +! ---------------------------------------------------------------- + gcRn%decayConstant = 0.693147/(gcRn%halfLife*conFac) + +! Grab the region string. +! ----------------------- + CALL I90_label ( 'Rn_regions_indices:', status ) + VERIFY_(status) + CALL I90_gtoken( gcRn%regionsString, status ) + VERIFY_(status) + +! Is this instantiation a global case? +! ----------------------------------- + IF(gcRn%regionsString(1:2) == "-1") THEN + NoRegionalConstraint = .TRUE. + ELSE + SELECT CASE (ESMF_UtilStringLowerCase(gcRn%regionsString(1:2))) + CASE ("gl") + NoRegionalConstraint = .TRUE. + CASE ("al") + NoRegionalConstraint = .TRUE. + CASE DEFAULT + NoRegionalConstraint = .FALSE. + END SELECT + END IF + +! Set regionsString to "-1" for the global case +! --------------------------------------------- + IF(NoRegionalConstraint) gcRn%regionsString = "-1" + + IF(MAPL_AM_I_ROOT()) THEN + IF(NoRegionalConstraint) THEN + PRINT *, TRIM(Iam)//": This instantiation has no regional constraints." + ELSE + PRINT *, TRIM(Iam)//": This instantiation is regionally constrained." + PRINT *, TRIM(Iam)//": List of region numbers included: ",TRIM(gcRn%regionsString) + END IF + END IF + +! Set the initial radon surface fluxes to zero +! -------------------------------------------- + gcRn%RnsfcFlux(i1:i2,j1:j2) = 0.00 + + RETURN + + END SUBROUTINE Rn_GridCompInitialize1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Rn_GridCompRun +! +! !INTERFACE: +! + + SUBROUTINE Rn_GridCompRun1_ ( gcRn, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT/OUTPUT PARAMETERS: + + TYPE(Rn_GridComp1), INTENT(INOUT) :: gcRn ! Grid Component + TYPE(Chem_Bundle), INTENT(INOUT) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(inout) :: impChem ! Import State + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(ESMF_State), intent(inout) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the Rn driver. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! 12Apr2008 Nielsen Configured for radon +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'Rn_GridCompRun1_' + +! Input fields from fvGCM +! ----------------------- + REAL, POINTER, DIMENSION(:,:,:) :: T => null() + REAL, POINTER, DIMENSION(:,:,:) :: zle => null() + REAL, POINTER, DIMENSION(:,:) :: soilT => null() + REAL, POINTER, DIMENSION(:,:) :: fracIce => null() + + INTEGER :: i1, i2, im, j1, j2, jm, km, idiag, iXj + INTEGER :: i, j, k, kReverse, n, nbeg, nend, nymd1 + INTEGER :: status + + REAL, PARAMETER :: nsuba=6.022E+26 + REAL, PARAMETER :: mwtAir=28.97 + REAL, PARAMETER :: mwtRn=222.00 + REAL, PARAMETER :: rstar=8.3143E+03 + REAL, PARAMETER :: rpstd=1.00E-05 + + REAL :: decadence, qmin, qmax, toND + REAL, ALLOCATABLE :: F(:,:),nd(:,:,:),p(:,:,:),pe(:,:,:),dZ(:,:,:) + INTEGER, ALLOCATABLE :: mask(:,:) + real, pointer :: ptr2d(:,:) => null() + +#define EXPORT expChem +#define iNAME TRIM(gcRn%iname) + +#define RnEM Rn_emis +#define RnCL Rn_column +#define RnSC Rn_surface +#define RnLS Rn_loss + +#include "Rn_GetPointer___.h" + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + im = w_c%grid%im + + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jm = w_c%grid%jm + km = w_c%grid%km + + iXj = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + + nbeg = w_c%reg%i_Rn + nend = w_c%reg%j_Rn + +! Get the region mask +! ------------------- + call MAPL_GetPointer(impChem,ptr2d,'Rn_regionMask',rc=status) + VERIFY_(STATUS) + gcRn%regionMask=ptr2d + +! It requires 1 bin +! ----------------- + IF ( nbeg /= nend ) THEN + IF(MAPL_AM_I_ROOT()) PRINT *, TRIM(Iam)//": Must have only 1 bin at the single instance level" + status = 1 + VERIFY_(status) + END IF + + call MAPL_GetPointer(impChem, ptr2d, 'Rn_EMISSION'//iNAME,rc=status) + VERIFY_(STATUS) + gcRn%ScheryEmission = ptr2d + +! Conversion factor: mBq m^{-2} to atoms m^{-2} s^{-1} +! ---------------------------------------------------- + toND = 0.001/gcRn%decayConstant + +! Allocate temporary workspace +! ---------------------------- + ALLOCATE(pe(i1:i2,j1:j2,km+1), p(i1:i2,j1:j2,km), nd(i1:i2,j1:j2,km), & + dZ(i1:i2,j1:j2,km), F(i1:i2,j1:j2), mask(i1:i2,j1:j2), STAT=status) + VERIFY_(status) + +! Get imports +! ----------- + CALL MAPL_GetPointer( impChem, T, 'T', RC=status ) + VERIFY_(status) + CALL MAPL_GetPointer( impChem, zle, 'ZLE', RC=status ) + VERIFY_(status) + CALL MAPL_GetPointer( impChem, soilT, 'TSOIL1', RC=status ) + VERIFY_(status) + CALL MAPL_GetPointer( impChem, fracIce, 'FRACI', RC=status ) + VERIFY_(status) + +! Layer thicknesses. ZLE(:,:,0:km). +! ---------------------------------- + DO k=1,km + dZ(i1:i2,j1:j2,k) = zle(i1:i2,j1:j2,k-1)-zle(i1:i2,j1:j2,k) + END DO + +! Layer interface pressures +! ------------------------- + pe(i1:i2,j1:j2,1)=w_c%grid%ptop + DO k=2,km+1 + pe(i1:i2,j1:j2,k)=pe(i1:i2,j1:j2,k-1)+w_c%delp(i1:i2,j1:j2,k-1) + END DO + +! Layer mean pressures +! -------------------- + DO k=1,km + p(i1:i2,j1:j2,k)=(pe(i1:i2,j1:j2,k)+pe(i1:i2,j1:j2,k+1))*0.50 + END DO + +! Number density +! -------------- + nd(i1:i2,j1:j2,1:km)= nsuba*p(i1:i2,j1:j2,1:km)/ & + (rstar*T(i1:i2,j1:j2,1:km)) + +! Validate +! -------- + IF(gcRn%DebugIsOn) THEN + CALL pmaxmin('Rn: T ', T, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('Rn: TSOIL1', soilT, qmin, qmax, iXj, 1, 1. ) + CALL pmaxmin('Rn: FRACI ',fracIce, qmin, qmax, iXj, 1, 1. ) + CALL pmaxmin('Rn: ZLE ', zle, qmin, qmax, iXj, km+1, 1. ) + CALL pmaxmin('Rn: dZ ', dZ, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('Rn: Edge p', pe, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('Rn: Mid p ', p, qmin, qmax, iXj, km, 1. ) + CALL pmaxmin('Rn: Numden', nd, qmin, qmax, iXj, km, 1. ) + END IF + +! Convert Radon from mole fraction to number density +! -------------------------------------------------- + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km) = & + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)*nd(i1:i2,j1:j2,1:km) + +! Clear surface flux diagnostic +! ----------------------------- + IF(ASSOCIATED(Rn_emis)) Rn_emis(i1:i2,j1:j2) = 0.00 + +! Fraction of emissions to accept from each box +! --------------------------------------------- + F(i1:i2,j1:j2) = 0.00 + +! Find land boxes from regional mask file. +! ---------------------------------------- + CALL setLandMask(status) + VERIFY_(status) + +! For the global intantiation, include ocean emissions. +! ----------------------------------------------------- + IF(gcRn%instance == 1) THEN + WHERE(mask(i1:i2,j1:j2) == 0) F(i1:i2,j1:j2) = 1.00-fracIce(i1:i2,j1:j2) + END IF + +! Assume frozen soil emits no radon +! --------------------------------- + WHERE(mask(i1:i2,j1:j2) == 1 .AND. soilT(i1:i2,j1:j2) < 273.00) mask(i1:i2,j1:j2) = 0 + +! Account for bad-valued soil temperatures +! ---------------------------------------- + WHERE(mask(i1:i2,j1:j2) == 1 .AND. soilT(i1:i2,j1:j2) > 500.00) mask(i1:i2,j1:j2) = 0 + +! Finalize fraction from land boxes. +! ---------------------------------- + WHERE(mask(i1:i2,j1:j2) == 1) F(i1:i2,j1:j2) = 1.00 + +! Place emissions into the surface layer, adding the number of +! atoms released in one time step to the surface layer number density. +! -------------------------------------------------------------------- + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km)=w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km)+F(i1:i2,j1:j2)* & + toND*gcRn%ScheryEmission(i1:i2,j1:j2)*cdt/dZ(i1:i2,j1:j2,km) + +! Diagnostic emissions, kg m^{-2} s^{-1}. +! --------------------------------------- + IF(ASSOCIATED(Rn_emis)) THEN + Rn_emis(i1:i2,j1:j2) = F(i1:i2,j1:j2)*toND*mwtRn*gcRn%ScheryEmission(i1:i2,j1:j2)/nsuba + END IF + +! Diagnostic loss, vertically integrated, kg m^{-2} s^{-1}. Compute +! before applying radioactive decay to the three-dimensional radon field. +! ----------------------------------------------------------------------- + n = gcRn%instance + decadence = EXP(-gcRn%decayConstant*cdt) + IF(ASSOCIATED(Rn_loss)) Rn_loss(i1:i2,j1:j2) = 0.00 + DO k = 1, km + + IF(ASSOCIATED(Rn_loss)) & + Rn_loss(i1:i2,j1:j2) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)*(1.00-decadence)* & + mwtRn*dZ(i1:i2,j1:j2,k)/(nsuba*cdt) + +! Apply radioactive decay, q(f) = q(i)EXP(-c delta t), to number density. +! ----------------------------------------------------------------------- + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)*decadence + + END DO ! Next layer, k + +! Column burden in kg m^{-2} +! -------------------------- + n = gcRn%instance + IF(ASSOCIATED(Rn_column)) then + Rn_column(i1:i2,j1:j2) = 0. + DO k = 1, km + Rn_column(i1:i2,j1:j2) = Rn_column(i1:i2,j1:j2) + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,k)* & + mwtRn*dZ(i1:i2,j1:j2,k)/nsuba + END DO + END IF + +! Return to mole fraction +! ----------------------- + w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)=w_c%qa(nbeg)%data3d(i1:i2,j1:j2,1:km)/nd(i1:i2,j1:j2,1:km) + +! Surface concentration in mole fraction +! -------------------------------------- + n = gcRn%instance + IF(ASSOCIATED(Rn_surface)) Rn_surface(i1:i2,j1:j2) = w_c%qa(nbeg)%data3d(i1:i2,j1:j2,km) + + IF(gcRn%DebugIsOn) THEN + n = gcRn%instance + IF(ASSOCIATED( Rn_emis)) & + CALL pmaxmin( 'Rn_emis', Rn_emis(i1:i2,j1:j2), qmin, qmax, iXj, 1, 1. ) + IF(ASSOCIATED( Rn_loss)) & + CALL pmaxmin( 'Rn_loss', Rn_loss(i1:i2,j1:j2), qmin, qmax, iXj, 1, 1. ) + IF(ASSOCIATED( Rn_column)) & + CALL pmaxmin( 'Rn_column', Rn_column(i1:i2,j1:j2), qmin, qmax, iXj, 1, 1. ) + IF(ASSOCIATED(Rn_surface)) & + CALL pmaxmin('Rn:surface', Rn_surface(i1:i2,j1:j2), qmin, qmax, iXj, 1, 1. ) + END IF + +! Housekeeping +! ------------ + DEALLOCATE(F, mask, dZ, nd, p, pe, STAT=status) + VERIFY_(status) + + RETURN + +CONTAINS + + SUBROUTINE setLandMask(rc) + IMPLICIT NONE + INTEGER, INTENT(OUT) :: rc + INTEGER :: i, k, status + INTEGER, ALLOCATABLE :: regionNumbers(:),flag(:) + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'Rn::setLandMask' + + rc = 0 + k = 32 + ALLOCATE(regionNumbers(k), flag(k), STAT=status) + VERIFY_(status) + +! Obtain region numbers from delimited list of integers +! ----------------------------------------------------- + regionNumbers(:) = 0 + CALL Chem_UtilExtractIntegers(gcRn%regionsString, k, regionNumbers, RC=status) + VERIFY_(status) + +! How many integers were found? +! ----------------------------- + flag(:) = 1 + WHERE(regionNumbers(:) == 0) flag(:) = 0 + k = SUM(flag) + DEALLOCATE(flag, STAT=status) + VERIFY_(status) + +! Set local mask to 1 where gridMask matches each integer (within precision!). +! ---------------------------------------------------------------------------- + mask(i1:i2,j1:j2) = 0 + IF(regionNumbers(1) == -1) THEN + WHERE(gcRn%regionMask(i1:i2,j1:j2) /= 0) mask(i1:i2,j1:j2) = 1 + ELSE + DO i = 1,k + WHERE( regionNumbers(i)-0.01 <= gcRn%regionMask(i1:i2,j1:j2) .AND. & + gcRn%regionMask(i1:i2,j1:j2) <= regionNumbers(i)+0.01) mask(i1:i2,j1:j2) = 1 + END DO + END IF + + RETURN + END SUBROUTINE setLandMask + + END SUBROUTINE Rn_GridCompRun1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Rn_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + SUBROUTINE Rn_GridCompFinalize1_ ( gcRn, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT/OUTPUT PARAMETERS: + + TYPE(Rn_GridComp1), INTENT(INOUT) :: gcRn ! Grid Component + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), INTENT(IN) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Import State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER(LEN=ESMF_MAXSTR), PARAMETER :: Iam = 'Rn_GridCompFinalize1_' + INTEGER :: status + rc = 0 + + DEALLOCATE ( gcRn%RnsfcFlux, gcRn%regionMask, gcRn%ScheryEmission, STAT=status ) + VERIFY_(status) + + RETURN + + END SUBROUTINE Rn_GridCompFinalize1_ + + END MODULE Rn_GridCompMod + +!----------------------------------------------------------------------- + +! Single Instance Wrapper + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Rn_SingleInstance_ --- Runs single instance of method +! +! !INTERFACE: +! + SUBROUTINE Rn_SingleInstance_ ( Method_, instance, & + gcRn, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + USE Rn_GridCompMod + USE ESMF + USE MAPL + USE Chem_Mod + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! Input "function pointer" +! ----------------------- + INTERFACE + SUBROUTINE Method_ (gc, w, imp, exp, ymd, hms, dt, rcode ) + USE Rn_GridCompMod + USE ESMF + USE MAPL + USE Chem_Mod + TYPE(Rn_GridComp1), INTENT(INOUT) :: gc + TYPE(Chem_Bundle), INTENT(IN) :: w + TYPE(ESMF_State), INTENT(INOUT) :: imp + TYPE(ESMF_State), INTENT(INOUT) :: exp + INTEGER, INTENT(IN) :: ymd, hms + REAL, INTENT(IN) :: dt + INTEGER, INTENT(OUT) :: rcode + END SUBROUTINE Method_ + END INTERFACE + + INTEGER, INTENT(IN) :: instance ! instance number + + TYPE(Chem_Bundle), INTENT(INOUT) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(Rn_GridComp1), INTENT(INOUT) :: gcRn ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the Rn Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! 12Apr2008 Nielsen Configured for radon. +! +!EOP +!------------------------------------------------------------------------- + + INTEGER :: n_Rn, i_Rn, j_Rn + +! Save overall Rn indices +! ----------------------- + n_Rn = w_c%reg%n_Rn + i_Rn = w_c%reg%i_Rn + j_Rn = w_c%reg%j_Rn + +! Customize indices for this particular instance +! ---------------------------------------------- + w_c%reg%n_Rn = 1 + w_c%reg%i_Rn = i_Rn + instance - 1 + w_c%reg%j_Rn = i_Rn + instance - 1 + +! Execute the instance method +! --------------------------- + CALL Method_ ( gcRn, w_c, impChem, expChem, nymd, nhms, cdt, rc ) + +! Restore the overall Rn indices +! ------------------------------ + w_c%reg%n_Rn = n_Rn + w_c%reg%i_Rn = i_Rn + w_c%reg%j_Rn = j_Rn + + END SUBROUTINE Rn_SingleInstance_ + +!----------------------------------------------------------------------- diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp_ExtData.rc new file mode 100644 index 00000000..acb6e571 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridComp_ExtData.rc @@ -0,0 +1,17 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +Rn_EMISSION NA Y Y %y4-%m2-%d2t12:00:00 none none Rn_EMISSION ExtData/g5chem/sfc/gocart.radon.x540_y361.nc +RN_regionMask NA N V - none none REGION_MASK ExtData/g5chem/sfc/RADON.region_mask.x540_y361.2001.nc +%% + +DerivedExports%% +Rn_EMISSIONAfri regionmask(Rn_EMISSION,Rn_regionMask;5) %y4-%m2-%d2t12:00:00 +Rn_EMISSIONAsia regionmask(Rn_EMISSION,Rn_regionMask;4) %y4-%m2-%d2t12:00:00 +Rn_EMISSIONAust regionmask(Rn_EMISSION,Rn_regionMask;7) %y4-%m2-%d2t12:00:00 +Rn_EMISSIONEuro regionmask(Rn_EMISSION,Rn_regionMask;3) %y4-%m2-%d2t12:00:00 +Rn_EMISSIONSoAm regionmask(Rn_EMISSION,Rn_regionMask;6) %y4-%m2-%d2t12:00:00 +Rn_EMISSIONNoAm regionmask(Rn_EMISSION,Rn_regionMask;1,2) %y4-%m2-%d2t12:00:00 +%% diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_Registry.rc b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_Registry.rc new file mode 100644 index 00000000..58bf2f33 --- /dev/null +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_Registry.rc @@ -0,0 +1,53 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: Rn + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl|# Sub| Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + RnEM | kg m-2 s-1 | xy | | | | | | Rn Emission __ENSEMBLE__ + RnEMAsia | kg m-2 s-1 | xy | | | | | | Rn Emission Asia + RnEMEuro | kg m-2 s-1 | xy | | | | | | Rn Emission Europe + RnEMNoAm | kg m-2 s-1 | xy | | | | | | Rn Emission North America + RnEMSoAm | kg m-2 s-1 | xy | | | | | | Rn Emission South America + RnEMAfri | kg m-2 s-1 | xy | | | | | | Rn Emission Africa + RnEMAust | kg m-2 s-1 | xy | | | | | | Rn Emission Australia + RnLS | kg m-2 s-1 | xy | | | | | | Rn Decay __ENSEMBLE__ + RnLSAsia | kg m-2 s-1 | xy | | | | | | Rn Decay Asia + RnLSEuro | kg m-2 s-1 | xy | | | | | | Rn Decay Europe + RnLSNoAm | kg m-2 s-1 | xy | | | | | | Rn Decay North America + RnLSSoAm | kg m-2 s-1 | xy | | | | | | Rn Decay South America + RnLSAfri | kg m-2 s-1 | xy | | | | | | Rn Decay Africa + RnLSAust | kg m-2 s-1 | xy | | | | | | Rn Decay Australia + RnSC | mol/mol | xy | | | | | | Rn Surface Concentration __ENSEMBLE__ + RnSCAsia | mol/mol | xy | | | | | | Rn Surface Concentration Asia + RnSCEuro | mol/mol | xy | | | | | | Rn Surface Concentration Europe + RnSCNoAm | mol/mol | xy | | | | | | Rn Surface Concentration North America + RnSCSoAm | mol/mol | xy | | | | | | Rn Surface Concentration South America + RnSCAfri | mol/mol | xy | | | | | | Rn Surface Concentration Africa + RnSCAust | mol/mol | xy | | | | | | Rn Surface Concentration Australia + RnCL | kg m-2 | xy | | | | | | Rn Column Burden __ENSEMBLE__ + RnCLAsia | kg m-2 | xy | | | | | | Rn Column Burden Asia + RnCLEuro | kg m-2 | xy | | | | | | Rn Column Burden Europe + RnCLNoAm | kg m-2 | xy | | | | | | Rn Column Burden North America + RnCLSoAm | kg m-2 | xy | | | | | | Rn Column Burden South America + RnCLAfri | kg m-2 | xy | | | | | | Rn Column Burden Africa + RnCLAust | kg m-2 | xy | | | | | | Rn Column Burden Australia +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + + diff --git a/ESMF/GOCART_GridComp/SS_GridComp/CMIP/SS_GridComp---full.rc b/ESMF/GOCART_GridComp/SS_GridComp/CMIP/SS_GridComp---full.rc new file mode 100644 index 00000000..9318de28 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/CMIP/SS_GridComp---full.rc @@ -0,0 +1,36 @@ +# +# Resource file for SS parameters. +# + +number_SS_bins: 5 + +particle_radius: 0.079 0.316 1.119 2.818 7.772 + +radius_lower: 0.03 0.1 0.5 1.5 5.0 + +radius_upper: 0.1 0.5 1.5 5.0 10.0 + +SS_density: 2200. 2200. 2200. 2200. 2200. + +# Scavenging efficiency per bin [km-1] +fscav: 0.4 0.4 0.4 0.4 0.4 # + +# Emissions methods and scaling +emission_scheme: 3 # 1 for Gong 2003, 2 for ... +emission_scale: 0.613 0.613 0.613 0.429 0.429 0.429 # a global scaling factor +sstemisFlag: 2 # Apply a correction to emissions based on SST (see code) +hoppelFlag: 0 # Apply Hoppel correction (set non-zero, see Fan and Toon 2011) +weibullFlag: 0 # Apply Weibull distribution (set non-zero, see Fan and Toon 2011) + +# Method of apply relative humidity to particle radius +rhFlag: 2 # RH swelling of Seasalt (1 for Fitzgerald 1975, + # 2 for Gerber 1985 method) + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.058 0.058 0.058 0.058 0.058 + +# Number of particles per kg mass +fnum: 3.017e17 1.085e16 1.207e14 9.391e12 2.922e11 + +# Number median radius [um] +particle_radius_number: 0.066 0.176 0.885 2.061 6.901 diff --git a/ESMF/GOCART_GridComp/SS_GridComp/CMIP/SS_GridComp.rc b/ESMF/GOCART_GridComp/SS_GridComp/CMIP/SS_GridComp.rc new file mode 100644 index 00000000..99686350 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/CMIP/SS_GridComp.rc @@ -0,0 +1,4 @@ +# +# SS main resource file defining the particular instances. +# +SS_instances: full diff --git a/ESMF/GOCART_GridComp/SS_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/SS_GridComp/CMakeLists.txt new file mode 100644 index 00000000..77dee41e --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-E\;-C\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/SS_GridComp/MERRA2-DD/SS_GridComp---full.rc b/ESMF/GOCART_GridComp/SS_GridComp/MERRA2-DD/SS_GridComp---full.rc new file mode 100644 index 00000000..9318de28 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/MERRA2-DD/SS_GridComp---full.rc @@ -0,0 +1,36 @@ +# +# Resource file for SS parameters. +# + +number_SS_bins: 5 + +particle_radius: 0.079 0.316 1.119 2.818 7.772 + +radius_lower: 0.03 0.1 0.5 1.5 5.0 + +radius_upper: 0.1 0.5 1.5 5.0 10.0 + +SS_density: 2200. 2200. 2200. 2200. 2200. + +# Scavenging efficiency per bin [km-1] +fscav: 0.4 0.4 0.4 0.4 0.4 # + +# Emissions methods and scaling +emission_scheme: 3 # 1 for Gong 2003, 2 for ... +emission_scale: 0.613 0.613 0.613 0.429 0.429 0.429 # a global scaling factor +sstemisFlag: 2 # Apply a correction to emissions based on SST (see code) +hoppelFlag: 0 # Apply Hoppel correction (set non-zero, see Fan and Toon 2011) +weibullFlag: 0 # Apply Weibull distribution (set non-zero, see Fan and Toon 2011) + +# Method of apply relative humidity to particle radius +rhFlag: 2 # RH swelling of Seasalt (1 for Fitzgerald 1975, + # 2 for Gerber 1985 method) + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.058 0.058 0.058 0.058 0.058 + +# Number of particles per kg mass +fnum: 3.017e17 1.085e16 1.207e14 9.391e12 2.922e11 + +# Number median radius [um] +particle_radius_number: 0.066 0.176 0.885 2.061 6.901 diff --git a/ESMF/GOCART_GridComp/SS_GridComp/MERRA2-DD/SS_GridComp.rc b/ESMF/GOCART_GridComp/SS_GridComp/MERRA2-DD/SS_GridComp.rc new file mode 100644 index 00000000..99686350 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/MERRA2-DD/SS_GridComp.rc @@ -0,0 +1,4 @@ +# +# SS main resource file defining the particular instances. +# +SS_instances: full diff --git a/ESMF/GOCART_GridComp/SS_GridComp/MERRA2/SS_GridComp---full.rc b/ESMF/GOCART_GridComp/SS_GridComp/MERRA2/SS_GridComp---full.rc new file mode 100644 index 00000000..9318de28 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/MERRA2/SS_GridComp---full.rc @@ -0,0 +1,36 @@ +# +# Resource file for SS parameters. +# + +number_SS_bins: 5 + +particle_radius: 0.079 0.316 1.119 2.818 7.772 + +radius_lower: 0.03 0.1 0.5 1.5 5.0 + +radius_upper: 0.1 0.5 1.5 5.0 10.0 + +SS_density: 2200. 2200. 2200. 2200. 2200. + +# Scavenging efficiency per bin [km-1] +fscav: 0.4 0.4 0.4 0.4 0.4 # + +# Emissions methods and scaling +emission_scheme: 3 # 1 for Gong 2003, 2 for ... +emission_scale: 0.613 0.613 0.613 0.429 0.429 0.429 # a global scaling factor +sstemisFlag: 2 # Apply a correction to emissions based on SST (see code) +hoppelFlag: 0 # Apply Hoppel correction (set non-zero, see Fan and Toon 2011) +weibullFlag: 0 # Apply Weibull distribution (set non-zero, see Fan and Toon 2011) + +# Method of apply relative humidity to particle radius +rhFlag: 2 # RH swelling of Seasalt (1 for Fitzgerald 1975, + # 2 for Gerber 1985 method) + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.058 0.058 0.058 0.058 0.058 + +# Number of particles per kg mass +fnum: 3.017e17 1.085e16 1.207e14 9.391e12 2.922e11 + +# Number median radius [um] +particle_radius_number: 0.066 0.176 0.885 2.061 6.901 diff --git a/ESMF/GOCART_GridComp/SS_GridComp/MERRA2/SS_GridComp.rc b/ESMF/GOCART_GridComp/SS_GridComp/MERRA2/SS_GridComp.rc new file mode 100644 index 00000000..99686350 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/MERRA2/SS_GridComp.rc @@ -0,0 +1,4 @@ +# +# SS main resource file defining the particular instances. +# +SS_instances: full diff --git a/ESMF/GOCART_GridComp/SS_GridComp/NR/SS_GridComp---full.rc b/ESMF/GOCART_GridComp/SS_GridComp/NR/SS_GridComp---full.rc new file mode 100644 index 00000000..9318de28 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/NR/SS_GridComp---full.rc @@ -0,0 +1,36 @@ +# +# Resource file for SS parameters. +# + +number_SS_bins: 5 + +particle_radius: 0.079 0.316 1.119 2.818 7.772 + +radius_lower: 0.03 0.1 0.5 1.5 5.0 + +radius_upper: 0.1 0.5 1.5 5.0 10.0 + +SS_density: 2200. 2200. 2200. 2200. 2200. + +# Scavenging efficiency per bin [km-1] +fscav: 0.4 0.4 0.4 0.4 0.4 # + +# Emissions methods and scaling +emission_scheme: 3 # 1 for Gong 2003, 2 for ... +emission_scale: 0.613 0.613 0.613 0.429 0.429 0.429 # a global scaling factor +sstemisFlag: 2 # Apply a correction to emissions based on SST (see code) +hoppelFlag: 0 # Apply Hoppel correction (set non-zero, see Fan and Toon 2011) +weibullFlag: 0 # Apply Weibull distribution (set non-zero, see Fan and Toon 2011) + +# Method of apply relative humidity to particle radius +rhFlag: 2 # RH swelling of Seasalt (1 for Fitzgerald 1975, + # 2 for Gerber 1985 method) + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.058 0.058 0.058 0.058 0.058 + +# Number of particles per kg mass +fnum: 3.017e17 1.085e16 1.207e14 9.391e12 2.922e11 + +# Number median radius [um] +particle_radius_number: 0.066 0.176 0.885 2.061 6.901 diff --git a/ESMF/GOCART_GridComp/SS_GridComp/NR/SS_GridComp.rc b/ESMF/GOCART_GridComp/SS_GridComp/NR/SS_GridComp.rc new file mode 100644 index 00000000..99686350 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/NR/SS_GridComp.rc @@ -0,0 +1,4 @@ +# +# SS main resource file defining the particular instances. +# +SS_instances: full diff --git a/ESMF/GOCART_GridComp/SS_GridComp/PIESA/SS_GridComp---full.rc b/ESMF/GOCART_GridComp/SS_GridComp/PIESA/SS_GridComp---full.rc new file mode 100644 index 00000000..9318de28 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/PIESA/SS_GridComp---full.rc @@ -0,0 +1,36 @@ +# +# Resource file for SS parameters. +# + +number_SS_bins: 5 + +particle_radius: 0.079 0.316 1.119 2.818 7.772 + +radius_lower: 0.03 0.1 0.5 1.5 5.0 + +radius_upper: 0.1 0.5 1.5 5.0 10.0 + +SS_density: 2200. 2200. 2200. 2200. 2200. + +# Scavenging efficiency per bin [km-1] +fscav: 0.4 0.4 0.4 0.4 0.4 # + +# Emissions methods and scaling +emission_scheme: 3 # 1 for Gong 2003, 2 for ... +emission_scale: 0.613 0.613 0.613 0.429 0.429 0.429 # a global scaling factor +sstemisFlag: 2 # Apply a correction to emissions based on SST (see code) +hoppelFlag: 0 # Apply Hoppel correction (set non-zero, see Fan and Toon 2011) +weibullFlag: 0 # Apply Weibull distribution (set non-zero, see Fan and Toon 2011) + +# Method of apply relative humidity to particle radius +rhFlag: 2 # RH swelling of Seasalt (1 for Fitzgerald 1975, + # 2 for Gerber 1985 method) + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.058 0.058 0.058 0.058 0.058 + +# Number of particles per kg mass +fnum: 3.017e17 1.085e16 1.207e14 9.391e12 2.922e11 + +# Number median radius [um] +particle_radius_number: 0.066 0.176 0.885 2.061 6.901 diff --git a/ESMF/GOCART_GridComp/SS_GridComp/PIESA/SS_GridComp.rc b/ESMF/GOCART_GridComp/SS_GridComp/PIESA/SS_GridComp.rc new file mode 100644 index 00000000..99686350 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/PIESA/SS_GridComp.rc @@ -0,0 +1,4 @@ +# +# SS main resource file defining the particular instances. +# +SS_instances: full diff --git a/ESMF/GOCART_GridComp/SS_GridComp/SS_GridComp---full.rc b/ESMF/GOCART_GridComp/SS_GridComp/SS_GridComp---full.rc new file mode 100755 index 00000000..9318de28 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/SS_GridComp---full.rc @@ -0,0 +1,36 @@ +# +# Resource file for SS parameters. +# + +number_SS_bins: 5 + +particle_radius: 0.079 0.316 1.119 2.818 7.772 + +radius_lower: 0.03 0.1 0.5 1.5 5.0 + +radius_upper: 0.1 0.5 1.5 5.0 10.0 + +SS_density: 2200. 2200. 2200. 2200. 2200. + +# Scavenging efficiency per bin [km-1] +fscav: 0.4 0.4 0.4 0.4 0.4 # + +# Emissions methods and scaling +emission_scheme: 3 # 1 for Gong 2003, 2 for ... +emission_scale: 0.613 0.613 0.613 0.429 0.429 0.429 # a global scaling factor +sstemisFlag: 2 # Apply a correction to emissions based on SST (see code) +hoppelFlag: 0 # Apply Hoppel correction (set non-zero, see Fan and Toon 2011) +weibullFlag: 0 # Apply Weibull distribution (set non-zero, see Fan and Toon 2011) + +# Method of apply relative humidity to particle radius +rhFlag: 2 # RH swelling of Seasalt (1 for Fitzgerald 1975, + # 2 for Gerber 1985 method) + +# Molecular weight of species [kg mole-1] +molecular_weight: 0.058 0.058 0.058 0.058 0.058 + +# Number of particles per kg mass +fnum: 3.017e17 1.085e16 1.207e14 9.391e12 2.922e11 + +# Number median radius [um] +particle_radius_number: 0.066 0.176 0.885 2.061 6.901 diff --git a/ESMF/GOCART_GridComp/SS_GridComp/SS_GridComp.rc b/ESMF/GOCART_GridComp/SS_GridComp/SS_GridComp.rc new file mode 100755 index 00000000..99686350 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/SS_GridComp.rc @@ -0,0 +1,4 @@ +# +# SS main resource file defining the particular instances. +# +SS_instances: full diff --git a/ESMF/GOCART_GridComp/SS_GridComp/SS_GridCompMod.F90 b/ESMF/GOCART_GridComp/SS_GridComp/SS_GridCompMod.F90 new file mode 100644 index 00000000..89a2e5b4 --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/SS_GridCompMod.F90 @@ -0,0 +1,2217 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: SS_GridCompMod --- SS Grid Component Class +! +! !INTERFACE: +! + + module SS_GridCompMod + +! !USES: + + USE ESMF + USE MAPL + + use Chem_Mod ! Chemistry Base Class + use Chem_StateMod ! Chemistry State + use Chem_ConstMod, only: grav ! Constants + use Chem_UtilMod ! I/O + use Chem_MieMod ! Aerosol LU Tables, calculator + use m_inpak90 ! Resource file management + use m_die, only: die + use SeasaltEmissionMod ! Emissions + use Chem_SettlingMod ! Settling + use DryDepositionMod ! Dry deposition + use WetRemovalMod ! Large scale wet removal + use ConvectionMod ! Offline convective mixing/scavenging + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC SS_GridComp ! The SS object + PUBLIC SS_GridComp1 ! Single instance SS object + + + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC SS_GridCompSetServices + PUBLIC SS_GridCompInitialize + PUBLIC SS_GridCompRun1 + PUBLIC SS_GridCompRun2 + PUBLIC SS_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) SS Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + type SS_GridComp1 + character(len=255) :: name + character(len=255) :: iname ! instance name + character(len=255) :: rcfilen ! resource file name + + integer :: instance ! instance number + + logical :: run_alarm = .false. ! run alarm + + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + integer :: rhFlag ! Choice of relative humidity parameterization for radius + integer :: sstemisFlag ! Choice of SST correction to emissions: 0 - none; 1 - Jaegle et al. 2011; 2 - GEOS5 + logical :: hoppelFlag ! Apply the Hoppel correction to emissions (Fan and Toon, 2011) + logical :: weibullFlag ! Apply the Weibull distribution to wind speed for emissions (Fan and Toon, 2011) + integer :: emission_scheme ! Emission scheme to use (see SeasaltEmissionMod) + real :: emission_scale ! Global tuning factor for emissions + real, pointer :: radius(:) => null() ! particle effective radius [um] + real, pointer :: rLow(:) => null() ! lower radius of particle bin [um] + real, pointer :: rUp(:) => null() ! upper radius of particle bin [um] + real, pointer :: rhop(:) => null() ! dry salt particle density [kg m-3] + real, pointer :: deep_lakes_mask(:,:) => null() + ! mask used to supress emissions from lakes that are OCEAN tiles + end type SS_GridComp1 + + type SS_GridComp + integer :: n = 0 ! number of instances + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + type(SS_GridComp1), pointer :: gcs(:) => null() ! instances + end type SS_GridComp + + character(len=*), parameter :: rc_basename = 'SS_GridComp' + + + + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + + real, parameter :: radToDeg = 57.2957795 + +CONTAINS + + subroutine SS_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: n,i + + type(ESMF_Config) :: cfg + + Iam = 'SS_GridCompSetServices' + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(rc=status) + VERIFY_(STATUS) + call ESMF_ConfigLoadFile(cfg,trim(rc_basename)//'.rc',rc=status) + VERIFY_(STATUS) + +! Parse resource file +! ------------------- + n = ESMF_ConfigGetLen(cfg,label='SS_instances:',rc=status) + VERIFY_(STATUS) + + +! We have 5 tracers for each instance of SS +! We cannot have fewer instances than half the number of +! SS bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( 5*n .LT. chemReg%n_SS ) then + rc = 35 + return + else if ( 5*n .GT. chemReg%n_SS ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(Iam)// & + ': fewer SS bins than possible SS instances: ',& + n, chemReg%n_SS/5 + end if + n = min(n,chemReg%n_SS/5 ) + +! Record name of each instance +! ---------------------------- + call ESMF_ConfigFindLabel(cfg,'SS_instances:',rc=status) + VERIFY_(STATUS) + do i = 1, n + call ESMF_ConfigGetAttribute(cfg,name,rc=status) + VERIFY_(STATUS) + ! resource file name + IF(TRIM(name) == "full" ) THEN + name = " " ! blank instance name for full (1) + ELSE + name = TRIM(name) ! instance name for others + END IF + call SS_GridCompSetServices1_(gc,chemReg,name,rc=status) + VERIFY_(STATUS) + end do + + RETURN_(ESMF_SUCCESS) + end subroutine SS_GridCompSetServices + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_GridCompInitialize --- Initialize SS_GridComp +! +! !INTERFACE: +! + + subroutine SS_GridCompInitialize ( gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(SS_GridComp), intent(inout) :: gcSS ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the SS Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'SS_GridCompInitialize' + CHARACTER(LEN=255) :: name + + integer :: i, ier, n + +! Load resource file +! ------------------ + call i90_loadf ( trim(rc_basename)//'.rc', ier ) + if ( ier .NE. 0 ) then + rc = 10 + return + end if + +! Parse resource file +! ------------------- + CALL I90_label ( 'SS_instances:', ier ) + if ( ier .NE. 0 ) then + rc = 20 + return + end if + +! First determine how many instances we have +! ------------------------------------------ + n = 0 + do while ( ier .EQ. 0 ) + CALL I90_gtoken( name, ier ) + n = n + 1 + end do + if ( n .EQ. 0 ) then + rc = 30 + return + end if + +! We have 5 tracers for each instance of SS +! We cannot have fewer instances than half the number of +! SS bins in the registry (it is OK to have less, though) +! -------------------------------------------------------- + if ( 5*n .LT. w_c%reg%n_SS ) then + rc = 35 + return + else if ( 5*n .GT. w_c%reg%n_SS ) then + if (MAPL_AM_I_ROOT()) & + print *, trim(myname)// & + ': fewer SS bin sets than possible SS instances'//& + ' (5 bins per instance): ',& + n, w_c%reg%n_SS + end if + n = min(n,w_c%reg%n_SS/5) + gcSS%n = n + +! Next allocate necessary memory +! ------------------------------ + allocate ( gcSS%gcs(n), stat=ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + +! Record name of each instance +! ---------------------------- + CALL I90_label ( 'SS_instances:', ier ) + do i = 1, n + CALL I90_gtoken( name, ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + ! resource file name + gcSS%gcs(i)%rcfilen = trim(rc_basename)//'---'//trim(name)//'.rc' + gcSS%gcs(i)%instance = i ! instance number + IF(TRIM(name) == "full" ) THEN + gcSS%gcs(i)%iname = " " ! blank instance name for full (1) + ELSE + gcSS%gcs(i)%iname = TRIM(name) ! instance name for others + END IF + end do + +! Next initialize each instance +! ----------------------------- + do i = 1, gcSS%n + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,myname,": Initializing instance ",TRIM(gcSS%gcs(i)%iname)," [",gcSS%gcs(i)%instance,"]" + END IF + call SS_SingleInstance_ ( SS_GridCompInitialize1_, i, & + gcSS%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = 1000+ier + return + end if + gcSS%gcs(i)%mie_tables => gcSS%mie_tables + end do + +! All done +! -------- + CALL I90_FullRelease( ier ) + IF( ier /= 0 ) THEN + PRINT *,myname,": I90_FullRelease not successful." + rc = 40 + END IF + + end subroutine SS_GridCompInitialize + + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_GridCompRun1 --- Run SS_GridComp +! +! !INTERFACE: +! + + subroutine SS_GridCompRun1 ( gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(SS_GridComp), INTENT(INOUT) :: gcSS ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the SS Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcSS%n + call SS_SingleInstance_ ( SS_GridCompRun1_, i, & + gcSS%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine SS_GridCompRun1 + + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_GridCompRun2 --- Run SS_GridComp +! +! !INTERFACE: +! + + subroutine SS_GridCompRun2 ( gcSS, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + LOGICAL, INTENT(IN) :: run_alarm ! run alarm + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(SS_GridComp), INTENT(INOUT) :: gcSS ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the SS Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcSS%n + gcSS%gcs(i)%run_alarm = run_alarm + + call SS_SingleInstance_ ( SS_GridCompRun2_, i, & + gcSS%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine SS_GridCompRun2 + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_GridCompFinalize --- Finalize SS_GridComp +! +! !INTERFACE: +! + + subroutine SS_GridCompFinalize ( gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(SS_GridComp), INTENT(INOUT) :: gcSS ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the SS Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcSS%n + call SS_SingleInstance_ ( SS_GridCompFinalize1_, i, & + gcSS%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + if (associated(gcSS%gcs)) deallocate ( gcSS%gcs, stat=ier ) + gcSS%n = -1 + + end subroutine SS_GridCompFinalize + + + subroutine SS_GridCompSetServices1_( gc, chemReg, iname, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + character(len=*), intent(IN ) :: iname + integer, intent(OUT ) :: rc + + character(len=ESMF_MAXSTR) :: Iam + + Iam = "SS_GridCompSetServices1_" + + ! Import spec goes here... + + RETURN_(ESMF_SUCCESS) + + end subroutine SS_GridCompSetServices1_ + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_GridCompInitialize --- Initialize SS_GridComp +! +! !INTERFACE: +! + + subroutine SS_GridCompInitialize1_ ( gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(SS_GridComp1), intent(inout) :: gcSS ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the SS Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'SS_GridCompInitialize1_' + + + character(len=255) :: rcfilen + integer :: n + integer, allocatable :: ier(:) + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, nbins_rc, i, j + real :: qmin, qmax, dummylon + real :: radius, rlow, rup, rhop, fscav, fnum, molwght, rnum + integer :: irhFlag, isstemisFlag, ihoppelFlag, iweibullFlag, iemission_scheme + + integer, parameter :: nhres = 6 ! number of horizontal model resolutions: a,b,c,d,e + real :: emission_scale(nhres) ! scale factor buffer + + + + rcfilen = trim(gcSS%rcfilen) + gcSS%name = 'SS Constituent Package' + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + nbins = w_c%reg%n_SS + n1 = w_c%reg%i_SS + n2 = w_c%reg%j_SS + + call init_() + if ( rc /= 0 ) return + + +! ------------------- +! Parse resource file +! ------------------- + +! Load resource file +! ------------------ + call i90_loadf ( rcfilen, ier(1) ) + if ( ier(1) .ne. 0 ) then + call final_(10) + return + end if + + call i90_label ( 'number_SS_bins:', ier(1) ) + nbins_rc = i90_gint ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(20) + return + end if + if ( nbins_rc /= nbins ) then + call final_(25) + return + end if + +! Particle radius +! --------------- + call i90_label ( 'particle_radius:', ier(1) ) + do n = 1, nbins + radius = i90_gfloat ( ier(n+1) ) + gcSS%radius(n) = radius + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Particle radius (lower bound) +! --------------- + call i90_label ( 'radius_lower:', ier(1) ) + do n = 1, nbins + rlow = i90_gfloat ( ier(n+1) ) + gcSS%rlow(n) = rlow + w_c%reg%rlow(n1+n-1) = rlow * 1.e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Particle radius (upper bound) +! --------------- + call i90_label ( 'radius_upper:', ier(1) ) + do n = 1, nbins + rup = i90_gfloat ( ier(n+1) ) + gcSS%rup(n) = rup + w_c%reg%rup(n1+n-1) = rup * 1.e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Dry Particle Density +! --------------- + call i90_label ( 'SS_density:', ier(1) ) + do n = 1, nbins + rhop = i90_gfloat ( ier(n+1) ) + gcSS%rhop(n) = rhop + w_c%reg%rhop(n1+n-1) = rhop + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Scavenging Efficiency +! To be used in convtran.F90, this parameter +! is the scavenging efficiency of the tracer [km -1] +! --------------- + call i90_label ( 'fscav:', ier(1) ) + do n = 1, nbins + fscav = i90_gfloat ( ier(n+1) ) + w_c%reg%fscav(n1+n-1) = fscav + w_c%qa(n1+n-1)%fscav = fscav + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Number median radius +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_radius_number:', ier(1) ) + do n = 1, nbins + rnum = i90_gfloat ( ier(n+1) ) + w_c%reg%rmed(n1+n-1) = rnum * 1e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Number to mass conversion factor +! To be used in droplet activation code +! --------------- + call i90_label ( 'fnum:', ier(1) ) + do n = 1, nbins + fnum = i90_gfloat ( ier(n+1) ) + w_c%reg%fnum(n1+n-1) = fnum + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Molecular weight +! To be used in droplet activation code +! --------------- + call i90_label ( 'molecular_weight:', ier(1) ) + do n = 1, nbins + molwght = i90_gfloat ( ier(n+1) ) + w_c%reg%molwght(n1+n-1) = molwght + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if +! ------- + +! Particle affected by relative humidity? +! --------------- + call i90_label ( 'rhFlag:', ier(1) ) + irhFlag = i90_gint ( ier(2) ) + gcSS%rhFlag = irhFlag + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + +! Which Emissions Scheme to Use (see SeasaltEmissionMod) +! --------------- + call i90_label ( 'emission_scheme:', ier(1) ) + iemission_scheme = i90_gint ( ier(2) ) + gcSS%emission_scheme = iemission_scheme + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + +! Emissions Efficiency +! Scaling factor to multiply calculated +! emissions by. Applies to all size bins. +! --------------- + CALL I90_Label ( 'emission_scale:', ier(1) ) + do n = 1, nhres + emission_scale(n) = i90_gfloat ( ier(n+1) ) + end do + gcSS%emission_scale = Chem_UtilResVal(im, jm, emission_scale(:), ier(nhres + 2)) + if ( any(ier(1:nhres+2) /= 0) ) then + call final_(50) + return + end if +! ------- + +! SST correction to emission strength following Jaegle et al, 2011 +! --------------- + call i90_label ( 'sstemisFlag:', ier(1) ) + isstemisFlag = i90_gint ( ier(2) ) + if ((isstemisFlag < 0) .or. (isstemisFlag > 2)) then + gcSS%sstemisFlag = 0 ! unknown correction - fall back to no SST correction + else + gcSS%sstemisFlag = isstemisFlag + end if + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + +! Hoppel 2005 correction to emissions (Fan and Toon 2011) +! --------------- + call i90_label ( 'hoppelFlag:', ier(1) ) + ihoppelFlag = i90_gint ( ier(2) ) + if (ihoppelFlag /= 0) then + gcSS%hoppelFlag = .True. + else + gcSS%hoppelFlag = .False. + end if + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + +! Weibull wind speed adjustment to emissions (Fan and Toon 2011) +! --------------- + call i90_label ( 'weibullFlag:', ier(1) ) + iweibullFlag = i90_gint ( ier(2) ) + if (iweibullFlag /= 0) then + gcSS%weibullFlag = .True. + else + gcSS%weibullFlag = .False. + end if + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + +! Mask to prevent emissions from the Great Lakes and the Caspian Sea +! ------------------------------------------------------------------ + gcSS%deep_lakes_mask = 1.0 + + do j = j1, j2 + do i = i1, i2 + dummylon = w_c%grid%lon(i,j)*radToDeg + if( dummylon < 0.0 ) dummylon = dummylon + 360.0 + ! The Great Lakes: lon = [91W,75W], lat = [40.5N, 50N] + if ((dummylon > 267.0) .and. & + (dummylon < 285.0) .and. & + (w_c%grid%lat(i,j)*radToDeg > 40.5) .and. & + (w_c%grid%lat(i,j)*radToDeg < 50.0)) gcSS%deep_lakes_mask(i,j) = 0.0 + + ! The Caspian Sea: lon = [45.0, 56], lat = 35, 48] + if ((dummylon > 45.0) .and. & + (dummylon < 56.0) .and. & + (w_c%grid%lat(i,j)*radToDeg > 35.0) .and. & + (w_c%grid%lat(i,j)*radToDeg < 48.0)) gcSS%deep_lakes_mask(i,j) = 0.0 + end do + end do + + + +! All done +! -------- + call i90_release() + deallocate(ier) + + return + +CONTAINS + + subroutine init_() + integer ios, nerr + nerr = max ( 32, nbins+1 ) + allocate ( gcSS%radius(nbins), gcSS%rLow(nbins), gcSS%rUp(nbins), & + gcSS%rhop(nbins), gcSS%deep_lakes_mask(i1:i2,j1:j2), ier(nerr), stat=ios ) + if ( ios /= 0 ) rc = 100 + end subroutine init_ + + subroutine final_(ierr) + integer :: ierr + integer ios + deallocate ( gcSS%radius, gcSS%rhop, gcSS%rLow, gcSS%rUp, gcSS%deep_lakes_mask, ier, stat=ios ) + call i90_release() + rc = ierr + end subroutine final_ + + end subroutine SS_GridCompInitialize1_ + + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_GridCompRun1_ --- The Chem Driver, run phase 1 +! +! !INTERFACE: +! + + subroutine SS_GridCompRun1_ ( gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(SS_GridComp1), intent(inout) :: gcSS ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called SS Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: Iam = 'SS_GridCompRun1_' + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n, ijl, ijkl, ijk1l, i, j + real :: qmin, qmax + real, pointer :: SS_radius(:), SS_rhop(:) + real, pointer :: memissions(:,:), nemissions(:,:), w10m(:,:), dqa(:,:) + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: frlake, frocean, frseaice, oro + real, pointer, dimension(:,:) :: u10m, v10m, ustar + real, pointer, dimension(:,:) :: dz + real, pointer, dimension(:,:) :: tskin + real, pointer, dimension(:,:,:) :: tmpu, rhoa + real, pointer, dimension(:,:) :: area + +! Modifications to source function + real, allocatable, dimension(:,:) :: tskin_c + real, allocatable, dimension(:,:) :: fsstemis + real, allocatable, dimension(:,:) :: fgridefficiency + real, allocatable, dimension(:,:) :: fhoppel, vsettle + real :: radius_wet, rhop_wet, diff_coef + double precision :: a, c, k, wt, x + double precision, allocatable, dimension(:,:) :: gweibull, wm + +#define EXPORT expChem +#define iNAME TRIM(gcSS%iname) + +#define ptrSSEM SS_emis + + integer :: STATUS + +#include "SS_GetPointer___.h" + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_SS + n1 = w_c%reg%i_SS + n2 = w_c%reg%j_SS + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + + +! Seasalt particle radius [m] and density [kg m-3] +! --------------------------------------------- + allocate(SS_radius(nbins), SS_rhop(nbins), __STAT__) + + SS_radius = 1.e-6*gcSS%radius + SS_rhop = gcSS%rhop + + allocate(w10m(i1:i2,j1:j2), dqa(i1:i2,j1:j2), __STAT__) + allocate(memissions(i1:i2,j1:j2), nemissions(i1:i2,j1:j2), __STAT__) + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, frocean, 'FROCEAN', __RC__ ) + call MAPL_GetPointer ( impChem, frseaice, 'FRACI', __RC__ ) + call MAPL_GetPointer ( impChem, oro, 'LWI', __RC__ ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', __RC__ ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', __RC__ ) + call MAPL_GetPointer ( impChem, ustar, 'USTAR', __RC__ ) + call MAPL_GetPointer ( impChem, tskin, 'TS', __RC__ ) + call MAPL_GetPointer ( impChem, dz, 'DZ', __RC__ ) + call MAPL_GetPointer ( impChem, frlake, 'FRLAKE', __RC__ ) + call MAPL_GetPointer ( impChem, area, 'AREA', __RC__ ) + +! Define 10-m wind speed + w10m = sqrt(u10m*u10m + v10m*v10m) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + + + +#ifdef DEBUG + + call pmaxmin('SS: frocean ', frocean, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: frseaice ', frseaice, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: oro ', oro , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: u10m ', u10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: v10m ', v10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: ustar ', ustar , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: tskin ', tskin , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + +#endif + +! Seasalt Source (and modifications) +! ----------- +! Grid box efficiency to emission (fraction of sea water) + allocate(fgridefficiency(i1:i2,j1:j2), __STAT__ ) + fgridefficiency = min(max(0.,(frocean-frseaice)*gcSS%deep_lakes_mask),1.) + + +! Apply SST correction to emissions + allocate(fsstemis(i1:i2,j1:j2), __STAT__ ) + + fsstemis = 1.0 + + if (gcSS%sstemisFlag == 1) then ! SST correction folowing Jaegle et al. 2011 + fsstemis = 0.0 + + allocate( tskin_c(i1:i2,j1:j2), __STAT__ ) + tskin_c = tskin - 273.15 + fsstemis = (0.3 + 0.1*tskin_c - 0.0076*tskin_c**2 + 0.00021*tskin_c**3) + + where(fsstemis < 0.0) fsstemis = 0.0 + + deallocate( tskin_c, __STAT__ ) + else if (gcSS%sstemisFlag == 2) then ! GEOS5 SST correction + fsstemis = 0.0 + + allocate( tskin_c(i1:i2,j1:j2), __STAT__ ) + tskin_c = tskin - 273.15 + + where(tskin_c < -0.1) tskin_c = -0.1 ! temperature range (0, 36) C + where(tskin_c > 36.0) tskin_c = 36.0 ! + + fsstemis = (-1.107211 -0.010681*tskin_c -0.002276*tskin_c**2 + 60.288927*1.0/(40.0 - tskin_c)) + where(fsstemis < 0.0) fsstemis = 0.0 + where(fsstemis > 7.0) fsstemis = 7.0 + + deallocate( tskin_c, __STAT__ ) + end if + +! Apply a Weibull distribution to emissions wind speeds +! The Weibull distribution correction ends up being a multiplicative constant (g) times +! our present source function (see Eq. 12 in Fan & Toon, 2011 and notes for 9/22/11). +! This constant is derived from the incomplete and complete forms of the gamma +! function, hence the utilities pasted below. The Weibull function and shape +! parameters (k, c) assumed are from Justus 1978. + + allocate(gweibull(i1:i2,j1:j2), wm(i1:i2,j1:j2), __STAT__ ) + gweibull = 1.0 + wm = sqrt(u10m**2 + v10m**2) ! mean wind speed + wt = 4.d0 ! a threshold (Fan & Toon, 2011) + + if (gcSS%weibullFlag) then + gweibull = 0.0 + + do j = j1, j2 + do i = i1, i2 + if (wm(i,j) > 0.01) then + k = 0.94d0 * sqrt(wm(i,j)) ! Weibull shape parameter + c = wm(i,j) / gamma(1.d0 + 1.d0/k) ! Weibull shape parameter + x = (wt / c) ** k + a = 3.41d0 / k + 1.d0 + gweibull(i,j) = (c / wm(i,j))**3.41d0 * igamma(a,x) + end if + end do ! i + end do ! j + endif + +! Loop over bins and do emission calculation +! Possibly apply the Hoppel correction based on fall speed (Fan and Toon, 2011) + allocate(fhoppel(i1:i2,j1:j2), vsettle(i1:i2,j1:j2), __STAT__ ) + fhoppel = 1.0 + do n = 1, nbins + memissions = 0. + nemissions = 0. + dqa = 0. + call SeasaltEmission( gcSS%rLow(n), gcSS%rUp(n), gcSS%emission_scheme, w10m, ustar, & + memissions, nemissions, rc ) +! For the Hoppel correction need to compute the wet radius and settling velocity +! in the surface + if(gcSS%hoppelFlag) then + do j = j1, j2 + do i = i1, i2 + call wet_radius ( SS_radius(n), SS_rhop(n), w_c%rh(i,j,km), gcSS%rhFlag, & + radius_wet, rhop_wet ) + call Chem_CalcVsettle ( radius_wet, rhop_wet, rhoa(i,j,km), tmpu(i,j,km), & + diff_coef, vsettle(i,j) ) + fhoppel(i,j) = (10./dz(i,j)) ** (vsettle(i,j)/MAPL_KARMAN/ustar(i,j)) + end do + end do + endif + +! For the moment, do not apply these corrections to the emissions + memissions = gcSS%emission_scale * fgridefficiency * fsstemis * fhoppel * gweibull * memissions + + dqa = memissions * cdt * grav / w_c%delp(:,:,km) + + w_c%qa(n1+n-1)%data3d(:,:,km) = w_c%qa(n1+n-1)%data3d(:,:,km) + dqa + + if (associated(SS_emis(n)%data2d)) then + SS_emis(n)%data2d = memissions + end if + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('SS: q_emi', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), & + qmin, qmax, ijl, km, 1. ) + end do +#endif + + +! Clean up +! -------- + deallocate(SS_radius, SS_rhop, __STAT__) + deallocate(memissions, nemissions, __STAT__) + deallocate(w10m, dqa, __STAT__) + deallocate(fsstemis, fgridefficiency, __STAT__) + deallocate(fhoppel, vsettle, gweibull, wm, __STAT__) + + return + + end subroutine SS_GridCompRun1_ + + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_GridCompRun2 --- The Chem Driver +! +! !INTERFACE: +! + + subroutine SS_GridCompRun2_ ( gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(SS_GridComp1), intent(inout) :: gcSS ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called SS Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: Iam = 'SS_GridCompRun2_' + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n, ijl, ijkl, ijk1l, k + real :: qmin, qmax + real, pointer :: SS_radius(:), SS_rhop(:) + real, pointer :: dqa(:,:), drydepositionfrequency(:,:) + type(Chem_Array), pointer :: fluxout + logical :: KIN + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: frlake, frocean, frseaice, & + oro, u10m, v10m, & + ustar, precc, precl, pblh, dz, & + shflux, z0h, hsurf, tskin + real, pointer, dimension(:,:,:) :: tmpu, rhoa, u, v, hghte, ple + real, pointer, dimension(:,:,:) :: pfllsan, pfilsan + +! Additional needs for GOCART convective diagnostic - Run2 + real, pointer, dimension(:,:,:) :: cmfmc, qlcn, qicn, dtrain + real, pointer, dimension(:,:) :: area + real*8, allocatable, dimension(:,:,:) :: cmfmc_, qccu_, dtrain_, & + airmass_, airmol_, vud_, & + delz_, delp_, tmpu_, ple_ + real*8, allocatable :: tc_(:,:,:,:), bcnv_(:,:,:) + real*8, allocatable :: area_(:,:), frlake_(:,:), & + frocean_(:,:), frseaice_(:,:) + integer*4 :: icdt + + +#define EXPORT expChem +#define iNAME TRIM(gcSS%iname) + +#define ptrSSWT SS_wet +#define ptrSSSV SS_conv +#define ptrSSEM SS_emis +#define ptrSSDP SS_dep +#define ptrSSSD SS_set + +#define ptrSSMASS SS_mass +#define ptrSSMASS25 SS_mass25 +#define ptrSSSMASS SS_sfcmass +#define ptrSSCMASS SS_colmass +#define ptrSSEXTTAU SS_exttau +#define ptrSSSCATAU SS_scatau +#define ptrSSSMASS25 SS_sfcmass25 +#define ptrSSCMASS25 SS_colmass25 +#define ptrSSEXTT25 SS_exttau25 +#define ptrSSSCAT25 SS_scatau25 +#define ptrSSAERIDX SS_aeridx +#define ptrSSCONC SS_conc +#define ptrSSEXTCOEF SS_extcoef +#define ptrSSSCACOEF SS_scacoef +#define ptrSSEXTTFM SS_exttaufm +#define ptrSSSCATFM SS_scataufm +#define ptrSSANGSTR SS_angstrom +#define ptrSSFLUXU SS_fluxu +#define ptrSSFLUXV SS_fluxv + + integer :: STATUS + +#include "SS_GetPointer___.h" + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_SS + n1 = w_c%reg%i_SS + n2 = w_c%reg%j_SS + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, frocean, 'FROCEAN', __RC__ ) + call MAPL_GetPointer ( impChem, frseaice, 'FRACI', __RC__ ) + call MAPL_GetPointer ( impChem, oro, 'LWI', __RC__ ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', __RC__ ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', __RC__ ) + call MAPL_GetPointer ( impChem, ustar, 'USTAR', __RC__ ) + call MAPL_GetPointer ( impChem, precc, 'CN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, precl, 'NCN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, tskin, 'TS', __RC__ ) + call MAPL_GetPointer ( impChem, z0h, 'Z0H', __RC__ ) + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + call MAPL_GetPointer ( impChem, shflux, 'SH', __RC__ ) + call MAPL_GetPointer ( impChem, dz, 'DZ', __RC__ ) + call MAPL_GetPointer ( impChem, frlake, 'FRLAKE', __RC__ ) + call MAPL_GetPointer ( impChem, area, 'AREA', __RC__ ) + + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, u, 'U', __RC__ ) + call MAPL_GetPointer ( impChem, v, 'V', __RC__ ) + call MAPL_GetPointer ( impChem, hghte, 'ZLE', __RC__ ) + call MAPL_GetPointer ( impChem, ple, 'PLE', __RC__ ) + call MAPL_GetPointer ( impChem, qlcn, 'QLCN', __RC__ ) + call MAPL_GetPointer ( impChem, qicn, 'QICN', __RC__ ) + call MAPL_GetPointer ( impChem, cmfmc, 'CNV_MFC', __RC__ ) + call MAPL_GetPointer ( impChem, dtrain, 'CNV_MFD', __RC__ ) + call MAPL_GetPointer ( impChem, pfllsan, 'PFL_LSAN', __RC__ ) + call MAPL_GetPointer ( impChem, pfilsan, 'PFI_LSAN', __RC__ ) + +! Unlike GEOS-4 hghte is defined for km+1 +! --------------------------------------- + hsurf => hghte(i1:i2,j1:j2,km) ! in GEOS-5 hghte is in [0,km] + + +#ifdef DEBUG + + call pmaxmin('SS: frocean ', frocean, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: frseaice ', frseaice, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: oro ', oro , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: u10m ', u10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: v10m ', v10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: ustar ', ustar , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: precc ', precc , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: precl ', precl , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: shfflux ', shflux , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: z0h ', z0h , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: hsurf ', hsurf , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: tskin ', tskin , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SS: tmpu ', tmpu , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SS: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SS: u ', u , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SS: v ', v , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SS: hghte ', hghte , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SS: pfllsan ', pfllsan , qmin, qmax, ijk1l,1, 1. ) + call pmaxmin('SS: pfilsan ', pfilsan , qmin, qmax, ijk1l,1, 1. ) + +#endif + + +RUN_ALARM: if (gcSS%run_alarm) then + +! Seasalt particle radius [m] and density [kg m-3] +! --------------------------------------------- + allocate( SS_radius(nbins), SS_rhop(nbins), __STAT__ ) + SS_radius = 1.e-6*gcSS%radius + SS_rhop = gcSS%rhop + + allocate( fluxout, __STAT__) + allocate( fluxout%data2d(i1:i2,j1:j2), dqa(i1:i2,j1:j2), & + drydepositionfrequency(i1:i2,j1:j2), __STAT__) + + +! Seasalt Settling +! ---------------- + call Chem_Settling ( i1, i2, j1, j2, km, n1, n2, nbins, gcSS%rhFlag, & + SS_radius, SS_rhop, cdt, w_c, tmpu, rhoa, hsurf, & + hghte, SS_set, rc ) + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('SS: q_set', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! Seasalt Deposition +! ----------- + drydepositionfrequency = 0. + call DryDepositionGOCART( i1, i2, j1, j2, km, & + tmpu, rhoa, hghte, oro, ustar, & + pblh, shflux, z0h, drydepositionfrequency, rc ) + + ! increase deposition velocity over land + where (abs(oro - LAND) < 0.5) + drydepositionfrequency = 5.0 * drydepositionfrequency + end where + + do n = 1, nbins + dqa = 0. + dqa = max(0.0, w_c%qa(n1+n-1)%data3d(:,:,km)*(1.-exp(-drydepositionfrequency*cdt))) + w_c%qa(n1+n-1)%data3d(:,:,km) = & + w_c%qa(n1+n-1)%data3d(:,:,km) - dqa + if( associated(SS_dep(n)%data2d) ) & + SS_dep(n)%data2d = dqa*w_c%delp(:,:,km)/grav/cdt + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('SS: q_dry', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + +! Seasalt Large-scale Wet Removal +! ------------------------------- + KIN = .TRUE. + do n = 1, nbins + w_c%qa(n1+n-1)%fwet = 1. + call WetRemovalGOCART(i1, i2, j1, j2, km, n1+n-1, n1+n-1, cdt, 'sea_salt', KIN, & + w_c%qa, ple, tmpu, rhoa, pfllsan, pfilsan, & + precc, precl, fluxout, rc ) + if(associated(SS_wet(n)%data2d)) SS_wet(n)%data2d = fluxout%data2d + end do + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('SS: q_wet', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Seasalt Convective-scale Mixing and Wet Removal +! ----------------------------------------------- + KIN = .TRUE. + icdt = cdt + allocate(cmfmc_(i1:i2,j1:j2,km+1), qccu_(i1:i2,j1:j2,km), & + dtrain_(i1:i2,j1:j2,km), airmass_(i1:i2,j1:j2,km), & + delz_(i1:i2,j1:j2,km), vud_(i1:i2,j1:j2,km), & + tc_(i1:i2,j1:j2,km,n1:n2), delp_(i1:i2,j1:j2,km), & + airmol_(i1:i2,j1:j2,km), tmpu_(i1:i2,j1:j2,km), & + bcnv_(i1:i2,j1:j2,n1:n2), ple_(i1:i2,j1:j2,km+1), & + area_(i1:i2,j1:j2), frlake_(i1:i2,j1:j2), & + frocean_(i1:i2,j1:j2), frseaice_(i1:i2,j1:j2), __STAT__ ) + + bcnv_ = 0.0 + area_ = area + frlake_ = frlake + frocean_ = frocean + frseaice_ = frseaice + do k = 1, km+1 + cmfmc_(:,:,k) = cmfmc(:,:,km-k+1) + ple_(:,:,k) = ple(:,:,km-k+1) + end do + do k = 1, km + dtrain_(:,:,k) = dtrain(:,:,km-k+1) + qccu_(:,:,k) = qlcn(:,:,km-k+1) + qicn(:,:,km-k+1) + delp_(:,:,k) = w_c%delp(:,:,km-k+1)/100. + airmass_(:,:,k) = w_c%delp(:,:,km-k+1)/grav*area_ + airmol_(:,:,k) = airmass_(:,:,k)*1000./28.966 + delz_(:,:,k) = w_c%delp(:,:,km-k+1)/grav/rhoa(:,:,km-k+1) + tmpu_(:,:,k) = tmpu(:,:,km-k+1) + enddo + do n = n1, n2 + do k = 1, km + tc_(:,:,k,n) = w_c%qa(n)%data3d(:,:,km-k+1) + enddo + enddo + call set_vud(i1, i2, j1, j2, km, frlake_, frocean_, frseaice_, cmfmc_, qccu_, & + airmass_, delz_, area_, vud_) + call convection(i1, i2, j1, j2, km, n1, n2, icdt, 'sea_salt', kin, & + tc_, cmfmc_, dtrain_, area_, delz_, delp_, vud_, & + airmass_, airmol_, tmpu_, ple_, & + bcnv_) +! Return adjusted tracer to mixing ratio + do n = n1, n2 + do k = 1, km + w_c%qa(n)%data3d(:,:,km-k+1) = tc_(:,:,k,n) + enddo + enddo + +! Note GOCART returns bcnv_ as negative, recast for my diagnostic + do n = 1, nbins + if(associated(SS_conv(n)%data2d)) SS_conv(n)%data2d = -bcnv_(:,:,n1+n-1)/area_/icdt + end do + +! Clean up +! -------- + + deallocate(cmfmc_, qccu_, dtrain_, tc_, airmass_, & + delz_, vud_, delp_, airmol_, tmpu_, bcnv_, ple_, & + area_, frlake_, frocean_, frseaice_, __STAT__ ) + + deallocate(fluxout%data2d, __STAT__) + deallocate(fluxout, __STAT__) + + deallocate(dqa, drydepositionfrequency, __STAT__ ) + + deallocate(SS_radius, SS_rhop, __STAT__) + + end if RUN_ALARM + +! Compute the desired output diagnostics here +! Ideally this will go where chemout is called in fvgcm.F since that +! will reflect the distributions after transport, etc. +! ------------------------------------------------------------------ + call SS_Compute_Diags(i1, i2, j1, j2, km, nbins, gcSS, w_c, tmpu, rhoa, u, v, & + SS_sfcmass, SS_colmass, SS_mass, SS_exttau, SS_scatau, & + SS_sfcmass25, SS_colmass25, SS_mass25, SS_exttau25, SS_scatau25, & + SS_conc, SS_extcoef, SS_scacoef, SS_exttaufm, SS_scataufm, & + SS_angstrom, SS_fluxu, SS_fluxv, rc) + + return + +CONTAINS +!############################################################################## +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_Compute_Diags - Calculate seasalt 2D diagnostics +! +! !INTERFACE: +! + + subroutine SS_Compute_Diags ( i1, i2, j1, j2, km, nbins, gcSS, w_c, tmpu, rhoa, u, v, & + sfcmass, colmass, mass, exttau, scatau, & + sfcmass25, colmass25, mass25, exttau25, scatau25, & + conc, extcoef, scacoef, exttaufm, scataufm, & + angstrom, fluxu, fluxv, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2, km, nbins + type(SS_GridComp1), intent(inout) :: gcSS ! SS Grid Component + type(Chem_Bundle), intent(in) :: w_c ! Chem Bundle + real, pointer, dimension(:,:,:) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:,:) :: u ! east-west wind [m s-1] + real, pointer, dimension(:,:,:) :: v ! north-south wind [m s-1] + +! !OUTPUT PARAMETERS: + type(Chem_Array), intent(inout) :: sfcmass ! sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: colmass ! col mass density kg/m2 + type(Chem_Array), intent(inout) :: mass ! 3d mass mixing ratio kg/kg + type(Chem_Array), intent(inout) :: exttau ! ext. AOT at 550 nm + type(Chem_Array), intent(inout) :: scatau ! sct. AOT at 550 nm + type(Chem_Array), intent(inout) :: sfcmass25 ! sfc mass concentration kg/m3 (pm2.5) + type(Chem_Array), intent(inout) :: colmass25 ! col mass density kg/m2 (pm2.5) + type(Chem_Array), intent(inout) :: mass25 ! 3d mass mixing ratio kg/kg (pm2.5) + type(Chem_Array), intent(inout) :: exttau25 ! ext. AOT at 550 nm (pm2.5) + type(Chem_Array), intent(inout) :: scatau25 ! sct. AOT at 550 nm (pm2.5) + type(Chem_Array), intent(inout) :: conc ! 3d mass concentration, kg/m3 + type(Chem_Array), intent(inout) :: extcoef ! 3d ext. coefficient, 1/m + type(Chem_Array), intent(inout) :: scacoef ! 3d scat.coefficient, 1/m + type(Chem_Array), intent(inout) :: exttaufm ! fine mode (sub-micron) ext. AOT at 550 nm + type(Chem_Array), intent(inout) :: scataufm ! fine mode (sub-micron) sct. AOT at 550 nm + type(Chem_Array), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter + type(Chem_Array), intent(inout) :: fluxu ! Column mass flux in x direction + type(Chem_Array), intent(inout) :: fluxv ! Column mass flux in y direction + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Calculates some simple 2d diagnostics from the SS fields +! Surface concentration (dry) +! Column mass load (dry) +! Extinction aot 550 (wet) +! Scattering aot 550 (wet) +! For the moment, this is hardwired. +! +! !REVISION HISTORY: +! +! 16APR2004, Colarco +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + character(len=*), parameter :: myname = 'SS_Compute_Diags' + integer :: i, j, k, n, n1, n2, nch, idx + real :: tau, ssa + real :: fPMfm(nbins) ! fraction of bin with particles diameter < 1.0 um + real :: fPM25(nbins) ! fraction of bin with particles diameter < 2.5 um + character(len=255) :: qname + real, dimension(i1:i2,j1:j2) :: tau470, tau870 + real :: ilam550, ilam470, ilam870 + logical :: do_angstrom + + +! Initialize local variables +! -------------------------- + n1 = w_c%reg%i_SS + n2 = w_c%reg%j_SS + nch = gcSS%mie_tables%nch + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + ilam470 = 0. + ilam870 = 0. + if(nch .gt. 1) then + do i = 1, nch + if ( gcSS%mie_tables%channels(i) .ge. 5.49e-7 .and. & + gcSS%mie_tables%channels(i) .le. 5.51e-7) ilam550 = i + if ( gcSS%mie_tables%channels(i) .ge. 4.69e-7 .and. & + gcSS%mie_tables%channels(i) .le. 4.71e-7) ilam470 = i + if ( gcSS%mie_tables%channels(i) .ge. 8.69e-7 .and. & + gcSS%mie_tables%channels(i) .le. 8.71e-7) ilam870 = i + enddo + endif + +! Determine if going to do Angstrom parameter calculation +! ------------------------------------------------------- + do_angstrom = .false. +! If both 470 and 870 channels provided (and not the same) then +! possibly will do Angstrom parameter calculation + if(ilam470 .ne. 0. .and. & + ilam870 .ne. 0. .and. & + ilam470 .ne. ilam870) do_angstrom = .true. + + + +! Compute the fine mode (sub-micron) and PM2.5 bin-wise fractions +! ------------------------------------ + call SS_Binwise_PM_Fractions(fPMfm, 0.50, gcSS%rlow, gcSS%rup, nbins) ! 2*r < 1.0 um + call SS_Binwise_PM_Fractions(fPM25, 1.25, gcSS%rlow, gcSS%rup, nbins) ! 2*r < 2.5 um + + +! Calculate the diagnostic variables if requested +! ----------------------------------------------- + +! Calculate the surface mass concentration + if( associated(sfcmass%data2d) ) then + sfcmass%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + sfcmass%data2d(i1:i2,j1:j2) & + = sfcmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + end do + endif + if( associated(sfcmass25%data2d) ) then + sfcmass25%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + sfcmass25%data2d(i1:i2,j1:j2) & + = sfcmass25%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km)*fPM25(n) + end do + endif + +! Calculate the seasalt column loading + if( associated(colmass%data2d) ) then + colmass%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + colmass%data2d(i1:i2,j1:j2) & + = colmass%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + end do + end do + endif + if( associated(colmass25%data2d)) then + colmass25%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + colmass25%data2d(i1:i2,j1:j2) & + = colmass25%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*fPM25(n) + end do + end do + endif + +! Calculate the total mass concentration + if( associated(conc%data3d) ) then + conc%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + conc%data3d(i1:i2,j1:j2,1:km) & + = conc%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km)*rhoa(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the total mass mixing ratio + if( associated(mass%data3d) ) then + mass%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + mass%data3d(i1:i2,j1:j2,1:km) & + = mass%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km) + end do + endif + if( associated(mass25%data3d) ) then + mass25%data3d(i1:i2,j1:j2,1:km) = 0. + do n = 1, nbins + mass25%data3d(i1:i2,j1:j2,1:km) & + = mass25%data3d(i1:i2,j1:j2,1:km) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,1:km)*fPM25(n) + end do + endif + +! Calculate the column mass flux in x direction + if( associated(fluxu%data2d) ) then + fluxu%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + fluxu%data2d(i1:i2,j1:j2) & + = fluxu%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*u(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the column mass flux in y direction + if( associated(fluxv%data2d) ) then + fluxv%data2d(i1:i2,j1:j2) = 0. + do n = 1, nbins + do k = 1, km + fluxv%data2d(i1:i2,j1:j2) & + = fluxv%data2d(i1:i2,j1:j2) & + + w_c%qa(n+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*v(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the extinction and/or scattering AOD + if( associated(exttau%data2d) .or. associated(scatau%data2d) ) then + + if( associated(exttau%data2d)) exttau%data2d(i1:i2,j1:j2) = 0. + if( associated(scatau%data2d)) scatau%data2d(i1:i2,j1:j2) = 0. + + if( associated(exttau25%data2d)) exttau25%data2d(i1:i2,j1:j2) = 0. + if( associated(scatau25%data2d)) scatau25%data2d(i1:i2,j1:j2) = 0. + + if( associated(exttaufm%data2d)) exttaufm%data2d(i1:i2,j1:j2) = 0. + if( associated(scataufm%data2d)) scataufm%data2d(i1:i2,j1:j2) = 0. + + if( associated(extcoef%data3d)) extcoef%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(scacoef%data3d)) scacoef%data3d(i1:i2,j1:j2,1:km) = 0. + + do n = 1, nbins + +! Select the name for species + qname = trim(w_c%reg%vname(n+n1-1)) + idx = Chem_MieQueryIdx(gcSS%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(gcSS%mie_tables, idx, ilam550, & + w_c%qa(n1+n-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau, ssa=ssa) + +! Calculate the total ext. and scat. coefficients + if( associated(extcoef%data3d) ) then + extcoef%data3d(i,j,k) = extcoef%data3d(i,j,k) + & + tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + if( associated(scacoef%data3d) ) then + scacoef%data3d(i,j,k) = scacoef%data3d(i,j,k) + & + ssa * tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + + +! Integrate in the vertical + if( associated(exttau%data2d) ) exttau%data2d(i,j) = exttau%data2d(i,j) + tau + if( associated(exttaufm%data2d)) & + exttaufm%data2d(i,j) = exttaufm%data2d(i,j) + tau*fPMfm(n) + if( associated(exttau25%data2d)) & + exttau25%data2d(i,j) = exttau25%data2d(i,j) + tau*fPM25(n) + + if( associated(scatau%data2d) ) scatau%data2d(i,j) = scatau%data2d(i,j) + tau*ssa + if( associated(scataufm%data2d) ) & + scataufm%data2d(i,j) = scataufm%data2d(i,j) + tau*ssa*fPMfm(n) + if( associated(scatau25%data2d) ) & + scatau25%data2d(i,j) = scatau25%data2d(i,j) + tau*ssa*fPM25(n) + + enddo + enddo + enddo + + enddo ! nbins + + endif + + +! Calculate the 470-870 Angstrom parameter + if( associated(angstrom%data2d) .and. do_angstrom ) then + + angstrom%data2d(i1:i2,j1:j2) = 0. +! Set tau to small number by default + tau470(i1:i2,j1:j2) = tiny(1.0) + tau870(i1:i2,j1:j2) = tiny(1.0) + + do n = 1, nbins + +! Select the name for species + qname = trim(w_c%reg%vname(n+n1-1)) + idx = Chem_MieQueryIdx(gcSS%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + + call Chem_MieQuery(gcSS%mie_tables, idx, ilam470, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau470(i,j) = tau470(i,j) + tau + + call Chem_MieQuery(gcSS%mie_tables, idx, ilam870, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau870(i,j) = tau870(i,j) + tau + + enddo + enddo + enddo + + enddo ! nbins + angstrom%data2d(i1:i2,j1:j2) = & + -log(tau470(i1:i2,j1:j2)/tau870(i1:i2,j1:j2)) / & + log(470./870.) + endif + + + rc = 0 + + end subroutine SS_Compute_Diags + + +!############################################################################## +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_Binwise_PM_Fractions - Calculate bin-wise PM fractions +! +! !INTERFACE: +! + + subroutine SS_Binwise_PM_Fractions(fPM, rPM, r_low, r_up, nbins) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + real, dimension(:), intent(inout) :: fPM ! bin-wise PM fraction (r < rPM) + +! !INPUT PARAMETERS: + + real, intent(in) :: rPM ! PM radius + integer, intent(in) :: nbins ! number of bins + real, dimension(:), intent(in) :: r_low ! bin radii - low bounds + real, dimension(:), intent(in) :: r_up ! bin radii - upper bounds + +! !OUTPUT PARAMETERS: + + +! !DESCRIPTION: Calculates bin-wise PM fractions +! +! !REVISION HISTORY: +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + + integer :: n + + character(len=*), parameter :: myname = 'SS_Binwise_PM_Fractions' + + do n = 1, nbins + if(r_up(n) < rPM) then + fPM(n) = 1.0 + else + if(r_low(n) < rPM) then +! Assume dm/dlnr = constant, i.e., dm/dr ~ 1/r + fPM(n) = log(rPM/r_low(n)) / log(r_up(n)/r_low(n)) + else + fPM(n) = 0.0 + endif + endif + enddo + + end subroutine SS_Binwise_PM_Fractions + + end subroutine SS_GridCompRun2_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + subroutine SS_GridCompFinalize1_ ( gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(SS_GridComp1), intent(inout) :: gcSS ! Grid Component + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Import State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'SS_GridCompFinalize1_' + + if (associated(gcSS%radius)) deallocate(gcSS%radius, stat=rc) + if (associated(gcSS%rhop)) deallocate(gcSS%rhop, stat=rc) + if (associated(gcSS%rLow)) deallocate(gcSS%rLow, stat=rc) + if (associated(gcSS%rUp)) deallocate(gcSS%rUp, stat=rc) + if (associated(gcSS%deep_lakes_mask)) deallocate(gcSS%deep_lakes_mask, stat=rc) + + rc = 0 + + return + + end subroutine SS_GridCompFinalize1_ + + subroutine wet_radius (radius, rhop, rh, flag, & + radius_wet, rhop_wet) + +! Compute the wet radius of sea salt particle +! Inputs: radius - dry radius [m] +! rhop - dry density [kg m-3] +! rh - relative humidity [0-1] +! flag - 1 (Fitzgerald, 1975) +! - 2 (Gerber, 1985) +! Outputs: radius_wet - humidified radius [m] +! rhop_wet - wet density [kg m-3] + + real, intent(in) :: radius, rhop, rh + integer :: flag ! control method of humidification + real, intent(out) :: radius_wet, rhop_wet + +! Local + real :: sat, rcm, rrat + real, parameter :: rhow = 1000. ! Density of water [kg m-3] + +! The following parameters relate to the swelling of seasalt like particles +! following Fitzgerald, Journal of Applied Meteorology, 1975. + real, parameter :: epsilon = 1. ! soluble fraction of deliqeuscing particle + real, parameter :: alphaNaCl = 1.35 + real :: alpha, alpha1, alpharat, beta, theta, f1, f2 + +! parameter from Gerber 1985 (units require radius in cm, see rcm) + real, parameter :: c1=0.7674, c2=3.079, c3=2.573e-11, c4=-1.424 + +! Default is to return radius as radius_wet, rhop as rhop_wet + radius_wet = radius + rhop_wet = rhop + +! Make sure saturation ratio (RH) is sensible + sat = max(rh,tiny(1.0)) ! to avoid zero FPE + +! Fitzgerald Scheme + if(flag .eq. 1 .and. sat .ge. 0.80) then +! parameterization blows up for RH > 0.995, so set that as max +! rh needs to be scaled 0 - 1 + sat = min(0.995,sat) +! Calculate the alpha and beta parameters for the wet particle +! relative to amonium sulfate + beta = exp( (0.00077*sat) / (1.009-sat) ) + if(sat .le. 0.97) then + theta = 1.058 + else + theta = 1.058 - (0.0155*(sat-0.97)) /(1.02-sat**1.4) + endif + alpha1 = 1.2*exp( (0.066*sat) / (theta-sat) ) + f1 = 10.2 - 23.7*sat + 14.5*sat**2. + f2 = -6.7 + 15.5*sat - 9.2*sat**2. + alpharat = 1. - f1*(1.-epsilon) - f2*(1.-epsilon**2.) + alpha = alphaNaCl * (alpha1*alpharat) +! radius_wet is the radius of the wet particle + radius_wet = alpha * radius**beta + rrat = (radius/radius_wet)**3. + rhop_wet = rrat*rhop + (1.-rrat)*rhow + elseif(flag .eq. 2) then ! Gerber + sat = min(0.995,sat) + rcm = radius*100. + radius_wet = 0.01 * ( c1*rcm**c2 / (c3*rcm**c4-alog10(sat)) & + + rcm**3.)**(1./3.) + rrat = (radius/radius_wet)**3. + rhop_wet = rrat*rhop + (1.-rrat)*rhow + endif + + end subroutine wet_radius + +!=============================================================================== +!gamma and incomplete gamma functions from Tianyi Fan, but she cannot recall +!origin of the code. I did verify against IDL for accuracy. --prc + double precision function gamma(X) + +!----------------------------------------------------------------------- +! Gamma function +!----------------------------------------------------------------------- + implicit none +double precision, intent(in) :: X +! local variable +double precision G(26) +double precision M1, Z, M, R, GR +integer K +double precision, parameter :: PI = 4.d0 * atan(1.d0) + + IF (X.EQ.INT(X)) THEN + IF (X.GT.0.0) THEN + gamma=1.0d0 + M1=X-1 + DO K=2,M1 + gamma=gamma*K + end do + ELSE + gamma=1.0d+300 + ENDIF + ELSE + IF (ABS(X).GT.1.0) THEN + Z=ABS(X) + M=INT(Z) + R=1.0 + DO K=1,M + R=R*(Z-K) + END DO + Z=Z-M + ELSE + Z=X + ENDIF + + DATA G/1.0D0,0.5772156649015329D0, & + -0.6558780715202538D0, -0.420026350340952D-1, & + 0.1665386113822915D0,-.421977345555443D-1, & + -.96219715278770D-2, .72189432466630D-2, & + -.11651675918591D-2, -.2152416741149D-3, & + .1280502823882D-3, -.201348547807D-4, & + -.12504934821D-5, .11330272320D-5, & + -.2056338417D-6, .61160950D-8, & + .50020075D-8, -.11812746D-8, & + .1043427D-9, .77823D-11, & + -.36968D-11, .51D-12, & + -.206D-13, -.54D-14, .14D-14, .1D-15/ + GR=G(26) + DO K=25,1,-1 + GR=GR*Z+G(K) + END DO + gamma =1.0/(GR*Z) + IF (ABS(X).GT.1.0) THEN + gamma=gamma*R + IF (X.LT.0.0D0) gamma =-PI/(X*gamma*SIN(PI*X)) + ENDIF + ENDIF + RETURN + + + + end function gamma + +!=============================================================================== + DOUBLE PRECISION function igamma(A, X) +!----------------------------------------------------------------------- +! incomplete Gamma function +!----------------------------------------------------------------------- + IMPLICIT NONE + double precision, intent(in) :: A + DOUBLE PRECISION, INTENT(IN) :: X +! LOCAL VARIABLE + DOUBLE PRECISION :: XAM, GIN, S, R, T0 + INTEGER K + XAM=-X+A*LOG(X) + IF (XAM.GT.700.0.OR.A.GT.170.0) THEN + WRITE(*,*)'IGAMMA: a and/or x too large, X = ', X + WRITE(*,*) 'A = ', A + STOP + + ENDIF + + IF (X.EQ.0.0) THEN + IGAMMA=GAMMA(A) + + ELSE IF (X.LE.1.0+A) THEN + S=1.0/A + R=S + DO K=1,60 + R=R*X/(A+K) + S=S+R + IF (ABS(R/S).LT.1.0e-15) EXIT + END DO + GIN=EXP(XAM)*S + IGAMMA=GAMMA(A)-GIN + ELSE IF (X.GT.1.0+A) THEN + T0=0.0 + DO K=60,1,-1 + T0=(K-A)/(1.0+K/(X+T0)) + end do + + IGAMMA=EXP(XAM)/(X+T0) + + ENDIF + + end function igamma + + end module SS_GridCompMod + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SS_SingleInstance_ --- Runs single instance of method +! +! !INTERFACE: +! + subroutine SS_SingleInstance_ ( Method_, instance, & + gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + Use SS_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! Input "function pointer" +! ----------------------- + interface + subroutine Method_ (gc, w, imp, exp, ymd, hms, dt, rcode ) + Use SS_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + type(SS_GridComp1), intent(inout) :: gc + type(Chem_Bundle), intent(in) :: w + type(ESMF_State), intent(inout) :: imp + type(ESMF_State), intent(inout) :: exp + integer, intent(in) :: ymd, hms + real, intent(in) :: dt + integer, intent(out) :: rcode + end subroutine Method_ + end interface + + integer, intent(in) :: instance ! instance number + + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(SS_GridComp1), INTENT(INOUT) :: gcSS ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the SS Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: n, n_SS, i_SS, j_SS + integer :: status + character(len=255), allocatable :: qname(:) + character(len=ESMF_MAXSTR) :: Iam + integer, parameter :: n_bins = 5 + + Iam = 'SS_SingleInstance_' + +! Save overall SS indices +! ----------------------- + n_SS = w_c%reg%n_SS + i_SS = w_c%reg%i_SS + j_SS = w_c%reg%j_SS + +! Save the name of the variables in this instance +! ----------------------------------------------- + allocate(qname(n_bins), __STAT__) + + do n = 1, n_bins + qname(n) = trim(w_c%reg%vname(i_SS + n_bins*(instance - 1) + n - 1)) + end do + +! Customize indices for this particular instance +! ---------------------------------------------- + w_c%reg%n_SS = n_bins + w_c%reg%i_SS = i_SS + n_bins*(instance - 1) + w_c%reg%j_SS = i_SS + n_bins*(instance - 1) + (n_bins - 1) + + do n = 1, n_bins + w_c%reg%vname(i_SS + n_bins*(instance - 1) + n - 1) = w_c%reg%vname(i_SS + n - 1) + end do + +! Execute the instance method +! --------------------------- + call Method_ ( gcSS, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! Restore the overall SS indices +! ------------------------------ + do n = 1, n_bins + w_c%reg%vname(i_SS + n_bins*(instance - 1) + n - 1) = qname(n) + end do + + w_c%reg%n_SS = n_SS + w_c%reg%i_SS = i_SS + w_c%reg%j_SS = j_SS + + deallocate(qname, __STAT__) + + end subroutine SS_SingleInstance_ + +!----------------------------------------------------------------------- + diff --git a/ESMF/GOCART_GridComp/SS_GridComp/SS_Registry.rc b/ESMF/GOCART_GridComp/SS_GridComp/SS_Registry.rc new file mode 100644 index 00000000..7f246e4f --- /dev/null +++ b/ESMF/GOCART_GridComp/SS_GridComp/SS_Registry.rc @@ -0,0 +1,69 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: SS + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl| Sub | Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + SSMASS | kg kg-1 | xyz | C | | | | | Sea Salt Mass Mixing Ratio __ENSEMBLE__ + SSMASS25 | kg kg-1 | xyz | C | | | | | Sea Salt Mass Mixing Ratio - PM 2.5 __ENSEMBLE__ + SSCONC | kg m-3 | xyz | C | | | | | Sea Salt Mass Concentration __ENSEMBLE__ + SSEXTCOEF| m-1 | xyz | C | | | | | Sea Salt Extinction Coefficient [550 nm] __ENSEMBLE__ + SSSCACOEF| m-1 | xyz | C | | | | | Sea Salt Scattering Coefficient [550 nm] __ENSEMBLE__ +# .........|............|.....|...|....|...|...|.....|.................................. + SSEM001 | kg m-2 s-1 | xy | | | | | | Sea Salt Emission Bin 001 __ENSEMBLE__ + SSEM002 | kg m-2 s-1 | xy | | | | | | Sea Salt Emission Bin 002 __ENSEMBLE__ + SSEM003 | kg m-2 s-1 | xy | | | | | | Sea Salt Emission Bin 003 __ENSEMBLE__ + SSEM004 | kg m-2 s-1 | xy | | | | | | Sea Salt Emission Bin 004 __ENSEMBLE__ + SSEM005 | kg m-2 s-1 | xy | | | | | | Sea Salt Emission Bin 005 __ENSEMBLE__ + SSSD001 | kg m-2 s-1 | xy | | | | | | Sea Salt Sedimentation Bin 001 __ENSEMBLE__ + SSSD002 | kg m-2 s-1 | xy | | | | | | Sea Salt Sedimentation Bin 002 __ENSEMBLE__ + SSSD003 | kg m-2 s-1 | xy | | | | | | Sea Salt Sedimentation Bin 003 __ENSEMBLE__ + SSSD004 | kg m-2 s-1 | xy | | | | | | Sea Salt Sedimentation Bin 004 __ENSEMBLE__ + SSSD005 | kg m-2 s-1 | xy | | | | | | Sea Salt Sedimentation Bin 005 __ENSEMBLE__ + SSDP001 | kg m-2 s-1 | xy | | | | | | Sea Salt Dry Deposition Bin 001 __ENSEMBLE__ + SSDP002 | kg m-2 s-1 | xy | | | | | | Sea Salt Dry Deposition Bin 002 __ENSEMBLE__ + SSDP003 | kg m-2 s-1 | xy | | | | | | Sea Salt Dry Deposition Bin 003 __ENSEMBLE__ + SSDP004 | kg m-2 s-1 | xy | | | | | | Sea Salt Dry Deposition Bin 004 __ENSEMBLE__ + SSDP005 | kg m-2 s-1 | xy | | | | | | Sea Salt Dry Deposition Bin 005 __ENSEMBLE__ + SSWT001 | kg m-2 s-1 | xy | | | | | | Sea Salt Wet Deposition Bin 001 __ENSEMBLE__ + SSWT002 | kg m-2 s-1 | xy | | | | | | Sea Salt Wet Deposition Bin 002 __ENSEMBLE__ + SSWT003 | kg m-2 s-1 | xy | | | | | | Sea Salt Wet Deposition Bin 003 __ENSEMBLE__ + SSWT004 | kg m-2 s-1 | xy | | | | | | Sea Salt Wet Deposition Bin 004 __ENSEMBLE__ + SSWT005 | kg m-2 s-1 | xy | | | | | | Sea Salt Wet Deposition Bin 005 __ENSEMBLE__ + SSSV001 | kg m-2 s-1 | xy | | | | | | Sea Salt Convective Scavenging Bin 001 __ENSEMBLE__ + SSSV002 | kg m-2 s-1 | xy | | | | | | Sea Salt Convective Scavenging Bin 002 __ENSEMBLE__ + SSSV003 | kg m-2 s-1 | xy | | | | | | Sea Salt Convective Scavenging Bin 003 __ENSEMBLE__ + SSSV004 | kg m-2 s-1 | xy | | | | | | Sea Salt Convective Scavenging Bin 004 __ENSEMBLE__ + SSSV005 | kg m-2 s-1 | xy | | | | | | Sea Salt Convective Scavenging Bin 005 __ENSEMBLE__ + SSSMASS | kg m-3 | xy | | | | | | Sea Salt Surface Mass Concentration __ENSEMBLE__ + SSCMASS | kg m-2 | xy | | | | | | Sea Salt Column Mass Density __ENSEMBLE__ + SSEXTTAU | 1 | xy | | | | | | Sea Salt Extinction AOT [550 nm] __ENSEMBLE__ + SSSCATAU | 1 | xy | | | | | | Sea Salt Scattering AOT [550 nm] __ENSEMBLE__ + SSSMASS25| kg m-3 | xy | | | | | | Sea Salt Surface Mass Concentration - PM 2.5 __ENSEMBLE__ + SSCMASS25| kg m-2 | xy | | | | | | Sea Salt Column Mass Density - PM 2.5 __ENSEMBLE__ + SSEXTT25 | 1 | xy | | | | | | Sea Salt Extinction AOT [550 nm] - PM 2.5 __ENSEMBLE__ + SSSCAT25 | 1 | xy | | | | | | Sea Salt Scattering AOT [550 nm] - PM 2.5 __ENSEMBLE__ + SSAERIDX | 1 | xy | | | | | | Sea Salt TOMS UV Aerosol Index __ENSEMBLE__ + SSEXTTFM | 1 | xy | | | | | | Sea Salt Extinction AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + SSSCATFM | 1 | xy | | | | | | Sea Salt Scattering AOT [550 nm] - PM 1.0 um __ENSEMBLE__ + SSANGSTR | 1 | xy | | | | | | Sea Salt Angstrom parameter [470-870 nm] __ENSEMBLE__ + SSFLUXU | kg m-1 s-1 | xy | | | | | | Sea Salt column u-wind mass flux __ENSEMBLE__ + SSFLUXV | kg m-1 s-1 | xy | | | | | | Sea Salt column v-wind mass flux __ENSEMBLE__ +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp---full.rc new file mode 100755 index 00000000..9fdc5b1f --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp---full.rc @@ -0,0 +1,71 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Volcanic sources +volcano_srcfilen: /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/volcanic/volcanic_continuos.rc +# volcano_srcfilen: ExtData/AeroCom/sfc/volcanic_v4/Aerocom.so2_volcanic.%y4%m2%d2.rc + + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: yes +using_GMI_NO3: yes +using_GMI_H2O2: yes +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp---volc.rc new file mode 100755 index 00000000..f39e3b43 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp---volc.rc @@ -0,0 +1,69 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Volcanic pointwise sources +volcano_srcfilen: /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/volcanic/volcanic_v10_1958-2015_explosive/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: yes +using_GMI_NO3: yes +using_GMI_H2O2: yes +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp.rc new file mode 100755 index 00000000..eb7e4a27 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N] +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..cfd203a4 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C1/SU_GridComp_ExtData.rc @@ -0,0 +1,55 @@ +PrimaryExports%% +# -------------|----------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|----------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning +SU_BIOMASS kgSO2/m2/s N Y %y4-%m2-%d2t12:00:00 none none biomass /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/CCMI/CCMI_REF-C1.bioburn_SO2.x720_y361_t12.%y4.nc + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 kgSO2/m2/s N Y %y4-%m2-%d2t12:00:00 none none sanl1 /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/CCMI/CCMI_REF-C1.nonenergy_anth_SO2.x720_y361_t12.%y4.nc +SU_ANTHROL2 kgSO2/m2/s N Y %y4-%m2-%d2t12:00:00 none none sanl2 /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/CCMI/CCMI_REF-C1.energy_SO2.x720_y361_t12.%y4.nc + +# Ship emissions +SU_SHIPSO2 NA N N %y4-%m2-%d2t12:00:00 none none so2_ship /dev/null +SU_SHIPSO4 NA N N %y4-%m2-%d2t12:00:00 none none so4_ship /dev/null + +# Aircraft fuel consumption +SU_AIRCRAFT kgFUEL/m2/s N Y %y4-%m2-%d2t12:00:00 none none fuel /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/AeroCom/AeroCom.aircraft_fuel.eta.x288_y181_z72_t12.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/AeroCom/sfc/DMSclim_sfcconcentration.x360_y181_t12.2000.nc + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N N %y4-%m2-%d2t12:00:00 none none h2o2 NOT_USING +SU_OH NA N N %y4-%m2-%d2t12:00:00 none none oh NOT_USING +SU_NO3 NA N N %y4-%m2-%d2t12:00:00 none none no3 NOT_USING + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +#### Volcanic: + +SU_BIOMASSvolc kgSO2/m2/s Y Y %y4-%m2-%d2t12:00:00 none none biomass /dev/null +SU_ANTHROL1volc kgSO2/m2/s Y Y %y4-%m2-%d2t12:00:00 none none sanl1 /dev/null +SU_ANTHROL2volc kgSO2/m2/s Y Y %y4-%m2-%d2t12:00:00 none none sanl2 /dev/null +SU_SHIPSO2volc NA N N %y4-%m2-%d2t12:00:00 none none so2_ship /dev/null +SU_SHIPSO4volc NA N N %y4-%m2-%d2t12:00:00 none none so4_ship /dev/null +SU_AIRCRAFTvolc kgFUEL/m2/s Y Y %y4-%m2-%d2t12:00:00 none none fuel /dev/null +SU_DMSOvolc NA Y Y %y4-%m2-%d2t12:00:00 none none conc /dev/null +SU_H2O2volc NA N N %y4-%m2-%d2t12:00:00 none none h2o2 NOT_USING +SU_OHvolc NA N N %y4-%m2-%d2t12:00:00 none none oh NOT_USING +SU_NO3volc NA N N %y4-%m2-%d2t12:00:00 none none no3 NOT_USING +SU_AVIATION_LTOvolc NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDSvolc NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRSvolc NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +#### Masks: + +SU_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp---full.rc new file mode 100755 index 00000000..9fdc5b1f --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp---full.rc @@ -0,0 +1,71 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Volcanic sources +volcano_srcfilen: /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/volcanic/volcanic_continuos.rc +# volcano_srcfilen: ExtData/AeroCom/sfc/volcanic_v4/Aerocom.so2_volcanic.%y4%m2%d2.rc + + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: yes +using_GMI_NO3: yes +using_GMI_H2O2: yes +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp---volc.rc new file mode 100755 index 00000000..f39e3b43 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp---volc.rc @@ -0,0 +1,69 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + +# For all land boxes in a latitude range, set doZoneMasking to +# 1 then specify BOTH the south and north limits in degrees. +# WARNING: When set, zone masking OVERRIDES regions setting above! +# ---------------------------------------------------------------- +doZoneMasking: 0 +LatitudeSouth: 45.0 +LatitudeNorth: 90.0 + +# Volcanic pointwise sources +volcano_srcfilen: /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/volcanic/volcanic_v10_1958-2015_explosive/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: yes +using_GMI_NO3: yes +using_GMI_H2O2: yes +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp.rc new file mode 100755 index 00000000..eb7e4a27 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N] +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..7cd85dfa --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CCMI_REF-C2/SU_GridComp_ExtData.rc @@ -0,0 +1,55 @@ +PrimaryExports%% +# -------------|----------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|----------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning +SU_BIOMASS kgSO2/m2/s N Y %y4-%m2-%d2t12:00:00 none none biomass /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/CCMI/CCMI_REF-C2.bioburn_SO2.x720_y361_t12.%y4.nc + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 kgSO2/m2/s N Y %y4-%m2-%d2t12:00:00 none none sanl1 /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/CCMI/CCMI_REF-C2.nonenergy_anth_SO2.x720_y361_t12.%y4.nc +SU_ANTHROL2 kgSO2/m2/s N Y %y4-%m2-%d2t12:00:00 none none sanl2 /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/CCMI/CCMI_REF-C2.energy_SO2.x720_y361_t12.%y4.nc + +# Ship emissions +SU_SHIPSO2 NA N N %y4-%m2-%d2t12:00:00 none none so2_ship /dev/null +SU_SHIPSO4 NA N N %y4-%m2-%d2t12:00:00 none none so4_ship /dev/null + +# Aircraft fuel consumption +SU_AIRCRAFT kgFUEL/m2/s N Y %y4-%m2-%d2t12:00:00 none none fuel /discover/nobackup/mmanyin/CCM/EXT_DATA/SU/AeroCom/AeroCom.aircraft_fuel.eta.x288_y181_z72_t12.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/AeroCom/sfc/DMSclim_sfcconcentration.x360_y181_t12.2000.nc + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N N %y4-%m2-%d2t12:00:00 none none h2o2 NOT_USING +SU_OH NA N N %y4-%m2-%d2t12:00:00 none none oh NOT_USING +SU_NO3 NA N N %y4-%m2-%d2t12:00:00 none none no3 NOT_USING + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +#### Volcanic: + +SU_BIOMASSvolc kgSO2/m2/s Y Y %y4-%m2-%d2t12:00:00 none none biomass /dev/null +SU_ANTHROL1volc kgSO2/m2/s Y Y %y4-%m2-%d2t12:00:00 none none sanl1 /dev/null +SU_ANTHROL2volc kgSO2/m2/s Y Y %y4-%m2-%d2t12:00:00 none none sanl2 /dev/null +SU_SHIPSO2volc NA N N %y4-%m2-%d2t12:00:00 none none so2_ship /dev/null +SU_SHIPSO4volc NA N N %y4-%m2-%d2t12:00:00 none none so4_ship /dev/null +SU_AIRCRAFTvolc kgFUEL/m2/s Y Y %y4-%m2-%d2t12:00:00 none none fuel /dev/null +SU_DMSOvolc NA Y Y %y4-%m2-%d2t12:00:00 none none conc /dev/null +SU_H2O2volc NA N N %y4-%m2-%d2t12:00:00 none none h2o2 NOT_USING +SU_OHvolc NA N N %y4-%m2-%d2t12:00:00 none none oh NOT_USING +SU_NO3volc NA N N %y4-%m2-%d2t12:00:00 none none no3 NOT_USING +SU_AVIATION_LTOvolc NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDSvolc NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRSvolc NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +#### Masks: + +SU_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp---full.rc new file mode 100755 index 00000000..6916e28f --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp---full.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic sources +volcano_srcfilen: ExtData/g5chem/sfc/gocart_tldiehl.so2_continuous_volcanic.x540_y361.2000.nc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp---volc.rc new file mode 100755 index 00000000..0ed37e7e --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp---volc.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/g5chem/sfc/gocart_tldiehl.so2_continuous_volcanic.x540_y361.2000.nc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp.rc new file mode 100755 index 00000000..eb0a9b90 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..be11cdf1 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CMIP/SU_GridComp_ExtData.rc @@ -0,0 +1,37 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/CMIP/sfc/SU/cmip5.SO2_bioburn.x720_y361_t14.%y4.nc + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA N Y - none none sanl1 ExtData/CMIP/sfc/SU/cmip5.noship_SO2_src.sfc.x720_y361_t14.%y4.nc +SU_ANTHROL2 NA N Y - none none sanl2 /dev/null + +# Ship emissions +SU_SHIPSO2 NA N Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/CMIP/sfc/SU/cmip5.ship_SO2_src.sfc.x720_y361_t14.%y4.nc +SU_SHIPSO4 NA N Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/CMIP/sfc/SU/cmip5.ship_SO4_src.sfc.x720_y361_t14.%y4.nc + +# Aircraft fuel consumption +SU_AIRCRAFT NA N Y %y4-%m2-%d2t12:00:00 none none fuel ExtData/CMIP/L72/cmip5.aircraft_fuel.eta.x288_y181_t14.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/AeroCom/sfc/DMSclim_sfcconcentration.x360_y181_t12.2000.nc + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none h2o2 ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none oh ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none no3 ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N V - none none REGION_MASK ExtData/CMIP/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% diff --git a/ESMF/GOCART_GridComp/SU_GridComp/CMakeLists.txt b/ESMF/GOCART_GridComp/SU_GridComp/CMakeLists.txt new file mode 100644 index 00000000..77dee41e --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/CMakeLists.txt @@ -0,0 +1,14 @@ +esma_set_this () + +esma_add_library (${this} + SRCS ${this}Mod.F90 + DEPENDENCIES Chem_Shared Chem_Base GMAO_mpeu MAPL_cfio_r4 MAPL) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +esma_generate_gocart_code (${this} "-B\;-E\;-C\;-N\;GOCART") + +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp---full.rc new file mode 100644 index 00000000..3388c9d0 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp---full.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp---volc.rc new file mode 100644 index 00000000..b20c4698 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp---volc.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp.rc new file mode 100644 index 00000000..eb0a9b90 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..1fe1b18d --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/19600101-20000331/SU_GridComp_ExtData.rc @@ -0,0 +1,38 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_so2.x576_y361_t14.%y4.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA N Y %y4-%m2-%d2t12:00:00 none none sanl1 ExtData/MERRA2/sfc/edgar-v42.emis_so2.non_energy.x3600_y1800.19700703T12z_20200703T00z.nc4 +SU_ANTHROL2 NA N Y %y4-%m2-%d2t12:00:00 none none sanl2 ExtData/MERRA2/sfc/edgar-v42.emis_so2.energy.x3600_y1800.19700703T12z_20200703T00z.nc4 + +# Ship emissions +SU_SHIPSO2 NA N Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/MERRA2/sfc/edgar-v41.emis_so2.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 +SU_SHIPSO4 NA N Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/MERRA2/sfc/edgar-v41.emis_so4.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aircraft fuel consumption +SU_AIRCRAFT NA N Y %y4-%m2-%d2t12:00:00 none none fuel ExtData/AeroCom/L72/AeroCom.aircraft_fuel.eta.x288_y181_z72_t14.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/MERRA2/sfc/DMSclim_sfcconcentration.x360_y181_t12.Lana2011.nc4 + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none H2O2 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none NO3 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +# +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp---full.rc new file mode 100644 index 00000000..3388c9d0 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp---full.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp---volc.rc new file mode 100644 index 00000000..b20c4698 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp---volc.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp.rc new file mode 100644 index 00000000..eb0a9b90 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..c7d26152 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/20000401-present/SU_GridComp_ExtData.rc @@ -0,0 +1,37 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_so2.005.%y4%m2%d2.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA N Y %y4-%m2-%d2t12:00:00 none none sanl1 ExtData/MERRA2/sfc/edgar-v42.emis_so2.non_energy.x3600_y1800.19700703T12z_20200703T00z.nc4 +SU_ANTHROL2 NA N Y %y4-%m2-%d2t12:00:00 none none sanl2 ExtData/MERRA2/sfc/edgar-v42.emis_so2.energy.x3600_y1800.19700703T12z_20200703T00z.nc4 + +# Ship emissions +SU_SHIPSO2 NA N Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/MERRA2/sfc/edgar-v41.emis_so2.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 +SU_SHIPSO4 NA N Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/MERRA2/sfc/edgar-v41.emis_so4.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aircraft fuel consumption +SU_AIRCRAFT NA N Y %y4-%m2-%d2t12:00:00 none none fuel ExtData/AeroCom/L72/AeroCom.aircraft_fuel.eta.x288_y181_z72_t14.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/MERRA2/sfc/DMSclim_sfcconcentration.x360_y181_t12.Lana2011.nc4 + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none H2O2 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none NO3 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +# +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp---full.rc new file mode 100644 index 00000000..3388c9d0 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp---full.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp---volc.rc new file mode 100644 index 00000000..b20c4698 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp---volc.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp.rc new file mode 100644 index 00000000..eb0a9b90 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..a8d9da54 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2-DD/SU_GridComp_ExtData.rc @@ -0,0 +1,38 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_so2.005.%y4%m2%d2.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA N Y %y4-%m2-%d2t12:00:00 none none sanl1 ExtData/MERRA2/sfc/edgar-v42.emis_so2.non_energy.x3600_y1800.19700703T12z_20200703T00z.nc4 +SU_ANTHROL2 NA N Y %y4-%m2-%d2t12:00:00 none none sanl2 ExtData/MERRA2/sfc/edgar-v42.emis_so2.energy.x3600_y1800.19700703T12z_20200703T00z.nc4 + +# Ship emissions +SU_SHIPSO2 NA N Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/MERRA2/sfc/edgar-v41.emis_so2.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 +SU_SHIPSO4 NA N Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/MERRA2/sfc/edgar-v41.emis_so4.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aircraft fuel consumption +SU_AIRCRAFT NA N Y %y4-%m2-%d2t12:00:00 none none fuel ExtData/AeroCom/L72/AeroCom.aircraft_fuel.eta.x288_y181_z72_t14.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/MERRA2/sfc/DMSclim_sfcconcentration.x360_y181_t12.Lana2011.nc4 + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none H2O2 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none NO3 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +# +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp---full.rc new file mode 100644 index 00000000..3388c9d0 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp---full.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp---volc.rc new file mode 100644 index 00000000..b20c4698 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp---volc.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp.rc new file mode 100644 index 00000000..eb0a9b90 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..93326069 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/19600101-20000331/SU_GridComp_ExtData.rc @@ -0,0 +1,38 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/MERRA2/sfc/HFED/v1.0/Y%y4/hfed.emis_so2.x576_y361_t14.%y4.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA N Y %y4-%m2-%d2t12:00:00 none none sanl1 ExtData/MERRA2/sfc/edgar-v42.emis_so2.non_energy.x1152_y721.19700703T12z_20200703T00z.nc4 +SU_ANTHROL2 NA N Y %y4-%m2-%d2t12:00:00 none none sanl2 ExtData/MERRA2/sfc/edgar-v42.emis_so2.energy.x1152_y721.19700703T12z_20200703T00z.nc4 + +# Ship emissions +SU_SHIPSO2 NA N Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/MERRA2/sfc/edgar-v41.emis_so2.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 +SU_SHIPSO4 NA N Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/MERRA2/sfc/edgar-v41.emis_so4.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aircraft fuel consumption +SU_AIRCRAFT NA N Y %y4-%m2-%d2t12:00:00 none none fuel ExtData/AeroCom/L72/AeroCom.aircraft_fuel.eta.x288_y181_z72_t14.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/MERRA2/sfc/DMSclim_sfcconcentration.x360_y181_t12.Lana2011.nc4 + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none H2O2 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none NO3 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +# +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp---full.rc new file mode 100644 index 00000000..3388c9d0 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp---full.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp---volc.rc new file mode 100644 index 00000000..b20c4698 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp---volc.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp.rc new file mode 100644 index 00000000..eb0a9b90 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..a6020b48 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/20000401-present/SU_GridComp_ExtData.rc @@ -0,0 +1,37 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_so2.005.%y4%m2%d2.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA N Y %y4-%m2-%d2t12:00:00 none none sanl1 ExtData/MERRA2/sfc/edgar-v42.emis_so2.non_energy.x1152_y721.19700703T12z_20200703T00z.nc4 +SU_ANTHROL2 NA N Y %y4-%m2-%d2t12:00:00 none none sanl2 ExtData/MERRA2/sfc/edgar-v42.emis_so2.energy.x1152_y721.19700703T12z_20200703T00z.nc4 + +# Ship emissions +SU_SHIPSO2 NA N Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/MERRA2/sfc/edgar-v41.emis_so2.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 +SU_SHIPSO4 NA N Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/MERRA2/sfc/edgar-v41.emis_so4.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aircraft fuel consumption +SU_AIRCRAFT NA N Y %y4-%m2-%d2t12:00:00 none none fuel ExtData/AeroCom/L72/AeroCom.aircraft_fuel.eta.x288_y181_z72_t14.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/MERRA2/sfc/DMSclim_sfcconcentration.x360_y181_t12.Lana2011.nc4 + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none H2O2 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none NO3 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +# +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp---full.rc new file mode 100644 index 00000000..3388c9d0 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp---full.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp---volc.rc new file mode 100644 index 00000000..b20c4698 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp---volc.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp.rc new file mode 100644 index 00000000..eb0a9b90 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..b16c2107 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/MERRA2/SU_GridComp_ExtData.rc @@ -0,0 +1,38 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_so2.005.%y4%m2%d2.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA N Y %y4-%m2-%d2t12:00:00 none none sanl1 ExtData/MERRA2/sfc/edgar-v42.emis_so2.non_energy.x1152_y721.19700703T12z_20200703T00z.nc4 +SU_ANTHROL2 NA N Y %y4-%m2-%d2t12:00:00 none none sanl2 ExtData/MERRA2/sfc/edgar-v42.emis_so2.energy.x1152_y721.19700703T12z_20200703T00z.nc4 + +# Ship emissions +SU_SHIPSO2 NA N Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/MERRA2/sfc/edgar-v41.emis_so2.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 +SU_SHIPSO4 NA N Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/MERRA2/sfc/edgar-v41.emis_so4.navigation.x360_y181_t47.19750703T12z_20210703T00z.nc4 + +# Aircraft fuel consumption +SU_AIRCRAFT NA N Y %y4-%m2-%d2t12:00:00 none none fuel ExtData/AeroCom/L72/AeroCom.aircraft_fuel.eta.x288_y181_z72_t14.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/MERRA2/sfc/DMSclim_sfcconcentration.x360_y181_t12.Lana2011.nc4 + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none H2O2 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none OH ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none NO3 ExtData/MERRA2/L72/gmi_ctm_hindcast.oxidants.x144_y91_z72_t14.%y4.nc4 + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +# +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp---full.rc new file mode 100755 index 00000000..3388c9d0 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp---full.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp---volc.rc new file mode 100755 index 00000000..b20c4698 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp---volc.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp.rc new file mode 100644 index 00000000..eb0a9b90 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..d4f86263 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/NR/SU_GridComp_ExtData.rc @@ -0,0 +1,38 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/NR/Y%y4/M%m2/qfed2.emis_so2.005.%y4%m2%d2.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA N Y - none none sanl1 ExtData/NR/sfc/EDGAR_v41.emis_nonenergy_SO2.x3600_y1800.t1.20050703.nc4 +SU_ANTHROL2 NA N Y - none none sanl2 ExtData/NR/sfc/EDGAR_v41.emis_energy_SO2.x3600_y1800.t1.20050703.nc4 + +# Ship emissions +SU_SHIPSO2 NA N Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/NR/sfc/AeroCom_EDGAR.emis_SO2.ship.x3600_y1800.t5.20040703_20080703_12z.nc4 +SU_SHIPSO4 NA N Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/NR/sfc/AeroCom_EDGAR.emis_SO4.ship.x3600_y1800.t5.20040703_20080703_12z.nc4 + +# Aircraft fuel consumption +SU_AIRCRAFT NA N Y %y4-%m2-%d2t12:00:00 none none fuel ExtData/PIESA/L72/AeroCom.aircraft_fuel.eta.x288_y181_z72_t14.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/AeroCom/sfc/DMSclim_sfcconcentration.x360_y181_t12.2000.nc + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none h2o2 ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none oh ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none no3 ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N V - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---anth.rc b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---anth.rc new file mode 100755 index 00000000..44f99407 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---anth.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: /dev/null + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.0 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---full.rc new file mode 100755 index 00000000..9ec11cbb --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---full.rc @@ -0,0 +1,66 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Hourly NEI08 Emissions: superseeds eocant1/2 over North America only +# -------------------------------------------------------------------- +#nei_boundingbox: -130 -60 23.75 56.5 # bounding box for cropping NEI08 emissions + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---strat.rc b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---strat.rc new file mode 100755 index 00000000..cb75f21b --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---strat.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: /dev/null + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: yes + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---volc.rc new file mode 100755 index 00000000..b20c4698 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp---volc.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp.rc new file mode 100644 index 00000000..1acaf89e --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full anth volc strat diff --git a/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..6c1242d9 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/PIESA/SU_GridComp_ExtData.rc @@ -0,0 +1,38 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/v2.4r6/Y%y4/M%m2/qfed2.emis_so2.005.%y4%m2%d2.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA N Y - none none sanl1 ExtData/AeroCom/sfc/EDGAR_v41.nonenergy_SO2_src.sfc.x1152_y721.20050703_12z.nc4 +SU_ANTHROL2 NA N Y - none none sanl2 ExtData/AeroCom/sfc/EDGAR_v41.energy_SO2_src.sfc.x1152_y721.20050703_12z.nc4 + +# Ship emissions +SU_SHIPSO2 NA N Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/AeroCom/sfc/AeroCom.ship_SO2_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc +SU_SHIPSO4 NA N Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/AeroCom/sfc/AeroCom.ship_SO4_src.sfc.x360_y181_t44.19780703_12z_20210703_12z.nc + +# Aircraft fuel consumption +SU_AIRCRAFT NA N Y %y4-%m2-%d2t12:00:00 none none fuel ExtData/AeroCom/L72/AeroCom.aircraft_fuel.eta.x288_y181_z72_t14.%y4.nc + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/PIESA/sfc/DMSclim_sfcconcentration.x360_y181_t12.2000.nc + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none h2o2 ExtData/AeroCom/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none oh ExtData/AeroCom/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none no3 ExtData/AeroCom/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CDS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null +SU_AVIATION_CRS NA N Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N V - none none REGION_MASK ExtData/AeroCom/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp---full.rc b/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp---full.rc new file mode 100755 index 00000000..d1b60126 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp---full.rc @@ -0,0 +1,66 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.35 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 9.01e16 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.0695 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 2.03 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Hourly NEI08 Emissions: superseeds eocant1/2 over North America only +# -------------------------------------------------------------------- +#nei_boundingbox: -130 -60 23.75 56.5 # bounding box for cropping NEI08 emissions + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp---volc.rc b/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp---volc.rc new file mode 100755 index 00000000..b20c4698 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp---volc.rc @@ -0,0 +1,62 @@ +# +# Resource file for SU parameters. +# + +number_su_classes: 4 + + +# Indicate regions using a comma-delimited list of integers. +# To activate all land boxes, use -1, or all or global (not case sensitive) +SU_regions_indices: global + + +# Volcanic pointwise sources +volcano_srcfilen: ExtData/PIESA/sfc/volcanic_v7/so2_volcanic_emissions_Carns.%y4%m2%d2.rc + +# Heights [m] of LTO, CDS and CRS aviation emissions layers +aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 + +# Fraction of anthropogenic emissions that are SO4 +so4_anthropogenic_fraction: 0.03 + +# Aircraft emission factor: go from kg fuel to kg SO2 +aircraft_fuel_emission_factor: 0.0008 + +# Scavenging efficiency per bin [km-1] (NOT USED UNLESS RAS IS CALLED) +fscav: 0.0 0.0 0.4 0.4 + +# Dry particle radius [um], used for settling +particle_radius: 0.0 0.0 0.60 0.0 + +# Type of settling to use (see Chem_SettlingMod) +rhFlag: 4 + +# Dry particle density [kg m-3] +particle_density: -1 -1 1700 -1 + +# Molecular weight of species [kg mole-1] +molecular_weight: -1 -1 0.132 -1 + +# Number of particles per kg mass +fnum: -1 -1 1.24e15 -1 + +# Number median radius [um] +particle_radius_number: -1 -1 0.35 -1 + +# Sigma of lognormal number distribution +sigma: -1 -1 1.59 -1 + +# OH H2O2 NO3 from GMI Combined Stratosphere Troposphere (Lower case yes to enable) +# ------------------------------------------------------------------------------------- +using_GMI_OH: no +using_GMI_NO3: no +using_GMI_H2O2: no +export_H2O2: no + +# production of SO2 by OCS from ACHEM +# ----------------------------------- +using_ACHEM_pSO2_OCS: no + +# Day of the week to reset tracer to zero; -1 means never reset to zero +my_day_of_the_week: -1 # Sun=1, Mon=2, ..., Sat=7 + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp.rc b/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp.rc new file mode 100755 index 00000000..eb0a9b90 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp.rc @@ -0,0 +1,19 @@ +# +# SU main resource file defining the particular instances. +# +# For detailed description of the GloPac tags consult: +# +# http://www.geos5.org/wiki/index.php?title=GEOS-5_Configuration_for_GloPac +# +# ------------------|-------|------------ +# Region | Tag | Masking +# ------------------|-------|------------ +# Boreal | bbbo | [45N, 90N] +# Non-Boreal | bbnb | [90S, 45N) +# Northern Asia | ffru | 9, 10 +# Southern Asian | ffas | 4 +# Europe | ffeu | 3 +# North America | ffna | 1 +# ------------------|-------|------------ + +SU_instances: full volc diff --git a/ESMF/GOCART_GridComp/SU_GridComp/SU_GridCompMod.F90 b/ESMF/GOCART_GridComp/SU_GridComp/SU_GridCompMod.F90 new file mode 100644 index 00000000..43b38c22 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/SU_GridCompMod.F90 @@ -0,0 +1,3274 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: SU_GridCompMod --- SU Grid Component Class +! +! !INTERFACE: +! + + module SU_GridCompMod + +! !USES: + + use ESMF + use MAPL + + use Chem_Mod ! Chemistry Base Class + use Chem_StateMod ! Chemistry State + use Chem_ConstMod, only: grav, von_karman, cpd, & ! Constants ! + undefval => undef, airMolWght => airmw + use Chem_UtilMod ! I/O + use Chem_MieMod ! Aerosol LU Tables, calculator + use m_inpak90 ! Resource file management + use m_die, only: die + USE Henrys_law_ConstantsMod, ONLY: get_HenrysLawCts + + use m_StrTemplate + use SulfateChemDriverMod + use ConvectionMod ! Offline convective mixing/scavenging + use Chem_SettlingMod ! Gravitiational Settling + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC SU_GridComp ! The SU object + PUBLIC SU_GridComp1 ! Single instance SU object + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC SU_GridCompSetServices + PUBLIC SU_GridCompInitialize + PUBLIC SU_GridCompRun1 + PUBLIC SU_GridCompRun2 + PUBLIC SU_GridCompFinalize + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) SU Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! 18May2006 da Silva Removed ensure postive, now in GOCART_GridComp +! 25Aug2009 Nielsen Connections, usage of GMI Combo OH, H2O2, and NO3 +! +!EOP +!------------------------------------------------------------------------- + +! Note that the dates associated with the input files are a real mess +! Chem_UtilMPread cares about the date! +! Arbitrarily I set so2biomass_src, so2anthro_l1_src, and so2anthro_l2_src to 1971 +! (of course these are not really valid for 1971) +! DMSO is valid 2000 +! OH, NO3, H2O2 files are valid 2001 +! Go figure...this is what happens when I get inputs from other people +! who are not the primary sources (e.g., Mian and Bian instead of +! geoschem...I get what they've got). + + type SU_GridComp1 + character(len=255) :: name + character(len=255) :: iname ! instance name + character(len=255) :: rcfilen ! resource file name + character(len=255) :: maskFileName + character(len=255) :: regionsString ! Comma-delimited string of regions + real, pointer :: regionMask(:,:) ! regional mask + integer :: instance ! instance number + logical :: run_alarm = .false. ! run alarm + + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + real, pointer :: so2biomass_src_(:,:) ! before diurnal + real, pointer :: so2biomass_src(:,:) + real, pointer :: so2anthro_l1_src(:,:) ! level 1 + real, pointer :: so2anthro_l2_src(:,:) ! level 2 + real, pointer :: so2ship_src(:,:) + real, pointer :: so4ship_src(:,:) + real, pointer :: aircraft_fuel_src(:,:,:) + real, pointer :: aviation_lto_src(:,:) ! aviation - landing and takeoff + real, pointer :: aviation_cds_src(:,:) ! aviation - climbing and descent + real, pointer :: aviation_crs_src(:,:) ! aviation - cruise + real :: aviation_layers(4) ! heights of the LTO, CDS and CRS layers + real, pointer :: dmso_conc(:,:) +! Special handling for volcanic emissions + integer :: nvolc = 0 + real, pointer, dimension(:) :: vLat => null(), & + vLon => null(), & + vSO2 => null(), & + vElev => null(), & + vCloud => null() + integer, pointer, dimension(:) :: vStart => null(), & + vEnd => null() +! Note that the OH, NO3, and H2O2 are from a geoschem run +! Ideally would be from a run of the fv chemistry package! + real, pointer :: oh_conc(:,:,:) + real, pointer :: no3_mr(:,:,:) + real, pointer :: h2o2_mr(:,:,:) +! OH and NO3 are scaled every timestep. H2O2 is replaced every +! 3 hours with the monthly value. Hence, we need to save a value +! somewhere! For now we save the instantaneous value here. + real, pointer :: h2o2_int(:,:,:) + real :: fSO4ant ! Fraction of anthropogenic emissions are SO4 + real :: eAircraftFuel ! Emission factor to go from fuel to SO2 + real :: fMassSulfur ! gram molar weight of S + real :: fMassSO2 ! gram molar weight of SO2 + real :: fMassSO4 ! gram molar weight of SO4 + real :: fMassDMS ! gram molar weight of DMS + real :: fMassMSA ! gram molar weight of MSA + integer :: nDMS + integer :: nSO2 + integer :: nSO4 + integer :: nMSA + integer :: nymd ! Update the emissions? + integer :: nymd_oxidants ! Update the oxidant files? + logical :: using_GMI_OH + logical :: using_GMI_NO3 + logical :: using_GMI_H2O2 + logical :: using_ACHEM_pSO2_OCS + logical :: export_H2O2 + logical :: firstRun + logical :: recycle_H2O2 = .false. + character(len=255) :: volcano_srcfilen +! parameters for sulfate gravitational settling + integer :: rhFlag !flag for sulfate growth parameterization + real, pointer :: radius(:) !particle effective radius [um] + real, pointer :: rhop(:) ! SU class density [kg m-3] +! age of tracers + integer :: myDOW = -1 ! my Day of the week: Sun=1, Mon=2,...,Sat=7 + logical :: doing_nei=.FALSE. ! NEI08: National Emission Inventory (US+Canada) + real :: nei_lon(2), nei_lat(2) ! NEI bounding box; superseeds eocant1/2 inside + character(len=255) :: nei_srcfilen(2) ! 1=bottom layer, 2=above bottom layer + integer :: nei_hour = -1 + integer :: nei_year = 2010 ! Hardwire this for now + +! Workspace for any requested point emissions (handled in run) +! ------------------------------------------------------------ + logical :: doing_point_emissions=.FALSE. ! Providing pointwise emissions + character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions + integer :: nPts = -1 + integer, pointer, dimension(:) :: pstart => null(), pend => null() + real, pointer, dimension(:) :: pLat => null(), & + pLon => null(), & + pBase => null(), & + pTop => null(), & + pEmis => null() + end type SU_GridComp1 + + type SU_GridComp + integer :: n = 0 ! number of instances + type(Chem_Mie), pointer :: mie_tables => null() ! aod LUTs + type(SU_GridComp1), pointer :: gcs(:) => null() ! instances + end type SU_GridComp + + character(len=*), parameter :: rc_basename = 'SU_GridComp' + + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + real, parameter :: pi = 3.1415, rearth = 6.37e6 + real, parameter :: radTODeg = 57.2957795 + real, parameter :: rH2O2 = 34./airMolWght + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_GridCompSetServices --- SetServices SU_GridComp +! +! !INTERFACE: +! + + subroutine SU_GridCompSetServices( gc, chemReg, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + integer, intent(OUT ) :: rc + + CHARACTER(LEN=255) :: name + + integer :: status + character(len=ESMF_MAXSTR) :: Iam + + integer :: n, i + + type(ESMF_Config) :: cfg + + Iam = "SU_GridCompSetServices" + +! Load resource file +! ------------------ + cfg = ESMF_ConfigCreate(__RC__) + call ESMF_ConfigLoadFile(cfg, trim(rc_basename)//'.rc', __RC__) + +! Parse resource file +! ------------------- + n = ESMF_ConfigGetLen(cfg, label='SU_instances:', __RC__) + +! We have 4 tracers for each instance of SU +! Chem_Registry provides the number (total) +! of tracers to be run. Therefore n*4 must +! be >= to that number or else we don't have +! enough instances requested. +! -------------------------------------------------------- + if ( n*4 .lt. chemReg%n_SU ) then + rc = 35 + return + end if + n = min(n,chemReg%n_SU/4 ) + + call ESMF_ConfigFindLabel(cfg, 'SU_instances:', __RC__) + + do i = 1, n + ! read the resource file name + call ESMF_ConfigGetAttribute(cfg, name, __RC__) + + if (trim(name) == "full" ) then + name = " " ! blank instance name for full (1) + else + name = trim(name) ! instance name for others + END IF + + call SU_GridCompSetServices1_(gc, chemReg, name, __RC__) + end do + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_regionMask', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'pSO2_OCS', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + RETURN_(ESMF_SUCCESS) + end subroutine SU_GridCompSetServices + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_GridCompInitialize --- Initialize SU_GridComp +! +! !INTERFACE: +! + + subroutine SU_GridCompInitialize ( gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(SU_GridComp), intent(inout) :: gcSU ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the SU Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'SU_GridCompInitialize' + CHARACTER(LEN=255) :: name + + integer :: i, ier, n, i_ + +! Load resource file +! ------------------ + call i90_loadf ( trim(rc_basename)//'.rc', ier ) + if ( ier .NE. 0 ) then + rc = 10 + return + end if + +! Parse resource file +! ------------------- + CALL I90_label ( 'SU_instances:', ier ) + if ( ier .NE. 0 ) then + rc = 20 + return + end if + +! First determine how many instances we have +! ------------------------------------------ + n = 0 + do while ( ier .EQ. 0 ) + CALL I90_gtoken( name, ier ) + if(ier .eq. 0) n = n + 1 + end do + if ( n .EQ. 0 ) then + rc = 30 + return + end if + +! We have 4 tracers for each instance of SU +! Chem_Registry provides the number (total) +! of tracers to be run. Therefore n*4 must +! be >= to that number or else we don't have +! enough instances requested. +! -------------------------------------------------------- + if ( n*4 .lt. w_c%reg%n_SU ) then + rc = 35 + return + end if + n = min(n,w_c%reg%n_SU/4 ) + gcSU%n = n + +! Next allocate necessary memory +! ------------------------------ + allocate ( gcSU%gcs(n), stat=ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + +! Record name of each instance +! ---------------------------- + CALL I90_label ( 'SU_instances:', ier ) + do i = 1, n + CALL I90_gtoken( name, ier ) + if ( ier .NE. 0 ) then + rc = 40 + return + end if + ! resource file name + gcSU%gcs(i)%rcfilen = trim(rc_basename)//'---'//trim(name)//'.rc' + gcSU%gcs(i)%instance = i ! instance number + + if (trim(name) == "full") then + gcSU%gcs(i)%iname = " " ! blank instance name for full (1) + else + gcSU%gcs(i)%iname = trim(name) ! instance name for others + end if + + end do + +! Next initialize each instance +! ----------------------------- + do i = 1, gcSU%n + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,myname,": Initializing instance ",TRIM(gcSU%gcs(i)%iname)," [",gcSU%gcs(i)%instance,"]" + END IF + call SU_SingleInstance_ ( SU_GridCompInitialize1_, i, & + gcSU%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = 1000+ier + return + end if + gcSU%gcs(i)%mie_tables => gcSU%mie_tables + end do + +! Get Henrys Law cts for the parameterized convective wet removal +! ----------------------------------------------------------- + do i = 1, gcSU%n + !- DMS + i_ = w_c%reg%i_SU + 4*(i - 1) + CALL get_HenrysLawCts('DMS',w_c%reg%Hcts(1,i_),w_c%reg%Hcts(2,i_)& + ,w_c%reg%Hcts(3,i_),w_c%reg%Hcts(4,i_)) + !print*,"DMS=",w_c%reg%Hcts(1,i_),w_c%reg%Hcts(2,i_),w_c%reg%Hcts(3,i_),w_c%reg%Hcts(4,i_) + + !- SO2 + i_ = w_c%reg%i_SU + 4*(i - 1) + 1 + CALL get_HenrysLawCts('SO2',w_c%reg%Hcts(1,i_),w_c%reg%Hcts(2,i_)& + ,w_c%reg%Hcts(3,i_),w_c%reg%Hcts(4,i_)) + !print*,"SO2=",w_c%reg%Hcts(1,i_),w_c%reg%Hcts(2,i_),w_c%reg%Hcts(3,i_),w_c%reg%Hcts(4,i_) + !call flush(6) + ENDDO + + +! All done +! -------- + CALL I90_FullRelease( ier ) + IF( ier /= 0 ) THEN + PRINT *,myname,": I90_FullRelease not successful." + rc = 40 + END IF + + + end subroutine SU_GridCompInitialize + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_GridCompRun1 --- Run SU_GridComp +! +! !INTERFACE: +! + + subroutine SU_GridCompRun1 ( gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(SU_GridComp), INTENT(INOUT) :: gcSU ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcSU%n + call SU_SingleInstance_ ( SU_GridCompRun1_, i, & + gcSU%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine SU_GridCompRun1 + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_GridCompRun2 --- Run SU_GridComp +! +! !INTERFACE: +! + + subroutine SU_GridCompRun2 ( gcSU, w_c, impChem, expChem, & + run_alarm, nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + LOGICAL, INTENT(IN) :: run_alarm ! run alarm + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(SU_GridComp), INTENT(INOUT) :: gcSU ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Runs the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer :: i, ier + + do i = 1, gcSU%n + gcSU%gcs(i)%run_alarm = run_alarm + + call SU_SingleInstance_ ( SU_GridCompRun2_, i, & + gcSU%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + end subroutine SU_GridCompRun2 + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_GridCompFinalize --- Initialize SU_GridComp +! +! !INTERFACE: +! + + subroutine SU_GridCompFinalize ( gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + IMPLICIT NONE + +! !INPUT PARAMETERS: + + TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(SU_GridComp), INTENT(INOUT) :: gcSU ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the SU Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer i, ier + + do i = 1, gcSU%n + call SU_SingleInstance_ ( SU_GridCompFinalize1_, i, & + gcSU%gcs(i), w_c, impChem, expChem, & + nymd, nhms, cdt, ier ) + if ( ier .NE. 0 ) then + rc = i * 1000+ier + return + end if + end do + + if (associated(gcSU%gcs)) deallocate ( gcSU%gcs, stat=ier ) + gcSU%n = -1 + + end subroutine SU_GridCompFinalize + + + subroutine SU_GridCompSetServices1_( gc, chemReg, iname, rc) + type(ESMF_GridComp), intent(INOUT) :: GC + type(Chem_Registry), intent(INOUT) :: chemReg + character(len=*), intent(IN ) :: iname + integer, intent(OUT ) :: rc + + + CHARACTER(LEN=255) :: name + type(ESMF_Config) :: cfg + + logical :: using_GMI_H2O2, using_GMI_OH, using_GMI_NO3 + logical :: using_ACHEM_pSO2_OCS, doing_NEI + character(len=ESMF_MAXSTR) :: tmpchar + + integer :: Status + character(len=ESMF_MAXSTR) :: Iam + + Iam ="SU_GridCOmpSetServices1_" + + if (trim(iname) == "") then + name = trim(rc_basename)//'---full.rc' + else + name = trim(rc_basename)//'---'//trim(iname)//'.rc' + end if + + cfg = ESMF_ConfigCreate(__RC__) + call ESMF_ConfigLoadFile(cfg, name, __RC__) + + call ESMF_ConfigGetAttribute(cfg, using_GMI_H2O2, label='using_GMI_H2O2:', __RC__) + call ESMF_ConfigGetAttribute(cfg, using_GMI_OH, label='using_GMI_OH:', __RC__) + call ESMF_ConfigGetAttribute(cfg, using_GMI_NO3, label='using_GMI_NO3:', __RC__) + + call ESMF_ConfigGetAttribute(cfg, using_ACHEM_pSO2_OCS, label='using_ACHEM_pSO2_OCS:', __RC__) + call ESMF_ConfigGetAttribute(cfg, tmpchar, label='nei_boundingbox:', RC=status) + if (status == 0) then + doing_NEI = .true. + else + doing_NEI = .false. + end if + + + if (doing_NEI) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_NEI_SRC1', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_NEI_SRC2', & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + end if + + if (.not. using_GMI_H2O2) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_H2O2'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + end if + + if (.not. using_GMI_OH) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_OH'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + end if + + if (.not. using_GMI_NO3) then + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_NO3'//trim(iname), & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + end if + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_BIOMASS'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_ANTHROL1'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_ANTHROL2'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_SHIPSO2'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_SHIPSO4'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_DMSO'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_AIRCRAFT'//iname, & + LONG_NAME = 'source species' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_AVIATION_LTO'//trim(iname), & + LONG_NAME = 'su_aviation_lto' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_AVIATION_CDS'//trim(iname), & + LONG_NAME = 'su_aviation_cds' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'SU_AVIATION_CRS'//trim(iname), & + LONG_NAME = 'su_aviation_crs' , & + UNITS = '1', & + DIMS = MAPL_DimsHorzOnly, & + VLOCATION = MAPL_VLocationNone, & + RESTART = MAPL_RestartSkip, & + RC = STATUS) + VERIFY_(STATUS) + + + RETURN_(ESMF_SUCCESS) + end subroutine SU_GridCompSetServices1_ + +!-------------------------------------------------------------------------- + +! Single Instance Methods + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_GridCompInitialize --- Initialize SU_GridComp +! +! !INTERFACE: +! + + subroutine SU_GridCompInitialize1_ ( gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(SU_GridComp1), intent(inout) :: gcSU ! Grid Component + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Initializes the SU Grid Component. It primarily sets +! the import state for each active constituent package. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'SU_GridCompInitialize1' + + + character(len=255) :: rcfilen = 'SU_GridComp.rc' + integer :: n + integer :: i1, i2, im, j1, j2, jm, km, nbins, n1, n2, nbins_rc + integer, allocatable :: ier(:) + real :: qmax, qmin + CHARACTER(LEN=255) :: string + logical :: NoRegionalConstraint + real :: radius, rhop + integer :: irhFlag + + rcfilen = gcSU%rcfilen + gcSU%name = 'SU Constituent Package' + gcSU%firstRun = .true. + + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + km = w_c%grid%km + nbins = w_c%reg%n_SU + n1 = w_c%reg%i_SU + n2 = w_c%reg%j_SU + +! Check on the number of bins + if(nbins .ne. 4) then + rc = 1 + return + endif + + + call init_() + if ( rc /= 0 ) return + +! Set the bin assignments to the gcSU grid component + gcSU%nDMS = 1 + gcSU%nSO2 = 2 + gcSU%nSO4 = 3 + gcSU%nMSA = 4 + + +! ------------------- +! Parse resource file +! ------------------- + +! Load resource file +! ------------------ + call i90_loadf ( rcfilen, ier(1) ) + if ( ier(1) .ne. 0 ) then + call final_(10) + return + end if + + call i90_label ( 'number_su_classes:', ier(1) ) + nbins_rc = i90_gint ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(20) + return + end if + if ( nbins_rc /= nbins ) then + call final_(25) + return + end if + + +! SU sources files +! --------------------- + call i90_label ( 'volcano_srcfilen:', ier(1) ) + if ( ier(1) /= 0 ) then + call final_(31) + return + else + call i90_gtoken ( gcSU%volcano_srcfilen, ier(1) ) + if ( ier(1) /= 0 ) then + call final_(41) + return + end if + end if + +! Aircraft emissions +! ------------------ + ier(:) = 0 + call i90_label ( 'aviation_vertical_layers:', ier(1) ) + gcSU%aviation_layers(1) = i90_gfloat(ier(2)) + gcSU%aviation_layers(2) = i90_gfloat(ier(3)) + gcSU%aviation_layers(3) = i90_gfloat(ier(4)) + gcSU%aviation_layers(4) = i90_gfloat(ier(5)) + + if ( any(ier(1:5) /= 0) ) then + call final_(77) + return + end if + +! Handle Point-wise Emission Sources Specified in a Text File +! ----------------------------------------------------------- + ier(:) = 0 + call i90_label ( 'point_emissions_srcfilen:', ier(1) ) + call i90_gtoken ( gcSU%point_emissions_srcfilen, ier(2) ) + if ( ier(1) /= 0 ) then + gcSU%doing_point_emissions = .FALSE. ! if rc is missing, don't fuss + else if ( any(ier(2:2) /= 0) ) then + call final_(42) ! this means point emissions info is messed up, abort + return + else + if ( (index(gcSU%point_emissions_srcfilen,'/dev/null')>0) ) then + gcSU%doing_point_emissions = .FALSE. ! disable it if no file specified + else + gcSU%doing_point_emissions = .TRUE. ! we are good to go + end if + end if + +! Handle NEI08 Emissions +! ---------------------- + ier(:) = 0 + call i90_label ( 'nei_bot_srcfilen:', ier(1) ) + call i90_gtoken ( gcSU%nei_srcfilen(1), ier(2) ) + call i90_label ( 'nei_top_srcfilen:', ier(3) ) + call i90_gtoken ( gcSU%nei_srcfilen(2), ier(4) ) + call i90_label ( 'nei_boundingbox:', ier(5) ) + gcSU%nei_lon(1) = i90_gfloat(ier(6)) + gcSU%nei_lon(2) = i90_gfloat(ier(7)) + gcSU%nei_lat(1) = i90_gfloat(ier(8)) + gcSU%nei_lat(2) = i90_gfloat(ier(9)) + if ( ier(1) /= 0 ) then + gcSU%doing_nei = .FALSE. ! if rc is missing, don't fuss + else if ( any(ier(2:9) /= 0) ) then + call final_(42) ! this means NEI info is messed up, abort + return + else + if ( (index(gcSU%nei_srcfilen(1),'/dev/null')>0) .or. & + (index(gcSU%nei_srcfilen(2),'/dev/null')>0) ) then + gcSU%doing_nei = .FALSE. ! disable it if no file specified + else + gcSU%doing_nei = .TRUE. ! we are good to go + end if + end if + + if ( MAPL_AM_I_ROOT() ) then + if ( gcSU%doing_nei ) then + print *, 'SU_GridComp: using NEI08 Emissions over North America' + else + print *, 'SU_GridComp: skipping NEI08 Emissions over North America' + end if + end if + +! ------- + +! Day of the week to reset tracer to zero +! --------------------------------------- + call i90_label ( 'my_day_of_the_week:',ier(1)) + if ( ier(1) /= 0 ) then + gcSU%myDOW = -1 ! by default never reset tracer to zero + else + gcSU%myDOW = i90_gint (ier(1)) + if ( ier(1) /= 0 ) then + call final_(60) + return + end if + end if + +! ------- +! Fraction of anthropogenic emissions to SO4 +! --------------- + call i90_label ( 'so4_anthropogenic_fraction:', ier(1) ) + gcSU%fSO4ant = i90_gfloat ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + + +! Aircraft Fuel Emission Factor +! --------------- + call i90_label ( 'aircraft_fuel_emission_factor:', ier(1) ) + gcSU%eAircraftFuel = i90_gfloat ( ier(2) ) + if ( any(ier(1:2) /= 0) ) then + call final_(52) + return + end if + + +! Scavenging Efficiency +! To be used in convtran.F90, this parameter +! is the scavenging efficiency of the tracer [km -1] +! --------------- + call i90_label ( 'fscav:', ier(1) ) + do n = 1, nbins + w_c%reg%fscav(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(53) + return + end if + +! Particle radius +! --------------- + call i90_label ( 'particle_radius:', ier(1) ) + do n = 1, nbins + radius = i90_gfloat ( ier(n+1) ) + gcSU%radius(n) = radius ! save radius in [um] +! w_c%qa(n1+n-1)%r = radius * 1.e-6 !radius in [m] + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(50) + return + end if + +! Particle affected by relative humidity? +! --------------- + call i90_label ( 'rhFlag:', ier(1) ) + irhFlag = i90_gint ( ier(2) ) + gcSU%rhFlag = irhFlag + w_c%qa(n1+n-1)%irhFlag = irhFlag + if ( any(ier(1:2) /= 0) ) then + call final_(50) + return + end if + +! Particle density +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_density:', ier(1) ) + do n = 1, nbins + w_c%reg%rhop(n1+n-1) = i90_gfloat ( ier(n+1) ) + gcSU%rhop(n) = w_c%reg%rhop(n1+n-1) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(54) + return + end if +! ------- + +! Number median radius +! To be used in droplet activation code +! --------------- + call i90_label ( 'particle_radius_number:', ier(1) ) + do n = 1, nbins + w_c%reg%rmed(n1+n-1) = i90_gfloat ( ier(n+1) ) * 1e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(55) + return + end if +! ------- + +! Sigma (lognormal mode width) +! To be used in droplet activation code +! --------------- + call i90_label ( 'sigma:', ier(1) ) + do n = 1, nbins + w_c%reg%sigma(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(56) + return + end if +! ------- + +! Number to mass conversion factor +! To be used in droplet activation code +! --------------- + call i90_label ( 'fnum:', ier(1) ) + do n = 1, nbins + w_c%reg%fnum(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(57) + return + end if +! ------- + +! Molecular weight +! To be used in droplet activation code +! --------------- + call i90_label ( 'molecular_weight:', ier(1) ) + do n = 1, nbins + w_c%reg%molwght(n1+n-1) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) then + call final_(58) + return + end if +! ------- + + +! Switches to select predicted OH H2O2 NO3 from the +! GMI Combined Stratosphere Troposphere Chemical Mechanism +! -------------------------------------------------------- + gcSU%using_GMI_OH = .FALSE. + CALL I90_Label("using_GMI_OH:",ier(1)) + IF(ier(1) /= 0) THEN + CALL final_(81) + RETURN + ELSE + CALL I90_GToken(string,ier(1)) + IF(ier(1) /= 0) THEN + CALL final_(82) + RETURN + END IF + IF(TRIM(string) == "yes" .AND. w_c%reg%doing_GMI) gcSU%using_GMI_OH = .TRUE. + END IF + + gcSU%using_GMI_NO3 = .FALSE. + CALL I90_Label("using_GMI_NO3:",ier(1)) + IF(ier(1) /= 0) THEN + CALL final_(83) + RETURN + ELSE + CALL I90_GToken(string,ier(1)) + IF(ier(1) /= 0) THEN + CALL final_(84) + RETURN + END IF + IF(TRIM(string) == "yes" .AND. w_c%reg%doing_GMI) gcSU%using_GMI_NO3 = .TRUE. + END IF + + gcSU%using_GMI_H2O2 = .FALSE. + CALL I90_Label("using_GMI_H2O2:",ier(1)) + IF(ier(1) /= 0) THEN + CALL final_(85) + RETURN + ELSE + CALL I90_GToken(string,ier(1)) + IF(ier(1) /= 0) THEN + CALL final_(86) + RETURN + END IF + IF(TRIM(string) == "yes" .AND. w_c%reg%doing_GMI) gcSU%using_GMI_H2O2 = .TRUE. + END IF + + gcSU%export_H2O2 = .FALSE. + CALL I90_Label("export_H2O2:",ier(1)) + IF(ier(1) /= 0) THEN + CALL final_(87) + RETURN + ELSE + CALL I90_GToken(string,ier(1)) + IF(ier(1) /= 0) THEN + CALL final_(88) + RETURN + END IF + IF(TRIM(string) == "yes" .AND. w_c%reg%doing_GMI) gcSU%export_H2O2 = .TRUE. + END IF + +! Switches to select import of production of SO2 from OCS +! provided in ACHEM mechanism +! -------------------------------------------------------- + gcSU%using_ACHEM_pSO2_OCS = .FALSE. + CALL I90_Label("using_ACHEM_pSO2_OCS:",ier(1)) + IF(ier(1) /= 0) THEN + CALL final_(89) + RETURN + ELSE + CALL I90_GToken(string,ier(1)) + IF(ier(1) /= 0) THEN + CALL final_(90) + RETURN + END IF + IF(TRIM(string) == "yes" .AND. w_c%reg%doing_OCS) gcSU%using_ACHEM_pSO2_OCS = .TRUE. + END IF + + IF(MAPL_AM_I_ROOT()) THEN + PRINT *," " + PRINT *,TRIM(myname)//":" + PRINT *," Using GMI OH: ",gcSU%using_GMI_OH + PRINT *," Using GMI NO3: ",gcSU%using_GMI_NO3 + PRINT *," Using GMI H2O2: ",gcSU%using_GMI_H2O2 + PRINT *," Using ACHEM pSO2_OCS: ", gcSU%using_ACHEM_pSO2_OCS + PRINT *," Exporting updated H2O2 to GMI: ",gcSU%export_H2O2 + PRINT *," " + END IF + +! ------- + + +! ------- + +! Set the gram molecular weights of the species +! --------------------------------------------- + gcSU%fMassSulfur = 32.0 + gcSU%fMassSO2 = 64.0 + gcSU%fMassSO4 = 96.0 + gcSU%fMassDMS = 62.0 + gcSU%fMassMSA = 96.0 + +! Initialize date for boundary conditions +! --------------------------------------- + gcSU%nymd = -1 ! nothing read yet + gcSU%nymd_oxidants = -1 + +! Grab the region string. +! ----------------------- + call i90_label ( 'SU_regions_indices:', ier(1) ) + CALL I90_gtoken( gcSU%regionsString, ier(2) ) + IF( ANY(ier(1:2) < 0 ) ) THEN + CALL final_(51) + RETURN + END IF + +! Is this instantiation a global case? +! ----------------------------------- + IF(gcSU%regionsString(1:2) == "-1") THEN + NoRegionalConstraint = .TRUE. + ELSE + SELECT CASE (ESMF_UtilStringLowerCase(gcSU%regionsString(1:2))) + CASE ("gl") + NoRegionalConstraint = .TRUE. + CASE ("al") + NoRegionalConstraint = .TRUE. + CASE DEFAULT + NoRegionalConstraint = .FALSE. + END SELECT + END IF + +! Set regionsString to "-1" for the global case +! --------------------------------------------- + IF(NoRegionalConstraint) gcSU%regionsString = "-1" + + IF(MAPL_AM_I_ROOT()) THEN + IF(NoRegionalConstraint) THEN + PRINT *,myname,": This instantiation has no regional constraints." + ELSE + PRINT *,myname,": This instantiation is regionally constrained." + PRINT *,myname,": List of region numbers included: ",TRIM(gcSU%regionsString) + END IF + END IF + +! All done +! -------- + call i90_release() + deallocate(ier) + + return + + +CONTAINS + + subroutine init_() + integer ios, nerr + nerr = max ( 32, nbins+1 ) + allocate ( gcSU%so2biomass_src(i1:i2,j1:j2), gcSU%so2anthro_l1_src(i1:i2,j1:j2), & + gcSU%so2biomass_src_(i1:i2,j1:j2), & + gcSU%so2anthro_l2_src(i1:i2,j1:j2), gcSU%dmso_conc(i1:i2,j1:j2), & + gcSU%so2ship_src(i1:i2,j1:j2), gcSU%so4ship_src(i1:i2,j1:j2), & + gcSU%oh_conc(i1:i2,j1:j2,km), gcSU%no3_mr(i1:i2,j1:j2,km), & + gcSU%h2o2_mr(i1:i2,j1:j2,km), gcSU%h2o2_int(i1:i2,j1:j2,km), & + gcSU%aircraft_fuel_src(i1:i2,j1:j2,km), & + gcSU%aviation_lto_src(i1:i2,j1:j2), & + gcSU%aviation_cds_src(i1:i2,j1:j2), & + gcSU%aviation_crs_src(i1:i2,j1:j2), & + gcSU%regionMask(i1:i2,j1:j2), & + gcSU%radius(nbins), gcSU%rhop(nbins), & + ier(nerr), stat=ios ) + if ( ios /= 0 ) rc = 100 + end subroutine init_ + + subroutine final_(ierr) + integer :: ierr + integer ios + deallocate ( gcSU%so2biomass_src, gcSU%so2anthro_l1_src, gcSU%so2anthro_l2_src, & + gcSU%so2biomass_src_, & + gcSU%dmso_conc, gcSU%oh_conc, gcSU%no3_mr, & + gcSU%so2ship_src, gcSU%so4ship_src, & + gcSU%h2o2_mr, gcSU%h2o2_int, gcSU%aircraft_fuel_src, & + gcSU%aviation_lto_src, gcSU%aviation_cds_src, gcSU%aviation_crs_src, & + gcSU%regionMask, gcSU%radius, gcSU%rhop, & + ier, stat=ios ) + + call i90_release() + rc = ierr + end subroutine final_ + + end subroutine SU_GridCompInitialize1_ + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_GridCompRun1_ --- The Chem Driver, run phase 1 +! +! !INTERFACE: +! + + subroutine SU_GridCompRun1_ ( gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(SU_GridComp1), intent(inout) :: gcSU ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called SU Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'SU_GridCompRun1_' + character(len=*), parameter :: Iam = myname + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n + integer :: i, j, ijl, ijkl, ijk1l + real :: qmax, qmin + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: pblh, oro, & + u10m, v10m, hsurf + real, pointer, dimension(:,:,:) :: tmpu, rhoa, hghte + + + real, pointer :: var2d(:,:) => null() + + integer :: idow + character(len=3) :: cdow + + +#define EXPORT expChem +#define iNAME TRIM(gcSU%iname) + +#define ptrSUEM SU_emis + +#define ptrSO4EMAN SU_SO4eman +#define ptrSO2EMAN SU_SO2eman +#define ptrSO2EMBB SU_SO2embb +#define ptrSO2EMVN SU_SO2emvn +#define ptrSO2EMVE SU_SO2emve + + integer :: STATUS + +! Indices for point emissions + integer, pointer, dimension(:) :: iPoint, jPoint + real, dimension(w_c%grid%km) :: point_column_emissions + integer :: ios, ii + +#include "SU_GetPointer___.h" + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_SU + n1 = w_c%reg%i_SU + n2 = w_c%reg%j_SU + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + +! Reset tracer to zero at 0Z on specific day of week +! -------------------------------------------------- + idow = Chem_UtilIdow(nymd) + if ( (nhms==0) .and. (idow == gcSU%myDOW) ) then + cdow = Chem_UtilCdow(nymd) + do n = n1, n2 + w_c%qa(n)%data3d(i1:i2,j1:j2,1:km) = tiny(1.) ! avoid division by zero + end do + if ( MAPL_AM_I_ROOT() ) then + print *, '<> SU '//cdow//' tracer being set to zero on ', nymd, nhms + end if + end if + + + call MAPL_GetPointer(impChem, var2d, 'SU_regionMask', __RC__) + gcSU%regionMask = var2d + + + call SulfateUpdateEmissions (impChem, iNAME, i1, i2, im, j1, j2, jm, km, cdt, & + nymd, nhms, & + w_c%grid_esmf, w_c%grid%lon, w_c%grid%lat, & + gcSU%nymd, & + w_c%diurnal_bb, & + gcSU%so2biomass_src, gcSU%so2biomass_src_, & + gcSU%so2anthro_l1_src, & + gcSU%so2anthro_l2_src, & + gcSU%so2ship_src, & + gcSU%so4ship_src, & + gcSU%dmso_conc, & + gcSU%aircraft_fuel_src, & + gcSU%aviation_lto_src, & + gcSU%aviation_cds_src, & + gcSU%aviation_crs_src, & + gcSU%volcano_srcfilen, & + gcSU%nvolc, gcSU%vLat, gcSU%vLon, & + gcSU%vElev, gcSU%vCloud, gcSU%vSO2, & + gcSU%vStart, gcSU%vEnd, & + doing_NEI=gcSU%doing_NEI, & + nei_hour=gcSU%nei_hour, & + nei_year=gcSU%nei_year, & + nei_srcfilen=gcSU%nei_srcfilen, & + nei_lon=gcSU%nei_lon, & + nei_lat=gcSU%nei_lat, & + lons=w_c%grid%lon, & + lats=w_c%grid%lat, & + maskString=trim(gcSU%regionsString), & + gridMask=gcSU%regionMask, & + rc=STATUS) + VERIFY_(STATUS) + +! Read any pointwise emissions, if requested (hardcoded will go to sulfate) +! ------------------------------------------------------------------------- + if(gcSU%doing_point_emissions) then + call Chem_UtilPointEmissions( nymd, gcSU%point_emissions_srcfilen, & + gcSU%nPts, gcSU%pLat, gcSU%pLon, & + gcSU%pBase, gcSU%pTop, gcSU%pEmis, & + gcSU%pStart, gcSU%pEnd ) + +! In case pStart or pEnd were not specified in the file set to defaults + where(gcSU%pStart < 0) gcSU%pStart = 000000 + where(gcSU%pEnd < 0) gcSU%pEnd = 240000 + endif + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + call MAPL_GetPointer ( impChem, oro, 'LWI', __RC__ ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', __RC__ ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, hghte, 'ZLE', __RC__ ) + + +! Unlike GEOS-4 hghte is defined for km+1 +! --------------------------------------- + hsurf => hghte(i1:i2,j1:j2,km) ! in GEOS-5 hghte is in [0,km] + +#ifdef DEBUG + + call pmaxmin('SU: oro ', oro , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: u10m ', u10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: v10m ', v10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: hsurf ', hsurf , qmin, qmax, ijl,1, 1. ) + + call pmaxmin('SU: tmpu ', tmpu , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SU: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SU: hghte ', hghte , qmin, qmax, ijkl,1, 1. ) + +#endif + +! SU Source +! ----------- + call SulfateDistributeEmissions ( i1, i2, j1, j2, km, nbins, cdt, nymd, nhms, & + gcSU%fSO4ant, & + gcSU%eAircraftFuel, & + gcSU%so2anthro_l1_src, gcSU%so2anthro_l2_src, & + gcSU%so2biomass_src, gcSU%dmso_conc, & + gcSU%so2ship_src, gcSU%so4ship_src, & + gcSU%aircraft_fuel_src, & + gcSU%nvolc, gcSU%vLat, gcSU%vLon, & + gcSU%vElev, gcSU%vCloud, gcSU%vSO2, & + gcSU%vStart, gcSU%vEnd, & + w_c%qa(n1+gcSU%nDMS-1)%data3d, & + w_c%qa(n1+gcSU%nSO2-1)%data3d, & + w_c%qa(n1+gcSU%nSO4-1)%data3d, & + oro, u10m, v10m, hsurf, hghte, pblh, & + tmpu, rhoa, w_c%delp, & + w_c%grid%cell_area, & + w_c%grid_esmf, & + SU_emis, & + SU_SO4eman, SU_SO2eman, SU_SO2embb, & + SU_SO2emvn, SU_SO2emve, & + rc, & + aviation_layers=gcSU%aviation_layers, & + aviation_lto_src=gcSU%aviation_lto_src, & + aviation_cds_src=gcSU%aviation_cds_src, & + aviation_crs_src=gcSU%aviation_crs_src) + +#ifdef DEBUG + do n = n1, n2 + call pmaxmin('SU: q_emi', w_c%qa(n)%data3d(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + end do +#endif + + +! Distribute pointwise sources if requested +! ----------------------------------------- + POINTWISE_SOURCES: if( gcSU%doing_point_emissions .and. gcSU%nPts > 0) then + +! Get indices for point emissions +! ------------------------------- + allocate(iPoint(gcSU%nPts), jPoint(gcSU%nPts), stat=ios) + + call MAPL_GetHorzIJIndex(gcSU%nPts, iPoint, jPoint, & + grid = w_c%grid_esmf, & + lon = gcSU%pLon/radToDeg, & + lat = gcSU%pLat/radToDeg, & + rc = rc) + + if ( rc /= 0 ) call die(myname,'cannot get indices for point emissions') + + do ii = 1, gcSU%nPts + i = iPoint(ii) + j = jPoint(ii) + if( i<1 .OR. j<1 ) cycle ! point emission not in this sub-domain +! if( gcSU%regionMask(i,j) == 0 ) cycle ! masked by region mask + +! Emissions not occurring in current time step +! -------------------------------------------- + if(nhms < gcSU%pStart(ii) .or. nhms >= gcSU%pEnd(ii)) cycle + + call distribute_point_emissions(w_c%delp(i,j,:), rhoa(i,j,:), & + gcSU%pBase(ii), gcSU%pTop(ii), gcSU%pEmis(ii), & + point_column_emissions, km) + w_c%qa(n1+gcSU%nSO4-1)%data3d(i,j,:) = w_c%qa(n1+gcSU%nSO4-1)%data3d(i,j,:) & + + cdt * grav / w_c%delp(i,j,:) & + * point_column_emissions / w_c%grid%cell_area(i,j) + + enddo + + deallocate(iPoint, jPoint, stat=ios) + + endif POINTWISE_SOURCES + + + return + +CONTAINS + +! Abstracted from distribute_aviation_emissions, but called per column + subroutine distribute_point_emissions(delp, rhoa, z_bot, z_top, emissions_point, & + emissions, km) + + implicit none + + integer, intent(in) :: km + + real, dimension(:), intent(in) :: delp + real, dimension(:), intent(in) :: rhoa + real, intent(in) :: emissions_point + real, intent(in) :: z_bot + real, intent(in) :: z_top + real, dimension(:), intent(out):: emissions + +! local + integer :: k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ + +! find level height + z = 0.0 + z_= 0.0 + + do k = km, 1, -1 + dz(k) = delp(k)/rhoa(k)/grav + z_ = z_ + dz(k) + z(k) = z_ + end do + +! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + +! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + +! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot .eq. k_top) then + w_(k_bot) = z_top - z_bot + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + +! distribute emissions in the vertical + emissions(:) = (w_ / sum(w_)) * emissions_point + + end subroutine distribute_point_emissions + + + end subroutine SU_GridCompRun1_ + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_GridCompRun2_ --- The Chem Driver, run phase 2 +! +! !INTERFACE: +! + + subroutine SU_GridCompRun2_ ( gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(SU_GridComp1), intent(inout) :: gcSU ! Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + +! !INPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemistry timestep (secs) + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: expChem ! Export State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine implements the so-called SU Driver. That +! is, adds chemical tendencies to each of the constituents, +! Note: water wapor, the first constituent is not considered a chemical +! constituents. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'SU_GridCompRun2_' + character(len=*), parameter :: Iam = myname + + integer :: i1, i2, im, j1, j2, jm, nbins, n1, n2, km, n + integer :: k, ijl, ijkl, ijk1l + real :: qmax, qmin + real, pointer :: SU_radius(:), SU_rhop(:) + logical :: KIN + +! Input fields from fvGCM +! ----------------------- + real, pointer, dimension(:,:) :: frlake, frocean, frseaice, & + pblh, oro, shflux, ustar, precc, & + precl, u10m, v10m, hsurf, z0h + real, pointer, dimension(:,:,:) :: tmpu, cloud, rhoa, u, v, hghte, ple + real, pointer, dimension(:,:,:) :: pfllsan, pfilsan + + REAL, POINTER, DIMENSION(:,:,:) :: GMI_H2O2mr, GMI_OHmr, GMI_NO3mr, ACHEM_PSO2_OCS + real, pointer, dimension(:,:,:) :: xoh, xno3, xh2o2 + +! Additional needs for GOCART convective diagnostic + real, pointer, dimension(:,:,:) :: cmfmc, qlcn, qicn, dtrain + real, pointer, dimension(:,:) :: area + real*8, allocatable, dimension(:,:,:) :: cmfmc_, qccu_, dtrain_, & + airmass_, airmol_, vud_, & + delz_, delp_, h2o2_, tmpu_, ple_ + real*8, allocatable :: tc_(:,:,:,:), bcnv_(:,:,:) + real*8, allocatable :: area_(:,:), frlake_(:,:), & + frocean_(:,:), frseaice_(:,:) + integer*4 :: icdt + + real, pointer :: var2d(:,:) => null() + + +#define EXPORT expChem +#define iNAME TRIM(gcSU%iname) + +#define ptrSUWT SU_wet +#define ptrSUSV SU_conv +#define ptrSUDP SU_dep +#define ptrSUSD SU_set + +#define ptrSUPSO2 SU_PSO2 +#define ptrSUPSO4 SU_PSO4 +#define ptrSUPSO4G SU_PSO4g +#define ptrSUPSO4AQ SU_PSO4aq +#define ptrSUPSO4WT SU_PSO4wet +#define ptrSUPMSA SU_PMSA + +#define ptrSO2SMASS SU_SO2sfcmass +#define ptrSO2CMASS SU_SO2colmass +#define ptrSO4SMASS SU_SO4sfcmass +#define ptrSO4CMASS SU_SO4colmass +#define ptrDMSSMASS SU_DMSsfcmass +#define ptrDMSCMASS SU_DMScolmass +#define ptrMSASMASS SU_MSAsfcmass +#define ptrMSACMASS SU_MSAcolmass +#define ptrSUCONC SU_conc +#define ptrSUEXTCOEF SU_extcoef +#define ptrSUSCACOEF SU_scacoef +#define ptrSUANGSTR SU_angstrom +#define ptrSUFLUXU SU_fluxu +#define ptrSUFLUXV SU_fluxv +#define ptrSO4MASS SU_so4mass +#define ptrSUEXTTAU SU_exttau +#define ptrSUSCATAU SU_scatau +#define ptrSO4SAREA SU_sarea +#define ptrSO4SNUM SU_snum + + integer :: STATUS + +#include "SU_GetPointer___.h" + +! Initialize local variables +! -------------------------- + rc = 0 + i1 = w_c%grid%i1; i2 = w_c%grid%i2; im = w_c%grid%im + j1 = w_c%grid%j1; j2 = w_c%grid%j2; jm = w_c%grid%jm + + km = w_c%grid%km + nbins = w_c%reg%n_SU + n1 = w_c%reg%i_SU + n2 = w_c%reg%j_SU + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + ijk1l = ijl * (km+1) + + + allocate(xoh(i1:i2,j1:j2,km), xno3(i1:i2,j1:j2,km), xh2o2(i1:i2,j1:j2,km), __STAT__) + + call MAPL_GetPointer(impChem, var2d, 'SU_regionMask', __RC__) + gcSU%regionMask = var2d + + if (gcSU%firstRun) then + gcSU%h2o2_mr = MAPL_UNDEF + gcSU%h2o2_int = MAPL_UNDEF + xh2o2 = MAPL_UNDEF + gcSU%firstRun = .false. + end if + + xoh = 0.0 + xno3 = 0.0 + xh2o2 = gcSU%h2o2_int + + +! Get 2D Imports +! -------------- + call MAPL_GetPointer ( impChem, pblh, 'ZPBL', __RC__ ) + call MAPL_GetPointer ( impChem, oro, 'LWI', __RC__ ) + call MAPL_GetPointer ( impChem, shflux, 'SH', __RC__ ) + call MAPL_GetPointer ( impChem, ustar, 'USTAR', __RC__ ) + call MAPL_GetPointer ( impChem, precc, 'CN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, precl, 'NCN_PRCP', __RC__ ) + call MAPL_GetPointer ( impChem, u10m, 'U10M', __RC__ ) + call MAPL_GetPointer ( impChem, v10m, 'V10M', __RC__ ) + call MAPL_GetPointer ( impChem, z0h, 'Z0H', __RC__ ) + call MAPL_GetPointer ( impChem, area, 'AREA', __RC__ ) + call MAPL_GetPointer ( impChem, frocean, 'FROCEAN', __RC__ ) + call MAPL_GetPointer ( impChem, frseaice, 'FRACI', __RC__ ) + call MAPL_GetPointer ( impChem, frlake, 'FRLAKE', __RC__ ) + +! Get 3D Imports +! -------------- + call MAPL_GetPointer ( impChem, tmpu, 'T', __RC__ ) + call MAPL_GetPointer ( impChem, cloud, 'FCLD', __RC__ ) + call MAPL_GetPointer ( impChem, rhoa, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( impChem, u, 'U', __RC__ ) + call MAPL_GetPointer ( impChem, v, 'V', __RC__ ) + call MAPL_GetPointer ( impChem, hghte, 'ZLE', __RC__ ) + call MAPL_GetPointer ( impChem, ple, 'PLE', __RC__ ) + call MAPL_GetPointer ( impChem, qlcn, 'QLCN', __RC__ ) + call MAPL_GetPointer ( impChem, qicn, 'QICN', __RC__ ) + call MAPL_GetPointer ( impChem, cmfmc, 'CNV_MFC', __RC__ ) + call MAPL_GetPointer ( impChem, dtrain, 'CNV_MFD', __RC__ ) + call MAPL_GetPointer ( impChem, pfllsan, 'PFL_LSAN', __RC__ ) + call MAPL_GetPointer ( impChem, pfilsan, 'PFI_LSAN', __RC__ ) + +! Oxidants from GMICHEM. Get pointers first ... +! ---------------------------------------------- + if ( gcSU%using_GMI_OH) call MAPL_GetPointer(impChem, GMI_OHmr, 'OH', __RC__) + if ( gcSU%using_GMI_NO3) call MAPL_GetPointer(impChem, GMI_NO3mr, 'NO3', __RC__) + if (gcSU%using_GMI_H2O2) call MAPL_GetPointer(impChem, GMI_H2O2mr, 'H2O2', __RC__) + +! Production of SO2 from OCS provided by ACHEM +! -------------------------------------------- + if (gcSU%using_ACHEM_pSO2_OCS) then + call MAPL_GetPointer(impChem, ACHEM_PSO2_OCS, 'pSO2_OCS', __RC__) + end if + + +! Unlike GEOS-4 hghte is defined for km+1 +! --------------------------------------- + hsurf => hghte(i1:i2,j1:j2,km) ! in GEOS-5 hghte is in [0,km] + +#ifdef DEBUG + + call pmaxmin('SU: oro ', oro , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: u10m ', u10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: v10m ', v10m , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: ustar ', ustar , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: precc ', precc , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: precl ', precl , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: pblh ', pblh , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: shfflux ', shflux , qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: hsurf ', hsurf , qmin, qmax, ijl,1, 1. ) + + call pmaxmin('SU: tmpu ', tmpu , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SU: rhoa ', rhoa , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SU: u ', u , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SU: v ', v , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SU: hghte ', hghte , qmin, qmax, ijkl,1, 1. ) + call pmaxmin('SU: pfllsan ', pfllsan , qmin, qmax, ijk1l,1, 1. ) + call pmaxmin('SU: pfilsan ', pfilsan , qmin, qmax, ijk1l,1, 1. ) + +#endif + +#ifdef DEBUG + + call pmaxmin('SU: h2o2', gcSU%h2o2_int(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + call pmaxmin('SU: oh', gcSU%oh_conc(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + call pmaxmin('SU: no3', gcSU%no3_mr(i1:i2,j1:j2,1:km), qmin, qmax, & + ijl, km, 1. ) + +#endif + + + call SulfateUpdateOxidants ( impChem, iNAME, i1, i2, im, j1, j2, jm, km, cdt, & + gcSU%using_GMI_OH, gcSU%using_GMI_NO3, & + gcSU%using_GMI_H2O2, & + GMI_OHmr, GMI_NO3mr, GMI_H2O2mr, & + nymd, nhms, & + w_c%grid_esmf, w_c%grid%lon, w_c%grid%lat, & + rhoa, & + gcSU%nymd_oxidants, & + gcSU%oh_conc, gcSU%no3_mr, gcSU%h2o2_mr, & + xoh, xno3, xh2o2, gcSU%recycle_H2O2 ) + +#ifdef DEBUG + CALL pmaxmin('SU: OH_conc', gcSU%oh_conc, qmin, qmax, ijl,km, 1. ) + CALL pmaxmin('SU: NO3_mr ', gcSU%no3_mr, qmin, qmax, ijl,km, 1. ) + CALL pmaxmin('SU: H2O2_mr', gcSU%h2o2_mr, qmin, qmax, ijl,km, 1. ) + CALL pmaxmin('SU: OH ', xoh, qmin, qmax, ijl,km, 1. ) + CALL pmaxmin('SU: NO3 ', xno3, qmin, qmax, ijl,km, 1. ) + CALL pmaxmin('SU: H2O2 ', xh2o2, qmin, qmax, ijl,km, 1. ) +#endif + +! Settling calculation +! Sulfate particle radius [m] and density [kg m-3] +! --------------------------------------------- + allocate( SU_radius(nbins), SU_rhop(nbins) ) + SU_radius = 1.e-6*gcSU%radius + SU_rhop = gcSU%rhop + +RUN_ALARM: if (gcSU%run_alarm) then + + call Chem_Settling ( i1, i2, j1, j2, km, n1, n2, nbins, gcSU%rhFlag, & + SU_radius, SU_rhop, cdt, w_c, tmpu, rhoa, hsurf, & + hghte, SU_set, rc ) + +! If doing the ACHEM provided pSO2 from OCS then add to SO2 here +! -------------------------------------------------------------- + IF(gcSU%using_ACHEM_pSO2_OCS .and. associated(ACHEM_PSO2_OCS) ) THEN + w_c%qa(n1+gcSU%nSO2-1)%data3d = & + w_c%qa(n1+gcSU%nSO2-1)%data3d + ACHEM_PSO2_OCS*cdt + ENDIF + +! SU Chemistry Driver (dry deposition and chemistry) +! ----------- + call SU_ChemDrv ( i1, i2, j1, j2, km, nbins, cdt, nymd, nhms, gcSU, w_c, & + ustar, u, v, shflux, oro, pblh, tmpu, cloud, rhoa, hghte, & + SU_dep, SU_PSO2, SU_PMSA, SU_pSO4, SU_PSO4g, SU_PSO4aq, & ! 2d diagnostics + pso2, pmsa, pso4, pso4g, pso4aq, & ! 3d diagnostics + xoh, xno3, xh2o2, & ! oxidants + rc) + +! Sulfate Large-scale Wet Removal +! ------------------------------- + KIN = .TRUE. + call SU_Wet_Removal ( i1, i2, j1, j2, km, nbins, cdt, 'sulfur', KIN, & + ple, rhoa, gcSU, w_c, & + precc, precl, pfllsan, pfilsan, & + tmpu, SU_wet, SU_pso4, SU_pso4wet, pso4, pso4wet, rc ) + +! Sulfate Convective-scale Mixing and Wet Removal +! ----------------------------------------------- + KIN = .TRUE. + icdt = cdt + allocate(cmfmc_(i1:i2,j1:j2,km+1), qccu_(i1:i2,j1:j2,km), & + dtrain_(i1:i2,j1:j2,km), airmass_(i1:i2,j1:j2,km), & + delz_(i1:i2,j1:j2,km), vud_(i1:i2,j1:j2,km), & + tc_(i1:i2,j1:j2,km,n1:n2), delp_(i1:i2,j1:j2,km), & + airmol_(i1:i2,j1:j2,km), tmpu_(i1:i2,j1:j2,km), & + bcnv_(i1:i2,j1:j2,n1:n2), ple_(i1:i2,j1:j2,km+1), & + area_(i1:i2,j1:j2), frlake_(i1:i2,j1:j2), & + frocean_(i1:i2,j1:j2), frseaice_(i1:i2,j1:j2),& + h2o2_(i1:i2,j1:j2,km), __STAT__ ) + + bcnv_ = 0.0 + area_ = area + frlake_ = frlake + frocean_ = frocean + frseaice_ = frseaice + do k = 1, km+1 + cmfmc_(:,:,k) = cmfmc(:,:,km-k+1) + ple_(:,:,k) = ple(:,:,km-k+1) + end do + do k = 1, km + dtrain_(:,:,k) = dtrain(:,:,km-k+1) + qccu_(:,:,k) = qlcn(:,:,km-k+1) + qicn(:,:,km-k+1) + delp_(:,:,k) = w_c%delp(:,:,km-k+1)/100. + airmass_(:,:,k) = w_c%delp(:,:,km-k+1)/grav*area_ + airmol_(:,:,k) = airmass_(:,:,k)*1000./28.966 + delz_(:,:,k) = w_c%delp(:,:,km-k+1)/grav/rhoa(:,:,km-k+1) + tmpu_(:,:,k) = tmpu(:,:,km-k+1) + enddo + do n = n1, n2 + do k = 1, km + tc_(:,:,k,n) = w_c%qa(n)%data3d(:,:,km-k+1) + enddo + enddo +! H2O2 is in vmr and SU are mmr. Convert H2O2 to mmr + do k = 1, km + h2o2_(:,:,k) = gcSU%h2o2_int(:,:,km-k+1)*rH2O2 + enddo + call set_vud(i1, i2, j1, j2, km, frlake_, frocean_, frseaice_, cmfmc_, qccu_, & + airmass_, delz_, area_, vud_) + call convection(i1, i2, j1, j2, km, n1, n2, icdt, 'sulfur', kin, & + tc_, cmfmc_, dtrain_, area_, delz_, delp_, vud_, & + airmass_, airmol_, tmpu_, ple_, & + bcnv_, h2o2_) + +! Return adjusted tracer to mixing ratio + do n = n1, n2 + do k = 1, km + w_c%qa(n)%data3d(:,:,km-k+1) = tc_(:,:,k,n) + enddo + enddo +! Return adjusted h2o2 + do k = 1, km + gcSU%h2o2_int(:,:,km-k+1) = h2o2_(:,:,k)/rH2O2 + enddo + +! Note GOCART returns bcnv_ as negative, recast for my diagnostic + if(associated(SU_conv(1)%data2d)) SU_conv(1)%data2d = 0.0 + if(associated(SU_conv(2)%data2d)) SU_conv(2)%data2d = -bcnv_(:,:,n1+gcSU%nSO2-1)/area_/icdt + if(associated(SU_conv(3)%data2d)) SU_conv(3)%data2d = -bcnv_(:,:,n1+gcSU%nSO4-1)/area_/icdt + if(associated(SU_conv(4)%data2d)) SU_conv(4)%data2d = -bcnv_(:,:,n1+gcSU%nMSA-1)/area_/icdt + + deallocate(cmfmc_, qccu_, dtrain_, tc_, airmass_, & + delz_, vud_, delp_, airmol_, tmpu_, bcnv_, ple_, & + area_, frlake_, frocean_, frseaice_, h2o2_, __STAT__ ) + +! Update GMI Combo oxidants before exiting. +! Note: H2O2 is the only one modified as of this writing. +! ------------------------------------------------------- + IF(gcSU%using_GMI_H2O2 .AND. gcSU%export_H2O2) & + GMI_H2O2mr(i1:i2,j1:j2,1:km) = gcSU%h2o2_int(i1:i2,j1:j2,1:km) + + end if RUN_ALARM + + +! Compute the desired output diagnostics here +! Ideally this will go where chemout is called in fvgcm.F since that +! will reflect the distributions after transport, etc. +! ----------- + call SU_Compute_Diags(i1, i2, j1, j2, km, nbins, gcSU, w_c, tmpu, rhoa, u, v, & + SU_DMSsfcmass, SU_DMScolmass, & + SU_MSAsfcmass, SU_MSAcolmass, & + SU_SO2sfcmass, SU_SO2colmass, & + SU_SO4sfcmass, SU_SO4colmass, & + SU_exttau, SU_scatau, SU_SO4mass, & + SU_conc, SU_extcoef, SU_scacoef, & + SU_angstrom, SU_fluxu, SU_fluxv, & + SU_sarea, SU_snum, rc) + + + deallocate(xoh, xno3, xh2o2, SU_radius, SU_rhop, stat=STATUS) + VERIFY_(STATUS) + + RETURN + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_ChemDrv - Do SU cycle chemistry following GOCART +! +! !INTERFACE: +! + + subroutine SU_ChemDrv ( i1, i2, j1, j2, km, nbins, cdt, nymd, nhms, gcSU, & + w_c, ustar, u, v, shflux, oro, pblh, tmpu, & + cloud, rhoa, hghte, & + su_dep, & + su_pSO2, su_pMSA, su_pSO4, su_pSO4g, su_pSO4aq, & ! 2d diagnostics + pSO2, pMSA, pSO4, pSO4g, pSO4aq, & ! 3d diagnostics + xoh, xno3, xh2o2, & + rc) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km, nbins, nymd, nhms + real, intent(in) :: cdt + type(SU_GridComp1), intent(inout) :: gcSU ! SU Grid Component + real, pointer, dimension(:,:,:) :: tmpu, cloud, rhoa, u, v, hghte + real, pointer, dimension(:,:) :: ustar, shflux, oro, pblh + real, pointer, dimension(:,:,:) :: xoh, xno3, xh2o2 + +! !OUTPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + type(Chem_Array), intent(inout) :: su_dep(nbins) ! Mass lost by deposition + ! to surface, kg/m2/s +! chemical production terms d(mixing ratio) /s + type(Chem_Array), intent(inout) :: su_pSO2, su_pMSA, su_pSO4, su_pSO4g, su_pSO4aq + type(Chem_Array), intent(inout) :: pSO2, pMSA, pSO4, pSO4g, pSO4aq + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'SU_ChemDrv' + +! !DESCRIPTION: Updates the SU concentration due to chemistry +! The SU grid component is currently established with 4 different +! species (bins) following this convection: +! 1) DMS +! 2) SO2 +! 3) SO4 +! 4) MSA +! Accordingly we have 4 chemical cycles to follow through, which are +! sub-subroutines under this one. +! The chemistry is a function of OH, NO3, and H2O2 concentrations +! as well as DMS, SO2, SO4, MSA concentrations. It is also a function +! of solar zenith angle and temperature. We pass in temperature. SZA +! will be a function of time of day and lat/lon. For now we simply add +! this to the grid component before calculating it. I bet this is +! somewhere else in the model. +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: ndystep, i, j, k, im + real :: pSO2_DMS(i1:i2,j1:j2,1:km), pMSA_DMS(i1:i2,j1:j2,1:km), & + pSO4g_SO2(i1:i2,j1:j2,1:km), pSO4aq_SO2(i1:i2,j1:j2,1:km) + +! Variables used in chemistry step + real :: drydepf(i1:i2,j1:j2) + real :: qmin, qmax + integer :: ijl, ijkl, n1, STATUS + integer :: nDMS, nSO2, nSO4, nMSA + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + n1 = w_c%reg%i_SU + + nDMS = gcSU%nDMS + nSO2 = gcSU%nSO2 + nSO4 = gcSU%nSO4 + nMSA = gcSU%nMSA + +! Reset the production terms + pSO2_DMS(i1:i2,j1:j2,1:km) = 0. + pMSA_DMS(i1:i2,j1:j2,1:km) = 0. + pSO4g_SO2(i1:i2,j1:j2,1:km) = 0. + pSO4aq_SO2(i1:i2,j1:j2,1:km) = 0. + if( associated(su_pSO2%data2d) ) su_pSO2%data2d(i1:i2,j1:j2) = 0. + if( associated(su_pMSA%data2d) ) su_pMSA%data2d(i1:i2,j1:j2) = 0. + if( associated(su_pSO4%data2d) ) su_pSO4%data2d(i1:i2,j1:j2) = 0. + if( associated(su_pSO4g%data2d) ) su_pSO4g%data2d(i1:i2,j1:j2) = 0. + if( associated(su_pSO4aq%data2d) ) su_pSO4aq%data2d(i1:i2,j1:j2) = 0. + if( associated(pSO2%data3d) ) pSO2%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(pMSA%data3d) ) pMSA%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(pSO4%data3d) ) pSO4%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(pSO4g%data3d) ) pSO4g%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(pSO4aq%data3d) ) pSO4aq%data3d(i1:i2,j1:j2,1:km) = 0. + + +! Now call the chemistry packages... +! ---------------------------------- + call SulfateChemDriverGOCART ( i1, i2, j1, j2, km, n1, & + nbins, cdt, nymd, nhms, & + w_c%grid%lon, w_c%grid%lat, & + w_c%qa(n1+nDMS-1)%data3d, & + w_c%qa(n1+nSO2-1)%data3d, & + w_c%qa(n1+nSO4-1)%data3d, & + w_c%qa(n1+nMSA-1)%data3d, & + xoh, xno3, xh2o2, & + u, v, w_c%delp, tmpu, cloud, rhoa, hghte, & + ustar, shflux, oro, pblh, z0h, & + SU_dep, SU_PSO2, SU_PMSA, & + SU_PSO4, SU_PSO4g, SU_PSO4aq, & ! 2d diagnostics + pso2, pmsa, pso4, pso4g, pso4aq, & ! 3d diagnostics + rc) + + +! Save the h2o2 value after chemistry + gcSU%h2o2_int = xh2o2 + +#ifdef DEBUG + if(associated(su_pso2%data2d)) call pmaxmin('SU: su_pso2',su_pso2%data2d,qmin,qmax,ijl,1,1.) + if(associated(su_pmsa%data2d)) call pmaxmin('SU: su_pmsa',su_pmsa%data2d,qmin,qmax,ijl,1,1.) + if(associated(su_pso4g%data2d)) call pmaxmin('SU: su_pso4g',su_pso4g%data2d,qmin,qmax,ijl,1,1.) + if(associated(su_pso4aq%data2d)) call pmaxmin('SU: su_pso4aq',su_pso4aq%data2d,qmin,qmax,ijl,1,1.) + call pmaxmin('SU: pSO4g_SO2', pSO4g_SO2, qmin, qmax, ijl, km, 1. ) + call pmaxmin('SU: pSO4aq_SO2', pSO4aq_SO2, qmin, qmax, ijl, km, 1. ) + call pmaxmin('SU: pSO2_DMS', pSO2_DMS, qmin, qmax, ijl, km, 1. ) + call pmaxmin('SU: pMSA_DMS', pMSA_DMS, qmin, qmax, ijl, km, 1. ) +#endif + + rc = 0 + + end subroutine SU_ChemDrv + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_Wet_Removal - Removal of dust by precipitation +! NOTE: For the removal term, fluxout is the sum of the in-cloud +! convective and large-scale washout and the total flux across +! the surface due to below-cloud (rainout) convective and +! large-scale precipitation reaching the surface. The fluxout +! is initialized to zero at the beginning and then at each i, j +! grid point it is added to. +! See Chin et al. 1996 for some of the logic of this. SO4 and +! MSA are scavenged "normally." DMS is not scavenged at all. +! SO2 is weakly soluble in water, but some fraction can be +! removed because of rapid aqueous phase reaction with H2O2. +! Accordingly, we compare the mixing ratios of H2O2 and SO2 and +! only scavenge that fraction of SO2 that is less than the +! H2O2 mixing ratio. If any of the scavenged SO2 is released +! by re-evaporation is emerges as SO4 +! +! +! !INTERFACE: +! + + subroutine SU_Wet_Removal ( i1, i2, j1, j2, km, nbins, cdt, aero_type, kin, & + ple, rhoa, gcSU, w_c, & + precc, precl, pfllsan, pfilsan, tmpu, & + fluxout, pSO4_colflux, pSO4wet_colflux, & + pso4, pso4wet, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km, nbins + real, intent(in) :: cdt + character(len=*) :: aero_type + logical, intent(in) :: KIN ! true for aerosol + real, pointer, dimension(:,:) :: precc ! total convective precip, [mm day-1] + real, pointer, dimension(:,:) :: precl ! total large-scale prec, [mm day-1] + real, pointer, dimension(:,:,:) :: pfllsan ! + real, pointer, dimension(:,:,:) :: pfilsan ! + real, pointer, dimension(:,:,:) :: tmpu ! temperature, [K] + real, pointer, dimension(:,:,:) :: rhoa ! air density, [kg m-3] + real, pointer, dimension(:,:,:) :: ple ! level edge air pressure + +! !OUTPUT PARAMETERS: + + type(SU_GridComp1), intent(inout) :: gcSU ! SU Grid Component + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + type(Chem_Array), intent(inout) :: fluxout(nbins) ! Mass lost by wet dep + ! to surface, kg/m2/s + type(Chem_Array), intent(inout) :: pSO4_colflux ! total chemical + ! production of SO4 + ! from SO2 + ! (column integrated) + type(Chem_Array), intent(inout) :: pSO4wet_colflux ! aqueous chemical + ! production of SO4 + ! from SO2 + ! (column integrated) + type(Chem_Array), intent(inout) :: pSO4 ! total chemical + ! production of SO4 from SO2 + type(Chem_Array), intent(inout) :: pSO4wet ! aqueous chemical + ! production of SO4 from SO2 + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'SU_Wet_Removal' + +! !DESCRIPTION: Updates the dust concentration in each vertical layer +! due to wet removal +! +! !REVISION HISTORY: +! +! 17Nov2003, Colarco +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k, iit, n, LH, kk, ios + integer :: n1, n2 + real :: pdog(i1:i2,j1:j2,km) ! air mass factor dp/g [kg m-2] + real*8 :: Td_ls, Td_cv ! ls and cv timescales [s] + real*8 :: pls, pcv, pac ! ls, cv, tot precip [mm day-1] + real*8 :: qls(km), qcv(km) ! ls, cv portion of moisture tendency [kg m-3 s-1] + real*8 :: qmx, qd, A ! temporary variables on moisture + real*8 :: F, B, BT ! temporary variables on cloud, freq. + real*8, allocatable :: fd(:,:) ! flux across layers [kg m-2] + real*8, allocatable :: dpfli(:,:,:) ! + real*8, allocatable :: DC(:) ! scavenge change in mass mixing ratio + real :: c_h2o(i1:i2,j1:j2,km), cldliq(i1:i2,j1:j2,km), cldice(i1:i2,j1:j2,km) + real, parameter :: kb = 1.3807e-23 ! Boltzmann constant [kg m2 s-1 K-1 mol-1] + real, parameter :: m_air = 4.8096e-26 ! Mass of air molecule [kg] + +! Rain parameters (from where?) + real, parameter :: B0_ls = 1.0e-4 + real, parameter :: F0_ls = 1.0 + real, parameter :: XL_ls = 5.0e-4 + real, parameter :: B0_cv = 1.5e-3 + real, parameter :: F0_cv = 0.3 + real, parameter :: XL_cv = 2.0e-3 + real, parameter :: one = 1.0, zero = 0.0 + +! Integer locations of SO2, etc. species + integer :: nDMS, nSO2, nSO4, nMSA + +! Conversion of SO2 mmr to SO2 vmr (since H2O2 is carried around like +! a volume mixing ratio) + real*8 :: fmr, SO2Soluble + fMR = airMolWght / gcSU%fMassSO2 + + rc=0 + +! Initialize local variables +! -------------------------- +! c_h2o, cldliq, and cldice are respectively intended to be the +! water mixing ratio (liquid or vapor?, in or out of cloud?) +! cloud liquid water mixing ratio +! cloud ice water mixing ratio + c_h2o = (10d0**(-2663.5d0/tmpu(:,:,:) + 12.537d0 ) ) / & + (ple(:,:,0:km-1)+ple(:,:,1:km)) /2d0 + cldliq = 0.d0 + where(tmpu > 248.) cldliq = 1.d-6 * ( ( tmpu - 248.d0) / 20.d0 ) + where(tmpu >= 268.) cldliq = 1.d-6 + cldice = 1.d-6 - cldliq + + do n = 1, nbins + if( associated(fluxout(n)%data2d) ) fluxout(n)%data2d(i1:i2,j1:j2) = 0.0 + end do + if( associated(pso4wet_colflux%data2d)) pso4wet_colflux%data2d(i1:i2,j1:j2) = 0. + if( associated(pso4wet%data3d) ) pso4wet%data3d(i1:i2,j1:j2,1:km) = 0. + + n1 = w_c%reg%i_SU + n2 = w_c%reg%j_SU + nDMS = gcSU%nDMS + nSO2 = gcSU%nSO2 + nSO4 = gcSU%nSO4 + nMSA = gcSU%nMSA + +! Allocate the dynamic arrays + allocate(fd(km,nbins),stat=ios) + if(ios .ne. 0) stop + allocate(dc(nbins),stat=ios) + if(ios .ne. 0) stop + allocate(dpfli(i1:i2, j1:j2, km),stat=ios) + if(ios .ne. 0) stop + +! Duration of rain: ls = model timestep, cv = 1800 s (<= cdt) + Td_ls = cdt + Td_cv = 1800. + +! Accumulate the 3-dimensional arrays of rhoa and pdog + pdog = w_c%delp/grav + dpfli = pfllsan(:,:,1:km)-pfllsan(:,:,0:km-1)+pfilsan(:,:,1:km)-pfilsan(:,:,0:km-1) + +! Loop over spatial indices + do j = j1, j2 + do i = i1, i2 + +! Check for total precipitation amount +! Assume no precip in column if precl+precc = 0 + pac = precl(i,j) + precc(i,j) + if(pac .le. 0.) goto 100 + pls = precl(i,j) + pcv = precc(i,j) + +! Initialize the precipitation fields + qls(:) = 0. + qcv(:) = 0. + fd(:,:) = 0. + Dc(:) = 0. + +! Find the highest model layer experiencing rainout. Assumes no +! scavenging if T < 258 K + LH = 0 + do k = 1, km + if(dpfli(i,j,k) .gt. 0. .and. tmpu(i,j,k) .gt. 258.) then + LH = k + goto 15 + endif + end do + 15 continue + if(LH .lt. 1) goto 100 + + do k = LH, km + qls(k) = dpfli(i,j,k)/pdog(i,j,k)*rhoa(i,j,k) + end do + +! Loop over vertical to do the scavenging! + do k = LH, km + +!----------------------------------------------------------------------------- +! (1) LARGE-SCALE RAINOUT: +! Tracer loss by rainout = TC0 * F * exp(-B*dt) +! where B = precipitation frequency, +! F = fraction of grid box covered by precipitating clouds. +! We assume that tracer scavenged by rain is falling down to the +! next level, where a fraction could be re-evaporated to gas phase +! if Qls is less then 0 in that level. +!----------------------------------------------------------------------------- + if (qls(k) .gt. 0.) then + F = F0_ls / (1. + F0_ls*B0_ls*XL_ls/(qls(k)*cdt/Td_ls)) + B = B0_ls/F0_ls +1./(F0_ls*XL_ls/qls(k)) + BT = B * Td_ls + if (BT.gt.10.) BT = 10. !< Avoid overflow > +! What is the soluble amount of SO2? + SO2Soluble = min(fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k),gcSU%h2o2_int(i,j,k)*one)/fmr + if(SO2Soluble .lt. 0.) SO2Soluble = 0. + +! Adjust SU amounts + DC(nDMS) = 0. + DC(nSO2) = SO2Soluble * F * (1.-exp(-BT)) + DC(nSO4) = w_c%qa(n1+nSO4-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + DC(nMSA) = w_c%qa(n1+nMSA-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + +! Adjust H2O2 concentration in cloudy portion of cell + if(fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k) .gt. gcSU%h2o2_int(i,j,k)) then +! gcSU%h2o2_int(i,j,k) = max(zero,(1.-F)*gcSU%h2o2_int(i,j,k)) +! GOCART removes all + gcSU%h2o2_int(i,j,k) = 0. + else + gcSU%h2o2_int(i,j,k) & + = gcSU%h2o2_int(i,j,k) - F*fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k) + endif + + do n = 1, nbins + if (DC(n).lt.0.) DC(n) = 0. + w_c%qa(n1+n-1)%data3d(i,j,k) = w_c%qa(n1+n-1)%data3d(i,j,k)-DC(n) + if (w_c%qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) w_c%qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + end do + +! Flux down: unit is kg m-2 +! Formulated in terms of production in the layer. In the revaporation step +! we consider possibly adding flux from above... + do n = 1, nbins + Fd(k,n) = DC(n) * pdog(i,j,k) + end do + + end if ! if Qls > 0 >>> + +!----------------------------------------------------------------------------- +! * (2) LARGE-SCALE WASHOUT: +! * Occurs when rain at this level is less than above. +!----------------------------------------------------------------------------- + if(k .gt. LH .and. qls(k) .ge. 0.) then + if(qls(k) .lt. qls(k-1)) then +! Find a maximum F overhead until the level where Qls<0. + Qmx = 0. + do kk = k-1,LH,-1 + if (Qls(kk).gt.0.) then + Qmx = max(Qmx,Qls(kk)) + else + goto 333 + end if + end do + + 333 continue + F = F0_ls / (1. + F0_ls*B0_ls*XL_ls/(Qmx*cdt/Td_ls)) + if (F.lt.0.01) F = 0.01 +!----------------------------------------------------------------------------- +! The following is to convert Q(k) from kgH2O/m3/sec to mm/sec in order +! to use the Harvard formula. Convert back to mixing ratio by multiplying +! by rhoa. Multiply by pdog gives kg/m2/s of precip. Divide by density +! of water (=1000 kg/m3) gives m/s of precip and multiply by 1000 gives +! units of mm/s (omit the multiply and divide by 1000). +!----------------------------------------------------------------------------- + + Qd = Qmx /rhoa(i,j,k)*pdog(i,j,k) + if (Qd.ge.50.) then + B = 0. + else + B = Qd * 0.1 + end if + BT = B * cdt + if (BT.gt.10.) BT = 10. + +! Adjust SO2 for H2O2 oxidation + SO2Soluble = min(fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k),gcSU%h2o2_int(i,j,k)*one)/fmr + if(SO2Soluble .lt. 0.) SO2Soluble = 0. + +! Adjust SU amounts + DC(nDMS) = 0. + DC(nSO2) = SO2Soluble * F * (1.-exp(-BT)) + DC(nSO4) = w_c%qa(n1+nSO4-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + DC(nMSA) = w_c%qa(n1+nMSA-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + +! Adjust H2O2 concentration in cloudy portion of cell + if(fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k) .gt. gcSU%h2o2_int(i,j,k)) then + gcSU%h2o2_int(i,j,k) = max(zero,(one-F)*gcSU%h2o2_int(i,j,k)) +! GOCART removes all +! gcSU%h2o2_int(i,j,k) = 0. + else + gcSU%h2o2_int(i,j,k) & + = gcSU%h2o2_int(i,j,k) - F*fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k) + endif + + do n = 1, nbins + if (DC(n).lt.0.) DC(n) = 0. + w_c%qa(n1+n-1)%data3d(i,j,k) = w_c%qa(n1+n-1)%data3d(i,j,k)-DC(n) + if (w_c%qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) w_c%qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + end do + + do n = 1, nbins + if( associated(fluxout(n)%data2d) ) then + fluxout(n)%data2d(i,j) = fluxout(n)%data2d(i,j)+DC(n)*pdog(i,j,k)/cdt + endif + end do + + end if + end if ! if ls washout >>> + +!----------------------------------------------------------------------------- +! (3) CONVECTIVE RAINOUT: +! Tracer loss by rainout = dd0 * F * exp(-B*dt) +! where B = precipitation frequency, +! F = fraction of grid box covered by precipitating clouds. +!----------------------------------------------------------------------------- + + if (qcv(k) .gt. 0.) then + F = F0_cv / (1. + F0_cv*B0_cv*XL_cv/(Qcv(k)*cdt/Td_cv)) + B = B0_cv + BT = B * Td_cv + if (BT.gt.10.) BT = 10. !< Avoid overflow > + +! Adjust SO2 for H2O2 oxidation + SO2Soluble = min(fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k),gcSU%h2o2_int(i,j,k)*one)/fmr + if(SO2Soluble .lt. 0.) SO2Soluble = 0. + +! Adjust SU amounts + DC(nDMS) = 0. + DC(nSO2) = SO2Soluble * F * (1.-exp(-BT)) + DC(nSO4) = w_c%qa(n1+nSO4-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + DC(nMSA) = w_c%qa(n1+nMSA-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + DC(nSO4) = 0. + DC(nMSA) = 0. + +! Adjust H2O2 concentration in cloudy portion of cell + if(fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k) .gt. gcSU%h2o2_int(i,j,k)) then + gcSU%h2o2_int(i,j,k) = max(zero,(one-F)*gcSU%h2o2_int(i,j,k)) + else + gcSU%h2o2_int(i,j,k) & + = gcSU%h2o2_int(i,j,k) - F*fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k) + endif + + do n = 1, nbins + if (DC(n).lt.0.) DC(n) = 0. + w_c%qa(n1+n-1)%data3d(i,j,k) = w_c%qa(n1+n-1)%data3d(i,j,k)-DC(n) + if (w_c%qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) w_c%qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + end do + +! Flux down: unit is kg m-2 +! Formulated in terms of production in the layer. In the revaporation step +! we consider possibly adding flux from above... + do n = 1, nbins + Fd(k,n) = Fd(k,n) + DC(n)*pdog(i,j,k) + end do + + end if ! if Qcv > 0 >>> + +!----------------------------------------------------------------------------- +! (4) CONVECTIVE WASHOUT: +! Occurs when rain at this level is less than above. +!----------------------------------------------------------------------------- + + if (k.gt.LH .and. Qcv(k).ge.0.) then + if (Qcv(k).lt.Qcv(k-1)) then +!----- Find a maximum F overhead until the level where Qls<0. + Qmx = 0. + do kk = k-1, LH, -1 + if (Qcv(kk).gt.0.) then + Qmx = max(Qmx,Qcv(kk)) + else + goto 444 + end if + end do + + 444 continue + F = F0_cv / (1. + F0_cv*B0_cv*XL_cv/(Qmx*cdt/Td_cv)) + if (F.lt.0.01) F = 0.01 +!----------------------------------------------------------------------------- +! The following is to convert Q(k) from kgH2O/m3/sec to mm/sec in order +! to use the Harvard formula. Convert back to mixing ratio by multiplying +! by rhoa. Multiply by pdog gives kg/m2/s of precip. Divide by density +! of water (=1000 kg/m3) gives m/s of precip and multiply by 1000 gives +! units of mm/s (omit the multiply and divide by 1000). +!----------------------------------------------------------------------------- + + Qd = Qmx / rhoa(i,j,k)*pdog(i,j,k) + if (Qd.ge.50.) then + B = 0. + else + B = Qd * 0.1 + end if + BT = B * cdt + if (BT.gt.10.) BT = 10. + +! Adjust SO2 for H2O2 oxidation + SO2Soluble = min(fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k),gcSU%h2o2_int(i,j,k)*one)/fmr + if(SO2Soluble .lt. 0.) SO2Soluble = 0. + +! Adjust SU amounts + DC(nDMS) = 0. + DC(nSO2) = SO2Soluble * F * (1.-exp(-BT)) +! Sulfate scavenged in moist +! DC(nSO4) = w_c%qa(n1+nSO4-1)%data3d(i,j,k) * F * (1.-exp(-BT)) +! DC(nMSA) = w_c%qa(n1+nMSA-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + DC(nSO4) = 0. + DC(nMSA) = 0. + +! Adjust H2O2 concentration in cloudy portion of cell + if(fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k) .gt. gcSU%h2o2_int(i,j,k)) then + gcSU%h2o2_int(i,j,k) = max(zero,(one-F)*gcSU%h2o2_int(i,j,k)) + else + gcSU%h2o2_int(i,j,k) & + = gcSU%h2o2_int(i,j,k) - F*fmr*w_c%qa(n1+nSO2-1)%data3d(i,j,k) + endif + + do n = 1, nbins + if (DC(n).lt.0.) DC(n) = 0. + w_c%qa(n1+n-1)%data3d(i,j,k) = w_c%qa(n1+n-1)%data3d(i,j,k)-DC(n) + if (w_c%qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) w_c%qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + end do + + do n = 1, nbins + if( associated(fluxout(n)%data2d) ) then + fluxout(n)%data2d(i,j) = fluxout(n)%data2d(i,j)+DC(n)*pdog(i,j,k)/cdt + endif + end do + + end if + end if ! if cv washout >>> + +!----------------------------------------------------------------------------- +! (5) RE-EVAPORATION. Assume that SO2 is re-evaporated as SO4 since it +! has been oxidized by H2O2 at the level above. +!----------------------------------------------------------------------------- +! Add in the flux from above, which will be subtracted if reevaporation occurs + if(k .gt. LH) then + do n = 1, nbins + Fd(k,n) = Fd(k,n) + Fd(k-1,n) + end do + +! Is there evaporation in the currect layer? + if (dpfli(i,j,k) .lt. 0.) then +! Fraction evaporated = H2O(k)evap / H2O(next condensation level). + if (dpfli(i,j,k-1) .gt. 0.) then + + A = abs( dpfli(i,j,k) / dpfli(i,j,k-1) ) + if (A .gt. 1.) A = 1. + +! Adjust tracer in the level +! For the SO2 tracer we do not allow re-evaporation. +! We compute DC(nSO2) solely to add this to DC(nSO4) and to remove +! from Fd(k,nSO2) +! Instead, the SO2 gets re-evaporated to the SO4 bin because of +! previous H2O2 oxidation + + DC(nDMS) = 0. + DC(nSO2) = Fd(k-1,nSO2) / pdog(i,j,k) * A + DC(nSO4) = Fd(k-1,nSO4) / pdog(i,j,k) * A + DC(nMSA) = Fd(k-1,nMSA) / pdog(i,j,k) * A + do n = 1, nbins + if (DC(n).lt.0.) DC(n) = 0. + end do + + w_c%qa(n1+nMSA-1)%data3d(i,j,k) = w_c%qa(n1+nMSA-1)%data3d(i,j,k) + DC(nMSA) + +! SO2 gets added to SO4, but remember to remove the SO2 from FD! + w_c%qa(n1+nSO4-1)%data3d(i,j,k) = w_c%qa(n1+nSO4-1)%data3d(i,j,k) + DC(nSO4) & + + DC(nSO2)*gcSU%fMassSO4/gcSU%fMassSO2 + if( associated(pso4wet_colflux%data2d)) & + pso4wet_colflux%data2d(i,j) = pso4wet_colflux%data2d(i,j) & + + DC(nSO2)*gcSU%fMassSO4/gcSU%fMassSO2 / cdt * w_c%delp(i,j,k)/grav + if( associated(pso4wet%data3d) ) & + pso4wet%data3d(i,j,k) = DC(nSO2)*gcSU%fMassSO4/gcSU%fMassSO2 / cdt + + if( associated(pso4_colflux%data2d)) & + pso4_colflux%data2d(i,j) = pso4_colflux%data2d(i,j) & + + DC(nSO2)*gcSU%fMassSO4/gcSU%fMassSO2 / cdt * w_c%delp(i,j,k)/grav + if( associated(pso4%data3d) ) & + pso4%data3d(i,j,k) = pso4%data3d(i,j,k) + DC(nSO2)*gcSU%fMassSO4/gcSU%fMassSO2 / cdt + +! Adjust the flux out of the bottom of the layer--remove SO2 here! + do n = 1, nbins + w_c%qa(n1+n-1)%data3d(i,j,k) = & + max(w_c%qa(n1+n-1)%data3d(i,j,k),tiny(1.0)) + Fd(k,n) = Fd(k,n) - DC(n)*pdog(i,j,k) + end do + + endif + endif ! if -moistq < 0 + endif + end do ! k + + do n = 1, nbins + if( associated(fluxout(n)%data2d) ) then + fluxout(n)%data2d(i,j) = fluxout(n)%data2d(i,j)+Fd(km,n)/cdt + endif + end do + + 100 continue + end do ! i + end do ! j + + deallocate(fd,DC,dpfli,stat=ios) + + end subroutine SU_Wet_Removal + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_Compute_Diags - Calculate dust 2D diagnostics +! +! !INTERFACE: +! + + subroutine SU_Compute_Diags ( i1, i2, j1, j2, km, nbins, gcSU, w_c, tmpu, rhoa, u, v, & + dmssfcmass, dmscolmass, & + msasfcmass, msacolmass, & + so2sfcmass, so2colmass, & + so4sfcmass, so4colmass, & + exttau, scatau, so4mass, so4conc, extcoef, & + scacoef, angstrom, fluxu, fluxv, sarea, snum, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2, km, nbins + type(SU_GridComp1), intent(inout):: gcSU ! SU Grid Component + type(Chem_Bundle), intent(in) :: w_c + real, pointer, dimension(:,:,:) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:,:) :: u ! east-west wind [m s-1] + real, pointer, dimension(:,:,:) :: v ! north-south wind [m s-1] + +! !OUTPUT PARAMETERS: + type(Chem_Array), intent(inout) :: dmssfcmass ! sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: dmscolmass ! col mass density kg/m2 + type(Chem_Array), intent(inout) :: msasfcmass ! sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: msacolmass ! col mass density kg/m2 + type(Chem_Array), intent(inout) :: so2sfcmass ! sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: so2colmass ! col mass density kg/m2 + type(Chem_Array), intent(inout) :: so4sfcmass ! sfc mass concentration kg/m3 + type(Chem_Array), intent(inout) :: so4colmass ! col mass density kg/m2 + type(Chem_Array), intent(inout) :: exttau ! ext. AOT at 550 nm + type(Chem_Array), intent(inout) :: scatau ! sct. AOT at 550 nm + type(Chem_Array), intent(inout) :: so4mass ! 3D sulfate mass mr + type(Chem_Array), intent(inout) :: so4conc ! 3D mass concentration, kg/m3 + type(Chem_Array), intent(inout) :: extcoef ! 3D ext. coefficient, 1/m + type(Chem_Array), intent(inout) :: scacoef ! 3D scat.coefficient, 1/m + type(Chem_Array), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter + type(Chem_Array), intent(inout) :: fluxu ! Column mass flux in x direction + type(Chem_Array), intent(inout) :: fluxv ! Column mass flux in y direction + type(Chem_Array), intent(inout) :: sarea ! Sulfate surface area density [m2 m-3] + type(Chem_Array), intent(inout) :: snum ! Sulfate number density [# m-2] + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Calculates some simple 2d diagnostics from the SU fields +! NOTE: For now this operates solely on the sulfate bin!!!! +! Surface concentration (dry) +! Column mass load (dry) +! Extinction aot 550 (wet) +! Scattering aot 550 (wet) +! For the moment, this is hardwired. +! +! !REVISION HISTORY: +! +! 16APR2004, Colarco +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + character(len=*), parameter :: myname = 'SU_Compute_Diags' + integer :: i, j, k, n, n1, n2, nSO4, nSO2, nDMS, nMSA, ios, nch, idx + real :: tau, ssa + character(len=255) :: qname + real, dimension(i1:i2,j1:j2) :: tau470, tau870 + real :: ilam550, ilam470, ilam870 + logical :: do_angstrom + real :: rh, gf, rwet, rmed, sigma, svol + + +! Initialize local variables +! -------------------------- + n1 = w_c%reg%i_SU + n2 = w_c%reg%j_SU + nch = gcSU%mie_tables%nch + nSO4 = gcSU%nSO4 + nSO2 = gcSU%nSO2 + nDMS = gcSU%nDMS + nMSA = gcSU%nMSA + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + ilam470 = 0. + ilam870 = 0. + if(nch .gt. 1) then + do i = 1, nch + if ( gcSU%mie_tables%channels(i) .ge. 5.49e-7 .and. & + gcSU%mie_tables%channels(i) .le. 5.51e-7) ilam550 = i + if ( gcSU%mie_tables%channels(i) .ge. 4.69e-7 .and. & + gcSU%mie_tables%channels(i) .le. 4.71e-7) ilam470 = i + if ( gcSU%mie_tables%channels(i) .ge. 8.69e-7 .and. & + gcSU%mie_tables%channels(i) .le. 8.71e-7) ilam870 = i + enddo + endif + +! Determine if going to do Angstrom parameter calculation +! ------------------------------------------------------- + do_angstrom = .false. +! If both 470 and 870 channels provided (and not the same) then +! possibly will do Angstrom parameter calculation + if(ilam470 .ne. 0. .and. & + ilam870 .ne. 0. .and. & + ilam470 .ne. ilam870) do_angstrom = .true. + + +! Calculate the diagnostic variables if requested +! ----------------------------------------------- + +! Calculate the surface mass concentration + if( associated(so4sfcmass%data2d) ) then + so4sfcmass%data2d(i1:i2,j1:j2) = 0. + so4sfcmass%data2d(i1:i2,j1:j2) & + = w_c%qa(nSO4+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + endif + if( associated(so2sfcmass%data2d) ) then + so2sfcmass%data2d(i1:i2,j1:j2) = 0. + so2sfcmass%data2d(i1:i2,j1:j2) & + = w_c%qa(nSO2+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + endif + if( associated(dmssfcmass%data2d) ) then + dmssfcmass%data2d(i1:i2,j1:j2) = 0. + dmssfcmass%data2d(i1:i2,j1:j2) & + = w_c%qa(nDMS+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + endif + if( associated(msasfcmass%data2d) ) then + msasfcmass%data2d(i1:i2,j1:j2) = 0. + msasfcmass%data2d(i1:i2,j1:j2) & + = w_c%qa(nMSA+n1-1)%data3d(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + endif + + +! Initialize the diagnostic variables +! ----------------------------------- + +! Calculate the column loading + if( associated(so4colmass%data2d) ) then + so4colmass%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + so4colmass%data2d(i1:i2,j1:j2) & + = so4colmass%data2d(i1:i2,j1:j2) & + + w_c%qa(nSO4+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + enddo + endif + if( associated(so2colmass%data2d) ) then + so2colmass%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + so2colmass%data2d(i1:i2,j1:j2) & + = so2colmass%data2d(i1:i2,j1:j2) & + + w_c%qa(nSO2+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + enddo + endif + if( associated(dmscolmass%data2d) ) then + dmscolmass%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + dmscolmass%data2d(i1:i2,j1:j2) & + = dmscolmass%data2d(i1:i2,j1:j2) & + + w_c%qa(nDMS+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + enddo + endif + if( associated(msacolmass%data2d) ) then + msacolmass%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + msacolmass%data2d(i1:i2,j1:j2) & + = msacolmass%data2d(i1:i2,j1:j2) & + + w_c%qa(nMSA+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav + enddo + endif + + +! Calculate the mass concentration of sulfate + if( associated(so4conc%data3d) ) then + so4conc%data3d(i1:i2,j1:j2,1:km) = 0. + so4conc%data3d(i1:i2,j1:j2,1:km) = w_c%qa(nSO4+n1-1)%data3d(i1:i2,j1:j2,1:km)*rhoa(i1:i2,j1:j2,1:km) + endif + +! Mass mixing ratio of sulfate + if( associated(so4mass%data3d) ) then + so4mass%data3d(i1:i2,j1:j2,1:km) = 0. + so4mass%data3d(i1:i2,j1:j2,1:km) = w_c%qa(nSO4+n1-1)%data3d(i1:i2,j1:j2,1:km) + endif + +! Calculate the column mass flux in x direction + if( associated(fluxu%data2d) ) then + fluxu%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + fluxu%data2d(i1:i2,j1:j2) & + = fluxu%data2d(i1:i2,j1:j2) & + + w_c%qa(nSO4+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*u(i1:i2,j1:j2,k) + end do + endif + +! Calculate the column mass flux in y direction + if( associated(fluxv%data2d) ) then + fluxv%data2d(i1:i2,j1:j2) = 0. + do k = 1, km + fluxv%data2d(i1:i2,j1:j2) & + = fluxv%data2d(i1:i2,j1:j2) & + + w_c%qa(nSO4+n1-1)%data3d(i1:i2,j1:j2,k)*w_c%delp(i1:i2,j1:j2,k)/grav*v(i1:i2,j1:j2,k) + end do + endif + +! Calculate the extinction and/or scattering AOD + if( associated(exttau%data2d) .or. associated(scatau%data2d) ) then + + if( associated(exttau%data2d) ) then + exttau%data2d(i1:i2,j1:j2) = 0. + endif + if( associated(scatau%data2d) ) then + scatau%data2d(i1:i2,j1:j2) = 0. + endif + + if( associated(extcoef%data3d) ) then + extcoef%data3d(i1:i2,j1:j2,1:km) = 0. + endif + if( associated(scacoef%data3d) ) then + scacoef%data3d(i1:i2,j1:j2,1:km) = 0. + endif + +! Note the binning is different for SO4 + do n = nSO4, nSO4 + +! Select the name for species + qname = trim(w_c%reg%vname(w_c%reg%i_SU+n-1)) + idx = Chem_MieQueryIdx(gcSU%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(gcSU%mie_tables, idx, ilam550, & + w_c%qa(n1+n-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau, ssa=ssa) + +! Calculate the total ext. and scat. coefficients + if( associated(extcoef%data3d) ) then + extcoef%data3d(i,j,k) = extcoef%data3d(i,j,k) + & + tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + if( associated(scacoef%data3d) ) then + scacoef%data3d(i,j,k) = scacoef%data3d(i,j,k) + & + ssa * tau * (grav * rhoa(i,j,k) / w_c%delp(i,j,k)) + endif + +! Integrate in the vertical + if( associated(exttau%data2d) ) then + exttau%data2d(i,j) = exttau%data2d(i,j) + tau + endif + if( associated(scatau%data2d) ) then + scatau%data2d(i,j) = scatau%data2d(i,j) + tau*ssa + endif + + enddo + enddo + enddo + + enddo ! nbins + + endif + + +! Calculate the 470-870 Angstrom parameter + if( associated(angstrom%data2d) .and. do_angstrom ) then + + angstrom%data2d(i1:i2,j1:j2) = 0. +! Set tau to small number by default + tau470(i1:i2,j1:j2) = tiny(1.0) + tau870(i1:i2,j1:j2) = tiny(1.0) + + do n = nSO4, nSO4 + +! Select the name for species + qname = trim(w_c%reg%vname(n+n1-1)) + idx = Chem_MieQueryIdx(gcSU%mie_tables,qname,rc) + if(rc .ne. 0) call die(myname, 'cannot find proper Mie table index') + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + + call Chem_MieQuery(gcSU%mie_tables, idx, ilam470, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau470(i,j) = tau470(i,j) + tau + + call Chem_MieQuery(gcSU%mie_tables, idx, ilam870, & + w_c%qa(n+n1-1)%data3d(i,j,k)*w_c%delp(i,j,k)/grav, & + w_c%rh(i,j,k), tau=tau) + tau870(i,j) = tau870(i,j) + tau + + enddo + enddo + enddo + + enddo ! nbins + angstrom%data2d(i1:i2,j1:j2) = & + -log(tau470(i1:i2,j1:j2)/tau870(i1:i2,j1:j2)) / & + log(470./870.) + endif + +! Calculate the sulfate surface area density [m2 m-3], possibly for use in +! StratChem or other component. Assumption here is a specified effective +! radius (gcSU%radius for sulfate) and standard deviation of lognormal +! distribution. Hydration is by grid box provided RH and is follows Petters +! and Kreeidenweis (ACP2007) + if(associated(sarea%data3d) .or. associated(snum%data3d)) then + rmed = w_c%reg%rmed(n1+nSO4-1) ! median radius, m + if(rmed > 0.) then + sigma = w_c%reg%sigma(n1+nSO4-1) ! width of lognormal distribution + do k = 1, km + do j = j1, j2 + do i = i1, i2 + rh = min(0.95,w_c%rh(i,j,k)) + gf = (1. + 1.19*rh/(1.-rh) ) ! ratio of wet/dry volume, eq. 5 + rwet = rmed * gf**(1./3.) ! wet effective radius, m +! Wet particle volume m3 m-3 + svol = w_c%qa(n1+nSO4-1)%data3d(i,j,k) * rhoa(i,j,k) / gcSU%rhop(nSO4) * gf +! Integral of lognormal surface area m2 m-3 + if(associated(sarea%data3d)) sarea%data3d(i,j,k) = 3./rwet*svol*exp(-5./2.*alog(sigma)**2.) +! Integral of lognormal number density # m-3 + if(associated(snum%data3d)) snum%data3d(i,j,k) = svol / (rwet**3) * exp(-9/2.*alog(sigma)**2.) * 3./4./pi + enddo + enddo + enddo + endif + endif + + rc = 0 + + end subroutine SU_Compute_Diags + + end subroutine SU_GridCompRun2_ + + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_GridCompFinalize --- The Chem Driver +! +! !INTERFACE: +! + + subroutine SU_GridCompFinalize1_ ( gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(SU_GridComp1), intent(inout) :: gcSU ! Grid Component + +! !INPUT PARAMETERS: + + type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + integer, intent(in) :: nymd, nhms ! time + real, intent(in) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: impChem ! Import State + type(ESMF_State), intent(inout) :: expChem ! Import State + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine finalizes this Grid Component. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + integer :: ios + character(len=*), parameter :: myname = 'SU_GridCompFinalize1_' + +! If initialized volcanic emissions from daily tables, clean-up + if (associated(gcSU%vLat)) deallocate(gcSU%vLat, stat=ios) + if (associated(gcSU%vLon)) deallocate(gcSU%vLon, stat=ios) + if (associated(gcSU%vSO2)) deallocate(gcSU%vSO2, stat=ios) + if (associated(gcSU%vElev)) deallocate(gcSU%vElev, stat=ios) + if (associated(gcSU%vCloud)) deallocate(gcSU%vCloud, stat=ios) + if (associated(gcSU%vStart)) deallocate(gcSU%vStart, stat=ios) + if (associated(gcSU%vEnd)) deallocate(gcSU%vEnd, stat=ios) + rc=0 + return + + end subroutine SU_GridCompFinalize1_ + + end module SU_GridCompMod + +!----------------------------------------------------------------------- + +! Single Instance Wrapper + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_SingleInstance_ --- Runs single instance of method +! +! !INTERFACE: +! + subroutine SU_SingleInstance_ ( Method_, instance, & + gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! !USES: + + Use SU_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + + IMPLICIT NONE + +! !INPUT PARAMETERS: + +! Input "function pointer" +! ----------------------- + interface + subroutine Method_ (gc, w, imp, exp, ymd, hms, dt, rcode ) + Use SU_GridCompMod + Use ESMF + Use MAPL + Use Chem_Mod + type(SU_GridComp1), intent(inout) :: gc + type(Chem_Bundle), intent(in) :: w + type(ESMF_State), intent(inout) :: imp + type(ESMF_State), intent(inout) :: exp + integer, intent(in) :: ymd, hms + real, intent(in) :: dt + integer, intent(out) :: rcode + end subroutine Method_ + end interface + + integer, intent(in) :: instance ! instance number + + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + INTEGER, INTENT(IN) :: nymd, nhms ! time + REAL, INTENT(IN) :: cdt ! chemical timestep (secs) + + +! !OUTPUT PARAMETERS: + + TYPE(SU_GridComp1), INTENT(INOUT) :: gcSU ! Grid Component + TYPE(ESMF_State), INTENT(INOUT) :: impChem ! Import State + TYPE(ESMF_State), INTENT(INOUT) :: expChem ! Export State + INTEGER, INTENT(OUT) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Finalizes the CO Grid Component. Multiple instance +! version. +! +! !REVISION HISTORY: +! +! 27Feb2008 da Silva Introduced multiple instances +! +!EOP +!------------------------------------------------------------------------- + + integer n_SU, i_SU, j_SU + character(len=255) :: dmsname, so2name, so4name, msaname + +! Save overall CO indices +! ----------------------- + n_SU = w_c%reg%n_SU + i_SU = w_c%reg%i_SU + j_SU = w_c%reg%j_SU + +! Save the name of the variables in this instance +! ----------------------------------------------- + dmsname = trim(w_c%reg%vname(i_SU + 4*(instance - 1))) + so2name = trim(w_c%reg%vname(i_SU + 4*(instance - 1) + 1)) + so4name = trim(w_c%reg%vname(i_SU + 4*(instance - 1) + 2)) + msaname = trim(w_c%reg%vname(i_SU + 4*(instance - 1) + 3)) + +! Customize indices for this particular instance +! ---------------------------------------------- + w_c%reg%n_SU = 4 + w_c%reg%i_SU = i_SU + 4*(instance - 1) + w_c%reg%j_SU = i_SU + 4*(instance - 1) + 3 + +! Update names to "full" version names iff so4name != 'SO4v' + if(trim(so4name) .ne. 'SO4v') then + w_c%reg%vname(i_SU + 4*(instance - 1)) = w_c%reg%vname(i_SU) + w_c%reg%vname(i_SU + 4*(instance - 1) + 1) = w_c%reg%vname(i_SU + 1) + w_c%reg%vname(i_SU + 4*(instance - 1) + 2) = w_c%reg%vname(i_SU + 2) + w_c%reg%vname(i_SU + 4*(instance - 1) + 3) = w_c%reg%vname(i_SU + 3) + endif + + +! Execute the instance method +! --------------------------- + call Method_ ( gcSU, w_c, impChem, expChem, & + nymd, nhms, cdt, rc ) + +! Restore the overall SU indices +! ------------------------------ + w_c%reg%vname(i_SU + 4*(instance - 1)) = dmsname + w_c%reg%vname(i_SU + 4*(instance - 1) + 1) = so2name + w_c%reg%vname(i_SU + 4*(instance - 1) + 2) = so4name + w_c%reg%vname(i_SU + 4*(instance - 1) + 3) = msaname + w_c%reg%n_SU = n_SU + w_c%reg%i_SU = i_SU + w_c%reg%j_SU = j_SU + + end subroutine SU_SingleInstance_ + +!----------------------------------------------------------------------- diff --git a/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp_ExtData.rc b/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp_ExtData.rc new file mode 100644 index 00000000..f91d75a0 --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/SU_GridComp_ExtData.rc @@ -0,0 +1,39 @@ +PrimaryExports%% +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | +# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | +# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| +# Biomass burning -- QFED-v2.x +SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none none biomass ExtData/PIESA/sfc/QFED/NRT/v2.5r1_0.1_deg/Y%y4/M%m2/qfed2.emis_so2.006.%y4%m2%d2.nc4 + +# Anthropogenic (BF & FF) emissions -- allowed to input as two layers +SU_ANTHROL1 NA Y Y %y4-%m2-%d2t12:00:00 none none sanl1 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.surface.x3600_y1800_t12.2010.nc4 +SU_ANTHROL2 NA Y Y %y4-%m2-%d2t12:00:00 none none sanl2 ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.elevated.x3600_y1800_t12.2010.nc4 + +# Ship emissions +SU_SHIPSO2 NA Y Y %y4-%m2-%d2t12:00:00 none none so2_ship ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.ships.x3600_y1800_t12.2010.nc4 +SU_SHIPSO4 NA Y Y %y4-%m2-%d2t12:00:00 none none so4_ship ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so4.ships.x3600_y1800_t12.2010.nc4 + +# Aircraft fuel consumption +SU_AIRCRAFT NA Y Y %y4-%m2-%d2t12:00:00 none none none /dev/null + +# DMS concentration +SU_DMSO NA Y Y %y4-%m2-%d2t12:00:00 none none conc ExtData/MERRA2/sfc/DMSclim_sfcconcentration.x360_y181_t12.Lana2011.nc4 + + +# H2O2, OH and NO3 mixing ratios +SU_H2O2 NA N Y %y4-%m2-%d2t12:00:00 none none h2o2 ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc +SU_OH NA N Y %y4-%m2-%d2t12:00:00 none none oh ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc +SU_NO3 NA N Y %y4-%m2-%d2t12:00:00 none none no3 ExtData/PIESA/L72/A2_ACCMIP_gmic_MERRA_oh_h2o2_no3.x144_y91_z72_t14.%y4.nc + +# Aviation emissions during the three phases of flight +SU_AVIATION_LTO NA Y Y %y4-%m2-%d2t12:00:00 none none so2_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.aviation_lto.x3600_y1800_t12.2010.nc4 +SU_AVIATION_CDS NA Y Y %y4-%m2-%d2t12:00:00 none none so2_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.aviation_cds.x3600_y1800_t12.2010.nc4 +SU_AVIATION_CRS NA Y Y %y4-%m2-%d2t12:00:00 none none so2_aviation ExtData/PIESA/sfc/HTAP/v2.2/htap-v2.2.emis_so2.aviation_crs.x3600_y1800_t12.2010.nc4 + +# Production of SO2 from OCS oxidation +pSO2_OCS NA Y Y %y4-%m2-%d2t12:00:00 none none biofuel /dev/null + +SU_regionMask NA N v - none none REGION_MASK ExtData/PIESA/sfc/ARCTAS.region_mask.x540_y361.2008.nc +%% + diff --git a/ESMF/GOCART_GridComp/SU_GridComp/SU_Registry.rc b/ESMF/GOCART_GridComp/SU_GridComp/SU_Registry.rc new file mode 100644 index 00000000..9e276ffc --- /dev/null +++ b/ESMF/GOCART_GridComp/SU_GridComp/SU_Registry.rc @@ -0,0 +1,252 @@ +# +# This the GOCART Grid Component Registry. It defines Import, +# Internal and Export states for this component as well as +# any +# +# !REVISION HISTORY: +# 16Aug2006 da Silva First Version +# +# ----------------------------------------------------------------- + + COMP_NAME: SU + +# Only change the Registry version when major structural changes +# occurs, not changes in content +# -------------------------------------------------------------- + GEOS_REGISTRY_VERSION: 1.00 + + +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- +# Short | | | V |Item|Intervl|# Sub| Long +# Name | Units | Dim |Loc|Type| R | A |Tiles| Name +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + SUEM001 | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 001 __ENSEMBLE__ + SUEM002 | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 002 __ENSEMBLE__ + SUEM003 | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 003 __ENSEMBLE__ + SUEM004 | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 004 __ENSEMBLE__ + SUDP001 | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 001 __ENSEMBLE__ + SUDP002 | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 002 __ENSEMBLE__ + SUDP003 | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 003 __ENSEMBLE__ + SUDP004 | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 004 __ENSEMBLE__ + SUSD001 | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 001 __ENSEMBLE__ + SUSD002 | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 002 __ENSEMBLE__ + SUSD003 | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 003 __ENSEMBLE__ + SUSD004 | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 004 __ENSEMBLE__ + SUWT001 | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 001 __ENSEMBLE__ + SUWT002 | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 002 __ENSEMBLE__ + SUWT003 | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 003 __ENSEMBLE__ + SUWT004 | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 004 __ENSEMBLE__ + SUSV001 | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 001 __ENSEMBLE__ + SUSV002 | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 002 __ENSEMBLE__ + SUSV003 | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 003 __ENSEMBLE__ + SUSV004 | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 004 __ENSEMBLE__ + SO4EMAN | kg m-2 s-1 | xy | | | | | | SO4 Anthropogenic Emissions __ENSEMBLE__ + SO2EMAN | kg m-2 s-1 | xy | | | | | | SO2 Anthropogenic Emissions __ENSEMBLE__ + SO2EMBB | kg m-2 s-1 | xy | | | | | | SO2 Biomass Burning Emissions __ENSEMBLE__ + SO2EMVN | kg m-2 s-1 | xy | | | | | | SO2 Volcanic (non-explosive) Emissions __ENSEMBLE__ + SO2EMVE | kg m-2 s-1 | xy | | | | | | SO2 Volcanic (explosive) Emissions __ENSEMBLE__ + PSO2 | kg m-2 s-1 | xyz | C | | | | | SO2 Prod from DMS oxidation __ENSEMBLE__ + PMSA | kg m-2 s-1 | xyz | C | | | | | MSA Prod from DMS oxidation __ENSEMBLE__ + PSO4 | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from all SO2 oxidation __ENSEMBLE__ + PSO4G | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from gaseous SO2 oxidation __ENSEMBLE__ + PSO4WET | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from wet SO2 oxidation __ENSEMBLE__ + PSO4AQ | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from aqueous SO2 oxidation __ENSEMBLE__ + SUPSO2 | kg m-2 s-1 | xy | | | | | | SO2 Prod from DMS Oxidation [column] __ENSEMBLE__ + SUPSO4 | kg m-2 s-1 | xy | | | | | | SO4 Prod from All SO2 Oxidation [column] __ENSEMBLE__ + SUPSO4G | kg m-2 s-1 | xy | | | | | | SO4 Prod from Gaseous SO2 Oxidation [column] __ENSEMBLE__ + SUPSO4AQ | kg m-2 s-1 | xy | | | | | | SO4 Prod from Aqueous SO2 Oxidation [column] __ENSEMBLE__ + SUPSO4WT | kg m-2 s-1 | xy | | | | | | SO4 Prod from Aqueous SO2 Oxidation (wet dep) [column] __ENSEMBLE__ + SUPMSA | kg m-2 s-1 | xy | | | | | | MSA Prod from DMS Oxidation [column] __ENSEMBLE__ + SO2SMASS | kg m-3 | xy | | | | | | SO2 Surface Mass Concentration __ENSEMBLE__ + SO2CMASS | kg m-2 | xy | | | | | | SO2 Column Mass Density __ENSEMBLE__ + SO4SMASS | kg m-3 | xy | | | | | | SO4 Surface Mass Concentration __ENSEMBLE__ + SO4CMASS | kg m-2 | xy | | | | | | SO4 Column Mass Density __ENSEMBLE__ + DMSSMASS | kg m-3 | xy | | | | | | DMS Surface Mass Concentration __ENSEMBLE__ + DMSCMASS | kg m-2 | xy | | | | | | DMS Column Mass Density __ENSEMBLE__ + MSASMASS | kg m-3 | xy | | | | | | MSA Surface Mass Concentration __ENSEMBLE__ + MSACMASS | kg m-2 | xy | | | | | | MSA Column Mass Density __ENSEMBLE__ + SUCONC | kg m-3 | xyz | C | | | | | SO4 Aerosol Mass Concentration __ENSEMBLE__ + SUEXTCOEF| m-1 | xyz | C | | | | | SO4 Extinction Coefficient [550 nm] __ENSEMBLE__ + SUSCACOEF| m-1 | xyz | C | | | | | SO4 Scattering Coefficient [550 nm] __ENSEMBLE__ + SUANGSTR | 1 | xy | | | | | | SO4 Angstrom parameter [470-870 nm] __ENSEMBLE__ + SUFLUXU | kg m-1 s-1 | xy | | | | | | SO4 column u-wind mass flux __ENSEMBLE__ + SUFLUXV | kg m-1 s-1 | xy | | | | | | SO4 column v-wind mass flux __ENSEMBLE__ + SO4MASS | kg kg-1 | xyz | C | | | | | SO4 Aerosol Mass Mixing Ratio __ENSEMBLE__ + SUEXTTAU | 1 | xy | | | | | | SO4 Extinction AOT [550 nm] __ENSEMBLE__ + SUSCATAU | 1 | xy | | | | | | SO4 Scattering AOT [550 nm] __ENSEMBLE__ + SO4SAREA | m2 m-3 | xyz | C | | | | | SO4 Surface Area Density __ENSEMBLE__ + SO4SNUM | m-3 | xyz | C | | | | | SO4 Number Density __ENSEMBLE__ +# .........|............|.....|...|....|...|...|.....|.................................. + SUEM001anth | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 001 (Anthropogenic) + SUEM002anth | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 002 (Anthropogenic) + SUEM003anth | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 003 (Anthropogenic) + SUEM004anth | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 004 (Anthropogenic) + SUDP001anth | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 001 (Anthropogenic) + SUDP002anth | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 002 (Anthropogenic) + SUDP003anth | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 003 (Anthropogenic) + SUDP004anth | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 004 (Anthropogenic) + SUSD001anth | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 001 (Anthropogenic) + SUSD002anth | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 002 (Anthropogenic) + SUSD003anth | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 003 (Anthropogenic) + SUSD004anth | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 004 (Anthropogenic) + SUWT001anth | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 001 (Anthropogenic) + SUWT002anth | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 002 (Anthropogenic) + SUWT003anth | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 003 (Anthropogenic) + SUWT004anth | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 004 (Anthropogenic) + SUSV001anth | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 001 (Anthropogenic) + SUSV002anth | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 002 (Anthropogenic) + SUSV003anth | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 003 (Anthropogenic) + SUSV004anth | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 004 (Anthropogenic) + SO4EMANanth | kg m-2 s-1 | xy | | | | | | SO4 Anthropogenic Emissions (Anthropogenic) + SO2EMANanth | kg m-2 s-1 | xy | | | | | | SO2 Anthropogenic Emissions (Anthropogenic) + SO2EMBBanth | kg m-2 s-1 | xy | | | | | | SO2 Biomass Burning Emissions (Anthropogenic) + SO2EMVNanth | kg m-2 s-1 | xy | | | | | | SO2 Volcanic (non-explosive) Emissions (Anthropogenic) + SO2EMVEanth | kg m-2 s-1 | xy | | | | | | SO2 Volcanic (explosive) Emissions (Anthropogenic) + PSO2anth | kg m-2 s-1 | xyz | C | | | | | SO2 Prod from DMS oxidation (Anthropogenic) + PMSAanth | kg m-2 s-1 | xyz | C | | | | | MSA Prod from DMS oxidation (Anthropogenic) + PSO4anth | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from all SO2 oxidation (Anthropogenic) + PSO4Ganth | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from gaseous SO2 oxidation (Anthropogenic) + PSO4WETanth | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from wet SO2 oxidation (Anthropogenic) + PSO4AQanth | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from aqueous SO2 oxidation (Anthropogenic) + SUPSO2anth | kg m-2 s-1 | xy | | | | | | SO2 Prod from DMS Oxidation [column] (Anthropogenic) + SUPSO4anth | kg m-2 s-1 | xy | | | | | | SO4 Prod from All SO2 Oxidation [column] (Anthropogenic) + SUPSO4Ganth | kg m-2 s-1 | xy | | | | | | SO4 Prod from Gaseous SO2 Oxidation [column] (Anthropogenic) + SUPSO4AQanth | kg m-2 s-1 | xy | | | | | | SO4 Prod from Aqueous SO2 Oxidation [column] (Anthropogenic) + SUPSO4WTanth | kg m-2 s-1 | xy | | | | | | SO4 Prod from Aqueous SO2 Oxidation (wet dep) [column] (Anthropogenic) + SUPMSAanth | kg m-2 s-1 | xy | | | | | | MSA Prod from DMS Oxidation [column] (Anthropogenic) + SO2SMASSanth | kg m-3 | xy | | | | | | SO2 Surface Mass Concentration (Anthropogenic) + SO2CMASSanth | kg m-2 | xy | | | | | | SO2 Column Mass Density (Anthropogenic) + SO4SMASSanth | kg m-3 | xy | | | | | | SO4 Surface Mass Concentration (Anthropogenic) + SO4CMASSanth | kg m-2 | xy | | | | | | SO4 Column Mass Density (Anthropogenic) + DMSSMASSanth | kg m-3 | xy | | | | | | DMS Surface Mass Concentration (Anthropogenic) + DMSCMASSanth | kg m-2 | xy | | | | | | DMS Column Mass Density (Anthropogenic) + MSASMASSanth | kg m-3 | xy | | | | | | MSA Surface Mass Concentration (Anthropogenic) + MSACMASSanth | kg m-2 | xy | | | | | | MSA Column Mass Density (Anthropogenic) + SUCONCanth | kg m-3 | xyz | C | | | | | SO4 Aerosol Mass Concentration (Anthropogenic) + SUEXTCOEFanth| m-1 | xyz | C | | | | | SO4 Extinction Coefficient [550 nm] (Anthropogenic) + SUSCACOEFanth| m-1 | xyz | C | | | | | SO4 Scattering Coefficient [550 nm] (Anthropogenic) + SUANGSTRanth | 1 | xy | | | | | | SO4 Angstrom parameter [470-870 nm] (Anthropogenic) + SUFLUXUanth | kg m-1 s-1 | xy | | | | | | SO4 column u-wind mass flux (Anthropogenic) + SUFLUXVanth | kg m-1 s-1 | xy | | | | | | SO4 column v-wind mass flux (Anthropogenic) + SO4MASSanth | kg kg-1 | xyz | C | | | | | SO4 Aerosol Mass Mixing Ratio (Anthropogenic) + SUEXTTAUanth | 1 | xy | | | | | | SO4 Extinction AOT [550 nm] (Anthropogenic) + SUSCATAUanth | 1 | xy | | | | | | SO4 Scattering AOT [550 nm] (Anthropogenic) + SO4SAREAanth | m2 m-3 | xyz | C | | | | | SO4 Surface Area Density (Anthropogenic) + SO4SNUManth | m-3 | xyz | C | | | | | SO4 Number Density (Anthropogenic) +# .............|............|.....|...|....|...|...|.....|.................................. + SUEM001volc | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 001 (Volcanic) + SUEM002volc | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 002 (Volcanic) + SUEM003volc | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 003 (Volcanic) + SUEM004volc | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 004 (Volcanic) + SUDP001volc | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 001 (Volcanic) + SUDP002volc | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 002 (Volcanic) + SUDP003volc | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 003 (Volcanic) + SUDP004volc | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 004 (Volcanic) + SUSD001volc | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 001 (Volcanic) + SUSD002volc | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 002 (Volcanic) + SUSD003volc | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 003 (Volcanic) + SUSD004volc | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 004 (Volcanic) + SUWT001volc | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 001 (Volcanic) + SUWT002volc | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 002 (Volcanic) + SUWT003volc | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 003 (Volcanic) + SUWT004volc | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 004 (Volcanic) + SUSV001volc | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 001 (Volcanic) + SUSV002volc | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 002 (Volcanic) + SUSV003volc | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 003 (Volcanic) + SUSV004volc | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 004 (Volcanic) + SO4EMANvolc | kg m-2 s-1 | xy | | | | | | SO4 Anthropogenic Emissions (Volcanic) + SO2EMANvolc | kg m-2 s-1 | xy | | | | | | SO2 Anthropogenic Emissions (Volcanic) + SO2EMBBvolc | kg m-2 s-1 | xy | | | | | | SO2 Biomass Burning Emissions (Volcanic) + SO2EMVNvolc | kg m-2 s-1 | xy | | | | | | SO2 Volcanic (non-explosive) Emissions (Volcanic) + SO2EMVEvolc | kg m-2 s-1 | xy | | | | | | SO2 Volcanic (explosive) Emissions (Volcanic) + PSO2volc | kg m-2 s-1 | xyz | C | | | | | SO2 Prod from DMS oxidation (Volcanic) + PMSAvolc | kg m-2 s-1 | xyz | C | | | | | MSA Prod from DMS oxidation (Volcanic) + PSO4volc | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from all SO2 oxidation (Volcanic) + PSO4Gvolc | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from gaseous SO2 oxidation (Volcanic) + PSO4WETvolc | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from wet SO2 oxidation (Volcanic) + PSO4AQvolc | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from aqueous SO2 oxidation (Volcanic) + SUPSO2volc | kg m-2 s-1 | xy | | | | | | SO2 Prod from DMS Oxidation [column] (Volcanic) + SUPSO4volc | kg m-2 s-1 | xy | | | | | | SO4 Prod from All SO2 Oxidation [column] (Volcanic) + SUPSO4Gvolc | kg m-2 s-1 | xy | | | | | | SO4 Prod from Gaseous SO2 Oxidation [column] (Volcanic) + SUPSO4AQvolc | kg m-2 s-1 | xy | | | | | | SO4 Prod from Aqueous SO2 Oxidation [column] (Volcanic) + SUPSO4WTvolc | kg m-2 s-1 | xy | | | | | | SO4 Prod from Aqueous SO2 Oxidation (wet dep) [column] (Volcanic) + SUPMSAvolc | kg m-2 s-1 | xy | | | | | | MSA Prod from DMS Oxidation [column] (Volcanic) + SO2SMASSvolc | kg m-3 | xy | | | | | | SO2 Surface Mass Concentration (Volcanic) + SO2CMASSvolc | kg m-2 | xy | | | | | | SO2 Column Mass Density (Volcanic) + SO4SMASSvolc | kg m-3 | xy | | | | | | SO4 Surface Mass Concentration (Volcanic) + SO4CMASSvolc | kg m-2 | xy | | | | | | SO4 Column Mass Density (Volcanic) + DMSSMASSvolc | kg m-3 | xy | | | | | | DMS Surface Mass Concentration (Volcanic) + DMSCMASSvolc | kg m-2 | xy | | | | | | DMS Column Mass Density (Volcanic) + MSASMASSvolc | kg m-3 | xy | | | | | | MSA Surface Mass Concentration (Volcanic) + MSACMASSvolc | kg m-2 | xy | | | | | | MSA Column Mass Density (Volcanic) + SUCONCvolc | kg m-3 | xyz | C | | | | | SO4 Aerosol Mass Concentration (Volcanic) + SUEXTCOEFvolc| m-1 | xyz | C | | | | | SO4 Extinction Coefficient [550 nm] (Volcanic) + SUSCACOEFvolc| m-1 | xyz | C | | | | | SO4 Scattering Coefficient [550 nm] (Volcanic) + SUANGSTRvolc | 1 | xy | | | | | | SO4 Angstrom parameter [470-870 nm] (Volcanic) + SUFLUXUvolc | kg m-1 s-1 | xy | | | | | | SO4 column u-wind mass flux (Volcanic) + SUFLUXVvolc | kg m-1 s-1 | xy | | | | | | SO4 column v-wind mass flux (Volcanic) + SO4MASSvolc | kg kg-1 | xyz | C | | | | | SO4 Aerosol Mass Mixing Ratio (Volcanic) + SUEXTTAUvolc | 1 | xy | | | | | | SO4 Extinction AOT [550 nm] (Volcanic) + SUSCATAUvolc | 1 | xy | | | | | | SO4 Scattering AOT [550 nm] (Volcanic) + SO4SAREAvolc | m2 m-3 | xyz | C | | | | | SO4 Surface Area Density (Volcanic) + SO4SNUMvolc | m-3 | xyz | C | | | | | SO4 Number Density (Volcanic) +# ---------|------------|-----|---|----|---|---|-----|--------------------------------- + SUEM001strat | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 001 (Stratospheric) + SUEM002strat | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 002 (Stratospheric) + SUEM003strat | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 003 (Stratospheric) + SUEM004strat | kg m-2 s-1 | xy | | | | | | Sulfate Emission Bin 004 (Stratospheric) + SUDP001strat | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 001 (Stratospheric) + SUDP002strat | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 002 (Stratospheric) + SUDP003strat | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 003 (Stratospheric) + SUDP004strat | kg m-2 s-1 | xy | | | | | | Sulfate Dry Deposition Bin 004 (Stratospheric) + SUSD001strat | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 001 (Stratospheric) + SUSD002strat | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 002 (Stratospheric) + SUSD003strat | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 003 (Stratospheric) + SUSD004strat | kg m-2 s-1 | xy | | | | | | Sulfate Settling Bin 004 (Stratospheric) + SUWT001strat | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 001 (Stratospheric) + SUWT002strat | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 002 (Stratospheric) + SUWT003strat | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 003 (Stratospheric) + SUWT004strat | kg m-2 s-1 | xy | | | | | | Sulfate Wet Deposition Bin 004 (Stratospheric) + SUSV001strat | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 001 (Stratospheric) + SUSV002strat | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 002 (Stratospheric) + SUSV003strat | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 003 (Stratospheric) + SUSV004strat | kg m-2 s-1 | xy | | | | | | Sulfate Convective Scavenging Bin 004 (Stratospheric) + SO4EMANstrat | kg m-2 s-1 | xy | | | | | | SO4 Anthropogenic Emissions (Stratospheric) + SO2EMANstrat | kg m-2 s-1 | xy | | | | | | SO2 Anthropogenic Emissions (Stratospheric) + SO2EMBBstrat | kg m-2 s-1 | xy | | | | | | SO2 Biomass Burning Emissions (Stratospheric) + SO2EMVNstrat | kg m-2 s-1 | xy | | | | | | SO2 Volcanic (non-explosive) Emissions (Stratospheric) + SO2EMVEstrat | kg m-2 s-1 | xy | | | | | | SO2 Volcanic (explosive) Emissions (Stratospheric) + PSO2strat | kg m-2 s-1 | xyz | C | | | | | SO2 Prod from DMS oxidation (Stratospheric) + PMSAstrat | kg m-2 s-1 | xyz | C | | | | | MSA Prod from DMS oxidation (Stratospheric) + PSO4strat | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from all SO2 oxidation (Stratospheric) + PSO4Gstrat | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from gaseous SO2 oxidation (Stratospheric) + PSO4WETstrat | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from wet SO2 oxidation (Stratospheric) + PSO4AQstrat | kg m-2 s-1 | xyz | C | | | | | SO4 Prod from aqueous SO2 oxidation (Stratospheric) + SUPSO2strat | kg m-2 s-1 | xy | | | | | | SO2 Prod from DMS Oxidation [column] (Stratospheric) + SUPSO4strat | kg m-2 s-1 | xy | | | | | | SO4 Prod from All SO2 Oxidation [column] (Stratospheric) + SUPSO4Gstrat | kg m-2 s-1 | xy | | | | | | SO4 Prod from Gaseous SO2 Oxidation [column] (Stratospheric) + SUPSO4AQstrat | kg m-2 s-1 | xy | | | | | | SO4 Prod from Aqueous SO2 Oxidation [column] (Stratospheric) + SUPSO4WTstrat | kg m-2 s-1 | xy | | | | | | SO4 Prod from Aqueous SO2 Oxidation (wet dep) [column] (Stratospheric) + SUPMSAstrat | kg m-2 s-1 | xy | | | | | | MSA Prod from DMS Oxidation [column] (Stratospheric) + SO2SMASSstrat | kg m-3 | xy | | | | | | SO2 Surface Mass Concentration (Stratospheric) + SO2CMASSstrat | kg m-2 | xy | | | | | | SO2 Column Mass Density (Stratospheric) + SO4SMASSstrat | kg m-3 | xy | | | | | | SO4 Surface Mass Concentration (Stratospheric) + SO4CMASSstrat | kg m-2 | xy | | | | | | SO4 Column Mass Density (Stratospheric) + DMSSMASSstrat | kg m-3 | xy | | | | | | DMS Surface Mass Concentration (Stratospheric) + DMSCMASSstrat | kg m-2 | xy | | | | | | DMS Column Mass Density (Stratospheric) + MSASMASSstrat | kg m-3 | xy | | | | | | MSA Surface Mass Concentration (Stratospheric) + MSACMASSstrat | kg m-2 | xy | | | | | | MSA Column Mass Density (Stratospheric) + SUCONCstrat | kg m-3 | xyz | C | | | | | SO4 Aerosol Mass Concentration (Stratospheric) + SUEXTCOEFstrat| m-1 | xyz | C | | | | | SO4 Extinction Coefficient [550 nm] (Stratospheric) + SUSCACOEFstrat| m-1 | xyz | C | | | | | SO4 Scattering Coefficient [550 nm] (Stratospheric) + SUANGSTRstrat | 1 | xy | | | | | | SO4 Angstrom parameter [470-870 nm] (Stratospheric) + SUFLUXUstrat | kg m-1 s-1 | xy | | | | | | SO4 column u-wind mass flux (Stratospheric) + SUFLUXVstrat | kg m-1 s-1 | xy | | | | | | SO4 column v-wind mass flux (Stratospheric) + SO4MASSstrat | kg kg-1 | xyz | C | | | | | SO4 Aerosol Mass Mixing Ratio (Stratospheric) + SUEXTTAUstrat | 1 | xy | | | | | | SO4 Extinction AOT [550 nm] (Stratospheric) + SUSCATAUstrat | 1 | xy | | | | | | SO4 Scattering AOT [550 nm] (Stratospheric) + SO4SAREAstrat | m2 m-3 | xyz | C | | | | | SO4 Surface Area Density (Stratospheric) + SO4SNUMstrat | m-3 | xyz | C | | | | | SO4 Number Density (Stratospheric) +# .............|............|.....|...|....|...|...|.....|.................................. + + diff --git a/ESMF/GOCART_GridComp/ut_GOCART.F90 b/ESMF/GOCART_GridComp/ut_GOCART.F90 new file mode 100644 index 00000000..89d7e7e6 --- /dev/null +++ b/ESMF/GOCART_GridComp/ut_GOCART.F90 @@ -0,0 +1,439 @@ +! ut_GOCART - Simple ESMF/MAPL example demonstrating how to call GOCART +! +! It assumes 2 processors, so typically you will run it as +! +! % mprirun -np 2 ut_GOCART.x +! +! Arlindo da Silva , December 2009 +!---------------------------------------------------------------------------- + +# include "MAPL_Generic.h" + + Program ut_GOCART + + use ESMF + use MAPL + use GOCART_GridCompMod, only: SetServices + + implicit NONE + +! Basic ESMF objects being used in this example +! --------------------------------------------- + type(ESMF_Grid) :: grid ! Grid + type(ESMF_VM) :: vm ! ESMF Virtual Machine + type(ESMF_Time) :: Time ! Time objects + type(ESMF_TimeInterval) :: TimeStep ! used to define a clock + +! Grid Component Objects +! ---------------------- + type(ESMF_GridComp) :: GC + type(ESMF_State) :: IMPORT + type(ESMF_State) :: EXPORT + type(ESMF_Clock) :: CLOCK + +! Basic information about the parallel environment +! PET = Persistent Execution Threads +! In the current implementation, a PET is equivalent +! to an MPI process +! ------------------------------------------------ + integer :: myPET ! The local PET number + integer :: nPET ! The total number of PETs you are running on + + integer :: status, rc + integer :: i, j, n, im, jm + + integer :: Nx = 2, Ny=1 ! Layout + integer :: IM_World=72, JM_World=46, LM_WORLD=72 ! Grid dimensions + +! Coordinate variables +! -------------------- + real(kind=8), pointer, dimension(:,:) :: lons, lats + + character(len=ESMF_MAXSTR) :: name + real, pointer, dimension(:,:) :: Array, newArray + + character(len=*), parameter :: Iam = 'ut_GOCART' + +! ----- + + call Main() + +CONTAINS + + subroutine Main() + +! Initialize the ESMF. For performance reasons, it is important +! to turn OFF ESMF's automatic logging feature +! ------------------------------------------------------------- + call ESMF_Initialize (LogKindFlag=ESMF_LOGKIND_NONE, vm=vm, __RC__) + +! Check the number of processors +! ------------------------------ + call ESMF_VMGet(vm, localPET=myPET, PETcount=nPET) + if ( nPET /= 2 ) then + if ( MAPL_am_I_root() ) then + print *, 'Error: expecting 2 PETs but found ', nPET, 'PETs' + print *, 'Try: mpirun -np 2 ut_GOCART.x' + end if + _ASSERT(.FALSE.,'needs informative message') + end if + + if ( MAPL_am_I_root() ) then + print * + print *, 'Starting ' // Iam // ' with ', nPET, ' PETs ...' + print * + end if + +! Create a global 2D Lat-Lon grid on a 2x1 layout +! ------------------------------------------------ + Grid = MAPL_LatLonGridCreate (Name='myGrid', & + Nx = Nx, Ny = Ny, & + IM_World = IM_World, & + JM_World = JM_World, & + LM_World = LM_World, & + __RC__ ) + +! Validate grid +! ------------- + call ESMF_GridValidate(Grid,__RC__) + +! Create a clock starting at 1/1/2001 0Z with a 30 min time step +! -------------------------------------------------------------- + call ESMF_CalendarSetDefault ( ESMF_CALKIND_GREGORIAN ) + call ESMF_TimeSet(Time, yy=2007, mm=7, dd=1, h=0, m=0, s=0) + call ESMF_TimeIntervalSet( TimeStep, h=0, m=30, s=0, __RC__ ) + CLOCK = ESMF_ClockCreate ( "Clock", timeStep=TimeStep, startTime=Time, __RC__ ) + + +! Create states and the component +! ------------------------------- + IMPORT = ESMF_StateCreate ( name='impGOCART', __RC__ ) + EXPORT = ESMF_StateCreate ( name='expGOCART', __RC__ ) + GC = ESMF_GridCompCreate ( name='GOCART', & + Grid=Grid, & +! GridCompType = ESMF_ATM, & + ConfigFile='MAPL.rc', & + __RC__ ) + + +! Set component services +! ---------------------- + call ESMF_GridCompSetServices ( GC, SetServices, __RC__ ) + +! Initialize component +! -------------------- + call ESMF_GridCompInitialize ( GC, importState=IMPORT, exportState=EXPORT, clock=CLOCK, __RC__ ) + +! Fill in IMPORT state with reasonable values +! ------------------------------------------- + call Fill_Import_State_ (IMPORT,__RC__) + +! Since we are not reading restarts, set the internal state with +! reasonable profiles so that we can exercise the code +! --------------------------------------------------------------- + call Fill_Internal_State_ (GC,__RC__) + +! Look at states +! -------------- + if ( MAPL_AM_I_ROOT() ) then + call ESMF_StatePrint(IMPORT) + call ESMF_StatePrint(EXPORT) + end if + +! Run component +! ------------- + call ESMF_GridCompRun ( GC, importState=IMPORT, exportState=EXPORT, clock=CLOCK, __RC__ ) + +! Finalize component +! ------------------ +!!! call ESMF_GridCompFinalize ( GC, IMPORT, EXPORT, CLOCK, __RC__ ) + +! All done +! -------- + call ESMF_Finalize(__RC__) + + end subroutine Main + +!............................................................................................ + subroutine Fill_Import_State_ (IMPORT,rc) + type(ESMF_State), intent(inout) :: IMPORT + integer, optional, intent(out) :: rc + +! ---- + + integer :: i1, i2, j1, j2, k1, k2 + + real, pointer, dimension(:,:,:) :: ple, zle, airdens, fcld, dqdt, t, u, v, o3, rh2 + + real, pointer, dimension(:,:) :: tropp, lwi, zpbl, frlake, fraci, wet1, lai, grn, cn_prcp, ncn_prcp, & + ps, sh, tsoil1, u10m, v10m, ustar, z0h + +! Get Pointers to IMPORT state +! ---------------------------- + call MAPL_GetPointer ( IMPORT, PLE, 'PLE', __RC__ ) + call MAPL_GetPointer ( IMPORT, ZLE, 'ZLE', __RC__ ) + call MAPL_GetPointer ( IMPORT, AIRDENS, 'AIRDENS', __RC__ ) + call MAPL_GetPointer ( IMPORT, FCLD, 'FCLD', __RC__ ) + call MAPL_GetPointer ( IMPORT, DQDT, 'DQDT', __RC__ ) + call MAPL_GetPointer ( IMPORT, T, 'T', __RC__ ) + call MAPL_GetPointer ( IMPORT, U, 'U', __RC__ ) + call MAPL_GetPointer ( IMPORT, V, 'V', __RC__ ) +! call MAPL_GetPointer ( IMPORT, O3, 'O3', __RC__ ) + call MAPL_GetPointer ( IMPORT, RH2, 'RH2', __RC__ ) + call MAPL_GetPointer ( IMPORT, TROPP, 'TROPP', __RC__ ) + call MAPL_GetPointer ( IMPORT, LWI, 'LWI', __RC__ ) + call MAPL_GetPointer ( IMPORT, ZPBL, 'ZPBL', __RC__ ) + call MAPL_GetPointer ( IMPORT, FRLAKE, 'FRLAKE', __RC__ ) + call MAPL_GetPointer ( IMPORT, FRACI, 'FRACI', __RC__ ) + call MAPL_GetPointer ( IMPORT, WET1, 'WET1', __RC__ ) + call MAPL_GetPointer ( IMPORT, LAI, 'LAI', __RC__ ) + call MAPL_GetPointer ( IMPORT, GRN, 'GRN', __RC__ ) + call MAPL_GetPointer ( IMPORT, CN_PRCP, 'CN_PRCP', __RC__ ) + call MAPL_GetPointer ( IMPORT, NCN_PRCP, 'NCN_PRCP', __RC__ ) + call MAPL_GetPointer ( IMPORT, PS, 'PS', __RC__ ) + call MAPL_GetPointer ( IMPORT, SH, 'SH', __RC__ ) + call MAPL_GetPointer ( IMPORT, TSOIL1, 'TSOIL1', __RC__ ) + call MAPL_GetPointer ( IMPORT, U10M, 'U10M', __RC__ ) + call MAPL_GetPointer ( IMPORT, V10M, 'V10M', __RC__ ) + call MAPL_GetPointer ( IMPORT, USTAR, 'USTAR', __RC__ ) + call MAPL_GetPointer ( IMPORT, Z0H, 'Z0H', __RC__ ) + + i1 = lbound(u,1) + j1 = lbound(u,2) + k1 = lbound(u,3) + i2 = ubound(u,1) + j2 = ubound(u,2) + k2 = ubound(u,3) + + _ASSERT( (k2-k1+1) == 72,'needs informative message') + + +! Fill typical values +! ------------------- + do j = j1, j2 + do i = i1, i2 + +! 3D +! -- + PLE(i,j,:) = (/ 1, 2, 3, 4, 6, 8, 11, 15, 21, 27, 36, 47, 61, 79, 101, 130, & + 165, 208, 262, 327, 407, 504, 621, 761, 929, 1127, 1364, 1645, & + 1979, 2373, 2836, 3381, 4017, 4764, 5638, 6660, 7851, 9236, & + 10866, 12783, 15039, 17693, 20792, 24398, 28606, 33388, 37003, & + 40612, 44214, 47816, 51405, 54997, 58584, 62170, 65769, 68147, & + 70540, 72931, 75313, 77711, 79623, 81046, 82485, 83906, 85344, & + 86765, 88201, 89636, 91071, 92516, 93921, 95376 /) + + ZLE(i,j,:) = (/ 78676, 74222, 71032, 68578, 66390, 64345, 62371, 60419, 58455, & + 56469, 54463, 52449, 50446, 48476, 46563, 44718, 42946, 41256, & + 39651, 38123, 36656, 35234, 33847, 32499, 31199, 29940, 28704, & + 27494, 26310, 25151, 24017, 22905, 21815, 20745, 19691, 18656, & + 17629, 16609, 15589, 14559, 13514, 12470, 11475, 10487, 9469, & + 8438, 7731, 7076, 6463, 5889, 5348, 4838, 4355, 3898, 3464, & + 3187, 2918, 2656, 2403, 2155, 1963, 1821, 1682, 1546, 1412, & + 1280, 1149, 1022, 896, 773, 654, 535, 417 /) + + AIRDENS(i,j,:) = (/ 2.27987766266e-05, 4.03523445129e-05, 6.19888305664e-05, 8.63075256348e-05, & + 0.000117659568787, 0.000159025192261, 0.000209808349609, 0.000270366668701, & + 0.000345230102539, 0.000439167022705, 0.00055980682373, 0.000717163085938, & + 0.000923156738281, 0.00120162963867, 0.00156402587891, 0.00202178955078, & + 0.00262451171875, 0.00339889526367, 0.00437164306641, 0.00555419921875, & + 0.00694274902344, 0.00857543945312, 0.0105895996094, 0.0131225585938, & + 0.0160827636719, 0.0195617675781, 0.0237731933594, 0.0287780761719, & + 0.0347290039062, 0.0416870117188, 0.0499267578125, 0.0596313476562, & + 0.0711669921875, 0.084716796875, 0.100830078125, 0.11865234375, 0.138671875, & + 0.1630859375, 0.190185546875, 0.22021484375, 0.25927734375, 0.318359375, & + 0.3720703125, 0.42138671875, 0.47265625, 0.521484375, 0.5615234375, & + 0.6005859375, 0.638671875, 0.677734375, 0.71875, 0.759765625, 0.8017578125, & + 0.8447265625, 0.8798828125, 0.90625, 0.9326171875, 0.958984375, 0.986328125, & + 1.013671875, 1.03515625, 1.052734375, 1.072265625, 1.08984375, 1.10546875, & + 1.123046875, 1.140625, 1.162109375, 1.1953125, 1.21875, 1.234375, 1.25 /) + + FCLD(i,j,:) = 1e-2 * & + (/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + 0, 0, 0, 0, 0, 0, 16, 21, 26, 28, 0, 0, 0, 0, 0, 0, 0, & + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0 /) + + DQDT(i,j,:) = 1e-12 * & + (/ 9, 11, -3, -3, -2, -18, -10, 2, 0, -3, -6, -5, -3, -1, 1, & + 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, & + 1, 1, 0, 0, -5, -22, -33, 95, 474, 348, 177, 3377, 11045, & + 11788, -5267, -7756, -17491, -19790, -10884, -6082, 8120, 4381, & + -10346, 8033, 69151, 77650, 61351, 46508, 33936, 23022, 15658, & + 11598, 6469, 4861, -846, -7974, -30500, -20663, -14930 /) + + T(i,j,:) = (/ 219, 221, 223, 228, 230, 230, 232, 238, 245, 253, 259, 263, & + 264, 262, 258, 253, 247, 239, 233, 229, 227, 227, 226, 223, & + 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 212, & + 214, 214, 216, 219, 219, 210, 210, 218, 227, 234, 240, 245, & + 250, 254, 257, 260, 262, 263, 265, 266, 267, 268, 269, 270, & + 270, 270, 270, 270, 271, 271, 271, 270, 267, 265, 266, 266 /) + + + U(i,j,:) = (/ -18, -13, 0, 10, 26, 36, 39, 40, 38, 37, 36, 35, 32, 28, & + 23, 16, 6, -2, -9, -13, -15, -16, -14, -14, -12, -12, -11, & + -10, -9, -5, -3, -2, 0, 1, 3, 5, 9, 13, 17, 22, 24, 26, & + 25, 26, 26, 22, 19, 17, 14, 12, 12, 11, 11, 11, 11, 10, 9, & + 8, 6, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -6, -6 /) + + V(i,j,:) = (/ 20, 13, 9, 4, -1, -9, -20, -24, -25, -27, -28, -28, -26, & + -25, -27, -28, -28, -28, -27, -27, -25, -23, -19, -15, -11, & + -10, -9, -8, -7, -7, -8, -9, -10, -12, -14, -15, -16, -18, & + -21, -22, -22, -25, -29, -25, -23, -23, -22, -20, -17, -13, & + -9, -6, -4, -4, -4, -3, -2, -1, 0, 0, 0, 1, 1, 1, 2, 2, & + 3, 3, 3, 4, 4, 3 /) + + O3(i,j,:) = 1.E-9 * & + (/ 16182, 9700, 7294, 5781, 4164, 3017, 2440, 2287, 2324, 2514, & + 2838, 3304, 4030, 4924, 5915, 7033, 8434, 9894, 11101, 11414, & + 10475, 9745, 10058, 9119, 8538, 9238, 9164, 10028, 10132, 10237, & + 9447, 7972, 7174, 5222, 4008, 3296, 2231, 1320, 768, 628, 685, & + 676, 202, 122, 96, 88, 86, 83, 83, 84, 84, 83, 82, 81, 79, & + 79, 77, 76, 77, 80, 84, 87, 89, 90, 89, 88, 83, 76, 69, 65, & + 64, 64 /) + + RH2(i,j,:) = 1e-6 * & + (/ 1, 2, 2, 2, 3, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 6, 18, 51, & + 129, 267, 394, 502, 682, 1135, 1603, 2076, 2820, 3792, 5120, & + 6806, 8912, 11597, 15397, 20386, 28168, 29755, 28748, 33875, & + 34058, 28657, 43458, 401856, 947266, 932618, 902344, 657227, & + 371583, 203370, 235108, 317872, 413086, 511719, 691407, 686524, & + 601563, 456055, 475098, 626954, 590821, 483399, 380860, 297852, & + 230958, 183594, 144288, 111084, 96558, 136963, 369629, 770508, & + 793946, 799805 /) +! 2D +! -- + TROPP(i,j) = 20363.5 + LWI(i,j) = 1. + ZPBL(i,j) = 59. + FRLAKE(i,j) = 0. + FRACI(i,j) = 0. + WET1(i,j) = 0.0 + LAI(i,j) = 0.280273 + GRN(i,j) = 0.5 + CN_PRCP(i,j) = 0.0 + NCN_PRCP(i,j) = 3.18323e-10 + PS(i,j) = 96825.3 + SH(i,j) = -28.548 + TSOIL1(i,j) = 260.014 + U10M(i,j) = -3.5 + V10M(i,j) = 2.8 + USTAR(i,j) = 0.29 + Z0H(i,j) = 0.02005 + + end do + end do + + end subroutine Fill_Import_State_ + +!............................................................................................... + + + subroutine Fill_Internal_State_ (GC,rc) + type(ESMF_GridComp), intent(inout) :: GC + integer, optional, intent(out) :: rc + +! ---- + + type(MAPL_MetaComp), pointer :: MAPL + type(ESMF_State) :: INTERNAL + + real, pointer :: tracer(:,:,:) + integer :: i1, i2, j1, j2, k1, k2 + +! Dust only for now... + real, pointer, dimension(:,:,:) :: du001, du002, du003, du004, du005 + + +! Get my internal stateb out of GC +! -------------------------------- + call MAPL_GetObjectFromGC ( GC, MAPL, __RC__ ) + call MAPL_Get ( MAPL, INTERNAL_ESMF_STATE=INTERNAL, __RC__ ) + +! Get Pointers to IMPORT state +! ---------------------------- + call MAPL_GetPointer ( INTERNAL, du001, 'GOCART::du001', __RC__ ) + call MAPL_GetPointer ( INTERNAL, du002, 'GOCART::du002', __RC__ ) + call MAPL_GetPointer ( INTERNAL, du003, 'GOCART::du003', __RC__ ) + call MAPL_GetPointer ( INTERNAL, du004, 'GOCART::du004', __RC__ ) + call MAPL_GetPointer ( INTERNAL, du005, 'GOCART::du005', __RC__ ) + +! Local bounds +! ------------ + _ASSERT( associated(du001), 'needs informative message' ) + tracer => du001 + i1 = lbound(tracer,1) + j1 = lbound(tracer,2) + k1 = lbound(tracer,3) + i2 = ubound(tracer,1) + j2 = ubound(tracer,2) + k2 = ubound(tracer,3) + + _ASSERT( (k2-k1+1) == 72,'needs informative message') + +! Fill typical values +! ------------------- + do j = j1, j2 + do i = i1, i2 + +! Dust (15Jul2008, 18W, 22N) +! -------------------------- + if (associated(du001)) du001(i,j,:) = 1.0e-12 * & + (/ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, & + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 10, 15, 39, & + 280, 1417, 1874, 1750, 1892, 2700, 4643, 5450, 7116, 9183, & + 8906, 9838, 7757, 4577, 5341, 17317, 32480, 63214, 82073, 94646, & + 102213, 102097, 100700, 93948, 91736, 91387, 90106, 88010, 85566, & + 81840, 80211, 77067, 74390, 69617, 53261, 23545, 9299 /) + if (associated(du002)) du002(i,j,:) = 1.0e-12 * & + (/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, & + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 44, & + 568, 2231, 3024, 4148, 6563, 12137, 14465, 19064, 25990, 24448, & + 28202, 22731, 13316, 15222, 47207, 88942, 172528, 225846, 262168, & + 285451, 287779, 282657, 269153, 262168, 259839, 255649, 249595, & + 243076, 232831, 228640, 220025, 212342, 199304, 153436, 68569, & + 26863 /) + if (associated(du003)) du003(i,j,:) = 1.0e-12 * & + (/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, & + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, & + 30, 233, 686, 1638, 3147, 7349, 9707, 13563, 20286, 19151, & + 23196, 19471, 11366, 12471, 37021, 71712, 141329, 189990, 224915, & + 247732, 258443, 256114, 252389, 247732, 246801, 243076, 237255, & + 230503, 221190, 217231, 210247, 205357, 197208, 159257, 76253, & + 29861 /) + if (associated(du004)) du004(i,j,:) = 1.0e-12 * & + (/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, & + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, & + 1, 2, 7, 33, 122, 736, 1361, 2263, 4999, 5574, 8091, 7902, & + 5625, 5407, 12195, 23633, 47323, 69151, 87079, 105938, 120141, & + 131084, 139000, 146451, 148081, 147149, 144588, 141096, 137836, & + 137138, 138535, 142027, 146917, 138535, 86264, 44355 /) + if (associated(du005)) du005(i,j,:) = 1.0e-12 * & + (/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, & + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, & + 1, 1, 1, 1, 1, 15, 25, 27, 116, 247, 456, 754, 852, 803, & + 906, 1279, 2154, 3027, 3708, 5006, 6462, 9241, 12486, 15833, & + 18860, 20635, 21887, 22614, 24302, 25437, 31433, 42085, 55531, & + 67289, 67172, 54890 /) + +! To do: add other tracers... +! --------------------------- + + end do + end do + +! --- D E B U G --- D E B U G --- D E B U G --- D E B U G --- D E B U G --- D E B U G --- + if (MAPL_AM_I_ROOT()) then + print *, '----- Inside Fill_Internal_State -----' + print *, ' state b o u n d s = ', & + lbound(du001,1), ubound(du001,1), & + lbound(du001,2), ubound(du001,2), & + lbound(du001,3), ubound(du001,3) + print *, '----- Inside Fill_Internal_State -----' + end if +! --- D E B U G --- D E B U G --- D E B U G --- D E B U G --- D E B U G --- D E B U G --- + + end subroutine Fill_Internal_State_ + +end Program ut_GOCART + diff --git a/ESMF/NUOPC/NUOPC_Cap.F90 b/ESMF/NUOPC/NUOPC_Cap.F90 new file mode 100644 index 00000000..e69de29b diff --git a/ESMF/Shared/CMakeLists.txt b/ESMF/Shared/CMakeLists.txt new file mode 100644 index 00000000..1512a93b --- /dev/null +++ b/ESMF/Shared/CMakeLists.txt @@ -0,0 +1,23 @@ +esma_set_this (OVERRIDE Chem_Shared2G) + +set (srcs + Chem_AeroGeneric.F90 + ) + +esma_add_library(${this} + SRCS ${srcs} + DEPENDENCIES MAPL) + +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/@GSW ) + set (gsw_ECBUILD_SYSTEM_INCLUDED TRUE) +endif() + +esma_add_subdirectories ( + MAPL + NCEP_Shared + GMAO_Shared + Chem_Shared + Chem_Base +) diff --git a/ESMF/Shared/Chem_AeroGeneric.F90 b/ESMF/Shared/Chem_AeroGeneric.F90 new file mode 100644 index 00000000..e8b4e207 --- /dev/null +++ b/ESMF/Shared/Chem_AeroGeneric.F90 @@ -0,0 +1,302 @@ + +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling & Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! + +! !MODULE: Aerosol_Callbacks --- Call back methods for aerosol optics. +! +! +! !INTERFACE: +! +module Chem_AeroGeneric + +! !USES: + use ESMF + use MAPL +! USE Chem_MieMod2G + + implicit none + private + +! +! !PUBLIC MEMBER FUNCTIONS: + public add_aero + public append_to_bundle + public determine_data_driven + public setZeroKlid + public setZeroKlid4d + public findKlid +! +! !DESCRIPTION: +! +! These modules compute aerosol optical properties for GOCART2G. +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco - Initial code. +! 11Jul2005 da Silva Standardization. +! 30Dec2019 Sherman, da Silva, Darmenov, Clune - 2nd Gen. Made ESMF compliant. +! No longer relies on Chem_Reg +! +!EOP +!------------------------------------------------------------------------- +contains + + +!==================================================================================== + subroutine add_aero (state, label, label2, grid, typekind, ptr, rc) + +! Description: Adds fields to aero state for aerosol optics calcualtions. + + implicit none + + type (ESMF_State), intent(inout) :: state + character (len=*), intent(in ) :: label + character (len=*), intent(in ) :: label2 + type (ESMF_Grid), intent(inout) :: grid + integer, intent(in ) :: typekind + real, pointer, dimension(:,:,:), optional, intent(in ) :: ptr + integer, intent( out) :: rc + + ! locals + type (ESMF_Field) :: field + character (len=ESMF_MAXSTR) :: field_name + + __Iam__('add_aero') + +!---------------------------------------------------------------------------------- +! Begin... + + call ESMF_AttributeSet (state, name=trim(label), value=trim(label2), __RC__) + + call ESMF_AttributeGet (state, name=trim(label), value=field_name, __RC__) + if (field_name /= '') then + field = MAPL_FieldCreateEmpty(trim(field_name), grid, __RC__) + if (trim(field_name) == 'PLE') then + call MAPL_FieldAllocCommit (field, dims=MAPL_DimsHorzVert, location=MAPL_VLocationEdge, typekind=typekind, hw=0, __RC__) + else + call MAPL_FieldAllocCommit (field, dims=MAPL_DimsHorzVert, location=MAPL_VLocationCenter, typekind=typekind, hw=0, __RC__) + end if + call MAPL_StateAdd (state, field, __RC__) + end if + +! if (field_name /= '') then +! field = ptr +! call MAPL_StateAdd (state, field, __RC__) +! end if + + RETURN_(ESMF_SUCCESS) + + end subroutine add_aero + +!===================================================================================== + + subroutine determine_data_driven(COMP_NAME, data_driven, RC) + + !ARGUMENTS: + integer, optional, intent( out) :: RC ! Error code: + character (len=ESMF_MAXSTR), intent(in ) :: COMP_NAME + logical, intent( out) :: data_driven + + !Local + integer :: i + +! Description: Determines whether gridded component is data driven or not. + + __Iam__('determine_data_driven') + +! Begin... + +! Is DU data driven? +! ------------------ + data_driven = .false. + + i = index(COMP_NAME, 'data') + if (i > 0) then + data_driven = .true. + end if + + RETURN_(ESMF_SUCCESS) + + end subroutine determine_data_driven + +!===================================================================================== + + subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) + + implicit none + +! !ARGUMENTS: + character (len=*), intent(in ) :: varName, prefix + type (ESMF_State), intent(in ) :: providerState + type (ESMF_FieldBundle), intent(inout) :: bundle + integer, intent( out) :: rc ! return code + +! !Local + type (ESMF_Field) :: field + +! Description: Adds deposition variables to deposition bundle + + __Iam__('append_to_bundle') + +! Dry deposition +! --------------- + call ESMF_StateGet (providerState, trim(prefix)//trim(varName), field, __RC__) + call MAPL_AllocateCoupling (field, __RC__) + call MAPL_FieldBundleAdd (bundle, field, __RC__) + + RETURN_(ESMF_SUCCESS) + + end subroutine append_to_bundle + +!=================================================================================== +!BOP +! !IROUTINE: setZeroKlid + subroutine setZeroKlid(km, klid, int_ptr) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! total model levels + integer, intent(in) :: klid ! index for pressure level + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: int_ptr ! aerosol pointer + +! !DESCRIPTION: Set values to 0 where above klid +! +! !REVISION HISTORY: +! +! 25Aug2020 E.Sherman - Written +! +! !Local Variables + integer :: k + +!EOP +!---------------------------------------------------------------------------------- +! Begin... + + do k = 1, km + if (k < klid) then + int_ptr(:,:,k) = 0.0 + else if (k >= klid) then + exit + end if + end do + + end subroutine setZeroKlid +!=================================================================================== +!BOP +! !IROUTINE: setZeroKlid + subroutine setZeroKlid4d (km, klid, int_ptr) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! total model levels + integer, intent(in) :: klid ! index for pressure level + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:,:), intent(inout) :: int_ptr ! aerosol pointer + +! !DESCRIPTION: Set values to 0 where above klid +! +! !REVISION HISTORY: +! +! 25Aug2020 E.Sherman - Written +! +! !Local Variables + integer :: k, n + +!EOP +!---------------------------------------------------------------------------------- +! Begin... + + do n = 1, ubound(int_ptr, 4) + do k = 1, km + if (k < klid) then + int_ptr(:,:,k,n) = 0.0 + else if (k >= klid) then + exit + end if + end do + end do + + end subroutine setZeroKlid4d + + +!=================================================================================== +!BOP +! !IROUTINE: findKlid + subroutine findKlid (klid, plid, ple, rc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(inout) :: klid ! index for pressure lid + real, intent(in) :: plid ! pressure lid [hPa] + real, dimension(:,:,:), intent(in) :: ple ! air pressure [Pa] + +! !OUTPUT PARAMETERS: + integer, intent(out) :: rc ! return code; 0 - all is good +! 1 - bad + +! !DESCRIPTION: Finds corresponding vertical index for defined pressure lid +! +! !REVISION HISTORY: +! +! 25Aug2020 E.Sherman - Written +! +! !Local Variables + integer :: k, j, i + real :: plid_, diff, refDiff + real, allocatable, dimension(:) :: pres ! pressure at each model level [Pa] + +!EOP +!---------------------------------------------------------------------------------- +! Begin... + klid = 1 + rc = 0 + +! convert from hPa to Pa + plid_ = plid*100.0 + + allocate(pres(ubound(ple,3))) + +! find pressure at each model level + do k = 1, ubound(ple,3) + pres(k) = ple(1,1,k) + end do + +! find smallest absolute difference between plid and average pressure at each model level + refDiff = 150000.0 + do k = 1, ubound(ple,3) + diff = abs(pres(k) - plid_) + if (diff < refDiff) then + klid = k + refDiff = diff + end if + end do + +! Check to make sure that all pressures at (i,j) were the same + do j = 1, ubound(ple,2) + do i = 1, ubound(ple,1) + if (pres(klid) /= ple(i,j,klid)) then + rc = 1 + return + end if + end do + end do + + end subroutine findKlid + +end module Chem_AeroGeneric + + diff --git a/ESMF/Shared/Chem_Base/Aod-550nm_Registry.rc b/ESMF/Shared/Chem_Base/Aod-550nm_Registry.rc new file mode 100755 index 00000000..a939d336 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Aod-550nm_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 5.5e-7 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/Aod3d_1064nm.rc b/ESMF/Shared/Chem_Base/Aod3d_1064nm.rc new file mode 100644 index 00000000..e9abe52b --- /dev/null +++ b/ESMF/Shared/Chem_Base/Aod3d_1064nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1.064e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [1064 nm] +ssa none Aerosol Single Scatter Albedo [1064 nm] +tau none Aerosol Layer Optical Thickness [1064 nm] +depol none Aerosol Depolarization Ratio [1064 nm] +backscat km-1sr-1 Aerosol Backscatter [1064 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [1064 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [1064 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [1064 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/Aod3d_355nm.rc b/ESMF/Shared/Chem_Base/Aod3d_355nm.rc new file mode 100644 index 00000000..69235b28 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Aod3d_355nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.355e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [355 nm] +ssa none Aerosol Single Scatter Albedo [355 nm] +tau none Aerosol Layer Optical Thickness [355 nm] +depol none Aerosol Depolarization Ratio [355 nm] +backscat km-1sr-1 Aerosol Backscatter [355 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [355 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [355 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [355 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/Aod3d_532nm.rc b/ESMF/Shared/Chem_Base/Aod3d_532nm.rc new file mode 100644 index 00000000..cb0b7f6d --- /dev/null +++ b/ESMF/Shared/Chem_Base/Aod3d_532nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +depol none Aerosol Depolarization Ratio [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/AodBands_Registry.rc b/ESMF/Shared/Chem_Base/AodBands_Registry.rc new file mode 100755 index 00000000..45ed37af --- /dev/null +++ b/ESMF/Shared/Chem_Base/AodBands_Registry.rc @@ -0,0 +1,116 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1 2 3 4 5 6 7 8 + +filename_optical_properties_DU: ExtData/PIESA/x/opticsBands_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/opticsBands_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/opticsBands_OC.v1_3.nc +filename_optical_properties_BC: ExtData/PIESA/x/opticsBands_BC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/opticsBands_BRC.v1_5.nc +filename_optical_properties_SU: ExtData/PIESA/x/opticsBands_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/opticsBands_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH01 none SW Band 1 +CH02 none SW Band 2 +CH03 none SW Band 3 +CH04 none SW Band 4 +CH05 none SW Band 5 +CH06 none SW Band 6 +CH07 none SW Band 7 +CH08 none SW Band 8 +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/Aod_CALIPSO.rc b/ESMF/Shared/Chem_Base/Aod_CALIPSO.rc new file mode 100644 index 00000000..908994ef --- /dev/null +++ b/ESMF/Shared/Chem_Base/Aod_CALIPSO.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/Aod_EOS.rc b/ESMF/Shared/Chem_Base/Aod_EOS.rc new file mode 100644 index 00000000..1d0b8def --- /dev/null +++ b/ESMF/Shared/Chem_Base/Aod_EOS.rc @@ -0,0 +1,121 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- + +# OMI SO2: 305, 310, 324, 380, 440, 500 +# OMI Aerosol: 354 [~340] 388 [~380] 471 [~470] +# MODIS: .47e-6 .55e-6 .659e-6 [~670] .865e-6 1.24e-6 1.64e-6 2.13e-6 +# MISR: 468 [~470] 558 [~550] 672 [~670] 867 [~865] +# PARASOL: 670 [~670] 865 +# AERONET: 340 380 440 500 675 [~670] 870 [~865] 1020 1640 + +n_channels: 12 +r_channels: .340e-6 .380e-6 .440e-6 .470e-6 .500e-6 .55e-6 .670e-6 .865e-6 1.02e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/Aod_MODIS.rc b/ESMF/Shared/Chem_Base/Aod_MODIS.rc new file mode 100644 index 00000000..0b1411be --- /dev/null +++ b/ESMF/Shared/Chem_Base/Aod_MODIS.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 7 + +r_channels: .47e-6 .55e-6 .659e-6 .865e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/Aod_Registry.rc b/ESMF/Shared/Chem_Base/Aod_Registry.rc new file mode 100755 index 00000000..5c079045 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Aod_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 4 + +r_channels: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CCMI_REF-C1/Aod_Registry.rc b/ESMF/Shared/Chem_Base/CCMI_REF-C1/Aod_Registry.rc new file mode 100755 index 00000000..5c079045 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CCMI_REF-C1/Aod_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 4 + +r_channels: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CCMI_REF-C1/Chem_Mie.rc b/ESMF/Shared/Chem_Base/CCMI_REF-C1/Chem_Mie.rc new file mode 100644 index 00000000..fa2d902a --- /dev/null +++ b/ESMF/Shared/Chem_Base/CCMI_REF-C1/Chem_Mie.rc @@ -0,0 +1,15 @@ +# +# Resorce file for Chem_Mie Module. Defines filename with LUTs and +# available channels +# + +Chem_Mie::du_optics_file: ExtData/PIESA/x/opticsBands_DU.v15_3.nc +Chem_Mie::ss_optics_file: ExtData/PIESA/x/opticsBands_SS.v3_3.nc +Chem_Mie::su_optics_file: ExtData/PIESA/x/opticsBands_SU.v1_3.nc +Chem_Mie::ni_optics_file: ExtData/PIESA/x/opticsBands_NI.v2_5.nc +Chem_Mie::oc_optics_file: ExtData/PIESA/x/opticsBands_OC.v1_3.nc +Chem_Mie::brc_optics_file: ExtData/PIESA/x/opticsBands_BRC.v1_5.nc +Chem_Mie::bc_optics_file: ExtData/PIESA/x/opticsBands_BC.v1_3.nc + +Chem_Mie::channels: 1 2 3 4 5 6 7 8 + diff --git a/ESMF/Shared/Chem_Base/CCMI_REF-C1/Chem_MieRegistry.rc b/ESMF/Shared/Chem_Base/CCMI_REF-C1/Chem_MieRegistry.rc new file mode 100755 index 00000000..fe2cca69 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CCMI_REF-C1/Chem_MieRegistry.rc @@ -0,0 +1,459 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# XX lists Stratchem's inferred species. See Chem_Registry.rc +# for GMIchem's XX (non-transported) species list. +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to mol/mol +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # carbon monoxide +doing_CO2: no # carbon dioxide +doing_DU: yes # mineral dust +doing_SS: yes # sea salt +doing_SU: yes # sulfates +doing_CFC: no # CFCs +doing_BC: yes # black carbon +doing_OC: yes # organic carbon +doing_BRC: no # brown carbon +doing_NI: no # nitrate +doing_Rn: no # radon +doing_CH4: no # methane +doing_SC: no # stratospheric chemistry +doing_GMI: no # GMI chemistry (GEOS-5) +doing_XX: no # generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: no # passive tracers + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 10 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 8 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC: 34 # stratospheric chemistry +nbins_XX: 18 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 10 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Global carbon monoxide +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +REDUCED +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 cm-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +st80_25 'mol mol-1' Stratosphere source 25 day tracer +CO_50_na 'mol mol-1' Anthro CO North America 50 day tracer +SF6 'mol mol-1' Sulfur Hexafluoride tracer +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant emission 90 day tracer +Rn222 'mol mol-1' Radon-222 +Pb210 'mol mol-1' Lead-210 +Be7 'mol mol-1' Beryllium radionuclide 7(Be) +Be10 'mol mol-1' Beryllium radionuclide 10(Be) +CH3I 'mol mol-1' Methyl iodide +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers diff --git a/ESMF/Shared/Chem_Base/CCMI_REF-C1/Chem_Registry.rc b/ESMF/Shared/Chem_Base/CCMI_REF-C1/Chem_Registry.rc new file mode 100644 index 00000000..ad843c3f --- /dev/null +++ b/ESMF/Shared/Chem_Base/CCMI_REF-C1/Chem_Registry.rc @@ -0,0 +1,638 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# Beginning with Heracles-1_0, four TR tracers are enabled in the +# default configuration. For the complete list of TR tracers, see +# Chem_MieRegistry.rc. +# +# StratChem can be run with Full or Reduced equation sets. +# When running Full, the string SC_f should be changed to SC. +# When running Reduced, the string SC_r should be changed to SC. +# This will be automatically done by stratchem_setup script. +# +# XX lists contain non-transported species for GMI and StratChem. +# When running GMI, the string XX_GMI should be changed to XX. +# When running StratChem, the string XX_SC should be changed to XX. +# This will be automatically done by the setup scripts. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to 'mol mol-1' +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + # &Label Active Constituents + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # &YesNo Include carbon monoxide? +doing_CO2: no # &YesNo Include carbon dioxide? +doing_DU: yes # &YesNo Include mineral dust? +doing_SS: yes # &YesNo Include sea salt? +doing_SU: yes # &YesNo Include sulfates? +doing_CFC: no # &YesNo Include CFCs? +doing_BC: yes # &YesNo Include black carbon? +doing_OC: yes # &YesNo Include organic carbon? +doing_BRC: no # &YesNo Include brown carbon? +doing_NI: no # &YesNo Include nitrate? +doing_Rn: no # &YesNo include Radon? +doing_CH4: no # &YesNo include Methane? +doing_SC: no # &YesNo Include stratospheric chemistry? +doing_GMI: yes # &YesNo GMI chemistry (GEOS-5) +doing_XX: yes # &YesNo generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: yes # &YesNo run passive tracers? + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 8 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC_f: 52 # stratospheric chemistry (full) +nbins_XX_SC_f: 18 # stratchem (full) non-transported species +nbins_SC_r: 33 # stratospheric chemistry (reduced) +nbins_XX_SC_r: 37 # stratchem (reduced) non-transported species +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_XX_GMI: 48 # GMI non-transported species +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 21 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Carbon Monoxide (All Sources) +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide (All Sources) +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +OCphobicbbbo 'kg kg-1' Hydrophobic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphilicbbbo 'kg kg-1' Hydrophilic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphobicbbnb 'kg kg-1' Hydrophobic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +OCphilicbbnb 'kg kg-1' Hydrophilic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 cm-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +H 'mol mol-1' Ground state atomic hydrogen (2S) +MO2 'mol mol-1' Methylperoxy radical (CH3O2) +N 'mol mol-1' Ground state atomic nitrogen +O 'mol mol-1' Ground state atomic oxygen (3P) +O1D 'mol mol-1' First excited singlet state of atomic oxygen (1D) +A3O2 'mol mol-1' Primary RO2 (C3H7O2) from propane +ATO2 'mol mol-1' RO2 from acetone (C3H6O3) +B3O2 'mol mol-1' Secondary RO2 (C3H7O2) from propane +EOH 'mol mol-1' Ethanol +ETO2 'mol mol-1' Ethylperoxy radical (C2H5O2) +GLYC 'mol mol-1' Glycolaldehyde (Hydroxyacetaldehyde C2H4O2) +GLYX 'mol mol-1' Glyoxal (2CHO) +IAO2 'mol mol-1' RO2 (C5H9O5) from isoprene oxidation products +INO2 'mol mol-1' RO2 (C5H8O3N) from ISOP+NO3 +INPN 'mol mol-1' Peroxide (C5H8O6N2) from INO2 +ISN1 'mol mol-1' RO2 (C4H7O4N) from ISN2 +ISNP 'mol mol-1' Peroxide (C4H7O4N) from ISN1 +KO2 'mol mol-1' RO2 (C4H7O3) from C3 ketones +MAN2 'mol mol-1' RO2 (C4H6O6N) from MACR+NO3 +MAO3 'mol mol-1' Peroxyacyl (C4H5O3) from MACR and MVK +MAOP 'mol mol-1' Peroxide (C4H6O3) from MAO3 +MAP 'mol mol-1' Peroxyacetic acid (C2H4O3) +MCO3 'mol mol-1' Peroxyacetyl radical (C2H3O3) +MGLY 'mol mol-1' Methylglyoxal (C3H4O2) +MRO2 'mol mol-1' RO2 (C4H7O4) from MACR+OH +MRP 'mol mol-1' Peroxide (C4H8O4) from MRO2 +PO2 'mol mol-1' RO2 (C3H7O3) from propene +PP 'mol mol-1' Peroxide (C3H8O3) from PO2 +PRN1 'mol mol-1' RO2 (C3H6O3N) from propene+NO3 +PRPN 'mol mol-1' Peroxide (C3H6O3N) from PRN1 +R4N1 'mol mol-1' RO2 (C4H9O3N) from R4N2 +R4O2 'mol mol-1' RO2 (C4H9O2) from ALK4 +R4P 'mol mol-1' Peroxide (C4H10O2) from R4O2 +RA3P 'mol mol-1' Peroxy propyl alcohol (C3H8O2) from A3O2 +RB3P 'mol mol-1' Peroxide (C3H8O2) from B3O2 +RCO3 'mol mol-1' Peroxypropionyl radical (C3H5O3) +RIO1 'mol mol-1' RO2 (C5H9O3) from isoprene oxydation products +RIO2 'mol mol-1' RO2 (C5H9O3) from isoprene +RIP 'mol mol-1' Peroxide (C5H10O3) from RIO2 +ROH 'mol mol-1' C2 alcohols +RP 'mol mol-1' Methacrolein peroxy acid (C4H6O3) +VRO2 'mol mol-1' RO2 (C4H7O4) from MVK+OH +VRP 'mol mol-1' Peroxide (C4H8O4) from VRO2 +OCSg 'mol mol-1' Carbonyl sulfide in GMI +ACET 'mol mol-1' Acetone +O2 cm-3 Molecular oxygen +NUMDENS cm-3 Total number density +T2M15d K Daily T2M time average +:: + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +nh_5 'mol mol-1' Northern Hemisphere 5 day tracer +nh_50 'mol mol-1' Northern Hemisphere 50 day tracer +aoa_nh days Age of air northern hemisphere tracer +st80_25 'mol mol-1' Stratospheric source 25 day tracer +CO_25 'mol mol-1' Anthro CO 25 day tracer +CO_50 'mol mol-1' Anthro CO 50 day tracer +CO_50_ea 'mol mol-1' Anthro CO 50 day tracer East Asia +CO_50_na 'mol mol-1' Anthro CO 50 day tracer North America +CO_50_eu 'mol mol-1' Anthro CO 50 day tracer Europe +CO_50_sa 'mol mol-1' Anthro CO 50 day tracer South Asia +SF6 'mol mol-1' Sulfur Hexaflouride +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant burden 90 day tracer +e90_n 'mol mol-1' Constant burden 90 day tracer 40N-pole emiss +e90_s 'mol mol-1' Constant burden 90 day tracer 40S-pole emiss +Be7 'kg kg-1' Beryllium-7 +Be10 'kg kg-1' Beryllium-10 +CH3I 'mol mol-1' Methyl iodide +Pb210 'kg kg-1' Lead-210 +Rn222 'kg kg-1' Radon-222 +stOX 'mol mol-1' Strat Ozone with chemical loss +Be7s 'kg kg-1' Beryllium radionuclide 7(Be) strat-source +Be10s 'kg kg-1' Beryllium radionuclide 10(Be) strat-source +Pb210s 'kg kg-1' Lead-210 strat-source +CO_GLB 'mol mol-1' CO 50 day tracer Global CMIP6+M2G +CO_NAM 'mol mol-1' CO 50 day tracer North America CMIP6+M2G +CO_EUR 'mol mol-1' CO 50 day tracer Europe CMIP6+M2G +CO_SAS 'mol mol-1' CO 50 day tracer South Asia CMIP6+M2G +CO_EAS 'mol mol-1' CO 50 day tracer East Asia CMIP6+M2G +CO_SEA 'mol mol-1' CO 50 day tracer Southeast Asia CMIP6+M2G +CO_ANZ 'mol mol-1' CO 50 day tracer Australia & New Zealand CMIP6+M2G +CO_NAF 'mol mol-1' CO 50 day tracer North Africa CMIP6+M2G +CO_RAF 'mol mol-1' CO 50 day tracer Rest of Africa CMIP6+M2G +CO_MDE 'mol mol-1' CO 50 day tracer Middle East CMIP6+M2G +CO_CAM 'mol mol-1' CO 50 day tracer Central America CMIP6+M2G +CO_SAM 'mol mol-1' CO 50 day tracer South America CMIP6+M2G +CO_RBU 'mol mol-1' CO 50 day tracer Russia & Belarus & Ukraine CMIP6+M2G +CO_CAS 'mol mol-1' CO 50 day tracer Central Asia CMIP6+M2G +CO_ARC 'mol mol-1' CO 50 day tracer Arctic CMIP6+M2G +CO_from_CH4 'mol mol-1' CO from global average CH4 oxidation +aoa_bl days Age of air above boundary layer +:: + + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers + diff --git a/ESMF/Shared/Chem_Base/CCMI_REF-C2/Aod_Registry.rc b/ESMF/Shared/Chem_Base/CCMI_REF-C2/Aod_Registry.rc new file mode 100755 index 00000000..55645524 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CCMI_REF-C2/Aod_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 4 + +r_channels: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CCMI_REF-C2/Chem_Mie.rc b/ESMF/Shared/Chem_Base/CCMI_REF-C2/Chem_Mie.rc new file mode 100644 index 00000000..d937c304 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CCMI_REF-C2/Chem_Mie.rc @@ -0,0 +1,14 @@ +# +# Resorce file for Chem_Mie Module. Defines filename with LUTs and +# available channels +# + +Chem_Mie::du_optics_file: ExtData/PIESA/x/opticsBands_DU.v15_3.nc +Chem_Mie::ss_optics_file: ExtData/PIESA/x/opticsBands_SS.v3_3.nc +Chem_Mie::su_optics_file: ExtData/PIESA/x/opticsBands_SU.v1_3.nc +Chem_Mie::ni_optics_file: ExtData/PIESA/x/opticsBands_NI.v2_5.nc +Chem_Mie::oc_optics_file: ExtData/PIESA/x/opticsBands_OC.v1_3.nc +Chem_Mie::bc_optics_file: ExtData/PIESA/x/opticsBands_BC.v1_3.nc + +Chem_Mie::channels: 1 2 3 4 5 6 7 8 + diff --git a/ESMF/Shared/Chem_Base/CCMI_REF-C2/Chem_MieRegistry.rc b/ESMF/Shared/Chem_Base/CCMI_REF-C2/Chem_MieRegistry.rc new file mode 100755 index 00000000..fe2cca69 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CCMI_REF-C2/Chem_MieRegistry.rc @@ -0,0 +1,459 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# XX lists Stratchem's inferred species. See Chem_Registry.rc +# for GMIchem's XX (non-transported) species list. +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to mol/mol +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # carbon monoxide +doing_CO2: no # carbon dioxide +doing_DU: yes # mineral dust +doing_SS: yes # sea salt +doing_SU: yes # sulfates +doing_CFC: no # CFCs +doing_BC: yes # black carbon +doing_OC: yes # organic carbon +doing_BRC: no # brown carbon +doing_NI: no # nitrate +doing_Rn: no # radon +doing_CH4: no # methane +doing_SC: no # stratospheric chemistry +doing_GMI: no # GMI chemistry (GEOS-5) +doing_XX: no # generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: no # passive tracers + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 10 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 8 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC: 34 # stratospheric chemistry +nbins_XX: 18 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 10 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Global carbon monoxide +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +REDUCED +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 cm-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +st80_25 'mol mol-1' Stratosphere source 25 day tracer +CO_50_na 'mol mol-1' Anthro CO North America 50 day tracer +SF6 'mol mol-1' Sulfur Hexafluoride tracer +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant emission 90 day tracer +Rn222 'mol mol-1' Radon-222 +Pb210 'mol mol-1' Lead-210 +Be7 'mol mol-1' Beryllium radionuclide 7(Be) +Be10 'mol mol-1' Beryllium radionuclide 10(Be) +CH3I 'mol mol-1' Methyl iodide +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers diff --git a/ESMF/Shared/Chem_Base/CCMI_REF-C2/Chem_Registry.rc b/ESMF/Shared/Chem_Base/CCMI_REF-C2/Chem_Registry.rc new file mode 100644 index 00000000..ad843c3f --- /dev/null +++ b/ESMF/Shared/Chem_Base/CCMI_REF-C2/Chem_Registry.rc @@ -0,0 +1,638 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# Beginning with Heracles-1_0, four TR tracers are enabled in the +# default configuration. For the complete list of TR tracers, see +# Chem_MieRegistry.rc. +# +# StratChem can be run with Full or Reduced equation sets. +# When running Full, the string SC_f should be changed to SC. +# When running Reduced, the string SC_r should be changed to SC. +# This will be automatically done by stratchem_setup script. +# +# XX lists contain non-transported species for GMI and StratChem. +# When running GMI, the string XX_GMI should be changed to XX. +# When running StratChem, the string XX_SC should be changed to XX. +# This will be automatically done by the setup scripts. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to 'mol mol-1' +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + # &Label Active Constituents + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # &YesNo Include carbon monoxide? +doing_CO2: no # &YesNo Include carbon dioxide? +doing_DU: yes # &YesNo Include mineral dust? +doing_SS: yes # &YesNo Include sea salt? +doing_SU: yes # &YesNo Include sulfates? +doing_CFC: no # &YesNo Include CFCs? +doing_BC: yes # &YesNo Include black carbon? +doing_OC: yes # &YesNo Include organic carbon? +doing_BRC: no # &YesNo Include brown carbon? +doing_NI: no # &YesNo Include nitrate? +doing_Rn: no # &YesNo include Radon? +doing_CH4: no # &YesNo include Methane? +doing_SC: no # &YesNo Include stratospheric chemistry? +doing_GMI: yes # &YesNo GMI chemistry (GEOS-5) +doing_XX: yes # &YesNo generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: yes # &YesNo run passive tracers? + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 8 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC_f: 52 # stratospheric chemistry (full) +nbins_XX_SC_f: 18 # stratchem (full) non-transported species +nbins_SC_r: 33 # stratospheric chemistry (reduced) +nbins_XX_SC_r: 37 # stratchem (reduced) non-transported species +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_XX_GMI: 48 # GMI non-transported species +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 21 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Carbon Monoxide (All Sources) +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide (All Sources) +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +OCphobicbbbo 'kg kg-1' Hydrophobic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphilicbbbo 'kg kg-1' Hydrophilic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphobicbbnb 'kg kg-1' Hydrophobic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +OCphilicbbnb 'kg kg-1' Hydrophilic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 cm-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +H 'mol mol-1' Ground state atomic hydrogen (2S) +MO2 'mol mol-1' Methylperoxy radical (CH3O2) +N 'mol mol-1' Ground state atomic nitrogen +O 'mol mol-1' Ground state atomic oxygen (3P) +O1D 'mol mol-1' First excited singlet state of atomic oxygen (1D) +A3O2 'mol mol-1' Primary RO2 (C3H7O2) from propane +ATO2 'mol mol-1' RO2 from acetone (C3H6O3) +B3O2 'mol mol-1' Secondary RO2 (C3H7O2) from propane +EOH 'mol mol-1' Ethanol +ETO2 'mol mol-1' Ethylperoxy radical (C2H5O2) +GLYC 'mol mol-1' Glycolaldehyde (Hydroxyacetaldehyde C2H4O2) +GLYX 'mol mol-1' Glyoxal (2CHO) +IAO2 'mol mol-1' RO2 (C5H9O5) from isoprene oxidation products +INO2 'mol mol-1' RO2 (C5H8O3N) from ISOP+NO3 +INPN 'mol mol-1' Peroxide (C5H8O6N2) from INO2 +ISN1 'mol mol-1' RO2 (C4H7O4N) from ISN2 +ISNP 'mol mol-1' Peroxide (C4H7O4N) from ISN1 +KO2 'mol mol-1' RO2 (C4H7O3) from C3 ketones +MAN2 'mol mol-1' RO2 (C4H6O6N) from MACR+NO3 +MAO3 'mol mol-1' Peroxyacyl (C4H5O3) from MACR and MVK +MAOP 'mol mol-1' Peroxide (C4H6O3) from MAO3 +MAP 'mol mol-1' Peroxyacetic acid (C2H4O3) +MCO3 'mol mol-1' Peroxyacetyl radical (C2H3O3) +MGLY 'mol mol-1' Methylglyoxal (C3H4O2) +MRO2 'mol mol-1' RO2 (C4H7O4) from MACR+OH +MRP 'mol mol-1' Peroxide (C4H8O4) from MRO2 +PO2 'mol mol-1' RO2 (C3H7O3) from propene +PP 'mol mol-1' Peroxide (C3H8O3) from PO2 +PRN1 'mol mol-1' RO2 (C3H6O3N) from propene+NO3 +PRPN 'mol mol-1' Peroxide (C3H6O3N) from PRN1 +R4N1 'mol mol-1' RO2 (C4H9O3N) from R4N2 +R4O2 'mol mol-1' RO2 (C4H9O2) from ALK4 +R4P 'mol mol-1' Peroxide (C4H10O2) from R4O2 +RA3P 'mol mol-1' Peroxy propyl alcohol (C3H8O2) from A3O2 +RB3P 'mol mol-1' Peroxide (C3H8O2) from B3O2 +RCO3 'mol mol-1' Peroxypropionyl radical (C3H5O3) +RIO1 'mol mol-1' RO2 (C5H9O3) from isoprene oxydation products +RIO2 'mol mol-1' RO2 (C5H9O3) from isoprene +RIP 'mol mol-1' Peroxide (C5H10O3) from RIO2 +ROH 'mol mol-1' C2 alcohols +RP 'mol mol-1' Methacrolein peroxy acid (C4H6O3) +VRO2 'mol mol-1' RO2 (C4H7O4) from MVK+OH +VRP 'mol mol-1' Peroxide (C4H8O4) from VRO2 +OCSg 'mol mol-1' Carbonyl sulfide in GMI +ACET 'mol mol-1' Acetone +O2 cm-3 Molecular oxygen +NUMDENS cm-3 Total number density +T2M15d K Daily T2M time average +:: + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +nh_5 'mol mol-1' Northern Hemisphere 5 day tracer +nh_50 'mol mol-1' Northern Hemisphere 50 day tracer +aoa_nh days Age of air northern hemisphere tracer +st80_25 'mol mol-1' Stratospheric source 25 day tracer +CO_25 'mol mol-1' Anthro CO 25 day tracer +CO_50 'mol mol-1' Anthro CO 50 day tracer +CO_50_ea 'mol mol-1' Anthro CO 50 day tracer East Asia +CO_50_na 'mol mol-1' Anthro CO 50 day tracer North America +CO_50_eu 'mol mol-1' Anthro CO 50 day tracer Europe +CO_50_sa 'mol mol-1' Anthro CO 50 day tracer South Asia +SF6 'mol mol-1' Sulfur Hexaflouride +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant burden 90 day tracer +e90_n 'mol mol-1' Constant burden 90 day tracer 40N-pole emiss +e90_s 'mol mol-1' Constant burden 90 day tracer 40S-pole emiss +Be7 'kg kg-1' Beryllium-7 +Be10 'kg kg-1' Beryllium-10 +CH3I 'mol mol-1' Methyl iodide +Pb210 'kg kg-1' Lead-210 +Rn222 'kg kg-1' Radon-222 +stOX 'mol mol-1' Strat Ozone with chemical loss +Be7s 'kg kg-1' Beryllium radionuclide 7(Be) strat-source +Be10s 'kg kg-1' Beryllium radionuclide 10(Be) strat-source +Pb210s 'kg kg-1' Lead-210 strat-source +CO_GLB 'mol mol-1' CO 50 day tracer Global CMIP6+M2G +CO_NAM 'mol mol-1' CO 50 day tracer North America CMIP6+M2G +CO_EUR 'mol mol-1' CO 50 day tracer Europe CMIP6+M2G +CO_SAS 'mol mol-1' CO 50 day tracer South Asia CMIP6+M2G +CO_EAS 'mol mol-1' CO 50 day tracer East Asia CMIP6+M2G +CO_SEA 'mol mol-1' CO 50 day tracer Southeast Asia CMIP6+M2G +CO_ANZ 'mol mol-1' CO 50 day tracer Australia & New Zealand CMIP6+M2G +CO_NAF 'mol mol-1' CO 50 day tracer North Africa CMIP6+M2G +CO_RAF 'mol mol-1' CO 50 day tracer Rest of Africa CMIP6+M2G +CO_MDE 'mol mol-1' CO 50 day tracer Middle East CMIP6+M2G +CO_CAM 'mol mol-1' CO 50 day tracer Central America CMIP6+M2G +CO_SAM 'mol mol-1' CO 50 day tracer South America CMIP6+M2G +CO_RBU 'mol mol-1' CO 50 day tracer Russia & Belarus & Ukraine CMIP6+M2G +CO_CAS 'mol mol-1' CO 50 day tracer Central Asia CMIP6+M2G +CO_ARC 'mol mol-1' CO 50 day tracer Arctic CMIP6+M2G +CO_from_CH4 'mol mol-1' CO from global average CH4 oxidation +aoa_bl days Age of air above boundary layer +:: + + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers + diff --git a/ESMF/Shared/Chem_Base/CMIP/Aod-550nm_Registry.rc b/ESMF/Shared/Chem_Base/CMIP/Aod-550nm_Registry.rc new file mode 100644 index 00000000..1f3d87b6 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Aod-550nm_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 5.5e-7 + +filename_optical_properties_DU: ExtData/CMIP/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/CMIP/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/CMIP/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/CMIP/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/CMIP/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/CMIP/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/CMIP/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CMIP/Aod3d_1064nm.rc b/ESMF/Shared/Chem_Base/CMIP/Aod3d_1064nm.rc new file mode 100644 index 00000000..df15b1b8 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Aod3d_1064nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1.064e-6 + +filename_optical_properties_DU: ExtData/CMIP/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/CMIP/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/CMIP/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/CMIP/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/CMIP/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/CMIP/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/CMIP/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [1064 nm] +ssa none Aerosol Single Scatter Albedo [1064 nm] +tau none Aerosol Layer Optical Thickness [1064 nm] +depol none Aerosol Depolarization Ratio [1064 nm] +backscat km-1sr-1 Aerosol Backscatter [1064 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [1064 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [1064 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [1064 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CMIP/Aod3d_355nm.rc b/ESMF/Shared/Chem_Base/CMIP/Aod3d_355nm.rc new file mode 100644 index 00000000..6f4b2f82 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Aod3d_355nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.355e-6 + +filename_optical_properties_DU: ExtData/CMIP/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/CMIP/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/CMIP/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/CMIP/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/CMIP/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/CMIP/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/CMIP/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [355 nm] +ssa none Aerosol Single Scatter Albedo [355 nm] +tau none Aerosol Layer Optical Thickness [355 nm] +depol none Aerosol Depolarization Ratio [355 nm] +backscat km-1sr-1 Aerosol Backscatter [355 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [355 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [355 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [355 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CMIP/Aod3d_532nm.rc b/ESMF/Shared/Chem_Base/CMIP/Aod3d_532nm.rc new file mode 100644 index 00000000..85c62e4a --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Aod3d_532nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/CMIP/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/CMIP/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/CMIP/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/CMIP/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/CMIP/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/CMIP/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/CMIP/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +depol none Aerosol Depolarization Ratio [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CMIP/AodBands_Registry.rc b/ESMF/Shared/Chem_Base/CMIP/AodBands_Registry.rc new file mode 100644 index 00000000..06038c14 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/AodBands_Registry.rc @@ -0,0 +1,116 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1 2 3 4 5 6 7 8 + +filename_optical_properties_DU: ExtData/CMIP/x/opticsBands_DU.v15_3.nc +filename_optical_properties_SS: ExtData/CMIP/x/opticsBands_SS.v3_3.nc +filename_optical_properties_OC: ExtData/CMIP/x/opticsBands_OC.v1_3.nc +filename_optical_properties_BC: ExtData/CMIP/x/opticsBands_BC.v1_3.nc +filename_optical_properties_BRC: ExtData/CMIP/x/opticsBands_BRC.v1_5.nc +filename_optical_properties_SU: ExtData/CMIP/x/opticsBands_SU.v1_3.nc +filename_optical_properties_NI: ExtData/CMIP/x/opticsBands_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH01 none SW Band 1 +CH02 none SW Band 2 +CH03 none SW Band 3 +CH04 none SW Band 4 +CH05 none SW Band 5 +CH06 none SW Band 6 +CH07 none SW Band 7 +CH08 none SW Band 8 +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CMIP/Aod_CALIPSO.rc b/ESMF/Shared/Chem_Base/CMIP/Aod_CALIPSO.rc new file mode 100644 index 00000000..24d97e11 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Aod_CALIPSO.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/CMIP/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/CMIP/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/CMIP/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/CMIP/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/CMIP/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/CMIP/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/CMIP/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CMIP/Aod_EOS.rc b/ESMF/Shared/Chem_Base/CMIP/Aod_EOS.rc new file mode 100644 index 00000000..3d3443f0 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Aod_EOS.rc @@ -0,0 +1,121 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- + +# OMI SO2: 305, 310, 324, 380, 440, 500 +# OMI Aerosol: 354 [~340] 388 [~380] 471 [~470] +# MODIS: .47e-6 .55e-6 .659e-6 [~670] .865e-6 1.24e-6 1.64e-6 2.13e-6 +# MISR: 468 [~470] 558 [~550] 672 [~670] 867 [~865] +# PARASOL: 670 [~670] 865 +# AERONET: 340 380 440 500 675 [~670] 870 [~865] 1020 1640 + +n_channels: 12 +r_channels: .340e-6 .380e-6 .440e-6 .470e-6 .500e-6 .55e-6 .670e-6 .865e-6 1.02e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/CMIP/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/CMIP/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/CMIP/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/CMIP/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/CMIP/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/CMIP/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/CMIP/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CMIP/Aod_MODIS.rc b/ESMF/Shared/Chem_Base/CMIP/Aod_MODIS.rc new file mode 100644 index 00000000..5d10c7d6 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Aod_MODIS.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 7 + +r_channels: .47e-6 .55e-6 .659e-6 .865e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/CMIP/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/CMIP/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/CMIP/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/CMIP/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/CMIP/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/CMIP/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/CMIP/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CMIP/Aod_Registry.rc b/ESMF/Shared/Chem_Base/CMIP/Aod_Registry.rc new file mode 100644 index 00000000..9e58f33f --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Aod_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 4 + +r_channels: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/CMIP/Chem_Init.rc b/ESMF/Shared/Chem_Base/CMIP/Chem_Init.rc new file mode 100644 index 00000000..439a0aca --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Chem_Init.rc @@ -0,0 +1,25 @@ +# +# Chemistry Initialization Resource File +# + +# CO +# ---------------------------------------------------- +amp_CO: 1e18 # positive for total mass [kg]; negative for mmr +lat0_CO: 0. # latitude +lon0_CO: 0. # longitude +z0_CO: 5. # altitude [km] +rx_CO: 4000. # axis E-W [km] +ry_CO: 500. # axis N-S [km] +rz_CO: 2. # axis in z [km] + +# DU +# ---------------------------------------------------- +amp_DU: 0. # positive for total mass [kg]; negative for mmr +lat0_DU: 0. # latitude +lon0_DU: 0. # longitude +z0_DU: 5. # altitude [km] +rx_DU: 4000. # axis E-W [km] +ry_DU: 500. # axis N-S [km] +rz_DU: 2. # axis in z [km] + + diff --git a/ESMF/Shared/Chem_Base/CMIP/Chem_Mie.rc b/ESMF/Shared/Chem_Base/CMIP/Chem_Mie.rc new file mode 100644 index 00000000..f1f788bc --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Chem_Mie.rc @@ -0,0 +1,15 @@ +# +# Resorce file for Chem_Mie Module. Defines filename with LUTs and +# available channels +# + +Chem_Mie::du_optics_file: ExtData/CMIP/x/opticsBands_DU.v15_3.nc +Chem_Mie::ss_optics_file: ExtData/CMIP/x/opticsBands_SS.v3_3.nc +Chem_Mie::su_optics_file: ExtData/CMIP/x/opticsBands_SU.v1_3.nc +Chem_Mie::ni_optics_file: ExtData/CMIP/x/opticsBands_NI.v2_5.nc +Chem_Mie::oc_optics_file: ExtData/CMIP/x/opticsBands_OC.v1_3.nc +Chem_Mie::brc_optics_file: ExtData/CMIP/x/opticsBands_BRC.v1_5.nc +Chem_Mie::bc_optics_file: ExtData/CMIP/x/opticsBands_BC.v1_3.nc + +Chem_Mie::channels: 1 2 3 4 5 6 7 8 + diff --git a/ESMF/Shared/Chem_Base/CMIP/Chem_MieRegistry.rc b/ESMF/Shared/Chem_Base/CMIP/Chem_MieRegistry.rc new file mode 100644 index 00000000..5b529bb1 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Chem_MieRegistry.rc @@ -0,0 +1,455 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# XX lists Stratchem's inferred species. See Chem_Registry.rc +# for GMIchem's XX (non-transported) species list. +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to mol/mol +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # carbon monoxide +doing_CO2: no # carbon dioxide +doing_DU: yes # mineral dust +doing_SS: yes # sea salt +doing_SU: yes # sulfates +doing_CFC: no # CFCs +doing_BC: yes # black carbon +doing_OC: yes # organic carbon +doing_BRC: no # brown carbon +doing_NI: yes # nitrate +doing_Rn: no # radon +doing_CH4: no # methane +doing_SC: no # stratospheric chemistry +doing_GMI: no # GMI chemistry (GEOS-5) +doing_XX: no # generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: no # passive tracers + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 10 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC: 34 # stratospheric chemistry +nbins_XX: 18 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 10 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Global carbon monoxide +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +REDUCED +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 m-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +st80_25 'mol mol-1' Stratosphere source 25 day tracer +CO_50_na 'mol mol-1' Anthro CO North America 50 day tracer +SF6 'mol mol-1' Sulfur Hexafluoride tracer +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant emission 90 day tracer +Rn222 'mol mol-1' Radon-222 +Pb210 'mol mol-1' Lead-210 +Be7 'mol mol-1' Beryllium radionuclide 7(Be) +Be10 'mol mol-1' Beryllium radionuclide 10(Be) +CH3I 'mol mol-1' Methyl iodide +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers diff --git a/ESMF/Shared/Chem_Base/CMIP/Chem_Registry.rc b/ESMF/Shared/Chem_Base/CMIP/Chem_Registry.rc new file mode 100644 index 00000000..326d7955 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/Chem_Registry.rc @@ -0,0 +1,638 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# Beginning with Heracles-1_0, four TR tracers are enabled in the +# default configuration. For the complete list of TR tracers, see +# Chem_MieRegistry.rc. +# +# StratChem can be run with Full or Reduced equation sets. +# When running Full, the string SC_f should be changed to SC. +# When running Reduced, the string SC_r should be changed to SC. +# This will be automatically done by stratchem_setup script. +# +# XX lists contain non-transported species for GMI and StratChem. +# When running GMI, the string XX_GMI should be changed to XX. +# When running StratChem, the string XX_SC should be changed to XX. +# This will be automatically done by the setup scripts. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to 'mol mol-1' +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + # &Label Active Constituents + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: yes # &YesNo Include carbon monoxide? +doing_CO2: yes # &YesNo Include carbon dioxide? +doing_DU: yes # &YesNo Include mineral dust? +doing_SS: yes # &YesNo Include sea salt? +doing_SU: yes # &YesNo Include sulfates? +doing_CFC: no # &YesNo Include CFCs? +doing_BC: yes # &YesNo Include black carbon? +doing_OC: yes # &YesNo Include organic carbon? +doing_BRC: no # &YesNo Include brown carbon? +doing_NI: yes # &YesNo Include nitrate? +doing_Rn: no # &YesNo include Radon? +doing_CH4: no # &YesNo include Methane? +doing_SC: no # &YesNo Include stratospheric chemistry? +doing_GMI: no # &YesNo GMI chemistry (GEOS-5) +doing_XX: no # &YesNo generic tracer +doing_PC: yes # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: yes # &YesNo run passive tracers? + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC_f: 52 # stratospheric chemistry (full) +nbins_XX_SC_f: 18 # stratchem (full) non-transported species +nbins_SC_r: 33 # stratospheric chemistry (reduced) +nbins_XX_SC_r: 37 # stratchem (reduced) non-transported species +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_XX_GMI: 48 # GMI non-transported species +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 4 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Carbon Monoxide (All Sources) +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide (All Sources) +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +OCphobicbbbo 'kg kg-1' Hydrophobic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphilicbbbo 'kg kg-1' Hydrophilic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphobicbbnb 'kg kg-1' Hydrophobic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +OCphilicbbnb 'kg kg-1' Hydrophilic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 cm-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +H 'mol mol-1' Ground state atomic hydrogen (2S) +MO2 'mol mol-1' Methylperoxy radical (CH3O2) +N 'mol mol-1' Ground state atomic nitrogen +O 'mol mol-1' Ground state atomic oxygen (3P) +O1D 'mol mol-1' First excited singlet state of atomic oxygen (1D) +A3O2 'mol mol-1' Primary RO2 (C3H7O2) from propane +ATO2 'mol mol-1' RO2 from acetone (C3H6O3) +B3O2 'mol mol-1' Secondary RO2 (C3H7O2) from propane +EOH 'mol mol-1' Ethanol +ETO2 'mol mol-1' Ethylperoxy radical (C2H5O2) +GLYC 'mol mol-1' Glycolaldehyde (Hydroxyacetaldehyde C2H4O2) +GLYX 'mol mol-1' Glyoxal (2CHO) +IAO2 'mol mol-1' RO2 (C5H9O5) from isoprene oxidation products +INO2 'mol mol-1' RO2 (C5H8O3N) from ISOP+NO3 +INPN 'mol mol-1' Peroxide (C5H8O6N2) from INO2 +ISN1 'mol mol-1' RO2 (C4H7O4N) from ISN2 +ISNP 'mol mol-1' Peroxide (C4H7O4N) from ISN1 +KO2 'mol mol-1' RO2 (C4H7O3) from C3 ketones +MAN2 'mol mol-1' RO2 (C4H6O6N) from MACR+NO3 +MAO3 'mol mol-1' Peroxyacyl (C4H5O3) from MACR and MVK +MAOP 'mol mol-1' Peroxide (C4H6O3) from MAO3 +MAP 'mol mol-1' Peroxyacetic acid (C2H4O3) +MCO3 'mol mol-1' Peroxyacetyl radical (C2H3O3) +MGLY 'mol mol-1' Methylglyoxal (C3H4O2) +MRO2 'mol mol-1' RO2 (C4H7O4) from MACR+OH +MRP 'mol mol-1' Peroxide (C4H8O4) from MRO2 +PO2 'mol mol-1' RO2 (C3H7O3) from propene +PP 'mol mol-1' Peroxide (C3H8O3) from PO2 +PRN1 'mol mol-1' RO2 (C3H6O3N) from propene+NO3 +PRPN 'mol mol-1' Peroxide (C3H6O3N) from PRN1 +R4N1 'mol mol-1' RO2 (C4H9O3N) from R4N2 +R4O2 'mol mol-1' RO2 (C4H9O2) from ALK4 +R4P 'mol mol-1' Peroxide (C4H10O2) from R4O2 +RA3P 'mol mol-1' Peroxy propyl alcohol (C3H8O2) from A3O2 +RB3P 'mol mol-1' Peroxide (C3H8O2) from B3O2 +RCO3 'mol mol-1' Peroxypropionyl radical (C3H5O3) +RIO1 'mol mol-1' RO2 (C5H9O3) from isoprene oxydation products +RIO2 'mol mol-1' RO2 (C5H9O3) from isoprene +RIP 'mol mol-1' Peroxide (C5H10O3) from RIO2 +ROH 'mol mol-1' C2 alcohols +RP 'mol mol-1' Methacrolein peroxy acid (C4H6O3) +VRO2 'mol mol-1' RO2 (C4H7O4) from MVK+OH +VRP 'mol mol-1' Peroxide (C4H8O4) from VRO2 +OCSg 'mol mol-1' Carbonyl sulfide in GMI +ACET 'mol mol-1' Acetone +O2 cm-3 Molecular oxygen +NUMDENS cm-3 Total number density +T2M15d K Daily T2M time average +:: + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant burden 90 day tracer +Rn222 'kg kg-1' Radon-222 +CH3I 'mol mol-1' Methyl iodide +Pb210 'kg kg-1' Lead-210 +nh_5 'mol mol-1' Northern Hemisphere 5 day tracer +nh_50 'mol mol-1' Northern Hemisphere 50 day tracer +aoa_nh days Age of air northern hemisphere tracer +st80_25 'mol mol-1' Stratospheric source 25 day tracer +CO_25 'mol mol-1' Anthro CO 25 day tracer +CO_50 'mol mol-1' Anthro CO 50 day tracer +CO_50_ea 'mol mol-1' Anthro CO 50 day tracer East Asia +CO_50_na 'mol mol-1' Anthro CO 50 day tracer North America +CO_50_eu 'mol mol-1' Anthro CO 50 day tracer Europe +CO_50_sa 'mol mol-1' Anthro CO 50 day tracer South Asia +SF6 'mol mol-1' Sulfur Hexafluoride tracer +e90_n 'mol mol-1' Constant burden 90 day tracer 40N-pole emiss +e90_s 'mol mol-1' Constant burden 90 day tracer 40S-pole emiss +Be7 'kg kg-1' Beryllium radionuclide 7(Be) +Be10 'kg kg-1' Beryllium radionuclide 10(Be) +stOX 'mol mol-1' Strat Ozone with chemical loss +Be7s 'kg kg-1' Beryllium radionuclide 7(Be) strat-source +Be10s 'kg kg-1' Beryllium radionuclide 10(Be) strat-source +Pb210s 'kg kg-1' Lead-210 strat-source +CO_GLB 'mol mol-1' CO 50 day tracer Global CMIP6+M2G +CO_NAM 'mol mol-1' CO 50 day tracer North America CMIP6+M2G +CO_EUR 'mol mol-1' CO 50 day tracer Europe CMIP6+M2G +CO_SAS 'mol mol-1' CO 50 day tracer South Asia CMIP6+M2G +CO_EAS 'mol mol-1' CO 50 day tracer East Asia CMIP6+M2G +CO_SEA 'mol mol-1' CO 50 day tracer Southeast Asia CMIP6+M2G +CO_ANZ 'mol mol-1' CO 50 day tracer Australia & New Zealand CMIP6+M2G +CO_NAF 'mol mol-1' CO 50 day tracer North Africa CMIP6+M2G +CO_RAF 'mol mol-1' CO 50 day tracer Rest of Africa CMIP6+M2G +CO_MDE 'mol mol-1' CO 50 day tracer Middle East CMIP6+M2G +CO_CAM 'mol mol-1' CO 50 day tracer Central America CMIP6+M2G +CO_SAM 'mol mol-1' CO 50 day tracer South America CMIP6+M2G +CO_RBU 'mol mol-1' CO 50 day tracer Russia & Belarus & Ukraine CMIP6+M2G +CO_CAS 'mol mol-1' CO 50 day tracer Central Asia CMIP6+M2G +CO_ARC 'mol mol-1' CO 50 day tracer Arctic CMIP6+M2G +CO_from_CH4 'mol mol-1' CO from global average CH4 oxidation +aoa_bl days Age of air above boundary layer +:: + + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers + diff --git a/ESMF/Shared/Chem_Base/CMIP/tavg3d_ext_p.rc b/ESMF/Shared/Chem_Base/CMIP/tavg3d_ext_p.rc new file mode 100644 index 00000000..d84b6cb3 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMIP/tavg3d_ext_p.rc @@ -0,0 +1,55 @@ +# lcv2prs.rc +# +# This is a resource file for the lcv2prs utility. +# +# !REVISION HISTORY: +# +# 27Jan2006 B. Yin First version. +# 25Apr2006 Todling Declared dims so fvsetup get set them up. +# 17May2006 Stassi modified from tavg3d_tmp_v.rc for pressure levels +# +#........................................................................... + +# ---------------------- +# Output File Resolution +# ---------------------- + +zonal_resolution: 540 # no. of zonal grid-points (im) +west_most_longitude_in_deg: -180.0 # longitude of first point (i=1) +meridional_resolution: 361 # no. meridional grid-points (jm) +vertical_levels_in_hPa: 1000 975 950 925 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 30 20 10 + +# ---------------- +# Variable Classes +# ---------------- + +# A variable class lists the variable names that make up a file type or product. + +# +### PRODUCT: tavg3d_ext_p (3-D tendency) +VarClass*tavg3d_ext_p: delp rh extinction ssa tau +# -------------------- +# Variable Translation +# -------------------- + +Variable_translation_table:: + +# Output | Input +# Name Units | Name scale_factor add_offset Positive check +# ------------------------------------------------------------------------------ + DELP Pa delp 1.0 0.0 0 + RH fraction rh 1.0 0.0 0 + SSA fraction ssa 1.0 0.0 0 + EXTINCTION 1/km extinction 1.0 0.0 0 + TAU UNITLESS tau 1.0 0.0 0 +:: + + + +# Table for variable names and description: + +DELP: Pressure difference between layer edges +RH: Relative Humidity +SSA: Aerosol Single Scatter Albedo [532 nm] +EXTINCTION: Aerosol Extinction [532 nm] +TAU: Aerosol Layer Optical Thickness [532 nm] diff --git a/ESMF/Shared/Chem_Base/CMakeLists.txt b/ESMF/Shared/Chem_Base/CMakeLists.txt new file mode 100644 index 00000000..363189b6 --- /dev/null +++ b/ESMF/Shared/Chem_Base/CMakeLists.txt @@ -0,0 +1,51 @@ +esma_set_this () + +set (srcs + Chem_RegistryMod.F90 + Chem_ArrayMod.F90 + Chem_BundleMod.F90 + Chem_Mod.F90 + Chem_InitMod.F90 + Chem_MieTableMod.F90 + Chem_MieMod.F90 + Chem_AodMod.F90 + Chem_SimpleBundleMod.F90 + ) +esma_add_library(${this} SRCS ${srcs} DEPENDENCIES GMAO_mpeu MAPL GMAO_gfio_r4) +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) +target_compile_definitions (${this} PRIVATE GEOS5) + +ecbuild_add_executable(TARGET gogo.x SOURCES gogo.F90 LIBS ${this}) + +include_directories (${esma_include}/${this}) + +if (F2PY_FOUND) + add_f2py_module(MieObs_ SOURCES MieObs_py.F90 + DESTINATION lib/Python + LIBRARIES Chem_Base MAPL GMAO_mpeu ${NETCDF_LIBRARIES} ${ESMF_LIBRARY} + INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${BASEDIR}/lib ${include_${this}} ${INC_NETCDF} + USE_MPI + ) + add_dependencies(MieObs_ ${this}) +endif (F2PY_FOUND) + + +foreach (exe Chem_Aod.x Chem_Aod3d.x ctl_crst.x Chem_BundleToG5rs.x reff_calculator.xx ext_calculator.xx) + get_filename_component (basename ${exe} NAME_WE) # base file name + ecbuild_add_executable ( + TARGET ${exe} + SOURCES ${basename}.F90 + LIBS ${this} ${OpenMP_Fortran_LIBRARIES}) + # Do not know how to propagate the flags for OpenMP link step from lower libraries. + set_target_properties(${exe} PROPERTIES LINK_FLAGS "${OpenMP_Fortran_FLAGS}") +endforeach () + +# Copy RC files to build tree +file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc) +foreach ( file ${rc_files} ) + get_filename_component( dir ${file} DIRECTORY ) + install( FILES ${file} DESTINATION etc/${dir} ) +endforeach() + +install(PROGRAMS ext_calculator.py reff.py extinction_calculator.csh DESTINATION bin) +install(PROGRAMS mieobs.py DESTINATION lib/Python) diff --git a/ESMF/Shared/Chem_Base/Chem_AerRegistry.rc b/ESMF/Shared/Chem_Base/Chem_AerRegistry.rc new file mode 100644 index 00000000..eab2fd0f --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_AerRegistry.rc @@ -0,0 +1,310 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registy --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTE: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to mol/mol +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + # &Label Active Constituents + +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # &YesNo Include carbon monoxide? +doing_CO2: no # &YesNo Include carbon dioxide? +doing_CFC: no # CFCs +doing_DU: yes # &YesNo Include mineral dust? +doing_SS: yes # &YesNo Include sea salt? +doing_SU: yes # &YesNo Include sulfates? +doing_BC: yes # &YesNo Include black carbon? +doing_OC: yes # &YesNo Include organic carbon? +doing_SC: no # &YesNo Include stratospheric chemistry? +doing_AC: no # auto chem +doing_XX: no # generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_GMI: no # GMI chemistry (GEOS-5) +doing_CARMA: no # CARMA Service Component + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 3 # ozone +nbins_CO: 1 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_CFC: 2 # CFCs +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 34 # stratospheric chemistry +nbins_AC: 35 # auto chem +nbins_XX: 18 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 1 # GMI chemistry (GEOS-5) +nbins_CARMA: 1 # CARMA Service Component + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: kg/kg # ozone +units_CO: kg/kg # carbon monoxide +units_CO2: kg/kg # carbon dioxide +units_CFC: mol/mol # CFCs +units_DU: kg/kg # mineral dust +units_SS: kg/kg # sea salt +units_SU: kg/kg # sulfates +units_BC: kg/kg # black carbon +units_OC: kg/kg # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_AC: kg/kg # auto chem +units_XX: kg/kg # generic tracer +units_PC: kg/kg # parameterized chemistry (GEOS-5) +units_GMI: kg/kg # GMI chemistry (GEOS-5) +units_CARMA: kg/kg # CARMA Service Component + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3PARAM mol/mol Parameterized ozone +OXSTRAT mol/mol Stratospheric odd oxygen +OXTROP mol/mol Tropospheric ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO mol/mol Global carbon monoxide +CONOAMAN mol/mol North American anthropogenic CO +COCEAMAN mol/mol Central American anthropogenic CO +COWHBB mol/mol Western Hemisphere biomass burning CO +COASIAAN mol/mol Asian anthropogenic CO +COASNBB mol/mol Northern Asia biomass burning CO +COASSBB mol/mol Southern Asia biomass burning CO +COFDAN mol/mol Mexico City anthropogenic CO +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 mol/mol Carbon Dioxide +CO2nam mol/mol North American Carbon Dioxide +CO2sam mol/mol South American Carbon Dioxide +CO2afr mol/mol African +:: + +variable_table_CFC:: +CFC12S mol/mol Stratospheric CFC-12 (CCl2F2) +CFC12T mol/mol Tropospheric CFC-12 (CCl2F2) +:: +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS kg/kg Dimethylsulphide +SO2 kg/kg Sulphur dioxide +SO4 kg/kg Sulphate aerosol +MSA kg/kg Methanesulphonic acid +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic kg/kg Hydrophobic Black Carbon +BCphilic kg/kg Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic kg/kg Hydrophobic Organic Carbon (Particulate Matter) +OCphilic kg/kg Hydrophilic Organic Carbon (Particulate Matter) +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OXSTRAT mol/mol Stratospheric odd oxygen +NOX mol/mol Odd nitrogen +HNO3 mol/mol Nitric acid +N2O5 mol/mol Dinitrogen pentoxide +HO2NO2 mol/mol Peroxynitric acid +CLONO2 mol/mol Chlorine nitrate +CLX mol/mol Odd chlorine +HCL mol/mol Hydrochloric acid +HOCL mol/mol Hypochlorous acid +H2O2 mol/mol Hydrogen peroxide +BRX mol/mol Odd bromine +N2O mol/mol Nitrous oxide +CL2 mol/mol Molecular chlorine +OCLO mol/mol Chlorine dioxide +BRCL mol/mol Bromine chloride +HBR mol/mol Hydrogen bromide +BRONO2 mol/mol Bromine nitrate +CH4 mol/mol Methane +HOBR mol/mol Hypobromous acid +CH3OOH mol/mol Methyl hydroperoxide +CO mol/mol Carbon monoxide +HNO3COND mol/mol Condensed nitric acid +H2OCOND mol/mol Condensed water vapor in chemistry +F11 mol/mol CFC-11 (CCl3F) +F12 mol/mol CFC-12 (CCl2F2) +F113 mol/mol CFC-113 (CCl2FCClF2) +HCFC mol/mol HCFC +CCL4 mol/mol Carbon tetrachloride +CH3CCL3 mol/mol Methyl chloroform +CH3CL mol/mol Methyl chloride +CH3BR mol/mol Methyl bromide +H1301 mol/mol Halon 1301 (CBrF3) +H12_24 mol/mol Halon 12_24 +Q4AGE mol/mol SSG for computing age-of-air +:: + +variable_table_AC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OXSTRAT mol/mol Stratospheric odd oxygen +NOX mol/mol Odd nitrogen +HNO3 mol/mol Nitric acid +N2O5 mol/mol Dinitrogen pentoxide +HO2NO2 mol/mol Peroxynitric acid +CLONO2 mol/mol Chlorine nitrate +CLX mol/mol Odd chlorine +HCL mol/mol Hydrochloric acid +HOCL mol/mol Hypochlorous acid +H2O2 mol/mol Hydrogen peroxide +BRX mol/mol Odd bromine +N2O mol/mol Nitrous oxide +CL2 mol/mol Molecular chlorine +OCLO mol/mol Chlorine dioxide +BRCL mol/mol Bromine chloride +HBR mol/mol Hydrogen bromide +BRONO2 mol/mol Bromine nitrate +CH4 mol/mol Methane +HOBR mol/mol Hypobromous acid +CH3OOH mol/mol Methyl hydroperoxide +CO mol/mol Carbon monoxide +HNO3COND mol/mol Condensed nitric acid +H2OCOND mol/mol Condensed water vapor in chemistry +F11 mol/mol CFC-11 (CCl3F) +F12 mol/mol CFC-12 (CCl2F2) +F113 mol/mol CFC-113 (CCl2FCClF2) +HCFC mol/mol HCFC +CCL4 mol/mol Carbon tetrachloride +CH3CCL3 mol/mol Methyl chloroform +CH3CL mol/mol Methyl chloride +CH3BR mol/mol Methyl bromide +H1301 mol/mol Halon 1301 (CBrF3) +H12_24 mol/mol Halon 12_24 +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM mol/mol Ozone from chemistry +O3P mol/mol Atomic oxygen in the ground state +O1D mol/mol Atomic oxygen in the first excited state +N mol/mol Atomic nitrogen +NO mol/mol Nitric oxide +NO2 mol/mol Nitrogen dioxide +NO3 mol/mol Nitrogen trioxide +HATOMIC mol/mol Atomic hydrogen +OH mol/mol Hydroxyl radical +HO2 mol/mol Hydroperoxyl radical +CL mol/mol Atomic chlorine +CLO mol/mol Chlorine monoxide +BRO mol/mol Bromine monoxide +BR mol/mol Atomic bromine +CL2O2 mol/mol Dichlorine peroxide +CH2O mol/mol Formaldehyde +CH3O2 mol/mol Methyl peroxide +RO3OX none Ozone-to-odd oxygen ratio +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_CFC: yes # CFCs +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_AC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_CARMA: yes # CARMA Service Component + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_CFC: yes # CFCs +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_CARMA: yes # CARMA Service Component diff --git a/ESMF/Shared/Chem_Base/Chem_Aod.F90 b/ESMF/Shared/Chem_Base/Chem_Aod.F90 new file mode 100644 index 00000000..76a23ca3 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_Aod.F90 @@ -0,0 +1,447 @@ +! Compute the Aerosol Optical Thickness for an input Chem Bundle +! - get the chemistry registry +! - pass the chem bundle to the AOD routine + + program Chem_Aod + + use m_die, only: die + use Chem_MieMod + use Chem_RegistryMod + use Chem_BundleMod + + implicit none + + character(len=*), parameter :: myname = 'chem_aod' + type(Chem_Mie) :: mie_tables + type(Chem_Registry) :: regInp ! chemistry registry + type(Chem_Bundle) :: w_c ! chemistry bundle + type(Chem_Bundle) :: w_tau ! tau chemistry bundle + type(Chem_Bundle) :: w_tauabs ! tau absorption chemistry bundle + type(Chem_Bundle) :: w_ssa ! ssa chemistry bundle + integer :: i, j, k, im, jm, km, idx + integer :: i1, i2, ig, j1, j2, jg, ik, iq + integer :: nymd, nhms, freq, rc, ier + integer :: idxTable + integer :: out_fid + integer iarg, iargc, argc, lenfile + logical :: only_taod + logical :: doing_tauabs2d + logical :: doing_totext2d + logical :: doing_ssa2d + logical :: doing_geos4 + logical :: doing_dry ! if true, calculate like rh = 0% + logical :: new, verbose + real :: channel, tau_, ssa_, scalerh, maxRH + character(len=255) :: infile, outfile, filename, rcfile, argv + character(len=255) :: filename0 + character(len=14) :: datestr + character(len=8) :: yyyymmddstr + character(len=4) :: hhnnstr + +! Parse the command line (see usage() below) + argc = iargc() + if(argc .lt. 1) call usage() + iarg = 0 + outfile = 'chem_aod' + rcfile = 'Aod_Registry.rc' + only_taod=.false. + doing_tauabs2d = .false. + doing_totext2d = .false. + doing_ssa2d = .false. + doing_geos4 = .false. + verbose = .false. + doing_dry = .false. + do i = 0, 32767 + iarg = iarg+1 + if(iarg .gt. argc) exit + call GetArg(iarg, argv) + select case(argv) + case ("-geos4") + doing_geos4 = .true. + case ("-dryaer") + doing_dry = .true. + case ("-v") + verbose = .true. + case ("-tauabs2d") + doing_tauabs2d = .true. + case ("-totext2d") + doing_totext2d = .true. +!_RT doing_tauabs2d = .true. + case ("-ssa2d") + doing_ssa2d = .true. + case ("-only_taod") + only_taod = .true. + case ("-o") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, outfile) + case ("-t") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, rcfile) + case default + infile = argv + end select + end do + rcfile = trim(rcfile) + infile = trim(infile) + outfile = trim(outfile) + lenfile = len(trim(outfile)) + +! Scaling of Relative Humidity +! Input optics files (e.g., optics_XX.nc4) have a fractional RH +! coordinate (that is, RH varies 0 - 1 in the file, as in GEOS-5). +! In GEOS-4, however, RH in the chem.eta file is represented as +! a percentage, so it varies 0 - 100%. For compatibility we +! introduce a flag "-geos4" on execution. If present, the RH +! from the chem.eta file is divided by 100 on input to the Mie +! calculator. +! If you requested to do the calculation like the aerosols were +! dry, then we set the RH like it is 0% + scaleRH = 1. + if(doing_geos4) scaleRH = 1. / 100. + if(doing_dry) scaleRH = 0. + +! Hardwired: Read the input chemistry registry from Chem_Registry.rc +! This registry file describes the input chemistry bundle being +! operated on. +! ------------------------------------------------------------------ + regInp = Chem_RegistryCreate(ier,'Chem_MieRegistry.rc') + if(ier /= 0) call die(myname, 'cannot create registry') + if(verbose) call Chem_RegistryPrint(regInp) + +! Hardwired: use the Chem_MieMod function to create the Mie tables +! ------------------------------------------------------------------------- + mie_tables = Chem_MieCreate(rcfile,ier) + +! Hardwired: we know the chem bundle files contain four time steps per file +! We will loop over all the times in the file and write them out +! ------------------------------------------------------------------------- + new = .true. + do idx = 1, 1 + +! Read the chemistry bundle from the infile +! ------------------------------------------------- + call Chem_BundleRead(infile, nymd, nhms, w_c, rc, freq=freq, & + ChemReg=regInp, timidx=idx) + + print *, 'Computing AOD for ', nymd, nhms + +! Check the RH seems sane + if(.not. doing_geos4 .and. .not. doing_dry) then + maxrh = maxval(w_c%rh) + if(maxrh .gt. 2.) then + print *, 'Maximum RH value = ', maxRH + print *, 'Should you have chosen "-geos4" as a command line option?' + endif + endif + +! ================================================================================== +! The enclosed bundle of code selects on what calculation we run and what is written + +! Simple for now: only do tau2d +! Create the output Chem_Bundle + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + ig = w_c%grid%ig + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jg = w_c%grid%jg + im = w_c%grid%im + jm = w_c%grid%jm + km = mie_tables%nch + + call Chem_BundleCreate(regInp, & + i1, i2, ig, im, & + j1, j2, jg, jm, km, & + w_tau, ier, & + lev=mie_tables%channels, levUnits="m") + if(doing_ssa2d .or. doing_tauabs2d) then + call Chem_BundleCreate(regInp, & + i1, i2, ig, im, & + j1, j2, jg, jm, km, & + w_ssa, ier, & + lev=mie_tables%channels, levUnits="m") + endif + + if(doing_tauabs2d) then + call Chem_BundleCreate(regInp, & + i1, i2, ig, im, & + j1, j2, jg, jm, km, & + w_tauabs, ier, & + lev=mie_tables%channels, levUnits="m") + endif + + if(ier /= 0) call die(myname, 'cannot create tau2d bundle') + + do ik = 1, km + channel = mie_tables%channels(ik) + + do iq = 1, mie_tables%nq + idxTable = Chem_MieQueryIdx(mie_tables,mie_tables%vname(iq),rc) + + if(idxTable .ne. -1) then + do k = 1, w_c%grid%km + do j = 1, jm + do i = 1, im + if ( doing_ssa2d .or. doing_tauabs2d ) then + call Chem_MieQuery(mie_tables, idxTable, float(ik), & + w_c%qa(iq)%data3d(i,j,k)*w_c%delp(i,j,k)/9.80616, & + w_c%rh(i,j,k) * scaleRH, tau=tau_, ssa=ssa_) + else + call Chem_MieQuery(mie_tables, idxTable, float(ik), & + w_c%qa(iq)%data3d(i,j,k)*w_c%delp(i,j,k)/9.80616, & + w_c%rh(i,j,k) * scaleRH, tau=tau_) + endif + w_tau%qa(iq)%data3d(i,j,ik) = w_tau%qa(iq)%data3d(i,j,ik) + tau_ + if(doing_ssa2d) w_ssa%qa(iq)%data3d(i,j,ik) = w_ssa%qa(iq)%data3d(i,j,ik) + tau_*ssa_ + if(doing_tauabs2d) w_tauabs%qa(iq)%data3d(i,j,ik) = & + w_tauabs%qa(iq)%data3d(i,j,ik) + (1.-ssa_)*tau_ + enddo + enddo + enddo + endif + enddo + + enddo + + if(doing_ssa2d) then + do iq = 1, mie_tables%nq + idxTable = Chem_MieQueryIdx(mie_tables,mie_tables%vname(iq),rc) + if(idxTable .ne. -1) then + w_ssa%qa(iq)%data3d = w_ssa%qa(iq)%data3d / w_tau%qa(iq)%data3d + endif + end do + end if + +! Write the Chem_Bundle out + write(yyyymmddstr,'(i8.8)') nymd + write(hhnnstr,'(i4.4)') nhms/100 + datestr = yyyymmddstr//'_'//hhnnstr//'z' + + + if(doing_totext2d) then + if (only_taod) then + filename0 = trim(outfile) + else + filename0 = trim(outfile(1:lenfile)//'.ext_Nc.'//datestr//'.nc4') + endif + call cmp_totext(filename0,w_tau,nymd,nhms,0,1,out_fid,freq=freq) + endif + + if(.not.only_taod) then + + filename = trim(outfile(1:lenfile)//'.taod_Nc.'//datestr//'.nc4') + call Chem_BundleWrite( filename, nymd, nhms, 0, w_tau, rc, & + verbose=verbose, new=new, freq=freq) + + if(doing_ssa2d) then + filename = trim(outfile(1:lenfile)//'.tssa_Nc.'//datestr//'.nc4') + call Chem_BundleWrite( filename, nymd, nhms, 0, w_ssa, rc, & + verbose=verbose, new=new, freq=freq) + endif + + if(doing_tauabs2d) then + + if(doing_totext2d) then + filename0 = trim(outfile(1:lenfile)//'.ext_Nc.'//datestr//'.nc4') + call cmp_totext(filename0,w_tauabs,nymd,nhms,0,2,out_fid,freq=freq) + endif + + filename = trim(outfile(1:lenfile)//'.aaod_Nc.'//datestr//'.nc4') + call Chem_BundleWrite( filename, nymd, nhms, 0, w_tauabs, rc, & + verbose=verbose, new=new, freq=freq) + endif + endif ! .not.only_taod + +! ================================================================================== + +! Don't overwrite the file +! ------------------------ + new = .false. + + enddo ! idx (time increment in input file) + +! Destroy Mie tables + call Chem_BundleDestroy(w_tau, rc) + if(doing_ssa2d) call Chem_BundleDestroy(w_ssa, rc) + if(doing_tauabs2d) call Chem_BundleDestroy(w_tauabs, rc) + call Chem_MieDestroy(mie_tables,ier) + call Chem_RegistryDestroy(regInp, rc) + +! ---------------------------------------------------------------------------- + contains + +!------------------------------------------------------------------------- +! NASA/GSFC Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: cmp_totext --- Computes Total AOD and ABS_AOD. +! +! !INTERFACE: +! + + + subroutine cmp_totext( outFile,w_c,nymd,nhms,prec,iflag,out_fid,freq) +! +! !USES: +! + use m_chars, only: uppercase + implicit NONE + +! +! !INPUT PARAMETERS: +! + integer, intent(in), OPTIONAL :: freq ! time frequency (HHMMSS) for + integer, intent(in) :: prec ! precision + ! multiple instance files + ! (default: 060000) + + type(Chem_Bundle), intent(in) :: w_c ! chemical bundle + integer :: im_e,jm_e,km_e,i,j,k,iq,iflag + +! !OUTPUT PARAMETER: + + real, allocatable :: total_ext(:,:,:) + real, allocatable :: valid_range(:,:), packing_range(:,:) + real, allocatable :: lat_e(:), lon_e(:), lev_e(:),kmVar_e(:) + character(len=*) :: outFile ! Output file name + integer :: out_fid,err4 + integer :: nymd,nhms,timeinc + integer :: nVars_new,rc + character(len=64) :: outVars(2) ! output variable names (nVars + character(len=64) :: outUnits(2) ! Units of output variables (nVars) + character(len=256) :: out_title(2) ! output title + character(len=256) :: source, contact, levunits,title +! +! !DESCRIPTION: Computes Total AOD & Total Absorption AOD. +! +! !REVISION HISTORY: +! +! 16Nov2011 Ravi Initial code +! +!EOP +!------------------------------------------------------------------ + + im_e = w_c%grid%im + jm_e = w_c%grid%jm + km_e = w_c%grid%km + + allocate(total_ext(im_e,jm_e,km_e),stat=err4) + + total_ext = 0.0 + do iq = 1, w_c%reg%nq + if(trim(uppercase(w_c%reg%vname(iq)(1:2))) == 'DU' .or. & + trim(uppercase(w_c%reg%vname(iq)(1:2))) == 'SS' .or. & + trim(uppercase(w_c%reg%vname(iq))) == 'SO4' .or. & + trim(uppercase(w_c%reg%vname(iq))) == 'NO3AN1' .or. & + trim(uppercase(w_c%reg%vname(iq))) == 'NO3AN2' .or. & + trim(uppercase(w_c%reg%vname(iq))) == 'NO3AN3' .or. & + trim(uppercase(w_c%reg%vname(iq))) == 'BCPHOBIC' .or. & + trim(uppercase(w_c%reg%vname(iq))) == 'BCPHILIC' .or. & + trim(uppercase(w_c%reg%vname(iq))) == 'OCPHOBIC' .or. & + trim(uppercase(w_c%reg%vname(iq))) == 'OCPHILIC') then + + print *, 'w_c%reg%vname(iq) = ', trim(w_c%reg%vname(iq)) + + do k = 1,km_e + do j = 1,jm_e + do i = 1,im_e + if(w_c%qa(iq)%data3d(i,j,k) < 1.e+10) then + total_ext(i,j,k) = total_ext(i,j,k) + w_c%qa(iq)%data3d(i,j,k) + endif + end do + end do + end do + endif + end do + + nvars_new = 2 + if(iflag == 1) then + allocate ( packing_range(2,nVars_new), valid_range(2,nVars_new), stat=err4 ) + allocate ( kmVar_e(nvars_new), stat=err4 ) + outVars(1) = 'taod' + out_title(1) = 'Total Aerosol Optical Depth' + outVars(2) = 'aaod' + out_title(2) = 'Total Absorption Aerosol Optical Depth' + outUnits(1) = 'kg/kg' + outUnits(2) = 'kg/kg' + source = 'Data Assimilation Office, NASA/GSFC' + contact = 'data@gmao.gsfc.nasa.gov' + title = "unknown" + levunits = 'm' + kmVar_e = km_e + +! Cannot handle cubed sphere for now +! ---------------------------------- + if ( w_c%grid%cubed_sphere ) then + call die('chem_aod','cannot yet handle cubed sphere') + end if + allocate ( lat_e(jm_e), lon_e(im_e), lev_e(km_e),stat=err4 ) + lat_e = w_c%grid%lat(1,:) + lon_e = w_c%grid%lon(:,1) + lev_e = w_c%grid%lev + + do j = 1, nVars_new + do i = 1, 2 + valid_range(i,j) = w_c%missing_value + packing_range(i,j) = w_c%missing_value + end do + end do + + if ( present(freq) ) then + timeinc = freq + else + timeinc = 060000 + end if + + + + call GFIO_Create ( outFile, title, source, contact, w_c%missing_value, & + im_e, jm_e, km_e, lon_e, lat_e, Lev_e, levunits, & + nymd,nhms,timeinc, & + nVars_new, outVars, out_title, outUnits, & + kmVar_e,valid_range,packing_range,prec, & + out_fid, rc ) + + if ( rc /= 0 ) call die (myname, 'wrong in GFIO_Create') + deallocate ( packing_range, valid_range,lat_e,lon_e,lev_e,kmVar_e) + endif + + call GFIO_PutVar (out_fid,outVars(iflag),nymd,nhms, & + im_e, jm_e, 1, km_e, total_ext,rc ) + if ( rc /= 0 ) call die (myname, 'something wrong in GFIO_PutVarT for 3D file') + + deallocate(total_ext) + + end subroutine cmp_totext +! ----------------------------------------------------- + + subroutine usage() + print * + print *,'Usage: ' + print *,' Chem_Aod.x [-tauabs2d -ssa2d ' + print *,' -o outfile -t rcfile ] infile' + print * + print *, 'where' + print * + print *, '-geos4 to specify that the relative humidity of input file' + print *, ' varies 0 - 100 instead of 0 - 1 as in GEOS-5' + print *, '-dryaer to specify to ignore the relative humidity in the' + print *, ' input file; compute all properties like RH = 0%' + print *, '-tauabs2d request column integrated absorption aerosol optical thickness' + print *, '-totext2d request total aerosol optical thickness and ' + print *, ' column integrated absorption aerosol optical thickness' + print *, ' (-tauabs2d default.)' + print *, '-ssa2d request column integrated single scattering albedo' + print *, '-o expid filename will look like expid.ext_nx.YYYYMMDD_HHNNz.nc4' + print *, ' filename for totext2d will look like expid.ext_nc.YYYYMMDD_HHNNz.nc4' + print *, '-t rcfile resource file specifying channels for AOD calc' + print *, '-v request verbose output' + print *, 'infile mandatory input aer_v file' + print * + call exit(1) + end subroutine usage + +end diff --git a/ESMF/Shared/Chem_Base/Chem_Aod3d.F90 b/ESMF/Shared/Chem_Base/Chem_Aod3d.F90 new file mode 100644 index 00000000..d47083f8 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_Aod3d.F90 @@ -0,0 +1,762 @@ +! Colarco, June 2006 +! Offline calculator of 3D aerosol optical properties +! 1) Read a registry determining aerosol optical properties to compute +! 2) Read a chem bundle of aerosol distribution from a file +! 3) Read an output registry naming the output chem bundle +! 4) Compute + + program chem_aodcalc + + use m_die, only: die + use Chem_MieMod + use Chem_RegistryMod + use Chem_BundleMod + use m_fpe, only: isnan + + implicit none + + real, parameter :: grav = 9.80616 + real, parameter :: rgas = 287.04 + + character(len=*), parameter :: myname = 'chem_aod' + type(Chem_Mie) :: mie_tables + type(Chem_Registry) :: regInp ! chemistry registry + type(Chem_Registry) :: regOut ! chemistry registry + type(Chem_Bundle) :: w_c ! input aerosol chemistry bundle + type(Chem_Bundle) :: w_tau ! output total tau chemistry bundle + type(Chem_Bundle) :: w_taudu ! output du tau chemistry bundle + type(Chem_Bundle) :: w_tauant ! output anthro tau chemistry bundle + type(Chem_Bundle) :: w_tauss ! output seasalt tau chemistry bundle + type(Chem_Bundle) :: w_tauoc ! output organic carbon tau chemistry bundle + type(Chem_Bundle) :: w_taubc ! output black carbon tau chemistry bundle + type(Chem_Bundle) :: w_taucc ! output total carbon tau chemistry bundle + type(Chem_Bundle) :: w_tausu ! output sulfate tau chemistry bundle + integer :: i, j, k, im, jm, km, idx, n, ndx + integer :: i1, i2, ig, j1, j2, jg, ik, iq, kk + integer :: nymd, nhms, freq, rc, ier, fid + integer :: idxTable + integer :: iarg, iargc, argc, lenfile + logical :: doing_dust, doing_anthro, doing_ss, doing_oc, doing_bc, doing_su, doing_cc + logical :: doing_geos4 + logical :: doing_dry + logical :: new + logical :: found_airdensfile, found_hghtefile + real :: channel, tau_, ssa_, bbck_, bext_, taulev, gasym_, scaleRH, maxRH, & + qMass, p11_, p22_, vol_, area_, refr_, refi_ + integer :: itau, iext, issa, immr, ibbck, & + iabck0, iabck1, ietob, igasym, idepol, & + ivol, iarea, ireff, irefr, irefi + integer, parameter :: READ_ONLY = 1 + real, pointer :: delz(:,:,:), t(:,:,:), q(:,:,:), hghte(:,:,:) + real, pointer :: airdens(:,:,:) => null() + character(len=255) :: infile, outfile, filename, airdensfile, hghtefile, rcfile, argv + character(len=8) :: datestr + character(len=11) :: chstr + character(len=3) :: chnstr + +! Parse the command line (see usage() below) + argc = iargc() + if(argc .lt. 1) call usage() + iarg = 0 + outfile = 'tau3d.nc4' + rcfile = 'Aod_CALIPSO.rc' + doing_dust = .false. + doing_ss = .false. + doing_bc = .false. + doing_oc = .false. + doing_cc = .false. + doing_su = .false. + doing_anthro = .false. + doing_geos4 = .false. + doing_dry = .false. + found_airdensfile = .false. + found_hghtefile = .false. + do i = 0, 32767 + iarg = iarg+1 + if(iarg .gt. argc) exit + call GetArg(iarg, argv) + select case(argv) + case ("-geos4") + doing_geos4 = .true. + case ("-dryaer") + doing_dry = .true. + case ("-dust") + doing_dust = .true. + case ("-ss") + doing_ss = .true. + case ("-su") + doing_su = .true. + case ("-bc") + doing_bc = .true. + case ("-oc") + doing_oc = .true. + case ("-cc") + doing_cc = .true. + case ("-anthro") + doing_anthro = .true. + case ("-airdensfile") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, airdensfile) + found_airdensfile = .true. + case ("-hghtefile") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, hghtefile) + found_hghtefile = .true. + case ("-o") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, outfile) + case ("-t") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, rcfile) + case default + infile = argv + end select + end do + rcfile = trim(rcfile) + infile = trim(infile) + outfile = trim(outfile) + lenfile = len(trim(outfile)) + if(found_hghtefile) hghtefile = trim(hghtefile) + if(found_airdensfile) then + airdensfile = trim(airdensfile) + else + airdensfile = infile + endif + +! Scaling of Relative Humidity +! Input optics files (e.g., optics_XX.nc4) have a fractional RH +! coordinate (that is, RH varies 0 - 1 in the file, as in GEOS-5). +! In GEOS-4, however, RH in the chem.eta file is represented as +! a percentage, so it varies 0 - 100%. For compatibility we +! introduce a flag "-geos4" on execution. If present, the RH +! from the chem.eta file is divided by 100 on input to the Mie +! calculator. +! If you requested to do the calculation like the aerosols were +! dry, then we set the RH like it is 0% + scaleRH = 1. + if(doing_geos4) scaleRH = 1. / 100. + if(doing_dry) scaleRH = 0. + +! Hardwired: Create the output bundle +! ----------------------------------- + regOut = Chem_RegistryCreate(ier, rcfile) + if(ier /= 0) call die(myname, 'cannot create output registry') + +! Check the output registry for desired output fields +! --------------------------------------------------- + itau = -1 + iext = -1 + issa = -1 + immr = -1 + ietob = -1 + ibbck = -1 + iabck0 = -1 + iabck1 = -1 + igasym = -1 + idepol = -1 + ivol = -1 + iarea = -1 + ireff = -1 + irefr = -1 + irefi = -1 + do iq = 1, regOut%nq + if(trim(regOut%vname(iq)) .eq. 'tau') itau = iq + if(trim(regOut%vname(iq)) .eq. 'extinction') iext = iq + if(trim(regOut%vname(iq)) .eq. 'ssa') issa = iq + if(trim(regOut%vname(iq)) .eq. 'mmr') immr = iq + if(trim(regOut%vname(iq)) .eq. 'ext2back') ietob = iq + if(trim(regOut%vname(iq)) .eq. 'attback0') iabck0 = iq + if(trim(regOut%vname(iq)) .eq. 'aback_sfc') iabck0 = iq ! alias + if(trim(regOut%vname(iq)) .eq. 'attback1') iabck1 = iq + if(trim(regOut%vname(iq)) .eq. 'aback_toa') iabck1 = iq ! alias + if(trim(regOut%vname(iq)) .eq. 'backscat') ibbck = iq + if(trim(regOut%vname(iq)) .eq. 'gasym') igasym = iq + if(trim(regOut%vname(iq)) .eq. 'depol') idepol = iq + if(trim(regOut%vname(iq)) .eq. 'depol') idepol = iq + if(trim(regOut%vname(iq)) .eq. 'volume') ivol = iq + if(trim(regOut%vname(iq)) .eq. 'area') iarea = iq + if(trim(regOut%vname(iq)) .eq. 'reff') ireff = iq + if(trim(regOut%vname(iq)) .eq. 'refreal') irefr = iq + if(trim(regOut%vname(iq)) .eq. 'refimag') irefi = iq + enddo + +! At this point should do some checking that certain fields are +! provided. + if(issa .gt. 0 .and. itau .lt. 0) ier = 1 + if(igasym .gt. 0 .and. (itau .lt. 0 .or. issa .lt. 0)) ier = 2 + if(ibbck .gt. 0 .and. itau .lt. 0) ier = 3 + if(ietob .gt. 0 .and. (itau .lt. 0 .or. ibbck .lt. 0)) ier = 4 + if((iabck0 .gt. 0 .or. iabck1 .gt. 0) .and. & + (itau .lt. 0 .or.ibbck .lt. 0) ) ier = 5 + if(idepol .gt. 0 .and. (itau .lt. 0 .or. issa .lt. 0)) ier = 6 + if(ireff .gt. 0 .and. (ivol .lt. 0 .or. iarea .lt. 0)) ier = 7 + if(irefr .gt. 0 .and. ivol .lt. 0) ier = 8 + if(irefi .gt. 0 .and. ivol .lt. 0) ier = 8 + + if(ier /= 0) then + print *,'----------------------------------------------------' + print *,'ier = ', ier + print *,'issa, itau, igasym, ibbck, ietob, iabck0, iabck1, idepol, ireff, irefr, irefi = ', & + issa, itau, igasym, ibbck, ietob, iabck0, iabck1, idepol, ireff, irefr, irefi + call die(myname,'inconsistency in output registry') + end if + +! Hardwired: Read the input chemistry registry from Chem_Registry.rc +! This registry file describes the input chemistry bundle being +! operated on. +! ------------------------------------------------------------------ + regInp = Chem_RegistryCreate(ier,'Chem_MieRegistry.rc') + if(ier /= 0) call die(myname, 'cannot create registry') + +! Hardwired: use the Chem_MieMod function to create the Mie tables +! ------------------------------------------------------------------ + mie_tables = Chem_MieCreate(rcfile,ier) + +! Call subroutine to check the number of times and frequency on +! input file; output will have same information +! ------------------------------------------------------------------ + call check_infile ! returns ndx and freq + + new = .true. + do idx = 1, ndx + +! Read the input chemistry bundle from the infile +! ------------------------------------------------- + call Chem_BundleRead(infile, nymd, nhms, w_c, rc, freq=freq, & + ChemReg=regInp, timidx=idx) + + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + ig = w_c%grid%ig + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jg = w_c%grid%jg + im = w_c%grid%im + jm = w_c%grid%jm + km = w_c%grid%km + +! Layer thickness in cartesian sense is needed for certain extrinsic +! properties, specifically any calculations requiring backscatter +! or extinction. If these fields are requested then we need to allocate +! space for the layer thickness ("delz"). The value of delz is +! filled in either by (1) reading the layer edge heights from a file (the +! "hghtefile") or (2) by reading the air density from a file (the +! "airdensfile") and computing via hydrostatic relation +! (i.e., dz = dp/g/rhoa) or (3) by computing directly from provided +! thermodynamic variables (e.g., t, qv). + if(iext .gt. 0 .or. ibbck .gt. 0) then + +! Allocate space to contain the thickness of the layer + allocate(delz(i1:i2,j1:j2,1:km), stat=ier) + if(ier /= 0) call die(myname,'could not allocate space for delz') + +! If "hghtefile" is provided let's get delz that way + if(found_hghtefile) then + allocate(hghte(i1:i2,j1:j2,1:km+1), stat=ier) + if(ier /= 0) call die(myname,'could not allocate space for HGHTE') + call GFIO_Open ( hghtefile, READ_ONLY, fid, ier ) + if(ier /= 0) call die(myname,'could not open '//hghtefile//' to read HGHTE') + call GFIO_GetVar ( fid, 'HGHTE', nymd, nhms, & + im, jm, 1, km+1, hghte, ier ) + if(ier /= 0) call die(myname,'could not read HGHTE from '//hghtefile) + call GFIO_Close ( fid, ier) + if(ier /= 0) call die(myname,'could not close infile for HGHTE read') + do ik = 1, km + delz(:,:,ik) = hghte(:,:,ik)-hghte(:,:,ik+1) + end do + deallocate(hghte,stat=ier) + if(ier /= 0) call die(myname,'could not deallocate space for HGHTE') + + else +! Get the air density, either from aerosol file or externally + if(trim(airdensfile) .eq. trim(infile)) then + airdens => delz +! Get the air density from the aerosol file + call GFIO_Open ( airdensfile, READ_ONLY, fid, ier ) + if(ier /= 0) call die(myname,'could not open '//airdensfile//' to read airdens') + call GFIO_GetVar ( fid, 'AIRDENS', nymd, nhms, & + im, jm, 1, km, airdens, ier ) + if(ier /= 0) then + call GFIO_GetVar ( fid, 'airdens', nymd, nhms, & + im, jm, 1, km, airdens, ier ) + if(ier /= 0) call die(myname,'could not read airdens from '//airdensfile) + end if + call GFIO_Close ( fid, ier) + if(ier /= 0) call die(myname,'could not close infile for airdens read') + else +! Get air density from an external file + call GFIO_Open ( airdensfile, READ_ONLY, fid, ier ) + if(ier /= 0) call die(myname,'could not open '//airdensfile//' to read airdens') + call GFIO_GetVar ( fid, 'AIRDENS', nymd, nhms, & + im, jm, 1, km, delz, ier ) + if ( ier /= 0 ) then + call GFIO_GetVar ( fid, 'airdens', nymd, nhms, & + im, jm, 1, km, delz, ier ) + end if + if(ier .eq. 0) then + airdens => delz + call GFIO_Close ( fid, ier) + if(ier /= 0) call die(myname,'could not close infile for airdens read') + else +! If the air density is not on the file try to compute delz directly +! from the thermodynamic variables (need T, QV) + allocate(t(i1:i2,j1:j2,1:km), q(i1:i2,j1:j2,1:km), stat=ier) + if(ier /= 0) call die(myname,'could not allocate space to compute airdens') + call GFIO_GetVar ( fid, 'T', nymd, nhms, & + im, jm, 1, km, t, ier ) + if(ier /= 0) call die(myname,'could not read temperature '//airdensfile) + call GFIO_GetVar ( fid, 'QV', nymd, nhms, & + im, jm, 1, km, q, ier ) + if(ier /= 0) call die(myname,'could not read specific humidity from '//airdensfile) + call GFIO_Close ( fid, ier) + if(ier /= 0) call die(myname,'could not close infile for airdens read') + do j = j1, j2 + do i = i1, i2 + call delz_ + enddo + enddo + deallocate(t,q,stat=ier) + if(ier /= 0) call die(myname,'cloud not deallocate t,q') + endif + endif + +! If you actually read air density, compute dz + if(associated(airdens)) then + delz = w_c%delp/grav/airdens + endif + endif + +! Turn delz from m to km + delz = delz/1000. + + endif + + print *, 'Computing AOD for ', nymd, nhms + +! Check that the RH seems sane + if(.not. doing_geos4 .and. .not. doing_dry) then + maxrh = maxval(w_c%rh) + if(maxrh .gt. 2.) then + print *, 'Maximum RH value = ', maxRH + print *, 'Should you have chosen "-geos4" as a command line option?' + endif + endif + +! ================================================================================== +! The enclosed bundle of code selects on what calculation we run and what is written + do ik = 1, mie_tables%nch + + channel = mie_tables%channels(ik) + +! Create and initialize output chemistry bundle + call create_species_bundle(w_tau) + +! If doing species + if(doing_dust) call create_species_bundle(w_taudu) + if(doing_anthro) call create_species_bundle(w_tauant) + if(doing_ss) call create_species_bundle(w_tauss) + if(doing_su) call create_species_bundle(w_tausu) + if(doing_oc) call create_species_bundle(w_tauoc) + if(doing_bc) call create_species_bundle(w_taubc) + if(doing_cc) call create_species_bundle(w_taucc) + + + do iq = 1, mie_tables%nq + +! Sanity check: Does the mie_table name = chem_registry name? + if(trim(mie_tables%vname(iq)) .ne. trim(w_c%reg%vname(iq)) ) & + call die(myname, 'mie_tables and chem_registry vname mismatch') +! Cases + idxTable = Chem_MieQueryIdx(mie_tables,mie_tables%vname(iq),rc) + + if(idxTable .ne. -1) then + do k = 1, km + do j = 1, jm + do i = 1, im + +! fix in case NaN on input of qa +#ifndef sysAIX + if(isnan(w_c%qa(iq)%data3d(i,j,k))) & + w_c%qa(iq)%data3d(i,j,k) = tiny(w_c%qa(iq)%data3d(i,j,k)) +#endif + qMass = w_c%qa(iq)%data3d(i,j,k)*w_c%delp(i,j,k)/grav + call Chem_MieQuery(mie_tables, idxTable, 1.*ik, & + qMass, & + w_c%rh(i,j,k) * scaleRH, tau=tau_, ssa=ssa_, & + bbck=bbck_, bext=bext_, gasym=gasym_, & + p11=p11_, p22=p22_, vol=vol_, area=area_, & + refr=refr_, refi=refi_) + +! Fill in the total values +! Note the weighting of the ssa, backscatter, and e_to_b ratio + call fill(w_tau) + + if(doing_dust .and. (iq .ge. w_c%reg%i_du .and. iq .le. w_c%reg%j_du)) then + call fill(w_taudu) + endif + + if(doing_su .and. (iq .ge. w_c%reg%i_su .and. iq .le. w_c%reg%j_su)) then + call fill(w_tausu) + endif + + if(doing_bc .and. (iq .ge. w_c%reg%i_bc .and. iq .le. w_c%reg%j_bc)) then + call fill(w_taubc) + endif + + if(doing_oc .and. (iq .ge. w_c%reg%i_oc .and. iq .le. w_c%reg%j_oc)) then + call fill(w_tauoc) + endif + + if(doing_ss .and. (iq .ge. w_c%reg%i_ss .and. iq .le. w_c%reg%j_ss)) then + call fill(w_tauss) + endif + + if(doing_anthro .and. & + ( (iq .ge. w_c%reg%i_oc .and. iq .le. w_c%reg%j_oc) .or. & + (iq .ge. w_c%reg%i_bc .and. iq .le. w_c%reg%j_bc) .or. & + (iq .ge. w_c%reg%i_su .and. iq .le. w_c%reg%j_su) ) ) then + call fill(w_tauant) + endif + + if(doing_cc .and. & + ( (iq .ge. w_c%reg%i_oc .and. iq .le. w_c%reg%j_oc) .or. & + (iq .ge. w_c%reg%i_bc .and. iq .le. w_c%reg%j_bc) ) ) then + call fill(w_taucc) + endif + + enddo ! i + enddo ! j + enddo ! k + endif + enddo ! iq + +! call Chem_RegistryPrint(regout) + +! Normalize the ssa calculation + call normal(w_tau) + if(doing_dust) call normal(w_taudu) + if(doing_ss) call normal(w_tauss) + if(doing_su) call normal(w_tausu) + if(doing_bc) call normal(w_taubc) + if(doing_oc) call normal(w_tauoc) + if(doing_cc) call normal(w_taucc) + if(doing_anthro) call normal(w_tauant) + +! Compute the attentuated backscatter terms + call backscatter(w_tau) + if(doing_dust) call backscatter(w_taudu) + if(doing_ss) call backscatter(w_tauss) + if(doing_su) call backscatter(w_tausu) + if(doing_oc) call backscatter(w_tauoc) + if(doing_bc) call backscatter(w_taubc) + if(doing_cc) call backscatter(w_taucc) + if(doing_anthro) call backscatter(w_tauant) + +! Write the Chem_Bundle out + write(datestr,'(i8.8)') nymd + chstr = '' + write(chnstr,'(i3.3)') ik + if(mie_tables%nch > 1) chstr = '.channel'//chnstr + filename = trim(outfile(1:lenfile)//trim(chstr)) + w_tau%rh = w_c%rh + call Chem_BundleWrite( filename, nymd, nhms, 0, w_tau, rc, & + verbose=.true., new=new, freq=freq) + if(doing_dust) then + filename = trim(outfile(1:lenfile)//trim(chstr)//'.dust') + w_taudu%rh = w_c%rh + call Chem_BundleWrite( filename, nymd, nhms, 0, w_taudu, rc, & + verbose=.true., new=new, freq=freq) + endif + if(doing_ss) then + filename = trim(outfile(1:lenfile)//trim(chstr)//'.ss') + w_tauss%rh = w_c%rh + call Chem_BundleWrite( filename, nymd, nhms, 0, w_tauss, rc, & + verbose=.true., new=new, freq=freq) + endif + if(doing_su) then + filename = trim(outfile(1:lenfile)//trim(chstr)//'.su') + w_tausu%rh = w_c%rh + call Chem_BundleWrite( filename, nymd, nhms, 0, w_tausu, rc, & + verbose=.true., new=new, freq=freq) + endif + if(doing_oc) then + filename = trim(outfile(1:lenfile)//trim(chstr)//'.oc') + w_tauoc%rh = w_c%rh + call Chem_BundleWrite( filename, nymd, nhms, 0, w_tauoc, rc, & + verbose=.true., new=new, freq=freq) + endif + if(doing_bc) then + filename = trim(outfile(1:lenfile)//trim(chstr)//'.bc') + w_taubc%rh = w_c%rh + call Chem_BundleWrite( filename, nymd, nhms, 0, w_taubc, rc, & + verbose=.true., new=new, freq=freq) + endif + if(doing_cc) then + filename = trim(outfile(1:lenfile)//trim(chstr)//'.cc') + w_taucc%rh = w_c%rh + call Chem_BundleWrite( filename, nymd, nhms, 0, w_taucc, rc, & + verbose=.true., new=new, freq=freq) + endif + if(doing_anthro) then + filename = trim(outfile(1:lenfile)//trim(chstr)//'.anthro') + w_tauant%rh = w_c%rh + call Chem_BundleWrite( filename, nymd, nhms, 0, w_tauant, rc, & + verbose=.true., new=new, freq=freq) + endif + + +! Clean up pointers +! ----------------- + call Chem_BundleDestroy(w_tau,rc) + if(doing_anthro) call Chem_BundleDestroy(w_tauant,rc) + if(doing_dust) call Chem_BundleDestroy(w_taudu,rc) + if(doing_ss) call Chem_BundleDestroy(w_tauss,rc) + if(doing_su) call Chem_BundleDestroy(w_tausu,rc) + if(doing_oc) call Chem_BundleDestroy(w_tauoc,rc) + if(doing_bc) call Chem_BundleDestroy(w_taubc,rc) + if(doing_cc) call Chem_BundleDestroy(w_taucc,rc) + + + enddo ! channels + +! Clean up allocation of space for delz if doing extinction + if(iext .gt. 0 .or. ibbck .gt. 0) deallocate(delz) + + +! ================================================================================== + + call Chem_BundleDestroy(w_c,rc) + new = .false. + enddo ! idx (time increment in input file) + +! Destroy Mie tables + call Chem_MieDestroy(mie_tables,ier) + call Chem_RegistryDestroy(regInp, rc) + call Chem_RegistryDestroy(regOut, rc) + +! ---------------------------------------------------------------------------- + contains + + subroutine usage() + print * + print *,'Usage: ' + print *,' Chem_Aod3d.x [-dust -anthro ' + print *,' -o outfile -t rcfile ] infile' + print * + print *, 'where' + print * + print *, '-geos4 to specify that the relative humidity of input file' + print *, ' varies 0 - 100 instead of 0 - 1 as in GEOS-5' + print *, '-dryaer to specify to ignore the relative humidity in the' + print *, ' input file; compute all properties like RH = 0%' + print *, '-dust compute for dust separately' + print *, '-ss compute for seasalt separately' + print *, '-su compute for sulfate separately' + print *, '-bc compute for black carbon separately' + print *, '-oc compute for organic carbon separately' + print *, '-cc compute for total carbon separately' + print *, '-anthro compute for SU, BC, and OC separately' + print *, '-o outfile output file header' + print *, '-t rcfile resource file specifying channels for AOD calc' + print *, '-airdensfile airdensfilename filename providing variable AIRDENS' + print *, ' if omitted, use infile' + print *, '-hghtefile hghtefilename filename providing variable HGHTE' + print *, ' supercedes airdensfile if both provided' + print *, 'infile mandatory c_rst file' + print * + call exit(1) + end subroutine usage + + + subroutine create_species_bundle(this) + type(Chem_Bundle) :: this + + call Chem_BundleCreate(regOut, & + i1, i2, ig, im, & + j1, j2, jg, jm, km, & + this, ier) + if(ier /= 0) call die(myname, 'cannot create bundle') + this%delp = w_c%delp + this%rh = 0. +! NB: as a hack I may use this%rh as a storage variable; +! I'll reset at the end + do n = 1, regOut%nq + this%qa(n)%data3d = 0.0 + end do + end subroutine create_species_bundle + + + subroutine fill(this) + type(Chem_Bundle) :: this + if(itau .gt. 0) this%qa(itau)%data3d(i,j,k) & + = this%qa(itau)%data3d(i,j,k) + tau_ + if(iext .gt. 0) this%qa(iext)%data3d(i,j,k) & + = this%qa(iext)%data3d(i,j,k) + tau_/delz(i,j,k) + if(issa .gt. 0) this%qa(issa)%data3d(i,j,k) & + = this%qa(issa)%data3d(i,j,k) + ssa_*tau_ + if(igasym .gt. 0) this%qa(igasym)%data3d(i,j,k) & + = this%qa(igasym)%data3d(i,j,k) + gasym_*ssa_*tau_ + if(immr .gt. 0) this%qa(immr)%data3d(i,j,k) & + = this%qa(immr)%data3d(i,j,k) + w_c%qa(iq)%data3d(i,j,k) + if(ibbck .gt. 0) this%qa(ibbck)%data3d(i,j,k) & + = this%qa(ibbck)%data3d(i,j,k) + bbck_*qMass/delz(i,j,k) + if(idepol .gt. 0) then + this%qa(idepol)%data3d(i,j,k) & + = this%qa(idepol)%data3d(i,j,k) + (p11_-p22_)*ssa_*tau_ +! See how we are using this%rh; don't forget! + this%rh(i,j,k) = this%rh(i,j,k) + (p11_+p22_)*ssa_*tau_ + endif + + if(ivol .gt. 0) then + this%qa(ivol)%data3d(i,j,k) = this%qa(ivol)%data3d(i,j,k) + vol_*qMass/delz(i,j,k) + endif + + if(iarea .gt. 0) then + this%qa(iarea)%data3d(i,j,k) = this%qa(iarea)%data3d(i,j,k) + area_*qMass/delz(i,j,k) + endif + + if(irefr .gt. 0) then + this%qa(irefr)%data3d(i,j,k) = this%qa(irefr)%data3d(i,j,k) + refr_*vol_*qMass/delz(i,j,k) + endif + + if(irefi .gt. 0) then + this%qa(irefi)%data3d(i,j,k) = this%qa(irefi)%data3d(i,j,k) + refi_*vol_*qMass/delz(i,j,k) + endif + + end subroutine fill + + + subroutine normal(this) + type(Chem_Bundle) :: this +! Check floating underflow in tau + do k = 1, km + do j = 1, jm + do i = 1, im + if(itau .gt. 0) this%qa(itau)%data3d(i,j,k) = max( this%qa(itau)%data3d(i,j,k), & + tiny(this%qa(itau)%data3d(i,j,k))) + if(iext .gt. 0) this%qa(iext)%data3d(i,j,k) = max( this%qa(iext)%data3d(i,j,k), & + tiny(this%qa(iext)%data3d(i,j,k))) + if(ibbck .gt. 0) this%qa(ibbck)%data3d(i,j,k) = max( this%qa(ibbck)%data3d(i,j,k), & + tiny(this%qa(ibbck)%data3d(i,j,k))) + if(issa .gt. 0) this%qa(issa)%data3d(i,j,k) = max( this%qa(issa)%data3d(i,j,k), & + tiny(this%qa(issa)%data3d(i,j,k))) + if(issa .gt. 0) this%qa(issa)%data3d(i,j,k) = this%qa(issa)%data3d(i,j,k)/this%qa(itau)%data3d(i,j,k) + if(igasym .gt. 0) this%qa(igasym)%data3d(i,j,k) = max( this%qa(igasym)%data3d(i,j,k), & + tiny(this%qa(igasym)%data3d(i,j,k))) + if(igasym .gt. 0) this%qa(igasym)%data3d(i,j,k) = this%qa(igasym)%data3d(i,j,k) & + /(this%qa(issa)%data3d(i,j,k)*this%qa(itau)%data3d(i,j,k)) + if(ietob .gt. 0) this%qa(ietob)%data3d(i,j,k) = this%qa(itau)%data3d(i,j,k)/delz(i,j,k)/this%qa(ibbck)%data3d(i,j,k) + if(ietob .gt. 0) this%qa(ietob)%data3d(i,j,k) = max( this%qa(ietob)%data3d(i,j,k), & + tiny(this%qa(ietob)%data3d(i,j,k))) + if(idepol .gt. 0) this%qa(idepol)%data3d(i,j,k) = this%qa(idepol)%data3d(i,j,k)/max(this%rh(i,j,k),tiny(this%rh)) + if(idepol .gt. 0) this%qa(idepol)%data3d(i,j,k) = max( this%qa(idepol)%data3d(i,j,k), & + tiny(this%qa(idepol)%data3d(i,j,k))) + if(ivol .gt. 0) this%qa(ivol)%data3d(i,j,k) = max( this%qa(ivol)%data3d(i,j,k), & + tiny(this%qa(ivol)%data3d(i,j,k))) + if(iarea .gt. 0) this%qa(iarea)%data3d(i,j,k) = max( this%qa(iarea)%data3d(i,j,k), & + tiny(this%qa(iarea)%data3d(i,j,k))) + if(ireff .gt. 0) this%qa(ireff)%data3d(i,j,k) = 3./4.*this%qa(ivol)%data3d(i,j,k)/this%qa(iarea)%data3d(i,j,k) + if(ireff .gt. 0) this%qa(ireff)%data3d(i,j,k) = max( this%qa(ireff)%data3d(i,j,k), & + tiny(this%qa(ireff)%data3d(i,j,k))) + if(irefr .gt. 0) this%qa(irefr)%data3d(i,j,k) = this%qa(irefr)%data3d(i,j,k)/this%qa(ivol)%data3d(i,j,k) + if(irefr .gt. 0) this%qa(irefr)%data3d(i,j,k) = max( this%qa(irefr)%data3d(i,j,k), & + tiny(this%qa(irefr)%data3d(i,j,k))) + if(irefi .gt. 0) this%qa(irefi)%data3d(i,j,k) = this%qa(irefi)%data3d(i,j,k)/this%qa(ivol)%data3d(i,j,k) + if(irefi .gt. 0) this%qa(irefi)%data3d(i,j,k) = max( this%qa(irefi)%data3d(i,j,k), & + tiny(this%qa(irefi)%data3d(i,j,k))) + enddo + enddo + enddo + end subroutine normal + + + subroutine backscatter(this) + type(Chem_Bundle) :: this + +! Attenuated backscatter from space (I think, right, k = 1 is TOA) + if(iabck1 .gt. 0) then + this%qa(iabck1)%data3d(:,:,1) = this%qa(ibbck)%data3d(:,:,1)*exp(-this%qa(itau)%data3d(:,:,1)) + do k = 2, km + do j = 1, jm + do i = 1, im + taulev = 0. + do kk = 1, k-1 + taulev = taulev + this%qa(itau)%data3d(i,j,kk) + enddo + taulev = taulev + 0.5 * this%qa(itau)%data3d(i,j,k) + this%qa(iabck1)%data3d(i,j,k) = this%qa(ibbck)%data3d(i,j,k)*exp(-2.*taulev) + enddo + enddo + enddo + endif + +! Attenuated backscatter from surface (I think, right, k = 1 is TOA) + if(iabck0 .gt. 0) then + this%qa(iabck0)%data3d(:,:,km) = this%qa(ibbck)%data3d(:,:,km)*exp(-this%qa(itau)%data3d(:,:,km)) + do k = km-1, 1, -1 + do j = 1, jm + do i = 1, im + taulev = 0. + do kk = km, k+1, -1 + taulev = taulev + this%qa(itau)%data3d(i,j,kk) + enddo + taulev = taulev + 0.5 * this%qa(itau)%data3d(i,j,k) + this%qa(iabck0)%data3d(i,j,k) = this%qa(ibbck)%data3d(i,j,k)*exp(-2.*taulev) + enddo + enddo + enddo + endif + end subroutine backscatter + + + subroutine delz_ + implicit none + + real :: Tv, mixr, pe(km+1) + real, parameter :: ptop = 1. +! Construct edge pressures +! ------------------------ + pe(1) = ptop + do k = 2, km + 1 + pe(k) = pe(k-1) + w_c%delp(i,j,k-1) + end do + +! Construct mid-layer pressures and layer thickness +! ------------------------------------------------- + do k = 1, km + mixr = q(i,j,k) / ( 1.0 - q(i,j,k) ) ! Mixing ratio from specific humidity + Tv = T(i,j,k) * ( 1 + 0.61 * mixr ) + delz(i,j,k) = Rgas * Tv * log(pe(k+1)/pe(k)) / grav + end do + + end subroutine delz_ + + + subroutine check_infile + ! This will die non-gracefully if any problems reading file + integer fid, err, hour, min, timInc + integer l_im, l_jm, l_km, l_lm, l_nvars, l_ngatts, incsecs, yyyymmdd_beg, hhmmss_beg + integer, parameter :: READ_ONLY = 1 + + ! Open the file + ! ------------- + call GFIO_Open ( infile, READ_ONLY, fid, err ) + call GFIO_DimInquire ( fid, l_im, l_jm, l_km, l_lm, l_nvars, l_ngatts, err) + call GetBegDateTime ( fid, yyyymmdd_beg, hhmmss_beg, incSecs, err ) + timInc = 000100 ! default: 1 minute + if ( l_lm .ge. 1 ) then !ams: changed lm.gt.1 to lm.ge.1 + hour = incSecs/3600 + if (hour == 0) hour=1 + min = mod(incSecs,3600*hour)/60 + timInc = incSecs/3600*10000 + mod(incSecs,3600)/60*100 + mod(incSecs,60) + end if + call GFIO_close ( fid, err ) + ndx = l_lm + freq = timInc + end subroutine check_infile + +end diff --git a/ESMF/Shared/Chem_Base/Chem_AodMod.F90 b/ESMF/Shared/Chem_Base/Chem_AodMod.F90 new file mode 100644 index 00000000..efba6aff --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_AodMod.F90 @@ -0,0 +1,452 @@ + +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_AodMod --- Aerosol Optical Depth Calculator +! +! !INTERFACE: +! + + module Chem_AodMod + +! !USES: + + + use ESMF + use MAPL + + use Chem_MieTableMod + use Chem_MieMod + use Chem_RegistryMod + + implicit none + +! +! !PUBLIC MEMBER FUNCTIONS: +! + PUBLIC Chem_AodCalculator ! Calculates AOD given mixing ratios + PUBLIC Chem_rEffCalculator ! Calculates Aerosol Effective Radius + +! +! !DESCRIPTION: +! +! This module implements an Aerosol Optical Depth calculator. +! +! !REVISION HISTORY: +! +! 29Nov2010 da Silva Revamped to use Simple Bundle construct. +! 12Jan2011 da Silva Reff capability. +! +!EOP +!------------------------------------------------------------------------- + + interface Chem_AodCalculator + Module Procedure Chem_AodCalculator2d + end interface Chem_AodCalculator + +CONTAINS + +!----------------------------------------------------------------------------- +!BOP + +! !IROUTINE: Chem_AodCalculator ---- Mie Calculator given Aerosol Mixing Ratio +! +! !INTERFACE: +! + subroutine Chem_AodCalculator2d ( y, x, Mie, verbose, rc ) + + +! !ARGUMENTS: + + type(MAPL_SimpleBundle), intent(inout) :: y ! Already created Bundle + type(MAPL_SimpleBundle), intent(in) :: x ! Aerosol concentrations + type(Chem_Mie), intent(inout) :: Mie ! Mie tables, etc + + logical, OPTIONAL, intent(in) :: verbose + integer, OPTIONAL, intent(out) :: rc + +! !DESCRIPTION: Compute AOD given aerosol mixing ratio. +! +!EOP +!----------------------------------------------------------------------------- + + integer iq, idxTable, im, jm, km, iRH, i, j, k, n + real(ESMF_KIND_R4) :: tau, delm, rh + logical :: verbose_ + + __Iam__("Chem_AodCalculator") + + if ( present(verbose) ) then + verbose_ = verbose .and. MAPL_AM_I_ROOT() + else + verbose_ = .FALSE. + end if + + im = size(x%coords%lons,1) + jm = size(x%coords%lons,2) + km = size(x%coords%levs) + + iRH = MAPL_SimpleBundleGetIndex(x,'RH',rank=3,rc=STATUS,quiet=.TRUE.) + if ( STATUS /= 0 ) then + iRH = MAPL_SimpleBundleGetIndex(x,'RH2',rank=3,__RC__) + end if + +! Consistency check +! ----------------- + if ( Mie%nch /= size(y%coords%levs) ) then + __raise__(MAPL_RC_ERROR,"mieTable/y has inconsistent number of channels") + end if + if ( .not. associated(x%coords%lcv%delp) ) then + __raise__(MAPL_RC_ERROR,"x%coords%lcv must have delp set") + end if + +! Initialize output arrays to zero +! -------------------------------- + y%r3(1)%q = 0.0 + +! Loop over aerosol species +! ------------------------- + do iq = 1, x%n3d + + idxTable = Chem_MieQueryIdx(Mie,x%r3(iq)%name,rc) + + if (idxTable == -1) then + if (verbose_) & + print *, '[-] Skipping '//trim(x%r3(iq)%name)//' contribution' + + cycle + end if + + if ( rc/=0 ) then + __raise__(MAPL_RC_ERROR,"cannot get Mie index for "//trim(x%r3(iq)%name)) + end if + + if (verbose_) & + print *, '[+] Adding '//trim(x%r3(iq)%name)//' contribution' + +! Loop over channel, x, y, z +! -------------------------- + do n = 1, Mie%nch + do k = 1, km + do j = 1, jm + do i = 1, im + + delm = x%r3(iq)%q(i,j,k) * x%coords%lcv%delp(i,j,k) / MAPL_GRAV + rh = x%r3(iRH)%q(i,j,k) + + call Chem_MieQuery(Mie, idxTable, float(n), delm, rh, tau=tau) + + y%r3(1)%q(i,j,n) = y%r3(1)%q(i,j,n) + tau + + end do ! longitudes + end do ! latitudes + end do ! levels + end do ! channels + + end do ! aerosol tracers + + + if (verbose_) & + print *, '[x] All done!' + + rc = 0 + + end subroutine Chem_AodCalculator2d + +!----------------------------------------------------------------------------- +!BOP + +! !IROUTINE: Chem_rEffCalculator ---- Compute Aerosol Effective Radius +! +! !INTERFACE: +! + subroutine Chem_rEffCalculator ( y, x, Mie, verbose, rc ) + + +! !ARGUMENTS: + + type(MAPL_SimpleBundle), intent(inout) :: y ! Already created Bundle + type(MAPL_SimpleBundle), intent(in) :: x ! Aerosol concentrations + type(Chem_Mie), intent(inout) :: Mie ! Mie tables, etc + + logical, OPTIONAL, intent(in) :: verbose + integer, OPTIONAL, intent(out) :: rc + +! !DESCRIPTION: Return Aerosol Effective Radius. +! +!EOP +!----------------------------------------------------------------------------- + + integer iq, idxTable, im, jm, km, iRH, i, j, k + real(ESMF_KIND_R4) :: rEff, delm, rh + logical :: verbose_ + + __Iam__("Chem_rEffCalculator") + + if ( present(verbose) ) then + verbose_ = verbose .and. MAPL_AM_I_ROOT() + else + verbose_ = .FALSE. + end if + + im = size(x%coords%lons,1) + jm = size(x%coords%lons,2) + km = size(x%coords%levs) + + iRH = MAPL_SimpleBundleGetIndex(x,'rh',rank=3,quiet=.true.,rc=STATUS) + if ( STATUS /= 0 ) then + iRH = MAPL_SimpleBundleGetIndex(x,'RH',rank=3,__RC__) + end if + +! Consistency check +! ----------------- + if ( .not. associated(x%coords%lcv%delp) ) then + __raise__(MAPL_RC_ERROR,"x%coords%lcv must have delp set") + end if + + delm = 0.0 + +! Loop over aerosol species +! ------------------------- + do iq = 1, x%n3d + + idxTable = Chem_MieQueryIdx(Mie,x%r3(iq)%name,rc) + if(idxTable == -1) cycle + if ( rc/=0 ) then + __raise__(MAPL_RC_ERROR,"cannot get Mie index for "//trim(x%r3(iq)%name)) + end if + + if (verbose_) & + print *, '[+] Adding '//trim(x%r3(iq)%name)//' contribution' + +! Loop over x, y, z +! ----------------- + do k = 1, km + do j = 1, jm + do i = 1, im + + rh = x%r3(iRH)%q(i,j,k) + + call Chem_MieQuery(Mie, idxTable, 1.0, delm, rh, rEff=rEff) + + y%r3(iq)%q(i,j,k) = rEff + + + end do ! longitudes + end do ! latitudes + end do ! levels + + end do ! aerosol tracers + + + if (verbose_) & + print *, '[x] All done!' + + rc = 0 + + end subroutine Chem_rEffCalculator + +!----------------------------------------------------------------------------- +!BOP + +! !IROUTINE: Chem_ConcCalculator ---- Compute Aerosol Effective Radius +! +! !INTERFACE: +! + subroutine Chem_ConcCalculator ( y, x, Mie, verbose, rc ) + + +! !ARGUMENTS: + + type(MAPL_SimpleBundle), intent(inout) :: y ! Already created Bundle + type(MAPL_SimpleBundle), intent(in) :: x ! Aerosol concentrations + type(Chem_Mie), intent(inout) :: Mie ! Mie tables, etc + + logical, OPTIONAL, intent(in) :: verbose + integer, OPTIONAL, intent(out) :: rc + +! !DESCRIPTION: Return Aerosol Concentration bundle. +! +!EOP +!----------------------------------------------------------------------------- + + integer iq, im, jm, km, i, j, k, idxTable + real(ESMF_KIND_R4) :: delm + logical :: verbose_ + + _Iam_("Chem_ConcCalculator") + + if ( present(verbose) ) then + verbose_ = verbose .and. MAPL_AM_I_ROOT() + else + verbose_ = .FALSE. + end if + + im = size(x%coords%lons,1) + jm = size(x%coords%lons,2) + km = size(x%coords%levs) + +! Consistency check +! ----------------- + if ( .not. associated(x%coords%lcv%delp) ) then + __raise__(MAPL_RC_ERROR,"x%coords%lcv must have delp set") + end if + +! Loop over aerosol species +! ------------------------- + do iq = 1, x%n3d + + idxTable = Chem_MieQueryIdx(Mie,x%r3(iq)%name,rc) + if(idxTable == -1) cycle + if ( rc/=0 ) then + __raise__(MAPL_RC_ERROR,"cannot get Mie index for "//trim(x%r3(iq)%name)) + end if + + if (verbose_) & + print *, '[+] Adding '//trim(x%r3(iq)%name)//' contribution' + +! Loop over x, y, z +! ----------------- + do k = 1, km + do j = 1, jm + do i = 1, im + + delm = x%r3(iq)%q(i,j,k) * x%coords%lcv%delp(i,j,k) / MAPL_GRAV + + y%r3(iq)%q(i,j,k) = delm + + end do ! longitudes + end do ! latitudes + end do ! levels + + end do ! aerosol tracers + + + if (verbose_) & + print *, '[x] All done!' + + rc = 0 + + end subroutine Chem_ConcCalculator + +!----------------------------------------------------------------------------- +!BOP + +! !IROUTINE: Chem_ExtCalculator ---- Compute 3D Aerosol Extinction +! +! !INTERFACE: +! + subroutine Chem_ExtCalculator ( y, x, Mie, verbose, rc ) + + +! !ARGUMENTS: + + type(MAPL_SimpleBundle), intent(inout) :: y ! Aerosol extinction + type(MAPL_SimpleBundle), intent(in) :: x ! Aerosol mixing ratio + type(Chem_Mie), intent(inout) :: Mie ! Mie tables, etc + + logical, OPTIONAL, intent(in) :: verbose + integer, OPTIONAL, intent(out) :: rc + +! !DESCRIPTION: Return Aerosol Extinction bundle. +! +!EOP +!----------------------------------------------------------------------------- + + integer :: iq, im, jm, km, i, j, k, n, idxTable + integer :: iTau, iExt, iBck, iRH, iRHO + real(ESMF_KIND_R4) :: delc, delm, delz, rh, tau, bck + logical :: verbose_ + + __Iam__("Chem_ExtCalculator") + + if ( present(verbose) ) then + verbose_ = verbose .and. MAPL_AM_I_ROOT() + else + verbose_ = .FALSE. + end if + + im = size(x%coords%lons,1) + jm = size(x%coords%lons,2) + km = size(x%coords%levs) + + iRH = MAPL_SimpleBundleGetIndex(x,'rh',rank=3,quiet=.true.,rc=STATUS) + if ( STATUS /= 0 ) then + iRH = MAPL_SimpleBundleGetIndex(x,'RH',rank=3,__RC__) + end if + + iRHO = MAPL_SimpleBundleGetIndex(x,'airdens',rank=3,quiet=.true.,rc=STATUS) + if ( STATUS /= 0 ) then + iRHO = MAPL_SimpleBundleGetIndex(x,'AIRDENS',rank=3,__RC__) + end if + + iTau = MAPL_SimpleBundleGetIndex(y,'tau', rank=3,quiet=.true.,rc=STATUS) + iExt = MAPL_SimpleBundleGetIndex(y,'extinction',rank=3,quiet=.true.,rc=STATUS) + iBck = MAPL_SimpleBundleGetIndex(y,'backscat', rank=3,quiet=.true.,rc=STATUS) + +! Consistency check +! ----------------- + if ( .not. associated(x%coords%lcv%delp) ) then + __raise__(MAPL_RC_ERROR,"x%coords%lcv must have delp set") + end if + if ( Mie%nch /= 1 ) then + __raise__(MAPL_RC_ERROR,"for now, Mie must have a single channel") + end if + n = 1 + +! Loop over aerosol species +! ------------------------- + if ( iTau>0 ) y%r3(iTau)%q = 0.0 + if ( iExt>0 ) y%r3(iExt)%q = 0.0 + if ( iBck>0 ) y%r3(iBck)%q = 0.0 + + do iq = 1, x%n3d + + idxTable = Chem_MieQueryIdx(Mie,x%r3(iq)%name,rc) + if(idxTable == -1) cycle + if ( rc/=0 ) then + __raise__(MAPL_RC_ERROR,"cannot get Mie index for "//trim(x%r3(iq)%name)) + end if + + if (verbose_) & + print *, '[+] Adding '//trim(x%r3(iq)%name)//' contribution' + +! Loop over x, y, z +! ----------------- + do k = 1, km + do j = 1, jm + do i = 1, im + + delm = x%r3(iq)%q(i,j,k) * x%coords%lcv%delp(i,j,k) / MAPL_GRAV + delc = x%r3(iq)%q(i,j,k) * x%r3(iRHO)%q(i,j,k) ! concentration + delz = x%coords%lcv%delp(i,j,k) / (MAPL_GRAV*x%r3(iRHO)%q(i,j,k)) + rh = x%r3(iRH)%q(i,j,k) + + call Chem_MieQuery(Mie, idxTable, float(n), delm, rh, tau=tau, bbck=bck ) + + if ( iTau>0 ) y%r3(iTau)%q(i,j,k) = y%r3(iTau)%q(i,j,k) + tau + + if ( iExt>0 ) y%r3(iExt)%q(i,j,k) = y%r3(iExt)%q(i,j,k) + tau / delz + + if ( iBck>0 ) y%r3(iBck)%q(i,j,k) = y%r3(iBck)%q(i,j,k) + bck * delc + + end do ! longitudes + end do ! latitudes + end do ! levels + + end do ! aerosol tracers + + + if (verbose_) & + print *, '[x] All done!' + + rc = 0 + + end subroutine Chem_ExtCalculator + + end module Chem_AodMod + diff --git a/ESMF/Shared/Chem_Base/Chem_ArrayMod.F90 b/ESMF/Shared/Chem_Base/Chem_ArrayMod.F90 new file mode 100644 index 00000000..c61f8947 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_ArrayMod.F90 @@ -0,0 +1,25 @@ +Module Chem_ArrayMod + + private + public Chem_Array + +! The Chem_Array, a light weight ESMF-like array +! ---------------------------------------------- + type Chem_Array + integer :: rank + logical :: did_alloc = .false. ! useful to keep track of allocations + real, pointer :: data2d(:,:) => null() + real, pointer :: data3d(:,:,:) => null() + +! A per-tracer scavenging efficiency in convective updrafts [km-1] + real :: fscav = 0.0 + +! A per-tracer large-scale wet removal efficiency [fraction] + real :: fwet = 0.0 + +! A kluge for doing RH affected fall velocities in CARMA + integer :: irhFlag = 0 + + end type Chem_Array + + end Module Chem_ArrayMod diff --git a/ESMF/Shared/Chem_Base/Chem_BundleMod.F90 b/ESMF/Shared/Chem_Base/Chem_BundleMod.F90 new file mode 100644 index 00000000..aea654ec --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_BundleMod.F90 @@ -0,0 +1,1821 @@ +#include "unused_dummy.H" +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_BundleMod.F90 --- Implements Chemical Bundle Class +! +! !INTERFACE: +! + MODULE Chem_BundleMod + +! !USES: + + Use ESMF + Use Chem_RegistryMod + Use Chem_ArrayMod + Use m_chars, only: uppercase + Use MAPL, only: MAPL_UNDEF + + Implicit NONE + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC Chem_Bundle ! chemical bundle type +! +! !PUBLIC MEMBER FUNCTIONS: +! + PUBLIC Chem_Grid ! grid definition + PUBLIC Chem_BundleCreate ! initializes chemical bundle + PUBLIC Chem_BundleDestroy ! "cleans" chemical bundle + PUBLIC Chem_BundleWrite ! writes Chem_Bundle to file + PUBLIC Chem_BundleRead ! reads Chem_Bundle from file + PUBLIC Chem_BundleStat ! Prints vital stats by level + PUBLIC Chem_BundleSetPtr ! Fix internal pointers + +! +! !DESCRIPTION: This module implements the chemical bundle class. +! It is loosely based on the fvDAS dynamics class m\_dyn. +! +! !REVISION HISTORY: +! +! 18sep2001 da Silva Initial code. +! 29jul2003 da Silva Revised for ESMF consistency +! 16oct2003 da Silva Introduced ghosting +! 15jan2003 da Silva Removed ptop,delp,q as arguments; added skipAlloc +! 29Mar2005 da Silva Revised RH implementation: before it was always +! allocated, not it is treated as the other variables. +! 11Aug2005 da Silva Added optional levels during creation +! 12Aug2005 da Silva Fixed bug in SetPtr routne (now it checks whether +! array is associated before pointing to it). +! 15Jan2008 Nielsen Added lon_min=-180.0 for GEOS5. +! 16Jun2016 Buchard Added option to do concentration instead of MR if needed (read airdens) +!EOP +!------------------------------------------------------------------------- + + real, parameter :: missing_val = MAPL_UNDEF ! hardwire this for now + integer, parameter :: nch = 256 + +! Grid +! ---- + type Chem_Grid + +! Zonal grid +! ---------- + integer :: i1, i2, iml ! local indices + integer :: ig ! ghosting + integer :: im ! global dimension + integer :: iLeft ! i1's index on global grid + real, pointer :: lon(:,:) => null() ! longitudes (deg) + +! Meridional grid +! --------------- + integer :: j1, j2, jml ! local indices + integer :: jg ! ghosting + integer :: jm ! global dimension + real, pointer :: lat(:,:) => null() ! latitudes (deg) + +! Vertical grid +! ------------- + integer :: km + real, pointer :: lev(:) => null() + character(len=nch) :: levUnits + real :: ptop ! Top pressure [Pa] + +! Horizontal gridbox area +! ----------------------- + real, pointer :: cell_area(:,:) => null() + +! Cubed sphere or not +! ------------------- + logical :: Cubed_Sphere = .FALSE. + + end type Chem_Grid + +! Chemical vector +! --------------- + type Chem_Bundle + +! Chem Registry +! ------------- + type(Chem_Registry) :: reg + +! Grid +! ---- + type(Chem_Grid) :: grid + + real, pointer :: cosz(:,:) => null() ! cosine solar zenith angle + real, pointer :: sinz(:,:) => null() ! sine solar zenith angle + + type(ESMF_Grid) :: grid_esmf + +! Whether this class allocated the memory for q, delp +! --------------------------------------------------- + logical :: did_allocation = .false. + logical :: has_rh = .false. ! for backward compatibility + logical :: diurnal_bb = .false. ! whether using diurnal biomass burning + logical :: do_concentration = .false. ! using concentration: MR * airdens instead of MR alone + real :: missing_value = MAPL_UNDEF + +! Tracer array +! ------------ + real, pointer :: delp(:,:,:) => null()! Layer thickness [Pa] (not ghosted) + real, pointer :: rh(:,:,:) => null() ! Layer thickness [Pa] (not ghosted) + real, pointer :: airdens(:,:,:) => null() ! Air density + + type(chem_array), pointer :: qa(:) => null() + ! access 4D array in q as a + ! collection of 3D arrays; used + ! for gradually removing the 4D + ! arrays + +! Two calendar elements (from ESMF) +! --------------------------------- + LOGICAL :: isLeapYear + REAL :: dayOfYear + + end type Chem_Bundle + +! Interfaces +! ---------- + PUBLIC Chem_BundleCreate_ ! initializes chemical bundle + PUBLIC Chem_BundleCreate1PE_ ! initializes chemical bundle + interface Chem_BundleCreate + module procedure Chem_BundleCreate_ ! Distributed data + module procedure Chem_BundleCreate1PE_ ! Undistributed data (1PE) + end interface + + CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_BundleCreate_ --- Creates Chemical Bundle +! +! !INTERFACE: +! + subroutine Chem_BundleCreate_ ( reg, & + i1, i2, ig, im, & + j1, j2, jg, jm, km, & + w_c, rc, & + skipAlloc, lat, lon, & + cell_area, & + lev, levUnits, ptop, & + do_Conc ) ! Optional +! +! !USES: +! + implicit NONE +! +! !INPUT PARAMETERS: +! + + type(Chem_registry) :: reg ! Chemical Registry + + ! Distributed grid info: + integer, intent(in) :: i1, i2 ! local zonal indices + integer, intent(in) :: ig ! zonal ghosting + integer, intent(in) :: im ! global zonal dimension + integer, intent(in) :: j1, j2 ! local meridional indices + integer, intent(in) :: jg ! meridional ghosting + integer, intent(in) :: jm ! global zonal dimension + integer, intent(in) :: km ! vertical dimension + + logical, OPTIONAL, intent(in) :: skipAlloc ! Do not allocate arrays + real, OPTIONAL, intent(in) :: lon(i1:i2,j1:j2) ! longitude in degrees + real, OPTIONAL, intent(in) :: lat(i1:i2,j1:j2) ! latitude in degrees + real, OPTIONAL, pointer :: cell_area(:,:) ! grid box area + real, OPTIONAL, intent(in) :: lev(1:km) ! levels + character(len=*), OPTIONAL, intent(in) :: levUnits ! level units + real, OPTIONAL, intent(in) :: ptop ! top pressure in Pa + logical, OPTIONAL, intent(in) :: do_Conc ! Do_concentration: In case you need MR*airdens instead of MR alone +! +! !OUTPUT PARAMETERS: +! + type(Chem_Bundle), intent (out) :: w_c ! Chemical bundle + + integer, intent(out) :: rc ! error return code: + ! 0 - all is well + ! 1 - already allocated + ! 2 - could not allocate memory + ! 3 - invalid dimensions + +! +! !DESCRIPTION: Creates a Chemical Bundle, allocating the necessary memory or +! optionally associating internal pointers with model declared +! flat arrays. +! +! !REVISION HISTORY: +! +! 20Sep2001 da Silva Initial code based on m_dyn. +! 05Sep2003 da Silva Revised ESMF-like design. +! 14mar2003 da Silva Added rh, lat, lon +! 16Jun2016 Buchard Added do_concentration option +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_BundleCreate_' + + integer err, i, j, n, nq, ios, ios1, ios2, ios3, ios4 + logical :: do_allocation + logical :: do_concentration + real*8 :: delta + +! Sanity check +! ------------ + rc = 0 + nq = reg%nq + if ( im<1 .or. jm<1 .or. km<1 .or. nq<1) then + rc = -3 + return + endif + + w_c%reg = reg + w_c%missing_value = MAPL_UNDEF + +! Whether or not we allocate memory for arrays +! -------------------------------------------- + if ( present(skipAlloc) ) then + do_allocation = .not. skipAlloc + else + do_allocation = .true. + end if + +! Whether or not read airdens to be able to work with concentration instead of MR +! ----------------------------------------------- + if ( present(do_Conc) ) then + do_concentration = do_Conc + else + do_concentration = .false. + end if + + + +! Initialize dimensional attributes +! --------------------------------- + w_c%grid%i1 = i1; w_c%grid%i2 = i2; w_c%grid%ig = ig; w_c%grid%im = im + w_c%grid%iml = i2 - i1 + 1 + w_c%grid%j1 = j1; w_c%grid%j2 = j2; w_c%grid%jg = jg; w_c%grid%jm = jm + w_c%grid%jml = j2 - j1 + 1 + w_c%grid%km = km + +! Detect cubed sphere for sanity checks latter +! -------------------------------------------- + if ( jm == im * 6 ) then + w_c%grid%Cubed_Sphere = .TRUE. + else + w_c%grid%Cubed_Sphere = .FALSE. + end if + +! Horizontal grid (hardwire A-grid for now) +! ----------------------------------------- + if ( present(ptop) ) then + w_c%grid%ptop = ptop + else + w_c%grid%ptop = 1.0 ! Pa: reasonable default + endif + +! Save lat/lons +! ------------- + allocate ( w_c%grid%lon(i1:i2,j1:j2), w_c%grid%lat(i1:i2,j1:j2), & + stat = ios ) ! + if ( ios /= 0 ) then + rc = 2 + return + end if + if ( present(lon) ) then + w_c%grid%lon = lon + else + !ALT w_c%grid%lon = MAPL_UNDEF + delta = 360.0d0/im + do i = 1, im + w_c%grid%lon(i,:) = -180.0d0 + (i-1)*delta + end do + end if + + if ( present(lat) ) then + w_c%grid%lat = lat + else + !ALT w_c%grid%lat = MAPL_UNDEF + if(jm==1) then + delta = 0.0d0 + else + delta = 180.0d0/(jm-1) + endif + do j = 1, jm + w_c%grid%lat(:,j) = -90.0d0 + (j-1)*delta + end do + end if + + if ( present(cell_area) ) then ! will be left unallocated otherwise + w_c%grid%cell_area => cell_area + end if + + if ( present(lev) ) then + allocate ( w_c%grid%lev(1:km), stat = ios ) + if ( ios /= 0 ) then + rc = 3 + return + end if + w_c%grid%lev = lev + end if + if ( present(levUnits) ) then + w_c%grid%levUnits = levUnits + else + w_c%grid%levUnits = 'none' + end if + + w_c%did_allocation = .false. + w_c%has_rh = .false. ! will be set to TRUE when set + w_c%do_concentration = .false. + + allocate(w_c%qa(nq),stat=ios2) + + if ( do_allocation ) then + + allocate(w_c%delp(i1:i2,j1:j2,km),stat=ios ) + do n = 1, nq + allocate(w_c%qa(n)%data3d(i1-ig:i2+ig,j1-jg:j2+jg,km),stat=ios1 ) + ios2 = ios2 + ios1 + end do + allocate(w_c%rh(i1:i2,j1:j2,km),stat=ios3 ) + + if ( ios + ios2 + ios3 == 0 ) then + w_c%did_allocation = .true. + w_c%delp = 0.0 + do n = 1, nq + w_c%qa(n)%data3d = 0.0 + end do + w_c%rh = 0.0 + else + w_c%did_allocation = .false. + rc = 4 + end if + + if (do_concentration ) then + w_c%do_concentration = .true. + allocate(w_c%airdens(i1:i2,j1:j2,km),stat=ios4 ) + if ( ios4 == 0 ) w_c%airdens = 0.0 + endif + + + end if + +! Set array of pointers: may be null() if no allocation took place +! ---------------------------------------------------------------- + call Chem_BundleSetPtr ( w_c, rc ) + + + end subroutine Chem_BundleCreate_ + +!------------------------------------------------------------------------- +! NASA/GSFC Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_BundleCreate1PE_ --- Creates Chemical Bundle (1 PE) +! +! !INTERFACE: +! + subroutine Chem_BundleCreate1PE_ ( reg, im, jm, km, & + w_c, rc, & + skipAlloc, ptop ) ! Optional +! +! !USES: +! + implicit NONE +! +! !INPUT PARAMETERS: +! + + type(Chem_registry) :: reg ! Chemical Registry + + ! Distributed grid info: + integer, intent(in) :: im ! global zonal dimension + integer, intent(in) :: jm ! global zonal dimension + integer, intent(in) :: km ! vertical dimension + + + + logical, OPTIONAL, intent(in) :: skipAlloc ! Do not allocate arrays + real, OPTIONAL, intent(in) :: ptop ! top pressure in Pa + +! +! !OUTPUT PARAMETERS: +! + type(Chem_Bundle), intent (out) :: w_c ! Chemical bundle + integer, intent(out) :: rc ! error return code: + ! 0 - all is well + ! 1 - already allocated + ! 2 - could not allocate memory + ! 3 - invalid dimensions + ! +! +! !DESCRIPTION: Creates a Chemical Bundle, allocating the necessary memory or +! optionally associating internal pointers with model declared +! flat array. All optional arguments must be specified, or NOT at all. +! This interface is for global, undistributed Bundles. +! +! +! !REVISION HISTORY: +! +! 20Sep2001 da Silva Initial code based on m_dyn. +! 05Sep2003 da Silva Revised ESMF-like design. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_BundleCreate1PE_' + + integer :: i1, i2, ig, j1, j2, jg + logical :: skipAllocation = .false. + real :: p_top = 1.0 + + + if ( present(skipAlloc) ) then + skipAllocation = skipAlloc + end if + if ( present(ptop) ) then + p_top = ptop + end if + + i1 = 1; i2 = im; ig = 0 + j1 = 1; j2 = jm; jg = 0 + + call Chem_BundleCreate_ ( reg, i1, i2, ig, im, j1, j2, jg, jm, km, & + w_c, rc, skipAlloc=skipAllocation, & + ptop = p_top ) + + end subroutine Chem_BundleCreate1PE_ + +!------------------------------------------------------------------------- +! NASA/GSFC Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_BundleDestroy --- Deallocates memory used by chemical state +! +! !INTERFACE: +! + subroutine Chem_BundleDestroy ( w_c, rc ) +! +! !USES: +! + implicit NONE +! +! !INPUT/OUTPUT PARAMETERS: +! + type(Chem_Bundle), intent (inout) :: w_c ! chemical bundle + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - +! !DESCRIPTION: +! +! Deallocates memory used by chemical bundle. +! +! !REVISION HISTORY: +! +! 20Jul1999 da Silva Initial code. +! 26oct1999 da Silva Added hs_stdv, ts, lwi, a, b +! 16Jun2016 Buchard Added do_concentration option +!EOP +!------------------------------------------------------------------------- + + integer n, ier + + rc = 0 + + if ( w_c%did_allocation ) then + + if ( associated(w_c%delp) ) deallocate(w_c%delp, stat=ier) + if ( associated(w_c%rh) ) deallocate(w_c%rh, stat=ier) + + + + + do n = 1, w_c%reg%nq + if ( associated(w_c%qa(n)%data3d) ) & + deallocate(w_c%qa(n)%data3d, stat=ier) + end do + if(associated(w_c%grid%lon)) deallocate( w_c%grid%lon ) + if(associated(w_c%grid%lat)) deallocate( w_c%grid%lat ) + if(associated(w_c%grid%lev)) deallocate( w_c%grid%lev ) + if(associated(w_c%qa)) deallocate( w_c%qa ) + + + if ( w_c%do_concentration ) then + if ( associated(w_c%airdens) ) deallocate(w_c%airdens, stat=ier) + endif + + + else + + if ( associated(w_c%delp) ) nullify(w_c%delp) + if ( associated(w_c%rh) ) nullify(w_c%rh) + + do n = 1, w_c%reg%nq + if ( associated(w_c%qa(n)%data3d) ) nullify(w_c%qa(n)%data3d) + end do + deallocate( w_c%grid%lon, w_c%grid%lat, w_c%grid%lev,w_c%qa, stat=ier) + + if ( w_c%do_concentration ) then + if ( associated(w_c%airdens) ) nullify(w_c%airdens) + endif + + end if + + + w_c%reg%nq = -1 + + end subroutine Chem_BundleDestroy + +!------------------------------------------------------------------------- +! NASA/GSFC Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_BundleWrite --- writes out single instance of chemical state +! +! !INTERFACE: +! + subroutine Chem_BundleWrite ( fname, nymd, nhms, prec, w_c, rc, & + verbose, new, freq, gfio_prec ) ! optional +! +! !USES: +! + implicit NONE + +! +! !INPUT PARAMETERS: +! + character(len=*), intent(in) :: fname ! output file name + integer, intent(in) :: nymd ! Date: year-month-day + integer, intent(in) :: nhms ! Time: hour-min-sec + integer, intent(in) :: prec ! precision: + ! 0 = 32 bits + ! 1 = 64 bits + type(Chem_Bundle), intent(in) :: w_c ! chemical bundle + + logical, intent(in), OPTIONAL :: verbose ! if true, send log to stdout + logical, intent(in), OPTIONAL :: new ! create new file even if it + ! already exists. + integer, intent(in), OPTIONAL :: freq ! time frequency (HHMMSS) for + ! multiple instance files + ! (default: 060000) + integer, OPTIONAL, intent(in) :: gfio_prec ! specify user precision + +! +! !OUTPUT PARAMETERS: +! + + integer, intent(out) :: rc ! error return code: + ! 0 - all is well + ! >0 - errors +! +! !DESCRIPTION: Writes a GFIO file with one or more instances of the +! chemical tracer bundle {\tt w\_f} valid at a given time +! to a file named {\tt fname}. The file is created or opened, written to and +! closed upon completion. +! +! !REVISION HISTORY: +! +! 20Sep2002 da Silva Initial code based dyn_put() +! 04Nov2015 Todling/Buchard add underlying gfio precision as option +! 16Jun2016 Buchard Even if do_concentration option is True, the file contains only MR +! +!EOP +!------------------------------------------------------------------------- + + character(len=nch) :: title, source, contact, levunits + + real, allocatable :: lat(:), lon(:), lev(:) + character(len=nch), allocatable :: vname(:), vtitle(:), vunits(:) + real, allocatable :: valid_range(:,:), packing_range(:,:) + integer, allocatable :: kmvar(:) + + real(8),allocatable :: lon8(:),lat8(:),lev8(:) + real(8),allocatable :: valid_range8(:,:), packing_range8(:,:) + real(8),allocatable,dimension(:,:,:)::rank3 + integer :: i1, i2, j1, j2, im, jm, km, nq, nvars + real :: p, ptop + integer :: i, j, k, timeinc + integer :: fid, err + integer :: gfio_prec_ + + + logical verb, creating, fexists + + integer, parameter :: READ_WRITE = 0 + + rc = 0 + +! Short hand for dimensions +! ------------------------- + i1 = w_c%grid%i1; j1 = w_c%grid%j1 + i2 = w_c%grid%i2; j2 = w_c%grid%j2 + im = w_c%grid%im; jm = w_c%grid%jm + km = w_c%grid%km; nq = w_c%reg%nq + nvars = nq + 2 ! delp, RH and tracers + +! Cannot handle cubed sphere +! -------------------------- + if ( w_c%grid%cubed_sphere ) then + rc = 1 + return + end if + +! No chemical tracers, nothing to do +! ---------------------------------- + if ( nvars .lt. 2 ) return + +! Requires global arrays for now +! ------------------------------ + if ( i1 /= 1 .or. i2 /= im .or. j1 /= 1 .or. j2 /= jm ) then + rc = 1 + return + end if + +! Handle optional parameters +! -------------------------- + if ( present(verbose) ) then + verb = verbose + else + verb = .false. + end if + + if ( present(new) ) then + creating = new + else + creating = .false. + end if + + gfio_prec_ = 32 ! default precision + if ( present(gfio_prec) ) then + gfio_prec_= gfio_prec + end if + + +! Check whether file exists +! ------------------------- + inquire ( file=trim(fname), exist=fexists ) + if ( .not. fexists ) creating = .true. ! must create then + +! Allocate local work space +! ------------------------- + rc = 0 + call init_ ( err ) + if ( err .ne. 0 ) then + call clean_() + rc = 2 + return + end if + + +! Create coordinate variables +! --------------------------- + + if ( gfio_prec_==64 ) then + lat8 = w_c%grid%lat(1,:) + lon8 = w_c%grid%lon(:,1) + else + lat = w_c%grid%lat(1,:) + lon = w_c%grid%lon(:,1) + endif + +! Vertical coordinates: fake something for GrADS sake +! --------------------------------------------------- + + + if ( associated(w_c%grid%lev) ) then + lev = w_c%grid%lev + levUnits = w_c%grid%levUnits + else + ptop = w_c%grid%ptop + i = im / 2 + j = jm / 2 + p = ptop + 0.5 * w_c%delp(i,j,1) + lev(1) = p + do k = 2, km + p = p + 0.5 * ( w_c%delp(i,j,k-1) + w_c%delp(i,j,k) ) + lev(k) = p + end do + lev(1:km) = lev(1:km) / 100. + levunits = 'hPa' + end if + if ( gfio_prec_==64 ) then + lev8 = lev + endif + + kmvar = km + +! Global metadata +! --------------- + title = 'fvCCM Chemical Bundle (Lagrangian Control Coordinates) v2.0' + source = 'Data Assimilation Office, NASA/GSFC' + contact = 'data@gmao.gsfc.nasa.gov' + +! For now, do not exercise packing/valid range feature +! ----------------------------------------------------- + if ( gfio_prec_== 64 ) then + do j = 1, nvars + do i = 1, 2 + valid_range8(i,j) = w_c%missing_value + packing_range8(i,j) = w_c%missing_value + end do + end do + else + do j = 1, nvars + do i = 1, 2 + valid_range(i,j) = w_c%missing_value + packing_range(i,j) = w_c%missing_value + end do + end do + endif +! Time attributes +! --------------- + if ( present(freq) ) then + timeinc = freq + else + timeinc = 060000 + end if + +! Create new GFIO file ... +! ------------------------ + if ( creating ) then + if (verb) print *, ' [] creating GFIO file ', trim(fname) + if ( gfio_prec_ == 64 ) then + call GFIO_Create ( fname, title, source, contact, & + real(w_c%missing_value,8), & + im, jm, km, lon8, lat8, lev8, levunits, & + nymd, nhms, timeinc, & + nvars, vname, vtitle, vunits, & + kmvar, valid_range8, packing_range8, prec, & + fid, err ) + else + call GFIO_Create ( fname, title, source, contact, & + w_c%missing_value, & + im, jm, km, lon, lat, lev, levunits, & + nymd, nhms, timeinc, & + nvars, vname, vtitle, vunits, & + kmvar, valid_range, packing_range, prec, & + fid, err ) + endif + +! ... or open existing GFIO file ... +! ---------------------------------- + else + + if (verb) print *, ' [] opening GFIO file ', trim(fname) + + call GFIO_Open ( fname, READ_WRITE, fid, err ) + + end if + + if ( err .ne. 0 ) then + rc = 3 + call clean_() + return + end if + +! Write the data to GFIO file +! --------------------------- + if ( gfio_prec_ == 64 ) then + if (verb) print *, ' [] writing ', trim(vname(1)) + rank3 = w_c%delp + call GFIO_PutVar ( fid, vname(1), nymd, nhms, im, jm, 1, km, & + rank3, err ) + if ( err .ne. 0 ) rc = 101 + + if (verb) print *, ' [] writing ', trim(vname(2)) + rank3 = w_c%rh + call GFIO_PutVar ( fid, vname(2), nymd, nhms, im, jm, 1, km, & + rank3, err ) + if ( err .ne. 0 ) rc = 102 + + do i = 3, nvars + if (verb) print *, ' [] writing ', trim(vname(i)) + rank3 = w_c%qa(i-2)%data3d(:,:,:) + call GFIO_PutVar ( fid, vname(i), nymd, nhms, im, jm, 1, km, & + rank3, err ) + if ( err .ne. 0 ) rc = 100 + i-1 + + if (w_c%do_concentration) then + rank3 = w_c%qa(i-2)%data3d(:,:,:)/w_c%airdens + call GFIO_PutVar ( fid, vname(i), nymd, nhms, im, jm, 1, km, & + rank3, err ) + if ( err .ne. 0 ) rc = 100 + i-1 + endif + end do + + else + + if (verb) print *, ' [] writing ', trim(vname(1)) + call GFIO_PutVar ( fid, vname(1), nymd, nhms, im, jm, 1, km, & + w_c%delp, err ) + if ( err .ne. 0 ) rc = 101 + + if (verb) print *, ' [] writing ', trim(vname(2)) + call GFIO_PutVar ( fid, vname(2), nymd, nhms, im, jm, 1, km, & + w_c%rh, err ) + if ( err .ne. 0 ) rc = 102 + + do i = 3, nvars + if (verb) print *, ' [] writing ', trim(vname(i)) + call GFIO_PutVar ( fid, vname(i), nymd, nhms, im, jm, 1, km, & + w_c%qa(i-2)%data3d(:,:,:), err ) + if ( err .ne. 0 ) rc = 100 + i-1 + + if (w_c%do_concentration) then + call GFIO_PutVar ( fid, vname(i), nymd, nhms, im, jm, 1, km, & + w_c%qa(i-2)%data3d(:,:,:)/w_c%airdens, err ) + if ( err .ne. 0 ) rc = 100 + i-1 + endif + + end do + + endif + +! Now save vertical grid info as attributes +! ----------------------------------------- + if ( creating ) then + call GFIO_PutRealAtt ( fid, 'ptop', 1, w_c%grid%ptop, prec, err ) + if ( err .ne. 0 ) rc = 201 + end if + + if (verb) print *, ' [] closing GFIO file ', trim(fname) + call GFIO_close ( fid, err ) + +! Clean up +! -------- + call clean_() + +! All done +! -------- + return + + CONTAINS + + subroutine init_ ( err ) ! allocates local memory + integer err, err1, err2, err3, err4 + allocate ( lat(jm), lon(im), lev(km),stat=err1 ) + allocate ( kmvar(nvars), vname(nvars), vtitle(nvars), stat=err2 ) + allocate ( vunits(nvars), stat=err3 ) + allocate ( packing_range(2,nvars), valid_range(2,nvars), stat=err4 ) + if (gfio_prec_==64) then + allocate(lon8(im)) + allocate(lat8(jm)) + allocate(lev8(km)) + allocate(packing_range8(2,nvars)) + allocate(valid_range8(2,nvars)) + allocate(rank3(im,jm,km)) + end if + + err = err1 + err2 + err3 + err4 + if ( err /= 0 ) return + vname(1) = 'delp' + vtitle(1) = 'Pressure Thickness' + vunits(1) = 'hPa' + vname(2) = 'rh' + vtitle(2) = 'Relative Humidity' + vunits(2) = 'percent' + do i = 1, nq + vname(i+2) = w_c%reg%vname(i) + vtitle(i+2) = w_c%reg%vtitle(i) + vunits(i+2) = w_c%reg%vunits(i) + end do + end subroutine init_ + + subroutine clean_() ! de-allocates local memory + deallocate ( lat, lon, lev, kmvar, vname, vtitle, vunits, stat=err ) + deallocate ( valid_range, packing_range, stat=err ) + if (gfio_prec_==64) then + deallocate(rank3) + deallocate(lon8) + deallocate(lat8) + deallocate(lev8) + deallocate(packing_range8) + deallocate(valid_range8) + endif + + end subroutine clean_ + + end Subroutine Chem_BundleWrite + +!------------------------------------------------------------------------- +! NASA/GSFC Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_BundleRead --- reads single instance of chemical state +! +! !INTERFACE: +! + subroutine Chem_BundleRead ( fname, nymd, nhms, w_c, rc, & + timidx, freq, chemReg, gfio_prec, do_Conc ) ! optional +! +! !USES: +! + implicit NONE +! +! !INPUT PARAMETERS: +! + character(len=*), intent(in) :: fname ! output file name + integer, OPTIONAL, intent(in) :: timidx ! time index; by default + ! last time index is returned + integer, OPTIONAL, intent(in) :: gfio_prec ! specify user precision + ! 32 or 64 bits + logical, OPTIONAL, intent(in) :: do_Conc ! True if you want MR*airdens + + + type(Chem_Registry), OPTIONAL, intent(in) :: chemReg ! Chemistry Registry +! +! !INPUT/OUTPUT PARAMETERS: +! + integer, intent(inout) :: nymd ! Date: year-month-day + integer, intent(inout) :: nhms ! Time: hour-min-sec + ! Note: unless timidx=0, + ! nymd/nhms will be + ! an output parameter. + + +! +! !OUTPUT PARAMETERS: +! + type(Chem_Bundle), intent(inout) :: w_c ! chemical bundle + integer, intent(out) :: rc ! error return code: + ! 0 - all is well + ! >0 - errors + integer, OPTIONAL, intent(out) :: freq ! time frequency on file + +! +! !DESCRIPTION: This routine reads GFIO files with one or more instances +! of the chemical bundle {\tt w\_f} from a file named +! {\tt fname}. The file is opened, read from and closed upon completion. +! By default, this routine returns the last time written to the file. +! The optional parameter {\tt timidx} allows the retrieval of times +! other than the last; use routine {\tt GFIO\_DimInquire()} to determine +! how many times have been written to the file. When {\tt timidx=0} +! is specified, (nymd,nhms) is used to specify the actual date required +! (this is the only instance when nymd/nhms are input parameters). +! When the OPTIONAL parameter chemReg only tracers in specified in it +! are read. When chemReg it is not specified, the chemical registry is +! read from file. +! +! !REVISION HISTORY: +! +! 20Sep2001 da Silva Initial code. +! 04Nov2015 Todling/Buchard - add underlying gfio precision as option +! all bug fix in lat/lon handle to BundleCreate +! +!EOP +!------------------------------------------------------------------------- + + character(len=nch) :: title, source, contact, levunits + character(len=nch), allocatable :: vname(:), vtitle(:), vunits(:) + character(len=nch) :: vname_ + + real, allocatable :: lat(:), lon(:), lev(:) + real, allocatable :: lat2d(:,:), lon2d(:,:) + real, allocatable :: valid_range(:,:), packing_range(:,:) + integer, allocatable :: kmvar(:), yyyymmdd(:), hhmmss(:), ivar(:) + + integer :: im, jm, km, lm, nvars + integer :: i1, i2, ig, j1, j2, jg + integer :: l, timinc, i, j, n + real :: amiss, buf(1), buf8(1) + + integer, parameter :: READ_ONLY = 1 + integer :: gfio_prec_ + integer :: fid, err, ngatts + + real(8) amiss8 + real(8),allocatable :: lon8(:),lat8(:),lev8(:) + real(8),allocatable :: valid_range8(:,:), packing_range8(:,:) + real(8),allocatable,dimension(:,:,:)::rank3 + type(Chem_registry) :: Reg + logical :: all_upper ! whether all variables are upper case + + rc = 0 + gfio_prec_ = 32 ! default precision + if ( present(gfio_prec) ) then + gfio_prec_= gfio_prec + end if + +! Open the file +! ------------- + call GFIO_Open ( fname, READ_ONLY, fid, err ) + if ( err .ne. 0 ) then + rc = 1 + call clean_() + return + end if + +! Get dimensions +! -------------- + call GFIO_DimInquire ( fid, im, jm, km, lm, nvars, ngatts, err) + if ( err .ne. 0 ) then + call clean_() + rc = 2 + end if + call init_ ( err ) + if ( err .ne. 0 ) then + call clean_() + rc = 3 + end if + +! For now must specify chemReg +! ---------------------------- + if ( present(chemReg) ) then + reg = chemReg + else + rc = 4 ! for now, later Reg will come from file + return + end if + +! Get file attributes +! ------------------- + if ( gfio_prec_== 64 ) then + call GFIO_Inquire ( fid, im, jm, km, lm, nvars, & + title, source, contact, amiss8, & + lon8, lat8, lev8, levunits, & + yyyymmdd, hhmmss, timinc, & + vname, vtitle, vunits, & + kmvar, valid_range8, packing_range8, err ) + amiss=amiss8;lon=lon8;lat=lat8;lev=lev8 + else + call GFIO_Inquire ( fid, im, jm, km, lm, nvars, & + title, source, contact, amiss, & + lon, lat, lev, levunits, & + yyyymmdd, hhmmss, timinc, & + vname, vtitle, vunits, & + kmvar, valid_range , packing_range, err ) + end if + if ( err .ne. 0 ) then + call clean_() + rc = 5 + end if + + if ( present(freq) ) then + freq = timinc + end if + +! Loop over variables and detect whether we have the new +! GEOS-5 convention where all variables are upper case. +! ------------------------------------------------------ + all_upper = .TRUE. + do n = 1, nvars + if ( trim(vname(n)) /= uppercase(trim(vname(n))) ) & + all_upper = .FALSE. + end do + + if ( all_upper ) & + print *, "Chem_BundleRead: Using GEOS-5 all upercase mode" + +! Pick time to return +! ------------------- + if ( present(timidx) ) then + if ( timidx .eq. 0 ) then + continue ! nothing to do, nymd/nhms set on input + else if ( timidx .lt. 0 .or. timidx .gt. lm ) then + call clean_() + rc = 6 + return + else + nymd = yyyymmdd(timidx) + nhms = hhmmss(timidx) + end if + else + nymd = yyyymmdd(lm) + nhms = hhmmss(lm) + end if + + if ( nvars < 2 ) then + rc = 7 + call clean_() + return + end if + + +! Allocate memory if necessary +! ---------------------------- + i1 = 1; i2 = im; ig = 0 + j1 = 1; j2 = jm; jg = 0 + allocate( lat2d(i1:i2,j1:j2), lon2d(i1:i2,j1:j2), stat=err) + if(err .ne. 0) then + call clean_() + rc = 11 + return + endif + do i = i1, i2 + lat2d(i,:) = lat + enddo + do j = j1, j2 + lon2d(:,j) = lon + enddo + call Chem_BundleCreate_ ( reg, i1, i2, ig, im, j1, j2, jg, jm, km, & + w_c, err, & + lat=lat2d, lon=lon2d, lev=lev, & + levUnits = levUnits, do_Conc = do_Conc) + deallocate(lat2d, lon2d, stat=err) + if(err .ne. 0) then + call clean_() + rc = 12 + return + endif + if ( err .eq. 1 ) then ! already allocated + if ( w_c%grid%im .ne. im .OR. & + w_c%grid%jm .ne. jm .OR. & + w_c%grid%km .ne. km .OR. & + w_c%reg%nq .ne. reg%nq ) then + rc = 8 ! current size not compatible + call clean_() + return + end if + else if ( err .ne. 0 ) then + rc = 9 + call clean_() + return + end if + +! Verify that variables in register are on file +! --------------------------------------------- + if ( reg%nq > nvars-1 ) then + rc = 200 + return + end if + do j = 1, reg%nq + ivar(j) = -1 + if ( all_upper ) then + vname_ = uppercase(trim(reg%vname(j))) + else + vname_ = trim(reg%vname(j)) + end if + do i = 1, nvars + if ( trim(vname_) .eq. trim(vname(i)) ) then + ivar(j) = i + end if + end do + if ( ivar(j) < 1 ) then + print *, 'Missing variable: ', trim(reg%vname(j)) + rc = 10 + call clean_() + return + end if + end do + + +! retrieve the variables +! ---------------------- + if ( gfio_prec_== 64 ) then + if ( all_upper ) then + call GFIO_GetVar ( fid, 'DELP', nymd, nhms, & + im, jm, 1, km, rank3, err ) + else + call GFIO_GetVar ( fid, 'delp', nymd, nhms, & + im, jm, 1, km, rank3, err ) + endif + if ( err .ne. 0 ) then + rc = 101 + else + w_c%delp=rank3 + end if + + call GFIO_GetVar ( fid, 'RH', nymd, nhms, & + im, jm, 1, km, rank3, err ) + if ( err .ne. 0 ) then + call GFIO_GetVar ( fid, 'rh', nymd, nhms, & + im, jm, 1, km, rank3, err ) + end if + if ( err .ne. 0 ) then + w_c%rh = w_c%missing_value + w_c%has_rh = .false. + else + w_c%has_rh = .true. ! for backward compatibility + w_c%rh = rank3 + end if + + if (w_c%do_concentration) then + if (all_upper) then + call GFIO_GetVar ( fid, 'AIRDENS', nymd, nhms, & + im, jm, 1, km, rank3, err ) + else + call GFIO_GetVar ( fid, 'airdens', nymd, nhms, & + im, jm, 1, km, rank3, err ) + endif + if ( err .ne. 0 ) then + rc = 101 + else + w_c%airdens=rank3 + end if + endif + else + if ( all_upper ) then + call GFIO_GetVar ( fid, 'DELP', nymd, nhms, & + im, jm, 1, km, w_c%delp, err ) + else + call GFIO_GetVar ( fid, 'delp', nymd, nhms, & + im, jm, 1, km, w_c%delp, err ) + endif + + if ( err .ne. 0 ) rc = 101 + call GFIO_GetVar ( fid, 'RH', nymd, nhms, & + im, jm, 1, km, w_c%rh, err ) + if ( err .ne. 0 ) then + call GFIO_GetVar ( fid, 'rh', nymd, nhms, & + im, jm, 1, km, w_c%rh, err ) + end if + if ( err .ne. 0 ) then + w_c%rh = w_c%missing_value + w_c%has_rh = .false. + else + w_c%has_rh = .true. ! for backward compatibility + end if + + if (w_c%do_concentration) then + if ( all_upper ) then + call GFIO_GetVar ( fid, 'AIRDENS', nymd, nhms, & + im, jm, 1, km, w_c%airdens, err ) + else + call GFIO_GetVar ( fid, 'airdens', nymd, nhms, & + im, jm, 1, km, w_c%airdens, err ) + endif + endif + end if ! + do n = 1, reg%nq + l = ivar(n) + if ( all_upper ) then + vname_ = uppercase(trim(vname(l))) + else + vname_ = trim(vname(l)) + end if + if ( gfio_prec_== 64 ) then + + if ( w_c%do_concentration ) then + + call GFIO_GetVar ( fid, vname_, nymd, nhms, & + im, jm, 1, km, rank3, err ) + w_c%qa(n)%data3d(:,:,:)=rank3*w_c%airdens + + else + call GFIO_GetVar ( fid, vname_, nymd, nhms, & + im, jm, 1, km, rank3, err ) + w_c%qa(n)%data3d(:,:,:)=rank3 + endif + + else + + if ( w_c%do_concentration ) then + + call GFIO_GetVar ( fid, vname_, nymd, nhms, & + im, jm, 1, km, w_c%qa(n)%data3d(:,:,:)*w_c%airdens, err ) + else + call GFIO_GetVar ( fid, vname_, nymd, nhms, & + im, jm, 1, km, w_c%qa(n)%data3d(:,:,:), err ) + endif + endif + if ( err .ne. 0 ) rc = 100 + l + end do + + +! Retrieve vertical grid attributes +! --------------------------------- + if ( gfio_prec_==64 ) then + call GFIO_GetRealAtt ( fid, 'ptop', 1, buf8, err ) + w_c%grid%ptop = buf8(1) + else + call GFIO_GetRealAtt ( fid, 'ptop', 1, buf , err ) + w_c%grid%ptop = buf(1) + endif + if ( err .ne. 0 ) then + w_c%grid%ptop = 1. ! do not fuss about this + rc = 0 + end if + +! Close GFIO file +! --------------- + call GFIO_close ( fid, err ) + +! All done +! -------- + call clean_() + return + + CONTAINS + + subroutine init_ ( err ) ! allocates local memory + integer err, err1, err2, err3, err4 + allocate( lat(jm), lon(im), lev(km), yyyymmdd(lm), stat=err1 ) + allocate( hhmmss(lm),vname(nvars), vunits(nvars), stat=err2 ) + allocate( vtitle(nvars),kmvar(nvars),valid_range(2,nvars),stat=err3 ) + allocate( packing_range(2,nvars),ivar(nvars),stat=err4) + if (gfio_prec_==64) then + allocate(lon8(im)) + allocate(lat8(jm)) + allocate(lev8(km)) + allocate(packing_range8(2,nvars)) + allocate(valid_range8(2,nvars)) + allocate(rank3(im,jm,km)) + end if + err = err1 + err2 + err3 + err4 + end subroutine init_ + + subroutine clean_() ! de-allocates local memory + deallocate (lat,lon,lev, yyyymmdd, hhmmss, vname, vunits, stat=err) + deallocate (vtitle,kmvar,valid_range,packing_range, ivar, stat=err) + if (gfio_prec_==64) then + deallocate(rank3) + deallocate(lon8) + deallocate(lat8) + deallocate(lev8) + deallocate(packing_range8) + deallocate(valid_range8) + endif + end subroutine clean_ + + end subroutine Chem_BundleRead + +!------------------------------------------------------------------------- +! NASA/GSFC Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_BundleSetPtr - Make sure internal pointers are set +! +! !INTERFACE: +! + subroutine Chem_BundleSetPtr ( w_c, rc ) +! +! !USES: +! + implicit NONE +! +! !INPUT/OUTPUT PARAMETERS: +! + type(Chem_Bundle), intent (inout) :: w_c ! chemical bundle + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - +! !DESCRIPTION: +! +! Make sure the internal array of pointers points to the current +! memory location of the 4D q array +! +! !REVISION HISTORY: +! +! 22Jul2005 da Silva Initial code. +! +!EOP +!------------------------------------------------------------------------- + + _UNUSED_DUMMY(w_c) + rc = 0 + + return + + end subroutine Chem_BundleSetPtr + +!------------------------------------------------------------------------- +! NASA/GSFC Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_BundleStat --- Prints vital stats of Chem_Bundle +! +! !INTERFACE: +! + subroutine Chem_BundleStat ( lu, w_c, rc ) +! +! !USES: +! + implicit NONE +! +! !INPUT PARAMETERS: +! + integer, intent(in) :: lu ! FORTRAN unit number for ASCII output + type(Chem_Bundle), intent(in) :: w_c ! dynamics state vector + +! +! !OUTPUT PARAMETERS: +! + + integer, intent(out), optional :: rc ! error return code: + ! 0 - all is well + ! >0 - errors +! +! !DESCRIPTION: This routine prints basic stats about a dynamics state vector. +! +! !REVISION HISTORY: +! +! 15sep2003 da Silva Adapted from dyn_stat +! +!EOP +!------------------------------------------------------------------------- + + integer :: i1, i2, im, j1, j2, jm, km, nq, l, ios, k + real, allocatable :: levs(:) + real :: amiss + + if ( present(rc) ) rc = 0 + i1 = w_c%grid%i1; j1 = w_c%grid%j1 + i2 = w_c%grid%i2; j2 = w_c%grid%j2 + im = w_c%grid%im; jm = w_c%grid%jm + km = w_c%grid%km; nq = w_c%reg%nq + amiss = w_c%missing_value + allocate ( levs(km), stat = ios ) + if ( ios .ne. 0 ) then + if ( present(rc) ) rc = 1 + return + end if + + do k = 1, km + levs(k) = k + end do + +!!! do k = 1, km +!!! print *, 'k, delp = ', k, minval(w_c%delp(i1:i2,j1:j2,k)), & +!!! maxval(w_c%delp(i1:i2,j1:j2,k)) +!!! end do +!!! do k = 1, km +!!! print *, 'k, rh = ', k, minval(w_c%rh(i1:i2,j1:j2,k)), & +!!! maxval(w_c%rh(i1:i2,j1:j2,k)) +!!! end do + + write(lu,*) 'Chem_BundleStat: i1, i2, im ', i1, i2, im + write(lu,*) 'Chem_BundleStat: j1, j2, jm ', j1, j2, jm + write(lu,*) 'Chem_BundleStat: km, ptop: ', km, w_c%grid%ptop + + call GDSTAT_ (lu,im,jm,km,w_c%delp, & + levs,'PRES','lev ',amiss, & + 'delp', 1 ) + + call GDSTAT_ (lu,im,jm,km,w_c%rh, & + levs,'PRES','lev ',amiss, & + 'rh', 1 ) + + do l = 1, nq + call GDSTAT_ (lu,im,jm,km,w_c%qa(l)%data3d(i1:i2,j1:j2,1:km), & + levs,'PRES','lev',amiss, & + w_c%reg%vtitle(l), 1 ) + end do + + deallocate ( levs ) + +CONTAINS + + subroutine GDSTAT_ (lu,mx,my,mz,a,h,atype,htype,amiss,header,inc) + +! Print statistics of one 3-d variable. This is from the PSAS library. +! It is reproduced here to avoid unnecessary dependencies. + + implicit none + + integer lu ! Output unit + integer mx,my,mz ! Array sizes + real a(mx,my,mz) ! The array + real h(mz) ! The argument(levels) + character(*), intent(in) :: atype ! Type of the variable + character(*), intent(in) :: htype ! Typf of the levels + real amiss ! missing value flag of a + character*(*) header ! A header message + integer inc ! order of the listing + + integer i,j,k + integer kfr,kto,kinc + integer imx,imn,jmx,jmn + integer knt + real amx,amn + real avg,dev,d + logical first + +! ..A practical value for the magnitude of the fraction of a real +! number. + + real rfrcval + parameter(rfrcval=1.e-5) + + character(len=nch) dash + +! ..function + + + logical spv + real aspv + spv(aspv)=abs((aspv-amiss)/amiss).le.rfrcval + + do i = 1, nch + dash(i:i) = '-' + end do + i = len(trim(header)) + write(lu,'(//a)') trim(header) + write(lu,'(a/)') dash(1:i) + if(htype.eq.'PRES') then + write(lu,'(a,3x,a,2x,a,5x,a,6x,a,9x,a,15x,a)') 'lvl','mbar', & + 'count','mean','stdv','maxi','mini' + elseif(htype.eq.'HGHT') then + write(lu,'(a,2x,a,2x,a,5x,a,6x,a,9x,a,15x,a)') 'lvl','meter', & + 'count','mean','stdv','maxi','mini' + elseif(htype.eq.'TEMP') then + write(lu,'(a,4x,a,4x,a,5x,a,6x,a,9x,a,15x,a)') 'lvl','K', & + 'count','mean','stdv','maxi','mini' + else + write(lu,'(a,4x,a,4x,a,5x,a,6x,a,9x,a,15x,a)') 'lvl',htype, & + 'count','mean','stdv','maxi','mini' + endif + +! ..Check the order of the listing, increase or decrease + if(inc.ge.0) then + kfr=1 + kto=mz + kinc=1 + else + kfr=mz + kto=1 + kinc=-1 + endif + + do k=kfr,kto,kinc + knt=0 + avg=0. + do j=1,my + do i=1,mx + if(.not.spv(a(i,j,k))) then + knt=knt+1 + avg=avg+a(i,j,k) + endif + end do + end do + avg=avg/max(1,knt) + + dev=0. + do j=1,my + do i=1,mx + if(.not.spv(a(i,j,k))) then + d=a(i,j,k)-avg + dev=dev+d*d + endif + end do + end do + dev=sqrt(dev/max(1,knt-1)) + + amx=a(1,1,k) + amn=a(1,1,k) + first=.true. + do j=1,my + do i=1,mx + if(.not.spv(a(i,j,k))) then + if(first) then + imx=i + imn=i + jmx=j + jmn=j + amx=a(imx,jmx,k) + amn=a(imn,jmn,k) + first=.false. + else + if(a(i,j,k).gt.amx) then + amx=a(i,j,k) + imx=i + jmx=j + endif + if(a(i,j,k).lt.amn) then + amn=a(i,j,k) + imn=i + jmn=j + endif + endif + endif + end do + end do + + if(atype.eq.'RELH') then + avg=avg*100. + dev=dev*100. + amx=amx*100. + amn=amn*100. + endif + + if(htype.eq.'PRES'.or.htype.eq.'HGHT') then + if(atype.eq.'HGHT'.or.atype.eq.'STRM') then + write(lu,'(i3,2i7,2i10,'// & + '2(i10,a,i3,a,i3,a))') & + k,nint(h(k)),knt,nint(avg),nint(dev), & + nint(amx),'(',imx,',',jmx,')', & + nint(amn),'(',imn,',',jmn,')' + elseif(atype.eq.'TEMP'.or.atype.eq.'PRES'.or. & + atype.eq.'WIND'.or.atype.eq.'%REH'.or. & + atype.eq.'RELH'.or.atype.eq.'MIXR') then + write(lu,'(i3,2i7,2f10.2,'// & + '2(f10.2,a,i3,a,i3,a))') & + k,nint(h(k)),knt,avg,dev, & + amx,'(',imx,',',jmx,')', & + amn,'(',imn,',',jmn,')' + elseif(atype.eq.'NORM') then + write(lu,'(i3,2i7,2f10.4,'// & + '2(f10.4,a,i3,a,i3,a))') & + k,nint(h(k)),knt,avg,dev, & + amx,'(',imx,',',jmx,')', & + amn,'(',imn,',',jmn,')' + else + write(lu,'(i3,2i7,1p,2e10.3e1,0p,'// & + '2(1p,e10.3e1,0p,a,i3,a,i3,a))') & + k,nint(h(k)),knt,avg,dev, & + amx,'(',imx,',',jmx,')', & + amn,'(',imn,',',jmn,')' + endif + + elseif(htype.eq.'TEMP') then + if(atype.eq.'HGHT'.or.atype.eq.'STRM') then + write(lu,'(i3,f7.2,i7,2i10,'// & + '2(i10,a,i3,a,i3,a))') & + k,h(k),knt,nint(avg),nint(dev), & + nint(amx),'(',imx,',',jmx,')', & + nint(amn),'(',imn,',',jmn,')' + elseif(atype.eq.'TEMP'.or.atype.eq.'PRES'.or. & + atype.eq.'WIND'.or.atype.eq.'%REH'.or. & + atype.eq.'RELH'.or.atype.eq.'MIXR') then + write(lu,'(i3,f7.2,i7,2f10.2,'// & + '2(f10.2,a,i3,a,i3,a))') & + k,h(k),knt,avg,dev, & + amx,'(',imx,',',jmx,')', & + amn,'(',imn,',',jmn,')' + elseif(atype.eq.'NORM') then + write(lu,'(i3,f7.2,i7,2f10.4,'// & + '2(f10.4,a,i3,a,i3,a))') & + k,h(k),knt,avg,dev,& + amx,'(',imx,',',jmx,')', & + amn,'(',imn,',',jmn,')' + else + write(lu,'(i3,f7.2,i7,1p,2e10.3e1,0p,'// & + '2(1p,e10.3e1,0p,a,i3,a,i3,a))') & + k,h(k),knt,avg,dev, & + amx,'(',imx,',',jmx,')', & + amn,'(',imn,',',jmn,')' + endif + + else + if(atype.eq.'HGHT'.or.atype.eq.'STRM') then + write(lu,'(i3,1p,e10.3e1,0p,i7,2i10,'// & + '2(i10,a,i3,a,i3,a))') & + k,h(k),knt,nint(avg),nint(dev), & + nint(amx),'(',imx,',',jmx,')', & + nint(amn),'(',imn,',',jmn,')' + elseif(atype.eq.'TEMP'.or.atype.eq.'PRES'.or. & + atype.eq.'WIND'.or.atype.eq.'%REH'.or. & + atype.eq.'RELH'.or.atype.eq.'MIXR') then + write(lu,'(i3,1p,e10.3e1,0p,i7,2f10.2,'// & + '2(f10.2,a,i3,a,i3,a))') & + k,h(k),knt,avg,dev, & + amx,'(',imx,',',jmx,')', & + amn,'(',imn,',',jmn,')' + elseif(atype.eq.'NORM') then + write(lu,'(i3,1p,e10.3e1,0p,i7,2f10.4,'// & + '2(f10.4,a,i3,a,i3,a))') & + k,h(k),knt,avg,dev, & + amx,'(',imx,',',jmx,')', & + amn,'(',imn,',',jmn,')' + else + write(lu,'(i3,1p,e10.3e1,0p,i7,1p,2e10.3e1,0p,'// & + '2(1p,e10.3e1,0p,a,i3,a,i3,a))') & + k,h(k),knt,avg,dev, & + amx,'(',imx,',',jmx,')', & + amn,'(',imn,',',jmn,')' + endif + + endif + end do ! k=kfr,kto,kinc + + end subroutine GDSTAT_ + + end subroutine Chem_BundleStat + + +#ifdef FUTURE_SPMD + +! +! The routines below are incomplete. +! + +!------------------------------------------------------------------------- +! NASA/GSFC Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_BundleGather --- Gather bundle on master PE +! +! !INTERFACE: +! + subroutine Chem_BundleGather ( w_c, w_g, rc ) +! +! !USES: +! +! use mod_comm + implicit NONE +! +! !INPUT PARAMETERS: +! + + type(Chem_Bundle), intent(inout) :: w_c ! distributed bundle + +! +! !OUTPUT PARAMETERS: +! + + type(Chem_Bundle), intent(inout) :: w_g ! global bundle + + integer, intent(out), optional :: rc ! error return code: + ! 0 - all is well + ! >0 - errors +! +! !DESCRIPTION: This routine gather a chem bundle on single PE. +! +! !REVISION HISTORY: +! +! 01mar2005 da Silva Initial version. +! +!EOP +!------------------------------------------------------------------------- + + type(Chem_Registry) :: reg + integer :: i1, i2, ig + integer :: j1, j2, jg + integer :: km, nq + +! Short hand for dimensions +! ------------------------- + i1 = w_c%grid%i1; j1 = w_c%grid%j1 + i2 = w_c%grid%i2; j2 = w_c%grid%j2 + ig = w_c%grid%i2; jg = w_c%grid%j2 + im = w_c%grid%im; jm = w_c%grid%jm + km = w_c%grid%km; nq = w_c%reg%nq + + reg = w_c%reg + + rc = 0 + +! Create global bundle on master +! ----------------------------- + if ( gid .eq. 0 ) then + call Chem_BundleCreate1PE_ ( reg, im, jm, km, w_c, rc ) + if ( rc /= 0 ) return + end if + +! Gather from all subdomains to GID=0 +! ------------------------------------ + call mp_gather4d(delp, delptmp, im, jm, km, 1, jfirst, jlast, 1, km, 0, 0, 0) +end subroutine Chem_BundleGather + +!------------------------------------------------------------------------- +! NASA/GSFC Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_BundleScatter --- Distributes a chem bundle +! +! !INTERFACE: +! + subroutine Chem_BundleScatter ( w_g, w_c, rc ) +! +! !USES: +! + use mod_comm + implicit NONE +! +! !INPUT PARAMETERS: +! + + type(Chem_Bundle), intent(inout) :: w_c ! distributed bundle + +! +! !OUTPUT PARAMETERS: +! + + type(Chem_Bundle), intent(inout) :: w_g ! global bundle + + integer, intent(out), optional :: rc ! error return code: + ! 0 - all is well + ! >0 - errors +! +! !DESCRIPTION: This routine distributes a chem bundle. +! +! !REVISION HISTORY: +! +! 01mar2005 da Silva Initial version. +! +!EOP +!------------------------------------------------------------------------- + +end subroutine Chem_BundleScatter + +#endif + + end MODULE Chem_BundleMod diff --git a/ESMF/Shared/Chem_Base/Chem_BundleToG5rs.F90 b/ESMF/Shared/Chem_Base/Chem_BundleToG5rs.F90 new file mode 100644 index 00000000..c069299b --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_BundleToG5rs.F90 @@ -0,0 +1,154 @@ +!------------------------------------------------------------------------- +! NASA GSFC, Global Modeling & Assimilation Office ! +!------------------------------------------------------------------------- +!BOP +! +! !PROGRAM: rst_hdf_bin.F90 --- Convert an hdf chem restart file to binary, +! primarily for obtaining GEOS5/Eros restarts +! from GEOS4 fvchem chemistry restart bundles. + +PROGRAM rst_hdf_bin + +! !USES: + + USE m_die, only: die + USE Chem_InitMod + USE Chem_RegistryMod + + IMPLICIT none + +! !DESCRIPTION: Create a binary aerochem restart from an existing HDF +! restart. +! +! !USAGE: Typical command line lists the existing HDF file and the +! output binary file: +! +! rst_hdf_bin.x -i b72.rst.chem.19650101_00z.hdf \ +! -o aerochem_internal_restart +! +! The Chem_Registry.rc must be applicable to the existing HDF +! dataset. However, the user may supply a list of species that +! are not to be included in the output file. See below. +! +! The binary file is a simple concatenation of 3-D arrays for +! each specie. +! +! The program contains no provision for changing horizontal or +! vertical discretization. +! +! !REVISION HISTORY: +! +! 15 Jun 2006 Nielsen First version. +! 28 Sep 2006 da Silva Major overhaul +! +!EOP +!------------------------------------------------------------------------- +! Grid parameters for existing chem file + + + integer, parameter :: READ_ONLY = 1 + +! This string identifies this procedure + + CHARACTER(LEN=*), PARAMETER :: myname = 'Chem_BundleToG5rs' + +! Registry and bundle + + TYPE(Chem_Registry) :: reg ! chemistry registry + +! Local variables + + CHARACTER(LEN=255) :: argv, inFile, outFile + + REAL, allocatable :: g4(:,:,:) + real*4, allocatable :: g5(:,:) + + INTEGER :: argc,iargc,ier,k + INTEGER :: n,nhms,nq,nymd + INTEGER, PARAMETER :: lu=12 + REAL :: gmin + + INTEGER :: fid, im, jm, km, lm, nvars, ngatts + INTEGER :: imh, n1, n2, n3, n4, m1, m2, m3, m4 + + +! Parse the command line [see usage() below] for file names +! --------------------------------------------------------- + argc = iargc() + if(argc .lt. 4) call usage() + CALL GetArg(1, inFile) + CALL GetArg(2, outFile) + CALL GetArg(3, argv); read(argv,*) nymd + CALL GetArg(4, argv); read(argv,*) nhms + +! Read the chemistry registry +! --------------------------- + reg = Chem_RegistryCreate( ier ) + IF(ier /= 0) CALL die(myname, 'Cannot create registry') + CALL Chem_RegistryPrint( reg ) + nq = reg%nq + + +! Open the GFIO file +! ------------------ + print *, myname //': reading ' // trim(inFile) + call GFIO_Open ( trim(inFile), READ_ONLY, fid, ier ) + if ( ier /= 0 ) call die(myname,'cannot read '//trim(inFile), ier ) + + call GFIO_DimInquire ( fid, im, jm, km, lm, nvars, ngatts, ier) + if ( ier /= 0 ) call die(myname,'cannot query '//trim(inFile), ier ) + + allocate(g4(im,jm,km),g5(im,jm),stat=ier) + if ( ier /= 0 ) call die(myname,'cannot allocate buffer', ier ) + +! Read the bundle +! --------------- + imh = im / 2 + n1 = 1; n2 = imh; n3 = n2+1; n4 = im + m1 = 1; m2 = n4-n3+1; m3 = m2+1; m4 = im + open(lu,file=trim(outFile), form='unformatted') + gmin = tiny(1.0) ! a very small number + do n = 1, nq + + call gfio_GetVar ( fid, trim(reg%vname(n)), nymd, nhms, & + im, jm, 1, km, g4, ier ) + if ( ier /= 0 ) call die(myname,'cannot read variable', ier ) + +! Lower cap for tracers: the smallest float point number +! ------------------------------------------------------ + where ( g4 < gmin ) + g4 = gmin + end where + + print 10, trim(Reg%vname(n))//':', minval(g4), maxval(g4), & + count (g4==gmin), ' points capped' +10 format(1x,a15,1p2e12.3,i8,a) + + do k = 1, km + g5(m1:m2,:) = g4(n3:n4,:,k) + g5(m3:m4,:) = g4(n1:n2,:,k) + write(lu) g5 + end do + + end do + + call gfio_close (fid, ier ) + close(lu) + deallocate(g4,g5) + +CONTAINS + + SUBROUTINE usage() + PRINT * + PRINT *,'Usage: ' + PRINT *,' Chem_BundleToG5rs.x inFile outFile nymd nhms' + PRINT * + PRINT *,'where both arguments are required and' + PRINT * + PRINT *,' inFile Input chemistry restart file, HDF format' + PRINT *,' outFile Output restart file, binary' + PRINT * + CALL exit(1) + END SUBROUTINE usage + +END PROGRAM rst_hdf_bin diff --git a/ESMF/Shared/Chem_Base/Chem_Ext3d.rc b/ESMF/Shared/Chem_Base/Chem_Ext3d.rc new file mode 100644 index 00000000..bc4044be --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_Ext3d.rc @@ -0,0 +1,48 @@ +# +# Resource file for (MPI) 3D Extinction Calculator +# + +# --------------------- +# Grid, Decomposition +# --------------------- + + +ExpId: a0000 + +Layout_Nx: 2 +Layout_Ny: 4 + +IM_World: 540# 540 +JM_World: 361# 361 +LM_World: 72 + +nymd: 20080630 +nhms: 120000 + +verbose: .TRUE. + +# ------------------- +# File Name Templates +# ------------------- + +aer_registry: Chem_AerRegistry.rc +ext_registry: Chem_ExtRegistry.rc + +aer_filename: /nobackup/1/ARCTAS/Y2008/M06/d5_arctas_02.inst3d_aer_v.20080630_1200z.hdf +ext_filename: ext.nc4 + +# ------------------- +# Mie Parameters +# ------------------- + +NUM_BANDS: 1 +BANDS: 532E-9 + +DU_OPTICS: ExtData/g5chem/x/optics_DU.v15_3.nc +SS_OPTICS: ExtData/g5chem/x/optics_SS.v3_3.nc +SU_OPTICS: ExtData/g5chem/x/optics_SU.v1_3.nc +NI_OPTICS: ExtData/g5chem/x/optics_NI.v2_5.nc +OC_OPTICS: ExtData/g5chem/x/optics_OC.v1_3.nc +BRC_OPTICS: ExtData/g5chem/x/optics_BRC.v1_5.nc +BC_OPTICS: ExtData/g5chem/x/optics_BC.v1_3.nc + diff --git a/ESMF/Shared/Chem_Base/Chem_ExtRegistry.rc b/ESMF/Shared/Chem_Base/Chem_ExtRegistry.rc new file mode 100644 index 00000000..67fbc589 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_ExtRegistry.rc @@ -0,0 +1,95 @@ +# +# Extinction Registry Resource File +# + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 3 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +#ssa none Aerosol Single Scatter Albedo [532 nm] +#tau none Aerosol Layer Optical Thickness [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +#ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +#aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +#aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/Chem_Init.F90 b/ESMF/Shared/Chem_Base/Chem_Init.F90 new file mode 100644 index 00000000..e12e4a88 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_Init.F90 @@ -0,0 +1,317 @@ +! Create an initialization for the chemistry bundle +! - get the chemistry registry +! - create the chemistry bundle +! !REVISION HISTORY: +! 31Mar2005 - Todling - iuic was not used before defined + + program chem_initialize + + use m_ioutil, only: luavail + use m_die, only: die + use Chem_InitMod + use Chem_RegistryMod + use Chem_BundleMod + + implicit none + +! Hard-wired c55 grid parameters + integer, parameter :: im = 288, jm = 181, km = 55 + real :: ak(km+1), bk(km+1) + + real, parameter :: grav = 9.81, RAIR = 287., CP = 1004., PREF = 1.e5 + character(len=*), parameter :: myname = 'chem_ini' + type(Chem_Registry) :: reg ! chemistry registry + type(Chem_Bundle) :: w_c ! chemistry bundle + integer :: i,j,k,n,nq,prec ! working variables + integer :: iuic, nstep, nymd, nhms + integer :: ier ! error checking + real :: ps(im,jm), pc(im,jm,km) ! Pressures + real :: zc(im,jm,km), dz(im,jm,km) ! vertical coordinates + real :: u(im,jm,km), v(im,jm,km) ! velocity + real :: pt(im,jm,km) ! potential temperature + real, parameter :: ptop = 1. ! pressure at top of atm. + real, pointer :: delp(:,:,:), q(:,:,:,:) + integer iarg, iargc, argc + character(len=255) :: chemfile, dynfile, argv, dummystr + + data ak / 1.00000, 2.00000, 3.27000, & + 4.75850, 6.60000, 8.93450, & + 11.97030, 15.94950, 21.13490, & + 27.85260, 36.50410, 47.58060, & + 61.67790, 79.51340, 101.94420, & + 130.05080, 165.07920, 208.49720, & + 262.02120, 327.64330, 407.65670, & + 504.68050, 621.68000, 761.98390, & + 929.29430, 1127.68880, 1364.33920, & + 1645.70720, 1979.15540, 2373.03610, & + 2836.78160, 3380.99550, 4017.54170, & + 4764.39320, 5638.79380, 6660.33770, & + 7851.22980, 9236.56610, 10866.34270, & + 12783.70000, 15039.30000, 17693.00000, & + 20119.20876, 21686.49129, 22436.28749, & + 22388.46844, 21541.75227, 19873.78342, & + 17340.31831, 13874.44006, 10167.16551, & + 6609.84274, 3546.59643, 1270.49390, & + 0.00000, 0.00000 / + + data bk /0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00000, 0.00000, 0.00000, & + 0.00696, 0.02801, 0.06372, & + 0.11503, 0.18330, 0.27033, & + 0.37844, 0.51046, 0.64271, & + 0.76492, 0.86783, 0.94329, & + 0.98511, 1.00000 / + + +! Parse the command line (see usage() below) + argc = iargc() + if(argc .lt. 1) call usage() + iarg = 0 + chemfile = 'chem_ini.c_rst' + do i = 0, 32767 + iarg = iarg+1 + if(iarg .gt. argc) exit + call GetArg(iarg, argv) + select case(argv) + case ("-o") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, chemfile) + case ("-grid") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, dummystr) + case default + dynfile = argv + end select + end do + if ( trim(chemfile) .eq. 'chem_ini.c_rst' ) then + i = index ( dynfile, 'd_rst' ) + if ( i .gt. 1 ) then + chemfile = dynfile(1:i-1) // 'c_rst' // dynfile(i+5:) + end if + end if + + +! Read the chemistry registry +! --------------------------- + reg = Chem_RegistryCreate(ier) + if(ier /= 0) call die(myname, 'cannot create registry') + nq = reg%nq + + +! Create the chemistry bundle to be filled in later +! ------------------------------------------------- + call Chem_BundleCreate1PE_(reg, im, jm, km, w_c, ier) + if(ier /= 0) call die(myname, 'cannot create bundle') + + delp => w_c%delp + q => w_c%q + + +! Read in some dynamics fields from a restart file in order to +! fill in delp and to calculate vertical coordinates in a useful +! fashion. +! -------------------------------------------------------------- + iuic = luavail() + open(iuic,file=dynfile, & + form='unformatted',access='sequential') + read(iuic) nstep,nymd,nhms + read(iuic) ps, delp, u, v, pt + do n = 1, 2 + read(iuic,END=9999) (((q(i,j,k,n),i=1,im),j=1,jm),k=1,km) + end do +9999 continue + close(iuic) + + +! Calculate the pressures and vertical grid coordinates from the +! hydrostatic equation. Use ak and bk to calculate grid mid-point +! pressures pc [Pa]. Use the potential temperature read in along with the +! pressures to calculate level thickness dz [m] with hydrostatic +! equation. Integrate level thickness to get mid-point altitudes zc [m]. + k = km + do j = 1, jm + do i = 1, im + pc(i,j,k) = 0.5*(ak(k)+ak(k+1)+(bk(k)+bk(k+1))*ps(i,j)) + dz(i,j,k) = RAIR*(pt(i,j,k)+273.)*delp(i,j,k)/GRAV/pc(i,j,k) & + *(PREF/pc(i,j,k))**(-RAIR/CP) + zc(i,j,k) = 0.5*dz(i,j,k) + end do + end do + + do k = km-1, 1, -1 + do j = 1, jm + do i = 1, im + pc(i,j,k) = 0.5*(ak(k)+ak(k+1)+(bk(k)+bk(k+1))*ps(i,j)) + dz(i,j,k) = RAIR*(pt(i,j,k)+273.)*delp(i,j,k)/GRAV/pc(i,j,k) & + *(PREF/pc(i,j,k))**(-RAIR/CP) + zc(i,j,k) = zc(i,j,k+1) + 0.5*(dz(i,j,k+1)+dz(i,j,k)) + end do + end do + end do + + +! Fill the bundle with initial conditions + if(reg%doing_CO) call initial_q_('CO',reg%i_CO, reg%j_CO) + if(reg%doing_DU) call initial_q_('DU',reg%i_DU, reg%j_DU) + if(reg%doing_SS) call initial_q_('SS',reg%i_SS, reg%j_SS) + if(reg%doing_SU) call initial_q_('SU',reg%i_SU, reg%j_SU) + if(reg%doing_BC) call initial_q_('BC',reg%i_BC, reg%j_BC) + if(reg%doing_OC) call initial_q_('OC',reg%i_OC, reg%j_OC) + if(reg%doing_XX) call initial_q_('XX',reg%i_XX, reg%j_XX) + +! Stat the bundle + call Chem_BundleStat(6, w_c, ier) + if(ier /= 0) call die(myname, 'cannot stat bundle') + + +! Write the bundle + prec = 0 + call Chem_BundleWrite(chemfile, nymd, nhms, prec, w_c, ier, verbose=.true.) + if(ier /=0 ) call die(myname,'cannot write bundle') + + +! ---------------------------------------------------------------------------- + contains + + subroutine initial_q_(name,n1,n2) + + character(len=*) :: name + type(Chem_Init) :: init ! initialization registry + integer :: n1, n2, ier + real :: lat, lat_min, lat_del, lon, lon_min, lon_del + real, parameter :: REARTH=6370000., GRAV = 9.81 + real :: pi, sqrttwopi, mass, delm, area + real :: x, y, ang_x, ang_y, angarg + real :: amp, lat0, lon0, z0, rx, ry, rz + + pi = 4.*atan(1.) + mass = 0. + + init = Chem_InitResource(name, ier) + if(ier /= 0) call die(name, 'cannot read init resource') + + amp = init%amp + lon0 = 2.*pi*init%lon0/360. + lat0 = 2.*pi*init%lat0/360. + z0 = init%z0 * 1000. + rx = init%rx * 1000. + ry = init%ry * 1000. + rz = init%rz * 1000. + +! for a positive amplitude I assume that that is a total amount of mass +! in kg I want distributed in an ellipse (assumes consituent is in mass +! mixing ratio units). Integrate ellipse for total mass of air. Divide +! constituent mass by air mass to arrive at uniform mass mixing ratio. + if(amp .gt. 0.) then +! first find the grid cells in the ellipse and integrate to get mass +! of air inside + do k = 1, km + do j = 1, jm + lat = 2.*pi*(w_c%grid%lat_min + (j-1)*w_c%grid%lat_del)/360. + area = 2.*pi*REARTH*cos(lat)/360.*w_c%grid%lon_del & + * 2.*pi*REARTH/360.*w_c%grid%lat_del + do i = 1, im + lon = 2.*pi*(w_c%grid%lon_min+(i-1)*w_c%grid%lon_del)/360. +! Use angarg to check for round-off error + angarg = sin(lat0)**2.+cos(lat0)**2.*cos(lon0-lon) + if(angarg .ge. 1.) angarg = 1.d0 + ang_x = acos(angarg) + angarg = sin(lat)*sin(lat0)+cos(lat)*cos(lat0) + if(angarg .ge. 1.) angarg = 1.d0 + ang_y = acos(angarg) + x = REARTH*ang_x + y = REARTH*ang_y + if( (x/rx)**2.+(y/ry)**2.+((zc(i,j,k)-z0)/rz)**2. .lt. 1) then + mass = mass+delp(i,j,k)*area/GRAV + endif + end do + end do + end do + + delm = amp/mass + + do k = 1, km + do j = 1, jm + lat = 2.*pi*(w_c%grid%lat_min + (j-1)*w_c%grid%lat_del)/360. + do i = 1, im + lon = 2.*pi*(w_c%grid%lon_min+(i-1)*w_c%grid%lon_del)/360. +! Use angarg to check for round-off error + angarg = sin(lat0)**2.+cos(lat0)**2.*cos(lon0-lon) + if(angarg .ge. 1.) angarg = 1.d0 + ang_x = acos(angarg) + angarg = sin(lat)*sin(lat0)+cos(lat)*cos(lat0) + if(angarg .ge. 1.) angarg = 1.d0 + ang_y = acos(angarg) + x = REARTH*ang_x + y = REARTH*ang_y + if( (x/rx)**2.+(y/ry)**2.+((zc(i,j,k)-z0)/rz)**2. .lt. 1) then + do n = n1, n2 + q(i,j,k,n) = delm + end do + endif + end do + end do + end do + + endif + + +!!! THIS PART IS NOT QUITE CORRECT + +! for a negative amplitude I assume that that the absolute value of the +! amplitude is a desired maximum mixing ratio for the species and that +! it will be distributed in space in some sort of gaussian distribution +! of lat, lon, and z. + if(amp .le. 0.) then + sqrttwopi = sqrt(2.*pi) + do k = 1, km + do j = 1, jm + lat = w_c%grid%lat_min + (j-1)*w_c%grid%lat_del + do i = 1, im + lon = w_c%grid%lon_min+(i-1)*w_c%grid%lon_del + do n = n1, n2 + q(i,j,k,n) = -amp*exp(-(1./rx**2.)*(lon-lon0)**2.) & + *exp(-(1./ry**2.)*(lat-lat0)**2.) & + *exp(-(1./rz**2.)*(zc(i,j,k)-z0)**2.) + end do + end do + end do + end do + endif + + end subroutine initial_q_ + + +! --------------------------------------------------------------------------- + subroutine usage() + print * + print *,'Usage: ' + print *,' chem_init.x [-o chemfile -grid ] dynfile' + print * + print *, 'where' + print * + print *, '-o chemfile output chemistry initialization' + print *, ' file. Default: same as dynfile' + print *, ' with substring "d_rst" replaced' + print *, ' with "c_rst"' + print *, '-grid grtype a55, b55, c55, etc. (inactive now!)' + print *, 'dynfile mandatory d_rst file' + print * + call exit(1) + end subroutine usage + +end diff --git a/ESMF/Shared/Chem_Base/Chem_Init.rc b/ESMF/Shared/Chem_Base/Chem_Init.rc new file mode 100755 index 00000000..439a0aca --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_Init.rc @@ -0,0 +1,25 @@ +# +# Chemistry Initialization Resource File +# + +# CO +# ---------------------------------------------------- +amp_CO: 1e18 # positive for total mass [kg]; negative for mmr +lat0_CO: 0. # latitude +lon0_CO: 0. # longitude +z0_CO: 5. # altitude [km] +rx_CO: 4000. # axis E-W [km] +ry_CO: 500. # axis N-S [km] +rz_CO: 2. # axis in z [km] + +# DU +# ---------------------------------------------------- +amp_DU: 0. # positive for total mass [kg]; negative for mmr +lat0_DU: 0. # latitude +lon0_DU: 0. # longitude +z0_DU: 5. # altitude [km] +rx_DU: 4000. # axis E-W [km] +ry_DU: 500. # axis N-S [km] +rz_DU: 2. # axis in z [km] + + diff --git a/ESMF/Shared/Chem_Base/Chem_InitMod.F90 b/ESMF/Shared/Chem_Base/Chem_InitMod.F90 new file mode 100644 index 00000000..f14d0ee6 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_InitMod.F90 @@ -0,0 +1,226 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_InitMod --- Chemistry Initialization Class +! +! !INTERFACE: +! + + module chem_initmod + +! !USES: + + use m_inpak90 ! resource file management (MPEU) + use m_die, only: die + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC Chem_Init ! Keeps track of desired initial conditions for + ! tracers to be specified in the Chem_Registry + +! +! !PUBLIIC MEMBER FUNCTIONS: +! + PUBLIC Chem_InitResource ! Query the resource file + +! +! !DESCRIPTION: +! +! This module implements an initialization registry for (chemical) +! constituents. +! This initial class is intended to serve as a stop gap before an ESMF +! implementation is adopted. +! +! +! !REVISION HISTORY: +! +! 21Oct2003 Colarco +! +!EOP +!------------------------------------------------------------------------- + + integer, parameter :: nch = 255 + +! Registry +! -------- + type Chem_Init + +! Amplitude +! --------- + real :: amp, lat0, lon0, z0, rx, ry, rz + + end type Chem_Init + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_InitCreate --- Cronstruct Chemisty Initialization +! +! !INTERFACE: +! + + Function Chem_InitResource ( name, rc, rcfile ) + + implicit none + type(Chem_Init) Chem_InitResource + +! !USES: + + +! !INPUT PARAMETERS: + + character(len=*) :: name + character(len=*), OPTIONAL :: rcfile ! Resource file name; default is + ! 'Chem_IC.rc' + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: +! +! +! !REVISION HISTORY: +! +! 21Oct2003 Colarco +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_InitResource' + + type(Chem_Init) :: this + character(len=255) :: rcfilen = 'Chem_Init.rc' + integer :: ier + + rc = 0 + +! ------------------------------------------------------ +! Parse resource file to see desired tracer parameters +! ------------------------------------------------------ + if ( present(rcfile) ) rcfilen = trim(rcfile) + call i90_loadf ( rcfilen, ier ) + if ( ier .ne. 0 ) call die(myname, 'could not read rc file '// & + trim(rcfile) ) + call parserc_ ( name, this%amp, this%lat0, this%lon0, this%z0, & + this%ry, this%rx, this%rz) + call I90_Release() + +! All done +! -------- + Chem_InitResource = this + + return + +! ----------------------------- +! Internal Constructor Routines +! ----------------------------- + + CONTAINS + +! parses rc file + subroutine parserc_ ( name, amp, lat0, lon0, z0, ry, rx, rz ) +! ------------------- + character(len=*), intent(in) :: name + real, intent(out) :: amp, lat0, lon0, z0, ry, rx, rz + + character(len=255) :: answer + integer ier + +! Defaults +! -------- + lat0 = 0. + lon0 = 90. + z0 = 20. + ry = 500. + rx = 5000. + rz = 5. + +! What amplitude? +! ------------------------- + call i90_label ( 'amp_'//trim(name)//':', ier ) + if ( ier .eq. 0 ) then + amp = i90_gint ( ier ) + end if + if ( ier .ne. 0 ) then + call die ( myname, 'cannot determine AMP for '//trim(name) ) + end if + +! What latitude? +! ------------------------- + call i90_label ( 'lat0_'//trim(name)//':', ier ) + if ( ier .eq. 0 ) then + lat0 = i90_gint ( ier ) + end if + if ( ier .ne. 0 ) then + call die ( myname, 'cannot determine LAT for '//trim(name) ) + end if + +! What longitude? +! ------------------------- + call i90_label ( 'lon0_'//trim(name)//':', ier ) + if ( ier .eq. 0 ) then + lon0 = i90_gint ( ier ) + end if + if ( ier .ne. 0 ) then + call die ( myname, 'cannot determine LON for '//trim(name) ) + end if + +! What z? +! ------------------------- + call i90_label ( 'z0_'//trim(name)//':', ier ) + if ( ier .eq. 0 ) then + z0 = i90_gint ( ier ) + end if + if ( ier .ne. 0 ) then + call die ( myname, 'cannot determine Z for '//trim(name) ) + end if + +! What rlat? +! ------------------------- + call i90_label ( 'ry_'//trim(name)//':', ier ) + if ( ier .eq. 0 ) then + ry = i90_gint ( ier ) + end if + if ( ier .ne. 0 ) then + call die ( myname, 'cannot determine RLAT for '//trim(name) ) + end if + +! What rlon? +! ------------------------- + call i90_label ( 'rx_'//trim(name)//':', ier ) + if ( ier .eq. 0 ) then + rx = i90_gint ( ier ) + end if + if ( ier .ne. 0 ) then + call die ( myname, 'cannot determine RLON for '//trim(name) ) + end if + +! What rz? +! ------------------------- + call i90_label ( 'rz_'//trim(name)//':', ier ) + if ( ier .eq. 0 ) then + rz = i90_gint ( ier ) + end if + if ( ier .ne. 0 ) then + call die ( myname, 'cannot determine RZ for '//trim(name) ) + end if + + end subroutine parserc_ + + + end Function Chem_InitResource + + + end module Chem_InitMod + diff --git a/ESMF/Shared/Chem_Base/Chem_Mie-550nm.rc b/ESMF/Shared/Chem_Base/Chem_Mie-550nm.rc new file mode 100755 index 00000000..db4ca823 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_Mie-550nm.rc @@ -0,0 +1,20 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 5.5e-7 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + diff --git a/ESMF/Shared/Chem_Base/Chem_Mie.F90 b/ESMF/Shared/Chem_Base/Chem_Mie.F90 new file mode 100644 index 00000000..b4b25c8e --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_Mie.F90 @@ -0,0 +1,183 @@ +! This little program will demonstrate the skeleton of what needs to be +! done to compute the parameters needed for the SW radiative transfer +! calculations. +! Requires a chem.eta file + + program chem_miecalc + + use m_die, only: die + use Chem_RegistryMod + use Chem_BundleMod + +! +++++++++++++++++++++++++++++++++++++++++++++++++++ +! This will be mandatory for the SW band calculations + use Chem_MieMod +! --------------------------------------------------- + + + implicit none + + character(len=*), parameter :: myname = 'chem_mie' + type(Chem_Registry) :: reg ! chemistry registry + type(Chem_Bundle) :: w_c ! chemistry bundle + type(Chem_Bundle) :: w_tau ! tau chemistry bundle + type(Chem_Bundle) :: w_ssa ! ssa chemistry bundle + type(Chem_Bundle) :: w_gasym ! asymmetry parameter bundle + type(Chem_Mie) :: mie_tables + real :: channel ! requested band number to get properties of + real :: channels(8) ! bands wanted from table + integer :: i, j, k, im, jm, km, iq + integer :: nymd, nhms, timidx, freq, rc, ier + integer iarg, iargc, argc, lenfile + real :: tau, ssa, gasym + real, pointer :: rh(:,:,:) + character(len=255) :: infile, outfile, filename, rcfile, argv + character(len=255) :: which(5) + + data channels /1., 2., 3., 4., 5., 6., 7., 8./ + + +! Parse the command line (see usage() below) + argc = iargc() + if(argc .lt. 1) call usage() + iarg = 0 + outfile = 'test' + rcfile = 'AodBands_Registry.rc' + do i = 0, 32767 + iarg = iarg+1 + if(iarg .gt. argc) exit + call GetArg(iarg, argv) + select case(argv) + case ("-o") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, outfile) + case ("-t") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, rcfile) + case default + infile = argv + end select + end do + rcfile = trim(rcfile) + infile = trim(infile) + outfile = trim(outfile) + lenfile = len(trim(outfile)) + +! Read the chemistry registry +! --------------------------- + reg = Chem_RegistryCreate(ier) + if(ier /= 0) call die(myname, 'cannot create registry') + +! Read the chemistry bundle from the infile +! ------------------------------------------------- + call Chem_BundleRead(infile, nymd, nhms, w_c, rc, freq=freq, ChemReg=reg) + +! Create the tau bundle +! ------------------------------------------------- + im = w_c%grid%im + jm = w_c%grid%jm + km = w_c%grid%km + reg = Chem_RegistryCreate(rc,rcfile=rcfile) + call Chem_BundleCreate(reg, im, jm, km, w_tau, ier) + if(ier /= 0) call die(myname, 'cannot create tau bundle') + call Chem_BundleCreate(reg, im, jm, km, w_ssa, ier) + if(ier /= 0) call die(myname, 'cannot create ssa bundle') + call Chem_BundleCreate(reg, im, jm, km, w_gasym, ier) + if(ier /= 0) call die(myname, 'cannot create gasym bundle') + +! Fill the bundles +! ------------------------------------------------- + w_tau%delp = w_c%delp + w_tau%rh = w_c%rh + w_ssa%delp = w_c%delp + w_ssa%rh = w_c%rh + w_gasym%delp = w_c%delp + w_gasym%rh = w_c%rh + +! +++++++++++++++++++++++++++++++++++++++++++++++++++ +! Read the Mie Tables +! ------------------- + mie_tables = Chem_MieCreate(rcfile, rc) + +! Compute what you want +! --------------------- +! Need to clean up the functionality. +! You must pass the following things: +! 1) the mie_tables +! 2) tracer name +! 3) requested channel (band) by number (e.g., 1, 2, 3, ...) +! 4) tracer mass in gridbox, +! = mixing ratio * delp / grav +! 5) relative humidity (scaled 0 - 1) +! You get out ier (error code) and optionally +! tau, ssa, and gasym of band +! Loop should be over space, constituent, and band +! Need to add functionality, but skeletally this is correct +! Only works now dust bin 1 and channel 1 + + channel = 1. + iq = w_c%reg%i_DU + do k = 1, km + do j = 1, jm + do i = 1, im + +! Get the parameters from the mie tables +! Note that the RH from the Chem Bundle is 0 - 100; want 0 - 1 (fraction) +! so divide by 100 + call Chem_MieQuery(mie_tables, 'du001', channel, & + w_c%q(i,j,k,iq)*w_c%delp(i,j,k)/9.81, & + w_c%rh(i,j,k), & + tau=tau, ssa=ssa, gasym=gasym,rc=ier) + +! Fill in the values + w_tau%q(i,j,k,1) = tau + w_ssa%q(i,j,k,1) = ssa + w_gasym%q(i,j,k,1) = gasym + + enddo + enddo + enddo + +! Destroy the Mie Tables +! ---------------------- + call Chem_MieDestroy(mie_tables, rc) + + +! --------------------------------------------------- + + +! Write the AOD +! ------------------------------------------------- + filename = trim(outfile(1:lenfile)//'*.nc4') + + filename = trim(outfile(1:lenfile)//'.tau.nc4') + call Chem_BundleWrite( filename, nymd, nhms, 0, w_tau, rc, & + verbose=.true.) + filename = trim(outfile(1:lenfile)//'.ssa.nc4') + call Chem_BundleWrite( filename, nymd, nhms, 0, w_ssa, rc, & + verbose=.true.) + + filename = trim(outfile(1:lenfile)//'.gasym.nc4') + call Chem_BundleWrite( filename, nymd, nhms, 0, w_gasym, rc, & + verbose=.true.) + +! ---------------------------------------------------------------------------- + contains + + subroutine usage() + print * + print *,'Usage: ' + print *,' chem_mie.x [-o outfile -t rcfile ] infile' + print * + print *, 'where' + print * + print *, '-o outfile output file containing AOD' + print *, '-t rcfile resource file specifying channels for AOD calc' + print *, 'infile mandatory c_rst file' + print * + call exit(1) + end subroutine usage + +end diff --git a/ESMF/Shared/Chem_Base/Chem_Mie.rc b/ESMF/Shared/Chem_Base/Chem_Mie.rc new file mode 100644 index 00000000..fa2d902a --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_Mie.rc @@ -0,0 +1,15 @@ +# +# Resorce file for Chem_Mie Module. Defines filename with LUTs and +# available channels +# + +Chem_Mie::du_optics_file: ExtData/PIESA/x/opticsBands_DU.v15_3.nc +Chem_Mie::ss_optics_file: ExtData/PIESA/x/opticsBands_SS.v3_3.nc +Chem_Mie::su_optics_file: ExtData/PIESA/x/opticsBands_SU.v1_3.nc +Chem_Mie::ni_optics_file: ExtData/PIESA/x/opticsBands_NI.v2_5.nc +Chem_Mie::oc_optics_file: ExtData/PIESA/x/opticsBands_OC.v1_3.nc +Chem_Mie::brc_optics_file: ExtData/PIESA/x/opticsBands_BRC.v1_5.nc +Chem_Mie::bc_optics_file: ExtData/PIESA/x/opticsBands_BC.v1_3.nc + +Chem_Mie::channels: 1 2 3 4 5 6 7 8 + diff --git a/ESMF/Shared/Chem_Base/Chem_MieMod.F90 b/ESMF/Shared/Chem_Base/Chem_MieMod.F90 new file mode 100644 index 00000000..a1a827eb --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_MieMod.F90 @@ -0,0 +1,1265 @@ +! $Id$ + +#include "MAPL_Exceptions.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! + +! !MODULE: Chem_MieMod --- Load and manipulate Mie tables +! +! !INTERFACE: +! + + module Chem_MieMod + +! !USES: + + use Chem_MieTableMod + use Chem_RegistryMod + use m_chars, only : uppercase + use m_die, only: die + use m_inpak90 + +#if defined(GEOS5) + use ESMF + use MAPL +#endif + + implicit none + +! !PUBLIC TYPES: +! + private + public Chem_Mie ! Holds Mie Lookup Tables + +! +! !PUBLIC MEMBER FUNCTIONS: +! + public Chem_MieCreate ! Constructor + public Chem_MieDestroy ! Destructor + public Chem_MieQuery ! Query the Mie table to return parameters (qname interface) + public Chem_MieQueryTauList + public Chem_MieQueryAllBand3D + public Chem_MieQueryAllBand4D + public Chem_MieQueryIdx ! Query the index of the mie table given the qname + +! +! !DESCRIPTION: +! +! This module read the mie aerosol tables. +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco - Initial code. +! 11Jul2005 da Silva Standardization. +! +!EOP +!------------------------------------------------------------------------- + +! Mie LUT table +! Will be reduced from input files to the desired channels +! -------- + type Chem_Mie +! private + integer :: nch ! number of channels + integer :: nMom=0 ! number of moments (phase function) + integer :: nPol=0 ! number of moments (phase function) + real, pointer :: channels(:) ! wavelengths + + character(len=255) :: rcfile + character(len=255) :: du_optics_file + character(len=255) :: ss_optics_file + character(len=255) :: bc_optics_file + character(len=255) :: oc_optics_file + character(len=255) :: brc_optics_file + character(len=255) :: su_optics_file + character(len=255) :: ni_optics_file + character(len=255) :: sm_optics_file + + ! mie tables -- dim(nch,nrh,nbin) + type(Chem_MieTable), pointer :: mie_DU => null() + type(Chem_MieTable), pointer :: mie_SS => null() + type(Chem_MieTable), pointer :: mie_BC => null() + type(Chem_MieTable), pointer :: mie_OC => null() + type(Chem_MieTable), pointer :: mie_BRC => null() + type(Chem_MieTable), pointer :: mie_SU => null() + type(Chem_MieTable), pointer :: mie_NI => null() + type(Chem_MieTable), pointer :: mie_SM => null() + + integer :: nq ! number of tracers + character(len=255), pointer :: vname(:) => null() + integer, pointer :: vindex(:) => null() + type(Chem_MieTable), pointer :: vtable(:) => null() + ! mapping of vtable for given idx + type(Chem_MieTable), pointer :: vtableUse => null() + + end type Chem_Mie + + interface Chem_MieCreate + module procedure Chem_MieCreateFromCF + module procedure Chem_MieCreateFromRC + end interface + + interface Chem_MieQuery + module procedure Chem_MieQueryByInt + module procedure Chem_MieQueryByChar + end interface + + +contains + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieCreate --- Construct Mie LUTs from RC File +! +! !INTERFACE: +! + + Function Chem_MieCreateFromRC ( rcfile, rc, chemReg ) result(this) + + implicit none + +! !INPUT PARAMETERS: + + character(len=*), intent(in) :: rcfile ! Mie table file name + type(Chem_Registry), target, optional, intent(in) :: chemReg ! Optional chemReg + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Creates a Mie object. It reads Mie Tables and associates +! with a regulr Chem Registry describing aerosol mixing +! ratios. Then chemReg is not specified, "Chem_MieRegistry.rc" or +! "Chem_Registry.rc" are in, if available. +! +! !REVISION HISTORY: +! +! 09Mar2005 da Silva API, prologues. +! 21Mar2010 da Silva Added optional argument chemReg. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_MieCreate' + + type(Chem_Mie) :: this + type(Chem_Registry), pointer :: reg + integer :: ios, n, iq, iiq + real, pointer :: rh_table(:), lambda_table(:), & + bext(:,:,:), bsca(:,:,:), reff(:,:), gf(:,:), & + rhop(:,:), rhod(:) + logical :: fexists + character(len=255) :: name + + rc = 0 + +! NOTE: when rc is mandatory it is not cool do call die(); in this case +! the user should do the error trapping + +! Get the Chem Registry: optionally, uses a private name: Chem_MieRegistry + + if ( present(chemReg) ) then + reg => ChemReg + else + allocate(reg) + inquire ( file='Chem_MieRegistry.rc', exist=fexists ) + if ( fexists ) then + reg = Chem_RegistryCreate(rc,rcfile='Chem_MieRegistry.rc') + if ( rc /= 0 ) call die(myname, 'Cannot read Chem_MieRegistry.rc' ) + else + reg = Chem_RegistryCreate(rc,rcfile='Chem_Registry.rc') + if ( rc /= 0 ) call die(myname, 'Cannot read Chem_Registry.rc' ) + end if + end if + +! Set up the hash table to map the Chem Registry to the +! Mie tables +! ----------------------------------------------------- + this%nq = reg%nq + allocate(this%vname( this%nq) ) + allocate(this%vindex(this%nq) ) + allocate(this%vtable(this%nq) ) + do iq = 1, this%nq + this%vindex(iq) = -1 + this%vname(iq) = reg%vname(iq) + enddo + + this%rcfile = rcfile + +! Load the resource file +! ---------------------- + call i90_loadf ( rcfile, ios ) + if ( ios /= 0 ) call die(myname, 'could not read rc file '// & + trim(rcfile) ) + + +! Set the number of channels to calculate over +! -------------------------------------------- + call i90_label ( 'n_channels:', ios ) + if ( ios /= 0 ) then + call die(myname, 'could not find channel number request') + else + this%nch = i90_gint ( ios ) + if ( ios /= 0 ) call die(myname,'could not parse number of channels') + end if + +! Set the number of moments +! ------------------------- + call i90_label ( 'n_moments:', ios ) + if ( ios /= 0 ) then + this%nmom = 0 + else + this%nmom = i90_gint ( ios ) + if ( ios /= 0 ) call die(myname,'could not parse number of moments') + end if + +! Set the channels to calculate over +! ---------------------------------- + allocate( this%channels(this%nch), stat = ios ) + call i90_label ( 'r_channels:', ios ) + if ( ios /= 0 ) then + call die(myname, 'could not find channel number request') + else + do n = 1, this%nch + this%channels(n) = i90_gfloat ( ios ) + if ( ios /= 0 ) call die(myname,'could not parse channels') + enddo + end if + +! Logic needs to be placed so that you check the mie tables against +! the chem registry (bin size, species, etc.) For now assume +! they are all right. +! ----------------------------------------------------------------- + call i90_label ( 'filename_optical_properties_DU:', ios ) + if ( ios /= 0 ) then + call die(myname, 'could not parse DU filename label') + else + call i90_gtoken ( this%du_optics_file, ios ) + if ( ios /= 0 ) call die(myname,'could not parse DU filename') + end if + + call i90_label ( 'filename_optical_properties_SS:', ios ) + if ( ios /= 0 ) then + call die(myname, 'could not parse SS filename label') + else + call i90_gtoken ( this%ss_optics_file, ios ) + if ( ios /= 0 ) call die(myname,'could not parse SS filename') + end if + + call i90_label ( 'filename_optical_properties_BC:', ios ) + if ( ios /= 0 ) then + call die(myname, 'could not parse BC filename label') + else + call i90_gtoken ( this%bc_optics_file, ios ) + if ( ios /= 0 ) call die(myname,'could not parse BC filename') + end if + + call i90_label ( 'filename_optical_properties_OC:', ios ) + if ( ios /= 0 ) then + call die(myname, 'could not parse OC filename label') + else + call i90_gtoken ( this%oc_optics_file, ios ) + if ( ios /= 0 ) call die(myname,'could not parse OC filename') + end if + + call i90_label ( 'filename_optical_properties_SU:', ios ) + if ( ios /= 0 ) then + call die(myname, 'could not parse SU filename label') + else + call i90_gtoken ( this%su_optics_file, ios ) + if ( ios /= 0 ) call die(myname,'could not parse SU filename') + end if + + call i90_label ( 'filename_optical_properties_NI:', ios ) + if ( ios /= 0 ) then + call die(myname, 'could not parse NI filename label') + else + call i90_gtoken ( this%ni_optics_file, ios ) + if ( ios /= 0 ) call die(myname,'could not parse NI filename') + end if + + call i90_label ( 'filename_optical_properties_BRC:', ios ) + if ( ios /= 0 ) then + call die(myname, 'could not parse BRC filename label') + else + call i90_gtoken ( this%brc_optics_file, ios ) + if ( ios /= 0 ) call die(myname,'could not parse BRC filename') + end if + + +! Close resource file + call I90_Release() + + +! Allocate and fill Mie Table +! --------------------------- + allocate(this%mie_DU, this%mie_SS, this%mie_SU, stat = rc ) + if ( rc /= 0 ) return + allocate(this%mie_BC, this%mie_OC, stat = rc ) + if ( rc /= 0 ) return + allocate(this%mie_NI, this%mie_BRC, stat = rc ) + if ( rc /= 0 ) return + this%mie_DU = Chem_MieTableCreate(this%du_optics_file, rc) + if ( rc /= 0 ) call die(myname, 'could not create table for dust') + this%mie_SS = Chem_MieTableCreate(this%ss_optics_file, rc) + if ( rc /= 0 ) call die(myname, 'could not create table for sea salt') + this%mie_SU = Chem_MieTableCreate(this%su_optics_file, rc) + if ( rc /= 0 ) call die(myname, 'could not create table for sulfates') + this%mie_OC = Chem_MieTableCreate(this%oc_optics_file, rc) + if ( rc /= 0 ) call die(myname, 'could not create table for organic carbon') + this%mie_BC = Chem_MieTableCreate(this%bc_optics_file, rc) + if ( rc /= 0 ) call die(myname, 'could not create table for black carbon') + this%mie_NI = Chem_MieTableCreate(this%ni_optics_file, rc) + if ( rc /= 0 ) call die(myname, 'could not create table for nitrates') + this%mie_BRC = Chem_MieTableCreate(this%brc_optics_file, rc) + if ( rc /= 0 ) call die(myname, 'could not create table for brown carbon') + + call Chem_MieTableRead(this%mie_DU,this%nch,this%channels,rc,nmom=this%nmom) + if ( rc /= 0 ) call die(myname, 'could not read table for dust') + call Chem_MieTableRead(this%mie_SS,this%nch,this%channels,rc,nmom=this%nmom) + if ( rc /= 0 ) call die(myname, 'could not read table for sea salt') + call Chem_MieTableRead(this%mie_SU,this%nch,this%channels,rc,nmom=this%nmom) + if ( rc /= 0 ) call die(myname, 'could not read table for sulfates') + call Chem_MieTableRead(this%mie_OC,this%nch,this%channels,rc,nmom=this%nmom) + if ( rc /= 0 ) call die(myname, 'could not read table for organic carbon') + call Chem_MieTableRead(this%mie_BC,this%nch,this%channels,rc,nmom=this%nmom) + if ( rc /= 0 ) call die(myname, 'could not read table for black carbon') + call Chem_MieTableRead(this%mie_NI,this%nch,this%channels,rc,nmom=this%nmom) + if ( rc /= 0 ) call die(myname, 'could not read table for nitrates') + call Chem_MieTableRead(this%mie_BRC,this%nch,this%channels,rc,nmom=this%nmom) + if ( rc /= 0 ) call die(myname, 'could not read table for brown carbon') + + this%nPol = this%mie_DU%nPol + +! Now map the mie tables to the hash table for the registry +! This part is hard-coded for now! +! --------------------------------------------------------- + if(reg%doing_DU) then + do iq = reg%i_DU, reg%j_DU + this%vindex(iq) = iq-reg%i_DU + 1 + this%vtable(iq) = this%mie_DU + enddo + endif + if(reg%doing_SS) then + do iq = reg%i_SS, reg%j_SS + this%vindex(iq) = iq-reg%i_SS + 1 + this%vtable(iq) = this%mie_SS + enddo + endif + if(reg%doing_OC) then + do iq = reg%i_OC, reg%j_OC + this%vindex(iq) = iq-reg%i_OC + 1 + this%vtable(iq) = this%mie_OC + enddo + endif + if(reg%doing_BRC) then + do iq = reg%i_BRC, reg%j_BRC + this%vindex(iq) = iq-reg%i_BRC + 1 + this%vtable(iq) = this%mie_BRC + enddo + endif + if(reg%doing_BC) then + do iq = reg%i_BC, reg%j_BC + this%vindex(iq) = iq-reg%i_BC + 1 + this%vtable(iq) = this%mie_BC + enddo + endif + if(reg%doing_SU) then + iiq = 0 + do iq = reg%i_SU, reg%j_SU + name = trim(this%vname(iq)) +! Only sulfate aerosol species have entries in the Mie table + if(name(1:3) == 'so4' .or. name(1:3) == 'SO4' .or. & + name(1:3) == 'sul' .or. name(1:3) == 'SUL') then + iiq = iiq + 1 + this%vindex(iq) = iiq + this%vtable(iq) = this%mie_SU + endif + enddo + endif + if(reg%doing_NI) then + iiq = 0 + do iq = reg%i_NI, reg%j_NI + name = trim(this%vname(iq)) +! Only nitrate aerosol species have entries in the Mie table + if(name(1:3) == 'no3' .or. name(1:3) == 'NO3') then + iiq = iiq + 1 + this%vindex(iq) = iiq + this%vtable(iq) = this%mie_NI + endif + enddo + endif + +! All done +! -------- + if ( .not. present(chemReg) ) then + call Chem_RegistryDestroy(reg,rc) + if ( rc /= 0 ) return + end if + + return + + end Function Chem_MieCreateFromRC + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieCreate --- Construct Mie LUTs from CF object +! +! !INTERFACE: +! + + function Chem_MieCreateFromCF ( cf, rc, chemReg ) result(this) + +#if !defined(GEOS5) + + integer, intent(in) :: cf + integer, intent(out) :: rc + type(Chem_Mie) this + +#else + +! !INPUT PARAMETERS: + + type(ESMF_Config) :: cf ! Mie table file name + type(Chem_Registry), target, optional, intent(in) :: chemReg ! Optional chemReg + +! !OUTPUT PARAMETERS: + + type(Chem_Mie) this + integer, intent(out) :: rc + +! !DESCRIPTION: +! +! This routine creates a LUT object from an ESMF configuration +! attribute CF. This routine is usually called from GEOS-5. +! +! IMPORTANT: Does not yet handle the phase function!!!! +! +! !REVISION HISTORY: +! +! 09Mar2005 da Silva API, prologues. +! +!EOP +!------------------------------------------------------------------------- + + type(Chem_Registry), pointer :: reg + integer :: iq, rcs(32) + integer :: i, itick, iiq + real, pointer :: rh_table(:), lambda_table(:), & + bext(:,:,:), bsca(:,:,:), reff(:,:), gf(:,:), & + rhop(:,:), rhod(:) + character(len=255) :: reg_filename, name + + __Iam__('Chem_MieCreateFromCF') + + +! We need a Chem Registry to map a variable name into +! the relevant Mie Table, mostly for efficiency reasons. +! ------------------------------------------------------ + if ( present(chemReg) ) then + + reg => chemReg ! User supplied registry + +! Load the Chem Registry from Chem_MieRegistry.rc +! ----------------------------------------------- + else + + allocate(reg,__STAT__) + call ESMF_ConfigGetAttribute( CF, reg_filename, Label="CHEM_REGISTRY_FILENAME:" , & + default='Chem_MieRegistry.rc', __RC__ ) + reg = Chem_RegistryCreate(rc,rcfile=reg_filename) + if ( rc /= 0 ) return + + end if + +! Set up the hash table to map the variable names to the +! corresponding Mie Table +! ----------------------------------------------------- + this%nq = reg%nq + allocate(this%vname(this%nq), this%vindex(this%nq), stat=rc ) + if ( rc /= 0 ) return + allocate(this%vtable(this%nq), stat=rc ) + if ( rc /= 0 ) return + do iq = 1, this%nq + this%vindex(iq) = -1 + this%vname(iq) = reg%vname(iq) + enddo + +! Get file names for the optical tables +! ------------------------------------- + call ESMF_ConfigGetAttribute( CF, this%du_optics_file, Label="DU_OPTICS:" , & + default='ExtData/g5chem/x/opticsBands_DU.nc4', & + __RC__ ) + call ESMF_ConfigGetAttribute( CF, this%ss_optics_file, Label="SS_OPTICS:" , & + default='ExtData/g5chem/x/opticsBands_SS.nc4', & + __RC__ ) + call ESMF_ConfigGetAttribute( CF, this%su_optics_file, Label="SU_OPTICS:" , & + default='ExtData/g5chem/x/opticsBands_SU.nc4', & + __RC__ ) + call ESMF_ConfigGetAttribute( CF, this%oc_optics_file, Label="OC_OPTICS:" , & + default='ExtData/g5chem/x/opticsBands_OC.nc4', & + __RC__ ) + call ESMF_ConfigGetAttribute( CF, this%bc_optics_file, Label="BC_OPTICS:" , & + default='ExtData/g5chem/x/opticsBands_BC.nc4', & + __RC__ ) + call ESMF_ConfigGetAttribute( CF, this%ni_optics_file, Label="NI_OPTICS:" , & + default='ExtData/g5chem/x/opticsBands_NI.nc4', & + __RC__ ) + call ESMF_ConfigGetAttribute( CF, this%brc_optics_file, Label="BRC_OPTICS:" , & + default='ExtData/g5chem/x/opticsBands_BRC.nc4', & + __RC__ ) + call ESMF_ConfigGetAttribute( CF, this%nch , Label= "NUM_BANDS:" , & + default=18, __RC__) + + allocate ( this%channels(this%nch), stat=rc ) + if ( rc /= 0 ) return + + call ESMF_ConfigGetAttribute( CF, this%channels , Label= "BANDS:" , & + count=this%nch, rc=rc ) + +! If there is no BAND definition on CF, make something up +! ------------------------------------------------------- + if(rc /= ESMF_SUCCESS) then + do i=1,this%nch + this%channels(i) = i + end do + end if + + allocate(this%mie_DU, this%mie_SS, this%mie_SU, this%mie_BRC, & + this%mie_BC, this%mie_OC, this%mie_NI, stat=rc) + if ( rc /= 0 ) return + + this%mie_DU = Chem_MieTableCreate(this%du_optics_file, __RC__ ) + this%mie_SS = Chem_MieTableCreate(this%ss_optics_file, __RC__ ) + this%mie_SU = Chem_MieTableCreate(this%su_optics_file, __RC__ ) + this%mie_OC = Chem_MieTableCreate(this%oc_optics_file, __RC__ ) + this%mie_BC = Chem_MieTableCreate(this%bc_optics_file, __RC__ ) + this%mie_NI = Chem_MieTableCreate(this%ni_optics_file, __RC__ ) + this%mie_BRC = Chem_MieTableCreate(this%brc_optics_file, __RC__ ) + + call Chem_MieTableRead(this%mie_DU,this%nch,this%channels, __RC__) + call Chem_MieTableRead(this%mie_SS,this%nch,this%channels, __RC__) + call Chem_MieTableRead(this%mie_SU,this%nch,this%channels, __RC__) + call Chem_MieTableRead(this%mie_OC,this%nch,this%channels, __RC__) + call Chem_MieTableRead(this%mie_BC,this%nch,this%channels, __RC__) + call Chem_MieTableRead(this%mie_NI,this%nch,this%channels, __RC__) + call Chem_MieTableRead(this%mie_BRC,this%nch,this%channels, __RC__) + +! Now map the mie tables to the hash table for the registry +! This part is hard-coded for now! +! --------------------------------------------------------- + if(reg%doing_DU) then + do iq = reg%i_DU, reg%j_DU + this%vname(iq) = reg%vname(iq) + this%vindex(iq) = iq-reg%i_DU + 1 + this%vtable(iq) = this%mie_DU + enddo + endif + if(reg%doing_SS) then + do iq = reg%i_SS, reg%j_SS + this%vindex(iq) = iq-reg%i_SS + 1 + this%vtable(iq) = this%mie_SS + enddo + endif + if(reg%doing_OC) then + do iq = reg%i_OC, reg%j_OC + this%vindex(iq) = iq-reg%i_OC + 1 + this%vtable(iq) = this%mie_OC + enddo + endif + if(reg%doing_BRC) then + do iq = reg%i_BRC, reg%j_BRC + this%vindex(iq) = iq-reg%i_BRC + 1 + this%vtable(iq) = this%mie_BRC + enddo + endif + if(reg%doing_BC) then + do iq = reg%i_BC, reg%j_BC + this%vindex(iq) = iq-reg%i_BC + 1 + this%vtable(iq) = this%mie_BC + enddo + endif + if(reg%doing_SU) then + iiq = 0 + do iq = reg%i_SU, reg%j_SU + name = trim(this%vname(iq)) +! Only sulfate aerosol species have entries in the Mie table + if(name(1:3) == 'so4' .or. name(1:3) == 'SO4' .or. & + name(1:3) == 'sul' .or. name(1:3) == 'SUL') then + iiq = iiq + 1 + this%vindex(iq) = iiq + this%vtable(iq) = this%mie_SU + endif + enddo + endif + if(reg%doing_NI) then + iiq = 0 + do iq = reg%i_NI, reg%j_NI + name = trim(this%vname(iq)) +! Only nitrate aerosol species have entries in the Mie table + if(name(1:3) == 'no3' .or. name(1:3) == 'NO3') then + iiq = iiq + 1 + this%vindex(iq) = iiq + this%vtable(iq) = this%mie_NI + endif + enddo + endif + +! All done +! -------- + if ( .not. present(chemReg) ) then + call Chem_RegistryDestroy(reg,__RC__) + deallocate(reg) + end if + +#endif + + return + + end function Chem_MieCreateFromCF + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieDestroy --- Destruct Mie Table +! +! !INTERFACE: +! + subroutine Chem_MieDestroy ( this, rc ) + +! !USES: + +! !INPUT/OUTPUT PARAMETERS: + + type(Chem_Mie), intent(inout) :: this + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + + +! !DESCRIPTION: Destructor for AOD object. +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: Iam = 'Chem_MieDestroy' + + call Chem_MieTableDestroy(this%mie_DU, rc=rc) + if ( rc /= 0 ) return + call Chem_MieTableDestroy(this%mie_SS, rc=rc) + if ( rc /= 0 ) return + call Chem_MieTableDestroy(this%mie_SU, rc=rc) + if ( rc /= 0 ) return + call Chem_MieTableDestroy(this%mie_OC, rc=rc) + if ( rc /= 0 ) return + call Chem_MieTableDestroy(this%mie_BC, rc=rc) + if ( rc /= 0 ) return + call Chem_MieTableDestroy(this%mie_NI, rc=rc) + if ( rc /= 0 ) return + call Chem_MieTableDestroy(this%mie_BRC, rc=rc) + if ( rc /= 0 ) return + + if ( associated(this%channels) ) deallocate(this%channels, stat=rc) + if ( rc /= 0 ) return + if ( associated(this%vname) ) deallocate(this%vname, stat=rc) + if ( rc /= 0 ) return + if ( associated(this%vindex) ) deallocate(this%vindex, stat=rc) + if ( rc /= 0 ) return + if ( associated(this%vtable) ) deallocate(this%vtable, stat=rc) + if ( rc /= 0 ) return + if ( associated(this%mie_DU) ) deallocate(this%mie_DU, stat=rc) + if ( rc /= 0 ) return + if ( associated(this%mie_SS) ) deallocate(this%mie_SS, stat=rc) + if ( rc /= 0 ) return + if ( associated(this%mie_SS) ) deallocate(this%mie_SS, stat=rc) + if ( rc /= 0 ) return + if ( associated(this%mie_OC) ) deallocate(this%mie_OC, stat=rc) + if ( rc /= 0 ) return + if ( associated(this%mie_BC) ) deallocate(this%mie_BC, stat=rc) + if ( rc /= 0 ) return + if ( associated(this%mie_NI) ) deallocate(this%mie_NI, stat=rc) + if ( rc /= 0 ) return + if ( associated(this%mie_BRC) ) deallocate(this%mie_BRC, stat=rc) + if ( rc /= 0 ) return + +end subroutine Chem_MieDestroy + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieQueryIdx --- Return the index of the mie table given +! a qname requested +! +! +! !INTERFACE: +! + Function Chem_MieQueryIdx ( this, qname, rc ) result(idx) + + implicit none + +! !INPUT PARAMETERS: + + type(Chem_Mie), intent(inout) :: this ! Input mie table structure + character(len=*), intent(in) :: qname ! Variable name to find in table, e.g., du001 + +! !OUTPUT PARAMETERS: + + integer, optional, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - +! !DESCRIPTION: +! +! +! !REVISION HISTORY: +! +! 24Apr2006, PRC +! +!EOP +!------------------------------------------------------------------------- + character(len=255) :: NAME + integer :: idx ! Index number in Mie table of qname + integer :: iq, i + +! Find the right table for this aerosol from its name + + NAME = trim(qname) + +! Remove qualifier from variable name: GOCART::du001 --> du001 +! ------------------------------------------------------------ + i = index(NAME,'::') + if ( i > 0 ) then + NAME = NAME(i+2:) + end if + + idx = -1 + do iq = 1, this%nq + if(uppercase(trim((NAME))) .eq. uppercase(trim(this%vname(iq)))) then + idx = this%vindex(iq) + this%vtableUse => this%vtable(iq) + exit + endif + enddo + + if(present(rc)) then + if(idx .eq. -1) then + rc = 1 + else + rc = 0 + end if + end if + + return + + end Function Chem_MieQueryIdx + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieQuery --- Return Tau, SSA, etc (scalar version) +! +! +! !INTERFACE: +! + subroutine Chem_MieQueryByInt ( this, idx, channel, q_mass, rh, & + tau, ssa, gasym, bext, bsca, bbck, & + reff, pmom, p11, p22, gf, rhop, rhod, & + vol, area, refr, refi, rc ) + +! !INPUT PARAMETERS: + + type(Chem_Mie), target, intent(in ) :: this + integer, intent(in ) :: idx ! variable index on Chem_Mie + real, intent(in ) :: channel ! channel number + real, intent(in ) :: q_mass ! aerosol mass [kg/m2], + real, intent(in ) :: rh ! relative himidity + +! !OUTPUT PARAMETERS: + + real, optional, intent(out) :: tau ! aerol extinction optical depth + real, optional, intent(out) :: ssa ! single scattering albedo + real, optional, intent(out) :: gasym ! asymmetry parameter + real, optional, intent(out) :: bext ! mass extinction efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: bsca ! mass scattering efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: bbck ! mass backscatter efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: reff ! effective radius (micron) + real, optional, intent(out) :: pmom(:,:) + real, optional, intent(out) :: p11 ! P11 phase function at backscatter + real, optional, intent(out) :: p22 ! P22 phase function at backscatter + real, optional, intent(out) :: gf ! Growth factor (ratio of wet to dry radius) + real, optional, intent(out) :: rhop ! Wet particle density [kg m-3] + real, optional, intent(out) :: rhod ! Dry particle density [kg m-3] + real, optional, intent(out) :: vol ! Wet particle volume [m3 kg-1] + real, optional, intent(out) :: area ! Wet particle cross section [m2 kg-1] + real, optional, intent(out) :: refr ! Wet particle real part of ref. index + real, optional, intent(out) :: refi ! Wet particle imag. part of ref. index + integer, optional, intent(out) :: rc ! error code + +! !DESCRIPTION: +! +! Returns requested parameters from the Mie tables, as a function +! of species, relative humidity, and channel +! +! Notes: Needs some checking, and I still force an interpolation step + +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco +! 11Jul2005 da Silva Standardization. +! +!EOP +!------------------------------------------------------------------------- + + integer :: ICHANNEL, TYPE + integer :: irh, irhp1, isnap + real :: rhUse, arh + real :: bextIn, bscaIn, bbckIn, gasymIn, p11In, p22In, & + gfIn, rhopIn, rhodIn, volIn, areaIn, & + refrIn, refiIn + type(Chem_MieTable), pointer :: TABLE + + character(len=*), parameter :: Iam = 'Chem_MieQueryByInt' + + if ( present(rc) ) rc = 0 + + ICHANNEL = nint(CHANNEL) + TABLE => this%vtableUse + TYPE = idx + +! ASSERT_(TYPE>0) +! ASSERT_(ICHANNEL>=LBOUND(TABLE%bext,1)) +! ASSERT_(ICHANNEL<=UBOUND(TABLE%bext,1)) + +! Now map the input RH to the high resolution hash table for RH + rhUse = max(rh,0.) + rhUse = min(rh,0.99) + isnap = int((rhUse+0.001)*1000.) + if(isnap .lt. 1) isnap = 1 + arh = TABLE%rha( isnap ) + irh = TABLE%rhi( isnap ) + irhp1 = irh+1 + if(irhp1 .gt. TABLE%nrh) irhp1 = TABLE%nrh + +! Now linearly interpolate the input table for the requested aerosol and +! channel; rh is the relative humidity. + + if(present(bext) .or. present(tau) .or. present(ssa) ) then + bextIn = TABLE%bext(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%bext(irhp1,ichannel,TYPE) * arh + endif + + if(present(bsca) .or. present(ssa) ) then + bscaIn = TABLE%bsca(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%bsca(irhp1,ichannel,TYPE) * arh + endif + + if(present(bbck)) then + bbckIn = TABLE%bbck(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%bbck(irhp1,ichannel,TYPE) * arh + endif + + if(present(gasym)) then + gasymIn = TABLE%g(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%g(irhp1,ichannel,TYPE) * arh + endif + + if(present(rEff) ) then + rEff = TABLE%rEff(irh ,TYPE) * (1.-arh) & + + TABLE%rEff(irhp1,TYPE) * arh + rEff = 1.E6 * rEff ! convert to microns + endif + + if(present(pmom)) then + pmom(:,:) = TABLE%pmom(irh ,ichannel,TYPE,:,:) * (1.-arh) & + + TABLE%pmom(irhp1,ichannel,TYPE,:,:) * arh + endif + + if(present(p11) ) then + p11In = TABLE%pback(irh ,ichannel,TYPE,1) * (1.-arh) & + + TABLE%pback(irhp1,ichannel,TYPE,1) * arh + endif + + if(present(p22) ) then + p22In = TABLE%pback(irh ,ichannel,TYPE,5) * (1.-arh) & + + TABLE%pback(irhp1,ichannel,TYPE,5) * arh + endif + + if(present(gf) ) then + gfIn = TABLE%gf(irh ,TYPE) * (1.-arh) & + + TABLE%gf(irhp1,TYPE) * arh + endif + + if(present(rhod) ) then + rhodIn = TABLE%rhod(1 ,TYPE) + endif + + if(present(vol) ) then + volIn = TABLE%vol(irh ,TYPE) * (1.-arh) & + + TABLE%vol(irhp1,TYPE) * arh + endif + + if(present(area) ) then + areaIn = TABLE%area(irh ,TYPE) * (1.-arh) & + + TABLE%area(irhp1,TYPE) * arh + endif + + if(present(refr) .or. present(tau) .or. present(ssa) ) then + refrIn = TABLE%refr(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%refr(irhp1,ichannel,TYPE) * arh + endif + + if(present(refi) .or. present(tau) .or. present(ssa) ) then + refiIn = TABLE%refi(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%refi(irhp1,ichannel,TYPE) * arh + endif + + +! Fill the requested outputs + if(present(tau )) tau = bextIn * q_mass + if(present(ssa )) ssa = bscaIn/bextIn + if(present(bext )) bext = bextIn + if(present(bsca )) bsca = bscaIn + if(present(bbck )) bbck = bbckIn + if(present(gasym)) gasym = gasymIn + if(present(p11 )) p11 = p11In + if(present(p22 )) p22 = p22In + if(present(gf )) gf = gfIn + if(present(rhop )) rhop = rhopIn + if(present(rhod )) rhod = rhodIn + if(present(vol )) vol = volIn + if(present(area )) area = areaIn + if(present(refr )) refr = refrIn + if(present(refi )) refi = refiIn + +! All Done +!---------- + + return + + end subroutine Chem_MieQueryByInt + + + subroutine Chem_MieQueryTauList ( this, idx, channel, q_mass, rh, tau, rc ) + + + type(Chem_Mie), target, intent(in ) :: this + integer, intent(in ) :: idx ! variable index on Chem_Mie + real, intent(in ) :: channel ! channel number + real, intent(in ) :: q_mass(:) ! aerosol mass [kg/m2], + real, intent(in ) :: rh(:) ! relative himidity + real, intent(out) :: tau(:) ! aerol optical depth + integer, optional, intent(out) :: rc ! error code + +!------------------------------------------------------------------------- + + integer :: ICHANNEL, i + integer :: irh, irhp1, isnap + real :: arh + type(Chem_MieTable), pointer :: TABLE + + character(len=*), parameter :: Iam = 'Chem_MieQueryList' + + if ( present(rc) ) rc = 0 + + ICHANNEL = nint(CHANNEL) + TABLE => this%vtableUse + +! Now map the input RH to the high resolution hash table for RH + + do i=1,size(tau) + arh = rh(i) + if(arh > .99) arh = .99 + if(arh < 0.0) arh = 0.0 + + isnap = int((arh+0.001)*1000.) + if(isnap .lt. 1) isnap = 1 + + arh = TABLE%rha( isnap ) + irh = TABLE%rhi( isnap ) + irhp1 = irh+1 + + if(irhp1 .gt. TABLE%nrh) irhp1 = TABLE%nrh + + tau(i) = ( TABLE%bext(irh ,ichannel,idx ) * (1.-arh) & + + TABLE%bext(irhp1,ichannel,idx ) * arh )*q_mass(i) + enddo + +! All Done +!---------- + + return + + end subroutine Chem_MieQueryTauList + + + subroutine Chem_MieQueryByChar( this, idx, channel, q_mass, rh, & + tau, ssa, gasym, bext, bsca, bbck, & + rEff, pmom, p11, p22, rc ) + +! ! INPUT parameters + type(Chem_Mie), target, intent(in ) :: this + character(*), intent(in ) :: idx ! variable index on Chem_Mie + real, intent(in ) :: channel ! channel number + real, intent(in ) :: q_mass ! aerosol mass [kg/m2], + real, intent(in ) :: rh ! relative himidity + +! ! OUTPUT Parameters + real, optional, intent(out) :: tau ! aerol extinction optical depth + real, optional, intent(out) :: ssa ! single scattering albedo + real, optional, intent(out) :: gasym ! asymmetry parameter + real, optional, intent(out) :: bext ! mass extinction efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: bsca ! mass scattering efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: bbck ! mass backscatter efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: reff ! effective radius (micron) + real, optional, intent(out) :: pmom(:,:) + real, optional, intent(out) :: p11 ! P11 phase function at backscatter + real, optional, intent(out) :: p22 ! P22 phase function at backscatter + integer, optional, intent(out) :: rc ! error code + + integer :: iq, i + + character(len=*), parameter :: Iam = 'Chem_MieQueryByChar' + character(len=255) :: NAME + + if ( present(rc) ) rc = 0 + +! Remove qualifier from variable name: GOCART::du001 --> du001 +! ------------------------------------------------------------ + NAME = trim(idx) + i = index(NAME,'::') + if ( i > 0 ) then + NAME = NAME(i+2:) + end if + + do iq = 1, this%nq + if( uppercase(trim(NAME)) == uppercase(trim(this%vname(iq)))) then + call Chem_MieQueryByInt( this, iq, channel, q_mass, rh, & + tau, ssa, gasym, bext, bsca, bbck, & + rEff, pmom, p11, p22, rc=rc ) + if ( rc /= 0 ) return + endif + enddo + + end subroutine Chem_MieQueryByChar + + subroutine Chem_MieQueryAllBand3D ( this, idx, nbands, offset, q_mass, rh, & + tau, ssa, asy, rc ) + + + type(Chem_Mie), target, intent(in ) :: this + integer, intent(in ) :: idx ! variable index on Chem_Mie + integer, intent(in ) :: nbands ! number of bands + integer, intent(in ) :: offset ! offset of bands + real, intent(in ) :: q_mass(:,:) ! aerosol mass [kg/m2], + real, intent(in ) :: rh(:,:) ! relative humidity + real, intent(out) :: tau(:,:,:) ! aerosol optical depth + real, intent(out) :: ssa(:,:,:) ! single scattering albedo + real, intent(out) :: asy(:,:,:) ! asymmetry parameter + integer, optional, intent(out) :: rc ! error code + +!------------------------------------------------------------------------- + + integer :: ICHANNEL, i, k, STATUS + integer :: irh, irhp1, isnap + real :: arh + type(Chem_MieTable), pointer :: TABLE + integer :: II, KK + real :: bextIn, bscaIn, gasymIn + + real, allocatable :: bext_band(:) + real, allocatable :: bsca_band(:) + real, allocatable :: gasy_band(:) + + character(len=*), parameter :: Iam = 'Chem_MieQueryAllBand3D' + + if ( present(rc) ) rc = 0 + + TABLE => this%vtableUse + + II = size(rh,1) + KK = size(rh,2) + + allocate(bext_band(TABLE%nrh), source=0.0, __STAT__) + allocate(bsca_band(TABLE%nrh), source=0.0, __STAT__) + allocate(gasy_band(TABLE%nrh), source=0.0, __STAT__) + +! Now map the input RH to the high resolution hash table for RH + + do ichannel=1,nbands + + bext_band = TABLE%bext(:,ichannel+offset,idx) + bsca_band = TABLE%bsca(:,ichannel+offset,idx) + gasy_band = TABLE%g(:,ichannel+offset,idx) + + do k=1,KK + do i=1,II + + arh = rh(i,k) + arh = max(arh,0.0) + arh = min(arh,0.99) + + isnap = int((arh+0.001)*1000.) + if(isnap .lt. 1) isnap = 1 + + arh = TABLE%rha( isnap ) + irh = TABLE%rhi( isnap ) + irhp1 = irh+1 + + if(irhp1 .gt. TABLE%nrh) irhp1 = TABLE%nrh + + bextIn = bext_band(irh ) * (1.-arh) & + + bext_band(irhp1) * arh + + bscaIn = bsca_band(irh ) * (1.-arh) & + + bsca_band(irhp1) * arh + + gasymIn = gasy_band(irh ) * (1.-arh) & + + gasy_band(irhp1) * arh + +! Fill the requested outputs + + tau(i,k,ichannel) = bextIn * q_mass(i,k) + ssa(i,k,ichannel) = bscaIn/bextIn + asy(i,k,ichannel) = gasymIn + + enddo + enddo + enddo + + deallocate(bext_band) + deallocate(bsca_band) + deallocate(gasy_band) + +! All Done +!---------- + + return + + end subroutine Chem_MieQueryAllBand3D + + subroutine Chem_MieQueryAllBand4D ( this, idx, nbands, offset, q_mass, rh, & + tau, ssa, asy, rc ) + + + type(Chem_Mie), target, intent(in ) :: this + integer, intent(in ) :: idx ! variable index on Chem_Mie + integer, intent(in ) :: nbands ! number of bands + integer, intent(in ) :: offset ! offset of bands + real, intent(in ) :: q_mass(:,:,:) ! aerosol mass [kg/m2], + real, intent(in ) :: rh(:,:,:) ! relative humidity + real, intent(out) :: tau(:,:,:,:) ! aerosol optical depth + real, intent(out) :: ssa(:,:,:,:) ! single scattering albedo + real, intent(out) :: asy(:,:,:,:) ! asymmetry parameter + integer, optional, intent(out) :: rc ! error code + +!------------------------------------------------------------------------- + + integer :: ICHANNEL, i, j, k, STATUS + integer :: irh, irhp1, isnap + real :: arh + type(Chem_MieTable), pointer :: TABLE + integer :: II, JJ, KK + real :: bextIn, bscaIn, gasymIn + + real, allocatable :: bext_band(:) + real, allocatable :: bsca_band(:) + real, allocatable :: gasy_band(:) + + character(len=*), parameter :: Iam = 'Chem_MieQueryAllBand4D' + + if ( present(rc) ) rc = 0 + + TABLE => this%vtableUse + + II = size(rh,1) + JJ = size(rh,2) + KK = size(rh,3) + + allocate(bext_band(TABLE%nrh), source=0.0, __STAT__) + allocate(bsca_band(TABLE%nrh), source=0.0, __STAT__) + allocate(gasy_band(TABLE%nrh), source=0.0, __STAT__) + +! Now map the input RH to the high resolution hash table for RH + + do ichannel=1,nbands + + bext_band = TABLE%bext(:,ichannel+offset,idx) + bsca_band = TABLE%bsca(:,ichannel+offset,idx) + gasy_band = TABLE%g(:,ichannel+offset,idx) + + do k=1,KK + do j=1,JJ + do i=1,II + + arh = rh(i,j,k) + arh = max(arh,0.0) + arh = min(arh,0.99) + + isnap = int((arh+0.001)*1000.) + if(isnap .lt. 1) isnap = 1 + + arh = TABLE%rha( isnap ) + irh = TABLE%rhi( isnap ) + irhp1 = irh+1 + + if(irhp1 .gt. TABLE%nrh) irhp1 = TABLE%nrh + + bextIn = bext_band(irh ) * (1.-arh) & + + bext_band(irhp1) * arh + + bscaIn = bsca_band(irh ) * (1.-arh) & + + bsca_band(irhp1) * arh + + gasymIn = gasy_band(irh ) * (1.-arh) & + + gasy_band(irhp1) * arh + +! Fill the requested outputs + + tau(i,j,k,ichannel) = bextIn * q_mass(i,j,k) + ssa(i,j,k,ichannel) = bscaIn/bextIn + asy(i,j,k,ichannel) = gasymIn + + enddo + enddo + enddo + enddo + + deallocate(bext_band) + deallocate(bsca_band) + deallocate(gasy_band) + +! All Done +!---------- + + return + + end subroutine Chem_MieQueryAllBand4D + + end module Chem_MieMod + diff --git a/ESMF/Shared/Chem_Base/Chem_MieRegistry.rc b/ESMF/Shared/Chem_Base/Chem_MieRegistry.rc new file mode 100755 index 00000000..5b529bb1 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_MieRegistry.rc @@ -0,0 +1,455 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# XX lists Stratchem's inferred species. See Chem_Registry.rc +# for GMIchem's XX (non-transported) species list. +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to mol/mol +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # carbon monoxide +doing_CO2: no # carbon dioxide +doing_DU: yes # mineral dust +doing_SS: yes # sea salt +doing_SU: yes # sulfates +doing_CFC: no # CFCs +doing_BC: yes # black carbon +doing_OC: yes # organic carbon +doing_BRC: no # brown carbon +doing_NI: yes # nitrate +doing_Rn: no # radon +doing_CH4: no # methane +doing_SC: no # stratospheric chemistry +doing_GMI: no # GMI chemistry (GEOS-5) +doing_XX: no # generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: no # passive tracers + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 10 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC: 34 # stratospheric chemistry +nbins_XX: 18 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 10 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Global carbon monoxide +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +REDUCED +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 m-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +st80_25 'mol mol-1' Stratosphere source 25 day tracer +CO_50_na 'mol mol-1' Anthro CO North America 50 day tracer +SF6 'mol mol-1' Sulfur Hexafluoride tracer +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant emission 90 day tracer +Rn222 'mol mol-1' Radon-222 +Pb210 'mol mol-1' Lead-210 +Be7 'mol mol-1' Beryllium radionuclide 7(Be) +Be10 'mol mol-1' Beryllium radionuclide 10(Be) +CH3I 'mol mol-1' Methyl iodide +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers diff --git a/ESMF/Shared/Chem_Base/Chem_MieTableMod.F90 b/ESMF/Shared/Chem_Base/Chem_MieTableMod.F90 new file mode 100644 index 00000000..9d5d7e2b --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_MieTableMod.F90 @@ -0,0 +1,809 @@ + +#include "MAPL_Exceptions.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_MieTableMod --- Reader for aerosol mie tables +! +! !INTERFACE: +! + + module Chem_MieTableMod + +! !USES: + + use ESMF + use MAPL + use m_die, only: die, warn + + implicit none + include "netcdf.inc" ! Required for Mie tables stored as NCDF files + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC Chem_MieTable ! Holds Mie Lookup Tables + +! +! !PUBLIC MEMBER FUNCTIONS: +! + PUBLIC Chem_MieTableCreate ! Constructor + PUBLIC Chem_MieTableDestroy ! Destructor + PUBLIC Chem_MieTableRead ! Read the mie table from the file + PUBLIC Chem_MieTableGetDims ! Return table sizes + +! +! !DESCRIPTION: +! +! This module read the mie aerosol tables. +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco - Initial code. +! 31Mar2005 Todling - Declared netcdf nf_ routines as external (OSF1) +! Removed # from include netcdf.inc +! +!EOP +!------------------------------------------------------------------------- + +! Mie LUT table +! Will be reduced from input files to the desired channels +! -------- + type Chem_MieTable + + character(len=255) :: mietablename + integer :: nlambda ! number of wavelengths in table + integer :: nrh ! number of RH values in table + integer :: nbin ! number of size bins in table + integer :: nMom ! number of moments of phase function + integer :: nPol ! number of elements of scattering phase matrix + real, pointer :: lambda(:) => null() ! wavelengths [m] + real, pointer :: rh(:) => null() ! RH values [fraction] + real, pointer :: reff(:,:) => null() ! effective radius [m] + real, pointer :: bext(:,:,:) => null() ! bext values [m2 kg-1] + real, pointer :: bsca(:,:,:) => null() ! bsca values [m2 kg-1] + real, pointer :: bbck(:,:,:) => null() ! bbck values [m2 kg-1] + real, pointer :: g(:,:,:) => null() ! asymmetry parameter + real, pointer :: pback(:,:,:,:) => null() ! Backscatter phase function + real, pointer :: pmom(:,:,:,:,:) => null( ) ! moments of phase function + real, pointer :: gf(:,:) => null() ! hygroscopic growth factor + real, pointer :: rhop(:,:) => null() ! wet particle density [kg m-3] + real, pointer :: rhod(:,:) => null() ! wet particle density [kg m-3] + real, pointer :: vol(:,:) => null() ! wet particle volume [m3 kg-1] + real, pointer :: area(:,:) => null() ! wet particle cross section [m2 kg-1] + real, pointer :: refr(:,:,:) => null() ! real part of refractive index + real, pointer :: refi(:,:,:) => null() ! imaginary part of refractive index + + integer :: rhi(991) ! pointer to rh map + real :: rha(991) ! slope on rh map + + end type Chem_MieTable + +# ifndef HAS_NETCDF3 + external nf_open, nf_inq_dimid, nf_inq_dimlen, nf_inq_varid, & + nf_get_var_double, nf_close +#endif + + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieTableCreate --- Construct Chemistry Registry +! +! !INTERFACE: +! + + Function Chem_MieTableCreate ( rcfile, rc ) + + implicit none + type(Chem_MieTable) Chem_MieTableCreate + +! !INPUT PARAMETERS: + + character(len=*) :: rcfile ! Mie table file name + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: +! +! +! !REVISION HISTORY: +! +! 09Mar2005 da Silva API, prologues. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_MieTableCreate' + + type(Chem_MieTable) :: this + +! _Iam_("Chem_MieTableCreate") + + rc = 0 + + this%mietablename = rcfile + +! Note: The actual allocation is done when reading because dimensions are +! read from file + +! All done +! -------- + Chem_MieTableCreate = this + + return + + end Function Chem_MieTableCreate + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieTableDestroy --- Destruct Mie Table +! +! !INTERFACE: +! + subroutine Chem_MieTableDestroy ( this, rc ) + +! !USES: + + implicit none + +! !INPUT/OUTPUT PARAMETERS: + + type(Chem_MieTable), intent(inout) :: this + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Destructor for AOD object. +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco +! +!EOP +!------------------------------------------------------------------------- + _Iam_("Chem_MieTableDestroy") + + rc = 0 + +! Set these to invalid values +! --------------------------- + this%nlambda = -1 + this%nrh = -1 + this%nbin = -1 + this%nmom = -1 + +! Deallocate whatever has been allocated +! -------------------------------------- + if ( associated(this%lambda) ) deallocate(this%lambda, stat=rc) + VERIFY_(rc) + if ( associated(this%rh) ) deallocate(this%rh, stat=rc) + VERIFY_(rc) + if ( associated(this%reff) ) deallocate(this%reff, stat=rc) + VERIFY_(rc) + if ( associated(this%bext) ) deallocate(this%bext, stat=rc) + VERIFY_(rc) + if ( associated(this%bsca) ) deallocate(this%bsca, stat=rc) + VERIFY_(rc) + if ( associated(this%bbck) ) deallocate(this%bbck, stat=rc) + VERIFY_(rc) + if ( associated(this%g) ) deallocate(this%g, stat=rc) + VERIFY_(rc) + if ( associated(this%pmom) ) deallocate(this%pmom, stat=rc) + VERIFY_(rc) + if ( associated(this%gf) ) deallocate(this%gf, stat=rc) + VERIFY_(rc) + if ( associated(this%rhop) ) deallocate(this%rhop, stat=rc) + VERIFY_(rc) + if ( associated(this%rhod) ) deallocate(this%rhod, stat=rc) + VERIFY_(rc) + if ( associated(this%vol) ) deallocate(this%vol, stat=rc) + VERIFY_(rc) + if ( associated(this%area) ) deallocate(this%area, stat=rc) + VERIFY_(rc) + if ( associated(this%refr) ) deallocate(this%refr, stat=rc) + VERIFY_(rc) + if ( associated(this%refi) ) deallocate(this%refi, stat=rc) + VERIFY_(rc) + +end subroutine Chem_MieTableDestroy + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieTableRead --- Read and fill in the Mie table, interpolated +! to the requested channels +! +! !INTERFACE: +! + SUBROUTINE Chem_MieTableRead ( this, nch, channels, rc, nmom ) + +! !INPUT PARAMETERS: + + IMPLICIT none + TYPE(Chem_MieTable), intent(inout) :: this + integer, intent(in) :: nch ! number of channels to interpolate table to + real, intent(in) :: channels(:) ! channels to interpolate table to + integer, OPTIONAL, intent(in) :: nmom ! number of moments to keep (default=0) + integer, intent(out) :: rc ! return code + + +! !DESCRIPTION: +! +! Fills in the Mie table +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_MieTableRead' + + integer :: ncid, idimid, ivarid, n, i, j, ip1 + integer :: nch_table, nrh_table, nbin_table, nmom_table, nPol_table +! Tables are hard-wired as single precision + real*8, pointer :: channels_table(:), rh_table(:), reff_table(:,:), & + bext_table(:,:,:), bsca_table(:,:,:), & + bbck_table(:,:,:), g_table(:,:,:), & + pmom_table(:,:,:,:,:), pback_table(:,:,:,:), & + gf_table(:,:), rhop_table(:,:), rhod_table(:,:), & + vol_table(:,:), area_table(:,:), & + refr_table(:,:,:), refi_table(:,:,:) + + real :: yerr + integer :: nmom_, imom, ipol + + _Iam_("Chem_MieTableRead") + + rc = 0 + +! Whether or not doing phase function +! ----------------------------------- + if ( present(nmom) ) then + nmom_ = nmom + else + nmom_ = 0 + end if + +! Set up nPol_table for reading backscatter phase function +! This will get overwritten if pmoments is requested +! -------------------------------------------------------- + nPol_table = 6 + + +! Open the table and get the dimensions +! ------------------------------------- + rc = nf_open(this%mietablename, NF_NOWRITE, ncid) + IF ( rc /= ESMF_SUCCESS ) THEN + print *, 'nf_open '//this%mietablename//' RETURN CODE=', rc + END IF + VERIFY_(rc) + +! RH +! -- + rc = nf_inq_dimid(ncid,'rh',idimid) + VERIFY_(rc) + rc = nf_inq_dimlen(ncid,idimid,nrh_table) + VERIFY_(rc) + +! Channels +! -------- + rc = nf_inq_dimid(ncid,'lambda',idimid) + VERIFY_(rc) + rc = nf_inq_dimlen(ncid,idimid,nch_table) + VERIFY_(rc) + +! Dry Effective radius +! -------------------- + rc = nf_inq_dimid(ncid,'radius',idimid) + VERIFY_(rc) + rc = nf_inq_dimlen(ncid,idimid,nbin_table) + VERIFY_(rc) + +! Moments of phase function +! ------------------------- + if ( nmom_ > 0 ) then + rc = nf_inq_dimid(ncid,'nMom',idimid) + VERIFY_(rc) + rc = nf_inq_dimlen(ncid,idimid,nmom_table) + VERIFY_(rc) + if ( nmom_ > nmom_table ) then + rc = 99 + VERIFY_(rc) + return + end if + rc = nf_inq_dimid(ncid,'nPol',idimid) + VERIFY_(rc) + rc = nf_inq_dimlen(ncid,idimid,nPol_table) + VERIFY_(rc) + endif + + + +! Get the table contents +! ------------------------------------- +! allocate ( channels_table(nch_table), rh_table(nrh_table), & +! bext_table(nch_table,nrh_table,nbin_table), & +! bsca_table(nch_table,nrh_table,nbin_table), & +! bbck_table(nch_table,nrh_table,nbin_table), & +! g_table(nch_table,nrh_table,nbin_table), stat = rc ) + + allocate(channels_table(nch_table),stat = rc ) + VERIFY_(rc) + allocate(rh_table(nrh_table),stat = rc ) + VERIFY_(rc) + allocate(reff_table(nrh_table,nbin_table),stat = rc ) + VERIFY_(rc) + allocate(bext_table(nch_table,nrh_table,nbin_table),stat = rc ) + VERIFY_(rc) + allocate(bsca_table(nch_table,nrh_table,nbin_table),stat = rc ) + VERIFY_(rc) + allocate(bbck_table(nch_table,nrh_table,nbin_table), stat = rc ) + VERIFY_(rc) + allocate(g_table(nch_table,nrh_table,nbin_table), stat = rc ) + VERIFY_(rc) + allocate(pback_table(nch_table,nrh_table,nbin_table,nPol_table), stat = rc ) + VERIFY_(rc) + allocate(gf_table(nrh_table,nbin_table),stat = rc ) + VERIFY_(rc) + allocate(rhop_table(nrh_table,nbin_table),stat = rc ) + VERIFY_(rc) + allocate(rhod_table(nrh_table,nbin_table),stat = rc ) + VERIFY_(rc) + allocate(vol_table(nrh_table,nbin_table),stat = rc ) + VERIFY_(rc) + allocate(area_table(nrh_table,nbin_table),stat = rc ) + VERIFY_(rc) + allocate(refr_table(nch_table,nrh_table,nbin_table), stat = rc ) + VERIFY_(rc) + allocate(refi_table(nch_table,nrh_table,nbin_table), stat = rc ) + VERIFY_(rc) + + if ( nmom_ > 0 ) then + allocate(pmom_table(nch_table,nrh_table,nbin_table,nmom_table,nPol_table), stat = rc ) + VERIFY_(rc) + end if + + + rc = nf_inq_varid(ncid,'lambda',ivarid) + VERIFY_(rc) + rc = nf_get_var_double(ncid,ivarid,channels_table) + VERIFY_(rc) + rc = nf_inq_varid(ncid,'rEff',ivarid) + VERIFY_(rc) + rc = nf_get_var_double(ncid,ivarid,reff_table) + VERIFY_(rc) + rc = nf_inq_varid(ncid,'bext',ivarid) + VERIFY_(rc) + rc = nf_get_var_double(ncid,ivarid,bext_table) + VERIFY_(rc) + rc = nf_inq_varid(ncid,'bsca',ivarid) + VERIFY_(rc) + rc = nf_get_var_double(ncid,ivarid,bsca_table) + VERIFY_(rc) + rc = nf_inq_varid(ncid,'bbck',ivarid) + VERIFY_(rc) + rc = nf_get_var_double(ncid,ivarid,bbck_table) + VERIFY_(rc) + rc = nf_inq_varid(ncid,'g',ivarid) + VERIFY_(rc) + rc = nf_get_var_double(ncid,ivarid,g_table) + VERIFY_(rc) + rc = nf_inq_varid(ncid,'rh',ivarid) + VERIFY_(rc) + rc = nf_get_var_double(ncid,ivarid,rh_table) + VERIFY_(rc) + +! Get the backscatter phase function values + rc = nf_inq_varid(ncid,'pback',ivarid) + if(rc .ne. NF_NOERR) then ! pback not in table, fill in dummy variable + pback_table = 1. + else + rc = nf_get_var_double(ncid,ivarid,pback_table) + VERIFY_(rc) + endif + + if ( nmom_ > 0 ) then + rc = nf_inq_varid(ncid,'pmom',ivarid) + VERIFY_(rc) + rc = nf_get_var_double(ncid,ivarid,pmom_table) + VERIFY_(rc) + end if + +! Aerosol optical properties not necessarily stored in all versions of the tables +! ---------------------- +! Particle growth factor + rc = nf_inq_varid(ncid,'growth_factor',ivarid) + if(rc .ne. NF_NOERR) then ! not in table, fill in dummy variable + gf_table = -999. + else + rc = nf_get_var_double(ncid,ivarid,gf_table) + VERIFY_(rc) + endif + +! Wet particle density + rc = nf_inq_varid(ncid,'rhop',ivarid) + if(rc .ne. NF_NOERR) then ! not in table, fill in dummy variable + rhop_table = -999. + else + rc = nf_get_var_double(ncid,ivarid,rhop_table) + VERIFY_(rc) + endif + +! Dry particle density (will be pulled from wet particle radius) + rc = nf_inq_varid(ncid,'rhop',ivarid) + if(rc .ne. NF_NOERR) then ! not in table, fill in dummy variable + rhod_table = -999. + else + rc = nf_get_var_double(ncid,ivarid,rhod_table) + do i = 1, nrh_table + rhod_table(i,:) = rhod_table(1,:) + enddo + VERIFY_(rc) + endif + +! Wet particle real part of refractive index + rc = nf_inq_varid(ncid,'refreal',ivarid) + if(rc .ne. NF_NOERR) then ! not in table, fill in dummy variable + refr_table = -999. + else + rc = nf_get_var_double(ncid,ivarid,refr_table) + VERIFY_(rc) + endif + +! Wet particle imaginary part of refractive index (ensure positive) + rc = nf_inq_varid(ncid,'refimag',ivarid) + if(rc .ne. NF_NOERR) then ! not in table, fill in dummy variable + refi_table = -999. + else + rc = nf_get_var_double(ncid,ivarid,refi_table) + VERIFY_(rc) + refi_table = abs(refi_table) + endif + +! Wet particle volume [m3 kg-1] +! Ratio of wet to dry volume is gf^3, hence the following + vol_table = gf_table**3 / rhod_table + +! Wet particle cross sectional area [m2 kg-1] +! Assume area is volume divided by (4./3.*reff) + area_table = vol_table / (4./3.*reff_table) + +! Close the table file +! ------------------------------------- + rc = nf_close(ncid) + VERIFY_(rc) + +! Setup the table to be returned +! ------------------------------------- + this%nlambda = nch + this%nrh = nrh_table + this%nbin = nbin_table + this%nMom = nmom_ +! if ( nmom_ > 0 ) this%nPol = nPol_table + this%nPol = nPol_table + +! allocate ( this%lambda(this%nLambda), this%rh(this%nrh), & +! this%bext(this%nLambda,this%nrh,this%nbin), & +! this%bsca(this%nLambda,this%nrh,this%nbin), & +! this%bbck(this%nLambda,this%nrh,this%nbin), & +! this%g(this%nLambda,this%nrh,this%nbin), & +! stat = rc ) + + allocate (this%lambda(this%nLambda),stat = rc ) + VERIFY_(rc) + allocate (this%rh(this%nrh),stat = rc ) + VERIFY_(rc) + allocate (this%reff(this%nrh,this%nbin),stat = rc ) + VERIFY_(rc) + allocate (this%bext(this%nrh,this%nLambda,this%nbin),stat = rc ) + VERIFY_(rc) + allocate (this%bsca(this%nrh,this%nLambda,this%nbin),stat = rc ) + VERIFY_(rc) + allocate (this%bbck(this%nrh,this%nLambda,this%nbin),stat = rc ) + VERIFY_(rc) + allocate (this%g(this%nrh,this%nLambda,this%nbin), stat = rc ) + VERIFY_(rc) + allocate (this%pback(this%nrh,this%nLambda,this%nbin,this%nPol), stat = rc ) + VERIFY_(rc) + if ( nmom_ > 0 ) then + allocate (this%pmom(this%nrh,this%nLambda,this%nbin,this%nMom,this%nPol), stat = rc ) + VERIFY_(rc) + end if + allocate (this%gf(this%nrh,this%nbin), stat = rc ) + VERIFY_(rc) + allocate (this%rhop(this%nrh,this%nbin), stat = rc ) + VERIFY_(rc) + allocate (this%rhod(this%nrh,this%nbin), stat = rc ) + VERIFY_(rc) + allocate (this%vol(this%nrh,this%nbin), stat = rc ) + VERIFY_(rc) + allocate (this%area(this%nrh,this%nbin), stat = rc ) + VERIFY_(rc) + allocate (this%refr(this%nrh,this%nLambda,this%nbin),stat = rc ) + VERIFY_(rc) + allocate (this%refi(this%nrh,this%nLambda,this%nbin),stat = rc ) + VERIFY_(rc) + +! Preserve the full RH structure of the input table + this%rh(:) = rh_table(:) + +! Insert the requested channels in the output table + this%lambda(:) = channels(:) + +! Insert rEff (moist effective radius) + this%reff(:,:) = reff_table(:,:) + +! Now we linearly interpolate the input table to the output table grid +! of requested channels + do j = 1, this%nbin + do i = 1, this%nrh + do n = 1, this%nlambda + call polint(channels_table,bext_table(:,i,j),nch_table, & + this%lambda(n),this%bext(i,n,j),yerr) + call polint(channels_table,bsca_table(:,i,j),nch_table, & + this%lambda(n),this%bsca(i,n,j),yerr) + call polint(channels_table,bbck_table(:,i,j),nch_table, & + this%lambda(n),this%bbck(i,n,j),yerr) + call polint(channels_table,g_table(:,i,j),nch_table, & + this%lambda(n),this%g(i,n,j),yerr) + call polint(channels_table,refr_table(:,i,j),nch_table, & + this%lambda(n),this%refr(i,n,j),yerr) + call polint(channels_table,refi_table(:,i,j),nch_table, & + this%lambda(n),this%refi(i,n,j),yerr) + do ipol = 1, this%nPol + call polint(channels_table,pback_table(:,i,j,ipol),nch_table, & + this%lambda(n),this%pback(i,n,j,ipol),yerr) + end do + if ( nmom_ > 0 ) then + do imom = 1, this%nMom + do ipol = 1, this%nPol + call polint(channels_table,pmom_table(:,i,j,imom,ipol),nch_table, & + this%lambda(n),this%pmom(i,n,j,imom,ipol),yerr) + end do + end do + end if + enddo + enddo + enddo + +! Insert growth factor + this%gf(:,:) = gf_table(:,:) + +! Wet particle density [kg m-3] + this%rhop(:,:) = rhop_table(:,:) + +! Dry particle density [kg m-3] + this%rhod(:,:) = rhod_table(:,:) + +! Volume [m3 kg-1] + this%vol(:,:) = vol_table(:,:) + +! Area [m2 kg-1] + this%area(:,:) = area_table(:,:) + + +! Now we do a mapping of the RH from the input table to some high +! resolution representation. This is to spare us the need to +! do a full-up interpolation later on. +! RH input from the table is scaled 0 - 0.99 +! We resolve the map to 0 - 0.990 in steps of 0.001 (991 total steps) + do j = 1, 991 + do i = this%nrh, 1, -1 + if( (j-1) .ge. int(this%rh(i)*1000)) then + ip1 = i + 1 + this%rhi(j) = i + if(ip1 .gt. this%nrh) then + this%rha(j) = 0. + else + this%rha(j) = ( (j-1)/1000. - this%rh(i)) & + / ( this%rh(ip1)- this%rh(i)) + endif + exit + endif + enddo +! print *, j, this%rhi(j), this%rha(j), this%rh(this%rhi(j)) + enddo + +! deallocate (channels_table, rh_table, bext_table, bsca_table, & +! bbck_table, g_table, stat = rc ) + + deallocate (channels_table, stat = rc ) + VERIFY_(rc) + deallocate (rh_table, stat = rc ) + VERIFY_(rc) + deallocate (reff_table, stat = rc ) + VERIFY_(rc) + deallocate (bext_table, stat = rc ) + VERIFY_(rc) + deallocate (bsca_table, stat = rc ) + VERIFY_(rc) + deallocate (bbck_table, stat = rc ) + VERIFY_(rc) + deallocate (g_table, stat = rc ) + VERIFY_(rc) + deallocate (pback_table, stat = rc ) + VERIFY_(rc) + if ( nmom_ > 0 ) then + deallocate (pmom_table, stat = rc ) + VERIFY_(rc) + endif + deallocate (gf_table, stat = rc ) + VERIFY_(rc) + deallocate (rhop_table, stat = rc ) + VERIFY_(rc) + deallocate (rhod_table, stat = rc ) + VERIFY_(rc) + deallocate (vol_table, stat = rc ) + VERIFY_(rc) + deallocate (area_table, stat = rc ) + VERIFY_(rc) + deallocate (refr_table, stat = rc ) + VERIFY_(rc) + deallocate (refi_table, stat = rc ) + VERIFY_(rc) + +return + +contains + + subroutine polint(x,y,n,xWant,yWant,yErr) + integer :: n +! recall, table hard-wired single precision + real*8 :: x(n),y(n) + real :: xWant, yWant, yErr + +! given array x(n) of independent variables and array y(n) of dependent +! variables, compute the linear interpolated result yWant at xWant and return +! with a dummy error estimate yErr. Hacked up from Numerical Recipes Chapter 3 + + integer :: i, j + real :: dx, slope + character(len=255) :: msg + +! on out of bounds, set i to lower or upper limit + i = 0 + if(xWant .lt. x(1)) then + write(msg,*) "in polint, wanted: ", xWant, ", got lower bound: ", x(1) + call warn(myname,msg) + i = 1 + endif + if(xWant .gt. x(n)) then + write(msg,*) "in polint, wanted: ", xWant, ", got upper bound: ", x(n) + call warn(myname,msg) + i = n + endif + +! if i is still zero find i less than xWant + if(i .eq. 0) then + do j = 1, n + if(xWant .ge. x(j)) i = j + enddo + endif + +! slope + if(i .eq. n) then + slope = 0. + else + slope = (y(i+1)-y(i)) / (x(i+1)-x(i)) + endif + dx = xWant - x(i) + yWant = y(i) + slope*dx + + yErr = 0. + + return + end subroutine polint + +END SUBROUTINE Chem_MieTableRead + +!................................................................ + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieTableGetDims --- Return size of tables. +! +! !INTERFACE: +! + SUBROUTINE Chem_MieTableGetDims ( mieTableName, nch_table, nrh_table, & + nbin_table, nmom_table, nPol_table, rc ) + +! !INPUT PARAMETERS: + + IMPLICIT none + character(len=*), intent(in) :: MieTableName ! table file name + integer, intent(out) :: nch_table, nrh_table, nbin_table, nmom_table, nPol_table + integer, intent(out) :: rc ! return code + + +! !DESCRIPTION: +! +! Returns the size of the MieTables. It assumes all takes are the same size, +! so it returns the size based on dust. +! +! !REVISION HISTORY: +! +! 165jun2010 da Silva/Buchard +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_MieTableRead' + + integer :: ncid, idimid + + _Iam_("Chem_MieTableGetDims") + + rc = 0 + +! Open the table and get the dimensions +! ------------------------------------- + rc = nf_open(mietablename, NF_NOWRITE, ncid) + VERIFY_(rc) + +! RH +! -- + rc = nf_inq_dimid(ncid,'rh',idimid) + VERIFY_(rc) + rc = nf_inq_dimlen(ncid,idimid,nrh_table) + VERIFY_(rc) + +! Channels +! -------- + rc = nf_inq_dimid(ncid,'lambda',idimid) + VERIFY_(rc) + rc = nf_inq_dimlen(ncid,idimid,nch_table) + VERIFY_(rc) + +! Effective radius +! ---------------- + rc = nf_inq_dimid(ncid,'radius',idimid) + VERIFY_(rc) + rc = nf_inq_dimlen(ncid,idimid,nbin_table) + VERIFY_(rc) + +! Moments of phase function +! ------------------------- + rc = nf_inq_dimid(ncid,'nMom',idimid) + if ( rc /= 0 ) then + nMom_table = 0 + nPol_table = 0 + rc = 0 + else + rc = nf_inq_dimlen(ncid,idimid,nmom_table) + VERIFY_(rc) + rc = nf_inq_dimid(ncid,'nPol',idimid) + VERIFY_(rc) + rc = nf_inq_dimlen(ncid,idimid,nPol_table) + VERIFY_(rc) + end if + + END SUBROUTINE Chem_MieTableGetDims + + end module Chem_MieTableMod + diff --git a/ESMF/Shared/Chem_Base/Chem_Mod.F90 b/ESMF/Shared/Chem_Base/Chem_Mod.F90 new file mode 100644 index 00000000..de34918a --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_Mod.F90 @@ -0,0 +1,39 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_Mod --- Chemistry Base Class +! +! !INTERFACE: +! + + module Chem_Mod + +! !USES: + + use Chem_RegistryMod + use Chem_ArrayMod + use Chem_BundleMod + use Chem_aodMod + implicit NONE + + PUBLIC ! All of the above + +! +! !DESCRIPTION: +! +! This module implements a base class for the GMAO Chemistry class. This +! initial class is intended to serve as a stop gap before an ESMF +! implementation is adopted. +! +! +! !REVISION HISTORY: +! +! 04May2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + end module Chem_Mod + diff --git a/ESMF/Shared/Chem_Base/Chem_Registry.rc b/ESMF/Shared/Chem_Base/Chem_Registry.rc new file mode 100755 index 00000000..a292651b --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_Registry.rc @@ -0,0 +1,638 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# Beginning with Heracles-1_0, four TR tracers are enabled in the +# default configuration. For the complete list of TR tracers, see +# Chem_MieRegistry.rc. +# +# StratChem can be run with Full or Reduced equation sets. +# When running Full, the string SC_f should be changed to SC. +# When running Reduced, the string SC_r should be changed to SC. +# This will be automatically done by stratchem_setup script. +# +# XX lists contain non-transported species for GMI and StratChem. +# When running GMI, the string XX_GMI should be changed to XX. +# When running StratChem, the string XX_SC should be changed to XX. +# This will be automatically done by the setup scripts. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to 'mol mol-1' +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + # &Label Active Constituents + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: yes # &YesNo Include carbon monoxide? +doing_CO2: yes # &YesNo Include carbon dioxide? +doing_DU: yes # &YesNo Include mineral dust? +doing_SS: yes # &YesNo Include sea salt? +doing_SU: yes # &YesNo Include sulfates? +doing_CFC: yes # &YesNo Include CFCs? +doing_BC: yes # &YesNo Include black carbon? +doing_OC: yes # &YesNo Include organic carbon? +doing_BRC: no # &YesNo Include brown carbon? +doing_NI: yes # &YesNo Include nitrate? +doing_Rn: no # &YesNo include Radon? +doing_CH4: no # &YesNo include Methane? +doing_SC: no # &YesNo Include stratospheric chemistry? +doing_GMI: no # &YesNo GMI chemistry (GEOS-5) +doing_XX: no # &YesNo generic tracer +doing_PC: yes # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: yes # &YesNo run passive tracers? + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 10 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC_f: 52 # stratospheric chemistry (full) +nbins_XX_SC_f: 18 # stratchem (full) non-transported species +nbins_SC_r: 33 # stratospheric chemistry (reduced) +nbins_XX_SC_r: 37 # stratchem (reduced) non-transported species +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_XX_GMI: 48 # generic tracer +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 4 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Carbon Monoxide (All Sources) +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide (All Sources) +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +OCphobicbbbo 'kg kg-1' Hydrophobic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphilicbbbo 'kg kg-1' Hydrophilic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphobicbbnb 'kg kg-1' Hydrophobic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +OCphilicbbnb 'kg kg-1' Hydrophilic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 cm-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +H 'mol mol-1' Ground state atomic hydrogen (2S) +MO2 'mol mol-1' Methylperoxy radical (CH3O2) +N 'mol mol-1' Ground state atomic nitrogen +O 'mol mol-1' Ground state atomic oxygen (3P) +O1D 'mol mol-1' First excited singlet state of atomic oxygen (1D) +A3O2 'mol mol-1' Primary RO2 (C3H7O2) from propane +ATO2 'mol mol-1' RO2 from acetone (C3H6O3) +B3O2 'mol mol-1' Secondary RO2 (C3H7O2) from propane +EOH 'mol mol-1' Ethanol +ETO2 'mol mol-1' Ethylperoxy radical (C2H5O2) +GLYC 'mol mol-1' Glycolaldehyde (Hydroxyacetaldehyde C2H4O2) +GLYX 'mol mol-1' Glyoxal (2CHO) +IAO2 'mol mol-1' RO2 (C5H9O5) from isoprene oxidation products +INO2 'mol mol-1' RO2 (C5H8O3N) from ISOP+NO3 +INPN 'mol mol-1' Peroxide (C5H8O6N2) from INO2 +ISN1 'mol mol-1' RO2 (C4H7O4N) from ISN2 +ISNP 'mol mol-1' Peroxide (C4H7O4N) from ISN1 +KO2 'mol mol-1' RO2 (C4H7O3) from C3 ketones +MAN2 'mol mol-1' RO2 (C4H6O6N) from MACR+NO3 +MAO3 'mol mol-1' Peroxyacyl (C4H5O3) from MACR and MVK +MAOP 'mol mol-1' Peroxide (C4H6O3) from MAO3 +MAP 'mol mol-1' Peroxyacetic acid (C2H4O3) +MCO3 'mol mol-1' Peroxyacetyl radical (C2H3O3) +MGLY 'mol mol-1' Methylglyoxal (C3H4O2) +MRO2 'mol mol-1' RO2 (C4H7O4) from MACR+OH +MRP 'mol mol-1' Peroxide (C4H8O4) from MRO2 +PO2 'mol mol-1' RO2 (C3H7O3) from propene +PP 'mol mol-1' Peroxide (C3H8O3) from PO2 +PRN1 'mol mol-1' RO2 (C3H6O3N) from propene+NO3 +PRPN 'mol mol-1' Peroxide (C3H6O3N) from PRN1 +R4N1 'mol mol-1' RO2 (C4H9O3N) from R4N2 +R4O2 'mol mol-1' RO2 (C4H9O2) from ALK4 +R4P 'mol mol-1' Peroxide (C4H10O2) from R4O2 +RA3P 'mol mol-1' Peroxy propyl alcohol (C3H8O2) from A3O2 +RB3P 'mol mol-1' Peroxide (C3H8O2) from B3O2 +RCO3 'mol mol-1' Peroxypropionyl radical (C3H5O3) +RIO1 'mol mol-1' RO2 (C5H9O3) from isoprene oxydation products +RIO2 'mol mol-1' RO2 (C5H9O3) from isoprene +RIP 'mol mol-1' Peroxide (C5H10O3) from RIO2 +ROH 'mol mol-1' C2 alcohols +RP 'mol mol-1' Methacrolein peroxy acid (C4H6O3) +VRO2 'mol mol-1' RO2 (C4H7O4) from MVK+OH +VRP 'mol mol-1' Peroxide (C4H8O4) from VRO2 +OCSg 'mol mol-1' Carbonyl sulfide in GMI +ACET 'mol mol-1' Acetone +O2 cm-3 Molecular oxygen +NUMDENS cm-3 Total number density +T2M15d K Daily T2M time average +:: + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant burden 90 day tracer +Rn222 'kg kg-1' Radon-222 +CH3I 'mol mol-1' Methyl iodide +Pb210 'kg kg-1' Lead-210 +nh_5 'mol mol-1' Northern Hemisphere 5 day tracer +nh_50 'mol mol-1' Northern Hemisphere 50 day tracer +aoa_nh days Age of air northern hemisphere tracer +st80_25 'mol mol-1' Stratospheric source 25 day tracer +CO_25 'mol mol-1' Anthro CO 25 day tracer +CO_50 'mol mol-1' Anthro CO 50 day tracer +CO_50_ea 'mol mol-1' Anthro CO 50 day tracer East Asia +CO_50_na 'mol mol-1' Anthro CO 50 day tracer North America +CO_50_eu 'mol mol-1' Anthro CO 50 day tracer Europe +CO_50_sa 'mol mol-1' Anthro CO 50 day tracer South Asia +SF6 'mol mol-1' Sulfur Hexafluoride tracer +e90_n 'mol mol-1' Constant burden 90 day tracer 40N-pole emiss +e90_s 'mol mol-1' Constant burden 90 day tracer 40S-pole emiss +Be7 'kg kg-1' Beryllium radionuclide 7(Be) +Be10 'kg kg-1' Beryllium radionuclide 10(Be) +Be7s 'kg kg-1' Beryllium radionuclide 7(Be) strat-source +Be10s 'kg kg-1' Beryllium radionuclide 10(Be) strat-source +Pb210s 'kg kg-1' Lead-210 strat-source +CO_GLB 'mol mol-1' CO 50 day tracer Global CMIP6+M2G +CO_NAM 'mol mol-1' CO 50 day tracer North America CMIP6+M2G +CO_EUR 'mol mol-1' CO 50 day tracer Europe CMIP6+M2G +CO_SAS 'mol mol-1' CO 50 day tracer South Asia CMIP6+M2G +CO_EAS 'mol mol-1' CO 50 day tracer East Asia CMIP6+M2G +CO_SEA 'mol mol-1' CO 50 day tracer Southeast Asia CMIP6+M2G +CO_ANZ 'mol mol-1' CO 50 day tracer Australia & New Zealand CMIP6+M2G +CO_NAF 'mol mol-1' CO 50 day tracer North Africa CMIP6+M2G +CO_RAF 'mol mol-1' CO 50 day tracer Rest of Africa CMIP6+M2G +CO_MDE 'mol mol-1' CO 50 day tracer Middle East CMIP6+M2G +CO_CAM 'mol mol-1' CO 50 day tracer Central America CMIP6+M2G +CO_SAM 'mol mol-1' CO 50 day tracer South America CMIP6+M2G +CO_RBU 'mol mol-1' CO 50 day tracer Russia & Belarus & Ukraine CMIP6+M2G +CO_CAS 'mol mol-1' CO 50 day tracer Central Asia CMIP6+M2G +CO_ARC 'mol mol-1' CO 50 day tracer Arctic CMIP6+M2G +CO_from_CH4 'mol mol-1' CO from global average CH4 oxidation +stOX 'mol mol-1' Strat Ozone with chemical loss +aoa_bl days Age of air above boundary layer +:: + + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers + diff --git a/ESMF/Shared/Chem_Base/Chem_RegistryMod---stub.F90 b/ESMF/Shared/Chem_Base/Chem_RegistryMod---stub.F90 new file mode 100644 index 00000000..aabefd5c --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_RegistryMod---stub.F90 @@ -0,0 +1,641 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_RegistryMod --- Chemistry Registry Class (Stub Version) +! +! !INTERFACE: +! + + module Chem_RegistryMod + +! !USES: + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC Chem_Registry ! Keeps track of which constituents are active, + ! to become internal state of Grid Component + +! +! !PUBLIIC MEMBER FUNCTIONS: +! + PUBLIC Chem_RegistryCreate ! Constructor from RC file + PUBLIC Chem_RegistryDestroy ! Destructor + PUBLIC Chem_RegistryPrint ! Prints a summary of the Chemistry registry + + PUBLIC Chem_RegistrySetIsGOCART ! Whether variable belongs to GOCART + +! +! !DESCRIPTION: +! +! This module implements a registry for (chemical) constituents. +! This initial class is intended to serve as a stop gap before an ESMF +! implementation is adopted. +! +! +! !REVISION HISTORY: +! +! 21Oct2009 da Silva Derived from real Chem_Registry for use at NCEP. +! +!EOP +!------------------------------------------------------------------------- + + integer, parameter :: nch = 255 + +! Registry +! -------- + type Chem_Registry + + integer :: nq ! Total number of tracers + +! Fixed Tracers +! ------------- + logical :: doing_H2O = .true. ! water vapor + logical :: doing_O3 = .true. ! ozone + + character(len=nch) :: units_H2O = 'kg/kg' + character(len=nch) :: units_O3 = 'ppmv' + + integer :: n_H2O = 1, i_H2O = 1, j_H2O = 1 + integer :: n_O3 = 1, i_O3 = 2, j_O3 = 2 + +! Floating Tracers +! ---------------- + logical :: doing_CO ! carbon monoxide + logical :: doing_CO2 ! carbon dioxide + logical :: doing_DU ! mineral dust + logical :: doing_SS ! sea salt + logical :: doing_SU ! sulfates + logical :: doing_CFC ! CFCs + logical :: doing_BC ! black carbon + logical :: doing_OC ! organic carbon + logical :: doing_BRC ! brown carbon + logical :: doing_Rn ! radon + logical :: doing_CH4 ! Methane + logical :: doing_SC ! stratospheric chemistry + logical :: doing_XX ! ancillary data + logical :: doing_AC ! auto chem + logical :: doing_PC ! Parameterized Chemistry (GEOS-5) + logical :: doing_GMI ! GMI Chemistry (GEOS-5) + logical :: doing_OCS ! ACHEM chemistry (OCS) + logical :: doing_NI ! Nitrate + logical :: doing_TR ! passive tracers + +! Number of bins and tracer index ranges for each constituent: +! n_TT - number of bins for tracer TT (n_TT = j_TT - i_TT + 1) +! i_TT - first index for tracer TT +! j_TT - last index for tracer TT +! ----------------------------------------------------------- + integer :: n_CO, i_CO, j_CO ! carbon monoxide + integer :: n_CO2,i_CO2,j_CO2 ! carbon dioxide + integer :: n_DU, i_DU, j_DU ! mineral dust + integer :: n_SS, i_SS, j_SS ! sea salt + integer :: n_SU, i_SU, j_SU ! sulfates + integer :: n_CFC,i_CFC,j_CFC ! CFCs + integer :: n_BC, i_BC, j_BC ! black carbon + integer :: n_OC, i_OC, j_OC ! organic carbon + integer :: n_BRC, i_BRC, j_BRC ! brown carbon + integer :: n_Rn, i_Rn, j_Rn ! radon + integer :: n_CH4,i_CH4,j_CH4 ! Methane + integer :: n_SC, i_SC, j_SC ! stratospheric chemistry + integer :: n_XX, i_XX, j_XX ! ancillary data + integer :: n_AC, i_AC, j_AC ! auto chem + integer :: n_PC, i_PC, j_PC ! parameterized chemistry (GEOS-5) + integer :: n_GMI, i_GMI, j_GMI ! GMI chemistry (GEOS-5) + integer :: n_OCS, i_OCS, j_OCS ! OCS chemistry (ACHEM) + integer :: n_NI, i_NI, j_NI ! Nitrate + integer :: n_TR, i_TR, j_TR ! passive tracers + +! GEOS-5 Short-hands: all combined tracers from CO to OC +! ------------------------------------------------------ + logical :: doing_GOCART + integer :: n_GOCART, i_GOCART, j_GOCART + +! Tracer units +! ------------ + character(len=nch) :: units_CO ! carbon monoxide + character(len=nch) :: units_CO2 ! carbon dioxide + character(len=nch) :: units_DU ! mineral dust + character(len=nch) :: units_SS ! sea salt + character(len=nch) :: units_SU ! sulfates + character(len=nch) :: units_CFC ! CFCs + character(len=nch) :: units_BC ! black carbon + character(len=nch) :: units_OC ! organic carbon + character(len=nch) :: units_BRC ! brown carbon + character(len=nch) :: units_Rn ! radon + character(len=nch) :: units_CH4 ! Methane + character(len=nch) :: units_SC ! stratospheric chemistry + character(len=nch) :: units_XX ! ancillary data + character(len=nch) :: units_AC ! auto chem + character(len=nch) :: units_PC ! parameterized chemistry (GEOS-5) + character(len=nch) :: units_GMI ! GMI chemistry (GEOS-5) + character(len=nch) :: units_OCS ! OCS chemistry (ACHEM) + character(len=nch) :: units_NI ! Nitrate + character(len=nch) :: units_TR ! passive tracers + +! CF Style metadata +! ----------------- + character(len=nch), pointer :: vname(:) ! (nq), variable short name + character(len=nch), pointer :: vtitle(:) ! (nq), variable long name + character(len=nch), pointer :: vunits(:) ! (nq), variable units + +! Tracer transport properties +! --------------------------- +!!! logical, pointer :: advect(:) ! (nq), whether to advect it +!!! logical, pointer :: diffuse(:) ! (nq), whether to diffuse it +! Set (or not) from component resource files + real, pointer :: fscav(:) ! (nq), scavenging coefficient + real, pointer :: rhop(:) ! (nq), dry particle mass density [kg m-3] + real, pointer :: molwght(:) ! (nq), molecular weight [kg mole-1] + real, pointer :: rlow(:) ! (nq), lower edge of particle size bin [m] + real, pointer :: rup(:) ! (nq), upper edge of particle size bin [m] + real, pointer :: rmed(:) ! (nq), particle bin number median radius [m] + real, pointer :: sigma(:) ! (nq), particle lognormal width + real, pointer :: fNum(:) ! (nq), ratio of particle number to mass + + end type Chem_Registry + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_RegistryCreate --- Construct Chemistry Registry +! +! !INTERFACE: +! + + Function Chem_RegistryCreate ( rc, rcfile ) + + implicit none + type(Chem_Registry) Chem_RegistryCreate + +! !USES: + +! !INPUT PARAMETERS: + + character(len=*), OPTIONAL :: rcfile ! Resource file name; default is + ! 'Chem_Registry.rc' + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Disable all tracers. +! +! +! !REVISION HISTORY: +! +! 21Oct2009 da Silva Derived from real Chem_Registry for use at NCEP. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_RegistryCreate' + + type(Chem_Registry) :: this + character(len=255) :: rcfilen + integer :: nq, ios, ier, n + logical, allocatable :: isGOCART(:) + + rc = 0 + +! Defaults +! -------- + nq = 0 + +! ------------------------------------------------------ +! Parse resource file to see which tracers are on +! defines doing_xx, and n_xx for each tracer +! ------------------------------------------------------ + call parserc_ ( 'H2O', this%doing_H2O, this%n_H2O, this%units_H2O ) + call parserc_ ( 'O3', this%doing_O3, this%n_O3, this%units_O3 ) + call parserc_ ( 'CO', this%doing_CO, this%n_CO, this%units_CO ) + call parserc_ ( 'CO2', this%doing_CO2, this%n_CO2, this%units_CO2 ) + call parserc_ ( 'DU', this%doing_DU, this%n_DU, this%units_DU ) + call parserc_ ( 'SS', this%doing_SS, this%n_SS, this%units_SS ) + call parserc_ ( 'SU', this%doing_SU, this%n_SU, this%units_SU ) + call parserc_ ( 'CFC', this%doing_CFC, this%n_CFC, this%units_CFC ) + call parserc_ ( 'BC', this%doing_BC, this%n_BC, this%units_BC ) + call parserc_ ( 'OC', this%doing_OC, this%n_OC, this%units_OC ) + call parserc_ ( 'BRC', this%doing_BRC, this%n_BRC, this%units_BRC ) + call parserc_ ( 'Rn', this%doing_Rn, this%n_Rn, this%units_Rn ) + call parserc_ ( 'CH4', this%doing_CH4, this%n_CH4, this%units_CH4 ) + call parserc_ ( 'SC', this%doing_SC, this%n_SC, this%units_SC ) + call parserc_ ( 'GMI', this%doing_GMI, this%n_GMI, this%units_GMI ) + call parserc_ ( 'XX', this%doing_XX, this%n_XX, this%units_XX ) + call parserc_ ( 'AC', this%doing_AC, this%n_AC, this%units_AC ) + call parserc_ ( 'PC', this%doing_PC, this%n_PC, this%units_PC ) + call parserc_ ( 'OCS', this%doing_OCS, this%n_OCS, this%units_OCS ) + call parserc_ ( 'NI', this%doing_NI, this%n_NI, this%units_NI ) + call parserc_ ( 'TR', this%doing_TR, this%n_TR, this%units_TR ) + +! Set internal indices +! -------------------- + call setidx_ ( this%doing_H2O, this%n_H2O, this%i_H2O, this%j_H2O ) + call setidx_ ( this%doing_O3, this%n_O3, this%i_O3, this%j_O3 ) + call setidx_ ( this%doing_CO, this%n_CO, this%i_CO, this%j_CO ) + call setidx_ ( this%doing_CO2, this%n_CO2, this%i_CO2, this%j_CO2 ) + call setidx_ ( this%doing_DU, this%n_DU, this%i_DU, this%j_DU ) + call setidx_ ( this%doing_SS, this%n_SS, this%i_SS, this%j_SS ) + call setidx_ ( this%doing_SU, this%n_SU, this%i_SU, this%j_SU ) + call setidx_ ( this%doing_CFC, this%n_CFC, this%i_CFC, this%j_CFC ) + call setidx_ ( this%doing_BC, this%n_BC, this%i_BC, this%j_BC ) + call setidx_ ( this%doing_OC, this%n_OC, this%i_OC, this%j_OC ) + call setidx_ ( this%doing_BRC, this%n_BRC, this%i_BRC, this%j_BRC ) + call setidx_ ( this%doing_Rn, this%n_Rn, this%i_Rn, this%j_Rn ) + call setidx_ ( this%doing_CH4, this%n_CH4, this%i_CH4, this%j_CH4 ) + call setidx_ ( this%doing_SC, this%n_SC, this%i_SC, this%j_SC ) + call setidx_ ( this%doing_GMI, this%n_GMI, this%i_GMI, this%j_GMI ) + call setidx_ ( this%doing_XX, this%n_XX, this%i_XX, this%j_XX ) + call setidx_ ( this%doing_AC, this%n_AC, this%i_AC, this%j_AC ) + call setidx_ ( this%doing_PC, this%n_PC, this%i_PC, this%j_PC ) + call setidx_ ( this%doing_OCS, this%n_OCS, this%i_OCS, this%j_OCS ) + call setidx_ ( this%doing_NI, this%n_NI, this%i_NI, this%j_NI ) + call setidx_ ( this%doing_TR, this%n_TR, this%i_TR, this%j_TR ) + +! Allocate memory in registry +! --------------------------- + this%nq = nq + allocate ( this%vname(nq), this%vtitle(nq), this%vunits(nq), & + this%fscav(nq), this%rhop(nq), this%molwght(nq), & + this%rlow(nq), this%rup(nq), this%rmed(nq), & + this%sigma(nq), this%fNum(nq), stat=ios ) + if ( ios /= 0 ) then + rc = 2 + return + end if + + this%fscav = 0.0 ! no scavanging by default + this%rhop = -1. ! default + this%molwght = -1. ! default + this%rlow = -1. ! default + this%rup = -1. ! default + this%rmed = -1. ! default + this%sigma = -1. ! default + this%fNum = -1. ! default + +! Fill in CF metadata +! ------------------- + call setmeta_ ( this%doing_H2O, 'q ', 'Specific Humidity', & + this%units_H2O, this%i_H2O, this%j_H2O ) + call setmeta_ ( this%doing_O3, 'o3', 'Ozone Mixing Ratio', & + this%units_O3, this%i_O3, this%j_O3 ) + call setmeta_ ( this%doing_CO, 'CO', 'Carbon Monoxide Mixing Ratio', & + this%units_CO, this%i_CO, this%j_CO ) + call setmeta_ ( this%doing_CO2, 'CO2', 'Carbon Dioxide Mixing Ratio', & + this%units_CO2, this%i_CO2, this%j_CO2 ) + call setmeta_ ( this%doing_DU, 'du', 'Dust Mixing Ratio', & + this%units_DU, this%i_DU, this%j_DU ) + call setmeta_ ( this%doing_SS, 'ss', 'Sea Salt Mixing Ratio', & + this%units_SS, this%i_SS, this%j_SS ) + call setmeta_ ( this%doing_SU, 'su', 'Surfates Mixing Ratio', & + this%units_SU, this%i_SU, this%j_SU ) + call setmeta_ ( this%doing_CFC, 'CFC', 'CFC-12 (CCl2F2) Mixing Ratio', & + this%units_CFC, this%i_CFC, this%j_CFC ) + call setmeta_ ( this%doing_BC, 'bc', 'Black Carbon Mixing Ratio', & + this%units_BC, this%i_BC, this%j_BC ) + call setmeta_ ( this%doing_OC, 'oc', 'Organic Carbon Mixing Ratio', & + this%units_OC, this%i_OC, this%j_OC ) + call setmeta_ ( this%doing_BRC, 'brc', 'Brown Carbon Mixing Ratio', & + this%units_BRC, this%i_BRC, this%j_BRC ) + call setmeta_ ( this%doing_Rn, 'Rn', 'Radon Mixing Ratio', & + this%units_Rn, this%i_Rn, this%j_Rn ) + call setmeta_ ( this%doing_CH4, 'CH4', 'Methane Mixing Ratio', & + this%units_CH4, this%i_CH4, this%j_CH4 ) + call setmeta_ ( this%doing_SC, 'sc', 'Stratosperic Chemistry Species', & + this%units_SC, this%i_SC, this%j_SC ) + call setmeta_ ( this%doing_GMI, 'GMI', 'GMI Chemistry', & + this%units_GMI, this%i_GMI, this%j_GMI ) + call setmeta_ ( this%doing_XX, 'xx', 'Ancillary Data', & + this%units_XX, this%i_XX, this%j_XX ) + call setmeta_ ( this%doing_AC, 'ac', 'Auto Chemistry Species', & + this%units_AC, this%i_AC, this%j_AC ) + call setmeta_ ( this%doing_PC, 'pc', 'Parameterized Chemistry', & + this%units_PC, this%i_PC, this%j_PC ) + call setmeta_ ( this%doing_OCS, 'ocs', 'Carbonyl Sulfide', & + this%units_OCS, this%i_OCS, this%j_OCS ) + call setmeta_ ( this%doing_NI, 'ni', 'Nitrate', & + this%units_NI, this%i_NI, this%j_NI ) + call setmeta_ ( this%doing_TR, 'TR', 'Passive Tracers', & + this%units_TR, this%i_TR, this%j_TR ) + +! Set indices for the GOCART family: from CO to OC +! ------------------------------------------------ + allocate ( isGOCART(nq), stat=ios ) + if ( ios /= 0 ) then + rc = 3 + return + end if + call Chem_RegistrySetIsGOCART ( this, isGOCART, nq ) + if ( any(isGOCART) ) then + this%doing_GOCART = .true. + do n = 1, nq + if ( isGOCART(n) ) then + this%i_GOCART = n + exit + end if + end do + do n = nq, 1, -1 + if ( isGOCART(n) ) then + this%j_GOCART = n + exit + end if + end do + this%n_GOCART = this%j_GOCART - this%i_GOCART + 1 + else + this%doing_GOCART = .false. + this%n_GOCART = 0 + this%i_GOCART = -1 + this%j_GOCART = -2 + end if + deallocate ( isGOCART ) + +! All done +! -------- + Chem_RegistryCreate = this + + return + +! ----------------------------- +! Internal Constructor Routines +! ----------------------------- + + CONTAINS + + subroutine parserc_ ( name, doing_it, n_tt, units ) ! parses rc file +! ------------------- + character(len=*), intent(in) :: name + logical, intent(out) :: doing_it + integer, intent(out) :: n_tt ! number of bins for tracer + character(len=*), intent(out) :: units + + character(len=255) :: answer + integer ier + +! Defaults +! -------- + doing_it = .false. + n_tt = -1 + units = 'unknown' + + end subroutine parserc_ + + + subroutine setidx_ ( doing_it, n_tt, i_tt, j_tt ) ! set tracer indices +! ------------------ + logical, intent(in) :: doing_it + integer, intent(in) :: n_tt ! number of bins for tracer + integer, intent(out) :: i_tt ! first tracer index + integer, intent(out) :: j_tt ! last tracer index + i_tt = -1 + j_tt = -2 + end subroutine setidx_ + + + subroutine setmeta_ ( doing_it, vname, vtitle, vunits, i_tt, j_tt ) +! ------------------- + logical, intent(in) :: doing_it + character(len=*), intent(in) :: vname, vtitle, vunits + integer, intent(in) :: i_tt, j_tt + integer i, nbins, ibin, ier, n + character(len=3) :: cbin + character(len=255) :: token + character(len=255) :: uvname + + return + + end subroutine setmeta_ + + end Function Chem_RegistryCreate + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_RegistryDestroy --- Destruct Chemisty Registry +! +! !INTERFACE: +! + subroutine Chem_RegistryDestroy ( this, rc ) + +! !USES: + + implicit none + +! !INPUT/OUTPUT PARAMETERS: + + type(Chem_Registry), intent(inout) :: this + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Destructor for Chemistry Registry object. +! +! !REVISION HISTORY: +! +! 22Jul2003 da Silva First crack. +! 03Sep2004 da Silva Added stratospheric chemistry hooks. +! +!EOP +!------------------------------------------------------------------------- + integer ios + + rc = 0 + this%nq = -1 + this%doing_H2O = .false. + this%doing_O3 = .false. + this%doing_CO = .false. ! carbon monoxide + this%doing_CO2 = .false. ! carbon dioxide + this%doing_DU = .false. ! mineral dust + this%doing_SS = .false. ! sea salt + this%doing_SU = .false. ! sulfates + this%doing_CFC = .false. ! CFCs + this%doing_BC = .false. ! black carbon + this%doing_OC = .false. ! organic carbon + this%doing_BRC = .false. ! brown carbon + this%doing_Rn = .false. ! radon + this%doing_CH4 = .false. ! Methane + this%doing_SC = .false. ! stratospheric chemistry + this%doing_AC = .false. ! stratospheric chemistry + this%doing_XX = .false. ! ancillary data + this%doing_PC = .false. ! parameterized chemistry (GEOS-5) + this%doing_OCS = .false. ! ACHEM chemistry (OCS) + this%doing_NI = .false. ! Nitrate + this%doing_GMI = .false. ! GMI chemistry (GEOS-5) + this%doing_TR = .false. ! passive tracers + deallocate ( this%vname, this%vtitle, this%vunits, this%fscav, & + this%rhop, this%molwght, this%rlow, this%rup, this%rmed, & + this%sigma, this%fNum, stat=ios ) + if ( ios /= 0 ) then + rc = 1 + return + end if + +end subroutine Chem_RegistryDestroy + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_RegistryPrint --- Print summary of Chemistry Registry +! +! !INTERFACE: +! + SUBROUTINE Chem_RegistryPrint( reg ) + +! !USES: + +! !INPUT PARAMETERS: + + IMPLICIT none + TYPE(Chem_Registry) :: reg + +! !OUTPUT PARAMETERS: + + +! !DESCRIPTION: +! +! Prints summary of Chemistry Registry +! +! !REVISION HISTORY: +! +! 22Jul2003 da Silva First crack. +! 9Dec2004 Nielsen Enhancements. +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER (LEN=255) :: ActiveList + + PRINT * + PRINT *,'--------------------------------------------------------' + PRINT *,'| Summary of the Chemistry Registry |' + PRINT *,'| from Chem_RegistryPrint |' + PRINT *,'--------------------------------------------------------' + WRITE(*,FMT="(' ',' Number of species: ',I3)") reg%nq + + ActiveList = ' ' + IF ( reg%doing_H2O ) ActiveList = TRIM(ActiveList)//' H2O' + IF ( reg%doing_O3 ) ActiveList = TRIM(ActiveList)//' O3' + IF ( reg%doing_CO ) ActiveList = TRIM(ActiveList)//' CO' + IF ( reg%doing_CO2 ) ActiveList = TRIM(ActiveList)//' CO2' + IF ( reg%doing_DU ) ActiveList = TRIM(ActiveList)//' DU' + IF ( reg%doing_SS ) ActiveList = TRIM(ActiveList)//' SS' + IF ( reg%doing_SU ) ActiveList = TRIM(ActiveList)//' SU' + IF ( reg%doing_CFC ) ActiveList = TRIM(ActiveList)//' CFC' + IF ( reg%doing_BC ) ActiveList = TRIM(ActiveList)//' BC' + IF ( reg%doing_BRC ) ActiveList = TRIM(ActiveList)//' BRC' + IF ( reg%doing_OC ) ActiveList = TRIM(ActiveList)//' OC' + IF ( reg%doing_Rn ) ActiveList = TRIM(ActiveList)//' Rn' + IF ( reg%doing_CH4 ) ActiveList = TRIM(ActiveList)//' CH4' + IF ( reg%doing_SC ) ActiveList = TRIM(ActiveList)//' SC' + IF ( reg%doing_GMI ) ActiveList = TRIM(ActiveList)//' GMI' + IF ( reg%doing_AC ) ActiveList = TRIM(ActiveList)//' AC' + IF ( reg%doing_XX ) ActiveList = TRIM(ActiveList)//' XX' + IF ( reg%doing_PC ) ActiveList = TRIM(ActiveList)//' PC' + IF ( reg%doing_OCS ) ActiveList = TRIM(ActiveList)//' OCS' + IF ( reg%doing_NI ) ActiveList = TRIM(ActiveList)//' NI' + IF ( reg%doing_TR ) ActiveList = TRIM(ActiveList)//' TR' + + PRINT * + PRINT *, 'Active chemistry components:',TRIM(ActiveList) + + IF ( reg%doing_H2O ) CALL reg_prt_( 'H2O', reg%n_H2O, reg%i_H2O, reg%j_H2O ) + IF ( reg%doing_O3 ) CALL reg_prt_( 'O3', reg%n_O3, reg%i_O3, reg%j_O3 ) + IF ( reg%doing_CO ) CALL reg_prt_( 'CO', reg%n_CO, reg%i_CO, reg%j_CO ) + IF ( reg%doing_CO2 ) CALL reg_prt_( 'CO2', reg%n_CO2, reg%i_CO2, reg%j_CO2 ) + IF ( reg%doing_DU ) CALL reg_prt_( 'DU', reg%n_DU, reg%i_DU, reg%j_DU ) + IF ( reg%doing_SS ) CALL reg_prt_( 'SS', reg%n_SS, reg%i_SS, reg%j_SS ) + IF ( reg%doing_SU ) CALL reg_prt_( 'SU', reg%n_SU, reg%i_SU, reg%j_SU ) + IF ( reg%doing_CFC ) CALL reg_prt_( 'CFC', reg%n_CFC, reg%i_CFC, reg%j_CFC ) + IF ( reg%doing_BC ) CALL reg_prt_( 'BC', reg%n_BC, reg%i_BC, reg%j_BC ) + IF ( reg%doing_OC ) CALL reg_prt_( 'OC', reg%n_OC, reg%i_OC, reg%j_OC ) + IF ( reg%doing_BRC ) CALL reg_prt_( 'BRC', reg%n_BRC, reg%i_BRC, reg%j_BRC ) + IF ( reg%doing_Rn ) CALL reg_prt_( 'Rn', reg%n_Rn, reg%i_Rn, reg%j_Rn ) + IF ( reg%doing_CH4 ) CALL reg_prt_( 'CH4', reg%n_CH4, reg%i_CH4, reg%j_CH4 ) + IF ( reg%doing_SC ) CALL reg_prt_( 'SC', reg%n_SC, reg%i_SC, reg%j_SC ) + IF ( reg%doing_GMI ) CALL reg_prt_( 'GMI', reg%n_GMI, reg%i_GMI, reg%j_GMI ) + IF ( reg%doing_AC ) CALL reg_prt_( 'AC', reg%n_AC, reg%i_AC, reg%j_AC ) + IF ( reg%doing_XX ) CALL reg_prt_( 'XX', reg%n_XX, reg%i_XX, reg%j_XX ) + IF ( reg%doing_PC ) CALL reg_prt_( 'PC', reg%n_PC, reg%i_PC, reg%j_PC ) + IF ( reg%doing_OCS ) CALL reg_prt_( 'OCS', reg%n_OCS, reg%i_OCS, reg%j_OCS ) + IF ( reg%doing_NI ) CALL reg_prt_( 'NI', reg%n_NI, reg%i_NI, reg%j_NI ) + IF ( reg%doing_TR ) CALL reg_prt_( 'TR', reg%n_TR, reg%i_TR, reg%j_TR ) + + IF ( reg%doing_GOCART ) & + CALL reg_prt_( 'GOCART is a COMPOSITE and', & + reg%n_GOCART, reg%i_GOCART, reg%j_GOCART ) + + PRINT * + +! PRINT *,'----- End of the summary of the Chemistry Registry -----' +! PRINT * + + 101 FORMAT(/,' Number of species: ',I3) + + RETURN + + CONTAINS + + SUBROUTINE reg_prt_ ( compName, n, i1, i2 ) + + IMPLICIT none + CHARACTER(LEN=*), INTENT(IN) :: compName + INTEGER, INTENT(IN) :: n, i1, i2 + INTEGER :: i + CHARACTER(LEN=7) :: string + + string = 'species' + IF( n == 1 ) string='specie ' + + WRITE(*,101) TRIM(compName),n,string + DO i = i1, i2 + WRITE(*,201) i,TRIM(reg%vname(i)),TRIM(reg%vunits(i)),TRIM(reg%vtitle(i)) + END DO + + 101 FORMAT(/,' Component ',A,' has ',I3,' ',A7,/, & + ' No ',2X,' Name ',2X,' Units ',2X,'Description',/, & + ' ---',2X,'--------',2X,'----------',2X,'-----------') + 201 FORMAT(' ',I3,2X,A8,2X,A10,2X,A) + + END SUBROUTINE reg_prt_ + +END SUBROUTINE Chem_RegistryPrint + + subroutine Chem_RegistrySetIsGOCART ( chemReg, isGOCART, nq ) + type(Chem_registry), intent(in) :: chemReg + integer, intent(in) :: nq ! total number of tracers in registry + logical, intent(out) :: isGOCART(nq) + ! ----- + isGOCART = .false. + if ( chemReg%doing_O3 ) isGOCART(chemReg%i_O3 :chemReg%j_O3) = .true. + if ( chemReg%doing_CO ) isGOCART(chemReg%i_CO :chemReg%j_CO) = .true. + if ( chemReg%doing_CO2 ) isGOCART(chemReg%i_CO2:chemReg%j_CO2) = .true. + if ( chemReg%doing_DU ) isGOCART(chemReg%i_DU :chemReg%j_DU) = .true. + if ( chemReg%doing_SS ) isGOCART(chemReg%i_SS :chemReg%j_SS) = .true. + if ( chemReg%doing_BC ) isGOCART(chemReg%i_BC :chemReg%j_BC) = .true. + if ( chemReg%doing_OC ) isGOCART(chemReg%i_OC :chemReg%j_OC) = .true. + if ( chemReg%doing_BRC ) isGOCART(chemReg%i_BRC :chemReg%j_BRC) = .true. + if ( chemReg%doing_SU ) isGOCART(chemReg%i_SU :chemReg%j_SU) = .true. + if ( chemReg%doing_CFC ) isGOCART(chemReg%i_CFC:chemReg%j_CFC) = .true. + if ( chemReg%doing_Rn ) isGOCART(chemReg%i_Rn :chemReg%j_Rn) = .true. + if ( chemReg%doing_CH4 ) isGOCART(chemReg%i_CH4:chemReg%j_CH4) = .true. + if ( chemReg%doing_NI ) isGOCART(chemReg%i_NI :chemReg%j_NI) = .true. + end subroutine Chem_RegistrySetIsGOCART + + end module Chem_RegistryMod + diff --git a/ESMF/Shared/Chem_Base/Chem_RegistryMod.F90 b/ESMF/Shared/Chem_Base/Chem_RegistryMod.F90 new file mode 100644 index 00000000..6f8330d3 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_RegistryMod.F90 @@ -0,0 +1,773 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_RegistryMod --- Chemistry Registry Class +! +! !INTERFACE: +! + + module Chem_RegistryMod + +! !USES: + + use m_inpak90 ! resource file management (MPEU) + use m_die, only: die, warn + use m_chars, only : uppercase + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + PUBLIC Chem_Registry ! Keeps track of which constituents are active, + ! to become internal state of Grid Component + +! +! !PUBLIIC MEMBER FUNCTIONS: +! + PUBLIC Chem_RegistryCreate ! Constructor from RC file + PUBLIC Chem_RegistryDestroy ! Destructor + PUBLIC Chem_RegistryPrint ! Prints a summary of the Chemistry registry + + PUBLIC Chem_RegistrySetIsGOCART ! Whether variable belongs to GOCART + +! +! !DESCRIPTION: +! +! This module implements a registry for (chemical) constituents. +! This initial class is intended to serve as a stop gap before an ESMF +! implementation is adopted. +! +! +! !REVISION HISTORY: +! +! 04May2003 da Silva First crack. +! 03Sep2004 da Silva Added stratospheric chemistry hooks. +! 4Oct2004 Nielsen Added stratospheric species' names. +! 9Dec2004 Nielsen Added Chem_RegistryPrint. +! 29Mar2005 da Silva H2O/O3 can now be turned off +! 25Jul2005 da Silva In preparation for GEOS-5: +! - Added PC and GMI families +! - removed concept of fixed tracers +! 29Jun2016 Nielsen Nullified creation of pc001 in vname list +! +!EOP +!------------------------------------------------------------------------- + + integer, parameter :: nch = 255 + +! Registry +! -------- + type Chem_Registry + + integer :: nq ! Total number of tracers + +! Fixed Tracers +! ------------- + logical :: doing_H2O = .true. ! water vapor + logical :: doing_O3 = .true. ! ozone + + character(len=nch) :: units_H2O = 'kg/kg' + character(len=nch) :: units_O3 = 'ppmv' + + integer :: n_H2O = 1, i_H2O = 1, j_H2O = 1 + integer :: n_O3 = 1, i_O3 = 2, j_O3 = 2 + +! Floating Tracers +! ---------------- + logical :: doing_CO ! carbon monoxide + logical :: doing_CO2 ! carbon dioxide + logical :: doing_DU ! mineral dust + logical :: doing_SS ! sea salt + logical :: doing_SU ! sulfates + logical :: doing_CFC ! CFCs + logical :: doing_BC ! black carbon + logical :: doing_OC ! organic carbon + logical :: doing_BRC ! brown carbon + logical :: doing_Rn ! radon + logical :: doing_CH4 ! Methane + logical :: doing_SC ! stratospheric chemistry + logical :: doing_XX ! ancillary data + logical :: doing_PC ! Parameterized Chemistry (GEOS-5) + logical :: doing_GMI ! GMI Chemistry (GEOS-5) + logical :: doing_OCS ! ACHEM chemistry (OCS) + logical :: doing_NI ! Nitrate + logical :: doing_TR ! passive tracers + +! Number of bins and tracer index ranges for each constituent: +! n_TT - number of bins for tracer TT (n_TT = j_TT - i_TT + 1) +! i_TT - first index for tracer TT +! j_TT - last index for tracer TT +! ----------------------------------------------------------- + integer :: n_CO, i_CO, j_CO ! carbon monoxide + integer :: n_CO2,i_CO2,j_CO2 ! carbon dioxide + integer :: n_DU, i_DU, j_DU ! mineral dust + integer :: n_SS, i_SS, j_SS ! sea salt + integer :: n_SU, i_SU, j_SU ! sulfates + integer :: n_CFC,i_CFC,j_CFC ! CFCs + integer :: n_BC, i_BC, j_BC ! black carbon + integer :: n_OC, i_OC, j_OC ! organic carbon + integer :: n_BRC, i_BRC, j_BRC ! brown carbon + integer :: n_Rn, i_Rn, j_Rn ! radon + integer :: n_CH4,i_CH4,j_CH4 ! Methane + integer :: n_SC, i_SC, j_SC ! stratospheric chemistry + integer :: n_XX, i_XX, j_XX ! ancillary data + integer :: n_PC, i_PC, j_PC ! parameterized chemistry (GEOS-5) + integer :: n_GMI, i_GMI, j_GMI ! GMI chemistry (GEOS-5) + integer :: n_OCS, i_OCS, j_OCS ! OCS chemistry (ACHEM) + integer :: n_NI, i_NI, j_NI ! Nitrate + integer :: n_TR, i_TR, j_TR ! passive tracers + +! GEOS-5 Short-hands: all combined tracers from CO to OC +! ------------------------------------------------------ + logical :: doing_GOCART + integer :: n_GOCART, i_GOCART, j_GOCART + +! Tracer units +! ------------ + character(len=nch) :: units_CO ! carbon monoxide + character(len=nch) :: units_CO2 ! carbon dioxide + character(len=nch) :: units_DU ! mineral dust + character(len=nch) :: units_SS ! sea salt + character(len=nch) :: units_SU ! sulfates + character(len=nch) :: units_CFC ! CFCs + character(len=nch) :: units_BC ! black carbon + character(len=nch) :: units_OC ! organic carbon + character(len=nch) :: units_BRC ! brown carbon + character(len=nch) :: units_Rn ! radon + character(len=nch) :: units_CH4 ! Methane + character(len=nch) :: units_SC ! stratospheric chemistry + character(len=nch) :: units_XX ! ancillary data + character(len=nch) :: units_PC ! parameterized chemistry (GEOS-5) + character(len=nch) :: units_GMI ! GMI chemistry (GEOS-5) + character(len=nch) :: units_OCS ! OCS chemistry (ACHEM) + character(len=nch) :: units_NI ! Nitrate + character(len=nch) :: units_TR ! passive tracers + +! CF Style metadata +! ----------------- + character(len=nch), pointer :: vname(:) ! (nq), variable short name + character(len=nch), pointer :: vtitle(:) ! (nq), variable long name + character(len=nch), pointer :: vunits(:) ! (nq), variable units + +! Tracer transport properties +! --------------------------- +!!! logical, pointer :: advect(:) ! (nq), whether to advect it +!!! logical, pointer :: diffuse(:) ! (nq), whether to diffuse it +! Set (or not) from component resource files + real, pointer :: fscav(:) ! (nq), scavenging coefficient + real, pointer :: rhop(:) ! (nq), dry particle mass density [kg m-3] + real, pointer :: molwght(:) ! (nq), molecular weight [kg mole-1] + real, pointer :: rlow(:) ! (nq), lower edge of particle size bin [m] + real, pointer :: rup(:) ! (nq), upper edge of particle size bin [m] + real, pointer :: rmed(:) ! (nq), particle bin number median radius [m] + real, pointer :: sigma(:) ! (nq), particle lognormal width + real, pointer :: fNum(:) ! (nq), ratio of particle number to mass + + real, pointer :: Hcts(:,:) ! (4,nq), four Henrys Law Cts + + + end type Chem_Registry + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_RegistryCreate --- Construct Chemistry Registry +! +! !INTERFACE: +! + + Function Chem_RegistryCreate ( rc, rcfile ) + + implicit none + type(Chem_Registry) Chem_RegistryCreate + +! !USES: + +! !INPUT PARAMETERS: + + character(len=*), OPTIONAL :: rcfile ! Resource file name; default is + ! 'Chem_Registry.rc' + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: +! +! +! !REVISION HISTORY: +! +! 22Jul2003 da Silva First crack. +! 03Sep2004 da Silva Added stratospheric chemistry hooks. +! 4Oct2004 Nielsen Added stratospheric species' names. +! 19Oct2005 da Silva Added CO2 +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_RegistryCreate' + + type(Chem_Registry) :: this + character(len=255) :: rcfilen + integer :: nq, ios, ier, n + logical, allocatable :: isGOCART(:) + + rc = 0 + +! Defaults +! -------- + nq = 0 + +! ------------------------------------------------------ +! Parse resource file to see which tracers are on +! defines doing_xx, and n_xx for each tracer +! ------------------------------------------------------ + if ( present(rcfile) ) then + rcfilen = trim(rcfile) + else + rcfilen = 'Chem_Registry.rc' + end if + call i90_loadf ( rcfilen, ier ) + if ( ier .ne. 0 ) call die(myname, 'could not read rc file '// & + trim(rcfile) ) + call parserc_ ( 'H2O', this%doing_H2O, this%n_H2O, this%units_H2O ) + call parserc_ ( 'O3', this%doing_O3, this%n_O3, this%units_O3 ) + call parserc_ ( 'CO', this%doing_CO, this%n_CO, this%units_CO ) + call parserc_ ( 'CO2', this%doing_CO2, this%n_CO2, this%units_CO2 ) + call parserc_ ( 'DU', this%doing_DU, this%n_DU, this%units_DU ) + call parserc_ ( 'SS', this%doing_SS, this%n_SS, this%units_SS ) + call parserc_ ( 'SU', this%doing_SU, this%n_SU, this%units_SU ) + call parserc_ ( 'CFC', this%doing_CFC, this%n_CFC, this%units_CFC ) + call parserc_ ( 'BC', this%doing_BC, this%n_BC, this%units_BC ) + call parserc_ ( 'OC', this%doing_OC, this%n_OC, this%units_OC ) + call parserc_ ( 'BRC', this%doing_BRC, this%n_BRC, this%units_BRC ) + call parserc_ ( 'Rn', this%doing_Rn, this%n_Rn, this%units_Rn ) + call parserc_ ( 'CH4', this%doing_CH4, this%n_CH4, this%units_CH4 ) + call parserc_ ( 'NI', this%doing_NI, this%n_NI, this%units_NI ) + call parserc_ ( 'SC', this%doing_SC, this%n_SC, this%units_SC ) + call parserc_ ( 'GMI', this%doing_GMI, this%n_GMI, this%units_GMI ) + call parserc_ ( 'XX', this%doing_XX, this%n_XX, this%units_XX ) + call parserc_ ( 'PC', this%doing_PC, this%n_PC, this%units_PC ) + call parserc_ ( 'OCS', this%doing_OCS, this%n_OCS, this%units_OCS ) + call parserc_ ( 'TR', this%doing_TR, this%n_TR, this%units_TR ) + +! Set internal indices +! -------------------- + call setidx_ ( this%doing_H2O, this%n_H2O, this%i_H2O, this%j_H2O ) + call setidx_ ( this%doing_O3, this%n_O3, this%i_O3, this%j_O3 ) + call setidx_ ( this%doing_CO, this%n_CO, this%i_CO, this%j_CO ) + call setidx_ ( this%doing_CO2, this%n_CO2, this%i_CO2, this%j_CO2 ) + call setidx_ ( this%doing_DU, this%n_DU, this%i_DU, this%j_DU ) + call setidx_ ( this%doing_SS, this%n_SS, this%i_SS, this%j_SS ) + call setidx_ ( this%doing_SU, this%n_SU, this%i_SU, this%j_SU ) + call setidx_ ( this%doing_CFC, this%n_CFC, this%i_CFC, this%j_CFC ) + call setidx_ ( this%doing_BC, this%n_BC, this%i_BC, this%j_BC ) + call setidx_ ( this%doing_OC, this%n_OC, this%i_OC, this%j_OC ) + call setidx_ ( this%doing_BRC, this%n_BRC, this%i_BRC, this%j_BRC ) + call setidx_ ( this%doing_Rn, this%n_Rn, this%i_Rn, this%j_Rn ) + call setidx_ ( this%doing_CH4, this%n_CH4, this%i_CH4, this%j_CH4 ) + call setidx_ ( this%doing_NI, this%n_NI, this%i_NI, this%j_NI ) + call setidx_ ( this%doing_SC, this%n_SC, this%i_SC, this%j_SC ) + call setidx_ ( this%doing_GMI, this%n_GMI, this%i_GMI, this%j_GMI ) + call setidx_ ( this%doing_XX, this%n_XX, this%i_XX, this%j_XX ) +! call setidx_ ( this%doing_PC, this%n_PC, this%i_PC, this%j_PC ) + call setidx_ ( this%doing_OCS, this%n_OCS, this%i_OCS, this%j_OCS ) + call setidx_ ( this%doing_TR, this%n_TR, this%i_TR, this%j_TR ) + +! Allocate memory in registry +! --------------------------- + this%nq = nq + allocate ( this%vname(nq), this%vtitle(nq), this%vunits(nq), & + this%fscav(nq), this%rhop(nq), this%molwght(nq), & + this%rlow(nq), this%rup(nq), this%rmed(nq), & + this%sigma(nq), this%fNum(nq), this%Hcts(4,nq), stat=ios ) + if ( ios /= 0 ) then + rc = 2 + return + end if + + this%fscav = 0.0 ! no scavanging by default + this%rhop = -1. ! default + this%molwght = -1. ! default + this%rlow = -1. ! default + this%rup = -1. ! default + this%rmed = -1. ! default + this%sigma = -1. ! default + this%fNum = -1. ! default + this%Hcts(:,:) = -1 ! default + +! Fill in CF metadata +! ------------------- + call setmeta_ ( this%doing_H2O, 'q ', 'Specific Humidity', & + this%units_H2O, this%i_H2O, this%j_H2O ) + call setmeta_ ( this%doing_O3, 'o3', 'Ozone Mixing Ratio', & + this%units_O3, this%i_O3, this%j_O3 ) + call setmeta_ ( this%doing_CO, 'CO', 'Carbon Monoxide Mixing Ratio', & + this%units_CO, this%i_CO, this%j_CO ) + call setmeta_ ( this%doing_CO2, 'CO2', 'Carbon Dioxide Mixing Ratio', & + this%units_CO2, this%i_CO2, this%j_CO2 ) + call setmeta_ ( this%doing_DU, 'du', 'Dust Mixing Ratio', & + this%units_DU, this%i_DU, this%j_DU ) + call setmeta_ ( this%doing_SS, 'ss', 'Sea Salt Mixing Ratio', & + this%units_SS, this%i_SS, this%j_SS ) + call setmeta_ ( this%doing_SU, 'su', 'Surfates Mixing Ratio', & + this%units_SU, this%i_SU, this%j_SU ) + call setmeta_ ( this%doing_CFC, 'CFC', 'CFC-12 (CCl2F2) Mixing Ratio', & + this%units_CFC, this%i_CFC, this%j_CFC ) + call setmeta_ ( this%doing_BC, 'bc', 'Black Carbon Mixing Ratio', & + this%units_BC, this%i_BC, this%j_BC ) + call setmeta_ ( this%doing_OC, 'oc', 'Organic Carbon Mixing Ratio', & + this%units_OC, this%i_OC, this%j_OC ) + call setmeta_ ( this%doing_BRC, 'brc', 'Brown Carbon Mixing Ratio', & + this%units_BRC, this%i_BRC, this%j_BRC ) + call setmeta_ ( this%doing_Rn, 'Rn', 'Radon Mixing Ratio', & + this%units_Rn, this%i_Rn, this%j_Rn ) + call setmeta_ ( this%doing_CH4, 'CH4', 'Methane Mixing Ratio', & + this%units_CH4, this%i_CH4, this%j_CH4 ) + call setmeta_ ( this%doing_NI, 'ni', 'Nitrate', & + this%units_NI, this%i_NI, this%j_NI ) + call setmeta_ ( this%doing_SC, 'sc', 'Stratosperic Chemistry Species', & + this%units_SC, this%i_SC, this%j_SC ) + call setmeta_ ( this%doing_GMI, 'GMI', 'GMI Chemistry', & + this%units_GMI, this%i_GMI, this%j_GMI ) + call setmeta_ ( this%doing_XX, 'xx', 'Ancillary Data', & + this%units_XX, this%i_XX, this%j_XX ) +! call setmeta_ ( this%doing_PC, 'pc', 'Parameterized Chemistry', & +! this%units_PC, this%i_PC, this%j_PC ) + call setmeta_ ( this%doing_OCS, 'ocs', 'Carbonyl Sulfide', & + this%units_OCS, this%i_OCS, this%j_OCS ) + call setmeta_ ( this%doing_TR, 'TR', 'Passive Tracers', & + this%units_TR, this%i_TR, this%j_TR ) + + call I90_Release() + +! Set indices for the GOCART family: from CO to OC +! ------------------------------------------------ + allocate ( isGOCART(nq), stat=ios ) + if ( ios /= 0 ) then + rc = 3 + return + end if + call Chem_RegistrySetIsGOCART ( this, isGOCART, nq ) + if ( any(isGOCART) ) then + this%doing_GOCART = .true. + do n = 1, nq + if ( isGOCART(n) ) then + this%i_GOCART = n + exit + end if + end do + do n = nq, 1, -1 + if ( isGOCART(n) ) then + this%j_GOCART = n + exit + end if + end do + this%n_GOCART = this%j_GOCART - this%i_GOCART + 1 + if (.not. ALL(isGOCART(this%i_GOCART:this%j_GOCART))) then + call die(myname, 'ERROR: non-GOCART entry found in the GOCART block') + end if + else + this%doing_GOCART = .false. + this%n_GOCART = 0 + this%i_GOCART = -1 + this%j_GOCART = -2 + end if + deallocate ( isGOCART ) + +! All done +! -------- + Chem_RegistryCreate = this + + return + +! ----------------------------- +! Internal Constructor Routines +! ----------------------------- + + CONTAINS + + subroutine parserc_ ( name, doing_it, n_tt, units ) ! parses rc file +! ------------------- + character(len=*), intent(in) :: name + logical, intent(out) :: doing_it + integer, intent(out) :: n_tt ! number of bins for tracer + character(len=*), intent(out) :: units + + character(len=255) :: answer + integer ier + +! Defaults +! -------- + doing_it = .false. + n_tt = -1 + units = 'unknown' + +! Determine whether to activate tracer +! ------------------------------------ + call i90_label ( 'doing_'//trim(name)//':', ier ) + if ( ier .eq. 0 ) then + call i90_gtoken ( answer, ier ) + if ( ier .eq. 0 ) then + if ( answer(1:1) .eq. 'y' .or. answer(1:1) .eq. 'Y' ) & + doing_it = .true. + end if + end if + + if ( .not. doing_it ) return + +! How many bins do we have? +! ------------------------- + call i90_label ( 'nbins_'//trim(name)//':', ier ) + if ( ier .eq. 0 ) then + n_tt = i90_gint ( ier ) + end if + if ( ier .ne. 0 ) then + call die ( myname, 'cannot determine NBINS for '//trim(name) ) + end if + + if ( n_tt < 1 ) then + call warn ( myname, 'less than 1 BIN for '//trim(name)// & + ' (OK in GEOS-5)' ) + end if + +! Units +! ----- + call i90_label ( 'units_'//trim(name)//':', ier ) + if ( ier .eq. 0 ) then + call i90_gtoken ( answer, ier ) + if ( ier .eq. 0 ) then + units = trim(answer) + end if + end if + if ( ier .ne. 0 ) then + call die ( myname, 'cannot determine UNITS for '//trim(name) ) + end if + + end subroutine parserc_ + + + subroutine setidx_ ( doing_it, n_tt, i_tt, j_tt ) ! set tracer indices +! ------------------ + logical, intent(in) :: doing_it + integer, intent(in) :: n_tt ! number of bins for tracer + integer, intent(out) :: i_tt ! first tracer index + integer, intent(out) :: j_tt ! last tracer index + if ( doing_it .and. n_tt > 0 ) then + i_tt = nq + 1 + j_tt = nq + n_tt + nq = nq + n_tt + else + i_tt = -1 + j_tt = -2 + end if + end subroutine setidx_ + + + subroutine setmeta_ ( doing_it, vname, vtitle, vunits, i_tt, j_tt ) +! ------------------- + logical, intent(in) :: doing_it + character(len=*), intent(in) :: vname, vtitle, vunits + integer, intent(in) :: i_tt, j_tt + integer i, nbins, ibin, ier, n + character(len=3) :: cbin + character(len=255) :: token + character(len=255) :: uvname + + +! This is too restrictive, since it assumes that the first +! specie name is identical to the name of the grid component. +! ----------------------------------------------------------- + if ( .not. doing_it .or. i_tt < 0 ) return + + nbins = j_tt - i_tt + 1 +! if ( nbins == 1 .and. trim(vname) /= 'xx' ) then +! this%vname(i_tt) = trim(vname) +! this%vtitle(i_tt) = trim(vtitle) +! this%vunits(i_tt) = trim(vunits) +! else + +! When a species (or bins) name table exists, extract the short names, +! the long names, and the units. Assume short name and the units are +! one token each. + +! n = len_trim(vname) !When Arlindo gets back we'll fix this. +! uvname(1:n) = ( .upper. vname ) +! token='variable_table_'//TRIM(uvname(1:n))//'::' + + token='variable_table_'//TRIM(uppercase(vname))//'::' + CALL I90_Label( TRIM(token), ier ) + +! Parse variable name table from resource file if it exists +! --------------------------------------------------------- +RealNames: IF( ier .EQ. 0 ) THEN + + DO i = i_tt, j_tt + CALL I90_GLine( ier ) + CALL I90_Gtoken ( token, ier ) + IF( TRIM(token) == '::' ) THEN + CALL die( myname, & + 'Not enough names in chemistry registry file for ' & + //TRIM(vname)) + END IF + this%vname(i) = TRIM(token) + CALL I90_Gtoken ( token, ier ) + this%vunits(i) = TRIM(token) + CALL I90_Gtoken ( token, ier ) + this%vtitle(i) = TRIM(token) + DO + CALL I90_Gtoken ( token, ier ) + IF ( ier .NE. 0 ) EXIT + this%vtitle(i) = TRIM(this%vtitle(i))//" "//TRIM(token) + END DO + END DO + + ELSE + +! Create default names using bin numbers +! -------------------------------------- + ibin = 0 + do i = i_tt, j_tt + ibin = ibin + 1 + write(cbin,'(i3.3)') ibin + this%vname(i) = trim(vname)//cbin + this%vtitle(i) = trim(vtitle)//' (bin '//cbin//')' + this%vunits(i) = trim(vunits) + end do + + END IF RealNames + +! end if + + end subroutine setmeta_ + + end Function Chem_RegistryCreate + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_RegistryDestroy --- Destruct Chemisty Registry +! +! !INTERFACE: +! + subroutine Chem_RegistryDestroy ( this, rc ) + +! !USES: + + implicit none + +! !INPUT/OUTPUT PARAMETERS: + + type(Chem_Registry), intent(inout) :: this + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Destructor for Chemistry Registry object. +! +! !REVISION HISTORY: +! +! 22Jul2003 da Silva First crack. +! 03Sep2004 da Silva Added stratospheric chemistry hooks. +! +!EOP +!------------------------------------------------------------------------- + integer ios + + rc = 0 + this%nq = -1 + this%doing_H2O = .false. + this%doing_O3 = .false. + this%doing_CO = .false. ! carbon monoxide + this%doing_CO2 = .false. ! carbon dioxide + this%doing_DU = .false. ! mineral dust + this%doing_SS = .false. ! sea salt + this%doing_SU = .false. ! sulfates + this%doing_CFC = .false. ! CFCs + this%doing_BC = .false. ! black carbon + this%doing_OC = .false. ! organic carbon + this%doing_BRC = .false. ! brown carbon + this%doing_Rn = .false. ! radon + this%doing_CH4 = .false. ! Methane + this%doing_SC = .false. ! stratospheric chemistry + this%doing_XX = .false. ! ancillary data + this%doing_PC = .false. ! parameterized chemistry (GEOS-5) + this%doing_OCS = .false. ! ACHEM chemistry (OCS) + this%doing_NI = .false. ! Nitrate + this%doing_GMI = .false. ! GMI chemistry (GEOS-5) + this%doing_TR = .false. ! passive tracers + deallocate ( this%vname, this%vtitle, this%vunits, this%fscav, & + this%rhop, this%molwght, this%rlow, this%rup, this%rmed, & + this%sigma, this%fNum, this%Hcts, stat=ios ) + + if ( ios /= 0 ) then + rc = 1 + return + end if + +end subroutine Chem_RegistryDestroy + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_RegistryPrint --- Print summary of Chemistry Registry +! +! !INTERFACE: +! + SUBROUTINE Chem_RegistryPrint( reg ) + +! !USES: + +! !INPUT PARAMETERS: + + IMPLICIT none + TYPE(Chem_Registry) :: reg + +! !OUTPUT PARAMETERS: + + +! !DESCRIPTION: +! +! Prints summary of Chemistry Registry +! +! !REVISION HISTORY: +! +! 22Jul2003 da Silva First crack. +! 9Dec2004 Nielsen Enhancements. +! +!EOP +!------------------------------------------------------------------------- + + CHARACTER (LEN=255) :: ActiveList + + PRINT * + PRINT *,'--------------------------------------------------------' + PRINT *,'| Summary of the Chemistry Registry |' + PRINT *,'| from Chem_RegistryPrint |' + PRINT *,'--------------------------------------------------------' + WRITE(*,FMT="(' ',' Number of species: ',I3)") reg%nq + + ActiveList = ' ' + IF ( reg%doing_H2O ) ActiveList = TRIM(ActiveList)//' H2O' + IF ( reg%doing_O3 ) ActiveList = TRIM(ActiveList)//' O3' + IF ( reg%doing_CO ) ActiveList = TRIM(ActiveList)//' CO' + IF ( reg%doing_CO2 ) ActiveList = TRIM(ActiveList)//' CO2' + IF ( reg%doing_DU ) ActiveList = TRIM(ActiveList)//' DU' + IF ( reg%doing_SS ) ActiveList = TRIM(ActiveList)//' SS' + IF ( reg%doing_SU ) ActiveList = TRIM(ActiveList)//' SU' + IF ( reg%doing_CFC ) ActiveList = TRIM(ActiveList)//' CFC' + IF ( reg%doing_BC ) ActiveList = TRIM(ActiveList)//' BC' + IF ( reg%doing_OC ) ActiveList = TRIM(ActiveList)//' OC' + IF ( reg%doing_BRC ) ActiveList = TRIM(ActiveList)//' BRC' + IF ( reg%doing_Rn ) ActiveList = TRIM(ActiveList)//' Rn' + IF ( reg%doing_CH4 ) ActiveList = TRIM(ActiveList)//' CH4' + IF ( reg%doing_NI ) ActiveList = TRIM(ActiveList)//' NI' + IF ( reg%doing_SC ) ActiveList = TRIM(ActiveList)//' SC' + IF ( reg%doing_GMI ) ActiveList = TRIM(ActiveList)//' GMI' + IF ( reg%doing_XX ) ActiveList = TRIM(ActiveList)//' XX' + IF ( reg%doing_PC ) ActiveList = TRIM(ActiveList)//' PC' + IF ( reg%doing_OCS ) ActiveList = TRIM(ActiveList)//' OCS' + IF ( reg%doing_TR ) ActiveList = TRIM(ActiveList)//' TR' + + PRINT * + PRINT *, 'Active chemistry components:',TRIM(ActiveList) + + IF ( reg%doing_H2O ) CALL reg_prt_( 'H2O', reg%n_H2O, reg%i_H2O, reg%j_H2O ) + IF ( reg%doing_O3 ) CALL reg_prt_( 'O3', reg%n_O3, reg%i_O3, reg%j_O3 ) + IF ( reg%doing_CO ) CALL reg_prt_( 'CO', reg%n_CO, reg%i_CO, reg%j_CO ) + IF ( reg%doing_CO2 ) CALL reg_prt_( 'CO2', reg%n_CO2, reg%i_CO2, reg%j_CO2 ) + IF ( reg%doing_DU ) CALL reg_prt_( 'DU', reg%n_DU, reg%i_DU, reg%j_DU ) + IF ( reg%doing_SS ) CALL reg_prt_( 'SS', reg%n_SS, reg%i_SS, reg%j_SS ) + IF ( reg%doing_SU ) CALL reg_prt_( 'SU', reg%n_SU, reg%i_SU, reg%j_SU ) + IF ( reg%doing_CFC ) CALL reg_prt_( 'CFC', reg%n_CFC, reg%i_CFC, reg%j_CFC ) + IF ( reg%doing_BC ) CALL reg_prt_( 'BC', reg%n_BC, reg%i_BC, reg%j_BC ) + IF ( reg%doing_OC ) CALL reg_prt_( 'OC', reg%n_OC, reg%i_OC, reg%j_OC ) + IF ( reg%doing_BRC ) CALL reg_prt_( 'BRC', reg%n_BRC, reg%i_BRC, reg%j_BRC ) + IF ( reg%doing_Rn ) CALL reg_prt_( 'Rn', reg%n_Rn, reg%i_Rn, reg%j_Rn ) + IF ( reg%doing_CH4 ) CALL reg_prt_( 'CH4', reg%n_CH4, reg%i_CH4, reg%j_CH4 ) + IF ( reg%doing_NI ) CALL reg_prt_( 'NI', reg%n_NI, reg%i_NI, reg%j_NI ) + IF ( reg%doing_SC ) CALL reg_prt_( 'SC', reg%n_SC, reg%i_SC, reg%j_SC ) + IF ( reg%doing_GMI ) CALL reg_prt_( 'GMI', reg%n_GMI, reg%i_GMI, reg%j_GMI ) + IF ( reg%doing_XX ) CALL reg_prt_( 'XX', reg%n_XX, reg%i_XX, reg%j_XX ) +! IF ( reg%doing_PC ) CALL reg_prt_( 'PC', reg%n_PC, reg%i_PC, reg%j_PC ) + IF ( reg%doing_OCS ) CALL reg_prt_( 'OCS', reg%n_OCS, reg%i_OCS, reg%j_OCS ) + IF ( reg%doing_TR ) CALL reg_prt_( 'TR', reg%n_TR, reg%i_TR, reg%j_TR ) + + IF ( reg%doing_GOCART ) & + CALL reg_prt_( 'GOCART is a COMPOSITE and', & + reg%n_GOCART, reg%i_GOCART, reg%j_GOCART ) + + PRINT * + +! PRINT *,'----- End of the summary of the Chemistry Registry -----' +! PRINT * + + 101 FORMAT(/,' Number of species: ',I3) + + RETURN + + CONTAINS + + SUBROUTINE reg_prt_ ( compName, n, i1, i2 ) + + IMPLICIT none + CHARACTER(LEN=*), INTENT(IN) :: compName + INTEGER, INTENT(IN) :: n, i1, i2 + INTEGER :: i + CHARACTER(LEN=7) :: string + + string = 'species' + IF( n == 1 ) string='specie ' + + WRITE(*,101) TRIM(compName),n,string + DO i = i1, i2 + WRITE(*,201) i,TRIM(reg%vname(i)),TRIM(reg%vunits(i)),TRIM(reg%vtitle(i)) + END DO + + 101 FORMAT(/,' Component ',A,' has ',I3,' ',A7,/, & + ' No ',2X,' Name ',2X,' Units ',2X,'Description',/, & + ' ---',2X,'--------',2X,'----------',2X,'-----------') + 201 FORMAT(' ',I3,2X,A8,2X,A10,2X,A) + + END SUBROUTINE reg_prt_ + +END SUBROUTINE Chem_RegistryPrint + + subroutine Chem_RegistrySetIsGOCART ( chemReg, isGOCART, nq ) + type(Chem_registry), intent(in) :: chemReg + integer, intent(in) :: nq ! total number of tracers in registry + logical, intent(out) :: isGOCART(nq) + ! ----- + isGOCART = .false. + if ( chemReg%doing_O3 ) isGOCART(chemReg%i_O3 :chemReg%j_O3) = .true. + if ( chemReg%doing_CO ) isGOCART(chemReg%i_CO :chemReg%j_CO) = .true. + if ( chemReg%doing_CO2 ) isGOCART(chemReg%i_CO2:chemReg%j_CO2) = .true. + if ( chemReg%doing_DU ) isGOCART(chemReg%i_DU :chemReg%j_DU) = .true. + if ( chemReg%doing_SS ) isGOCART(chemReg%i_SS :chemReg%j_SS) = .true. + if ( chemReg%doing_BC ) isGOCART(chemReg%i_BC :chemReg%j_BC) = .true. + if ( chemReg%doing_OC ) isGOCART(chemReg%i_OC :chemReg%j_OC) = .true. + if ( chemReg%doing_BRC ) isGOCART(chemReg%i_BRC :chemReg%j_BRC) = .true. + if ( chemReg%doing_SU ) isGOCART(chemReg%i_SU :chemReg%j_SU) = .true. + if ( chemReg%doing_CFC ) isGOCART(chemReg%i_CFC:chemReg%j_CFC) = .true. + if ( chemReg%doing_Rn ) isGOCART(chemReg%i_Rn :chemReg%j_Rn) = .true. + if ( chemReg%doing_CH4 ) isGOCART(chemReg%i_CH4:chemReg%j_CH4) = .true. + if ( chemReg%doing_NI ) isGOCART(chemReg%i_NI :chemReg%j_NI) = .true. + end subroutine Chem_RegistrySetIsGOCART + + end module Chem_RegistryMod + diff --git a/ESMF/Shared/Chem_Base/Chem_SimpleBundleMod.F90 b/ESMF/Shared/Chem_Base/Chem_SimpleBundleMod.F90 new file mode 100644 index 00000000..cc5fef86 --- /dev/null +++ b/ESMF/Shared/Chem_Base/Chem_SimpleBundleMod.F90 @@ -0,0 +1,163 @@ +! +! This class extends MAPL_SimpleBundle with more Chemistry specific methods. +! +! Arlindo da Silva , November 2010 +!---------------------------------------------------------------------------- + +# include "MAPL_Generic.h" + +module Chem_SimpleBundleMod + + use ESMF + use MAPL + use Chem_RegistryMod + use m_StrTemplate + + implicit NONE + + private + +! Inheritted from MAPL_SImpleBundle +! --------------------------------- + public MAPL_SimpleBundle + public MAPL_SimpleBundleCreate + public MAPL_SimpleBundlePrint + public MAPL_SimpleBundleRead + public MAPL_SimpleBundleWrite + +! Defined Here +! ------------ + public Chem_SimpleBundleCreate + public Chem_SimpleBundleRead + public Chem_SimpleBundleWrite + + integer, parameter :: READ_ONLY=1 + +CONTAINS + +!.......................................................................................... + + Function Chem_SimpleBundleCreate (name, Reg, Grid, rc, & + Levs, LevUnits, & + ptop, delp ) result (self) + + type(MAPL_SimpleBundle) :: self + character(len=*), intent(in) :: name + type(Chem_Registry), intent(in) :: Reg + type(ESMF_Grid), intent(inout) :: Grid + integer, OPTIONAL, intent(out) :: rc + + ! Vertical coordinates + real(ESMF_KIND_R4), OPTIONAL, intent(in) :: Levs(:) ! Constant levels + character(len=*), OPTIONAL, intent(in) :: LevUnits ! Level units + ! Lagrangian Control Volume Info + real(ESMF_KIND_R4), OPTIONAL, intent(in) :: ptop ! top pressure (Pa) + real(ESMF_KIND_R4), OPTIONAL, pointer, & + intent(in) :: delp(:,:,:) ! layer thickness (Pa) + +! --- + + type(ESMF_FieldBundle), pointer :: Bundle + type(ESMF_Field), pointer :: Field + real(ESMF_KIND_R4), pointer :: ptr(:,:,:) + integer :: i, im, jm, km, dims(7) + + __Iam__ ('Chem_SimpleBundleCreate') + + +! Grid sizes +! ---------- + call MAPL_GridGet(Grid, localCellCountPerDim = dims, __RC__) + im = dims(1); jm = dims(2); km = dims(3) + +! Create an ESMF Bundle for holding variables in Chem Registry +! ------------------------------------------------------------ + allocate(Bundle,__STAT__) + Bundle = ESMF_FieldBundleCreate ( name=name, __RC__ ) + call ESMF_FieldBundleSet ( bundle, grid=Grid, __RC__ ) + +! Add fields +! ---------- + do i = 1, Reg%nq + allocate(Field,ptr(im,jm,km), __STAT__) + ptr = MAPL_UNDEF + field = ESMF_FieldCreate(name=Reg%vname(i), grid=Grid, & + fArrayPtr = ptr, dataCopyFlag=ESMF_DATACOPY_REFERENCE, __RC__) + call MAPL_FieldBundleAdd(Bundle, Field=Field, __RC__) + end do + +! Create the simple bundle +! ------------------------ + self = MAPL_SimpleBundleCreate(Bundle, Levs=Levs, LevUnits=LevUnits, & + ptop=ptop, delp=delp, __RC__) + + end Function Chem_SimpleBundleCreate + +!.......................................................................................... + + Function Chem_SimpleBundleRead (CF, rc_name, grid, time, verbose, only_vars, rc ) result(self) +! +! Variant interface for MAPL_SimpleBundleRead. +! + type(MAPL_SimpleBundle) :: self + type(ESMF_Config), intent(inout) :: CF + character(len=*), intent(in) :: rc_name + type(ESMF_Grid), intent(in) :: Grid + type(ESMF_Time), OPTIONAL, intent(inout) :: Time + logical, OPTIONAL, intent(in) :: verbose + character(len=*), optional, intent(IN) :: only_vars + integer, OPTIONAL, intent(out) :: rc +! --- + character(len=256) :: filename, template, expid, fname + type(ESMF_Time) :: Time_ + integer :: nymd, nhms, yy, mm, dd, h, m, s, fid, incSecs + + __Iam__ ('Chem_SimpleBundleRead') + + call ESMF_ConfigGetAttribute(CF, expid, Label='EXPID:', Default='unknown',__RC__ ) + call ESMF_ConfigGetAttribute(CF, filename, Label=trim(rc_name)//':', __RC__ ) + fname = trim(rc_name) + + if ( present(Time) ) then + self = MAPL_SimpleBundleRead (filename, fname, Grid, Time, verbose, & + ONLY_VARS=only_vars, expid=expid, __RC__ ) + else + call GFIO_Open ( filename, READ_ONLY, fid, rc ) + if ( rc /= 0 ) return + call GetBegDateTime ( fid, nymd, nhms, incSecs, rc ) + if ( rc /= 0 ) return + call GFIO_Close ( fid, rc ) + if ( rc /= 0 ) return + yy = nymd/10000; mm = (nymd-yy*10000) / 100; dd = nymd - (10000*yy + mm*100) + h = nhms/10000; m = (nhms- h*10000) / 100; s = nhms - (10000*h + m*100) + call ESMF_TimeSet(Time_, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s) + self = MAPL_SimpleBundleRead (filename, fname, Grid, Time_, verbose, & + ONLY_VARS=only_vars, expid=expid, __RC__ ) + end if + + end Function Chem_SimpleBundleRead + +!................................................ + + subroutine Chem_SimpleBundleWrite (self, CF, rc_name, Time, verbose, rc ) +! +! Variant interface for MAPL_SimpleBundleWrite. +! + type(MAPL_SimpleBundle) :: self + type(ESMF_Config), intent(inout) :: CF + character(len=*), intent(in) :: rc_name + type(ESMF_Time), intent(inout) :: Time + logical, OPTIONAL, intent(in) :: verbose + integer, OPTIONAL, intent(out) :: rc +! --- + character(len=256) :: filename + + __Iam__ ('Chem_SimpleBundleWrite') + + call ESMF_ConfigGetAttribute(CF, filename, Label=trim(rc_name)//':', __RC__ ) + + call MAPL_SimpleBundleWrite ( self, filename, time, verbose, rc ) + + end subroutine Chem_SimpleBundleWrite + +end module Chem_SimpleBundleMod diff --git a/ESMF/Shared/Chem_Base/HOWTO_ChemRestarts.txt b/ESMF/Shared/Chem_Base/HOWTO_ChemRestarts.txt new file mode 100644 index 00000000..a2bc7fcc --- /dev/null +++ b/ESMF/Shared/Chem_Base/HOWTO_ChemRestarts.txt @@ -0,0 +1,669 @@ + + How to Create GEOS-5 GOCART/StratChem Restarts + + Arlindo da Silva + NASA/GSFC, GMAO, Code 610.1 + Arlindo.daSilva@nasa.gov + + Last Update: Tue Jan 27 12:18:57 EST 2009 + +Contents +-------- + +I. Manipulating GEOS-5 Chem Restarts with lats4d + EXAMPLE 1: Create a ctl for an existing GOCART restart + EXAMPLE 2: Create a subset of a GOCART restart + EXAMPLE 3: Create a GOCART restart with a different horizontal resolution + EXAMPLE 4: Create a GOCART restart with additional variables + EXAMPLE 5: Dump statistics from a binary restart file + EXAMPLE 6: Change vertical resolution + +II. Generating GEOS-5 Restarts from GEOS-4 Chem Bundle files + + + +I. Manipulating GEOS-5 Chem Restarts with lats4d + --------------------------------------------- + +While the binary GEOS-5 restarts do not come with any describing metadata, a +GrADS control file (ctl) can be created using the ctl_crst.x utility: + + ctl_crst.x Chem_Registry.rc [rs_filename [res] ] + +where *Chem_Registry.rc* is the Chem Registry used in the run that produced +the binary restart file *rs_fielname*. The optional parameter *res* specify +the the resolution of the run, e.g., b72, c72, ..., where "72" is the number +opf levels the the first letter is the horizontal resolution: + + b - 2x2.5 deg + c - 1x1.25 deg + d - 0.5 x 2/3 deg + e - 0.25 x 1/3 deg + etc. + +The default is res = 'd72'. When the binary restart file name is omitted, only +the lats4d sample line is written (see below). + +If you are not familiar with Lats4D, before proceeding you may want to read +this: + + http://opengrads.org/wiki/index.php?title=Lats4D + +EXAMPLE 1: Create a ctl for an existing GOCART restart +...................................................... + +% set g5home = /discover/nobackup/dao_ops/intermediate/d520_fp +% ctl_crst.x $g5home/run/Chem_Registry.rc \ + $g5home/recycle/d520_fp.gocart_internal_rst.20080814_03z.bin \ + > old.ctl + +Here are the (abbreviated) contents of old.ctl: + +--- cut --- --- cut --- --- cut --- --- cut --- --- cut --- --- cut --- +DSET /discover/nobackup/dao_ops/intermediate/d520_fp/recycle/d520_fp.gocart_internal_rst.20080814_03z.bin +TITLE Chem Restart File +UNDEF 1.0E20 +XDEF 540 LINEAR -180 0.666667 +YDEF 361 LINEAR -90 0.500000 +ZDEF 72 LINEAR 1 1 +TDEF 1 LINEAR 05feb1960 6hr +VARS 32 +CO 0 72 Global carbon monoxide +... +OCphilicbbnb 0 72 Hydrophilic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +ENDVARS +--- cut --- --- cut --- --- cut --- --- cut --- --- cut --- --- cut --- + +You can open this file directly in GrADS and verify that it can correctly read +the restart. + +When the binary restart file name is omitted, a sample *lats4d* command line +is written. This is useful for creating variable subsets with lats4d; see the +next example. + + +EXAMPLE 2: Create a subset of a GOCART restart +.............................................. + +Suppose you want to create a shorter GOCART restart with fewer variables from +and existing restart. In this case run *ctl_crst.x* using the +*Chem_Registry.rc* that contains the desired subset list of variables, e.g., + +% ctl_crst ./Chem_Registry.rc + +which produces + +lats4d.sh -i old.ctl -o new -format sequential -v -vars co co2 du001 du002 du003 +du004 du005 ss001 ss002 ss003 ss004 ss005 dms so2 so4 msa bcphobic bcphilic +ocphobic ocphilic + +If *old.ctl* was produced as in EXAMPLE 1 then you just run the command above +(the output file name was changed from new to new2): + +% lats4d.sh -i old.ctl -o new2 -format sequential -v\ + -vars CO CO2 \ + du001 du002 du003 du004 du005 \ + ss001 ss002 ss003 ss004 ss005 \ + dms so2 so4 msa \ + bcphobic bcphilic ocphobic ocphilic + +which will produce the new (Fortran sequential) binary file *new2.bin*. You can +examine the contents of this file by first creating a ctl for it: + +% ctl_crst.x ./Chem_Registry.rc new2.bin > new2.ctl + + +EXAMPLE 3: Create a GOCART restart with a different horizontal resolution +......................................................................... + +Suppose you want to create a shorter GOCART restart with fewer variables from +and existing restart and also with a different horizontal resolution. In this +case run *ctl_crst.x* using the *Chem_Registry.rc* that contains the desired +list of variables, e.g., + +% ctl_crst ./Chem_Registry.rc + +which produces + +lats4d.sh -i old.ctl -o new -format sequential -v -vars CO CO2 du001 du002 +du003 du004 du005 ss001 ss002 ss003 ss004 ss005 DMS SO2 SO4 MSA BCphobic +BCphilic OCphobic OCphilic + +You can use the following Lats4D options to produce the output file at a +different resolution: + + -geos0.25 1/4 by 1/3 degrees + -geos0.5 1/2 by 2/3 degrees + -geos1x125 1 by 1 1/4 degrees + -geos1x1 1 x 1 degree (GEOS-3) + -geos4x5 4 x 5 degrees + -geos2x25 2 x 2 1/2 degrees + +All the GEOS grids are global, [90S,90N], [180W,180E). For each of these +options there are variants "a" for box- averaging and "s" for bessel +interpolation. The default is linear interpolation. For example, use +-geos4x5 for linear interpolation, -geos4x5a for box-averaging and +-geos4x5s for bessel interpolation. + + +If *old.ctl* was produced as in EXAMPLE 1 then you just add the interpolation +option, e.g., + +% lats4d.sh -i old.ctl -o new3 -format sequential -v\ + -geos2x25 -vars CO CO2 \ + du001 du002 du003 du004 du005 \ + ss001 ss002 ss003 ss004 ss005 \ + DMS SO2 SO4 MSA \ + BCphobic BCphilic OCphobic OCphilic + +which will produce the new (Fortran sequential) binary file *new3.bin*. You can +examine the contents of this file by first creating a ctl for it: + +% ctl_crst.x ./Chem_Registry.rc new3.bin > new3.ctl + +IMPORTANT: It has been reported that lats4d may run out of memory and give +segmentation fault in re() when regriding to 1/4 x 1/3 degree resolutions. One +solution has been to use lats4d with a x86_64 build of GrADS and have plenty +of memory. + + +EXAMPLE 4: Create a GOCART restart with additional variables +............................................................ + +If you have a modified *Chem_Registry.rc* file which puts additional variables +into the GOCART restart, then you may want to convert an existing GOCART into +one which is consistent with the new *Chem_Registry.rc* by adding zeros as +placeholders for the new variables. + +Let's start with the new2.bin file from Example 2 above. Suppose the modified +*Chem_Registry.rc* adds five variables, COBBAE, COBBNA, COBBLA, COBBAF, COBBGL, +after the CO variable, and two new variables, CFC12S and CFC12T, after the MSA +variable. Use the following procedures to convert new2.bin. + +First create three subsets of new2.bin based on the locations for the new +variables. + +% lats4d.sh -i new2.ctl -vars co -o subfile1 -format sequential +% lats4d.sh -i new2.ctl -vars co2 du001 du002 du003 du004 du005 \ + ss001 ss002 ss003 ss004 ss005 dms so2 so4 msa \ + -o subfile2 -format sequential +% lats4d.sh -i new2.ctl -vars bcphobic bcphilic ocphobic ocphilic \ + -o subfile3 -format sequential + +The outputs from these commands are subfile1.bin, subfile2.bin, and +subfile3.bin. + +Now create a record of zeros to use as a placeholder for the new variables. Note +that it is not important which old variable is used in this command since all +the values are multiplied by zero. + +% lats4d.sh -i new2.ctl -vars co -o zeros -func '0*@' -format sequential + +The output from this command is zeros.bin. + +Finally, use the *cat* command to create the new GOCART: + +% cat zeros.bin zeros.bin > zeros2.bin +% cat zeros.bin zeros.bin zeros.bin zeros.bin zeros.bin > zeros5.bin + +% cat subfile1.bin zeros5.bin subfile2.bin zeros2.bin subfile3.bin > new4.bin + +You can create a ctl file for new4.bin using the modified *Chem_Registry.rc* +mentioned at the beginning of this example: + +% ctl_crst.x ./Chem_Registry.rc new4.bin > new4.ctl + +To check that the old variables from new2.bin were transferred correctly, it is +a good idea to dump and compare the statistics from both new2.bin and new4.bin +(see EXAMPLE 5). + + +EXAMPLE 5: Dump statistics from a binary restart file +..................................................... + +Use lats4d.sh and the ctl file (e.g. new.ctl) to dump statistics from a binary +file. + +% lats4d.sh -i new.ctl -format stats + + +EXAMPLE 6: Change vertical resolution +..................................... + +Lats4D cannot really change the vertical resolution. Your best option is to +use the GFIO_remap.x utility in this case. This utility however, can only +handle COARDS compliant files in either NetCDF-3, HDF-4 or even NetCDF-4/HDF-5 +(provided it has been compiled with the correct library.) + +The first step is to use Lats4D to create a COARDS compliante file. For the +case in the previous example, simply omit the "-format sequential" option: + +% lats4d.sh -i old.ctl -o new72 -v \ + -geos2x25 -vars CO CO2 \ + du001 du002 du003 du004 du005 \ + ss001 ss002 ss003 ss004 ss005 \ + DMS SO2 SO4 MSA \ + BCphobic BCphilic OCphobic OCphilic + +This will create file "new72.nc". Next, use GFIO_remap.x to change the number +of vertical layers: + +% setenv G5BIN $HOME/GEOSgcm/Linux/bin +% $G5BIN/GFIO_remap.x -nlev 91 -o new91.nc new72.nc + +Finally, use lats4d again to convert this file to binary + +% lats4d.sh -i new91.nc -o new91 -format sequential -v \ + -geos2x25 -vars CO CO2 \ + du001 du002 du003 du004 du005 \ + ss001 ss002 ss003 ss004 ss005 \ + DMS SO2 SO4 MSA \ + BCphobic BCphilic OCphobic OCphilic + +You could also have used GFIO_remap.x for the horizontal interpolation; type +GFIO_remap.x without arguments for a list of command line options. + + + +II. Generating GEOS-5 Restarts from GEOS-4 Chem Bundles + --------------------------------------------------- + +These notes explain how to produce GOCART/StratChem Internal Restart +files for GEOS-5, based on GEOS Chem Bundle files (either c_rst or +chem.eta files). + +1) Required utilities: + + - GFIO_remap.x (provided in GMAO_Shared/GMAO_hermes) + + Purpose: used to convert the GEOS-4 fields to the necessaty + GEOS-5 vertical/horizontal resolution + + - Chem_BundleToG5rs.x (provided in GMAO_Shared/Chem_Base) + + Purpose: used to convert the GEOS-4 Chem Bundle (a HDF-4 file) + to the GEOS-5 (GrADS) binary format. At this point the + Chem Bundle should be exactly at the same resolution as + required by GEOS-5 (including 72 levels), although the + input file could have more variables than necesary. + The longitudinal swap (from [0,360) to [-180,180) is + performed by this utility. + +2) Required "resource" files: + + Prepare the resource file "Chem_Registry.rc" in a way consistent + with the way it will be used in GEOS-5. Pay particular attention to + the number of bins (nbins_?? resources), as GEOS-4 may have been + run with 8 CO tracers but you only need 1 global CO tracer, for + example. You should activate only those variables to be included in + the GEOS-5 binary restart file (excluding "pchem"/GMI which do not + have GEOS-4 heritage.) Notice that, + + - if producing "gocart_internal_restart", set to "yes" all tracers + from doing_CO through doing_OC, inclusive. All other tracers + should be set to "no". + - if producing "stratchem_internal_restart", set to "yes" tracers + doing_SC and doing_XX, all others to "no". + +3) Notes about dates + + The GEOS-5 binary restarts to not include dates, therefore you are + free to use restarts from any data you choose. It is recommended + that you at least match the day/month/time as to provide restarts + that are climatologically realistic. + +4) Which GEOS-4 experiments to use + + Because usually GEOS-5 will run with CO2, you need to use runs that + had CO, CO2 and aerosols. For example, the First Look systems used + for CRAVE; the AVE_Houston/INTEX-B did not include CO2. As of this + writing, the CRAVE files can be found at NCCS in the following directory: + + /output/dao_ops/GEOS-4_CRAVE/a_flk_04C/rs + + Spin-up runs can be found here: + + /output/dasilva/a_flk_04C/rs + + Always take a look in the contents of the file to make sure the + fields are spun up. For example, in GrADS do this + + ga-> d ave((du001+du002+du003+du004+du005)*delp,z=1,z=55) + + to make sure you have a well established dust plume. + +3) Example 1: creating a 2x2.5 GEOS-5 "gocart_internal_restart" from a + GEOS-4 chem restart file for 21 December 1992. + + a) Locate a GEOS-4 chem restart for this date. In this case we have + + a_flk_04C.rst.chem.20051221_18z.bin + + available from + + /output/dasilva/a_flk_04C/rs/Y2005/M12 + + (don't be fooled by the .bin extension - this is a HDF-4 file!) + + b) Use the "SAMPLE FILE 1" below for Chem_Registry.rc (or modify + current Chem_Registry.rc file if there were structural changes. + + c) Copy files to a scratch location: + +% setenv CRAVE /output/dasilva/a_flk_04C +% cp $CRAVE/rs/Y2005/M12/a_flk_04C.rst.chem.20051221_18z.bin $TMPDIR +% (place Chem_Registry.rc in $TMPDIR as well) + + d) Remap to 2x2.5 horizontal/72 layer resolution in 2 steps: + +% setenv G5BIN $HOME/GEOSgcm/Linux/bin +% $G5BIN/GFIO_remap.x -res b -o b55.hdf a_flk_04C.rst.chem.20051221_18z.bin +% $G5BIN/GFIO_remap.x -nlev 72 -o b72.hdf b55.hdf + + Hint: Typer GFIO_remap.x without arguments for a list of command + line options. + + e) Convert to remaped GEOS-4 file to GEOS-5 binary format: + +% $G5BIN/Chem_BundleToG5rs.x b72.hdf gocart_internal_restart 20051221 180000 + + The last 2 parameters are the date/time of the INPUT GEOS-4 file; + the GEOS-5 output file will have no date inside. + + That is it! The gocart_internal_restart is ready for use in a + GEOS-5 2x2.5 run. + + +3) EXAMPLE 2: creating a 0.5x2/3 degree GEOS-5 "gocart_internal_restart" from a + GEOS-4 chem restart file for 21 December 1992. + + a) through c) same as in EXAMPLE 1 + + d) Remap to 0.5x2/3 horizontal/72 layer resolution in 2 steps: + +% $G5BIN/GFIO_remap.x -res d -o d55.hdf a_flk_04C.rst.chem.20051221_18z.bin +% $G5BIN/GFIO_remap.x -nlev 72 -o d72.hdf d55.hdf + + e) Convert to remaped GEOS-4 file to GEOS-5 binary format: + +% $G5BIN/Chem_BundleToG5rs.x d72.hdf gocart_internal_restart 20051221 180000 + +............................................................................ + +------------------------------- +SAMPLE FILE 1: Chem_Registry.rc +------------------------------- + +--- cut --- --- cut --- --- cut --- --- cut --- --- cut --- --- cut --- +# +# Chemistry Registry Resource File +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to mol/mol +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: yes # carbon monoxide +doing_CO2: yes # carbon dioxide +doing_DU: yes # mineral dust +doing_SS: yes # sea salt +doing_SU: yes # sulfates +doing_BC: yes # black carbon +doing_OC: yes # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # auto chem +doing_XX: no # generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_GMI: no # GMI chemistry (GEOS-5) + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 3 # ozone +nbins_CO: 1 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 34 # stratospheric chemistry +nbins_AC: 35 # auto chem +nbins_XX: 18 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 1 # GMI chemistry (GEOS-5) + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: kg/kg # ozone +units_CO: kg/kg # carbon monoxide +units_CO2: kg/kg # carbon dioxide +units_DU: kg/kg # mineral dust +units_SS: kg/kg # sea salt +units_SU: kg/kg # sulfates +units_BC: kg/kg # black carbon +units_OC: kg/kg # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_AC: kg/kg # auto chem +units_XX: kg/kg # generic tracer +units_PC: kg/kg # parameterized chemistry (GEOS-5) +units_GMI: kg/kg # GMI chemistry (GEOS-5) + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3PARAM mol/mol Parameterized ozone +OXSTRAT mol/mol Stratospheric odd oxygen +OXTROP mol/mol Tropospheric ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO mol/mol Global carbon monoxide +CONOAMAN mol/mol North American anthropogenic CO +COCEAMAN mol/mol Central American anthropogenic CO +COWHBB mol/mol Western Hemisphere biomass burning CO +COASIAAN mol/mol Asian anthropogenic CO +COASNBB mol/mol Northern Asia biomass burning CO +COASSBB mol/mol Southern Asia biomass burning CO +COFDAN mol/mol Mexico City anthropogenic CO +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 mol/mol Carbon Dioxide +CO2nam mol/mol North American Carbon Dioxide +CO2sam mol/mol South American Carbon Dioxide +CO2afr mol/mol African +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS kg/kg Dimethylsulphide +SO2 kg/kg Sulphur dioxide +SO4 kg/kg Sulphate aerosol +MSA kg/kg Methanesulphonic acid +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic kg/kg Hydrophobic Black Carbon +BCphilic kg/kg Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic kg/kg Hydrophobic Organic Carbon (Particulate Matter) +OCphilic kg/kg Hydrophilic Organic Carbon (Particulate Matter) +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OXSTRAT mol/mol Stratospheric odd oxygen +NOX mol/mol Odd nitrogen +HNO3 mol/mol Nitric acid +N2O5 mol/mol Dinitrogen pentoxide +HO2NO2 mol/mol Peroxynitric acid +CLONO2 mol/mol Chlorine nitrate +CLX mol/mol Odd chlorine +HCL mol/mol Hydrochloric acid +HOCL mol/mol Hypochlorous acid +H2O2 mol/mol Hydrogen peroxide +BRX mol/mol Odd bromine +N2O mol/mol Nitrous oxide +CL2 mol/mol Molecular chlorine +OCLO mol/mol Chlorine dioxide +BRCL mol/mol Bromine chloride +HBR mol/mol Hydrogen bromide +BRONO2 mol/mol Bromine nitrate +CH4 mol/mol Methane +HOBR mol/mol Hypobromous acid +CH3OOH mol/mol Methyl hydroperoxide +CO mol/mol Carbon monoxide +HNO3COND mol/mol Condensed nitric acid +H2OCOND mol/mol Condensed water vapor in chemistry +F11 mol/mol CFC-11 (CCl3F) +F12 mol/mol CFC-12 (CCl2F2) +F113 mol/mol CFC-113 (CCl2FCClF2) +HCFC mol/mol HCFC +CCL4 mol/mol Carbon tetrachloride +CH3CCL3 mol/mol Methyl chloroform +CH3CL mol/mol Methyl chloride +CH3BR mol/mol Methyl bromide +H1301 mol/mol Halon 1301 (CBrF3) +H12_24 mol/mol Halon 12_24 +Q4AGE mol/mol SSG for computing age-of-air +:: + +variable_table_AC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OXSTRAT mol/mol Stratospheric odd oxygen +NOX mol/mol Odd nitrogen +HNO3 mol/mol Nitric acid +N2O5 mol/mol Dinitrogen pentoxide +HO2NO2 mol/mol Peroxynitric acid +CLONO2 mol/mol Chlorine nitrate +CLX mol/mol Odd chlorine +HCL mol/mol Hydrochloric acid +HOCL mol/mol Hypochlorous acid +H2O2 mol/mol Hydrogen peroxide +BRX mol/mol Odd bromine +N2O mol/mol Nitrous oxide +CL2 mol/mol Molecular chlorine +OCLO mol/mol Chlorine dioxide +BRCL mol/mol Bromine chloride +HBR mol/mol Hydrogen bromide +BRONO2 mol/mol Bromine nitrate +CH4 mol/mol Methane +HOBR mol/mol Hypobromous acid +CH3OOH mol/mol Methyl hydroperoxide +CO mol/mol Carbon monoxide +HNO3COND mol/mol Condensed nitric acid +H2OCOND mol/mol Condensed water vapor in chemistry +F11 mol/mol CFC-11 (CCl3F) +F12 mol/mol CFC-12 (CCl2F2) +F113 mol/mol CFC-113 (CCl2FCClF2) +HCFC mol/mol HCFC +CCL4 mol/mol Carbon tetrachloride +CH3CCL3 mol/mol Methyl chloroform +CH3CL mol/mol Methyl chloride +CH3BR mol/mol Methyl bromide +H1301 mol/mol Halon 1301 (CBrF3) +H12_24 mol/mol Halon 12_24 +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM mol/mol Ozone from chemistry +O3P mol/mol Atomic oxygen in the ground state +O1D mol/mol Atomic oxygen in the first excited state +N mol/mol Atomic nitrogen +NO mol/mol Nitric oxide +NO2 mol/mol Nitrogen dioxide +NO3 mol/mol Nitrogen trioxide +HATOMIC mol/mol Atomic hydrogen +OH mol/mol Hydroxyl radical +HO2 mol/mol Hydroperoxyl radical +CL mol/mol Atomic chlorine +CLO mol/mol Chlorine monoxide +BRO mol/mol Bromine monoxide +BR mol/mol Atomic bromine +CL2O2 mol/mol Dichlorine peroxide +CH2O mol/mol Formaldehyde +CH3O2 mol/mol Methyl peroxide +RO3OX none Ozone-to-odd oxygen ratio +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_AC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) + +--- cut --- --- cut --- --- cut --- --- cut --- --- cut --- --- cut --- diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Aod-550nm_Registry.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod-550nm_Registry.rc new file mode 100644 index 00000000..0a1334fc --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod-550nm_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 5.5e-7 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Aod3d_1064nm.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod3d_1064nm.rc new file mode 100644 index 00000000..fb474817 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod3d_1064nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1.064e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [1064 nm] +ssa none Aerosol Single Scatter Albedo [1064 nm] +tau none Aerosol Layer Optical Thickness [1064 nm] +depol none Aerosol Depolarization Ratio [1064 nm] +backscat km-1sr-1 Aerosol Backscatter [1064 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [1064 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [1064 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [1064 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Aod3d_355nm.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod3d_355nm.rc new file mode 100644 index 00000000..6d4b1eb2 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod3d_355nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.355e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [355 nm] +ssa none Aerosol Single Scatter Albedo [355 nm] +tau none Aerosol Layer Optical Thickness [355 nm] +depol none Aerosol Depolarization Ratio [355 nm] +backscat km-1sr-1 Aerosol Backscatter [355 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [355 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [355 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [355 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Aod3d_532nm.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod3d_532nm.rc new file mode 100644 index 00000000..dc2a5074 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod3d_532nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +depol none Aerosol Depolarization Ratio [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/AodBands_Registry.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/AodBands_Registry.rc new file mode 100644 index 00000000..7faf3eb0 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/AodBands_Registry.rc @@ -0,0 +1,116 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1 2 3 4 5 6 7 8 + +filename_optical_properties_DU: ExtData/AeroCom/x/opticsBands_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/opticsBands_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/opticsBands_OC.v1_3.nc +filename_optical_properties_BC: ExtData/AeroCom/x/opticsBands_BC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/opticsBands_BRC.v1_5.nc +filename_optical_properties_SU: ExtData/AeroCom/x/opticsBands_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/opticsBands_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH01 none SW Band 1 +CH02 none SW Band 2 +CH03 none SW Band 3 +CH04 none SW Band 4 +CH05 none SW Band 5 +CH06 none SW Band 6 +CH07 none SW Band 7 +CH08 none SW Band 8 +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_CALIPSO.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_CALIPSO.rc new file mode 100644 index 00000000..b9b8ec4e --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_CALIPSO.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_EOS.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_EOS.rc new file mode 100644 index 00000000..247e2b0b --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_EOS.rc @@ -0,0 +1,121 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- + +# OMI SO2: 305, 310, 324, 380, 440, 500 +# OMI Aerosol: 354 [~340] 388 [~380] 471 [~470] +# MODIS: .47e-6 .55e-6 .659e-6 [~670] .865e-6 1.24e-6 1.64e-6 2.13e-6 +# MISR: 468 [~470] 558 [~550] 672 [~670] 867 [~865] +# PARASOL: 670 [~670] 865 +# AERONET: 340 380 440 500 675 [~670] 870 [~865] 1020 1640 + +n_channels: 12 +r_channels: .340e-6 .380e-6 .440e-6 .470e-6 .500e-6 .55e-6 .670e-6 .865e-6 1.02e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_MODIS.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_MODIS.rc new file mode 100644 index 00000000..41b9608b --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_MODIS.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 7 + +r_channels: .47e-6 .55e-6 .659e-6 .865e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_Registry.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_Registry.rc new file mode 100644 index 00000000..34a6513a --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Aod_Registry.rc @@ -0,0 +1,107 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 4 + +r_channels: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_Init.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_Init.rc new file mode 100644 index 00000000..439a0aca --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_Init.rc @@ -0,0 +1,25 @@ +# +# Chemistry Initialization Resource File +# + +# CO +# ---------------------------------------------------- +amp_CO: 1e18 # positive for total mass [kg]; negative for mmr +lat0_CO: 0. # latitude +lon0_CO: 0. # longitude +z0_CO: 5. # altitude [km] +rx_CO: 4000. # axis E-W [km] +ry_CO: 500. # axis N-S [km] +rz_CO: 2. # axis in z [km] + +# DU +# ---------------------------------------------------- +amp_DU: 0. # positive for total mass [kg]; negative for mmr +lat0_DU: 0. # latitude +lon0_DU: 0. # longitude +z0_DU: 5. # altitude [km] +rx_DU: 4000. # axis E-W [km] +ry_DU: 500. # axis N-S [km] +rz_DU: 2. # axis in z [km] + + diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_Mie.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_Mie.rc new file mode 100644 index 00000000..3643e6cf --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_Mie.rc @@ -0,0 +1,15 @@ +# +# Resorce file for Chem_Mie Module. Defines filename with LUTs and +# available channels +# + +Chem_Mie::du_optics_file: ExtData/AeroCom/x/opticsBands_DU.v15_3.nc +Chem_Mie::ss_optics_file: ExtData/AeroCom/x/opticsBands_SS.v3_3.nc +Chem_Mie::su_optics_file: ExtData/AeroCom/x/opticsBands_SU.v1_3.nc +Chem_Mie::ni_optics_file: ExtData/AeroCom/x/opticsBands_NI.v2_5.nc +Chem_Mie::oc_optics_file: ExtData/AeroCom/x/opticsBands_OC.v1_3.nc +Chem_Mie::brc_optics_file: ExtData/AeroCom/x/opticsBands_BRC.v1_5.nc +Chem_Mie::bc_optics_file: ExtData/AeroCom/x/opticsBands_BC.v1_3.nc + +Chem_Mie::channels: 1 2 3 4 5 6 7 8 + diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_MieRegistry.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_MieRegistry.rc new file mode 100644 index 00000000..5b529bb1 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_MieRegistry.rc @@ -0,0 +1,455 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# XX lists Stratchem's inferred species. See Chem_Registry.rc +# for GMIchem's XX (non-transported) species list. +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to mol/mol +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # carbon monoxide +doing_CO2: no # carbon dioxide +doing_DU: yes # mineral dust +doing_SS: yes # sea salt +doing_SU: yes # sulfates +doing_CFC: no # CFCs +doing_BC: yes # black carbon +doing_OC: yes # organic carbon +doing_BRC: no # brown carbon +doing_NI: yes # nitrate +doing_Rn: no # radon +doing_CH4: no # methane +doing_SC: no # stratospheric chemistry +doing_GMI: no # GMI chemistry (GEOS-5) +doing_XX: no # generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: no # passive tracers + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 10 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC: 34 # stratospheric chemistry +nbins_XX: 18 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 10 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Global carbon monoxide +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +REDUCED +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 m-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +st80_25 'mol mol-1' Stratosphere source 25 day tracer +CO_50_na 'mol mol-1' Anthro CO North America 50 day tracer +SF6 'mol mol-1' Sulfur Hexafluoride tracer +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant emission 90 day tracer +Rn222 'mol mol-1' Radon-222 +Pb210 'mol mol-1' Lead-210 +Be7 'mol mol-1' Beryllium radionuclide 7(Be) +Be10 'mol mol-1' Beryllium radionuclide 10(Be) +CH3I 'mol mol-1' Methyl iodide +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_Registry.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_Registry.rc new file mode 100644 index 00000000..326d7955 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/Chem_Registry.rc @@ -0,0 +1,638 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# Beginning with Heracles-1_0, four TR tracers are enabled in the +# default configuration. For the complete list of TR tracers, see +# Chem_MieRegistry.rc. +# +# StratChem can be run with Full or Reduced equation sets. +# When running Full, the string SC_f should be changed to SC. +# When running Reduced, the string SC_r should be changed to SC. +# This will be automatically done by stratchem_setup script. +# +# XX lists contain non-transported species for GMI and StratChem. +# When running GMI, the string XX_GMI should be changed to XX. +# When running StratChem, the string XX_SC should be changed to XX. +# This will be automatically done by the setup scripts. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to 'mol mol-1' +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + # &Label Active Constituents + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: yes # &YesNo Include carbon monoxide? +doing_CO2: yes # &YesNo Include carbon dioxide? +doing_DU: yes # &YesNo Include mineral dust? +doing_SS: yes # &YesNo Include sea salt? +doing_SU: yes # &YesNo Include sulfates? +doing_CFC: no # &YesNo Include CFCs? +doing_BC: yes # &YesNo Include black carbon? +doing_OC: yes # &YesNo Include organic carbon? +doing_BRC: no # &YesNo Include brown carbon? +doing_NI: yes # &YesNo Include nitrate? +doing_Rn: no # &YesNo include Radon? +doing_CH4: no # &YesNo include Methane? +doing_SC: no # &YesNo Include stratospheric chemistry? +doing_GMI: no # &YesNo GMI chemistry (GEOS-5) +doing_XX: no # &YesNo generic tracer +doing_PC: yes # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: yes # &YesNo run passive tracers? + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC_f: 52 # stratospheric chemistry (full) +nbins_XX_SC_f: 18 # stratchem (full) non-transported species +nbins_SC_r: 33 # stratospheric chemistry (reduced) +nbins_XX_SC_r: 37 # stratchem (reduced) non-transported species +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_XX_GMI: 48 # GMI non-transported species +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 4 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Carbon Monoxide (All Sources) +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide (All Sources) +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +OCphobicbbbo 'kg kg-1' Hydrophobic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphilicbbbo 'kg kg-1' Hydrophilic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphobicbbnb 'kg kg-1' Hydrophobic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +OCphilicbbnb 'kg kg-1' Hydrophilic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 cm-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +H 'mol mol-1' Ground state atomic hydrogen (2S) +MO2 'mol mol-1' Methylperoxy radical (CH3O2) +N 'mol mol-1' Ground state atomic nitrogen +O 'mol mol-1' Ground state atomic oxygen (3P) +O1D 'mol mol-1' First excited singlet state of atomic oxygen (1D) +A3O2 'mol mol-1' Primary RO2 (C3H7O2) from propane +ATO2 'mol mol-1' RO2 from acetone (C3H6O3) +B3O2 'mol mol-1' Secondary RO2 (C3H7O2) from propane +EOH 'mol mol-1' Ethanol +ETO2 'mol mol-1' Ethylperoxy radical (C2H5O2) +GLYC 'mol mol-1' Glycolaldehyde (Hydroxyacetaldehyde C2H4O2) +GLYX 'mol mol-1' Glyoxal (2CHO) +IAO2 'mol mol-1' RO2 (C5H9O5) from isoprene oxidation products +INO2 'mol mol-1' RO2 (C5H8O3N) from ISOP+NO3 +INPN 'mol mol-1' Peroxide (C5H8O6N2) from INO2 +ISN1 'mol mol-1' RO2 (C4H7O4N) from ISN2 +ISNP 'mol mol-1' Peroxide (C4H7O4N) from ISN1 +KO2 'mol mol-1' RO2 (C4H7O3) from C3 ketones +MAN2 'mol mol-1' RO2 (C4H6O6N) from MACR+NO3 +MAO3 'mol mol-1' Peroxyacyl (C4H5O3) from MACR and MVK +MAOP 'mol mol-1' Peroxide (C4H6O3) from MAO3 +MAP 'mol mol-1' Peroxyacetic acid (C2H4O3) +MCO3 'mol mol-1' Peroxyacetyl radical (C2H3O3) +MGLY 'mol mol-1' Methylglyoxal (C3H4O2) +MRO2 'mol mol-1' RO2 (C4H7O4) from MACR+OH +MRP 'mol mol-1' Peroxide (C4H8O4) from MRO2 +PO2 'mol mol-1' RO2 (C3H7O3) from propene +PP 'mol mol-1' Peroxide (C3H8O3) from PO2 +PRN1 'mol mol-1' RO2 (C3H6O3N) from propene+NO3 +PRPN 'mol mol-1' Peroxide (C3H6O3N) from PRN1 +R4N1 'mol mol-1' RO2 (C4H9O3N) from R4N2 +R4O2 'mol mol-1' RO2 (C4H9O2) from ALK4 +R4P 'mol mol-1' Peroxide (C4H10O2) from R4O2 +RA3P 'mol mol-1' Peroxy propyl alcohol (C3H8O2) from A3O2 +RB3P 'mol mol-1' Peroxide (C3H8O2) from B3O2 +RCO3 'mol mol-1' Peroxypropionyl radical (C3H5O3) +RIO1 'mol mol-1' RO2 (C5H9O3) from isoprene oxydation products +RIO2 'mol mol-1' RO2 (C5H9O3) from isoprene +RIP 'mol mol-1' Peroxide (C5H10O3) from RIO2 +ROH 'mol mol-1' C2 alcohols +RP 'mol mol-1' Methacrolein peroxy acid (C4H6O3) +VRO2 'mol mol-1' RO2 (C4H7O4) from MVK+OH +VRP 'mol mol-1' Peroxide (C4H8O4) from VRO2 +OCSg 'mol mol-1' Carbonyl sulfide in GMI +ACET 'mol mol-1' Acetone +O2 cm-3 Molecular oxygen +NUMDENS cm-3 Total number density +T2M15d K Daily T2M time average +:: + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant burden 90 day tracer +Rn222 'kg kg-1' Radon-222 +CH3I 'mol mol-1' Methyl iodide +Pb210 'kg kg-1' Lead-210 +nh_5 'mol mol-1' Northern Hemisphere 5 day tracer +nh_50 'mol mol-1' Northern Hemisphere 50 day tracer +aoa_nh days Age of air northern hemisphere tracer +st80_25 'mol mol-1' Stratospheric source 25 day tracer +CO_25 'mol mol-1' Anthro CO 25 day tracer +CO_50 'mol mol-1' Anthro CO 50 day tracer +CO_50_ea 'mol mol-1' Anthro CO 50 day tracer East Asia +CO_50_na 'mol mol-1' Anthro CO 50 day tracer North America +CO_50_eu 'mol mol-1' Anthro CO 50 day tracer Europe +CO_50_sa 'mol mol-1' Anthro CO 50 day tracer South Asia +SF6 'mol mol-1' Sulfur Hexafluoride tracer +e90_n 'mol mol-1' Constant burden 90 day tracer 40N-pole emiss +e90_s 'mol mol-1' Constant burden 90 day tracer 40S-pole emiss +Be7 'kg kg-1' Beryllium radionuclide 7(Be) +Be10 'kg kg-1' Beryllium radionuclide 10(Be) +stOX 'mol mol-1' Strat Ozone with chemical loss +Be7s 'kg kg-1' Beryllium radionuclide 7(Be) strat-source +Be10s 'kg kg-1' Beryllium radionuclide 10(Be) strat-source +Pb210s 'kg kg-1' Lead-210 strat-source +CO_GLB 'mol mol-1' CO 50 day tracer Global CMIP6+M2G +CO_NAM 'mol mol-1' CO 50 day tracer North America CMIP6+M2G +CO_EUR 'mol mol-1' CO 50 day tracer Europe CMIP6+M2G +CO_SAS 'mol mol-1' CO 50 day tracer South Asia CMIP6+M2G +CO_EAS 'mol mol-1' CO 50 day tracer East Asia CMIP6+M2G +CO_SEA 'mol mol-1' CO 50 day tracer Southeast Asia CMIP6+M2G +CO_ANZ 'mol mol-1' CO 50 day tracer Australia & New Zealand CMIP6+M2G +CO_NAF 'mol mol-1' CO 50 day tracer North Africa CMIP6+M2G +CO_RAF 'mol mol-1' CO 50 day tracer Rest of Africa CMIP6+M2G +CO_MDE 'mol mol-1' CO 50 day tracer Middle East CMIP6+M2G +CO_CAM 'mol mol-1' CO 50 day tracer Central America CMIP6+M2G +CO_SAM 'mol mol-1' CO 50 day tracer South America CMIP6+M2G +CO_RBU 'mol mol-1' CO 50 day tracer Russia & Belarus & Ukraine CMIP6+M2G +CO_CAS 'mol mol-1' CO 50 day tracer Central Asia CMIP6+M2G +CO_ARC 'mol mol-1' CO 50 day tracer Arctic CMIP6+M2G +CO_from_CH4 'mol mol-1' CO from global average CH4 oxidation +aoa_bl days Age of air above boundary layer +:: + + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers + diff --git a/ESMF/Shared/Chem_Base/MERRA2-DD/tavg3d_ext_p.rc b/ESMF/Shared/Chem_Base/MERRA2-DD/tavg3d_ext_p.rc new file mode 100644 index 00000000..d84b6cb3 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2-DD/tavg3d_ext_p.rc @@ -0,0 +1,55 @@ +# lcv2prs.rc +# +# This is a resource file for the lcv2prs utility. +# +# !REVISION HISTORY: +# +# 27Jan2006 B. Yin First version. +# 25Apr2006 Todling Declared dims so fvsetup get set them up. +# 17May2006 Stassi modified from tavg3d_tmp_v.rc for pressure levels +# +#........................................................................... + +# ---------------------- +# Output File Resolution +# ---------------------- + +zonal_resolution: 540 # no. of zonal grid-points (im) +west_most_longitude_in_deg: -180.0 # longitude of first point (i=1) +meridional_resolution: 361 # no. meridional grid-points (jm) +vertical_levels_in_hPa: 1000 975 950 925 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 30 20 10 + +# ---------------- +# Variable Classes +# ---------------- + +# A variable class lists the variable names that make up a file type or product. + +# +### PRODUCT: tavg3d_ext_p (3-D tendency) +VarClass*tavg3d_ext_p: delp rh extinction ssa tau +# -------------------- +# Variable Translation +# -------------------- + +Variable_translation_table:: + +# Output | Input +# Name Units | Name scale_factor add_offset Positive check +# ------------------------------------------------------------------------------ + DELP Pa delp 1.0 0.0 0 + RH fraction rh 1.0 0.0 0 + SSA fraction ssa 1.0 0.0 0 + EXTINCTION 1/km extinction 1.0 0.0 0 + TAU UNITLESS tau 1.0 0.0 0 +:: + + + +# Table for variable names and description: + +DELP: Pressure difference between layer edges +RH: Relative Humidity +SSA: Aerosol Single Scatter Albedo [532 nm] +EXTINCTION: Aerosol Extinction [532 nm] +TAU: Aerosol Layer Optical Thickness [532 nm] diff --git a/ESMF/Shared/Chem_Base/MERRA2/Aod-550nm_Registry.rc b/ESMF/Shared/Chem_Base/MERRA2/Aod-550nm_Registry.rc new file mode 100644 index 00000000..0a1334fc --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Aod-550nm_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 5.5e-7 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2/Aod3d_1064nm.rc b/ESMF/Shared/Chem_Base/MERRA2/Aod3d_1064nm.rc new file mode 100644 index 00000000..fb474817 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Aod3d_1064nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1.064e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [1064 nm] +ssa none Aerosol Single Scatter Albedo [1064 nm] +tau none Aerosol Layer Optical Thickness [1064 nm] +depol none Aerosol Depolarization Ratio [1064 nm] +backscat km-1sr-1 Aerosol Backscatter [1064 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [1064 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [1064 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [1064 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2/Aod3d_355nm.rc b/ESMF/Shared/Chem_Base/MERRA2/Aod3d_355nm.rc new file mode 100644 index 00000000..6d4b1eb2 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Aod3d_355nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.355e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [355 nm] +ssa none Aerosol Single Scatter Albedo [355 nm] +tau none Aerosol Layer Optical Thickness [355 nm] +depol none Aerosol Depolarization Ratio [355 nm] +backscat km-1sr-1 Aerosol Backscatter [355 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [355 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [355 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [355 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2/Aod3d_532nm.rc b/ESMF/Shared/Chem_Base/MERRA2/Aod3d_532nm.rc new file mode 100644 index 00000000..dc2a5074 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Aod3d_532nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +depol none Aerosol Depolarization Ratio [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2/AodBands_Registry.rc b/ESMF/Shared/Chem_Base/MERRA2/AodBands_Registry.rc new file mode 100644 index 00000000..7faf3eb0 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/AodBands_Registry.rc @@ -0,0 +1,116 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1 2 3 4 5 6 7 8 + +filename_optical_properties_DU: ExtData/AeroCom/x/opticsBands_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/opticsBands_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/opticsBands_OC.v1_3.nc +filename_optical_properties_BC: ExtData/AeroCom/x/opticsBands_BC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/opticsBands_BRC.v1_5.nc +filename_optical_properties_SU: ExtData/AeroCom/x/opticsBands_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/opticsBands_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH01 none SW Band 1 +CH02 none SW Band 2 +CH03 none SW Band 3 +CH04 none SW Band 4 +CH05 none SW Band 5 +CH06 none SW Band 6 +CH07 none SW Band 7 +CH08 none SW Band 8 +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2/Aod_CALIPSO.rc b/ESMF/Shared/Chem_Base/MERRA2/Aod_CALIPSO.rc new file mode 100644 index 00000000..b9b8ec4e --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Aod_CALIPSO.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2/Aod_EOS.rc b/ESMF/Shared/Chem_Base/MERRA2/Aod_EOS.rc new file mode 100644 index 00000000..247e2b0b --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Aod_EOS.rc @@ -0,0 +1,121 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- + +# OMI SO2: 305, 310, 324, 380, 440, 500 +# OMI Aerosol: 354 [~340] 388 [~380] 471 [~470] +# MODIS: .47e-6 .55e-6 .659e-6 [~670] .865e-6 1.24e-6 1.64e-6 2.13e-6 +# MISR: 468 [~470] 558 [~550] 672 [~670] 867 [~865] +# PARASOL: 670 [~670] 865 +# AERONET: 340 380 440 500 675 [~670] 870 [~865] 1020 1640 + +n_channels: 12 +r_channels: .340e-6 .380e-6 .440e-6 .470e-6 .500e-6 .55e-6 .670e-6 .865e-6 1.02e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2/Aod_MODIS.rc b/ESMF/Shared/Chem_Base/MERRA2/Aod_MODIS.rc new file mode 100644 index 00000000..41b9608b --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Aod_MODIS.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 7 + +r_channels: .47e-6 .55e-6 .659e-6 .865e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2/Aod_Registry.rc b/ESMF/Shared/Chem_Base/MERRA2/Aod_Registry.rc new file mode 100644 index 00000000..9e58f33f --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Aod_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 4 + +r_channels: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/MERRA2/Chem_Init.rc b/ESMF/Shared/Chem_Base/MERRA2/Chem_Init.rc new file mode 100644 index 00000000..439a0aca --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Chem_Init.rc @@ -0,0 +1,25 @@ +# +# Chemistry Initialization Resource File +# + +# CO +# ---------------------------------------------------- +amp_CO: 1e18 # positive for total mass [kg]; negative for mmr +lat0_CO: 0. # latitude +lon0_CO: 0. # longitude +z0_CO: 5. # altitude [km] +rx_CO: 4000. # axis E-W [km] +ry_CO: 500. # axis N-S [km] +rz_CO: 2. # axis in z [km] + +# DU +# ---------------------------------------------------- +amp_DU: 0. # positive for total mass [kg]; negative for mmr +lat0_DU: 0. # latitude +lon0_DU: 0. # longitude +z0_DU: 5. # altitude [km] +rx_DU: 4000. # axis E-W [km] +ry_DU: 500. # axis N-S [km] +rz_DU: 2. # axis in z [km] + + diff --git a/ESMF/Shared/Chem_Base/MERRA2/Chem_Mie.rc b/ESMF/Shared/Chem_Base/MERRA2/Chem_Mie.rc new file mode 100644 index 00000000..bfcc5a99 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Chem_Mie.rc @@ -0,0 +1,15 @@ +# +# Resorce file for Chem_Mie Module. Defines filename with LUTs and +# available channels +# + +Chem_Mie::du_optics_file: ExtData/AeroCom/x/opticsBands_DU.v15_3.nc +Chem_Mie::ss_optics_file: ExtData/AeroCom/x/opticsBands_SS.v3_3.nc +Chem_Mie::su_optics_file: ExtData/AeroCom/x/opticsBands_SU.v1_3.nc +Chem_Mie::ni_optics_file: ExtData/AeroCom/x/opticsBands_NI.v2_5.nc +Chem_Mie::oc_optics_file: ExtData/AeroCom/x/opticsBands_OC.v1_3.nc +Chem_Mie::brc_optics_file: ExtData/AeroCom/x/opticsBands_BRC.v1_5.nc +Chem_Mie::bc_optics_file: ExtData/AeroCom/x/opticsBands_BC.v1_3.nc + +Chem_Mie::channels: 1 2 3 4 5 6 7 8 + diff --git a/ESMF/Shared/Chem_Base/MERRA2/Chem_MieRegistry.rc b/ESMF/Shared/Chem_Base/MERRA2/Chem_MieRegistry.rc new file mode 100644 index 00000000..5b529bb1 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Chem_MieRegistry.rc @@ -0,0 +1,455 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# XX lists Stratchem's inferred species. See Chem_Registry.rc +# for GMIchem's XX (non-transported) species list. +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to mol/mol +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # carbon monoxide +doing_CO2: no # carbon dioxide +doing_DU: yes # mineral dust +doing_SS: yes # sea salt +doing_SU: yes # sulfates +doing_CFC: no # CFCs +doing_BC: yes # black carbon +doing_OC: yes # organic carbon +doing_BRC: no # brown carbon +doing_NI: yes # nitrate +doing_Rn: no # radon +doing_CH4: no # methane +doing_SC: no # stratospheric chemistry +doing_GMI: no # GMI chemistry (GEOS-5) +doing_XX: no # generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: no # passive tracers + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 10 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC: 34 # stratospheric chemistry +nbins_XX: 18 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 10 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Global carbon monoxide +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +REDUCED +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 m-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +st80_25 'mol mol-1' Stratosphere source 25 day tracer +CO_50_na 'mol mol-1' Anthro CO North America 50 day tracer +SF6 'mol mol-1' Sulfur Hexafluoride tracer +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant emission 90 day tracer +Rn222 'mol mol-1' Radon-222 +Pb210 'mol mol-1' Lead-210 +Be7 'mol mol-1' Beryllium radionuclide 7(Be) +Be10 'mol mol-1' Beryllium radionuclide 10(Be) +CH3I 'mol mol-1' Methyl iodide +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers diff --git a/ESMF/Shared/Chem_Base/MERRA2/Chem_Registry.rc b/ESMF/Shared/Chem_Base/MERRA2/Chem_Registry.rc new file mode 100644 index 00000000..ff74c3ec --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/Chem_Registry.rc @@ -0,0 +1,638 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# Beginning with Heracles-1_0, four TR tracers are enabled in the +# default configuration. For the complete list of TR tracers, see +# Chem_MieRegistry.rc. +# +# StratChem can be run with Full or Reduced equation sets. +# When running Full, the string SC_f should be changed to SC. +# When running Reduced, the string SC_r should be changed to SC. +# This will be automatically done by stratchem_setup script. +# +# XX lists contain non-transported species for GMI and StratChem. +# When running GMI, the string XX_GMI should be changed to XX. +# When running StratChem, the string XX_SC should be changed to XX. +# This will be automatically done by the setup scripts. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to 'mol mol-1' +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + # &Label Active Constituents + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: yes # &YesNo Include carbon monoxide? +doing_CO2: no # &YesNo Include carbon dioxide? +doing_DU: yes # &YesNo Include mineral dust? +doing_SS: yes # &YesNo Include sea salt? +doing_SU: yes # &YesNo Include sulfates? +doing_CFC: no # &YesNo Include CFCs? +doing_BC: yes # &YesNo Include black carbon? +doing_OC: yes # &YesNo Include organic carbon? +doing_BRC: no # &YesNo Include brown carbon? +doing_NI: yes # &YesNo Include nitrate? +doing_Rn: no # &YesNo include Radon? +doing_CH4: no # &YesNo include Methane? +doing_SC: no # &YesNo Include stratospheric chemistry? +doing_GMI: no # &YesNo GMI chemistry (GEOS-5) +doing_XX: no # &YesNo generic tracer +doing_PC: yes # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: yes # &YesNo run passive tracers? + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC_f: 52 # stratospheric chemistry (full) +nbins_XX_SC_f: 18 # stratchem (full) non-transported species +nbins_SC_r: 33 # stratospheric chemistry (reduced) +nbins_XX_SC_r: 37 # stratchem (reduced) non-transported species +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_XX_GMI: 48 # GMI non-transported species +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 4 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Carbon Monoxide (All Sources) +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide (All Sources) +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +OCphobicbbbo 'kg kg-1' Hydrophobic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphilicbbbo 'kg kg-1' Hydrophilic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphobicbbnb 'kg kg-1' Hydrophobic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +OCphilicbbnb 'kg kg-1' Hydrophilic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 cm-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +H 'mol mol-1' Ground state atomic hydrogen (2S) +MO2 'mol mol-1' Methylperoxy radical (CH3O2) +N 'mol mol-1' Ground state atomic nitrogen +O 'mol mol-1' Ground state atomic oxygen (3P) +O1D 'mol mol-1' First excited singlet state of atomic oxygen (1D) +A3O2 'mol mol-1' Primary RO2 (C3H7O2) from propane +ATO2 'mol mol-1' RO2 from acetone (C3H6O3) +B3O2 'mol mol-1' Secondary RO2 (C3H7O2) from propane +EOH 'mol mol-1' Ethanol +ETO2 'mol mol-1' Ethylperoxy radical (C2H5O2) +GLYC 'mol mol-1' Glycolaldehyde (Hydroxyacetaldehyde C2H4O2) +GLYX 'mol mol-1' Glyoxal (2CHO) +IAO2 'mol mol-1' RO2 (C5H9O5) from isoprene oxidation products +INO2 'mol mol-1' RO2 (C5H8O3N) from ISOP+NO3 +INPN 'mol mol-1' Peroxide (C5H8O6N2) from INO2 +ISN1 'mol mol-1' RO2 (C4H7O4N) from ISN2 +ISNP 'mol mol-1' Peroxide (C4H7O4N) from ISN1 +KO2 'mol mol-1' RO2 (C4H7O3) from C3 ketones +MAN2 'mol mol-1' RO2 (C4H6O6N) from MACR+NO3 +MAO3 'mol mol-1' Peroxyacyl (C4H5O3) from MACR and MVK +MAOP 'mol mol-1' Peroxide (C4H6O3) from MAO3 +MAP 'mol mol-1' Peroxyacetic acid (C2H4O3) +MCO3 'mol mol-1' Peroxyacetyl radical (C2H3O3) +MGLY 'mol mol-1' Methylglyoxal (C3H4O2) +MRO2 'mol mol-1' RO2 (C4H7O4) from MACR+OH +MRP 'mol mol-1' Peroxide (C4H8O4) from MRO2 +PO2 'mol mol-1' RO2 (C3H7O3) from propene +PP 'mol mol-1' Peroxide (C3H8O3) from PO2 +PRN1 'mol mol-1' RO2 (C3H6O3N) from propene+NO3 +PRPN 'mol mol-1' Peroxide (C3H6O3N) from PRN1 +R4N1 'mol mol-1' RO2 (C4H9O3N) from R4N2 +R4O2 'mol mol-1' RO2 (C4H9O2) from ALK4 +R4P 'mol mol-1' Peroxide (C4H10O2) from R4O2 +RA3P 'mol mol-1' Peroxy propyl alcohol (C3H8O2) from A3O2 +RB3P 'mol mol-1' Peroxide (C3H8O2) from B3O2 +RCO3 'mol mol-1' Peroxypropionyl radical (C3H5O3) +RIO1 'mol mol-1' RO2 (C5H9O3) from isoprene oxydation products +RIO2 'mol mol-1' RO2 (C5H9O3) from isoprene +RIP 'mol mol-1' Peroxide (C5H10O3) from RIO2 +ROH 'mol mol-1' C2 alcohols +RP 'mol mol-1' Methacrolein peroxy acid (C4H6O3) +VRO2 'mol mol-1' RO2 (C4H7O4) from MVK+OH +VRP 'mol mol-1' Peroxide (C4H8O4) from VRO2 +OCSg 'mol mol-1' Carbonyl sulfide in GMI +ACET 'mol mol-1' Acetone +O2 cm-3 Molecular oxygen +NUMDENS cm-3 Total number density +T2M15d K Daily T2M time average +:: + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant burden 90 day tracer +Rn222 'kg kg-1' Radon-222 +CH3I 'mol mol-1' Methyl iodide +Pb210 'kg kg-1' Lead-210 +nh_5 'mol mol-1' Northern Hemisphere 5 day tracer +nh_50 'mol mol-1' Northern Hemisphere 50 day tracer +aoa_nh days Age of air northern hemisphere tracer +st80_25 'mol mol-1' Stratospheric source 25 day tracer +CO_25 'mol mol-1' Anthro CO 25 day tracer +CO_50 'mol mol-1' Anthro CO 50 day tracer +CO_50_ea 'mol mol-1' Anthro CO 50 day tracer East Asia +CO_50_na 'mol mol-1' Anthro CO 50 day tracer North America +CO_50_eu 'mol mol-1' Anthro CO 50 day tracer Europe +CO_50_sa 'mol mol-1' Anthro CO 50 day tracer South Asia +SF6 'mol mol-1' Sulfur Hexafluoride tracer +e90_n 'mol mol-1' Constant burden 90 day tracer 40N-pole emiss +e90_s 'mol mol-1' Constant burden 90 day tracer 40S-pole emiss +Be7 'kg kg-1' Beryllium radionuclide 7(Be) +Be10 'kg kg-1' Beryllium radionuclide 10(Be) +stOX 'mol mol-1' Strat Ozone with chemical loss +Be7s 'kg kg-1' Beryllium radionuclide 7(Be) strat-source +Be10s 'kg kg-1' Beryllium radionuclide 10(Be) strat-source +Pb210s 'kg kg-1' Lead-210 strat-source +CO_GLB 'mol mol-1' CO 50 day tracer Global CMIP6+M2G +CO_NAM 'mol mol-1' CO 50 day tracer North America CMIP6+M2G +CO_EUR 'mol mol-1' CO 50 day tracer Europe CMIP6+M2G +CO_SAS 'mol mol-1' CO 50 day tracer South Asia CMIP6+M2G +CO_EAS 'mol mol-1' CO 50 day tracer East Asia CMIP6+M2G +CO_SEA 'mol mol-1' CO 50 day tracer Southeast Asia CMIP6+M2G +CO_ANZ 'mol mol-1' CO 50 day tracer Australia & New Zealand CMIP6+M2G +CO_NAF 'mol mol-1' CO 50 day tracer North Africa CMIP6+M2G +CO_RAF 'mol mol-1' CO 50 day tracer Rest of Africa CMIP6+M2G +CO_MDE 'mol mol-1' CO 50 day tracer Middle East CMIP6+M2G +CO_CAM 'mol mol-1' CO 50 day tracer Central America CMIP6+M2G +CO_SAM 'mol mol-1' CO 50 day tracer South America CMIP6+M2G +CO_RBU 'mol mol-1' CO 50 day tracer Russia & Belarus & Ukraine CMIP6+M2G +CO_CAS 'mol mol-1' CO 50 day tracer Central Asia CMIP6+M2G +CO_ARC 'mol mol-1' CO 50 day tracer Arctic CMIP6+M2G +CO_from_CH4 'mol mol-1' CO from global average CH4 oxidation +aoa_bl days Age of air above boundary layer +:: + + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers + diff --git a/ESMF/Shared/Chem_Base/MERRA2/tavg3d_ext_p.rc b/ESMF/Shared/Chem_Base/MERRA2/tavg3d_ext_p.rc new file mode 100644 index 00000000..d84b6cb3 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MERRA2/tavg3d_ext_p.rc @@ -0,0 +1,55 @@ +# lcv2prs.rc +# +# This is a resource file for the lcv2prs utility. +# +# !REVISION HISTORY: +# +# 27Jan2006 B. Yin First version. +# 25Apr2006 Todling Declared dims so fvsetup get set them up. +# 17May2006 Stassi modified from tavg3d_tmp_v.rc for pressure levels +# +#........................................................................... + +# ---------------------- +# Output File Resolution +# ---------------------- + +zonal_resolution: 540 # no. of zonal grid-points (im) +west_most_longitude_in_deg: -180.0 # longitude of first point (i=1) +meridional_resolution: 361 # no. meridional grid-points (jm) +vertical_levels_in_hPa: 1000 975 950 925 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 30 20 10 + +# ---------------- +# Variable Classes +# ---------------- + +# A variable class lists the variable names that make up a file type or product. + +# +### PRODUCT: tavg3d_ext_p (3-D tendency) +VarClass*tavg3d_ext_p: delp rh extinction ssa tau +# -------------------- +# Variable Translation +# -------------------- + +Variable_translation_table:: + +# Output | Input +# Name Units | Name scale_factor add_offset Positive check +# ------------------------------------------------------------------------------ + DELP Pa delp 1.0 0.0 0 + RH fraction rh 1.0 0.0 0 + SSA fraction ssa 1.0 0.0 0 + EXTINCTION 1/km extinction 1.0 0.0 0 + TAU UNITLESS tau 1.0 0.0 0 +:: + + + +# Table for variable names and description: + +DELP: Pressure difference between layer edges +RH: Relative Humidity +SSA: Aerosol Single Scatter Albedo [532 nm] +EXTINCTION: Aerosol Extinction [532 nm] +TAU: Aerosol Layer Optical Thickness [532 nm] diff --git a/ESMF/Shared/Chem_Base/MieObs_py.F90 b/ESMF/Shared/Chem_Base/MieObs_py.F90 new file mode 100644 index 00000000..48b25a92 --- /dev/null +++ b/ESMF/Shared/Chem_Base/MieObs_py.F90 @@ -0,0 +1,640 @@ +! +! Simple f77 wrapper for the Python interface to the Mie Calculator. +! This version works from columns already interpolated to obs location. + + + +subroutine getMieDims ( mieTableFile, nCh, nRh, nBin, nMom, nPol, rc) + +! Retrieve dimensions of MieTable + + use Chem_MieTableMod, only: Chem_MieTableGetDims + implicit NONE + character(len=*), intent(in) :: mieTableFile ! input Mie Table file name + integer, intent(out) :: nCh + integer, intent(out) :: nRh + integer, intent(out) :: nBin + integer, intent(out) :: nMom + integer, intent(out) :: nPol + integer, intent(out) :: rc ! return code + + call Chem_MieTableGetDims(mieTableFile, nCh, nRh, nBin, nMom, nPol, rc) + +end subroutine getMieDims + +!............................................................................. + + subroutine getEdgeVars ( km, nobs, airdens, delp, ptop, & + pe, ze, te ) +! +! Get pressure and temperature at the edge of layers, +! + + implicit NONE + + integer, intent(in) :: km ! number vertical layers + integer, intent(in) :: nobs ! number of profiles + + real, intent(in) :: airdens(km,nobs) + real, intent(in) :: delp(km,nobs) + real, intent(in) :: ptop ! top (edge) pressure [Pa] + + real, intent(out) :: pe(km+1,nobs) ! edge pressure [Pa] + real, intent(out) :: ze(km+1,nobs) ! edge height above sfc [m] + real, intent(out) :: te(km+1,nobs) ! edge Temperature [K] + +! --- + + integer :: k, n + + real :: alpha, pm(km), tm(km) + + real, parameter :: grav = 9.80616 + real, parameter :: Rgas = 287. + real, parameter :: kappa = 2.0 / 7.0 + + do n = 1, nobs + + pe(1,n) = ptop + do k = 1, km + pe(k+1,n) = pe(k,n) + delp(k,n) + end do + + ze(km+1,n) = 0.0 ! height above surface + do k = km, 1, -1 + ze(k,n) = ze(k+1,n) + delp(k,n) / ( airdens(k,n) * grav ) + end do + + do k = 1, km + pm(k) = ( pe(k,n) + pe(k+1,n) ) / 2.0 + tm(k) = pm(k) / ( airdens(k,n) * Rgas ) + end do + + te(1,n) = tm(1) ! isothermal at highest level + do k = 2, km + alpha = log(pe(k,n)/pm(k-1))/log(pm(k)/pm(k-1)) + te(k,n) = tm(k-1) + alpha * (tm(k) - tm(k-1) ) + end do + ! dry adiabatic + te(km+1,n) = tm(km) * (pe(km+1,n)/pm(km))**kappa + + end do + +end subroutine getEdgeVars + +!................................................................................... + + subroutine getAOPscalar ( km, nobs, nch, nq, rcfile, channels, vname, verbose, & + qm, rh, & + tau, ssa, g, rc ) + +! Returns aod, ssa and asymmetry factor profiles. + + use Chem_MieMod + implicit NONE + + integer, intent(in) :: km ! number vertical layers + integer, intent(in) :: nobs ! number of profiles + + character(len=*), intent(in) :: rcfile ! resource file, e.g., Aod_EOS.rc + + integer, intent(in) :: nch ! number of channels + real, intent(in) :: channels(nch) + + integer, intent(in) :: nq ! number of tracers + character, intent(in) :: vname(nq,16) ! variable name + + integer, intent(in) :: verbose + + real, intent(in) :: qm(km,nq,nobs) ! (mixing ratio) * delp/g + real, intent(in) :: rh(km,nobs) ! relative humidity + + real, intent(out) :: tau(km,nch,nobs) ! aerosol optical depth + real, intent(out) :: ssa(km,nch,nobs) ! single scattering albedo + real, intent(out) :: g(km,nch,nobs) ! asymmetry factor + + integer, intent(out) :: rc + +! --- + + type(Chem_Mie) :: mieTables + real :: idxChannel(nch) ! this should have been integer + integer :: idxTable + character(len=16) :: vname_(nq) + + integer :: iq, n, m, i, k + real :: tau_, ssa_, g_ + + rc = 0 + +! Deal with f2py strange handling of strings +! ------------------------------------------ + do iq = 1, nq + do n = 1, 16 + vname_(iq)(n:n) = vname(iq,n) + end do + end do + +! Create the Mie Tables +! --------------------- + mieTables = Chem_MieCreate(rcfile,rc) + if ( rc /= 0 ) then + print *, 'Cannot create Mie tables from '//trim(rcfile) + return + end if + +! Determine channel indices +! ------------------------- + do n = 1, nch + idxChannel(n) = -1 ! this is really the channel index + do m = 1, mieTables%nch + if ( abs(channels(n) - (1.e9)*mieTables%channels(m)) < 1. ) then + idxChannel(n) = m + exit + end if + end do + end do + if ( any(idxChannel<0) ) then + print *, 'Mie resource files does not set the required channel' + print *, 'Channels requested: ', channels + print *, 'Channels on RC file: ', 1.e+9 * mieTables%channels + rc = 99 + return + end if + +! Initialize output arrays to zero +! -------------------------------- + tau = 0.0 + ssa = 0.0 + g = 0.0 + +! Loop over aerosol species +! ------------------------- + do iq = 1,nq + idxTable = Chem_MieQueryIdx(mieTables,vname_(iq),rc) + if(idxTable == -1) cycle + if ( rc/=0 ) then + print *, 'cannot get Mie index for '//vname_(iq) + return + end if + + if (verbose==1) & + print *, '[+] Adding '//trim(vname_(iq))//' contribution' + +! Loop over nobs, km, nch +! -------------------------- + do i = 1, nobs + do n = 1, nch + do k =1, km + + call Chem_MieQuery(mieTables, idxTable, idxChannel(n), & + qm(k,iq,i), rh(k,i), tau=tau_, ssa=ssa_, gasym=g_) + + tau(k,n,i) = tau(k,n,i) + tau_ + ssa(k,n,i) = ssa(k,n,i) + ssa_ * tau_ + g(k,n,i) = g(k,n,i) + g_ * ssa_ * tau_ + + end do ! end nch + end do ! end km + end do ! end nobs + end do ! end tracers + +! Normalize ssa and g +! ------------------- + where ( tau > 0.0 ) ssa = ssa / tau + where ( ssa*tau > 0.0 ) g = g / ( ssa * tau ) + + call Chem_MieDestroy(mieTables, rc) + if ( rc /= 0 ) then + print *, 'Cannot destroy MieTables' + return + end if + + + end subroutine getAOPscalar + +!................................................................................... + + subroutine getAOPvector ( km, nobs, nch, nq, rcfile, channels, vname, verbose, & + qm, rh,nMom,nPol, & + tau, ssa, g, pmom, rc ) + +! Returns aod, ssa, asymmetry factor, phase function profiles. + + use Chem_MieMod + implicit NONE + + integer, intent(in) :: km ! number vertical layers + integer, intent(in) :: nobs ! number of profiles + + character(len=*), intent(in) :: rcfile ! resource file, e.g., Aod_EOS.rc + + integer, intent(in) :: nch ! number of channels + real, intent(in) :: channels(nch) + + integer, intent(in) :: nMom ! number of legender momemts + integer, intent(in) :: nPol ! number of components of the scattering matrix + + integer, intent(in) :: nq ! number of tracers + character, intent(in) :: vname(nq,16) ! variable name + + integer, intent(in) :: verbose + + real, intent(in) :: qm(km,nq,nobs) ! (mixing ratio) * delp/g + real, intent(in) :: rh(km,nobs) ! relative humidity + + real, intent(out) :: tau(km,nch,nobs) ! aerosol optical depth + real, intent(out) :: ssa(km,nch,nobs) ! single scattering albedo + real, intent(out) :: g(km,nch,nobs) ! asymmetry factor + real, intent(out) :: pmom(km,nch,nobs,nMom,nPol) ! elements of scattering phase matrix + + integer, intent(out) :: rc + +! ------------------------------------------------------------------------------------- +! PMOM Notes: +! +! The paramer "pmom" contains elements of the phase matrix and it is dimensioned as +! (npol,nmom,radius,rh,lambda) where +! +! nmom = number of phase function moments in the file +! npol = index of the phase function quantity +! npol = 4 or 6 +! +! index moments of quantity +! ----- ------------------- +! 1 P11 +! 2 P12 +! 3 P33 +! 4 P34 +! 5 P22 +! 6 P44 +! +! Note that for Mie based tables we only have npol = 4. For the ellipsoid +! tables we have npol = 6 and have appended the P22 and P44 as the last +! two indices. From symmetry, for Mie based tables we know P22 = P11 and +! P44 = P33. +! +! In this code, if nPol=6 is requested, we allways return 6 elements of the +! phase matrix, setting P22=P11 and P44=P33 if needed. +! +! ------------------------------------------------------------------------------------- + +! --- + + type(Chem_Mie) :: mieTables + real :: idxChannel(nch) ! this should have been integer + integer :: idxTable + character(len=16) :: vname_(nq) + + integer :: iq, n, m, i, k,iMom, iPol, nPol_ + real :: tau_, ssa_, g_ + real, pointer :: pmom_(:,:) + logical :: spherical_ext ! whether to set P22=P11 and P44=P11 + integer :: iP11=1, iP12=2, iP33=3, iP34=4, iP22=5, iP44=6 + + rc = 0 + +! Deal with f2py strange handling of strings +! ------------------------------------------ + do iq = 1, nq + do n = 1, 16 + vname_(iq)(n:n) = vname(iq,n) + end do + end do + +! Create the Mie Tables +! --------------------- + mieTables = Chem_MieCreate(rcfile,rc) + print *, 'mietables', mieTables%bc_optics_file + if ( rc /= 0 ) then + print *, 'Cannot create Mie tables from '//trim(rcfile) + return + end if + + if ( nMom > mieTables%nMom ) then ! mieTables%nMom is writen in Aod_EOS.rc file + print *, 'mieTables do not have enough moments', nMom, mieTables%nMom + rc = 99 + return + end if + +! Determine channel indices +! ------------------------- + do n = 1, nch + idxChannel(n) = -1 ! this is really the channel index + do m = 1, mieTables%nch + if ( abs(channels(n) - (1.e9)*mieTables%channels(m)) < 1. ) then + idxChannel(n) = m + exit + end if + end do + end do + if ( any(idxChannel<0) ) then + print *, 'Mie resource files does not set the required channel' + print *, 'Channels requested: ', channels + print *, 'Channels on RC file: ', 1.e+9 * mieTables%channels + rc = 99 + return + end if + +! Allocate memory for phase function; size determined by what kind +! table has been loaded; n_moments given in Aod_EOS.rc +! ---------------------------------------------------------------- +! print *,'nmom mietable', mieTables%nMom,mieTables%vtableUse%nMom +! print *,'npol mietable', mieTables%nPol,mieTables%vtableUse%nPol + + +! Initialize output arrays to zero +! -------------------------------- + tau = 0.0 + ssa = 0.0 + g = 0.0 + pmom=0.0 + +! Loop over aerosol species +! ------------------------- + do iq = 1,nq + + idxTable = Chem_MieQueryIdx(mieTables,vname_(iq),rc) + if(idxTable == -1) cycle + if ( rc/=0 ) then + print *, 'cannot get Mie index for '//vname_(iq) + return + end if + + if (verbose==1) & + print *, '[+] Adding '//trim(vname_(iq))//' contribution' + +! Check number of moments on file for this species +! ------------------------------------------------ + if ( nMom > mieTables%vtableUse%nMom ) then + print *, 'ERROR: mieTables do not have enough moments', nMom, mieTables%vtableUse%nMom + rc = 666 + return + end if + +! Handle possible case of non-spherical dust, but spherical everything else +! ------------------------------------------------------------------------- + if ( nPol .LE. mieTables%vtableUse%nPol ) then ! user requests fewer polarizations + nPol_ = nPol + print*,'nPol mie table', mieTables%vtableUse%nPol + spherical_ext = .FALSE. + else if ( nPol == 6 .AND. mieTables%vtableUse%nPol == 4 ) then + nPol_ = 4 ! file only has 4, user wants 6 + spherical_ext = .TRUE. ! special case, will set P22=P11, P44=P33 + else + rc = 777 + print *, 'ERROR: inconsistent number of polarizations: ', nPol, mieTables%vtableUse%nPol + return + end if + print *, 'npol_ test',iq, nPol_ + + allocate(pmom_(mieTables%nMom,nPol_),stat=rc) + if ( rc /= 0 ) then + print *, 'Cannot allocate memory for pmom_' + return + end if +! STOP +! Loop over nobs, km, nch +! -------------------------- + do i = 1, nobs + do n = 1, nch + do k =1, km + + call Chem_MieQuery(mieTables, idxTable, idxChannel(n), & + qm(k,iq,i), rh(k,i), tau=tau_, ssa=ssa_, gasym=g_,pmom=pmom_) + + tau(k,n,i) = tau(k,n,i) + tau_ + ssa(k,n,i) = ssa(k,n,i) + ssa_ * tau_ + g(k,n,i) = g(k,n,i) + g_ * ssa_ * tau_ + do ipol=1, nPol_ + do imom=1, nMom + pmom(k,n,i,imom,ipol) = pmom(k,n,i,imom,ipol) & + + pmom_(imom,ipol) * ssa_ * tau_ + + end do + end do + +! Special handling, spherical symmetry +! ------------------------------------ + if ( spherical_ext ) then + pmom(k,n,i,:,iP22) = pmom(k,n,i,:,iP11) + pmom(k,n,i,:,iP44) = pmom(k,n,i,:,iP33) + end if + + end do ! end nch + end do ! end km + end do ! end nobs + deallocate(pmom_) + end do ! end tracers + print*, 'end tracer', iq +! Normalize ssa and g +! ------------------- + where ( tau > 0.0 ) ssa = ssa / tau + where ( ssa*tau > 0.0 ) g = g / ( ssa * tau ) + do i = 1,nobs + do n = 1, nch + do k = 1, km + do ipol=1, nPol ! normalize Pmom + do imom=1, nMom + if (( ssa(k,n,i) * tau(k,n,i) ) > 0.0 ) then + pmom(k,n,i,imom,ipol) = pmom(k,n,i,imom,ipol) / ( ssa(k,n,i) * tau(k,n,i) ) + end if + end do + end do + end do + end do + end do + + + + call Chem_MieDestroy(mieTables, rc) + if ( rc /= 0 ) then + print *, 'Cannot destroy MieTables' + return + end if + + end subroutine getAOPvector + +!................................................................................... + + subroutine getExt ( km, nobs, nch, nq, rcfile, channels, vname, verbose, & + qc,qm, rh, ext, sca, bsc, absc_SFC, absc_TOA, depol, rc ) + +! Returns aerosol extinction profile. + + use Chem_MieMod + implicit NONE + + integer, intent(in) :: km ! number vertical layers + integer, intent(in) :: nobs ! number of profiles + + integer, intent(in) :: nch ! number of channels + real, intent(in) :: channels(nch) + + integer, intent(in) :: nq ! number of tracers + character(len=*), intent(in) :: rcfile ! resource file, e.g., Aod_EOS.rc + + character, intent(in) :: vname(nq,16) ! variable name + + integer, intent(in) :: verbose + + real, intent(in) :: qc(km,nq,nobs) ! (mixing ratio) * (air density) + real, intent(in) :: qm(km,nq,nobs) ! (mixing ratio) * delp/g + real, intent(in) :: rh(km,nobs) ! relative humidity + + real, intent(out) :: ext(km,nch,nobs) ! total aerosol extinction + real, intent(out) :: sca(km,nch,nobs) ! scattering extinction + real, intent(out) :: bsc(km,nch,nobs) ! total aero backscatter (toa) + real, intent(out) :: absc_TOA(km,nch,nobs) ! attenuated aero bascatter (from toa) + real, intent(out) :: absc_SFC(km,nch,nobs) ! attenuated aero bascatter (from surface) + real, intent(out) :: depol(km,nch,nobs) ! depolarization ratio + + integer, intent(out) :: rc + +! --- + + real :: depol_(km,nch,nobs) ! numerator of depolatization ratio + + type(Chem_Mie) :: mieTables + real :: idxChannel(nch) ! this should have been integer + integer :: idxTable + character(len=16) :: vname_(nq) + + integer :: iq, n, m, i, k, l + real :: ext_, bsc_,ssa_,bext_,tau_,taulev, p11_, p22_ + real :: tau(km,nch,nobs) + + rc = 0 + +! Deal with f2py strange handling of strings +! ------------------------------------------ + do iq = 1, nq + do n = 1, 16 + vname_(iq)(n:n) = vname(iq,n) + end do + end do + +! Create the Mie Tables +! --------------------- + mieTables = Chem_MieCreate(rcfile,rc) + if ( rc /= 0 ) then + print *, 'Cannot create Mie tables from ' // trim(rcfile) + return + end if + +! Determine channel indices +! ------------------------- + do n = 1, nch + idxChannel(n) = -1 ! this is really the channel index + do m = 1, mieTables%nch + if ( abs(channels(n) - (1.e9)*mieTables%channels(m)) < 1. ) then + idxChannel(n) = m + exit + end if + end do + end do + if ( any(idxChannel<0) ) then + print *, 'Mie resource files does not set the required channel' + print *, 'Channels requested: ', channels + print *, 'Channels on RC file: ', 1.e+9 * mieTables%channels + rc = 99 + return + end if + +! Initialize output arrays to zero +! -------------------------------- + ext = 0.0 + sca = 0.0 + bsc = 0.0 + tau = 0.0 + absc_TOA = 0.0 + absc_SFC = 0.0 + depol = 0.0 + depol_ = 0.0 + +! Loop over aerosol species +! ------------------------- + do iq = 1,nq + idxTable = Chem_MieQueryIdx(mieTables,vname_(iq),rc) + if(idxTable == -1) cycle + if ( rc/=0 ) then + print *, 'cannot get Mie index for '//vname_(iq) + return + end if + + if (verbose==1) & + print *, '[+] Adding '//trim(vname_(iq))//' contribution' + +! Loop over nobs, km, nch +! -------------------------- + do i = 1, nobs + do n = 1, nch + do k =1, km + + call Chem_MieQuery(mieTables, idxTable, idxChannel(n), & + qc(k,iq,i), rh(k,i), tau=ext_,& + ssa=ssa_,bext=bext_, bbck=bsc_ ) + + ext(k,n,i) = ext(k,n,i) + ext_ + sca(k,n,i) = sca(k,n,i) + ssa_ * ext_ + bsc(k,n,i) = bsc(k,n,i) + bsc_*qc(k,iq,i) + + call Chem_MieQuery(mieTables, idxTable, idxChannel(n), & + qm(k,iq,i), rh(k,i), tau=tau_, p11=p11_, p22=p22_) + + tau(k,n,i) = tau(k,n,i) + tau_ + depol(k,n,i) = depol(k,n,i) + (p11_-p22_)*ssa_*tau_ + depol_(k,n,i) = depol_(k,n,i) + (p11_+p22_)*ssa_*tau_ + + end do ! end nch + end do ! end km + end do ! end nobs + end do ! end tracers + + ! Depolarization ratio + ! -------------------- + where (depol_>0) + depol = depol / depol_ + elsewhere + depol = 0.0 + endwhere + + bsc= bsc*1e03 ! in km-1 sr-1 + ext= ext*1e03 ! in km-1 + sca= sca*1e03 ! in km-1 + +! Attenuated backscatter from space + + absc_TOA(1,:,:) = bsc(1,:,:)*exp(-tau(1,:,:)) + do n = 1, nch + do k = 2, km + do i = 1, nobs + taulev = 0. + do l = 1, k-1 + taulev = taulev + tau(l,n,i) + enddo + taulev = taulev + 0.5 *tau(k,n,i) + absc_TOA(k,n,i) = bsc(k,n,i)*exp(-2.*taulev) + enddo + enddo + enddo + +! Attenuated backscatter from surface + + absc_SFC(km,:,:)= bsc(km,:,:)*exp(-tau(km,:,:)) + do n = 1, nch + do k = km -1, 1, -1 + do i = 1, nobs + taulev = 0. + do l = km, k+1, -1 + taulev = taulev + tau(l,n,i) + enddo + taulev = taulev + 0.5 * tau(k,n,i) + absc_SFC(k,n,i) = bsc(k,n,i)*exp(-2.*taulev) + enddo + enddo + enddo + +end subroutine getExt + + diff --git a/ESMF/Shared/Chem_Base/NR/Aod-550nm_Registry.rc b/ESMF/Shared/Chem_Base/NR/Aod-550nm_Registry.rc new file mode 100644 index 00000000..0a1334fc --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Aod-550nm_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 5.5e-7 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/NR/Aod3d_1064nm.rc b/ESMF/Shared/Chem_Base/NR/Aod3d_1064nm.rc new file mode 100644 index 00000000..fb474817 --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Aod3d_1064nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1.064e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [1064 nm] +ssa none Aerosol Single Scatter Albedo [1064 nm] +tau none Aerosol Layer Optical Thickness [1064 nm] +depol none Aerosol Depolarization Ratio [1064 nm] +backscat km-1sr-1 Aerosol Backscatter [1064 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [1064 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [1064 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [1064 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/NR/Aod3d_355nm.rc b/ESMF/Shared/Chem_Base/NR/Aod3d_355nm.rc new file mode 100644 index 00000000..6d4b1eb2 --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Aod3d_355nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.355e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [355 nm] +ssa none Aerosol Single Scatter Albedo [355 nm] +tau none Aerosol Layer Optical Thickness [355 nm] +depol none Aerosol Depolarization Ratio [355 nm] +backscat km-1sr-1 Aerosol Backscatter [355 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [355 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [355 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [355 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/NR/Aod3d_532nm.rc b/ESMF/Shared/Chem_Base/NR/Aod3d_532nm.rc new file mode 100644 index 00000000..dc2a5074 --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Aod3d_532nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +depol none Aerosol Depolarization Ratio [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/NR/AodBands_Registry.rc b/ESMF/Shared/Chem_Base/NR/AodBands_Registry.rc new file mode 100644 index 00000000..7faf3eb0 --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/AodBands_Registry.rc @@ -0,0 +1,116 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1 2 3 4 5 6 7 8 + +filename_optical_properties_DU: ExtData/AeroCom/x/opticsBands_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/opticsBands_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/opticsBands_OC.v1_3.nc +filename_optical_properties_BC: ExtData/AeroCom/x/opticsBands_BC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/opticsBands_BRC.v1_5.nc +filename_optical_properties_SU: ExtData/AeroCom/x/opticsBands_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/opticsBands_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH01 none SW Band 1 +CH02 none SW Band 2 +CH03 none SW Band 3 +CH04 none SW Band 4 +CH05 none SW Band 5 +CH06 none SW Band 6 +CH07 none SW Band 7 +CH08 none SW Band 8 +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/NR/Aod_CALIPSO.rc b/ESMF/Shared/Chem_Base/NR/Aod_CALIPSO.rc new file mode 100644 index 00000000..b9b8ec4e --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Aod_CALIPSO.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/NR/Aod_EOS.rc b/ESMF/Shared/Chem_Base/NR/Aod_EOS.rc new file mode 100644 index 00000000..247e2b0b --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Aod_EOS.rc @@ -0,0 +1,121 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- + +# OMI SO2: 305, 310, 324, 380, 440, 500 +# OMI Aerosol: 354 [~340] 388 [~380] 471 [~470] +# MODIS: .47e-6 .55e-6 .659e-6 [~670] .865e-6 1.24e-6 1.64e-6 2.13e-6 +# MISR: 468 [~470] 558 [~550] 672 [~670] 867 [~865] +# PARASOL: 670 [~670] 865 +# AERONET: 340 380 440 500 675 [~670] 870 [~865] 1020 1640 + +n_channels: 12 +r_channels: .340e-6 .380e-6 .440e-6 .470e-6 .500e-6 .55e-6 .670e-6 .865e-6 1.02e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/NR/Aod_MODIS.rc b/ESMF/Shared/Chem_Base/NR/Aod_MODIS.rc new file mode 100644 index 00000000..41b9608b --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Aod_MODIS.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 7 + +r_channels: .47e-6 .55e-6 .659e-6 .865e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/NR/Aod_Registry.rc b/ESMF/Shared/Chem_Base/NR/Aod_Registry.rc new file mode 100644 index 00000000..9e58f33f --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Aod_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 4 + +r_channels: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 + +filename_optical_properties_DU: ExtData/AeroCom/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/AeroCom/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/AeroCom/x/optics_OC.v1_3.nc +filename_optical_properties_BC: ExtData/AeroCom/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/AeroCom/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/AeroCom/x/optics_NI.v2_5.nc +filename_optical_properties_BRC: ExtData/AeroCom/x/optics_BRC.v1_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/NR/Chem_Init.rc b/ESMF/Shared/Chem_Base/NR/Chem_Init.rc new file mode 100644 index 00000000..439a0aca --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Chem_Init.rc @@ -0,0 +1,25 @@ +# +# Chemistry Initialization Resource File +# + +# CO +# ---------------------------------------------------- +amp_CO: 1e18 # positive for total mass [kg]; negative for mmr +lat0_CO: 0. # latitude +lon0_CO: 0. # longitude +z0_CO: 5. # altitude [km] +rx_CO: 4000. # axis E-W [km] +ry_CO: 500. # axis N-S [km] +rz_CO: 2. # axis in z [km] + +# DU +# ---------------------------------------------------- +amp_DU: 0. # positive for total mass [kg]; negative for mmr +lat0_DU: 0. # latitude +lon0_DU: 0. # longitude +z0_DU: 5. # altitude [km] +rx_DU: 4000. # axis E-W [km] +ry_DU: 500. # axis N-S [km] +rz_DU: 2. # axis in z [km] + + diff --git a/ESMF/Shared/Chem_Base/NR/Chem_Mie.rc b/ESMF/Shared/Chem_Base/NR/Chem_Mie.rc new file mode 100644 index 00000000..3643e6cf --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Chem_Mie.rc @@ -0,0 +1,15 @@ +# +# Resorce file for Chem_Mie Module. Defines filename with LUTs and +# available channels +# + +Chem_Mie::du_optics_file: ExtData/AeroCom/x/opticsBands_DU.v15_3.nc +Chem_Mie::ss_optics_file: ExtData/AeroCom/x/opticsBands_SS.v3_3.nc +Chem_Mie::su_optics_file: ExtData/AeroCom/x/opticsBands_SU.v1_3.nc +Chem_Mie::ni_optics_file: ExtData/AeroCom/x/opticsBands_NI.v2_5.nc +Chem_Mie::oc_optics_file: ExtData/AeroCom/x/opticsBands_OC.v1_3.nc +Chem_Mie::brc_optics_file: ExtData/AeroCom/x/opticsBands_BRC.v1_5.nc +Chem_Mie::bc_optics_file: ExtData/AeroCom/x/opticsBands_BC.v1_3.nc + +Chem_Mie::channels: 1 2 3 4 5 6 7 8 + diff --git a/ESMF/Shared/Chem_Base/NR/Chem_MieRegistry.rc b/ESMF/Shared/Chem_Base/NR/Chem_MieRegistry.rc new file mode 100644 index 00000000..5b529bb1 --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Chem_MieRegistry.rc @@ -0,0 +1,455 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# XX lists Stratchem's inferred species. See Chem_Registry.rc +# for GMIchem's XX (non-transported) species list. +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to mol/mol +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # carbon monoxide +doing_CO2: no # carbon dioxide +doing_DU: yes # mineral dust +doing_SS: yes # sea salt +doing_SU: yes # sulfates +doing_CFC: no # CFCs +doing_BC: yes # black carbon +doing_OC: yes # organic carbon +doing_BRC: no # brown carbon +doing_NI: yes # nitrate +doing_Rn: no # radon +doing_CH4: no # methane +doing_SC: no # stratospheric chemistry +doing_GMI: no # GMI chemistry (GEOS-5) +doing_XX: no # generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: no # passive tracers + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 10 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC: 34 # stratospheric chemistry +nbins_XX: 18 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 10 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Global carbon monoxide +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +REDUCED +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 m-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +st80_25 'mol mol-1' Stratosphere source 25 day tracer +CO_50_na 'mol mol-1' Anthro CO North America 50 day tracer +SF6 'mol mol-1' Sulfur Hexafluoride tracer +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant emission 90 day tracer +Rn222 'mol mol-1' Radon-222 +Pb210 'mol mol-1' Lead-210 +Be7 'mol mol-1' Beryllium radionuclide 7(Be) +Be10 'mol mol-1' Beryllium radionuclide 10(Be) +CH3I 'mol mol-1' Methyl iodide +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers diff --git a/ESMF/Shared/Chem_Base/NR/Chem_Registry.rc b/ESMF/Shared/Chem_Base/NR/Chem_Registry.rc new file mode 100644 index 00000000..326d7955 --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/Chem_Registry.rc @@ -0,0 +1,638 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# Beginning with Heracles-1_0, four TR tracers are enabled in the +# default configuration. For the complete list of TR tracers, see +# Chem_MieRegistry.rc. +# +# StratChem can be run with Full or Reduced equation sets. +# When running Full, the string SC_f should be changed to SC. +# When running Reduced, the string SC_r should be changed to SC. +# This will be automatically done by stratchem_setup script. +# +# XX lists contain non-transported species for GMI and StratChem. +# When running GMI, the string XX_GMI should be changed to XX. +# When running StratChem, the string XX_SC should be changed to XX. +# This will be automatically done by the setup scripts. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to 'mol mol-1' +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + # &Label Active Constituents + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: yes # &YesNo Include carbon monoxide? +doing_CO2: yes # &YesNo Include carbon dioxide? +doing_DU: yes # &YesNo Include mineral dust? +doing_SS: yes # &YesNo Include sea salt? +doing_SU: yes # &YesNo Include sulfates? +doing_CFC: no # &YesNo Include CFCs? +doing_BC: yes # &YesNo Include black carbon? +doing_OC: yes # &YesNo Include organic carbon? +doing_BRC: no # &YesNo Include brown carbon? +doing_NI: yes # &YesNo Include nitrate? +doing_Rn: no # &YesNo include Radon? +doing_CH4: no # &YesNo include Methane? +doing_SC: no # &YesNo Include stratospheric chemistry? +doing_GMI: no # &YesNo GMI chemistry (GEOS-5) +doing_XX: no # &YesNo generic tracer +doing_PC: yes # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: yes # &YesNo run passive tracers? + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC_f: 52 # stratospheric chemistry (full) +nbins_XX_SC_f: 18 # stratchem (full) non-transported species +nbins_SC_r: 33 # stratospheric chemistry (reduced) +nbins_XX_SC_r: 37 # stratchem (reduced) non-transported species +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_XX_GMI: 48 # GMI non-transported species +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 4 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Carbon Monoxide (All Sources) +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide (All Sources) +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +OCphobicbbbo 'kg kg-1' Hydrophobic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphilicbbbo 'kg kg-1' Hydrophilic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphobicbbnb 'kg kg-1' Hydrophobic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +OCphilicbbnb 'kg kg-1' Hydrophilic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 cm-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +H 'mol mol-1' Ground state atomic hydrogen (2S) +MO2 'mol mol-1' Methylperoxy radical (CH3O2) +N 'mol mol-1' Ground state atomic nitrogen +O 'mol mol-1' Ground state atomic oxygen (3P) +O1D 'mol mol-1' First excited singlet state of atomic oxygen (1D) +A3O2 'mol mol-1' Primary RO2 (C3H7O2) from propane +ATO2 'mol mol-1' RO2 from acetone (C3H6O3) +B3O2 'mol mol-1' Secondary RO2 (C3H7O2) from propane +EOH 'mol mol-1' Ethanol +ETO2 'mol mol-1' Ethylperoxy radical (C2H5O2) +GLYC 'mol mol-1' Glycolaldehyde (Hydroxyacetaldehyde C2H4O2) +GLYX 'mol mol-1' Glyoxal (2CHO) +IAO2 'mol mol-1' RO2 (C5H9O5) from isoprene oxidation products +INO2 'mol mol-1' RO2 (C5H8O3N) from ISOP+NO3 +INPN 'mol mol-1' Peroxide (C5H8O6N2) from INO2 +ISN1 'mol mol-1' RO2 (C4H7O4N) from ISN2 +ISNP 'mol mol-1' Peroxide (C4H7O4N) from ISN1 +KO2 'mol mol-1' RO2 (C4H7O3) from C3 ketones +MAN2 'mol mol-1' RO2 (C4H6O6N) from MACR+NO3 +MAO3 'mol mol-1' Peroxyacyl (C4H5O3) from MACR and MVK +MAOP 'mol mol-1' Peroxide (C4H6O3) from MAO3 +MAP 'mol mol-1' Peroxyacetic acid (C2H4O3) +MCO3 'mol mol-1' Peroxyacetyl radical (C2H3O3) +MGLY 'mol mol-1' Methylglyoxal (C3H4O2) +MRO2 'mol mol-1' RO2 (C4H7O4) from MACR+OH +MRP 'mol mol-1' Peroxide (C4H8O4) from MRO2 +PO2 'mol mol-1' RO2 (C3H7O3) from propene +PP 'mol mol-1' Peroxide (C3H8O3) from PO2 +PRN1 'mol mol-1' RO2 (C3H6O3N) from propene+NO3 +PRPN 'mol mol-1' Peroxide (C3H6O3N) from PRN1 +R4N1 'mol mol-1' RO2 (C4H9O3N) from R4N2 +R4O2 'mol mol-1' RO2 (C4H9O2) from ALK4 +R4P 'mol mol-1' Peroxide (C4H10O2) from R4O2 +RA3P 'mol mol-1' Peroxy propyl alcohol (C3H8O2) from A3O2 +RB3P 'mol mol-1' Peroxide (C3H8O2) from B3O2 +RCO3 'mol mol-1' Peroxypropionyl radical (C3H5O3) +RIO1 'mol mol-1' RO2 (C5H9O3) from isoprene oxydation products +RIO2 'mol mol-1' RO2 (C5H9O3) from isoprene +RIP 'mol mol-1' Peroxide (C5H10O3) from RIO2 +ROH 'mol mol-1' C2 alcohols +RP 'mol mol-1' Methacrolein peroxy acid (C4H6O3) +VRO2 'mol mol-1' RO2 (C4H7O4) from MVK+OH +VRP 'mol mol-1' Peroxide (C4H8O4) from VRO2 +OCSg 'mol mol-1' Carbonyl sulfide in GMI +ACET 'mol mol-1' Acetone +O2 cm-3 Molecular oxygen +NUMDENS cm-3 Total number density +T2M15d K Daily T2M time average +:: + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant burden 90 day tracer +Rn222 'kg kg-1' Radon-222 +CH3I 'mol mol-1' Methyl iodide +Pb210 'kg kg-1' Lead-210 +nh_5 'mol mol-1' Northern Hemisphere 5 day tracer +nh_50 'mol mol-1' Northern Hemisphere 50 day tracer +aoa_nh days Age of air northern hemisphere tracer +st80_25 'mol mol-1' Stratospheric source 25 day tracer +CO_25 'mol mol-1' Anthro CO 25 day tracer +CO_50 'mol mol-1' Anthro CO 50 day tracer +CO_50_ea 'mol mol-1' Anthro CO 50 day tracer East Asia +CO_50_na 'mol mol-1' Anthro CO 50 day tracer North America +CO_50_eu 'mol mol-1' Anthro CO 50 day tracer Europe +CO_50_sa 'mol mol-1' Anthro CO 50 day tracer South Asia +SF6 'mol mol-1' Sulfur Hexafluoride tracer +e90_n 'mol mol-1' Constant burden 90 day tracer 40N-pole emiss +e90_s 'mol mol-1' Constant burden 90 day tracer 40S-pole emiss +Be7 'kg kg-1' Beryllium radionuclide 7(Be) +Be10 'kg kg-1' Beryllium radionuclide 10(Be) +stOX 'mol mol-1' Strat Ozone with chemical loss +Be7s 'kg kg-1' Beryllium radionuclide 7(Be) strat-source +Be10s 'kg kg-1' Beryllium radionuclide 10(Be) strat-source +Pb210s 'kg kg-1' Lead-210 strat-source +CO_GLB 'mol mol-1' CO 50 day tracer Global CMIP6+M2G +CO_NAM 'mol mol-1' CO 50 day tracer North America CMIP6+M2G +CO_EUR 'mol mol-1' CO 50 day tracer Europe CMIP6+M2G +CO_SAS 'mol mol-1' CO 50 day tracer South Asia CMIP6+M2G +CO_EAS 'mol mol-1' CO 50 day tracer East Asia CMIP6+M2G +CO_SEA 'mol mol-1' CO 50 day tracer Southeast Asia CMIP6+M2G +CO_ANZ 'mol mol-1' CO 50 day tracer Australia & New Zealand CMIP6+M2G +CO_NAF 'mol mol-1' CO 50 day tracer North Africa CMIP6+M2G +CO_RAF 'mol mol-1' CO 50 day tracer Rest of Africa CMIP6+M2G +CO_MDE 'mol mol-1' CO 50 day tracer Middle East CMIP6+M2G +CO_CAM 'mol mol-1' CO 50 day tracer Central America CMIP6+M2G +CO_SAM 'mol mol-1' CO 50 day tracer South America CMIP6+M2G +CO_RBU 'mol mol-1' CO 50 day tracer Russia & Belarus & Ukraine CMIP6+M2G +CO_CAS 'mol mol-1' CO 50 day tracer Central Asia CMIP6+M2G +CO_ARC 'mol mol-1' CO 50 day tracer Arctic CMIP6+M2G +CO_from_CH4 'mol mol-1' CO from global average CH4 oxidation +aoa_bl days Age of air above boundary layer +:: + + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers + diff --git a/ESMF/Shared/Chem_Base/NR/tavg3d_ext_p.rc b/ESMF/Shared/Chem_Base/NR/tavg3d_ext_p.rc new file mode 100644 index 00000000..d84b6cb3 --- /dev/null +++ b/ESMF/Shared/Chem_Base/NR/tavg3d_ext_p.rc @@ -0,0 +1,55 @@ +# lcv2prs.rc +# +# This is a resource file for the lcv2prs utility. +# +# !REVISION HISTORY: +# +# 27Jan2006 B. Yin First version. +# 25Apr2006 Todling Declared dims so fvsetup get set them up. +# 17May2006 Stassi modified from tavg3d_tmp_v.rc for pressure levels +# +#........................................................................... + +# ---------------------- +# Output File Resolution +# ---------------------- + +zonal_resolution: 540 # no. of zonal grid-points (im) +west_most_longitude_in_deg: -180.0 # longitude of first point (i=1) +meridional_resolution: 361 # no. meridional grid-points (jm) +vertical_levels_in_hPa: 1000 975 950 925 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 30 20 10 + +# ---------------- +# Variable Classes +# ---------------- + +# A variable class lists the variable names that make up a file type or product. + +# +### PRODUCT: tavg3d_ext_p (3-D tendency) +VarClass*tavg3d_ext_p: delp rh extinction ssa tau +# -------------------- +# Variable Translation +# -------------------- + +Variable_translation_table:: + +# Output | Input +# Name Units | Name scale_factor add_offset Positive check +# ------------------------------------------------------------------------------ + DELP Pa delp 1.0 0.0 0 + RH fraction rh 1.0 0.0 0 + SSA fraction ssa 1.0 0.0 0 + EXTINCTION 1/km extinction 1.0 0.0 0 + TAU UNITLESS tau 1.0 0.0 0 +:: + + + +# Table for variable names and description: + +DELP: Pressure difference between layer edges +RH: Relative Humidity +SSA: Aerosol Single Scatter Albedo [532 nm] +EXTINCTION: Aerosol Extinction [532 nm] +TAU: Aerosol Layer Optical Thickness [532 nm] diff --git a/ESMF/Shared/Chem_Base/PIESA/Aod-550nm_Registry.rc b/ESMF/Shared/Chem_Base/PIESA/Aod-550nm_Registry.rc new file mode 100644 index 00000000..a939d336 --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Aod-550nm_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 5.5e-7 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/PIESA/Aod3d_1064nm.rc b/ESMF/Shared/Chem_Base/PIESA/Aod3d_1064nm.rc new file mode 100644 index 00000000..e9abe52b --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Aod3d_1064nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1.064e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [1064 nm] +ssa none Aerosol Single Scatter Albedo [1064 nm] +tau none Aerosol Layer Optical Thickness [1064 nm] +depol none Aerosol Depolarization Ratio [1064 nm] +backscat km-1sr-1 Aerosol Backscatter [1064 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [1064 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [1064 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [1064 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/PIESA/Aod3d_355nm.rc b/ESMF/Shared/Chem_Base/PIESA/Aod3d_355nm.rc new file mode 100644 index 00000000..69235b28 --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Aod3d_355nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.355e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [355 nm] +ssa none Aerosol Single Scatter Albedo [355 nm] +tau none Aerosol Layer Optical Thickness [355 nm] +depol none Aerosol Depolarization Ratio [355 nm] +backscat km-1sr-1 Aerosol Backscatter [355 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [355 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [355 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [355 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/PIESA/Aod3d_532nm.rc b/ESMF/Shared/Chem_Base/PIESA/Aod3d_532nm.rc new file mode 100644 index 00000000..cb0b7f6d --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Aod3d_532nm.rc @@ -0,0 +1,115 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 8 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +depol none Aerosol Depolarization Ratio [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/PIESA/AodBands_Registry.rc b/ESMF/Shared/Chem_Base/PIESA/AodBands_Registry.rc new file mode 100644 index 00000000..45ed37af --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/AodBands_Registry.rc @@ -0,0 +1,116 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 1 2 3 4 5 6 7 8 + +filename_optical_properties_DU: ExtData/PIESA/x/opticsBands_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/opticsBands_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/opticsBands_OC.v1_3.nc +filename_optical_properties_BC: ExtData/PIESA/x/opticsBands_BC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/opticsBands_BRC.v1_5.nc +filename_optical_properties_SU: ExtData/PIESA/x/opticsBands_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/opticsBands_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH01 none SW Band 1 +CH02 none SW Band 2 +CH03 none SW Band 3 +CH04 none SW Band 4 +CH05 none SW Band 5 +CH06 none SW Band 6 +CH07 none SW Band 7 +CH08 none SW Band 8 +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/PIESA/Aod_CALIPSO.rc b/ESMF/Shared/Chem_Base/PIESA/Aod_CALIPSO.rc new file mode 100644 index 00000000..908994ef --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Aod_CALIPSO.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 1 + +r_channels: 0.532e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +extinction km-1 Aerosol Extinction [532 nm] +ssa none Aerosol Single Scatter Albedo [532 nm] +tau none Aerosol Layer Optical Thickness [532 nm] +backscat km-1sr-1 Aerosol Backscatter [532 nm] +ext2back sr-1 Aerosol Extinction to Backscatter Ratio [532 nm] +aback_sfc km-1sr-1 Aerosol Attenuated Backscatter from Surface [532 nm] +aback_toa km-1sr-1 Aerosol Attenuated Backscatter from Space [532 nm] +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/PIESA/Aod_EOS.rc b/ESMF/Shared/Chem_Base/PIESA/Aod_EOS.rc new file mode 100644 index 00000000..1d0b8def --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Aod_EOS.rc @@ -0,0 +1,121 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- + +# OMI SO2: 305, 310, 324, 380, 440, 500 +# OMI Aerosol: 354 [~340] 388 [~380] 471 [~470] +# MODIS: .47e-6 .55e-6 .659e-6 [~670] .865e-6 1.24e-6 1.64e-6 2.13e-6 +# MISR: 468 [~470] 558 [~550] 672 [~670] 867 [~865] +# PARASOL: 670 [~670] 865 +# AERONET: 340 380 440 500 675 [~670] 870 [~865] 1020 1640 + +n_channels: 12 +r_channels: .340e-6 .380e-6 .440e-6 .470e-6 .500e-6 .55e-6 .670e-6 .865e-6 1.02e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/PIESA/Aod_MODIS.rc b/ESMF/Shared/Chem_Base/PIESA/Aod_MODIS.rc new file mode 100644 index 00000000..0b1411be --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Aod_MODIS.rc @@ -0,0 +1,114 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 7 + +r_channels: .47e-6 .55e-6 .659e-6 .865e-6 1.24e-6 1.64e-6 2.13e-6 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 7 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0470 none AOD 470 nm +CH0550 none AOD 550 nm +CH0659 none AOD 659 nm +CH0865 none AOD 865 nm +CH1240 none AOD 1240 nm +CH1640 none AOD 1640 nm +CH2130 none AOD 2130 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/PIESA/Aod_Registry.rc b/ESMF/Shared/Chem_Base/PIESA/Aod_Registry.rc new file mode 100644 index 00000000..5c079045 --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Aod_Registry.rc @@ -0,0 +1,108 @@ +# +# AOD Registry Resource File +# + +# First block specifies number and channels to compute AOD over +# and the input filenames to use. Be sure that n_channels >= +# nbins_XX below, which specifies which to write to the bundle file. +# ---------------------------------------------------- +n_channels: 4 + +r_channels: 4.7e-7 5.5e-7 6.7e-7 8.7e-7 + +filename_optical_properties_DU: ExtData/PIESA/x/optics_DU.v15_3.nc +filename_optical_properties_SS: ExtData/PIESA/x/optics_SS.v3_3.nc +filename_optical_properties_OC: ExtData/PIESA/x/optics_OC.v1_3.nc +filename_optical_properties_BRC: ExtData/PIESA/x/optics_BRC.v1_5.nc +filename_optical_properties_BC: ExtData/PIESA/x/optics_BC.v1_3.nc +filename_optical_properties_SU: ExtData/PIESA/x/optics_SU.v1_3.nc +filename_optical_properties_NI: ExtData/PIESA/x/optics_NI.v2_5.nc + +# Second block is a copy of a chem registry type, used here only +# to specify what to write out to the bundle file!!! + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor +doing_O3: no # ozone +doing_CO: no # carbon monoxide +doing_DU: no # mineral dust +doing_SS: no # sea salt +doing_SU: no # sulfates +doing_BC: no # black carbon +doing_OC: no # organic carbon +doing_SC: no # stratospheric chemistry +doing_AC: no # Authochem +doing_XX: yes # generic tracer + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_SC: 35 # stratospheric chemistry +nbins_XX: 1 # generic tracer + +# Units for each constituent +# -------------------------- +units_H2O: kg/kg # water vapor +units_O3: ppmv # ozone +units_CO: ppmv # carbon monoxide +units_DU: unknown # mineral dust +units_SS: unknown # sea salt +units_SU: unknown # sulfates +units_BC: unknown # black carbon +units_OC: unknown # organic carbon +units_SC: kg/kg # stratospheric chemistry +units_XX: unknown # generic tracer + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH0550 none AOD 550 nm +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_SC: yes # stratospheric chemistry +advect_XX: yes # generic tracer + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer diff --git a/ESMF/Shared/Chem_Base/PIESA/Chem_Init.rc b/ESMF/Shared/Chem_Base/PIESA/Chem_Init.rc new file mode 100644 index 00000000..439a0aca --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Chem_Init.rc @@ -0,0 +1,25 @@ +# +# Chemistry Initialization Resource File +# + +# CO +# ---------------------------------------------------- +amp_CO: 1e18 # positive for total mass [kg]; negative for mmr +lat0_CO: 0. # latitude +lon0_CO: 0. # longitude +z0_CO: 5. # altitude [km] +rx_CO: 4000. # axis E-W [km] +ry_CO: 500. # axis N-S [km] +rz_CO: 2. # axis in z [km] + +# DU +# ---------------------------------------------------- +amp_DU: 0. # positive for total mass [kg]; negative for mmr +lat0_DU: 0. # latitude +lon0_DU: 0. # longitude +z0_DU: 5. # altitude [km] +rx_DU: 4000. # axis E-W [km] +ry_DU: 500. # axis N-S [km] +rz_DU: 2. # axis in z [km] + + diff --git a/ESMF/Shared/Chem_Base/PIESA/Chem_Mie.rc b/ESMF/Shared/Chem_Base/PIESA/Chem_Mie.rc new file mode 100644 index 00000000..3643e6cf --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Chem_Mie.rc @@ -0,0 +1,15 @@ +# +# Resorce file for Chem_Mie Module. Defines filename with LUTs and +# available channels +# + +Chem_Mie::du_optics_file: ExtData/AeroCom/x/opticsBands_DU.v15_3.nc +Chem_Mie::ss_optics_file: ExtData/AeroCom/x/opticsBands_SS.v3_3.nc +Chem_Mie::su_optics_file: ExtData/AeroCom/x/opticsBands_SU.v1_3.nc +Chem_Mie::ni_optics_file: ExtData/AeroCom/x/opticsBands_NI.v2_5.nc +Chem_Mie::oc_optics_file: ExtData/AeroCom/x/opticsBands_OC.v1_3.nc +Chem_Mie::brc_optics_file: ExtData/AeroCom/x/opticsBands_BRC.v1_5.nc +Chem_Mie::bc_optics_file: ExtData/AeroCom/x/opticsBands_BC.v1_3.nc + +Chem_Mie::channels: 1 2 3 4 5 6 7 8 + diff --git a/ESMF/Shared/Chem_Base/PIESA/Chem_MieRegistry.rc b/ESMF/Shared/Chem_Base/PIESA/Chem_MieRegistry.rc new file mode 100644 index 00000000..5b529bb1 --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Chem_MieRegistry.rc @@ -0,0 +1,455 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# XX lists Stratchem's inferred species. See Chem_Registry.rc +# for GMIchem's XX (non-transported) species list. +# +# IMPORTANT: This file should be the same as Chem_Registry.rc, except that +# only aerosols (DU, SS, SU, BC, OC) are turned ON. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to mol/mol +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: no # carbon monoxide +doing_CO2: no # carbon dioxide +doing_DU: yes # mineral dust +doing_SS: yes # sea salt +doing_SU: yes # sulfates +doing_CFC: no # CFCs +doing_BC: yes # black carbon +doing_OC: yes # organic carbon +doing_BRC: no # brown carbon +doing_NI: yes # nitrate +doing_Rn: no # radon +doing_CH4: no # methane +doing_SC: no # stratospheric chemistry +doing_GMI: no # GMI chemistry (GEOS-5) +doing_XX: no # generic tracer +doing_PC: no # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: no # passive tracers + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 10 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC: 34 # stratospheric chemistry +nbins_XX: 18 # generic tracer +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 10 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Global carbon monoxide +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +REDUCED +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 m-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +st80_25 'mol mol-1' Stratosphere source 25 day tracer +CO_50_na 'mol mol-1' Anthro CO North America 50 day tracer +SF6 'mol mol-1' Sulfur Hexafluoride tracer +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant emission 90 day tracer +Rn222 'mol mol-1' Radon-222 +Pb210 'mol mol-1' Lead-210 +Be7 'mol mol-1' Beryllium radionuclide 7(Be) +Be10 'mol mol-1' Beryllium radionuclide 10(Be) +CH3I 'mol mol-1' Methyl iodide +:: + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers diff --git a/ESMF/Shared/Chem_Base/PIESA/Chem_Registry.rc b/ESMF/Shared/Chem_Base/PIESA/Chem_Registry.rc new file mode 100644 index 00000000..326d7955 --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/Chem_Registry.rc @@ -0,0 +1,638 @@ +#------------------------------------------------------------------------ +#BOP +# +# !RESOURCE: AeroChem_Registry --- AeroChem Registry +# +# !HELP: +# +# The Chemistry Registry resource file is used to control basic +# properties of the GOCART and StratChem Grid Components. +# Specifically, it +# +# - selects which constituents to simulate +# - selects the number of bins for each constituent +# - specifies variable names and units for each constituent +# +# NOTES: The water vapor and ozone tracers are not really being used +# in GEOS-5. They are still kept for compatibility with GEOS-4. +# +# Beginning with Heracles-1_0, four TR tracers are enabled in the +# default configuration. For the complete list of TR tracers, see +# Chem_MieRegistry.rc. +# +# StratChem can be run with Full or Reduced equation sets. +# When running Full, the string SC_f should be changed to SC. +# When running Reduced, the string SC_r should be changed to SC. +# This will be automatically done by stratchem_setup script. +# +# XX lists contain non-transported species for GMI and StratChem. +# When running GMI, the string XX_GMI should be changed to XX. +# When running StratChem, the string XX_SC should be changed to XX. +# This will be automatically done by the setup scripts. +# +# !REVISION HISTORY: +# +# 27May2005 da Silva Added variable tables for SU/BC/OC. +# 19dec2005 da Silva Changed volume mixing ratio units to 'mol mol-1' +# 10Feb2006 Hayashi Added analysis update frequency +# 27Jul2006 da Silva No more analysis frequencies; added GMI/PChem (GEOS-5) +# +#----------------------------------------------------------------------- +#EOP + + # &Label Active Constituents + +# Whether to include the constituent in the simulation +# ---------------------------------------------------- +doing_H2O: no # water vapor (must always ON for fvGCM) +doing_O3: no # ozone (must be always ON for fvGCM in DAS mode) +doing_CO: yes # &YesNo Include carbon monoxide? +doing_CO2: yes # &YesNo Include carbon dioxide? +doing_DU: yes # &YesNo Include mineral dust? +doing_SS: yes # &YesNo Include sea salt? +doing_SU: yes # &YesNo Include sulfates? +doing_CFC: no # &YesNo Include CFCs? +doing_BC: yes # &YesNo Include black carbon? +doing_OC: yes # &YesNo Include organic carbon? +doing_BRC: no # &YesNo Include brown carbon? +doing_NI: yes # &YesNo Include nitrate? +doing_Rn: no # &YesNo include Radon? +doing_CH4: no # &YesNo include Methane? +doing_SC: no # &YesNo Include stratospheric chemistry? +doing_GMI: no # &YesNo GMI chemistry (GEOS-5) +doing_XX: no # &YesNo generic tracer +doing_PC: yes # parameterized chemistry (GEOS-5) +doing_OCS: no # ACHEM chemistry (OCS) +doing_TR: yes # &YesNo run passive tracers? + +# You can select the number of bins (e.g., particle size) +# for each of the constituents. Note nbins>1 may not be +# supported by some constituents +# ---------------------------------------------------- +nbins_H2O: 1 # water vapor +nbins_O3: 1 # ozone +nbins_CO: 1 # carbon monoxide +nbins_CO2: 1 # carbon dioxide +nbins_DU: 5 # mineral dust +nbins_SS: 5 # sea salt +nbins_SU: 4 # sulfates +nbins_CFC: 2 # CFCs +nbins_BC: 2 # black carbon +nbins_OC: 2 # organic carbon +nbins_BRC: 2 # brown carbon +nbins_NI: 5 # nitrate +nbins_Rn: 1 # radon +nbins_CH4: 15 # methane +nbins_SC_f: 52 # stratospheric chemistry (full) +nbins_XX_SC_f: 18 # stratchem (full) non-transported species +nbins_SC_r: 33 # stratospheric chemistry (reduced) +nbins_XX_SC_r: 37 # stratchem (reduced) non-transported species +nbins_PC: 1 # parameterized chemistry (GEOS-5) +nbins_GMI: 72 # GMI chemistry (GEOS-5) +nbins_XX_GMI: 48 # GMI non-transported species +nbins_OCS: 1 # ACHEM chemistry (OCS) +nbins_TR: 4 # passive tracers + +# Units for each constituent +# -------------------------- +units_H2O: 'kg kg-1' # water vapor +units_O3: 'kg kg-1' # ozone +units_CO: 'mol mol-1' # carbon monoxide +units_CO2: 'mol mol-1' # carbon dioxide +units_DU: 'kg kg-1' # mineral dust +units_SS: 'kg kg-1' # sea salt +units_SU: 'kg kg-1' # sulfates +units_CFC: 'mol mol-1' # CFCs +units_BC: 'kg kg-1' # black carbon +units_OC: 'kg kg-1' # organic carbon +units_BRC: 'kg kg-1' # brown carbon +units_NI: 'kg kg-1' # nitrate +units_Rn: 'mol mol-1' # radon +units_CH4: 'mol mol-1' # methane +units_SC: 'mol mol-1' # stratospheric chemistry +units_XX: 'mol mol-1' # generic tracer +units_PC: 'kg kg-1' # parameterized chemistry (GEOS-5) +units_GMI: 'mol mol-1' # GMI chemistry (GEOS-5) +units_OCS: 'kg kg-1' # ACHEM chemistry (OCS) +units_TR: 'mol mol-1' # passive tracers + +# Variable names to override defaults. Optional. Name and Units must +# be 1 token. Long names can be more than one token. +# -------------------------------------------------------------------- + +variable_table_O3:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Parameterized ozone +:: + +variable_table_CO:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO 'mol mol-1' Carbon Monoxide (All Sources) +COBBAE 'mol mol-1' CO Asia and Europe Biomass Burning +COBBNA 'mol mol-1' CO North America Biomass Burning +COBBLA 'mol mol-1' CO Central and South America Biomass Burning +COBBAF 'mol mol-1' CO Africa Biomass Burning +COBBGL 'mol mol-1' CO Global Biomass Burning +CONBAS 'mol mol-1' CO Asia Non-Biomass Burning +CONBNA 'mol mol-1' CO North American Non-Biomass Burning +CONBEU 'mol mol-1' CO European Non-Biomass Burning +CONBGL 'mol mol-1' CO Global Non-Biomass Burning +:: + +variable_table_CO2:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CO2 'mol mol-1' Carbon Dioxide (All Sources) +:: + +variable_table_CFC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CFC12S 'mol mol-1' Stratospheric CFC-12 (CCl2F2) +CFC12T 'mol mol-1' Tropospheric CFC-12 (CCl2F2) +:: + +variable_table_SU:: + +# Name Units Long Name +# ----- ------ -------------------------------- +DMS 'kg kg-1' Dimethylsulphide +SO2 'kg kg-1' Sulphur dioxide +SO4 'kg kg-1' Sulphate aerosol +MSA 'kg kg-1' Methanesulphonic acid +DMSv 'kg kg-1' Dimethylsulphide (volcanic) +SO2v 'kg kg-1' Sulphur dioxide (volcanic) +SO4v 'kg kg-1' Sulphate aerosol (volcanic) +MSAv 'kg kg-1' Methanesulphonic acid (volcanic) +:: + +variable_table_BC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BCphobic 'kg kg-1' Hydrophobic Black Carbon +BCphilic 'kg kg-1' Hydrophilic Black Carbon +:: + +variable_table_OC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OCphobic 'kg kg-1' Hydrophobic Organic Carbon (Particulate Matter) +OCphilic 'kg kg-1' Hydrophilic Organic Carbon (Particulate Matter) +OCphobicbbbo 'kg kg-1' Hydrophobic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphilicbbbo 'kg kg-1' Hydrophilic Organic Carbon (Boreal Biomass Burning, Particulate Matter) +OCphobicbbnb 'kg kg-1' Hydrophobic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +OCphilicbbnb 'kg kg-1' Hydrophilic Organic Carbon (Non-Boreal Biomass Burning, Particulate Matter) +:: + +variable_table_BRC:: + +# Name Units Long Name +# ----- ------ -------------------------------- +BRCphobic 'kg kg-1' Hydrophobic Brown Carbon (Particulate Matter) +BRCphilic 'kg kg-1' Hydrophilic Brown Carbon (Particulate Matter) +:: + +variable_table_RN:: + +# Name Units Long Name +# ----- ------ -------------------------------- +Rn 'mol mol-1' Global radon +:: + +variable_table_CH4:: + +# Name Units Long Name +# ----- ------ -------------------------------- +CH4animls 'mol mol-1' Methane from animals +CH4coal 'mol mol-1' Methane from coal +CH4leak 'mol mol-1' Methane from leakage +CH4gasvnt 'mol mol-1' Methane from gas venting +CH4hydz 'mol mol-1' Methane from ocean HYDZ +CH4msw 'mol mol-1' Methane from municipal sewers +CH4soilab 'mol mol-1' Methane absorbed by soil +CH4trmite 'mol mol-1' Methane from termites +CH4bogs 'mol mol-1' Methane from bogs +CH4burn 'mol mol-1' Methane from biomass burning +CH4ricec 'mol mol-1' Methane from rice cultivation +CH4swamps 'mol mol-1' Methane from swamps +CH4tundra 'mol mol-1' Methane from tundra +CH4bf 'mol mol-1' Methane from biofuel +CH4tot 'mol mol-1' Methane +:: + +variable_table_NI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +NH3 'kg kg-1' Ammonia (NH3, gas phase) +NH4a 'kg kg-1' Ammonium ion (NH4+, aerosol phase) +NO3an1 'kg kg-1' Nitrate size bin 001 +NO3an2 'kg kg-1' Nitrate size bin 002 +NO3an3 'kg kg-1' Nitrate size bin 003 +:: + +variable_table_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_f:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +OX 'mol mol-1' Stratospheric odd oxygen +NOX 'mol mol-1' Odd nitrogen +HNO3 'mol mol-1' Nitric acid +N2O5 'mol mol-1' Dinitrogen pentoxide +HO2NO2 'mol mol-1' Peroxynitric acid +CLONO2 'mol mol-1' Chlorine nitrate +CLX 'mol mol-1' Odd chlorine +HCL 'mol mol-1' Hydrochloric acid +HOCL 'mol mol-1' Hypochlorous acid +H2O2 'mol mol-1' Hydrogen peroxide +BRX 'mol mol-1' Odd bromine +N2O 'mol mol-1' Nitrous oxide +CL2 'mol mol-1' Molecular chlorine +OCLO 'mol mol-1' Chlorine dioxide +BRCL 'mol mol-1' Bromine chloride +HBR 'mol mol-1' Hydrogen bromide +BRONO2 'mol mol-1' Bromine nitrate +CH4 'mol mol-1' Methane +HOBR 'mol mol-1' Hypobromous acid +CH3OOH 'mol mol-1' Methyl hydroperoxide +CO 'mol mol-1' Carbon monoxide +HNO3COND 'mol mol-1' Condensed nitric acid +CFC11 'mol mol-1' CFC-11 (CCl3F) +CFC12 'mol mol-1' CFC-12 (CCl2F2) +CFC113 'mol mol-1' CFC-113 (CCl2FCClF2) +HCFC22 'mol mol-1' HCFC-22 (CHClF2) +CCL4 'mol mol-1' Carbon tetrachloride +CH3CCL3 'mol mol-1' Methyl chloroform +CH3CL 'mol mol-1' Methyl chloride +CH3BR 'mol mol-1' Methyl bromide +H1301 'mol mol-1' Halon 1301 (CBrF3) +H1211 'mol mol-1' Halon 1211 (CBrClF2) +AOADAYS days Age-of-air +:: + +variable_table_XX_SC_r:: + +# Name Units Long Name +# ----- ------ -------------------------------- +O3CHEM 'mol mol-1' Ozone from chemistry +O3P 'mol mol-1' Atomic oxygen in the ground state +O1D 'mol mol-1' Atomic oxygen in the first excited state +N 'mol mol-1' Atomic nitrogen +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +HATOMIC 'mol mol-1' Atomic hydrogen +OH 'mol mol-1' Hydroxyl radical +HO2 'mol mol-1' Hydroperoxyl radical +CL 'mol mol-1' Atomic chlorine +CLO 'mol mol-1' Chlorine monoxide +BRO 'mol mol-1' Bromine monoxide +BR 'mol mol-1' Atomic bromine +CL2O2 'mol mol-1' Dichlorine peroxide +CH2O 'mol mol-1' Formaldehyde +CH3O2 'mol mol-1' Methyl peroxide +CFC114 'mol mol-1' CFC-114 (C2Cl2F4) +CFC115 'mol mol-1' CFC-115 (C2ClF5) +HCFC141B 'mol mol-1' HCFC-141b (CH3CCl2F) +HCFC142B 'mol mol-1' HCFC-142b (CH3CClF2) +H1202 'mol mol-1' Halon 1202 (CBrF3) +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +CHBR3 'mol mol-1' Bromoform +CH2BR2 'mol mol-1' Dibromomethane +CH2BRCL 'mol mol-1' CH2BRCL +CHBRCL2 'mol mol-1' CHBRCL2 +CHBR2CL 'mol mol-1' CHBR2CL +HFC23 'mol mol-1' CHF3 +HFC32 'mol mol-1' CH2F2 +HFC125 'mol mol-1' CHF2CF3 +HFC134A 'mol mol-1' CH2FCF3 +HFC143A 'mol mol-1' CF3CH3 +HFC152A 'mol mol-1' CH2CHF2 +CO2 'mol mol-1' Lat-depedent CO2 +SF6 'mol mol-1' Sulfur hexafluoride +RO3OX "none" Ozone-to-odd oxygen ratio +:: + +variable_table_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +AOADAYS days Age-of-air +CH2O 'mol mol-1' Formaldehyde +CH4 'mol mol-1' Methane +CO 'mol mol-1' Carbon monoxide +H2 'mol mol-1' Molecular hydrogen +HCOOH 'mol mol-1' Formic acid (CH2O2) +HNO2 'mol mol-1' Nitrous acid +HNO3 'mol mol-1' Nitric acid +HNO4 'mol mol-1' Pernitric acid +HO2 'mol mol-1' Perhydroxyl radical +H2O2 'mol mol-1' Hydrogen peroxide +MOH 'mol mol-1' Methanol +MP 'mol mol-1' Methyl hydroperoxide +N2O 'mol mol-1' Nitrous oxide +NO 'mol mol-1' Nitric oxide +NO2 'mol mol-1' Nitrogen dioxide +NO3 'mol mol-1' Nitrogen trioxide +N2O5 'mol mol-1' Dinitrogen pentoxide +OX 'mol mol-1' Ozone +OH 'mol mol-1' Hydroxyl radical +Br 'mol mol-1' Ground state atomic bromine (2P3/2) +BrCl 'mol mol-1' Bromine chloride +BrO 'mol mol-1' Bromine monoxide radical +BrONO2 'mol mol-1' Bromine nitrate +HBr 'mol mol-1' Hydrogen bromide +HOBr 'mol mol-1' Hydrobromous acid +Cl 'mol mol-1' Ground state atomic chlorine (2P3/2) +Cl2 'mol mol-1' Molecular chlorine +ClO 'mol mol-1' Chlorine monoxide radical +Cl2O2 'mol mol-1' Chlorine peroxide +ClONO2 'mol mol-1' Chlorine nitrate +HCl 'mol mol-1' Hydrochloric acid +HOCl 'mol mol-1' Hydrochlorous acid +OClO 'mol mol-1' Symmetrical chlorine dioxide +CH3Br 'mol mol-1' Methyl bromide +CH3Cl 'mol mol-1' Methyl chloride +CH3CCl3 'mol mol-1' Methyl chloroform +CCl4 'mol mol-1' Carbon tetrachloride +CFC11 'mol mol-1' CFC11 (CFCl3) +CFC12 'mol mol-1' CFC12 (CF2Cl2) +CFC113 'mol mol-1' CFC113 (C2Cl3F3) +CFC114 'mol mol-1' CFC114 (C2Cl2F4) +CFC115 'mol mol-1' CFC115 (C2ClF5) +HCFC22 'mol mol-1' HCFC22 (CClF2H) +HCFC141b 'mol mol-1' HCFC141b (C2Cl2FH3) +HCFC142b 'mol mol-1' HCFC142b (C2ClF2H3) +CF2Br2 'mol mol-1' Halon 1202 +CF2ClBr 'mol mol-1' Halon 1211 +CF3Br 'mol mol-1' Halon 1301 +H2402 'mol mol-1' Halon 2402 (C2Br2F4) +ACTA 'mol mol-1' Acetic acid (C2H4O2) +ALD2 'mol mol-1' Acetaldehyde (C2H4O) +ALK4 'mol mol-1' C4-5 alkanes (C4H10 C5H12) +C2H6 'mol mol-1' Ethane +C3H8 'mol mol-1' Propane +ETP 'mol mol-1' Ethylhydroperoxide (C2H6O2) from ETO2 +HAC 'mol mol-1' Hydroxyacetone (C3H6O2) +IALD 'mol mol-1' Hydroxy carbonyl alkenes (C5H8O2) from isoprene +IAP 'mol mol-1' Peroxide (C5H10O5) from IAO2 +ISOP 'mol mol-1' Isoprene (C5H8) +MACR 'mol mol-1' Methacrolein (C4H6O) +MEK 'mol mol-1' Methyl ethyl ketone (C4H8O) +MVK 'mol mol-1' Methyl vinyl ketone (C4H6O) +PAN 'mol mol-1' Peroxyacetyl nitrate (C2H3NO5) +PMN 'mol mol-1' Peroxymethacryloyl nitrate (C4H5O5N) +PPN 'mol mol-1' Peroxypropionyl nitrate (C3H5NO5) +PRPE 'mol mol-1' Propene (C3H6) +R4N2 'mol mol-1' C4-C5 alkylnitrates (C4H9O3N) +RCHO 'mol mol-1' C2 aldehydes (C3H6O) +RCOOH 'mol mol-1' C2 organic acids +N2 cm-3 Molecular nitrogen +HNO3COND 'mol mol-1' Condensed nitric acid +:: + +variable_table_XX_GMI:: + +# Name Units Long Name +# ----- ------ -------------------------------- +H 'mol mol-1' Ground state atomic hydrogen (2S) +MO2 'mol mol-1' Methylperoxy radical (CH3O2) +N 'mol mol-1' Ground state atomic nitrogen +O 'mol mol-1' Ground state atomic oxygen (3P) +O1D 'mol mol-1' First excited singlet state of atomic oxygen (1D) +A3O2 'mol mol-1' Primary RO2 (C3H7O2) from propane +ATO2 'mol mol-1' RO2 from acetone (C3H6O3) +B3O2 'mol mol-1' Secondary RO2 (C3H7O2) from propane +EOH 'mol mol-1' Ethanol +ETO2 'mol mol-1' Ethylperoxy radical (C2H5O2) +GLYC 'mol mol-1' Glycolaldehyde (Hydroxyacetaldehyde C2H4O2) +GLYX 'mol mol-1' Glyoxal (2CHO) +IAO2 'mol mol-1' RO2 (C5H9O5) from isoprene oxidation products +INO2 'mol mol-1' RO2 (C5H8O3N) from ISOP+NO3 +INPN 'mol mol-1' Peroxide (C5H8O6N2) from INO2 +ISN1 'mol mol-1' RO2 (C4H7O4N) from ISN2 +ISNP 'mol mol-1' Peroxide (C4H7O4N) from ISN1 +KO2 'mol mol-1' RO2 (C4H7O3) from C3 ketones +MAN2 'mol mol-1' RO2 (C4H6O6N) from MACR+NO3 +MAO3 'mol mol-1' Peroxyacyl (C4H5O3) from MACR and MVK +MAOP 'mol mol-1' Peroxide (C4H6O3) from MAO3 +MAP 'mol mol-1' Peroxyacetic acid (C2H4O3) +MCO3 'mol mol-1' Peroxyacetyl radical (C2H3O3) +MGLY 'mol mol-1' Methylglyoxal (C3H4O2) +MRO2 'mol mol-1' RO2 (C4H7O4) from MACR+OH +MRP 'mol mol-1' Peroxide (C4H8O4) from MRO2 +PO2 'mol mol-1' RO2 (C3H7O3) from propene +PP 'mol mol-1' Peroxide (C3H8O3) from PO2 +PRN1 'mol mol-1' RO2 (C3H6O3N) from propene+NO3 +PRPN 'mol mol-1' Peroxide (C3H6O3N) from PRN1 +R4N1 'mol mol-1' RO2 (C4H9O3N) from R4N2 +R4O2 'mol mol-1' RO2 (C4H9O2) from ALK4 +R4P 'mol mol-1' Peroxide (C4H10O2) from R4O2 +RA3P 'mol mol-1' Peroxy propyl alcohol (C3H8O2) from A3O2 +RB3P 'mol mol-1' Peroxide (C3H8O2) from B3O2 +RCO3 'mol mol-1' Peroxypropionyl radical (C3H5O3) +RIO1 'mol mol-1' RO2 (C5H9O3) from isoprene oxydation products +RIO2 'mol mol-1' RO2 (C5H9O3) from isoprene +RIP 'mol mol-1' Peroxide (C5H10O3) from RIO2 +ROH 'mol mol-1' C2 alcohols +RP 'mol mol-1' Methacrolein peroxy acid (C4H6O3) +VRO2 'mol mol-1' RO2 (C4H7O4) from MVK+OH +VRP 'mol mol-1' Peroxide (C4H8O4) from VRO2 +OCSg 'mol mol-1' Carbonyl sulfide in GMI +ACET 'mol mol-1' Acetone +O2 cm-3 Molecular oxygen +NUMDENS cm-3 Total number density +T2M15d K Daily T2M time average +:: + +variable_table_TR:: + +# Name Units Long Name +# ----- ------ -------------------------------- +aoa days Age of air (uniform source) tracer +e90 'mol mol-1' Constant burden 90 day tracer +Rn222 'kg kg-1' Radon-222 +CH3I 'mol mol-1' Methyl iodide +Pb210 'kg kg-1' Lead-210 +nh_5 'mol mol-1' Northern Hemisphere 5 day tracer +nh_50 'mol mol-1' Northern Hemisphere 50 day tracer +aoa_nh days Age of air northern hemisphere tracer +st80_25 'mol mol-1' Stratospheric source 25 day tracer +CO_25 'mol mol-1' Anthro CO 25 day tracer +CO_50 'mol mol-1' Anthro CO 50 day tracer +CO_50_ea 'mol mol-1' Anthro CO 50 day tracer East Asia +CO_50_na 'mol mol-1' Anthro CO 50 day tracer North America +CO_50_eu 'mol mol-1' Anthro CO 50 day tracer Europe +CO_50_sa 'mol mol-1' Anthro CO 50 day tracer South Asia +SF6 'mol mol-1' Sulfur Hexafluoride tracer +e90_n 'mol mol-1' Constant burden 90 day tracer 40N-pole emiss +e90_s 'mol mol-1' Constant burden 90 day tracer 40S-pole emiss +Be7 'kg kg-1' Beryllium radionuclide 7(Be) +Be10 'kg kg-1' Beryllium radionuclide 10(Be) +stOX 'mol mol-1' Strat Ozone with chemical loss +Be7s 'kg kg-1' Beryllium radionuclide 7(Be) strat-source +Be10s 'kg kg-1' Beryllium radionuclide 10(Be) strat-source +Pb210s 'kg kg-1' Lead-210 strat-source +CO_GLB 'mol mol-1' CO 50 day tracer Global CMIP6+M2G +CO_NAM 'mol mol-1' CO 50 day tracer North America CMIP6+M2G +CO_EUR 'mol mol-1' CO 50 day tracer Europe CMIP6+M2G +CO_SAS 'mol mol-1' CO 50 day tracer South Asia CMIP6+M2G +CO_EAS 'mol mol-1' CO 50 day tracer East Asia CMIP6+M2G +CO_SEA 'mol mol-1' CO 50 day tracer Southeast Asia CMIP6+M2G +CO_ANZ 'mol mol-1' CO 50 day tracer Australia & New Zealand CMIP6+M2G +CO_NAF 'mol mol-1' CO 50 day tracer North Africa CMIP6+M2G +CO_RAF 'mol mol-1' CO 50 day tracer Rest of Africa CMIP6+M2G +CO_MDE 'mol mol-1' CO 50 day tracer Middle East CMIP6+M2G +CO_CAM 'mol mol-1' CO 50 day tracer Central America CMIP6+M2G +CO_SAM 'mol mol-1' CO 50 day tracer South America CMIP6+M2G +CO_RBU 'mol mol-1' CO 50 day tracer Russia & Belarus & Ukraine CMIP6+M2G +CO_CAS 'mol mol-1' CO 50 day tracer Central Asia CMIP6+M2G +CO_ARC 'mol mol-1' CO 50 day tracer Arctic CMIP6+M2G +CO_from_CH4 'mol mol-1' CO from global average CH4 oxidation +aoa_bl days Age of air above boundary layer +:: + + +#........................................................................ + +# ------------------- +# Not Implemented Yet +# ------------------- + +# Whether to advect the constituent +# --------------------------------- +advect_H2O: yes # water vapor +advect_O3: yes # ozone +advect_CO: yes # carbon monoxide +advect_CO2: yes # carbon dioxide +advect_DU: yes # mineral dust +advect_SS: yes # sea salt +advect_SU: yes # sulfates +advect_CFC: yes # CFCs +advect_BC: yes # black carbon +advect_OC: yes # organic carbon +advect_BRC: yes # brown carbon +advect_NI: yes # nitrate +advect_Rn: yes # radon +advect_CH4: yes # methane +advect_SC: yes # stratospheric chemistry +advect_XX: no # generic tracer +advect_PC: yes # parameterized chemistry (GEOS-5) +advect_GMI: yes # GMI chemistry (GEOS-5) +advect_OCS: yes # ACHEM chemistry (OCS) +advect_TR: yes # passive tracers + +# Whether to diffuse the constituent +# ---------------------------------- +diffuse_H2O: yes # water vapor +diffuse_O3: yes # ozone +diffuse_XX: yes # generic tracer +diffuse_CO: yes # carbon monoxide +diffuse_CO2: yes # carbon dioxide +diffuse_DU: yes # mineral dust +diffuse_SS: yes # sea salt +diffuse_SU: yes # sulfates +diffuse_CFC: yes # CFCs +diffuse_BC: yes # black carbon +diffuse_OC: yes # organic carbon +diffuse_BRC: yes # brown carbon +diffuse_NI: yes # nitrate +diffuse_Rn: yes # radon +diffuse_CH4: yes # methane +diffuse_SC: yes # stratospheric chemistry +diffuse_XX: yes # generic tracer +diffuse_PC: yes # parameterized chemistry (GEOS-5) +diffuse_GMI: yes # GMI chemistry (GEOS-5) +diffuse_OCS: yes # ACHEM chemistry (OCS) +diffuse_TR: yes # passive tracers + diff --git a/ESMF/Shared/Chem_Base/PIESA/tavg3d_ext_p.rc b/ESMF/Shared/Chem_Base/PIESA/tavg3d_ext_p.rc new file mode 100644 index 00000000..d84b6cb3 --- /dev/null +++ b/ESMF/Shared/Chem_Base/PIESA/tavg3d_ext_p.rc @@ -0,0 +1,55 @@ +# lcv2prs.rc +# +# This is a resource file for the lcv2prs utility. +# +# !REVISION HISTORY: +# +# 27Jan2006 B. Yin First version. +# 25Apr2006 Todling Declared dims so fvsetup get set them up. +# 17May2006 Stassi modified from tavg3d_tmp_v.rc for pressure levels +# +#........................................................................... + +# ---------------------- +# Output File Resolution +# ---------------------- + +zonal_resolution: 540 # no. of zonal grid-points (im) +west_most_longitude_in_deg: -180.0 # longitude of first point (i=1) +meridional_resolution: 361 # no. meridional grid-points (jm) +vertical_levels_in_hPa: 1000 975 950 925 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 30 20 10 + +# ---------------- +# Variable Classes +# ---------------- + +# A variable class lists the variable names that make up a file type or product. + +# +### PRODUCT: tavg3d_ext_p (3-D tendency) +VarClass*tavg3d_ext_p: delp rh extinction ssa tau +# -------------------- +# Variable Translation +# -------------------- + +Variable_translation_table:: + +# Output | Input +# Name Units | Name scale_factor add_offset Positive check +# ------------------------------------------------------------------------------ + DELP Pa delp 1.0 0.0 0 + RH fraction rh 1.0 0.0 0 + SSA fraction ssa 1.0 0.0 0 + EXTINCTION 1/km extinction 1.0 0.0 0 + TAU UNITLESS tau 1.0 0.0 0 +:: + + + +# Table for variable names and description: + +DELP: Pressure difference between layer edges +RH: Relative Humidity +SSA: Aerosol Single Scatter Albedo [532 nm] +EXTINCTION: Aerosol Extinction [532 nm] +TAU: Aerosol Layer Optical Thickness [532 nm] diff --git a/ESMF/Shared/Chem_Base/SCChem_Init.F90 b/ESMF/Shared/Chem_Base/SCChem_Init.F90 new file mode 100644 index 00000000..51b8b751 --- /dev/null +++ b/ESMF/Shared/Chem_Base/SCChem_Init.F90 @@ -0,0 +1,313 @@ +!--------------------------------------------------exi----------------------- +! NASA GSFC, Global Modeling & Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !PROGRAM: SCChem_Init.F90 --- Establishes the inital Chem_Bundle + +PROGRAM Chem_initialize + +! !USES: + + USE m_die, only: die + USE Chem_InitMod + USE Chem_RegistryMod + USE Chem_BundleMod + + IMPLICIT none + +! !DESCRIPTION: Create a c55 initialization for the SC Code 916 chemistry +! bundle under fvGCM version 1_4r2 using +! - c55 d_rst file for dynamics from dao_ops +! - b55 d_rst file for chemistry from "old" (no SC_GridComp) +! runs. +! +! The new c55 d_rst file contains the dynamics and specific +! humidity from the dao_ops c55 d_rst file, plus the ozone from +! the ozone from the chemistry. +! +! The c55 Chem_Bundle contains 52 species that have been +! very roughly interpolated from 2x2.5 to 1x1.25, plus RO3OX +! set to -1. +! +! !USAGE: Typical command line lists output chem bundle, input dao_ops dynamics, +! and input chem916 d_rst in the following manner: +! +! SCChem_Init.x -o /gmao/model/enielsen/c55.rst.chem.19650101_00z.hdf \ +! -d /output/dao_ops/GEOS-4.0.3/a_llk_04/rs/Y2004/M11/a_llk_04.rst.lcv.20041101_00z.bin +! -c /output/enielsen/chem916/1_4r2/b55/rs/Y1964/M11/b55.rst.lcv.19641101_00z.bin +! +! For now the output d_rst file is hard-coded. Sorry. +! +! !REVISION HISTORY: +! +! 18sep2001 da Silva Initial code. (?) +! 10Oct2004 Nielsen Adapted for SCGridComp +! 28Nov2004 Nielsen Rewritten for getting IC for Polar-AVE mission. +! +!EOP +!------------------------------------------------------------------------- +! Hard-wired c55 grid parameters + + INTEGER, PARAMETER :: im = 288, jm = 181, km = 55 + +! Hard-wired b55 grid parameters + + INTEGER, PARAMETER :: imb = 144, jmb = 91 + +! This sting identifies this procedure + + CHARACTER(LEN=*), PARAMETER :: myname = 'SCChem_Init' + +! Registry and bundle + + TYPE(Chem_Registry) :: reg ! chemistry registry + TYPE(Chem_Bundle) :: w_c ! chemistry bundle + +! Local variables + + CHARACTER(LEN=255) :: argv, chemfile, dummystr, dynfile, b55chemfile + +! 1 x 1.25 + REAL :: ps(im,jm) + REAL :: specie(im,jm,km),u(im,jm,km) + REAL :: v(im,jm,km),pt(im,jm,km),ro3ox(im,jm,km) + +! 2 x 2.5 + REAL :: psb(imb,jmb),delpb(imb,jmb,km) + REAL :: specieb(imb,jmb,km),ub(imb,jmb,km),qb(imb,jmb,km) + REAL :: vb(imb,jmb,km),ptb(imb,jmb,km),ro3oxb(imb,jmb,km) + + INTEGER :: argc,i,iarg,iargc,ic,ier + INTEGER :: j,k,n,nhms,nq,nstep,nymd,prec + INTEGER, EXTERNAL :: system + INTEGER, PARAMETER :: iuic = 12 + + REAL, POINTER :: delp(:,:,:), q(:,:,:,:) + +! Parse the command line [see usage() below] for file names +! of input dynamics restart and output chemistry bundle. +! --------------------------------------------------------- + argc = iargc() + if(argc .lt. 1) call usage() + iarg = 0 + chemfile = 'chem_ini.c_rst' + do i = 0, 32767 + iarg = iarg+1 + if(iarg .gt. argc) exit + call GetArg(iarg, argv) + select case(argv) + case ("-o") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, chemfile) + case ("-d") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, dynfile) + case ("-c") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, b55chemfile) + case default + call usage() + end select + end do + if ( trim(chemfile) .eq. 'chem_ini.c_rst' ) then + i = index ( dynfile, 'd_rst' ) + if ( i .gt. 1 ) then + chemfile = dynfile(1:i-1) // 'c_rst' // dynfile(i+5:) + end if + end if + +! Read the chemistry registry +! --------------------------- + reg = Chem_RegistryCreate( ier ) + IF(ier /= 0) CALL die(myname, 'Cannot create registry') + CALL Chem_RegistryPrint( reg ) + nq = reg%nq + +! Create the chemistry bundle to be filled in later +! ------------------------------------------------- + CALL Chem_BundleCreate1PE_(reg, im, jm, km, w_c, ier) + IF(ier /= 0) CALL die(myname, 'Cannot create bundle') + + delp => w_c%delp + q => w_c%q + +! Read the chem916 b55 d_rst file, which contains both dynamics +! and chemistry +! ------------------------------------------------------------- + OPEN(UNIT=iuic,FILE=b55chemfile,FORM='unformatted', & + ACCESS='sequential',STATUS='old',ACTION='read') + + WRITE(*,FMT="(' CHEM_INIT: Reading b55 ',A,' ...')") TRIM(b55chemfile) + READ(iuic) nstep,nymd,nhms + READ(iuic) psb, delpb, ub, vb, ptb + + WRITE(*,FMT="(2X,'PS b55 MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(psb),MINVAL(psb) + WRITE(*,FMT="(2X,'U b55 MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(ub),MINVAL(ub) + WRITE(*,FMT="(2X,'V b55 MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(vb),MINVAL(vb) + WRITE(*,FMT="(2X,'PT b55 MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(ptb),MINVAL(ptb) + +! Read ozone-to-odd oxygen ratio +! ------------------------------ + READ(iuic) ro3oxb + WRITE(*,FMT="(2X,'RO3OX b55 MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(ro3oxb),MINVAL(ro3oxb) + +! Acquire specific humidity +! ------------------------- + READ(iuic) specieb + qb(:,:,:) = specieb(:,:,:) + WRITE(*,FMT="(2X,'SPEC HUM b55 MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(specieb),MINVAL(specieb) + + CALL make1x125(imb,jmb,im,jm,km,qb,specie) + q(:,:,:,1)=specie(:,:,:) + +! Spin through the rest of the species +! ------------------------------------ + DO ic=1,52 + + READ(iuic) specieb + qb(:,:,:) = specieb(:,:,:) + WRITE(*,FMT="(2X,A8,' b55 MAX=',1PE12.4,' MIN=',1PE12.4)") & + reg%vname(ic+2),MAXVAL(specieb),MINVAL(specieb) + CALL make1x125(imb,jmb,im,jm,km,qb,specie) + q(:,:,:,ic+2)=specie(:,:,:) + + END DO + + CLOSE(iuic) + +! Just for fun, set the "operational ozone," which we do not use, to +! the sum of the stratospheric and tropospheric parts. NOTE: vmr! +! ------------------------------------------------------------------ + q(:,:,:,2)=q(:,:,:,37)+q(:,:,:,38) + +! Add ozone-to-odd oxygen ration at the end +! ----------------------------------------- + q(:,:,:,nq) = -1 + +! Read in the dynamics fields from dao_ops c55 d_rst file +! -------------------------------------------------------- + OPEN(UNIT=iuic,FILE=dynfile,FORM='unformatted', & + ACCESS='sequential',STATUS='old',ACTION='read') + + WRITE(*,FMT="(' CHEM_INIT: Reading dao_ops ',A,' ...')") TRIM(dynfile) + READ(iuic) nstep,nymd,nhms + READ(iuic) ps, delp, u, v, pt + + WRITE(*,FMT="(2X,'PS MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(ps),MINVAL(ps) + WRITE(*,FMT="(2X,'U MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(u),MINVAL(u) + WRITE(*,FMT="(2X,'V MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(v),MINVAL(v) + WRITE(*,FMT="(2X,'PT MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(pt),MINVAL(pt) + +! Acquire specific humidity +! ------------------------- + READ(iuic) specie + q(:,:,:,1) = specie(:,:,:) + WRITE(*,FMT="(2X,'SPEC HUM MAX=',1PE12.4,' MIN=',1PE12.4)") & + MAXVAL(specie),MINVAL(specie) + +! Stat the bundle +! --------------- +! call Chem_BundleStat(6, w_c, ier) + if(ier /= 0) call die(myname, 'Cannot stat bundle') + +! Write the bundle +! ---------------- + prec = 0 + ier = system("/bin/rm -rf "//chemfile) + call Chem_BundleWrite(chemfile, nymd, nhms, prec, w_c, ier, verbose=.true.) + if(ier /=0 ) call die(myname,'Cannot write bundle') + +! Write a "new" dynamics restart file. It must have SPHU and O3 +! -------------------------------------------------------------- + dynfile='/gmao/model/enielsen/c55.rst.dyn.20041101_00z.bin' + OPEN(UNIT=iuic,FILE=TRIM(dynfile),FORM='unformatted', & + ACCESS='sequential',STATUS='new',ACTION='write') + WRITE(*,FMT="(' CHEM_INIT: Writing ',A,' ...')") TRIM(dynfile) + WRITE(iuic) nstep,nymd,nhms + WRITE(iuic) ps, delp, u, v, pt + specie(:,:,:)=q(:,:,:,1) + WRITE(iuic) specie + specie(:,:,:)=q(:,:,:,2) + WRITE(iuic) specie + CLOSE(iuic) + +! Try to read the newly created bundle +! ------------------------------------ + WRITE(*,FMT="(' CHEM_INIT: Test reading ',A,' ...')") TRIM(chemfile) + CALL Chem_BundleRead ( TRIM(chemfile), nymd, nhms, w_c, ier, & + timidx=0, chemReg=reg ) + WRITE(*,FMT="(' CHEM_INIT: Return code is ',I3)") ier + + DO ic=1,55 + WRITE(*,FMT="(2X,A8,' MAX=',1PE12.4,' MIN=',1PE12.4)") & + reg%vname(ic),MAXVAL(q(:,:,:,ic)),MINVAL(q(:,:,:,ic)) + END DO + +CONTAINS + + SUBROUTINE usage() + PRINT * + PRINT *,'Usage: ' + PRINT *,' chem_init.x -o chemfile -d dynfile -c b55chemfile' + PRINT * + PRINT *, 'where' + PRINT * + PRINT *, '-o chemfile Output chemistry initialization' + PRINT *, ' file name. Default: same as dynfile' + PRINT *, ' with substring "d_rst" replaced' + PRINT *, ' with "c_rst"' + PRINT *, '-d dynfile Mandatory c55 dao_ops d_rst file name' + PRINT *, 'b55chemfile Mandatory b55 chemistry input file name' + PRINT * + CALL exit(1) + END SUBROUTINE usage + + SUBROUTINE make1x125(imb,jmb,im,jm,km,qb,q) + IMPLICIT none + INTEGER, INTENT(IN) :: imb,jmb,im,jm,km + REAL, INTENT(IN) :: qb(imb,jmb,km) + REAL, INTENT(OUT) :: q(im,jm,km) + INTEGER :: i,j,k + REAL :: r(imb,jm,km) + + DO k=1,km + DO i=1,imb + + DO j=1,jmb-1 + r(i,2*j-1,k) = qb(i,j,k) + r(i,2*j ,k) = (qb(i,j,k)+qb(i,j+1,k))*0.50 + END DO + r(i,jm,k) = qb(i,jmb,k) + + END DO + END DO + + DO k=1,km + DO j=1,jm + + DO i=1,imb + q(2*i-1,j,k) = r(i,j,k) + q(2*i ,j,k) = (r(i,j,k)+r(i,j,k))*0.50 + END DO + q(im ,j,k) = (r(imb,j,k)+r(1,j,k))*0.50 + + END DO + END DO + + END SUBROUTINE make1x125 + +END PROGRAM Chem_initialize diff --git a/ESMF/Shared/Chem_Base/backscatter_calculator.csh b/ESMF/Shared/Chem_Base/backscatter_calculator.csh new file mode 100755 index 00000000..1075136b --- /dev/null +++ b/ESMF/Shared/Chem_Base/backscatter_calculator.csh @@ -0,0 +1,83 @@ +#!/bin/csh -f +# +# Computes aerosol backscatter files files. See usage: below for details. +# + +# set up executable names (assumes they are on the path) + set bin = Chem_Aod3d.x + +# Did I pass in a filename to operate on? + if ($#argv < 2) then + goto usage + endif + +# Setup the input filename + set aerFile = "$1" + shift + + if ( ! (-e $aerFile) ) then + echo $0": cannot find input aer_v file $aerFile" + exit 1 + endif + + foreach ch ( $argv ) + + set chnm = ${ch}nm + set rcFile = Aod3d_$chnm.rc + set absFile = ( `echo $aerFile | sed -e "s/_aer_v/_abs-${chnm}_v/g"` ) + + if ( ! (-e $rcFile) ) then + echo $0": cannot find input rc file $rcFile" + exit 1 + endif + + /bin/rm -f $absFile + + set cmd = "$bin -t $rcFile -o $absFile $aerFile" + + echo $cmd + $cmd + + end + + echo $0": All done" + exit 0 + +#-------------------------------------------------------------- +usage: + +cat <0: + nz = nc.createDimension('lev',km) + x = nc.createDimension('x',1) + y = nc.createDimension('y',1) + + if options.station: + # Station names + # ------------- + stnName_ = nc.createVariable('stnName','S1',('station','ls'),zlib=zlib) + stnName_.long_name = 'Station Names' + stnName_.axis = 'e' + stnName_[:] = stations[:] + + # Coordinate variables + # -------------------- + time = nc.createVariable('time','i4',('time',),zlib=zlib) + time.long_name = 'Time' + t0 = tyme[0] + isot0 = isotimeIn[0] + date0 = ''.join(isot0[:10]) + time0 = ''.join(isot0[-8:]) + time.units = 'seconds since '+date0+' '+time0 + time[:] = tyme + if km > 0: # pressure level not supported yet + lev = nc.createVariable('lev','f4',('lev',),zlib=zlib) + lev.long_name = 'Vertical Level' + lev.units = 'km' + lev.positive = 'down' + lev.axis = 'z' + lev[:] = range(1,km+1) + + # Add fake dimensions for GrADS compatibility + # ------------------------------------------- + x = nc.createVariable('x','f4',('x',),zlib=zlib) + x.long_name = 'Fake Longitude for GrADS Compatibility' + x.units = 'degrees_east' + x[:] = zeros(1) + y = nc.createVariable('y','f4',('y',),zlib=zlib) + y.long_name = 'Fake Latitude for GrADS Compatibility' + y.units = 'degrees_north' + y[:] = zeros(1) + if options.station: + e = nc.createVariable('station','i4',('station',),zlib=zlib) + e.long_name = 'Station Ensemble Dimension' + e.axis = 'e' + e.grads_dim = 'e' + e[:] = range(len(stations)) + + # Lat/Lon Coordinates + # ---------------------- + if options.station: + lon = nc.createVariable('longitude','f4',('station',),zlib=zlib) + lon.long_name = 'Longitude' + lon.units = 'degrees_east' + lon[:] = lons[:] + lat = nc.createVariable('latitude','f4',('station',),zlib=zlib) + lat.long_name = 'Latitude' + lat.units = 'degrees_north' + lat[:] = lats[:] + else: + lon = nc.createVariable('longitude','f4',('time',),zlib=zlib) + lon.long_name = 'Longitude' + lon.units = 'degrees_east' + lon[:] = lons[:] + lat = nc.createVariable('latitude','f4',('time',),zlib=zlib) + lat.long_name = 'Latitude' + lat.units = 'degrees_north' + lat[:] = lats[:] + + # Time in ISO format if so desired + # --------------------------------- + isotime = nc.createVariable('isotime','S1',('time','ls'),zlib=zlib) + isotime.long_name = 'Time (ISO Format)' + isotime[:] = isotimeIn[:] + + # Write each variable + # -------------------------------------------------- + for n, name in enumerate(MieVarsNames): + + var = squeeze(MieVars[name]) + size = len(var.shape) + if options.station: + if size == 2: + var = asarray([var]) + size = len(var.shape) + if size == 3: + dim = ('station','time','lev') + if size == 2: + dim = ('time','lev') + if size == 1: + dim = ('time') + this = nc.createVariable(name,'f4',dim,zlib=zlib) + this.standard_name = name + this.units = MieVarsUnits[n] + this.missing_value = MAPL_UNDEF + if options.station: + this[:] = transpose(var,(0,2,1)) + else: + this[:] = transpose(var) + + # Close the file + # -------------- + nc.close() + + if options.verbose: + print " <> wrote %s file %s"%(options.format,options.outFile) + + +#------------------------------------ M A I N ------------------------------------ + +if __name__ == "__main__": + + format = 'NETCDF3_CLASSIC' + inFile = 'trj_sampler.nc' + outFile = 'ext_sampler.nc' + channel = (532,) + rcFile = 'Aod3d_532nm.rc' + +# Parse command line options +# -------------------------- + parser = OptionParser() + + parser.add_option("-i", "--input", dest="inFile", default=inFile, + help="Sampled input file") + + parser.add_option("-o", "--output", dest="outFile", default=outFile, + help="Output file containing optical properties") + + parser.add_option("-r", "--rc", dest="rcFile", default=rcFile, + help="Resource file pointing to optical tables") + + parser.add_option("-f", "--format", dest="format", default=format, + help="Output file format: one of NETCDF4, NETCDF4_CLASSIC, NETCDF3_CLASSIC, NETCDF3_64BIT or EXCEL (default=%s)"%format ) + + parser.add_option("-c", "--channel", dest="channel", default=channel, + help="Channel for Mie calculation") + + parser.add_option("-v", "--verbose", + action="store_true", dest="verbose", + help="Verbose mode") + + parser.add_option("--du", + action="store_true", dest="dust", + help="Dust Only") + + parser.add_option("--ss", + action="store_true", dest="seasalt", + help="Seasalt Only") + + parser.add_option("--su", + action="store_true", dest="sulfate", + help="Sulfate Only") + + parser.add_option("--bc", + action="store_true", dest="bcarbon", + help="Black Carbon Only") + + parser.add_option("--oc", + action="store_true", dest="ocarbon", + help="Organic Carbon Only") + + parser.add_option("--stn", + action="store_true", dest="station", + help="Input File is from stn_sampler.py") + + (options, args) = parser.parse_args() + + + # Create consistent file name extension + # ------------------------------------- + name, ext = os.path.splitext(options.outFile) + if ext.upper() == '.XLS': + options.format = 'EXCEL' + if 'NETCDF4' in options.format: + options.outFile = name + '.nc4' + elif 'NETCDF3' in options.format: + options.outFile = name + '.nc' + elif 'EXCEL' in options.format: + options.outFile = name + '.xls' + else: + raise ValueError, 'invalid extension <%s>'%ext + + + # Get Variables + # -------------------------- + Vars = getVars(options.inFile) + + # Run Mie Calculator and Write Output Files + # -------------------------- + if options.station: + StnNames = Vars.STNNAME + else: + StnNames = '' + + channelIn = float(options.channel) + MieVars = computeMie(Vars,channelIn,VNAMES,options.rcFile) + writeNC(StnNames,Vars.LONGITUDE,Vars.LATITUDE,Vars.TIME,Vars.ISOTIME,MieVars,MieVarsNames,MieVarsUnits,options.inFile,options.outFile) + + if options.dust: + outFile = options.outFile+'.dust' + MieVars = computeMie(Vars,channelIn,VNAMES_DU,options.rcFile) + writeNC(StnNames,Vars.LONGITUDE,Vars.LATITUDE,Vars.TIME,Vars.ISOTIME,MieVars,MieVarsNames,MieVarsUnits,options.inFile,outFile) + + if options.seasalt: + outFile = options.outFile+'.ss' + MieVars = computeMie(Vars,channelIn,VNAMES_SS,options.rcFile) + writeNC(StnNames,Vars.LONGITUDE,Vars.LATITUDE,Vars.TIME,Vars.ISOTIME,MieVars,MieVarsNames,MieVarsUnits,options.inFile,outFile) + + if options.sulfate: + outFile = options.outFile+'.su' + MieVars = computeMie(Vars,channelIn,VNAMES_SU,options.rcFile) + writeNC(StnNames,Vars.LONGITUDE,Vars.LATITUDE,Vars.TIME,Vars.ISOTIME,MieVars,MieVarsNames,MieVarsUnits,options.inFile,outFile) + + if options.bcarbon: + outFile = options.outFile+'.bc' + MieVars = computeMie(Vars,channelIn,VNAMES_BC,options.rcFile) + writeNC(StnNames,Vars.LONGITUDE,Vars.LATITUDE,Vars.TIME,Vars.ISOTIME,MieVars,MieVarsNames,MieVarsUnits,options.inFile,outFile) + + if options.ocarbon: + outFile = options.outFile+'.oc' + MieVars = computeMie(Vars,channelIn,VNAMES_OC,options.rcFile) + writeNC(StnNames,Vars.LONGITUDE,Vars.LATITUDE,Vars.TIME,Vars.ISOTIME,MieVars,MieVarsNames,MieVarsUnits,options.inFile,outFile) + diff --git a/ESMF/Shared/Chem_Base/extinction_calculator.csh b/ESMF/Shared/Chem_Base/extinction_calculator.csh new file mode 100755 index 00000000..a1547b6f --- /dev/null +++ b/ESMF/Shared/Chem_Base/extinction_calculator.csh @@ -0,0 +1,139 @@ +#!/bin/csh -f +# +# Computes aerosol extention files. See usage: below for details. +# + +echo "Beginning Exctinction Calculator $argv" + +# set up executable names (assumes they are on the path) + set chemaod = "${FVROOT}/bin/Chem_Aod3d.x" + set lcv2prs = "${FVROOT}/bin/lcv2prs.x" + +# Did I pass in a filename to operate on? + if ($#argv < 1) then + goto usage + endif + +# Check options + if ( "$1" == "-clean" ) then + set clean = 1 + shift + else + set clean = 0 + endif + +# Setup the input filename + set inpfile = $1 + +# Parse the name of the input filename + set expid = `echo $inpfile:r:r:r` + set inpfiletyp = `echo $inpfile:r:r:e` + set datetag = `echo $inpfile:r:e` + +# Trickery to pull out the YYYYMMDD and HHMMSS from filename + set datevalid = `echo $datetag | cut -d"+" -f2` + set YYYYMMDD = `echo $datevalid | cut -c1-8` + set HHMMSS = `echo $datevalid | cut -c10-13`00 + +# Check the input file passed +# If it is not of type "filetyp" then exit + if ( "$inpfiletyp" =~ *3d_aer_v* ) then + echo "Starting extinction calculation for file $inpfile" + else + exit 0 # Not an error, exit gracefully + endif + /bin/rm -f tau3d.nc4 +# Now run the AOD calculator +# With no other options will produce output file tau3d.nc4 + set cmd = "$chemaod -t Aod_CALIPSO.rc $inpfile" + echo $cmd + $cmd + if ( $status ) then + echo $0": error running the extinction calculator" + exit 2 + endif + +# rename the output file + set extvfile = `echo $inpfile | sed -e 's/_aer_v/_ext_v/g'` + \mv -f tau3d.nc4 $extvfile + +# Now do the pressure level interpolation + set extpfile = `echo $inpfile | sed -e 's/_aer_v/_ext_p/g'` + set savfile = `echo $inpfile | sed -e 's/_aer_v/_sav_v/g'` + $lcv2prs -nStep=1 -date $YYYYMMDD -start $HHMMSS \ + -vars @tavg3d_ext_p -rc tavg3d_ext_p.rc \ + -o $extpfile $extvfile + if ( $status ) then + echo $0": error on return from lcv2prs - aborting" + exit 3 + endif + +# Optional clean-up: delete input and intermediate files + if ( $clean ) then + +# /bin/cp $inpfile $extvfile $extpfile /explore/nobackup/dao_ops/colarco + /bin/mv $inpfile $savfile + \rm -f $inpfile $extvfile + endif + + echo $0":All done" +# Kludge for MPI run + if ( $?MPI_ENVIRONMENT ) ${FVROOT}/bin/makeiau.x + exit + + exit 0 + +#-------------------------------------------------------------- +usage: + +cat < 0) then + read(res(1:i) , '(i4)', iostat=rc) im + if (rc /= 0) then + rc = ERROR_DIM_SIZES + return + end if + + read(res(i+1:), '(i4)', iostat=rc) jm + if (rc /= 0) then + rc = ERROR_DIM_SIZES + return + end if + else + rc = ERROR_DIM_SIZES + return + end if + end select + + if ((im > 0) .and. (jm > 0)) then + rc = SUCCESS + else + rc = ERROR_GRID + end if + + return +end subroutine parse_resolution + + +subroutine parse_levels(lev, lm, rc) + + implicit none + + character(len=*), intent(in) :: lev ! resolution string + integer, intent(out) :: lm ! JM + integer, intent(out) :: rc ! return code + + read(lev, '(i3)', iostat=rc) lm + + if (rc == 0) then + rc = SUCCESS + else + rc = ERROR_VERTICAL_LEVELS + end if + +end subroutine parse_levels + + +subroutine parse_real(str, v, rc) + + implicit none + + character(len=*), intent(in) :: str ! string + real, intent(out) :: v ! real + integer, intent(out) :: rc ! return code + + read(str, *, iostat=rc) v + + if (rc == 0) then + rc = SUCCESS + else + rc = ERROR_CONVERSION_TO_REAL + end if + +end subroutine parse_real + + +subroutine error_message(rc) + + implicit none + + integer, intent (in) :: rc + + select case (rc) + case (ERROR_UNRECOGNIZED_ARGUMENTS) + print *, 'Missing source and target files, horizontal resolution.' + print *, "Try 'gogo.x --help' for more information." + + case (ERROR_DIM_SIZES) + print *, 'Please provide the restart file resolution as two numbers' + print *, "separated by comma, e.g., '-r 576,361'" + + case (ERROR_GRID) + print *, "Unrecognized grid. Please use one of the nominal GEOS-5 grids, e.g., 'c90', 'd', ..." + + case (ERROR_UNSPECIFIED_SOURCE_CHEM_REGISTRY) + print *, 'Please provide source chem registry file.' + + case (ERROR_UNSPECIFIED_TARGET_CHEM_REGISTRY) + print *, 'Please provide target chem registry file.' + + case (ERROR_UNSPECIFIED_SOURCE_GOCART_RESTART) + print *, 'Please provide input GOCART restart file.' + + case (ERROR_UNSPECIFIED_TARGET_GOCART_RESTART) + print *, 'Please provide output GOCART restart file.' + + case (ERROR_UNSPECIFIED_RESOLUTION) + print *, 'Please provide horizontal resolution.' + + case (ERROR_DUPLICATED_OPTIONS) + print *, "One or more duplicated options. Try 'gogo.x --help' for more information." + + case (ERROR_MISSING_OPTION) + print *, "Missing mandatory option. Try 'gogo.x --help' for more information." + + case default + print *, "Try 'gogo.x --help' for more information." + end select + + print * + print * + +end subroutine + +end program gocart_restart_editor + diff --git a/ESMF/Shared/Chem_Base/merge_crst.F90 b/ESMF/Shared/Chem_Base/merge_crst.F90 new file mode 100644 index 00000000..2f5345e0 --- /dev/null +++ b/ESMF/Shared/Chem_Base/merge_crst.F90 @@ -0,0 +1,131 @@ +! +! Merge 2 Chem_Bundles. Quick and dirty. +! + + program merge_crst + + use Chem_RegistryMod + use Chem_BundleMod + + character(len=255) :: in_file(2), in_reg(2), out_file + integer :: ier + + type(Chem_Registry) :: reg_in(2), reg_out + type(Chem_Registry) :: reg + type(Chem_Bundle) :: w_in(2), w_out + + integer :: k,nhms,nymd,nymd2,nhms2,im,jm,km + integer :: i, j, i_in, i_out, j_in, j_out + +! Take Aerosols and global CO from CRAVE run +! ------------------------------------------ + in_file(1) = '/output/dao_ops/GEOS-4_CRAVE/a_flk_04C/rs/Y2006/M02/a_flk_04C.rst.chem.20060221_15z.bin' + + in_reg(1) = '/output/dao_ops/GEOS-4_CRAVE/a_flk_04C/run/Chem_Registry.rc' + +! Take O3 from Eric's file +! ------------------------ + in_file(2) = '/nobackup1/enielsen/fvchem/INTEX2006/c55/recycle/c55.c_rst.20060101' + in_reg(2) = '/nobackup1/enielsen/fvchem/INTEX2006/c55/run/Chem_Registry.rc' + +! Output file to create + out_file = '/nobackup1/dasilva/rs4intex/20060221_15/a_flk_04C.c_rst' + +! Create registries +! ----------------- + reg_in(1) = Chem_RegistryCreate ( ier, rcfile = in_reg(1) ) + call Chem_RegistryPrint(reg_in(1)) + reg_in(2) = Chem_RegistryCreate ( ier, rcfile = in_reg(2) ) + call Chem_RegistryPrint(reg_in(2)) + reg_out = Chem_RegistryCreate ( ier, rcfile = 'Chem_Registry.rc' ) + call Chem_RegistryPrint(reg_out) + if ( ier /= 0 ) then + print *,'oops, error' + call exit(1) + end if + +! Read in source bundles +! ------------------------ + call Chem_BundleRead ( trim(in_file(1)), nymd, nhms, w_in(1), ier, & + chemReg = reg_in(1) ) + print *, 'Read first bundle at on ', nymd, nhms + call Chem_BundleRead ( trim(in_file(2)), nymd2, nhms2, w_in(2), ier, & + chemReg = reg_in(2) ) + print *, 'nymd, nhms = ', nymd2, nhms2 + +! Fill in the static portion of the outgoing chem bundle +! ------------------------------------------------------ + im = w_in(1)%grid%im + jm = w_in(1)%grid%jm + km = w_in(1)%grid%km + call Chem_BundleCreate ( reg_out, im, jm, km, & + w_out, ier ) + call Chem_RegistryPrint(w_out%reg) + +! Most things come from the CRAVE run +! ----------------------------------- + w_out%delp = w_in(1)%delp + w_out%rh = w_in(1)%rh + w_out%qa = w_in(1)%qa + w_out%grid = w_in(1)%grid + + w_out% q = 0.0 ! start with a clean slate + +! H2O +! --- + i_in = reg_in(1)%i_H2O; j_in = reg_in(1)%j_H2O; + i_out = reg_out%i_H2O; j_out = reg_out%j_H2O; + w_out%q(:,:,:,i_out:j_out) = w_in(1)%q(:,:,:,i_in:j_in) + +! DU +! --- + i_in = reg_in(1)%i_DU; j_in = reg_in(1)%j_DU; + i_out = reg_out%i_DU; j_out = reg_out%j_DU; + w_out%q(:,:,:,i_out:j_out) = w_in(1)%q(:,:,:,i_in:j_in) + +! SS +! --- + i_in = reg_in(1)%i_SS; j_in = reg_in(1)%j_SS; + i_out = reg_out%i_SS; j_out = reg_out%j_SS; + w_out%q(:,:,:,i_out:j_out) = w_in(1)%q(:,:,:,i_in:j_in) + +! BC +! --- + i_in = reg_in(1)%i_BC; j_in = reg_in(1)%j_BC; + i_out = reg_out%i_BC; j_out = reg_out%j_BC; + w_out%q(:,:,:,i_out:j_out) = w_in(1)%q(:,:,:,i_in:j_in) + +! OC +! --- + i_in = reg_in(1)%i_OC; j_in = reg_in(1)%j_OC; + i_out = reg_out%i_OC; j_out = reg_out%j_OC; + w_out%q(:,:,:,i_out:j_out) = w_in(1)%q(:,:,:,i_in:j_in) + +! SU +! --- + i_in = reg_in(1)%i_SU; j_in = reg_in(1)%j_SU; + i_out = reg_out%i_SU; j_out = reg_out%j_SU; + w_out%q(:,:,:,i_out:j_out) = w_in(1)%q(:,:,:,i_in:j_in) + +! Get O3 from Eric +! ---------------- + i_in = reg_in(2)%i_O3; j_in = reg_in(2)%j_O3; + i_out = reg_out%i_O3; j_out = reg_out%j_O3; + w_out%q(:,:,:,i_out:j_out) = w_in(2)%q(:,:,:,i_in:j_in) + +! CO from Eric +! ------------ + i_in = reg_in(2)%i_CO; j_in = reg_in(2)%j_CO; + i_out = reg_out%i_CO; j_out = reg_out%j_CO; + w_out%q(:,:,:,i_out:j_out) = w_in(2)%q(:,:,:,i_in:j_in) + + +! Write output file with date from Ops +! ------------------------------------ + call Chem_BundleWrite ( trim(out_file), nymd, nhms, 0, w_out, ier ) + + print *, 'all done' + + end program merge_crst + + diff --git a/ESMF/Shared/Chem_Base/mieobs.py b/ESMF/Shared/Chem_Base/mieobs.py new file mode 100644 index 00000000..34b33284 --- /dev/null +++ b/ESMF/Shared/Chem_Base/mieobs.py @@ -0,0 +1,302 @@ +""" + Implements Python interface to Mie Calculator. Based on f2py extension Mie_. + +""" + +from numpy import array, isfortran, ones, float32, size, zeros +from pylab import plot, axis, title +from MAPL import config + +VNAMES = [ 'DU001', 'DU002', 'DU003', 'DU004', 'DU005', + 'SS001', 'SS002', 'SS003', 'SS004', 'SS005', + 'BCPHOBIC', 'BCPHILIC', + 'OCPHOBIC', 'OCPHILIC', + 'SO4' ] + +import MieObs_ + +def getMieDims(rcfile='Aod_EOS.rc'): + """ + Return dimensions of Mie-table like nPol and nMom. + """ + cf = config.Config(rcfile) + dutable = cf('filename_optical_properties_DU') + nCh, nRh, nBin, nMom, nPol, rc = MieObs_.getmiedims(dutable) + if rc != 0: + raise ValueError, "on return from getMieDims, rc = %d"%rc + + return (nMom, nPol) + +#--- +def _toArray(channels): + """Return numpy array, if *channels* is a scalar.""" + + if type(channels) is int: + channels = (channels, ) + elif type(channels) is float: + channels = (channels, ) + channels = array(channels) + return channels +#--- +def aerToUpper(aer): + """ + Create upper case aliases for aer variables to cope with changes + in filename. + """ + vnames = aer.__dict__.keys() + for v in vnames: + V = v.upper() + if v != V: + aer.__dict__[V] = aer.__dict__[v] # make alias +#--- +def getEdgeVars(aer,ptop=1.): + """ + Given aer object with (airdens,delp) attributes + returns + pe --- layer edge pressure [Pa] + ze --- layer edge height above sfc [m] + te --- temperature [K] at layer edge + + Input arrays can be (nobs,km) or (km,nobs). + It always returns arrays that are (km,nobs). + """ + if needs_transpose(aer): + pe, ze, te = MieObs_.getedgevars(aer.AIRDENS.T,aer.DELP.T,ptop) + else: + pe, ze, te = MieObs_.getedgevars(aer.AIRDENS,aer.DELP,ptop) + + return (pe,ze,te) + +#-- +def getAOPscalar(aer,channels,vnames=VNAMES,vtypes=None,Verbose=False,rcfile='Aod_EOS.rc'): + """ + Compute (tau,ssa,g) given aer object. + + Input arrays can be (nobs,km) or (km,nobs). + It always returns arrays that are (km,nobs). + """ + + # Variable type for mie calculation + # --------------------------------- + if vtypes is None: + vtypes = vname # to be used in mie calculation + + # Make sure channels is a numpy array + # ------------------------------------- + channels = _toArray(channels) + + # Pack inputs + # ----------- + nq, nch = len(vnames), len(channels) + nobs = size(aer.PS) + if needs_transpose(aer): # aer is (nobs,km) + km = aer.DELP.shape[1] + qm = ones((km,nq,nobs),dtype=float32) + rh = aer.RH.T +# rh = zeros((km,nobs)) + for n, v in zip(range(nq),vnames): + V = v.upper() + qm[:,n,:] = aer.__dict__[V].T * aer.DELP.T / 9.81 + else: # aer is (km,nobs) + km = aer.DELP.shape[0] + qm = ones((km,nq,nobs),dtype=float32) + rh = aer.RH +# rh = zeros((km,nobs)) + for n, v in zip(range(nq),vnames): + V = v.upper() + qm[:,n,:] = aer.__dict__[V] * aer.DELP / 9.81 + + # Do the Mie calculation + # ---------------------- + tau,ssa,g,rc = MieObs_.getaopscalar(rcfile,channels,pad(vtypes),Verbose,qm,rh) + + if rc!=0: + print "<<>> on return from MieObs_.getaopscalar, rc = ", rc + raise ValueError, 'cannot get Aerosol Optical Properties (scalar version)' + + return (tau,ssa,g) +#-- +def getAOPvector(aer,channels,I=None,vnames=VNAMES,vtypes=None, + Verbose=False,rcfile='Aod_EOS.rc',nMom=301): + """ + Compute (tau,ssa,g,pmom) given aer object. + + Input arrays can be (nobs,km) or (km,nobs). + It always returns arrays that are (km,nobs). + + J --- index of subset of observations to process + """ + + # Variable type for mie calculation + # --------------------------------- + if vtypes is None: + vtypes = vname # to be used in mie calculation + + # Make sure channels is a numpy array + # ------------------------------------- + channels = _toArray(channels) + + # Pack inputs + # ----------- + nq, nch = len(vnames), len(channels) + if I is None: + nobs = size(aer.PS) + I = range(0,nobs) + else : + nobs = len(I) + + if needs_transpose(aer): # aer is (nobs,km) + km = aer.DELP.shape[1] + + qm = ones((km,nq,nobs),dtype=float32) + rh = aer.RH[I].T + for n, v in zip(range(nq),vnames): + V = v.upper() + qm[:,n,:] = aer.__dict__[V][I].T * aer.DELP[I].T / 9.81 + else: # aer is (km,nobs) + km = aer.DELP.shape[0] + qm = ones((km,nq,nobs),dtype=float32) + rh = aer.RH[:,I] + for n, v in zip(range(nq),vnames): + V = v.upper() + qm[:,n,:] = aer.__dict__[V][:,I] * aer.DELP[:,I] / 9.81 + + + # Do the Mie calculation + # ---------------------- + nMom_mieTable,nPol_mieTable = getMieDims(rcfile=rcfile) # return nMom & nPol of the Mie tables + nPol = 6 # for dust non spherical + tau,ssa,g,pmom,rc = MieObs_.getaopvector(rcfile,channels,pad(vtypes),Verbose,qm,rh,nMom,nPol) + + if rc!=0: + print "<<>> on return from MieObs_.getaopvector, rc = ", rc + raise ValueError, 'cannot get Aerosol Optical Properties (vector version)' + + return (tau,ssa,g,pmom) +#--- +def getAOPext(aer,channels,I=None,vnames=VNAMES,vtypes=None,Verbose=False,rcfile='Aod3d_532nm.rc'): + """ + Compute (ext,backscat,aback_sfc,aback_toa) given aer object. + + Input arrays can be (nobs,km) or (km,nobs). + It always returns arrays that are (km,nobs). + + I --- index of subset of observations to process + """ + + # Variable type for mie calculation + # --------------------------------- + if vtypes is None: + vtypes = vname # to be used in mie calculation + + # Make sure channels is a numpy array + # ------------------------------------- + channels = _toArray(channels) + + # Pack inputs + # ----------- + nq, nch = len(vnames), len(channels) + + if I is None: + nobs = size(aer.PS) + I = range(0,nobs) + else : + nobs = len(I) + + if needs_transpose(aer): # aer is (nobs,km) + km = aer.DELP.shape[1] + + qc = ones((km,nq,nobs),dtype=float32) + qm = ones((km,nq,nobs),dtype=float32) + rh = aer.RH[I].T +# rh = zeros((km,nobs)) + for n, v in zip(range(nq),vnames): + V = v.upper() + qc[:,n,:] = aer.__dict__[V][I].T * aer.AIRDENS[I].T + qm[:,n,:] = aer.__dict__[V][I].T * aer.DELP[I].T / 9.81 + else: # aer is (km,nobs) + km = aer.DELP.shape[0] + + qc = ones((km,nq,nobs),dtype=float32) + qm = ones((km,nq,nobs),dtype=float32) + rh = aer.RH[I] +# rh = zeros((km,nobs)) + for n, v in zip(range(nq),vnames): + V = v.upper() + qc[:,n,:] = aer.__dict__[V][:,I] * aer.AIRDENS[:,I] + qm[:,n,:] = aer.__dict__[V][:,I] * aer.DELP[:,I] / 9.81 + + # Do the Mie calculation + # ---------------------- + ext,sca,backscat,aback_sfc,aback_toa,depol,rc = \ + MieObs_.getext(rcfile,channels,pad(vtypes),Verbose,qc,qm,rh) + + if rc!=0: + print "<<>> on return from MieObs_.getaopvector, rc = ", rc + raise ValueError, 'cannot get Aerosol Optical Properties (vector version)' + + return (ext,sca,backscat,aback_sfc,aback_toa,depol) + +#........................................................................ +def pad(names): + """ + Make all strings in list *names* the same size for f2py's benefit. + """ + return [ "%-16s"%v for v in names ] + +#........................................................................ +def needs_transpose(aer): + """ + Returns + True if aer object has shapes (nobs,km) + False if aer object has shapes (km,nobs) + This is needed to cope with the way the fortran expects + the data arrays. + """ + if aer.PS.shape[0] == aer.DELP.shape[0]: # (nobs,km) + return True + else: + return False + +#........................................................................ + +if __name__ == "__main__": + + from pyobs import LIDAR_L2, NPZ + from mie import getTopo + + channels = array([532.,]) + + c_dn = '/nobackup/2/vbuchard/LIDAR/dR_Fortuna-2-4-b4/' # Pete's Calipso interp + a_dn = '/nobackup/2/vbuchard/LIDAR/dR_Fortuna-2-4-b4/' # aer_Nv + interp + + c_fn = 'dR_Fortuna-2-4-b4.calipso_532nm.20090715.nc' # Pete's interp + a_fn = 'dR_Fortuna-2-4-b4.calipso_aer.20090715.npz' # aer collocation + + # Read relevant data + # ------------------ + c = LIDAR_L2(c_dn+c_fn) # Pete's interp with CALPSO coordinates + a = NPZ(a_dn+a_fn) # aer_v interpolated to obs location + aerToUpper(a) +# --------------------------------------------------------------------------- +# NOTE: +# +# For creating the npz file above with the aer_v data interpolated to obs , +# location you do this: +# c.sampleFile(aer_v,npzFile=npzFile) +# where aer_v is the full, gridded, netcdf file. +# In principle, you do not need to write the npzFile as the result of the +# sampling is also available as attribute *sample*. So, instead of reading +# the npzFile you could do +# a = c.sample +# But sampling takes time, so saving a "sampling file" is convenient. +# BTW, npzFile is too python specific. Soon, I'll implement a NetCDF option, +# so you will be able to say +# c.sample(aer_v,ncFile=NetCDF_filename) +# See bottom of GMAO_pyobs/pyobs.lidar_l2.py file for an example. +# --------------------------------------------------------------------------- + + pe, ze, te = getEdgeVars(a) + + tau, ssa, g = getAOPscalar(a,channels,rcfile='Aod_EOS.rc') + ext,sca,backscat,aback_sfc,aback_toa = getAOPext(a,channels) diff --git a/ESMF/Shared/Chem_Base/reff.py b/ESMF/Shared/Chem_Base/reff.py new file mode 100755 index 00000000..c62369d1 --- /dev/null +++ b/ESMF/Shared/Chem_Base/reff.py @@ -0,0 +1,156 @@ +#!/usr/bin/env python + +""" + Python wrapper for ana_lpe.x. + + ana_lde.py aer_f aod_d + +""" + +import os +import sys + +from optparse import OptionParser # Command-line args + +from gfio import GFIO +from MAPL import config + +import warnings +warnings.filterwarnings("ignore") + +#--------------------------------------------------------------------- + +if __name__ == "__main__": + + expid = "a0000" + dir = '.' + +# System Dependent defaults +# ------------------------- + if os.path.exists("/nobackup/1/ARCTAS"): # calculon + dir_f = '/nobackup/1/ARCTAS/' + dir_a = '/home/adasilva/GAAS/%s/chem/' + aer_f = dir_f + 'Y%y4/M%m2/d5_arctas_02.inst3d_aer_v.%y4%m2%d2_%h2%n2z.nc' + aer_a = dir_a + "Y%y4/M%m2/%s.aer_a.eta.%y4%m2%d2_%h2%n2z.nc4" + aod_f = dir_a + "Y%y4/M%m2/%s.aod_f.sfc.%y4%m2%d2_%h2%n2z.nc" + aod_d = dir_a + "Y%y4/M%m2/%s.aod_d.sfc.%y4%m2%d2_%h2%n2z.nc" + elif os.path.exists('/discover/nobackup/projects/gmao/iesa/'): # Discover + dir_f = '/discover/nobackup/projects/gmao/iesa/aerosol/data/ARCTAS/' + dir_a = '/discover/nobackup/projects/gmao/iesa/aerosol/experiments/GAAS/%s/chem/' + aer_f = dir_f + 'Y%y4/M%m2/D%d2/d5_arctas_02.inst3d_aer_v.%y4%m2%d2_%h2%n2z.nc4' + aer_a = dir_a + "Y%y4/M%m2/D%d2/%s.aer_a.eta.%y4%m2%d2_%h2%n2z.nc4" + aod_f = dir_a + "Y%y4/M%m2/%s.aod_f.sfc.%y4%m2%d2_%h2%n2z.nc" + aod_d = dir_a + "Y%y4/M%m2/%s.aod_d.sfc.%y4%m2%d2_%h2%n2z.nc" + else: # Generic default + aer_f = "%s.aer_f.eta.%y4%m2%d2_%h2%n2z.nc" + aer_a = "%s.aer_a.eta.%y4%m2%d2_%h2%n2z.nc" + aod_f = "%s.aod_f.sfc.%y4%m2%d2_%h2%n2z.nc" + aod_d = "%s.aod_d.sfc.%y4%m2%d2_%h2%n2z.nc" + + + rc_file = "lde.rc" + Nx = "2" + Ny = "4" + +# Parse command line options +# -------------------------- + parser = OptionParser(usage="Usage: %prog [options] nymd nhms", + version='1.0.0' ) + + parser.add_option("-A", "--aer_a", dest="aer_a", default=aer_a, + help="output aerosol concentration analysis file template (default=%s)"%aer_a ) + + parser.add_option("-F", "--aer_f", dest="aer_f", default=aer_f, + help="input aerosol concentration background file template (default=%s)"%aer_f ) + + parser.add_option("-D", "--dir", dest="dir", default=dir, + help="directory name to append to file names (default=%s)"%dir ) + + parser.add_option("-d", "--aod_d", dest="aod_d", default=aod_d, + help="output AOD analysis increment file template (default=%s)"%aod_d ) + + parser.add_option("-f", "--aod_f", dest="aod_f", default=aod_f, + help="output AOD background file template (default=%s)"%aod_f ) + + parser.add_option("-r", "--rcfile", dest="rc", default=rc_file, + help="resource file (default=%s)"%rc_file ) + + parser.add_option("-X", "--Nx", dest="Nx", default=Nx, + help="number of PEs to decompose longitude (default=%s)"%Nx ) + + parser.add_option("-Y", "--Ny", dest="Ny", default=Ny, + help="number of PEs to decompose latitude (default=%s)"%Ny ) + + parser.add_option("-x", "--expid", dest="expid", default=expid, + help="experiment Id (default=%s)"%expid ) + + parser.add_option("-v", "--verbose", + action="store_true", dest="verbose") + + options, args = parser.parse_args() + + if len(args) < 2: + parser.error("not enough input arguments") + else: + nymd = args[0] + nhms = args[1] + +# Expand file name templates +# -------------------------- + options.aer_f = config.strTemplate(options.aer_f,expid=options.expid, + nymd=nymd,nhms=nhms) + options.aer_a = config.strTemplate(options.aer_a,expid=options.expid, + nymd=nymd,nhms=nhms) + options.aod_f = config.strTemplate(options.aod_f,expid=options.expid, + nymd=nymd,nhms=nhms) + options.aod_d = config.strTemplate(options.aod_d,expid=options.expid, + nymd=nymd,nhms=nhms) + +# Append directory +# ---------------- + if options.aer_f[0] not in ('/','.'): + options.aer_f = options.dir+'/'+options.aer_f + if options.aer_a[0] not in ('/','.'): + options.aer_a = options.dir+'/'+options.aer_a + if options.aod_f[0] not in ('/','.'): + options.aod_f = options.dir+'/'+options.aod_f + if options.aod_d[0] not in ('/','.'): + options.aod_d = options.dir+'/'+options.aod_d + +# Get file dimensions +# ------------------- + f = GFIO(options.aer_f,'r') + d = GFIO(options.aod_d,'r') + +# Load rc file +# ------------ + cf = config.Config(options.rc) + +# Update rc file with user specified parameters +# --------------------------------------------- + cf('ExpId',options.expid) + cf('Layout_Nx',options.Nx) + cf('Layout_Ny',options.Ny) + cf('IM_World',f.im) + cf('JM_World',f.jm) + cf('LM_World',f.km) + cf('CM_World',d.km) + cf('nymd',nymd) + cf('nhms',nhms) + if options.verbose: + cf('verbose',".TRUE.") + else: + cf('verbose',".FALSE.") + cf('aer_ana_filename',options.aer_a) + cf('aer_bkg_filename',options.aer_f) + cf('aod_bkg_filename',options.aod_f) + cf('aod_inc_filename',options.aod_d) + cf.save(rcfile="lde.rc") # save updated rc file + + nPE = int(options.Nx) * int(options.Ny) + +# Run the Fortran binary +# ---------------------- + rc = os.system("mpirun -np %d ana_lde.x"%nPE) + if rc: + raise RuntimeError, "rc=%d on return from 'ana_lde.x'"%rc diff --git a/ESMF/Shared/Chem_Base/reff.rc b/ESMF/Shared/Chem_Base/reff.rc new file mode 100755 index 00000000..5aed43ac --- /dev/null +++ b/ESMF/Shared/Chem_Base/reff.rc @@ -0,0 +1,49 @@ +# +# FVPSAS Analysis resource file. +# +# !REVISION HISTORY: +# +# 14feb2010 da Silva Adapted from GEOS-4 ana.rc. +# +#----------------------------------------------------------------------------- + +# ------------------ +# Dynamic Parameters +# ------------------ + +ExpId: aXXXX + +Layout_Nx: 2 +Layout_Ny: 4 + +IM_World: 72 # 1024 +JM_World: 46 # 512 +LM_World: 91 + +nymd: 20080630 +nhms: 120000 + +# ------------------- +# File Name Templates +# ------------------- + +aer_bkg_filename: /nobackup/1/ARCTAS/Y2008/M06/d5_arctas_02.inst3d_aer_v.20080630_1200z.nc +aer_reff_filename: /nobackup/1/ARCTAS/Y2008/M06/d5_arctas_02.inst3d_ref_v.20080630_1200z.nc + +# ------------------- +# MIE PARAMETERS +# ------------------- + +# Common MODIS/MISR channels +NUM_BANDS: 4 + BANDS: 470.E-9 550.E-9 660.E-9 870.E-9 + +DU_OPTICS: ExtData/PIESA/x/optics_DU.v15_3.nc +SS_OPTICS: ExtData/PIESA/x/optics_SS.v3_3.nc +SU_OPTICS: ExtData/PIESA/x/optics_SU.v1_3.nc +NI_OPTICS: ExtData/PIESA/x/optics_NI.v2_5.nc +OC_OPTICS: ExtData/PIESA/x/optics_OC.v1_3.nc +BRC_OPTICS: ExtData/PIESA/x/optics_BRC.v1_5.nc +BC_OPTICS: ExtData/PIESA/x/optics_BC.v1_3.nc + +#. diff --git a/ESMF/Shared/Chem_Base/reff_calculator.F90 b/ESMF/Shared/Chem_Base/reff_calculator.F90 new file mode 100644 index 00000000..e31fff67 --- /dev/null +++ b/ESMF/Shared/Chem_Base/reff_calculator.F90 @@ -0,0 +1,174 @@ +# include "MAPL_Generic.h" + + program reff_calculator + +!----------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!----------------------------------------------------------------------- +!BOP +! +! !ROUTINE: ana_aod: AOD Analysis Application +! +! !INTERFACE: +! +! Usage: reff_calculator.x +! +! !USES: +! + use ESMF + use MAPL_Mod + use Chem_SimpleBundleMod + use Chem_RegistryMod + use Chem_MieMod + use Chem_AodMod + + use m_die + use m_FileResolv + use m_StrTemplate + use m_inpak90 + + implicit NONE + +! !DESCRIPTION: Reads a chem bundle file and writes a similar with the effective radius. +! This is a MPI application. +! +! !REVISION HISTORY: +! +! 13jan2011 da Silva Derived from mpana_aod. +! +!EOP +!----------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'reff_calculator' + +! Local variables +! --------------- + integer :: rc + integer :: nymd=0, nhms=0 + integer :: yy, mm, dd, h, m, s + + logical :: verbose = .TRUE. + +! Control variables and obervations +! --------------------------------- + type (MAPL_SimpleBundle) :: q_f ! Gridded concentration background + + type (Chem_Mie) :: Mie ! Mie Tables, etc + type (Chem_Registry) :: aerReg ! Registry with many species + +! Basic ESMF objects +! ------------------ + type(ESMF_Config) :: CF ! Resource file + type(ESMF_Grid) :: etaGrid ! Eta Grid (lon, lat, eta) + type(ESMF_Time) :: Time + type(ESMF_VM) :: VM + + integer :: Nx, Ny ! Layout + integer :: IM_World, JM_World, LM_WORLD ! Global Grid dimensions + + call Main() + +CONTAINS + +!............................................................................................... + Subroutine Main() + + __Iam__('reff_calculator') + +! Initialize the ESMF. For performance reasons, it is important +! to turn OFF ESMF's automatic logging feature +! ------------------------------------------------------------- + call ESMF_Initialize (logKindFlag=ESMF_LOGKIND_NONE, VM=VM, __RC__) + call ESMF_CalendarSetDefault ( ESMF_CALKIND_GREGORIAN, __RC__ ) + + if ( MAPL_am_I_root() ) then + print * + print *, ' --------------------------------------' + print *, ' ana_aod - the aod analysis application' + print *, ' --------------------------------------' + print * + end if + +! ------------------- +! ESMF Grid, Etc +! ------------------- + +! Load resources +! -------------- + CF = ESMF_ConfigCreate(__RC__) + call ESMF_ConfigLoadFile(CF, fileName='reff.rc', __RC__) + +! World grid dimensions and layout +! -------------------------------- + call ESMF_ConfigGetAttribute(CF, IM_World, Label='IM_World:', __RC__ ) + call ESMF_ConfigGetAttribute(CF, JM_World, Label='JM_World:', __RC__ ) + call ESMF_ConfigGetAttribute(CF, LM_World, Label='LM_World:', __RC__ ) + call ESMF_ConfigGetAttribute(CF, Nx, Label='Layout_Nx:', __RC__ ) + call ESMF_ConfigGetAttribute(CF, Ny, Label='Layout_Ny:', __RC__ ) + call ESMF_ConfigGetAttribute(CF, verbose, Label='verbose:', __RC__ ) + +! Create global grids: +! ------------------- + etaGrid = MAPL_LatLonGridCreate (Name='etaGrid', & + Nx = Nx, Ny = Ny, & + IM_World = IM_World, & + JM_World = JM_World, & + LM_World = LM_World, & + __RC__ ) + +! Validate grid +! ------------- + call ESMF_GridValidate(etaGrid,__RC__) + +! Get date/time from CF +! --------------------- + call ESMF_ConfigGetAttribute(CF, nymd, Label='nymd:', __RC__ ) + call ESMF_ConfigGetAttribute(CF, nhms, Label='nhms:', __RC__ ) + +! Create ESMF Time +! ---------------- + yy = nymd/10000; mm = (nymd-yy*10000) / 100; dd = nymd - (10000*yy + mm*100) + h = nhms/10000; m = (nhms - h*10000) / 100; s = nhms - (10000*h + m*100) + call ESMF_TimeSet(Time, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s) + +! ------------------- +! Gridded Background +! ------------------- + +! Registry +! -------- + aerReg = Chem_RegistryCreate ( rc, 'Chem_AerRegistry.rc' ) + if ( rc == 0 ) then + if ( MAPL_AM_I_ROOT() ) then + call Chem_RegistryPrint(aerReg) + end if + else + call die(myname,'could not read Chem Registry for specifies') + end if + +! Read aerosol mixing ratio +! ------------------------- + q_f = Chem_SimpleBundleRead (CF, 'aer_bkg_filename', etaGrid, & + time=Time, verbose=verbose, __RC__ ) + Mie = Chem_MieCreate(CF, chemReg=aerReg, __RC__) + +! Calcular rEff +! ------------- + call MAPL_SimpleBundlePrint(q_f) + call Chem_rEffCalculator (q_f, q_f, Mie, verbose, __RC__) + call MAPL_SimpleBundlePrint(q_f) + +! Write rEff file +! --------------- + call Chem_SimpleBundleWrite (q_f, CF, 'aer_reff_filename', Time, __RC__ ) + +! All done +! -------- + call ESMF_Finalize ( __RC__ ) + + end subroutine Main + + end program reff_calculator + + + diff --git a/ESMF/Shared/Chem_Base/reloc_crst.F90 b/ESMF/Shared/Chem_Base/reloc_crst.F90 new file mode 100644 index 00000000..4a392ce3 --- /dev/null +++ b/ESMF/Shared/Chem_Base/reloc_crst.F90 @@ -0,0 +1,112 @@ +! +! 1) First version added rough estimates SO2 for the Montserrat volcano on +! May 20th, 2006. +! 2) On May 15, SO2 pattern had not moved west as much as seen by OMI. Here +! we apply a simple relocation of that feature to where OMI reported it. +! +! + + program edit_crst + + use Chem_RegistryMod + use Chem_BundleMod + + character(len=255) :: in_file, out_file + character(len=255) :: in_add_file + character(len=255) :: dir, time + real, pointer :: lon(:), lat(:), pm(:,:,:) + real, allocatable :: co2_tmp(:,:,:), tmp(:,:,:) + + type(Chem_Registry) :: reg_in, reg_out + type(Chem_Registry) :: reg + type(Chem_Bundle) :: w_in, w_out + type(Chem_Bundle) :: w + + integer :: k,ier,nhms,nymd,im,jm,km + integer :: ii, jj, i, j, is, js, i1, i2, i1r, i2r, j1, j2, k1, k2, i_so2 + real :: q_so2 + +! real, pointer :: q(:,:,:,:) + + time = '20060520_15z' ! eruption restart + time = '20060525_21z' ! first relocation + +! Look in +! /output0/dao_ops/GEOS-4_AVE_Houston/fvcm_ave_01/rs/Y2005/M06 + in_file = 'a_flk_04C.rst.chem.'//trim(time)//'.bin' + +! Output file to create + out_file = 'a_flk_04C.c_rst.'//time + + reg_in = Chem_RegistryCreate ( ier, rcfile = 'Chem_Registry.rc' ) + reg_out = Chem_RegistryCreate ( ier, rcfile = 'Chem_Registry.rc' ) +! call Chem_registryprint(reg_out) + if ( ier /= 0 ) then + print *,'oops, error' + call exit(1) + end if + + +! Read initial chem bundle +! ------------------------ + call Chem_BundleRead ( trim(in_file), nymd, nhms, w_in, ier, & + chemReg = reg_in ) + print *, 'nymd, nhms = ', nymd, nhms + +! Alter the SO2 amounts (see /home/dasilva/out/montserrat.m on calculon) +! ---------------------------------------------------------------------- +#ifdef MONTSERRAT_ERUPTION + + k1 = 38 + k2 = 40 + is = -49 + if ( is <= 0 ) is = w_in%grid%im + is + js = 108 + print *, 'Nearest gridpoints to Montserrat:' + print *, ' Levels: ', w_in%grid%lev(k1:k2) + print *, ' Lon, lat: ', w_in%grid%lon(is)-360., w_in%grid%lat(js) + + q_so2 = 1.4262e-06 ! Based on Nick estimated 55K tons of SO2. + i_so2 = reg_in%i_su + 1 + print *, 'Variable name: ', reg_in%vname(i_so2) + + w_in%q(is,js,k1:k2,i_so2) = q_so2 + +#else + + k1 = 55 - 21 + 1 + k2 = 55 - 16 + 1 + + i1 = w_in%grid%im - 82 ! source + i2 = w_in%grid%im - 67 ! source + i1r = i1 - 14 ! destination + i2r = i2 - 14 ! destination + + j1 = 98 + j2 = 107 + + allocate ( tmp(i1:i2,j1:j2,k1:k2) ) + + print *, 'Nearest gridpoints to feature:' + print *, ' Levels: ', k1, k2, w_in%grid%lev(k1:k2) + print *, ' Lats: ', w_in%grid%lat(j1:j2) + print *, ' Src Lons: ', w_in%grid%lon(i1)-360., w_in%grid%lon(i2)-360. + print *, ' Dst Lons: ', w_in%grid%lon(i1r)-360., w_in%grid%lon(i2r)-360. + + i_so2 = reg_in%i_su + 1 + print *, 'Variable name: ', reg_in%vname(i_so2) + + tmp = w_in%q(i1r:i2r,j1:j2,k1:k2,i_so2) + w_in%q(i1r:i2r,j1:j2,k1:k2,i_so2) = w_in%q(i1:i2,j1:j2,k1:k2,i_so2) + w_in%q(i1:i2,j1:j2,k1:k2,i_so2) = tmp + +#endif + + +! Write restart +! ------------ + call Chem_BundleWrite ( trim(out_file), nymd, nhms, 1, w_in, ier ) + + end program edit_crst + + diff --git a/ESMF/Shared/Chem_Base/tavg3d_ext_p.rc b/ESMF/Shared/Chem_Base/tavg3d_ext_p.rc new file mode 100644 index 00000000..d84b6cb3 --- /dev/null +++ b/ESMF/Shared/Chem_Base/tavg3d_ext_p.rc @@ -0,0 +1,55 @@ +# lcv2prs.rc +# +# This is a resource file for the lcv2prs utility. +# +# !REVISION HISTORY: +# +# 27Jan2006 B. Yin First version. +# 25Apr2006 Todling Declared dims so fvsetup get set them up. +# 17May2006 Stassi modified from tavg3d_tmp_v.rc for pressure levels +# +#........................................................................... + +# ---------------------- +# Output File Resolution +# ---------------------- + +zonal_resolution: 540 # no. of zonal grid-points (im) +west_most_longitude_in_deg: -180.0 # longitude of first point (i=1) +meridional_resolution: 361 # no. meridional grid-points (jm) +vertical_levels_in_hPa: 1000 975 950 925 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100 70 50 30 20 10 + +# ---------------- +# Variable Classes +# ---------------- + +# A variable class lists the variable names that make up a file type or product. + +# +### PRODUCT: tavg3d_ext_p (3-D tendency) +VarClass*tavg3d_ext_p: delp rh extinction ssa tau +# -------------------- +# Variable Translation +# -------------------- + +Variable_translation_table:: + +# Output | Input +# Name Units | Name scale_factor add_offset Positive check +# ------------------------------------------------------------------------------ + DELP Pa delp 1.0 0.0 0 + RH fraction rh 1.0 0.0 0 + SSA fraction ssa 1.0 0.0 0 + EXTINCTION 1/km extinction 1.0 0.0 0 + TAU UNITLESS tau 1.0 0.0 0 +:: + + + +# Table for variable names and description: + +DELP: Pressure difference between layer edges +RH: Relative Humidity +SSA: Aerosol Single Scatter Albedo [532 nm] +EXTINCTION: Aerosol Extinction [532 nm] +TAU: Aerosol Layer Optical Thickness [532 nm] diff --git a/ESMF/Shared/Chem_Base/ut_Bundle.f90 b/ESMF/Shared/Chem_Base/ut_Bundle.f90 new file mode 100644 index 00000000..0b9ed188 --- /dev/null +++ b/ESMF/Shared/Chem_Base/ut_Bundle.f90 @@ -0,0 +1,199 @@ +! +! Unit tester for Chem_Registry.F90 +! + + Program ut_Bundle + + use m_die, only: die + use Chem_RegistryMod + use Chem_BundleMod + + implicit NONE + + + character(len=*), parameter :: myname = 'ut_Bundle' + type(Chem_Registry) :: reg + type(Chem_Bundle) :: w_c + integer ier, i, j, k, l, prec, nymd, nhms + integer :: im = 72, jm = 46, km = 18 + real d2r, factor, lat, lon, dp + integer, external :: system + +! No rc file name provided +! ------------------------ + reg = Chem_RegistryCreate ( ier ) + if ( ier /= 0 ) call die ( myname, 'cannot create registry' ) + call reg_print_ ( reg ) + +! Create Bundle - No memory alloc +! ------------------------------- + call Chem_BundleCreate1PE_ ( reg, im, jm, km, w_c, ier ) + if ( ier /= 0 ) call die ( myname, 'cannot create bundle' ) + +! Uninitialized bundle +! -------------------- + print *, 'Uninitialized bundle' + call Chem_BundleStat ( 6, w_c, ier ) + if ( ier /= 0 ) call die ( myname, 'cannot stat bundle' ) + +! Put data in it +! -------------- + call fill_bundle_() + +! Initialized bundle +! ------------------ + print *, 'Initialized bundle' + call Chem_BundleStat ( 6, w_c, ier ) + if ( ier /= 0 ) call die ( myname, 'cannot stat bundle' ) + +! Write out bundle +! ---------------- + prec = 0 + nymd = 19600205 + nhms = 120000 + ier = system ( "/bin/rm -rf bundle.hdf" ) + call Chem_BundleWrite ( 'bundle.hdf', nymd, nhms, prec, w_c, ier, & + verbose = .true. ) + if ( ier /= 0 ) then + print *, 'ier = ', ier + call die ( myname, 'cannot write bundle' ) + end if + print *, 'ncdumping bundle1...' + ier = system ( "hdfdump bundle.hdf > bundle1.ncl" ) + ier = system ( "/bin/mv bundle.hdf bundle1.hdf" ) + +! Destroy bundle +! -------------- + call Chem_BundleDestroy ( w_c, ier ) + if ( ier /= 0 ) call die ( myname, 'cannot destroy bundle' ) + +! Next read bundle from file +! -------------------------- + call Chem_BundleRead ( 'bundle1.hdf', nymd, nhms, w_c, ier, & + timidx=0, chemReg=reg ) + if ( ier /= 0 ) call die ( myname, 'cannot read bundle' ) + + print *, 'Read bundle' + call Chem_BundleStat ( 6, w_c, ier ) + if ( ier /= 0 ) call die ( myname, 'cannot stat bundle' ) + +! Write out file and diff them +! ---------------------------- + ier = system ( "/bin/rm -rf bundle.hdf" ) + call Chem_BundleWrite ( 'bundle.hdf', nymd, nhms, prec, w_c, ier, & + verbose = .true. ) + if ( ier /= 0 ) then + print *, 'ier = ', ier + call die ( myname, 'cannot write bundle' ) + end if + print *, 'ncdumping bundle2...' + ier = system ( "hdfdump bundle.hdf > bundle2.ncl" ) + ier = system ( "/bin/mv bundle.hdf bundle2.hdf" ) + + print *, 'differences are...' + ier = system ( "diff bundle1.ncl bundle2.ncl" ) + +! Clean up mess +! ------------- + call Chem_RegistryDestroy ( reg, ier ) + if ( ier /= 0 ) call die ( myname, 'cannot destroy registry' ) + call Chem_BundleDestroy ( w_c, ier ) + if ( ier /= 0 ) call die ( myname, 'cannot destroy bundle' ) + + +! .................................................................. + + contains + + subroutine reg_print_ ( reg ) + type(Chem_Registry) :: reg + + integer i + + print * + print *, '-----------------------------------------------------------' + print * + print *, 'Total number of tracers: ', reg%nq +! print *, 'Number of fixed tracers: ', reg%nf + do i = 1, reg%nq + print * + print *, ' Tracer: ', i + print *, 'Short Name: ', trim(reg%vname(i)) + print *, 'Long Name: ', trim(reg%vtitle(i)) + print *, ' Units: ', trim(reg%vunits(i)) + end do + + print * + + if ( reg%doing_H2O ) then + print *, 'Tracer H2O: ', reg%doing_H2O, reg%n_H2O, reg%i_H2O, reg%j_H2O + end if + if ( reg%doing_O3 ) then + print *, 'Tracer O3: ', reg%doing_O3, reg%n_O3, reg%i_O3, reg%j_O3 + end if + if ( reg%doing_CO ) then + print *, 'Tracer CO: ', reg%doing_CO, reg%n_CO, reg%i_CO, reg%j_CO + end if + if ( reg%doing_DU ) then + print *, 'Tracer DU: ', reg%doing_DU, reg%n_DU, reg%i_DU, reg%j_DU + end if + if ( reg%doing_SS ) then + print *, 'Tracer SS: ', reg%doing_SS, reg%n_SS, reg%i_SS, reg%j_SS + end if + if ( reg%doing_SU ) then + print *, 'Tracer SU: ', reg%doing_SU, reg%n_SU, reg%i_SU, reg%j_SU + end if + if ( reg%doing_BC ) then + print *, 'Tracer BC: ', reg%doing_BC, reg%n_BC, reg%i_BC, reg%j_BC + end if + if ( reg%doing_OC ) then + print *, 'Tracer OC: ', reg%doing_OC, reg%n_OC, reg%i_OC, reg%j_OC + end if + if ( reg%doing_XX ) then + print *, 'Tracer XX: ', reg%doing_XX, reg%n_XX, reg%i_XX, reg%j_XX + end if + + print * + + end subroutine reg_print_ + + subroutine fill_bundle_() + + integer kk + + d2r = 3.1415 / 180. + w_c%grid%ptop = 1.0 + dp = 100000 / km + do k = 1, km + kk = 1 + (5 * k ) / km + do j = 1, jm + lat = w_c%grid%lat_min + (j-1) * w_c%grid%lat_del + do i = 1, im + lon = w_c%grid%lon_min + (i-1) * w_c%grid%lon_del + factor = (1 - sin(kk*d2r*lat) * cos(d2r*kk*lon) ) + w_c%delp(i,j,k) = dp + factor + w_c%rh(i,j,k) = 10. + (k-1.) * 80. / ( km - 1. ) + factor + do l = 1, reg%nq +! w_c%q(i,j,k,l) = l * k * factor + w_c%qa(l)%data3d(i,j,k) = l * k * factor + end do + end do + end do + end do + + print * + do k = 1, km + print *, 'k, delp = ', k, minval(w_c%delp(1:im,1:jm,k)), & + maxval(w_c%delp(1:im,1:jm,k)) + end do + + print * + do k = 1, km + print *, 'k, rh = ', k, minval(w_c%rh(1:im,1:jm,k)), & + maxval(w_c%delp(1:im,1:jm,k)) + end do + + end subroutine fill_bundle_ + + +end Program ut_Bundle diff --git a/ESMF/Shared/Chem_Base/ut_Mie.F90 b/ESMF/Shared/Chem_Base/ut_Mie.F90 new file mode 100644 index 00000000..cf309419 --- /dev/null +++ b/ESMF/Shared/Chem_Base/ut_Mie.F90 @@ -0,0 +1,249 @@ + + +! +! Simple testing of Mie Tables +! + +program ut_Mie + + use Chem_MieMod + use m_die + implicit NONE + + + real :: rh + real :: pmom(751,4), tau, g, ssa, idxChannel + type(Chem_mie) :: mieTables + + integer :: iq, rc, idxTable, m, i + integer, parameter :: nq = 15 + character(len=*), parameter :: vname(nq) = & + (/ 'du001 ', 'du002 ', 'du003 ', 'du004 ', 'du005 ', & + 'ss001 ', 'ss002 ', 'ss003 ', 'ss004 ', 'ss005 ', & + 'BCphobic', 'BCphilic', 'OCphobic', 'OCphilic', 'SO4 ' /) + +! Create 1 time +!---------------------- + print *, '1ere creation ' + print *, '------------------------------------------------- ' + mieTables = Chem_MieCreate('Aod_EOS.rc', rc ) + if ( rc /= 0 ) call die('ut_mie','oh, oh, cannot create the table') + + print *, 'nMom = ', mieTables%nMom + print *, 'nPol = ', mieTables%nPol + print *, 'nch = ', mieTables%nch + do m = 1, mieTables%nch + if ( abs(550.0 - (1.e9)*mieTables%channels(m)) < 1. ) then + idxChannel = m + print *, 'idxchannel', idxChannel + exit + end if + end do + + do iq = 1, nq + + idxTable = Chem_MieQueryIdx(mieTables,vname(iq),rc) + if ( rc /= 0 ) & + call die('ut_mie','cannot do Chem_MieQueryIdx') + print * +! print *, '---> idx for ',vname(iq), ' is ', idxTable + rh = 0.99 + call Chem_MieQuery(mieTables, idxTable, idxChannel, & + 1.0, rh, ssa =ssa, gasym=g, tau=tau, pmom = pmom) + +! print*, 'tau', tau, 'g', g, 'ssa', ssa +! print*,'pmom', pmom(11,1), pmom(20,2), pmom(20,3), pmom(20,4) + +! do i = 1, 751, 10 +!if 0 +! print *, vname(iq)//' --> ', i, & +! maxval(abs(mietables%vtableuse%pmom(:,:,:,i,1))), & +! maxval(abs(mietables%vtableuse%pmom(:,:,:,i,2))), & +! maxval(abs(mietables%vtableuse%pmom(:,:,:,i,3))), & +! maxval(abs(mietables%vtableuse%pmom(:,:,:,i,4))) +!else +! print *, vname(iq)//' --> ', i, pmom(i,:) +!endif +! end do + + end do + +! destroy for 1 time +!-------------------------- + call Chem_MieDestroy(mieTables, rc) + if ( rc /= 0 ) then + print *, 'Cannot destroy MieTables' +! return + end if + +! create 2nd time +!--------------------------- + + print *, '2eme creation ' + print *, '------------------------------------------------- ' + mieTables = Chem_MieCreate('Aod_EOS.rc', rc ) + if ( rc /= 0 ) call die('ut_mie','oh, oh, cannot create the table') + + print *, 'nMom = ', mieTables%nMom + print *, 'nPol = ', mieTables%nPol + print *, 'nch = ', mieTables%nch + do m = 1, mieTables%nch + if ( abs(550.0 - (1.e9)*mieTables%channels(m)) < 1. ) then + idxChannel = m + print *, 'idxchannel', idxChannel + exit + end if + end do + + do iq = 1, nq + + idxTable = Chem_MieQueryIdx(mieTables,vname(iq),rc) + if ( rc /= 0 ) & + call die('ut_mie','cannot do Chem_MieQueryIdx') + print * +! print *, '---> idx for ',vname(iq), ' is ', idxTable + rh = 0.99 + call Chem_MieQuery(mieTables, idxTable, idxChannel, & + 1.0, rh, ssa =ssa, gasym=g, tau=tau, pmom = pmom) + +! print*, 'tau', tau, 'g', g, 'ssa', ssa +! print*,'pmom', pmom(11,1), pmom(20,2), pmom(20,3), pmom(20,4) + end do + +! destroy for 2 time +!-------------------------- + call Chem_MieDestroy(mieTables, rc) + if ( rc /= 0 ) then + print *, 'Cannot destroy MieTables' +! return + end if + +! create 3rd time +!--------------------------- + + print *, '3eme creation ' + print *, '------------------------------------------------- ' + mieTables = Chem_MieCreate('Aod_EOS.rc', rc ) + if ( rc /= 0 ) call die('ut_mie','oh, oh, cannot create the table') + + print *, 'nMom = ', mieTables%nMom + print *, 'nPol = ', mieTables%nPol + print *, 'nch = ', mieTables%nch + do m = 1, mieTables%nch + if ( abs(550.0 - (1.e9)*mieTables%channels(m)) < 1. ) then + idxChannel = m + print *, 'idxchannel', idxChannel + exit + end if + end do + + do iq = 1, nq + + idxTable = Chem_MieQueryIdx(mieTables,vname(iq),rc) + if ( rc /= 0 ) & + call die('ut_mie','cannot do Chem_MieQueryIdx') + print * +! print *, '---> idx for ',vname(iq), ' is ', idxTable + rh = 0.99 + call Chem_MieQuery(mieTables, idxTable, idxChannel, & + 1.0, rh, ssa =ssa, gasym=g, tau=tau, pmom = pmom) + +! print*, 'tau', tau, 'g', g, 'ssa', ssa +! print*,'pmom', pmom(11,1), pmom(20,2), pmom(20,3), pmom(20,4) + end do + +! destroy for 3rd time +!-------------------------- + call Chem_MieDestroy(mieTables, rc) + if ( rc /= 0 ) then + print *, 'Cannot destroy MieTables' +! return + end if + +! create 4 time +!--------------------------- + + print *, '4eme creation ' + print *, '------------------------------------------------- ' + mieTables = Chem_MieCreate('Aod_EOS.rc', rc ) + if ( rc /= 0 ) call die('ut_mie','oh, oh, cannot create the table') + + print *, 'nMom = ', mieTables%nMom + print *, 'nPol = ', mieTables%nPol + print *, 'nch = ', mieTables%nch + do m = 1, mieTables%nch + if ( abs(550.0 - (1.e9)*mieTables%channels(m)) < 1. ) then + idxChannel = m + print *, 'idxchannel', idxChannel + exit + end if + end do + + do iq = 1, nq + + idxTable = Chem_MieQueryIdx(mieTables,vname(iq),rc) + if ( rc /= 0 ) & + call die('ut_mie','cannot do Chem_MieQueryIdx') + print * +! print *, '---> idx for ',vname(iq), ' is ', idxTable + rh = 0.99 + call Chem_MieQuery(mieTables, idxTable, idxChannel, & + 1.0, rh, ssa =ssa, gasym=g, tau=tau, pmom = pmom) + +! print*, 'tau', tau, 'g', g, 'ssa', ssa +! print*,'pmom', pmom(11,1), pmom(20,2), pmom(20,3), pmom(20,4) + end do + +! destroy for 4rd time +!-------------------------- + call Chem_MieDestroy(mieTables, rc) + if ( rc /= 0 ) then + print *, 'Cannot destroy MieTables' +! return + end if + +! create 5 time +!--------------------------- + + print *, '5eme creation ' + print *, '------------------------------------------------- ' + mieTables = Chem_MieCreate('Aod_EOS.rc', rc ) + if ( rc /= 0 ) call die('ut_mie','oh, oh, cannot create the table') + + print *, 'nMom = ', mieTables%nMom + print *, 'nPol = ', mieTables%nPol + print *, 'nch = ', mieTables%nch + do m = 1, mieTables%nch + if ( abs(550.0 - (1.e9)*mieTables%channels(m)) < 1. ) then + idxChannel = m + print *, 'idxchannel', idxChannel + exit + end if + end do + + do iq = 1, nq + + idxTable = Chem_MieQueryIdx(mieTables,vname(iq),rc) + if ( rc /= 0 ) & + call die('ut_mie','cannot do Chem_MieQueryIdx') + print * +! print *, '---> idx for ',vname(iq), ' is ', idxTable + rh = 0.99 + call Chem_MieQuery(mieTables, idxTable, idxChannel, & + 1.0, rh, ssa =ssa, gasym=g, tau=tau, pmom = pmom) + +! print*, 'tau', tau, 'g', g, 'ssa', ssa +! print*,'pmom', pmom(11,1), pmom(20,2), pmom(20,3), pmom(20,4) + end do + +! destroy for 5rd time +!-------------------------- + call Chem_MieDestroy(mieTables, rc) + if ( rc /= 0 ) then + print *, 'Cannot destroy MieTables' +! return + end if + + + + end program ut_Mie diff --git a/ESMF/Shared/Chem_Base/ut_Registry.f90 b/ESMF/Shared/Chem_Base/ut_Registry.f90 new file mode 100644 index 00000000..cfb653f1 --- /dev/null +++ b/ESMF/Shared/Chem_Base/ut_Registry.f90 @@ -0,0 +1,41 @@ +! +! Unit tester for Chem_Registry.F90 +! + + Program ut_Registry + +!!! use m_die, only: die + use Chem_RegistryMod + + implicit NONE + + + character(len=*), parameter :: myname = 'ut_Registry' + type(Chem_Registry) :: reg + integer ier + +! No rc file name provided +! ------------------------ + reg = Chem_RegistryCreate ( ier ) + if ( ier /= 0 ) call die ( myname, 'cannot create registry' ) + CALL Chem_RegistryPrint ( reg ) + call Chem_RegistryDestroy ( reg, ier ) + if ( ier /= 0 ) call die ( myname, 'cannot destroy registry' ) + +! No rc file name provided +! ------------------------ + reg = Chem_RegistryCreate ( ier, 'Chem_Registry.rc' ) + if ( ier /= 0 ) call die ( myname, 'cannot create registry' ) + CALL Chem_RegistryPrint ( reg ) + call Chem_RegistryDestroy ( reg, ier ) + if ( ier /= 0 ) call die ( myname, 'cannot destroy registry' ) + +! .................................................................. + + end Program ut_Registry + + subroutine die(name,msg) + character(len=*) name, msg + print *, trim(name)//': '//trim(msg) + call exit(7) + end subroutine die diff --git a/ESMF/Shared/Chem_Shared/.SulfateChemDriverMod.F90.swp b/ESMF/Shared/Chem_Shared/.SulfateChemDriverMod.F90.swp new file mode 100644 index 00000000..180b2cfe Binary files /dev/null and b/ESMF/Shared/Chem_Shared/.SulfateChemDriverMod.F90.swp differ diff --git a/ESMF/Shared/Chem_Shared/Bundle_IncrementMod.F90 b/ESMF/Shared/Chem_Shared/Bundle_IncrementMod.F90 new file mode 100755 index 00000000..71a0565a --- /dev/null +++ b/ESMF/Shared/Chem_Shared/Bundle_IncrementMod.F90 @@ -0,0 +1,456 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, GMAO, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! +! !MODULE: Bundle_IncrementMod --- Computes tracer increments and puts them into a bundle +! +! !INTERFACE: +! + + MODULE Bundle_IncrementMod + +! !USES: + + + +! +! !DESCRIPTION: This module can be used to compute model variable increments if the +! following conditions are met: +! 1) A non-increment, or "parent", bundle exists (e.g. TR, TRADV, MTR) +! 2) The increment is computed as: (X_t2 - X_t1)/(t2-t1) +! For new increment bundles the user must do at least the following: +! 1) Define an increment bundle in Set Services of a gridded component. +! 2) add an "IncType" and make appropriate changes to the code for the new "IncType". + +! NOTE!!! - The MTRI (moist increments) are NOT mass weighted. If DYCORE uses mass weighting in +! its solution, the moist increment will be incorrect. + + +!EOP +!------------------------------------------------------------------------- + +!BOC + + USE ESMF + USE MAPL + + IMPLICIT NONE + PRIVATE + +! !PUBLIC MEMBER FUNCTIONS: + PUBLIC Initialize_IncBundle_init + PUBLIC Initialize_IncBundle_run + PUBLIC Compute_IncBundle + + type(ESMF_Field) :: field, TempField + character(len=ESMF_MAXSTR) :: fieldname + character(len=ESMF_MAXSTR) :: org_bundle ! Original bundle name + character(len=ESMF_MAXSTR) :: inc_bundle ! Increment bundle name + integer :: i, ppos, NQ + + integer, parameter, public :: DYNinc = 1 + integer, parameter, public :: H2Oinc = 2 + integer, parameter, public :: CHMinc = 3 + integer, parameter, public :: MTRIinc = 4 + integer, parameter, public :: CHMincR2 = 5 + integer, parameter, public :: MTRIincCTM = 6 + integer, parameter, public :: TRIincCTM = 7 + + +CONTAINS + +!------------------------------------------------------------------------- +!------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Initialize_IncBundle_init - Initialize increment bundle with fields from a +! "parent" bundle. This must be called in the Initialize method of a gridded component. + + SUBROUTINE Initialize_IncBundle_init(GC, state1, state2, IncType, RC) + + IMPLICIT NONE + + ! ARGUMENTS + type(ESMF_GridComp), intent(in) :: GC ! Gridded component + type(ESMF_State), intent(in) :: state1 ! Original bundle state + type(ESMF_State), intent(in) :: state2 ! Increment bundle state + integer, intent(in) :: IncType ! Increment bundle type + integer, optional, intent( out) :: RC ! Error code + + + ! TYPES and VARIABLES + integer :: STATUS + type(ESMF_FieldBundle) :: BUNDLE, BUNDLEi, BUNDLEemiss + type(ESMF_Config) :: cf ! AGCM.rc + character(len=ESMF_MAXSTR) :: IAm, valueOld + character(len=ESMF_MAXSTR) :: incEmiss_bundle ! Increment chemistry emissions bundle name + character(len=ESMF_MAXSTR) :: longname ! longname metadata description + character(len=2) :: suffix ! suffix appended to variable name + integer :: nCols + character(len=ESMF_MAXSTR), allocatable :: NAMES(:) + + Iam = "Initialize_IncBundle_init" + +! ============================================================================ + +! Begin... + if (IncType == DYNinc) then + org_bundle = 'TRADV' + inc_bundle = 'TRADVI' + suffix = 'ID' + longname = '_due_to_dynamics' + else if (IncType == H2Oinc) then + org_bundle = 'TRADV' + inc_bundle = 'H2ORTRI' + suffix = 'IW' + longname = '_due_to_water_rescaling' + else if (IncType == CHMinc) then + org_bundle = 'CHEM_TRACERS' + inc_bundle = 'CHEMTRI' + incEmiss_bundle = 'CHEMTRIr1' + suffix = 'IC' + longname = '_due_to_chemistry' + else if (IncType == MTRIinc) then + org_bundle = 'MTR' + inc_bundle = 'MTRI' + suffix = 'IM' + longname = '_due_to_moist_processes' + else if (IncType == MTRIincCTM) then + org_bundle = 'ConvTR' + inc_bundle = 'MTRI' + suffix = 'IM' + longname = '_due_to_moist_processes' + else if (IncType == TRIincCTM) then + org_bundle = 'DiffTR' + inc_bundle = 'TRI' + suffix = 'IT' + longname = '_due_to_turbulence_processes' + end if + + call ESMF_GridCompGet ( GC, config=cf, RC=STATUS ) + VERIFY_(STATUS) + + call ESMF_ConfigGetDim (cf, NQ, nCols, label=(trim(inc_bundle)//'_increments::'), rc=STATUS) + + if (NQ > 0) then + call ESMF_ConfigFindLabel (cf, (trim(inc_bundle)//'_increments::'), rc=STATUS) + VERIFY_(STATUS) + + allocate (NAMES(NQ), stat=STATUS) + VERIFY_(STATUS) + + do i = 1, NQ + call ESMF_ConfigNextLine(cf, rc=STATUS) + VERIFY_(STATUS) + call ESMF_ConfigGetAttribute(cf, NAMES(i), rc=STATUS) + VERIFY_(STATUS) + enddo + +! Fill the increments bundle with fields from "parent" bundle +!------------------------------------------------------------------ + call ESMF_StateGet(state1, org_bundle, BUNDLE, rc=STATUS) + VERIFY_(STATUS) + + call ESMF_StateGet(state2, inc_bundle, BUNDLEi, rc=STATUS) + VERIFY_(STATUS) + + if (IncType == CHMinc) then + call ESMF_StateGet(state2, incEmiss_bundle, BUNDLEemiss, rc=STATUS) + VERIFY_(STATUS) + end if + + do i = 1, NQ + call ESMF_FieldBundleGet (BUNDLE, NAMES(i), field=field, rc=status) + if (status/=0) then + if (mapl_am_i_root()) print*, trim(NAMES(i)),' is not valid. It likely does not exist in ',trim(org_bundle) + VERIFY_(23) + end if + + call ESMF_FieldGet (field, name=fieldname, RC=STATUS) + VERIFY_(STATUS) + + TempField = MAPL_FieldCreate (field, name=(trim(fieldname)//suffix) ,DoCopy=.true., rc=status) + VERIFY_(STATUS) + call MAPL_FieldBundleAdd (BUNDLEi, TempField, rc=status) + VERIFY_(STATUS) + + if (IncType == CHMinc) then + TempField = MAPL_FieldCreate (field, name=(trim(fieldname)//suffix//'emiss') ,DoCopy=.true., rc=status) + VERIFY_(STATUS) + call MAPL_FieldBundleAdd (BUNDLEemiss, TempField, rc=status) + VERIFY_(STATUS) + end if + end do + + deallocate (NAMES, stat=STATUS) + +! Set Species Attributes +!---------------------------------- + if ((IncType==DYNinc) .OR. (IncType==CHMinc) .OR. (IncType==H2Oinc).OR. (IncType == MTRIinc) & + .OR. (IncType == MTRIincCTM) .OR. (IncType == TRIincCTM)) then + do i = 1, NQ + call ESMF_FieldBundleGet (BUNDLEi, fieldIndex=i, field=field, rc=STATUS ) + VERIFY_(STATUS) + call ESMF_FieldGet (field, name=fieldname, RC=STATUS) + VERIFY_(STATUS) + + if (fieldname==('AOADAYS'//suffix)) then + call ESMF_AttributeSET (field, name='UNITS', value='days s-1', rc=status) + VERIFY_(STATUS) + else + call ESMF_AttributeGET (field, name='UNITS', value=valueOld, rc=status) + VERIFY_(STATUS) + call ESMF_AttributeSET (field, name='UNITS', value=trim(valueOld)//' s-1', rc=status) + VERIFY_(STATUS) + end if + + ppos = len(trim(fieldname)) + call ESMF_AttributeSET (field, name='LONG_NAME', value=('tendency_of_'//fieldname(1:ppos-2)//trim(longname)), rc=status) + VERIFY_(STATUS) + end do + end if + + if (IncType == CHMinc) then + do i = 1, NQ + call ESMF_FieldBundleGet (BUNDLEemiss, fieldIndex=i, field=field, rc=STATUS ) + VERIFY_(STATUS) + call ESMF_FieldGet (field, name=fieldname, RC=STATUS) + VERIFY_(STATUS) + + if (fieldname==('AOADAYS'//suffix//'emiss')) then + call ESMF_AttributeSET (field, name='UNITS', value='days s-1', rc=status) + VERIFY_(STATUS) + else + call ESMF_AttributeGET (field, name='UNITS', value=valueOld, rc=status) + VERIFY_(STATUS) + call ESMF_AttributeSET (field, name='UNITS', value=trim(valueOld)//' s-1', rc=status) + VERIFY_(STATUS) + end if + + ppos = len(trim(fieldname)) + call ESMF_AttributeSET (field, name='LONG_NAME', value=('chemistry_tendency_of_'//fieldname(1:ppos-7)//'_from_emissions'), rc=status) + VERIFY_(STATUS) + end do + end if ! (IncType == 'CHMinc') + end if ! NQ > 0 + + RETURN_(ESMF_SUCCESS) + END SUBROUTINE Initialize_IncBundle_init +!============================================================================================================== + +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 610.1 GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Initialize_IncBundle_run - Re-initialize increment bundle with data from the +! ! "parent" bundle within the Run method. The "parent" bundle is the non-increment +! bundle (e.g. TR, MTR, TRADV) + + SUBROUTINE Initialize_IncBundle_run(state1, state2, IncType, RC) + + IMPLICIT NONE + + ! ARGUMENTS + type(ESMF_State), intent(in) :: state1 ! Original bundle state + type(ESMF_State), intent(in) :: state2 ! Increment bundle state + integer, intent(in) :: IncType ! Increment bundle type + integer, optional, intent( out) :: RC ! Error code + + ! TYPES and VARIABLES + integer :: STATUS + type(ESMF_FieldBundle) :: BUNDLE, BUNDLEi + character(len=ESMF_MAXSTR) :: IAm + character(len=ESMF_MAXSTR), allocatable :: NAMES(:) + real :: DT + real, dimension(:,:,:), pointer :: org_ptr, inc_ptr + + Iam = "Initialize_IncBundle_run" + +! ============================================================================ + +! Begin... + if (IncType == DYNinc) then + org_bundle = 'TRADV' + inc_bundle = 'TRADVI' + else if (IncType == H2Oinc) then + org_bundle = 'TRADV' + inc_bundle = 'H2ORTRI' + else if (IncType == CHMinc) then + org_bundle = 'CHEM_TRACERS' + inc_bundle = 'CHEMTRIr1' + else if (IncType == CHMincR2) then + org_bundle = 'CHEM_TRACERS' + inc_bundle = 'CHEMTRI' + else if (IncType == MTRIinc) then + org_bundle = 'MTR' + inc_bundle = 'MTRI' + else if (IncType == MTRIincCTM) then + org_bundle = 'ConvTR' + inc_bundle = 'MTRI' + else if (IncType == TRIincCTM) then + org_bundle = 'DiffTR' + inc_bundle = 'TRI' + end if + + +! !Initialize increment bundle in Run method before the child is called +! !-------------------------------------------------------------------- + call ESMF_StateGet (state2, inc_bundle, BUNDLEi, rc=STATUS) + VERIFY_(STATUS) + call ESMF_StateGet (state1, org_bundle, BUNDLE, rc=STATUS) + VERIFY_(STATUS) + call ESMF_FieldBundleGet (BUNDLEi, fieldCount=NQ, rc=STATUS ) + VERIFY_(STATUS) + +! !Check if there is anything in the bundle. + if (NQ > 0) then + allocate (NAMES(NQ), stat=STATUS) + VERIFY_(STATUS) + + call ESMF_FieldBundleGet(BUNDLEi, fieldNameList=NAMES, rc=STATUS) + VERIFY_(STATUS) + +! !Get increment data pointer and initialize value + do i = 1, NQ + ppos = len(trim(NAMES(i))) + if (IncType == CHMinc) then + call ESMFL_BundleGetPointerToData (BUNDLE, trim(NAMES(i)(1:ppos-7)), org_ptr, rc=status) + VERIFY_(STATUS) + else + call ESMFL_BundleGetPointerToData (BUNDLE, trim(NAMES(i)(1:ppos-2)), org_ptr, rc=status) + VERIFY_(STATUS) + end if + + call ESMFL_BundleGetPointerToData (BUNDLEi, trim(NAMES(i)), inc_ptr, rc=status) + VERIFY_(STATUS) + + inc_ptr = org_ptr + end do + deallocate(NAMES) + end if ! NQ > 0 + + RETURN_(ESMF_SUCCESS) + END SUBROUTINE Initialize_IncBundle_run +!======================================================================================= +! +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 610.1 GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Compute_IncBundle - Compute the increment after the child has run. + + SUBROUTINE Compute_IncBundle(state1, state2, IncType, META, RC) + + IMPLICIT NONE + + ! ARGUMENTS + type(ESMF_State), intent(in) :: state1 ! Original bundle state + type(ESMF_State), intent(in) :: state2 ! Increment bundle state + integer, intent(in) :: IncType ! Increment bundle type + type(MAPL_MetaComp), pointer, intent(in) :: META + integer, optional, intent( out) :: RC ! Error code + + + ! TYPES and VARIABLES + integer :: STATUS + type(ESMF_FieldBundle) :: BUNDLE, BUNDLEi, BUNDLEemiss + character(len=ESMF_MAXSTR) :: IAm + character(len=ESMF_MAXSTR) :: inc_emiss_bundle ! Increment chemistry emissions bundle name + character(len=ESMF_MAXSTR), allocatable :: NAMES(:) + real :: DT + real, dimension(:,:,:), pointer :: org_ptr, inc_ptr, inc_emiss_ptr + + Iam = "Compute_IncBundle" +! ============================================================================ +! Begin... + if (IncType == DYNinc) then + org_bundle = 'TRADV' + inc_bundle = 'TRADVI' + else if (IncType == H2Oinc) then + org_bundle = 'TRADV' + inc_bundle = 'H2ORTRI' + else if (IncType == CHMinc) then + org_bundle = 'CHEM_TRACERS' + inc_bundle = 'CHEMTRIr1' + else if (IncType == CHMincR2) then + org_bundle = 'CHEM_TRACERS' + inc_bundle = 'CHEMTRI' + inc_emiss_bundle = 'CHEMTRIr1' + else if (IncType == MTRIinc) then + org_bundle = 'MTR' + inc_bundle = 'MTRI' + else if (IncType == MTRIincCTM) then + org_bundle = 'ConvTR' + inc_bundle = 'MTRI' + else if (IncType == TRIincCTM) then + org_bundle = 'DiffTR' + inc_bundle = 'TRI' + end if + + call ESMF_StateGet (state2, inc_bundle, BUNDLEi, rc=STATUS) + VERIFY_(STATUS) + call ESMF_FieldBundleGet (BUNDLEi, fieldCount=NQ, rc=STATUS ) + VERIFY_(STATUS) + +! !Check if there is anything in the bundle. + if (NQ > 0) then + call ESMF_StateGet (state1, org_bundle, BUNDLE, rc=STATUS) + VERIFY_(STATUS) + + if (IncType == CHMincR2) then + call ESMF_StateGet (state2, inc_emiss_bundle, BUNDLEemiss, rc=STATUS) + VERIFY_(STATUS) + end if + + call MAPL_GetResource(META, DT, label="RUN_DT:", RC=STATUS) + VERIFY_(STATUS) + allocate (NAMES(NQ), stat=STATUS) + VERIFY_(STATUS) + + call ESMF_FieldBundleGet(BUNDLEi, fieldNameList=NAMES, rc=STATUS) + VERIFY_(STATUS) + +! !Get pointers to data + do i = 1, NQ + ppos = len(trim(NAMES(i))) + if (IncType == CHMinc) then + call ESMFL_BundleGetPointerToData (BUNDLE, trim(NAMES(i)(1:ppos-7)), org_ptr, rc=status) + VERIFY_(STATUS) + call ESMFL_BundleGetPointerToData (BUNDLEi, trim(NAMES(i)), inc_ptr, rc=status) + VERIFY_(STATUS) +! end if + else if (IncType == CHMincR2) then + call ESMFL_BundleGetPointerToData (BUNDLEemiss, trim(NAMES(i))//'emiss', inc_emiss_ptr, rc=status) + VERIFY_(STATUS) + call ESMFL_BundleGetPointerToData (BUNDLE, trim(NAMES(i)(1:ppos-2)), org_ptr, rc=status) + VERIFY_(STATUS) + call ESMFL_BundleGetPointerToData (BUNDLEi, trim(NAMES(i)), inc_ptr, rc=status) + VERIFY_(STATUS) + else + call ESMFL_BundleGetPointerToData (BUNDLE, trim(NAMES(i)(1:ppos-2)), org_ptr, rc=status) + VERIFY_(STATUS) + call ESMFL_BundleGetPointerToData (BUNDLEi, trim(NAMES(i)), inc_ptr, rc=status) + VERIFY_(STATUS) + end if + +! !Compute increment and update pointer + if (IncType == CHMincR2) then + inc_ptr = ((org_ptr-inc_ptr)/DT) + inc_emiss_ptr + else + inc_ptr = (org_ptr-inc_ptr)/DT + end if + end do + deallocate(NAMES) + end if ! NQ > 0 + + RETURN_(ESMF_SUCCESS) + END SUBROUTINE Compute_IncBundle + + +END MODULE Bundle_IncrementMod diff --git a/ESMF/Shared/Chem_Shared/CMakeLists.txt b/ESMF/Shared/Chem_Shared/CMakeLists.txt new file mode 100644 index 00000000..c015cea0 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/CMakeLists.txt @@ -0,0 +1,50 @@ +esma_set_this() + +set (srcs + Chem_ConstMod.F90 + Chem_SettlingMod.F90 + DryDepositionMod.F90 + DustEmissionMod.F90 + WetRemovalMod.F90 + SeasaltEmissionMod.F90 + NitrateChemDriverMod.F90 + SulfateChemDriverMod.F90 + ConvectionMod.F90 + SmokeEmissionMod.F90 + VegLaiMod.F90 + GmiPrintError_mod.F90 + GmiTimeControl_mod.F90 + GmiSolar_mod.F90 + GmiResistance.F90 + GmiEmissUtils.F90 + Henrys_Law_cts.F90 + Chem_GroupMod.F90 + Bundle_IncrementMod.F90 + ) + +if (DOING_GEOS5) + list (APPEND srcs mod_diag.F90 diaglist.F90) + list (APPEND srcs Chem_UtilMod.F90 Chem_StateMod.F90) +else () + list (APPEND srcs Chem_UtilMod.F90) + list (APPEND srcs Chem_UtilMod_geos4.F90) +endif () + +esma_add_library(${this} + SRCS ${srcs} + DEPENDENCIES GMAO_mpeu MAPL Chem_Base) +target_include_directories(${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) +#add_definitions(-DDEBUG) +add_definitions(-DSPMD -DFVCHEM) + +file (COPY gmi_drydep_data.h DESTINATION ${include_${this}}) +file (COPY gmi_emiss_constants.h DESTINATION ${include_${this}}) +file (COPY gmi_phys_constants.h DESTINATION ${include_${this}}) +file (COPY gmi_time_constants.h DESTINATION ${include_${this}}) + +install( + PROGRAMS bundleParser.py + DESTINATION bin +) + + diff --git a/ESMF/Shared/Chem_Shared/Chem_ConstMod.F90 b/ESMF/Shared/Chem_Shared/Chem_ConstMod.F90 new file mode 100644 index 00000000..f6ad5ebd --- /dev/null +++ b/ESMF/Shared/Chem_Shared/Chem_ConstMod.F90 @@ -0,0 +1,99 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_ConstMod --- Defines physical constants +! +! !INTERFACE: +! + + MODULE Chem_ConstMod + +! !USES: + + Implicit NONE + +! +! !DESCRIPTION: This module defines physical constants used throughout the +! system. Since it is highly desirable that model and analysis +! share the same constants, it is advised that this module be customized +! for each model. +! +! !REVISION HISTORY: +! +! 10oct1999 da Silva Based on function getcon() from the GEOS GCM. +! +!EOP +!------------------------------------------------------------------------- + +!BOC + +! Computational constants +! ----------------------- + real, parameter :: vecmax = 65535.5 + real, parameter :: caltoj = 4184. + real, parameter :: undef = 1.e15 ! missing value + +! Astronomical constants +! ---------------------- + real, parameter :: obliquity = 23.45 + real, parameter :: perihelion = 102. + real, parameter :: eccentricity = 0.0167 + real, parameter :: radius_earth = 6371e3 + real, parameter :: vernal_equinox = 80.5 + real, parameter :: summer_solstice = 176.5 + real, parameter :: s0 = 1365.0 + +! Terrestrial constants +! --------------------- +!!! real, parameter :: grav = 9.81 + real, parameter :: grav = 9.80616 + real, parameter :: srfprs = 984.7 + real, parameter :: pimean = 984.7 + real, parameter :: pstd = 1000.0 + real, parameter :: tstd = 280.0 + real, parameter :: sday = 86400.0 + real, parameter :: ssalb = 0.99 + real, parameter :: co2 = 330.0 + +! Thermodynamic constants +! ----------------------- + real, parameter :: cpd = 1004.16 + real, parameter :: cpm = 1004.64 + real, parameter :: cpv = 1869.46 + real, parameter :: alhl = 2.499e6 ! Latent heat consensation + real, parameter :: alhs = 2.845e6 ! Latent heat sublimation + real, parameter :: stfbol = 5.67e-8 + real, parameter :: airmw = 28.97 ! molecular weight of air + real, parameter :: h2omw = 18.01 ! molecular weight of H2O + real, parameter :: runiv = 8314.3 +!!! real, parameter :: rgas = runiv/airmw + real, parameter :: rgas = 287.04 + real, parameter :: rvap = runiv/h2omw +!!! real, parameter :: kappa = rgas/cpd + real, parameter :: kappa = rgas/cpm + real, parameter :: heatw = 597.2 + real, parameter :: heati = 680.0 + real, parameter :: tice = 273.16 ! Freezing point + real, parameter :: zvir = 4.61e2/rgas - 1. + + + +! Lapse rate +! ---------- + real, parameter :: gamma = 6.5E-3 ! 6.5 Kelvin / Km + +! turbulence constants +! -------------------- + real, parameter :: von_karman = 0.4 + +! moisture constants +! ------------------ + real, parameter :: eps = 0.622 + real, parameter :: virtcon = 0.609 + real, parameter :: epsfac = eps*heatw/rgas*caltoj + +!EOC + + end MODULE Chem_ConstMod diff --git a/ESMF/Shared/Chem_Shared/Chem_DepositionMod.F90 b/ESMF/Shared/Chem_Shared/Chem_DepositionMod.F90 new file mode 100644 index 00000000..ebd08876 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/Chem_DepositionMod.F90 @@ -0,0 +1,301 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_DepositionMod --- Aerosol Turbulent Deposition Module +! +! !INTERFACE: +! + + module Chem_DepositionMod + +! !USES: + + use Chem_Mod + use Chem_ConstMod, only: grav, von_karman, cpd ! Constants ! +!!! use Chem_UtilMod + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC Chem_Deposition + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) DU Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! +!EOP + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + +!------------------------------------------------------------------------- +CONTAINS +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_Deposition - Calculate aerosol dry deposition for lowest layer +! +! !INTERFACE: +! + + subroutine Chem_Deposition ( i1, i2, j1, j2, km, nbeg, nend, nbins, cdt, w_c, & + radius, rhop, & + tmpu, rhoa, hsurf, hghte, oro, ustar, & + u10m, v10m, fraclake, gwettop, pblh, shflux, & + z0h, fluxout, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2, km, nbins, nbeg, nend + real, intent(in) :: cdt + real, pointer, dimension(:,:,:) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:) :: hsurf ! surface geopotential height [m] + real, pointer, dimension(:,:,:) :: hghte ! top of layer geopotential height [m] + real, pointer, dimension(:,:) :: oro ! orography flag + real, pointer, dimension(:,:) :: fraclake ! fraction covered by water + real, pointer, dimension(:,:) :: gwettop ! fraction soil moisture + real, pointer, dimension(:,:) :: ustar ! friction speed + real, pointer, dimension(:,:) :: u10m ! 10-m u-wind component [m s-1] + real, pointer, dimension(:,:) :: v10m ! 10-m v-wind component [m s-1] + real, pointer, dimension(:,:) :: pblh ! PBL height [m] + real, pointer, dimension(:,:) :: shflux ! sfc. sens. heat flux [W m-2] + real, pointer, dimension(:,:) :: z0h ! rough height, sens. heat [m] + real, pointer, dimension(:) :: radius ! particle radius [m] + real, pointer, dimension(:) :: rhop ! particle density [kg m-3] + +! !OUTPUT PARAMETERS: + type(Chem_Bundle), intent(inout) :: w_c + type(Chem_Array), pointer :: fluxout(:) ! Mass lost by deposition + ! to surface, kg/m2/s + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Calculates the deposition velocity and removal for the +! lowest model layer +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + character(len=*), parameter :: myname = 'Chem_Deposition' + character(len=255) :: NAME + integer :: i, j, k, n, im, dk + real, parameter :: rhow = 1000. ! density of water [kg m-3] + real, parameter :: coll_size = 0.002 ! collector size [m] + real :: pm(i1:i2,j1:j2) ! pressure [Pa] + real :: dz(i1:i2,j1:j2) ! lowest layer thickness + real :: rmu(i1:i2,j1:j2) ! dynamic viscosity [kg m-1 s-1] + real :: Ra(i1:i2,j1:j2) ! aerodynamic resistance + real :: Rs(i1:i2,j1:j2) ! surface resistance + real :: vdep(i1:i2,j1:j2) ! Deposition speed [m s-1] + real :: drydepf(i1:i2,j1:j2) ! Deposition frequency [s-1] + real :: outflux(i1:i2,j1:j2) + + real qmin, qmax + + real*8 Rttl ! total surface resistance + real*8 dc + real*8 diff_coef, vsettle + real*8 Sc ! Schmidt number + real*8 Eb ! Brownian diffusion collection efficiency + real*8 St ! Stokes number + real*8 Ein ! Interception collection efficiency + real*8 Eim ! Impaction collection efficiency + real*8 alpha, gamma + + real*8 R1, R2, w10m, u_thresh0 + real*8 obk, vds, vdsmax, czh, factor + real*8 frac, cz, psi_h, eps, logmfrac, z0h_min, z0h_, r8_cdt + real*8 :: one = 1.0, zero = 0.0 + + r8_cdt = cdt + +! Handle the fact that hghte may be in the range [1,km+1] or [0,km] +! ----------------------------------------------------------------- + dk = lbound(hghte,3) - 1 ! This is either 0 or 1 + +! Initialize local variables +! -------------------------- + im = w_c%grid%im + +! Calculate the pressure, air density, viscosity, and thickness of the +! surface level + pm = 0.5*w_c%delp(i1:i2,j1:j2,1) + do k = 2, km + pm = pm + 0.5*(w_c%delp(i1:i2,j1:j2,k)+w_c%delp(i1:i2,j1:j2,k-1)) + end do + dz = hghte(:,:,km+dk) - hsurf(:,:) + +!!! call pmaxmin ( 'dep dz', dz, qmin, qmax, i2-i1+1, j2-j1+1, 1. ) + + rmu = 1.8325e-5*(416.16/(tmpu(i1:i2,j1:j2,km)+120.)) & + *(tmpu(i1:i2,j1:j2,km)/296.16)**1.5 + + z0h_min = 100. * tiny(1.0) ! because sometimes we may get z0h=0. + +! ========================================================================= +! Aerodynamic Resistance +! psi_h and Ra are equations 2, 4-5 of Walcek et al. 1986 Atmospheric Environment +! obk supposedly from Wesely and Hicks 1977 J. Air Poll. Control Assoc. +! + do j = j1, j2 + do i = i1, i2 + +! Calculate the Monin-Obhukov length: +! -Air denisity * Cp * T(surface) * Ustar^3 +! OBK = ------------------------------------------- +! vK * g * Sensible heat flux +! vK = 0.4 von Karman constant +! Cp = 1000 J kg-1 K-1 specific heat of air at constant pressure +! If OBK < 0 the air is unstable; if OBK > 0 the air is stable +! For sensible heat flux of zero OBK goes to infinity (set to 1.e5) + if(shflux(i,j) .eq. 0.) then + obk = 1.e5 + else + obk = -rhoa(i,j,km)*cpd*tmpu(i,j,km)*ustar(i,j)**3. & + / (von_karman*grav*shflux(i,j)) + endif + + cz = dz(i,j) / 2. + frac = cz / obk + if(frac .gt. 1.) frac = 1. + if(frac .gt. 0. .and. frac .le. 1.) then + psi_h = -5.0*frac + else if (frac .lt. 0.) then + eps = min(one,-frac) + logmfrac = log(eps) + psi_h = exp(0.598 + 0.39*logmfrac - 0.09*(logmfrac)**2.) + endif + + z0h_ = max ( z0h(i,j), z0h_min ) + + Ra(i,j) = (log(cz/z0h_) - psi_h) / (von_karman*ustar(i,j)) + + enddo + enddo + +! ======================================================================= +! Surface Resistance term for aerosols +! Rs formulation from eqn. 15 - 18 of Walcek et al. 1986 Atmospheric Environment +! obk supposedly from Wesely and Hicks 1977 J. Air Poll. Control Assoc. + +! Loop over the bins + do n = 1, nbins + + NAME = trim(w_c%reg%vname(nbeg+n-1)) + + outflux = 0.0 + +! Loop over space + do j = j1, j2 + do i = i1, i2 + +! Calculate the Monin-Obhukov length: +! -Air denisity * Cp * T(surface) * Ustar^3 +! OBK = ------------------------------------------- +! vK * g * Sensible heat flux +! vK = 0.4 von Karman constant +! Cp = 1000 J kg-1 K-1 specific heat of air at constant pressure +! If OBK < 0 the air is unstable; if OBK > 0 the air is stable +! For sensible heat flux of zero OBK goes to infinity (set to 1.e5) + if(shflux(i,j) .eq. 0.) then + obk = 1.e5 + else + obk = -rhoa(i,j,km)*cpd*tmpu(i,j,km)*ustar(i,j)**3. & + / (von_karman*grav*shflux(i,j)) + endif + +! Calculate the surface resistance term + vds = 0.002*ustar(i,j) +! Set to small value of vds if ustar too small + vds = max(vds, 0.002 * 0.00001) + if(obk .lt. 0.) vds = vds*(1.+(-300./obk)**0.6667) + czh = pblh(i,j)/obk + if(czh .lt. -30.) vds = 0.0009*ustar(i,j)*(-czh)**0.6667 +! vdsMax is from Table 2 of Walcek et al. 1986 +! There are actually seasonal and regionally varying values, +! but for most of the world a value of 1.0 cm s-1 is used. + vdsMax = 0.01 + + Rs(i,j) = 1./min(vds,vdsmax) + + if(Rs(i,j) .gt. 9999.) Rs(i,j) = 9999. + if(Rs(i,j) .lt. 1.) Rs(i,j) = 1. + +! If doing dust over land, possibly re-emit + R2 = 1. + if(trim(NAME(1:2)) .eq. 'du') then + +! Calculate the threshold velocity for dust emissions + u_thresh0 = 0.13 * sqrt(rhop(n)*grav*2.*radius(n)/rhoa(i,j,km)) & + * sqrt(1.+6.e-7/(rhop(n)*grav*(2.*radius(n))**2.5)) & + / sqrt(1.928*(1331.*(100.*2.*radius(n))**1.56+0.38)**0.092 - 1.) + w10m = sqrt(u10m(i,j)**2. + v10m(i,j)**2.) + +! Calculate the coefficient for resuspension + if(oro(i,j) .eq. OCEAN) then + R2 = 1. + else + R2 = fraclake(i,j)+(1.-fraclake(i,j)) & + *( gwettop(i,j)+(1.-gwettop(i,j)) & + *exp(-max(zero,(w10m-u_thresh0)))) + endif + endif + + +! Now what is the deposition velocity + Rttl = Ra(i,j) + Rs(i,j) + + vdep(i,j) = 1./Rttl*R2 + +! Set a minimum value of deposition velocity + vdep(i,j) = max(vdep(i,j),1.e-4) + +! Save the dry deposition frequency for the chemical removal terms +! in units of s-1 + drydepf(i,j) = vdep(i,j) / dz(i,j) + +! Update the mass mixing ratio and compute the flux out + factor = (1.0d0-exp(-drydepf(i,j)*r8_cdt)) + dc = max(zero,w_c%qa(n+nbeg-1)%data3d(i,j,km)*factor) + w_c%qa(n+nbeg-1)%data3d(i,j,km) = w_c%qa(n+nbeg-1)%data3d(i,j,km) - dc + + outflux(i,j) = dc * w_c%delp(i,j,km)/grav/cdt + + end do ! i + end do ! j + +! Diagnostic output if requested + if( associated(fluxout(n)%data2d) ) fluxout(n)%data2d = outflux + + end do ! n + + rc = 0 + + end subroutine Chem_Deposition + + end module Chem_DepositionMod diff --git a/ESMF/Shared/Chem_Shared/Chem_GroupMod.F90 b/ESMF/Shared/Chem_Shared/Chem_GroupMod.F90 new file mode 100644 index 00000000..8011c6da --- /dev/null +++ b/ESMF/Shared/Chem_Shared/Chem_GroupMod.F90 @@ -0,0 +1,1895 @@ +#include "MAPL_Generic.h" + +!! +!! #define CHEM_INFO +!! #define DEBUG_STUFF +!! + + +!--------------------------------------------------------------------------- +! NASA/GSFC, Atmospheric Chemistry and Dynamics Lab, Code 614 ! +!--------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_GroupMod --- Support for Bry and Cly chemical families +! +! !INTERFACE: +! + + MODULE Chem_GroupMod + +! !USES: + + USE ESMF + USE MAPL + + IMPLICIT NONE + +! !PUBLIC TYPES: +! + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC Init_GMI_Chem_Groups + PUBLIC Init_GCC_Chem_Groups + + PUBLIC Pack_Chem_Groups + PUBLIC Unpack_Chem_Groups + + PRIVATE Set_GMI_Globals + PRIVATE Set_GCC_Globals + + LOGICAL :: GMI_groups_active = .FALSE. + LOGICAL :: GCC_groups_active = .FALSE. + + REAL, PARAMETER :: mw_BR = 79.904 + REAL, PARAMETER :: mw_CL = 35.45 + REAL, PARAMETER :: mw_N = 14.007 + REAL, PARAMETER :: mw_O = 15.999 + REAL, PARAMETER :: mw_H = 1.008 + + REAL, PARAMETER :: mw_BR2 = (2*mw_BR ) + REAL, PARAMETER :: mw_BRCL = ( mw_BR + mw_CL ) + REAL, PARAMETER :: mw_BRNO2 = ( mw_BR + mw_N + 2*mw_O) + REAL, PARAMETER :: mw_BRNO3 = ( mw_BR + mw_N + 3*mw_O) + REAL, PARAMETER :: mw_BRO = ( mw_BR + mw_O ) + REAL, PARAMETER :: mw_HBR = ( mw_BR + mw_H ) + REAL, PARAMETER :: mw_HOBR = ( mw_BR + mw_H + mw_O) + + REAL, PARAMETER :: mw_CL2 = (2*mw_CL ) + REAL, PARAMETER :: mw_CL2O2 = (2*mw_CL + 2*mw_O ) + REAL, PARAMETER :: mw_CLNO2 = ( mw_CL + mw_N + 2*mw_O) + REAL, PARAMETER :: mw_CLNO3 = ( mw_CL + mw_N + 3*mw_O) + REAL, PARAMETER :: mw_CLO = ( mw_CL + mw_O ) + REAL, PARAMETER :: mw_CLOO = ( mw_CL + 2*mw_O ) + REAL, PARAMETER :: mw_HCL = ( mw_CL + mw_H ) + REAL, PARAMETER :: mw_HOCL = ( mw_CL + mw_H + mw_O) + REAL, PARAMETER :: mw_OCLO = ( mw_CL + 2*mw_O ) + + REAL, PARAMETER :: mw_NO = ( mw_N + mw_O ) + REAL, PARAMETER :: mw_NO2 = ( mw_N + 2*mw_O ) + REAL, PARAMETER :: mw_N2O5 = (2*mw_N + 5*mw_O ) + REAL, PARAMETER :: mw_HNO3 = ( mw_H + mw_N + 3*mw_O) + +! For Chem Groups +! --------------- + integer, parameter :: NUMGRP = 2 + character(len=10) :: chem_group_names(NUMGRP) ! See Set_GMI_Globals and Set_GCC_Globals + + integer, parameter :: MAXGRP_ELEM = 10 ! Max number of species per family + + INTEGER :: sgrp_elem_map(MAXGRP_ELEM, NUMGRP) ! See Set_GMI_Globals and Set_GCC_Globals + REAL :: sgrp_fac(MAXGRP_ELEM, NUMGRP) ! See Set_GMI_Globals and Set_GCC_Globals + + + + TYPE :: ChemGroupElemPtr + REAL, DIMENSION(:,:,:), POINTER :: p + END TYPE ChemGroupElemPtr + + INTEGER, PARAMETER :: GMI_GROUP_SPECIES_COUNT = 18 + TYPE (ChemGroupElemPtr) :: x(GMI_GROUP_SPECIES_COUNT) ! vector of pointers + character(len=10) :: gmi_group_species(GMI_GROUP_SPECIES_COUNT) ! See Set_GMI_Globals + + INTEGER, PARAMETER :: GCC_GROUP_SPECIES_COUNT = 22 + TYPE (ChemGroupElemPtr) :: y(GCC_GROUP_SPECIES_COUNT) ! vector of pointers + character(len=10) :: gcc_group_species(GCC_GROUP_SPECIES_COUNT) ! See Set_GCC_Globals + + ! See Set_GMI_Globals for a subset of these: + ! See Set_GCC_Globals for a subset of these: + ! These indices are relative to vector x (for GMI) or vector y (for GCC) + integer :: iBR + integer :: iBR2 + integer :: iBRCL + integer :: iBRO + integer :: iBRONO2 + integer :: iBRNO2 + integer :: iBRNO3 + integer :: iHBR + integer :: iHOBR + + integer :: iCL + integer :: iCL2 + integer :: iCLO + integer :: iCLOO + integer :: iCL2O2 + integer :: iCLONO2 ! GMI version + integer :: iCLNO2 + integer :: iCLNO3 ! GCC version + integer :: iHCL + integer :: iHOCL + integer :: iOCLO + + integer :: iN2O5 + integer :: iNO + integer :: iNO2 + integer :: iHNO3 + + +! +! !DESCRIPTION: +! +! This module provides types and subroutines pertaining to chemical families +! +! !REVISION HISTORY: +! +! 31Jul2018 - Manyin, first crack +! 21Nov2018 - Manyin: Resolve Cl from BrCl (and N from ClONO2) within cell, +! and then distribute remainder within column +! +!EOP + +!------------------------------------------------------------------------- +CONTAINS + +!--------------------------------------------------------------------------- +! NASA/GSFC, Atmospheric Chemistry and Dynamics Lab, Code 614 ! +!--------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Init_GMI_Chem_Groups - One time initialization +! +! !INTERFACE: + + SUBROUTINE Init_GMI_Chem_Groups() + + IMPLICIT NONE + + GMI_groups_active = .TRUE. + + RETURN + END SUBROUTINE Init_GMI_Chem_Groups + +!--------------------------------------------------------------------------- +! NASA/GSFC, Atmospheric Chemistry and Dynamics Lab, Code 614 ! +!--------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Init_GCC_Chem_Groups - One time initialization +! +! !INTERFACE: + + SUBROUTINE Init_GCC_Chem_Groups() + + IMPLICIT NONE + + GCC_groups_active = .TRUE. + + RETURN + END SUBROUTINE Init_GCC_Chem_Groups + +!--------------------------------------------------------------------------- +! NASA/GSFC, Atmospheric Chemistry and Dynamics Lab, Code 614 ! +!--------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Set_GMI_Globals +! +! !INTERFACE: + + SUBROUTINE Set_GMI_Globals() + + IMPLICIT NONE + + chem_group_names(1) = 'Bry' + chem_group_names(2) = 'Cly' + + iBR = 1 ; gmi_group_species(iBR) = 'Br ' + iBRCL = 2 ; gmi_group_species(iBRCL) = 'BrCl ' + iBRO = 3 ; gmi_group_species(iBRO) = 'BrO ' + iBRONO2 = 4 ; gmi_group_species(iBRONO2) = 'BrONO2' + iHBR = 5 ; gmi_group_species(iHBR) = 'HBr ' + iHOBR = 6 ; gmi_group_species(iHOBR) = 'HOBr ' + + iCL = 7 ; gmi_group_species(iCL) = 'Cl ' + iCL2 = 8 ; gmi_group_species(iCL2) = 'Cl2 ' + iCLO = 9 ; gmi_group_species(iCLO) = 'ClO ' + iCL2O2 = 10 ; gmi_group_species(iCL2O2) = 'Cl2O2 ' + iCLONO2 = 11 ; gmi_group_species(iCLONO2) = 'ClONO2' + iHCL = 12 ; gmi_group_species(iHCL) = 'HCl ' + iHOCL = 13 ; gmi_group_species(iHOCL) = 'HOCl ' + iOCLO = 14 ; gmi_group_species(iOCLO) = 'OClO ' + + iN2O5 = 15 ; gmi_group_species(iN2O5) = 'N2O5 ' + iNO = 16 ; gmi_group_species(iNO) = 'NO ' + iNO2 = 17 ; gmi_group_species(iNO2) = 'NO2 ' + iHNO3 = 18 ; gmi_group_species(iHNO3) = 'HNO3 ' + + ! Species indices and factors for Bry + ! Factors account for the units being mol/mol + ! (indices are relative to the vector x) + sgrp_elem_map( 1,1) = iBR ; sgrp_fac( 1,1) = 1.0 + sgrp_elem_map( 2,1) = iBRCL ; sgrp_fac( 2,1) = 1.0 + sgrp_elem_map( 3,1) = iBRO ; sgrp_fac( 3,1) = 1.0 + sgrp_elem_map( 4,1) = iBRONO2 ; sgrp_fac( 4,1) = 1.0 + sgrp_elem_map( 5,1) = iHBR ; sgrp_fac( 5,1) = 1.0 + sgrp_elem_map( 6,1) = iHOBR ; sgrp_fac( 6,1) = 1.0 + sgrp_elem_map( 7,1) = 0 ; sgrp_fac( 7,1) = 0.0 + sgrp_elem_map( 8,1) = 0 ; sgrp_fac( 8,1) = 0.0 + sgrp_elem_map( 9,1) = 0 ; sgrp_fac( 9,1) = 0.0 + sgrp_elem_map(10,1) = 0 ; sgrp_fac(10,1) = 0.0 + + ! Species indices and factors for Cly + ! Factors account for the units being mol/mol + ! (indices are relative to the vector x) + sgrp_elem_map( 1,2) = iCL ; sgrp_fac( 1,2) = 1.0 + sgrp_elem_map( 2,2) = iCL2 ; sgrp_fac( 2,2) = 2.0 + sgrp_elem_map( 3,2) = iCLO ; sgrp_fac( 3,2) = 1.0 + sgrp_elem_map( 4,2) = iCL2O2 ; sgrp_fac( 4,2) = 2.0 + sgrp_elem_map( 5,2) = iCLONO2 ; sgrp_fac( 5,2) = 1.0 + sgrp_elem_map( 6,2) = iHCL ; sgrp_fac( 6,2) = 1.0 + sgrp_elem_map( 7,2) = iHOCL ; sgrp_fac( 7,2) = 1.0 + sgrp_elem_map( 8,2) = iOCLO ; sgrp_fac( 8,2) = 1.0 + sgrp_elem_map( 9,2) = 0 ; sgrp_fac( 9,2) = 0.0 + sgrp_elem_map(10,2) = 0 ; sgrp_fac(10,2) = 0.0 + + RETURN + END SUBROUTINE Set_GMI_Globals + + +!--------------------------------------------------------------------------- +! NASA/GSFC, Atmospheric Chemistry and Dynamics Lab, Code 614 ! +!--------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Set_GCC_Globals +! +! !INTERFACE: + + SUBROUTINE Set_GCC_Globals() + + IMPLICIT NONE + + chem_group_names(1) = 'TRC_Bry' + chem_group_names(2) = 'TRC_Cly' + + iBR = 1 ; gcc_group_species(iBR) = 'TRC_Br ' + iBR2 = 2 ; gcc_group_species(iBR2) = 'TRC_Br2 ' + iBRCL = 3 ; gcc_group_species(iBRCL) = 'TRC_BrCl ' + iBRNO2 = 4 ; gcc_group_species(iBRNO2) = 'TRC_BrNO2 ' + iBRNO3 = 5 ; gcc_group_species(iBRNO3) = 'TRC_BrNO3 ' + iBRO = 6 ; gcc_group_species(iBRO) = 'TRC_BrO ' + iHBR = 7 ; gcc_group_species(iHBR) = 'TRC_HBr ' + iHOBR = 8 ; gcc_group_species(iHOBR) = 'TRC_HOBr ' + + iCL = 9 ; gcc_group_species(iCL) = 'TRC_Cl ' + iCL2 = 10 ; gcc_group_species(iCL2) = 'TRC_Cl2 ' + iCL2O2 = 11 ; gcc_group_species(iCL2O2) = 'TRC_Cl2O2 ' + iCLNO2 = 12 ; gcc_group_species(iCLNO2) = 'TRC_ClNO2 ' + iCLNO3 = 13 ; gcc_group_species(iCLNO3) = 'TRC_ClNO3 ' + iCLO = 14 ; gcc_group_species(iCLO) = 'TRC_ClO ' + iCLOO = 15 ; gcc_group_species(iCLOO) = 'TRC_ClOO ' + iHCL = 16 ; gcc_group_species(iHCL) = 'TRC_HCl ' + iHOCL = 17 ; gcc_group_species(iHOCL) = 'TRC_HOCl ' + iOCLO = 18 ; gcc_group_species(iOCLO) = 'TRC_OClO ' + + iN2O5 = 19 ; gcc_group_species(iN2O5) = 'TRC_N2O5 ' + iNO = 20 ; gcc_group_species(iNO) = 'TRC_NO ' + iNO2 = 21 ; gcc_group_species(iNO2) = 'TRC_NO2 ' + iHNO3 = 22 ; gcc_group_species(iHNO3) = 'TRC_HNO3 ' + + ! Species indices and factors for Bry + ! Factors account for the units being kg/kg + ! (indices are relative to the vector y) + sgrp_elem_map( 1,1) = iBR ; sgrp_fac( 1,1) = mw_BR / mw_BR + sgrp_elem_map( 2,1) = iBR2 ; sgrp_fac( 2,1) = 2*mw_BR / mw_BR2 + sgrp_elem_map( 3,1) = iBRCL ; sgrp_fac( 3,1) = mw_BR / mw_BRCL + sgrp_elem_map( 4,1) = iBRNO2 ; sgrp_fac( 4,1) = mw_BR / mw_BRNO2 + sgrp_elem_map( 5,1) = iBRNO3 ; sgrp_fac( 5,1) = mw_BR / mw_BRNO3 + sgrp_elem_map( 6,1) = iBRO ; sgrp_fac( 6,1) = mw_BR / mw_BRO + sgrp_elem_map( 7,1) = iHBR ; sgrp_fac( 7,1) = mw_BR / mw_HBR + sgrp_elem_map( 8,1) = iHOBR ; sgrp_fac( 8,1) = mw_BR / mw_HOBR + sgrp_elem_map( 9,1) = 0 ; sgrp_fac( 9,1) = 0.0 + sgrp_elem_map(10,1) = 0 ; sgrp_fac(10,1) = 0.0 + + ! Species indices and factors for Cly + ! Factors account for the units being kg/kg + ! (indices are relative to the vector y) + sgrp_elem_map( 1,2) = iCL ; sgrp_fac( 1,2) = mw_CL / mw_CL + sgrp_elem_map( 2,2) = iCL2 ; sgrp_fac( 2,2) = 2*mw_CL / mw_CL2 + sgrp_elem_map( 3,2) = iCL2O2 ; sgrp_fac( 3,2) = 2*mw_CL / mw_CL2O2 + sgrp_elem_map( 4,2) = iCLNO2 ; sgrp_fac( 4,2) = mw_CL / mw_CLNO2 + sgrp_elem_map( 5,2) = iCLNO3 ; sgrp_fac( 5,2) = mw_CL / mw_CLNO3 + sgrp_elem_map( 6,2) = iCLO ; sgrp_fac( 6,2) = mw_CL / mw_CLO + sgrp_elem_map( 7,2) = iCLOO ; sgrp_fac( 7,2) = mw_CL / mw_CLOO + sgrp_elem_map( 8,2) = iHCL ; sgrp_fac( 8,2) = mw_CL / mw_HCL + sgrp_elem_map( 9,2) = iHOCL ; sgrp_fac( 9,2) = mw_CL / mw_HOCL + sgrp_elem_map(10,2) = iOCLO ; sgrp_fac(10,2) = mw_CL / mw_OCLO + + RETURN + END SUBROUTINE Set_GCC_Globals + + + +!--------------------------------------------------------------------------- +! NASA/GSFC, Atmospheric Chemistry and Dynamics Lab, Code 614 ! +!--------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Pack_Chem_Groups - Initialize the family entries in the Advection Bundle +! +! !INTERFACE: + + SUBROUTINE Pack_Chem_Groups(state) + + IMPLICIT NONE + +! !ARGUMENTS + TYPE(ESMF_State), INTENT(in) :: state + + character(len=ESMF_MAXSTR) :: IAm + + REAL, POINTER, DIMENSION(:,:,:) :: qq1 ! for chem groups + INTEGER :: ig,im,imsgrp,i + REAL*8, ALLOCATABLE, DIMENSION(:,:,:) :: qq2 + TYPE(ESMF_FieldBundle) :: TRADV_BUNDLE + + INTEGER :: STATUS, RC + INTEGER :: i1,i2,j1,j2,k1,k2 + + Iam = "Pack_Chem_Groups" + + + IF ( GMI_groups_active ) THEN + + ! Store in Bry: atoms of Br / molecules of air + ! Store in Cly: atoms of Cl / molecules of air + + CALL Set_GMI_Globals() + + CALL ESMF_StateGet(state, 'TRADV', TRADV_BUNDLE, __RC__ ) + + DO i=1,GMI_GROUP_SPECIES_COUNT + CALL ESMFL_BundleGetPointerToData(TRADV_BUNDLE, 'GMICHEM::'//TRIM(gmi_group_species(i)), x(i)%p, __RC__ ) + ENDDO + + i1 = LBOUND(x(1)%p,1); i2 = UBOUND(x(1)%p,1) + j1 = LBOUND(x(1)%p,2); j2 = UBOUND(x(1)%p,2) + k1 = LBOUND(x(1)%p,3); k2 = UBOUND(x(1)%p,3) + + allocate( qq2(i1:i2,j1:j2,k1:k2), __STAT__ ) + + DO ig=1,NUMGRP + CALL ESMFL_BundleGetPointerToData(TRADV_BUNDLE, 'GMICHEM::'//TRIM(chem_group_names(ig)), qq1, __RC__ ) + +! PACK GROUP using REAL*8 if possible + + ! Accumulate in qq2 which is double precision + qq2(:,:,:) = 0.0 + + do im = 1, MAXGRP_ELEM + + imsgrp = sgrp_elem_map(im,ig) + + if (imsgrp > 0) then + qq2(:,:,:) = qq2(:,:,:) + x(imsgrp)%p(:,:,:) * sgrp_fac(im,ig) + end if + + end do + + qq1 = qq2 + + ENDDO + + deallocate(qq2, __STAT__ ) + + ENDIF + + IF ( GCC_groups_active ) THEN + + ! Store in TRC_Bry: kg of Br / kg of air + ! Store in TRC_Cly: kg of Cl / kg of air + + CALL Set_GCC_Globals() + + CALL ESMF_StateGet(state, 'TRADV', TRADV_BUNDLE, __RC__ ) + + DO i=1,GCC_GROUP_SPECIES_COUNT + CALL ESMFL_BundleGetPointerToData(TRADV_BUNDLE, 'GEOSCHEMCHEM::'//TRIM(gcc_group_species(i)), y(i)%p, __RC__ ) + ENDDO + + i1 = LBOUND(y(1)%p,1); i2 = UBOUND(y(1)%p,1) + j1 = LBOUND(y(1)%p,2); j2 = UBOUND(y(1)%p,2) + k1 = LBOUND(y(1)%p,3); k2 = UBOUND(y(1)%p,3) + + allocate( qq2(i1:i2,j1:j2,k1:k2), __STAT__ ) + + DO ig=1,NUMGRP + CALL ESMFL_BundleGetPointerToData(TRADV_BUNDLE, 'GEOSCHEMCHEM::'//TRIM(chem_group_names(ig)), qq1, __RC__ ) + +! PACK GROUP using REAL*8 if possible + + ! Accumulate in qq2 which is double precision + qq2(:,:,:) = 0.0 + + do im = 1, MAXGRP_ELEM + + imsgrp = sgrp_elem_map(im,ig) + + if (imsgrp > 0) then + qq2(:,:,:) = qq2(:,:,:) + y(imsgrp)%p(:,:,:) * sgrp_fac(im,ig) + end if + + end do + + qq1 = qq2 + + ENDDO + + deallocate(qq2, __STAT__ ) + + ENDIF + + RETURN + END SUBROUTINE Pack_Chem_Groups + +!--------------------------------------------------------------------------- +! NASA/GSFC, Atmospheric Chemistry and Dynamics Lab, Code 614 ! +!--------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Unpack_Chem_Groups - Modify species based on the family tracers +! +! !INTERFACE: + +#ifdef CHEM_INFO + SUBROUTINE Unpack_Chem_Groups(state, PLE, AREA, Q_separate, bry_ratio, aBRCL, aCL2, aOCLO, aCL2O2, aCLO, aHCL, aHOCL, zBRCL, zCL2, zOCLO, zCL2O2, zCLO, zHCL, zHOCL, zBRY, aCLY, zCLY ) +#else + SUBROUTINE Unpack_Chem_Groups(state, PLE, AREA, Q_separate) +#endif + + IMPLICIT NONE + +! !ARGUMENTS + type(ESMF_State), intent(in) :: state + REAL*4, POINTER, DIMENSION(:,:,:), INTENT(IN) :: PLE + REAL*4, POINTER, DIMENSION(:,:), INTENT(IN) :: AREA + REAL*4, POINTER, DIMENSION(:,:,:), INTENT(IN), OPTIONAL :: Q_separate ! water vapor [kg vapor / kg moist air] + ! option to provide Q separate from the advection bundle, + ! otherwise we get Q from that bundle (TRADV) +#ifdef CHEM_INFO + REAL*4, POINTER, DIMENSION(:,:,:) :: bry_ratio, aBRCL, aCL2, aOCLO, aCL2O2, aCLO, aHCL, aHOCL + REAL*4, POINTER, DIMENSION(:,:,:) :: zBRCL, zCL2, zOCLO, zCL2O2, zCLO, zHCL, zHOCL + REAL*4, POINTER, DIMENSION(:,:,:) :: zBRY, aCLY, zCLY +#endif + + + character(len=ESMF_MAXSTR) :: IAm + + REAL, POINTER, DIMENSION(:,:,:) :: qq1 ! for chem groups + INTEGER :: ig,im,imsgrp,i + REAL*8, ALLOCATABLE, DIMENSION(:,:,:) :: group_factor + REAL*8, ALLOCATABLE, DIMENSION(:,:,:) :: BRCL_pre_adjust + REAL*8, ALLOCATABLE, DIMENSION(:,:,:) :: CLONO2_pre_adjust + REAL*8, ALLOCATABLE, DIMENSION(:,:,:) :: CLNO2_pre_adjust + REAL*8, ALLOCATABLE, DIMENSION(:,:,:) :: CLNO3_pre_adjust + + REAL*8, POINTER, DIMENSION(:,:,:) :: XXX_diff + REAL*8, POINTER, DIMENSION(:,:,:) :: BRCL_diff ! alias of XXX_diff + REAL*8, POINTER, DIMENSION(:,:,:) :: CLNOX_diff ! alias of XXX_diff + REAL*8, POINTER, DIMENSION(:,:,:) :: CLONO2_diff ! alias of XXX_diff + + REAL*8, POINTER, DIMENSION(:,:,:) :: XXX_sum + REAL*8, POINTER, DIMENSION(:,:,:) :: CL_sum ! alias of XXX_sum + REAL*8, POINTER, DIMENSION(:,:,:) :: N_sum ! alias of XXX_sum + + REAL*8, ALLOCATABLE, DIMENSION(:,:,:) :: qq2 + REAL*8, ALLOCATABLE, DIMENSION(:,:,:) :: mass_AIR ! kg moist air + REAL*8, ALLOCATABLE, DIMENSION(:,:,:) :: kmol_per_kg_AIR ! conversion for moist air + REAL*8, ALLOCATABLE, DIMENSION(:,:,:) :: frac ! scaling fraction + REAL*8 :: minloc_out(3) + TYPE(ESMF_FieldBundle) :: TRADV_BUNDLE + REAL*4, POINTER, DIMENSION(:,:,:) :: Q ! water vapor [kg vapor / kg moist air] + + LOGICAL, ALLOCATABLE, DIMENSION(:) :: in_play ! whether gridbox can accept more adjustment + + INTEGER :: STATUS, RC + INTEGER :: i1,i2,j1,j2,k1,k2 + INTEGER :: k + + REAL, PARAMETER :: MAXFRAC = 0.99 ! Do not reduce more than this + REAL, PARAMETER :: VERY_SMALL = 1.0e-25 + + Iam = "Unpack_Chem_Groups" + + IF ( GMI_groups_active ) THEN + +! IF (MAPL_AM_I_ROOT()) print*,'Unpacking GMI groups Bry and Cly' + + CALL Set_GMI_Globals() + + i1 = LBOUND(x(1)%p,1); i2 = UBOUND(x(1)%p,1) + j1 = LBOUND(x(1)%p,2); j2 = UBOUND(x(1)%p,2) + k1 = LBOUND(x(1)%p,3); k2 = UBOUND(x(1)%p,3) + + allocate( group_factor(i1:i2,j1:j2,k1:k2), & + BRCL_pre_adjust(i1:i2,j1:j2,k1:k2), & + CLONO2_pre_adjust(i1:i2,j1:j2,k1:k2), & + mass_AIR(i1:i2,j1:j2,k1:k2), & + kmol_per_kg_AIR(i1:i2,j1:j2,k1:k2), & + frac(i1:i2,j1:j2,k1:k2), & + XXX_diff(i1:i2,j1:j2,k1:k2), & + XXX_sum(i1:i2,j1:j2,k1:k2), & + in_play(k1:k2), & + qq2(i1:i2,j1:j2,k1:k2), __STAT__ ) + + do k=k1,k2 + mass_AIR(:,:,k) = (PLE(:,:,k)-PLE(:,:,k-1)) * AREA(:,:) / MAPL_GRAV + end do + + CALL ESMF_StateGet(state, 'TRADV', TRADV_BUNDLE, __RC__ ) + + IF ( PRESENT(Q_separate) ) THEN + Q => Q_separate + ELSE + CALL ESMFL_BundleGetPointerToData(TRADV_BUNDLE, 'Q', Q, __RC__ ) + ENDIF + + kmol_per_kg_AIR(:,:,:) = (1.0 - Q(:,:,:))/MAPL_AIRMW + Q(:,:,:)/MAPL_H2OMW + + DO ig=1,NUMGRP + CALL ESMFL_BundleGetPointerToData(TRADV_BUNDLE, 'GMICHEM::'//TRIM(chem_group_names(ig)), qq1, __RC__ ) +! +! BASED ON INCLUDE FILE vvv +! + + qq2(:,:,:) = 0.0d0 + + select case (ig) + case (1) + +!.... Bry + +#ifdef CHEM_INFO + IF ( ASSOCIATED(zBRY) ) zBRY = qq1 + IF ( ASSOCIATED(aBRCL) ) aBRCL = x(iBRCL)%p(:,:,:) +#endif + + BRCL_pre_adjust(:,:,:) = x(iBRCL)%p(:,:,:) + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & qq2(:,:,:) = qq2(:,:,:) + & + & x(imsgrp)%p(:,:,:) * & + & sgrp_fac(im,ig) + end do + + where ( qq2(:,:,:) > VERY_SMALL ) + group_factor(:,:,:) = qq1(:,:,:) / qq2(:,:,:) + elsewhere + group_factor(:,:,:) = -999.0 + end where + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & x(imsgrp)%p(:,:,:) = x(imsgrp)%p(:,:,:) * & + & group_factor(:,:,:) + end do + +!.... In the very rare cases where the species sum is tiny, divide up Bry + where( group_factor(:,:,:) == -999.0 ) + x(iBR )%p(:,:,:) = qq1(:,:,:) / 6.0 + x(iBRCL )%p(:,:,:) = qq1(:,:,:) / 6.0 + x(iBRO )%p(:,:,:) = qq1(:,:,:) / 6.0 + x(iBRONO2)%p(:,:,:) = qq1(:,:,:) / 6.0 + x(iHBR )%p(:,:,:) = qq1(:,:,:) / 6.0 + x(iHOBR )%p(:,:,:) = qq1(:,:,:) / 6.0 + end where + +#ifdef CHEM_INFO + IF ( ASSOCIATED(zBRCL) ) zBRCL = x(iBRCL)%p(:,:,:) + IF ( ASSOCIATED(bry_ratio) ) bry_ratio = group_factor +#endif + + case (2) + +!.... Cly -- NOTE: family does NOT include BrCl + +#ifdef CHEM_INFO + IF ( ASSOCIATED(aCLY) ) aCLY = qq1 +#endif + + CLONO2_pre_adjust(:,:,:) = x(iCLONO2)%p(:,:,:) + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & qq2(:,:,:) = qq2(:,:,:) + & + & x(imsgrp)%p(:,:,:) * & + & sgrp_fac(im,ig) + end do + + where ( qq2(:,:,:) > VERY_SMALL ) + group_factor(:,:,:) = qq1(:,:,:) / qq2(:,:,:) + elsewhere + group_factor(:,:,:) = -999.0 + end where + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & x(imsgrp)%p(:,:,:) = x(imsgrp)%p(:,:,:) * & + & group_factor(:,:,:) + end do + +!.... In the very rare cases where the species sum is tiny, divide up Cly + where( group_factor(:,:,:) == -999.0 ) + x(iCL )%p(:,:,:) = (qq1(:,:,:) / 10.0) + x(iCL2 )%p(:,:,:) = (qq1(:,:,:) / 10.0) * 2.0 + x(iCLO )%p(:,:,:) = (qq1(:,:,:) / 10.0) + x(iCL2O2 )%p(:,:,:) = (qq1(:,:,:) / 10.0) * 2.0 + x(iCLONO2)%p(:,:,:) = (qq1(:,:,:) / 10.0) + x(iHCL )%p(:,:,:) = (qq1(:,:,:) / 10.0) + x(iHOCL )%p(:,:,:) = (qq1(:,:,:) / 10.0) + x(iOCLO )%p(:,:,:) = (qq1(:,:,:) / 10.0) + end where + + end select + + ENDDO + +!!! +!!! Compensate for the Cl changed in BrCl +!!! + +#ifdef CHEM_INFO + IF ( ASSOCIATED(aCL2) ) aCL2 = x(iCL2)%p(:,:,:) + IF ( ASSOCIATED(aOCLO) ) aOCLO = x(iOCLO)%p(:,:,:) + IF ( ASSOCIATED(aCL2O2) ) aCL2O2 = x(iCL2O2)%p(:,:,:) + IF ( ASSOCIATED(aCLO) ) aCLO = x(iCLO)%p(:,:,:) + IF ( ASSOCIATED(aHCL) ) aHCL = x(iHCL)%p(:,:,:) + IF ( ASSOCIATED(aHOCL) ) aHOCL = x(iHOCL)%p(:,:,:) +#endif + + BRCL_diff => XXX_diff + CL_sum => XXX_sum + +!.... Compute delta BrCl [mol_BRCL / mol_AIR] = [mol_CL / mol_AIR] + BRCL_diff(:,:,:) = x(iBRCL)%p(:,:,:) - BRCL_pre_adjust(:,:,:) + +!.... Compute CL_sum [mol_CL / mol_AIR] + CL_sum(:,:,:) = 2 * x(iCL2 )%p(:,:,:) + & + & x(iOCLO )%p(:,:,:) + & + & 2 * x(iCL2O2)%p(:,:,:) + & + & x(iCLO )%p(:,:,:) + & + & x(iHCL )%p(:,:,:) + & + & x(iHOCL )%p(:,:,:) + +!print*,'CL_sum min = ', MINVAL(CL_sum) + +!.... In gridboxes where BrCl has been reduced, increase Cly species + where ( BRCL_diff(:,:,:) < 0.0 ) + where ( CL_sum(:,:,:) > VERY_SMALL ) + + frac(:,:,:) = -1.0 * BRCL_diff(:,:,:) / CL_sum(:,:,:) ! Note frac is positive + ! Multiply by (1 + frac) + + x(iCL2 )%p(:,:,:) = x(iCL2 )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + x(iOCLO )%p(:,:,:) = x(iOCLO )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + x(iCL2O2)%p(:,:,:) = x(iCL2O2)%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + x(iCLO )%p(:,:,:) = x(iCLO )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + x(iHCL )%p(:,:,:) = x(iHCL )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + x(iHOCL )%p(:,:,:) = x(iHOCL )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + + elsewhere + + ! Add to species (subtract a negative): + x(iCL2 )%p(:,:,:) = x(iCL2 )%p(:,:,:) - BRCL_diff(:,:,:) / 12.0 + x(iOCLO )%p(:,:,:) = x(iOCLO )%p(:,:,:) - BRCL_diff(:,:,:) / 6.0 + x(iCL2O2)%p(:,:,:) = x(iCL2O2)%p(:,:,:) - BRCL_diff(:,:,:) / 12.0 + x(iCLO )%p(:,:,:) = x(iCLO )%p(:,:,:) - BRCL_diff(:,:,:) / 6.0 + x(iHCL )%p(:,:,:) = x(iHCL )%p(:,:,:) - BRCL_diff(:,:,:) / 6.0 + x(iHOCL )%p(:,:,:) = x(iHOCL )%p(:,:,:) - BRCL_diff(:,:,:) / 6.0 + + end where + + end where + +!.... In gridboxes where BrCl has increased, reduce Cly species + + call GMI_reduce_Cly_vmr ( ) + +!.... Clean up + nullify(BRCL_diff, CL_sum) + +#ifdef CHEM_INFO + IF ( ASSOCIATED(zCL2) ) zCL2 = x(iCL2)%p(:,:,:) + IF ( ASSOCIATED(zOCLO) ) zOCLO = x(iOCLO)%p(:,:,:) + IF ( ASSOCIATED(zCL2O2) ) zCL2O2 = x(iCL2O2)%p(:,:,:) + IF ( ASSOCIATED(zCLO) ) zCLO = x(iCLO)%p(:,:,:) + IF ( ASSOCIATED(zHCL) ) zHCL = x(iHCL)%p(:,:,:) + IF ( ASSOCIATED(zHOCL) ) zHOCL = x(iHOCL)%p(:,:,:) +#endif + +!!! +!!! Done handling Cl change from BrCl +!!! + +!.... Account for changes in NOy reservoir ClONO2 + + CLONO2_diff => XXX_diff + N_sum => XXX_sum + +!.... Compute delta ClONO2 [mol_CLONO2 / mol_AIR] = [mol_N / mol_AIR] + CLONO2_diff(:,:,:) = x(iCLONO2)%p(:,:,:) - CLONO2_pre_adjust(:,:,:) + +!.... Compute N_sum [mol_N / mol_AIR] + N_sum(:,:,:) = 2 * x(iN2O5)%p(:,:,:) + & + x(iNO )%p(:,:,:) + & + x(iNO2 )%p(:,:,:) + & + x(iHNO3)%p(:,:,:) + +!print*,'N_sum min = ', MINVAL(N_sum) + +!.... In gridboxes where ClONO2 has been reduced, increase N species + where ( CLONO2_diff(:,:,:) < 0.0 ) + where ( N_sum(:,:,:) > VERY_SMALL ) + + frac(:,:,:) = -1.0 * CLONO2_diff(:,:,:) / N_sum(:,:,:) ! Note frac is positive + ! Multiply by (1 + frac) + + x(iN2O5)%p(:,:,:) = x(iN2O5)%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + x(iNO )%p(:,:,:) = x(iNO )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + x(iNO2 )%p(:,:,:) = x(iNO2 )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + x(iHNO3)%p(:,:,:) = x(iHNO3)%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + + elsewhere + + ! Add to species (subtract a negative): + x(iN2O5)%p(:,:,:) = x(iN2O5)%p(:,:,:) - CLONO2_diff(:,:,:) / 8.0 + x(iNO )%p(:,:,:) = x(iNO )%p(:,:,:) - CLONO2_diff(:,:,:) / 4.0 + x(iNO2 )%p(:,:,:) = x(iNO2 )%p(:,:,:) - CLONO2_diff(:,:,:) / 4.0 + x(iHNO3)%p(:,:,:) = x(iHNO3)%p(:,:,:) - CLONO2_diff(:,:,:) / 4.0 + + end where + end where + + +!.... In gridboxes where ClONO2 has increased, reduce N species + + call GMI_reduce_N_vmr ( ) + +!.... Clean up + nullify(CLONO2_diff, N_sum) + +! +! ^^^^^^^^^^^^^^^^^^^^^^^^^^ +! + +#ifdef CHEM_INFO + IF ( ASSOCIATED(zCLY) ) THEN + + qq2(:,:,:) = 0.0 + ig = 2 + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & qq2(:,:,:) = qq2(:,:,:) + & + & x(imsgrp)%p(:,:,:) * & + & sgrp_fac(im,ig) + end do + + zCLY = qq2 + + ENDIF +#endif + + deallocate(group_factor, BRCL_pre_adjust, CLONO2_pre_adjust, mass_AIR, & + kmol_per_kg_AIR, in_play, frac, XXX_diff, XXX_sum, qq2, __STAT__ ) + + ENDIF + + + IF ( GCC_groups_active ) THEN + +! IF (MAPL_AM_I_ROOT()) print*,'Unpacking GCC groups TRC_Bry and TRC_Cly' + + CALL Set_GCC_Globals() + + i1 = LBOUND(y(1)%p,1); i2 = UBOUND(y(1)%p,1) + j1 = LBOUND(y(1)%p,2); j2 = UBOUND(y(1)%p,2) + k1 = LBOUND(y(1)%p,3); k2 = UBOUND(y(1)%p,3) + + allocate( group_factor(i1:i2,j1:j2,k1:k2), & + BRCL_pre_adjust(i1:i2,j1:j2,k1:k2), & + CLNO2_pre_adjust(i1:i2,j1:j2,k1:k2), & + CLNO3_pre_adjust(i1:i2,j1:j2,k1:k2), & + mass_AIR(i1:i2,j1:j2,k1:k2), & + frac(i1:i2,j1:j2,k1:k2), & + XXX_diff(i1:i2,j1:j2,k1:k2), & + XXX_sum(i1:i2,j1:j2,k1:k2), & + in_play(k1:k2), & + qq2(i1:i2,j1:j2,k1:k2), __STAT__ ) + + do k=k1,k2 + mass_AIR(:,:,k) = (PLE(:,:,k)-PLE(:,:,k-1)) * AREA(:,:) / MAPL_GRAV + end do + + CALL ESMF_StateGet(state, 'TRADV', TRADV_BUNDLE, __RC__ ) + + DO ig=1,NUMGRP + CALL ESMFL_BundleGetPointerToData(TRADV_BUNDLE, 'GEOSCHEMCHEM::'//TRIM(chem_group_names(ig)), qq1, __RC__ ) +! +! BASED ON INCLUDE FILE vvv +! + + qq2(:,:,:) = 0.0d0 + + select case (ig) + case (1) + +!.... Bry + +#ifdef CHEM_INFO + IF ( ASSOCIATED(zBRY) ) zBRY = qq1 + IF ( ASSOCIATED(aBRCL) ) aBRCL = y(iBRCL)%p(:,:,:) +#endif + + BRCL_pre_adjust(:,:,:) = y(iBRCL)%p(:,:,:) + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & qq2(:,:,:) = qq2(:,:,:) + & + & y(imsgrp)%p(:,:,:) * & + & sgrp_fac(im,ig) + end do + + group_factor(:,:,:) = qq1(:,:,:) / qq2(:,:,:) + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & y(imsgrp)%p(:,:,:) = y(imsgrp)%p(:,:,:) * & + & group_factor(:,:,:) + end do + +#ifdef CHEM_INFO + IF ( ASSOCIATED(zBRCL) ) zBRCL = y(iBRCL)%p(:,:,:) + IF ( ASSOCIATED(bry_ratio) ) bry_ratio = group_factor +#endif + + case (2) + +! aCLY is initilized below, so z-a shows affect of BrCl adjustment +!#ifdef CHEM_INFO +! IF ( ASSOCIATED(aCLY) ) aCLY = qq1 +!#endif + +!.... Cly -- NOTE: family does NOT include BrCl + + CLNO2_pre_adjust(:,:,:) = y(iCLNO2)%p(:,:,:) + CLNO3_pre_adjust(:,:,:) = y(iCLNO3)%p(:,:,:) + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & qq2(:,:,:) = qq2(:,:,:) + & + & y(imsgrp)%p(:,:,:) * & + & sgrp_fac(im,ig) + end do + + group_factor(:,:,:) = qq1(:,:,:) / qq2(:,:,:) + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & y(imsgrp)%p(:,:,:) = y(imsgrp)%p(:,:,:) * & + & group_factor(:,:,:) + end do + + end select + + ENDDO + +!!!!!!!!!!!!!!!!!!!!!!! +!!! Compensate for the Cl changed in BrCl + +#ifdef CHEM_INFO + IF ( ASSOCIATED(aCL2) ) aCL2 = y(iCL2)%p(:,:,:) + IF ( ASSOCIATED(aOCLO) ) aOCLO = y(iOCLO)%p(:,:,:) + IF ( ASSOCIATED(aCL2O2) ) aCL2O2 = y(iCL2O2)%p(:,:,:) + IF ( ASSOCIATED(aCLO) ) aCLO = y(iCLO)%p(:,:,:) + IF ( ASSOCIATED(aHCL) ) aHCL = y(iHCL)%p(:,:,:) + IF ( ASSOCIATED(aHOCL) ) aHOCL = y(iHOCL)%p(:,:,:) +#endif + + + BRCL_diff => XXX_diff + CL_sum => XXX_sum + +!.... Compute delta BrCl [kmol_BrCl / kg_AIR] = [kmol_Cl / kg_AIR] + BRCL_diff(:,:,:) = (y(iBRCL)%p(:,:,:) - BRCL_pre_adjust(:,:,:)) / mw_BRCL + +!.... Compute CL_sum [kmol_Cl / kg_AIR] + CL_sum(:,:,:) = 2 * y(iCL2 )%p(:,:,:) / mw_CL2 + & + y(iOCLO )%p(:,:,:) / mw_OCLO + & + 2 * y(iCL2O2)%p(:,:,:) / mw_CL2O2 + & + y(iCLO )%p(:,:,:) / mw_CLO + & + y(iHCL )%p(:,:,:) / mw_HCL + & + y(iHOCL )%p(:,:,:) / mw_HOCL + +!print*,'CL_sum min = ', MINVAL(CL_sum) + +!.... In gridboxes where BrCl has been reduced, increase Cly species + where ( BRCL_diff(:,:,:) < 0.0 ) + where ( CL_sum(:,:,:) > VERY_SMALL ) + + frac(:,:,:) = -1.0 * BRCL_diff(:,:,:) / CL_sum(:,:,:) ! Note frac is positive + ! Multiply by (1 + frac) + + y(iCL2 )%p(:,:,:) = y(iCL2 )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + y(iOCLO )%p(:,:,:) = y(iOCLO )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + y(iCL2O2)%p(:,:,:) = y(iCL2O2)%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + y(iCLO )%p(:,:,:) = y(iCLO )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + y(iHCL )%p(:,:,:) = y(iHCL )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + y(iHOCL )%p(:,:,:) = y(iHOCL )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + + elsewhere + + ! Add to species (subtract a negative): + y(iCL2 )%p(:,:,:) = y(iCL2 )%p(:,:,:) - BRCL_diff(:,:,:) / 12.0 * mw_CL2 + y(iOCLO )%p(:,:,:) = y(iOCLO )%p(:,:,:) - BRCL_diff(:,:,:) / 6.0 * mw_OCLO + y(iCL2O2)%p(:,:,:) = y(iCL2O2)%p(:,:,:) - BRCL_diff(:,:,:) / 12.0 * mw_CL2O2 + y(iCLO )%p(:,:,:) = y(iCLO )%p(:,:,:) - BRCL_diff(:,:,:) / 6.0 * mw_CLO + y(iHCL )%p(:,:,:) = y(iHCL )%p(:,:,:) - BRCL_diff(:,:,:) / 6.0 * mw_HCL + y(iHOCL )%p(:,:,:) = y(iHOCL )%p(:,:,:) - BRCL_diff(:,:,:) / 6.0 * mw_HOCL + + end where + + end where + + +!.... In gridboxes where BrCl has increased, reduce Cly species + + call GCC_reduce_Cly_mmr ( ) + +!.... Clean up + nullify(BRCL_diff, CL_sum) + +#ifdef CHEM_INFO + IF ( ASSOCIATED(zCL2) ) zCL2 = y(iCL2)%p(:,:,:) + IF ( ASSOCIATED(zOCLO) ) zOCLO = y(iOCLO)%p(:,:,:) + IF ( ASSOCIATED(zCL2O2) ) zCL2O2 = y(iCL2O2)%p(:,:,:) + IF ( ASSOCIATED(zCLO) ) zCLO = y(iCLO)%p(:,:,:) + IF ( ASSOCIATED(zHCL) ) zHCL = y(iHCL)%p(:,:,:) + IF ( ASSOCIATED(zHOCL) ) zHOCL = y(iHOCL)%p(:,:,:) +#endif + +!!! Done handling Cl change from BrCl +!!!!!!!!!!!!!!!!!!!!!!! + + +!!!!!!!!!!!!!!!!!!!!!!! +!!! Account for changes in NOy reservoirs ClNO2 and ClNO3 + + CLNOX_diff => XXX_diff + N_sum => XXX_sum + +!.... Compute delta ClNOX [(kmol_CLNO2 + kmol_CLNO3) / kg_AIR] = [kmol_N / kg_AIR] + CLNOX_diff(:,:,:) = (y(iCLNO2)%p(:,:,:) - CLNO2_pre_adjust(:,:,:)) / mw_CLNO2 + & + (y(iCLNO3)%p(:,:,:) - CLNO3_pre_adjust(:,:,:)) / mw_CLNO3 + +!.... Compute N_sum [kmol_N / kg_AIR] + N_sum(:,:,:) = 2 * y(iN2O5)%p(:,:,:) / mw_N2O5 + & + y(iNO )%p(:,:,:) / mw_NO + & + y(iNO2 )%p(:,:,:) / mw_NO2 + & + y(iHNO3)%p(:,:,:) / mw_HNO3 + +!print*,'N_sum min = ', MINVAL(N_sum) + +!.... In gridboxes where ClNOX has been reduced, increase N species + where ( CLNOX_diff(:,:,:) < 0.0 ) + where ( N_sum(:,:,:) > VERY_SMALL ) + + frac(:,:,:) = -1.0 * CLNOX_diff(:,:,:) / N_sum(:,:,:) ! Note frac is positive + ! Multiply by (1 + frac) + + y(iN2O5)%p(:,:,:) = y(iN2O5)%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + y(iNO )%p(:,:,:) = y(iNO )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + y(iNO2 )%p(:,:,:) = y(iNO2 )%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + y(iHNO3)%p(:,:,:) = y(iHNO3)%p(:,:,:) * ( 1.0 + frac(:,:,:) ) + + elsewhere + + ! Add to species (subtract a negative): + y(iN2O5)%p(:,:,:) = y(iN2O5)%p(:,:,:) - CLNOX_diff(:,:,:) / 8.0 * mw_N2O5 + y(iNO )%p(:,:,:) = y(iNO )%p(:,:,:) - CLNOX_diff(:,:,:) / 4.0 * mw_NO + y(iNO2 )%p(:,:,:) = y(iNO2 )%p(:,:,:) - CLNOX_diff(:,:,:) / 4.0 * mw_NO2 + y(iHNO3)%p(:,:,:) = y(iHNO3)%p(:,:,:) - CLNOX_diff(:,:,:) / 4.0 * mw_HNO3 + + end where + + end where + + +!.... In gridboxes where ClNOX has increased, reduce N species + + call GCC_reduce_N_mmr ( ) + +!.... Clean up + nullify(CLNOX_diff, N_sum) + +!!! Done handling N change from ClNO2 and ClNO3 +!!!!!!!!!!!!!!!!!!!!!!! + +! +! ^^^^^^^^^^^^^^^^^^^^^^^^^^ +! + +#ifdef CHEM_INFO + IF ( ASSOCIATED(zCLY) ) THEN + + qq2(:,:,:) = 0.0 + ig = 2 + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & qq2(:,:,:) = qq2(:,:,:) + & + & y(imsgrp)%p(:,:,:) * & + & sgrp_fac(im,ig) + end do + + zCLY = qq2 + + ENDIF +#endif + + deallocate(group_factor, BRCL_pre_adjust, CLNO2_pre_adjust, CLNO3_pre_adjust, & + mass_AIR, in_play, frac, XXX_diff, XXX_sum, qq2, __STAT__ ) + + ENDIF + + RETURN + + + contains + +! +! Where BrCl has increased, we want to reduce Cl to maintain conservation. +! To distribute the Cl loss proportionally across 6 species, we compute +! the fraction that is to be lost (guard against very low values +! in all 6 species which would make the fraction too high or undefined). +! Once we have the fraction by which to reduce the field, do not let +! the field go negative; if mass loss is un-accounted for in a gridbox, +! distribute it within the column. +! + +!.... In gridboxes where BrCl has increased, reduce Cly species + SUBROUTINE GMI_reduce_Cly_vmr ( ) + + integer :: loop_count, i, j, k + real*8 :: f, extra, vsum_EXTRA, col_mixrat, box_mixrat + + do i = i1,i2 + do j = j1,j2 + + vsum_EXTRA = 0.0d0 ! extra within column [kmol_CL] + + !! Guard against (1-frac) getting too small, or going negative + + !! + !! First pass through the column; make sure that in_play(k) is initialized for all k + !! + do k = k1,k2 + + if ( BRCL_diff(i,j,k) <= 0.0 ) then + + !! There was addition (not reduction) in this gridbox; + !! permit reduction in the next phase (column work) + !! if there is enough Cly + if ( CL_sum(i,j,k) < VERY_SMALL ) then + in_play(k) = .FALSE. + else + in_play(k) = .TRUE. + end if + + CYCLE + + end if + + if ( CL_sum(i,j,k) < VERY_SMALL ) then + + !! We should not divide BRCL_diff by CL_sum + !! Consider all of the amount to be extra [kmol_CL / kmol_AIR] + extra = BRCL_diff(i,j,k) + + !! Convert to [kmol_CL] + extra = extra * kmol_per_kg_AIR(i,j,k) * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + in_play(k) = .FALSE. + + CYCLE + + end if + + !! At this point, BRCL_diff > 0, and CL_sum is not too small + + f = BRCL_diff(i,j,k) / CL_sum(i,j,k) ! Note frac is positive + ! Multiply by (1 - frac) + + !! In gridboxes where (1-frac) gets too small or negative, + !! accumulate the extra mass of the species + if ( f > MAXFRAC ) then + + !! First compute total in gridbox [kmol_CL / kmol_AIR] + extra = CL_sum(i,j,k) + + !! Convert to remaining fraction [kmol_CL] + extra = extra * ( f - MAXFRAC ) * kmol_per_kg_AIR(i,j,k) * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + !! Apply f=MAXFRAC + x(iCL2 )%p(i,j,k) = x(iCL2 )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iOCLO )%p(i,j,k) = x(iOCLO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iCL2O2)%p(i,j,k) = x(iCL2O2)%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iCLO )%p(i,j,k) = x(iCLO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iHCL )%p(i,j,k) = x(iHCL )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iHOCL )%p(i,j,k) = x(iHOCL )%p(i,j,k) * ( 1.0 - MAXFRAC ) + + in_play(k) = .FALSE. + + else ! ( f > 0.0 .AND. f <= MAXFRAC ) + + x(iCL2 )%p(i,j,k) = x(iCL2 )%p(i,j,k) * ( 1.0 - f ) + x(iOCLO )%p(i,j,k) = x(iOCLO )%p(i,j,k) * ( 1.0 - f ) + x(iCL2O2)%p(i,j,k) = x(iCL2O2)%p(i,j,k) * ( 1.0 - f ) + x(iCLO )%p(i,j,k) = x(iCLO )%p(i,j,k) * ( 1.0 - f ) + x(iHCL )%p(i,j,k) = x(iHCL )%p(i,j,k) * ( 1.0 - f ) + x(iHOCL )%p(i,j,k) = x(iHOCL )%p(i,j,k) * ( 1.0 - f ) + + !! If fraction is small we will allow further reduction + !! in the gridbox; we expect that to happen at most 2 or 3 times + if (f < 0.70) then + in_play(k) = .TRUE. + else + in_play(k) = .FALSE. + end if + + end if + + end do + + + !! Distribute any extra mass of Cly species throughout the entire column + + loop_count = 0 + + !! + !! Additional passes through the column, in which + !! the remainder amount is divided among + !! all column gridboxes that are still 'in play' + !! + + DO WHILE ( vsum_EXTRA > 0.0d0 .AND. ANY(in_play(:)) ) + + !! Mixing ratio to be subtracted from every box in + !! the column that is still in play [kmol_CL / kg_AIR] + col_mixrat = vsum_EXTRA / SUM(mass_AIR(i,j,:), MASK=in_play(:) ) + + vsum_EXTRA = 0.0d0 + + do k = k1,k2 + + if ( .NOT. in_play(k) ) CYCLE + + !! + !! Compute the fraction + !! + + !! First compute total in gridbox [kmol_CL / kmol_AIR] + box_mixrat = 2 * x(iCL2 )%p(i,j,k) + & + x(iOCLO )%p(i,j,k) + & + 2 * x(iCL2O2)%p(i,j,k) + & + x(iCLO )%p(i,j,k) + & + x(iHCL )%p(i,j,k) + & + x(iHOCL )%p(i,j,k) + + !! Convert to [kmol_CL / kg_AIR] + box_mixrat = box_mixrat * kmol_per_kg_AIR(i,j,k) + + f = col_mixrat/box_mixrat + + !! + !! Apply the fraction + !! + + if ( f > MAXFRAC ) then + + !! First compute total in gridbox [kmol_CL / kmol_AIR] + extra = 2 * x(iCL2 )%p(i,j,k) + & + x(iOCLO )%p(i,j,k) + & + 2 * x(iCL2O2)%p(i,j,k) + & + x(iCLO )%p(i,j,k) + & + x(iHCL )%p(i,j,k) + & + x(iHOCL )%p(i,j,k) + + !! Convert to remaining fraction [kmol_CL] + extra = extra * ( f - MAXFRAC ) * kmol_per_kg_AIR(i,j,k) * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + !! Apply f=MAXFRAC + x(iCL2 )%p(i,j,k) = x(iCL2 )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iOCLO )%p(i,j,k) = x(iOCLO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iCL2O2)%p(i,j,k) = x(iCL2O2)%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iCLO )%p(i,j,k) = x(iCLO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iHCL )%p(i,j,k) = x(iHCL )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iHOCL )%p(i,j,k) = x(iHOCL )%p(i,j,k) * ( 1.0 - MAXFRAC ) + + in_play(k) = .FALSE. + + else + + x(iCL2 )%p(i,j,k) = x(iCL2 )%p(i,j,k) * ( 1.0 - f ) + x(iOCLO )%p(i,j,k) = x(iOCLO )%p(i,j,k) * ( 1.0 - f ) + x(iCL2O2)%p(i,j,k) = x(iCL2O2)%p(i,j,k) * ( 1.0 - f ) + x(iCLO )%p(i,j,k) = x(iCLO )%p(i,j,k) * ( 1.0 - f ) + x(iHCL )%p(i,j,k) = x(iHCL )%p(i,j,k) * ( 1.0 - f ) + x(iHOCL )%p(i,j,k) = x(iHOCL )%p(i,j,k) * ( 1.0 - f ) + + !! If fraction is small we will allow further reduction + !! in the gridbox; we expect that to happen at most 2 or 3 times + if (f < 0.70) then + in_play(k) = .TRUE. + else + in_play(k) = .FALSE. + end if + + end if + + end do + + loop_count = loop_count+1 + + END DO + + IF ( loop_count > 0 ) print*,'CL LOOP COUNT = ', loop_count, COUNT(in_play(:)) + + if ( vsum_EXTRA > 0.0d0 ) then + print*,'Cannot conserve Cl !!' + end if + + end do + end do + + END SUBROUTINE GMI_reduce_Cly_vmr + +!.... In gridboxes where ClONO2 has increased, reduce N species + SUBROUTINE GMI_reduce_N_vmr ( ) + + integer :: loop_count, i, j, k + real*8 :: f, extra, vsum_EXTRA, col_mixrat, box_mixrat + +#ifdef DEBUG_STUFF + real :: the_min + integer:: ii,jj,kk + + the_min = 1000.0 +#endif + + do i = i1,i2 + do j = j1,j2 + + vsum_EXTRA = 0.0d0 ! extra within column [kmol_N] + + !! Guard against (1-frac) getting too small, or going negative + + !! + !! First pass through the column; make sure that in_play(k) is initialized for all k + !! + do k = k1,k2 + +#ifdef DEBUG_STUFF + IF ( N_sum(i,j,k) < the_min ) THEN + the_min = N_sum(i,j,k) + ii = i + jj = j + kk = k + ENDIF +#endif + + if ( CLONO2_diff(i,j,k) <= 0.0 ) then + + !! There was addition (not reduction) in this gridbox; + !! permit reduction in the next phase (column work) + in_play(k) = .TRUE. + + CYCLE + + end if + + if ( N_sum(i,j,k) < VERY_SMALL ) then + + !! We should not divide CLONO2_diff by N_sum + !! Consider all of the amount to be extra [kmol_N / kmol_AIR] + extra = CLONO2_diff(i,j,k) + + !! Convert to [kmol_N] + extra = extra * kmol_per_kg_AIR(i,j,k) * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + in_play(k) = .FALSE. + + CYCLE + + end if + + f = CLONO2_diff(i,j,k) / N_sum(i,j,k) ! Note frac is positive + ! Multiply by (1 - frac) + + !! In gridboxes where (1-frac) gets too small or negative, + !! accumulate the extra mass of the species + if ( f > MAXFRAC ) then + + !! First compute total in gridbox [kmol_N / kmol_AIR] + extra = N_sum(i,j,k) + + !! Convert to remaining fraction [kmol_N] + extra = extra * ( f - MAXFRAC ) * kmol_per_kg_AIR(i,j,k) * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + !! Apply f=MAXFRAC + x(iN2O5)%p(i,j,k) = x(iN2O5)%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iNO )%p(i,j,k) = x(iNO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iNO2 )%p(i,j,k) = x(iNO2 )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iHNO3)%p(i,j,k) = x(iHNO3)%p(i,j,k) * ( 1.0 - MAXFRAC ) + + in_play(k) = .FALSE. + + else ! ( f > 0.0 .AND. f <= MAXFRAC ) + + x(iN2O5)%p(i,j,k) = x(iN2O5)%p(i,j,k) * ( 1.0 - f ) + x(iNO )%p(i,j,k) = x(iNO )%p(i,j,k) * ( 1.0 - f ) + x(iNO2 )%p(i,j,k) = x(iNO2 )%p(i,j,k) * ( 1.0 - f ) + x(iHNO3)%p(i,j,k) = x(iHNO3)%p(i,j,k) * ( 1.0 - f ) + + !! If fraction is small we will allow further reduction + !! in the gridbox; we expect that to happen at most 2 or 3 times + if (f < 0.70) then + in_play(k) = .TRUE. + else + in_play(k) = .FALSE. + end if + + end if + + end do + + + !! Distribute any extra mass of N species throughout the entire column + + loop_count = 0 + + !! + !! Additional passes through the column, in which + !! the remainder amount is divided among + !! all column gridboxes that are still 'in play' + !! + + DO WHILE ( vsum_EXTRA > 0.0d0 .AND. ANY(in_play(:)) ) + + !! Mixing ratio to be subtracted from every box in + !! the column that is still in play [kmol_N / kg_AIR] + col_mixrat = vsum_EXTRA / SUM(mass_AIR(i,j,:), MASK=in_play(:) ) + + vsum_EXTRA = 0.0d0 + + do k = k1,k2 + + if ( .NOT. in_play(k) ) CYCLE + + !! + !! Compute the fraction + !! + + !! First compute total in gridbox [kmol_N / kmol_AIR] + box_mixrat = 2 * x(iN2O5)%p(i,j,k) + & + x(iNO )%p(i,j,k) + & + x(iNO2 )%p(i,j,k) + & + x(iHNO3)%p(i,j,k) + + !! Convert to [kmol_N / kg_AIR] + box_mixrat = box_mixrat * kmol_per_kg_AIR(i,j,k) + + f = col_mixrat/box_mixrat + + !! + !! Apply the fraction + !! + + if ( f > MAXFRAC ) then + + !! First compute total in gridbox [kmol_N / kmol_AIR] + extra = 2 * x(iN2O5)%p(i,j,k) / mw_N2O5 + & + x(iNO )%p(i,j,k) / mw_NO + & + x(iNO2 )%p(i,j,k) / mw_NO2 + & + x(iHNO3)%p(i,j,k) / mw_HNO3 + + !! Convert to remaining fraction [kmol_N] + extra = extra * ( f - MAXFRAC ) * kmol_per_kg_AIR(i,j,k) * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + !! Apply f=MAXFRAC + x(iN2O5)%p(i,j,k) = x(iN2O5)%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iNO )%p(i,j,k) = x(iNO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iNO2 )%p(i,j,k) = x(iNO2 )%p(i,j,k) * ( 1.0 - MAXFRAC ) + x(iHNO3)%p(i,j,k) = x(iHNO3)%p(i,j,k) * ( 1.0 - MAXFRAC ) + + in_play(k) = .FALSE. + + else + + x(iN2O5)%p(i,j,k) = x(iN2O5)%p(i,j,k) * ( 1.0 - f ) + x(iNO )%p(i,j,k) = x(iNO )%p(i,j,k) * ( 1.0 - f ) + x(iNO2 )%p(i,j,k) = x(iNO2 )%p(i,j,k) * ( 1.0 - f ) + x(iHNO3)%p(i,j,k) = x(iHNO3)%p(i,j,k) * ( 1.0 - f ) + + !! If fraction is small we will allow further reduction + !! in the gridbox; we expect that to happen at most 2 or 3 times + if (f < 0.70) then + in_play(k) = .TRUE. + else + in_play(k) = .FALSE. + end if + + end if + + end do + + loop_count = loop_count+1 + + END DO + + IF ( loop_count > 0 ) print*,'N LOOP COUNT = ', loop_count, COUNT(in_play(:)) + + if ( vsum_EXTRA > 0.0d0 ) then + print*,'Cannot conserve N!!' + end if + + end do + end do + +#ifdef DEBUG_STUFF + IF ( the_min < 1.0e-15 ) print*,'N_sum min = ',the_min, ' ijk ', ii, jj, kk +#endif + + END SUBROUTINE GMI_reduce_N_vmr + +!.... In gridboxes where BrCl has increased, reduce Cly species + SUBROUTINE GCC_reduce_Cly_mmr ( ) + + integer :: loop_count, i, j, k + real*8 :: f, extra, vsum_EXTRA, col_mixrat, box_mixrat + + do i = i1,i2 + do j = j1,j2 + + vsum_EXTRA = 0.0d0 ! extra within column [kmol_CL] + + !! Guard against (1-frac) getting too small, or going negative + + !! + !! First pass through the column; make sure that in_play(k) is initialized for all k + !! + do k = k1,k2 + + if ( BRCL_diff(i,j,k) <= 0.0 ) then + + !! There was addition (not reduction) in this gridbox; + !! permit reduction in the next phase (column work) + !! if there is enough Cly + if ( CL_sum(i,j,k) < VERY_SMALL ) then + in_play(k) = .FALSE. + else + in_play(k) = .TRUE. + end if + + CYCLE + + end if + + if ( CL_sum(i,j,k) < VERY_SMALL ) then + + !! We should not divide BRCL_diff by CL_sum + !! Consider all of the amount to be extra [kmol_CL / kg_AIR] + extra = BRCL_diff(i,j,k) + + !! Convert to [kmol_CL] + extra = extra * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + in_play(k) = .FALSE. + + CYCLE + + end if + + !! At this point, BRCL_diff > 0, and CL_sum is not too small + + f = BRCL_diff(i,j,k) / CL_sum(i,j,k) ! Note frac is positive + ! Multiply by (1 - frac) + + !! In gridboxes where (1-frac) gets too small or negative, + !! accumulate the extra mass of the species + if ( f > MAXFRAC ) then + + !! First compute total in gridbox [kmol_CL / kg_AIR] + extra = CL_sum(i,j,k) + + !! Convert to remaining fraction [kmol_CL] + extra = extra * ( f - MAXFRAC ) * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + !! Apply f=MAXFRAC + y(iCL2 )%p(i,j,k) = y(iCL2 )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iOCLO )%p(i,j,k) = y(iOCLO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iCL2O2)%p(i,j,k) = y(iCL2O2)%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iCLO )%p(i,j,k) = y(iCLO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iHCL )%p(i,j,k) = y(iHCL )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iHOCL )%p(i,j,k) = y(iHOCL )%p(i,j,k) * ( 1.0 - MAXFRAC ) + + in_play(k) = .FALSE. + + else ! ( f > 0.0 .AND. f <= MAXFRAC ) + + y(iCL2 )%p(i,j,k) = y(iCL2 )%p(i,j,k) * ( 1.0 - f ) + y(iOCLO )%p(i,j,k) = y(iOCLO )%p(i,j,k) * ( 1.0 - f ) + y(iCL2O2)%p(i,j,k) = y(iCL2O2)%p(i,j,k) * ( 1.0 - f ) + y(iCLO )%p(i,j,k) = y(iCLO )%p(i,j,k) * ( 1.0 - f ) + y(iHCL )%p(i,j,k) = y(iHCL )%p(i,j,k) * ( 1.0 - f ) + y(iHOCL )%p(i,j,k) = y(iHOCL )%p(i,j,k) * ( 1.0 - f ) + + !! If fraction is small we will allow further reduction + !! in the gridbox; we expect that to happen at most 2 or 3 times + if (f < 0.70) then + in_play(k) = .TRUE. + else + in_play(k) = .FALSE. + end if + + end if + + end do + + + !! Distribute any extra mass of Cly species throughout the entire column + +#ifdef CHEM_INFO + ! aCLY and zCLY will show the change IN THE COLUMN, due to BrCl adjustment + IF ( ASSOCIATED(aCLY) ) THEN + + qq2(i,j,:) = 0.0 + ig = 2 + + do im = 1, MAXGRP_ELEM + imsgrp = sgrp_elem_map(im,ig) + if (imsgrp > 0) & + & qq2(i,j,:) = qq2(i,j,:) + & + & y(imsgrp)%p(i,j,:) * & + & sgrp_fac(im,ig) + end do + + aCLY(i,j,:) = qq2(i,j,:) + + ENDIF +#endif + + loop_count = 0 + + !! + !! Additional passes through the column, in which + !! the remainder amount is divided among + !! all column gridboxes that are still 'in play' + !! + + DO WHILE ( vsum_EXTRA > 0.0d0 .AND. ANY(in_play(:)) ) + + !! Mixing ratio to be subtracted from every box in + !! the column that is still in play [kmol_CL / kg_AIR] + col_mixrat = vsum_EXTRA / SUM(mass_AIR(i,j,:), MASK=in_play(:) ) + + vsum_EXTRA = 0.0d0 + + do k = k1,k2 + + if ( .NOT. in_play(k) ) CYCLE + + !! + !! Compute the fraction + !! + + !! First compute total in gridbox [kmol_CL / kg_AIR] + box_mixrat = 2 * y(iCL2 )%p(i,j,k) / mw_CL2 + & + y(iOCLO )%p(i,j,k) / mw_OCLO + & + 2 * y(iCL2O2)%p(i,j,k) / mw_CL2O2 + & + y(iCLO )%p(i,j,k) / mw_CLO + & + y(iHCL )%p(i,j,k) / mw_HCL + & + y(iHOCL )%p(i,j,k) / mw_HOCL + + f = col_mixrat/box_mixrat + + !! + !! Apply the fraction + !! + + if ( f > MAXFRAC ) then + + !! First compute total in gridbox [kmol_CL / kg_AIR] + extra = 2 * y(iCL2 )%p(i,j,k) / mw_CL2 + & + y(iOCLO )%p(i,j,k) / mw_OCLO + & + 2 * y(iCL2O2)%p(i,j,k) / mw_CL2O2 + & + y(iCLO )%p(i,j,k) / mw_CLO + & + y(iHCL )%p(i,j,k) / mw_HCL + & + y(iHOCL )%p(i,j,k) / mw_HOCL + + !! Convert to remaining fraction [kmol_CL] + extra = extra * ( f - MAXFRAC ) * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + !! Apply f=MAXFRAC + y(iCL2 )%p(i,j,k) = y(iCL2 )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iOCLO )%p(i,j,k) = y(iOCLO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iCL2O2)%p(i,j,k) = y(iCL2O2)%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iCLO )%p(i,j,k) = y(iCLO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iHCL )%p(i,j,k) = y(iHCL )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iHOCL )%p(i,j,k) = y(iHOCL )%p(i,j,k) * ( 1.0 - MAXFRAC ) + + in_play(k) = .FALSE. + + else + + y(iCL2 )%p(i,j,k) = y(iCL2 )%p(i,j,k) * ( 1.0 - f ) + y(iOCLO )%p(i,j,k) = y(iOCLO )%p(i,j,k) * ( 1.0 - f ) + y(iCL2O2)%p(i,j,k) = y(iCL2O2)%p(i,j,k) * ( 1.0 - f ) + y(iCLO )%p(i,j,k) = y(iCLO )%p(i,j,k) * ( 1.0 - f ) + y(iHCL )%p(i,j,k) = y(iHCL )%p(i,j,k) * ( 1.0 - f ) + y(iHOCL )%p(i,j,k) = y(iHOCL )%p(i,j,k) * ( 1.0 - f ) + + !! If fraction is small we will allow further reduction + !! in the gridbox; we expect that to happen at most 2 or 3 times + if (f < 0.70) then + in_play(k) = .TRUE. + else + in_play(k) = .FALSE. + end if + + end if + + end do + + loop_count = loop_count+1 + + END DO + + IF ( loop_count > 0 ) print*,'CL LOOP COUNT = ', loop_count, COUNT(in_play(:)) + + if ( vsum_EXTRA > 0.0d0 ) then + print*,'Cannot conserve Cl !!' + end if + + end do + end do + + END SUBROUTINE GCC_reduce_Cly_mmr + +!.... In gridboxes where ClNOX has increased, reduce N species + SUBROUTINE GCC_reduce_N_mmr ( ) + + integer :: loop_count, i, j, k + real*8 :: f, extra, vsum_EXTRA, col_mixrat, box_mixrat + + do i = i1,i2 + do j = j1,j2 + + vsum_EXTRA = 0.0d0 ! extra within column [kmol_N] + + !! Guard against (1-frac) getting too small, or going negative + + !! + !! First pass through the column; make sure that in_play(k) is initialized for all k + !! + do k = k1,k2 + + if ( CLNOX_diff(i,j,k) <= 0.0 ) then + + !! There was addition (not reduction) in this gridbox; + !! permit reduction in the next phase (column work) + in_play(k) = .TRUE. + + CYCLE + + end if + + if ( N_sum(i,j,k) < VERY_SMALL ) then + + !! We should not divide CLNOX_diff by N_sum + !! Consider all of the amount to be extra [kmol_N / kg_AIR] + extra = CLNOX_diff(i,j,k) + + !! Convert to [kmol_N] + extra = extra * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + in_play(k) = .FALSE. + + CYCLE + + end if + + f = CLNOX_diff(i,j,k) / N_sum(i,j,k) ! Note frac is positive + ! Multiply by (1 - frac) + + !! In gridboxes where (1-frac) gets too small or negative, + !! accumulate the extra mass of the species + if ( f > MAXFRAC ) then + + !! First compute total in gridbox [kmol_N / kg_AIR] + extra = N_sum(i,j,k) + + !! Convert to remaining fraction [kmol_N] + extra = extra * ( f - MAXFRAC ) * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + !! Apply f=MAXFRAC + y(iN2O5)%p(i,j,k) = y(iN2O5)%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iNO )%p(i,j,k) = y(iNO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iNO2 )%p(i,j,k) = y(iNO2 )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iHNO3)%p(i,j,k) = y(iHNO3)%p(i,j,k) * ( 1.0 - MAXFRAC ) + + in_play(k) = .FALSE. + + else ! ( f > 0.0 .AND. f <= MAXFRAC ) + + y(iN2O5)%p(i,j,k) = y(iN2O5)%p(i,j,k) * ( 1.0 - f ) + y(iNO )%p(i,j,k) = y(iNO )%p(i,j,k) * ( 1.0 - f ) + y(iNO2 )%p(i,j,k) = y(iNO2 )%p(i,j,k) * ( 1.0 - f ) + y(iHNO3)%p(i,j,k) = y(iHNO3)%p(i,j,k) * ( 1.0 - f ) + + !! If fraction is small we will allow further reduction + !! in the gridbox; we expect that to happen at most 2 or 3 times + if (f < 0.70) then + in_play(k) = .TRUE. + else + in_play(k) = .FALSE. + end if + + end if + + end do + + + !! Distribute any extra mass of N species throughout the entire column + + loop_count = 0 + + !! + !! Additional passes through the column, in which + !! the remainder amount is divided among + !! all column gridboxes that are still 'in play' + !! + + DO WHILE ( vsum_EXTRA > 0.0d0 .AND. ANY(in_play(:)) ) + + !! Mixing ratio to be subtracted from every box in + !! the column that is still in play [kmol_N / kg_AIR] + col_mixrat = vsum_EXTRA / SUM(mass_AIR(i,j,:), MASK=in_play(:) ) + + vsum_EXTRA = 0.0d0 + + do k = k1,k2 + + if ( .NOT. in_play(k) ) CYCLE + + !! + !! Compute the fraction + !! + + !! First compute total in gridbox [kmol_N / kg_AIR] + box_mixrat = 2 * y(iN2O5)%p(i,j,k) / mw_N2O5 + & + y(iNO )%p(i,j,k) / mw_NO + & + y(iNO2 )%p(i,j,k) / mw_NO2 + & + y(iHNO3)%p(i,j,k) / mw_HNO3 + + f = col_mixrat/box_mixrat + + !! + !! Apply the fraction + !! + + if ( f > MAXFRAC ) then + + !! First compute total in gridbox [kmol_N / kg_AIR] + extra = 2 * y(iN2O5)%p(i,j,k) / mw_N2O5 + & + y(iNO )%p(i,j,k) / mw_NO + & + y(iNO2 )%p(i,j,k) / mw_NO2 + & + y(iHNO3)%p(i,j,k) / mw_HNO3 + + !! Convert to remaining fraction [kmol_N] + extra = extra * ( f - MAXFRAC ) * mass_AIR(i,j,k) + + vsum_EXTRA = vsum_EXTRA + extra + + !! Apply f=MAXFRAC + y(iN2O5)%p(i,j,k) = y(iN2O5)%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iNO )%p(i,j,k) = y(iNO )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iNO2 )%p(i,j,k) = y(iNO2 )%p(i,j,k) * ( 1.0 - MAXFRAC ) + y(iHNO3)%p(i,j,k) = y(iHNO3)%p(i,j,k) * ( 1.0 - MAXFRAC ) + + in_play(k) = .FALSE. + + else + + y(iN2O5)%p(i,j,k) = y(iN2O5)%p(i,j,k) * ( 1.0 - f ) + y(iNO )%p(i,j,k) = y(iNO )%p(i,j,k) * ( 1.0 - f ) + y(iNO2 )%p(i,j,k) = y(iNO2 )%p(i,j,k) * ( 1.0 - f ) + y(iHNO3)%p(i,j,k) = y(iHNO3)%p(i,j,k) * ( 1.0 - f ) + + !! If fraction is small we will allow further reduction + !! in the gridbox; we expect that to happen at most 2 or 3 times + if (f < 0.70) then + in_play(k) = .TRUE. + else + in_play(k) = .FALSE. + end if + + end if + + end do + + loop_count = loop_count+1 + + END DO + + IF ( loop_count > 0 ) print*,'N LOOP COUNT = ', loop_count, COUNT(in_play(:)) + + if ( vsum_EXTRA > 0.0d0 ) then + print*,'Cannot conserve N!!' + end if + + end do + end do + + END SUBROUTINE GCC_reduce_N_mmr + + END SUBROUTINE Unpack_Chem_Groups + + END MODULE Chem_GroupMod diff --git a/ESMF/Shared/Chem_Shared/Chem_SettlingCalculator.F90 b/ESMF/Shared/Chem_Shared/Chem_SettlingCalculator.F90 new file mode 100644 index 00000000..5d38b5a8 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/Chem_SettlingCalculator.F90 @@ -0,0 +1,256 @@ +! Colarco, January 2009 +! Code to run offline the Chem_SettlingMod Module from GEOS-5 +! to test how it works (if at all!). + +! NOTE: There are filenames coded below that need to be +! interfaced to properly: requires an input file +! of the chemistry (this is specified on the input line) +! but also needs some ancillary meteorology which is +! currently hard-coded below. Should be fixed. + + program Chem_SettleCalc + + use ESMF ! Needed to initialize MPI + use Chem_Mod ! Chemistry Base Class + use Chem_StateMod ! Chemistry State + use Chem_SettlingMod ! Settling + use Chem_ConstMod, only: grav, von_karman, cpd ! Constants ! + use Chem_UtilMod ! I/O + use m_inpak90 ! Resource file management + use m_die, only: die + + implicit none + +! Variables + integer :: i, j, k, n, iarg, iargc, argc, fid + integer, parameter :: READ_ONLY=1 + integer :: nymd, nhms, flag + integer :: nbins, i1, i2, j1, j2, ig, jg, im, jm, km, ijl, ijkl + integer, dimension(32) :: ier + type(Chem_Bundle) :: w_c ! chemistry bundle used for RH and pressure + type(Chem_Bundle) :: w_vsettle ! bundle to hold output + type(Chem_Registry) :: regInp + character(len=255) :: argv, infile, rcfile, myname + character(len=2) :: XX + real :: qmin, qmax, cdt + real, pointer, dimension(:) :: radius, & ! particle effective radius [um] + rhop ! particle density [kg m-3] + real, pointer, dimension(:,:,:) :: pm, & ! layer midpoint air pressure [Pa] + rhoa, & ! layer midpoint air density [kg m-3] + t, & ! layer midpoint temperature [K] + rh, & ! layer relative humidity + delp, & ! layer pressure thickness [Pa] + hght ! layer mid-point geopotential height [m] + real, pointer, dimension(:,:) :: hsurf + real, pointer, dimension(:,:,:) :: hghte ! layer edge geopotential height [m] + type(Chem_Array), pointer, dimension(:) :: fluxout, vsettle + +! + ier(:) = 0 + myname = 'Chem_SettlingCalc' + +! This is needed to set up the MPI for the pmaxmin calls below and in +! Chem_SettlingMod + call ESMF_Initialize( rc = ier(0)) + +! Parse the command line (see usage() below) + argc = iargc() + iarg = 0 + rcfile = '' + do i = 0, 32767 + iarg = iarg+1 + if(iarg .gt. argc) exit + call GetArg(iarg, argv) + select case(argv) + case ("-t") + if(iarg+1 .gt. argc) call usage() + iarg = iarg+1 + call GetArg(iarg, rcfile) + case default + infile = argv + end select + end do + + +! Provide a resource file (e.g., SS_GridComp.rc) which has the +! particle bins and sizes. If no resource file is provided, +! then default conditions are for 1 bin of 1 um effective radius +! and 1000 kg m-3 density. +! The value of "flag" is used to define what relative humidity +! correction to apply to the particles. 0: none, 1: Fitzgerald SS, +! 2: Gerber SS + flag = 0 + if(rcfile .eq. '') then + nbins = 1 + allocate(radius(nbins), rhop(nbins), stat = ier(1)) + if(ier(1) /= 0) call die(myname,'cannot allocate radius, rhop') + + radius(1) = 1.e-6 + rhop(1) = 1000. + + else +! Read the resource file provided +! Works only for SS or DU + if(rcfile(1:2) .eq. 'DU' .or. & + rcfile(1:2) .eq. 'SS') then + XX = trim(rcfile(1:2)) + else + call die(myname,'do not know what to do with rcfile '//rcfile) + endif + + call i90_loadf ( rcfile, ier(1) ) + if(ier(1) /= 0) call die(myname,'cannot open rcfile '//rcfile) + call i90_label ( 'number_'//XX//'_bins:', ier(1) ) + nbins = i90_gint ( ier(2) ) + if(any(ier(:) /= 0)) call die(myname,'cannot find number of bins in '//rcfile) + + allocate(radius(nbins), rhop(nbins), stat = ier(1)) + if(ier(1) /= 0) call die(myname,'cannot allocate radius, rhop') + +! Particle radius +! --------------- + call i90_label ( 'particle_radius:', ier(1) ) + do n = 1, nbins + radius(n) = i90_gfloat ( ier(n+1) )*1.e-6 + end do + if ( any(ier(1:nbins+1) /= 0) ) call die(myname,'cannot get radii') + +! Dry Particle Density +! --------------- + call i90_label ( XX//'_density:', ier(1) ) + do n = 1, nbins + rhop(n) = i90_gfloat ( ier(n+1) ) + end do + if ( any(ier(1:nbins+1) /= 0) ) call die(myname,'cannot get rhop') +! ------- + +! If Seasalt, check for RH flag +! ----------------------------- + if(XX .eq. 'SS') then + call i90_label ( 'rhFlag:', ier(1) ) + flag = i90_gint(ier(2)) + if ( any(ier(1:nbins+1) /= 0) ) call die(myname,'cannot get rhflag') + endif + endif + + regInp = Chem_RegistryCreate(ier(1),'Chem_Registry.rc') + call Chem_BundleRead(infile, nymd, nhms, w_c, ier(2), ChemReg=regInp) + i1 = w_c%grid%i1 + i2 = w_c%grid%i2 + ig = w_c%grid%ig + j1 = w_c%grid%j1 + j2 = w_c%grid%j2 + jg = w_c%grid%jg + im = w_c%grid%im + jm = w_c%grid%jm + km = w_c%grid%km + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + allocate(pm(i1:i2,j1:j2,1:km), t(i1:i2,j1:j2,1:km), & + rhoa(i1:i2,j1:j2,1:km), rh(i1:i2,j1:j2,1:km), & + delp(i1:i2,j1:j2,1:km), hght(i1:i2,j1:j2,1:km), stat = ier(1)) + allocate(hsurf(i1:i2,j1:j2), stat=ier(2)) + allocate(hghte(i1:i2,j1:j2,1:km+1), stat = ier(3)) + if(any(ier(:) /= 0)) call die(myname,'cannot allocate atmosphere') + +! Allocate space for output arrays + allocate(fluxout(nbins), vsettle(nbins), stat=ier(1)) + do n = 1, nbins + allocate(fluxout(n)%data2d(i1:i2,j1:j2), & + vsettle(n)%data3d(i1:i2,j1:j2,1:km), stat=ier(n+1)) + enddo + if( any(ier(1:nbins+1) /= 0)) call die(myname,'cannot allocate output arrays') + +! Temperature, RH, DELP, HGHT + call GFIO_Open('d520_fp.tavg3d_dyn_v.20090101_0000z.hdf', & + READ_ONLY, fid, ier(1)) + call GFIO_GetVar(fid,'T', nymd, nhms, im, jm, 1, km, t, ier(2)) + call GFIO_GetVar(fid,'RH', nymd, nhms, im, jm, 1, km, rh, ier(3)) + call GFIO_GetVar(fid,'DELP', nymd, nhms, im, jm, 1, km, delp, ier(4)) + call GFIO_GetVar(fid,'HGHT', nymd, nhms, im, jm, 1, km, hght, ier(5)) + call GFIO_Close(fid,ier(6)) + +! HGHTE + call GFIO_Open('d520_fp.tavg3d_met_e.20090101_0000z.hdf', & + READ_ONLY, fid, ier(1)) + call GFIO_GetVar(fid,'HGHTE', nymd, nhms, im, jm, 1, km+1, hghte, ier(2)) + call GFIO_Close(fid,ier(3)) + +! Loop over vertical coordinate to get pressures + pm(i1:i2,j1:j2,1) = w_c%grid%ptop + 0.5*delp(i1:i2,j1:j2,1) + do k = 2, km + pm(i1:i2,j1:j2,k) = pm(i1:i2,j1:j2,k-1) & + +0.5*(delp(i1:i2,j1:j2,k)+delp(i1:i2,j1:j2,k-1)) + end do + +! Air Density + rhoa = pm/287./t + +! Surface Height + hsurf = hghte(:,:,km+1) + +! call pmaxmin('delp ', delp, qmin, qmax, ijkl, 1, 1.) +! call pmaxmin('hght ', hght, qmin, qmax, ijkl, 1, 1.) +! call pmaxmin('rh ', rh, qmin, qmax, ijkl, 1, 1.) +! call pmaxmin('t ', t, qmin, qmax, ijkl, 1, 1.) +! call pmaxmin('rhoa ', rhoa, qmin, qmax, ijkl, 1, 1.) + + cdt = 1800. + +! Create and initialize output chemistry bundle + call Chem_BundleCreate(regInp, & + i1, i2, ig, im, & + j1, j2, jg, jm, km, & + w_vsettle, ier(1)) + + if(ier(1) /= 0) call die(myname, 'cannot create bundle') + w_vsettle%delp = w_c%delp + w_vsettle%rh = w_c%rh + do n = 1, regInp%nq + w_vsettle%qa(n)%data3d = 0.0 + end do + + call Chem_Settling ( i1, i2, j1, j2, km, & + w_c%reg%i_SS, w_c%reg%j_SS, nbins, flag, & + radius, rhop, cdt, w_c, & + t, rhoa, hsurf, hghte, fluxout, ier(1), & + vsettle) + + do n = 1, nbins + w_vsettle%qa(n)%data3d = vsettle(n)%data3d + end do + + call Chem_BundleWrite('d520_fp.tavg3d_vsettle_v.20090101.hdf', & + nymd, nhms, 0, w_vsettle, ier(1), verbose=.true., new=.true.) + + do n = 1, nbins + deallocate(fluxout(n)%data2d, vsettle(n)%data3d, stat=ier(n)) + enddo + deallocate(fluxout, vsettle, stat=ier(nbins+1)) + if( any(ier(1:nbins+1) /= 0)) call die(myname,'cannot deallocate output arrays') + + deallocate(radius, rhop, stat=ier(1)) + if(ier(1) /= 0) call die(myname,'cannot deallocate radius, rhop') + deallocate(pm, rhoa, t, rh, delp, hght, hghte, hsurf, stat=ier(1)) + if(ier(1) /= 0) call die(myname,'cannot deallocate atmosphere') + + + +! ---------------------------------------------------------------------------- + contains + + subroutine usage() + print * + print *,'Usage: ' + print *,' Chem_SettleCalc.x [-t rcfile ] infile' + print * + print *, 'where' + print * + print *, '-t rcfile resource file specifying particle radii, density' + print *, '-v request verbose output' + print *, 'infile mandatory input aer_v file' + print * + call exit(1) + end subroutine usage + +end program Chem_SettleCalc diff --git a/ESMF/Shared/Chem_Shared/Chem_SettlingMod.F90 b/ESMF/Shared/Chem_Shared/Chem_SettlingMod.F90 new file mode 100644 index 00000000..986538de --- /dev/null +++ b/ESMF/Shared/Chem_Shared/Chem_SettlingMod.F90 @@ -0,0 +1,674 @@ +#include "unused_dummy.H" +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_SettlingMod --- Gravitional Sedimentation & Settling Speed +! +! !INTERFACE: +! + + module Chem_SettlingMod + +! !USES: + + use Chem_Mod + use Chem_ConstMod, only: grav ! Constants ! + use Chem_UtilMod + + use m_mpout + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC Chem_Settling + PUBLIC Chem_SettlingSimple + PUBLIC Chem_CalcVsettle + +! +! !DESCRIPTION: +! +! This module implements the (pre-ESMF) DU Grid Component. +! +! !REVISION HISTORY: +! +! 16Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- +CONTAINS +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_Settling - +! +! !INTERFACE: +! + + subroutine Chem_Settling ( i1, i2, j1, j2, km, nbeg, nend, nbins, flag, & + radiusInp, rhopInp, cdt, w_c, tmpu, rhoa, & + hsurf, hghte, fluxout, rc, & + vsettleOut, correctionMaring ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km, nbeg, nend, nbins + integer, intent(in) :: flag ! flag to control particle swelling (see note) + real, intent(in) :: cdt + real, pointer, dimension(:) :: radiusInp, rhopInp + real, pointer, dimension(:,:) :: hsurf + real, pointer, dimension(:,:,:) :: tmpu, rhoa, hghte + +! !OUTPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + type(Chem_Array), pointer :: fluxout(:) ! Mass lost by settling + ! to surface, kg/m2/s + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - +! Optionally output the settling velocity calculated + type(Chem_Array), pointer, optional, dimension(:) :: vsettleOut + +! Optionally correct the settling velocity following Maring et al, 2003 + logical, optional, intent(in) :: correctionMaring + + character(len=*), parameter :: myname = 'Settling' + +! !DESCRIPTION: Gravitational settling of aerosol between vertical +! layers. Assumes input radius in [m] and density (rhop) +! in [kg m-3]. If flag is set, use the Fitzgerald 1975 (flag = 1) +! or Gerber 1985 (flag = 2) parameterization to update the +! particle radius for the calculation (local variables radius +! and rhop). +! +! !REVISION HISTORY: +! +! 17Sep2004 Colarco Strengthen sedimentation flux out at surface +! by setting removal to be valid from middle of +! surface layer +! 06Nov2003 Colarco Based on Ginoux +! 23Jan2003 da Silva Standardization +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k, iit, n + real, parameter :: rhow = 1000. ! Density of water [kg m-3] + real :: vsettle(i1:i2,j1:j2,km) ! fall speed [m s-1] + real*8 :: cmass_before(i1:i2,j1:j2) + real*8 :: cmass_after(i1:i2,j1:j2) + real :: diff_coef ! Brownian diffusion coefficient [m2 s-1] + real*8 :: qdel(i1:i2,j1:j2), qsrc(i1:i2,j1:j2), dp(i1:i2,j1:j2), dpm1(i1:i2,j1:j2) + real :: dz(i1:i2,j1:j2,km) ! layer thickness [m] + real*8 :: dzd(i1:i2,j1:j2,km), vsd(i1:i2,j1:j2,km), qa(i1:i2,j1:j2,km) + +! The following parameters relate to the swelling of seasalt like particles +! following Fitzgerald, Journal of Applied Meteorology, 1975. + real, parameter :: epsilon = 1. ! soluble fraction of deliqeuscing particle + real, parameter :: alphaNaCl = 1.35 + real :: alpha, alpha1, alpharat, beta, theta, f1, f2 + +! parameter from Gerber 1985 (units require radius in cm, see rcm) + real :: rcm + real, parameter :: c1=0.7674, c2=3.079, c3=2.573e-11, c4=-1.424 +! parameters for ammonium sulfate + real, parameter :: SU_c1=0.4809, SU_c2=3.082, SU_c3=3.110e-11, SU_c4=-1.428 + + +! parameters from Maring et al, 2003 + real, parameter :: v_upwardMaring = 0.33e-2 ! upward velocity, [m s-1] + real, parameter :: diameterMaring = 7.30e-6 ! particle diameter, [m] + +! + real :: sat, rrat + real :: radius, rhop ! particle radius and density passed to + ! fall velocity calculation + real :: minTime, qmin, qmax + integer :: nSubSteps, dk, ijl + real*8 :: dt_settle, g + + _UNUSED_DUMMY(nend) + rc = 0 + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + g = grav + +! Handle the fact that hghte may be in the range [1,km+1] or [0,km] +! ----------------------------------------------------------------- + dk = lbound(hghte,3) - 1 ! This is either 0 or 1 + +! Layer thickness from hydrostatic equation + k = km + dz(:,:,k) = hghte(:,:,k+dk)-hsurf(:,:) + do k = km-1, 1, -1 + dz(:,:,k) = hghte(:,:,k+dk) - hghte(:,:,k+dk+1) + enddo + dzd = dz + +! Loop over the number of dust bins + do n = 1, nbins + + qa = w_c%qa(nbeg+n-1)%data3d + + radius = radiusInp(n) + rhop = rhopInp(n) + +! Reset a (large) minimum time to cross a grid cell in settling + minTime = cdt + + if( associated(fluxout(n)%data2d) ) fluxout(n)%data2d(i1:i2,j1:j2) = 0.0 + cmass_before(:,:) = 0.d0 + cmass_after(:,:) = 0.d0 + +! If radius le 0 then get out of loop + if(radius .le. 0.) cycle + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + +! Find the column dry mass before sedimentation + cmass_before(i,j) = cmass_before(i,j) + qa(i,j,k)/g * w_c%delp(i,j,k) + +! Adjust the particle size for relative humidity effects + sat = max(w_c%rh(i,j,k),tiny(1.0)) ! to avoid zero FPE + +! Fitzgerald + if(flag .eq. 1 .and. sat .ge. 0.80) then +! parameterization blows up for RH > 0.995, so set that as max +! rh needs to be scaled 0 - 1 + sat = min(0.995,sat) +! Calculate the alpha and beta parameters for the wet particle +! relative to amonium sulfate + beta = exp( (0.00077*sat) / (1.009-sat) ) + if(sat .le. 0.97) then + theta = 1.058 + else + theta = 1.058 - (0.0155*(sat-0.97)) /(1.02-sat**1.4) + endif + alpha1 = 1.2*exp( (0.066*sat) / (theta-sat) ) + f1 = 10.2 - 23.7*sat + 14.5*sat**2. + f2 = -6.7 + 15.5*sat - 9.2*sat**2. + alpharat = 1. - f1*(1.-epsilon) - f2*(1.-epsilon**2.) + alpha = alphaNaCl * (alpha1*alpharat) +! radius is the radius of the wet particle + radius = alpha * radiusInp(n)**beta + rrat = (radiusInp(n)/radius)**3. + rhop = rrat*rhopInp(n) + (1.-rrat)*rhow + elseif(flag .eq. 2) then ! Gerber + sat = min(0.995,sat) + rcm = radiusInp(n)*100. + radius = 0.01 * ( c1*rcm**c2 / (c3*rcm**c4-alog10(sat)) & + + rcm**3.)**(1./3.) + rrat = (radiusInp(n)/radius)**3. + rhop = rrat*rhopInp(n) + (1.-rrat)*rhow + elseif(flag .eq. 3) then +! Gerber parameterization for Ammonium Sulfate + sat = min(0.995,sat) + rcm = radiusInp(n)*100. + radius = 0.01 * ( SU_c1*rcm**SU_c2 / (SU_c3*rcm**SU_c4-alog10(sat)) & + + rcm**3.)**(1./3.) + rrat = (radiusInp(n)/radius)**3. + rhop = rrat*rhopInp(n) + (1.-rrat)*rhow + elseif(flag .eq. 4) then +! Petters and Kreidenweis (ACP2007) parameterization + sat = min(0.99,sat) + radius = (radiusInp(n)**3 * (1+1.19*sat/(1-sat)))**(1./3.) + rrat = (radiusInp(n)/radius)**3 + rhop = rrat*rhopInp(n) + (1.-rrat)*rhow + endif + +! Calculate the settling velocity + call Chem_CalcVsettle(radius, rhop, rhoa(i,j,k), & + tmpu(i,j,k), diff_coef, vsettle(i,j,k)) + end do + end do + end do + + if(present(correctionMaring)) then + if ((correctionMaring) .and. (radiusInp(n) .le. (0.5*diameterMaring))) then + vsettle = max(1.0e-9, vsettle - v_upwardMaring) + endif + endif + + vsd = vsettle + + if(present(vsettleOut)) then + vsettleOut(n)%data3d = vsettle + endif + +! Determine global max/min time to cross grid cell + call pmaxmin ( 'Chem_Settling: dt', dz(i1:i2,j1:j2,1:km)/vsettle(i1:i2,j1:j2,1:km), & + qmin, qmax, ijl, km, 0. ) + minTime = min(minTime,qmin) + + +! Now, how many iterations do we need to do? + if ( minTime < 0 ) then + nSubSteps = 0 + call mpout_log(myname,'no Settling because minTime = ', minTime ) + else if(minTime .ge. cdt) then + nSubSteps = 1 + dt_settle = cdt + else + nSubSteps = cdt/minTime+1 + dt_settle = cdt/nSubSteps + endif + +! Loop over sub-timestep + do iit = 1, nSubSteps + +! Try a simple forward Euler scheme + + qdel = qa(i1:i2,j1:j2,1)*dt_settle*vsd(i1:i2,j1:j2,1)/dzd(i1:i2,j1:j2,1) + qa(i1:i2,j1:j2,1) = qa(i1:i2,j1:j2,1) - qdel + + do k = 2, km + dp = w_c%delp(i1:i2,j1:j2,k) + dpm1 = w_c%delp(i1:i2,j1:j2,k-1) + qsrc = qdel * dpm1 / dp + qdel = qa(i1:i2,j1:j2,k)*dt_settle*vsd(i1:i2,j1:j2,k)/dzd(i1:i2,j1:j2,k) + qa(i1:i2,j1:j2,k) = qa(i1:i2,j1:j2,k) - qdel + qsrc + enddo + +! An alternative accumulator approach to computing the outgoing flux +! if( associated(fluxout(n)%data2d) ) then +! fluxout(n)%data2d = fluxout(n)%data2d + qdel * pdog/grav / dt_settle +! endif + + end do ! iit + +! Find the column dry mass after sedimentation and thus the loss flux + do k = 1, km + do j = j1, j2 + do i = i1, i2 + cmass_after(i,j) = cmass_after(i,j) + qa(i,j,k)/ g * w_c%delp(i,j,k) + enddo + enddo + enddo + + if( associated(fluxout(n)%data2d) ) then + fluxout(n)%data2d(i1:i2,j1:j2) & + = (cmass_before(i1:i2,j1:j2) - cmass_after(i1:i2,j1:j2))/cdt + endif + + w_c%qa(nbeg+n-1)%data3d = qa + + end do ! n + + end subroutine Chem_Settling + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_SettlingSimple - support for single bin settling call +! +! !INTERFACE: +! + + subroutine Chem_SettlingSimple ( i1, i2, j1, j2, km, ibin, flag, & + radiusInp, rhopInp, cdt, w_c, tmpu, rhoa, & + hsurf, hghte, fluxout, rc, & + vsettleOut, correctionMaring ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km, ibin + integer, intent(in) :: flag ! flag to control particle swelling (see note) + real, intent(in) :: cdt, radiusInp, rhopInp + real, pointer, dimension(:,:) :: hsurf + real, pointer, dimension(:,:,:) :: tmpu, rhoa, hghte + +! !OUTPUT PARAMETERS: + + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields + type(Chem_Array), pointer :: fluxout ! Mass lost by settling + ! to surface, kg/m2/s + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - +! Optionally output the settling velocity calculated + type(Chem_Array), pointer, optional :: vsettleOut + +! Optionally correct the settling velocity following Maring et al, 2003 + logical, optional, intent(in) :: correctionMaring + + character(len=*), parameter :: myname = 'Settling' + +! !DESCRIPTION: Gravitational settling of aerosol between vertical +! layers. Assumes input radius in [m] and density (rhop) +! in [kg m-3]. If flag is set, use the Fitzgerald 1975 (flag = 1) +! or Gerber 1985 (flag = 2) parameterization to update the +! particle radius for the calculation (local variables radius +! and rhop). +! +! !REVISION HISTORY: +! +! 17Sep2004 Colarco Strengthen sedimentation flux out at surface +! by setting removal to be valid from middle of +! surface layer +! 06Nov2003 Colarco Based on Ginoux +! 23Jan2003 da Silva Standardization +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k, iit + real, parameter :: rhow = 1000. ! Density of water [kg m-3] + real :: vsettle(i1:i2,j1:j2,km) ! fall speed [m s-1] + real*8 :: cmass_before(i1:i2,j1:j2) + real*8 :: cmass_after(i1:i2,j1:j2) + real :: diff_coef ! Brownian diffusion coefficient [m2 s-1] + real*8 :: qdel(i1:i2,j1:j2), qsrc(i1:i2,j1:j2), dp(i1:i2,j1:j2), dpm1(i1:i2,j1:j2) + real :: dz(i1:i2,j1:j2,km) ! layer thickness [m] + real*8 :: dzd(i1:i2,j1:j2,km), vsd(i1:i2,j1:j2,km), qa(i1:i2,j1:j2,km) + +! The following parameters relate to the swelling of seasalt like particles +! following Fitzgerald, Journal of Applied Meteorology, 1975. + real, parameter :: epsilon = 1. ! soluble fraction of deliqeuscing particle + real, parameter :: alphaNaCl = 1.35 + real :: alpha, alpha1, alpharat, beta, theta, f1, f2 + +! parameter from Gerber 1985 (units require radius in cm, see rcm) + real :: rcm + real, parameter :: c1=0.7674, c2=3.079, c3=2.573e-11, c4=-1.424 +! parameters for ammonium sulfate + real, parameter :: SU_c1=0.4809, SU_c2=3.082, SU_c3=3.110e-11, SU_c4=-1.428 + + +! parameters from Maring et al, 2003 + real, parameter :: v_upwardMaring = 0.33e-2 ! upward velocity, [m s-1] + real, parameter :: diameterMaring = 7.30e-6 ! particle diameter, [m] + +! + real :: sat, rrat + real :: radius, rhop ! particle radius and density passed to + ! fall velocity calculation + real :: minTime, qmin, qmax + integer :: nSubSteps, dk, ijl + real*8 :: dt_settle, g + + rc = 0 + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + g = grav + +! Handle the fact that hghte may be in the range [1,km+1] or [0,km] +! ----------------------------------------------------------------- + dk = lbound(hghte,3) - 1 ! This is either 0 or 1 + +! Layer thickness from hydrostatic equation + k = km + dz(:,:,k) = hghte(:,:,k+dk)-hsurf(:,:) + do k = km-1, 1, -1 + dz(:,:,k) = hghte(:,:,k+dk) - hghte(:,:,k+dk+1) + enddo + dzd = dz + + qa = w_c%qa(ibin)%data3d + + radius = radiusInp + rhop = rhopInp + +! Reset a (large) minimum time to cross a grid cell in settling + minTime = cdt + + if( associated(fluxout%data2d) ) fluxout%data2d(i1:i2,j1:j2) = 0.0 + cmass_before(:,:) = 0.d0 + cmass_after(:,:) = 0.d0 + +! If radius le 0 then get out of loop + if(radius .le. 0.) return + + do k = 1, km + do j = j1, j2 + do i = i1, i2 + +! Find the column dry mass before sedimentation + cmass_before(i,j) = cmass_before(i,j) + qa(i,j,k)/g * w_c%delp(i,j,k) + +! Adjust the particle size for relative humidity effects + sat = max(w_c%rh(i,j,k),tiny(1.0)) ! to avoid zero FPE + +! Fitzgerald + if(flag .eq. 1 .and. sat .ge. 0.80) then +! parameterization blows up for RH > 0.995, so set that as max +! rh needs to be scaled 0 - 1 + sat = min(0.995,sat) +! Calculate the alpha and beta parameters for the wet particle +! relative to amonium sulfate + beta = exp( (0.00077*sat) / (1.009-sat) ) + if(sat .le. 0.97) then + theta = 1.058 + else + theta = 1.058 - (0.0155*(sat-0.97)) /(1.02-sat**1.4) + endif + alpha1 = 1.2*exp( (0.066*sat) / (theta-sat) ) + f1 = 10.2 - 23.7*sat + 14.5*sat**2. + f2 = -6.7 + 15.5*sat - 9.2*sat**2. + alpharat = 1. - f1*(1.-epsilon) - f2*(1.-epsilon**2.) + alpha = alphaNaCl * (alpha1*alpharat) +! radius is the radius of the wet particle + radius = alpha * radiusInp**beta + rrat = (radiusInp/radius)**3. + rhop = rrat*rhopInp + (1.-rrat)*rhow + elseif(flag .eq. 2) then ! Gerber + sat = min(0.995,sat) + rcm = radiusInp*100. + radius = 0.01 * ( c1*rcm**c2 / (c3*rcm**c4-alog10(sat)) & + + rcm**3.)**(1./3.) + rrat = (radiusInp/radius)**3. + rhop = rrat*rhopInp + (1.-rrat)*rhow + elseif(flag .eq. 3) then +! Gerber parameterization for Ammonium Sulfate + sat = min(0.995,sat) + rcm = radiusInp*100. + radius = 0.01 * ( SU_c1*rcm**SU_c2 / (SU_c3*rcm**SU_c4-alog10(sat)) & + + rcm**3.)**(1./3.) + rrat = (radiusInp/radius)**3. + rhop = rrat*rhopInp + (1.-rrat)*rhow + elseif(flag .eq. 4) then +! Petters and Kreidenweis (ACP2007) parameterization + sat = min(0.99,sat) + radius = (radiusInp**3 * (1+1.19*sat/(1-sat)))**(1./3.) + rrat = (radiusInp/radius)**3 + rhop = rrat*rhopInp + (1.-rrat)*rhow + endif + +! Calculate the settling velocity + call Chem_CalcVsettle(radius, rhop, rhoa(i,j,k), & + tmpu(i,j,k), diff_coef, vsettle(i,j,k)) + end do + end do + end do + + if(present(correctionMaring)) then + if ((correctionMaring) .and. (radiusInp .le. (0.5*diameterMaring))) then + vsettle = max(1.0e-9, vsettle - v_upwardMaring) + endif + endif + + vsd = vsettle + + if(present(vsettleOut)) then + if(associated(vsettleOut%data3d)) vsettleOut%data3d = vsettle + endif + +! Determine global max/min time to cross grid cell + call pmaxmin ( 'Chem_Settling: dt', dz(i1:i2,j1:j2,1:km)/vsettle(i1:i2,j1:j2,1:km), & + qmin, qmax, ijl, km, 0. ) + minTime = min(minTime,qmin) + + +! Now, how many iterations do we need to do? + if ( minTime < 0 ) then + nSubSteps = 0 + call mpout_log(myname,'no Settling because minTime = ', minTime ) + else if(minTime .ge. cdt) then + nSubSteps = 1 + dt_settle = cdt + else + nSubSteps = cdt/minTime+1 + dt_settle = cdt/nSubSteps + endif + +! Loop over sub-timestep + do iit = 1, nSubSteps + +! Try a simple forward Euler scheme + + qdel = qa(i1:i2,j1:j2,1)*dt_settle*vsd(i1:i2,j1:j2,1)/dzd(i1:i2,j1:j2,1) + qa(i1:i2,j1:j2,1) = qa(i1:i2,j1:j2,1) - qdel + + do k = 2, km + dp = w_c%delp(i1:i2,j1:j2,k) + dpm1 = w_c%delp(i1:i2,j1:j2,k-1) + qsrc = qdel * dpm1 / dp + qdel = qa(i1:i2,j1:j2,k)*dt_settle*vsd(i1:i2,j1:j2,k)/dzd(i1:i2,j1:j2,k) + qa(i1:i2,j1:j2,k) = qa(i1:i2,j1:j2,k) - qdel + qsrc + enddo + + end do ! iit + +! Find the column dry mass after sedimentation and thus the loss flux + do k = 1, km + do j = j1, j2 + do i = i1, i2 + cmass_after(i,j) = cmass_after(i,j) + qa(i,j,k)/ g * w_c%delp(i,j,k) + enddo + enddo + enddo + + if( associated(fluxout%data2d) ) then + fluxout%data2d(i1:i2,j1:j2) & + = (cmass_before(i1:i2,j1:j2) - cmass_after(i1:i2,j1:j2))/cdt + endif + + w_c%qa(ibin)%data3d = qa + + end subroutine Chem_SettlingSimple + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_CalcVsettle - Calculate the aerosol settling velocity +! +! !INTERFACE: +! + + subroutine Chem_CalcVsettle ( radius, rhop, rhoa, tmpu, & + diff_coef, vsettle ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + real, intent(in) :: radius ! Particle radius [m] + real, intent(in) :: rhop ! Particle density [kg m-3] + real, intent(in) :: rhoa ! Layer air density [kg m-3] + real, intent(in) :: tmpu ! Layer temperature [K] + +! !OUTPUT PARAMETERS: + + real, intent(out) :: diff_coef ! Brownian diffusion + ! coefficient [m2 s-1] + real, intent(out) :: vsettle ! Layer fall speed [m s-1] + + character(len=*), parameter :: myname = 'Vsettle' + +! !DESCRIPTION: Calculates the aerosol settling velocity and Brownian diffusion +! coefficient +! Follows discussions in Seinfeld and Pandis, Pruppacher and +! Klett, and the coding in CARMA (Toon et al., 1988) +! Should work satisfactorily for al reasonable sized aerosols +! (up to Reynolds number 300) +! +! !REVISION HISTORY: +! +! 06Nov2003 Colarco Initial version. +! 23Jan2003 da Silva Standardization +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + real*8 rmu ! Dynamic viscosity [kg m-1 s-1] + real*8 vt ! Thermal velocity of air molecule [m s-1] + real*8 rmfp ! Air molecule mean free path [m] + real*8 bpm ! Cunningham slip correction factor + real*8 rkn ! Knudsen number + real*8 re, x, y ! reynold's number and parameters + real, parameter :: kb = 1.3807e-23 ! Boltzmann constant [kg m2 s-1 K-1 mol-1] + real, parameter :: m_air = 4.8096e-26 ! Mass of air molecule [kg] + real, parameter :: pi = 3.141529265 + +! Dynamic viscosity from corrected Sutherland's Equation + rmu = 1.8325e-5*(416.16/(tmpu+120.))*(tmpu/296.16)**1.5 + +! Thermal velocity of air molecule + vt = sqrt(8.*kb*tmpu/pi/m_air) + +! Air molecule mean free path + rmfp = 2.*rmu/rhoa/vt + +! Knudsen number + rkn = rmfp/radius + +! Cunningham slip correction factor + bpm = 1. + 1.246*rkn + 0.42*rkn*exp(-0.87/rkn) + +! Brownian diffusion coefficient + diff_coef = kb*tmpu*bpm/3./pi/rmu/(2.*radius) + +! Fall speed (assumes Reynolds # < 0.01) + vsettle = 2./9.*rhop*radius**2.*grav*bpm/rmu + +! Check the Reynold's number to see if we need a drag correction +! First guess at Reynold's number using Stoke's calculation + re = 2.*rhoa*radius*vsettle/rmu + +! If Re > 0.01 then apply drag correction following Pruppacher and +! Klett regime 2 (eq. 10-142). Assuming reasonable aerosols we +! do not consider that particle Re may exceed 300. + if(re .gt. 0.01) then + x = log(24.*re/bpm) + y = -3.18657 + 0.992696 *x - .00153193 *x**2. & + - 0.000987059*x**3. - .000578878 *x**4. & + + 8.55176E-05*x**5. - 3.27815E-06*x**6. + re = exp(y)*bpm + vsettle = rmu*re/2./rhoa/radius + endif + + + end subroutine Chem_CalcVsettle + + end module Chem_SettlingMod diff --git a/ESMF/Shared/Chem_Shared/Chem_StateMod.F90 b/ESMF/Shared/Chem_Shared/Chem_StateMod.F90 new file mode 100644 index 00000000..3afb8357 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/Chem_StateMod.F90 @@ -0,0 +1,230 @@ +#include "unused_dummy.H" +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_StateMod --- Replacement for Chem_State under ESMF +! +! !INTERFACE: +! + + module Chem_StateMod + +! !USES: + + use ESMF + use ESMFL_Mod, only: ESMFL_StateGetPointerToData + + use Chem_Mod ! Chemistry Base Class + use mod_diag ! fvGCM diagnostics + use m_die + implicit NONE + +! +! !PUBLIIC MEMBER FUNCTIONS: +! + + PUBLIC Chem_StateSetNeeded + PUBLIC Chem_StateGetArray2D + PUBLIC Chem_StateGetArray3D + +! +! !DESCRIPTION: +! +! This module provides a few methods for managing data arrays from an +! ESMF state. This is a replacing for the orifinal, pre-ESMF, Chem_State +! class. +! +! !REVISION HISTORY: +! +! 27Feb2005 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + integer, parameter :: XY = 2, XYZ = 3 ! all that is needed for now + +! Holds GEOS-4 variable catalogue (not instantiable by definition) +! --------------------------------------------------------------- + logical :: diaglist_init = .false. + type(diag_type), save :: diag(pdiag) + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_StateSetNeeded - Activate/deactivate fields in State +! +! !INTERFACE: +! + + subroutine Chem_StateSetNeeded ( This, which, needed, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: This ! Import State for Chem_GridComp + +! !INPUT PARAMETERS: + + integer, intent(in) :: which ! which field to activate/deactivate + logical, intent(in) :: needed ! whether it is needed or not + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine set a field as needed or not. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + +! +! Nothing to do in GEOS-5 +! + _UNUSED_DUMMY(this) + _UNUSED_DUMMY(which) + _UNUSED_DUMMY(needed) + + rc = 0 + + end subroutine Chem_StateSetNeeded + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_StateGetArray2D +! +! !INTERFACE: +! + + subroutine Chem_StateGetArray2D ( This, which, array, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: This ! Import State for Chem_GridComp + +! !INPUT PARAMETERS: + + integer, intent(in) :: which ! which field to activate/deactivate + +! !OUTPUT PARAMETERS: + + real, pointer :: array(:,:) + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine assign a pointer to a 2D array in the state. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=80) :: vname + + call GetVarName_ ( which, vname ) + + call ESMFL_StateGetPointerToData ( This, array, vname) + rc =0 + + + end subroutine Chem_StateGetArray2D + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_StateGetArray3D +! +! !INTERFACE: +! + + subroutine Chem_StateGetArray3D ( This, which, array, rc ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + type(ESMF_State), intent(inout) :: This ! Import State for Chem_GridComp + +! !INPUT PARAMETERS: + + integer, intent(in) :: which ! which field to activate/deactivate + +! !OUTPUT PARAMETERS: + + real, pointer :: array(:,:,:) + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: This routine assign a pointer to a 3D array in the state. +! +! !REVISION HISTORY: +! +! 18Sep2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + character(len=80) :: vname + + call GetVarName_ ( which, vname ) + + call ESMFL_StateGetPointerToData ( This, array, vname) + rc =0 + if (which == iAIRDENS) array = 1.2 ! THIS is ugly and VERY WRONG!!!! + + end subroutine Chem_StateGetArray3D + +!.................. private auxiliary routines ................. + + subroutine GetVarName_ ( which, vname ) + + implicit NONE + integer, intent(in) :: which + character(len=80), intent(out) :: vname + +! Make sure GEOS-4 catalogue is initialized +! ----------------------------------------- + if ( .not. diaglist_init ) then + call diaglist ( diag ) + end if + + if ( which < 1 .OR. which > pdiag ) & + call die ( 'Chem_stateMod::GetVarName_', 'invalid variable index' ) + + vname = trim ( diag(which)%name ) + + end subroutine GetVarName_ + + + end module Chem_StateMod + diff --git a/ESMF/Shared/Chem_Shared/Chem_UtilMod.F90 b/ESMF/Shared/Chem_Shared/Chem_UtilMod.F90 new file mode 100644 index 00000000..e9b30ec1 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/Chem_UtilMod.F90 @@ -0,0 +1,1557 @@ +#include "MAPL_Generic.h" +#include "unused_dummy.H" +#if 0 +#define min(x,y) amin(real(x),real(y)) +#define MIN(x,y) AMIN(real(x),real(y)) +#define max(x,y) amax(real(x),real(y)) +#define MAX(x,y) AMAX(real(x),real(y)) +#endif + +#define DEALOC_(A) if(associated(A)) then; A=0; call MAPL_DeAllocNodeArray(A,rc=STATUS); if(STATUS==MAPL_NoShm) deallocate(A, stat=STATUS); VERIFY_(STATUS); NULLIFY(A); endif + +#define DEALOC2_(A) if(associated(A)) then; deallocate(A, stat=STATUS); VERIFY_(STATUS); NULLIFY(A); endif + +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_UtilMod --- Assorted Utilities for fvChem +! +! !INTERFACE: +! + + module Chem_UtilMod + +! !USES: + + use ESMF + use MAPL + + use Chem_Mod ! Chemistry Base Class + use mod_diag ! fvGCM diagnostics + use m_die + use m_StrTemplate ! string templates + use m_chars, only: uppercase + + implicit NONE + +! +! !PUBLIIC MEMBER FUNCTIONS: +! + + PRIVATE + PUBLIC Chem_UtilNegFiller ! Fills negative values in a column + PUBLIC Chem_UtilTroppFixer ! Repairs tropopause pressure bad values + PUBLIC Chem_UtilGetTimeInfo ! Time info on file + PUBLIC Chem_UtilExtractIntegers ! Extract integers from a character-delimited string + PUBLIC Chem_BiomassDiurnal ! Biomass burning diurnal cycle + PUBLIC Chem_UtilResVal ! Finds resolution dependent value that corresponds + ! to the model resolution + PUBLIC Chem_UtilIdow ! Integer day of the week: Sun=1, Mon=2, etc. + PUBLIC Chem_UtilCdow ! String day of the week: 'Sun', 'Mon', etc. + + PUBLIC Chem_UtilPointEmissions ! From a provided list returns a table of + ! pointwise emissions (e.g., for volcanoes + ! or wildfires) + + PUBLIC tick ! GEOS-4 stub + PUBLIC mcalday ! GEOS-4 stub + PUBLIC pmaxmin ! functional + PUBLIC zenith ! GEOS-4 stub + +! +! !DESCRIPTION: +! +! This module implements assorted odds & ends for fvChem. +! +! !REVISION HISTORY: +! +! 29oct2003 da Silva First crack. +! 16aug2005 da Silva Introduced scatter from MAPL_CommsMod. +! +!EOP +!------------------------------------------------------------------------- + + interface pmaxmin + module procedure pmaxmin2d + module procedure pmaxmin3d + end interface + +CONTAINS + +#ifdef USE_MAPL_MPREAD + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_UtilMPread --- Reads fields from file and distribute +! +! !INTERFACE: +! + subroutine Chem_UtilMPread_g5 ( filen, varn, nymd, nhms, & + i1, i2, ig, im, j1, j2, jg, jm, km, & + var2d, var3d, cyclic, grid ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + character(len=*), intent(in) :: filen ! GFIO compatible file name + character(len=*), intent(in) :: varn ! variable name + integer, intent(in) :: nymd, nhms ! date/time + + ! Distributed grid info: + integer, intent(in) :: i1, i2 ! local zonal indices + integer, intent(in) :: ig ! zonal ghosting + integer, intent(in) :: im ! global zonal dimension + integer, intent(in) :: j1, j2 ! local meridional indices + integer, intent(in) :: jg ! meridional ghosting + integer, intent(in) :: jm ! global zonal dimension + integer, intent(in) :: km ! vertical dimension + + logical, OPTIONAL, intent(in) :: cyclic ! whether time dimension is periodic + + ! ESMF Grid; this is required + ! in GEOS-5 under ESMF + type(ESMF_Grid), OPTIONAL, intent(in) :: grid + +! !OUTPUT PARAMETERS: + + real, OPTIONAL, intent(out), target :: var2d(i1-ig:i2+ig,j1-jg:j2+jg) + real, OPTIONAL, intent(out), target :: var3d(i1-ig:i2+ig,j1-jg:j2+jg,km) + +! !DESCRIPTION: +! +! !REVISION HISTORY: +! +! 15Aug2006 da Silva It is now a simple wrap around CFIOReadArray(). +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: Iam = 'Chem_UtilMPread_g5' + type(ESMF_TIME) :: time + integer :: yy, mm, dd, h, m, s, rc, STATUS + + real, pointer :: ptr2(:,:), ptr3(:,:,:) + + +! Convert time to ESMF format +! --------------------------- + call parseIntTime_ ( nymd, yy, mm, dd ) + call parseIntTime_ ( nhms, h, m, s ) + call ESMF_TimeSet(time, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, rc=status ) + if ( status /= 0 ) call die(Iam,'failed to convert time') + +! Read either 2D or 3D array +! -------------------------- + if ( .not. present(grid) ) & + call die ( Iam,'when running under the ESMF "grid" must be specified' ) + + if ( present(var2d) ) then + + ptr2 => var2d + call MAPL_CFIORead ( varn, filen, time, grid, ptr2, rc=STATUS, & + verbose = .true., time_is_cyclic=cyclic, & + time_interp = .true. ) + + else if ( present(var3d) ) then + + ptr3 => var3d + call MAPL_CFIORead ( varn, filen, time, grid, ptr3, rc=STATUS, & + verbose = .true., time_is_cyclic=cyclic, & + time_interp = .true. ) + + else + + call die ( Iam,'either "var2d" or "var3d" must be specified' ) + + end if + + if ( status /= 0 ) call die(Iam,'cannot read '//trim(varn)) + + +CONTAINS + subroutine parseIntTime_ ( hhmmss, hour, min, sec ) + integer, intent(in) :: hhmmss + integer, intent(out) :: hour, min, sec + hour = hhmmss / 10000 + min = mod(hhmmss,10000)/100 + sec = mod(hhmmss,100) + end subroutine parseIntTime_ + + end subroutine Chem_UtilMPread_g5 + +#endif + + +subroutine Chem_UtilGetTimeInfo ( fname, begDate, begTime, nTimes, incSecs ) + + implicit NONE + character(len=*), intent(in) :: fname ! GFIO/CFIO filename + integer, intent(out) :: begDate, begTime ! initial time/date on file + ! given as YYYYMMDD and HHMMSS + integer, intent(out) :: nTimes ! number of time steps on file + integer, intent(out) :: incSecs ! time steps in seconds + + + integer :: READ_ONLY=1 + integer :: fid, rc, im,jm,km,nvars,ngatts + character(len=*), parameter :: myname = 'Chem_UtilGetTimeInfo' + +! Special case +! ----------- + if ( fname(1:9) == '/dev/null' ) then + begDate=0; begTime=0; nTimes=0; incSecs=0 + return + end if + +! Open file +! --------- + call GFIO_Open ( fname, READ_ONLY, fid, rc ) + if ( rc /= 0 ) call die(myname, 'Unable to open '// trim(fname)) + if ( rc .ne. 0 ) then + begDate=-1; begTime=-1; nTimes=-1; incSecs=-1 + return + endif + +! Get dimension sizes +! ------------------- + call GFIO_DimInquire (fid,im,jm,km,nTimes,nvars,ngatts,rc) + if ( rc /= 0 ) call die(myname, 'Unable to inquire about dimension sizes for file '// trim(fname)) + if ( rc .ne. 0 ) then + begDate=-1; begTime=-1; nTimes=-1; incSecs=-1 + return + endif + +! Get initial time/timestep +! ------------------------- + call GetBegDateTime ( fid, begDate, begTime, incSecs, rc ) + if ( rc .ne. 0 ) then + begDate=-1; begTime=-1; nTimes=-1; incSecs=-1 + return + endif + + call GFIO_close(fid,rc) + +end subroutine Chem_UtilGetTimeInfo + +!............................... geos4 stubs .......................... + +! Parallelized utility routine for computing/printing +! max/min of an input array +! + subroutine pmaxmin3d ( qname, a, pmin, pmax, im, jt, fac ) + implicit none + character*(*) qname + integer im, jt + real :: a(:,:,:) + real pmax, pmin + real fac ! multiplication factor + call pmaxmin2d ( qname, reshape(a,(/ im, jt /)), & + pmin, pmax, im, jt, fac ) + + end subroutine pmaxmin3d + + subroutine pmaxmin2d ( qname, a, pmin, pmax, im, jt, fac ) + + implicit none + + character*(*) qname + integer im, jt + real a(im,jt) + real pmax, pmin + real fac ! multiplication factor + + integer :: i, j, two=2 + + real qmin(jt), qmax(jt) + real pm1(2) + real pm_res(2) + type(ESMF_VM) :: vm + + character(len=32) :: name + integer :: status + + + call ESMF_VmGetCurrent(vm=vm, rc=status) +!$omp parallel do private(i, j, pmax, pmin) + + do j=1,jt + pmax = a(1,j) + pmin = a(1,j) + do i=2,im + pmax = max(pmax, a(i,j)) + pmin = min(pmin, a(i,j)) + enddo + qmax(j) = pmax + qmin(j) = pmin + enddo +! +! Now find max/min of amax/amin +! + pmax = qmax(1) + pmin = qmin(1) + do j=2,jt + pmax = max(pmax, qmax(j)) + pmin = min(pmin, qmin(j)) + enddo + + pm1(1) = pmax + pm1(2) = -pmin + call MAPL_CommsAllReduceMax(vm, sendbuf=pm1, recvbuf=pm_res, cnt=two, RC=status) + pmax=pm_res(1) + pmin=-pm_res(2) + + if ( fac /= 0.0 ) then ! trick to prevent printing + if ( MAPL_am_I_root() ) then + name = ' ' + name(1:len(qname)) = qname + write(*,*) name, ' max = ', pmax*fac, ' min = ', pmin*fac + return + end if + end if + + return + + end subroutine pmaxmin2d + + + function leap_year(ny) +! +! Determine if year ny is a leap year +! +! Author: S.-J. Lin + implicit none + logical leap_year + integer ny + integer ny00 + +! +! No leap years prior to 0000 +! + parameter ( ny00 = 0000 ) ! The threshold for starting leap-year + + if( ny >= ny00 ) then + if( mod(ny,100) == 0. .and. mod(ny,400) == 0. ) then + leap_year = .true. + elseif( mod(ny,4) == 0. .and. mod(ny,100) /= 0. ) then + leap_year = .true. + else + leap_year = .false. + endif + else + leap_year = .false. + endif + + return + end function leap_year + + + integer FUNCTION INCYMD (NYMD,M) + +! PURPOSE +! INCYMD: NYMD CHANGED BY ONE DAY +! MODYMD: NYMD CONVERTED TO JULIAN DATE +! DESCRIPTION OF PARAMETERS +! NYMD CURRENT DATE IN YYMMDD FORMAT +! M +/- 1 (DAY ADJUSTMENT) + + integer nymd, m, ny, nm, nd + + INTEGER NDPM(12) + DATA NDPM /31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/ +!!! logical leap_year + + NY = NYMD / 10000 + NM = MOD(NYMD,10000) / 100 + ND = MOD(NYMD,100) + M + + IF (ND.EQ.0) THEN + NM = NM - 1 + IF (NM.EQ.0) THEN + NM = 12 + NY = NY - 1 + ENDIF + ND = NDPM(NM) + IF (NM.EQ.2 .AND. leap_year(NY)) ND = 29 + ENDIF + + IF (ND.EQ.29 .AND. NM.EQ.2 .AND. leap_year(ny)) GO TO 20 + + IF (ND.GT.NDPM(NM)) THEN + ND = 1 + NM = NM + 1 + IF (NM.GT.12) THEN + NM = 1 + NY = NY + 1 + ENDIF + ENDIF + + 20 CONTINUE + INCYMD = NY*10000 + NM*100 + ND + RETURN + END FUNCTION INCYMD + + subroutine tick (nymd, nhms, ndt) + +! Input: + integer ndt ! TIME-STEP +! Inpuit/Output: + integer nymd ! CURRENT YYYYMMDD + integer nhms ! CURRENT HHMMSS +!!! integer incymd + +! Revision: S.-J. Lin Mar 2000 + integer nsecf, nhmsf, n, nsec + + NSECF(N) = N/10000*3600 + MOD(N,10000)/100* 60 + MOD(N,100) + NHMSF(N) = N/3600*10000 + MOD(N,3600 )/ 60*100 + MOD(N, 60) + + NSEC = NSECF(NHMS) + ndt + + IF (NSEC.GT.86400) THEN + DO WHILE (NSEC.GT.86400) + NSEC = NSEC - 86400 + NYMD = INCYMD (NYMD,1) + ENDDO + ENDIF + + IF (NSEC.EQ.86400) THEN + NSEC = 0 + NYMD = INCYMD (NYMD,1) + ENDIF + + IF (NSEC .LT. 0) THEN + DO WHILE (NSEC .LT. 0) + NSEC = 86400 + NSEC + NYMD = INCYMD (NYMD,-1) + ENDDO + ENDIF + + NHMS = NHMSF (NSEC) + return + end subroutine tick + + subroutine mcalday(nymd, nhms, calday) + implicit none + +! input: + integer nymd + integer nhms +! Output: + real calday ! Julian day (1 to 366 for non-leap year) + ! Julian day (-1 to -367 for leap year) +! Local: + real tsec + integer n, nsecf, m, mm + integer dd, ds + integer days(12) + integer ny + + data days /31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/ + nsecf(n) = n/10000*3600 + mod(n,10000)/100* 60 + mod(n,100) + + ny = nymd / 10000 + mm = mod(nymd, 10000) / 100 + dd = mod(nymd, 100) + + ds = dd -1 + + if( mm .ne. 1) then + do m=1, mm-1 + if( m.eq.2 .and. leap_year(ny) ) then + ds = ds + 29 + else + ds = ds + days(m) + endif + enddo + endif + + tsec = ds * 86400 + nsecf(nhms) + + calday = tsec / 86400. + 1. + if( leap_year(ny) ) calday = -calday + + return + end subroutine mcalday + + subroutine zenith(calday ,dodiavg ,clat ,coszrs ) + +! +! Input arguments +! + real calday ! Calendar day, including fraction + logical dodiavg ! true => do diurnal averaging + real clat ! Current latitude (radians) +! +! Output arguments +! + real coszrs(*) ! Cosine solar zenith angle +! +!---------------------------Local variables----------------------------- +! + _UNUSED_DUMMY(calday) + _UNUSED_DUMMY(dodiavg) + _UNUSED_DUMMY(clat) + _UNUSED_DUMMY(coszrs(1)) ! assumed-size + + call die ('zenith','stub only, please do not call zenith_()' ) + + end subroutine zenith + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_UtilNegFiller --- Negative Filler +! +! !INTERFACE: +! + subroutine Chem_UtilNegFiller ( q, delp, in, jn, qmin ) + +! !USES: + + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + + integer :: in, jn ! number of local lon/lat + real, pointer :: delp(:,:,:) + real, OPTIONAL, intent(in) :: qmin + +! !OUTPUT PARAMETERS: + + real, pointer :: q(:,:,:) ! 3D tracer + +! !DESCRIPTION: +! +! !REVISION HISTORY: Makes sure tracer has no negative values. This is +! a "flat tax" algorithm: first negative values are +! replaced with tiny() or user specified value. Then profiles are rescaled +! to preserve column mass, whenever possible. No mass conservation is +! imposed when the initial column mass is negative or zero. +! +! 18May2007 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + + real :: mass_1(in,jn), mass_2(in,jn), ratio(in,jn) + real :: qmin_ +#ifdef DEBUG + real :: vmax, vmin +#endif + integer :: k, k1, k2, km + + k1 = lbound(q,3) + k2 = ubound(q,3) + km = k2 - k1 + 1 + +! Unless specified, minimum is the smallest positive float, not zero +! ------------------------------------------------------------------ + if ( present(qmin) ) then + qmin_ = qmin + else + qmin_ = tiny(1.0) + end if + +#ifdef DEBUG + call pmaxmin ( 'NegFill: q_beg', q, vmax, vmin, in*jn, km, 1. ) +#endif + +! Column mass before fixer +! ------------------------ + mass_1 = sum ( delp * q, 3 ) + +! Cap q +! ----- + where ( q < qmin_ ) q = qmin_ + +! Enforce conservation of column mass +! ----------------------------------- + mass_2 = sum ( delp * q, 3 ) + where ( (mass_2 /= mass_1) .AND. (mass_1 > 0.0) ) + ratio = mass_1 / mass_2 + elsewhere + ratio = 1.0 + end where + +! Next correct q in each layer +! ---------------------------- + do k = k1, k2 + where ( ratio /= 1.0 ) + q(:,:,k) = ratio * q(:,:,k) + end where + end do + +#ifdef DEBUG + call pmaxmin ( 'NegFill: mass_1', mass_1, vmax, vmin, in*jn,1, 1. ) + call pmaxmin ( 'NegFill: mass_2', mass_2, vmax, vmin, in*jn,1, 1. ) + call pmaxmin ( 'NegFill: ratio', ratio, vmax, vmin, in*jn,1, 1. ) + call pmaxmin ( 'NegFill: q_end', q, vmax, vmin, in*jn, km, 1. ) +#endif + +end subroutine Chem_UtilNegFiller + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_UtilTroppFixer - Repair tropopause pressure bad values +! +! !INTERFACE: +! + SUBROUTINE Chem_UtilTroppFixer(im, jm, tropp, threshold, verbose, newTropp, rc) + +! !USES: + +! !USES: + + IMPLICIT NONE + +! !INPUT/OUTPUT PARAMETERS: + + INTEGER, INTENT(IN) :: im !Index range, longitude + INTEGER, INTENT(IN) :: jm !Index range, latitude + REAL, POINTER , INTENT(INOUT) :: tropp(:,:) !Tropopause pressure (Pa) + REAL, OPTIONAL, INTENT(IN) :: threshold !User-supplied threshold (Pa). If + ! not present, default is 110000 Pa. + LOGICAL, OPTIONAL, INTENT(IN) :: verbose !Write message when bad value is + ! encountered. DEBUG directive turns + ! on the message even if verbose is not + ! present or if verbose = .FALSE. + INTEGER, INTENT(OUT) :: rc !Return code: 0=OK, 1=Unable to repair + + +! !OUTPUT PARAMETERS: + + REAL, OPTIONAL, INTENT(OUT) :: newTropp(1:im,1:jm) + !If present, fill with repaired + ! tropopause pressures (Pa). Otherwise + ! tropp is overwritten. + +! !DESCRIPTION: +! +! Replace bad values in tropopause pressure array with an average of nearby good +! values. Working outward from the afflicted cell, nearby cells are scanned for +! the presence of good values. In the first scan, all adjacent cells, which can +! number up to eight, are considered. If at least one of the cells has a valid +! pressure, the scanning is terminated. Otherwise, the "radius" of the scan is +! increased by one, and up to 24 cells are considered, and so on, until, at the +! extreme, all cells on the current processor fall under consideration. +! +! After the scanning is done, the bad value is replaced with the average the +! valid pressures found by the scan. Thus, the accuracy of the replaced value +! drops rapidly as the scan expands outward. At the same time, the only case +! in which a valid pressure will not be found to replace a bad one is if all +! pressures on the current processor are invalid. In this case the return +! code is set to 1. +! +! If newTropp is not present, then the input array, tropp, is overwritten. If +! it is present, it is filled, even if there are no invalid pressures in tropp. +! +! No scanning is done if all tropopause pressures are valid. +! +! Assumptions/bugs: +! +! Bad values are high, but not Indef, and the primary purpose of this routine +! is to repair the case where GEOS-5 fails to find the tropopause and assigns +! MAPL_UNDEF as the tropopause pressure. We recommend using the blended +! tropopause values for tropp, because the frequency of bad values is quite +! rare compared to the unblended case. +! +! !REVISION HISTORY: +! +! 25Jan2008 Nielsen Initial code and testing. +! +!EOP +!------------------------------------------------------------------------- + CHARACTER(LEN=*), PARAMETER :: myName = 'Chem_UtilTroppFixer' + + LOGICAL :: tellMe + + INTEGER :: i,ier,j,m + INTEGER :: ie,iw,jn,js + + INTEGER, ALLOCATABLE :: mask(:,:) + INTEGER, ALLOCATABLE :: mx(:) + REAL, ALLOCATABLE :: p(:,:) + + REAL :: badValue, r + + rc = 0 + +! Determine verbosity, letting the DEBUG +! directive override local specification +! -------------------------------------- + tellMe = .FALSE. + IF(PRESENT(verbose)) THEN + IF(verbose) tellMe = .TRUE. + END IF +#ifdef DEBUG + tellMe = .TRUE. +#endif + +! Set the bad value to 110000 Pa (1100 hPa) +! ----------------------------------------- + IF(PRESENT(threshold)) THEN + badValue = threshold + ELSE + badValue = 1.10E+05 !Pa, 1100 hPa + END IF + +! There may be no bad values ... +! ------------------------------ + IF( ALL( tropp(1:im,1:jm) < badValue ) ) THEN + IF(PRESENT(newTropp)) newTropp(1:im,1:jm) = tropp(1:im,1:jm) + RETURN + END IF + +! ... or there is at least one bad value +! -------------------------------------- + ALLOCATE(mask(1:im,1:jm),STAT=ier) + ALLOCATE(p(1:im,1:jm),STAT=ier) + ALLOCATE(mx(4),STAT=ier) + +! Loop over each cell +! ------------------- + DO j=1,jm + DO i=1,im + +! Invalid pressure found at cell(i,j) +! ----------------------------------- + IF(tropp(i,j) >= badValue) THEN + +! Determine maximum "radius" of search +! ------------------------------------ + mx(1) = im-i + mx(2) = i-1 + mx(3) = jm-j + mx(4) = j-1 + +! Start search +! ------------ + DO m=1,MAXVAL(mx) + +! Clear the mask +! -------------- + mask(1:im,1:jm) = 0 + +! Range of search +! --------------- + iw = MAX( 1,i-m) + ie = MIN(im,i+m) + js = MAX( 1,j-m) + jn = MIN(jm,j+m) + +! Set mask to one for cells in range of search +! -------------------------------------------- + mask(iw:ie,js:jn) = 1 + +! Set mask back to zero for cells in range +! of search that have invalid pressures. +! ---------------------------------------- + WHERE(tropp(iw:ie,js:jn) >= badValue) mask(iw:ie,js:jn) = 0 + +! One valid pressure is enough ... +! -------------------------------- + IF(SUM(MASK) >= 1) EXIT + +! ... or "radius" of search needs to be extended +! ---------------------------------------------- + END DO + +! Repair bad value at cell(i,j) with average +! of valid pressures found in range of search +! ------------------------------------------- + r = SUM(tropp,mask == 1) + p(i,j) = r/(1.00*SUM(mask)) + +! For debugging +! ------------- +! IF(tellMe) THEN +! WRITE(*,FMT="(A,': ',ES12.5,' becomes ',ES12.5,' Pa [',I4,2X,I4,']')") & +! TRIM(myName),tropp(i,j),p(i,j),m,SUM(mask) +! END IF + + ELSE + +! Input pressure at cell(i,j) was valid +! ------------------------------------- + p(i,j) = tropp(i,j) + + END IF + +! Next cell +! --------- + END DO + END DO + +! Clean up +! -------- + DEALLOCATE(mask,STAT=ier) + DEALLOCATE(mx,STAT=ier) + +! If all cells have bad values, then +! register a failure, but continue. +! ---------------------------------- + IF( ANY( p(1:im,1:jm) >= badValue ) ) THEN + PRINT *, myName,": WARNING Unable to fix bad tropopause pressure(s)" + rc = 1 + END IF + +! Overwrite input or fill output array +! ------------------------------------ + IF(PRESENT(newTropp)) THEN + newTropp(1:im,1:jm) = p(1:im,1:jm) + ELSE + tropp(1:im,1:jm) = p(1:im,1:jm) + END IF + +! Clean up some more +! ------------------ + DEALLOCATE(p,STAT=ier) + + RETURN + END SUBROUTINE Chem_UtilTroppFixer + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Chem_UtilExtractIntegers - Extract integers from a delimited string +! +! !INTERFACE: +! + SUBROUTINE Chem_UtilExtractIntegers(string,iSize,iValues,delimiter,verbose,fillValue,rc) + +! !USES: + + IMPLICIT NONE + +! !INPUT/OUTPUT PARAMETERS: + + CHARACTER(LEN=*), INTENT(IN) :: string ! Character-delimited string of integers + INTEGER, INTENT(IN) :: iSize + INTEGER, INTENT(INOUT) :: iValues(iSize)! Space allocated for extracted integers + CHARACTER(LEN=*), OPTIONAL :: delimiter ! 1-character delimiter + LOGICAL, OPTIONAL, INTENT(IN) :: verbose ! Let me know iValues as they are found. + ! DEBUG directive turns on the message even + ! if verbose is not present or if + ! verbose = .FALSE. + INTEGER, OPTIONAL, INTENT(IN) :: fillValue ! unfilled iValue entries get this value (default=0) + INTEGER, OPTIONAL, INTENT(OUT) :: rc ! Return code + +! !DESCRIPTION: +! +! Extract integers from a character-delimited string, for example, "-1,45,256,7,10". In the context +! of Chem_Util, this is provided for determining the numerically indexed regions over which an +! emission might be applied. +! +! In multiple passes, the string is parsed for the delimiter, and the characters up to, but not +! including the delimiter are taken as consecutive digits of an integer. A negative sign ("-") is +! allowed. After the first pass, each integer and its trailing delimiter are lopped of the head of +! the (local copy of the) string, and the process is started over. +! +! The default delimiter is a comma (","). +! +! "Unfilled" iValues get set to fillValue. +! +! Return codes: +! 1 Zero-length string. +! 2 iSize needs to be increased. +! +! Assumptions/bugs: +! +! A non-zero return code does not stop execution. +! Allowed numerals are: 0,1,2,3,4,5,6,7,8,9. +! A delimiter must be separated from another delimiter by at least one numeral. +! The delimiter cannot be a numeral or a negative sign. +! The character following a negative sign must be an allowed numeral. +! The first character must be an allowed numeral or a negative sign. +! The last character must be an allowed numeral. +! The blank character (" ") cannot serve as a delimiter. +! +! Examples of strings that will work: +! "1" +! "-1" +! "-1,2004,-3" +! "1+-2+3" +! "-1A100A5" +! +! Examples of strings that will not work: +! "1,--2,3" +! "1,,2,3" +! "1,A,3" +! "1,-,2" +! "1,2,3,4," +! "+1" +! "1 3 6" +! +! !REVISION HISTORY: +! +! 29Feb2008 Nielsen Initial code and testing. +! 25Jul2014 Manyin Added fillValue arg +! +!EOP +!------------------------------------------------------------------------- + CHARACTER(LEN=*), PARAMETER :: myName = 'Chem_UtilExtractIntegers' + + INTEGER :: base,count,i,iDash,last,lenStr + INTEGER :: multiplier,pos,posDelim,sign + CHARACTER(LEN=255) :: str + CHARACTER(LEN=1) :: char,delimChar + LOGICAL :: Done + LOGICAL :: tellMe + +! Initializations +! --------------- + rc = 0 + count = 1 + Done = .FALSE. + iValues(:) = 0 + base = ICHAR("0") + iDash = ICHAR("-") + +! Determine verbosity, letting the DEBUG +! directive override local specification +! -------------------------------------- + tellMe = .FALSE. + IF(PRESENT(verbose)) THEN + IF(verbose) tellMe = .TRUE. + END IF +#ifdef DEBUG + tellMe = .TRUE. +#endif + +! Check for zero-length string +! ---------------------------- + lenStr = LEN_TRIM(string) + IF(lenStr == 0) THEN + rc = 1 + PRINT *,myname,": ERROR - Found zero-length string." + RETURN + END IF + +! Default delimiter is a comma +! ---------------------------- + delimChar = "," + IF(PRESENT(delimiter)) delimChar(1:1) = delimiter(1:1) + +! Work on a local copy +! -------------------- + str = TRIM(string) + +! One pass for each delimited integer +! ----------------------------------- + Parse: DO + + lenStr = LEN_TRIM(str) + +! Parse the string for the delimiter +! ---------------------------------- + posDelim = INDEX(TRIM(str),TRIM(delimChar)) + IF(tellMe) PRINT *,myname,": Input string is >",TRIM(string),"<" + +! If the delimiter does not exist, +! one integer remains to be extracted. +! ------------------------------------ + IF(posDelim == 0) THEN + Done = .TRUE. + last = lenStr + ELSE + last = posDelim-1 + END IF + multiplier = 10**last + +! Examine the characters of this integer +! -------------------------------------- + Extract: DO pos=1,last + + char = str(pos:pos) + i = ICHAR(char) + +! Account for a leading "-" +! ------------------------- + IF(pos == 1) THEN + IF(i == iDash) THEN + sign = -1 + ELSE + sign = 1 + END IF + END IF + +! "Power" of 10 for this character +! -------------------------------- + multiplier = multiplier/10 + + IF(pos == 1 .AND. sign == -1) CYCLE Extract + +! Integer comes from remaining characters +! --------------------------------------- + i = (i-base)*multiplier + iValues(count) = iValues(count)+i + IF(pos == last) THEN + iValues(count) = iValues(count)*sign + IF(tellMe) PRINT *,myname,":Integer number ",count," is ",iValues(count) + END IF + + END DO Extract + + IF(Done) THEN + IF(PRESENT(fillValue) .AND. (count < iSize)) iValues((count+1):iSize) = fillValue + EXIT + END IF + +! Lop off the leading integer and try again +! ----------------------------------------- + str(1:lenStr-posDelim) = str(posDelim+1:lenStr) + str(lenStr-posDelim+1:255) = " " + count = count+1 + +! Check size +! ---------- + IF(count > iSize) THEN + rc = 2 + PRINT *,myname,": ERROR - iValues does not have enough elements." + END IF + + END DO Parse + + RETURN +END SUBROUTINE Chem_UtilExtractIntegers + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! This is a candidate for ESMFL, here for dependency reasons +! + + subroutine GridGetLatLons_ ( grid, lons, lats ) + + implicit NONE + type(ESMF_Grid) :: grid + + real, pointer :: lons(:), lats(:) + +! --- + + character(len=*), parameter :: Iam = 'GridGetLatLons' + + real(KIND=8), pointer :: R8D2(:,:) + real, pointer :: lons2d(:,:), lats2d(:,:) + real, pointer :: LONSLocal(:,:), LATSlocal(:,:) + integer :: IM_WORLD, JM_WORLD, dims(3), STATUS, RC + +! ---- + +! Get world dimensions +! -------------------- + call MAPL_GridGet(GRID, globalCellCountPerDim=DIMS, RC=STATUS) + + IM_WORLD = dims(1) + JM_WORLD = dims(2) + +! Allocate memory for output if necessary +! --------------------------------------- + if ( .not. associated(lons) ) then + allocate(lons(IM_WORLD), stat=STATUS) + VERIFY_(status) + else + if(size(LONS,1) /= IM_WORLD) STATUS = 1 + VERIFY_(status) + end if + if ( .not. associated(lats) ) then + allocate(lats(JM_WORLD), stat=STATUS) + VERIFY_(status) + else + if(size(LATS,1) /= JM_WORLD) STATUS = 1 + VERIFY_(status) + end if + +! Local work space +! ---------------- + allocate(LONS2d(IM_WORLD,JM_WORLD), LATS2d(IM_WORLD,JM_WORLD), & + STAT=status) + VERIFY_(status) + LONS2d=0 + LATS2d=0 + +! Get the local longitudes and gather them into a global array +! ------------------------------------------------------------ + call ESMF_GridGetCoord(grid, localDE=0, coordDim=1, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + datacopyFlag = ESMF_DATACOPY_REFERENCE, & + farrayPtr=R8D2, rc=status) + + allocate(LONSLOCAL(size(R8D2,1),size(R8D2,2)), STAT=status) + VERIFY_(status) + + LONSLOCAL = R8D2*(180/MAPL_PI) + + call ArrayGather(LONSLOCAL, LONS2D, GRID, RC=STATUS) + +! Get the local longitudes and gather them into a global array +! ------------------------------------------------------------ + call ESMF_GridGetCoord(grid, localDE=0, coordDim=2, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + datacopyFlag = ESMF_DATACOPY_REFERENCE, & + farrayPtr=R8D2, rc=status) + + allocate(LATSLOCAL(size(R8D2,1),size(R8D2,2)), STAT=status) + VERIFY_(status) + + LATSlocal = R8D2*(180/MAPL_PI) + + call ArrayGather(LATSLOCAL, LATS2D, GRID, RC=STATUS) + VERIFY_(STATUS) + +! Return 1D arrays +! ---------------- + LONS = LONS2D(:,1) + LATS = LATS2D(1,:) + + DEALLOCATE(LONSLOCAL, LATSLOCAL, LONS2d, LATS2d ) + + end subroutine GridGetLatLons_ + +!.......................................................................................... + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Chem_BiomassDiurnal - Applies diurnal cycle to biomass emissions. +! +! !INTERFACE: +! + + subroutine Chem_BiomassDiurnal ( Eout, Ein, lons, lats, nhms, cdt) + +! !USES: + + IMPLICIT NONE + +! !ARGUMENTS: + + real, intent(out) :: Eout(:,:) ! Emissions valid at NHMS + real, intent(in) :: Ein(:,:) ! Daily-mean emissions + real, intent(in) :: lons(:,:) ! Latitudes in degrees + real, intent(in) :: lats(:,:) ! Latitudes in degrees + integer, intent(in) :: nhms + real, intent(in) :: cdt ! time step in seconds + +! !DESCRIPTION: +! +! Applies diurnal cycle to biomass emissions. +! +! !DESCRIPTION: +! +! This module implements assorted odds & ends for fvChem. +! +! !REVISION HISTORY: +! +! 13nov2009 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + +! Hardwired diurnal cycle (multiplied by 100) +! These numbers were derived from GOES-12 +! fire counts for 2003-2007. +! ------------------------------------------- + integer, parameter :: N = 240 + real, parameter :: DT = 86400. / N + +! Apply flat diurnal cycle for boreal forests as a +! temporary solution to prevent very high aerosol +! optical depth during the day + real, parameter :: Boreal(N) = 1.0 +! real, parameter :: Boreal(N) = & +! (/ 0.0277, 0.0292, 0.0306, 0.0318, 0.0327, 0.0335, & +! 0.0340, 0.0342, 0.0341, 0.0338, 0.0333, 0.0326, & +! 0.0316, 0.0305, 0.0292, 0.0278, 0.0263, 0.0248, & +! 0.0233, 0.0217, 0.0202, 0.0187, 0.0172, 0.0158, & +! 0.0145, 0.0133, 0.0121, 0.0110, 0.0100, 0.0091, & +! 0.0083, 0.0075, 0.0068, 0.0062, 0.0056, 0.0051, & +! 0.0046, 0.0042, 0.0038, 0.0035, 0.0032, 0.0030, & +! 0.0028, 0.0026, 0.0025, 0.0024, 0.0024, 0.0024, & +! 0.0024, 0.0026, 0.0027, 0.0030, 0.0033, 0.0036, & +! 0.0041, 0.0046, 0.0052, 0.0060, 0.0069, 0.0079, & +! 0.0090, 0.0104, 0.0119, 0.0137, 0.0157, 0.0180, & +! 0.0205, 0.0235, 0.0268, 0.0305, 0.0346, 0.0393, & +! 0.0444, 0.0502, 0.0565, 0.0634, 0.0711, 0.0794, & +! 0.0884, 0.0982, 0.1087, 0.1201, 0.1323, 0.1453, & +! 0.1593, 0.1742, 0.1900, 0.2069, 0.2249, 0.2439, & +! 0.2642, 0.2858, 0.3086, 0.3329, 0.3587, 0.3860, & +! 0.4149, 0.4455, 0.4776, 0.5115, 0.5470, 0.5840, & +! 0.6227, 0.6628, 0.7043, 0.7470, 0.7908, 0.8355, & +! 0.8810, 0.9271, 0.9735, 1.0200, 1.0665, 1.1126, & +! 1.1580, 1.2026, 1.2460, 1.2880, 1.3282, 1.3664, & +! 1.4023, 1.4356, 1.4660, 1.4933, 1.5174, 1.5379, & +! 1.5548, 1.5679, 1.5772, 1.5826, 1.5841, 1.5818, & +! 1.5758, 1.5661, 1.5529, 1.5365, 1.5169, 1.4944, & +! 1.4693, 1.4417, 1.4119, 1.3801, 1.3467, 1.3117, & +! 1.2755, 1.2383, 1.2003, 1.1616, 1.1225, 1.0832, & +! 1.0437, 1.0044, 0.9653, 0.9265, 0.8882, 0.8504, & +! 0.8134, 0.7771, 0.7416, 0.7070, 0.6734, 0.6407, & +! 0.6092, 0.5787, 0.5493, 0.5210, 0.4939, 0.4680, & +! 0.4433, 0.4197, 0.3974, 0.3763, 0.3565, 0.3380, & +! 0.3209, 0.3051, 0.2907, 0.2777, 0.2662, 0.2561, & +! 0.2476, 0.2407, 0.2352, 0.2313, 0.2289, 0.2279, & +! 0.2283, 0.2300, 0.2329, 0.2369, 0.2417, 0.2474, & +! 0.2536, 0.2602, 0.2670, 0.2738, 0.2805, 0.2869, & +! 0.2927, 0.2979, 0.3024, 0.3059, 0.3085, 0.3101, & +! 0.3107, 0.3102, 0.3087, 0.3061, 0.3026, 0.2983, & +! 0.2931, 0.2871, 0.2806, 0.2735, 0.2659, 0.2579, & +! 0.2497, 0.2412, 0.2326, 0.2240, 0.2153, 0.2066, & +! 0.1979, 0.1894, 0.1809, 0.1726, 0.1643, 0.1562, & +! 0.1482, 0.1404, 0.1326, 0.1250, 0.1175, 0.1101, & +! 0.1028, 0.0956, 0.0886, 0.0818, 0.0751, 0.0687 /) + real, parameter :: NonBoreal(N) = & + (/ 0.0121, 0.0150, 0.0172, 0.0185, 0.0189, 0.0184, & + 0.0174, 0.0162, 0.0151, 0.0141, 0.0133, 0.0126, & + 0.0121, 0.0117, 0.0115, 0.0114, 0.0114, 0.0116, & + 0.0120, 0.0126, 0.0133, 0.0142, 0.0151, 0.0159, & + 0.0167, 0.0174, 0.0180, 0.0184, 0.0187, 0.0189, & + 0.0190, 0.0190, 0.0191, 0.0192, 0.0192, 0.0193, & + 0.0194, 0.0194, 0.0193, 0.0192, 0.0190, 0.0187, & + 0.0185, 0.0182, 0.0180, 0.0178, 0.0177, 0.0176, & + 0.0174, 0.0172, 0.0169, 0.0166, 0.0162, 0.0158, & + 0.0153, 0.0149, 0.0144, 0.0138, 0.0132, 0.0126, & + 0.0118, 0.0109, 0.0101, 0.0092, 0.0085, 0.0081, & + 0.0080, 0.0083, 0.0091, 0.0102, 0.0117, 0.0135, & + 0.0157, 0.0182, 0.0210, 0.0240, 0.0273, 0.0308, & + 0.0345, 0.0387, 0.0432, 0.0483, 0.0540, 0.0606, & + 0.0683, 0.0775, 0.0886, 0.1022, 0.1188, 0.1388, & + 0.1625, 0.1905, 0.2229, 0.2602, 0.3025, 0.3500, & + 0.4031, 0.4623, 0.5283, 0.6016, 0.6824, 0.7705, & + 0.8650, 0.9646, 1.0676, 1.1713, 1.2722, 1.3662, & + 1.4491, 1.5174, 1.5685, 1.6014, 1.6173, 1.6200, & + 1.6150, 1.6082, 1.6040, 1.6058, 1.6157, 1.6353, & + 1.6651, 1.7045, 1.7513, 1.8024, 1.8541, 1.9022, & + 1.9429, 1.9738, 1.9947, 2.0072, 2.0132, 2.0141, & + 2.0096, 1.9994, 1.9829, 1.9604, 1.9321, 1.8977, & + 1.8562, 1.8052, 1.7419, 1.6646, 1.5738, 1.4734, & + 1.3693, 1.2676, 1.1724, 1.0851, 1.0052, 0.9317, & + 0.8637, 0.8004, 0.7414, 0.6862, 0.6348, 0.5871, & + 0.5434, 0.5037, 0.4682, 0.4368, 0.4097, 0.3864, & + 0.3667, 0.3499, 0.3355, 0.3231, 0.3123, 0.3029, & + 0.2944, 0.2862, 0.2773, 0.2670, 0.2547, 0.2402, & + 0.2238, 0.2061, 0.1882, 0.1712, 0.1562, 0.1434, & + 0.1332, 0.1251, 0.1189, 0.1141, 0.1103, 0.1071, & + 0.1043, 0.1018, 0.0996, 0.0979, 0.0968, 0.0964, & + 0.0966, 0.0970, 0.0973, 0.0970, 0.0959, 0.0938, & + 0.0909, 0.0873, 0.0831, 0.0784, 0.0732, 0.0676, & + 0.0618, 0.0565, 0.0521, 0.0491, 0.0475, 0.0473, & + 0.0480, 0.0492, 0.0504, 0.0514, 0.0519, 0.0521, & + 0.0520, 0.0517, 0.0513, 0.0510, 0.0507, 0.0507, & + 0.0508, 0.0512, 0.0515, 0.0518, 0.0519, 0.0518, & + 0.0513, 0.0506, 0.0496, 0.0482, 0.0465, 0.0443, & + 0.0418, 0.0387, 0.0351, 0.0310, 0.0263, 0.0214 /) + +! Fixed normalization factors; a more accurate normalization would take +! in consideration longitude and time step +! --------------------------------------------------------------------- + real*8, save :: fBoreal = -1., fNonBoreal = -1 + real, save :: fDT=-1 + + integer :: hh, mm, ss, ndt, i, j, k + integer :: NN + real :: secs, secs_local, aBoreal, aNonBoreal, alpha + +! ----- + +! Normalization factor depends on timestep +! ---------------------------------------- + if ( fDT /= cdt ) then + fBoreal = 0.0 + fNonBoreal = 0.0 + NN = 0 + ndt = max(1,nint(cdt/DT)) + + do k = 1, N, ndt + NN = NN + 1 + fBoreal = fBoreal + Boreal(k) + fNonBoreal = fNonBoreal + NonBoreal(k) + end do + + fBoreal = fBoreal / NN + fnonBoreal = fnonBoreal / NN + fDT = cdt ! so it recalculates only if necessary + end if + + +! Find number of secs since begining of the day (GMT) +! --------------------------------------------------- + hh = nhms/10000 + mm = (nhms - 10000*hh) / 100 + ss = nhms - 10000*hh - 100*mm + secs = 3600.*hh + 60.*mm + ss + +! Apply factors depending on latitude +! ----------------------------------- + do j = lbound(Ein,2), ubound(Ein,2) + do i = lbound(Ein,1), ubound(Ein,1) + +! Find corresponding index in hardwired diurnal cycle +! 240 = 24 * 60 * 60 secs / 360 deg +! --------------------------------------------------- + secs_local = secs + 240. * lons(i,j) + k = 1 + mod(nint(secs_local/DT),N) + if ( k < 1 ) k = N + k + +! Apply diurnal cycle +! ------------------- + aBoreal = Boreal(k) / fBoreal + aNonBoreal = NonBoreal(k) / fNonBoreal + + if ( lats(i,j) >= 50. ) then + Eout(i,j) = aBoreal * Ein(i,j) + else if ( lats(i,j) >= 30. ) then + alpha = (lats(i,j) - 30. ) / 20. + Eout(i,j) = (1-alpha) * aNonBoreal * Ein(i,j) + & + alpha * aBoreal * Ein(i,j) + else + Eout(i,j) = aNonBoreal * Ein(i,j) + end if + end do + end do + + end subroutine Chem_BiomassDiurnal + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_UtilResVal --- returns resolution dependent value +! +! !INTERFACE: +! + function Chem_UtilResVal( im_World, jm_World, res_value, rc ) result (val) + +! !USES: + + implicit NONE + + real :: val ! resolution dependent value + +! !INPUT/OUTPUT PARAMETERS: + integer, intent(in) :: im_World, jm_World ! number of global grid cells + real, intent(in) :: res_value(:) ! array with the resolution dependent values: + ! the 'a', 'b', ..., 'e' resolution values have + ! indexes 1, 2, ..., 5. + +! !OUTPUT PARAMETERS: + integer, intent(inout) :: rc ! return code + + +! !DESCRIPTION: +! +! !REVISION HISTORY: +! +! 13 Feb2012 Anton Darmenov First crack. +! 25 Oct2012 Anton Darmenov Added support for FV3 resolutions. +! +!EOP +!------------------------------------------------------------------------- + character(len=*), parameter :: Iam = 'Chem_UtilResVal' + + integer :: i_res + + integer, parameter :: res_a = 1 ! 'a' to 'e' resolution indexes + integer, parameter :: res_b = 2 ! + integer, parameter :: res_c = 3 ! + integer, parameter :: res_d = 4 ! + integer, parameter :: res_e = 5 ! + integer, parameter :: res_f = 6 ! + + i_res = 0 + + if ((im_World < 1) .or. (jm_World < 1)) then + call die(Iam, 'incorrect model resolution') + end if + + if (jm_World == 6*im_World) then + if (im_World <= 24) then + i_res = res_a + else if (im_World <= 48) then + i_res = res_b + else if (im_World <= 90) then + i_res = res_c + else if (im_World <= 180) then + i_res = res_d + else if (im_World <= 360) then + i_res = res_e + else if (im_World <= 720) then + i_res = res_f + else + i_res = res_f + end if + else + if ((im_World <= 72) .and. (jm_World <= 46)) then + i_res = res_a + else if ((im_World <= 144) .and. (jm_World <= 91)) then + i_res = res_b + else if ((im_World <= 288) .and. (jm_World <= 181)) then + i_res = res_c + else if ((im_World <= 576) .and. (jm_World <= 361)) then + i_res = res_d + else if ((im_World <= 1152) .and. (jm_World <= 721)) then + i_res = res_e + else if ((im_World <= 2304) .and. (jm_World <=1441)) then + i_res = res_f + else + i_res = res_f + end if + end if + + if ((i_res < 1) .or. (i_res > size(res_value))) then + val = 0.0 + rc = 42 + else + val = res_value(i_res) + rc = 0 + end if + + end function Chem_UtilResVal + + function Chem_UtilIdow(nymd) result (idow) + implicit NONE + integer, intent(in) :: nymd + integer :: idow ! day of the week: Sun=1, Mon=2, etc. + integer :: y, m, d + integer, parameter :: t(0:11) = (/ 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 /) + y = nymd / 10000 + m = (nymd - y*10000)/100 + d = nymd - (y*10000 + m*100) + if ( m<3 ) then + y = y - 1 + end if + idow = 1+mod(y + y/4 - y/100 + y/400 + t(m-1) + d,7) + return + end function Chem_UtilIdow + + function Chem_UtilCdow(nymd) result (cdow) + implicit NONE + integer, intent(in) :: nymd + character(len=3) :: cdow ! day of the week: Sun, Mon, etc. + character(len=3) :: cday(7) = (/ 'Sun','Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' /) + cdow = cday(Chem_UtilIdow(nymd)) + return + end function Chem_UtilCdow + + +! Chem_UtilPointEmissions +! Colarco, February 9, 2015 +! Given a text file of point wise emissions (see example) return a table with +! the emissions location (lat,lon), altitude (bottom, top), amount (kg/s over +! duration of event), and (optionally) the NHMS start and end times of +! emissions. Useful for events, like volcanic eruptions or individual fires. +! This is inspired by GetVolcDailyTables in SulfateChemDriverMod.F90 +! +! Table format +! Here's an example from volcanic tables (remove ! from lines for functionality +!### latitude (-90,90), longitude (-180,180), amount [kg/s], +!### base elevation [m], top altitude [m], +!### (optional) begin time [HHMMSS], (optional) end time [HHMMSS] +!source:: +!50.170 6.850 3.587963e-03 600. 600. +!:: +! +! Arguments +! Input +! nymd -- integer YYYYMMDD for file +! filetemplate -- grads-like filename template filled in with nymd +! Output +! nPts -- number of events in file +! vLat -- latitude (one per event...) +! vLon -- longitude +! vBase -- base altitude (e.g., bottom of plume) +! vTop -- top altitude (e.g., top of plume) +! vEmis -- emission flux (e.g., kg s-1 of species) +! vStart -- HHMMSS to start emissions (optional) +! vEnd -- HHMMSS to end emissions (optional) + + subroutine Chem_UtilPointEmissions( nymd, filetemplate, & + nPts, vLat, vLon, vBase, vTop, vEmis, vStart, vEnd ) + + implicit NONE + + integer, intent(in) :: nymd + character(len=255) :: filetemplate + integer :: nPts + real, pointer, dimension(:) :: vLat, vLon, vTop, vBase, vEmis + integer, pointer, dimension(:) :: vStart, vEnd + integer :: i, j, nLines, nCols, rc, STATUS, nymd1, nhms1, ios + character(len=255) :: fname + type(ESMF_Config) :: cf + real, pointer, dimension(:) :: vData + +! If previous instance of volcano point data tables exist, deallocate it +! to get the correct number of elements + if(associated(vLat)) deallocate(vLat, stat=ios) + if(associated(vLon)) deallocate(vLon, stat=ios) + if(associated(vEmis)) deallocate(vEmis, stat=ios) + if(associated(vBase)) deallocate(vBase, stat=ios) + if(associated(vTop)) deallocate(vTop, stat=ios) + if(associated(vStart)) deallocate(vStart, stat=ios) + if(associated(vEnd)) deallocate(vEnd, stat=ios) + + +! Assumes files provided daily (or less frequently) +! ------------------------------------------------- + nymd1 = nymd + nhms1 = 120000 + call StrTemplate ( fname, filetemplate, xid='unknown', & + nymd=nymd1, nhms=nhms1 ) + cf = ESMF_ConfigCreate() + call ESMF_ConfigLoadFile(cf, fileName=trim(fname), rc=STATUS ) + call ESMF_ConfigGetDim(cf, nLines, nCols, LABEL='source::', rc=STATUS ) + nPts = nLines + allocate(vData(nCols), vLat(nLines), vLon(nLines), & + vEmis(nLines), vBase(nLines), vStart(nLines), & + vEnd(nLines), vTop(nLines), stat=ios) + vStart = -1 + vEnd = -1 + call ESMF_ConfigFindLabel(cf, 'source::',rc=STATUS) + do i = 1, nLines + call ESMF_ConfigNextLine(cf, rc=rc) + do j = 1, nCols + call ESMF_ConfigGetAttribute(cf, vData(j), default=-1.) + end do + vLat(i) = vData(1) + vLon(i) = vData(2) + vEmis(i) = vData(3) + vBase(i) = vData(4) + vTop(i) = vData(5) + if(nCols >= 6) vStart(i) = vData(6) + if(nCols >= 7) vEnd(i) = vData(7) + end do + + +! Check value of vStart and vEnd. Set to be +! vStart = 000000 if default (=-1) is provided +! vEnd = 240000 if default (=-1) is provided + where(vStart < 0) vStart = 000000 + where(vEnd < 0) vEnd = 240000 + + call ESMF_ConfigDestroy(cf) + deallocate(vData, stat=ios) + + end subroutine Chem_UtilPointEmissions + + end module Chem_UtilMod + diff --git a/ESMF/Shared/Chem_Shared/Chem_UtilMod_geos4.F90 b/ESMF/Shared/Chem_Shared/Chem_UtilMod_geos4.F90 new file mode 100644 index 00000000..650c508b --- /dev/null +++ b/ESMF/Shared/Chem_Shared/Chem_UtilMod_geos4.F90 @@ -0,0 +1,231 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: Chem_UtilMod --- Assorted Utilities for fvChem +! +! !INTERFACE: +! + + module Chem_UtilMod + +! !USES: + +#if defined(SPMD) + use mod_comm, only: gid ! fvGCM communication library +#ifdef FORCE_R4 + use mod_comm, only: mp_scatter2d => mp_scatter2d_r4 ! to cope lf95 bug + use mod_comm, only: mp_scatter4d => mp_scatter4d_r4 +#else + use mod_comm, only: mp_scatter2d ! fvGCM communication library + use mod_comm, only: mp_scatter4d ! fvGCM communication library +#endif +#endif + use Chem_Mod ! Chemistry Base Class + use mod_diag ! fvGCM diagnostics + use m_die + use m_StrTemplate + + implicit NONE + +! +! !PUBLIIC MEMBER FUNCTIONS: +! + + PRIVATE + PUBLIC Chem_UtilMPread + +! +! !DESCRIPTION: +! +! This module implements assorted odds & ends for fvChem. +! +! !REVISION HISTORY: +! +! 29oct2003 da Silva First crack. +! +!EOP +!------------------------------------------------------------------------- + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_UtilMPread --- Reads fields from file and distribute +! +! !INTERFACE: +! + subroutine Chem_UtilMPread ( filen, varn, nymd, nhms, & + i1, i2, ig, im, j1, j2, jg, jm, km, & +! ++PRC + grid, & +! --PRC + var2d, var3d, cyclic ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + character(len=*), intent(in) :: filen ! GFIO compatible file name + character(len=*), intent(in) :: varn ! variable name + integer, intent(in) :: nymd, nhms ! date/time + + ! Distributed grid info: + integer, intent(in) :: i1, i2 ! local zonal indices + integer, intent(in) :: ig ! zonal ghosting + integer, intent(in) :: im ! global zonal dimension + integer, intent(in) :: j1, j2 ! local meridional indices + integer, intent(in) :: jg ! meridional ghosting + integer, intent(in) :: jm ! global zonal dimension + integer, intent(in) :: km ! vertical dimension + integer, OPTIONAL, intent(in) :: grid ! not need in GEOS-4 + + +! !OUTPUT PARAMETERS: + + real, OPTIONAL, intent(out) :: var2d(i1-ig:i2+ig,j1-jg:j2+jg) + real, OPTIONAL, intent(out) :: var3d(i1-ig:i2+ig,j1-jg:j2+jg,km) + logical, OPTIONAL, intent(in) :: cyclic ! whether time dimension is periodic + +! !DESCRIPTION: +! +! !REVISION HISTORY: +! +! 28oct2003 da Silva First crack. +! 03ayg2004 da Silva Uses GetVarT for time interpolation +! 18nov2004 da Silva Added cyclic option for climatological files. +! 31may2005 da Silva Template expansion. +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_UtilMPread' + logical :: tcyclic + + integer :: READ_ONLY=1, nokm=0 + real, allocatable :: v2d(:,:), v3d(:,:,:) + integer :: fid, rc, ios + character(len=255) :: fname + +#if !defined (SPMD) + integer :: gid = 0 +#endif + +! Consistency check +! ----------------- + if ( .not. ( present(var2d) .or. present(var3d) ) ) then + call die ( myname, 'missing var2d or var3d' ) + else if ( present(var2d) .and. present(var3d) ) then + call die ( myname, 'either var2d or var3d, but not both' ) + end if + if ( i1 /=1 .or. i2 /=im .or. ig /= 0 ) & + call die ( myname, 'fvgcm only allows distributed latitudes' ) + + if ( present(cyclic) ) then + tcyclic = cyclic + else + tcyclic = .false. ! by default time dimension is not periodic + end if + +! Expand templates +! ---------------- + if ( index(filen,'%') .gt. 0 ) then + call StrTemplate ( fname, filen, xid='unknown', & + nymd=nymd, nhms=nhms ) + else + fname = filen + end if + + +! Read file +! --------- + if ( gid .eq. 0 ) then + +#ifdef DEBUG + print *, myname // ': Opening GFIO file ' // trim(fname) +#endif + +! Open file, get first time +! ------------------------- + call GFIO_Open ( fname, READ_ONLY, fid, rc ) + if ( rc .ne. 0 ) then + call die(myname,'cannot open GFIO file '//trim(fname)) + end if + +! Read global array +! ----------------- +#if defined(SPMD) + if ( present(var2d) ) then +#ifdef DEBUG + print *, myname // ': reading variable ' // trim(varn) +#endif + allocate(v2d(im,jm),stat=ios) + if ( ios /= 0 ) call die ( myname, 'cannot allocate v2d' ) + call GFIO_GetVarT1 ( fid, trim(varn), nymd, nhms, im, jm, nokm, 1, & + v2d, rc, tcyclic, fid ) + if ( rc .ne. 0 ) call die(myname,'cannot read '//trim(varn) ) + else + allocate(v3d(im,jm,km),stat=ios) + if ( ios /= 0 ) call die ( myname, 'cannot allocate v3d' ) + call GFIO_GetVarT1 ( fid, trim(varn), nymd, nhms, im, jm, 1, km, & + v3d, rc, tcyclic, fid ) + if ( rc .ne. 0 ) call die(myname,'cannot read '//trim(varn) ) + end if +#else + if ( present(var2d) ) then +#ifdef DEBUG + print *, myname // ': reading variable ' // trim(varn) +#endif + call GFIO_GetVarT1 ( fid, trim(varn), nymd, nhms, im, jm, nokm, 1, & + var2d, rc, tcyclic, fid ) + if ( rc .ne. 0 ) call die(myname,'cannot read '//trim(varn) ) + else + if ( ios /= 0 ) call die ( myname, 'cannot allocate v3d' ) + call GFIO_GetVarT1 ( fid, trim(varn), nymd, nhms, im, jm, 1, km, & + var3d, rc, tcyclic, fid ) + if ( rc .ne. 0 ) call die(myname,'cannot read '//trim(varn) ) + end if +#endif + +! Close file +! ---------- + call GFIO_Close ( fid, rc ) +#ifdef DEBUG + print *, myname // ': Closing GFIO file ' // trim(fname) +#endif + + end if ! masterproc + +! Distribute data +! --------------- +#if defined(SPMD) + if ( present(var2d) ) then + call mp_scatter2d(v2d, var2d, im, jm, j1, j2, 0) + if ( gid == 0 ) then + deallocate(v2d,stat=ios) + if ( ios /= 0 ) call die ( myname, 'cannot deallocate v2d' ) + end if + else + call mp_scatter4d ( v3d, var3d, im, jm, km, 1, j1, j2, & + 1, km, jg, jg, 0) + if ( gid == 0 ) then + deallocate(v3d,stat=ios) + if ( ios /= 0 ) call die ( myname, 'cannot deallocate v3d' ) + end if + end if +#endif + +! All done +! -------- + return + +end subroutine Chem_UtilMPread + + end module Chem_UtilMod + diff --git a/ESMF/Shared/Chem_Shared/ConvectionMod.F90 b/ESMF/Shared/Chem_Shared/ConvectionMod.F90 new file mode 100644 index 00000000..3eb8e7a1 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/ConvectionMod.F90 @@ -0,0 +1,1087 @@ +#include "unused_dummy.H" +! Module: ConvectionMod --- mimic the convective scavenging algorithm from the +! offline GOCART CTM + + module ConvectionMod + +! USES + use Chem_Mod + use m_die + +! PUBLIC + +! Description +! TC is tracer mixing ratio (Mass Mixing Ratio) +! Note that I change the sense of this so that rather than calling all aerosols +! at once (as in offline CTM) I call separately from each component (DU, SS, etc.) +! Assumption is that H2O2 passed in is in units of mass mixing ratio + +! Parameters + real*8, parameter :: kc = 5.0e-3 ! conversion rate of cloud condensate to precipation [s-1] + logical, parameter :: lsadirect = .false. + +! ALT: for the time being we need a simple mechanism to disable +! convection if GF was chosen in Moist +! (otherwise we would be doing it twice) + logical, private :: doing_convection = .true. + public enable_convection + public disable_convection + +CONTAINS + subroutine enable_convection + doing_convection = .true. + end subroutine enable_convection + + subroutine disable_convection + doing_convection = .false. + end subroutine disable_convection + + subroutine zflip (varin, varout, km) +! reorder a variable in the vertical + real*8, dimension(:,:,:) :: varin, varout + integer*4 :: km, k + + do k = 1, km + varout(:,:,k) = varin(:,:,km-k+1) + enddo + +end subroutine zflip + + +! ---------------------------------------------------------------------------------- +! OMIT sulfate stuff for now + SUBROUTINE convection(i1, i2, j1, j2, km, n1, n2, dt_30m, aero_type, kin, & + tc, cldmas, dtrain, area, delz, delp, vud, & + airmass, airmol, tmpu, ple, bcnv, h2o2 ) + + IMPLICIT NONE + + INTEGER, INTENT(IN) :: i1, i2, j1, j2, km, n1, n2, dt_30m + character(len=*) :: aero_type + REAL*8, INTENT(INOUT) :: tc(i1:i2,j1:j2,km,n1:n2) +! REAL*8, INTENT(INOUT) :: cldscv(i1:i2,j1:j2,km,n1:n2), cldso2(i1:i2,j1:j2,km) +! REAL*8, INTENT(INOUT) :: cldso4(i1:i2,j1:j2,km), cldmsa(i1:i2,j1:j2,km) + REAL*8 :: cldscv(i1:i2,j1:j2,km,n1:n2), cldso2(i1:i2,j1:j2,km) + REAL*8 :: cldso4(i1:i2,j1:j2,km), cldmsa(i1:i2,j1:j2,km) +! REAL*8, INTENT(INOUT) :: tcnv(i1:i2,j1:j2,n1:n2) +! REAL*8, INTENT(INOUT) :: wet_conv_in(i1:i2,j1:j2,km,n1:n2) + REAL*8, INTENT(INOUT) :: airmass(i1:i2,j1:j2,km) + REAL*8, DIMENSION(i1:i2,j1:j2,km), INTENT(IN) :: vud + REAL*8, DIMENSION(i1:i2,j1:j2,km+1), INTENT(IN) :: cldmas + REAL*8, DIMENSION(i1:i2,j1:j2,km), INTENT(IN) :: dtrain + REAL*8, DIMENSION(i1:i2,j1:j2), INTENT(IN) :: area + REAL*8, DIMENSION(i1:i2,j1:j2,km), INTENT(IN) :: delz, delp + REAL*8, DIMENSION(i1:i2,j1:j2,km), INTENT(IN) :: airmol + REAL*8, DIMENSION(i1:i2,j1:j2,km), INTENT(IN) :: tmpu + REAL*8, DIMENSION(i1:i2,j1:j2,km+1), INTENT(IN) :: ple + REAL*8, INTENT(OUT) :: bcnv(i1:i2,j1:j2,n1:n2) + REAL*8, INTENT(INOUT), optional :: h2o2(i1:i2,j1:j2,km) + LOGICAL, INTENT(INOUT) :: KIN ! true for aerosol + + REAL*8 :: tc1(i1:i2,j1:j2,km,n1:n2), f(i1:i2,j1:j2,km,n1:n2) + REAL*8 :: cldmas_tmp(i1:i2,j1:j2,km), so2loss +! epsilon: A very small positive number [unitless] + REAL*8, PARAMETER :: EPSILON = 1.0E-32 + REAL*8, PARAMETER :: R = 8.2057d-2 ! universal gas constant [L*atm/moles/K] + REAL*8, PARAMETER :: INV_T0 = 1d0 / 298d0 + REAL*8, PARAMETER :: conv_NH3 = 5.69209978831d-1 ! 0.6*SQRT(0.9) for ice to gas ratio + REAL*8 :: kg, Kstar298, H298_R, I2G, L2G, C_TOT, F_L, F_I + INTEGER :: n, i, j, l, NSO2, NSO4, NMSA + REAL*8, DIMENSION(i1:i2,j1:j2,km) :: c_h2o + REAL*8, DIMENSION(i1:i2,j1:j2,km) :: cldliq + REAL*8, DIMENSION(i1:i2,j1:j2,km) :: cldice + + +!srf---------------------- +!ALT: a better protection to not do convection is Moist chooses GF + if (.not. doing_convection) then + bcnv(:,:,:) = 0.0 + RETURN + end if +!srf---------------------- + + +! Initialize local variables +! -------------------------- +! c_h2o, cldliq, and cldice are respectively intended to be the +! water mixing ratio (liquid or vapor?, in or out of cloud?) +! cloud liquid water mixing ratio +! cloud ice water mixing ratio + c_h2o = (10d0**(-2663.5d0/tmpu(:,:,:) + 12.537d0 ) ) / & + (ple(:,:,1:km)+ple(:,:,2:km+1)) /2d0 + cldliq = 0.d0 + where(tmpu > 248.) cldliq = 1.d-6 * ( ( tmpu - 248.d0) / 20.d0 ) + where(tmpu >= 268.) cldliq = 1.d-6 + cldice = 1.d-6 - cldliq + + ! executable statements + + tc1(:,:,:,:) = tc(:,:,:,:) + !if (MAPL_AM_I_ROOT()) print *, 'hbian convection tmpu =', tmpu(i1,j1,1), tmpu(i1,j1,km) + +! compute the fraction of tracer scavenged in convective cloud updrafts + f = 0.0 + kg = 0d0 + + DO n = n1, n2 + if (TRIM(aero_type) .eq. 'nitrate' .and. n .eq. n1 ) kin = .false. ! treat NH3 as a gas tracer + if (TRIM(aero_type) .eq. 'nitrate' .and. n .gt. n1 ) kin = .true. ! treat others as aerosol + + if (kin) then + CALL f_aerosol(i1, i2, j1, j2, km, kc, f(:,:,:,n), delz, vud ) + else + ! gas tracer NH3 + if (TRIM(aero_type) .eq. 'nitrate' .and. n .eq. n1 ) then + ! values adopted in Umich/IMPACT and GMI, effective Herry's law coefficient at pH = 5 + Kstar298 = 1.05d6 + H298_R = -4.2d3 + endif + DO L = 2, KM + DO J = j1, j2 + DO I = i1, i2 + ! ice to gas ratio + if ( c_h2o(i,j,l) > 0.d0) then + I2G = (cldice(i,j,l) / c_h2o(i,j,l)) * conv_NH3 + else + I2G = 0.d0 + endif + L2G = cldliq(i,j,l) * R * tmpu(i,j,l) * & + Kstar298 * EXP( -H298_R * ( ( 1d0 / tmpu(i,j,l) ) - INV_T0 ) ) + ! fraction of NH3 in liquid & ice phases + C_TOT = 1d0 + L2G + I2G + F_L = L2G / C_TOT + F_I = I2G / C_TOT + ! compute kg, the retention factor for liquid NH3 is 0 at T < 248K and + ! 0.05 at 248K < T < 268K + if (tmpu(i,j,l) >=268d0) then + kg = kc * ( F_L+F_I ) + elseif ( (248d0 < tmpu(i,j,l)) .and. (tmpu(i,j,l) < 268d0) ) then + kg = kc * ( (0.05*F_L)+F_I ) + else + kg = kc * F_I + endif + if(kg > 0.d0 .and. vud(i,j,l) > 1.e-14) & + f(i,j,l,n) = 1.0 - EXP( -kg * delz(i,j,l) / vud(i,j,l) ) + ENDDO + ENDDO + ENDDO + endif + +! Special treatment for DMS and SO2 if aero_type is "sulfur" + if(trim(aero_type) .eq. 'sulfur') then + + if(.not.present(h2o2)) call die ('GOCARTConvectionMod.F90', & + 'missing required H2O2 for sulfur') + + if(n .eq. n1) f(:,:,:,n1) = 0.0 ! DMS + !if(n .eq. n1+1) f(:,:,:,n1+1) = 0.0 ! SO2 for now is not scavenged +#undef PRC +!#ifdef PRC + if(n .eq. n1+1) then ! SO2 requires special handling + + !============================================================== + ! Coupled full chemistry/aerosol simulation: + ! Use the wet scavenging formula of Chin et al [1996], + ! such that a soluble fraction of SO2 is limited by the + ! availability of H2O2 in the precipitating grid box. + ! Scavenge the soluble SO2 at the same rate as the sulfate. + ! Update H2O2_sav and SO2_sav for use in RAINOUT, WASHOUT + !============================================================== + DO L = 2, KM + DO J = j1, j2 + DO I = i1, i2 + + ! Make sure to deplete H2O2s the same as SO2s. + ! (dkh, rjp, bmy, 11/17/05) + ! based on GEOS-Chem. tq, 01/09 + + IF ( tc1(i,j,l,n) > epsilon ) THEN + + ! limit f + so2loss = MIN( h2o2(i,j,l), tc1(i,j,l,n) ) + f(i,j,l,n) = f(i,j,l,n) * so2loss / tc1(i,j,l,n) + f(i,j,l,n) = MAX(f(i,j,l,n), 0.0) + + ! update saved h2o2 concentration + h2o2(i,j,l) = h2o2(i,j,l) - ( tc1(i,j,l,n) * f(i,j,l,n) ) + h2o2(i,j,l) = MAX( h2o2(i,j,l), epsilon ) + + ELSE + + ! set f = 0 if so2 < epsilon (dkh, rjp, bmy, 11/17/05) + f(i,j,l,n) = 0.d0 + + END IF + + ENDDO + ENDDO + ENDDO + endif ! SO2 +!#endif + endif ! sulfur + + ENDDO ! n + +! if tracer is type "carbon" then set coefficient to 0 for hydrophobic +! implementing QQ Wang's change by Huisheng Bian (4/24/2015) +! not scavenging BCn1 (hydrophobic) when T > 258 K + if(trim(aero_type) .eq. 'OC') f(:,:,:,n1) = 0d0 + +! suppress scavenging most aerosols at cold T except BCn1 (hydrophobic), dust, and HNO3 + if (trim(aero_type) .eq. 'BC') then + where (tmpu >= 258.d0) + f(:,:,:,n1) = 0.d0 + end where + end if + + if (trim(aero_type) .eq. 'BC') then + where (tmpu < 258.d0) + f(:,:,:,n2) = 0.d0 + end where + end if + + if (trim(aero_type) .eq. 'OC' .or. & + trim(aero_type) .eq. 'sea_salt' .or. & + trim(aero_type) .eq. 'sulfur' .or. & + trim(aero_type) .eq. 'seasalt' .or. & + trim(aero_type) .eq. 'sulfate' .or. & + trim(aero_type) .eq. 'nitrate' .or. & + trim(aero_type) .eq. 'bromine' .or. & + trim(aero_type) .eq. 'NH3' .or. & + trim(aero_type) .eq. 'NH4a') then + + do n = n1, n2 + where (tmpu < 258.d0 ) + f(:,:,:,n) = 0.d0 + endwhere + end do + + end if + + + ! re-index for routine cldcnv + cldmas_tmp(:,:,1:km) = cldmas(:,:,2:km+1) + + ! internal time step for the convection routine is 300s + CALL cldcnv(i1, i2, j1, j2, km, n1, n2, dt_30m, aero_type, & + tc, f, airmass, area, cldmas_tmp, dtrain, delz, delp) + + ! -- Mass balance + SELECT CASE(TRIM(aero_type)) + + CASE('sulfur') + NSO2 = n1+1 + NSO4 = n1+2 + NMSA = n1+3 + + cldso2 = 0.0d0 + cldso4 = 0.0d0 + cldmsa = 0.0d0 + + DO l = 1,km + DO j = j1, j2 + DO i = i1, i2 + cldso2(i,j,l) = cldso2(i,j,l) + & + (tc(i,j,l,NSO2) - tc1(i,j,l,NSO2)) * airmass(i,j,l) + cldso4(i,j,l) = cldso4(i,j,l) + & + (tc(i,j,l,NSO4) - tc1(i,j,l,NSO4)) * airmass(i,j,l) + cldmsa(i,j,l) = cldmsa(i,j,l) + & + (tc(i,j,l,NMSA) - tc1(i,j,l,NMSA)) * airmass(i,j,l) + END DO + END DO + END DO + + DO n = n1, n2 + DO i = i1, i2 + DO j = j1, j2 + bcnv(i,j,n) = 0.0 + DO l = 1,km + IF (tc(i,j,l,n) < 0.0) tc(i,j,l,n) = 1.0E-32 + ! kg tracer + bcnv(i,j,n) = bcnv(i,j,n) + & + (tc(i,j,l,n) - tc1(i,j,l,n)) *airmass(i,j,l) + END DO + END DO + END DO + END DO + + CASE('co') + cldscv = 0.0d0 + DO n = n1, n2 + DO l = 1,km + DO j = j1, j2 + DO i = i1, i2 + cldscv(i,j,l,n) = cldscv(i,j,l,n) + & + ! wet_conv_in(i,j,l,n) = wet_conv_in(i,j,l,n) + & + (tc(i,j,l,n) - tc1(i,j,l,n)) * airmol(i,j,l) + END DO + END DO + END DO + END DO + + bcnv(:,:,:) = 0.0 + DO n = n1, n2 + DO i = i1, i2 + DO j = j1, j2 + DO l = 1,km + IF (tc(i,j,l,n) < 0.0) tc(i,j,l,n) = 1.0E-32 + bcnv(i,j,n) = bcnv(i,j,n) + & + (tc(i,j,l,n) - tc1(i,j,l,n)) * airmol(i,j,l) + END DO + END DO + END DO + END DO + + CASE DEFAULT + +!!$ DO n = n1, n2 +!!$ DO l = 1,km +!!$ DO j = j1, j2 +!!$ DO i = i1, i2 +!!$ wet_conv_in(i,j,l,n) = wet_conv_in(i,j,l,n) + & +!!$ (tc(i,j,l,n) - tc1(i,j,l,n)) * airmass(i,j,l) +!!$ END DO +!!$ END DO +!!$ END DO +!!$ END DO + + DO n = n1, n2 + DO i = i1, i2 + DO j = j1, j2 + bcnv(i,j,n) = 0.0 + DO l = 1,km + IF (tc(i,j,l,n) < 0.0) tc(i,j,l,n) = 1.0E-32 + bcnv(i,j,n) = bcnv(i,j,n) + & + (tc(i,j,l,n) - tc1(i,j,l,n)) * airmass(i,j,l) + END DO + END DO + END DO + END DO + + END SELECT + +! tcnv(:,:,:) = tcnv(:,:,:) + bcnv(:,:,:) + +END SUBROUTINE convection + + + +! ---------------------------------------------------------------------------------- +! set_vud + SUBROUTINE set_vud(i1, i2, j1, j2, km, frlake, frocean, frseaice, cldmas, qccu, & + airmass, delz, area, vud) + + INTEGER, INTENT(IN) :: i1, i2, j1, j2, km + REAL*8, INTENT(IN), DIMENSION(i1:i2,j1:j2) :: frlake, frocean, frseaice + REAL*8, INTENT(IN), DIMENSION(i1:i2,j1:j2) :: area + REAL*8, INTENT(IN), DIMENSION(i1:i2,j1:j2,km) :: qccu, airmass, delz + REAL*8, INTENT(IN), DIMENSION(i1:i2,j1:j2,km+1) :: cldmas + REAL*8, INTENT(OUT) :: vud(i1:i2,j1:j2,km) + + REAL*8, PARAMETER :: max_vud=100 ! maximum updraft velocity [m/s] + REAL*8 :: water(i1:i2,j1:j2), dvud(i1:i2,j1:j2,km) + INTEGER :: i, j, k + + ! executable statements + + !============================================================== + ! Compute vud -- 5 m/s over oceans, 10 m/s over land + ! Assume vud is the same at all altitudes; the array can be 2-D + !============================================================== +! WHERE ((frlake + frocean - frseaice) >= 0.5) ! water +! dvud = 5.0 +! ELSEWHERE ! land (including permanent ice) and sea ice +! dvud = 10.0 +! END WHERE + + water = frlake + frocean - frseaice + WHERE (water < 0.0) water = 0.0 + WHERE (water > 1.0) water = 1.0 + ! Compute updraft velocity as a weighted average over water and land+ice. + DO k = 1,km +! dvud(:,:,k) = water(:,:)*5.0 + MAX((1.0-water(:,:)),0.0)*10.0 + dvud(:,:,k) = water(:,:)*5.0 + (1.0-water(:,:))*10.0 + END DO + + ! compute updraft velocity from cldmas=rho*vud + + DO k = 1,km-1 + DO j = j1,j2 + DO i = i1,i2 + IF (qccu(i,j,k) >= TINY(0.0)) THEN + vud(i,j,k) = cldmas(i,j,k+1)/(qccu(i,j,k)*airmass(i,j,k)) * & + area(i,j) * delz(i,j,k) + ELSE + vud(i,j,k) = dvud(i,j,k) + END IF + END DO + END DO + END DO + + vud(:,:,km) = 0.0 + + ! What should be used as threshold value here? 100 m/s? +! WHERE (vud > max_vud) vud = max_vud + WHERE (vud > max_vud) vud = dvud + + END SUBROUTINE set_vud + + +! ---------------------------------------------------------------------------------- +! SUBROUTINE COMPUTE_F( i1, i2 ,j1 ,j2, km, n, aero_type, F, bxheight, vud, tc1, h2o2, kc) + SUBROUTINE COMPUTE_F( i1, i2 ,j1 ,j2, km, n, aero_type, F, bxheight, vud, tc1, kc) +! +!****************************************************************************** +! Subroutine COMPUTE_F computes F, the fraction of soluble tracer lost by +! scavenging in convective cloud updrafts. (hyl, bmy, djj, 2/23/00, 7/20/04) +! +! Arguments as Input: +! ============================================================================ +! (1 ) N (INTEGER) : Tracer number +! +! Arguments as Output: +! ============================================================================ +! (2 ) F (REAL*8) : Fraction of tracer scavenged in cloud updraft [0-1] +! +! References (see above for full citations): +! =========================================================================== +! (1 ) Jacob et al, 2000 +! (2 ) Chin et al, 1996 +! +! NOTES: +! (1 ) Currently works computes scavenging fractions for either full +! chemistry simulation (NSRCX == 3) or Rn-Pb-Be chemistry simulation +! (NSRCX == 1). Set the scavenging fraction to zero for other +! simulations which do not carry soluble tracers. (bmy, 3/2/00) +! (2 ) Need to call INIT_SCAV to initialize the Vud, C_H2O, CLDLIQ, +! and CLDICE fields once per timestep. (bmy, 2/23/00) +! (3 ) For aerosols only: now apply Eq. 2 for all temperatures. Also +! use the distance between the grid box centers in Eq. 2. Updated +! comments and made some cosmetic changes (hyl, bmy, 6/18/01) +! (4 ) Remove IREF, JREF -- these are obsolete. T is now dimensioned +! (I1:I2,J1:J2,KM). T(IREF,JREF,L) is now T(I,J,L). (bmy, 9/27/01) +! (5 ) Removed obsolete code from 9/01 (bmy, 10/23/01) +! (6 ) Fix 2 bugs for aerosol scavenging in Rn-Pb-Be simulation: +! (a) set F(:,:,1) = 0 since we don't do any scavenging there. +! (b) DO L = 2, KM to avoid any subscript range out of bounds +! errors (rjp, hyl, bmy, 1/10/02) +! (7 ) Now set F=0 in the first level for all tracers. Also now +! compute the distance between grid box centers and use that in +! in Eq. 10 from Jacob et al, 2000 to compute F. (hyl, bmy, 1/24/02) +! (8 ) Eliminated obsolete code from 1/02 (bmy, 2/27/02) +! (9 ) Now reference T from "dao_mod.f" instead of from "CMN". Also reference +! BXHEIGHT from "dao_mod.f" instead of from "CMN_NOX". Now bundled +! into "wetscav_mod.f". Now references IDTHNO3, IDTH2O2, etc, from +! F90 module "tracerid_mod.f". Added internal routines F_AEROSOL +! and GET_ISOL. Rewritten so that we don't duplicate code for +! different chemistry simulations. (bmy, 1/17/03) +! (10) Now compute F for SO2 in the same way for both fullchem and offline +! simulations (rjp, bmy, 3/23/03) +! (11) Added slots for carbon aerosol & dust tracers. Now modified internal +! routine GET_ISOL so it's not hardwired anymore. (rjp, bmy, 4/5/04) +! (12) Added slots for sea salt aerosol tracers (rjp, bec, bmy, 4/20/04) +! (13) Added slots for secondary organic aerosol tracers (rjp, bmy, 7/13/04) +! (14) Remove reference to CMN, it's not needed. Made internal routine +! F_AEROSOL a module procedure rather than an internal routine to +! COMPUTE_F in order to facilitate parallelization on the Altix. Also +! now pass all arguments explicitly to F_AEROSOL. (bmy, 7/20/04) +!****************************************************************************** +! + ! References to F90 modules + +! USE mo_control, ONLY: lsadirect +! USE mo_tracer, ONLY: NBC1, NOC1, NBC2, NOC2, NDMS, NSO2, NSO4, NMSA, & +! NCO, NCOSA, NCOEA, NCOEU, NCONA, NCOOR, & +! NAVOC, NBVOC, NCOAVOC, NCOBVOC, NCOCH4, & +! NCOSM, NCOAF, NCOAU, NCOFF, NCOBF, NCOBB, NCOBI, & +! aero_type + + IMPLICIT NONE + + ! Arguments + INTEGER, INTENT(IN) :: i1, i2, j1, j2, km + character(len=*) :: aero_type + INTEGER, INTENT(IN) :: n + REAL*8, INTENT(IN) :: bxheight(I1:I2,J1:J2,KM), vud(i1:i2,j1:j2,km) + REAL*8, INTENT(IN) :: kc +! REAL*8, INTENT(INOUT) :: tc1(i1:i2,j1:j2,km), h2o2(i1:i2,j1:j2,km) + REAL*8, INTENT(INOUT) :: tc1(i1:i2,j1:j2,km) + REAL*8, INTENT(OUT) :: f(I1:I2,J1:J2,KM) + + ! Local variables + + ! Kc is the conversion rate from cloud condensate to precip [s^-1] +! REAL*8, PARAMETER :: KC = 5.0E-3 + + ! CONV = 0.6 * SQRT( 1.9 ), used for the ice to gas ratio for H2O2 + REAL*8, PARAMETER :: CONV = 8.27042925126E-1 + ! epsilon: A very small positive number [unitless] + REAL*8, PARAMETER :: EPSILON = 1.0E-32 + + !================================================================= + ! COMPUTE_F begins here! + ! + ! For aerosol tracers, compute F with internal routine F_AEROSOL. + ! + ! ISOL = tracer index for the ND38 diagnostic. Values are: + ! + ! Tracer Rn-Pb-Be run Fullchem run Offline sulfate run + ! ------ ------------ ------------ ------------------- + ! 210Pb 1 - - + ! 7Be 2 - - + ! HNO3 - 1 - + ! H2O2 - 2 7 + ! CH2O - 3 - + ! MP - 4 - + ! SO2 - 5 1 + ! SO4 - 6 2 + ! MSA - 7 3 + ! NH3 - 8 4 + ! NH4 - 9 5 + ! NIT - 10 6 + !================================================================= + + _UNUSED_DUMMY(tc1) + _UNUSED_DUMMY(n) + + SELECT CASE (TRIM(aero_type)) + + CASE ('sulfur') + +#undef PRC +#ifdef PRC + +! SO2 + IF ( n == NSO2 ) THEN + + !--------------------------- + ! SO2 (aerosol) + !--------------------------- + + ! Compute fraction of SO2 scavenged + + CALL f_aerosol(i1, i2, j1, j2, km, kc, f, bxheight, vud ) + + !============================================================== + ! Coupled full chemistry/aerosol simulation: + ! Use the wet scavenging formula of Chin et al [1996], + ! such that a soluble fraction of SO2 is limited by the + ! availability of H2O2 in the precipitating grid box. + ! Scavenge the soluble SO2 at the same rate as the sulfate. + ! Update H2O2_sav and SO2_sav for use in RAINOUT, WASHOUT + !============================================================== + DO L = 2, KM + DO J = j1, j2 + DO I = i1, i2 + + ! Make sure to deplete H2O2s the same as SO2s. + ! (dkh, rjp, bmy, 11/17/05) + ! based on GEOS-Chem. tq, 01/09 + + IF ( tc1(i,j,l) > epsilon ) THEN + + ! limit f + so2loss = MIN( h2o2(i,j,l), tc1(i,j,l) ) + f(i,j,l) = f(i,j,l) * so2loss / tc1(i,j,l) + f(i,j,l) = MAX(f(i,j,l), 0.0) + + ! update saved h2o2 concentration + h2o2(i,j,l) = h2o2(i,j,l) - ( tc1(i,j,l) * f(i,j,l) ) + h2o2(i,j,l) = MAX( h2o2(i,j,l), epsilon ) + + ELSE + + ! set f = 0 if so2 < epsilon (dkh, rjp, bmy, 11/17/05) + f(i,j,l) = 0.0 + + END IF + + ENDDO + ENDDO + ENDDO + + ELSE IF ( n == NSO4 ) THEN + + !---------------------------- + ! SO4 (aerosol) + !---------------------------- + + CALL f_aerosol(i1, i2, j1, j2, km, kc, f, bxheight, vud ) + + ELSE IF ( n == NMSA ) THEN + + !--------------------------- + ! MSA (aerosol) + !--------------------------- + + CALL f_aerosol(i1, i2, j1, j2, km, kc, f, bxheight, vud ) + + ELSE IF ( n == NDMS) THEN + + !--------------------------- + ! DMS (aerosol) + !--------------------------- + + !---------------------------- + ! Insoluble tracer, set F=0 + !---------------------------- + + F(:,:,:) = 0.0 + + ENDIF +#endif +F = 0.0 + + CASE ('carbon') + +! PRC rewrite this a bit +! IF ( n == n2 ) THEN + + !---------------------------- + ! HYDROPHILIC (aerosol) + !---------------------------- + + CALL f_aerosol(i1, i2, j1, j2, km, kc, f, bxheight, vud ) + + +! ELSE IF ( n == n1 ) THEN + +! !---------------------------- +! ! HYDROPHOBIC (aerosol) +! !---------------------------- + +! ! Force not to be lost in convective updraft for now +! F = 0.0 + +! END IF + + CASE ('dust') + + !---------------------------- + ! DUST (aerosol) (all dust bins) + !---------------------------- + + CALL f_aerosol(i1, i2, j1, j2, km, kc, f, bxheight, vud ) + + CASE ('sea_salt') + + !---------------------------- + ! seasalt aerosol (accum mode and coarse mode) + !---------------------------- + + CALL f_aerosol(i1, i2, j1, j2, km, kc, f, bxheight, vud ) + + CASE ('co') + + IF ( lsadirect ) THEN + + CALL f_aerosol(i1, i2, j1, j2, km, kc, f, bxheight, vud ) + + ELSE + + !---------------------------- + ! ALL CO ARE HYDROPHOBIC + !---------------------------- + + ! Force not to be lost in convective updraft for now + F = 0.0 + + END IF + + + END SELECT + + ! Return to calling program + +END SUBROUTINE COMPUTE_F + + +! ---------------------------------------------------------------------------------- + SUBROUTINE f_aerosol( i1, i2, j1, j2, km, kc, f, bxheight, vud) +! +!****************************************************************************** +! Subroutine F_AEROSOL returns the fraction of aerosol scavenged in updrafts +! (bmy, 11/7/02, 7/20/04) +! +! Arguments as Input: +! ============================================================================ +! (1 ) KC (REAL*8) : Conversion rate from cloud condensate to precip [s^-1] +! +! Arguments as Output: +! ============================================================================ +! (2 ) F (REAL*8) : Fraction of aerosol scavenged in updrafts [unitless] +! +! NOTES: +! (1 ) Split off +!****************************************************************************** +! + ! References to F90 modules + + IMPLICIT NONE + + ! Arguments + INTEGER, INTENT(IN) :: i1, i2, j1, j2, km + REAL*8, INTENT(IN) :: kc + REAL*8, INTENT(IN) :: bxheight(i1:i2,j1:j2,km), vud(i1:i2,j1:j2,km) + REAL*8, INTENT(OUT) :: f(i1:i2,j1:j2,km) + + ! Local variables + INTEGER :: i, j, l + + !================================================================= + ! F_AEROSOL begins here! + ! + ! Aerosol tracers are 100% in the cloud condensate phase, so + ! we set K = Kc, and compute F accordingly (cf Jacob et al 2000 ) + !================================================================= + + ! Turn off scavenging in the first level by setting F = 0 +!!! f(:,:,1) = 0.0 + + ! Apply scavenging in levels 2 and higher +!! DO l = 2, km + + DO l = 1, km-1 + DO j = j1, j2 + DO i = i1, i2 + ! Distance between grid box centers [m] +! tmp = 0.5 * ( bxheight(i,j,l-1) + bxheight(i,j,l) ) + + ! (Eq. 2, Jacob et al, 2000, with K = Kc) +! f(i,j,l) = 1.0 - EXP( -kc * tmp / vud(i,j,l) ) + if(vud(i,j,l) > 1.e-14) & + f(i,j,l) = 1.0 - EXP( -kc * bxheight(i,j,l) / vud(i,j,l) ) + + END DO + END DO + END DO + + ! Return to calling program +END SUBROUTINE f_aerosol + +! ---------------------------------------------------------------------------------- + SUBROUTINE cldcnv(i1, i2, j1, j2, km, n1, n2, dt_conv, aero_type, & + q, f, airmass, area, cldmas, dtrn, delz, delp) + +! ============================================================================ +! +! This is the cumulus transport module for 3D GEOS-CTM. +! Author: Shian-Jiann Lin, Code 910.3, NASA/GSFC, +! Feb 12, 1997. +! Version 3, Detrainment and Entrainment are considered. +! The algorithm reduces to that of version 2 if Dtrn = 0. +! +! Q: tracer mixing ratio. +! CLDMAS: cloud mass flux in kg/(s m**2); must be positive definite. +! DTRN: Detrainment rate in kg/(s m**2); must be positive definite. +! NDT: Large scale advection time step (SEC.). +! +! +! +! ^ +! | +! | +! ------ cldmas(k) ----------- +! +! q(k), dtrn(k) (layer k) +! +! ----- cldmas(k-1) ----------- +! ^ +! | +! | +! +! ============================================================================ +! +! cldcnv modified by Bob Yantosca and Mian Chin for wet scavenging of +! soluble species in cloud updraft. +! Modified by Thomas Diehl for usage with GEOS-5 data. +! +! ============================================================================ + + IMPLICIT NONE + + INTEGER, INTENT(IN) :: i1, i2, j1, j2, km, n1, n2, dt_conv + character(len=*) :: aero_type + REAL*8, INTENT(IN), DIMENSION(i1:i2,j1:j2,km) :: airmass, cldmas, dtrn + REAL*8, INTENT(IN) :: delz(i1:i2,j1:j2,km), delp(i1:i2,j1:j2,km), area(i1:i2,j1:j2) + REAL*8, INTENT(IN) :: f(i1:i2,j1:j2,km,n1:n2) +! REAL*8, INTENT(INOUT) :: q(i1:i2,j1:j2,km,n1:n2), h2o2(i1:i2,j1:j2,km) + REAL*8, INTENT(INOUT) :: q(i1:i2,j1:j2,km,n1:n2) + + REAL*8 :: bmass(i1:i2,j1:j2,km), qb(i1:i2,j1:j2), mb(i1:i2,j1:j2), qc(i1:i2,j1:j2) + REAL*8 :: tdt, qc_pres, cmout, entrn, delq + REAL*8 :: term_1, term_2, term_3, term_4, tsum + INTEGER :: nsteps, ktop, ic, istep, i, j, k + REAL*8, PARAMETER :: tiny = 1.0E-14 + + ! executable statements + +! ============================================================================ +! Define active convective region,from J = JS(outh) to J = JN(orth), +! and to level K = KTOP. +! +! Polar regions are too cold to have moist convection. +! (Dry convection should be done elsewhere.) +! ============================================================================ + + ktop = km - 1 +! jump = (jmx - 1)/20 +! js = 1 + jump +! jn = jmx - js + 1 + +!write(*,*) js, jn +!write(*,*) minval(q), maxval(q) +!write(*,*) minval(delp), maxval(delp) + +! ============================================================================ +! Internal time step for convective mixing is 300 sec. +! ============================================================================ + +! Use fixed internal convection time step of 300s +! nstep: number of internal time steps to reach dt_conv, which is the external + ! time interval for the convection process + + _UNUSED_DUMMY(aero_type) + _UNUSED_DUMMY(delz) + + nsteps = dt_conv / 300 + nsteps = MAX(nsteps,1) + tdt = REAL(dt_conv) / REAL(nsteps) + +! ============================================================================ +! Compute air mass of each grid box (I,J,K). +! ============================================================================ + + DO k = 1,km + DO j = j1, j2 + DO i = i1, i2 + bmass(i,j,k) = airmass(i,j,k)/area(i,j) + END DO + END DO + END DO + + tracer_loop: DO ic = n1, n2 + time_loop: DO istep = 1,nsteps + +! ============================================================================ +! (1) Below cloud base +! +! If Cloud Mass Flux exists at (I,J,2), then compute QB. +! QB is "weighted average" mixing ratio below the cloud base. +! QB is used to compute QC, which is defined as: +! +! QC = ( Total mass of tracer below cloud base + +! Subsidence into cloud base from above ) +! ------------------------------------------------------- +! Total air mass below cloud base +! +! MB is the total mass of air below the cloud base. +! ============================================================================ + + j_loop_1: DO j = j1, j2 + i_loop_1: DO i = i1, i2 + + IF (cldmas(i,j,2) > tiny) THEN + + qb(i,j) = & + (q(i,j,1,ic)*delp(i,j,1) + q(i,j,2,ic)*delp(i,j,2)) / & + (delp(i,j,1) + delp(i,j,2)) + + ! alternative: + ! use delz as weight +! qb(i,j) = (q(i,j,1,ic)*delz(i,j,1) + & +! q(i,j,2,ic)*delz(i,j,2)) / & +! (delz(i,j,1) + delz(i,j,2)) + + mb(i,j) = bmass(i,j,1) + bmass(i,j,2) + + qc(i,j) = & + ( mb(i,j) * qb(i,j) + & + cldmas(i,j,2) * q(i,j,3,ic) * tdt) / & + ( mb(i,j) + cldmas(i,j,2) * tdt) + +! ============================================================================ +! Compute net change in mixing ratio. +! +! DQ = QB - QC is the total mass to be transported out of the cloud base. +! Changes below cloud base are proportional to the background mass. +! +! Subtract DQ from Q(*,*,K=1,*) and from Q(*,*,K=2,*), but do not make +! Q(*,*,K=1,*) or Q(*,*,K=2,*) negative. +! ============================================================================ + +! modification for now based on GEOS-CHEM +! should be revisited ... + +! dq = qb(i,j) - qc(i,j) +! IF (dq > q(i,j,1,ic) .OR. dq > q(i,j,2,ic)) THEN +! q(i,j,2,ic) = qc(i,j) +! q(i,j,1,ic) = qc(i,j) +! ELSE +! q(i,j,2,ic) = q(i,j,2,ic) - dq +! q(i,j,1,ic) = q(i,j,1,ic) - dq +! END IF + + q(i,j,2,ic) = qc(i,j) + q(i,j,1,ic) = qc(i,j) + +! ============================================================================ +! If there is no Cloud mass flux, set QC = Q(K=3) at this I,J location +! ============================================================================ + ELSE + qc(i,j) = q(i,j,3,ic) + END IF + END DO i_loop_1 + END DO j_loop_1 + +! ============================================================================ +! (2) Cloud interior mixing +! ============================================================================ + + k_loop: DO k = 3,ktop + + j_loop_2: DO j = j1, j2 + i_loop_2: DO i = i1, i2 + +! ============================================================================ +! If there is cloud mass flux at this location, do the convective +! transport. +! +! QC_PRES = amount of QC preserved against wet scavenging +! CMOUT = air mass flowing out of cloud at level K +! ENTRN = air mass flowing into cloud at level K +! +! If Entrainment >= 0 then compute the new value of QC(I,J): +! +! CLDMAS(K-1)*QC_PRES + ENTRN(K)*Q(K) +! QC(I,J) = --------------------------------------- +! CLDMAS(I,J,K) + DTRN(I,J,K) +! +! = tracer mass coming in from below (i.e. level K-1) + +! tracer mass coming in from this level (i.e. level K) +! ----------------------------------------------------------- +! total mass coming into cloud + +! +! Entrainment must be >= 0 (since we cannot have a negative flux of air +! into the cloud). This condition is strong enough to ensure that +! CMOUT > 0 and will prevent floating-point exception. +! ============================================================================ + + IF (cldmas(i,j,k-1) > tiny) THEN + + ! Soluble species are scavenged during entrainment. + qc_pres = qc(i,j) * (1.0 - f(i,j,k,ic)) + cmout = cldmas(i,j,k) + dtrn(i,j,k) + entrn = cmout - cldmas(i,j,k-1) + + IF (entrn >= 0.0) THEN + qc(i,j) = ( cldmas(i,j,k-1) * qc_pres + & + entrn * q(i,j,k,ic) ) / & + cmout + endif + +! ============================================================================ +! The cumulus transport above the cloud base is done as follows: +! C_k-1 = cloud air mass flux from level k-1 to level k +! C_k = cloud air mass flux from level k to level k+1 +! QC_k-1 = mixing ratio of tracer INSIDE CLOUD in level k-1 +! QC_k = mixing ratio of tracer INSIDE CLOUD in level k +! Q_k = mixing ratio of tracer in level k +! Q_k+1 = mixing ratio of tracer in level k+1 +! +! ( Cloud ) +! ( ) +! ( )3) C_k * Q_k+1 +! k+1 ( ^ ) | +! ------------(---------|----------)------------|-------- +! ( | ) V +! (2) C_k * QC_k ) +! ( ) +! k ( ) +! ( ^ )4) C_k-1 * Q_k +! ( | ) | +! ------------(---------|----------)------------|---------- +! k-1 ( | ) | +! (1) C_k-1 * QC_k-1 ) V +! ( * AP ) +! ( ) +! ( ) +! +! There are 4 terms that contribute to mass flow in and out of level k: +! +! 1) C_k-1 * QC_PRES = tracer convected from level k-1 to level k +! 2) C_k * QC_k = tracer convected from level k to level k+1 +! 3) C_k * Q_k+1 = tracer subsiding from level k+1 to level k +! 4) C_k-1 * Q_k = tracer subsiding from level k to level k-1 +! +! Therefore the change in tracer concentration is given by +! DELQ = (Term 1) - (Term 2) + (Term 3) - (Term 4) +! +! and Q(I,J,K,IC) = Q(I,J,K,IC) + DELQ +! +! ============================================================================ + + term_1 = cldmas(i,j,k-1) * qc_pres + term_2 = -cldmas(i,j,k ) * qc(i,j ) + term_3 = cldmas(i,j,k ) * q (i,j,k+1,ic) + term_4 = -cldmas(i,j,k-1) * q (i,j,k, ic) + + tsum = term_1 + term_2 + term_3 + term_4 + + delq = ( tdt / bmass(i,j,k) ) * tsum + + q(i,j,k,ic) = q(i,j,k,ic) + delq + + ! prevent concentrations from being negative + IF (q(i,j,k,ic) < 1.0E-32) q(i,j,k,ic) = 1.0E-32 + + ELSE +! ============================================================================ +! No cloud transport if cloud mass flux < TINY; Change Qc to q +! ============================================================================ + + qc(i,j) = q(i,j,k,ic) + + !-------------------------------------------------- + ! FIX FOR GEOS-5 MET FIELDS! + ! + ! Bug fix for the cloud base layer, which is not + ! necessarily in the boundary layer, and for + ! GEOS-5, there could be "secondary convection + ! plumes - one in the PBL and another one not. + ! + ! NOTE: TERM_2 and TERM_3 are the same terms as described + ! in the above section. + ! + ! (swu, 08/13/2007) + !-------------------------------------------------- + IF ( cldmas(i,j,k) > tiny ) THEN + ! Tracer convected from K -> K+1 + term_2 = -cldmas(i,j,k ) * qc(i,j) + + ! Tracer subsiding from K+1 -> K + term_3 = cldmas(i,j,k ) * q (i,j,k+1,ic) + + ! Change in tracer concentration + delq = ( tdt / bmass(i,j,k) ) * (term_2 + term_3) + + ! Add change in tracer to Q array + q(i,j,k,ic) = q(i,j,k,ic) + delq + + ! prevent concentrations from being negative + IF (q(i,j,k,ic) < 1.0E-32) q(i,j,k,ic) = 1.0E-32 + END IF + + END IF + + END DO i_loop_2 + END DO j_loop_2 + END DO k_loop + + END DO time_loop + END DO tracer_loop + +END SUBROUTINE cldcnv + +end module diff --git a/ESMF/Shared/Chem_Shared/DryDepositionMod.F90 b/ESMF/Shared/Chem_Shared/DryDepositionMod.F90 new file mode 100644 index 00000000..ef69d9c6 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/DryDepositionMod.F90 @@ -0,0 +1,279 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: DryDepositionMod --- Aerosol Turbulent Deposition Module +! +! !INTERFACE: +! + + module DryDepositionMod + +! !USES: + + use Chem_Mod + use Chem_ConstMod, only: grav, von_karman, cpd ! Constants ! + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC DryDepositionGOCART + +! +! !DESCRIPTION: +! +! This module implements various dry deposition schemes +! +! !REVISION HISTORY: +! +! 08Jan2010 - Colarco, first crack +! +!EOP + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + +!------------------------------------------------------------------------- +CONTAINS + +! !IROUTINE: ObukhovLength - Calculate the Obukhov length scale stability parameter +! +! !INTERFACE: +! +! ========================================================================= +! Calculate the Obukhov length scale +! Wesely and Hicks (1977) Journal of Air Pollution Control Association +! Equation 9. Note: we have adopted this from GOCART, which neglected +! the latent heat of evaporation term. Also, we are using surface +! mid-layer values of air density and temperature, not absolute surface +! values (and not the potential temperature, either). + + subroutine ObukhovLength ( i1, i2, j1, j2, & + t, rhoa, shflux, ustar, & + obk ) + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2 + real, dimension(i1:i2,j1:j2) :: t ! temperature [K] + real, dimension(i1:i2,j1:j2) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:) :: ustar ! friction speed [m s-1] + real, pointer, dimension(:,:) :: shflux ! sfc. sens. heat flux [W m-2] + +! !OUTPUT PARAMETERS + real, dimension(i1:i2,j1:j2) :: obk ! Obukhov length [m] + +! Local + +! Calculate the Monin-Obhukov length: +! -Air density * Cp * T(surface) * Ustar^3 +! OBK = ------------------------------------------- +! vK * g * Sensible heat flux +! vK = 0.4 von Karman constant +! Cp = 1000 J kg-1 K-1 specific heat of air at constant pressure +! If OBK < 0 the air is unstable; if OBK > 0 the air is stable +! For sensible heat flux of zero OBK goes to infinity (set to 1.e5) + + obk = 1.e5 + where(abs(shflux) > 1.e-32) & + obk = - rhoa * cpd * t * ustar**3. & + / (von_karman * grav * shflux) + + return + end subroutine ObukhovLength + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: DryDepositionGOCART - Calculate aerosol dry deposition for lowest layer +! +! !INTERFACE: +! + + subroutine DryDepositionGOCART ( i1, i2, j1, j2, km, & + tmpu, rhoa, hghte, oro, ustar, & + pblh, shflux, z0h, drydepf, rc, & + radius, rhop, u10m, v10m, fraclake, gwettop ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2, km + real, pointer, dimension(:,:,:) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:,:) :: hghte ! top of layer geopotential height [m] + real, pointer, dimension(:,:) :: oro ! orography flag + real, pointer, dimension(:,:) :: ustar ! friction speed + real, pointer, dimension(:,:) :: pblh ! PBL height [m] + real, pointer, dimension(:,:) :: shflux ! sfc. sens. heat flux [W m-2] + real, pointer, dimension(:,:) :: z0h ! rough height, sens. heat [m] + +! !OUTPUT PARAMETERS: + real :: drydepf(i1:i2,j1:j2) ! Deposition frequency [s-1] + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - +! !OPTIONAL PARAMETERS: +! If these parameters are provided we compute a "resuspension" term as +! if the particles are lifted like dust + real, optional :: radius ! particle radius [m] + real, optional :: rhop ! particle density [kg m-3] + real, pointer, dimension(:,:), optional :: u10m ! 10-m u-wind component [m s-1] + real, pointer, dimension(:,:), optional :: v10m ! 10-m v-wind component [m s-1] + real, pointer, dimension(:,:), optional :: fraclake ! fraction covered by water + real, pointer, dimension(:,:), optional :: gwettop ! fraction soil moisture + + + +! !DESCRIPTION: Calculates the deposition velocity for aerosols in the lowest +! model layer. +! +! !REVISION HISTORY: +! +! 08Jan2010 - Colarco, based on GOCART implementation, does not +! include any size dependent deposition term +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + character(len=*), parameter :: myname = 'DryDepositionGOCART' + integer :: i, j + real, parameter :: rhow = 1000. ! density of water [kg m-3] + real, parameter :: coll_size = 0.002 ! collector size [m] + real :: dz(i1:i2,j1:j2) ! lowest layer thickness + real :: rmu(i1:i2,j1:j2) ! dynamic viscosity [kg m-1 s-1] + real :: Ra(i1:i2,j1:j2) ! aerodynamic resistance + real :: Rs(i1:i2,j1:j2) ! surface resistance + real :: vdep(i1:i2,j1:j2) ! Deposition speed [m s-1] + real :: obk(i1:i2,j1:j2) ! Obukhov Length [m] + + real*8 Rttl ! total surface resistance + + real*8 R2, w10m, u_thresh0 + real*8 vds, vdsmax, czh + real*8 :: frac, cz, psi_h, eps, logmfrac, z0h_min, z0h_ + real*8 :: one = 1.0, zero = 0.0 + +! Initialize local variables +! -------------------------- + +! Calculate the viscosity and thickness of the surface level + dz = hghte(:,:,km-1) - hghte(:,:,km) + rmu = 1.8325e-5*(416.16/(tmpu(i1:i2,j1:j2,km)+120.)) & + *(tmpu(i1:i2,j1:j2,km)/296.16)**1.5 + + z0h_min = 100. * tiny(1.0) ! because sometimes we may get z0h=0. + +! ========================================================================= +! Calculate the Obukhov length scale + call ObukhovLength ( i1, i2, j1, j2, & + tmpu(:,:,km), rhoa(:,:,km), shflux, ustar, & + obk ) + + +! ========================================================================= +! Aerodynamic Resistance +! psi_h and Ra are equations 2, 4-5 of Walcek et al. 1986 Atmospheric Environment +! + do j = j1, j2 + do i = i1, i2 + + cz = dz(i,j) / 2. + frac = cz / obk(i,j) + if(frac .gt. 1.) frac = 1. + if(frac .gt. 0. .and. frac .le. 1.) then + psi_h = -5.0*frac + else if (frac .lt. 0.) then + eps = min(one,-frac) + logmfrac = log(eps) + psi_h = exp(0.598 + 0.39*logmfrac - 0.09*(logmfrac)**2.) + endif + + z0h_ = max ( z0h(i,j), z0h_min ) + + Ra(i,j) = (log(cz/z0h_) - psi_h) / (von_karman*ustar(i,j)) + + enddo + enddo + +! ======================================================================= +! Surface Resistance term for aerosols +! Rs formulation from eqn. 15 - 18 of Walcek et al. 1986 Atmospheric Environment + +! Loop over space + do j = j1, j2 + do i = i1, i2 + +! Calculate the surface resistance term + vds = 0.002*ustar(i,j) +! Set to small value of vds if ustar too small + vds = max(vds, 0.002 * 0.00001) + if(obk(i,j) .lt. 0.) vds = vds*(1.+(-300./obk(i,j))**0.6667) + czh = pblh(i,j)/obk(i,j) + if(czh .lt. -30.) vds = 0.0009*ustar(i,j)*(-czh)**0.6667 +! vdsMax is from Table 2 of Walcek et al. 1986 +! There are actually seasonal and regionally varying values, +! but for most of the world a value of 1.0 cm s-1 is used. + vdsMax = 0.01 + + Rs(i,j) = 1./min(vds,vdsmax) + + if(Rs(i,j) .gt. 9999.) Rs(i,j) = 9999. + if(Rs(i,j) .lt. 1.) Rs(i,j) = 1. + +! If doing dust over land, possibly re-emit +! Logic is to check on optional provided parameter and modify R2 + R2 = 1. + if(present(fraclake) .and. present(u10m) .and. present(v10m) .and. & + present(radius) .and. present(rhop) .and. present(gwettop)) then + +! Calculate the threshold velocity for dust emissions + u_thresh0 = 0.13 * sqrt(rhop*grav*2.*radius/rhoa(i,j,km)) & + * sqrt(1.+6.e-7/(rhop*grav*(2.*radius)**2.5)) & + / sqrt(1.928*(1331.*(100.*2.*radius)**1.56+0.38)**0.092 - 1.) + w10m = sqrt(u10m(i,j)**2. + v10m(i,j)**2.) + +! Calculate the coefficient for resuspension + if(oro(i,j) .eq. OCEAN) then + R2 = 1. + else + R2 = fraclake(i,j)+(1.-fraclake(i,j)) & + *( gwettop(i,j)+(1.-gwettop(i,j)) & + *exp(-max(zero,(w10m-u_thresh0)))) + endif + endif + +! Now what is the deposition velocity + Rttl = Ra(i,j) + Rs(i,j) + + vdep(i,j) = 1./Rttl*R2 + +! Set a minimum value of deposition velocity + vdep(i,j) = max(vdep(i,j),1.e-4) + +! Save the dry deposition frequency for the chemical removal terms +! in units of s-1 + drydepf(i,j) = max(0.,vdep(i,j) / dz(i,j)) + + end do ! i + end do ! j + + rc = 0 + + end subroutine DryDepositionGOCART + + end module DryDepositionMod diff --git a/ESMF/Shared/Chem_Shared/DustEmissionMod.F90 b/ESMF/Shared/Chem_Shared/DustEmissionMod.F90 new file mode 100644 index 00000000..3edc6971 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/DustEmissionMod.F90 @@ -0,0 +1,712 @@ +#include "unused_dummy.H" +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: DustEmissionMod.F90 --- Calculate the dust emissions +! +! !INTERFACE: +! + + module DustEmissionMod + +! !USES: + + use Chem_Mod + use Chem_ConstMod, only: grav ! Constants ! + use Chem_UtilMod + use MAPL_ConstantsMod, only : MAPL_PI + + use m_mpout + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC DustEmissionDEAD + PUBLIC DustEmissionGOCART + PUBLIC DustEmissionSimple + PUBLIC MAM_DustEmissionGOCART + PUBLIC MAM_DustEmission + PUBLIC KokSizeDistribution + + + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + +! +! !DESCRIPTION: +! +! This module implements the Dust Emission calculations +! +! !REVISION HISTORY: +! +! 29Dec2009 Colarco First crack! +! +!EOP +!------------------------------------------------------------------------- +CONTAINS +! +! DEAD-based dust emission scheme (Zender et al., JGR, 2003) +! Pass in a grid of wind speeds and surface characteristics and +! returns the total dust emission mass flux [kg m-2 s-1]. +! Emissions need to be scaled by source function (ie., fraction of +! grid cell emitting) and distributed over a particle size distribution. +! +! !IROUTINE: DustEmissionDEAD - Compute the dust emissions +! +! !INTERFACE: +! + + subroutine DustEmissionDEAD( i1, i2, j1, j2, km, & + gwettop, oro, ustar, u10m, v10m, & + emissions, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km + real, pointer, dimension(:,:) :: gwettop, oro, ustar, u10m, v10m + +! !OUTPUT PARAMETERS: + + real :: emissions(i1:i2,j1:j2) ! Local emission + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'DustEmissionsDEAD' + +! !DESCRIPTION: Computes the dust emissions for one time step +! +! !REVISION HISTORY: +! +! 29Dec2009, Colarco - Modifications to change calling +! 10Oct2007, Nowottnick/Colarco - Implement simplified Zender source +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j + real, parameter :: air_dens = 1.25 ! Air density = 1.25 kg m-3 + real :: u_thresh0 ! dry bed, non-salting saltation threshold [m s-1] + real :: w10m + +! Variables and parameters specific to Zender source implementation + real :: fd ! drag partitioning eff. factor + ! dust effective diameter for monomodal soil + real, parameter :: soil_diameter = 75.e-6 + ! soil grain particle density [kg m-3] + real, parameter :: soil_density = 2650. + real, parameter :: zoms = 33.e-6 ! smooth roughness length [m] + real, parameter :: zom = 100.e-6 ! roughness length [m] + real, parameter :: mclay = 0.2 ! mass fraction of clay + real :: fw ! water eff. factor + real :: wt ! Threshold water content + real :: u_thresh_drag + real :: u_thresh_drag_water + real :: ustars ! Modified fric. vel for Owen Effect + real :: k_z ! Log profile for nonsaltating + real :: wt10m ! Threshold 10m wind speed + real, parameter :: cs=2.61 ! Constant for horiz flux + real :: rat ! Ratio of threshold to friction vel + real :: horiz_flux ! Horizontal Mass Flux + real :: vert_flux ! Vertical Mass Flux + real :: alpha ! Vertical Flux Conversion Factor [m-1] + + _UNUSED_DUMMY(km) + +! Initialize local variables +! -------------------------- + emissions(:,:) = 0. + +! Calculate drag partitioning efficiency to represent sink of atmos momentum +! to nonerodible roughness elements +! Assumes constant smooth roughness length zoms and constant roughness +! length for momentum transfer zom +! Zender 2003 eq. 3 + fd = ( 1.0 - & + ( log( zom/zoms ) / & + log( 0.35 * ( (0.1/zoms)**0.8 ) ) & + ) & + ) ** (-1.) + +! Calculate the threshold water content following Fecan et al. [1999] +! Assumes a globally constant mass fraction of clay in soil, mclay +! Zender 2003 eq. 5 (implicit a = 1) + wt = 0.17 * mclay + 0.14 * mclay**2 + +! Compute parameter for scaling horizontal to vertical mass flux, +! alpha = [1/m], Zender 2003 eq. 11 + alpha = 100. * exp( (13.4*mclay - 6.)*log(10.) ) + +! Calculate constant k for nonsaltating profile +! Gillette et al. [1998] eq. 3 + k_z = 0.4 / log(10./zom) + +! Calculate the threshold velocity of wind erosion [m/s] for each radius +! for a dry soil, as in Marticorena et al. [1997], eq. 1 +! Assumptions are a constant surface level air density (air_dens) +! and we compute threshold for a single particle size/density (soil_diameter +! and soil_density), equivalent to choosing a monomodal bed of potentially +! saltating particles. + u_thresh0 = 0.13 * sqrt(soil_density*grav*soil_diameter/air_dens) & + * sqrt(1.+6.e-7/(soil_density*grav*soil_diameter**2.5)) & + / sqrt(1.928*(1331.*(100.*soil_diameter)**1.56+0.38)**0.092 - 1.) + +! Apply the drag partitioning correction +! Equivalent to Marticorena [1997] eq. 4, where our fd = 1/(their)feff + u_thresh_drag = u_thresh0*fd + + +! Spatially dependent part of calculation +! --------------------------------------- + do j = j1, j2 + do i = i1, i2 + + if ( oro(i,j) /= LAND ) cycle ! only over LAND gridpoints + + w10m = sqrt(u10m(i,j)**2.+v10m(i,j)**2.) + +! Modify the threshold depending on soil moisture as in Fecan 1999 +! Zender 2003 eq. 6 + if (gwettop(i,j) <= wt) then + fw = 1.0 + else + fw = sqrt( 1. + 1.21 * (100. * (gwettop(i,j)-wt) )**0.68) + endif + u_thresh_drag_water = u_thresh_drag*fw + +! Modify friction velocity for Owen Effect +! Assumption of stable atmospheric profile to go from saltation +! wind speed to equivalent threshold at z = 10m +! Gillette et al. [1998] eq. 3 + wt10m = u_thresh_drag_water/k_z + if (w10m >= wt10m) then + ustars = ustar(i,j) + 0.003*((w10m-wt10m)**2) + else + ustars = ustar(i,j) + endif + +! Calculate the horizontal mass flux of dust [kg m-1 s-1] +! Marticorena et al. 1997 eq. 5 +! Note: differs from Zender et al. 2003 eq. 10 + rat = u_thresh_drag_water / ustars + if (rat < 1.0) then + horiz_flux = cs * air_dens * ustars**3 /grav * & + (1 - rat**2) * (1+rat) + + else + horiz_flux = 0.0 + endif + +! Calculate the vertical mass flux of dust and scale to source [kg m-2 s-1] + vert_flux = alpha * horiz_flux + + emissions(i,j) = vert_flux + + end do + end do + + rc = 0 + + end subroutine DustEmissionDEAD + + + +! +! GOCART-based dust emission scheme (modified from Ginoux et al., JGR, 2001) +! Pass in a grid of wind speeds, surface characteristics, and an aerosol +! particle radius and returns the total dust emission mass flux [kg m-2 s-1]. +! Emissions need to be scaled by source function (ie., fraction of +! grid cell emitting), tuning factor, and fractional soil content of particle +! size. +! +! !IROUTINE: DustEmissionGOCART - Compute the dust emissions +! +! !INTERFACE: +! + + subroutine DustEmissionGOCART( i1, i2, j1, j2, km, radius, & + fraclake, gwettop, oro, u10m, v10m, & + emissions, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km + real :: radius ! particle radius [m] + real, pointer, dimension(:,:) :: fraclake, gwettop, oro, u10m, v10m + +! !OUTPUT PARAMETERS: + + real :: emissions(i1:i2,j1:j2) ! Local emission + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'DustEmissionsGOCART' + +! !DESCRIPTION: Computes the dust emissions for one time step +! +! !REVISION HISTORY: +! +! 29Dec2009, Colarco - Modifications to change calling +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j + real, parameter :: air_dens = 1.25 ! Air density = 1.25 kg m-3 + real, parameter :: soil_density = 2650. ! km m-3 + real :: diameter ! dust effective diameter [m] + real :: u_thresh0 + real :: u_thresh + real :: w10m + + _UNUSED_DUMMY(km) + +! Initialize local variables +! -------------------------- + emissions(:,:) = 0. + +! Calculate the threshold velocity of wind erosion [m/s] for each radius +! for a dry soil, as in Marticorena et al. [1997]. +! The parameterization includes the air density which is assumed +! = 1.25 kg m-3 to speed the calculation. The error in air density is +! small compared to errors in other parameters. + diameter = 2. * radius + u_thresh0 = 0.13 * sqrt(soil_density*grav*diameter/air_dens) & + * sqrt(1.+6.e-7/(soil_density*grav*diameter**2.5)) & + / sqrt(1.928*(1331.*(100.*diameter)**1.56+0.38)**0.092 - 1.) + +!if(mapl_am_i_root())print*,'DustEmissionGOCART u_thresh0 = ', u_thresh0 + +! Spatially dependent part of calculation +! --------------------------------------- + do j = j1, j2 + do i = i1, i2 + + if ( oro(i,j) /= LAND ) cycle ! only over LAND gridpoints + + w10m = sqrt(u10m(i,j)**2.+v10m(i,j)**2.) + +! This should give emissions equal to about 200 Tg month-1 +! if(gcDU%src(i,j) .lt. 1.) then +! DU_emis(n)%data2d(i,j) = & +! 4.3064e-8*gcDU%sfrac(n)*gcDU%src(i,j) +! w_c%qa(n1+n-1)%data3d(i,j,km) = w_c%qa(n1+n-1)%data3d(i,j,km) & +! + DU_emis(n)%data2d(i,j)*cdt*grav/w_c%delp(i,j,km) +! endif + +! Modify the threshold depending on soil moisture as in Ginoux et al. [2001] + if(gwettop(i,j) .lt. 0.5) then + u_thresh = amax1(0.,u_thresh0* & + (1.2+0.2*alog10(max(1.e-3,gwettop(i,j))))) + + if(w10m .gt. u_thresh) then +! Emission of dust [kg m-2 s-1] + emissions(i,j) = & + (1.-fraclake(i,j)) * w10m**2. * (w10m-u_thresh) + +!if(mapl_am_i_root())print*,'DustEmissionGOCART u_thresh = ', u_thresh +!if(mapl_am_i_root())print*,'DustEmissionGOCART w10m = ', w10m + + endif + endif + + end do ! i + end do ! j + + rc = 0 + + end subroutine DustEmissionGOCART + + +! Simple version of GOCART like scheme, where a threshold value is provided +! along with a wind speed and the emissions are returned. No size information +! is implied. +! +! !IROUTINE: DustEmissionSimple - Compute the dust emissions +! +! !INTERFACE: +! + + subroutine DustEmissionSimple( i1, i2, j1, j2, ut0, & + fraclake, gwettop, oro, w, & + tsoil, tsoil_freezing, emissions, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2 + real :: ut0 ! dry threshold speed [m s-1] + real, pointer, dimension(:,:) :: fraclake, & ! fraction of grid cell in lake + gwettop, & ! soil moisture + oro, & ! orography flag + w, & ! wind speed [m s-1] + tsoil ! soil surface temperature [K] + real :: tsoil_freezing ! soil freezing point [K] + +! !OUTPUT PARAMETERS: + + real :: emissions(i1:i2,j1:j2) ! Local emission [kg m-2 s-1] + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'DustEmissionsSimple' + +! !DESCRIPTION: Computes the dust emissions for one time step +! +! !REVISION HISTORY: +! +! 19Nov2012, Colarco - Introduced +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j + integer :: n1, n2 + real :: emis(i1:i2,j1:j2) ! Local bin emission + real :: ut + real :: w10m + +! Initialize local variables +! -------------------------- + emissions(:,:) = 0. + +! Spatially dependent part of calculation +! --------------------------------------- + do j = j1, j2 + do i = i1, i2 + + if ( oro(i,j) /= LAND ) cycle ! only over LAND gridpoints + +! Modify the threshold depending on soil moisture as in Ginoux et al. [2001] + if ((gwettop(i,j) .lt. 0.5) .and. (tsoil(i,j) .gt. tsoil_freezing)) then + ut = max(0.0, ut0 * (1.2 + 0.2*alog10(max(1.0e-3, gwettop(i,j)))) / & + (1.2 + 0.2*alog10(1.0e-3))) + + if(w(i,j) .gt. ut) then +! Emission of dust [kg m-2 s-1] + emissions(i,j) = & + (1.-fraclake(i,j)) * w(i,j)**2. * (w(i,j)-ut) + + endif + endif + + end do ! i + end do ! j + + rc = 0 + + end subroutine DustEmissionSimple + + + subroutine MAM_DustEmissionGOCART( i1, i2, j1, j2, km, & + fraclake, gwettop, oro, u10m, v10m, & + emission_total, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km + real, pointer, dimension(:,:) :: fraclake, gwettop, oro, u10m, v10m + +! !OUTPUT PARAMETERS: + + real, intent(inout) :: emission_total(i1:i2,j1:j2) ! Local emission + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + + character(len=*), parameter :: myname = 'MAM_DustEmissionGOCART' + +! !DESCRIPTION: Computes the dust emissions for one time step +! +! !REVISION HISTORY: +! +! 11Oct2011, Darmenov - For now use the GOCART emission scheme to +! calculate the total emission +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: n + real :: emission(i1:i2, j1:j2) + double precision :: emission_total_(i1:i2, j1:j2) + + integer, parameter :: nbins = 5 + real, parameter :: radius(nbins) = (/0.73, 1.4, 2.4, 4.5, 8.0/) * 1e-6 ! [m] + real, parameter :: src_fraction(nbins) = (/0.1, 0.25, 0.25, 0.25, 0.25/) + + emission_total = 0.0 ! total emission + emission_total_ = 0.0d0 ! total emission: double precision + + do n = 1, nbins + emission = 0.0 + call DustEmissionGOCART( i1, i2, j1, j2, km, radius(n), & + fraclake, gwettop, oro, u10m, v10m, & + emission, rc ) + + emission_total_ = emission_total_ + src_fraction(n) * emission + end do + + emission_total = emission_total_ + + end subroutine MAM_DustEmissionGOCART + + + subroutine MAM_DustEmission( i1, i2, j1, j2, km, & + rLow, rUp, & + emission_bulk, & + emission_mass, emission_num, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km + real, intent(in) :: rLow, rUp ! Dry particle bin edge radii [m] + real, intent(in) :: emission_bulk(i1:i2, j1:j2) + +! !OUTPUT PARAMETERS: + + real, intent(inout) :: emission_mass(i1:i2, j1:j2) ! Local emission + real, intent(inout) :: emission_num (i1:i2, j1:j2) + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + + character(len=*), parameter :: myname = 'MAM_DustEmission' + +! !DESCRIPTION: Computes the dust emissions for one time step +! +! !REVISION HISTORY: +! +! 11Oct2011, Darmenov - MAM +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: n + real :: pi + +!! Initial size distribution of dust, D'Almeida[1987] +! integer, parameter :: nmodes = 3 +! real, parameter :: MMD(nmodes) = (/0.832, 4.82, 19.38/) * 1e-6 ! mass median diameter, [m] +! real, parameter :: sigma_g(nmodes) = (/2.1, 1.9, 1.6/) ! geometric standard deviation +! real, parameter :: weight_mass(nmodes) = (/0.036, 0.957, 0.007/) ! mass weights + +!! Initial size distribution of dust, Claquin[1999] +! integer, parameter :: nmodes = 3 +! real, parameter :: MMD(nmodes) = (/0.011, 2.54, 42.10/) * 1e-6 ! mass median diameter, [m] +! real, parameter :: sigma_g(nmodes) = (/1.89, 2.0, 2.13/) ! geometric standard deviation +! real, parameter :: weight_mass(nmodes) = (/2.6e-6, 0.78, 0.22/) ! mass weights + +!! Initial size distribution of dust, Alfaro and Gomes[2001], and Foret et al[2006] + integer, parameter :: nmodes = 3 + real, parameter :: MMD(nmodes) = (/1.5, 6.7, 14.2/) * 1e-6 ! mass median diameter, [m] + real, parameter :: sigma_g(nmodes) = (/1.7, 1.6, 1.5/) ! geometric standard deviation + real, parameter :: weight_mass(nmodes) = (/0.02, 0.27, 0.71/) ! mass weights + + real, parameter :: soil_density = 2650.0 ! km m-3 + + real :: NMD(nmodes) + real :: weight_number(nmodes), w_n(nmodes) + real :: integral_mass(nmodes), integral_number(nmodes) + + _UNUSED_DUMMY(km) + +! Initialize local variables +! -------------------------- + rc = 0 + + pi = 4 * atan(1.0) + + NMD = MMD * exp(-3 * log(sigma_g)**2) + + w_n = weight_mass / (pi/6 * soil_density * NMD**3 * exp(4.5*log(sigma_g)**2)) + weight_number = w_n / sum(w_n) + + ! compute the size distribution integrals + do n = 1, nmodes + integral_mass(n) = lognormal_integral(2*rLow, 2*rUp, MMD(n), sigma_g(n)) + integral_number(n) = lognormal_integral(2*rLow, 2*rUp, NMD(n), sigma_g(n)) + end do + + emission_mass = emission_bulk * sum(weight_mass * integral_mass) + emission_num = emission_bulk * sum(w_n * integral_number) + +! emission_mass(:,:) = 0.0 +! emission_num (:,:) = 0.0 +! +! do n = 1, nmodes +! emission_mass = emission_mass + emission_bulk * weight_mass(n) * integral_mass(n) +! emission_num = emission_num + emission_bulk * w_n(n) * integral_number(n) +! end do + + contains + real function lognormal_cdf(x, median, sigma) result(cdf) + implicit none + real, intent(in) :: x, median, sigma + real :: erf + + cdf = 0.5 * (1 + erf(log(x/median) / (sqrt(2.0) * log(sigma)))) + end function lognormal_cdf + + real function lognormal_integral(x1, x2, median, sigma) result(integral) + implicit none + real, intent(in) :: x1, x2, median, sigma + + integral = lognormal_cdf(x2, median, sigma) - lognormal_cdf(x1, median, sigma) + end function lognormal_integral + + end subroutine MAM_DustEmission + + + +! ------------------------------------------------------------------------------ +! Algorithm to compute mass fraction of dust emissions in particle bin of radius +! range spanned by rlow and rup [m] based on brittle fragmentation theory, after +! Kok PNAS (2011), his equations 5 & 6 +! +! !IROUTINE: KokSizeDistribution -- pass mass fraction size bins at dust emission +! +! !INTERFACE: +! + + subroutine KokSizeDistribution( r, rlow, rup, dm, dn, rhod, rhog) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + real, intent(in), dimension(:) :: r, rlow, rup ! bin center, lower, and + ! upper radius [m] + real, intent(in), optional :: rhod, rhog ! dust and group densities [kg m-3] + +! !OUTPUT PARAMETERS: + real, intent(out), dimension(:) :: dm ! mass fraction of each bin + real, intent(out), dimension(:), optional :: dn ! number fraction of each bin + +! !DESCRIPTION: Compute the dust emission mass fraction per size bin based on +! Kok PNAS (2011) brittle fragmentation theory +! +! !REVISION HISTORY: +! +! 13Apr2017, Colarco - Introduced +! 01Oct2018, Colarco - For CARMA it is possible for mixed group dust element +! to have different density than mixed group "pc" element, which +! requires a correction here in terms of the radius of a "pure" +! dust particle with same mass as the mixed group particle. +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: nbin, ibin + real :: erf + real, parameter :: ds = 3.4e-6, & ! soil median diameter [m] + sigma = 3., & ! width of soil distribution + lambda = 12.e-6, & ! side crack propagation length + cv = 12.62e-6, & ! some constants + cn = 0.9539e-6 + real :: rho_dust, rho_grp ! dust and group densities [kg m-3] + +! parameters for a fine sub-bin distribution + integer, parameter :: nbin_ = 1000 + real :: r_(nbin_), dr_(nbin_), dm_(nbin_), dn_(nbin_) + real :: rmrat_, rmin_ + +! Set the particle densities that go with the radii passed in + rho_dust = 2650. ! nominal dust particle density + if(present(rhod)) rho_dust = rhod + rho_grp = rho_dust + if(present(rhog)) rho_grp = rhog + +! Get number of major bins + nbin = size(r) + +! Loop over the major size bins + do ibin = 1, nbin + + rmrat_ = (rup(ibin)/rlow(ibin))**(3./nbin_) + rmin_ = rlow(ibin)*((1.+rmrat_)/2.)**(1./3.) + call carmabins(rmin_, rmrat_, r_, dr_) + +! If the radii passed in are for a "mixed" group with a different density +! than "pure" dust we need to determine the radius of the "pure" dust +! particle with the same mass as the "mixed" group particle of specified +! radius, which is simply: + r_ = r_*(rho_grp/rho_dust)**(1./3.) + dr_ = dr_*(rho_grp/rho_dust)**(1./3.) + +! Calculate the mass fraction from Kok PNAS 2011 Eqn. 6 + dm_ = ( dr_/r_ ) * (2.*r_/cv) * & + (1. + erf(alog(2.*r_/ds)/sqrt(2.)/alog(sigma)))*exp(-(2.*r_/lambda)**3) + dm(ibin) = sum(dm_) +if(MAPL_AM_I_ROOT()) print *, 'DUST USING THESE BIN MASS FRACTIONS:', ibin, r(ibin), dm(ibin) + +! Calculate the number fraction from Kok PNAS 2011 Eqn. 5 + if(present(dn)) then + dn_ = ( dr_/r_ ) * (1./cn/(2.*r_)**2) * & + (1. + erf(alog(2.*r_/ds)/sqrt(2.)/alog(sigma)))*exp(-(2.*r_/lambda)**3) + dn(ibin) = sum(dn_) + endif + enddo + + contains + subroutine carmabins(rmin, rmrat, r, dr) +! mimics the CARMA size bin routine, provides onlly r and dr and assumes +! particle density = 1. + real, intent(in) :: rmin, rmrat + real, intent(out), dimension(:) :: r, dr + + integer :: nbin, ibin + real, parameter :: pi = MAPL_PI + real :: rmassmin, vrfact, rmass + + nbin = size(r) + + rmassmin = 4./3.*pi*rmin**3 + vrfact = ( (3./2./pi / (rmrat+1.))**(1./3.))*(rmrat**(1./3.) - 1.) + do ibin = 1, nbin + rmass = rmassmin*rmrat**(ibin-1) + r(ibin) = (rmass/(4./3.*pi))**(1./3.) + dr(ibin) = vrfact*rmass**(1./3.) + enddo + + end subroutine carmabins + + end subroutine KokSizeDistribution + +end module diff --git a/ESMF/Shared/Chem_Shared/GmiEmissUtils.F90 b/ESMF/Shared/Chem_Shared/GmiEmissUtils.F90 new file mode 100644 index 00000000..d456de59 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/GmiEmissUtils.F90 @@ -0,0 +1,366 @@ + +!============================================================================= +! +! $Id$ +! +! CODE DEVELOPER +! John Tannahill, LLNL +! jrt@llnl.gov +! +! Original code from: +! Harvard tropospheric emissions module for 3D applications; +! by Yuhang Wang, Gerry Gardner, and Prof. Daniel Jacob +! of Harvard University (Release V1.0) +! +! FILE +! emiss_utils.F +! +! ROUTINES +! Biofit +! Sun_Param +! Diffg +! +!============================================================================= + + +!----------------------------------------------------------------------------- +! +! ROUTINE +! Biofit +! +! DESCRIPTION +! This routine calculates the light correction. +! +! Light adjustment by the function Biofit is described by Wang [1996]. +! It combines: +! * local dependence of stomal resistance on the intensity I of light +! impinging the leaf; this is expressed as a mutliplicative factor +! I/(I+b) to the stomatal resistance where b = 50 (W*m^-2) +! (equation (7) of Baldocchi et al. [1987]) +! * radiative transfer of direct and diffuse radiation in the canopy +! using equations (12)-(16) from Guenther et al. [1995] +! * separate accounting of sunlit and shaded leaves using equation (12) +! of Guenther et al. [1995] +! * partitioning of the radiation at the top of the canopy into direct +! and diffuse components using a parameterization of results from an +! atmospheric radiative transfer model [Wang, 1996]. +! +! ARGUMENTS +! cloud_frac1 : fractional cloud cover +! suncos1 : cosine of the solar zenith angle +! xlai1 : leaf area index of land type for current month +! coeff : factor that integrates the light dependence over the canopy +! depth; "sp" even though "ri" is input per unit area of leaf +! +!----------------------------------------------------------------------------- + + function Biofit & + & (cloud_frac1, suncos1, xlai1, coeff) + + implicit none + +# include "gmi_emiss_constants.h" + +! ---------------------- +! Argument declarations. +! ---------------------- + + real*8 :: cloud_frac1 + real*8 :: suncos1 + real*8 :: xlai1 + real*8 :: coeff(NPOLY) + + +! ---------------------- +! Function declarations. +! ---------------------- + + real*8 :: Biofit + + +! ----------------------- +! Parameter declarations. +! ----------------------- + + integer, parameter :: & + & BIOFIT_DIM = 4 ! Biofit dimension + + +! ---------------------- +! Variable declarations. +! ---------------------- + + integer :: ii, nn + integer :: k0, k1, k2, k3 + integer :: spdim + + real*8 :: bigterm(NPOLY) + + real*8 :: spterm (BIOFIT_DIM-1) + + real*8 :: term (BIOFIT_DIM) + + +! ---------------- +! Begin execution. +! ---------------- + + term(1) = 1.0d0 + term(2) = xlai1 + term(3) = suncos1 + term(4) = cloud_frac1 + + + spdim = BIOFIT_DIM - 1 + + + do ii = 1, spdim + spterm(ii) = term(ii+1) + end do + + +! ============== + call Sun_Param & +! ============== + & (spdim, spterm) + + + do ii = 1, spdim + term(ii+1) = spterm(ii) + end do + + + k0 = 0 + + do k3 = 1, BIOFIT_DIM + do k2 = k3, BIOFIT_DIM + do k1 = k2, BIOFIT_DIM + + k0 = k0 + 1 + + bigterm(k0) = term(k1) * term(k2) * term(k3) + + end do + end do + end do + + + Biofit = 0.0d0 + + do nn = 1, NPOLY + + Biofit = Biofit + (coeff(nn) * bigterm(nn)) + + end do + + Biofit = Max (Biofit, 0.1d0) + + + return + + end + + +!----------------------------------------------------------------------------- +! +! ROUTINE +! Sun_Param +! +! DESCRIPTION +! This routine scales and constrains xlai, suncos, and cloud_frac; called +! by Biofit. +! +! ARGUMENTS +! spdim : spterm dimension +! spterm : array of terms containing xlai, suncos, cloud_frac +! +!----------------------------------------------------------------------------- + + subroutine Sun_Param & + & (spdim, spterm) + + use GmiPrintError_mod, only : GmiPrintError + + implicit none + +! ---------------------- +! Argument declarations. +! ---------------------- + + integer :: spdim + real*8 :: spterm(spdim) + + +! ----------------------- +! Parameter declarations. +! ----------------------- + + integer, parameter :: & + & SPDIM_PARAM = 3 + + integer, parameter :: & + & ND (SPDIM_PARAM) = & ! scaling factor for each variable + & (/ 55, 20, 11 /) + + real*8, parameter :: & + & XHI(SPDIM_PARAM) = & ! maximum for each variable + & (/ 11.0d0, 1.0d0, 1.0d0 /) + + +! ---------------------- +! Variable declarations. +! ---------------------- + + character (len=75) :: err_msg + + integer :: ii + + real*8 :: rnd + real*8 :: xlow ! minimum for each variable + + +! ---------------- +! Begin execution. +! ---------------- + + if (spdim /= SPDIM_PARAM) then + err_msg = 'spdim/SPDIM_PARAM problem in Sun_Param.' + call GmiPrintError & + & (err_msg, .true., 2, spdim, SPDIM_PARAM, 0, 0.0d0, 0.0d0) + end if + + + do ii = 1, spdim + + spterm(ii) = Min (spterm(ii), XHI(ii)) + + if (ii /= spdim) then + + rnd = ND (ii) + + xlow = XHI(ii) / rnd + + else + + xlow = 0.0d0 + + end if + + spterm(ii) = Max (spterm(ii), xlow) + + spterm(ii) = spterm(ii) / XHI(ii) + + end do + + + return + + end + + +!----------------------------------------------------------------------------- +! +! ROUTINE +! Diffg +! +! DESCRIPTION +! This routine calculates the molecular diffusivity of a gas in air +! (m^2/s). +! +! The molecular radius of air is given in a table on p. 479 of Levine +! [1988]; the table also gives radii for some other molecules. Rather +! than using a specific molecular radius a generic value is used for all +! molecules, which is good enough in terms of calculating the diffusivity +! as long as the molecule is not too big. +! +! ARGUMENTS +! tk : temperature (degK) +! press : pressure (Pa) +! xm : molecular weight of gas (kg) +! +!----------------------------------------------------------------------------- + + function Diffg & + & (tk, press, xm) + + implicit none + +# include "gmi_phys_constants.h" + +! ---------------------- +! Argument declarations. +! ---------------------- + + real*8 :: tk + real*8 :: press + real*8 :: xm + + +! ---------------------- +! Function declarations. +! ---------------------- + + real*8 :: Diffg + + +! ----------------------- +! Parameter declarations. +! ----------------------- + + real*8, parameter :: & + & RADAIR = 1.2d-10, & ! hard-sphere molecular radii of air (m) + & RADX = 1.5d-10 ! hard-sphere molecular radii of the diffusing + ! gas (m) + + +! ---------------------- +! Variable declarations. +! ---------------------- + + real*8 :: airden + real*8 :: diam + real*8 :: frpath + real*8 :: speed + real*8 :: zz + + +! ---------------- +! Begin execution. +! ---------------- + + airden = press * AVOGAD / (GAS_CONST_J * tk) + + +! ------------------------------------------------------------------- +! Calculate the mean free path for gas X in air: eq. 8.5 of Seinfeld +! [1986]; diam is the collision diameter for gas X with air. +! ------------------------------------------------------------------- + + zz = xm / (MWTAIR * KGPG) + + diam = RADX + RADAIR + + frpath = 1.0d0 / (GMI_PI * Sqrt (1.0d0 + zz ) * & + & airden * (diam * diam)) + + +! ------------------------------------------------------------- +! Calculate average speed of gas X; eq. 15.47 of Levine [1988]. +! ------------------------------------------------------------- + + speed = Sqrt (8.0d0 * GAS_CONST_J * tk / (GMI_PI * xm)) + + +! -------------------------------------------------------------------- +! Calculate diffusion coefficient of gas X in air; eq. 8.9 of Seinfeld +! [1986]. +! -------------------------------------------------------------------- + + Diffg = (3.0d0 * GMI_PI / 32.0d0) * & + & (1.0d0 + zz) * frpath * speed + + + return + + end + diff --git a/ESMF/Shared/Chem_Shared/GmiPrintError_mod.F90 b/ESMF/Shared/Chem_Shared/GmiPrintError_mod.F90 new file mode 100644 index 00000000..5cfd8e1a --- /dev/null +++ b/ESMF/Shared/Chem_Shared/GmiPrintError_mod.F90 @@ -0,0 +1,108 @@ +!------------------------------------------------------------------------- +! NASA/GFSC, SIVO, Code 610.3 +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: GmiPrintError_mod +! +! !INTERFACE: +! + module GmiPrintError_mod +! + implicit none +! +! !PUBLIC MEMBER FUNCTIONS: +! + public GmiPrintError +! +! !DESCRIPTION: +! Provide a routine to print the error message and exit the code. +! +! !AUTHOR: +! Jules Kouatchou +! +! !REVISION HISTORY: +! Initial code. +! +! Mar 30, 2017: Moved this file from GmiIOutilities/ to Chem_Shared/ for TR +! +!EOP +!------------------------------------------------------------------------- + +CONTAINS + +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: GmiPrintError +! +! !INTERFACE: +! + subroutine GmiPrintError & + (err_msg, err_do_stop, err_num_ints, err_int1, err_int2, & + err_num_reals, err_real1, err_real2) +! + implicit none +! +! !INPUT PARAMETERS: +!! err_msg : error message to be printed out +!! err_do_stop : do stop on error? +!! err_num_ints : number of integers to be printed out (0, 1, or 2) +!! err_int1 : integer 1 to print out +!! err_int2 : integer 2 to print out +!! err_num_reals : number of reals to be printed out (0, 1, or 2) +!! err_real1 : real 1 to print out +!! err_real2 : real 2 to print out + character (len=*), intent(in) :: err_msg + logical , intent(in) :: err_do_stop + integer , intent(in) :: err_num_ints + integer , intent(in) :: err_int1 + integer , intent(in) :: err_int2 + integer , intent(in) :: err_num_reals + real*8 , intent(in) :: err_real1 + real*8 , intent(in) :: err_real2 +! +! !DESCRIPTION: +! Output error messages, and exits if requested. +! +! !AUTHOR: +! Jules Kouatchou +! +! !REVISION HISTORY: +! Initial code. +! +!EOP +!------------------------------------------------------------------------- +!BOC + Write (6,*) + Write (6,*) & + '--------------------------------------------------------------' + + Write (6,*) '!! ' // Trim (err_msg) + + if (err_num_ints == 1) then + Write (6,*) ' ', err_int1 + else if (err_num_ints == 2) then + Write (6,*) ' ', err_int1, err_int2 + end if + + if (err_num_reals == 1) then + Write (6,*) ' ', err_real1 + else if (err_num_reals == 2) then + Write (6,*) ' ', err_real1, err_real2 + end if + + Write (6,*) & + '--------------------------------------------------------------' + Write (6,*) + + if (err_do_stop) then + stop "Code stopped by GmiPrintError." + end if + + return + + end subroutine GmiPrintError +!EOC +!------------------------------------------------------------------------ +end module GmiPrintError_mod diff --git a/ESMF/Shared/Chem_Shared/GmiResistance.F90 b/ESMF/Shared/Chem_Shared/GmiResistance.F90 new file mode 100644 index 00000000..1bb1acb7 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/GmiResistance.F90 @@ -0,0 +1,358 @@ + +!============================================================================= +! +! $Id$ +! +! CODE DEVELOPER +! Dan Bergmann, LLNL +! dbergmann@llnl.gov +! +! FILE +! GmiResistance.F90 +! +! ROUTINES +! Canopy_Resistance +! Surface_Resistance +! +! NOTE +! Mar 30, 2017: Moved and renamed GMI_GridComp/GmiDeposition/resistance.F90 +! to Chem_Shared/GmiResistance.F90, for use by TR +! +!============================================================================= + + +!----------------------------------------------------------------------------- +! +! ROUTINE +! Canopy_Resistance +! +! DESCRIPTION +! This routine calculates bulk surface resistance of the canopy from the +! network of resistances in parallel and in series. +! +! ARGUMENTS +! rdc : tbd +! rix : +! press : +! tempk1 : +! f01 : +! hstar1 : +! xmw1 : +! rac1 : +! rclo1 : +! rcls1 : +! rgso1 : +! rgss1 : +! rlu1 : +! rsurfc1 : +! +!----------------------------------------------------------------------------- + + subroutine Canopy_Resistance & + & (rdc, rix, press, tempk1, f01, hstar1, xmw1, & + & rac1, rclo1, rcls1, rgso1, rgss1, rlu1, rsurfc1) + + implicit none + +# include "gmi_phys_constants.h" + + +! ---------------------- +! Argument declarations. +! ---------------------- + + real*8 :: rdc + real*8 :: rix + real*8 :: press + real*8 :: tempk1 + real*8 :: f01 + real*8 :: hstar1 + real*8 :: xmw1 + real*8 :: rac1 + real*8 :: rclo1 + real*8 :: rcls1 + real*8 :: rgso1 + real*8 :: rgss1 + real*8 :: rlu1 + real*8 :: rsurfc1 + + +! ----------------------- +! Parameter declarations. +! ----------------------- + + real*8, parameter :: & + & BIG1 = 1.0d25 + + +! ---------------------- +! Function declarations. +! ---------------------- + + real*8, external :: Diffg + + +! ---------------------- +! Variable declarations. +! ---------------------- + + real*8 :: dtmp1, dtmp2, dtmp3, dtmp4 + + real*8 :: rclx + real*8 :: rgsx + real*8 :: rixx + real*8 :: rluxx + + +! ---------------- +! Begin execution. +! ---------------- + + rixx = rix * ( Diffg (tempk1, press, MWTH2O*KGPG) / & + & Diffg (tempk1, press, xmw1 *KGPG) ) + & + & 1.0d0 / (hstar1 / 3000.0d0 + 100.0d0 * f01) + + if (rlu1 < 9999.0d0) then + rluxx = rlu1 / (hstar1 / 1.0d+05 + f01) + else + rluxx = BIG1 + end if + +! --------------------------------------------------------------------- +! To prevent virtually zero resistance to species with huge HSTAR, such +! as HNO3, a minimum value of rluxx needs to be set. The rationality +! of the existence of such a minimum is demonstrated by the observed +! relationship between Vd(NOy-NOx) and ustar in Munger et. al. [1996]; +! Vd(HNO3) never exceeds 2 cm*s^-1 in observations. The corresponding +! minimum resistance is 50 s*m^-1. This correction was introduced by +! J.Y. Liang on 7/9/95. +! --------------------------------------------------------------------- + + rluxx = Max (rluxx, 50.0d0) + + + rgsx = & + & 1.0d0 / & + & (hstar1 / 1.0d+05 / rgss1 + f01 / rgso1) + + rclx = & + & 1.0d0 / & + & (hstar1 / 1.0d+05 / rcls1 + f01 / rclo1) + + +! ----------------------------------------------------------------------- +! Get the bulk surface resistance of the canopy, rsurfc, from the network +! of resistances in parallel and in series (Fig. 1 of Wesely [1989]). +! ----------------------------------------------------------------------- + + dtmp1 = 1.0d0 / rixx + dtmp2 = 1.0d0 / rluxx + dtmp3 = 1.0d0 / (rac1 + rgsx) + dtmp4 = 1.0d0 / (rdc + rclx) + + rsurfc1 = 1.0d0 / (dtmp1 + dtmp2 + dtmp3 + dtmp4) + + + return + + end subroutine Canopy_Resistance + + +!----------------------------------------------------------------------------- +! +! ROUTINE +! Surface_Resistace +! +! DESCRIPTION +! This routine tbd +! +! ARGUMENTS +! idep1 : tbd +! rac1 : +! rclo1 : +! rcls1 : +! rgso1 : +! rgss1 : +! ri1 : +! rlu1 : +! rt : +! tempc1 : +! cfrac1 : +! radiat1 : +! suncos1 : +! xlai1 : +! rix : +! +!----------------------------------------------------------------------------- + + subroutine Surface_Resistance & + & (idep1, rac1, rclo1, rcls1, rgso1, rgss1, ri1, rlu1, & + & rt, tempc1, cfrac1, radiat1, suncos1, xlai1, rix) + + implicit none + +# include "gmi_emiss_constants.h" +# include "gmi_drydep_data.h" + + +! ---------------------- +! Argument declarations. +! ---------------------- + + integer :: idep1 + real*8 :: rac1 + real*8 :: rclo1 + real*8 :: rcls1 + real*8 :: rgso1 + real*8 :: rgss1 + real*8 :: ri1 + real*8 :: rlu1 + real*8 :: rt + real*8 :: tempc1 + real*8 :: cfrac1 + real*8 :: radiat1 + real*8 :: suncos1 + real*8 :: xlai1 + real*8 :: rix + + +! ----------------------- +! Parameter declarations. +! ----------------------- + + real*8, parameter :: & + & BIG1 = 1.0d6 + + real*8, parameter :: & + & BIG2 = 1.0d25 + + +! ---------------------- +! Function declarations. +! ---------------------- + + real*8, external :: Biofit + + +! ---------------------- +! Variable declarations. +! ---------------------- + + real*8 :: gfaci, gfact + + real*8 :: xdrycoeff(NPOLY) + + +! ---------------- +! Begin execution. +! ---------------- + +! ---------------------------------------------------------------------- +! Read the internal resistance ri (minimum stomatal resistance for water +! vapor, per unit area of leaf) from the IRI array; a "9999" value means +! no deposition to stomata, so we impose a very large value for ri. +! ---------------------------------------------------------------------- + + ri1 = iri(idep1) + + if (ri1 >= 9999.0d0) ri1 = 1.0d25 + + +! ---------------------------------------------------------------------- +! Cuticular resistances IRLU read in from drydep table are per unit area +! of leaf; divide them by the leaf area index to get a cuticular +! resistance for the bulk canopy. If IRLU is "9999", it means there are +! no cuticular surfaces on which to deposit, so we impose a very large +! value for rlu. +! ---------------------------------------------------------------------- + + if ((irlu(idep1) >= 9999) .or. (xlai1 <= 0.0d0)) then + + rlu1 = 1.0d25 + + else + + rlu1 = irlu(idep1) + rlu1 = (rlu1 / xlai1) + rt + + end if + + +! ---------------------------------------------------------- +! The following are the remaining resistances for the Wesely +! resistance-in-series model for a surface canopy +! (see Atmos. Environ. paper, Fig.1). +! ---------------------------------------------------------- + + rac1 = Max (irac(idep1), 1) + if (rac1 >= 9999.0d0) rac1 = BIG2 + + rgss1 = irgss(idep1) + rgss1 = Max (rgss1+rt, 1.0d0) + + rgso1 = irgso(idep1) + rgso1 = Max (rgso1+rt, 1.0d0) + if (rgso1 >= 9999.0d0) rgso1 = BIG2 + + rcls1 = ircls(idep1) + rcls1 = rcls1 + rt + if (rcls1 >= 9999.0d0) rcls1 = BIG2 + + rclo1 = irclo(idep1) + rclo1 = rclo1 + rt + if (rclo1 >= 9999.0d0) rclo1 = BIG2 + + +! ---------------------------------------------------------------------- +! Adjust stomatal resistances for insolation and temperature => +! +! Temperature adjustment is from Wesely [1989], equation (3). +! +! Light adjustment by the function Biofit is described by Wang [1996]. +! It combines: +! - local dependence of stomal resistance on the intensity I of light +! impinging the leaf; this is expressed as a mutliplicative +! factor I/(I+b) to the stomatal resistance where b = 50 W*m^-2 +! (equation (7) of Baldocchi et. al. [1987]); +! - radiative transfer of direct and diffuse radiation in the +! canopy using equations (12)-(16) from Guenther et. al. [1995]; +! - separate accounting of sunlit and shaded leaves using +! equation (12) of Guenther et. al. [1995]; +! - partitioning of the radiation at the top of the canopy into direct +! and diffuse components using a parameterization to results from +! an atmospheric radiative transfer model [Wang, 1996]. +! The dependent variables of the function Biofit are the leaf area +! index (xylai), the cosine of zenith angle (suncos) and the fractional +! cloud cover (cfrac). The factor gfaci integrates the light +! dependence over the canopy depth; sp even though ri is input per +! unit area of leaf, it need not be scaled by lai to yield a bulk +! canopy value because that is already done in the gfaci formulation. +! ---------------------------------------------------------------------- + + if (ri1 >= 9999.0d0) then + + rix = ri1 + + else + + if ((tempc1 > 0.0d0) .and. (tempc1 < 40.0d0)) then + gfact = 400.0d0 / tempc1 / (40.0d0 - tempc1) + else + gfact = 100.0d0 + end if + + if ((radiat1 > 1.0d-5) .and. (xlai1 > 0.0d0)) then + xdrycoeff(:) = DRYCOEFF(:) + gfaci = 1.0d0 / Biofit (cfrac1, suncos1, xlai1, xdrycoeff) + else + gfaci = 100.0d0 + end if + + rix = ri1 * gfact * gfaci + + end if + + return + + end subroutine Surface_Resistance + diff --git a/ESMF/Shared/Chem_Shared/GmiSolar_mod.F90 b/ESMF/Shared/Chem_Shared/GmiSolar_mod.F90 new file mode 100644 index 00000000..49046792 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/GmiSolar_mod.F90 @@ -0,0 +1,337 @@ +module GmiSolar_mod + + implicit none + + private + public :: CalcSolarDeclination + public :: CalcSolarZenithAngle + public :: CalcCosSolarZenithAngle + public :: computeSolarZenithAngle_Photolysis + + contains + +!============================================================================= +! +! CODE DEVELOPER +! John Tannahill, LLNL (Original code from Keith Grant, LLNL) +! jrt@llnl.gov +! +!============================================================================= +! +! Mar 30, 2017: Moved this file from GmiSupportingModules/ to Chem_Shared/ for TR +! +!----------------------------------------------------------------------------- +! +! ROUTINE +! CalcSolarDeclination +! +! DESCRIPTION +! Given the Julian day, this routine calculates the solar declination and +! the square of the ratio of the mean Earth-Sun distance to the current +! Earth-Sun distance. Refer to: Paltridge, G.W., and C.M.R. Platt, 1976: +! "Radiative Processes in Meteorology and Climatology", Elsevier, pp. 57-63. +! +! ARGUMENTS +! julday : Julian day counting ranging from 0 on Jan. 1st to 364 on +! Dec. 31st +! decl : solar declination (deg) +! rdistsq : the square of the ratio of the mean Earth-Sun distance +! to the current Earth-Sun distance +! +!----------------------------------------------------------------------------- + + subroutine CalcSolarDeclination & + & (julday, decl, rdistsq) + + implicit none + +# include "gmi_phys_constants.h" + + +! ---------------------- +! Argument declarations. +! ---------------------- + + real*8, intent(in ) :: julday + real*8, intent(out) :: decl + real*8, intent(out) :: rdistsq + +! ----------------------- +! Parameter declarations. +! ----------------------- + + real*8, parameter :: TWO_PI = 2.0d0 * GMI_PI + +! ---------------------- +! Variable declarations. +! ---------------------- + + real*8 :: theta ! year angle on specified day + real*8 :: theta2, theta3 + +! ---------------- +! Begin execution. +! ---------------- + +!c? Leap year? + theta = (TWO_PI * julday) / 365.0d0 + + theta2 = 2.0d0 * theta + theta3 = 3.0d0 * theta + + decl = & + & (360.0d0 / TWO_PI) * & + & (0.006918d0 - & + & 0.399912d0 * Cos (theta) + 0.070257d0 * Sin (theta) - & + & 0.006758d0 * Cos (theta2) + 0.000907d0 * Sin (theta2) - & + & 0.002697d0 * Cos (theta3) + 0.001480d0 * Sin (theta3)) + + rdistsq = & + & 1.000110d0 + & + & 0.034221d0 * Cos (theta) + 0.001280d0 * Sin (theta) + & + & 0.000719d0 * Cos (theta2) + 0.000077d0 * Sin (theta2) + + return + + end subroutine CalcSolarDeclination + +!----------------------------------------------------------------------------- +! +! ROUTINE +! Solrza +! +! DESCRIPTION +! Given a Greenwich time, a solar declination and reference latitude and +! longitudes, this routine returns a corresponding list of cosines of solar +! zenith angles. Refer to: Paltridge, G.W., and C.M.R. Platt, 1976: +! "Radiative Processes in Meteorology and Climatology", Elsevier, p. 62. +! +! ARGUMENTS +! time : Greenwich time since Jan 1, counting zero from midnight (days) +! decl : solar declination (deg) +! lat : latitude (deg) +! lon : longitudes (deg) +! nn : number of longitudes for which to calculate cosines of the +! solar zenith angle +! cossza : cosines of the solar zenith angle (output) +! +!----------------------------------------------------------------------------- + + subroutine CalcSolarZenithAngle & + & (time, decl, lat, lon, nn, cossza) + + implicit none + +# include "gmi_phys_constants.h" + +! ---------------------- +! Argument declarations. +! ---------------------- + + integer, intent(in ) :: nn + real*8 , intent(in ) :: time + real*8 , intent(in ) :: decl + real*8 , intent(in ) :: lat + real*8 , intent(in ) :: lon (nn) + real*8 , intent(out) :: cossza(nn) + +! ----------------------- +! Parameter declarations. +! ----------------------- + + real*8, parameter :: TWO_PI = 2.0d0 * GMI_PI + real*8, parameter :: PI_180 = TWO_PI / 360.0d0 + +! ---------------------- +! Variable declarations. +! ---------------------- + + integer :: ii + + real*8 :: cosha + +! ---------------- +! Begin execution. +! ---------------- + + do ii = 1, nn + +! ------------------------------------------------------------- +! Calculate the cosine of the hour angle which is referenced to +! noon. +! ------------------------------------------------------------- + + cosha = & + & Cos (TWO_PI * & + & (Mod (time + (lon(ii) / 360.d0), 1.0d0) - 0.5d0)) + + +! ----------------------------------------------- +! Calculate the cosine of the solar zenith angle. +! ----------------------------------------------- + + cossza(ii) = & + & Sin (PI_180 * lat) * Sin (PI_180 * decl) + & + & Cos (PI_180 * lat) * Cos (PI_180 * decl) * cosha + + end do + + + return + + end subroutine CalcSolarZenithAngle + +!----------------------------------------------------------------------------- +! +! ROUTINE +! CalcCosSolarZenithAngle +! +! DESCRIPTION +! Given a Greenwich time, a solar declination and reference latitude and +! longitudes, this routine returns a corresponding list of cosines of solar +! zenith angles. Refer to: Paltridge, G.W., and C.M.R. Platt, 1976: +! "Radiative Processes in Meteorology and Climatology", Elsevier, p. 62. +! +! ARGUMENTS +! time : Greenwich time since Jan 1, counting zero from midnight (days) +! latDeg : latitude (deg) +! lonDeg : longitudes (deg) +! i1,i2 : Dimensions of latDeg, lonDeg +! j1,j2 +! cossza : cosines of the solar zenith angle (output) +! +!----------------------------------------------------------------------------- + + subroutine CalcCosSolarZenithAngle & + & (time, latDeg, lonDeg, cosSolarZenithAngle, i1, i2, j1, j2) + + implicit none + +# include "gmi_phys_constants.h" + +! ---------------------- +! Argument declarations. +! ---------------------- + + integer, intent(in ) :: i1, i2, j1, j2 + real*8 , intent(in ) :: time + real*8 , intent(in ) :: latDeg(i1:i2,j1:j2) + real*8 , intent(in ) :: lonDeg(i1:i2,j1:j2) + real*8 , intent(out) :: cosSolarZenithAngle(i1:i2,j1:j2) + +! ----------------------- +! Parameter declarations. +! ----------------------- + + real*8, parameter :: TWO_PI = 2.0d0 * GMI_PI + real*8, parameter :: PI_180 = TWO_PI / 360.0d0 + +! ---------------------- +! Variable declarations. +! ---------------------- + + integer :: ii, ij + real*8 :: decl, theta, theta2, theta3 + real*8 :: cosha(i1:i2,j1:j2), coslat, sinlat + +! ---------------- +! Begin execution. +! ---------------- + +!c? Leap year? + theta = (TWO_PI * time) / 365.0d0 + + theta2 = 2.0d0 * theta + theta3 = 3.0d0 * theta + +! Calculate the solar declination (deg) + + decl = & + & (360.0d0 / TWO_PI) * & + & (0.006918d0 - & + & 0.399912d0 * Cos (theta) + 0.070257d0 * Sin (theta) - & + & 0.006758d0 * Cos (theta2) + 0.000907d0 * Sin (theta2) - & + & 0.002697d0 * Cos (theta3) + 0.001480d0 * Sin (theta3)) + +! ------------------------------------------------------------------- +! Calculate the cosine of the hour angle which is referenced to noon. +! ------------------------------------------------------------------- + + cosha (i1:i2,j1:j2) = Cos(TWO_PI * (Mod (time + (lonDeg(i1:i2,j1:j2) / 360.d0), 1.0d0) - 0.5d0)) + +! ----------------------------------------------- +! Calculate the cosine of the solar zenith angle. +! ----------------------------------------------- + + do ij = j1, j2 + do ii = i1, i2 + sinlat = Sin (PI_180 * latDeg(ii,ij)) * Sin (PI_180 * decl) + coslat = Cos (PI_180 * latDeg(ii,ij)) * Cos (PI_180 * decl) + cosSolarZenithAngle(ii,ij) = sinlat + coslat*cosha(ii,ij) + end do + end do + + return + + end subroutine CalcCosSolarZenithAngle +!EOC +!------------------------------------------------------------------------------ +!BOP +! +! !IROUTINE: computeSolarZenithAngle_Photolysis +! +! !INTERFACE: +! + function computeSolarZenithAngle_Photolysis (jday, time_sec, & + fastj_offset_sec, latDeg, lonDeg, i1, i2, j1, j2) & + result(this_) +! +! !INPUT PARAMETERS: + integer :: i1, i2, j1, j2 + integer :: jday ! day of year (1-365) + real*8 :: time_sec ! current time in seconds + real*8 :: fastj_offset_sec ! offset from tau at which to do photolysis (s) + real*8 :: latDeg(i1:i2,j1:j2) ! latitude (deg) + real*8 :: lonDeg(i1:i2,j1:j2) ! longitude (deg) +! +! !RETURNED VALUE + real*8 :: this_(i1:i2,j1:j2) +! +! !DESCRIPTION: +! Computes the solar zenith angle used in the photolysis package. +! +! !DEFINED PARAMETERS: + real*8, parameter :: locPI = 3.141592653589793D0 + real*8, parameter :: PI180 = locPI / 180.0d0 +! +! !LOCAL VARIABLES: + REAL*8 :: sindec, soldek, cosdec + REAL*8 :: sinlat(i1:i2,j1:j2), sollat(i1:i2,j1:j2), coslat(i1:i2,j1:j2) + REAL*8 :: cosz(i1:i2,j1:j2) + real*8 :: tau, timej, loct + integer :: ii, ij +!EOP +!------------------------------------------------------------------------------ +!BOC + tau = time_sec / 3600.0d0 + timej = fastj_offset_sec / 3600.0d0 + + sindec=0.3978d0*sin(0.9863d0*(dble(jday)-80.d0)*PI180) + soldek=asin(sindec) + cosdec=cos(soldek) + sinlat(i1:i2,j1:j2)=sin(latDeg(i1:i2,j1:j2)*PI180) + sollat(i1:i2,j1:j2)=asin(sinlat(i1:i2,j1:j2)) + coslat(i1:i2,j1:j2)=cos(sollat(i1:i2,j1:j2)) + + do ij = j1, j2 + do ii = i1, i2 + loct = (((tau+timej)*15.d0)-180.d0)*PI180 + (lonDeg(ii,ij)*PI180) + cosz(ii,ij) = cosdec*coslat(ii,ij)*cos(loct) + sindec*sinlat(ii,ij) + this_(ii,ij) = acos(cosz(ii,ij))/PI180 + enddo + enddo + + end function computeSolarZenithAngle_Photolysis +!EOC +!------------------------------------------------------------------------------ +end module GmiSolar_mod diff --git a/ESMF/Shared/Chem_Shared/GmiTimeControl_mod.F90 b/ESMF/Shared/Chem_Shared/GmiTimeControl_mod.F90 new file mode 100644 index 00000000..7102853c --- /dev/null +++ b/ESMF/Shared/Chem_Shared/GmiTimeControl_mod.F90 @@ -0,0 +1,827 @@ +!-------------------------------------------------------------------------------- +! +! Mar 30, 2017: Moved this file from GmiSupportingModules/ to Chem_Shared/ for TR +! +!-------------------------------------------------------------------------------- +!BOP +! +! !MODULE: GmiTimeControl_mod +! +! !INTERFACE: +! + module GmiTimeControl_mod +! +! !USES: +! + implicit none +! +! !PUBLIC MEMBER FUNCTIONS: +! + private + public :: Set_leapYearFlag +! public :: GmiAdvanceClock + public :: GetSecondsFromJanuary1 + public :: GetDaysFromJanuary1 + public :: ConvertTimeToSeconds + public :: ConvertSecondstoTime + public :: ConvertDateToSeconds + public :: GmiSplitDateTime +! + public :: Get_begGmiDate + public :: Get_begGmiTime + public :: Get_endGmiDate + public :: Get_endGmiTime + public :: Get_curGmiDate + public :: Get_curGmiTime +! public :: Get_gmiTimeStep + public :: Get_gmiSeconds + public :: Get_numTimeSteps + public :: Set_begGmiDate + public :: Set_begGmiTime + public :: Set_endGmiDate + public :: Set_endGmiTime + public :: Set_curGmiDate + public :: Set_curGmiTime +! public :: Set_gmiTimeStep + public :: Set_gmiSeconds + public :: Set_numTimeSteps +! +! !PUBLIC DATA MEMBERS: +! + public :: SIZTUSML + public :: leapYearFlag + public :: t_GmiClock + + type t_GmiClock + integer :: begGmiDate ! beginning date of the experiment year/month/day (YYYYMMDD) + integer :: begGmiTime ! beginning time of the experiment hour/min/sec (HHMMSS) + integer :: endGmiDate ! end date of the experiment year/month/day (YYYYMMDD) + integer :: endGmiTime ! end time of the experiment hour/min/sec (HHMMSS) +! real*8 :: gmiTimeStep ! GMI model time step (s) + integer :: curGmiDate ! current date of the experiment year/month/day (YYYYMMDD) + ! This is updated at each iteration + integer :: curGmiTime ! current time of the experiment hour/min/sec (HHMMSS) + ! This is updated at each iteration + real*8 :: gmiSeconds ! current integration time in seconds + integer :: numTimeSteps ! current number of time steps + end type t_GmiClock + + integer, parameter :: SIZTUSML = 16 + integer :: leapYearFlag ! Used to determine how leap years are derived +! +! !DESCRIPTION: +! +! !AUTHOR: +! John Tannahill (jrt@llnl.gov) and Jules Kouatchou (kouatchou@gsfc.nasa.gov) +! +! !REVISION HISTORY: +! Initial code. +! +!EOP +!------------------------------------------------------------------------- +! + CONTAINS +! +!------------------------------------------------------------------------- + subroutine Get_begGmiDate (self, ymd) + integer , intent(out) :: ymd + type(t_GmiClock), intent(in ) :: self + ymd = self%begGmiDate + return + end subroutine Get_begGmiDate +!------------------------------------------------------------------------- + subroutine Set_begGmiDate (self, ymd) + integer , intent(in ) :: ymd + type(t_GmiClock), intent(inout) :: self + self%begGmiDate = ymd + return + end subroutine Set_begGmiDate +!------------------------------------------------------------------------- + subroutine Get_begGmiTime (self, hms) + integer , intent(out) :: hms + type(t_GmiClock), intent(in ) :: self + hms = self%begGmiTime + return + end subroutine Get_begGmiTime +!------------------------------------------------------------------------- + subroutine Set_begGmiTime (self, hms) + integer , intent(in ) :: hms + type(t_GmiClock), intent(inout) :: self + self%begGmiTime = hms + return + end subroutine Set_begGmiTime +!------------------------------------------------------------------------- + subroutine Get_endGmiDate (self, ymd) + integer , intent(out) :: ymd + type(t_GmiClock), intent(in ) :: self + ymd = self%endGmiDate + return + end subroutine Get_endGmiDate +!------------------------------------------------------------------------- + subroutine Set_endGmiDate (self, ymd) + integer , intent(in ) :: ymd + type(t_GmiClock), intent(inout) :: self + self%endGmiDate = ymd + return + end subroutine Set_endGmiDate +!------------------------------------------------------------------------- + subroutine Get_endGmiTime (self, hms) + integer , intent(out) :: hms + type(t_GmiClock), intent(in ) :: self + hms = self%endGmiTime + return + end subroutine Get_endGmiTime +!------------------------------------------------------------------------- + subroutine Set_endGmiTime (self, hms) + integer , intent(in ) :: hms + type(t_GmiClock), intent(inout) :: self + self%endGmiTime = hms + return + end subroutine Set_endGmiTime +!------------------------------------------------------------------------- + subroutine Get_curGmiDate (self, ymd) + integer , intent(out) :: ymd + type(t_GmiClock), intent(in ) :: self + ymd = self%curGmiDate + return + end subroutine Get_curGmiDate +!------------------------------------------------------------------------- + subroutine Set_curGmiDate (self, ymd) + integer , intent(in ) :: ymd + type(t_GmiClock), intent(inout) :: self + self%curGmiDate = ymd + return + end subroutine Set_curGmiDate +!------------------------------------------------------------------------- + subroutine Get_curGmiTime (self, hms) + integer , intent(out) :: hms + type(t_GmiClock), intent(in ) :: self + hms = self%curGmiTime + return + end subroutine Get_curGmiTime +!------------------------------------------------------------------------- + subroutine Set_curGmiTime (self, hms) + integer , intent(in ) :: hms + type(t_GmiClock), intent(inout) :: self + self%curGmiTime = hms + return + end subroutine Set_curGmiTime +!------------------------------------------------------------------------- + subroutine Get_numTimeSteps (self, numTS) + integer , intent(out) :: numTS + type(t_GmiClock), intent(in ) :: self + numTS = self%numTimeSteps + return + end subroutine Get_numTimeSteps +!------------------------------------------------------------------------- + subroutine Set_numTimeSteps (self, numTS) + integer , intent(in ) :: numTS + type(t_GmiClock), intent(inout) :: self + self%numTimeSteps = numTS + return + end subroutine Set_numTimeSteps +!------------------------------------------------------------------------- +! subroutine Get_gmiTimeStep (self, tdt) +! real*8 , intent(out) :: tdt +! type(t_GmiClock), intent(in ) :: self +! tdt = self%gmiTimeStep +! return +! end subroutine Get_gmiTimeStep +!------------------------------------------------------------------------- +! subroutine Set_gmiTimeStep (self, tdt) +! real*8 , intent(in ) :: tdt +! type(t_GmiClock), intent(inout) :: self +! self%gmiTimeStep = tdt +! return +! end subroutine Set_gmiTimeStep +!------------------------------------------------------------------------- + subroutine Get_gmiSeconds (self, gmi_secs) + real*8 , intent(out) :: gmi_secs + type(t_GmiClock), intent(in ) :: self + gmi_secs = self%gmiSeconds + return + end subroutine Get_gmiSeconds +!------------------------------------------------------------------------- + subroutine Set_gmiSeconds (self, gmi_secs) + real*8 , intent(in ) :: gmi_secs + type(t_GmiClock), intent(inout) :: self + self%gmiSeconds = gmi_secs + return + end subroutine Set_gmiSeconds +!------------------------------------------------------------------------- + subroutine Set_leapYearFlag (leap_year_flag) + integer, intent(in) :: leap_year_flag + leapYearFlag = leap_year_flag + return + end subroutine Set_leapYearFlag +!------------------------------------------------------------------------- +!! !BOP +!! ! +!! ! !IROUTINE: GmiAdvanceClock +!! ! +!! ! !INTERFACE: +!! ! +!! subroutine GmiAdvanceClock (self) +!! ! +!! implicit none +!! +!! # include "gmi_time_constants.h" +!! +!! type(t_GmiClock), intent(inout) :: self +!! ! +!! ! !LOCAL VARIABLES: +!! integer :: nsec +!! real*8 :: tdt ! model time step (s) +!! integer :: num_time_steps ! number of time steps +!! integer :: nymd ! year/month/day (YYYYMMDD) +!! integer :: nhms ! hour/min/sec (HHMMSS) +!! real*8 :: gmi_sec ! total Gmimod seconds (s) +!! ! +!! ! !DESCRIPTION: +!! ! This routine steps the Gmimod clock one time step. +!! ! +!! ! !AUTHOR: +!! ! +!! ! !REVISION HISTORY: +!! ! Initial code. +!! !EOP +!! !------------------------------------------------------------------------- +!! !BOC +!! +!! call Get_curGmiDate (self, nymd ) +!! call Get_curGmiTime (self, nhms ) +!! call Get_numTimeSteps(self, num_time_steps) +!! call Get_gmiSeconds (self, gmi_sec ) +!! call Get_gmiTimeStep (self, tdt ) WARNING: tdt differs in Run1 vs Run2 +!! +!! num_time_steps = num_time_steps + 1 +!! gmi_sec = num_time_steps * tdt +!! +!! nsec = ConvertTimeToSeconds (nhms) + Nint (tdt) +!! +!! if (nsec >= SECPDY) then +!! nsec = nsec - SECPDY +!! nymd = IncrementDate (nymd, 1) +!! end if +!! +!! if (nsec < 00000) then +!! nsec = SECPDY + nsec +!! nymd = IncrementDate (nymd, -1) +!! end if +!! +!! nhms = ConvertSecondstoTime (nsec) +!! +!! call Set_curGmiDate (self, nymd ) +!! call Set_curGmiTime (self, nhms ) +!! call Set_numTimeSteps(self, num_time_steps) +!! call Set_gmiSeconds (self, gmi_sec ) +!! +!! return +!! +!! end subroutine GmiAdvanceClock +!! ! +!! !EOC +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: GetSecondsFromJanuary1 +! +! !INTERFACE: +! + subroutine GetSecondsFromJanuary1 (nsec_jan1, nymd, nhms) +! + implicit none +! +! !INPUT PARAMETERS: + integer, intent(in) :: nymd ! year/month/day (YYYYMMDD) + integer, intent(in) :: nhms ! hour/min/sec (HHMMSS) +! +! !OUTPUT PARAMETERS: + integer, intent(out) :: nsec_jan1 ! seconds from Jan. 1st (s) +! +! !DESCRIPTION: +! This routine returns the offset in seconds from Jan. 1st, +! given any nymd/nhms. +! +! !LOCAL VARIABLES: + integer :: nsec_ymd + integer :: nsec_hms +! +! !AUTHOR: +! +! !REVISION HISTORY: +! Initial code. +! +!EOP +!------------------------------------------------------------------------- +!BOC + nsec_ymd = ConvertDateToSeconds (nymd) + + nsec_hms = ConvertTimeToSeconds (nhms) + + nsec_jan1 = nsec_ymd + nsec_hms + + return + + end subroutine GetSecondsFromJanuary1 +!EOC +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: GetDaysFromJanuary1 +! + subroutine GetDaysFromJanuary1 (nday_jan1, nymd) +! + implicit none + +# include "gmi_time_constants.h" +! +! !INPUT PARAMETERS: + integer, intent(in) :: nymd ! year/month/day (YYYYMMDD) +! +! !OUTPUT PARAMETERS: + integer, intent(out) :: nday_jan1 ! days from Jan. 1st (days) +! +! !DESCRIPTION: +! This routine returns the offset in days from Jan. 1st, given any +! nymd/nhms. +! +! !LOCAL VARIABLES: + integer :: nsec_ymd +! +! !AUTHOR: +! !HISTORY: +! +!EOP +!----------------------------------------------------------------------------- +!BOC + nsec_ymd = ConvertDateToSeconds (nymd) + + nday_jan1 = (nsec_ymd / SECPDY) + 1 + + return + + end subroutine GetDaysFromJanuary1 +!EOC +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: IncrementDate + + +!----------------------------------------------------------------------------- +! +! ROUTINE +! IncrementDate +! +! DESCRIPTION +! This routine increments/decrements nymd by one day. +! +! ARGUMENTS +! nymd : year/month/day (YYYYMMDD) +! dyinc : the day increment/decrement (1 or -1) +! +!----------------------------------------------------------------------------- + + function IncrementDate (nymd, dyinc) + + use GmiPrintError_mod , only : GmiPrintError + + implicit none + +# include "gmi_time_constants.h" + +! ---------------------- +! Argument declarations. +! ---------------------- + + integer :: nymd + integer :: dyinc + + +! ---------------------- +! Function declarations. +! ---------------------- + + integer :: IncrementDate + +! ---------------------- +! Variable declarations. +! ---------------------- + + character (len=75) :: err_msg + + logical :: is_ldy + logical :: is_lyr + + integer :: ndy, nmon, nyr + +! ---------------- +! Begin execution. +! ---------------- + + if ((dyinc /= -1) .and. (dyinc /= 1)) then + err_msg = 'dyinc range error in IncrementDate.' + call GmiPrintError (err_msg, .true., 1, dyinc, 0, 0, 0.0d0, 0.0d0) + end if + + nyr = nymd / 10000 + nmon = Mod (nymd, 10000) / 100 + ndy = Mod (nymd, 100) + dyinc + + if (ndy == 0) then + +! ------------------------- +! Return to previous month. +! ------------------------- + + nmon = nmon - 1 + + if (nmon == 0) then + nmon = MONTHS_PER_YEAR + nyr = nyr - 1 +! if (nyr == 0) then +! nyr = 99 +! else +! nyr = nyr - 1 +! end if + end if + + is_lyr = IsLeapYear (nyr) + + if (is_lyr) then + ndy = DAYS_PER_MONTH_LY(nmon) + else + ndy = DAYS_PER_MONTH(nmon) + end if + + else + + is_lyr = IsLeapYear (nyr) + + if (is_lyr .and. (nmon == 2) .and. (ndy == DAYS_PER_MONTH_LY(nmon))) then + is_ldy = .true. + else + is_ldy = .false. + end if + + if (.not. is_ldy) then + + if (ndy > DAYS_PER_MONTH(nmon)) then + +! ---------------------- +! Proceed to next month. +! ---------------------- + + ndy = 1 + nmon = nmon + 1 + + if (nmon > MONTHS_PER_YEAR) then + nmon = 1 + nyr = nyr + 1 +! if (nyr == 99) then +! nyr = 0 +! else +! nyr = nyr + 1 +! end if + end if + + end if + + end if + + end if + + IncrementDate = (nyr * 10000) + (nmon * 100) + ndy + + return + + end function IncrementDate +!EOC +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: IsLeapYear + + +!----------------------------------------------------------------------------- +! +! ROUTINE +! IsLeapYear +! +! DESCRIPTION +! This routine always returns false if leapYearFlag < 0, +! always returns true if leapYearFlag > 0, +! and calculates whether or not it is really a leap year if +! leapYearFlag = 0. +! +! ARGUMENTS +! the_year : the year to check (last 2 digits) +! +!----------------------------------------------------------------------------- + + function IsLeapYear (the_year) + + implicit none + +!# include "gmi_time_utils.h" + +! ---------------------- +! Argument declarations. +! ---------------------- + + integer :: the_year + +! ---------------------- +! Function declarations. +! ---------------------- + + logical :: IsLeapYear + +! ---------------------- +! Variable declarations. +! ---------------------- + +!c integer, save :: the_year00 = 1900 + integer, save :: the_year00 = 2000 + + +! ---------------- +! Begin execution. +! ---------------- + + IsLeapYear = .false. + + + if (leapYearFlag > 0) then + + IsLeapYear = .true. + + else if (leapYearFlag == 0) then + + if (Mod (the_year, 4) == 0) then + + if ((the_year /= 0) .or. (Mod (the_year00, 400) == 0)) then + + IsLeapYear = .true. + + end if + + end if + + end if + + return + + end function IsLeapYear +!EOC +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: ConvertTimeToSeconds + + +!----------------------------------------------------------------------------- +! +! ROUTINE +! ConvertTimeToSeconds +! +! DESCRIPTION +! This routine converts nhms to total seconds. +! +! ARGUMENTS +! nhms : hour/min/sec (HHMMSS) +! +!----------------------------------------------------------------------------- + + function ConvertTimeToSeconds (nhms) + + use GmiPrintError_mod , only : GmiPrintError + + implicit none + +# include "gmi_time_constants.h" + +! ---------------------- +! Argument declarations. +! ---------------------- + + integer :: nhms + + +! ---------------------- +! Function declarations. +! ---------------------- + + integer :: ConvertTimeToSeconds + + +! ---------------------- +! Variable declarations. +! ---------------------- + + character (len=75) :: err_msg + + integer :: nsec + +! ---------------- +! Begin execution. +! ---------------- + + nsec = (nhms / 10000) * SECPHR + & + (Mod (nhms, 10000) / 100) * SECPMN + & + Mod (nhms, 100) + + if (nsec >= SECPDY) then + + err_msg = 'nsec too big in ConvertTimeToSeconds.' + call GmiPrintError (err_msg, .true., 1, nsec, 0, 0, 0.0d0, 0.0d0) + + end if + + ConvertTimeToSeconds = nsec + + return + + end function ConvertTimeToSeconds + + +!----------------------------------------------------------------------------- +! +! ROUTINE +! ConvertSecondstoTime +! +! DESCRIPTION +! This routine converts total seconds to hour/min/sec. +! +! ARGUMENTS +! nsec : total seconds +! +!----------------------------------------------------------------------------- + + function ConvertSecondstoTime (nsec) + + use GmiPrintError_mod , only : GmiPrintError + + implicit none + +# include "gmi_time_constants.h" + +! ---------------------- +! Argument declarations. +! ---------------------- + + integer :: nsec + + +! ---------------------- +! Function declarations. +! ---------------------- + + integer :: ConvertSecondstoTime + + +! ---------------------- +! Variable declarations. +! ---------------------- + + character (len=75) :: err_msg + + integer :: nhms + + +! ---------------- +! Begin execution. +! ---------------- + + if (nsec >= SECPDY) then + + err_msg = 'nsec too big in ConvertSecondstoTime.' + call GmiPrintError (err_msg, .true., 1, nsec, 0, 0, 0.0d0, 0.0d0) + + end if + + nhms = (nsec / SECPHR) * 10000 + & + (Mod (nsec, SECPHR) / SECPMN) * 100 + & + Mod (nsec, SECPMN) + + + ConvertSecondstoTime = nhms + + return + + end function ConvertSecondstoTime +!EOC +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: ConvertDateToSeconds +! +! !INTERFACE: +! + function ConvertDateToSeconds (nymd) +! +! !USES: + use GmiPrintError_mod , only : GmiPrintError +! + implicit none + +# include "gmi_time_constants.h" +! +! !INPUT PARAMETERS: + integer, intent(in) :: nymd ! year/month/day (YYYYMMDD) +! +! !RETURNED VALUE: + integer :: ConvertDateToSeconds +! +! !DESCRIPTION: +! This routine converts nymd to total seconds. +! +! !LOCAL VARIABLES: + character (len=75) :: err_msg + logical :: is_lyr + integer :: idays, isecs + integer :: iyrsec + integer :: ndy, nmon, nyr +! +! !AUTHOR: +! +! !REVISION HISTORY: +! Initial code. +! +!EOP +!------------------------------------------------------------------------- +!BOC + + nyr = nymd / 10000 + nmon = Mod (nymd, 10000) / 100 + ndy = Mod (nymd, 100) + + is_lyr = IsLeapYear (nyr) + + if (is_lyr) then + idays = (START_DAY_OF_MONTH_LY(nmon) - 1) + (ndy - 1) + iyrsec = SECPYR_LY + else + idays = (START_DAY_OF_MONTH(nmon) - 1) + (ndy - 1) + iyrsec = SECPYR + end if + + isecs = idays * SECPDY + + if (isecs >= iyrsec) then + err_msg = 'isecs too big in ConvertDateToSeconds.' + call GmiPrintError (err_msg, .true., 1, isecs, 0, 0, 0.0d0, 0.0d0) + end if + + ConvertDateToSeconds = isecs + + return + + end function ConvertDateToSeconds +!EOC +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: GmiSplitDateTime +! +! !INTERFACE: +! + subroutine GmiSplitDateTime (nlmr, left2, middle2, right2) +! + implicit none +! +! !INPUT PARAMETERS: + integer, intent(in) :: nlmr ! nymd or nhms ("lmr" = "left" "middle" "right") + ! (YYYYMMDD or HHMMSS) +! +! !OUTPUT PARAMETERS: + integer, intent(out) :: left2 ! left field (year or hours) + integer, intent(out) :: middle2 ! middle field (month or minutes) + integer, intent(out) :: right2 ! right field (day or seconds) +! +! !DESCRIPTION: +! This routine extracts the three fields from either nymd +! (year, month, day) or nhms (hours, minutes, seconds). +! +! !AUTHOR: +! +! !REVISION HISTORY: +! Initial code. +! +!EOP +!------------------------------------------------------------------------- +!BOC + + left2 = nlmr / 10000 + middle2 = Mod (nlmr, 10000) / 100 + right2 = Mod (nlmr, 100) + + return + + end subroutine GmiSplitDateTime +!EOC +!------------------------------------------------------------------------- + + end module GmiTimeControl_mod + diff --git a/ESMF/Shared/Chem_Shared/Henrys_Law_cts.F90 b/ESMF/Shared/Chem_Shared/Henrys_Law_cts.F90 new file mode 100644 index 00000000..9cd13fcf --- /dev/null +++ b/ESMF/Shared/Chem_Shared/Henrys_Law_cts.F90 @@ -0,0 +1,456 @@ +MODULE Henrys_law_ConstantsMod + IMPLICIT NONE + !--- : ak0(ispc), dak(ispc), hstar(ispc), dhr(ispc) + !--- corrh=1.+ak0(ispc)*exp(dak(ispc)*tcorr)/hplus + !--- hplus = 1.175E-4 - for cloud water. pH is assumed to be 3.93: pH=3.93 =>hplus=10**(-pH) + !--- tcorr = 1./temp - 1./298.15 + !--- fct = 1.e-3 * rgas * temp + !--- henry_coef = hstar(ispc)* exp(dhr(ispc)*tcorr) * fct * corrh + + INTEGER,PARAMETER :: nspecies_HL=051 + REAL ,PARAMETER :: notfound = -1. + + type Hcts_vars + real :: hstar,dhr,ak0,dak + END TYPE Hcts_vars + type (Hcts_vars) :: Hcts(nspecies_HL) + + !Name of species + CHARACTER(LEN=8),PARAMETER,DIMENSION(nspecies_HL) :: spc_name=(/ & + 'O3 ' & !001 + ,'H2O2' & !002 + ,'NO ' & !003 + ,'NO2 ' & !004 + ,'NO3 ' & !005 + ,'N2O5' & !006 + ,'HONO' & !007 + ,'HNO3' & !008 + ,'HNO4' & !009 + ,'SO2 ' & !010 + ,'SULF' & !011 + ,'CO ' & !012 + ,'CO2 ' & !013 + ,'N2 ' & !014 + ,'O2 ' & !015 + ,'H2O ' & !016 + ,'H2 ' & !017 + ,'O3P ' & !018 + ,'O1D ' & !019 + ,'HO ' & !020 + ,'HO2 ' & !021 + ,'CH4 ' & !022 + ,'ETH ' & !023 + ,'ALKA' & !024 + ,'ALKE' & !025 + ,'BIO ' & !026 + ,'ARO ' & !027 + ,'HCHO' & !028 + ,'ALD ' & !029 + ,'KET ' & !030 + ,'CRBO' & !031 + ,'ONIT' & !032 + ,'PAN ' & !033 + ,'OP1 ' & !034 + ,'OP2 ' & !035 + ,'ORA1' & !036 + ,'ORA2' & !037 + ,'MO2 ' & !038 + ,'AKAP' & !039 + ,'AKEP' & !040 + ,'BIOP' & !041 + ,'PHO ' & !042 + ,'ADD ' & !043 + ,'AROP' & !044 + ,'CBOP' & !045 + ,'OLN ' & !046 + ,'XO2 ' & !047 + ,'DMS ' & !048 + ,'NH3 ' & !049 + ,'CFC ' & !050 + ,'N2O ' & !050 + /) + + + !Number of each specie + INTEGER,PARAMETER :: O3 =001 + INTEGER,PARAMETER :: H2O2=002 + INTEGER,PARAMETER :: NO =003 + INTEGER,PARAMETER :: NO2 =004 + INTEGER,PARAMETER :: NO3 =005 + INTEGER,PARAMETER :: N2O5=006 + INTEGER,PARAMETER :: HONO=007 + INTEGER,PARAMETER :: HNO3=008 + INTEGER,PARAMETER :: HNO4=009 + INTEGER,PARAMETER :: SO2 =010 + INTEGER,PARAMETER :: SULF=011 + INTEGER,PARAMETER :: CO =012 + INTEGER,PARAMETER :: CO2 =013 + INTEGER,PARAMETER :: N2 =014 + INTEGER,PARAMETER :: O2 =015 + INTEGER,PARAMETER :: H2O =016 + INTEGER,PARAMETER :: H2 =017 + INTEGER,PARAMETER :: O3P =018 + INTEGER,PARAMETER :: O1D =019 + INTEGER,PARAMETER :: HO =020 + INTEGER,PARAMETER :: HO2 =021 + INTEGER,PARAMETER :: CH4 =022 + INTEGER,PARAMETER :: ETH =023 + INTEGER,PARAMETER :: ALKA=024 + INTEGER,PARAMETER :: ALKE=025 + INTEGER,PARAMETER :: BIO =026 + INTEGER,PARAMETER :: ARO =027 + INTEGER,PARAMETER :: HCHO=028 + INTEGER,PARAMETER :: ALD =029 + INTEGER,PARAMETER :: KET =030 + INTEGER,PARAMETER :: CRBO=031 + INTEGER,PARAMETER :: ONIT=032 + INTEGER,PARAMETER :: PAN =033 + INTEGER,PARAMETER :: OP1 =034 + INTEGER,PARAMETER :: OP2 =035 + INTEGER,PARAMETER :: ORA1=036 + INTEGER,PARAMETER :: ORA2=037 + INTEGER,PARAMETER :: MO2 =038 + INTEGER,PARAMETER :: AKAP=039 + INTEGER,PARAMETER :: AKEP=040 + INTEGER,PARAMETER :: BIOP=041 + INTEGER,PARAMETER :: PHO =042 + INTEGER,PARAMETER :: ADD =043 + INTEGER,PARAMETER :: AROP=044 + INTEGER,PARAMETER :: CBOP=045 + INTEGER,PARAMETER :: OLN =046 + INTEGER,PARAMETER :: XO2 =047 + INTEGER,PARAMETER :: DMS =048 + INTEGER,PARAMETER :: NH3 =049 + INTEGER,PARAMETER :: CFC =050 + INTEGER,PARAMETER :: N2O =051 + + + + +! HENRYS LAW COEFFICIENTS +! Henrys law coefficient +! [KH298]=mole/(l atm) +! Referencias em R. Sander (1999) +! Compilation of Henry Law Constants +! for Inorganic and Organic Species +! of Potential Importance in +! Environmental Chemistry (Version 3) +! http://www.henrys-law.org +! * indica artigos nao encontrados nesse endereço eletronico + REAL,PARAMETER,DIMENSION(nspecies_HL) :: hstar=(/& + 1.10E-2 , & ! O3 - 001 + 8.30E+4 , & ! H2O2 - 002 + 1.90E-3 , & ! NO - 003 + 1.20E-2 , & ! NO2 - 004 + 6.1E-01 , & ! NO3 - 005 + 2.1E+00 , & ! N2O5 - 006 + 5.00E+1 , & ! HONO - 007 + 2.10E+5 , & ! HNO3 - 008 + 1.20E+4 , & ! HNO4 - 009 + 1.40E+0 , & ! SO2 - 010 + 2.10E+5 , & ! SULF - 011 + 9.90E-4 , & ! CO - 012 + 3.6E-02 , & ! CO2 - 013 + 6.1E-04 , & ! N2 - 014 + 1.3E-03 , & ! O2 - 015 + 0.0E+00 , & ! H2O - 016 + 7.8E-04 , & ! H2 - 017 + 0.00E+0 , & ! O3P - 018 + 0.00E+0 , & ! O1D - 019 + 3.00E+1 , & ! HO - 020 + 5.70E+3 , & ! HO2 - 021 + 1.40E-3 , & ! CH4 - 022 + 1.90E-3 , & ! ETH - 023 + 1.00E-3 , & ! ALKA - 024 + 5.00E-3 , & ! ALKE - 025 + 2.80E-2 , & ! BIO - 026 + 1.73E-1 , & ! ARO - 027 + 3.20E+3 , & ! HCHO - 028 + 1.40E+1 , & ! ALD - 029 + 3.00E+1 , & ! KET - 030 + 2.1E+05 , & ! CRBO - 031 + 1.00E+0 , & ! ONIT - 032 + 3.60E+0 , & ! PAN - 033 + 3.10E+2 , & ! OP1 - 034 + 3.40E+2 , & ! OP2 - 035 + 8.90E+3 , & ! ORA1 - 036 + 4.10E+3 , & ! ORA2 - 037 + 2.00E+3 , & ! MO2 - 038 + 0.0E+00 , & ! AKAP - 039 + 0.0E+00 , & ! AKEP - 040 + 0.0E+00 , & ! BIOP - 041 + 0.0E+00 , & ! PHO - 042 + 0.0E+00 , & ! ADD - 043 + 0.0E+00 , & ! AROP - 044 + 1.14E+1 , & ! CBOP - 045 + 0.0E+00 , & ! OLN - 046 + 0.0E+00 , & ! XO2 - 047 + 5.6E-01 , & ! DMS - 048 + 5.9E+01 , & ! NH3 - 048 + -1. , & ! CFC - 048 + 2.4E-02 & ! N2O - 051 + /) + + + +! -DH/R (for temperature correction) +! [-DH/R]=K +! Referencias em R. Sander (1999) +! Compilation of Henry Law Constants +! for Inorganic and Organic Species +! of Potential Importance in +! Environmental Chemistry (Version 3) +! http://www.henrys-law.org + REAL,PARAMETER,DIMENSION(nspecies_HL) :: dhr=(/& + 2400. , & ! O3 - 001 + 7400. , & ! H2O2 - 002 + 1400. , & ! NO - 003 + 2500. , & ! NO2 - 004 + 2000. , & ! NO3 - 005 + 3400. , & ! N2O5 - 006 + 4900. , & ! HONO - 007 + 8700. , & ! HNO3 - 008 + 6900. , & ! HNO4 - 009 + 2900. , & ! SO2 - 010 + 0. , & ! SULF - 011 + 1300. , & ! CO - 012 + 2200. , & ! CO2 - 013 + 1300. , & ! N2 - 014 + 1500. , & ! O2 - 015 + 0. , & ! H2O - 016 + 500. , & ! H2 - 017 + 0. , & ! O3P - 018 + 0. , & ! O1D - 019 + 4500. , & ! HO - 020 + 5900. , & ! HO2 - 021 + 1600. , & ! CH4 - 022 + 2300. , & ! ETH - 023 + 2700. , & ! ALKA - 024 + 3000. , & ! ALKE - 025 + 0. , & ! BIO - 026 + 4045. , & ! ARO - 027 + 6800. , & ! HCHO - 028 + 5600. , & ! ALD - 029 + 4600. , & ! KET - 030 + 5300. , & ! CRBO - 031 + 5800. , & ! ONIT - 032 + 6500. , & ! PAN - 033 + 5200. , & ! OP1 - 034 + 6000. , & ! OP2 - 035 + 5700. , & ! ORA1 - 036 + 6300. , & ! ORA2 - 037 + 6600. , & ! MO2 - 038 + 0. , & ! AKAP - 039 + 0. , & ! AKEP - 040 + 0. , & ! BIOP - 041 + 0. , & ! PHO - 042 + 0. , & ! ADD - 043 + 0. , & ! AROP - 044 + 0. , & ! CBOP - 045 + 0. , & ! OLN - 046 + 0. , & ! XO2 - 047 + 3500. , & ! DMS - 048 + 4200. , & ! NH3 - 048 + -1. , & ! CFC - 048 + 2700. & ! N2O - 048 + /) + + + REAL,PARAMETER,DIMENSION(nspecies_HL) :: weight=(/& + 48. , & ! O3 - 001 + 34. , & ! H2O2 - 002 + 30. , & ! NO - 003 + 46. , & ! NO2 - 004 + 62. , & ! NO3 - 005 + 108. , & ! N2O5 - 006 + 47. , & ! HONO - 007 + 63. , & ! HNO3 - 008 + 79. , & ! HNO4 - 009 + 64. , & ! SO2 - 010 + 98. , & ! SULF - 011 + 28. , & ! CO - 012 + 44. , & ! CO2 - 013 + 28. , & ! N2 - 014 + 32. , & ! O2 - 015 + 18. , & ! H2O - 016 + 2. , & ! H2 - 017 + 16. , & ! O3P - 018 + 16. , & ! O1D - 019 + 17. , & ! HO - 020 + 33. , & ! HO2 - 021 + 16. , & ! CH4 - 022 + 30. , & ! ETH - 023 + 61.6 , & ! ALKA - 024 + 33.0 , & ! ALKE - 025 + 68. , & ! BIO - 026 + 97.9 , & ! ARO - 027 + 30. , & ! HCHO - 028 + 44. , & ! ALD - 029 + 72. , & ! KET - 030 + 68.6 , & ! CRBO - 031 + 119. , & ! ONIT - 032 + 122. , & ! PAN - 033 + 48. , & ! OP1 - 034 + 62. , & ! OP2 - 035 + 46. , & ! ORA1 - 036 + 60. , & ! ORA2 - 037 + 47. , & ! MO2 - 038 + 102. , & ! AKAP - 039 + 88.4 , & ! AKEP - 040 + 117. , & ! BIOP - 041 + 107. , & ! PHO - 042 + 107. , & ! ADD - 043 + 151. , & ! AROP - 044 + 85.4 , & ! CBOP - 045 + 136. , & ! OLN - 046 + 44. , & ! XO2 - 047 + 62.13, & ! DMS - 048 + 17.03, & ! NH3 - 048 + -1. , & ! CFC - 048 + 44. & ! CFC - 048 + /) + + +! ACID DISSOCIATION CONSTANT AT 298K +! [mole/liter of liquid water] +! Referencias: Barth et al. JGR 112, D13310 2007 +! Martell and Smith, 1976, Critical stability +! vol1-4 Plenum Press New York + REAL,PARAMETER,DIMENSION(nspecies_HL) :: ak0=(/& + 0.00E+00 , & ! O3 - 001 + 2.20E-12 , & ! H2O2 - 002 + 0.00E+00 , & ! NO - 003 + 0.00E+00 , & ! NO2 - 004 + 0.00E+00 , & ! NO3 - 005 + 0.00E+00 , & ! N2O5 - 006 + 7.10E-04 , & ! HONO - 007 + 1.54E+01 , & ! HNO3 - 008 + 0.00E+00 , & ! HNO4 - 009 + 1.30E-02 , & ! SO2 - 010 + 1.00E-02 , & ! SULF - 011 + 0.00E+00 , & ! CO - 012 + 4.50E-07 , & ! CO2 - 013 + 0.00E+00 , & ! N2 - 014 + 0.00E+00 , & ! O2 - 015 + 0.00E+00 , & ! H2O - 016 + 0.00E+00 , & ! H2 - 017 + 0.00E+00 , & ! O3P - 018 + 0.00E+00 , & ! O1D - 019 + 0.00E+00 , & ! HO - 020 + 3.50E-05 , & ! HO2 - 021 + 0.00E+00 , & ! CH4 - 022 + 0.00E+00 , & ! ETH - 023 + 0.00E+00 , & ! ALKA - 024 + 0.00E+00 , & ! ALKE - 025 + 0.00E+00 , & ! BIO - 026 + 0.00E+00 , & ! ARO - 027 + 0.00E+00 , & ! HCHO - 028 + 0.00E+00 , & ! ALD - 029 + 0.00E+00 , & ! KET - 030 + 0.00E+00 , & ! CRBO - 031 + 0.00E+00 , & ! ONIT - 032 + 0.00E+00 , & ! PAN - 033 + 0.00E+00 , & ! OP1 - 034 + 0.00E+00 , & ! OP2 - 035 + 1.80E-04 , & ! ORA1 - 036 + 1.75E-05 , & ! ORA2 - 037 + 0.00E+00 , & ! MO2 - 038 + 0.00E+00 , & ! AKAP - 039 + 0.00E+00 , & ! AKEP - 040 + 0.00E+00 , & ! BIOP - 041 + 0.00E+00 , & ! PHO - 042 + 0.00E+00 , & ! ADD - 043 + 0.00E+00 , & ! AROP - 044 + 0.00E+00 , & ! CBOP - 045 + 0.00E+00 , & ! OLN - 046 + 0.00E+00 , & ! XO2 - 047 + 0.00E+00 , & ! DMS - 048 + 0.00E+00 , & ! NH3 - 049 + 0.00E+00 , & ! NH3 - 049 + 0.00E+00 & ! CFC - 050 + /) + +! Temperature correction factor for +! acid dissociation constants +! [K] +! Referencias: Barth et al. JGR 112, D13310 2007 + REAL,PARAMETER,DIMENSION(nspecies_HL) :: dak=(/& + 0. , & ! O3 - 001 + -3700. , & ! H2O2 - 002 + 0. , & ! NO - 003 + 0. , & ! NO2 - 004 + 0. , & ! NO3 - 005 + 0. , & ! N2O5 - 006 + 0. , & ! HONO - 007 + 0. , & ! HNO3 - 008 + 0. , & ! HNO4 - 009 + 2000. , & ! SO2 - 010 + 0. , & ! SULF - 011 + 0. , & ! CO - 012 + -1000. , & ! CO2 - 013 + 0. , & ! N2 - 014 + 0. , & ! O2 - 015 + 0. , & ! H2O - 016 + 0. , & ! H2 - 017 + 0. , & ! O3P - 018 + 0. , & ! O1D - 019 + 0. , & ! HO - 020 + 0. , & ! HO2 - 021 + 0. , & ! CH4 - 022 + 0. , & ! ETH - 023 + 0. , & ! ALKA - 024 + 0. , & ! ALKE - 025 + 0. , & ! BIO - 026 + 0. , & ! ARO - 027 + 0. , & ! HCHO - 028 + 0. , & ! ALD - 029 + 0. , & ! KET - 030 + 0. , & ! CRBO - 031 + 0. , & ! ONIT - 032 + 0. , & ! PAN - 033 + 0. , & ! OP1 - 034 + 0. , & ! OP2 - 035 + -1500. , & ! ORA1 - 036 + 0. , & ! ORA2 - 037 + 0. , & ! MO2 - 038 + 0. , & ! AKAP - 039 + 0. , & ! AKEP - 040 + 0. , & ! BIOP - 041 + 0. , & ! PHO - 042 + 0. , & ! ADD - 043 + 0. , & ! AROP - 044 + 0. , & ! CBOP - 045 + 0. , & ! OLN - 046 + 0. , & ! XO2 - 047 + 0. , & ! DMS - 048 + 0. , & ! NH3 - 049 + 0. , & ! NH3 - 049 + 0. & ! CFC - 050 + /) +CONTAINS +!--------------------------------------------------------------------------------------------------- + SUBROUTINE get_HenrysLawCts(name,c1,c2,c3,c4) + IMPLICIT NONE + character(len=*), intent(in) :: name + real, intent(out):: c1,c2,c3,c4 + integer :: l,found + found = 0 +loop2: DO l = 1,nspecies_HL + IF(TRIM(spc_name(l)) == TRIM(name)) then + c1 = hstar(l) + c2 = dhr(l) + c3 = ak0(l) + c4 = dak(l) + found = 1 + EXIT loop2 + ENDIF + enddo loop2 + IF(found == 0) then + c1 = notfound + c2 = notfound + c3 = notfound + c4 = notfound + ENDIF + END SUBROUTINE get_HenrysLawCts + +END MODULE Henrys_law_ConstantsMod diff --git a/ESMF/Shared/Chem_Shared/NitrateChemDriverMod.F90 b/ESMF/Shared/Chem_Shared/NitrateChemDriverMod.F90 new file mode 100644 index 00000000..009d290c --- /dev/null +++ b/ESMF/Shared/Chem_Shared/NitrateChemDriverMod.F90 @@ -0,0 +1,2119 @@ +#include "unused_dummy.H" +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: NitrateChemDriverMod.F90 --- Calculate the nitrate aerosol +! chemistry +! +! !INTERFACE: +! + + module NitrateChemDriverMod + +! !USES: + + USE ESMF + USE MAPL + use m_StrTemplate + use m_die, only: die + + use Chem_Mod + use Chem_ConstMod, only: grav, undefval => undef, & + airMolWght => airmw ! Constants ! + use Chem_UtilMod + use DryDepositionMod + + use m_mpout + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC RPMARES + PUBLIC SKTRS_HNO3 + PUBLIC SKTRS_SSLT + + real*8, parameter :: pi = MAPL_PI + real*8, parameter :: rgas = MAPL_RUNIV/1000.d0 ! to get units J/(K*mol) + +! gram molecular weights of species + real, parameter :: fMassSulfur = 32., fMassSO2 = 64., fMassSO4 = 96., & + fMassDMS = 62., fMassMSA = 96., fmassHNO3 = 63.013 + +! +! !DESCRIPTION: +! +! This module implements the Nitrate chemistry calculations +! +! !REVISION HISTORY: +! +! 03Sept2014 Colarco First crack! +! +!EOP +!------------------------------------------------------------------------- +CONTAINS +! +!------------------------------------------------------------------------------ +! RPMARES thermodynamic module for sulfate/nitrate/ammonium/water aerosol +!------------------------------------------------------------------------------ + + SUBROUTINE RPMARES( SO4, GNO3, GNH3, RH, TEMP, & + & ASO4, AHSO4, ANO3, AH2O, ANH4 ) +! +!****************************************************************************** +! +! Description: +! +! ARES calculates the chemical composition of a sulfate/nitrate/ +! ammonium/water aerosol based on equilibrium thermodynamics. +! +! This code considers two regimes depending upon the molar ratio +! of ammonium to sulfate. +! +! For values of this ratio less than 2,the code solves a cubic for +! hydrogen ion molality, H+, and if enough ammonium and liquid +! water are present calculates the dissolved nitric acid. For molal +! ionic strengths greater than 50, nitrate is assumed not to be present. +! +! For values of the molar ratio of 2 or greater, all sulfate is assumed +! to be ammonium sulfate and a calculation is made for the presence of +! ammonium nitrate. +! +! The Pitzer multicomponent approach is used in subroutine ACTCOF to +! obtain the activity coefficients. Abandoned -7/30/97 FSB +! +! The Bromley method of calculating the multicomponent activity coefficients +! is used in this version 7/30/97 SJR/FSB +! +! The calculation of liquid water +! is done in subroutine water. Details for both calculations are given +! in the respective subroutines. +! +! Based upon MARS due to +! P. Saxena, A.B. Hudischewskyj, C. Seigneur, and J.H. Seinfeld, +! Atmos. Environ., vol. 20, Number 7, Pages 1471-1483, 1986. +! +! and SCAPE due to +! Kim, Seinfeld, and Saxeena, Aerosol Sience and Technology, +! Vol 19, number 2, pages 157-181 and pages 182-198, 1993. +! +! NOTE: All concentrations supplied to this subroutine are TOTAL +! over gas and aerosol phases +! +! Parameters: +! +! SO4 : Total sulfate in MICROGRAMS/M**3 as sulfate +! GNO3 : Nitric Acid vapor in MICROGRAMS/M**3 as nitric acid +! GNH3 : Gas phase ammonia in MICROGRAMS/M**3 +! RH : Fractional relative humidity +! TEMP : Temperature in Kelvin +! ASO4 : Aerosol phase sulfate in MICROGRAMS/M**3 +! AHSO4 : Aerosol phase in bisulfate in MICROGRAMS/M**3 [rjp, 12/12/01] +! ANO3 : Aerosol phase nitrate in MICROGRAMS/M**3 +! ANH4 : Aerosol phase ammonium in MICROGRAMS/M**3 +! AH2O : Aerosol phase water in MICROGRAMS/M**3 +! +! Revision History: +! Who When Detailed description of changes +! --------- -------- ------------------------------------------- +! S.Roselle 11/10/87 Received the first version of the MARS code +! S.Roselle 12/30/87 Restructured code +! S.Roselle 2/12/88 Made correction to compute liquid-phase +! concentration of H2O2. +! S.Roselle 5/26/88 Made correction as advised by SAI, for +! computing H+ concentration. +! S.Roselle 3/1/89 Modified to operate with EM2 +! S.Roselle 5/19/89 Changed the maximum ionic strength from +! 100 to 20, for numerical stability. +! F.Binkowski 3/3/91 Incorporate new method for ammonia rich case +! using equations for nitrate budget. +! F.Binkowski 6/18/91 New ammonia poor case which +! omits letovicite. +! F.Binkowski 7/25/91 Rearranged entire code, restructured +! ammonia poor case. +! F.Binkowski 9/9/91 Reconciled all cases of ASO4 to be output +! as SO4-- +! F.Binkowski 12/6/91 Changed the ammonia defficient case so that +! there is only neutralized sulfate (ammonium +! sulfate) and sulfuric acid. +! F.Binkowski 3/5/92 Set RH bound on AWAS to 37 % to be in agreement +! with the Cohen et al. (1987) maximum molality +! of 36.2 in Table III.( J. Phys Chem (91) page +! 4569, and Table IV p 4587.) +! F.Binkowski 3/9/92 Redid logic for ammonia defficient case to remove +! possibility for denomenator becoming zero; +! this involved solving for H+ first. +! Note that for a relative humidity +! less than 50%, the model assumes that there is no +! aerosol nitrate. +! F.Binkowski 4/17/95 Code renamed ARES (AeRosol Equilibrium System) +! Redid logic as follows +! 1. Water algorithm now follows Spann & Richardson +! 2. Pitzer Multicomponent method used +! 3. Multicomponent practical osmotic coefficient +! use to close iterations. +! 4. The model now assumes that for a water +! mass fraction WFRAC less than 50% there is +! no aerosol nitrate. +! F.Binkowski 7/20/95 Changed how nitrate is calculated in ammonia poor +! case, and changed the WFRAC criterion to 40%. +! For ammonium to sulfate ratio less than 1.0 +! all ammonium is aerosol and no nitrate aerosol +! exists. +! F.Binkowski 7/21/95 Changed ammonia-ammonium in ammonia poor case to +! allow gas-phase ammonia to exist. +! F.Binkowski 7/26/95 Changed equilibrium constants to values from +! Kim et al. (1993) +! F.Binkowski 6/27/96 Changed to new water format +! F.Binkowski 7/30/97 Changed to Bromley method for multicomponent +! activity coefficients. The binary activity +! coefficients +! are the same as the previous version +! F.Binkowski 8/1/97 Changed minimum sulfate from 0.0 to 1.0e-6 i.e. +! 1 picogram per cubic meter +! F.Binkowski 2/23/98 Changes to code made by Ingmar Ackermann to +! deal with precision problems on workstations +! incorporated in to this version. Also included +! are his improved descriptions of variables. +! F. Binkowski 8/28/98 changed logic as follows: +! If iterations fail, initial values of nitrate +! are retained. +! Total mass budgets are changed to account for gas +! phase returned. +! F.Binkowski 10/01/98 Removed setting RATIO to 5 for low to +! to zero sulfate sulfate case. +! F.Binkowski 01/10/2000 reconcile versions +! +! F.Binkowski 05/17/2000 change to logic for calculating RATIO +! F.Binkowski 04/09/2001 change for very low values of RATIO, +! RATIO < 0.5, no iterative calculations are done +! in low ammonia case a MAX(1.0e-10, MSO4) IS +! applied, and the iteration count is +! reduced to fifty for each iteration loop. +! R. Yantosca 09/25/2002 Bundled into "rpmares_mod.f". Declared all REALs +! as REAL*8's. Cleaned up comments. Also now force +! double precision explicitly with "D" exponents. +! P. Le Sager and Bug fix for low ammonia case -- prevent floating +! R. Yantosca 04/10/2008 point underflow and NaN's. +!****************************************************************************** +! S. Steenrod 04/15/2010 Modified to include into GMI model +! + + !================================================================= + ! ARGUMENTS and their descriptions + !================================================================= + REAL*8 :: SO4 ! Total sulfate in micrograms / m**3 + REAL*8 :: GNO3 ! Gas-phase nitric acid in micrograms / m**3 + REAL*8 :: GNH3 ! Gas-phase ammonia in micrograms / m**3 + REAL*8 :: RH ! Fractional relative humidity + REAL*8 :: TEMP ! Temperature in Kelvin + REAL*8 :: ASO4 ! Aerosol sulfate in micrograms / m**3 + REAL*8 :: AHSO4 ! Aerosol bisulfate in micrograms / m**3 + REAL*8 :: ANO3 ! Aerosol nitrate in micrograms / m**3 + REAL*8 :: AH2O ! Aerosol liquid water content water in + ! micrograms / m**3 + REAL*8 :: ANH4 ! Aerosol ammonium in micrograms / m**3 + + !================================================================= + ! PARAMETERS and their descriptions: + !================================================================= + + ! Molecular weights + REAL*8, PARAMETER :: MWNO3 = 62.0049d0 ! NO3 + REAL*8, PARAMETER :: MWHNO3 = 63.01287d0 ! HNO3 + REAL*8, PARAMETER :: MWSO4 = 96.0576d0 ! SO4 + REAL*8, PARAMETER :: MWNH3 = 17.03061d0 ! NH3 + REAL*8, PARAMETER :: MWNH4 = 18.03858d0 ! NH4 + + ! Minimum value of sulfate aerosol concentration + REAL*8, PARAMETER :: MINSO4 = 1.0d-6 / MWSO4 + + ! Minimum total nitrate cncentration + REAL*8, PARAMETER :: MINNO3 = 1.0d-6 / MWNO3 + + ! Force a minimum concentration + REAL*8, PARAMETER :: FLOOR = 1.0d-30 + + ! Tolerances for convergence test. NOTE: We now have made these + ! parameters so they don't lose their values (phs, bmy, 4/10/08) + REAL*8, PARAMETER :: TOLER1 = 0.00001d0 + REAL*8, PARAMETER :: TOLER2 = 0.001d0 + + ! Limit to test for zero ionic activity (phs, bmy, 4/10/08) + REAL*8, PARAMETER :: EPS = 1.0d-30 + + !================================================================= + ! SCRATCH LOCAL VARIABLES and their descriptions: + !================================================================= + + INTEGER :: IRH ! Index set to percent relative humidity + INTEGER :: NITR ! Number of iterations for activity + ! coefficients + INTEGER :: NNN ! Loop index for iterations + INTEGER :: NR ! Number of roots to cubic equation for + ! H+ ciaprecision + REAL*8 :: A0 ! Coefficients and roots of + REAL*8 :: A1 ! Coefficients and roots of + REAL*8 :: A2 ! Coefficients and roots of + REAL :: AA ! Coefficients and discriminant for + ! quadratic equation for ammonium nitrate + REAL*8 :: BAL ! internal variables ( high ammonia case) + REAL*8 :: BB ! Coefficients and discriminant for + ! quadratic equation for ammonium nitrate + REAL*8 :: BHAT ! Variables used for ammonia solubility + REAL*8 :: CC ! Coefficients and discriminant for + ! quadratic equation for ammonium nitrate + REAL*8 :: CONVT ! Factor for conversion of units + REAL*8 :: DD ! Coefficients and discriminant for + ! quadratic equation for ammonium nitrate + REAL*8 :: DISC ! Coefficients and discriminant for + ! quadratic equation for ammonium nitrate + REAL*8 :: EROR ! Relative error used for convergence test + REAL*8 :: FNH3 ! "Free ammonia concentration", that + ! which exceeds TWOSO4 + REAL*8 :: GAMAAB ! Activity Coefficient for (NH4+, + ! HSO4-)GAMS( 2,3 ) + REAL*8 :: GAMAAN ! Activity coefficient for (NH4+, NO3-) + ! GAMS( 2,2 ) + REAL*8 :: GAMAHAT ! Variables used for ammonia solubility + REAL*8 :: GAMANA ! Activity coefficient for (H+ ,NO3-) + ! GAMS( 1,2 ) + REAL*8 :: GAMAS1 ! Activity coefficient for (2H+, SO4--) + ! GAMS( 1,1 ) + REAL*8 :: GAMAS2 ! Activity coefficient for (H+, HSO4-) + ! GAMS( 1,3 ) + REAL*8 :: GAMOLD ! used for convergence of iteration + REAL*8 :: GASQD ! internal variables ( high ammonia case) + REAL*8 :: HPLUS ! Hydrogen ion (low ammonia case) (moles + ! / kg water) + REAL*8 :: K1A ! Equilibrium constant for ammonia to + ! ammonium + REAL*8 :: K2SA ! Equilibrium constant for + ! sulfate-bisulfate (aqueous) + REAL*8 :: K3 ! Dissociation constant for ammonium + ! nitrate + REAL*8 :: KAN ! Equilibrium constant for ammonium + ! nitrate (aqueous) + REAL*8 :: KHAT ! Variables used for ammonia solubility + REAL*8 :: KNA ! Equilibrium constant for nitric acid + ! (aqueous) + REAL*8 :: KPH ! Henry's Law Constant for ammonia + REAL*8 :: KW ! Equilibrium constant for water + ! dissociation + REAL*8 :: KW2 ! Internal variable using KAN + REAL*8 :: MAN ! Nitrate (high ammonia case) (moles / + ! kg water) + REAL*8 :: MAS ! Sulfate (high ammonia case) (moles / + ! kg water) + REAL*8 :: MHSO4 ! Bisulfate (low ammonia case) (moles / + ! kg water) + REAL*8 :: MNA ! Nitrate (low ammonia case) (moles / kg + ! water) + REAL*8 :: MNH4 ! Ammonium (moles / kg water) + REAL*8 :: MOLNU ! Total number of moles of all ions + REAL*8 :: MSO4 ! Sulfate (low ammonia case) (moles / kg + ! water) + REAL*8 :: PHIBAR ! Practical osmotic coefficient + REAL*8 :: PHIOLD ! Previous value of practical osmotic + ! coefficient used for convergence of + ! iteration + REAL*8 :: RATIO ! Molar ratio of ammonium to sulfate + REAL*8 :: RK2SA ! Internal variable using K2SA + REAL*8 :: RKNA ! Internal variables using KNA + REAL*8 :: RKNWET ! Internal variables using KNA + REAL*8 :: RR1 + REAL*8 :: RR2 + REAL*8 :: STION ! Ionic strength + REAL*8 :: T1 ! Internal variables for temperature + ! corrections + REAL*8 :: T2 ! Internal variables for temperature + ! corrections + REAL*8 :: T21 ! Internal variables of convenience (low + ! ammonia case) + REAL*8 :: T221 ! Internal variables of convenience (low + ! ammonia case) + REAL*8 :: T3 ! Internal variables for temperature + ! corrections + REAL*8 :: T4 ! Internal variables for temperature + ! corrections + REAL*8 :: T6 ! Internal variables for temperature + ! corrections + REAL*8 :: TNH4 ! Total ammonia and ammonium in + ! micromoles / meter ** 3 + REAL*8 :: TNO3 ! Total nitrate in micromoles / meter ** 3 + !----------------------------------------------------------------------- + ! Prior to 4/10/08: + ! Now make these PARAMETERS instead of variables (bmy, 4/10/08) + !REAL*8 :: TOLER1 ! Tolerances for convergence test + !REAL*8 :: TOLER2 ! Tolerances for convergence test + !----------------------------------------------------------------------- + REAL*8 :: TSO4 ! Total sulfate in micromoles / meter ** 3 + REAL*8 :: TWOSO4 ! 2.0 * TSO4 (high ammonia case) (moles + ! / kg water) + REAL*8 :: WFRAC ! Water mass fraction + REAL*8 :: WH2O ! Aerosol liquid water content (internally) + ! micrograms / meter **3 on output + ! internally it is 10 ** (-6) kg (water) + ! / meter ** 3 + ! the conversion factor (1000 g = 1 kg) + ! is applied for AH2O output + REAL*8 :: WSQD ! internal variables ( high ammonia case) + REAL*8 :: XNO3 ! Nitrate aerosol concentration in + ! micromoles / meter ** 3 + REAL*8 :: XXQ ! Variable used in quadratic solution + REAL*8 :: YNH4 ! Ammonium aerosol concentration in + ! micromoles / meter** 3 + REAL*8 :: ZH2O ! Water variable saved in case ionic + ! strength too high. + REAL*8 :: ZSO4 ! Total sulfate molality - mso4 + mhso4 + ! (low ammonia case) (moles / kg water) + REAL*8 :: CAT( 2 ) ! Array for cations (1, H+); (2, NH4+) + ! (moles / kg water) + REAL*8 :: AN ( 3 ) ! Array for anions (1, SO4--); (2, + ! NO3-); (3, HSO4-) (moles / kg water) + REAL*8 :: CRUTES( 3 ) ! Coefficients and roots of + REAL*8 :: GAMS( 2, 3 ) ! Array of activity coefficients + REAL*8 :: TMASSHNO3 ! Total nitrate (vapor and particle) + REAL*8 :: GNO3_IN, ANO3_IN + ! !LOCAL VARIABLES: + character (len=75) :: err_msg + + !================================================================= + ! RPMARES begins here! + ! convert into micromoles/m**3 + !================================================================= + + ! For extremely low relative humidity ( less than 1% ) set the + ! water content to a minimum and skip the calculation. + IF ( RH .LT. 0.01 ) THEN + AH2O = FLOOR + RETURN + ENDIF + + ! total sulfate concentration + TSO4 = MAX( FLOOR, SO4 / MWSO4 ) + ASO4 = SO4 + + !Cia models3 merge NH3/NH4 , HNO3,NO3 here + !c *** recommended by Dr. Ingmar Ackermann + + ! total nitrate + TNO3 = MAX( 0.0d0, ( ANO3 / MWNO3 + GNO3 / MWHNO3 ) ) + + ! total ammonia + TNH4 = MAX( 0.0d0, ( GNH3 / MWNH3 + ANH4 / MWNH4 ) ) + + GNO3_IN = GNO3 + ANO3_IN = ANO3 + TMASSHNO3 = MAX( 0.0d0, GNO3 + ANO3 ) + + ! set the molar ratio of ammonium to sulfate + RATIO = TNH4 / TSO4 + + ! validity check for negative concentration + IF ( TSO4 < 0.0d0 .OR. TNO3 < 0.0d0 .OR. TNH4 < 0.0d0 ) THEN + PRINT*, 'TSO4 : ', TSO4 + PRINT*, 'TNO3 : ', TNO3 + PRINT*, 'TNH4 : ', TNH4 + +!.sds CALL GEOS_CHEM_STOP + err_msg = 'negative concen problem in RPMARES - TSO4, TNO3, TNH4:' + call PrintError & + & (err_msg, .true., 0, 0, 0, 2, TSO4, TNO3) + ENDIF + + ! now set humidity index IRH as a percent + IRH = NINT( 100.0 * RH ) + + ! now set humidity index IRH as a percent + IRH = MAX( 1, IRH ) + IRH = MIN( 99, IRH ) + + !================================================================= + ! Specify the equilibrium constants at correct temperature. + ! Also change units from ATM to MICROMOLE/M**3 (for KAN, KPH, and K3 ) + ! Values from Kim et al. (1993) except as noted. + ! Equilibrium constant in Kim et al. (1993) + ! K = K0 exp[ a(T0/T -1) + b(1+log(T0/T)-T0/T) ], T0 = 298.15 K + ! K = K0 EXP[ a T3 + b T4 ] in the code here. + !================================================================= + CONVT = 1.0d0 / ( 0.082d0 * TEMP ) + T6 = 0.082d-9 * TEMP + T1 = 298.0d0 / TEMP + T2 = LOG( T1 ) + T3 = T1 - 1.0d0 + T4 = 1.0d0 + T2 - T1 + + !================================================================= + ! Equilibrium Relation + ! + ! HSO4-(aq) = H+(aq) + SO4--(aq) ; K2SA + ! NH3(g) = NH3(aq) ; KPH + ! NH3(aq) + H2O(aq) = NH4+(aq) + OH-(aq) ; K1A + ! HNO3(g) = H+(aq) + NO3-(aq) ; KNA + ! NH3(g) + HNO3(g) = NH4NO3(s) ; K3 + ! H2O(aq) = H+(aq) + OH-(aq) ; KW + !================================================================= + KNA = 2.511d+06 * EXP( 29.17d0 * T3 + 16.83d0 * T4 ) * T6 + K1A = 1.805d-05 * EXP( -1.50d0 * T3 + 26.92d0 * T4 ) + K2SA = 1.015d-02 * EXP( 8.85d0 * T3 + 25.14d0 * T4 ) + KW = 1.010d-14 * EXP( -22.52d0 * T3 + 26.92d0 * T4 ) + KPH = 57.639d0 * EXP( 13.79d0 * T3 - 5.39d0 * T4 ) * T6 + !K3 = 5.746E-17 * EXP( -74.38 * T3 + 6.12 * T4 ) * T6 * T6 + KHAT = KPH * K1A / KW + KAN = KNA * KHAT + + ! Compute temperature dependent equilibrium constant for NH4NO3 + ! (from Mozurkewich, 1993) + K3 = EXP( 118.87d0 - 24084.0d0 / TEMP - 6.025d0 * LOG( TEMP ) ) + + ! Convert to (micromoles/m**3) **2 + K3 = K3 * CONVT * CONVT + + WH2O = 0.0d0 + STION = 0.0d0 +!.sds AH2O = 0.0d0 + AH2O = FLOOR + + MAS = 0.0d0 + MAN = 0.0d0 + HPLUS = 0.0d0 + !-------------------------------------------------------------- + ! Prior to 4/10/08: + ! Now make these parameters so that they won't lose their + ! values. (phs, bmy, 4/10/08) + !TOLER1 = 0.00001d0 + !TOLER2 = 0.001d0 + !-------------------------------------------------------------- + NITR = 0 + NR = 0 + GAMAAN = 1.0d0 + GAMOLD = 1.0d0 + + ! If there is very little sulfate and nitrate + ! set concentrations to a very small value and return. + IF ( ( TSO4 .LT. MINSO4 ) .AND. ( TNO3 .LT. MINNO3 ) ) THEN + ASO4 = MAX( FLOOR, ASO4 ) + AHSO4 = MAX( FLOOR, AHSO4 ) ! [rjp, 12/12/01] + ANO3 = MAX( FLOOR, ANO3 ) + ANH4 = MAX( FLOOR, ANH4 ) + WH2O = FLOOR + AH2O = FLOOR + GNH3 = MAX( FLOOR, GNH3 ) + GNO3 = MAX( FLOOR, GNO3 ) + + RETURN + ENDIF + + !================================================================= + ! High Ammonia Case + !================================================================= + IF ( RATIO .GT. 2.0d0 ) THEN + + GAMAAN = 0.1d0 + + ! Set up twice the sulfate for future use. + TWOSO4 = 2.0d0 * TSO4 + XNO3 = 0.0d0 + YNH4 = TWOSO4 + + ! Treat different regimes of relative humidity + ! + ! ZSR relationship is used to set water levels. Units are + ! 10**(-6) kg water/ (cubic meter of air) + ! start with ammomium sulfate solution without nitrate + + CALL AWATER( IRH, TSO4, YNH4, TNO3, AH2O ) !**** note TNO3 + WH2O = 1.0d-3 * AH2O + + ASO4 = TSO4 * MWSO4 + + ! In sulfate poor case, Sulfate ion is preferred + ! Set bisulfate equal to zero [rjp, 12/12/01] + AHSO4 = 0.0d0 + ANO3 = 0.0d0 + ANH4 = YNH4 * MWNH4 + WFRAC = AH2O / ( ASO4 + ANH4 + AH2O ) + + !IF ( WFRAC .EQ. 0.0 ) RETURN ! No water + IF ( WFRAC .LT. 0.2d0 ) THEN + + ! "dry" ammonium sulfate and ammonium nitrate + ! compute free ammonia + FNH3 = TNH4 - TWOSO4 + CC = TNO3 * FNH3 - K3 + + ! check for not enough to support aerosol + IF ( CC .LE. 0.0d0 ) THEN + XNO3 = 0.0d0 + ELSE + AA = 1.0d0 + BB = -( TNO3 + FNH3 ) + DISC = BB * BB - 4.0d0 * CC + + ! Check for complex roots of the quadratic + ! set retain initial values of nitrate and RETURN + ! if complex roots are found + IF ( DISC .LT. 0.0d0 ) THEN + XNO3 = 0.0d0 + AH2O = 1000.0d0 * WH2O + YNH4 = TWOSO4 + ASO4 = TSO4 * MWSO4 + AHSO4 = 0.0d0 + ANH4 = YNH4 * MWNH4 + GNH3 = MWNH3 * MAX( FLOOR, ( TNH4 - YNH4 ) ) + GNO3 = GNO3_IN + ANO3 = ANO3_IN + RETURN + ENDIF + + ! to get here, BB .lt. 0.0, CC .gt. 0.0 always + DD = SQRT( DISC ) + XXQ = -0.5d0 * ( BB + SIGN ( 1.0d0, BB ) * DD ) + + + ! Since both roots are positive, select smaller root. + XNO3 = MIN( XXQ / AA, CC / XXQ ) + + ENDIF ! CC .LE. 0.0 + + AH2O = 1000.0d0 * WH2O + YNH4 = TWOSO4 + XNO3 + ASO4 = TSO4 * MWSO4 + AHSO4 = FLOOR + ANO3 = XNO3 * MWNO3 + ANH4 = YNH4 * MWNH4 + GNH3 = MWNH3 * MAX( FLOOR, ( TNH4 - YNH4 ) ) + GNO3 = MAX( FLOOR, ( TMASSHNO3 - ANO3 ) ) + RETURN + ENDIF ! WFRAC .LT. 0.2 + + ! liquid phase containing completely neutralized sulfate and + ! some nitrate. Solve for composition and quantity. + MAS = TSO4 / WH2O + MAN = 0.0d0 + XNO3 = 0.0d0 + YNH4 = TWOSO4 + PHIOLD = 1.0d0 + + !=============================================================== + ! Start loop for iteration + ! + ! The assumption here is that all sulfate is ammonium sulfate, + ! and is supersaturated at lower relative humidities. + !=============================================================== + DO NNN = 1, 50 ! loop count reduced 0409/2001 by FSB + + NITR = NNN + GASQD = GAMAAN * GAMAAN + WSQD = WH2O * WH2O + KW2 = KAN * WSQD / GASQD + AA = 1.0 - KW2 + BB = TWOSO4 + KW2 * ( TNO3 + TNH4 - TWOSO4 ) + CC = -KW2 * TNO3 * ( TNH4 - TWOSO4 ) + + ! This is a quadratic for XNO3 [MICROMOLES / M**3] + ! of nitrate in solution + DISC = BB * BB - 4.0d0 * AA * CC + + ! Check for complex roots, retain inital values and RETURN + IF ( DISC .LT. 0.0 ) THEN + XNO3 = 0.0d0 + AH2O = 1000.0d0 * WH2O + YNH4 = TWOSO4 + ASO4 = TSO4 * MWSO4 + AHSO4 = FLOOR ! [rjp, 12/12/01] + ANH4 = YNH4 * MWNH4 + GNH3 = MWNH3 * MAX( FLOOR, (TNH4 - YNH4 ) ) + GNO3 = GNO3_IN + ANO3 = ANO3_IN + RETURN + ENDIF + + ! Deal with degenerate case (yoj) + IF ( AA .NE. 0.0d0 ) THEN + DD = SQRT( DISC ) + XXQ = -0.5d0 * ( BB + SIGN( 1.0d0, BB ) * DD ) + RR1 = XXQ / AA + RR2 = CC / XXQ + + ! choose minimum positve root + IF ( ( RR1 * RR2 ) .LT. 0.0d0 ) THEN + XNO3 = MAX( RR1, RR2 ) + ELSE + XNO3 = MIN( RR1, RR2 ) + ENDIF + ELSE + XNO3 = - CC / BB ! AA equals zero here. + ENDIF + + XNO3 = MIN( XNO3, TNO3 ) + + ! This version assumes no solid sulfate forms (supersaturated ) + ! Now update water + CALL AWATER ( IRH, TSO4, YNH4, XNO3, AH2O ) + + ! ZSR relationship is used to set water levels. Units are + ! 10**(-6) kg water/ (cubic meter of air). The conversion + ! from micromoles to moles is done by the units of WH2O. + WH2O = 1.0d-3 * AH2O + + ! Ionic balance determines the ammonium in solution. + MAN = XNO3 / WH2O + MAS = TSO4 / WH2O + MNH4 = 2.0d0 * MAS + MAN + YNH4 = MNH4 * WH2O + + ! MAS, MAN and MNH4 are the aqueous concentrations of sulfate, + ! nitrate, and ammonium in molal units (moles/(kg water) ). + STION = 3.0d0 * MAS + MAN + CAT( 1 ) = 0.0d0 + CAT( 2 ) = MNH4 + AN ( 1 ) = MAS + AN ( 2 ) = MAN + AN ( 3 ) = 0.0d0 + CALL ACTCOF ( CAT, AN, GAMS, MOLNU, PHIBAR ) + GAMAAN = GAMS( 2, 2 ) + + ! Use GAMAAN for convergence control + EROR = ABS( GAMOLD - GAMAAN ) / GAMOLD + GAMOLD = GAMAAN + + ! Check to see if we have a solution + IF ( EROR .LE. TOLER1 ) THEN + ASO4 = TSO4 * MWSO4 + AHSO4 = 0.0d0 ! [rjp, 12/12/01] + ANO3 = XNO3 * MWNO3 + ANH4 = YNH4 * MWNH4 + GNO3 = MAX( FLOOR, ( TMASSHNO3 - ANO3 ) ) + GNH3 = MWNH3 * MAX( FLOOR, ( TNH4 - YNH4 ) ) + AH2O = 1000.0d0 * WH2O + RETURN + ENDIF + + ENDDO + + ! If after NITR iterations no solution is found, then: + ! FSB retain the initial values of nitrate particle and vapor + ! note whether or not convert all bisulfate to sulfate + ASO4 = TSO4 * MWSO4 + AHSO4 = FLOOR + XNO3 = TNO3 / MWNO3 + YNH4 = TWOSO4 + ANH4 = YNH4 * MWNH4 + + CALL AWATER ( IRH, TSO4, YNH4, XNO3, AH2O ) + + GNO3 = GNO3_IN + ANO3 = ANO3_IN + GNH3 = MAX( FLOOR, MWNH3 * (TNH4 - YNH4 ) ) + RETURN + + !================================================================ + ! Low Ammonia Case + ! + ! Coded by Dr. Francis S. Binkowski 12/8/91.(4/26/95) + ! modified 8/28/98 + ! modified 04/09/2001 + ! + ! All cases covered by this logic + !================================================================= + ELSE + + WH2O = 0.0d0 + CALL AWATER ( IRH, TSO4, TNH4, TNO3, AH2O ) + WH2O = 1.0d-3 * AH2O + ZH2O = AH2O + + ! convert 10**(-6) kg water/(cubic meter of air) to micrograms + ! of water per cubic meter of air (1000 g = 1 kg) + ! in sulfate rich case, preferred form is HSO4- + !ASO4 = TSO4 * MWSO4 + ASO4 = FLOOR ![rjp, 12/12/01] + AHSO4 = TSO4 * MWSO4 ![rjp, 12/12/01] + ANH4 = TNH4 * MWNH4 + ANO3 = ANO3_IN + GNO3 = TMASSHNO3 - ANO3 + GNH3 = FLOOR + + !============================================================== + ! *** Examine special cases and return if necessary. + ! + ! FSB For values of RATIO less than 0.5 do no further + ! calculations. The code will cycle and still predict the + ! same amount of ASO4, ANH4, ANO3, AH2O so terminate early + ! to swame computation + !============================================================== + IF ( RATIO .LT. 0.5d0 ) RETURN ! FSB 04/09/2001 + + ! Check for zero water. + IF ( WH2O .EQ. 0.0d0 ) RETURN + ZSO4 = TSO4 / WH2O + + ! ZSO4 is the molality of total sulfate i.e. MSO4 + MHSO4 + ! do not solve for aerosol nitrate for total sulfate molality + ! greater than 11.0 because the model parameters break down + !### IF ( ZSO4 .GT. 11.0 ) THEN + !IF ( ZSO4 .GT. 9.0 ) THEN ! 18 June 97 + !IF ( ZSO4 .GT. 9.d0 ) THEN ! H. Bian 24 June 2015 + IF ( ZSO4 .GT. 9.00 ) THEN ! H. Bian 24 June 2015 + RETURN + ENDIF + IF ( ZSO4 .GT. 0.1d0 .and. TEMP .le. 220.d0) THEN ! H. Bian 24 June 2015 + RETURN + ENDIF + + ! *** Calculation may now proceed. + ! + ! First solve with activity coeffs of 1.0, then iterate. + PHIOLD = 1.0d0 + GAMANA = 1.0d0 + GAMAS1 = 1.0d0 + GAMAS2 = 1.0d0 + GAMAAB = 1.0d0 + GAMOLD = 1.0d0 + + ! All ammonia is considered to be aerosol ammonium. + MNH4 = TNH4 / WH2O + + ! MNH4 is the molality of ammonium ion. + YNH4 = TNH4 + + ! loop for iteration + DO NNN = 1, 50 ! loop count reduced 04/09/2001 by FSB + NITR = NNN + + ! set up equilibrium constants including activities + ! solve the system for hplus first then sulfate & nitrate + RK2SA = K2SA * GAMAS2 * GAMAS2 / (GAMAS1 * GAMAS1 * GAMAS1) + RKNA = KNA / ( GAMANA * GAMANA ) + RKNWET = RKNA * WH2O + T21 = ZSO4 - MNH4 + T221 = ZSO4 + T21 + + ! set up coefficients for cubic + A2 = RK2SA + RKNWET - T21 + A1 = RK2SA * RKNWET - T21 * ( RK2SA + RKNWET ) & + & - RK2SA * ZSO4 - RKNA * TNO3 + A0 = - (T21 * RK2SA * RKNWET & + & + RK2SA * RKNWET * ZSO4 + RK2SA * RKNA * TNO3 ) + + CALL CUBIC ( A2, A1, A0, NR, CRUTES ) + + ! Code assumes the smallest positive root is in CRUTES(1) + HPLUS = CRUTES( 1 ) + BAL = HPLUS **3 + A2 * HPLUS**2 + A1 * HPLUS + A0 + + ! molality of sulfate ion + MSO4 = RK2SA * ZSO4 / ( HPLUS + RK2SA ) + + ! molality of bisulfate ion + ! MAX added 04/09/2001 by FSB + MHSO4 = MAX( 1.0d-10, ZSO4 - MSO4 ) + + ! molality of nitrate ion + MNA = RKNA * TNO3 / ( HPLUS + RKNWET ) + MNA = MAX( 0.0d0, MNA ) + MNA = MIN( MNA, TNO3 / WH2O ) + XNO3 = MNA * WH2O + ANO3 = MNA * WH2O * MWNO3 + GNO3 = MAX( FLOOR, TMASSHNO3 - ANO3 ) + ASO4 = MSO4 * WH2O * MWSO4 ![rjp, 12/12/01] + AHSO4 = MHSO4 * WH2O * MWSO4 ![rjp, 12/12/01] + + ! Calculate ionic strength + STION = 0.5d0 * ( HPLUS + MNA + MNH4 + MHSO4 + 4.0d0 * MSO4) + + ! Update water + CALL AWATER ( IRH, TSO4, YNH4, XNO3, AH2O ) + + ! Convert 10**(-6) kg water/(cubic meter of air) to micrograms + ! of water per cubic meter of air (1000 g = 1 kg) + WH2O = 1.0d-3 * AH2O + CAT( 1 ) = HPLUS + CAT( 2 ) = MNH4 + AN ( 1 ) = MSO4 + AN ( 2 ) = MNA + AN ( 3 ) = MHSO4 + + CALL ACTCOF ( CAT, AN, GAMS, MOLNU, PHIBAR ) + + GAMANA = GAMS( 1, 2 ) + GAMAS1 = GAMS( 1, 1 ) + GAMAS2 = GAMS( 1, 3 ) + GAMAAN = GAMS( 2, 2 ) + + !------------------------------------------------------------ + ! Add robustness: now check if GAMANA or GAMAS1 is too small + ! for the division in RKNA and RK2SA. If they are, return w/ + ! original values: basically replicate the procedure used + ! after the current DO-loop in case of no-convergence + ! (phs, bmy, rjp, 4/10/08) + !-------------------------------------------------------------- + IF ( ( ABS( GAMANA ) < EPS ) .OR. ( ABS( GAMAS1 ) < EPS ) ) THEN + + ! Reset to original values + ANH4 = TNH4 * MWNH4 + GNH3 = FLOOR + GNO3 = GNO3_IN + ANO3 = ANO3_IN + ASO4 = TSO4 * MWSO4 + AHSO4 = FLOOR + + ! Update water + CALL AWATER ( IRH, TSO4, TNH4, TNO3, AH2O ) + + ! Exit this subroutine + RETURN + ENDIF + + GAMAHAT = ( GAMAS2 * GAMAS2 / ( GAMAAB * GAMAAB ) ) + BHAT = KHAT * GAMAHAT + !### EROR = ABS ( ( PHIOLD - PHIBAR ) / PHIOLD ) + !### PHIOLD = PHIBAR + EROR = ABS ( GAMOLD - GAMAHAT ) / GAMOLD + GAMOLD = GAMAHAT + + ! return with good solution + IF ( EROR .LE. TOLER2 ) THEN + RETURN + ENDIF + + ENDDO + + ! after NITR iterations, failure to solve the system + ! convert all ammonia to aerosol ammonium and return input + ! values of NO3 and HNO3 + ANH4 = TNH4 * MWNH4 + GNH3 = FLOOR + GNO3 = GNO3_IN + ANO3 = ANO3_IN + ASO4 = TSO4 * MWSO4 ! [rjp, 12/17/01] + AHSO4= FLOOR ! [rjp, 12/17/01] + + CALL AWATER ( IRH, TSO4, TNH4, TNO3, AH2O ) + + RETURN + + ENDIF ! ratio .gt. 2.0 + + ! Return to calling program + END SUBROUTINE RPMARES + +!------------------------------------------------------------------------------ + + SUBROUTINE AWATER( IRHX, MSO4, MNH4, MNO3, WH2O ) +! +!****************************************************************************** +! NOTE!!! wh2o is returned in micrograms / cubic meter +! mso4,mnh4,mno3 are in microMOLES / cubic meter +! +! This version uses polynomials rather than tables, and uses empirical +! polynomials for the mass fraction of solute (mfs) as a function of water +! activity +! where: +! +! mfs = ms / ( ms + mw) +! ms is the mass of solute +! mw is the mass of water. +! +! Define y = mw/ ms +! +! then mfs = 1 / (1 + y) +! +! y can then be obtained from the values of mfs as +! +! y = (1 - mfs) / mfs +! +! +! the aerosol is assumed to be in a metastable state if the rh is +! is below the rh of deliquescence, but above the rh of crystallization. +! +! ZSR interpolation is used for sulfates with x ( the molar ratio of +! ammonium to sulfate in eh range 0 <= x <= 2, by sections. +! section 1: 0 <= x < 1 +! section 2: 1 <= x < 1.5 +! section 3: 1.5 <= x < 2.0 +! section 4: 2 <= x +! In sections 1 through 3, only the sulfates can affect the amount of water +! on the particles. +! In section 4, we have fully neutralized sulfate, and extra ammonium which +! allows more nitrate to be present. Thus, the ammount of water is +! calculated +! using ZSR for ammonium sulfate and ammonium nitrate. Crystallization is +! assumed to occur in sections 2,3,and 4. See detailed discussion below. +! +! +! +! definitions: +! mso4, mnh4, and mno3 are the number of micromoles/(cubic meter of air) +! for sulfate, ammonium, and nitrate respectively +! irhx is the relative humidity (%) +! wh2o is the returned water amount in micrograms / cubic meter of air +! x is the molar ratio of ammonium to sulfate +! y0,y1,y1.5, y2 are the water contents in mass of water/mass of solute +! for pure aqueous solutions with x equal 1, 1.5, and 2 respectively. +! y3 is the value of the mass ratio of water to solute for +! a pure ammonium nitrate solution. +! +! +! coded by Dr. Francis S. Binkowski, 4/8/96. +! +! *** modified 05/30/2000 +! The use of two values of mfs at an ammonium to sulfate ratio +! representative of ammonium sulfate led to an minor inconsistancy +! in nitrate behavior as the ratio went from a value less than two +! to a value greater than two and vice versa with either ammonium +! held constant and sulfate changing, or sulfate held constant and +! ammonium changing. the value of Chan et al. (1992) is the only value +! now used. +! +! *** Modified 09/25/2002 +! Ported into "rpmares_mod.f". Now declare all variables with REAL*8. +! Also cleaned up comments and made cosmetic changes. Force double +! precision explicitly with "D" exponents. +!****************************************************************************** +! + ! Arguments + INTEGER :: IRHX + REAL*8 :: MSO4, MNH4, MNO3, WH2O + + ! Local variables + INTEGER :: IRH + REAL*8 :: TSO4, TNH4, TNO3, X, AW, AWC + REAL*8 :: MFS0, MFS1, MFS15, Y + REAL*8 :: Y0, Y1, Y15, Y2, Y3, Y40 + REAL*8 :: Y140, Y1540, YC, MFSSO4, MFSNO3 + + ! Molecular weight parameters + REAL*8, PARAMETER :: MWSO4 = 96.0636d0 + REAL*8, PARAMETER :: MWNH4 = 18.0985d0 + REAL*8, PARAMETER :: MWNO3 = 62.0649d0 + REAL*8, PARAMETER :: MW2 = MWSO4 + 2.0d0 * MWNH4 + REAL*8, PARAMETER :: MWANO3 = MWNO3 + MWNH4 + + !================================================================= + ! The polynomials use data for aw as a function of mfs from Tang + ! and Munkelwitz, JGR 99: 18801-18808, 1994. The polynomials were + ! fit to Tang's values of water activity as a function of mfs. + ! + ! *** coefficients of polynomials fit to Tang and Munkelwitz data + ! now give mfs as a function of water activity. + !================================================================= + REAL*8 :: C1(4) = (/ 0.9995178d0, -0.7952896d0, & + & 0.99683673d0, -1.143874d0 /) + + REAL*8 :: C15(4) = (/ 1.697092d0, -4.045936d0, & + & 5.833688d0, -3.463783d0 /) + + !================================================================= + ! The following coefficients are a fit to the data in Table 1 of + ! Nair & Vohra, J. Aerosol Sci., 6: 265-271, 1975 + ! data c0/0.8258941, -1.899205, 3.296905, -2.214749 / + ! + ! New data fit to data from + ! Nair and Vohra J. Aerosol Sci., 6: 265-271, 1975 + ! Giaque et al. J.Am. Chem. Soc., 82: 62-70, 1960 + ! Zeleznik J. Phys. Chem. Ref. Data, 20: 157-1200 + !================================================================= + REAL*8 :: C0(4) = (/ 0.798079d0, -1.574367d0, & + & 2.536686d0, -1.735297d0 /) + + !================================================================= + ! Polynomials for ammonium nitrate and ammonium sulfate are from: + ! Chan et al.1992, Atmospheric Environment (26A): 1661-1673. + !================================================================= + REAL*8 :: KNO3(6) = (/ 0.2906d0, 6.83665d0, -26.9093d0, & + & 46.6983d0, -38.803d0, 11.8837d0 /) + + REAL*8 :: KSO4(6) = (/ 2.27515d0, -11.147d0, 36.3369d0, & + & -64.2134d0, 56.8341d0, -20.0953d0 /) + + !================================================================= + ! AWATER begins here! + !================================================================= + + ! Check range of per cent relative humidity + IRH = IRHX + IRH = MAX( 1, IRH ) + IRH = MIN( IRH, 100 ) + + ! Water activity = fractional relative humidity + AW = DBLE( IRH ) / 100.0d0 + TSO4 = MAX( MSO4 , 0.0d0 ) + TNH4 = MAX( MNH4 , 0.0d0 ) + TNO3 = MAX( MNO3 , 0.0d0 ) + X = 0.0d0 + + ! If there is non-zero sulfate calculate the molar ratio + ! otherwise check for non-zero nitrate and ammonium + IF ( TSO4 .GT. 0.0d0 ) THEN + X = TNH4 / TSO4 + ELSE + IF ( TNO3 .GT. 0.0d0 .AND. TNH4 .GT. 0.0d0 ) X = 10.0d0 + ENDIF + + ! *** begin screen on x for calculating wh2o + IF ( X .LT. 1.0d0 ) THEN + MFS0 = nh3_POLY4( C0, AW ) + MFS1 = nh3_POLY4( C1, AW ) + Y0 = ( 1.0d0 - MFS0 ) / MFS0 + Y1 = ( 1.0d0 - MFS1 ) / MFS1 + Y = ( 1.0d0 - X ) * Y0 + X * Y1 + + ELSE IF ( X .LT. 1.5d0 ) THEN + + IF ( IRH .GE. 40 ) THEN + MFS1 = nh3_POLY4( C1, AW ) + MFS15 = nh3_POLY4( C15, AW ) + Y1 = ( 1.0d0 - MFS1 ) / MFS1 + Y15 = ( 1.0d0 - MFS15 ) / MFS15 + Y = 2.0d0 * ( Y1 * ( 1.5d0 - X ) + Y15 *( X - 1.0d0 ) ) + + !============================================================== + ! Set up for crystalization + ! + ! Crystallization is done as follows: + ! + ! For 1.5 <= x, crystallization is assumed to occur + ! at rh = 0.4 + ! + ! For x <= 1.0, crystallization is assumed to occur at an + ! rh < 0.01, and since the code does not allow ar rh < 0.01, + ! crystallization is assumed not to occur in this range. + ! + ! For 1.0 <= x <= 1.5 the crystallization curve is a straignt + ! line from a value of y15 at rh = 0.4 to a value of zero at + ! y1. From point B to point A in the diagram. The algorithm + ! does a double interpolation to calculate the amount of + ! water. + ! + ! y1(0.40) y15(0.40) + ! + + Point B + ! + ! + ! + ! + ! +--------------------+ + ! x=1 x=1.5 + ! Point A + !============================================================== + ELSE + + ! rh along the crystallization curve. + AWC = 0.80d0 * ( X - 1.0d0 ) + Y = 0.0d0 + + ! interpolate using crystalization curve + IF ( AW .GE. AWC ) THEN + MFS1 = nh3_POLY4( C1, 0.40d0 ) + MFS15 = nh3_POLY4( C15, 0.40d0 ) + Y140 = ( 1.0d0 - MFS1 ) / MFS1 + Y1540 = ( 1.0d0 - MFS15 ) / MFS15 + Y40 = 2.0d0 * ( Y140 * ( 1.5d0 - X ) + & + & Y1540 * ( X - 1.0d0 ) ) + + ! Y along crystallization curve + YC = 2.0d0 * Y1540 * ( X - 1.0d0 ) + Y = Y40 - (Y40 - YC) * (0.40d0 - AW) / (0.40d0 - AWC) + ENDIF + ENDIF + + ELSE IF ( X .LT. 2.0d0 ) then ! changed 12/11/2000 by FSB + Y = 0.0D0 + + IF ( IRH .GE. 40 ) THEN + MFS15 = nh3_POLY4( C15, AW ) + !MFS2 = nh3_POLY4( C2, AW ) + Y15 = ( 1.0d0 - MFS15 ) / MFS15 + !y2 = ( 1.0d0 - MFS2 ) / MFS2 + MFSSO4 = nh3_POLY6( KSO4, AW ) ! Changed 05/30/2000 by FSB + Y2 = ( 1.0d0 - MFSSO4 ) / MFSSO4 + Y = 2.0d0 * (Y15 * (2.0d0 - X) + Y2 * (X - 1.5d0) ) + ENDIF + + ELSE ! 2.0 <= x changed 12/11/2000 by FSB + + !============================================================== + ! Regime where ammonium sulfate and ammonium nitrate are + ! in solution. + ! + ! following cf&s for both ammonium sulfate and ammonium nitrate + ! check for crystallization here. their data indicate a 40% + ! value is appropriate. + !============================================================== + Y2 = 0.0d0 + Y3 = 0.0d0 + + IF ( IRH .GE. 40 ) THEN + MFSSO4 = nh3_POLY6( KSO4, AW ) + MFSNO3 = nh3_POLY6( KNO3, AW ) + Y2 = ( 1.0d0 - MFSSO4 ) / MFSSO4 + Y3 = ( 1.0d0 - MFSNO3 ) / MFSNO3 + + ENDIF + + ENDIF ! end of checking on x + + !================================================================= + ! Now set up output of WH2O + ! WH2O units are micrograms (liquid water) / cubic meter of air + !================================================================= + IF ( X .LT. 2.0D0 ) THEN ! changed 12/11/2000 by FSB + + WH2O = Y * ( TSO4 * MWSO4 + MWNH4 * TNH4 ) + + ELSE + + ! this is the case that all the sulfate is ammonium sulfate + ! and the excess ammonium forms ammonum nitrate + WH2O = Y2 * TSO4 * MW2 + Y3 * TNO3 * MWANO3 + + ENDIF + + ! Return to calling program + END SUBROUTINE AWATER + +!------------------------------------------------------------------------------ + + FUNCTION nh3_POLY4( A, X ) RESULT( Y ) + + ! Arguments + REAL*8, INTENT(IN) :: A(4), X + + ! Return value + REAL*8 :: Y + + !================================================================= + ! nh3_POLY4 begins here! + !================================================================= + Y = A(1) + X * ( A(2) + X * ( A(3) + X * ( A(4) ))) + + ! Return to calling program + END FUNCTION nh3_POLY4 + +!------------------------------------------------------------------------------ + + FUNCTION nh3_POLY6( A, X ) RESULT( Y ) + + ! Arguments + REAL*8, INTENT(IN) :: A(6), X + + ! Return value + REAL*8 :: Y + + !================================================================= + ! nh3_POLY6 begins here! + !================================================================= + Y = A(1) + X * ( A(2) + X * ( A(3) + X * ( A(4) + & + & X * ( A(5) + X * ( A(6) ))))) + + ! Return to calling program + END FUNCTION nh3_POLY6 + +!------------------------------------------------------------------------------ + + SUBROUTINE CUBIC( A2, A1, A0, NR, CRUTES ) +! +!****************************************************************************** +! Subroutine to find the roots of a cubic equation / 3rd order polynomial +! Formulae can be found in numer. recip. on page 145 +! kiran developed this version on 25/4/1990 +! Dr. Francis S. Binkowski modified the routine on 6/24/91, 8/7/97 +! *** +! *** modified 2/23/98 by fsb to incorporate Dr. Ingmar Ackermann's +! recommendations for setting a0, a1,a2 as real*8 variables. +! +! Modified by Bob Yantosca (10/15/02) +! - Now use upper case / white space +! - force double precision with "D" exponents +! - updated comments / cosmetic changes +! - now call ERROR_STOP from "error_mod.f" to stop the run safely +!****************************************************************************** +! + ! Arguments + INTEGER :: NR + REAL*8 :: A2, A1, A0 + REAL*8 :: CRUTES(3) + + ! Local variables + REAL*8 :: QQ, RR, A2SQ, THETA, DUM1, DUM2 + REAL*8 :: PART1, PART2, PART3, RRSQ, PHI, YY1 + REAL*8 :: YY2, YY3, COSTH, SINTH + REAL*8, PARAMETER :: ONE = 1.0d0 + REAL*8, PARAMETER :: SQRT3 = 1.732050808d0 + REAL*8, PARAMETER :: ONE3RD = 0.333333333d0 + ! !LOCAL VARIABLES: + character (len=75) :: err_msg + + !================================================================= + ! CUBIC begins here! + !================================================================= + A2SQ = A2 * A2 + QQ = ( A2SQ - 3.d0*A1 ) / 9.d0 + RR = ( A2*( 2.d0*A2SQ - 9.d0*A1 ) + 27.d0*A0 ) / 54.d0 + + ! CASE 1 THREE REAL ROOTS or CASE 2 ONLY ONE REAL ROOT + DUM1 = QQ * QQ * QQ + RRSQ = RR * RR + DUM2 = DUM1 - RRSQ + + IF ( DUM2 .GE. 0.d0 ) THEN + + ! Now we have three real roots + PHI = SQRT( DUM1 ) + + IF ( ABS( PHI ) .LT. 1.d-20 ) THEN + CRUTES(1) = 0.0d0 + CRUTES(2) = 0.0d0 + CRUTES(3) = 0.0d0 + NR = 0 +!.sds no such module - what is ours? +!.sds CALL ERROR_STOP( 'PHI < 1d-20', 'CUBIC (rpmares_mod.f)' ) + print *,'PHI < 1d-20 in CUBIC (rpmares_mod.f)' + err_msg = 'PHI < 1d-20 in CUBIC (rpmares_mod.f):' + call PrintError & + & (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0) + + ENDIF + + THETA = ACOS( RR / PHI ) / 3.0d0 + COSTH = COS( THETA ) + SINTH = SIN( THETA ) + + ! Use trig identities to simplify the expressions + ! Binkowski's modification + PART1 = SQRT( QQ ) + YY1 = PART1 * COSTH + YY2 = YY1 - A2/3.0d0 + YY3 = SQRT3 * PART1 * SINTH + CRUTES(3) = -2.0d0*YY1 - A2/3.0d0 + CRUTES(2) = YY2 + YY3 + CRUTES(1) = YY2 - YY3 + + ! Set negative roots to a large positive value + IF ( CRUTES(1) .LT. 0.0d0 ) CRUTES(1) = 1.0d9 + IF ( CRUTES(2) .LT. 0.0d0 ) CRUTES(2) = 1.0d9 + IF ( CRUTES(3) .LT. 0.0d0 ) CRUTES(3) = 1.0d9 + + ! Put smallest positive root in crutes(1) + CRUTES(1) = MIN( CRUTES(1), CRUTES(2), CRUTES(3) ) + NR = 3 + + ELSE + + ! Now here we have only one real root + PART1 = SQRT( RRSQ - DUM1 ) + PART2 = ABS( RR ) + PART3 = ( PART1 + PART2 )**ONE3RD + CRUTES(1) = -SIGN(ONE,RR) * ( PART3 + (QQ/PART3) ) - A2/3.D0 + CRUTES(2) = 0.D0 + CRUTES(3) = 0.D0 + NR = 1 + + ENDIF + + ! Return to calling program + END SUBROUTINE CUBIC + +!------------------------------------------------------------------------------ + + SUBROUTINE ACTCOF( CAT, AN, GAMA, MOLNU, PHIMULT ) +! +!****************************************************************************** +! +! DESCRIPTION: +! +! This subroutine computes the activity coefficients of (2NH4+,SO4--), +! (NH4+,NO3-),(2H+,SO4--),(H+,NO3-),AND (H+,HSO4-) in aqueous +! multicomponent solution, using Bromley's model and Pitzer's method. +! +! REFERENCES: +! +! Bromley, L.A. (1973) Thermodynamic properties of strong electrolytes +! in aqueous solutions. AIChE J. 19, 313-320. +! +! Chan, C.K. R.C. Flagen, & J.H. Seinfeld (1992) Water Activities of +! NH4NO3 / (NH4)2SO4 solutions, Atmos. Environ. (26A): 1661-1673. +! +! Clegg, S.L. & P. Brimblecombe (1988) Equilibrium partial pressures +! of strong acids over saline solutions - I HNO3, +! Atmos. Environ. (22): 91-100 +! +! Clegg, S.L. & P. Brimblecombe (1990) Equilibrium partial pressures +! and mean activity and osmotic coefficients of 0-100% nitric acid +! as a function of temperature, J. Phys. Chem (94): 5369 - 5380 +! +! Pilinis, C. and J.H. Seinfeld (1987) Continued development of a +! general equilibrium model for inorganic multicomponent atmospheric +! aerosols. Atmos. Environ. 21(11), 2453-2466. +! +! +! +! +! ARGUMENT DESCRIPTION: +! +! CAT(1) : conc. of H+ (moles/kg) +! CAT(2) : conc. of NH4+ (moles/kg) +! AN(1) : conc. of SO4-- (moles/kg) +! AN(2) : conc. of NO3- (moles/kg) +! AN(3) : conc. of HSO4- (moles/kg) +! GAMA(2,1) : mean molal ionic activity coeff for (2NH4+,SO4--) +! GAMA(2,2) : " " " " " " (NH4+,NO3-) +! GAMA(2,3) : " " " " " " (NH4+. HSO4-) +! GAMA(1,1) : " " " " " " (2H+,SO4--) +! GAMA(1,2) : " " " " " " (H+,NO3-) +! GAMA(1,3) : " " " " " " (H+,HSO4-) +! MOLNU : the total number of moles of all ions. +! PHIMULT : the multicomponent paractical osmotic coefficient. +! +! REVISION HISTORY: +! Who When Detailed description of changes +! --------- -------- ------------------------------------------- +! S.Roselle 7/26/89 Copied parts of routine BROMLY, and began this +! new routine using a method described by Pilinis +! and Seinfeld 1987, Atmos. Envirn. 21 pp2453-2466. +! S.Roselle 7/30/97 Modified for use in Models-3 +! F.Binkowski 8/7/97 Modified coefficients BETA0, BETA1, CGAMA +! R.Yantosca 9/25/02 Ported into "rpmares_mod.f" for GEOS-CHEM. Cleaned +! up comments, etc. Also force double precision by +! declaring REALs as REAL*8 and by using "D" exponents. +!****************************************************************************** +! + + ! Error codes + + + + !================================================================= + ! PARAMETERS and their descriptions: + !================================================================= + INTEGER, PARAMETER :: NCAT = 2 ! number of cation + INTEGER, PARAMETER :: NAN = 3 ! number of anions + REAL*8, PARAMETER :: XSTAT0 = 0 ! Normal, successful completion + REAL*8, PARAMETER :: XSTAT1 = 1 ! File I/O error + REAL*8, PARAMETER :: XSTAT2 = 2 ! Execution error + REAL*8, PARAMETER :: XSTAT3 = 3 ! Special error + + !================================================================= + ! ARGUMENTS and their descriptions + !================================================================= + REAL*8 :: MOLNU ! tot # moles of all ions + REAL*8 :: PHIMULT ! multicomponent paractical + ! osmotic coef + REAL*8 :: CAT(NCAT) ! cation conc in moles/kg (input) + REAL*8 :: AN(NAN) ! anion conc in moles/kg (input) + REAL*8 :: GAMA(NCAT,NAN) ! mean molal ionic activity coefs + + !================================================================= + ! SCRATCH LOCAL VARIABLES and their descriptions: + !================================================================= + INTEGER :: IAN ! anion indX + INTEGER :: ICAT ! cation indX + REAL*8 :: FGAMA ! + REAL*8 :: I ! ionic strength + REAL*8 :: R ! + REAL*8 :: S ! + REAL*8 :: TA ! + REAL*8 :: TB ! + REAL*8 :: TC ! + REAL*8 :: TEXPV ! + REAL*8 :: TRM ! + REAL*8 :: TWOI ! 2*ionic strength + REAL*8 :: TWOSRI ! 2*sqrt of ionic strength + REAL*8 :: ZBAR ! + REAL*8 :: ZBAR2 ! + REAL*8 :: ZOT1 ! + REAL*8 :: SRI ! square root of ionic strength + REAL*8 :: F2(NCAT) ! + REAL*8 :: F1(NAN) ! + REAL*8 :: BGAMA (NCAT,NAN) ! + REAL*8 :: X (NCAT,NAN) ! + REAL*8 :: M (NCAT,NAN) ! molality of each electrolyte + REAL*8 :: LGAMA0(NCAT,NAN) ! binary activity coefficients + REAL*8 :: Y (NAN,NCAT) ! + REAL*8 :: BETA0 (NCAT,NAN) ! binary activity coef parameter + REAL*8 :: BETA1 (NCAT,NAN) ! binary activity coef parameter + REAL*8 :: CGAMA (NCAT,NAN) ! binary activity coef parameter + REAL*8 :: V1 (NCAT,NAN) ! # of cations in electrolyte + ! formula + REAL*8 :: V2 (NCAT,NAN) ! # of anions in electrolyte + ! formula + ! absolute value of charges of cation + REAL*8 :: ZP(NCAT) = (/ 1.0d0, 1.0d0 /) + + ! absolute value of charges of anion + REAL*8 :: ZM(NAN) = (/ 2.0d0, 1.0d0, 1.0d0 /) + + ! Character values. + CHARACTER(LEN=120) :: XMSG = ' ' +! CHARACTER(LEN=16), SAVE :: PNAME = ' driver program name' + + !================================================================ + ! *** Sources for the coefficients BETA0, BETA1, CGAMA + ! (1,1);(1,3) - Clegg & Brimblecombe (1988) + ! (2,3) - Pilinis & Seinfeld (1987), cgama different + ! (1,2) - Clegg & Brimblecombe (1990) + ! (2,1);(2,2) - Chan, Flagen & Seinfeld (1992) + !================================================================ + + ! now set the basic constants, BETA0, BETA1, CGAMA + DATA BETA0(1,1) /2.98d-2/, BETA1(1,1) / 0.0d0/, & + & CGAMA(1,1) /4.38d-2/ ! 2H+SO4- + + DATA BETA0(1,2) / 1.2556d-1/, BETA1(1,2) / 2.8778d-1/, & + & CGAMA(1,2) / -5.59d-3/ ! HNO3 + + DATA BETA0(1,3) / 2.0651d-1/, BETA1(1,3) / 5.556d-1/, & + & CGAMA(1,3) /0.0d0/ ! H+HSO4- + + DATA BETA0(2,1) / 4.6465d-2/, BETA1(2,1) /-0.54196d0/, & + & CGAMA(2,1) /-1.2683d-3/ ! (NH4)2SO4 + + DATA BETA0(2,2) /-7.26224d-3/, BETA1(2,2) /-1.168858d0/, & + & CGAMA(2,2) / 3.51217d-5/ ! NH4NO3 + + DATA BETA0(2,3) / 4.494d-2/, BETA1(2,3) / 2.3594d-1/, & + & CGAMA(2,3) /-2.962d-3/ ! NH4HSO4 + + DATA V1(1,1), V2(1,1) / 2.0d0, 1.0d0 / ! 2H+SO4- + DATA V1(2,1), V2(2,1) / 2.0d0, 1.0d0 / ! (NH4)2SO4 + DATA V1(1,2), V2(1,2) / 1.0d0, 1.0d0 / ! HNO3 + DATA V1(2,2), V2(2,2) / 1.0d0, 1.0d0 / ! NH4NO3 + DATA V1(1,3), V2(1,3) / 1.0d0, 1.0d0 / ! H+HSO4- + DATA V1(2,3), V2(2,3) / 1.0d0, 1.0d0 / ! NH4HSO4 + + _UNUSED_DUMMY(MOLNU) + _UNUSED_DUMMY(PHIMULT) + + !================================================================= + ! ACTCOF begins here! + !================================================================= + + ! Compute ionic strength + I = 0.0d0 + + DO ICAT = 1, NCAT + I = I + CAT( ICAT ) * ZP( ICAT ) * ZP( ICAT ) + ENDDO + + DO IAN = 1, NAN + I = I + AN( IAN ) * ZM( IAN ) * ZM( IAN ) + ENDDO + + I = 0.5d0 * I + + ! check for problems in the ionic strength + IF ( I .EQ. 0.0d0 ) THEN + + DO IAN = 1, NAN + DO ICAT = 1, NCAT + GAMA( ICAT, IAN ) = 0.0d0 + ENDDO + ENDDO + + XMSG = 'Ionic strength is zero...returning zero activities' + !CALL M3WARN ( PNAME, 0, 0, XMSG ) + RETURN + + ELSE IF ( I .LT. 0.0d0 ) THEN + XMSG = 'Ionic strength below zero...negative concentrations' + !CALL M3EXIT ( PNAME, 0, 0, XMSG, XSTAT1 ) + ENDIF + + ! Compute some essential expressions + SRI = SQRT( I ) + TWOSRI = 2.0d0 * SRI + TWOI = 2.0d0 * I + TEXPV = 1.0d0 - EXP( -TWOSRI ) * ( 1.0d0 + TWOSRI - TWOI ) + R = 1.0d0 + 0.75d0 * I + S = 1.0d0 + 1.5d0 * I + ZOT1 = 0.511d0 * SRI / ( 1.0d0 + SRI ) + + ! Compute binary activity coeffs + FGAMA = -0.392d0 * ( ( SRI / ( 1.0d0 + 1.2d0 * SRI ) & + & + ( 2.0d0 / 1.2d0 ) * LOG( 1.0d0 + 1.2d0 * SRI ) ) ) + + DO ICAT = 1, NCAT + DO IAN = 1, NAN + + BGAMA( ICAT, IAN ) = 2.0d0 * BETA0( ICAT, IAN ) & + & + ( 2.0d0 * BETA1( ICAT, IAN ) / ( 4.0d0 * I ) ) & + & * TEXPV + + ! Compute the molality of each electrolyte for given ionic strength + M( ICAT, IAN ) = ( CAT( ICAT )**V1( ICAT, IAN ) & + & * AN( IAN )**V2( ICAT, IAN ) )**( 1.0d0 & + & / ( V1( ICAT, IAN ) + V2( ICAT, IAN ) ) ) + + ! Calculate the binary activity coefficients + LGAMA0( ICAT, IAN ) = ( ZP( ICAT ) * ZM( IAN ) * FGAMA & + & + M( ICAT, IAN ) & + & * ( 2.0d0 * V1( ICAT, IAN ) * V2( ICAT, IAN ) & + & / ( V1( ICAT, IAN ) + V2( ICAT, IAN ) ) & + & * BGAMA( ICAT, IAN ) ) & + & + M( ICAT, IAN ) * M( ICAT, IAN ) & + & * ( 2.0d0 * ( V1( ICAT, IAN ) & + & * V2( ICAT, IAN ) )**1.5d0 & + & / ( V1( ICAT, IAN ) + V2( ICAT, IAN ) ) & + & * CGAMA( ICAT, IAN ) ) ) / 2.302585093d0 + + ENDDO + ENDDO + + ! prepare variables for computing the multicomponent activity coeffs + DO IAN = 1, NAN + DO ICAT = 1, NCAT + ZBAR = ( ZP( ICAT ) + ZM( IAN ) ) * 0.5d0 + ZBAR2 = ZBAR * ZBAR + Y( IAN, ICAT ) = ZBAR2 * AN( IAN ) / I + X( ICAT, IAN ) = ZBAR2 * CAT( ICAT ) / I + ENDDO + ENDDO + + DO IAN = 1, NAN + F1( IAN ) = 0.0d0 + DO ICAT = 1, NCAT + F1( IAN ) = F1( IAN ) + X( ICAT, IAN ) * LGAMA0( ICAT, IAN ) & + & + ZOT1 * ZP( ICAT ) * ZM( IAN ) * X( ICAT, IAN ) + ENDDO + ENDDO + + DO ICAT = 1, NCAT + F2( ICAT ) = 0.0d0 + DO IAN = 1, NAN + F2( ICAT ) = F2( ICAT ) + Y( IAN, ICAT ) * LGAMA0(ICAT, IAN) & + & + ZOT1 * ZP( ICAT ) * ZM( IAN ) * Y( IAN, ICAT ) + ENDDO + ENDDO + + ! now calculate the multicomponent activity coefficients + DO IAN = 1, NAN + DO ICAT = 1, NCAT + + TA = -ZOT1 * ZP( ICAT ) * ZM( IAN ) + TB = ZP( ICAT ) * ZM( IAN ) / ( ZP( ICAT ) + ZM( IAN ) ) + TC = ( F2( ICAT ) / ZP( ICAT ) + F1( IAN ) / ZM( IAN ) ) + TRM = TA + TB * TC + + IF ( TRM .GT. 30.0d0 ) THEN + GAMA( ICAT, IAN ) = 1.0d+30 + ELSE + GAMA( ICAT, IAN ) = 10.0d0**TRM + ENDIF + + ENDDO + ENDDO + + ! Return to calling program + END SUBROUTINE ACTCOF + +!------------------------------------------------------------------------------ + + + + +! Copy (and rename) GmiPrintError subroutine for use here locally +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: PrintError +! +! !INTERFACE: +! + subroutine PrintError & + (err_msg, err_do_stop, err_num_ints, err_int1, err_int2, & + err_num_reals, err_real1, err_real2) +! + implicit none +! +! !INPUT PARAMETERS: +!! err_msg : error message to be printed out +!! err_do_stop : do stop on error? +!! err_num_ints : number of integers to be printed out (0, 1, or 2) +!! err_int1 : integer 1 to print out +!! err_int2 : integer 2 to print out +!! err_num_reals : number of reals to be printed out (0, 1, or 2) +!! err_real1 : real 1 to print out +!! err_real2 : real 2 to print out + character (len=*), intent(in) :: err_msg + logical , intent(in) :: err_do_stop + integer , intent(in) :: err_num_ints + integer , intent(in) :: err_int1 + integer , intent(in) :: err_int2 + integer , intent(in) :: err_num_reals + real*8 , intent(in) :: err_real1 + real*8 , intent(in) :: err_real2 +! +! !DESCRIPTION: +! Output error messages, and exits if requested. +! +! !AUTHOR: +! Jules Kouatchou +! +! !REVISION HISTORY: +! Initial code. +! +!EOP +!------------------------------------------------------------------------- +!BOC + Write (6,*) + Write (6,*) & + '--------------------------------------------------------------' + + Write (6,*) '!! ' // Trim (err_msg) + + if (err_num_ints == 1) then + Write (6,*) ' ', err_int1 + else if (err_num_ints == 2) then + Write (6,*) ' ', err_int1, err_int2 + end if + + if (err_num_reals == 1) then + Write (6,*) ' ', err_real1 + else if (err_num_reals == 2) then + Write (6,*) ' ', err_real1, err_real2 + end if + + Write (6,*) & + '--------------------------------------------------------------' + Write (6,*) + + if (err_do_stop) then + stop "Code stopped by PrintError." + end if + + return + + end subroutine PrintError + +!------------------------------------------------------------------------ + + +! Below are the series of heterogeneous reactions +! The reactions sktrs_hno3n1, sktrs_hno3n2, and sktrs_hno3n3 are provided +! as given by Huisheng Bian. As written they depend on knowing the GOCART +! structure and operate per column but the functions themselves are +! repetitive. I cook up a single sktrs_hno3 function which is called per +! grid box per species with an optional parameter gamma being passed. +! Following is objective: +! loss rate (k = 1/s) of species on aerosol surfaces +! +! k = sad * [ radA/Dg +4/(vL) ]^(-1) +! +! where +! Dg = gas phase diffusion coefficient (cm2/s) +! L = sticking coefficient (unitless) = gamma +! v = mean molecular speed (cm/s) = [ 8RT / (pi*M) ]^1/2 +! +! radA/Dg = uptake by gas-phase diffusion to the particle surface +! 4/(vL) = uptake by free molecular collisions of gas molecules with the surface +!======================================================================= + + + FUNCTION sktrs_hno3 ( tk, frh, sad, ad, radA, gammaInp ) +! Simple functional call to calculate heterogeneous reaction rate of +! nitric acid on aerosols. Inputs are: +! tk - temperature [K] +! frh - fractional relative humidity [0 - 1] +! sad - aerosol surface area density [cm2 cm-3] +! ad - air number concentration [# cm-3] +! radA - aerosol radius [cm] +! gammaInp - optional uptake coefficient (e.g., 0.2 for SS, else calculated) + + real*8 tk + real*8 frh + real*8 sad + real*8 ad + real*8 radA + real*8 sktrs_hno3 + real*8, optional :: gammaInp +!... local variables + REAL*8, PARAMETER :: GAMMA_SSLT = 0.2d0 +! REAL*8, PARAMETER :: GAMMA_HNO3 = 0.1d0 + REAL*8, PARAMETER :: GAMMA_HNO3 = 1.0d-3 +! REAL*8, PARAMETER :: GAMMA_HNO3 = 5.0d-4 + real*8 dfkg + real*8 avgvel + real*8 gamma + +! Initialize + sktrs_hno3 = 0.d0 + gamma = 3.d-5 + + if( present(gammaInp)) then + gamma = gammaInp + else +! Following uptake coefficients of Liu et al.(2007) + if (frh >= 0.1d0 .and. frh < 0.3d0 ) gamma = gamma_hno3 * (0.03d0 + 0.08d0 * (frh - 0.1d0)) + if (frh >= 0.3d0 .and. frh < 0.5d0 ) gamma = gamma_hno3 * (0.19d0 + 0.255d0 * (frh - 0.3d0)) + if (frh >= 0.5d0 .and. frh < 0.6d0 ) gamma = gamma_hno3 * (0.7d0 + 0.3d0 * (frh - 0.5d0)) + if (frh >= 0.6d0 .and. frh < 0.7d0 ) gamma = gamma_hno3 * (1.0d0 + 0.3d0 * (frh - 0.6d0)) + if (frh >= 0.7d0 .and. frh < 0.8d0 ) gamma = gamma_hno3 * (1.3d0 + 0.7d0 * (frh - 0.7d0)) + if (frh >= 0.8d0 ) gamma = gamma_hno3 * 2.0d0 + endif + +! calculate gas phase diffusion coefficient (cm2/s) + dfkg = 9.45D17 / ad * ( tk * (3.472D-2 + 1.D0/fmassHNO3) )**0.5d0 + +! calculate mean molecular speed (cm/s) + avgvel = 100.0d0 * (8.0d0 * rgas * tk * 1000.0d0 / (pi * fmassHNO3))**0.5d0 + +! calculate rate coefficient + sktrs_hno3 = sad * ( 4.0d0 / ( gamma * avgvel )+ radA / dfkg )**(-1.0d0) + + END FUNCTION sktrs_hno3 + + + FUNCTION sktrs_sslt ( tk, frh, sad, ad, radA, gammaInp ) +! Simple functional call to calculate heterogeneous reaction rate of +! nitric acid on aerosols. Inputs are: +! tk - temperature [K] +! frh - fractional relative humidity [0 - 1] +! sad - aerosol surface area density [cm2 cm-3] +! ad - air number concentration [# cm-3] +! radA - aerosol radius [cm] +! gammaInp - optional uptake coefficient (e.g., 0.2 for SS, else calculated) + + real*8 tk + real*8 frh + real*8 sad + real*8 ad + real*8 radA + real*8 sktrs_sslt + real*8, optional :: gammaInp +!... local variables + REAL*8, PARAMETER :: GAMMA_SSLT = 0.1d0 + real*8 dfkg + real*8 avgvel + + _UNUSED_DUMMY(frh) + _UNUSED_DUMMY(gammaInp) + +! Initialize + sktrs_sslt = 0.d0 + +! calculate gas phase diffusion coefficient (cm2/s) + dfkg = 9.45D17 / ad * ( tk * (3.472D-2 + 1.D0/fmassHNO3) )**0.5d0 + +! calculate mean molecular speed (cm/s) + avgvel = 100.0d0 * (8.0d0 * rgas * tk * 1000.0d0 / (pi * fmassHNO3))**0.5d0 + +! calculate rate coefficient + sktrs_sslt = sad * ( 4.0d0 / ( gamma_sslt * avgvel )+ radA / dfkg )**(-1.0d0) + + END FUNCTION sktrs_sslt + + + FUNCTION sktrs_hno3n1 (tk, frh, sad, ad, radA, NSADdust, tropp, pr) +! + real*8 tk(:) + real*8 frh(:) + real*8 sad(:,:) + real*8 ad(:) + real*8 radA(:,:) + integer NSADdust + real*8, OPTIONAL :: tropp + real*8 pr(:) + real*8, DIMENSION (size(tk)) :: sktrs_hno3n1 +!... local variables + REAL*8, PARAMETER :: GAMMA_SSLT = 0.2d0 +! REAL*8, PARAMETER :: GAMMA_HNO3 = 0.1d0 + REAL*8, PARAMETER :: GAMMA_HNO3 = 1.0d-3 +! REAL*8, PARAMETER :: GAMMA_HNO3 = 5.0d-4 + real*8, DIMENSION (size(tk)) :: dfkg + real*8, DIMENSION (size(tk)) :: avgvel + real*8, DIMENSION (size(tk)) :: gamma +! +!======================================================================= +! HNO3 + aerosols => NO3a +!======================================================================= +! tk = temperature (K) +! frh = fractional relative humidity (0-1) +! sad = surface area of aerosols/volume of air (cm2/cm3) +! ad = molec/cm3 air +! radA = radius of aerosol (cm) +! ntotA = # dust bins +! +! loss rate (k = 1/s) of species on aerosol surfaces +! +! k = sad * [ radA/Dg +4/(vL) ]^(-1) +! +! where +! Dg = gas phase diffusion coefficient (cm2/s) +! L = sticking coefficient (unitless) = gamma +! v = mean molecular speed (cm/s) = [ 8RT / (pi*M) ]^1/2 +! +! radA/Dg = uptake by gas-phase diffusion to the particle surface +! 4/(vL) = uptake by free molecular collisions of gas molecules with the surface +!======================================================================= +! + sktrs_hno3n1(:) = 0.d0 +! +!tdf Following uptake coefficients of Liu et al.(2007) + gamma(:) = 0.0d0 + where (frh(:) >= 0.1d0 .and. frh(:) < 0.3d0 ) & + gamma(:) = gamma_hno3 * (0.03d0 + 0.08d0 * (frh(:) - 0.1d0)) + where (frh(:) >= 0.3d0 .and. frh(:) < 0.5d0 ) & + gamma(:) = gamma_hno3 * (0.19d0 + 0.255d0 * (frh(:) - 0.3d0)) + where (frh(:) >= 0.5d0 .and. frh(:) < 0.6d0 ) & + gamma(:) = gamma_hno3 * (0.7d0 + 0.3d0 * (frh(:) - 0.5d0)) + where (frh(:) >= 0.6d0 .and. frh(:) < 0.7d0 ) & + gamma(:) = gamma_hno3 * (1.0d0 + 0.3d0 * (frh(:) - 0.6d0)) + where (frh(:) >= 0.7d0 .and. frh(:) < 0.8d0 ) & + gamma(:) = gamma_hno3 * (1.3d0 + 0.7d0 * (frh(:) - 0.7d0)) + where (frh(:) >= 0.8d0 ) & + gamma(:) = gamma_hno3 * 2.0d0 +! +! calculate gas phase diffusion coefficient (cm2/s) + dfkg(:) = 9.45D17 / ad(:) * ( tk(:) * (3.472D-2 + 1.D0/fmassHNO3) )**0.5d0 +! +! calculate mean molecular speed (cm/s) + avgvel(:) = 100.0d0 * (8.0d0 * rgas * tk(:) * 1000.0d0 / & + & (pi * fmassHNO3))**0.5d0 +! +! The NO3a produced on the surface of SO4, BC, OC, dust bin 1, and sea salt bin 1 +!!... SO4 +! where( sad(NSADdust+1,:) > 0.0d0 ) sktrs_hno3n1(:) = sktrs_hno3n1(:) + & +! & sad(NSADdust+1,:) * ( 4.0d0 / ( gamma(:) * avgvel(:) )+ radA(NSADdust+1,:) / dfkg(:) )**(-1.0d0) +! +!!... BC +! where( sad(NSADdust+2,:) > 0.0d0 ) sktrs_hno3n1(:) = sktrs_hno3n1(:) + & +! & sad(NSADdust+2,:) * ( 4.0d0 / ( gamma(:) * avgvel(:) )+ radA(NSADdust+2,:) / dfkg(:) )**(-1.0d0) +! +!!... OC +! where( sad(NSADdust+3,:) > 0.0d0 ) sktrs_hno3n1(:) = sktrs_hno3n1(:) + & +! & sad(NSADdust+3,:) * ( 4.0d0 / ( gamma(:) * avgvel(:) )+ radA(NSADdust+3,:) / dfkg(:) )**(-1.0d0) +! +!... sea salt bin 1 + where( sad(NSADdust+4,:) > 0.0d0 ) sktrs_hno3n1(:) = sktrs_hno3n1(:) + & + & sad(NSADdust+4,:) * ( 4.0d0 / ( GAMMA_SSLT * avgvel(:) )+ radA(NSADdust+4,:) / dfkg(:) )**(-1.0d0) +! +!... dust bin1 + where( sad(1,:) > 0.0d0 ) sktrs_hno3n1(:) = sktrs_hno3n1(:) + & + & sad(1,:) * ( 4.0d0 / ( gamma(:) * avgvel(:) )+ radA(1,:) / dfkg(:) )**(-1.0d0) + where( sad(2,:) > 0.0d0 ) sktrs_hno3n1(:) = sktrs_hno3n1(:) + & + & sad(2,:) * ( 4.0d0 / ( gamma(:) * avgvel(:) )+ radA(2,:) / dfkg(:) )**(-1.0d0) + where( sad(3,:) > 0.0d0 ) sktrs_hno3n1(:) = sktrs_hno3n1(:) + & + & sad(3,:) * ( 4.0d0 / ( gamma(:) * avgvel(:) )+ radA(3,:) / dfkg(:) )**(-1.0d0) + where( sad(4,:) > 0.0d0 ) sktrs_hno3n1(:) = sktrs_hno3n1(:) + & + & sad(4,:) * ( 4.0d0 / ( gamma(:) * avgvel(:) )+ radA(4,:) / dfkg(:) )**(-1.0d0) +! +!... reaction only used in troposphere if tropp is passed in + if ( present(tropp) ) then + where( pr <= tropp ) sktrs_hno3n1 = 0.0d0 + end if +! +! + END FUNCTION sktrs_hno3n1 +! +! +! +!.... sktrs_hno3n2 (temperature, FRH, sadcol2, adcol, radA, NSADdust, tropp, p +! +! _1_ +! +!.... GMI Tropospheric Chemistry - Heterogenious Nitrate reactions: +! HNO3 + aerosols -> Nitrate aerosols +! Aerosol surface areas are associated with aerosol types and size bins. +! The product on dust bin 2,3 and sea salt bin 2, 3 is NO3an2. + +! + FUNCTION sktrs_hno3n2 (tk, frh, sad, ad, radA, NSADdust, tropp, pr) +! + real*8 tk(:) + real*8 frh(:) + real*8 sad(:,:) + real*8 ad(:) + real*8 radA(:,:) + integer NSADdust + real*8, OPTIONAL :: tropp + real*8 pr(:) + real*8, DIMENSION (size(tk)) :: sktrs_hno3n2 +!... local variables + REAL*8, PARAMETER :: GAMMA_SSLT = 0.2d0 +! REAL*8, PARAMETER :: GAMMA_HNO3 = 0.1d0 + REAL*8, PARAMETER :: GAMMA_HNO3 = 1.0d-3 +! REAL*8, PARAMETER :: GAMMA_HNO3 = 5.0d-4 +! + real*8, DIMENSION (size(tk)) :: dfkg + real*8, DIMENSION (size(tk)) :: avgvel + real*8, DIMENSION (size(tk)) :: gamma +! +!======================================================================= +! HNO3 + medium aerosols => NO3a +!======================================================================= +! tk = temperature (K) +! frh = fractional relative humidity (0-1) +! sad = surface area of aerosols/volume of air (cm2/cm3) +! ad = molec/cm3 air +! radA = radius of aerosol (cm) +! ntotA = # dust bins +! +! loss rate (k = 1/s) of species on aerosol surfaces +! +! k = sad * [ radA/Dg +4/(vL) ]^(-1) +! +! where +! Dg = gas phase diffusion coefficient (cm2/s) +! L = sticking coefficient (unitless) = gamma +! v = mean molecular speed (cm/s) = [ 8RT / (pi*M) ]^1/2 +! +! radA/Dg = uptake by gas-phase diffusion to the particle surface +! 4/(vL) = uptake by free molecular collisions of gas molecules with the surface +!======================================================================= +! + sktrs_hno3n2(:) = 0.d0 +! +!tdf Following uptake coefficients of Liu et al.(2007) + gamma(:) = 0.0d0 + where (frh(:) >= 0.1d0 .and. frh(:) < 0.3d0 ) & + gamma(:) = gamma_hno3 * (0.03d0 + 0.08d0 * (frh(:) - 0.1d0)) + where (frh(:) >= 0.3d0 .and. frh(:) < 0.5d0 ) & + gamma(:) = gamma_hno3 * (0.19d0 + 0.255d0 * (frh(:) - 0.3d0)) + where (frh(:) >= 0.5d0 .and. frh(:) < 0.6d0 ) & + gamma(:) = gamma_hno3 * (0.7d0 + 0.3d0 * (frh(:) - 0.5d0)) + where (frh(:) >= 0.6d0 .and. frh(:) < 0.7d0 ) & + gamma(:) = gamma_hno3 * (1.0d0 + 0.3d0 * (frh(:) - 0.6d0)) + where (frh(:) >= 0.7d0 .and. frh(:) < 0.8d0 ) & + gamma(:) = gamma_hno3 * (1.3d0 + 0.7d0 * (frh(:) - 0.7d0)) + where (frh(:) >= 0.8d0 ) & + gamma(:) = gamma_hno3 * 2.0d0 +! +! calculate gas phase diffusion coefficient (cm2/s) + dfkg(:) = 9.45D17 / ad(:) * ( tk(:) * (3.472D-2 + 1.D0/fmassHNO3) )**0.5d0 +! +! calculate mean molecular speed (cm/s) + avgvel(:) = 100.0d0 * (8.0d0 * rgas * tk(:) * 1000.0d0 / (pi * fmassHNO3))**0.5d0 +! +! The product on dust bin 2,3 and sea salt bin 2, 3 is NO3an2. +!... sea salt bin 2 + where( sad(NSADdust+5,:) > 0.0d0 ) sktrs_hno3n2(:) = sktrs_hno3n2(:) + & + & sad(NSADdust+5,:) * ( 4.0d0 / ( GAMMA_SSLT * avgvel(:) )+ radA(NSADdust+5,:) / dfkg(:) )**(-1.0d0) +! +!... sea salt bin 3 + where( sad(NSADdust+6,:) > 0.0d0 ) sktrs_hno3n2(:) = sktrs_hno3n2(:) + & + & sad(NSADdust+6,:) * ( 4.0d0 / ( GAMMA_SSLT * avgvel(:) )+ radA(NSADdust+6,:) / dfkg(:) )**(-1.0d0) +! +!... dust bin 2 + where( sad(5,:) > 0.0d0 ) sktrs_hno3n2(:) = sktrs_hno3n2(:) + & + & sad(5,:) * ( 4.0d0 / ( gamma(:) * avgvel(:) )+ radA(5,:) / dfkg(:) )**(-1.0d0) +! +!... dust bin 3 + where( sad(6,:) > 0.0d0 ) sktrs_hno3n2(:) = sktrs_hno3n2(:) + & + & sad(6,:) * ( 4.0d0 / ( gamma(:) * avgvel(:) )+ radA(6,:) / dfkg(:) )**(-1.0d0) +! +!... reaction only used in troposphere if tropp is passed in + if ( present(tropp) ) then + where( pr <= tropp ) sktrs_hno3n2 = 0.0d0 + end if +! +! + END FUNCTION sktrs_hno3n2 +! +! +! +!.... sktrs_hno3n3 (temperature, FRH, sadcol2, adcol, radA, NSADdust, tropp, p +! +!_1_ +! +!.... GMI Tropospheric Chemistry - Heterogenious Nitrate reactions: +! HNO3 + aerosols -> Nitrate aerosols +! Aerosol surface areas are associated with aerosol types and size bins. +! The product on dust bin 4, 5 and sea salt bin 4 is NO3an3. + +! + FUNCTION sktrs_hno3n3 (tk, frh, sad, ad, radA, NSADdust, tropp, pr) +! + real*8 tk(:) + real*8 frh(:) + real*8 sad(:,:) + real*8 ad(:) + real*8 radA(:,:) + integer NSADdust + real*8, OPTIONAL :: tropp + real*8 pr(:) + real*8, DIMENSION (size(tk)) :: sktrs_hno3n3 +!... local variables + REAL*8, PARAMETER :: GAMMA_SSLT = 0.2d0 +! REAL*8, PARAMETER :: GAMMA_HNO3 = 0.1d0 + REAL*8, PARAMETER :: GAMMA_HNO3 = 1.0d-3 +! REAL*8, PARAMETER :: GAMMA_HNO3 = 5.0d-4 +! + real*8, DIMENSION (size(tk)) :: dfkg + real*8, DIMENSION (size(tk)) :: avgvel + real*8, DIMENSION (size(tk)) :: gamma +! +!======================================================================= +! HNO3 + large aerosols => NO3a +!======================================================================= +! tk = temperature (K) +! frh = fractional relative humidity (0-1) +! sad = surface area of aerosols/volume of air (cm2/cm3) +! ad = molec/cm3 air +! radA = radius of aerosol (cm) +! ntotA = # dust bins +! +! loss rate (k = 1/s) of species on aerosol surfaces +! +! k = sad * [ radA/Dg +4/(vL) ]^(-1) +! +! where +! Dg = gas phase diffusion coefficient (cm2/s) +! L = sticking coefficient (unitless) = gamma +! v = mean molecular speed (cm/s) = [ 8RT / (pi*M) ]^1/2 +! +! radA/Dg = uptake by gas-phase diffusion to the particle surface +! 4/(vL) = uptake by free molecular collisions of gas molecules with the surface +!======================================================================= +! + sktrs_hno3n3(:) = 0.d0 +! +!tdf Following uptake coefficients of Liu et al.(2007) + gamma(:) = 0.0d0 + where (frh(:) >= 0.1d0 .and. frh(:) < 0.3d0 ) & + gamma(:) = gamma_hno3 * (0.03d0 + 0.08d0 * (frh(:) - 0.1d0)) + where (frh(:) >= 0.3d0 .and. frh(:) < 0.5d0 ) & + gamma(:) = gamma_hno3 * (0.19d0 + 0.255d0 * (frh(:) - 0.3d0)) + where (frh(:) >= 0.5d0 .and. frh(:) < 0.6d0 ) & + gamma(:) = gamma_hno3 * (0.7d0 + 0.3d0 * (frh(:) - 0.5d0)) + where (frh(:) >= 0.6d0 .and. frh(:) < 0.7d0 ) & + gamma(:) = gamma_hno3 * (1.0d0 + 0.3d0 * (frh(:) - 0.6d0)) + where (frh(:) >= 0.7d0 .and. frh(:) < 0.8d0 ) & + gamma(:) = gamma_hno3 * (1.3d0 + 0.7d0 * (frh(:) - 0.7d0)) + where (frh(:) >= 0.8d0 ) & + gamma(:) = gamma_hno3 * 2.0d0 +! +! calculate gas phase diffusion coefficient (cm2/s) + dfkg(:) = 9.45D17 / ad(:) * ( tk(:) * (3.472D-2 + 1.D0/fmassHNO3) )**0.5d0 +! +! calculate mean molecular speed (cm/s) + avgvel(:) = 100.0d0 * (8.0d0 * rgas * tk(:) * 1000.0d0 / & + & (pi * fmassHNO3))**0.5d0 +! +! The product on dust bin 4, 5 and sea salt bin 4 is NO3an3. +!... dust bin 4 and 5 + where( sad(7,:) > 0.0d0 ) sktrs_hno3n3(:) = sktrs_hno3n3(:) + & + & sad(7,:) * ( 4.0d0 / ( gamma(:) * avgvel(:) )+ radA(7,:) / dfkg(:) )**(-1.0d0) +! +!... sea salt bin 4 + where( sad(NSADdust+7,:) > 0.0d0 ) sktrs_hno3n3(:) = sktrs_hno3n3(:) + & + & sad(NSADdust+7,:) * ( 4.0d0 / ( GAMMA_SSLT * avgvel(:) )+ radA(NSADdust+7,:) / dfkg(:) )**(-1.0d0) +! +!... reaction only used in troposphere if tropp is passed in + if ( present(tropp) ) then + where( pr <= tropp ) sktrs_hno3n3 = 0.0d0 + end if +! +! + END FUNCTION sktrs_hno3n3 + +end module diff --git a/ESMF/Shared/Chem_Shared/SeasaltEmissionMod.F90 b/ESMF/Shared/Chem_Shared/SeasaltEmissionMod.F90 new file mode 100644 index 00000000..ac4ddde0 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/SeasaltEmissionMod.F90 @@ -0,0 +1,193 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: SeasaltEmissionMod.F90 --- Calculate the Seasalt Emissions +! +! !INTERFACE: +! + + module SeasaltEmissionMod + +! !USES: + + use Chem_Mod + use Chem_ConstMod, only: grav ! Constants ! + use Chem_UtilMod + + use m_mpout + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC SeasaltEmission +! PUBLIC SeasaltEmissionGong2003 +! PUBLIC SeasaltEmissionGong1997 +! PUBLIC SeasaltEmissionCaffrey2006 + + +! !CONSTANTS + real, parameter :: r80fac = 1.65 ! ratio of radius(RH=0.8)/radius(RH=0.) [Gerber] + real, parameter :: rhop = 2200. ! dry seasalt density [kg m-3] + real, parameter :: pi = 3.1415 ! ratio of circumference to diameter of circle + +! +! !DESCRIPTION: +! +! This module implements the sea salt aerosol emission parameterizations. +! For all variants, emissions are some function of wind speed (and possibly +! other dynamical parameters) and the sea salt particle radius. Here, +! we assume the model passes in dry radius (or dry radius of size bin edges). +! Output is the mass emission flux (kg m-2 s-1) into that radius bin. +! +! !REVISION HISTORY: +! +! 30Mar2010 Colarco First crack! +! +!EOP +!------------------------------------------------------------------------- +CONTAINS +! +! !IROUTINE: SeasaltEmission - Master driver to compute the sea salt emissions +! +! !INTERFACE: +! + subroutine SeasaltEmission ( rLow, rUp, method, w10m, ustar, & + memissions, nemissions, rc ) + +! !DESCRIPTION: Calculates the seasalt mass emission flux every timestep. +! The particular method (algorithm) used for the calculation is based +! on the value of "method" passed on input. Mostly these algorithms are +! a function of wind speed and particle size (nominally at 80% RH). +! Routine is called once for each size bin, passing in the edge radii +! "rLow" and "rUp" (in dry radius, units of um). Returned in the emission +! mass flux [kg m-2 s-1]. A sub-bin assumption is made to break (possibly) +! large size bins into a smaller space. +! +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + real, intent(in) :: rLow, rUp ! Dry particle bin edge radii [um] + real, target, intent(in) :: w10m(:,:) ! 10-m wind speed [m s-1] + real, target, intent(in) :: ustar(:,:) ! friction velocity [m s-1] + integer, intent(in) :: method ! Algorithm to use + +! !OUTPUT PARAMETERS: + + real, pointer, dimension(:,:) :: memissions ! Mass Emissions Flux [kg m-2 s-1] + real, pointer, dimension(:,:) :: nemissions ! Number Emissions Flux [# m-2 s-1] + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - +! !Local Variables + integer :: ir + real, pointer :: w(:,:) ! Intermediary wind speed [m s-1] + real :: r, dr ! sub-bin radius spacing (dry, um) + real :: rwet, drwet ! sub-bin radius spacing (rh=80%, um) + real :: aFac, bFac, scalefac, rpow, exppow, wpow + + integer, parameter :: nr = 10 ! Number of (linear) sub-size bins + + character(len=*), parameter :: myname = 'SeasaltEmission' + +! Define the sub-bins (still in dry radius) + dr = (rUp - rLow)/nr + r = rLow + 0.5*dr + +! Loop over size bins + nemissions = 0. + memissions = 0. + + do ir = 1, nr + + rwet = r80fac * r + drwet = r80fac * dr + + select case(method) + + case(1) ! Gong 2003 + aFac = 4.7*(1.+30.*rwet)**(-0.017*rwet**(-1.44)) + bFac = (0.433-log10(rwet))/0.433 + scalefac = 1. + rpow = 3.45 + exppow = 1.607 + wpow = 3.41 + w => w10m + + case(2) ! Gong 1997 + aFac = 3. + bFac = (0.380-log10(rwet))/0.650 + scalefac = 1. + rpow = 1.05 + exppow = 1.19 + wpow = 3.41 + w => w10m + + case(3) ! GEOS5 2012 + aFac = 4.7*(1.+30.*rwet)**(-0.017*rwet**(-1.44)) + bFac = (0.433-log10(rwet))/0.433 + scalefac = 33.0e3 + rpow = 3.45 + exppow = 1.607 + wpow = 3.41 - 1. + w => ustar + + case default + if(MAPL_AM_I_ROOT()) print *, 'SeasaltEmission missing algorithm method' + rc = 1 + return + + end select + + +! Number emissions flux (# m-2 s-1) + nemissions = nemissions + SeasaltEmissionGong( rwet, drwet, w, scalefac, aFac, bFac, rpow, exppow, wpow ) +! Mass emissions flux (kg m-2 s-1) + scalefac = scalefac * 4./3.*pi*rhop*r**3.*1.e-18 + memissions = memissions + SeasaltEmissionGong( rwet, drwet, w, scalefac, aFac, bFac, rpow, exppow, wpow ) + + r = r + dr + + end do + + rc = 0 + + end subroutine SeasaltEmission + + +! Function to compute sea salt emissions following the Gong style +! parameterization. Functional form is from Gong 2003: +! dN/dr = scalefac * 1.373 * (w^wpow) * (r^-aFac) * (1+0.057*r^rpow) * 10^(exppow*exp(-bFac^2)) +! where r is the particle radius at 80% RH, dr is the size bin width at 80% RH, and w is the wind speed + + function SeasaltEmissionGong ( r, dr, w, scalefac, aFac, bFac, rpow, exppow, wpow ) + + real, intent(in) :: r, dr ! Wet particle radius, bin width [um] + real, pointer, intent(in) :: w(:,:) ! Grid box mean wind speed [m s-1] (10-m or ustar wind) + real, intent(in) :: scalefac, aFac, bFac, rpow, exppow, wpow + real :: SeasaltEmissionGong(size(w,1),size(w,2)) + +! Initialize + SeasaltEmissionGong = 0. + +! Particle size distribution function + SeasaltEmissionGong = scalefac * 1.373*r**(-aFac)*(1.+0.057*r**rpow) & + *10**(exppow*exp(-bFac**2.))*dr +! Apply wind speed function + SeasaltEmissionGong = w**wpow * SeasaltEmissionGong + + end function SeasaltEmissionGong + + + end module diff --git a/ESMF/Shared/Chem_Shared/SmokeEmissionMod.F90 b/ESMF/Shared/Chem_Shared/SmokeEmissionMod.F90 new file mode 100644 index 00000000..5de827de --- /dev/null +++ b/ESMF/Shared/Chem_Shared/SmokeEmissionMod.F90 @@ -0,0 +1,761 @@ +#include "unused_dummy.H" +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: SmokeEmissionMod +! +! This routine emits smoke particles as a partile size distribution. +! The user has control over the vertical distrubtion of the smoke +! emission as well. +! +! Jamison A. Smith +! +! !INTERFACE: + +Module SmokeEmissionMod + +! !USES: + +use Chem_Mod ! Chemistry Base Class +use Chem_ConstMod, only: grav ! Constants +use Chem_UtilMod ! I/O +use m_mpout ! new to GEOS-5 +use MAPL ! To test for rootproc + +Implicit None + +! !PUBLIC TYPES: + +! This private statement keeps definitions from used mods from clashing +! with definition in other mods, like CARMA_GridComp, that use this mod. + +PRIVATE + +! !PUBLIC MEMBER FUNCTIONS: + +Public SmokeEmission + +! !DESCRIPTION: +! +! !REVISION HISTORY: +! +! 2011Jan21 Adding standard deviation of MINX altitude observations, JAS +! 2010May06 Adjusted spatial mask for Siberian fire, JAS +! 2010Apr01 Final form, JAS +! 2009Feb03 J. A. Smith converting SM_GridCompMod (GEOS-4) +! to SmokeEmissionMod (GEOS-5) +! 2007Aug28 J. A. Smith converting BC_GridCompMod (GOCART) +! to SM_GridCompMod (CARMA) +! +!EOP +!------------------------------------------------------------------------- + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SmokeEmission - Adds Smoke from passed argument emission +! Smoke is distributed across several size bins +! Smoke is also distributed vertically +! +! !INTERFACE: + +Subroutine SmokeEmission ( i1, i2, j1, j2, km, & + nymd, nhms, dtime, & + rhoa, ple, & + emission, & + profile, & + binfirst, binlast, & + r, & + dr, & + rhop, & + z_bl, & + z_lo, & + lon, lat, & + qa, rc ) + +! !USES: + +Implicit None + +! !INPUT PARAMETERS: + +integer, intent(in) :: i1, i2, j1, j2, km ! spatial indices for bounds + ! of subdomain +integer, intent(in) :: nymd, nhms ! date and time +real, intent(in) :: dtime ! timestep +real, pointer, dimension(:,:,:) :: rhoa, ple ! air density in grid box + ! center and pressure at + ! grid box edges +real, pointer, dimension(:,:) :: emission ! emission rate +real, pointer, dimension(:,:,:) :: profile ! observed altitudes +integer, intent(in) :: binfirst, binlast ! bounds for mass bins + +! Are the indicies of r and dr going to be binfirst and binlast? +! maybe check this with lbound and ubound? + +real, pointer, dimension(:) :: r ! radius for mass grid read from rc + ! file and computed via setupbins +real, pointer, dimension(:) :: dr ! bin width consistent with mass grid + +real, pointer, dimension(:) :: rhop ! density of smoke particles + +real, pointer :: z_bl(:,:) ! altitude at the top of the boundary layer +real, pointer :: z_lo(:,:,:) ! altitude of the lower edge of grid boxes + +real, pointer, dimension(:,:) :: lon ! longitude +real, pointer, dimension(:,:) :: lat ! latitude + +! !OUTPUT PARAMETERS: + +integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - badness + +! INOUT PARAMETERS + +type( Chem_Array ), pointer :: qa(:) ! mixing ratio of smoke bins + +! !DESCRIPTION: Computes the smoke emission for one timestep +! Reads emission rate from a file +! Distributes mass across several size bins +! Distributes aerosol vertically as well, can emit into the +! boundary layer or in elevated layers as seems more appropriate +! for the Siberian fires of May 2003 + +! !REVISION HISTORY: +! +! 2010Apr01, J. A. Smith, final form +! 2010Feb02, J. A. Smith, adapting GEOS-4 SM_GridComp to GEOS-5 +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + +character(len=255), parameter :: myname = 'SmokeEmission' + +integer :: i, j, k ! counter indices for spatial coords + +integer :: ibin ! counter index for mass bins +integer, parameter :: nelem = 1 ! # of CARMA elements +integer, parameter :: ngroup = 1 ! # of CARMA groups + +! vars for particle size distribution + +real, parameter :: pi = 3.14159265358979323846 + +real :: sigma, rm ! characteristics of log-normal size dist. +real :: factor ! coefficients for size distribution + +real :: dist_mass, dndlnr ! total mass of size distribution with 1 particle + ! per cubic meter, the size distribution function + +real, dimension(binfirst:binlast) :: dm, mass_frac ! mass in each bin for size + ! dist., frac of total + ! mass that lies in each + ! bin + +! vars for vertical distribtion of smoke plumes + +logical :: elevated ! Will want to run most smoke in the BL and + ! Siberian smoke elevated + +real :: xlo, xhi, ylo, yhi ! bounds of lat/lon for Siberian spatial mask + +!real :: ptop, pbot ! pressure at top and bottom of a grid box + +!integer, parameter :: nlayer = 1 ! # of elevated smoke plume layers +!integer :: ilayer ! counter index +!real, dimension(nlayer) :: p_layer ! pressure levels (mbar) + ! of elevated smoke plumes + +real, dimension(i1:i2,j1:j2) :: sum_frac ! sum of air dens for + ! smoke plume layers + ! for a column, used to + ! put equal mass mixing + ! ratios in each layer +real, dimension(i1:i2,j1:j2,1:km) :: alt_frac ! fraction of smoke mass + ! emitted into a press. + ! level for a column + +! MINX altitudes for Siberia coresponding to the dates of May 2003 + +real, dimension(31) :: MINXalt = & + (/ -9999.99, 1164.85, 1946.29, 1983.82, 2102.06, 1329.31, 1987.82 & + , 1860.88, 1791.34, 4373.53, -9999.99, 3239.38, 1446.67, 2514.30 & + , 2422.74, 1923.87, 2946.53, 2021.50, 2341.06, 3191.82, 1629.18 & + , 3025.59, 1895.57, 1568.98, 1247.66, 1904.46, 1243.16, 1948.45 & + , 1159.08, 1744.56, 1534.30 /) + +real, dimension(31) :: MINXdev = & + (/ -9999.99, 982.614, 548.590, 839.832, 738.142, 506.484, 532.365 & + , 526.686, 393.708, 227.842, -9999.99, 282.753, 947.079, 551.947 & + , 597.896, 673.824, 1228.36, 833.620, 538.828, 1172.63, 770.214 & + , 1347.20, 655.367, 411.847, 669.359, 521.719, 293.923, 469.504 & + , 430.608, 494.765, 655.285 /) + +integer :: date +real :: altitude ! altitude to be used for a particular day +logical :: use_profile ! If MINX observations exist, use them +real :: z + +real, parameter :: smallval = 1.0e-37 ! FPE testing + +_UNUSED_DUMMY(nymd) +_UNUSED_DUMMY(nhms) + +!-- +! Initialize local variables + +rc = 0 + +!if ( MAPL_AM_I_ROOT () ) then +! write(*,*) 'Hey! I am SmokeEmission. Here me roar!' +!endif + +!-- +! Generate a log-normal size distribution for emitting the smoke bins +! +! rc file and setupbins are now being used to generate mass grid +! rc file uses cgs units + +! Particle size distribution a la Westphal and Toon, 1991 +! +! Log-normal characteristics + +sigma = 1.45 +rm = 1.e-5 ! cm + +! The mass of the entire distribution + +dist_mass = 0. + +!if ( MAPL_AM_I_ROOT () ) then +! write(*,*) 'JAS: Check 1' +! print *, binfirst, binlast +! print *, pi, rm, sigma, log(sigma) +! print *, rhop, ubound(rhop,1), lbound(rhop,1) +! print *, r, ubound(r,1), lbound(r,1) +!endif + +do ibin = binfirst, binlast + + ! Size distribution with 1 particle / m**3 + + dndlnr = 1. / ( 2. * pi ) ** 0.5 / log( sigma ) & + * exp( - ( & + log( r(ibin) / rm ) ** 2 & + / & + ( 2 * log( sigma ) ** 2 ) & + ) & + ) + + ! Mass in each bin + + factor = 4. / 3. * pi * rhop(ibin) + dm(ibin) = dndlnr * dr(ibin) * factor * r(ibin) ** 2 + + ! Mass of the entire distribution + + dist_mass = dist_mass + dm(ibin) + +enddo ! loop over bins + +!if ( MAPL_AM_I_ROOT () ) then +! write(*,*) 'JAS: Check 2' +!endif + +if ( dist_mass < smallval ) then + write(*,*) 'JAS: dist_mass too small', dist_mass + dist_mass = 42.0 + rc = 42 +else + + ! Calc frac of mass of distribution within each bin + + do ibin = binfirst, binlast + mass_frac(ibin) = dm(ibin) / dist_mass + enddo + +endif + +!if ( MAPL_AM_I_ROOT () ) then +! write(*,*) 'JAS: Check 3' +!endif + +!-- +! lon and lat vals for identifying Siberian region + +xlo = 80. +xhi = 140. +ylo = 44. +yhi = 64. + +!-- +! This code segment distributes the smoke emission into mulitple elevated +! layers or into the boundary layer. +! Emitted mass is proportional to the air density in that layer, so that +! plume parcels have the same mass mixing ratio of smoke aerosol. + +! Elevated layers + +!p_layer(1) = 756. ! mbar +!p_layer(2) = 669. +!p_layer(3) = 614. +!p_layer(4) = 511. + +! May want to shift these emission layers up a few mbars for sensitivity +! Trajectories indicate that Siberian smoke comes from pressure levels of +! 400 mbar or less + +!p_layer = p_layer - 200. + +!p_layer = p_layer * 1.e2 ! mbar => Pa + +!-- +! Compute the fraction of emission to emit at each level + +sum_frac(:,:) = 0. +alt_frac(:,:,:) = 0. + +date = date - 20030500 + +!-- +! Is this code obsolete? This code was used when I didn't have a MINX +! profile, only the mean and standard deviation + +altitude = -9999.99 +if ( date == 1 .or. date == 11 ) then + altitude = -9999.99 ! No valid plume height observations +else + if ( date > 0 .and. date < 32 ) then + altitude = MINXalt(date) ! Use mean MINX obs for alt + endif +endif + +!-- + +!if ( MAPL_AM_I_ROOT () ) then +! write(*,*) 'JAS: Check 4' +!endif + +do j = j1, j2 + do i = i1, i2 + + if ( lon(i,j) .gt. xlo .and. lon(i,j) .lt. xhi & + .and. lat(i,j) .gt. ylo .and. lat(i,j) .lt. yhi ) then + + ! Siberian + +! elevated = .false. + elevated = .true. + + else + + ! Other sources + + elevated = .false. +! emission(i,j) = 0. + + endif ! spatial mask for Siberian fire + + ! Lowest valid altitude on Earth is ~ -500.0 m + + if ( elevated .eqv. .true. .AND. altitude > -500.0 ) then + + use_profile = .false. ! will set to true if valid obs are found + + do k = km, 1, -1 + + ! ple has bounds of 0 and km, ple(:,:,0) is the top of the model + ! ple(:,:,km) is the surface + + !ptop = ple(i,j,k-1) + !pbot = ple(i,j,k) + + ! JAS -- careful b/c two smoke layers may lie in the same model layer + + ! do ilayer = 1, nlayer + ! if( p_layer(ilayer) .ge. ptop .and. p_layer(ilayer) .lt. pbot ) then + ! alt_frac(i,j,k) = alt_frac(i,j,k) + rhoa(i,j,k) + ! sum_frac(i,j) = sum_frac(i,j) + rhoa(i,j,k) + ! endif + ! enddo ! ilayer + + ! JAS, shifting to geometric vertical coordinate for use with MINX + ! + ! z_lo has bounds of 0 and km, z_lo(;,:,0) is the top of the model + ! z_lo(:,:,km) is the surface + + !if ( altitude >= z_lo(i,j,k) .AND. altitude < z_lo(i,j,k-1) ) then + ! alt_frac(i,j,k) = rhoa(i,j,k) + ! sum_frac(i,j) = rhoa(i,j,k) + !else + ! alt_frac(i,j,k) = 0.0 + !endif + + !-- + ! By ending up in this branch, we have a date with valid MINX + ! observations + ! + ! Not every Siberian column has valid MINX observations, however + ! + ! Need to check for valid observations within each column. + ! If they exist, then use the profile + ! If they don't exist, spread the smoke evenly around the + ! mean altitude for the region such that the smoke is + ! confined to +/- 1 standard deviation from the regional mean + + if ( profile(i,j,k) > smallval ) use_profile = .true. + + enddo ! k + + do k = km, 1, -1 + if ( use_profile .eqv. .true. ) then + alt_frac(i,j,k) = rhoa(i,j,k) * profile(i,j,k) + sum_frac(i,j) = sum_frac(i,j) + alt_frac(i,j,k) + else + z = 0.5 * ( z_lo(i,j,k) + z_lo(i,j,k-1) ) + if ( z >= MINXalt(date) - MINXdev(date) .and. & + z < MINXalt(date) + MINXdev(date) ) then + alt_frac(i,j,k) = rhoa(i,j,k) + sum_frac(i,j) = sum_frac(i,j) + alt_frac(i,j,k) + endif + endif + enddo ! k + + else + +! or emit into the boundary layer + +! z_lo has bounds of 0 and km, z_lo(;,:,0) is the top of the model +! z_lo(:,:,km) is the surface + + do k = km, 1, -1 + + if ( z_lo(i,j,k) .lt. z_bl(i,j) ) then + alt_frac(i,j,k) = rhoa(i,j,k) + sum_frac(i,j) = sum_frac(i,j) + alt_frac(i,j,k) + endif + + enddo ! k + + endif ! elevated or boundary layer + + !-- + ! + ! Caculate alt_frac + + ! protect against divide-by-zero error + + + if ( sum_frac(i,j) > smallval ) then + + do k = km, 1, -1 + alt_frac(i,j,k) = alt_frac(i,j,k) / sum_frac(i,j) + enddo + + else + + ! if sum_frac = 0., force all emission into surface layer + + alt_frac(i,j,:) = 0.0 + alt_frac(i,j,km) = 1.0 + + endif + + enddo ! i +enddo ! j + +!-------------------------------------- +! +! Update mixing ratios of CARMA species + +!if ( MAPL_AM_I_ROOT () ) then +! write(*,*) 'JAS: Check 5' +! write(*,*) +! write(*,*) dtime, grav +! write(*,*) +! write(*,*) 'Bounds of mass_frac and qa' +! write(*,*) binfirst, binlast +! write(*,*) lbound ( mass_frac, 1 ) , ubound ( mass_frac, 1 ) +! write(*,*) lbound ( qa, 1 ), ubound ( qa, 1 ) +! write(*,*) +! write(*,*) 'Bounds of emission' +! write(*,*) i1, i2, j1, j2 +! write(*,*) lbound ( emission, 1 ) , ubound ( emission, 1 ) +! write(*,*) lbound ( emission, 2 ) , ubound ( emission, 2 ) +! write(*,*) +! write(*,*) 'Bounds of alt_frac' +! write(*,*) i1, i2, j1, j2, 1, km +! write(*,*) lbound ( alt_frac, 1 ) , ubound ( alt_frac, 1 ) +! write(*,*) lbound ( alt_frac, 2 ) , ubound ( alt_frac, 2 ) +! write(*,*) lbound ( alt_frac, 3 ) , ubound ( alt_frac, 3 ) +! write(*,*) +! write(*,*) 'Bounds of ple' +! write(*,*) i1, i2, j1, j2, 1, km +! write(*,*) lbound( ple, 1 ), ubound( ple, 1 ) +! write(*,*) lbound( ple, 2 ), ubound( ple, 2 ) +! write(*,*) lbound( ple, 3 ), ubound( ple, 3 ) +! +!endif + +do i = i1, i2 +do j = j1, j2 +do k = km, 1, -1 + +! if ( MAPL_AM_I_ROOT () ) then +! write(*,*) 'JAS: Check 6' +! write(*,*) i, j, k, ple(i,j,k), ple(i,j,k-1) +! endif + + if ( ( ple(i,j,k) - ple(i,j,k-1 ) ) < smallval ) then + write(*,*) 'JAS: delta ple is too small' & + , k, k-1, ple(i,j,k) - ple(i,j,k-1) + rc = 43 + endif + do ibin = binfirst, binlast + +! if ( MAPL_AM_I_ROOT () ) then +! write(*,*) 'JAS: Check 7' +! write(*,*) ibin, lbound ( qa, 1 ), ubound ( qa, 1 ) +! write(*,*) +! write(*,*) 'Checking qa(ibin)%data3d' +! write(*,*) ibin, i, j, k +! write(*,*) i, lbound ( qa(ibin)%data3d, 1 ), ubound ( qa(ibin)%data3d, 1 ) +! write(*,*) j, lbound ( qa(ibin)%data3d, 2 ), ubound ( qa(ibin)%data3d, 2 ) +! write(*,*) k, lbound ( qa(ibin)%data3d, 3 ), ubound ( qa(ibin)%data3d, 3 ) +! write(*,*) +! write(*,*) 'Checking values' +! write(*,*) qa(ibin)%data3d(i,j,k), mass_frac(ibin) +! write(*,*) emission(i,j), alt_frac(i,j,k) +! write(*,*) ple(i,j,k), ple(i,j,k-1) +! write(*,*) 'Ending Check 7' +! endif + + qa(ibin)%data3d(i,j,k) = qa(ibin)%data3d(i,j,k) & + + mass_frac(ibin) * emission(i,j) & + * alt_frac(i,j,k) & + * dtime * grav & + / ( ple(i,j,k) - ple(i,j,k-1) ) + enddo ! ibin + +enddo ! k +enddo ! j +enddo ! i + +!if ( MAPL_AM_I_ROOT () ) then +! write(*,*) 'I am SmokeEmission, and I''m gonna take a nap.' +!endif + +rc = 0 + +End Subroutine SmokeEmission + +End Module SmokeEmissionMod + +!--------------------------------------------------------------------------- +! +! JAS: I'm storing old comments and code down here at the end of the routine + +#define JAS +#ifndef JAS + +! Note: I (J. A. Smith) am modifying this routine extensively because +! I want to move it from GEOS-4 to GEOS-5. The organization is +! changing a lot as I try to simplify this thing and get away +! from the old structure of having three routines to +! 1) Initialize +! 2) Run +! 3) Finalize +! My impression is that the initialize and finalize steps are +! occuring somewhere else in the code like the coupler routines +! written by Colarco and Bardeen. - JAS 2010Feb04 + +! use Chem_StateMod ! Chemistry State +! use m_inpak90 ! Resource file management +! use m_die, only: die + +! real, parameter :: SM_rhop = 1350. ! MKS units for now +! real, dimension(binlast-binfirst+1) :: SM_radius +! real, dimension(binlast-binfirst+1) :: SM_mass +! real :: rmrat +! real :: dr +! real :: vrfact + +!real :: rhop = 1.35 +!real, dimension(binfirst:binlast) :: r +!real, dimension(binfirst:binlast) :: dr + +! logical, parameter :: elevated = .false. +! logical, parameter :: elevated = .true. + +! + JAS -- I do not understand the next section +! +! Update emissions/production if necessary (daily) +! ----------------------------------------------- +! if( gcSM%nymd .ne. nymd )then +! +! Biomass Burning -- select on known inventories +! ---------------------------------------------- +! +! Daily files (e.g., MODIS) or GFED v.2 (1997 - 2005 valid) +! +! if( index( gcSM%BiomassBurningFile,'%' ) .gt. 0 .or. & +! index( gcSM%BiomassBurningFile,'gfed' ) .gt. 0 )then +! nymd1 = nymd +! nhms1 = 120000 +! +! Assume GFED climatology or Martin (Duncan) climatology +! +! else +! nymd1 = 1971*10000 + mod ( nymd, 10000 ) ! assumes 1971 +!! nymd1 = nymd +! nhms1 = 120000 +! end if +! +! Get the information from the biomass burning file +! +! fileread command went here orginally +! +! gcSM%nymd = nymd +! +! endif ! gcSM%nymd .ne. nymd +! +! - JAS -- I do not understand the above section + +! JAS, I ought to be using carma_bins +! JAS, carma_bins got lost in converstion to GEOS-5 + +! JAS, looks like I'm ignoring the .rc file for now +! originally, we were using MKS -- now, rc file uses cgs +! seeing how I'm ignoring the rc file for now, I can stay w/ MKS as +! long as I'm consistent + +! if ( NBIN .eq. 16 ) then +! SM_radius(1) = 25.e-9 ! meter(m) +! rmrat = 2. +! elseif ( NBIN .eq. 8 ) then +! SM_radius(1) = 25.e-9 ! m +! rmrat = exp( 15. * alog(2.) / 7. ) ! = 4.416358 +! else +! print *, '*** Error ***' +! print *, 'Chem_Shared/SmokeEmissionMod.F90: code not ready for this NBIN' +! print *, 'NBIN = ', NBIN +! rc = 2 +! return +! endif + +! SM_mass(1) = factor * SM_radius(1) ** 3 +! do ibin = 2, nbin +! SM_mass(ibin) = rmrat * SM_mass(ibin-1) +! SM_radius(ibin) = ( SM_mass(ibin) / factor ) ** ( 1. / 3. ) +! enddo + +! For bin width calc + +! vrfact = ( 3. / 2. / pi / ( rmrat + 1. ) ) ** ( 1. / 3. ) & +! * ( rmrat ** ( 1. / 3. ) - 1. ) + +! Bin width + +! dr = vrfact & +! * ( 4. / 3. * pi * SM_radius(ibin) ** 3 ) ** ( 1. / 3. ) + +! k1 = lbound( z_lo, 3 ) +! k2 = ubound( z_lo, 3 ) +! print *, 'z_lo of k1', z_lo(i1,j1,k1), 'k1', k1 +! print *, 'z_lo of k2', z_lo(i1,j1,k2), 'k2', k2 +! k1 = lbound( ple, 3 ) +! k2 = ubound( ple, 3 ) +! print *, 'ple of k1', ple(i1,j1,k1), 'k1', k1 +! print *, 'ple of k2', ple(i1,j1,k2), 'k2', k2 + +!print *, 'i j', i, j, 'lon lat', lon(i,j), lat(i,j) + +! JAS, dbg +! if( i .eq. 1 .and. j .eq. 1 ) print *,'k = ', k, ' Ps @ k = ', & +! ple(i,j,k), ple(i,j,k-1) + +! JAS -- I am coopting Pete's code for finding the alitudes of various +! layers to do my elevated layers code + +! Now update the tracer mixing ratios with the aerosol sources +! ------------------------------------------------------------ +! p0 = ps + +K_LOOP: do k = km, 1, -1 + +! print *, 'SM_Emissions: getting emissions for layer ', k + +! First determine emissions for this layer +! ---------------------------------------- + do j = j1, j2 + do i = i1, i2 + +!!! Gotta use ple now; find out the bounds of this !!! + + p1 = p0(i,j) - w_c%delp(i,j,k) + +! !!! JAS: code for 4 elevated layers emitted +! + +! Based on old vtracer code which is still here but commented + +! srcBiomass(i,j) = 0. +! +! JAS This next part looks like code for tracing the time of emission +! +! JAS if p is in between good src altitudes then +! n = mod(date,8) + 1 +! MUST comment out previous vtracer stuff so that extra emissions +! don't occur +! +! n = 0 +! if ( ( p0(i,j) .ge. 600.e2 .and. p1 .lt. 600.e2 ) & +! .or. ( p0(i,j) .ge. 400.e2 .and. p1 .lt. 400.e2 ) & +! .or. ( p0(i,j) .ge. 300.e2 .and. p1 .lt. 300.e2 ) )then +! n = mod( date + 5, 16 ) / 2 + 1 +! endif +! +! Emission of the tracers will be prescribed as 1 ppbm per time step. +! This will permit me to see how many time steps air resides in an +! emitting column. +! +! if ( n .gt. 0 .and. n .le. nbins ) then +! w_c%qa(nbeg+n-1)%data3d(i,j,k) = & +! w_c%qa(nbeg+n-1)%data3d(i,j,k) + 1.e-9 +! endif + +! JAS This next part looks like my poor attempt at emitting in 3 elevated +! layers. This thing split the mass equally among the layers, making +! the mixing ratio increase with altitude of the layer +! +! if ( ( p0(i,j) .ge. 600.e2 .and. p1 .lt. 600.e2 ) & +! .or. ( p0(i,j) .ge. 400.e2 .and. p1 .lt. 400.e2 ) & +! .or. ( p0(i,j) .ge. 300.e2 .and. p1 .lt. 300.e2 ) )then +! +! srcBiomass(i,j) = 1. / 3. *eBiomass*gcSM%biomass_src(i,j) +! +! endif + +! !!! JAS: end of elevated layers code + +! Update pressure of lower level +! ------------------------------ + p0(i,j) = p1 + + end do ! i + end do ! j + + end do K_LOOP + +#endif + +! endif of C-preprocessor statement to comment out old code diff --git a/ESMF/Shared/Chem_Shared/SulfateChemDriverMod.F90 b/ESMF/Shared/Chem_Shared/SulfateChemDriverMod.F90 new file mode 100644 index 00000000..85eea52e --- /dev/null +++ b/ESMF/Shared/Chem_Shared/SulfateChemDriverMod.F90 @@ -0,0 +1,2903 @@ +#include "MAPL_Generic.h" +#include "unused_dummy.H" +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: SulfateChemDriverMod.F90 --- Calculate the sulfate aerosol +! chemistry +! +! !INTERFACE: +! + + module SulfateChemDriverMod + +! !USES: + + USE ESMF + USE MAPL + use m_StrTemplate + use m_die, only: die + + use Chem_Mod + use Chem_ConstMod, only: grav, undefval => undef, & + airMolWght => airmw ! Constants ! + use Chem_UtilMod + use DryDepositionMod + + use m_mpout + +! use pflogger + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC SulfateChemDriverGOCART + PUBLIC SulfateUpdateEmissions + PUBLIC SulfateUpdateOxidants + PUBLIC SulfateDistributeEmissions + + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + + real, parameter :: pi = 3.1415, rearth = 6.37e6 + real, parameter :: radToDeg = 57.2957795 + real, parameter :: nAvogadro = 6.022e23 ! molecules per mole of air + +! gram molecular weights of species + real, parameter :: fMassSulfur = 32., fMassSO2 = 64., fMassSO4 = 96., & + fMassDMS = 62., fMassMSA = 96. + +! relative position of sulfate tracers + integer, parameter :: nDMS = 1, & + nSO2 = 2, & + nSO4 = 3, & + nMSA = 4 + + +! +! !DESCRIPTION: +! +! This module implements the Dust Emission calculations +! +! !REVISION HISTORY: +! +! 29Dec2009 Colarco First crack! +! +!EOP +!------------------------------------------------------------------------- +CONTAINS +! +! GOCART-based sulfate chemistry driver +! +! !ROUTINE: SulfateChemDriverGOCART +! +! !INTERFACE: +! + subroutine SulfateChemDriverGOCART ( i1, i2, j1, j2, km, nbeg, & + nbins, cdt, nymd, nhms, & + lonRad, latRad, & + dms, so2, so4, msa, & + xoh, xno3, xh2o2, & + u, v, delp, tmpu, cloud, rhoa, hghte, & + ustar, shflux, oro, pblh, z0h, & + SU_dep, SU_PSO2, SU_PMSA, & + SU_PSO4, SU_PSO4g, SU_PSO4aq, & ! 2d diagnostics + pso2, pmsa, pso4, pso4g, pso4aq, & ! 3d diagnostics + rc) + + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km, nbeg, nbins, & + nymd, nhms + real, intent(in) :: cdt + real, pointer, dimension(:,:,:) :: dms, so2, so4, msa + real, pointer, dimension(:,:,:) :: xoh, xno3, xh2o2 + real, pointer, dimension(:,:,:) :: u, v, delp, tmpu, cloud, rhoa, hghte + real, pointer, dimension(:,:) :: ustar, shflux, oro, pblh, z0h + real, pointer, dimension(:,:) :: lonRad, latRad + +! !OUTPUT PARAMETERS: + type(Chem_Array), intent(inout) :: SU_dep(nbins) ! Mass lost by deposition + ! to surface, kg/m2/s +! chemical production terms d(mixing ratio) /s + type(Chem_Array), intent(inout) :: su_pSO2, su_pMSA, su_PSO4, su_pSO4g, su_pSO4aq + type(Chem_Array), intent(inout) :: pSO2, pMSA, pSO4, pSO4g, pSO4aq + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'SU_ChemDrv' + +! !DESCRIPTION: Updates the SU concentration due to chemistry +! The SU grid component is currently established with 4 different +! species (bins) following this convection: +! 1) DMS +! 2) SO2 +! 3) SO4 +! 4) MSA +! Accordingly we have 4 chemical cycles to follow through, which are +! sub-subroutines under this one. +! The chemistry is a function of OH, NO3, and H2O2 concentrations +! as well as DMS, SO2, SO4, MSA concentrations. It is also a function +! of solar zenith angle and temperature. We pass in temperature. SZA +! will be a function of time of day and lat/lon. For now we simply add +! this to the grid component before calculating it. I bet this is +! somewhere else in the model. +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + real :: cossza(i1:i2,j1:j2), sza(i1:i2,j1:j2) + integer :: k, n, jday + real :: pSO2_DMS(i1:i2,j1:j2,1:km), pMSA_DMS(i1:i2,j1:j2,1:km), & + pSO4g_SO2(i1:i2,j1:j2,1:km), pSO4aq_SO2(i1:i2,j1:j2,1:km) + real :: drydepositionfrequency(i1:i2,j1:j2) + real :: xhour + integer :: ijl, ijkl +#ifdef DEBUG + real :: qmin, qmax +#endif + _UNUSED_DUMMY(nbeg) + _UNUSED_DUMMY(u) + _UNUSED_DUMMY(v) + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + +! Reset the production terms + pSO2_DMS(i1:i2,j1:j2,1:km) = 0. + pMSA_DMS(i1:i2,j1:j2,1:km) = 0. + pSO4g_SO2(i1:i2,j1:j2,1:km) = 0. + pSO4aq_SO2(i1:i2,j1:j2,1:km) = 0. + if( associated(su_pSO2%data2d) ) su_pSO2%data2d(i1:i2,j1:j2) = 0. + if( associated(su_pMSA%data2d) ) su_pMSA%data2d(i1:i2,j1:j2) = 0. + if( associated(su_pSO4%data2d) ) su_pSO4%data2d(i1:i2,j1:j2) = 0. + if( associated(su_pSO4g%data2d) ) su_pSO4g%data2d(i1:i2,j1:j2) = 0. + if( associated(su_pSO4aq%data2d) ) su_pSO4aq%data2d(i1:i2,j1:j2) = 0. + if( associated(pSO2%data3d) ) pSO2%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(pMSA%data3d) ) pMSA%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(pSO4%data3d) ) pSO4%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(pSO4g%data3d) ) pSO4g%data3d(i1:i2,j1:j2,1:km) = 0. + if( associated(pSO4aq%data3d) ) pSO4aq%data3d(i1:i2,j1:j2,1:km) = 0. + + +! Find the cossza +! ---------------------------------- + jday = idaynum(nymd) + xhour = ( real(nhms/10000)*3600. & + + real(mod(nhms,10000)/100)*60. & + + real(mod(nhms,100)) & + ) / 3600. + call szangle(jday, xHour, lonRad, latRad, sza, cossza, i1, i2, j1, j2) + +! Reset the dry deposition fluxes & frequencies + do n = 1, nbins + if( associated(su_dep(n)%data2d) ) su_dep(n)%data2d(i1:i2,j1:j2) = 0.0 + end do + call DryDepositionGOCART( i1, i2, j1, j2, km, & + tmpu, rhoa, hghte, oro, ustar, & + pblh, shflux, z0h, drydepositionfrequency, rc ) + +if(mapl_am_i_root()) print*,'SU sum(drydepositionfrequency) = ',sum(drydepositionfrequency) + +! Now call the chemistry packages... +! ---------------------------------- + +! DMS source and oxidation to SO2 and MSA + call SU_ChemDrv_DMS( i1, i2, j1, j2, km, cdt, xoh, xno3, rhoa, & + dms, delp, tmpu, cossza, pSO2_DMS, pMSA_DMS, & + drydepositionfrequency, su_dep(nDMS), rc) + + if( associated(pSO2%data3d) ) & + pSO2%data3d(i1:i2,j1:j2,1:km) = pSO2_DMS(i1:i2,j1:j2,1:km) + if( associated(su_pSO2%data2d)) then + do k = 1, km + su_pSO2%data2d(i1:i2,j1:j2) & + = su_pSO2%data2d(i1:i2,j1:j2) & + + pSO2_DMS(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav + enddo + endif + + if( associated(pMSA%data3d) ) & + pMSA%data3d(i1:i2,j1:j2,1:km) = pMSA_DMS(i1:i2,j1:j2,1:km) + if( associated(su_pMSA%data2d)) then + do k = 1, km + su_pMSA%data2d(i1:i2,j1:j2) & + = su_pMSA%data2d(i1:i2,j1:j2) & + + pMSA_DMS(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav + enddo + endif + +! SO2 source and oxidation to SO4 + call SU_ChemDrv_SO2( i1, i2, j1, j2, km, cdt, xoh, xh2o2, rhoa, & + so2, delp, tmpu, cloud, pSO2_DMS, pSO4g_SO2, & + pSO4aq_SO2, drydepositionfrequency, oro, su_dep(nSO2), rc) + if( associated(pSO4g%data3d) ) & + pSO4g%data3d(i1:i2,j1:j2,1:km) = pSO4g_SO2(i1:i2,j1:j2,1:km) + if( associated(su_pSO4g%data2d)) then + do k = 1, km + su_pSO4g%data2d(i1:i2,j1:j2) & + = su_pSO4g%data2d(i1:i2,j1:j2) & + + pSO4g_SO2(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav + enddo + endif + + if( associated(pSO4aq%data3d) ) & + pSO4aq%data3d(i1:i2,j1:j2,1:km) = pSO4aq_SO2(i1:i2,j1:j2,1:km) + if( associated(su_pSO4aq%data2d)) then + do k = 1, km + su_pSO4aq%data2d(i1:i2,j1:j2) & + = su_pSO4aq%data2d(i1:i2,j1:j2) & + + pSO4aq_SO2(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav + enddo + endif + + if( associated(pSO4%data3d) ) & + pSO4%data3d(i1:i2,j1:j2,1:km) = pSO4g_SO2(i1:i2,j1:j2,1:km) + pSO4aq_SO2(i1:i2,j1:j2,1:km) + if( associated(su_pSO4%data2d)) then + do k = 1, km + su_pSO4%data2d(i1:i2,j1:j2) & + = su_pSO4%data2d(i1:i2,j1:j2) & + + pSO4g_SO2(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav & + + pSO4aq_SO2(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav + enddo + endif + + + +! SO4 source and loss + call SU_ChemDrv_SO4( i1, i2, j1, j2, km, cdt, so4, delp, & + pSO4g_SO2, pSO4aq_SO2, drydepositionfrequency, su_dep(nSO4), rc) + + +! MSA source and loss + call SU_ChemDrv_MSA( i1, i2, j1, j2, km, cdt, msa, delp, & + pMSA_DMS, drydepositionfrequency, su_dep(nMSA), rc) + +#ifdef DEBUG + if(associated(su_pso2%data2d)) call pmaxmin('SU: su_pso2',su_pso2%data2d,qmin,qmax,ijl,1,1.) + if(associated(su_pmsa%data2d)) call pmaxmin('SU: su_pmsa',su_pmsa%data2d,qmin,qmax,ijl,1,1.) + if(associated(su_pso4g%data2d)) call pmaxmin('SU: su_pso4g',su_pso4g%data2d,qmin,qmax,ijl,1,1.) + if(associated(su_pso4aq%data2d)) call pmaxmin('SU: su_pso4aq',su_pso4aq%data2d,qmin,qmax,ijl,1,1.) + call pmaxmin('SU: pSO4g_SO2', pSO4g_SO2, qmin, qmax, ijl, km, 1. ) + call pmaxmin('SU: pSO4aq_SO2', pSO4aq_SO2, qmin, qmax, ijl, km, 1. ) + call pmaxmin('SU: pSO2_DMS', pSO2_DMS, qmin, qmax, ijl, km, 1. ) + call pmaxmin('SU: pMSA_DMS', pMSA_DMS, qmin, qmax, ijl, km, 1. ) +#endif + + rc = 0 + + end subroutine SulfateChemDriverGOCART + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_ChemDrv_DMS +! NOTE: This is the DMS oxidation subroutine. + +! +! !INTERFACE: +! + + subroutine SU_ChemDrv_DMS( i1, i2, j1, j2, km, cdt, xoh, xno3, rhoa, & + qa, delp, tmpu, cossza, pSO2_DMS, pMSA_DMS, & + drydepf, fluxOut, rc) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km + real, intent(in) :: cdt + real, pointer :: qa(:,:,:) + real, pointer :: delp(:,:,:) + real, pointer, dimension(:,:,:) :: tmpu, rhoa + real, intent(in) :: drydepf(i1:i2,j1:j2) + real, intent(in) :: xoh(i1:i2,j1:j2,km), xno3(i1:i2,j1:j2,km) + real, intent(in) :: cossza(i1:i2,j1:j2) + + +! !OUTPUT PARAMETERS: + + type(Chem_Array), intent(inout) :: fluxout ! Mass lost by deposition + ! to surface, kg/m2/s + real, intent(out) :: pSO2_DMS(i1:i2,j1:j2,km), pMSA_DMS(i1:i2,j1:j2,km) + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'SU_ChemDrv_DMS' + +! !DESCRIPTION: Computes the production of SO2 and MSA due to DMS oxidation +! +! R1: DMS + OH -> a*SO2 + b*MSA OH addition channel +! k1 = { 1.7d-42*exp(7810/T)*[O2] / (1+5.5e-31*exp(7460/T)*[O2] } +! a = 0.75, b = 0.25 +! +! R2: DMS + OH -> SO2 + ... OH abstraction channel +! k2 = 1.2e-11*exp(-260/T) +! +! DMS_OH = DMS0 * exp(-(r1+r2)*NDT1) +! where DMS0 is the DMS concentration at the beginning, +! r1 = k1*[OH], r2 = k2*[OH] +! +! R3: DMS + NO3 -> SO2 + ... +! k3 = 1.9e-13*exp(500/T) +! +! DMS = DMS_OH * exp(-r3*NDT1) +! where r3 = k3*[NO3] +! +! R4: DMS + X -> SO2 + ... +! assume to be at the rate of DMS+OH and DMS+NO3 combined. +! +! The production of SO2 and MSA here, PSO2_DMS and PMSA_DMS, are saved +! for use in CHEM_SO2 and CHEM_MSA subroutines as a source term. They +! are in unit of MixingRatio/second. +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k + real*8 :: Fx, b, eff + real*8 :: rk1, rk2, rk3, rk4 + real*8 :: tk, o2, oh, no3, air + real*8 :: dms, dms0, dms_oh + + data Fx / 1.0 / + data b / 0.25 / + data eff / 1. / + + _UNUSED_DUMMY(delp) + _UNUSED_DUMMY(drydepf) + +! spatial loop + do k = 1, km + do j = j1, j2 + do i = i1, i2 + + rk1 = 0. + rk2 = 0. + rk3 = 0. + rk4 = 0. + + tk = tmpu(i,j,k) + oh = xoh(i,j,k) +! air molecules in # cm-3 + air = 1000.*rhoa(i,j,k) / airMolWght * nAvogadro * 1.e-6 +! oxygen molecules in # cm-3 + o2 = 0.21 * air +! no3 -> go from volume mixing ratio to # cm-3 + no3 = xno3(i,j,k) * air + +! initial DMS concentration (kg kg-1) + dms0 = qa(i,j,k) + dms0 = max(dms0,tiny(dms0)) + +! 1 & 2) DMS + OH: RK1 = addition, RK2 = abstraction + if(oh .gt. 0.) then + rk1 = (1.7d-42 * exp(7810./tk) * o2) / & + (1. + 5.5e-31 * exp(7460./tk) * o2) * oh + rk2 = (1.2e-11 * exp(-260./tk)) * oh + endif + +! 3) DMS + NO3: only happens at night + if(cossza(i,j) .le. 0.) then + rk3 = (1.9e-13 * exp(500./tk)) * no3 + endif + +! Now do the DMS loss + dms_oh = dms0 * exp( -(rk1+rk2)* Fx * cdt) + dms = dms_oh * exp( -(rk3) * Fx * cdt) + +! SO2 and MSA production terms +! MSA is formed from the DMS+OH addition step +! Production should go as mass mixing ratio change in MSA + if( (rk1+rk2) .eq. 0.) then + pMSA_DMS(i,j,k) = 0. + else + pMSA_DMS(i,j,k) = (dms0 - dms_oh) * b*rk1/((rk1+rk2)*Fx) * eff & + * (fMassMSA/fMassDMS) / cdt + endif + +! Everything else goes into SO2 formation step + pSO2_DMS(i,j,k) = ( dms0 - dms - & + pMSA_DMS(i,j,k)*cdt*(fMassDMS/fMassMSA) & + ) * (fMassSO2/fMassDMS) / cdt + + +! 4) Dry deposition of DMS (not in GOCART?) +! if(k .eq. km) rk4 = drydepf(i,j) +! dms0 = dms +! dms = dms0 * exp(-rk4*cdt) +! dms = max(dms,1.e-32) + +! Update the mass mixing ratio and the dry deposition flux out of DMS + dms = max(dms,tiny(dms)) + qa(i,j,k) = dms + + end do ! i + end do ! j + if(k .eq. km .and. associated(fluxout%data2d) ) fluxout%data2d = 0. + end do ! k + + + rc = 0 + + end subroutine SU_ChemDrv_DMS + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_ChemDrv_SO2 +! NOTE: This is the SO2 oxidation subroutine. + +! +! !INTERFACE: +! + + subroutine SU_ChemDrv_SO2( i1, i2, j1, j2, km, cdt, xoh, xh2o2, rhoa,& + qa, delp, tmpu, cloud, pSO2_DMS, pSO4g_SO2, & + pSO4aq_SO2, drydepf, oro, fluxOut, rc) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km + real, intent(in) :: cdt + real, pointer :: qa(:,:,:) + real, pointer :: delp(:,:,:) + real, pointer, dimension(:,:,:) :: tmpu, cloud, rhoa + real, pointer, dimension(:,:) :: oro + real, intent(in) :: drydepf(i1:i2,j1:j2) + real, intent(in) :: pSO2_DMS(i1:i2,j1:j2,km) + real, intent(inout) :: xoh(i1:i2,j1:j2,km), xh2o2(i1:i2,j1:j2,km) + +! !OUTPUT PARAMETERS: + + type(Chem_Array), intent(inout) :: fluxout ! Mass lost by deposition + ! to surface, kg/m2/s + real, intent(out) :: pSO4g_SO2(i1:i2,j1:j2,km) + real, intent(out) :: pSO4aq_SO2(i1:i2,j1:j2,km) + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'SU_ChemDrv_SO2' + +! !DESCRIPTION: Computes the concentration of SO2 and production of SO4 +! +! SO2 production: +! DMS + OH, DMS + NO3 (saved in SU_ChemDrv_DMS) +! +! SO2 loss: +! SO2 + OH -> SO4 +! SO2 -> drydep +! SO2 + H2O2 or O3 (aq) -> SO4 +! +! SO2 = SO2_0 * exp(-bt) +! + PSO2_DMS*dt/bt * [1-exp(-bt)] +! where b is the sum of the reaction rate of SO2 + OH and the dry +! deposition rate of SO2, PSO2_DMS is SO2 production from DMS in +! MixingRatio/timestep. +! +! If there is cloud in the gridbox (fraction = fc), then the aqueous +! phase chemistry also takes place in cloud. The amount of SO2 oxidized +! by H2O2 in cloud is limited by the available H2O2; the rest may be +! oxidized due to additional chemistry, e.g, reaction with O3 or O2 +! (catalyzed by trace metal). +! +! !REVISION HISTORY: +! +! 15Jul2010, Colarco - modularized +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k + real*8 :: rk1, rk2, rk, rkt, f1 + real*8 :: L1, L2, Ld, SO2, SO2_cd, fc, fMR + real*8 :: oh, h2o2, SO20, tk, air, k0, ki, kk + real, dimension(i1:i2,j1:j2) :: fout + + data ki / 1.5e-12 / + +! Conversion of SO2 mmr to SO2 vmr + fMR = airMolWght / fMassSO2 + +! Initialize flux variable + fout = 0. + +! spatial loop + do k = 1, km + do j = j1, j2 + do i = i1, i2 + + rk1 = 0. + rk2 = 0. + L1 = 0. + L2 = 0. + Ld = 0. + + tk = tmpu(i,j,k) + oh = xoh(i,j,k) + h2o2 = max(xh2o2(i,j,k),tiny(xh2o2(i,j,k))) + +! air molecules in # cm-3 + air = 1000.*rhoa(i,j,k) / airMolWght * nAvogadro * 1.e-6 +! 1) SO2 + OH(g) in s-1 + k0 = 3.0e-31 * (300./tk)**4.3 + kk = k0 * air / ki + f1 = (1. + (log10(kk))**2.)**(-1.) + rk1 = ( (k0*air/(1.+kk)) * 0.6**f1) * oh + +! 2) rk2 is the loss of SO2 due to dry deposition. + if(k .eq. km) then +! drydepf calculated for aerosol +! follow Walcek: ocean drydepf_so2 = 10*drydepf_aer +! or if land drydepf_so2 = 3*drydepf_aer + if(oro(i,j) .eq. OCEAN) then + rk2 = 10.*drydepf(i,j) + else + rk2 = 3.*drydepf(i,j) + endif +! rk2 = drydepf(i,j) + else + rk2 = 0. + endif + + rk = (rk1 + rk2) + rkt = rk*cdt + +! Update the SO2 concentration +! Originally this was solved like a simple exponential solution +! after Jacobson eq. 13.38, which is more accurate but not mass +! conserving. We've already timesplit everything, so accuracy is +! out to lunch, and I'd prefer to conserve mass. + +! initial SO2 concentration (kg kg-1) after adding source + SO20 = qa(i,j,k) + pSO2_DMS(i,j,k)*cdt + SO20 = max(SO20,tiny(SO20)) + + if(rk .gt. 0.) then + SO2_cd = SO20 * exp(-rkt) + L1 = (SO20 - SO2_cd) * rk1/rk + if(k .eq. km) then + Ld = (SO20 - SO2_cd) * rk2/rk + fout(i,j) = Ld * delp(i,j,km)/grav/cdt + else + Ld = 0. + endif + else + SO2_cd = SO20 + L1 = 0. + endif + + +! Update SO2 concentration after cloud chemistry, if it occurs + fc = cloud(i,j,k) + if(fc .gt. 0. .and. SO2_cd .gt. 0. .and. tk .gt. 258.) then +! Check on H2O2 vmr -> is SO2 vmr greater? + if(fMr * SO2_cd .gt. h2o2) then + fc = fc*(h2o2/(fMR*SO2_cd)) + h2o2 = h2o2*(1.-cloud(i,j,k)) + else + h2o2 = h2o2*(1. - cloud(i,j,k)*(fMR*SO2_cd)/h2o2) + endif + SO2 = SO2_cd*(1.-fc) +! aqueous loss rate (mixing ratio/timestep) + L2 = SO2_cd * fc + else + SO2 = SO2_cd + L2 = 0. + endif + +! Ideally you would update the H2O2 mixing ratio at this point +! and then reset it periodically + xh2o2(i,j,k) = max(h2o2,tiny(h2o2)) + + SO2 = max(SO2,tiny(SO2)) + qa(i,j,k) = SO2 + pSO4g_SO2(i,j,k) = L1 * (fMassSO4/fMassSO2) / cdt + pSO4aq_SO2(i,j,k) = L2 * (fMassSO4/fMassSO2) / cdt + + end do + end do + end do + + if( associated(fluxout%data2d) ) fluxout%data2d = fout + + rc = 0 + + end subroutine SU_ChemDrv_SO2 + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_ChemDrv_SO4 - Do SU cycle chemistry following GOCART +! NOTE: This is the SO4 production by SO2 oxidation subroutine. + +! +! !INTERFACE: +! + + subroutine SU_ChemDrv_SO4( i1, i2, j1, j2, km, cdt, qa, delp, & + pSO4g_SO2, pSO4aq_SO2, drydepf, fluxOut, rc) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km + real, intent(in) :: cdt + real, pointer :: qa(:,:,:) + real, pointer :: delp(:,:,:) + real, intent(in) :: drydepf(i1:i2,j1:j2) + real, intent(in) :: pSO4g_SO2(i1:i2,j1:j2,km) + real, intent(in) :: pSO4aq_SO2(i1:i2,j1:j2,km) + +! !OUTPUT PARAMETERS: + + type(Chem_Array), intent(inout) :: fluxout ! Mass lost by deposition + ! to surface, kg/m2/s + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'SU_ChemDrv_SO4' + +! !DESCRIPTION: +! +! SO4 production: +! The only production term is due to SO2 oxidation. +! SO4 = SO4_0 * exp(-kt) + pSO4_SO2/kt * (1.-exp(-kt)) +! where k is the dry deposition +! +! !REVISION HISTORY: +! +! 15Jul2010, Colarco - Modularized +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k + real*8 :: rk, rkt, Ld + real*8 :: SO4, SO40, pSO4 + real, dimension(i1:i2,j1:j2) :: fout + + +! Initialize flux variable + fout = 0. + +! spatial loop + do k = 1, km + do j = j1, j2 + do i = i1, i2 + + pSO4 = pSO4g_SO2(i,j,k)+pSO4aq_SO2(i,j,k) + +! initial SO4 concentration (kg kg-1) + SO40 = qa(i,j,k) + SO40 = max(SO40,tiny(SO40)) + +! Update the SO4 concentration +! Originally this was solved like a simple exponential solution +! after Jacobson eq. 13.38, which is more accurate but not mass +! conserving. We've already timesplit everything, so accuracy is +! out to lunch, and I'd prefer to conserve mass. +! RK is the dry deposition frequency + if(k .eq. km) then + RK = drydepf(i,j) + RKT = RK*cdt + SO4 = (SO40 + pSO4*cdt) * exp(-rkt) + Ld = (SO40 - SO4 + pSO4*cdt) + fout(i,j) = Ld * delp(i,j,km)/grav/cdt + else + SO4 = SO40 + pSO4*cdt + Ld = 0. + endif + + SO4 = max(SO4,tiny(SO4)) + qa(i,j,k) = SO4 + + end do + end do + end do + + if( associated(fluxout%data2d) ) fluxout%data2d = fout + + rc = 0 + + end subroutine SU_ChemDrv_SO4 + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SU_ChemDrv_MSA - MSA production by DMS oxidation + +! +! !INTERFACE: +! + + subroutine SU_ChemDrv_MSA( i1, i2, j1, j2, km, cdt, qa, delp, & + pMSA_DMS, drydepf, fluxOut, rc) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km + real, intent(in) :: cdt + real, pointer :: qa(:,:,:) + real, pointer :: delp(:,:,:) + real, intent(in) :: drydepf(i1:i2,j1:j2) + real, intent(in) :: pMSA_DMS(i1:i2,j1:j2,km) + +! !OUTPUT PARAMETERS: + + type(Chem_Array), intent(inout) :: fluxout ! Mass lost by deposition + ! to surface, kg/m2/s + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'SU_ChemDrv_MSA' + +! !DESCRIPTION: +! +! MSA production: +! The only production term is due to DMS oxidation. +! MSA = MSA_0 * exp(-kt) + pSO4_SO2/kt * (1.-exp(-kt)) +! where k is the dry deposition +! +! !REVISION HISTORY: +! +! 15Jul2010, Colarco -- modularized +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k + real*8 :: rk, rkt, Ld + real*8 :: MSA, MSA0 + real, dimension(i1:i2,j1:j2) :: fout + +! Initialize flux variable + fout = 0. + +! spatial loop + do k = 1, km + do j = j1, j2 + do i = i1, i2 + +! initial MSA concentration (kg kg-1) + MSA0 = qa(i,j,k) + MSA0 = max(MSA0,tiny(MSA0)) + +! Update the MSA concentration +! Originally this was solved like a simple exponential solution +! after Jacobson eq. 13.38, which is more accurate but not mass +! conserving. We've already timesplit everything, so accuracy is +! out to lunch, and I'd prefer to conserve mass. +! RK is the dry deposition frequency + if(k .eq. km) then + RK = drydepf(i,j) + RKT = RK*cdt + MSA = (MSA0 + pMSA_DMS(i,j,k)*cdt) * exp(-rkt) + Ld = (MSA0 + pMSA_DMS(i,j,k)*cdt - MSA) + fout(i,j) = Ld * delp(i,j,km)/grav/cdt + else + MSA = MSA0 + pMSA_DMS(i,j,k)*cdt + Ld = 0. + endif + + MSA = max(MSA,tiny(MSA)) + qa(i,j,k) = MSA + + end do + end do + end do + + if( associated(fluxout%data2d) ) fluxout%data2d = fout + + rc = 0 + + end subroutine SU_ChemDrv_MSA + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SulfateUpdateOxidants - Update Oxidant Fields for Sulfate +! We have 3 oxidant fields (OH, NO3, H2O2) which may come +! from either a climatological file or from interactive GMI. +! IF from climatology, update (reset) values from climatology +! if necessary (e.g., for a new day) and set to current values +! needed by chemistry. +! IF from GMI read as is +! +! !INTERFACE: + subroutine SulfateUpdateOxidants ( impChem,iName, i1, i2, im, j1, j2, jm, km, cdt, & + using_GMI_OH, using_GMI_NO3, & + using_GMI_H2O2, & + GMI_OHmr, GMI_NO3mr, GMI_H2O2mr, & + nymd_current, nhms_current, & + grid, lonRad, latRad, & + rhoa, & + nymd_last, & + oh_clim, no3_clim, h2o2_clim, & + xoh, xno3, xh2o2, recycle_h2o2 ) + +! +! Input + type(ESMF_State), intent(inout) :: impChem + character(len=*), intent(in ) :: iName + integer, intent(in) :: i1, i2, im, j1, j2, jm, km + real, intent(in) :: cdt + integer, intent(in) :: nymd_current, & ! current model NYMD + nhms_current ! current model NHMS + integer, intent(inout) :: nymd_last ! NYMD of last emission update + logical, intent(inout) :: recycle_h2o2 ! triggers recycling of H2O2 + logical, intent(in) :: using_GMI_OH, & + using_GMI_NO3, & + using_GMI_H2O2 + type(ESMF_Grid) :: grid + real, pointer, dimension(:,:) :: lonRad, latRad + + real, pointer, dimension(:,:,:) :: oh_clim, & + no3_clim, & + h2o2_clim, & + xoh, xno3, xh2o2, & + GMI_OHmr, & + GMI_H2O2mr, & + GMI_NO3mr, & + rhoa + +! Local + integer :: i, j, k, jday + integer :: STATUS + real :: qmax, xhour, xhouruse + real :: cossza(i1:i2,j1:j2), sza(i1:i2,j1:j2) + real :: tcosz(i1:i2,j1:j2), tday(i1:i2,j1:j2), tnight(i1:i2,j1:j2) + integer :: n, ndystep + real, pointer :: ptr3d(:,:,:) => null() + + _UNUSED_DUMMY(im) + _UNUSED_DUMMY(jm) + _UNUSED_DUMMY(grid) + + +! Update emissions/production if necessary (daily) +! ----------------------------------------------- +! Oxidant fields +! The expectation here is that OH is being read in the form +! volume mixing ratio from a file (so, like GMI would provide). +! Below, in the scaling by solar zenith angle, we convert from +! VMR to # cm-3 expected by the chemistry. + IF(.NOT. using_GMI_OH) THEN + call MAPL_GetPointer(impChem,ptr3d,"SU_OH"//trim(iName),rc=status) + oh_clim = ptr3d + + where(1.01*oh_clim(i1:i2,j1:j2,1:km) > undefval) oh_clim(i1:i2,j1:j2,1:km) = 0. + where( oh_clim(i1:i2,j1:j2,1:km) < 0 ) oh_clim(i1:i2,j1:j2,1:km) = 0. + END IF + + + IF(.NOT. using_GMI_NO3) THEN + call MAPL_GetPointer(impChem,ptr3d,"SU_NO3"//trim(iName),rc=status) + no3_clim = ptr3d + + where(1.01*no3_clim(i1:i2,j1:j2,1:km) > undefval) no3_clim(i1:i2,j1:j2,1:km) = 0. + where( no3_clim(i1:i2,j1:j2,1:km) < 0 ) no3_clim(i1:i2,j1:j2,1:km) = 0. + END IF + + IF(.NOT. using_GMI_H2O2) THEN + call MAPL_GetPointer(impChem,ptr3d,"SU_H2O2"//trim(iName),rc=status) + h2o2_clim = ptr3d + + where(1.01*h2o2_clim(i1:i2,j1:j2,1:km) > undefval) h2o2_clim(i1:i2,j1:j2,1:km) = 0. + where( h2o2_clim(i1:i2,j1:j2,1:km) < 0 ) h2o2_clim(i1:i2,j1:j2,1:km) = 0. + END IF + +! The first time through the reads we will save the h2o2 monthly +! average in the instantaneous field +! --------------------------------- + if (nymd_last == nymd_current .and. (.not. using_GMI_H2O2)) then + xh2o2 = h2o2_clim + nymd_last = nymd_current +if(mapl_am_i_root()) print*,'SU nymd_oxidants == nymd_current' + end if + + +! Find the day number of the year and hour (needed for later doing sza) +! ---------------------------------- + jday = idaynum(nymd_current) + xhour = ( real(nhms_current/10000)*3600. & + + real(mod(nhms_current,10000)/100)*60. & + + real(mod(nhms_current,100)) & + ) / 3600. + +! Recycle H2O2 to input on 3 hour boundaries if not coupled to GMI +! ---------------------------------- + if (.NOT. using_GMI_H2O2 .and. recycle_h2o2) then + xh2o2 = h2o2_clim + recycle_h2o2 = .false. + end if + +! If not getting instantaneous values from GMI, update for time of day. +! --------------------------------------------------------------------- +! OH + if( .not. using_GMI_OH) then + xoh = oh_clim + cossza(:,:) = 0. + +! Want to find the sum of the cos(sza) for use in scaling OH diurnal variation +! tcosz is the sum of cossza over the whole day +! tday is the time of day spent in light +! Requires integrating over future times, so cannot use w_c%cosz + xHourUse = xHour + ndystep = 86400. / cdt + tcosz(:,:) = 0. + tday(:,:) = 0. + do n = 1, ndystep + call szangle(jday, xHourUse, lonRad, latRad, sza, cossza, i1, i2, j1, j2) + tcosz = tcosz + cossza + xHourUse = xHourUse + cdt/3600. + if(xHourUse .gt. 24.) xHourUse = xHourUse - 24. +! Find the daylight portion of the day + do j = j1, j2 + do i = i1, i2 + if(cossza(i,j) .gt. 0.) tday(i,j) = tday(i,j) + cdt + end do + end do + end do + +! Find the cos(sza) now for use in scaling OH and NO3 + call szangle(jday,xHour,lonRad,latRad,sza,cossza,i1,i2,j1,j2) + + tnight(i1:i2,j1:j2) = (86400.-tday(i1:i2,j1:j2)) + + DO k=1,km + WHERE(tcosz(i1:i2,j1:j2) > 0) + xoh(i1:i2,j1:j2,k) = oh_clim(i1:i2,j1:j2,k)*(86400./cdt)*cossza(i1:i2,j1:j2) / tcosz(i1:i2,j1:j2) + ELSEWHERE + xoh(i1:i2,j1:j2,k) = 0.00 + END WHERE + END DO + WHERE(xoh(i1:i2,j1:j2,1:km) < 0.00) xoh(i1:i2,j1:j2,1:km) = 0.00 + endif +! To go from volume mixing ratio to # cm-3 (expected in chemistry) +! include the following line + xoh = xoh * 1000.*rhoa / airMolWght * nAvogadro * 1.e-6 + +! NO3 + IF(.NOT. using_GMI_NO3) THEN + xno3 = no3_clim + cossza(:,:) = 0. + call szangle(jday,xHour,lonRad,latRad,sza,cossza,i1,i2,j1,j2) + +! If there is daylight then no3 is small (assume zero) and the +! average is distributed only over the night time portion + + DO k=1,km + WHERE(cossza(i1:i2,j1:j2) > 0 .OR. tnight(i1:i2,j1:j2) < tiny(1.0)) + xno3(i1:i2,j1:j2,k) = 0.00 + ELSEWHERE + xno3(i1:i2,j1:j2,k) = no3_clim(i1:i2,j1:j2,k) * 86400./ tnight(i1:i2,j1:j2) + END WHERE + END DO + END IF + +! If doing GMI, grab oxidants from GMICHEM if the pointers were found. +! Note: OH units must be cm^{-3}. +! -------------------------------------------------------------------- + IF( using_GMI_NO3) THEN + xno3(i1:i2,j1:j2,1:km) = GMI_NO3mr(i1:i2,j1:j2,1:km) + WHERE(xno3(i1:i2,j1:j2,1:km) < 0.00) xno3(i1:i2,j1:j2,1:km) = 0.00 + END IF + + IF(using_GMI_H2O2) THEN + xh2o2(i1:i2,j1:j2,1:km) = GMI_H2O2mr(i1:i2,j1:j2,1:km) + WHERE(xh2o2(i1:i2,j1:j2,1:km) < 0.00) xh2o2(i1:i2,j1:j2,1:km) = 0.00 + END IF + + IF( using_GMI_OH) THEN + qmax = 17.01/airMolWght + xoh(i1:i2,j1:j2,1:km) = GMI_OHmr(i1:i2,j1:j2,1:km)* & + nAvogadro / airMolWght * 1000.* & + rhoa(i1:i2,j1:j2,1:km)*1.00E-06 + WHERE(xoh(i1:i2,j1:j2,1:km) < 0.00) xoh(i1:i2,j1:j2,1:km) = 0.00 + END IF + + + + + end subroutine SulfateUpdateOxidants + + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SulfateUpdateEmissions - Update Sulfate Emissions +! We have emissions from 4 sources, which are distributed +! differently in the vertical +! 1) biomass burning - uniformly mixed in PBL (SO2) +! 2) anthropogenic l1 - emitted into lowest 100 m (SO2,SO4) +! 3) anthropogenic l2 - emitted into 100 - 500 m levels (SO2,SO4) +! 4) volcanic emissions +! Additionally have a source of DMS from transfer from seawater +! into lowest model layer +! Consider factors in conversion: we estimate that 5% of sulfur +! from anthropogenic sources (by mass) goes directly to SO4. +! +! !INTERFACE: + subroutine SulfateUpdateEmissions ( impChem, iName, i1, i2, im, j1, j2, jm, km, cdt, & + nymd_current, nhms_current, & + grid, lonRad, latRad, & + nymd_last, & + diurnal_bb, & + so2biomass_src, so2biomass_src_, & + so2anthro_l1_src, & + so2anthro_l2_src, & + so2ship_src, & + so4ship_src, & + dmso_conc, & + aircraft_fuel_src, & + aviation_lto_src, & + aviation_cds_src, & + aviation_crs_src, & + volcano_srcfilen, & + nvolc, vLat, vLon, vElev, vCloud, vSO2, vStart, vEnd, & + doing_NEI, nei_hour, nei_year, nei_srcfilen, & + nei_lon, nei_lat, lons, lats, & + maskString, gridMask, & + rc) + +! +! Input + type(ESMF_State), intent(inout) :: impChem + character(len=*), intent(in ) :: iName + integer :: i1, i2, im, j1, j2, jm, km + real :: cdt + integer :: nymd_current, & ! current model NYMD + nhms_current, & ! current model NHMS + nymd_last ! NYMD of last emission update + logical :: diurnal_bb + type(ESMF_Grid) :: grid + real, pointer, dimension(:,:) :: lonRad, latRad + + character(len=*) :: volcano_srcfilen + + real, pointer, dimension(:,:) :: so2biomass_src, & + so2biomass_src_, & + so2anthro_l1_src, & + so2anthro_l2_src, & + so2ship_src, & + so4ship_src, & + dmso_conc + + real, pointer, dimension(:,:,:) :: aircraft_fuel_src + real, pointer, dimension(:) :: vLat, vLon, vElev, vCloud, vSO2 + integer, pointer, dimension(:) :: vStart, vEnd + real, pointer, dimension(:) :: vLatE => null(), & + vLonE => null(), & + vElevE => null(), & + vCloudE => null(), & + vSO2E => null() + + real, pointer, dimension(:) :: vLatC => null(), & + vLonC => null(), & + vElevC => null(), & + vCloudC => null(), & + vSO2C => null() + + integer :: nVolc, nVolcE, nVolcC + logical :: useVolcanicDailyTables = .false. + +! Input parameters for NEI08 handling +! Note: these should are being defined as optional until the CARMA API is updated. + logical, intent(in), optional :: doing_NEI + integer, intent(inout), optional :: nei_hour, nei_year + character(len=*), intent(in), optional :: nei_srcfilen(2) + real, intent(in), optional :: nei_lon(2), nei_lat(2), lons(:,:), lats(:,:) + +! Emissions from aviation sector +! ------------------------------ + real, dimension(:,:), intent(inout) :: aviation_lto_src, & + aviation_cds_src, & + aviation_crs_src + + integer, intent(out) :: rc + +! Optional parameters to be passed for masking separate instances + character(len=*), OPTIONAL, intent(in) :: maskString !Delimited string of integers + real, OPTIONAL, intent(in) :: gridMask(i1:i2,j1:j2) !Grid mask (NOTE: No ghosting) + +! Local + integer :: ijl, ijkl + integer :: i, ios + real, pointer :: ptr2d(:,:) => null() + real, pointer :: ptr3d(:,:,:) => null() + integer :: status + +! Workspace for NEI emissions +! --------------------------- + real, pointer, dimension(:,:) :: nei_src1, nei_src2 + integer :: hour, year, nei_nymd +#ifdef DEBUG + real :: qmin, qmax +#endif + + + character(len=32) :: Iam + + _UNUSED_DUMMY(maskString) + _UNUSED_DUMMY(gridMask) + + Iam = 'SulfateUpdateEmissions' + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + +! Special handling of the volcanic sources, which are provided only in a table +! based format at the present time. The key string searched on here is +! "volcanic_". If present this refers to the daily tables. Anything else +! points to the data statement tables in this piece of Fortran code. The +! special case is "/dev/null" which is to run without volcanoes. + if(index(volcano_srcfilen,'volcanic_') .ne. 0) useVolcanicDailyTables = .true. + + +! Anthropogenic and ship emissions are now outside of UpdateEmiss loop to +! account for diurnal variability in HEMCO emissions (ckeller, 2/27/16) + +! Anthropogenic emissions +! ----------------------- + call MAPL_GetPointer(impChem,ptr2d,"SU_ANTHROL1"//trim(iName),rc=status) + VERIFY_(STATUS) + so2anthro_l1_src = ptr2d + + call MAPL_GetPointer(impChem,ptr2d,"SU_ANTHROL2"//trim(iName),rc=status) + VERIFY_(STATUS) + so2anthro_l2_src = ptr2d + +! Ship based emissions of SO2 and SO4 +! ----------------------------------- + call MAPL_GetPointer(impChem,ptr2d,"SU_SHIPSO2"//trim(iName),rc=status) + VERIFY_(STATUS) + so2ship_src = ptr2d + + call MAPL_GetPointer(impChem,ptr2d,"SU_SHIPSO4"//trim(iName),rc=status) + VERIFY_(STATUS) + so4ship_src = ptr2d + +! Update emissions/production if necessary (daily) +! ----------------------------------------------- +if(mapl_am_i_root()) print*,'SU nymd_last = ', nymd_last +if(mapl_am_i_root()) print*,'SU nymd_current = ', nymd_current + + UpdateEmiss: if(nymd_last .ne. nymd_current) then + nymd_last = nymd_current + +if(mapl_am_i_root()) print*,'SU inside UpdateEmiss' + +! Biomass Burning -- select on known inventories +! ---------------------------------------------- + call MAPL_GetPointer(impChem,ptr2d,"SU_BIOMASS"//trim(iName),rc=status) + so2biomass_src = ptr2d + +! Save read in emissions if doing diurnal BB +! ------------------------------------------ + if ( diurnal_bb ) then + so2biomass_src_(:,:) = so2biomass_src(:,:) + end if + +! DMS concentrations (from climatology) +! ------------------------------------- + call MAPL_GetPointer(impChem,ptr2d,"SU_DMSO"//trim(iName),rc=status) + VERIFY_(STATUS) + dmso_conc = ptr2d + +! Aircraft fuel source +! -------------------- + call MAPL_GetPointer(impChem,ptr3d,"SU_AIRCRAFT"//trim(iName),rc=status) + VERIFY_(STATUS) + aircraft_fuel_src = ptr3d + +! Aviation-LTO emissions +! ---------------------- + call MAPL_GetPointer(impChem,ptr2d,'SU_AVIATION_LTO'//iNAME,rc=status) + VERIFY_(STATUS) + aviation_lto_src = ptr2d + + call MAPL_GetPointer(impChem,ptr2d,'SU_AVIATION_CDS'//iNAME,rc=status) + VERIFY_(STATUS) + aviation_cds_src = ptr2d + + call MAPL_GetPointer(impChem,ptr2d,'SU_AVIATION_CRS'//iNAME,rc=status) + VERIFY_(STATUS) + aviation_crs_src = ptr2d + +! As a safety check, where values are undefined set to 0 + where(1.01*so2biomass_src(i1:i2,j1:j2) > undefval) so2biomass_src(i1:i2,j1:j2) = 0. + where(1.01*dmso_conc(i1:i2,j1:j2) > undefval) dmso_conc(i1:i2,j1:j2) = 0. + where(1.01*so2anthro_l1_src(i1:i2,j1:j2) > undefval) so2anthro_l1_src(i1:i2,j1:j2) = 0. + where(1.01*so2anthro_l2_src(i1:i2,j1:j2) > undefval) so2anthro_l2_src(i1:i2,j1:j2) = 0. + where(1.01*so2ship_src(i1:i2,j1:j2) > undefval) so2ship_src(i1:i2,j1:j2) = 0. + where(1.01*so4ship_src(i1:i2,j1:j2) > undefval) so4ship_src(i1:i2,j1:j2) = 0. + where(1.01*aircraft_fuel_src(i1:i2,j1:j2,1:km) > undefval ) & + aircraft_fuel_src(i1:i2,j1:j2,1:km) = 0. + where(1.01*aviation_lto_src(i1:i2,j1:j2) > undefval ) aviation_lto_src(i1:i2,j1:j2) = 0. + where(1.01*aviation_cds_src(i1:i2,j1:j2) > undefval ) aviation_cds_src(i1:i2,j1:j2) = 0. + where(1.01*aviation_crs_src(i1:i2,j1:j2) > undefval ) aviation_crs_src(i1:i2,j1:j2) = 0. + +#ifdef DEBUG + call pmaxmin('SU: so2biomass_src ', so2biomass_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: so2anthro_l1_src', so2anthro_l1_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: so2anthro_l2_src', so2anthro_l2_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: so2ship_src ', so2ship_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: so4ship_src ', so4ship_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: DMSO_conc ', dmso_conc, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: fuel ', aircraft_fuel_src, qmin, qmax, ijl,km, 1. ) + call pmaxmin('SU: so2_aviation_lto', aviation_lto_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: so2_aviation_cds', aviation_cds_src, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SU: so2_aviation_crs', aviation_crs_src, qmin, qmax, ijl,1, 1. ) +#endif + +! Volcanic emissions +! ------------------ +! Two possible sources of volcanic emissions +! 1) daily tables referenced as external text files +! 2) contained inventory of explosive and non-explosive +! volcanoes +! What is provided at this point is the number of +! volcanoes, their locations, elevations, and SO2 emissions. +! Added some additional variables "vStart" and "vEnd" which +! for now are the start and end time of the eruption. For hard +! wired data tables the emissions are assumed to hold over entire +! day. With "useVolcanicDailyTables" there are optionally two +! columns in each line of table that provide start and end hour +! of event. In all cases we are assuming the value of vSO2 is +! kg SO2 s-1 over the *duration of the event*. The duration is +! 24 hours unless otherwise specified. So when updating the daily +! tables put in numbers accordingly. + + if( useVolcanicDailyTables ) then + call GetVolcDailyTables( nymd_current, volcano_srcfilen, & + nVolc, vLat, vLon, vElev, vCloud, vSO2, vStart, vEnd ) +! Read from the previous inventory of non-explosive volcanoes +! Special handling to partition is possible (and /dev/null handling) + else + if(volcano_srcfilen(1:4) == 'cont') then + call GetVolcContinuous( nVolcC, vLatC, vLonC, vElevC, vCloudC, vSO2C ) + nVolcE=0 + else if(volcano_srcfilen(1:4) == 'expl') then + call GetVolcExplosive( nymd_current, nVolcE, vLatE, vLonE, vElevE, vCloudE, vSO2E ) + nVolcC=0 + else + call GetVolcExplosive( nymd_current, nVolcE, vLatE, vLonE, vElevE, vCloudE, vSO2E ) + call GetVolcContinuous( nVolcC, vLatC, vLonC, vElevC, vCloudC, vSO2C ) + endif + +! combine the two data sets +! If previous instance of volcano point data tables exist, deallocate it +! to get the correct number of elements + if(associated(vLat)) deallocate(vLat, stat=ios) + if(associated(vLon)) deallocate(vLon, stat=ios) + if(associated(vSO2)) deallocate(vSO2, stat=ios) + if(associated(vElev)) deallocate(vElev, stat=ios) + if(associated(vCloud)) deallocate(vCloud, stat=ios) + if(associated(vStart)) deallocate(vStart, stat=ios) + if(associated(vEnd)) deallocate(vEnd, stat=ios) + +! Allocate space for the volcanoes + nVolc = nVolcE + nVolcC + allocate(vLat(nvolc), vLon(nvolc), & + vSO2(nvolc), vElev(nvolc), & + vCloud(nvolc), vStart(nvolc), vEnd(nvolc), & + stat=ios) + if(nVolc > 0) then + if(nVolcE > 0) then + do i = 1, nVolcE + vLat(i) = vLatE(i) + vLon(i) = vLonE(i) + vElev(i) = vElevE(i) + vCloud(i) = vCloudE(i) + vSO2(i) = vSO2E(i) + end do + end if + if(nVolcC > 0) then + do i = 1, nVolcC + vLat(i+nVolcE) = vLatC(i) + vLon(i+nVolcE) = vLonC(i) + vElev(i+nVolcE) = vElevC(i) + vCloud(i+nVolcE) = vCloudC(i) + vSO2(i+nVolcE) = vSO2C(i) + end do + end if + endif + +! For these tables vStart and vEnd are not provided, so we assume +! eruption is throughout day and set to default values + vStart = -1 + vEnd = -1 + +! Clean Up + if(associated(vLatC)) deallocate(vLatC, stat=ios) + if(associated(vLonC)) deallocate(vLonC, stat=ios) + if(associated(vSO2C)) deallocate(vSO2C, stat=ios) + if(associated(vElevC)) deallocate(vElevC, stat=ios) + if(associated(vCloudC)) deallocate(vCloudC, stat=ios) + if(associated(vLatE)) deallocate(vLatE, stat=ios) + if(associated(vLonE)) deallocate(vLonE, stat=ios) + if(associated(vSO2E)) deallocate(vSO2E, stat=ios) + if(associated(vElevE)) deallocate(vElevE, stat=ios) + if(associated(vCloudE)) deallocate(vCloudE, stat=ios) +! Special possible case + if(volcano_srcfilen(1:9) == '/dev/null') nvolc = 0 + endif + +! For volcanos, check value of vStart and vEnd. Set to be +! vStart = 000000 if default (=-1) is provided +! vEnd = 240000 if default (=-1) is provided + where(vStart < 0) vStart = 000000 + where(vEnd < 0) vEnd = 240000 + + + endif UpdateEmiss + +! Apply dirunal emissions to BB +! ------------------------------------------ + if ( diurnal_bb ) then + call Chem_BiomassDiurnal ( so2biomass_src, so2biomass_src_, & + lonRad*radToDeg, latRad*radToDeg, nhms_current, cdt ) +if(mapl_am_i_root()) print*,'SU inside sum(so2biomass_src) = ',sum(so2biomass_src) +if(mapl_am_i_root()) print*,'SU inside sum(so2biomass_src_) = ',sum(so2biomass_src_) + end if + +! Apply NEI emissions over North America if so desired +! ---------------------------------------------------- + if ( present(doing_nei) ) then + if (doing_NEI) then + + hour = nhms_current/10000 + year = nymd_current/10000 + + if ( hour /= nei_hour ) then + + allocate(nei_src1(i1:i2,j1:j2),nei_src2(i1:i2,j1:j2),stat=ios) + +! Handle SO2 +! ---------- + call MAPL_GetPointer(impChem,ptr2d,'SU_NEI_SRC1',rc=status) + VERIFY_(STATUS) + call MAPL_GetPointer(impChem,ptr2d,'SU_NEI_SRC2',rc=status) + VERIFY_(STATUS) + + WHERE ( (lons.ge.nei_lon(1)) .AND. & + (lons.le.nei_lon(2)) .AND. & + (lats.ge.nei_lat(1)) .AND. & + (lats.le.nei_lat(2)) ) + + so2anthro_l1_src = nei_src1 + so2anthro_l2_src = nei_src2 + + end where + +#ifdef DEBUG + call pmaxmin('SO2: nei_bot', nei_src1, qmin, qmax, ijl,1, 1. ) + call pmaxmin('SO2: nei_src', nei_src2, qmin, qmax, ijl,1, 1. ) +#endif + + nei_hour = hour ! only update NEI once hourly + deallocate(nei_src1,nei_src2) + + end if ! time to update NEI + + end if ! doing NEI + end if ! present(doing_nei) + + rc = 0 + + end subroutine SulfateUpdateEmissions + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: SulfateDistributeEmissions - Adds sulfate source emission for one timestep +! We have emissions from 4 sources, which are distributed +! differently in the vertical +! 1) biomass burning - uniformly mixed in PBL (SO2) +! 2) anthropogenic l1 - emitted into lowest 100 m (SO2,SO4) +! 3) anthropogenic l2 - emitted into 100 - 500 m levels (SO2,SO4) +! 4) volcanic emissions +! Additionally have a source of DMS from transfer from seawater +! into lowest model layer +! Consider factors in conversion: we estimate that 5% of sulfur +! from anthropogenic sources (by mass) goes directly to SO4. +! +! !INTERFACE: +! + + subroutine SulfateDistributeEmissions ( i1, i2, j1, j2, km, nbins, cdt, nymd, nhms, & + fSO4ant, eAircraftFuel, & + so2anthro_l1_src, so2anthro_l2_src, & + so2biomass_src, dmso_conc, & + so2ship_src, so4ship_src, & + aircraft_fuel_src, & + nvolc, vlat, vlon, velev, vcloud, & + vso2, vstart, vend, & + dms, so2, so4, & + oro, u10m, v10m, hsurf, hghte, pblh, & + tmpu, rhoa, delp, & + cell_area, grid, & + SU_emis, & + SU_SO4eman, SU_SO2eman, SU_SO2embb, & + SU_SO2emvn, SU_SO2emve, & + rc, maskString, gridMask, & + aviation_layers, & + aviation_lto_src, & + aviation_cds_src, & + aviation_crs_src) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: i1, i2, j1, j2, km, nbins, nvolc + integer, intent(in) :: nymd, nhms + real, intent(in) :: cdt, fSO4ant, eAircraftFuel + real, pointer, dimension(:,:) :: so2anthro_l1_src, so2anthro_l2_src, & + so2biomass_src, dmso_conc, & + so2ship_src, so4ship_src + real, pointer, dimension(:,:,:) :: aircraft_fuel_src + real, pointer, dimension(:,:) :: cell_area + type(ESMF_Grid), intent(inout) :: Grid ! ESMF Grid + real, pointer, dimension(:) :: vlat, vlon, velev, vcloud, vso2 + integer, pointer, dimension(:) :: vstart, vend + real, pointer, dimension(:,:) :: oro, u10m, v10m, pblh, hsurf + real, pointer, dimension(:,:,:) :: tmpu, rhoa, hghte, delp + +! !OUTPUT PARAMETERS: + + real, pointer, dimension(:,:,:) :: dms, so2, so4 + type(Chem_Array), intent(inout) :: SU_emis(nbins) ! SU emissions, kg/m2/s + type(Chem_Array), intent(inout) :: SU_SO4eman ! SO4 anthro emissions, kg/m2/s + type(Chem_Array), intent(inout) :: SU_SO2eman ! SO2 anthro emissions, kg/m2/s + type(Chem_Array), intent(inout) :: SU_SO2embb ! SO2 bioburn emissions, kg/m2/s + type(Chem_Array), intent(inout) :: SU_SO2emvn ! SO2 volcanic (non-explosive) emissions, kg/m2/s + type(Chem_Array), intent(inout) :: SU_SO2emve ! SO2 volcanic (explosive) emissions, kg/m2/s + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! Optional parameters to be passed for masking separate instances + character(len=*), OPTIONAL, intent(in) :: maskString !Delimited string of integers + real, OPTIONAL, intent(in) :: gridMask(i1:i2,j1:j2) !Grid mask (NOTE: No ghosting) + + real, optional, intent(in) :: aviation_layers(4) ! heights of LTO, CDS and CRS layers + real, optional, dimension(i1:i2,j1:j2), intent(in) :: aviation_lto_src ! SO2 Aviation-LTO + real, optional, dimension(i1:i2,j1:j2), intent(in) :: aviation_cds_src ! SO2 Aviation-CDS + real, optional, dimension(i1:i2,j1:j2), intent(in) :: aviation_crs_src ! SO2 Aviation-CRS + + character(len=*), parameter :: myname = 'SU_Emission' + +! !DESCRIPTION: Updates the SU concentration with emissions every timestep +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! Based on Ginoux +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k, n, ios + real :: p1, z1, dz, deltaz, deltap, f100, f500, fPblh + real :: sCO2, schmidt, w10m, akw, sst + real :: zpbl + + ! pressure at 100m, 500m, & PBLH + real, dimension(i1:i2,j1:j2) :: p100, p500, pPblh + real, dimension(i1:i2,j1:j2) :: p0, z0, ps + + + real, dimension(i1:i2,j1:j2) :: srcSO2 + real, dimension(i1:i2,j1:j2) :: srcSO4 + real, dimension(i1:i2,j1:j2) :: srcDMS + real, dimension(i1:i2,j1:j2) :: srcSO4anthro + real, dimension(i1:i2,j1:j2) :: srcSO2anthro + real, dimension(i1:i2,j1:j2) :: srcSO2bioburn + real, dimension(i1:i2,j1:j2) :: srcSO2volc + real, dimension(i1:i2,j1:j2) :: srcSO2volce + real, dimension(i1:i2,j1:j2) :: so2srcvolc + + integer :: it + real :: hup, hlow, dzvolc + real :: deltaSO2v, so2volcano + integer :: ijl, ijkl + +real :: deltaSO2v_sum + +! Handle masking of volcanic sources + logical :: doingMasking + INTEGER, ALLOCATABLE :: regionNumbers(:),flag(:) + INTEGER, ALLOCATABLE :: mask(:,:) + +! Indices for volcanic sources + integer :: iVolc(nvolc), jVolc(nvolc) + +! Aviation + real, dimension(i1:i2,j1:j2,km) :: emis_aviation + real, dimension(i1:i2,j1:j2,km) :: srcAviation + real :: z_lto_bot, z_lto_top + real :: z_cds_bot, z_cds_top + real :: z_crs_bot, z_crs_top +#ifdef DEBUG + real :: qmin, qmax +#endif + +!class (logger), pointer :: lgr +!lgr => logging%get_logger('volcanic_emissions') + + _UNUSED_DUMMY(nymd) + + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + ijkl = ijl * km + +! Initialize local variables +! -------------------------- + srcSO2 = 0.0 + srcSO4 = 0.0 + srcDMS = 0.0 + srcSO2volc = 0.0 + srcSO2volce = 0.0 + so2srcvolc = 0.0 + + do n = 1, nbins + if( associated(SU_emis(n)%data2d) ) SU_emis(n)%data2d(i1:i2,j1:j2) = 0.0 + end do + if( associated(SU_SO4eman%data2d)) SU_SO4eman%data2d(i1:i2,j1:j2) = 0.0 + if( associated(SU_SO2eman%data2d)) SU_SO2eman%data2d(i1:i2,j1:j2) = 0.0 + if( associated(SU_SO2embb%data2d)) SU_SO2embb%data2d(i1:i2,j1:j2) = 0.0 + if( associated(SU_SO2emvn%data2d)) SU_SO2emvn%data2d(i1:i2,j1:j2) = 0.0 + if( associated(SU_SO2emve%data2d)) SU_SO2emve%data2d(i1:i2,j1:j2) = 0.0 + +! Distribute aircraft emissions from LTO, CDS and CRS layers +! ---------------------------------------------------------- + z_lto_bot = max(1e-3, aviation_layers(1)) + z_lto_top = max(2e-3, aviation_layers(2)) + + z_cds_bot = max(2e-3, aviation_layers(2)) + z_cds_top = max(3e-3, aviation_layers(3)) + + z_crs_bot = max(3e-3, aviation_layers(3)) + z_crs_top = max(4e-3, aviation_layers(4)) + + emis_aviation = 0.0 + srcAviation = 0.0 + + call distribute_aviation_emissions(delp, rhoa, z_lto_bot, z_lto_top, aviation_lto_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(delp, rhoa, z_cds_bot, z_cds_top, aviation_cds_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(delp, rhoa, z_crs_bot, z_crs_top, aviation_crs_src, emis_aviation, i1, i2, j1, j2, km) + srcAviation = srcAviation + emis_aviation + +! Find the pressure of the 100m, 500m, and PBLH altitudes + ps = 0.0 + do k = 1, km + ps(i1:i2,j1:j2) = ps(i1:i2,j1:j2) + delp(i1:i2,j1:j2,k) + end do + p0 = ps + z0(i1:i2,j1:j2) = 0. + do k = km, 1, -1 + do j = j1, j2 + do i = i1, i2 + p1 = p0(i,j) - delp(i,j,k) + dz = delp(i,j,k)/rhoa(i,j,k)/grav + z1 = z0(i,j)+dz + if(z0(i,j) .lt. 100 .and. z1 .ge. 100.) then + deltaz = z1-100. + deltap = deltaz*rhoa(i,j,k)*grav + p100(i,j) = p1+deltap + endif + if(z0(i,j) .lt. 500 .and. z1 .ge. 500.) then + deltaz = z1-500. + deltap = deltaz*rhoa(i,j,k)*grav + p500(i,j) = p1+deltap + endif + zpbl = max ( pblh(i,j), 100. ) + if(z0(i,j) .lt. zpbl .and. z1 .ge. zpbl) then + deltaz = z1-zpbl + deltap = deltaz*rhoa(i,j,k)*grav + pPblh(i,j) = p1+deltap + endif + p0(i,j) = p1 + z0(i,j) = z1 + end do + end do + end do + +! Now update the tracer mixing ratios with the aerosol sources + p0 = ps + z0 = hsurf + do k = km, 1, -1 + + do j = j1, j2 + do i = i1, i2 + + p1 = p0(i,j) - delp(i,j,k) + f100 = 0. + if(p1 .ge. p100(i,j)) f100 = delp(i,j,k)/(ps(i,j)-p100(i,j)) + if(p1 .lt. p100(i,j) .and. p0(i,j) .ge. p100(i,j)) & + f100 = (p0(i,j)-p100(i,j))/(ps(i,j)-p100(i,j)) + + f500 = 0. + if(p0(i,j) .ge. p100(i,j) .and. p1 .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = (p100(i,j)-p1)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = delp(i,j,k)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .ge. p500(i,j) .and. p1 .lt. p500(i,j)) & + f500 = (p0(i,j)-p500(i,j))/(p100(i,j)-p500(i,j)) + + fPblh = 0. + if(p1 .ge. pPblh(i,j)) fPblh = delp(i,j,k)/(ps(i,j)-pPblh(i,j)) + if(p1 .lt. pPblh(i,j) .and. p0(i,j) .ge. pPblh(i,j)) & + fPblh = (p0(i,j)-pPblh(i,j))/(ps(i,j)-pPblh(i,j)) + +! All source from files specified in kg SO2 m-2 s-1 (unless filename +! indicates otherwise!). + srcSO4anthro(i,j) = fSO4ant * fMassSO4/fMassSO2 * & + ( f100 * so2anthro_l1_src(i,j) & + + f500 * so2anthro_l2_src(i,j) ) + srcSO2anthro(i,j) = (1.-fSO4ant) * & + ( f100 * so2anthro_l1_src(i,j) & + + f500 * so2anthro_l2_src(i,j) ) + + srcSO2bioburn(i,j) = fPblh*so2biomass_src(i,j) + +! Add the ship emissions to anthro + srcSO2anthro(i,j) = srcSO2anthro(i,j) + f100*so2ship_src(i,j) + srcSO4anthro(i,j) = srcSO4anthro(i,j) + f100*so4ship_src(i,j) + +! Add the aircraft fuel emissions to anthro SO2 + srcSO2anthro(i,j) = srcSO2anthro(i,j) + & + eAircraftFuel * aircraft_fuel_src(i,j,k) + + srcSO2anthro(i,j) = srcSO2anthro(i,j) + srcAviation(i,j,k) + + srcSO4(i,j) = srcSO4anthro(i,j) + srcSO2(i,j) = srcSO2anthro(i,j)+srcSO2bioburn(i,j) + + so2(i,j,k) = so2(i,j,k) + srcSO2(i,j)*cdt*grav/delp(i,j,k) + so4(i,j,k) = so4(i,j,k) + srcSO4(i,j)*cdt*grav/delp(i,j,k) + + p0(i,j) = p1 + + end do ! i + end do ! j + + if( associated(SU_emis(nSO2)%data2d) ) & + SU_emis(nSO2)%data2d = SU_emis(nSO2)%data2d + srcSO2 + if( associated(SU_emis(nSO4)%data2d) ) & + SU_emis(nSO4)%data2d = SU_emis(nSO4)%data2d + srcSO4 + if( associated(SU_SO4eman%data2d) ) & + SU_SO4eman%data2d = SU_SO4eman%data2d + srcSO4anthro + if( associated(SU_SO2eman%data2d) ) & + SU_SO2eman%data2d = SU_SO2eman%data2d + srcSO2anthro + if( associated(SU_SO2embb%data2d) ) & + SU_SO2embb%data2d = SU_SO2embb%data2d + srcSO2bioburn + +#ifdef DEBUG + if ( k >= km-1 ) then + call pmaxmin('SU: srcSO2 ', srcSO2 , qmin, qmax, ijl, 1, 1. ) + call pmaxmin('SU: srcSO4 ', srcSO4 , qmin, qmax, ijl, 1, 1. ) + call pmaxmin('SU: srcSO4anthro ', srcSO4anthro , qmin, qmax, ijl, 1, 1. ) + call pmaxmin('SU: srcSO2anthro ', srcSO2anthro , qmin, qmax, ijl, 1, 1. ) + call pmaxmin('SU: srcSO2bioburn ', srcSO2bioburn , qmin, qmax, ijl, 1, 1. ) + end if +#endif + + end do ! k + +! Create mask for volcanic emissions +! When masking, both the mask and the string +! of integers (region numbers) must be present +! -------------------------------------------- + IF ( (PRESENT(maskString) .AND. .NOT. PRESENT(gridMask)) .OR. & + (PRESENT(gridMask) .AND. .NOT. PRESENT(maskString)) ) & + CALL die ( myname, ": Both gridMask and maskString must be specified." ) + + IF(PRESENT(gridMask)) THEN + IF(TRIM(maskString) == "-1") THEN + doingMasking = .FALSE. + ELSE + doingMasking = .TRUE. + END IF + ELSE + doingMasking = .FALSE. + END IF + +! Masking initialization +! ---------------------- + SetMask: IF(doingMasking) THEN + + k = 32 + ALLOCATE(regionNumbers(k),flag(k),mask(i1:i2,j1:j2),STAT=ios) + IF ( ios /= 0 ) CALL die ( myname, ": Cannot allocate for masking.") + +! Obtain region numbers from delimited list of integers +! ----------------------------------------------------- + regionNumbers(:) = 0 + CALL Chem_UtilExtractIntegers(maskString,k,regionNumbers,RC=ios) + IF ( ios /= 0 ) CALL die ( myname, ": Unable to extract integers for regionNumbers.") + +! How many integers were found? +! ----------------------------- + flag(:) = 1 + WHERE(regionNumbers(:) == 0) flag(:) = 0 + k = SUM(flag) + DEALLOCATE(flag,STAT=ios) + IF ( ios /= 0 ) CALL die ( myname, ": Cannot dallocate flag.") + +! Set local mask to 1 where gridMask matches each integer (within precision!) +! --------------------------------------------------------------------------- + mask(i1:i2,j1:j2) = 0 + DO ios=1,k + WHERE(regionNumbers(ios)-0.01 <= gridMask .AND. & + gridMask <= regionNumbers(ios)+0.01) mask = 1 + END DO + + END IF SetMask + +! Add the volcanic source +! ----------------------- +! Note: the model lat and lon are wired in radians +! but the dx and dy are in degrees +! We add here the regional mask checking to exclude +! any points that are not wanted for a particular +! ensemble member calling this routine. + +! Point source volcanos (loop over each volcano) + srcSO2volc(:,:) = 0. + srcSO2volce(:,:) = 0. + z0 = hghte(:,:,km) + + if(nvolc > 0) then + + ! Get indices for volcanic emissions + ! ---------------------------------- + call MAPL_GetHorzIJIndex(nvolc,iVolc,jVolc,Grid=Grid,lon=vLon/radToDeg,lat=vLat/radToDeg,rc=rc) + + if ( rc /= 0 ) call die(myname,'cannot get indices for volcanic emissions') + +! Loop over all volcanoes in the database + do it = 1, nvolc + +deltaSO2v_sum = 0. + + i = iVolc(it) + j = jVolc(it) + +! Skip this volcano? +! ------------------ + if ( i<1 .OR. j<1 ) cycle ! volcano not in sub-domain +! if(doingMasking) then +! if( mask(i,j) == 0 ) cycle +! end if + +! Check time against time range of eruption +! ----------------------------------------- + if(nhms < vStart(it) .or. nhms >= vEnd(it)) cycle + + so2volcano = 0. + +! Emissions per volcano +! ------------------------------------------------------------------------------- + if(cell_area(i,j) .gt. 1.) then + so2volcano = vSO2(it) /cell_area(i,j) ! to kg SO2/sec/m2 + so2volcano = max(so2volcano,tiny(so2volcano)) + endif + +! Distribute in the vertical +! Database provides altitude of top of volcano cone (vElev) and altitude +! of plume top (vCloud). If vCloud != vElev then distribute emissions +! in top 1/3 of column extending from vElev to vCloud (case of explosive +! eruption), else put emissions in grid cell containing vElev (degassing) +! -------------------------- + hup = vCloud(it) + hlow = vElev(it) + if (hup .ne. hlow) then + hlow = hup - (hup-hlow)/3. + endif + +! Diagnostic - sum of volcanos +! ---------------------------- + if (hup .eq. hlow) then + srcSO2volc(i,j) = srcSO2volc(i,j) + so2volcano + else + srcSO2volce(i,j) = srcSO2volce(i,j) + so2volcano + endif + + dzvolc = hup-hlow + do k = km, 1, -1 + z1 = hghte(i,j,k-1) ! geopotential altitude at gridbox top + dz = z1-z0(i,j) ! thickness of gridbox + deltaSO2v = 0. + +! Volcano is above this level +! --------------------------- + if(z1 .lt. hlow) then + z0(i,j) = z1 + cycle + end if + +! Volcano is below this level (except at surface) +! ----------------------------------------------- + if(z0(i,j) .gt. hup .and. k .ne. km) then + z0(i,j) = z1 + cycle + end if + +! Volcano is in this level +! ------------------------ + if( (k .eq. km .and. z0(i,j) .gt. hup) .or. & ! below surface + (z0(i,j) .le. hlow .and. z1 .ge. hup) ) then ! in level + deltaSO2v = so2volcano + +! Volcano only partly in level ! Cell: +! ---------------------------- + else if (z0(i,j) .lt. hlow .and. z1 .lt. hup) then ! has bottom of cloud + deltaSO2v = (z1-hlow)/dzvolc*so2volcano + + else if (z0(i,j) .gt. hlow .and. z1 .gt. hup) then ! has top of cloud + deltaSO2v = (hup-z0(i,j))/dzvolc*so2volcano + + else ! is filled with cloud + deltaSO2v = dz/dzvolc*so2volcano + end if + + z0(i,j) = z1 + so2(i,j,k) = so2(i,j,k) + deltaSO2v*cdt*grav/delp(i,j,k) + +deltaSO2v_sum = deltaSO2v_sum + deltaSO2v + + end do ! k +!call lgr%debug('legacy emissions at %g0 %g0 : %g25.17', vLat(it), vLon(it), deltaSO2v_sum) + + enddo ! it + + endif + + +!if(mapl_am_i_root()) print*,'SU deltaSO2v_sum = ',deltaSO2v_sum + +! Diagnostics -- this is really the point defined volcanos + if(associated(SU_SO2emve%data2d)) then + SU_SO2emve%data2d = srcSO2volce + endif + if(associated(SU_SO2emvn%data2d)) then + SU_SO2emvn%data2d = srcSO2volc +if(mapl_am_i_root()) print*,'SU inside sum(SO2EMVN) = ',sum(SU_SO2emvn%data2d) + endif + if( associated(SU_emis(nSO2)%data2d) ) & + SU_emis(nSO2)%data2d = SU_emis(nSO2)%data2d + srcSO2volc + srcSO2volce + +! Clean up volcano masking function + IF(doingMasking) THEN + DEALLOCATE(regionNumbers, mask, STAT=ios) + IF ( ios /= 0 ) CALL die ( myname, ': Cannot deallocate masking tape.') + END IF + +#ifdef DEBUG + call pmaxmin('SU: srcSO2volcExp ', srcSO2volc , qmin, qmax, ijl, 1, 1. ) +#endif + +! Add in the DMS source +! --------------------- +! DMS emissions go into the lowest model layer only +! The transfer of DMS from the ocean surface to the atmosphere is +! a function of surface temperature and wind speed. +! For now we use the lowest atmospheric temperature (really want SST) +! and the 10-m wind speed. +! This code follows from GOCART with the following notes: +! :the Schmidt number for CO2 is assumed to be 600 +! :the Schmidt number of DMSo follows Saltzman et al., 1993 +! :the Schmidt number dependence breaks for high SST +! :following www.knmi.nl/~velthove/TM/input we introduce a maximum +! temperature of 28 C for the calculation +! :the w10m dependence is from Liss and Merlivat (1986) +! All this needs some thorough checking! + k = km + sCO2 = 600. + do j = j1, j2 + do i = i1, i2 + sst = tmpu(i,j,k)-273.15 + if(sst .gt. 28.) sst = 28. +! only valid for ocean and warm enough temperatures + if( (oro(i,j) /= OCEAN) .or. (sst .lt. -20.)) cycle + schmidt = 2764.0 - 147.12*sst + 3.726*(sst**2.) - 0.038*(sst**3.) +! w10m is the 10-m wind speed in m s-1 + w10m = sqrt(u10m(i,j)**2. + v10m(i,j)**2.) + if(w10m .le. 3.6) then + akw = 0.17*w10m*((sCO2/schmidt)**0.667) + else if (w10m .le. 13.) then + akw = (2.85*w10m - 9.65)*sqrt(sCO2/schmidt) + else + akw = (5.90*w10m - 49.3)*sqrt(sCO2/schmidt) + endif +! This parameterization has put akw in units cm hr-1 -> goto m s-1 + akw = akw/100./3600. +! DMSo concentration is nMol/L +! Want to put the source into units of kg m-2 s-1 + srcDMS(i,j) = akw * (fmassDMS/1000.)*(dmso_conc(i,j)*1.e-9/1.e-3) + dms(i,j,k) = dms(i,j,k) + srcDMS(i,j)*cdt*grav/delp(i,j,k) + end do + end do + + if( associated(SU_emis(nDMS)%data2d) ) SU_emis(nDMS)%data2d = srcDMS + +#ifdef DEBUG + call pmaxmin('SU: srcDMS ', srcDMS , qmin, qmax, ijl, 1, 1. ) +#endif + + rc = 0 + +contains + subroutine distribute_aviation_emissions(delp, rhoa, z_bot, z_top, emissions_layer, emissions, i1, i2, j1, j2, km) + + implicit none + + integer, intent(in) :: i1, i2, j1, j2, km + + real, dimension(:,:,:), intent(in) :: delp + real, dimension(:,:,:), intent(in) :: rhoa + real, dimension(:,:), intent(in) :: emissions_layer + real, intent(in) :: z_bot + real, intent(in) :: z_top + real, dimension(:,:,:), intent(out):: emissions + +! local + integer :: i, j, k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ + + do j = j1, j2 + do i = i1, i2 + ! find level height + z = 0.0 + z_= 0.0 + + do k = km, 1, -1 + dz(k) = delp(i,j,k)/rhoa(i,j,k)/grav + z_ = z_ + dz(k) + z(k) = z_ + end do + + ! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + + ! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + + ! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot .eq. k_top) then + w_(k_bot) = z_top - z_bot + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + + ! distribute emissions in the vertical + emissions(i,j,:) = (w_ / sum(w_)) * emissions_layer(i,j) + end do + end do + + end subroutine distribute_aviation_emissions + + end subroutine SulfateDistributeEmissions + + +!------------------------------------------------------------------------- +! NASA/GSFC +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: GetVolcDailyTables - Get pointwise SO2 and altitude of volcanoes +! from a daily file data base + +! +! !INTERFACE: +! + + subroutine GetVolcDailyTables( nymd, volcnon_srcfilen, & + nVolcPts, vLat, vLon, vElev, vCloud, vSO2, vStart, vEnd ) + +! !USES: + + implicit NONE + +! Data for volcanic emissions comes from the daily inventory of all +! volcanos (as represented by the text tables). We return all the +! volcanic emissions (as points, per volcano). + + integer, intent(in) :: nymd + character(len=255) :: volcnon_srcfilen + integer :: nVolcPts + real, pointer, dimension(:) :: vLat, vLon, vElev, vCloud, vSO2 + integer, pointer, dimension(:) :: vStart, vEnd + integer :: i, j, nLines, nCols, rc, STATUS, nymd1, nhms1, ios + character(len=255) :: fname + type(ESMF_Config) :: cf + real, pointer, dimension(:) :: vData + +! If previous instance of volcano point data tables exist, deallocate it +! to get the correct number of elements + if(associated(vLat)) deallocate(vLat, stat=ios) + if(associated(vLon)) deallocate(vLon, stat=ios) + if(associated(vSO2)) deallocate(vSO2, stat=ios) + if(associated(vElev)) deallocate(vElev, stat=ios) + if(associated(vCloud)) deallocate(vCloud, stat=ios) + if(associated(vStart)) deallocate(vStart, stat=ios) + if(associated(vEnd)) deallocate(vEnd, stat=ios) + +! Daily files (e.g., from AEROCOM) +! -------------------------------- +! Note: Volcanic emissions in these files are in mass of Sulfur + nymd1 = nymd + nhms1 = 120000 + call StrTemplate ( fname, volcnon_srcfilen, xid='unknown', & + nymd=nymd1, nhms=nhms1 ) + cf = ESMF_ConfigCreate() + call ESMF_ConfigLoadFile(cf, fileName=trim(fname), rc=STATUS ) + call ESMF_ConfigGetDim(cf, nLines, nCols, LABEL='volcano::', rc=STATUS ) + nVolcPts = nLines + allocate(vData(nCols), vLat(nLines), vLon(nLines), & + vSO2(nLines), vElev(nLines), vStart(nLines), & + vEnd(nLines), vCloud(nLines), stat=ios) + vStart = -1 + vEnd = -1 + call ESMF_ConfigFindLabel(cf, 'volcano::',rc=STATUS) + do i = 1, nLines + call ESMF_ConfigNextLine(cf, rc=rc) + do j = 1, nCols + call ESMF_ConfigGetAttribute(cf, vData(j), default=-1.) + end do + vLat(i) = vData(1) + vLon(i) = vData(2) + vSO2(i) = vData(3) * fMassSO2 / fMassSulfur + vElev(i) = vData(4) + vCloud(i) = vData(5) + if(nCols >= 6) vStart(i) = vData(6) + if(nCols >= 7) vEnd(i) = vData(7) + end do + + call ESMF_ConfigDestroy(cf) + deallocate(vData, stat=ios) + + end subroutine GetVolcDailyTables + +!------------------------------------------------------------------------- +! NASA/GSFC +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: GetVolcExplosive - Get pointwise SO2 and altitude of explosive +! volcanos from a data base + +! +! !INTERFACE: +! + + subroutine GetVolcExplosive( nymd, nVolcExp, & + vLatP, vLonP, vElevP, vCloudP, vSO2P ) + +! !USES: + + implicit NONE + +! Description +! Data for volcanic explosions provided by Thomas Diehl. I have converted +! from kt SO2 event-1 to kt SO2 day-1 in the data table. Following that I +! convert to kg SO2 s-1 needed in emissions. Assumption is uniform +! injection over 24 hour period. +! What is returned is the number of volcanoes and an array of locations, +! elevations, and SO2 amounts. + + integer :: nymd + real, pointer, dimension(:) :: vLatP, vLonP, vElevP, vCloudP, vSO2P + integer :: it, nv, ios, nVolcExp + +! database parameters and data + integer, parameter :: nvolc = 349 + integer :: startday(nvolc), endday(nvolc) + real :: so2exp(nvolc), vlon(nvolc), vlat(nvolc), & + velev(nvolc), celev(nvolc) + +! If previous instance of volcano point data tables exist, deallocate it +! to get the correct number of elements + if(associated(vLatP)) deallocate(vLatP, stat=ios) + if(associated(vLonP)) deallocate(vLonP, stat=ios) + if(associated(vSO2P)) deallocate(vSO2P, stat=ios) + if(associated(vElevP)) deallocate(vElevP, stat=ios) + if(associated(vCloudP)) deallocate(vCloudP, stat=ios) + + data startday / & + 20051231, 20051231, 20051231, 20061231, 20001015, 20061231, & + 20000301, 20021019, 20010717, 20061231, 20010905, 20001220, & + 20050619, 20061231, 20020615, 19990815, 20000425, 20010525, & + 19990815, 19991109, 19990719, 20000315, 20001214, 19990915, & + 19990224, 19990815, 19990712, 19990225, 19990418, 19990915, & + 20031028, 20000615, 19990329, 19990402, 19990701, 19990417, & + 19990412, 19990915, 19990421, 19990527, 19990915, 20000615, & + 19990514, 20001209, 20000415, 19990915, 19990630, 20000319, & + 19990628, 19991023, 19990720, 20010729, 19990807, 20061231, & + 19991115, 19991020, 19991116, 20010805, 20000302, 19991229, & + 20000315, 20000127, 20000210, 20000208, 20000214, 20000304, & + 20000224, 20000226, 20000229, 20000306, 20000905, 20000403, & + 20000326, 20000518, 20010915, 20001029, 20010818, 20030831, & + 20010215, 20000610, 20001030, 20000604, 20001113, 20000818, & + 20001018, 20001015, 20000831, 20001104, 20000721, 20000922, & + 20010705, 20010115, 20000820, 20000823, 20000827, 20000904, & + 20000910, 20001108, 20000926, 20061231, 20000930, 20001101, & + 20010721, 20010416, 20001129, 20001130, 20010115, 20001215, & + 20001218, 20001222, 20040705, 20010428, 20010808, 20021124, & + 20010429, 20010218, 20010302, 20010219, 20010219, 20010415, & + 20010405, 20010404, 20010605, 20010425, 20010429, 20031122, & + 20010501, 20010503, 20011209, 20020827, 20011003, 20010619, & + 20010707, 20010809, 20010915, 20010809, 20010730, 20030712, & + 20010806, 20061231, 20010828, 20011115, 20011019, 20011115, & + 20011005, 20061231, 20011031, 20061231, 20011126, 20020106, & + 20021026, 20061231, 20020116, 20020521, 20020116, 20020117, & + 20020203, 20020422, 20020515, 20020315, 20020609, 20040415, & + 20020715, 20021006, 20030409, 20021216, 20020617, 20020607, & + 20020825, 20021115, 20020725, 20020802, 20020815, 20020802, & + 20020915, 20020820, 20021103, 20021015, 20020925, 20020926, & + 20020929, 20040217, 20021106, 20021011, 20021207, 20021012, & + 20021026, 20021027, 20021030, 20021103, 20021103, 20021120, & + 20030128, 20021202, 20021112, 20021114, 20021219, 20021116, & + 20021118, 20021203, 20030110, 20021128, 20021228, 20030401, & + 20030101, 20040408, 20030228, 20030418, 20031015, 20030528, & + 20030723, 20031109, 20030514, 20030416, 20031010, 20030417, & + 20030703, 20030506, 20030510, 20030513, 20030523, 20030523, & + 20040325, 20030602, 20061231, 20040110, 20030901, 20030712, & + 20030608, 20030609, 20040614, 20030616, 20030723, 20030714, & + 20030715, 20031008, 20030801, 20031002, 20030915, 20030901, & + 20030904, 20030912, 20031115, 20031011, 20040328, 20031209, & + 20040114, 20050215, 20040127, 20040205, 20040214, 20040224, & + 20040915, 20040502, 20040925, 20050805, 20040414, 20050405, & + 20041008, 20041003, 20040528, 20050222, 20040517, 20040526, & + 20040607, 20040815, 20040912, 20040608, 20040609, 20040624, & + 20041024, 20040624, 20040916, 20040704, 20050207, 20050911, & + 20040730, 20040805, 20061231, 20040914, 20050315, 20040915, & + 20040915, 20041209, 20041005, 20061231, 20041212, 20061231, & + 20041110, 20041104, 20061231, 20041111, 20041115, 20041123, & + 20041125, 20041225, 20041126, 20041127, 20041219, 20041209, & + 20041213, 20041227, 20041220, 20050127, 20050214, 20061231, & + 20050407, 20061231, 20050525, 20050128, 20061231, 20050216, & + 20050331, 20050227, 20050225, 20050223, 20050407, 20050701, & + 20050406, 20050903, 20050718, 20050518, 20050414, 20061231, & + 20050418, 20061231, 20050718, 20050504, 20050529, 20061231, & + 20050616, 20051007, 20050815, 20051112, 20051104, 20050929, & + 20051001, 20051005, 20061231, 20051117, 20051030, 20061231, & + 20051208, 20061231, 20061231, 20051201, 20061231, 20051222, & + 20061231 & + / + data endday / & + 20051231, 20051231, 20051231, 20061231, 20001015, 20061231, & + 20000301, 20021019, 20010717, 20061231, 20010905, 20001220, & + 20050619, 20061231, 20020615, 19990815, 20000425, 20010525, & + 19990815, 19991109, 19990719, 20000315, 20001214, 19990915, & + 19990224, 19990815, 19990712, 19990225, 19990418, 19990915, & + 20031028, 20000615, 19990329, 19990402, 19990701, 19990417, & + 19990412, 19990915, 19990421, 19990527, 19990915, 20000615, & + 19990514, 20001209, 20000415, 19990915, 19990630, 20000319, & + 19990628, 19991023, 19990720, 20010729, 19990807, 20061231, & + 19991115, 19991020, 19991116, 20010805, 20000302, 19991229, & + 20000315, 20000127, 20000210, 20000208, 20000214, 20000304, & + 20000224, 20000226, 20000229, 20000306, 20000905, 20000403, & + 20000326, 20000518, 20010915, 20001029, 20010818, 20030831, & + 20010215, 20000610, 20001030, 20000604, 20001113, 20000818, & + 20001018, 20001015, 20000831, 20001104, 20000721, 20000922, & + 20010705, 20010115, 20000820, 20000823, 20000827, 20000904, & + 20000910, 20001108, 20000926, 20061231, 20000930, 20001101, & + 20010721, 20010416, 20001129, 20001130, 20010115, 20001215, & + 20001218, 20001222, 20040705, 20010428, 20010808, 20021124, & + 20010429, 20010218, 20010302, 20010219, 20010219, 20010415, & + 20010405, 20010404, 20010605, 20010425, 20010429, 20031122, & + 20010501, 20010503, 20011209, 20020827, 20011003, 20010619, & + 20010707, 20010809, 20010915, 20010809, 20010730, 20030712, & + 20010806, 20061231, 20010828, 20011115, 20011019, 20011115, & + 20011005, 20061231, 20011031, 20061231, 20011126, 20020106, & + 20021026, 20061231, 20020116, 20020521, 20020116, 20020117, & + 20020203, 20020422, 20020515, 20020315, 20020609, 20040415, & + 20020715, 20021006, 20030409, 20021216, 20020617, 20020607, & + 20020825, 20021115, 20020725, 20020802, 20020815, 20020802, & + 20020915, 20020820, 20021103, 20021015, 20020925, 20020926, & + 20020929, 20040217, 20021106, 20021011, 20021207, 20021012, & + 20021026, 20021027, 20021030, 20021103, 20021103, 20021120, & + 20030128, 20021202, 20021112, 20021114, 20021219, 20021116, & + 20021118, 20021203, 20030110, 20021128, 20021228, 20030401, & + 20030101, 20040408, 20030228, 20030418, 20031015, 20030528, & + 20030723, 20031109, 20030514, 20030416, 20031010, 20030417, & + 20030703, 20030506, 20030510, 20030513, 20030523, 20030523, & + 20040325, 20030602, 20061231, 20040110, 20030901, 20030712, & + 20030608, 20030609, 20040614, 20030616, 20030723, 20030714, & + 20030715, 20031008, 20030801, 20031002, 20030915, 20030901, & + 20030904, 20030912, 20031115, 20031011, 20040328, 20031209, & + 20040114, 20050215, 20040127, 20040205, 20040214, 20040224, & + 20040915, 20040502, 20040925, 20050805, 20040414, 20050405, & + 20041008, 20041003, 20040528, 20050222, 20040517, 20040526, & + 20040607, 20040815, 20040912, 20040608, 20040609, 20040624, & + 20041024, 20040624, 20040916, 20040704, 20050207, 20050911, & + 20040730, 20040805, 20061231, 20040914, 20050315, 20040915, & + 20040915, 20041209, 20041005, 20061231, 20041212, 20061231, & + 20041110, 20041104, 20061231, 20041111, 20041115, 20041123, & + 20041125, 20041225, 20041126, 20041127, 20041219, 20041209, & + 20041213, 20041227, 20041220, 20050127, 20050214, 20061231, & + 20050407, 20061231, 20050525, 20050128, 20061231, 20050216, & + 20050331, 20050227, 20050225, 20050223, 20050407, 20050701, & + 20050406, 20050903, 20050718, 20050518, 20050414, 20061231, & + 20050418, 20061231, 20050718, 20050504, 20050529, 20061231, & + 20050616, 20051007, 20050815, 20051112, 20051104, 20050929, & + 20051001, 20051005, 20061231, 20051117, 20051030, 20061231, & + 20051208, 20061231, 20061231, 20051201, 20061231, 20051222, & + 20061231 & + / + data so2exp / & + 0.004, 0.004, 0.008, 0.001, 0.011, 0.022, & + 0.031, 0.004, 0.044, 0.042, 0.008, 0.063, & + 0.001, 0.035, 0.001, 0.036, 0.177, 0.112, & + 0.047, 0.012, 0.038, 0.001, 0.041, 0.062, & + 0.044, 0.089, 0.108, 17.000, 1.513, 0.092, & + 0.068, 0.005, 30.952, 30.952, 0.183, 30.952, & + 1.700, 0.110, 21.000, 1.513, 0.016, 0.041, & + 190.000, 0.030, 0.051, 0.002, 0.141, 0.423, & + 2.250, 1.959, 16.000, 0.038, 5.667, 0.223, & + 0.006, 2.250, 3.000, 0.006, 0.022, 0.750, & + 0.279, 43.333, 43.333, 2.833, 9.167, 9.500, & + 17.000, 250.000, 250.000, 250.000, 0.628, 0.708, & + 1.308, 0.038, 0.032, 0.086, 0.036, 0.095, & + 2.434, 46.429, 0.015, 8.500, 1.319, 1.250, & + 0.155, 0.024, 0.362, 0.155, 8.500, 0.298, & + 0.007, 0.002, 11.500, 1.250, 0.375, 20.583, & + 0.225, 0.034, 1.250, 0.001, 17.143, 17.143, & + 0.008, 0.014, 0.354, 9.000, 0.354, 23.000, & + 0.041, 10.000, 0.089, 0.041, 0.540, 0.025, & + 1.065, 8.219, 28.000, 8.219, 17.000, 8.219, & + 11.017, 21.111, 0.315, 0.750, 4.000, 0.041, & + 15.000, 1.065, 0.011, 0.036, 0.002, 9.583, & + 7.037, 0.708, 0.039, 6.389, 33.000, 0.038, & + 3.000, 0.006, 17.000, 0.004, 0.078, 0.043, & + 2.250, 0.001, 2.250, 0.061, 2.250, 0.607, & + 0.007, 0.009, 15.833, 0.891, 2.250, 30.000, & + 10.556, 0.193, 0.177, 2.250, 0.274, 0.003, & + 0.258, 0.385, 0.053, 0.011, 0.118, 2.250, & + 0.236, 0.002, 12.264, 90.000, 0.125, 17.000, & + 12.264, 1.889, 0.230, 0.102, 120.000, 120.000, & + 120.000, 0.034, 8.387, 2.250, 0.039, 2.250, & + 1.211, 8.500, 10.000, 10.000, 10.000, 15.278, & + 1.211, 0.385, 0.436, 5.000, 0.436, 36.111, & + 36.111, 36.111, 8.696, 2.250, 5.000, 0.170, & + 1.700, 0.036, 0.385, 0.031, 0.070, 11.236, & + 0.016, 0.009, 0.288, 2.125, 0.094, 2.250, & + 0.221, 0.250, 1.797, 38.000, 1.797, 0.321, & + 0.007, 36.000, 0.385, 0.841, 0.179, 1.797, & + 12.778, 12.778, 0.108, 12.778, 0.061, 3.400, & + 33.333, 0.038, 16.429, 0.266, 0.125, 16.000, & + 0.095, 115.000, 0.005, 0.062, 0.015, 2.250, & + 2.250, 0.288, 2.125, 0.281, 0.750, 1.889, & + 0.080, 1.885, 0.083, 0.035, 5.667, 0.225, & + 0.096, 0.258, 52.581, 0.001, 1.125, 17.000, & + 52.581, 0.227, 0.022, 1.000, 30.000, 1.000, & + 0.136, 190.000, 0.224, 2.250, 0.556, 0.005, & + 20.000, 17.000, 0.003, 0.170, 0.012, 17.000, & + 100.000, 0.170, 3.400, 0.021, 1.620, 0.021, & + 0.751, 625.000, 0.022, 8.000, 0.450, 0.751, & + 55.000, 0.531, 0.751, 7.000, 0.751, 0.225, & + 15.000, 1.620, 40.000, 0.751, 0.405, 0.024, & + 0.218, 0.024, 0.140, 140.000, 0.751, 0.895, & + 0.279, 0.102, 4.444, 2.250, 0.083, 0.175, & + 70.000, 0.225, 0.173, 0.061, 2.250, 0.027, & + 5.667, 0.027, 0.187, 115.000, 38.235, 0.029, & + 2.250, 0.177, 0.708, 0.157, 0.038, 28.750, & + 115.000, 0.062, 0.088, 0.515, 277.778, 0.039, & + 7.667, 0.042, 1.625, 5.667, 0.006, 0.321, & + 0.006 & + / + data velev / & + 1185, 5230, 3676, 3794, 1330, 1222, & + 2552, 2968, 3350, 2960, 688, 1536, & + 1334, 3850, 2847, 704, 1413, 4784, & + 321, 1807, 915, 1023, 5426, 1325, & + 799, 813, 4835, 2882, 2857, 3800, & + 1784, 1717, 4095, 4095, 1703, 4095, & + 3283, 2891, 2857, 2857, 3428, 1745, & + 4317, 3763, 1061, 1018, 799, 2462, & + 2799, 2631, 915, 915, 728, 3283, & + 5023, 2334, 5023, 5023, 635, 1700, & + 704, 3058, 3058, 4835, 3058, 2631, & + 799, 1491, 1491, 1491, 321, 2891, & + 2882, 4276, 737, 5967, 1580, 1784, & + 2745, 4095, 813, 1807, 2631, 815, & + 2997, 3428, 2462, 2882, 5592, 4835, & + 2552, 990, 815, 815, 1952, 815, & + 2799, 1131, 815, 1750, 2334, 2334, & + 704, 851, 2329, 2329, 2329, 5426, & + 5426, 5426, 799, 5426, 2462, 815, & + 2334, 1730, 3058, 1730, 321, 1730, & + 3058, 2631, 2891, 635, 5426, 5426, & + 2334, 2334, 1745, 3800, 1325, 1413, & + 2631, 3350, 813, 2882, 915, 915, & + 5023, 5023, 2334, 990, 161, 2597, & + 2741, 1370, 2552, 1536, 4784, 2882, & + 3350, 3763, 2631, 1807, 2130, 3470, & + 3470, 1816, 1580, 833, 4835, 4784, & + 704, 3470, 1330, 1745, 2552, 4276, & + 3332, 990, 3058, 3058, 2799, 140, & + 3058, 394, 2334, 2507, 725, 725, & + 725, 688, 3470, 2462, 4784, 1703, & + 3350, 5592, 3350, 3350, 3350, 3562, & + 3350, 3470, 2665, 2665, 2665, 2631, & + 2631, 2631, 3562, 2435, 3470, 1580, & + 2882, 4835, 3470, 2568, 704, 3470, & + 2435, 3350, 2462, 3125, 2334, 4784, & + 1816, 990, 790, 790, 790, 1807, & + 2847, 790, 3470, 2631, 1703, 790, & + 1413, 1413, 2745, 1413, 1745, 1592, & + 915, 915, 2882, 1715, 3212, 1784, & + 1784, 1580, 635, 2462, 1807, 5592, & + 1592, 2882, 1330, 1703, 3350, 833, & + 2507, 915, 704, 1784, 2334, 790, & + 3332, 2631, 3058, 1325, 2857, 5426, & + 3058, 1320, 2462, 2329, 2329, 2329, & + 3800, 1230, 1703, 635, 4276, 2552, & + 2060, 2891, 2847, 2568, 3350, 1413, & + 2568, 2568, 3726, 2549, 1784, 799, & + 1807, 1725, 3562, 1807, 1061, 1807, & + 1807, 1330, 1807, 1807, 1807, 815, & + 1784, 1784, 1807, 1807, 2507, 5426, & + 4835, 688, 2435, 1807, 1807, 1156, & + 1413, 1703, 2631, 1533, 1816, 2334, & + 790, 790, 2597, 815, 1592, 915, & + 2361, 1330, 1784, 5592, 1476, 354, & + 2381, 1730, 3332, 1700, 2507, 1442, & + 2381, 990, 2631, 564, 1490, 1413, & + 2361, 4276, 1496, 2882, 1252, 3350, & + 1784 & + / + data celev / & + 9000, 9000, 9000, 6794, 9000, 1772, & + 9000, 5968, 9000, 3510, 3688, 9000, & + 1884, 9000, 3397, 3704, 9000, 9000, & + 3321, 9000, 9000, 1073, 9000, 4325, & + 1349, 3813, 7835, 5882, 9000, 6800, & + 9000, 2267, 7095, 7095, 4703, 7095, & + 6283, 5891, 9000, 9000, 3978, 4745, & + 4867, 6763, 4061, 1068, 1349, 9000, & + 3349, 3181, 9000, 9000, 3728, 18000, & + 8023, 2884, 8023, 8023, 1185, 2250, & + 3704, 6058, 6058, 7835, 6058, 3181, & + 3799, 9000, 9000, 9000, 9000, 5891, & + 5882, 4826, 3737, 8967, 4580, 9000, & + 5745, 7095, 1363, 4807, 3181, 9000, & + 5997, 3978, 5462, 5882, 8592, 7835, & + 3102, 1040, 9000, 9000, 2502, 9000, & + 3349, 1681, 9000, 2300, 18000, 18000, & + 1254, 1401, 5329, 5329, 5329, 9000, & + 9000, 9000, 9000, 9000, 9000, 3815, & + 9000, 18000, 6058, 18000, 3321, 18000, & + 6058, 3181, 5891, 1185, 9000, 9000, & + 9000, 9000, 2295, 6800, 1375, 9000, & + 3181, 6350, 1363, 9000, 9000, 9000, & + 8023, 8023, 5334, 1040, 711, 3147, & + 3291, 1920, 3102, 9000, 5334, 5882, & + 3900, 6763, 3181, 9000, 2680, 4020, & + 4020, 4816, 4580, 1383, 7835, 5334, & + 3704, 6470, 4330, 2295, 3102, 4826, & + 6332, 1040, 6058, 6058, 3349, 3140, & + 6058, 3394, 5334, 3057, 18000, 18000, & + 18000, 3688, 6470, 3012, 5334, 2253, & + 9000, 8592, 3900, 9000, 3900, 18000, & + 9000, 6470, 5665, 5665, 5665, 5631, & + 5631, 5631, 18000, 2985, 6470, 4580, & + 5882, 7835, 6470, 3118, 3704, 6470, & + 2985, 3900, 5462, 6125, 5334, 5334, & + 4816, 1040, 9000, 9000, 9000, 2357, & + 3397, 9000, 6470, 3181, 4703, 9000, & + 9000, 9000, 2795, 9000, 2295, 4592, & + 9000, 9000, 9000, 4715, 3762, 9000, & + 9000, 9000, 685, 2512, 2357, 6142, & + 2142, 9000, 4330, 2253, 3900, 3833, & + 5507, 9000, 3704, 4784, 5334, 9000, & + 6332, 2681, 6058, 1375, 3407, 8426, & + 6058, 4320, 3012, 5329, 5329, 5329, & + 6800, 1780, 4703, 1185, 9000, 3102, & + 2110, 5891, 3397, 5568, 3900, 4413, & + 5568, 5568, 6726, 5549, 9000, 3799, & + 18000, 9000, 6562, 18000, 1611, 18000, & + 18000, 4330, 18000, 18000, 18000, 1365, & + 9000, 9000, 18000, 18000, 5507, 8426, & + 7835, 3688, 5435, 18000, 18000, 4156, & + 4413, 2253, 2681, 2083, 2366, 5334, & + 9000, 9000, 5597, 1365, 2142, 3915, & + 5361, 4330, 4784, 9000, 4476, 3354, & + 2931, 4730, 6332, 4700, 3057, 9000, & + 9000, 1040, 2681, 3564, 9000, 4413, & + 9000, 7276, 4496, 5882, 1802, 3900, & + 2334 & + / + data vlon / & + 127.880, 281.659, 112.920, 167.170, 148.420, 204.708, & + 269.399, 110.442, 15.004, 35.902, 152.203, 159.430, & + 168.120, 256.380, 288.070, 130.308, 168.346, 281.402, & + 177.180, 145.061, 297.820, 332.680, 261.378, 127.642, & + 129.716, 105.423, 160.638, 160.587, 196.030, 101.264, & + 125.400, 115.375, 9.170, 9.170, 122.775, 9.170, & + 161.360, 100.473, 196.030, 196.030, 109.208, 272.996, & + 215.980, 269.120, 273.155, 123.590, 129.716, 123.685, & + 114.242, 55.713, 297.820, 297.820, 273.298, 161.360, & + 281.558, 151.330, 281.558, 281.558, 273.839, 274.378, & + 130.308, 29.200, 29.200, 160.638, 29.200, 55.713, & + 129.716, 340.300, 340.300, 340.300, 177.180, 100.473, & + 160.587, 282.630, 140.843, 288.150, 124.792, 124.725, & + 73.513, 9.170, 105.423, 145.061, 55.713, 139.529, & + 288.830, 109.208, 123.685, 160.587, 292.270, 160.638, & + 269.399, 333.550, 139.529, 139.529, 102.620, 139.529, & + 114.242, 140.681, 139.529, 155.195, 151.330, 151.330, & + 130.308, 165.800, 112.950, 112.950, 112.950, 261.378, & + 261.378, 261.378, 129.716, 261.378, 123.685, 139.529, & + 151.330, 190.056, 29.200, 190.056, 177.180, 190.056, & + 29.200, 55.713, 100.473, 273.839, 261.378, 261.378, & + 151.330, 151.330, 272.996, 101.264, 127.642, 168.346, & + 55.713, 15.004, 105.423, 160.587, 297.820, 297.820, & + 281.558, 281.558, 151.330, 333.550, 141.290, 100.679, & + 158.830, 333.670, 269.399, 159.430, 281.402, 160.587, & + 15.004, 269.120, 55.713, 145.061, 271.731, 29.250, & + 29.250, 155.458, 124.792, 168.370, 160.638, 281.402, & + 130.308, 29.250, 148.420, 272.996, 269.399, 282.630, & + 114.042, 333.550, 29.200, 29.200, 114.242, 148.121, & + 29.200, 140.306, 151.330, 200.620, 125.425, 125.425, & + 125.425, 152.203, 29.250, 123.685, 281.402, 122.775, & + 15.004, 292.270, 15.004, 15.004, 15.004, 282.344, & + 15.004, 29.250, 107.730, 107.730, 107.730, 55.713, & + 55.713, 55.713, 282.344, 123.132, 29.250, 124.792, & + 160.587, 160.638, 29.250, 138.526, 130.308, 29.250, & + 123.132, 15.004, 123.685, 288.271, 151.330, 281.402, & + 155.458, 333.550, 145.670, 145.670, 145.670, 145.061, & + 288.070, 145.670, 29.250, 55.713, 122.775, 145.670, & + 168.346, 168.346, 73.513, 168.346, 272.996, 131.106, & + 297.820, 297.820, 160.587, 127.325, 288.623, 124.725, & + 124.725, 124.792, 273.839, 123.685, 145.061, 292.270, & + 131.106, 160.587, 148.420, 122.450, 15.004, 168.370, & + 200.620, 297.820, 130.308, 125.400, 151.330, 145.670, & + 114.042, 55.713, 29.200, 127.642, 196.030, 261.378, & + 29.200, 125.500, 123.685, 112.950, 112.950, 112.950, & + 101.264, 37.750, 122.450, 273.839, 282.630, 269.399, & + 347.720, 100.473, 288.070, 138.526, 15.004, 168.346, & + 138.526, 138.526, 116.470, 237.820, 124.725, 129.716, & + 145.061, 342.670, 282.344, 145.061, 273.155, 145.061, & + 145.061, 148.420, 145.061, 145.061, 145.061, 139.529, & + 124.725, 124.725, 145.061, 145.061, 200.620, 261.378, & + 160.638, 152.203, 123.132, 145.061, 145.061, 156.020, & + 168.346, 122.450, 55.713, 185.846, 155.458, 151.330, & + 145.670, 145.670, 100.679, 139.529, 131.106, 297.820, & + 43.380, 148.420, 124.725, 292.270, 268.450, 93.858, & + 270.370, 190.056, 114.042, 274.378, 200.620, 40.480, & + 270.370, 333.550, 55.713, 150.030, 268.830, 168.346, & + 43.380, 282.630, 167.830, 160.587, 206.570, 15.004, & + 124.725 & + / + data vlat / & + 1.680, -2.002, -8.108, -77.530, -5.525, 19.425, & + 14.381, -7.542, 37.734, -2.751, -4.271, 54.050, & + -16.250, 19.514, -39.420, 30.789, -16.507, -0.171, & + -37.520, -4.100, 16.720, 38.730, 19.023, 1.475, & + 29.635, -6.102, 56.057, 55.978, 54.756, -1.814, & + 2.780, -8.242, 4.203, 4.203, -8.530, 4.203, & + 56.653, -0.381, 54.756, 54.756, -7.242, 12.702, & + 62.000, 14.473, 12.602, -8.540, 29.635, 13.257, & + -8.058, -21.229, 16.720, 16.720, 12.506, 56.653, & + -1.467, -5.050, -1.467, -1.467, 11.984, 11.538, & + 30.789, -1.408, -1.408, 56.057, -1.408, -21.229, & + 29.635, 63.980, 63.980, 63.980, -37.520, -0.381, & + 55.978, 1.220, 42.541, -15.780, 1.358, 1.108, & + -53.106, 4.203, -6.102, -4.100, -21.229, 34.079, & + -37.850, -7.242, 13.257, 55.978, -23.370, 56.057, & + 14.381, -57.780, 34.079, 34.079, -3.520, 34.079, & + -8.058, 42.061, 34.079, -6.140, -5.050, -5.050, & + 30.789, -10.380, -7.942, -7.942, -7.942, 19.023, & + 19.023, 19.023, 29.635, 19.023, 13.257, 34.079, & + -5.050, 52.825, -1.408, 52.825, -37.520, 52.825, & + -1.408, -21.229, -0.381, 11.984, 19.023, 19.023, & + -5.050, -5.050, 12.702, -1.814, 1.475, -16.507, & + -21.229, 37.734, -6.102, 55.978, 16.720, 16.720, & + -1.467, -1.467, -5.050, -57.780, 24.754, -0.978, & + 53.255, -58.420, 14.381, 54.050, -0.171, 55.978, & + 37.734, 14.473, -21.229, -4.100, 13.434, -1.520, & + -1.520, 50.325, 1.358, -16.680, 56.057, -0.171, & + 30.789, -1.520, -5.525, 12.702, 14.381, 1.220, & + -8.125, -57.780, -1.408, -1.408, -8.058, -5.520, & + -1.408, 30.480, -5.050, 56.170, 2.280, 2.280, & + 2.280, -4.271, -1.520, 13.257, -0.171, -8.530, & + 37.734, -23.370, 37.734, 37.734, 37.734, -0.077, & + 37.734, -1.520, -7.320, -7.320, -7.320, -21.229, & + -21.229, -21.229, -0.077, 10.412, -1.520, 1.358, & + 55.978, 56.057, -1.520, 36.403, 30.789, -1.520, & + 10.412, 37.734, 13.257, -38.692, -5.050, -0.171, & + 50.325, -57.780, 16.350, 16.350, 16.350, -4.100, & + -39.420, 16.350, -1.520, -21.229, -8.530, 16.350, & + -16.507, -16.507, -53.106, -16.507, 12.702, 32.881, & + 16.720, 16.720, 55.978, 0.800, -36.863, 1.108, & + 1.108, 1.358, 11.984, 13.257, -4.100, -23.370, & + 32.881, 55.978, -5.525, -8.670, 37.734, -16.680, & + 56.170, 16.720, 30.789, 2.780, -5.050, 16.350, & + -8.125, -21.229, -1.408, 1.475, 54.756, 19.023, & + -1.408, 3.670, 13.257, -7.942, -7.942, -7.942, & + -1.814, -46.900, -8.670, 11.984, 1.220, 14.381, & + -37.092, -0.381, -39.420, 36.403, 37.734, -16.507, & + 36.403, 36.403, -8.420, 46.200, 1.108, 29.635, & + -4.100, 64.420, -0.077, -4.100, 12.602, -4.100, & + -4.100, -5.525, -4.100, -4.100, -4.100, 34.079, & + 1.108, 1.108, -4.100, -4.100, 56.170, 19.023, & + 56.057, -4.271, 10.412, -4.100, -4.100, 50.680, & + -16.507, -8.670, -21.229, 52.381, 50.325, -5.050, & + 16.350, 16.350, -0.978, 34.079, 32.881, 16.720, & + -11.750, -5.525, 1.108, -23.370, -0.370, 12.278, & + 13.853, 52.825, -8.125, 11.538, 56.170, 12.600, & + 13.853, -57.780, -21.229, -5.450, -0.830, -16.507, & + -11.750, 1.220, -15.400, 55.978, 59.363, 37.734, & + 1.108 & + / + +! Reorient the longitudes for GEOS-5 + where(vlon > 180.) vlon = vlon-360. + +! Count the number of volcanoes on your given day + nv = 0 + do it = 1, nvolc + if(nymd .lt. startday(it) .or. nymd .gt. endday(it)) cycle + nv = nv + 1 + end do + +! Allocate space for the volcanoes + allocate(vLatP(nv), vLonP(nv), & + vSO2P(nv), vElevP(nv), & + vCloudP(nv), stat=ios) + +! Accumulate the volcanoes + nv = 0 + do it = 1, nvolc + if(nymd .lt. startday(it) .or. nymd .gt. endday(it)) cycle + nv = nv + 1 + vLatP(nv) = vlat(it) + vLonP(nv) = vlon(it) + vSO2P(nv) = so2exp(it) * 1.e6 / 86400. ! to kg SO2/sec + vElevP(nv) = velev(it) + vCloudP(nv) = celev(it) + enddo + + nVolcExp = nv + + end subroutine GetVolcExplosive + +!------------------------------------------------------------------------- +! NASA/GSFC +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: GetVolcContinuous - Get pointwise SO2 and altitude of +! continuous outgassing volcanos from +! a data base + +! +! !INTERFACE: +! + + subroutine GetVolcContinuous( nVolcC, & + vLatP, vLonP, vElevP, vCloudP, vSO2P ) + +! !USES: + + implicit NONE + +! Description +! Data for outgassing volcanos provided by Thomas Diehl. Data table is +! Mg SO2 day-1 and I convert to kg SO2 s-1 needed in emissions. Assumption +! is continuous emissions throughout day. +! What is returned is the number of volcanoes and an array of locations, +! elevations, and SO2 amounts. + + real, pointer, dimension(:) :: vLatP, vLonP, vElevP, vCloudP, vSO2P + integer :: it, ios, nVolcC + +! database parameters and data + integer, parameter :: nvolc = 47 + real :: vso2(nvolc), vlon(nvolc), vlat(nvolc), & + velev(nvolc), celev(nvolc) + +! If previous instance of volcano point data tables exist, deallocate it +! to get the correct number of elements + if(associated(vLatP)) deallocate(vLatP, stat=ios) + if(associated(vLonP)) deallocate(vLonP, stat=ios) + if(associated(vSO2P)) deallocate(vSO2P, stat=ios) + if(associated(vElevP)) deallocate(vElevP, stat=ios) + if(associated(vCloudP)) deallocate(vCloudP, stat=ios) + + data vso2 / & + 730, 44, 4000, 21, 16, & + 520, 920, 690, 480, 3300, & + 900, 75, 58, 140, 14, & + 370, 530, 570, 1900, 130, & + 76, 140, 370, 270, 56, & + 68, 3, 48, 22, 1027, & + 140, 230, 640, 510, 20, & + 20, 590, 84, 73, 790, & + 110, 500, 1900, 650, 2400, & + 3, 79 & + / + + data velev / & + 926, 500, 3350, 613, 2890, & + 321, 1807, 1330, 2334, 1750, & + 361, 2084, 3432, 2911, 2329, & + 1565, 2462, 717, 1117, 1359, & + 1592, 1788, 2560, 758, 731, & + 1124, 1860, 1252, 3053, 1222, & + 4100, 3772, 3763, 2552, 2365, & + 1950, 1745, 1010, 1258, 635, & + 1657, 2708, 5321, 4276, 5592, & + 1920, 3794 & + / + data celev / & + 926, 500, 3350, 613, 2890, & + 321, 1807, 1330, 2334, 1750, & + 361, 2084, 3432, 2911, 2329, & + 1565, 2462, 717, 1117, 1359, & + 1592, 1788, 2560, 758, 731, & + 1124, 1860, 1252, 3053, 1222, & + 4100, 3772, 3763, 2552, 2365, & + 1950, 1745, 1010, 1258, 635, & + 1657, 2708, 5321, 4276, 5592, & + 1920, 3794 & + / + data vlon / & + 15.2130, 14.9620, 15.0040, 40.6700, 35.9020, & + 177.1800, 145.0610, 148.4200, 151.3300, 155.1950, & + 169.4250, 107.6000, 109.2080, 110.4420, 112.9500, & + 124.0500, 123.6850, 130.3080, 130.6570, 130.2940, & + 131.1060, 131.2510, 138.5260, 139.3980, 140.8430, & + 148.8430, -155.3610, -153.4300, -153.0900, -155.2920, & + -103.6200, -91.5520, -90.8800, -90.6010, -89.6300, & + -89.6330, -87.0040, -86.8450, -86.5400, -86.1610, & + -84.7030, -84.2330, -75.3220, -77.3700, -67.7300, & + -16.7200, 167.1700 & + / + data vlat / & + 38.7890, 38.4040, 37.7340, 13.6000, -2.7510, & + -37.5200, -4.1000, -5.5250, -5.0500, -6.1400, & + -19.5200, -6.7700, -7.2420, -7.5420, -7.9420, & + 12.7700, 13.2570, 30.7890, 31.5850, 32.7570, & + 32.8810, 33.0830, 36.4030, 34.7210, 42.5410, & + 45.3870, 58.1720, 59.3630, 60.0320, 19.4250, & + 19.5140, 14.7560, 14.4730, 14.3810, 13.8530, & + 13.8130, 12.7020, 12.6020, 12.4220, 11.9840, & + 10.4630, 10.2000, 4.8950, 1.2200, -23.3700, & + 64.6500, -77.5300 & + / + +! Allocate space for the volcanoes + allocate(vLatP(nvolc), vLonP(nvolc), & + vSO2P(nvolc), vElevP(nvolc), & + vCloudP(nvolc), stat=ios) + +! Accumulate the volcanoes + do it = 1, nvolc + vLatP(it) = vlat(it) + vLonP(it) = vlon(it) + vSO2P(it) = vso2(it) * 1000. / 86400. ! to kg SO2/sec + vElevP(it) = velev(it) + vCloudP(it) = celev(it) + enddo + nVolcC = nvolc + + end subroutine GetVolcContinuous + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: idaynum -- given nymd compute the day number of the year +! +! Colarco, July 29, 2004 + + integer function idaynum (nymd) + integer :: nymd, yyyy, mm, dd, imon, isleapyr + integer :: ndays(12) + + data ndays /31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/ + + yyyy = nymd / 10000 + mm = mod(nymd,10000) / 100 + dd = mod(nymd,100) + +! Is it a leap year? + isleapyr = 0 + if(mod(yyyy,4) .eq. 0) then + isleapyr = 1 + if(mod(yyyy,100) .eq. 0) then + isleapyr = 0 + if(mod(yyyy,400) .eq. 0) then + isleapyr = 1 + endif + endif + endif + +! What day number + idaynum = 0 + if(mm .eq. 1) then + idaynum = dd + else + do imon = 1, mm-1 + if(imon .eq. 2 .and. isleapyr .eq. 1) then + idaynum = idaynum+29 + else + idaynum = idaynum + ndays(imon) + endif + enddo + idaynum = idaynum + dd + endif + + return + end function idaynum + + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: szangle -- given locations and hour find the sza +! from GOCART (source?) +! +! Colarco, July 29, 2004 + + subroutine szangle(jday,xhour,lonRad,latRad,sza,cossza,i1,i2,j1,j2) + + real, pointer, dimension(:,:) :: lonRad, latRad + integer :: jday, i1, i2, j1, j2, i, j + real :: a0, a1, a2, a3, b1, b2, b3, r, dec + real :: pi, timloc, ahr, xlon, rlat, xHour + real :: cossza(i1:i2,j1:j2), sza(i1:i2,j1:j2) + data pi / 3.1415926 / + + a0 = 0.006918 + a1 = 0.399912 + a2 = 0.006758 + a3 = 0.002697 + b1 = 0.070257 + b2 = 0.000907 + b3 = 0.000148 + r = 2.*pi*float(jday-1)/365. ! where jday is day # of the year + +! dec is the solar declination in radians + dec = a0 - a1*cos( r) + b1*sin( r) & + - a2*cos(2.*r) + b2*sin(2.*r) & + - a3*cos(3.*r) + b3*sin(3.*r) + + do j = j1, j2 + do i = i1, i2 +! timloc is the local time in hours + xlon = lonRad(i,j)*radToDeg + timloc = xhour + xlon/15. + if(timloc .lt. 0.) timloc = timloc+24. + if(timloc .gt. 24.) timloc = timloc-24. +! ahr is the hour angle in radians + ahr = abs(timloc - 12.)*15.*pi/180. + + rlat = latRad(i,j) + cossza(i,j) = sin(rlat)*sin(dec) & + + cos(rlat)*cos(dec)*cos(ahr) + cossza(i,j) = min(max(cossza(i,j),-1.0),1.0) !ALT make sure cos stays between -1.0 and 1.0 + sza(i,j) = acos(cossza(i,j)) * radToDeg + if(cossza(i,j) .lt. 0.) cossza(i,j) = 0. + end do + end do + + end subroutine szangle + + + +end module diff --git a/ESMF/Shared/Chem_Shared/VegLaiMod.F90 b/ESMF/Shared/Chem_Shared/VegLaiMod.F90 new file mode 100644 index 00000000..305fadcf --- /dev/null +++ b/ESMF/Shared/Chem_Shared/VegLaiMod.F90 @@ -0,0 +1,229 @@ +#include "MAPL_Generic.h" + +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: VegLaiMod --- Vegetation Index and Leaf Area Index +! +! !INTERFACE: +! + + MODULE VegLaiMod + +! !USES: + + USE ESMF + USE MAPL + + IMPLICIT NONE + + +! !PUBLIC TYPES: +! + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC Decode_Land_Types + PUBLIC Decode_XLAI + +! +! !DESCRIPTION: +! +! This module decodes land-use and LAI info from 3D arrays. +! The Olson land types are used. +! +! !REVISION HISTORY: +! +! 16May2016 - Manyin, first crack +! +!EOP + +!------------------------------------------------------------------------- +CONTAINS + +!--------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1, GEOS/DAS ! +! Atmospheric Chemistry and Dynamics Lab, Code 614 ! +!--------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Decode_Land_Types - Decode Olson Land Types from a 3D array +! +! !INTERFACE: + + SUBROUTINE Decode_Land_Types(PTR3D, NTYPE, i1, i2, j1, j2, km, ireg, iuse, iland, rc) + + IMPLICIT NONE + +! !INPUT PARAMETERS: + REAL, POINTER, INTENT(IN), DIMENSION(:,:,:) :: PTR3D + INTEGER, INTENT(IN) :: NTYPE ! max number of land types in a gridbox + INTEGER, INTENT(IN) :: i1, i2, j1, j2, km + +! !OUTPUT PARAMETERS + INTEGER, POINTER, INTENT(INOUT), DIMENSION(:,:) :: ireg ! number of land types in each grid square + INTEGER, POINTER, INTENT(INOUT), DIMENSION(:,:,:) :: iuse ! fraction of grid box area occupied by land type + INTEGER, POINTER, INTENT(INOUT), DIMENSION(:,:,:) :: iland ! land type id in grid square for ireg land types + + INTEGER, INTENT(OUT) :: rc +! +! !DESCRIPTION: +! +! This routine ingests land use mil fractions from Michael Manyin's NetCDF files, which are +! set up to facilitate mapping to the cubed sphere. The incoming 3-D field actually consists of +! 72 2-D fractional coverage fields, one for each Olson land type. (There are 74 land types, but +! a few such as 13 and 14 are unused, so in the file we store the coverage for type 73 in 13, and +! the coverage for type 74 in 14.) Fractional coverage is a value between 0 and 1000. +! We impose the constraint that, for any gridbox, there can be at most NTYPE land types stored. +! So we test each coverage fraction to be sure it satisfies the threshold VEG_MIN_VALID, and +! we only track info for those entries. If the number of qualifying entries in a gridbox +! exceeds NTPYE, the mil fractions are sorted in ascending order by MAPL_Sort. +! The "upper" NTYPE values are then copied into the output arrays. If the number of +! qualifying land types is less than or equal to NTYPE, there is no need to sort, and all the +! values are copied. +! +! NOTE: The fraction coverage fields are constant in the current Olson scheme. +! +!EOP +!--------------------------------------------------------------------------- + REAL, PARAMETER :: VEG_MIN_VALID = 1.0 + + CHARACTER(LEN=ESMF_MAXSTR) :: IAm + INTEGER :: STATUS + INTEGER :: i,j,k,m,ic + INTEGER, ALLOCATABLE :: landNum(:) + INTEGER, ALLOCATABLE :: milFrac(:) + + rc = 0 + IAm = "Decode_Land_Types" + + ireg(:,:) = 0 + iuse(:,:,:) = 0 + iland(:,:,:) = 0 + + ! Allocate the max number of possible entries + ALLOCATE( landNum(km), __STAT__ ) + ALLOCATE( milFrac(km), __STAT__ ) + + DO j = j1, j2 + DO i = i1, i2 + + ic = 0 + landNum(:) = -1 ! in case we need to sort (ic > NTYPE) + milFrac(:) = -1 ! in case we need to sort (ic > NTYPE) + DO k = 1, km + + IF(PTR3D(i,j,k) >= VEG_MIN_VALID) THEN + ic = ic+1 + m = k + IF(k == 13) m = 73 + IF(k == 14) m = 74 +! Expecting land type number 0-73 but read in as 1-74 +! landNum(ic) = m + landNum(ic) = m - 1 + milFrac(ic) = INT(PTR3D(i,j,k)+0.0001) + END IF + + END DO + + IF(ic > NTYPE) THEN + + CALL MAPL_Sort(milFrac(1:ic),landNum(1:ic)) + + iland(i,j,1:NTYPE) = landNum(ic:ic-(NTYPE-1):-1) + iuse(i,j,1:NTYPE) = milFrac(ic:ic-(NTYPE-1):-1) + ireg(i,j) = NTYPE + + ELSE + + iland(i,j,1:ic) = landNum(1:ic) + iuse(i,j,1:ic) = milFrac(1:ic) + ireg(i,j) = ic + + END IF + + END DO + END DO + + DEALLOCATE(landNum, __STAT__ ) + DEALLOCATE(milFrac, __STAT__ ) + + RETURN + END SUBROUTINE Decode_Land_Types + + +!--------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1, GEOS/DAS ! +! Atmospheric Chemistry and Dynamics Lab, Code 614 ! +!--------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: Decode_XLAI - Decode Leaf Area Indices from a 3D array +! +! !INTERFACE: + + SUBROUTINE Decode_XLAI(PTR3D, NTYPE, i1, i2, j1, j2, km, ireg, iuse, iland, xlai, rc) + + IMPLICIT NONE + +! !INPUT PARAMETERS: + REAL, POINTER, INTENT(IN), DIMENSION(:,:,:) :: PTR3D + INTEGER, INTENT(IN) :: NTYPE + INTEGER, INTENT(IN) :: i1, i2, j1, j2, km + INTEGER, POINTER, INTENT(IN), DIMENSION(:,:) :: ireg ! number of land types in a grid square + INTEGER, POINTER, INTENT(IN), DIMENSION(:,:,:) :: iuse ! fraction of grid box area occupied by land type + INTEGER, POINTER, INTENT(IN), DIMENSION(:,:,:) :: iland ! land type id in grid square for ireg land types + +! !OUTPUT PARAMETERS + REAL*8 , POINTER, INTENT(INOUT), DIMENSION(:,:,:) :: xlai ! leaf area index of land type + + INTEGER, INTENT(OUT) :: rc +! +! !DESCRIPTION: +! +! This routine ingests Leaf Area Index fractions from Michael Manyin's NetCDF files, which are +! set up to facilitate mapping to the cubed sphere. The incoming 3-D field actually consists of +! 72 2-D LAI fields, one for each Olson land type. (There are 74 land types, but +! a few such as 13 and 14 are unused, so in the file we store the LAI for type 73 in 13, and +! the coverage for type 74 in 14.) LAI is a floating point fraction. It varies monthly. +! +!EOP +!--------------------------------------------------------------------------- + CHARACTER(LEN=ESMF_MAXSTR) :: IAm + INTEGER :: STATUS + INTEGER :: i,j,k,ic + + rc = 0 + IAm = "Decode_XLAI" + + DO j = j1,j2 + DO i = i1,i2 + + DO ic = 1,ireg(i,j) +! Add back 1 for correct k indices +! k = iland(i,j,ic) + k = iland(i,j,ic) + 1 + IF(k > 72) k = k-60 ! There are 74 land types, but some are unused so 73->13, 74->14 + IF(k < 1 .OR. k > 72) THEN + print*,'DECODE_XLAI bad value of k=',k + ENDIF + xlai(i,j,ic) = PTR3D(i,j,k) + END DO + + DO ic = ireg(i,j)+1,NTYPE + xlai(i,j,ic) = 0.0d0 + END DO + + END DO + END DO + + RETURN + END SUBROUTINE Decode_XLAI + + + END MODULE VegLaiMod diff --git a/ESMF/Shared/Chem_Shared/WetRemovalMod.F90 b/ESMF/Shared/Chem_Shared/WetRemovalMod.F90 new file mode 100644 index 00000000..f13ece25 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/WetRemovalMod.F90 @@ -0,0 +1,501 @@ +!------------------------------------------------------------------------- +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!------------------------------------------------------------------------- +!BOP +! +! !MODULE: WetRemovalMod --- Aerosol Large-Scale Wet Removal Module +! +! !INTERFACE: +! + + module WetRemovalMod + +! !USES: + + use Chem_Mod + use Chem_ConstMod, only: grav, von_karman, cpd ! Constants ! + + implicit none + +! !PUBLIC TYPES: +! + PRIVATE + +! +! !PUBLIC MEMBER FUNCTIONS: +! + + PUBLIC WetRemovalGOCART + +! +! !DESCRIPTION: +! +! This module implements various wet removal schemes +! +! !REVISION HISTORY: +! +! 08Jan2010 - Colarco, first crack +! +!EOP + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + +!------------------------------------------------------------------------- +CONTAINS +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: WetRemovalGOCART - Calculate aerosol wet removal due +! to large scale processes. +! +! !INTERFACE: +! + + subroutine WetRemovalGOCART ( i1, i2, j1, j2, km, n1, n2, cdt, aero_type, kin, & + qa, ple, tmpu, rhoa, pfllsan, pfilsan, & + precc, precl, fluxout, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2, n1, n2, km + real, intent(in) :: cdt + character(len=*) :: aero_type + LOGICAL, INTENT(INOUT) :: KIN ! true for aerosol + TYPE(Chem_Array), pointer :: qa(:) ! tracer array will go here + real, pointer, dimension(:,:,:) :: ple, tmpu, rhoa + real, pointer, dimension(:,:,:) :: pfllsan, pfilsan + real, pointer, dimension(:,:) :: precc, precl + TYPE(Chem_Array), pointer :: fluxout ! tracer loss flux [kg m-2 s-1] + +! !OUTPUT PARAMETERS: + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Calculates the updated species concentration due to wet +! removal. As written, intended to function for large +! scale (not convective) wet removal processes +! +! !REVISION HISTORY: +! +! 08Jan2010 - Colarco, based on GOCART implementation, does not +! include any size dependent term +! +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + character(len=*), parameter :: myname = 'WetRemovalGOCART' + integer :: i, j, k, n, nbins, LH, kk, ios + real :: pdog(i1:i2,j1:j2,km) ! air mass factor dp/g [kg m-2] + real :: delz(i1:i2,j1:j2,km) ! box height dp/g/rhoa [m] + real :: pls, pcv, pac ! ls, cv, tot precip [mm day-1] + real :: qls(km), qcv(km) ! ls, cv portion of moisture tendency[kg m-3 s-1] + real :: qmx, qd, A ! temporary variables on moisture + real :: F, B, BT ! temporary variables on cloud, freq. + real :: WASHFRAC, WASHFRAC_F_14 + real, allocatable :: fd(:,:) ! flux across layers [kg m-2] + real, allocatable :: dpfli(:,:,:) ! vertical gradient of LS ice+rain precip flux + real, allocatable :: DC(:) ! scavenge change in mass mixing ratio + real :: c_h2o(i1:i2,j1:j2,km), cldliq(i1:i2,j1:j2,km), cldice(i1:i2,j1:j2,km) + +! Rain parameters from Liu et al. + real, parameter :: B0_ls = 1.0e-4 + real, parameter :: F0_ls = 1.0 + real, parameter :: XL_ls = 5.0e-4 + real, parameter :: B0_cv = 1.5e-3 + real, parameter :: F0_cv = 0.3 + real, parameter :: XL_cv = 2.0e-3 + real, parameter :: k_wash = 1.d0 ! first order washout rate, constant, [cm^-1] +! Duration of rain: ls = model timestep, cv = 1800 s (<= cdt) + real :: Td_ls + real, parameter :: Td_cv = 1800. + REAL*8, PARAMETER :: R = 8.2057d-2 ! universal gas constant [L*atm/moles/K] + REAL*8, PARAMETER :: INV_T0 = 1d0 / 298d0 + REAL*8, PARAMETER :: conv_NH3 = 5.69209978831d-1 ! 0.6*SQRT(0.9) for ice to gas ratio + REAL*8 :: k_rain, Kstar298, H298_R, I2G, L2G, C_TOT, F_L, F_I + REAL*8 :: PP, LP + + logical :: snow_scavenging + +! Efficiency of dust wet removal (since dust is really not too hygroscopic) +! Applied only to in-cloud scavenging + real :: effRemoval + + rc=0 + +! Initialize local variables +! -------------------------- +! c_h2o, cldliq, and cldice are respectively intended to be the +! water mixing ratio (liquid or vapor?, in or out of cloud?) +! cloud liquid water mixing ratio +! cloud ice water mixing ratio + c_h2o = (10d0**(-2663.5d0/tmpu(:,:,:) + 12.537d0 ) ) / & + (ple(:,:,0:km-1)+ple(:,:,1:km)) /2d0 + cldliq = 0.d0 + where(tmpu > 248.) cldliq = 1.d-6 * ( ( tmpu - 248.d0) / 20.d0 ) + where(tmpu >= 268.) cldliq = 1.d-6 + cldice = 1.d-6 - cldliq + + Td_ls = cdt + nbins = n2-n1+1 + if( associated(fluxout%data2d) ) fluxout%data2d(i1:i2,j1:j2) = 0.0 + +! Allocate the dynamic arrays + allocate(fd(km,nbins),stat=ios) + if(ios .ne. 0) stop + allocate(dc(nbins),stat=ios) + if(ios .ne. 0) stop + allocate(dpfli(i1:i2, j1:j2, km),stat=ios) + if(ios .ne. 0) stop + +! Accumulate the 3-dimensional arrays of rhoa and pdog + pdog = (ple(:,:,1:km)-ple(:,:,0:km-1)) / grav + delz = pdog / rhoa + dpfli = pfllsan(:,:,1:km)-pfllsan(:,:,0:km-1)+pfilsan(:,:,1:km)-pfilsan(:,:,0:km-1) + if (.not. KIN) then ! Gases + if (aero_type == 'NH3') then ! Only for NH3 at present + ! values adopted in Umich/IMPACT and GMI, effective Henry's law coefficient at pH=5 + Kstar298 = 1.05d6 + H298_R = -4.2d3 + else + if (MAPL_AM_I_ROOT()) print *, 'stop in WetRemoval, need Kstar298 and H298_R' + stop + endif + endif + +! Snow scavenging flag + snow_scavenging = .true. + + if ( (aero_type == 'OC' ) .or. & + (aero_type == 'sea_salt') .or. & + (aero_type == 'sulfur' ) .or. & + (aero_type == 'seasalt' ) .or. & + (aero_type == 'sulfate' ) .or. & + (aero_type == 'NH3' ) .or. & + (aero_type == 'NH4a' ) .or. & + (aero_type == 'nitrate' ) .or. & + (aero_type == 'bromine' ) .or. & + (aero_type == 'dust' ) ) then + snow_scavenging = .false. + end if + +! Loop over spatial indices + do j = j1, j2 + do i = i1, i2 + +! Check for total precipitation amount +! Assume no precip in column if precl+precc = 0 + pac = precl(i,j) + precc(i,j) + if(pac .le. 0.) goto 100 + pls = precl(i,j) + pcv = precc(i,j) + +! Initialize the precipitation fields + qls(:) = 0. + qcv(:) = 0. + fd(:,:) = 0. + +! Find the highest model layer experiencing rainout. Assumes no +! scavenging if T < 258 K + LH = 0 + do k = 1, km + if(dpfli(i,j,k) .gt. 0. ) then + LH = k + goto 15 + endif + end do + 15 continue + if(LH .lt. 1) goto 100 + + do k = LH, km + qls(k) = dpfli(i,j,k)/pdog(i,j,k)*rhoa(i,j,k) + end do + +! Loop over vertical to do the scavenging! + do k = LH, km + +!----------------------------------------------------------------------------- +! (1) LARGE-SCALE RAINOUT: +! Tracer loss by rainout = TC0 * F * exp(-B*dt) +! where B = precipitation frequency, +! F = fraction of grid box covered by precipitating clouds. +! We assume that tracer scavenged by rain is falling down to the +! next level, where a fraction could be re-evaporated to gas phase +! if Qls is less then 0 in that level. +!----------------------------------------------------------------------------- + if (qls(k) .gt. 0.) then + F = F0_ls / (1. + F0_ls*B0_ls*XL_ls/(qls(k)*cdt/Td_ls)) + k_rain = B0_ls/F0_ls +1./(F0_ls*XL_ls/qls(k)) + if ( kin ) then ! Aerosols + B = k_rain + else ! Gases + ! ice to gas ratio + if ( c_h2o(i,j,k) > 0.d0) then + I2G = (cldice(i,j,k) / c_h2o(i,j,k)) * conv_NH3 + else + I2G = 0.d0 + endif + L2G = cldliq(i,j,k) * R * tmpu(i,j,k) * & + Kstar298 * EXP( -H298_R * ( ( 1d0 / tmpu(i,j,k) ) - INV_T0 ) ) + ! fraction of NH3 in liquid & ice phases + C_TOT = 1d0 + L2G + I2G + F_L = L2G / C_TOT + F_I = I2G / C_TOT + ! compute kg, the retention factor for liquid NH3 is 0 at T < 248K and + ! 0.05 at 248K < T < 268K + if (tmpu(i,j,k) >=268d0) then + B = k_rain * ( F_L+F_I ) + elseif ( (248d0 < tmpu(i,j,k)) .and. (tmpu(i,j,k) < 268d0) ) then + B = k_rain * ( (0.05*F_L)+F_I ) + else + B = k_rain * F_I + endif + endif ! kin + BT = B * Td_ls + if (BT.gt.10.) BT = 10. !< Avoid overflow > +! Adjust du level: + do n = 1, nbins +! supress scavenging at cold T except for HNO3 + if (tmpu(i,j,k) < 258d0 .and. .not.snow_scavenging) then + F = 0.d0 + endif + + effRemoval = qa(n1+n-1)%fwet + DC(n) = qa(n1+n-1)%data3d(i,j,k) * F * effRemoval *(1.-exp(-BT)) + if (DC(n).lt.0.) DC(n) = 0. + qa(n1+n-1)%data3d(i,j,k) = qa(n1+n-1)%data3d(i,j,k)-DC(n) + if (qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + end do +! Flux down: unit is kg m-2 +! Formulated in terms of production in the layer. In the revaporation step +! we consider possibly adding flux from above... + do n = 1, nbins + Fd(k,n) = DC(n)*pdog(i,j,k) + end do + + end if ! if Qls > 0 >>> + +!----------------------------------------------------------------------------- +! * (2) LARGE-SCALE WASHOUT: +! * Occurs when rain at this level is less than above. +!----------------------------------------------------------------------------- + if(k .gt. LH .and. qls(k) .ge. 0.) then + if(qls(k) .lt. qls(k-1)) then +! Find a maximum F overhead until the level where Qls<0. + Qmx = 0. + do kk = k-1,LH,-1 + if (Qls(kk).gt.0.) then + Qmx = max(Qmx,Qls(kk)) + else + goto 333 + end if + end do + + 333 continue + F = F0_ls / (1. + F0_ls*B0_ls*XL_ls/(Qmx*cdt/Td_ls)) + ! if (MAPL_AM_I_ROOT()) then + ! print *, 'hbianwdep WASHFmax =',F + ! endif + if (F.lt.0.01) F = 0.01 +!----------------------------------------------------------------------------- +! The following is to convert Q(k) from kgH2O/m3/sec to mm/sec in order +! to use the Harvard formula. Convert back to mixing ratio by multiplying +! by rhoa. Multiply by pdog gives kg/m2/s of precip. Divide by density +! of water (=1000 kg/m3) gives m/s of precip and multiply by 1000 gives +! units of mm/s (omit the multiply and divide by 1000). +!----------------------------------------------------------------------------- + +! Aerosols + Qd = Qmx /rhoa(i,j,k)*pdog(i,j,k) + if (Qd.ge.50.) then + B = 0. + else + B = Qd * 0.1 + end if + BT = B * cdt + if (BT.gt.10.) BT = 10. + +! Gases + if ( .not. KIN ) then + IF ( tmpu(i,j,k) >= 268d0 ) THEN + !------------------------ + ! T >= 268K: Do washout + !------------------------ + ! Rainwater content in the grid box (Eq. 17, Jacob et al, 2000) + PP = (PFLLSAN(i,j,k)/1000d0 + PFILSAN(i,j,k)/917d0 )*100d0 ! from kg H2O/m2/s to cm3 H2O/cm2/s + LP = ( PP * cdt ) / ( F * delz(i,j,k)*100.d0 ) ! DZ*100.d0 in cm + ! Compute liquid to gas ratio for H2O2, using the appropriate + ! parameters for Henry's law -- also use rainwater content Lp + ! (Eqs. 7, 8, and Table 1, Jacob et al, 2000) + !CALL COMPUTE_L2G( Kstar298, H298_R, tmpu(i,j,k), LP, L2G ) + L2G = Kstar298 * EXP( -H298_R*((1d0/tmpu(i,j,k))-INV_T0) ) & + * LP * R * tmpu(i,j,k) + ! Washout fraction from Henry's law (Eq. 16, Jacob et al, 2000) + WASHFRAC = L2G / ( 1d0 + L2G ) + ! Washout fraction / F from Eq. 14, Jacob et al, 2000 + ! Note: WASHFRAC_F_14 should match what's used for HNO3 (hma, 13aug2011) + WASHFRAC_F_14 = 1d0 - EXP( -K_WASH * ( PP / F ) * cdt ) + ! Do not let the Henry's law washout fraction exceed + IF ( WASHFRAC > WASHFRAC_F_14 ) THEN + WASHFRAC = WASHFRAC_F_14 + ENDIF + ELSE + !------------------------ + ! T < 268K: No washout + !------------------------ + WASHFRAC = 0d0 + ENDIF + endif + +! Adjust du level: + do n = 1, nbins + if ( KIN ) then + DC(n) = qa(n1+n-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + else + DC(n) = qa(n1+n-1)%data3d(i,j,k) * F * WASHFRAC + endif + if (DC(n).lt.0.) DC(n) = 0. + qa(n1+n-1)%data3d(i,j,k) = qa(n1+n-1)%data3d(i,j,k)-DC(n) + if (qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) & + qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + if( associated(fluxout%data2d) ) then + fluxout%data2d(i,j) = fluxout%data2d(i,j)+DC(n)*pdog(i,j,k)/cdt + endif + end do + + end if + end if ! if ls washout >>> + +!----------------------------------------------------------------------------- +! (3) CONVECTIVE RAINOUT: +! Tracer loss by rainout = dd0 * F * exp(-B*dt) +! where B = precipitation frequency, +! F = fraction of grid box covered by precipitating clouds. +!----------------------------------------------------------------------------- + + if (qcv(k) .gt. 0.) then + F = F0_cv / (1. + F0_cv*B0_cv*XL_cv/(Qcv(k)*cdt/Td_cv)) + B = B0_cv + BT = B * Td_cv + if (BT.gt.10.) BT = 10. !< Avoid overflow > + +! Adjust du level: + do n = 1, nbins + effRemoval = qa(n1+n-1)%fwet + DC(n) = qa(n1+n-1)%data3d(i,j,k) * F * effRemoval * (1.-exp(-BT)) + if (DC(n).lt.0.) DC(n) = 0. + qa(n1+n-1)%data3d(i,j,k) = qa(n1+n-1)%data3d(i,j,k)-DC(n) + if (qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + end do + +!------ Flux down: unit is kg. Including both ls and cv. + do n = 1, nbins + Fd(k,n) = Fd(k,n) + DC(n)*pdog(i,j,k) + end do + + end if ! if Qcv > 0 >>> + +!----------------------------------------------------------------------------- +! (4) CONVECTIVE WASHOUT: +! Occurs when rain at this level is less than above. +!----------------------------------------------------------------------------- + + if (k.gt.LH .and. Qcv(k).ge.0.) then + if (Qcv(k).lt.Qcv(k-1)) then +!----- Find a maximum F overhead until the level where Qls<0. + Qmx = 0. + do kk = k-1, LH, -1 + if (Qcv(kk).gt.0.) then + Qmx = max(Qmx,Qcv(kk)) + else + goto 444 + end if + end do + + 444 continue + F = F0_cv / (1. + F0_cv*B0_cv*XL_cv/(Qmx*cdt/Td_cv)) + if (F.lt.0.01) F = 0.01 +!----------------------------------------------------------------------------- +! The following is to convert Q(k) from kgH2O/m3/sec to mm/sec in order +! to use the Harvard formula. Convert back to mixing ratio by multiplying +! by rhoa. Multiply by pdog gives kg/m2/s of precip. Divide by density +! of water (=1000 kg/m3) gives m/s of precip and multiply by 1000 gives +! units of mm/s (omit the multiply and divide by 1000). +!----------------------------------------------------------------------------- + + Qd = Qmx / rhoa(i,j,k)*pdog(i,j,k) + if (Qd.ge.50.) then + B = 0. + else + B = Qd * 0.1 + end if + BT = B * cdt + if (BT.gt.10.) BT = 10. + +! Adjust du level: + do n = 1, nbins + DC(n) = qa(n1+n-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + if (DC(n).lt.0.) DC(n) = 0. + qa(n1+n-1)%data3d(i,j,k) = qa(n1+n-1)%data3d(i,j,k)-DC(n) + if (qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) & + qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + if( associated(fluxout%data2d) ) then + fluxout%data2d(i,j) = fluxout%data2d(i,j)+DC(n)*pdog(i,j,k)/cdt + endif + end do + + end if + end if ! if cv washout >>> + +!----------------------------------------------------------------------------- +! (5) RE-EVAPORATION. Assume that SO2 is re-evaporated as SO4 since it +! has been oxidized by H2O2 at the level above. +!----------------------------------------------------------------------------- +! Add in the flux from above, which will be subtracted if reevaporation occurs + if(k .gt. LH) then + do n = 1, nbins + Fd(k,n) = Fd(k,n) + Fd(k-1,n) + end do + +! Is there evaporation in the currect layer? + if (dpfli(i,j,k) .lt. 0.) then +! Fraction evaporated = H2O(k)evap / H2O(next condensation level). + if (dpfli(i,j,k-1) .gt. 0.) then + + A = abs( dpfli(i,j,k) / dpfli(i,j,k-1) ) + if (A .gt. 1.) A = 1. + +! Adjust tracer in the level + do n = 1, nbins + DC(n) = Fd(k-1,n) / pdog(i,j,k) * A + qa(n1+n-1)%data3d(i,j,k) = qa(n1+n-1)%data3d(i,j,k) + DC(n) + qa(n1+n-1)%data3d(i,j,k) = max(qa(n1+n-1)%data3d(i,j,k),1.e-32) +! Adjust the flux out of the bottom of the layer + Fd(k,n) = Fd(k,n) - DC(n)*pdog(i,j,k) + end do + + endif + endif ! if -moistq < 0 + endif + end do ! k + + do n = 1, nbins + if( associated(fluxout%data2d) ) then + fluxout%data2d(i,j) = fluxout%data2d(i,j)+Fd(km,n)/cdt + endif + end do + + 100 continue + end do ! i + end do ! j + + deallocate(fd,DC,dpfli,stat=ios) + + end subroutine WetRemovalGOCART + + end module WetRemovalMod diff --git a/ESMF/Shared/Chem_Shared/bundleParser.py b/ESMF/Shared/Chem_Shared/bundleParser.py new file mode 100755 index 00000000..f53f4b17 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/bundleParser.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- + +import re +import sys +import numpy +import os + +checker = numpy.zeros((5), dtype=bool) +bundle = [None] * 5 +#print checker + +# Check to see if TRADVI diagnostics are asked for in HISOTRY.rc +# -------------------------------------------------------------- +f = open('HISTORY.rc', 'rt') +for line in f: + line = line.strip() + if not line.startswith('#'): +# print line + if "'TRADVI%" in line: + checker[0] = True + bundle[0] = "'TRADVI" + if "'CHEMTRI%" in line: + checker[1] = True + bundle[1] = "'CHEMTRI" + if "'H2ORTRI%" in line: + checker[2] = True + bundle[2] = "'H2ORTRI" + if "'TRI%" in line: + checker[3] = True + bundle[3] = "'TRI" + if "'MTRI%" in line: + checker[4] = True + bundle[4] = "'MTRI" + +f.close() + + +# If no increment species are asked for in HISTORY.rc then exit +#-------------------------------------------------------------- +if not any(checker): + sys.exit() + + +# Get species names from HISTORY.rc +#---------------------------------- +for i in range(len(checker)): + if checker[i]: + tag = [] + f = open('HISTORY.rc', 'rt') + for line in f: + line = line.strip() +# print line + if not line.startswith('#'): + specName = re.findall(bundle[i]+'%(.*?)\'', line) + if specName: + if specName not in tag: + tag.append(specName) + f.close() + +# Write table of species increment names to AGCM.rc or GEOSCTM.rc +#---------------------------------------------------------------- + exists = os.path.isfile('AGCM.rc') + if exists: + with open('AGCM.rc','a') as myfile: + myfile.write('\n' '\n' '# ' + bundle[i][1:] + ' increment tracers' '\n' + '#-------------------------' '\n' + bundle[i][1:] + '_increments::' + '\n') + for item in tag: + myfile.write(str(item)[2:-4] + '\n') + myfile.write('::' '\n') + + exists = os.path.isfile('GEOSCTM.rc') + if exists: + with open('GEOSCTM.rc','a') as myfile: + myfile.write('\n' '\n' '# ' + bundle[i][1:] + ' increment tracers' '\n' + '#-------------------------' '\n' + bundle[i][1:] + '_increments::' + '\n') + for item in tag: + myfile.write(str(item)[2:-4] + '\n') + myfile.write('::' '\n') + + diff --git a/ESMF/Shared/Chem_Shared/diaglist.F90 b/ESMF/Shared/Chem_Shared/diaglist.F90 new file mode 100644 index 00000000..9e82e79e --- /dev/null +++ b/ESMF/Shared/Chem_Shared/diaglist.F90 @@ -0,0 +1,2604 @@ +!!!! #include + + SUBROUTINE diaglist(diag) + + USE mod_diag + +! ---------------------------------------------------------------------- +! +! This routine contains the initialization of the diagnostic name, +! description, and unit. +! +! type diag_type +! character*8 :: name ! name for diagnostic +! character*16 :: unit ! unit for diagnostic fields +! character*80 :: desc ! description for diagnostic fields +! integer :: pick ! is the diag needed for output 1:yes 0:no +! logical :: counted ! if true, diagnostic is counted +! integer :: vdim ! number of levels 1 or km +! integer :: nlist ! number of output streams +! integer, pointer :: fldloc(:,:) ! location in diagnostic buffer +! integer, pointer :: count(:) ! counter +! logical, pointer :: alt(:) ! if true use alternate name/unit for output +! character*8 :: aname ! Alternate name for diagnostic +! character*16 :: aunit ! Alternate unit for diagnostic fields +! character*80 :: adesc ! description for diagnostic fields +! real*4 :: convfac ! conversion factor if alternate unit different than primary +! endtype +! +! ---------------------------------------------------------------------- +! Variable Declaration + + type (diag_type) :: diag(pdiag) ! diagnostic attributes (see above) + integer :: n ! do loop counter + + do n = 1, pdiag + diag(n)%convfac = 1. + diag(n)%aname = ' ' + diag(n)%aunit = ' ' + diag(n)%adesc = ' '// & + ' ' + diag(n)%counted = .false. + enddo + + + diag(iALBEDO )%name = 'ALBEDO ' + diag(iALBEDO )%desc = 'Surface Albedo' + diag(iALBEDO )%unit = 'fraction' + diag(iALBEDO )%aname= 'ALBEDO ' + diag(iALBEDO )%adesc= 'Surface Albedo' + diag(iALBEDO )%counted = .true. + + diag(iALDIF )%name = 'ALDIF ' + diag(iALDIF )%desc = 'Albedo: longwave, diffuse ' + diag(iALDIF )%unit = 'fraction' + diag(iALDIF )%aname= 'ALBNIRDF' + diag(iALDIF )%adesc= 'Diffuse Beam NIR Surface Albedo' + + diag(iALDIR )%name = 'ALDIR ' + diag(iALDIR )%desc = 'Albedo: longwave, direct ' + diag(iALDIR )%unit = 'fraction' + diag(iALDIR )%aname= 'ALBNIRDR' + diag(iALDIR )%adesc= 'Direct Beam NIR Surface Albedo' + + diag(iASDIF )%name = 'ASDIF ' + diag(iASDIF )%desc = 'Albedo: shortwave, diffuse ' + diag(iASDIF )%unit = 'fraction' + diag(iASDIF )%aname= 'ALBVISDF' + diag(iASDIF )%adesc= 'Diffuse Beam VIS Surface Albedo' + + diag(iASDIR )%name = 'ASDIR ' + diag(iASDIR )%desc = 'Albedo: shortwave, direct ' + diag(iASDIR )%unit = 'fraction' + diag(iASDIR )%aname= 'ALBVISDR' + diag(iASDIR )%adesc= 'Direct Beam VIS Surface Albedo' + + diag(iBMA )%name = 'BMA ' + diag(iBMA )%desc = 'Bulk moisture avaliability ' + diag(iBMA )%unit = 'fraction' + + diag(iBULKTS )%name = 'BULKTS ' + diag(iBULKTS )%desc = 'Bulk surface temperatur (average of tile temperature)' + diag(iBULKTS )%unit = 'K' + + diag(iCAPEMX )%name = 'CAPEMX ' + diag(iCAPEMX )%desc = 'Maximum CAPE' + diag(iCAPEMX )%unit = 'J/kg' + + diag(iCLDHGH )%name = 'CLDHGH ' + diag(iCLDHGH )%desc = 'Vertically-integrated, random overlap, ' & + // 'high cloud amount' + diag(iCLDHGH )%unit = 'fraction' + diag(iCLDHGH )%aname= 'CLDHI ' + diag(iCLDHGH )%adesc= 'High-Level (above 400 hPa) Cloud Fraction' + + diag(iCLDLOW )%name = 'CLDLOW ' + diag(iCLDLOW )%desc = 'Vertically-integrated, random overlap, ' & + // 'low cloud amount' + diag(iCLDLOW )%unit = 'fraction' + diag(iCLDLOW )%adesc= 'Low-Level (1000-700 hPa) Cloud Fraction' + + diag(iCLDMED )%name = 'CLDMED ' + diag(iCLDMED )%desc = 'Vertically-integrated, random overlap, ' & + // 'mid cloud amount' + diag(iCLDMED )%unit = 'fraction' + diag(iCLDMED )%aname= 'CLDMID ' + diag(iCLDMED )%adesc= 'Mid-Level (700-400 hPa) Cloud Fraction' + + diag(iCLDPRS )%name = 'CLDPRS ' + diag(iCLDPRS )%desc = 'Cloud Top Pressure (when cloudy)' + diag(iCLDPRS )%unit = 'Pa' + diag(iCLDPRS )%aunit= 'hPa' + diag(iCLDPRS )%convfac = 0.01 + diag(iCLDPRS )%counted = .true. + + diag(iCLDTMP )%name = 'CLDTMP ' + diag(iCLDTMP )%desc = 'Cloud Top Temperature (when cloudy)' + diag(iCLDTMP )%unit = 'K' + diag(iCLDTMP )%counted = .true. + + diag(iCLDTOT )%name = 'CLDTOT ' + diag(iCLDTOT )%desc = 'Vertically-integrated, random overlap, ' & + // 'total cloud cover' + diag(iCLDTOT )%unit = 'fraction' + diag(iCLDTOT )%aname= 'CLDFRC ' + diag(iCLDTOT )%adesc= '2-D Total Cloud Fraction' + + diag(iCNVCLD )%name = 'CNVCLD ' + diag(iCNVCLD )%desc = 'Random overlap total convective cloud amount' + diag(iCNVCLD )%unit = 'fraction' + + diag(iEMSFC )%name = 'EMSFC ' + diag(iEMSFC )%desc = 'Bulk surface emissivity' + diag(iEMSFC )%unit = 'fraction' + + diag(iFLNS )%name = 'FLNS ' + diag(iFLNS )%desc = 'Net longwave flux at surface' + diag(iFLNS )%unit = 'W/m2' + diag(iFLNS )%aname= 'RADLWG ' + diag(iFLNS )%adesc= 'Net Upward Longwave Flux at the Ground' + + diag(iFLNSC )%name = 'FLNSC ' + diag(iFLNSC )%desc = 'Clear sky net longwave flux at surface' + diag(iFLNSC )%unit = 'W/m2' + diag(iFLNSC )%aname= 'LWGCLR ' + diag(iFLNSC )%adesc= 'Clear Sky Net Longwave Flux at the Ground' + + diag(iFLNT )%name = 'FLNT ' + diag(iFLNT )%desc = 'Net longwave flux at top' + diag(iFLNT )%unit = 'W/m2' + diag(iFLNT )%aname= 'OLR ' + diag(iFLNT )%adesc= 'Outgoing longwave radiation' + + diag(iFLNTC )%name = 'FLNTC ' + diag(iFLNTC )%desc = 'Clear sky net longwave flux at top' + diag(iFLNTC )%unit = 'W/m2' + diag(iFLNTC )%aname= 'OLRCLR ' + diag(iFLNTC )%adesc= 'Clear sky outgoing longwave radiation' + + diag(iFRACLAKE)%name = 'FRACLAKE' + diag(iFRACLAKE)%desc = 'Lake fraction' + diag(iFRACLAKE)%unit = 'fraction' + + diag(iFRACVEG )%name = 'FRACVEG ' + diag(iFRACVEG )%desc = 'Vegetation fraction' + diag(iFRACVEG )%unit = 'fraction' + + diag(iFSDS )%name = 'FSDS ' + diag(iFSDS )%desc = 'Flux shortwave downwelling surface' + diag(iFSDS )%unit = 'W/m2' + + diag(iFSNS )%name = 'FSNS ' + diag(iFSNS )%desc = 'Net solar flux at surface' + diag(iFSNS )%unit = 'W/m2' + diag(iFSNS )%aname= 'RADSWG ' + diag(iFSNS )%adesc= 'Net Downward Shortwave Flux at the Ground' + + diag(iFSNSC )%name = 'FSNSC ' + diag(iFSNSC )%desc = 'Clear sky net solar flux at surface ' + diag(iFSNSC )%unit = 'W/m2' + diag(iFSNSC )%aname= 'SWGCLR ' + diag(iFSNSC )%adesc= 'Clear Sky Net Downward SW Radiation at the Ground' + + diag(iFSNT )%name = 'FSNT ' + diag(iFSNT )%desc = 'Net solar flux at top' + diag(iFSNT )%unit = 'W/m2' + + diag(iFSNTC )%name = 'FSNTC ' + diag(iFSNTC )%desc = 'Clear sky net solar flux at top' + diag(iFSNTC )%unit = 'W/m2' + + diag(iGWETROOT)%name = 'GWETROOT' + diag(iGWETROOT)%desc = 'Root zone soil wetness' + diag(iGWETROOT)%unit = 'fraction' + diag(iGWETROOT)%aname= 'GWETROOT' + + diag(iGWETTC )%name = 'GWETTC ' + diag(iGWETTC )%desc = 'Total column soil layer wetness' + diag(iGWETTC )%unit = 'fraction' + diag(iGWETTC )%aname= 'GWETTC ' + + diag(iGWETTOP )%name = 'GWETTOP ' + diag(iGWETTOP )%desc = 'Top soil layer wetness' + diag(iGWETTOP )%unit = 'fraction' + diag(iGWETTOP )%aname= 'GWETTOP ' + + diag(iH300 )%name = 'H300 ' + diag(iH300 )%desc = '300 hPa Geopotential height' + diag(iH300 )%unit = 'm' + + diag(iH500 )%name = 'H500 ' + diag(iH500 )%desc = '500 hPa Geopotential height' + diag(iH500 )%unit = 'm' + + diag(iHKBETA )%name = 'HKBETA ' + diag(iHKBETA )%desc = 'Overshoot parameter in Hack scheme' + diag(iHKBETA )%unit = 'fraction' + + diag(iHKETA )%name = 'HKETA ' + diag(iHKETA )%desc = 'Mass flux without overshoot in Hack scheme' + diag(iHKETA )%unit = 'kg/m2 s' + + diag(iHSURF )%name = 'HSURF ' + diag(iHSURF )%desc = 'Surface height' + diag(iHSURF )%unit = 'm' + diag(iHSURF )%aname= 'PHIS ' + diag(iHSURF )%aunit= 'm' + diag(iHSURF )%adesc= 'Surface geopotential' + + diag(iHTLCL )%name = 'HTLCL ' + diag(iHTLCL )%desc = ' Height above surface at LCL level' + diag(iHTLCL )%unit = 'm' + + diag(iHTMMSE )%name = 'HTMMSE ' + diag(iHTMMSE )%desc = ' Height above surface at maximum moist' & + //' static energy level' + diag(iHTMMSE )%unit = 'm' + + diag(iLAI )%name = 'LAI ' + diag(iLAI )%desc = 'Leaf area index' + diag(iLAI )%unit = 'm2/m2' + + diag(iDTG )%name = 'DTG ' + diag(iDTG )%desc = 'Change in ground temperature' + diag(iDTG )%unit = 'K/s' + + diag(iLHFX )%name = 'LHFX ' + diag(iLHFX )%desc = 'Surface latent heat flux' + diag(iLHFX )%unit = 'W/m2' + diag(iLHFX )%aname= 'EFLUX ' + diag(iLHFX )%adesc= 'Latent Heat Flux (pos.upwrd)' + + diag(iLWSH )%name = 'LWSH ' + diag(iLWSH )%desc = 'Liquid water scale height' + diag(iLWSH )%unit = 'm' + + diag(iO3DU )%name = 'O3DU ' + diag(iO3DU )%desc = 'Total Column Ozone' + diag(iO3DU )%unit = 'Dobson Unit' + + diag(iORO )%name = 'ORO ' + diag(iORO )%desc = 'Surface type flag' + diag(iORO )%unit = 'flag' + diag(iORO )%aname= 'SURFTYPE' + + diag(iOSR )%name = 'OSR ' + diag(iOSR )%desc = 'Outgoing Shortwave Radiation' + diag(iOSR )%unit = 'W/m2' + + diag(iOSRCLR )%name = 'OSRCLR ' + diag(iOSRCLR )%desc = 'Clear Sky Outgoing Shortwave Radiation' + diag(iOSRCLR )%unit = 'W/m2' + + diag(iPARDF )%name = 'PARDF ' + diag(iPARDF )%desc = 'Diffuse photosynthetically active radiation' & + // ' (0.35-0.70 um)' + diag(iPARDF )%unit = 'W/m2' + diag(iPARDF )%aname= 'PARDF ' + + diag(iPARDR )%name = 'PARDR ' + diag(iPARDR )%desc = 'Direct photosynthetically active radiation' & + //' (0.35-0.70 um)' + diag(iPARDR )%unit = 'W/m2' + diag(iPARDR )%aname= 'PARDR ' + + diag(iPBLH )%name = 'PBLH ' + diag(iPBLH )%desc = 'Planetary boundary layer height' + diag(iPBLH )%unit = 'm' + diag(iPBLH )%aname= 'PBL ' + + diag(iPREACC )%name = 'PREACC ' + diag(iPREACC )%desc = 'Total precipitation rate' + diag(iPREACC )%unit = 'mm/day' + + diag(iPRECC )%name = 'PRECC ' + diag(iPRECC )%desc = 'Convective precipitation rate' + diag(iPRECC )%unit = 'mm/day' + diag(iPRECC )%aname= 'PRECON ' + diag(iPRECC )%adesc= 'Convective Precipitation' + + diag(iPRECL )%name = 'PRECL ' + diag(iPRECL )%desc = 'Large-scale precipitation rate' + diag(iPRECL )%unit = 'mm/day' + + diag(iPRECL_RH)%name = 'PRECL_RH' + diag(iPRECL_RH)%desc = 'Precipitation rate due to limit RH' + diag(iPRECL_RH)%unit = 'mm/day' + + diag(iQ10M )%name = 'Q10M ' + diag(iQ10M )%desc = '10 meter Specific humidity' + diag(iQ10M )%unit = 'kg/kg' + diag(iQ10M )%adesc= 'Specific Humidity Interpolated to 10 Meters' + diag(iQ10M )%aunit= 'g/kg' + diag(iQ10M )%convfac = 1000.0 + + diag(iQ2M )%name = 'Q2M ' + diag(iQ2M )%desc = '2 meter Specific humidity' + diag(iQ2M )%unit = 'kg/kg' + diag(iQ2M )%adesc= 'Specific Humidity Interpolated to 2 Meters' + diag(iQ2M )%aunit= 'g/kg' + diag(iQ2M )%convfac = 1000.0 + + diag(iQFLX )%name = 'QFLX ' + diag(iQFLX )%desc = 'Surface water flux' + diag(iQFLX )%unit = 'kg/m2/s' + diag(iQFLX )%aname= 'EVAP ' + diag(iQFLX )%aunit= 'mm/day' + diag(iQFLX )%adesc= 'Surface Evaporation' + diag(iQFLX )%convfac = 86400.0 + + diag(iQPERT )%name = 'QPERT ' + diag(iQPERT )%desc = 'Perturbation specific humidity ' & + // '(eddies in PBL)' + diag(iQPERT )%unit = 'kg/kg' + + diag(iSHFX )%name = 'SHFX ' + diag(iSHFX )%desc = 'Surface sensible heat flux' + diag(iSHFX )%unit = 'W/m2' + diag(iSHFX )%aname= 'HFLUX ' + diag(iSHFX )%adesc= 'Sensible Heat Flux (pos.upwrd)' + + diag(iSLP )%name = 'SLP ' + diag(iSLP )%desc = 'Sea level pressure' + diag(iSLP )%unit = 'Pa' + diag(iSLP )%aunit= 'hPa' + diag(iSLP )%convfac = 0.01 + + diag(iSNOWDP )%name = 'SNOWDP ' + diag(iSNOWDP )%desc = 'Snow depth' + diag(iSNOWDP )%unit = 'm' + diag(iSNOWDP )%aname= 'SNOWDPTH' + diag(iSNOWDP )%adesc= 'Snow Depth (mm)' + diag(iSNOWDP )%aunit= 'mm' + diag(iSNOWDP )%convfac = 1000.0 + + diag(iSNOWH )%name = 'SNOWH ' + diag(iSNOWH )%desc = 'Water equivalent snow depth' + diag(iSNOWH )%unit = 'm' + diag(iSNOWH )%aname= 'SNOW ' + diag(iSNOWH )%adesc= 'Snow Depth (mm water equivalent)' + diag(iSNOWH )%aunit= 'mm' + diag(iSNOWH )%convfac = 1000.0 + + diag(iSOILWC1 )%name = 'SOILWC1 ' + diag(iSOILWC1 )%desc = 'Total column soil water content for soil tiles' + diag(iSOILWC1 )%unit = 'mm' + + diag(iSOILWC2 )%name = 'SOILWC2 ' + diag(iSOILWC2 )%desc = 'Total column soil water content for water budget' + diag(iSOILWC2 )%unit = 'mm' + + diag(iSOLIN )%name = 'SOLIN ' + diag(iSOLIN )%desc = 'Solar insolation' + diag(iSOLIN )%unit = 'W/m2' + diag(iSOLIN )%aname= 'RADSWT ' + diag(iSOLIN )%adesc= 'Incident Shortwave Radiation at TOA' + + diag(iSRFRAD )%name = 'SRFRAD ' + diag(iSRFRAD )%desc = 'Net radiative forcing at surface (net SW + downward LW)' + diag(iSRFRAD )%unit = 'W/m2' + + diag(iSRUNOFF )%name = 'SRUNOFF ' + diag(iSRUNOFF )%desc = 'Surface runoff' + diag(iSRUNOFF )%unit = 'mm/s' + + diag(iSURFP )%name = 'SURFP ' + diag(iSURFP )%desc = 'Surface pressure' + diag(iSURFP )%unit = 'Pa' + diag(iSURFP )%aname= 'PS ' + diag(iSURFP )%aunit= 'hPa' + diag(iSURFP )%convfac = 0.01 + + diag(iT10M )%name = 'T10M ' + diag(iT10M )%desc = '10 meter temperature' + diag(iT10M )%unit = 'K' + diag(iT10M )%adesc= 'Temperature Interpolated to 10 Meters' + + diag(iT200 )%name = 'T200 ' + diag(iT200 )%desc = '200 hPa temperature' + diag(iT200 )%unit = 'K' + + diag(iT2M )%name = 'T2M ' + diag(iT2M )%desc = '2 meter temperature' + diag(iT2M )%unit = 'K' + diag(iT2M )%adesc= 'Temperature Interpolated to 2 Meters' + + diag(iT850 )%name = 'T850 ' + diag(iT850 )%desc = '850 hPa temperature' + diag(iT850 )%unit = 'K' + diag(iT850 )%counted = .true. + + diag(iTAUCLI )%name = 'TAUCLI ' + diag(iTAUCLI )%desc = 'Cloud Optical Depth Ice' + diag(iTAUCLI )%unit = 'unitless' + diag(iTAUCLI )%counted = .true. + + diag(iTAUCLW )%name = 'TAUCLW ' + diag(iTAUCLW )%desc = 'Cloud Optical Depth Water' + diag(iTAUCLW )%unit = 'unitless' + diag(iTAUCLW )%counted = .true. + + diag(iTAUGWX )%name = 'TAUGWX ' + diag(iTAUGWX )%desc = 'East-west gravity wave drag surface stress' + diag(iTAUGWX )%unit = 'N/m2' + diag(iTAUGWX )%aname= 'GWDUS ' + diag(iTAUGWX )%adesc= 'Zonal Wind Gravity Wave Surface Stress' + + diag(iTAUGWY )%name = 'TAUGWY ' + diag(iTAUGWY )%desc = 'North-south gravity wave drag surface stress' + diag(iTAUGWY )%unit = 'N/m2' + diag(iTAUGWY )%aname= 'GWDVS ' + diag(iTAUGWY )%adesc= 'Meridional Wind Gravity Wave Surface Stress' + + diag(iTAUX )%name = 'TAUX ' + diag(iTAUX )%desc = 'X-component (east-west) of surface stress' + diag(iTAUX )%unit = 'N/m2' + diag(iTAUX )%aname= 'UFLUX ' + diag(iTAUX )%adesc= 'Zonal Wind Surface Stress' + + diag(iTAUY )%name = 'TAUY ' + diag(iTAUY )%desc = 'Y-component (north-south) of surface stress' + diag(iTAUY )%unit = 'N/m2' + diag(iTAUY )%aname= 'VFLUX ' + diag(iTAUY )%adesc= 'Meridional Wind Surface Stress' + + diag(iTHICK )%name = 'THICK ' + diag(iTHICK )%desc = 'Thickness of the 500 hPa to 1000 hPa Layer (5400m = freezing line)' + diag(iTHICK )%unit = 'm' + + diag(iTLAKE1 )%name = 'TLAKE1 ' + diag(iTLAKE1 )%desc = 'Top layer lake temperature' + diag(iTLAKE1 )%unit = 'K' + + diag(iTPERT )%name = 'TPERT ' + diag(iTPERT )%desc = 'Perturbation temperature (eddies in PBL)' + diag(iTPERT )%unit = 'K' + + diag(iTQ )%name = 'TQ ' + diag(iTQ )%desc = 'Total precipitable water' + diag(iTQ )%unit = 'kg/m2' + diag(iTQ )%aname= 'TPW ' + diag(iTQ )%aunit= 'g/cm2' + diag(iTQ )%convfac = 0.1 + + diag(iTRAD )%name = 'TRAD ' + diag(iTRAD )%desc = 'Surface brightness temperature (average of tile brightness temperature' + diag(iTRAD )%unit = 'K' + + diag(iTROPP )%name = 'TROPP ' + diag(iTROPP )%desc = 'Tropopause pressure' + diag(iTROPP )%unit = 'Pa' + diag(iTROPP )%aunit= 'hPa' + diag(iTROPP )%convfac = 0.01 + diag(iTROPP )%counted = .true. + + diag(iTROPQ )%name = 'TROPQ ' + diag(iTROPQ )%desc = 'Tropopause specific humidity' + diag(iTROPQ )%unit = 'kg/kg' + diag(iTROPQ )%aunit= 'g/kg' + diag(iTROPQ )%convfac = 1000. + diag(iTROPQ )%counted = .true. + + diag(iTROPT )%name = 'TROPT ' + diag(iTROPT )%desc = 'Tropopause temperature' + diag(iTROPT )%unit = 'K' + diag(iTROPT )%counted = .true. + + diag(iTSKIN )%name = 'TSKIN ' + diag(iTSKIN )%desc = 'Surface skin temperature for CERES (derived from tile IR flux' + diag(iTSKIN )%unit = 'K' + + diag(iTSLAKE )%name = 'TSLAKE ' + diag(iTSLAKE )%desc = 'Lake skin temperature' + diag(iTSLAKE )%unit = 'K' + + diag(iTSOIL1 )%name = 'TSOIL1 ' + diag(iTSOIL1 )%desc = 'Top layer soil temperature' + diag(iTSOIL1 )%unit = 'K' + + diag(iTVEG )%name = 'TVEG ' + diag(iTVEG )%desc = 'Bulk vegetation temperature' + diag(iTVEG )%unit = 'K' + + diag(iU10M )%name = 'U10M ' + diag(iU10M )%desc = '10 meter U wind' + diag(iU10M )%unit = 'm/s' + diag(iU10M )%adesc= 'Zonal Wind Interpolated to 10 Meters' + + diag(iU200 )%name = 'U200 ' + diag(iU200 )%desc = '200 hPa U wind' + diag(iU200 )%unit = 'm/s' + + diag(iU2M )%name = 'U2M ' + diag(iU2M )%desc = '2 meter U wind' + diag(iU2M )%unit = 'm/s' + diag(iU2M )%adesc= 'Zonal Wind Interpolated to 2 Meters' + + diag(iU500 )%name = 'U500 ' + diag(iU500 )%desc = '500 hPa U wind' + diag(iU500 )%unit = 'm/s' + + diag(iU850 )%name = 'U850 ' + diag(iU850 )%desc = '850 hPa U wind' + diag(iU850 )%unit = 'm/s' + diag(iU850 )%counted = .true. + + diag(iUSTAR )%name = 'USTAR ' + diag(iUSTAR )%desc = 'Surface friction velocity' + diag(iUSTAR )%unit = 'm/s' + diag(iUSTAR )%adesc= 'Friction velocity' + + diag(iV10M )%name = 'V10M ' + diag(iV10M )%desc = '10 meter V wind' + diag(iV10M )%unit = 'm/s' + diag(iV10M )%adesc= 'Meridional Wind Interpolated to 10 Meters' + + diag(iV200 )%name = 'V200 ' + diag(iV200 )%desc = '200 hPa V wind' + diag(iV200 )%unit = 'm/s' + + diag(iV2M )%name = 'V2M ' + diag(iV2M )%desc = '2 meter V wind' + diag(iV2M )%unit = 'm/s' + diag(iV2M )%adesc= 'Meridional Wind Interpolated to 2 Meters' + + diag(iV500 )%name = 'V500 ' + diag(iV500 )%desc = '500 hPa V wind' + diag(iV500 )%unit = 'm/s' + + diag(iV850 )%name = 'V850 ' + diag(iV850 )%desc = '850 hPa V wind' + diag(iV850 )%unit = 'm/s' + diag(iV850 )%counted = .true. + + diag(iVAVET )%name = 'VAVET ' + diag(iVAVET )%desc = 'Vertically averaged temperature' + diag(iVAVET )%unit = 'K' + + diag(iVAVEU )%name = 'VAVEU ' + diag(iVAVEU )%desc = 'Vertically averaged U Wind' + diag(iVAVEU )%unit = 'm/s' + + diag(iVAVEUQ )%name = 'VAVEUQ ' + diag(iVAVEUQ )%desc = 'Vertically averaged U Wind * specific humidity' + diag(iVAVEUQ )%unit = 'm/s*kg/kg' + diag(iVAVEUQ )%aunit= 'm/s*g/kg' + diag(iVAVEUQ )%convfac = 1000.0 + + diag(iVAVEUT )%name = 'VAVEUT ' + diag(iVAVEUT )%desc = 'Vertically averaged U Wind * temperature' + diag(iVAVEUT )%unit = 'Km/s' + + diag(iVAVEV )%name = 'VAVEV ' + diag(iVAVEV )%desc = 'Vertically averaged V Wind' + diag(iVAVEV )%unit = 'm/s' + + diag(iVAVEVQ )%name = 'VAVEVQ ' + diag(iVAVEVQ )%desc = 'Vertically averaged V Wind * specific humidity' + diag(iVAVEVQ )%unit = 'm/s*kg/kg' + diag(iVAVEVQ )%aunit= 'm/s*g/kg' + diag(iVAVEVQ )%convfac = 1000.0 + + diag(iVAVEVT )%name = 'VAVEVT ' + diag(iVAVEVT )%desc = 'Vertically averaged V Wind * temperature' + diag(iVAVEVT )%unit = 'Km/s' + + diag(iWATCAN )%name = 'WATCAN ' + diag(iWATCAN )%desc = 'Water on canopy' + diag(iWATCAN )%unit = 'mm' + + diag(iWBALLAKE)%name = 'WBALLAKE' + diag(iWBALLAKE)%desc = 'Water balance term for lake, wet land, and glacier' + diag(iWBALLAKE)%unit = 'mm/s' + + diag(iZ0H )%name = 'Z0H ' + diag(iZ0H )%desc = 'Roughness length, sensible heat' + diag(iZ0H )%unit = 'm' + + diag(iZ0M )%name = 'Z0M ' + diag(iZ0M )%desc = 'Roughness length, momentum' + diag(iZ0M )%unit = 'm' + + diag(iZMMB )%name = 'ZMMB ' + diag(iZMMB )%desc = 'Cloud base mass flux from Z&M scheme' + diag(iZMMB )%unit = 'kg/m2/s' + + diag(iZMPR )%name = 'ZMPR ' + diag(iZMPR )%desc = 'Precipitation from Z&M scheme' + diag(iZMPR )%unit = 'mm/day' + + diag(iZPD )%name = 'ZPD ' + diag(iZPD )%desc = 'Displacement height' + diag(iZPD )%unit = 'm' + +#ifdef FVCHEM + + diag(iDUEM001 )%name = 'DUEM001 ' + diag(iDUEM001 )%desc = 'Dust Emission Bin 1' + diag(iDUEM001 )%unit = 'kg/m2/s' + + diag(iDUEM002 )%name = 'DUEM002 ' + diag(iDUEM002 )%desc = 'Dust Emission Bin 2' + diag(iDUEM002 )%unit = 'kg/m2/s' + + diag(iDUEM003 )%name = 'DUEM003 ' + diag(iDUEM003 )%desc = 'Dust Emission Bin 3' + diag(iDUEM003 )%unit = 'kg/m2/s' + + diag(iDUEM004 )%name = 'DUEM004 ' + diag(iDUEM004 )%desc = 'Dust Emission Bin 4' + diag(iDUEM004 )%unit = 'kg/m2/s' + + diag(iDUEM005 )%name = 'DUEM005 ' + diag(iDUEM005 )%desc = 'Dust Emission Bin 5' + diag(iDUEM005 )%unit = 'kg/m2/s' + + diag(iDUEM006 )%name = 'DUEM006 ' + diag(iDUEM006 )%desc = 'Dust Emission Bin 6' + diag(iDUEM006 )%unit = 'kg/m2/s' + + diag(iDUEM007 )%name = 'DUEM007 ' + diag(iDUEM007 )%desc = 'Dust Emission Bin 7' + diag(iDUEM007 )%unit = 'kg/m2/s' + + diag(iDUEM008 )%name = 'DUEM008 ' + diag(iDUEM008 )%desc = 'Dust Emission Bin 8' + diag(iDUEM008 )%unit = 'kg/m2/s' + + diag(iDUSD001 )%name = 'DUSD001 ' + diag(iDUSD001 )%desc = 'Dust Sedimentation Bin 1' + diag(iDUSD001 )%unit = 'kg/m2/s' + + diag(iDUSD002 )%name = 'DUSD002 ' + diag(iDUSD002 )%desc = 'Dust Sedimentation Bin 2' + diag(iDUSD002 )%unit = 'kg/m2/s' + + diag(iDUSD003 )%name = 'DUSD003 ' + diag(iDUSD003 )%desc = 'Dust Sedimentation Bin 3' + diag(iDUSD003 )%unit = 'kg/m2/s' + + diag(iDUSD004 )%name = 'DUSD004 ' + diag(iDUSD004 )%desc = 'Dust Sedimentation Bin 4' + diag(iDUSD004 )%unit = 'kg/m2/s' + + diag(iDUSD005 )%name = 'DUSD005 ' + diag(iDUSD005 )%desc = 'Dust Sedimentation Bin 5' + diag(iDUSD005 )%unit = 'kg/m2/s' + + diag(iDUSD006 )%name = 'DUSD006 ' + diag(iDUSD006 )%desc = 'Dust Sedimentation Bin 6' + diag(iDUSD006 )%unit = 'kg/m2/s' + + diag(iDUSD007 )%name = 'DUSD007 ' + diag(iDUSD007 )%desc = 'Dust Sedimentation Bin 7' + diag(iDUSD007 )%unit = 'kg/m2/s' + + diag(iDUSD008 )%name = 'DUSD008 ' + diag(iDUSD008 )%desc = 'Dust Sedimentation Bin 8' + diag(iDUSD008 )%unit = 'kg/m2/s' + + diag(iDUDP001 )%name = 'DUDP001 ' + diag(iDUDP001 )%desc = 'Dust Dry Deposition Bin 1' + diag(iDUDP001 )%unit = 'kg/m2/s' + + diag(iDUDP002 )%name = 'DUDP002 ' + diag(iDUDP002 )%desc = 'Dust Dry Deposition Bin 2' + diag(iDUDP002 )%unit = 'kg/m2/s' + + diag(iDUDP003 )%name = 'DUDP003 ' + diag(iDUDP003 )%desc = 'Dust Dry Deposition Bin 3' + diag(iDUDP003 )%unit = 'kg/m2/s' + + diag(iDUDP004 )%name = 'DUDP004 ' + diag(iDUDP004 )%desc = 'Dust Dry Deposition Bin 4' + diag(iDUDP004 )%unit = 'kg/m2/s' + + diag(iDUDP005 )%name = 'DUDP005 ' + diag(iDUDP005 )%desc = 'Dust Dry Deposition Bin 5' + diag(iDUDP005 )%unit = 'kg/m2/s' + + diag(iDUDP006 )%name = 'DUDP006 ' + diag(iDUDP006 )%desc = 'Dust Dry Deposition Bin 6' + diag(iDUDP006 )%unit = 'kg/m2/s' + + diag(iDUDP007 )%name = 'DUDP007 ' + diag(iDUDP007 )%desc = 'Dust Dry Deposition Bin 7' + diag(iDUDP007 )%unit = 'kg/m2/s' + + diag(iDUDP008 )%name = 'DUDP008 ' + diag(iDUDP008 )%desc = 'Dust Dry Deposition Bin 8' + diag(iDUDP008 )%unit = 'kg/m2/s' + + diag(iDUWT001 )%name = 'DUWT001 ' + diag(iDUWT001 )%desc = 'Dust Wet Deposition Bin 1' + diag(iDUWT001 )%unit = 'kg/m2/s' + + diag(iDUWT002 )%name = 'DUWT002 ' + diag(iDUWT002 )%desc = 'Dust Wet Deposition Bin 2' + diag(iDUWT002 )%unit = 'kg/m2/s' + + diag(iDUWT003 )%name = 'DUWT003 ' + diag(iDUWT003 )%desc = 'Dust Wet Deposition Bin 3' + diag(iDUWT003 )%unit = 'kg/m2/s' + + diag(iDUWT004 )%name = 'DUWT004 ' + diag(iDUWT004 )%desc = 'Dust Wet Deposition Bin 4' + diag(iDUWT004 )%unit = 'kg/m2/s' + + diag(iDUWT005 )%name = 'DUWT005 ' + diag(iDUWT005 )%desc = 'Dust Wet Deposition Bin 5' + diag(iDUWT005 )%unit = 'kg/m2/s' + + diag(iDUWT006 )%name = 'DUWT006 ' + diag(iDUWT006 )%desc = 'Dust Wet Deposition Bin 6' + diag(iDUWT006 )%unit = 'kg/m2/s' + + diag(iDUWT007 )%name = 'DUWT007 ' + diag(iDUWT007 )%desc = 'Dust Wet Deposition Bin 7' + diag(iDUWT007 )%unit = 'kg/m2/s' + + diag(iDUWT008 )%name = 'DUWT008 ' + diag(iDUWT008 )%desc = 'Dust Wet Deposition Bin 8' + diag(iDUWT008 )%unit = 'kg/m2/s' + + diag(iDUSV001 )%name = 'DUSV001 ' + diag(iDUSV001 )%desc = 'Dust Convective Scavenging Bin 1' + diag(iDUSV001 )%unit = 'kg/m2/s' + + diag(iDUSV002 )%name = 'DUSV002 ' + diag(iDUSV002 )%desc = 'Dust Convective Scavenging Bin 2' + diag(iDUSV002 )%unit = 'kg/m2/s' + + diag(iDUSV003 )%name = 'DUSV003 ' + diag(iDUSV003 )%desc = 'Dust Convective Scavenging Bin 3' + diag(iDUSV003 )%unit = 'kg/m2/s' + + diag(iDUSV004 )%name = 'DUSV004 ' + diag(iDUSV004 )%desc = 'Dust Convective Scavenging Bin 4' + diag(iDUSV004 )%unit = 'kg/m2/s' + + diag(iDUSV005 )%name = 'DUSV005 ' + diag(iDUSV005 )%desc = 'Dust Convective Scavenging Bin 5' + diag(iDUSV005 )%unit = 'kg/m2/s' + + diag(iDUSV006 )%name = 'DUSV006 ' + diag(iDUSV006 )%desc = 'Dust Convective Scavenging Bin 6' + diag(iDUSV006 )%unit = 'kg/m2/s' + + diag(iDUSV007 )%name = 'DUSV007 ' + diag(iDUSV007 )%desc = 'Dust Convective Scavenging Bin 7' + diag(iDUSV007 )%unit = 'kg/m2/s' + + diag(iDUSV008 )%name = 'DUSV008 ' + diag(iDUSV008 )%desc = 'Dust Convective Scavenging Bin 8' + diag(iDUSV008 )%unit = 'kg/m2/s' + + diag(iDUSMASS )%name = 'DUSMASS ' + diag(iDUSMASS )%desc = 'Dust Surface Mass Concentration' + diag(iDUSMASS )%unit = 'kg/m3' + + diag(iDUCMASS )%name = 'DUCMASS ' + diag(iDUCMASS )%desc = 'Dust Column Mass Density' + diag(iDUCMASS )%unit = 'kg/m2' + + diag(iDUSMASS1 )%name = 'DUSMASS1 ' + diag(iDUSMASS1 )%desc = 'Dust sub-micron Surface Mass Concentration' + diag(iDUSMASS1 )%unit = 'kg/m3' + + diag(iDUCMASS1 )%name = 'DUCMASS1 ' + diag(iDUCMASS1 )%desc = 'Dust sub-micron Column Mass Density' + diag(iDUCMASS1 )%unit = 'kg/m2' + + diag(iDUEXTTAU )%name = 'DUEXTTAU ' + diag(iDUEXTTAU )%desc = 'Dust Extinction AOT [550 nm]' + diag(iDUEXTTAU )%unit = 'unitless' + + diag(iDUSCATAU )%name = 'DUSCATAU ' + diag(iDUSCATAU )%desc = 'Dust Scattering AOT [550 nm]' + diag(iDUSCATAU )%unit = 'unitless' + + diag(iDUAERIDX )%name = 'DUAERIDX ' + diag(iDUAERIDX )%desc = 'Dust TOMS UV Aerosol Index' + diag(iDUAERIDX )%unit = 'unitless' + + diag(iDUSM25 )%name = 'DUSM25 ' + diag(iDUSM25 )%desc = 'Dust Surface Mass Concentration (PM2.5)' + diag(iDUSM25 )%unit = 'kg/m3' + + diag(iDUCM25 )%name = 'DUCM25 ' + diag(iDUCM25 )%desc = 'Dust Column Mass Density (PM2.5)' + diag(iDUCM25 )%unit = 'kg/m2' + + diag(iDUEXTT25 )%name = 'DUEXTT25 ' + diag(iDUEXTT25 )%desc = 'Dust Extinction AOT [550 nm] (PM2.5)' + diag(iDUEXTT25 )%unit = 'unitless' + + diag(iDUSCAT25 )%name = 'DUSCAT25 ' + diag(iDUSCAT25 )%desc = 'Dust Scattering AOT [550 nm] (PM2.5)' + diag(iDUSCAT25 )%unit = 'unitless' + + diag(iSSEM001 )%name = 'SSEM001 ' + diag(iSSEM001 )%desc = 'Seasalt Emission Bin 1' + diag(iSSEM001 )%unit = 'kg/m2/s' + + diag(iSSEM002 )%name = 'SSEM002 ' + diag(iSSEM002 )%desc = 'Seasalt Emission Bin 2' + diag(iSSEM002 )%unit = 'kg/m2/s' + + diag(iSSEM003 )%name = 'SSEM003 ' + diag(iSSEM003 )%desc = 'Seasalt Emission Bin 3' + diag(iSSEM003 )%unit = 'kg/m2/s' + + diag(iSSEM004 )%name = 'SSEM004 ' + diag(iSSEM004 )%desc = 'Seasalt Emission Bin 4' + diag(iSSEM004 )%unit = 'kg/m2/s' + + diag(iSSEM005 )%name = 'SSEM005 ' + diag(iSSEM005 )%desc = 'Seasalt Emission Bin 5' + diag(iSSEM005 )%unit = 'kg/m2/s' + + diag(iSSEM006 )%name = 'SSEM006 ' + diag(iSSEM006 )%desc = 'Seasalt Emission Bin 6' + diag(iSSEM006 )%unit = 'kg/m2/s' + + diag(iSSEM007 )%name = 'SSEM007 ' + diag(iSSEM007 )%desc = 'Seasalt Emission Bin 7' + diag(iSSEM007 )%unit = 'kg/m2/s' + + diag(iSSEM008 )%name = 'SSEM008 ' + diag(iSSEM008 )%desc = 'Seasalt Emission Bin 8' + diag(iSSEM008 )%unit = 'kg/m2/s' + + diag(iSSSD001 )%name = 'SSSD001 ' + diag(iSSSD001 )%desc = 'Seasalt Sedimentation Bin 1' + diag(iSSSD001 )%unit = 'kg/m2/s' + + diag(iSSSD002 )%name = 'SSSD002 ' + diag(iSSSD002 )%desc = 'Seasalt Sedimentation Bin 2' + diag(iSSSD002 )%unit = 'kg/m2/s' + + diag(iSSSD003 )%name = 'SSSD003 ' + diag(iSSSD003 )%desc = 'Seasalt Sedimentation Bin 3' + diag(iSSSD003 )%unit = 'kg/m2/s' + + diag(iSSSD004 )%name = 'SSSD004 ' + diag(iSSSD004 )%desc = 'Seasalt Sedimentation Bin 4' + diag(iSSSD004 )%unit = 'kg/m2/s' + + diag(iSSSD005 )%name = 'SSSD005 ' + diag(iSSSD005 )%desc = 'Seasalt Sedimentation Bin 5' + diag(iSSSD005 )%unit = 'kg/m2/s' + + diag(iSSSD006 )%name = 'SSSD006 ' + diag(iSSSD006 )%desc = 'Seasalt Sedimentation Bin 6' + diag(iSSSD006 )%unit = 'kg/m2/s' + + diag(iSSSD007 )%name = 'SSSD007 ' + diag(iSSSD007 )%desc = 'Seasalt Sedimentation Bin 7' + diag(iSSSD007 )%unit = 'kg/m2/s' + + diag(iSSSD008 )%name = 'SSSD008 ' + diag(iSSSD008 )%desc = 'Seasalt Sedimentation Bin 8' + diag(iSSSD008 )%unit = 'kg/m2/s' + + diag(iSSDP001 )%name = 'SSDP001 ' + diag(iSSDP001 )%desc = 'Seasalt Dry Deposition Bin 1' + diag(iSSDP001 )%unit = 'kg/m2/s' + + diag(iSSDP002 )%name = 'SSDP002 ' + diag(iSSDP002 )%desc = 'Seasalt Dry Deposition Bin 2' + diag(iSSDP002 )%unit = 'kg/m2/s' + + diag(iSSDP003 )%name = 'SSDP003 ' + diag(iSSDP003 )%desc = 'Seasalt Dry Deposition Bin 3' + diag(iSSDP003 )%unit = 'kg/m2/s' + + diag(iSSDP004 )%name = 'SSDP004 ' + diag(iSSDP004 )%desc = 'Seasalt Dry Deposition Bin 4' + diag(iSSDP004 )%unit = 'kg/m2/s' + + diag(iSSDP005 )%name = 'SSDP005 ' + diag(iSSDP005 )%desc = 'Seasalt Dry Deposition Bin 5' + diag(iSSDP005 )%unit = 'kg/m2/s' + + diag(iSSDP006 )%name = 'SSDP006 ' + diag(iSSDP006 )%desc = 'Seasalt Dry Deposition Bin 6' + diag(iSSDP006 )%unit = 'kg/m2/s' + + diag(iSSDP007 )%name = 'SSDP007 ' + diag(iSSDP007 )%desc = 'Seasalt Dry Deposition Bin 7' + diag(iSSDP007 )%unit = 'kg/m2/s' + + diag(iSSDP008 )%name = 'SSDP008 ' + diag(iSSDP008 )%desc = 'Seasalt Dry Deposition Bin 8' + diag(iSSDP008 )%unit = 'kg/m2/s' + + diag(iSSWT001 )%name = 'SSWT001 ' + diag(iSSWT001 )%desc = 'Seasalt Wet Deposition Bin 1' + diag(iSSWT001 )%unit = 'kg/m2/s' + + diag(iSSWT002 )%name = 'SSWT002 ' + diag(iSSWT002 )%desc = 'Seasalt Wet Deposition Bin 2' + diag(iSSWT002 )%unit = 'kg/m2/s' + + diag(iSSWT003 )%name = 'SSWT003 ' + diag(iSSWT003 )%desc = 'Seasalt Wet Deposition Bin 3' + diag(iSSWT003 )%unit = 'kg/m2/s' + + diag(iSSWT004 )%name = 'SSWT004 ' + diag(iSSWT004 )%desc = 'Seasalt Wet Deposition Bin 4' + diag(iSSWT004 )%unit = 'kg/m2/s' + + diag(iSSWT005 )%name = 'SSWT005 ' + diag(iSSWT005 )%desc = 'Seasalt Wet Deposition Bin 5' + diag(iSSWT005 )%unit = 'kg/m2/s' + + diag(iSSWT006 )%name = 'SSWT006 ' + diag(iSSWT006 )%desc = 'Seasalt Wet Deposition Bin 6' + diag(iSSWT006 )%unit = 'kg/m2/s' + + diag(iSSWT007 )%name = 'SSWT007 ' + diag(iSSWT007 )%desc = 'Seasalt Wet Deposition Bin 7' + diag(iSSWT007 )%unit = 'kg/m2/s' + + diag(iSSWT008 )%name = 'SSWT008 ' + diag(iSSWT008 )%desc = 'Seasalt Wet Deposition Bin 8' + diag(iSSWT008 )%unit = 'kg/m2/s' + + diag(iSSSV001 )%name = 'SSSV001 ' + diag(iSSSV001 )%desc = 'Seasalt Convective Scavenging Bin 1' + diag(iSSSV001 )%unit = 'kg/m2/s' + + diag(iSSSV002 )%name = 'SSSV002 ' + diag(iSSSV002 )%desc = 'Seasalt Convective Scavenging Bin 2' + diag(iSSSV002 )%unit = 'kg/m2/s' + + diag(iSSSV003 )%name = 'SSSV003 ' + diag(iSSSV003 )%desc = 'Seasalt Convective Scavenging Bin 3' + diag(iSSSV003 )%unit = 'kg/m2/s' + + diag(iSSSV004 )%name = 'SSSV004 ' + diag(iSSSV004 )%desc = 'Seasalt Convective Scavenging Bin 4' + diag(iSSSV004 )%unit = 'kg/m2/s' + + diag(iSSSV005 )%name = 'SSSV005 ' + diag(iSSSV005 )%desc = 'Seasalt Convective Scavenging Bin 5' + diag(iSSSV005 )%unit = 'kg/m2/s' + + diag(iSSSV006 )%name = 'SSSV006 ' + diag(iSSSV006 )%desc = 'Seasalt Convective Scavenging Bin 6' + diag(iSSSV006 )%unit = 'kg/m2/s' + + diag(iSSSV007 )%name = 'SSSV007 ' + diag(iSSSV007 )%desc = 'Seasalt Convective Scavenging Bin 7' + diag(iSSSV007 )%unit = 'kg/m2/s' + + diag(iSSSV008 )%name = 'SSSV008 ' + diag(iSSSV008 )%desc = 'Seasalt Convective Scavenging Bin 8' + diag(iSSSV008 )%unit = 'kg/m2/s' + + diag(iSSSMASS )%name = 'SSSMASS ' + diag(iSSSMASS )%desc = 'Seasalt Surface Mass Concentration' + diag(iSSSMASS )%unit = 'kg/m3' + + diag(iSSCMASS )%name = 'SSCMASS ' + diag(iSSCMASS )%desc = 'Seasalt Column Mass Density' + diag(iSSCMASS )%unit = 'kg/m2' + + diag(iSSEXTTAU )%name = 'SSEXTTAU ' + diag(iSSEXTTAU )%desc = 'Seasalt Extinction AOT [550 nm]' + diag(iSSEXTTAU )%unit = 'unitless' + + diag(iSSSCATAU )%name = 'SSSCATAU ' + diag(iSSSCATAU )%desc = 'Seasalt Scattering AOT [550 nm]' + diag(iSSSCATAU )%unit = 'unitless' + + diag(iSSSM25 )%name = 'SSSM25 ' + diag(iSSSM25 )%desc = 'Seasalt Surface Mass Concentration (PM2.5)' + diag(iSSSM25 )%unit = 'kg/m3' + + diag(iSSCM25 )%name = 'SSCM25 ' + diag(iSSCM25 )%desc = 'Seasalt Column Mass Density (PM2.5)' + diag(iSSCM25 )%unit = 'kg/m2' + + diag(iSSEXTT25 )%name = 'SSEXTT25 ' + diag(iSSEXTT25 )%desc = 'Seasalt Extinction AOT [550 nm] (PM2.5)' + diag(iSSEXTT25 )%unit = 'unitless' + + diag(iSSSCAT25 )%name = 'SSSCAT25 ' + diag(iSSSCAT25 )%desc = 'Seasalt Scattering AOT [550 nm] (PM2.5)' + diag(iSSSCAT25 )%unit = 'unitless' + + diag(iBCEM001 )%name = 'BCEM001 ' + diag(iBCEM001 )%desc = 'Black Carbon Emission Bin 1' + diag(iBCEM001 )%unit = 'kg/m2/s' + + diag(iBCEM002 )%name = 'BCEM002 ' + diag(iBCEM002 )%desc = 'Black Carbon Emission Bin 2' + diag(iBCEM002 )%unit = 'kg/m2/s' + + diag(iBCEM003 )%name = 'BCEM003 ' + diag(iBCEM003 )%desc = 'Black Carbon Emission Bin 3' + diag(iBCEM003 )%unit = 'kg/m2/s' + + diag(iBCEM004 )%name = 'BCEM004 ' + diag(iBCEM004 )%desc = 'Black Carbon Emission Bin 4' + diag(iBCEM004 )%unit = 'kg/m2/s' + + diag(iBCEM005 )%name = 'BCEM005 ' + diag(iBCEM005 )%desc = 'Black Carbon Emission Bin 5' + diag(iBCEM005 )%unit = 'kg/m2/s' + + diag(iBCEM006 )%name = 'BCEM006 ' + diag(iBCEM006 )%desc = 'Black Carbon Emission Bin 6' + diag(iBCEM006 )%unit = 'kg/m2/s' + + diag(iBCEM007 )%name = 'BCEM007 ' + diag(iBCEM007 )%desc = 'Black Carbon Emission Bin 7' + diag(iBCEM007 )%unit = 'kg/m2/s' + + diag(iBCEM008 )%name = 'BCEM008 ' + diag(iBCEM008 )%desc = 'Black Carbon Emission Bin 8' + diag(iBCEM008 )%unit = 'kg/m2/s' + + diag(iBCDP001 )%name = 'BCDP001 ' + diag(iBCDP001 )%desc = 'Black Carbon Deposition Bin 1' + diag(iBCDP001 )%unit = 'kg/m2/s' + + diag(iBCDP002 )%name = 'BCDP002 ' + diag(iBCDP002 )%desc = 'Black Carbon Deposition Bin 2' + diag(iBCDP002 )%unit = 'kg/m2/s' + + diag(iBCDP003 )%name = 'BCDP003 ' + diag(iBCDP003 )%desc = 'Black Carbon Deposition Bin 3' + diag(iBCDP003 )%unit = 'kg/m2/s' + + diag(iBCDP004 )%name = 'BCDP004 ' + diag(iBCDP004 )%desc = 'Black Carbon Deposition Bin 4' + diag(iBCDP004 )%unit = 'kg/m2/s' + + diag(iBCDP005 )%name = 'BCDP005 ' + diag(iBCDP005 )%desc = 'Black Carbon Deposition Bin 5' + diag(iBCDP005 )%unit = 'kg/m2/s' + + diag(iBCDP006 )%name = 'BCDP006 ' + diag(iBCDP006 )%desc = 'Black Carbon Deposition Bin 6' + diag(iBCDP006 )%unit = 'kg/m2/s' + + diag(iBCDP007 )%name = 'BCDP007 ' + diag(iBCDP007 )%desc = 'Black Carbon Deposition Bin 7' + diag(iBCDP007 )%unit = 'kg/m2/s' + + diag(iBCDP008 )%name = 'BCDP008 ' + diag(iBCDP008 )%desc = 'Black Carbon Deposition Bin 8' + diag(iBCDP008 )%unit = 'kg/m2/s' + + diag(iBCWT001 )%name = 'BCWT001 ' + diag(iBCWT001 )%desc = 'Black Carbon Wet Deposition Bin 1' + diag(iBCWT001 )%unit = 'kg/m2/s' + + diag(iBCWT002 )%name = 'BCWT002 ' + diag(iBCWT002 )%desc = 'Black Carbon Wet Deposition Bin 2' + diag(iBCWT002 )%unit = 'kg/m2/s' + + diag(iBCWT003 )%name = 'BCWT003 ' + diag(iBCWT003 )%desc = 'Black Carbon Wet Deposition Bin 3' + diag(iBCWT003 )%unit = 'kg/m2/s' + + diag(iBCWT004 )%name = 'BCWT004 ' + diag(iBCWT004 )%desc = 'Black Carbon Wet Deposition Bin 4' + diag(iBCWT004 )%unit = 'kg/m2/s' + + diag(iBCWT005 )%name = 'BCWT005 ' + diag(iBCWT005 )%desc = 'Black Carbon Wet Deposition Bin 5' + diag(iBCWT005 )%unit = 'kg/m2/s' + + diag(iBCWT006 )%name = 'BCWT006 ' + diag(iBCWT006 )%desc = 'Black Carbon Wet Deposition Bin 6' + diag(iBCWT006 )%unit = 'kg/m2/s' + + diag(iBCWT007 )%name = 'BCWT007 ' + diag(iBCWT007 )%desc = 'Black Carbon Wet Deposition Bin 7' + diag(iBCWT007 )%unit = 'kg/m2/s' + + diag(iBCWT008 )%name = 'BCWT008 ' + diag(iBCWT008 )%desc = 'Black Carbon Wet Deposition Bin 8' + diag(iBCWT008 )%unit = 'kg/m2/s' + + diag(iBCSV001 )%name = 'BCSV001 ' + diag(iBCSV001 )%desc = 'Black Carbon Convective Scavenging Bin 1' + diag(iBCSV001 )%unit = 'kg/m2/s' + + diag(iBCSV002 )%name = 'BCSV002 ' + diag(iBCSV002 )%desc = 'Black Carbon Convective Scavenging Bin 2' + diag(iBCSV002 )%unit = 'kg/m2/s' + + diag(iBCSV003 )%name = 'BCSV003 ' + diag(iBCSV003 )%desc = 'Black Carbon Convective Scavenging Bin 3' + diag(iBCSV003 )%unit = 'kg/m2/s' + + diag(iBCSV004 )%name = 'BCSV004 ' + diag(iBCSV004 )%desc = 'Black Carbon Convective Scavenging Bin 4' + diag(iBCSV004 )%unit = 'kg/m2/s' + + diag(iBCSV005 )%name = 'BCSV005 ' + diag(iBCSV005 )%desc = 'Black Carbon Convective Scavenging Bin 5' + diag(iBCSV005 )%unit = 'kg/m2/s' + + diag(iBCSV006 )%name = 'BCSV006 ' + diag(iBCSV006 )%desc = 'Black Carbon Convective Scavenging Bin 6' + diag(iBCSV006 )%unit = 'kg/m2/s' + + diag(iBCSV007 )%name = 'BCSV007 ' + diag(iBCSV007 )%desc = 'Black Carbon Convective Scavenging Bin 7' + diag(iBCSV007 )%unit = 'kg/m2/s' + + diag(iBCSV008 )%name = 'BCSV008 ' + diag(iBCSV008 )%desc = 'Black Carbon Convective Scavenging Bin 8' + diag(iBCSV008 )%unit = 'kg/m2/s' + + diag(iBCSMASS )%name = 'BCSMASS ' + diag(iBCSMASS )%desc = 'Black Carbon Surface Mass Concentration' + diag(iBCSMASS )%unit = 'kg/m3' + + diag(iBCCMASS )%name = 'BCCMASS ' + diag(iBCCMASS )%desc = 'Black Carbon Column Mass Density' + diag(iBCCMASS )%unit = 'kg/m2' + + diag(iBCEXTTAU )%name = 'BCEXTTAU ' + diag(iBCEXTTAU )%desc = 'Black Carbon Extinction AOT [550 nm]' + diag(iBCEXTTAU )%unit = 'unitless' + + diag(iBCSCATAU )%name = 'BCSCATAU ' + diag(iBCSCATAU )%desc = 'Black Carbon Scattering AOT [550 nm]' + diag(iBCSCATAU )%unit = 'unitless' + + diag(iBCEMAN )%name = 'BCEMAN ' + diag(iBCEMAN )%desc = 'Black Carbon Anthropogenic Emissions' + diag(iBCEMAN )%unit = 'kg/m2/s' + + diag(iBCEMBB )%name = 'BCEMBB ' + diag(iBCEMBB )%desc = 'Black Carbon Biomass Burning Emissions' + diag(iBCEMBB )%unit = 'kg/m2/s' + + diag(iBCEMBF )%name = 'BCEMBF ' + diag(iBCEMBF )%desc = 'Black Carbon Biofuel Emissions' + diag(iBCEMBF )%unit = 'kg/m2/s' + + diag(iBCHYPHIL )%name = 'BCHYPHIL ' + diag(iBCHYPHIL )%desc = 'Black Carbon Conversion of Hydrophobic to Hydrophilic' + diag(iBCHYPHIL )%unit = 'kg/m2/s' + + diag(iOCEM001 )%name = 'OCEM001 ' + diag(iOCEM001 )%desc = 'Organic Carbon Emission Bin 1' + diag(iOCEM001 )%unit = 'kg/m2/s' + + diag(iOCEM002 )%name = 'OCEM002 ' + diag(iOCEM002 )%desc = 'Organic Carbon Emission Bin 2' + diag(iOCEM002 )%unit = 'kg/m2/s' + + diag(iOCEM003 )%name = 'OCEM003 ' + diag(iOCEM003 )%desc = 'Organic Carbon Emission Bin 3' + diag(iOCEM003 )%unit = 'kg/m2/s' + + diag(iOCEM004 )%name = 'OCEM004 ' + diag(iOCEM004 )%desc = 'Organic Carbon Emission Bin 4' + diag(iOCEM004 )%unit = 'kg/m2/s' + + diag(iOCEM005 )%name = 'OCEM005 ' + diag(iOCEM005 )%desc = 'Organic Carbon Emission Bin 5' + diag(iOCEM005 )%unit = 'kg/m2/s' + + diag(iOCEM006 )%name = 'OCEM006 ' + diag(iOCEM006 )%desc = 'Organic Carbon Emission Bin 6' + diag(iOCEM006 )%unit = 'kg/m2/s' + + diag(iOCEM007 )%name = 'OCEM007 ' + diag(iOCEM007 )%desc = 'Organic Carbon Emission Bin 7' + diag(iOCEM007 )%unit = 'kg/m2/s' + + diag(iOCEM008 )%name = 'OCEM008 ' + diag(iOCEM008 )%desc = 'Organic Carbon Emission Bin 8' + diag(iOCEM008 )%unit = 'kg/m2/s' + + diag(iOCDP001 )%name = 'OCDP001 ' + diag(iOCDP001 )%desc = 'Organic Carbon Deposition Bin 1' + diag(iOCDP001 )%unit = 'kg/m2/s' + + diag(iOCDP002 )%name = 'OCDP002 ' + diag(iOCDP002 )%desc = 'Organic Carbon Deposition Bin 2' + diag(iOCDP002 )%unit = 'kg/m2/s' + + diag(iOCDP003 )%name = 'OCDP003 ' + diag(iOCDP003 )%desc = 'Organic Carbon Deposition Bin 3' + diag(iOCDP003 )%unit = 'kg/m2/s' + + diag(iOCDP004 )%name = 'OCDP004 ' + diag(iOCDP004 )%desc = 'Organic Carbon Deposition Bin 4' + diag(iOCDP004 )%unit = 'kg/m2/s' + + diag(iOCDP005 )%name = 'OCDP005 ' + diag(iOCDP005 )%desc = 'Organic Carbon Deposition Bin 5' + diag(iOCDP005 )%unit = 'kg/m2/s' + + diag(iOCDP006 )%name = 'OCDP006 ' + diag(iOCDP006 )%desc = 'Organic Carbon Deposition Bin 6' + diag(iOCDP006 )%unit = 'kg/m2/s' + + diag(iOCDP007 )%name = 'OCDP007 ' + diag(iOCDP007 )%desc = 'Organic Carbon Deposition Bin 7' + diag(iOCDP007 )%unit = 'kg/m2/s' + + diag(iOCDP008 )%name = 'OCDP008 ' + diag(iOCDP008 )%desc = 'Organic Carbon Deposition Bin 8' + diag(iOCDP008 )%unit = 'kg/m2/s' + + diag(iOCWT001 )%name = 'OCWT001 ' + diag(iOCWT001 )%desc = 'Organic Carbon Wet Deposition Bin 1' + diag(iOCWT001 )%unit = 'kg/m2/s' + + diag(iOCWT002 )%name = 'OCWT002 ' + diag(iOCWT002 )%desc = 'Organic Carbon Wet Deposition Bin 2' + diag(iOCWT002 )%unit = 'kg/m2/s' + + diag(iOCWT003 )%name = 'OCWT003 ' + diag(iOCWT003 )%desc = 'Organic Carbon Wet Deposition Bin 3' + diag(iOCWT003 )%unit = 'kg/m2/s' + + diag(iOCWT004 )%name = 'OCWT004 ' + diag(iOCWT004 )%desc = 'Organic Carbon Wet Deposition Bin 4' + diag(iOCWT004 )%unit = 'kg/m2/s' + + diag(iOCWT005 )%name = 'OCWT005 ' + diag(iOCWT005 )%desc = 'Organic Carbon Wet Deposition Bin 5' + diag(iOCWT005 )%unit = 'kg/m2/s' + + diag(iOCWT006 )%name = 'OCWT006 ' + diag(iOCWT006 )%desc = 'Organic Carbon Wet Deposition Bin 6' + diag(iOCWT006 )%unit = 'kg/m2/s' + + diag(iOCWT007 )%name = 'OCWT007 ' + diag(iOCWT007 )%desc = 'Organic Carbon Wet Deposition Bin 7' + diag(iOCWT007 )%unit = 'kg/m2/s' + + diag(iOCWT008 )%name = 'OCWT008 ' + diag(iOCWT008 )%desc = 'Organic Carbon Wet Deposition Bin 8' + diag(iOCWT008 )%unit = 'kg/m2/s' + + diag(iOCSV001 )%name = 'OCSV001 ' + diag(iOCSV001 )%desc = 'Organic Carbon Convective Scavenging Bin 1' + diag(iOCSV001 )%unit = 'kg/m2/s' + + diag(iOCSV002 )%name = 'OCSV002 ' + diag(iOCSV002 )%desc = 'Organic Carbon Convective Scavenging Bin 2' + diag(iOCSV002 )%unit = 'kg/m2/s' + + diag(iOCSV003 )%name = 'OCSV003 ' + diag(iOCSV003 )%desc = 'Organic Carbon Convective Scavenging Bin 3' + diag(iOCSV003 )%unit = 'kg/m2/s' + + diag(iOCSV004 )%name = 'OCSV004 ' + diag(iOCSV004 )%desc = 'Organic Carbon Convective Scavenging Bin 4' + diag(iOCSV004 )%unit = 'kg/m2/s' + + diag(iOCSV005 )%name = 'OCSV005 ' + diag(iOCSV005 )%desc = 'Organic Carbon Convective Scavenging Bin 5' + diag(iOCSV005 )%unit = 'kg/m2/s' + + diag(iOCSV006 )%name = 'OCSV006 ' + diag(iOCSV006 )%desc = 'Organic Carbon Convective Scavenging Bin 6' + diag(iOCSV006 )%unit = 'kg/m2/s' + + diag(iOCSV007 )%name = 'OCSV007 ' + diag(iOCSV007 )%desc = 'Organic Carbon Convective Scavenging Bin 7' + diag(iOCSV007 )%unit = 'kg/m2/s' + + diag(iOCSV008 )%name = 'OCSV008 ' + diag(iOCSV008 )%desc = 'Organic Carbon Convective Scavenging Bin 8' + diag(iOCSV008 )%unit = 'kg/m2/s' + + diag(iOCSMASS )%name = 'OCSMASS ' + diag(iOCSMASS )%desc = 'Organic Carbon Surface Mass Concentration' + diag(iOCSMASS )%unit = 'kg/m3' + + diag(iOCCMASS )%name = 'OCCMASS ' + diag(iOCCMASS )%desc = 'Organic Carbon Column Mass Density' + diag(iOCCMASS )%unit = 'kg/m2' + + diag(iOCEXTTAU )%name = 'OCEXTTAU ' + diag(iOCEXTTAU )%desc = 'Organic Carbon Extinction AOT [550 nm]' + diag(iOCEXTTAU )%unit = 'unitless' + + diag(iOCSCATAU )%name = 'OCSCATAU ' + diag(iOCSCATAU )%desc = 'Organic Carbon Scattering AOT [550 nm]' + diag(iOCSCATAU )%unit = 'unitless' + + diag(iOCEMAN )%name = 'OCEMAN ' + diag(iOCEMAN )%desc = 'Organic Carbon Anthropogenic Emissions' + diag(iOCEMAN )%unit = 'kg/m2/s' + + diag(iOCEMBB )%name = 'OCEMBB ' + diag(iOCEMBB )%desc = 'Organic Carbon Biomass Burning Emissions' + diag(iOCEMBB )%unit = 'kg/m2/s' + + diag(iOCEMBF )%name = 'OCEMBF ' + diag(iOCEMBF )%desc = 'Organic Carbon Biofuel Emissions' + diag(iOCEMBF )%unit = 'kg/m2/s' + + diag(iOCEMBG )%name = 'OCEMBG ' + diag(iOCEMBG )%desc = 'Organic Carbon Biogenic Emissions' + diag(iOCEMBG )%unit = 'kg/m2/s' + + diag(iOCHYPHIL )%name = 'OCHYPHIL ' + diag(iOCHYPHIL )%desc = 'Organic Carbon Conversion of Hydrophobic to Hydrophilic' + diag(iOCHYPHIL )%unit = 'kg/m2/s' + + diag(iSUEM001 )%name = 'SUEM001 ' + diag(iSUEM001 )%desc = 'Sulfate Emission Bin 1' + diag(iSUEM001 )%unit = 'kg/m2/s' + + diag(iSUEM002 )%name = 'SUEM002 ' + diag(iSUEM002 )%desc = 'Sulfate Emission Bin 2' + diag(iSUEM002 )%unit = 'kg/m2/s' + + diag(iSUEM003 )%name = 'SUEM003 ' + diag(iSUEM003 )%desc = 'Sulfate Emission Bin 3' + diag(iSUEM003 )%unit = 'kg/m2/s' + + diag(iSUEM004 )%name = 'SUEM004 ' + diag(iSUEM004 )%desc = 'Sulfate Emission Bin 4' + diag(iSUEM004 )%unit = 'kg/m2/s' + + diag(iSUEM005 )%name = 'SUEM005 ' + diag(iSUEM005 )%desc = 'Sulfate Emission Bin 5' + diag(iSUEM005 )%unit = 'kg/m2/s' + + diag(iSUEM006 )%name = 'SUEM006 ' + diag(iSUEM006 )%desc = 'Sulfate Emission Bin 6' + diag(iSUEM006 )%unit = 'kg/m2/s' + + diag(iSUEM007 )%name = 'SUEM007 ' + diag(iSUEM007 )%desc = 'Sulfate Emission Bin 7' + diag(iSUEM007 )%unit = 'kg/m2/s' + + diag(iSUEM008 )%name = 'SUEM008 ' + diag(iSUEM008 )%desc = 'Sulfate Emission Bin 8' + diag(iSUEM008 )%unit = 'kg/m2/s' + + diag(iSUDP001 )%name = 'SUDP001 ' + diag(iSUDP001 )%desc = 'Sulfate Deposition Bin 1' + diag(iSUDP001 )%unit = 'kg/m2/s' + + diag(iSUDP002 )%name = 'SUDP002 ' + diag(iSUDP002 )%desc = 'Sulfate Deposition Bin 2' + diag(iSUDP002 )%unit = 'kg/m2/s' + + diag(iSUDP003 )%name = 'SUDP003 ' + diag(iSUDP003 )%desc = 'Sulfate Deposition Bin 3' + diag(iSUDP003 )%unit = 'kg/m2/s' + + diag(iSUDP004 )%name = 'SUDP004 ' + diag(iSUDP004 )%desc = 'Sulfate Deposition Bin 4' + diag(iSUDP004 )%unit = 'kg/m2/s' + + diag(iSUDP005 )%name = 'SUDP005 ' + diag(iSUDP005 )%desc = 'Sulfate Deposition Bin 5' + diag(iSUDP005 )%unit = 'kg/m2/s' + + diag(iSUDP006 )%name = 'SUDP006 ' + diag(iSUDP006 )%desc = 'Sulfate Deposition Bin 6' + diag(iSUDP006 )%unit = 'kg/m2/s' + + diag(iSUDP007 )%name = 'SUDP007 ' + diag(iSUDP007 )%desc = 'Sulfate Deposition Bin 7' + diag(iSUDP007 )%unit = 'kg/m2/s' + + diag(iSUDP008 )%name = 'SUDP008 ' + diag(iSUDP008 )%desc = 'Sulfate Deposition Bin 8' + diag(iSUDP008 )%unit = 'kg/m2/s' + + diag(iSUWT001 )%name = 'SUWT001 ' + diag(iSUWT001 )%desc = 'Sulfate Wet Deposition Bin 1' + diag(iSUWT001 )%unit = 'kg/m2/s' + + diag(iSUWT002 )%name = 'SUWT002 ' + diag(iSUWT002 )%desc = 'Sulfate Wet Deposition Bin 2' + diag(iSUWT002 )%unit = 'kg/m2/s' + + diag(iSUWT003 )%name = 'SUWT003 ' + diag(iSUWT003 )%desc = 'Sulfate Wet Deposition Bin 3' + diag(iSUWT003 )%unit = 'kg/m2/s' + + diag(iSUWT004 )%name = 'SUWT004 ' + diag(iSUWT004 )%desc = 'Sulfate Wet Deposition Bin 4' + diag(iSUWT004 )%unit = 'kg/m2/s' + + diag(iSUWT005 )%name = 'SUWT005 ' + diag(iSUWT005 )%desc = 'Sulfate Wet Deposition Bin 5' + diag(iSUWT005 )%unit = 'kg/m2/s' + + diag(iSUWT006 )%name = 'SUWT006 ' + diag(iSUWT006 )%desc = 'Sulfate Wet Deposition Bin 6' + diag(iSUWT006 )%unit = 'kg/m2/s' + + diag(iSUWT007 )%name = 'SUWT007 ' + diag(iSUWT007 )%desc = 'Sulfate Wet Deposition Bin 7' + diag(iSUWT007 )%unit = 'kg/m2/s' + + diag(iSUWT008 )%name = 'SUWT008 ' + diag(iSUWT008 )%desc = 'Sulfate Wet Deposition Bin 8' + diag(iSUWT008 )%unit = 'kg/m2/s' + + diag(iSUSV001 )%name = 'SUSV001 ' + diag(iSUSV001 )%desc = 'Sulfate Convective Scavenging Bin 1' + diag(iSUSV001 )%unit = 'kg/m2/s' + + diag(iSUSV002 )%name = 'SUSV002 ' + diag(iSUSV002 )%desc = 'Sulfate Convective Scavenging Bin 2' + diag(iSUSV002 )%unit = 'kg/m2/s' + + diag(iSUSV003 )%name = 'SUSV003 ' + diag(iSUSV003 )%desc = 'Sulfate Convective Scavenging Bin 3' + diag(iSUSV003 )%unit = 'kg/m2/s' + + diag(iSUSV004 )%name = 'SUSV004 ' + diag(iSUSV004 )%desc = 'Sulfate Convective Scavenging Bin 4' + diag(iSUSV004 )%unit = 'kg/m2/s' + + diag(iSUSV005 )%name = 'SUSV005 ' + diag(iSUSV005 )%desc = 'Sulfate Convective Scavenging Bin 5' + diag(iSUSV005 )%unit = 'kg/m2/s' + + diag(iSUSV006 )%name = 'SUSV006 ' + diag(iSUSV006 )%desc = 'Sulfate Convective Scavenging Bin 6' + diag(iSUSV006 )%unit = 'kg/m2/s' + + diag(iSUSV007 )%name = 'SUSV007 ' + diag(iSUSV007 )%desc = 'Sulfate Convective Scavenging Bin 7' + diag(iSUSV007 )%unit = 'kg/m2/s' + + diag(iSUSV008 )%name = 'SUSV008 ' + diag(iSUSV008 )%desc = 'Sulfate Convective Scavenging Bin 8' + diag(iSUSV008 )%unit = 'kg/m2/s' + + diag(iSUSO2SMASS )%name = 'SO2SMASS ' + diag(iSUSO2SMASS )%desc = 'SO2 Surface Mass Concentration' + diag(iSUSO2SMASS )%unit = 'kg/m3' + + diag(iSUSO2CMASS )%name = 'SO2CMASS ' + diag(iSUSO2CMASS )%desc = 'SO2 Column Mass Density' + diag(iSUSO2CMASS )%unit = 'kg/m2' + + diag(iSUSO4SMASS )%name = 'SO4SMASS ' + diag(iSUSO4SMASS )%desc = 'SO4 Surface Mass Concentration' + diag(iSUSO4SMASS )%unit = 'kg/m3' + + diag(iSUSO4CMASS )%name = 'SO4CMASS ' + diag(iSUSO4CMASS )%desc = 'SO4 Column Mass Density' + diag(iSUSO4CMASS )%unit = 'kg/m2' + + diag(iSUDMSSMASS )%name = 'DMSSMASS ' + diag(iSUDMSSMASS )%desc = 'SO2 Surface Mass Concentration' + diag(iSUDMSSMASS )%unit = 'kg/m3' + + diag(iSUDMSCMASS )%name = 'DMSCMASS ' + diag(iSUDMSCMASS )%desc = 'SO2 Column Mass Density' + diag(iSUDMSCMASS )%unit = 'kg/m2' + + diag(iSUPSO2 )%name = 'SUPSO2 ' + diag(iSUPSO2 )%desc = 'SO2 Production from DMS Oxidation column integrated' + diag(iSUPSO2 )%unit = 'kg/m2/s' + + diag(iSUPSO4g )%name = 'SUPSO4g ' + diag(iSUPSO4g )%desc = 'SO4 Production from gas-phase SO2 Oxidation column integrated' + diag(iSUPSO4g )%unit = 'kg/m2/s' + + diag(iSUPSO4aq )%name = 'SUPSO4aq ' + diag(iSUPSO4aq )%desc = 'SO4 Production from aqueous SO2 Oxidation column integrated' + diag(iSUPSO4aq )%unit = 'kg/m2/s' + + diag(iSUPSO4wet )%name = 'SUPSO4wt ' + diag(iSUPSO4wet )%desc = 'SO4 Production from aqueous SO2 Oxidation (wet dep) column integrated' + diag(iSUPSO4wet )%unit = 'kg/m2/s' + + diag(iSUPMSA )%name = 'SUPMSA ' + diag(iSUPMSA )%desc = 'MSA Production from DMS Oxidation column integrated' + diag(iSUPMSA )%unit = 'kg/m2/s' + + diag(iSUEXTTAU )%name = 'SUEXTTAU ' + diag(iSUEXTTAU )%desc = 'SO4 Extinction AOT [550 nm]' + diag(iSUEXTTAU )%unit = 'unitless' + + diag(iSUSCATAU )%name = 'SUSCATAU ' + diag(iSUSCATAU )%desc = 'SO4 Scattering AOT [550 nm]' + diag(iSUSCATAU )%unit = 'unitless' + + diag(iSUEMSO4AN )%name = 'SO4EMAN ' + diag(iSUEMSO4AN )%desc = 'SO4 Anthropogenic Emissions' + diag(iSUEMSO4AN )%unit = 'kg/m2/s' + + diag(iSUEMSO2AN )%name = 'SO2EMAN ' + diag(iSUEMSO2AN )%desc = 'SO2 Anthropogenic Emissions' + diag(iSUEMSO2AN )%unit = 'kg/m2/s' + + diag(iSUEMSO2BB )%name = 'SO2EMBB ' + diag(iSUEMSO2BB )%desc = 'SO2 Biomass Burning Emissions' + diag(iSUEMSO2BB )%unit = 'kg/m2/s' + + diag(iSUEMSO2VN )%name = 'SO2EMVN ' + diag(iSUEMSO2VN )%desc = 'SO2 Non-explosive Volcanic Emissions' + diag(iSUEMSO2VN )%unit = 'kg/m2/s' + + diag(iSUEMSO2VE )%name = 'SO2EMVE ' + diag(iSUEMSO2VE )%desc = 'SO2 Explosive Volanic Emissions' + diag(iSUEMSO2VE )%unit = 'kg/m2/s' + + diag(iN2OFLX )%name = 'N2OFLX' + diag(iN2OFLX )%desc = 'Derived N2O surface flux' + diag(iN2OFLX )%unit = 'kg/s' + + diag(iCH4FLX )%name = 'CH4FLX' + diag(iCH4FLX )%desc = 'Derived CH4 surface flux' + diag(iCH4FLX )%unit = 'kg/s' + + diag(iF11FLX )%name = 'F11FLX' + diag(iF11FLX )%desc = 'Derived F11 surface flux' + diag(iF11FLX )%unit = 'kg/s' + + diag(iF12FLX )%name = 'F12FLX' + diag(iF12FLX )%desc = 'Derived F12 surface flux' + diag(iF12FLX )%unit = 'kg/s' + + diag(iF113FLX )%name = 'F113FLX' + diag(iF113FLX )%desc = 'Derived F113 surface flux' + diag(iF113FLX )%unit = 'kg/s' + + diag(iHCFCFLX )%name = 'HCFCFLX' + diag(iHCFCFLX )%desc = 'Derived HCFC surface flux' + diag(iHCFCFLX )%unit = 'kg/s' + + diag(iCCL4FLX )%name = 'CCL4FLX' + diag(iCCL4FLX )%desc = 'Derived CCL4 surface flux' + diag(iCCL4FLX )%unit = 'kg/s' + + diag(iCH3CCL3FLX )%name = 'MCFFLX' + diag(iCH3CCL3FLX )%desc = 'Derived CH3CCL3 surface flux' + diag(iCH3CCL3FLX )%unit = 'kg/s' + + diag(iCH3CLFLX )%name = 'CH3CLFLX' + diag(iCH3CLFLX )%desc = 'Derived CH3CL surface flux' + diag(iCH3CLFLX )%unit = 'kg/s' + + diag(iCH3BRFLX )%name = 'CH3BRFLX' + diag(iCH3BRFLX )%desc = 'Derived CH3BR surface flux' + diag(iCH3BRFLX )%unit = 'kg/s' + + diag(iH1301FLX )%name = 'H1301FLX' + diag(iH1301FLX )%desc = 'Derived H1301 surface flux' + diag(iH1301FLX )%unit = 'kg/s' + + diag(iH12_24FLX )%name = 'H1224FLX' + diag(iH12_24FLX )%desc = 'Derived H12_24 surface flux' + diag(iH12_24FLX )%unit = 'kg/s' + + diag(iCOSSZA )%name = 'COSSZA ' + diag(iCOSSZA )%desc = 'Cosine of SZA' + diag(iCOSSZA )%unit = 'unitless' + + diag(iTCOSZ )%name = 'TCOSZ ' + diag(iTCOSZ )%desc = 'Integrated cosine of SZA' + diag(iTCOSZ )%unit = 'unitless' + + diag(iXOH )%name = 'XOH ' + diag(iXOH )%desc = 'OH surface concentration' + diag(iXOH )%unit = '# cm-3' + + diag(iXNO3 )%name = 'XNO3 ' + diag(iXNO3 )%desc = 'NO3 surface mixing ratio' + diag(iXNO3 )%unit = 'unitless' + + diag(iXH2O2 )%name = 'XH2O2 ' + diag(iXH2O2 )%desc = 'H2O2 surface mixing ratio' + diag(iXH2O2 )%unit = 'unitless' + + diag(iCOEM001 )%name = 'COEM001 ' + diag(iCOEM001 )%desc = 'Carbon Monoxide Emission Bin 1' + diag(iCOEM001 )%unit = 'kg/m2/s' + + diag(iCOEM002 )%name = 'COEM002 ' + diag(iCOEM002 )%desc = 'Carbon Monoxide Emission Bin 2' + diag(iCOEM002 )%unit = 'kg/m2/s' + + diag(iCOEM003 )%name = 'COEM003 ' + diag(iCOEM003 )%desc = 'Carbon Monoxide Emission Bin 3' + diag(iCOEM003 )%unit = 'kg/m2/s' + + diag(iCOEM004 )%name = 'COEM004 ' + diag(iCOEM004 )%desc = 'Carbon Monoxide Emission Bin 4' + diag(iCOEM004 )%unit = 'kg/m2/s' + + diag(iCOEM005 )%name = 'COEM005 ' + diag(iCOEM005 )%desc = 'Carbon Monoxide Emission Bin 5' + diag(iCOEM005 )%unit = 'kg/m2/s' + + diag(iCOEM006 )%name = 'COEM006 ' + diag(iCOEM006 )%desc = 'Carbon Monoxide Emission Bin 6' + diag(iCOEM006 )%unit = 'kg/m2/s' + + diag(iCOEM007 )%name = 'COEM007 ' + diag(iCOEM007 )%desc = 'Carbon Monoxide Emission Bin 7' + diag(iCOEM007 )%unit = 'kg/m2/s' + + diag(iCOEM008 )%name = 'COEM008 ' + diag(iCOEM008 )%desc = 'Carbon Monoxide Emission Bin 8' + diag(iCOEM008 )%unit = 'kg/m2/s' + + diag(iCOLS001 )%name = 'COLS001 ' + diag(iCOLS001 )%desc = 'Carbon Monoxide Chemical Loss Bin 1' + diag(iCOLS001 )%unit = 'kg/m2/s' + + diag(iCOLS002 )%name = 'COLS002 ' + diag(iCOLS002 )%desc = 'Carbon Monoxide Chemical Loss Bin 2' + diag(iCOLS002 )%unit = 'kg/m2/s' + + diag(iCOLS003 )%name = 'COLS003 ' + diag(iCOLS003 )%desc = 'Carbon Monoxide Chemical Loss Bin 3' + diag(iCOLS003 )%unit = 'kg/m2/s' + + diag(iCOLS004 )%name = 'COLS004 ' + diag(iCOLS004 )%desc = 'Carbon Monoxide Chemical Loss Bin 4' + diag(iCOLS004 )%unit = 'kg/m2/s' + + diag(iCOLS005 )%name = 'COLS005 ' + diag(iCOLS005 )%desc = 'Carbon Monoxide Chemical Loss Bin 5' + diag(iCOLS005 )%unit = 'kg/m2/s' + + diag(iCOLS006 )%name = 'COLS006 ' + diag(iCOLS006 )%desc = 'Carbon Monoxide Chemical Loss Bin 6' + diag(iCOLS006 )%unit = 'kg/m2/s' + + diag(iCOLS007 )%name = 'COLS007 ' + diag(iCOLS007 )%desc = 'Carbon Monoxide Chemical Loss Bin 7' + diag(iCOLS007 )%unit = 'kg/m2/s' + + diag(iCOLS008 )%name = 'COLS008 ' + diag(iCOLS008 )%desc = 'Carbon Monoxide Chemical Loss Bin 8' + diag(iCOLS008 )%unit = 'kg/m2/s' + + diag(iCOPD001 )%name = 'COPD001 ' + diag(iCOPD001 )%desc = 'Carbon Monoxide Chemical Production Bin 1' + diag(iCOPD001 )%unit = 'kg/m2/s' + + diag(iCOPD002 )%name = 'COPD002 ' + diag(iCOPD002 )%desc = 'Carbon Monoxide Chemical Production Bin 2' + diag(iCOPD002 )%unit = 'kg/m2/s' + + diag(iCOPD003 )%name = 'COPD003 ' + diag(iCOPD003 )%desc = 'Carbon Monoxide Chemical Production Bin 3' + diag(iCOPD003 )%unit = 'kg/m2/s' + + diag(iCOPD004 )%name = 'COPD004 ' + diag(iCOPD004 )%desc = 'Carbon Monoxide Chemical Production Bin 4' + diag(iCOPD004 )%unit = 'kg/m2/s' + + diag(iCOPD005 )%name = 'COPD005 ' + diag(iCOPD005 )%desc = 'Carbon Monoxide Chemical Production Bin 5' + diag(iCOPD005 )%unit = 'kg/m2/s' + + diag(iCOPD006 )%name = 'COPD006 ' + diag(iCOPD006 )%desc = 'Carbon Monoxide Chemical Production Bin 6' + diag(iCOPD006 )%unit = 'kg/m2/s' + + diag(iCOPD007 )%name = 'COPD007 ' + diag(iCOPD007 )%desc = 'Carbon Monoxide Chemical Production Bin 7' + diag(iCOPD007 )%unit = 'kg/m2/s' + + diag(iCOPD008 )%name = 'COPD008 ' + diag(iCOPD008 )%desc = 'Carbon Monoxide Chemical Production Bin 8' + diag(iCOPD008 )%unit = 'kg/m2/s' + + diag(iCOCL001 )%name = 'COCL001 ' + diag(iCOCL001 )%desc = 'Carbon Monoxide Column Burden Bin 1' + diag(iCOCL001 )%unit = 'kg/m2' + + diag(iCOCL002 )%name = 'COCL002 ' + diag(iCOCL002 )%desc = 'Carbon Monoxide Column Burden Bin 2' + diag(iCOCL002 )%unit = 'kg/m2' + + diag(iCOCL003 )%name = 'COCL003 ' + diag(iCOCL003 )%desc = 'Carbon Monoxide Column Burden Bin 3' + diag(iCOCL003 )%unit = 'kg/m2' + + diag(iCOCL004 )%name = 'COCL004 ' + diag(iCOCL004 )%desc = 'Carbon Monoxide Column Burden Bin 4' + diag(iCOCL004 )%unit = 'kg/m2' + + diag(iCOCL005 )%name = 'COCL005 ' + diag(iCOCL005 )%desc = 'Carbon Monoxide Column Burden Bin 5' + diag(iCOCL005 )%unit = 'kg/m2' + + diag(iCOCL006 )%name = 'COCL006 ' + diag(iCOCL006 )%desc = 'Carbon Monoxide Column Burden Bin 6' + diag(iCOCL006 )%unit = 'kg/m2' + + diag(iCOCL007 )%name = 'COCL007 ' + diag(iCOCL007 )%desc = 'Carbon Monoxide Column Burden Bin 7' + diag(iCOCL007 )%unit = 'kg/m2' + + diag(iCOCL008 )%name = 'COCL008 ' + diag(iCOCL008 )%desc = 'Carbon Monoxide Column Burden Bin 8' + diag(iCOCL008 )%unit = 'kg/m2' + + diag(iCOSC001 )%name = 'COSC001 ' + diag(iCOSC001 )%desc = 'Carbon Monoxide Surface Concentration Bin 1' + diag(iCOSC001 )%unit = 'ppbv' + + diag(iCOSC002 )%name = 'COSC002 ' + diag(iCOSC002 )%desc = 'Carbon Monoxide Surface Concentration Bin 2' + diag(iCOSC002 )%unit = 'ppbv' + + diag(iCOSC003 )%name = 'COSC003 ' + diag(iCOSC003 )%desc = 'Carbon Monoxide Surface Concentration Bin 3' + diag(iCOSC003 )%unit = 'ppbv' + + diag(iCOSC004 )%name = 'COSC004 ' + diag(iCOSC004 )%desc = 'Carbon Monoxide Surface Concentration Bin 4' + diag(iCOSC004 )%unit = 'ppbv' + + diag(iCOSC005 )%name = 'COSC005 ' + diag(iCOSC005 )%desc = 'Carbon Monoxide Surface Concentration Bin 5' + diag(iCOSC005 )%unit = 'ppbv' + + diag(iCOSC006 )%name = 'COSC006 ' + diag(iCOSC006 )%desc = 'Carbon Monoxide Surface Concentration Bin 6' + diag(iCOSC006 )%unit = 'ppbv' + + diag(iCOSC007 )%name = 'COSC007 ' + diag(iCOSC007 )%desc = 'Carbon Monoxide Surface Concentration Bin 7' + diag(iCOSC007 )%unit = 'ppbv' + + diag(iCOSC008 )%name = 'COSC008 ' + diag(iCOSC008 )%desc = 'Carbon Monoxide Surface Concentration Bin 8' + diag(iCOSC008 )%unit = 'ppbv' + + diag(iCO2EM001 )%name = 'CO2EM001 ' + diag(iCO2EM001 )%desc = 'Carbon Dioxide Emission Bin 1' + diag(iCO2EM001 )%unit = 'kg/m2/s' + + diag(iCO2EM002 )%name = 'CO2EM002 ' + diag(iCO2EM002 )%desc = 'Carbon Dioxide Emission Bin 2' + diag(iCO2EM002 )%unit = 'kg/m2/s' + + diag(iCO2EM003 )%name = 'CO2EM003 ' + diag(iCO2EM003 )%desc = 'Carbon Dioxide Emission Bin 3' + diag(iCO2EM003 )%unit = 'kg/m2/s' + + diag(iCO2EM004 )%name = 'CO2EM004 ' + diag(iCO2EM004 )%desc = 'Carbon Dioxide Emission Bin 4' + diag(iCO2EM004 )%unit = 'kg/m2/s' + + diag(iCO2EM005 )%name = 'CO2EM005 ' + diag(iCO2EM005 )%desc = 'Carbon Dioxide Emission Bin 5' + diag(iCO2EM005 )%unit = 'kg/m2/s' + + diag(iCO2EM006 )%name = 'CO2EM006 ' + diag(iCO2EM006 )%desc = 'Carbon Dioxide Emission Bin 6' + diag(iCO2EM006 )%unit = 'kg/m2/s' + + diag(iCO2EM007 )%name = 'CO2EM007 ' + diag(iCO2EM007 )%desc = 'Carbon Dioxide Emission Bin 7' + diag(iCO2EM007 )%unit = 'kg/m2/s' + + diag(iCO2EM008 )%name = 'CO2EM008 ' + diag(iCO2EM008 )%desc = 'Carbon Dioxide Emission Bin 8' + diag(iCO2EM008 )%unit = 'kg/m2/s' + + diag(iCO2CL001 )%name = 'CO2CL001 ' + diag(iCO2CL001 )%desc = 'Carbon Dioxide Column Burden Bin 1' + diag(iCO2CL001 )%unit = 'kg/m2' + + diag(iCO2CL002 )%name = 'CO2CL002 ' + diag(iCO2CL002 )%desc = 'Carbon Dioxide Column Burden Bin 2' + diag(iCO2CL002 )%unit = 'kg/m2' + + diag(iCO2CL003 )%name = 'CO2CL003 ' + diag(iCO2CL003 )%desc = 'Carbon Dioxide Column Burden Bin 3' + diag(iCO2CL003 )%unit = 'kg/m2' + + diag(iCO2CL004 )%name = 'CO2CL004 ' + diag(iCO2CL004 )%desc = 'Carbon Dioxide Column Burden Bin 4' + diag(iCO2CL004 )%unit = 'kg/m2' + + diag(iCO2CL005 )%name = 'CO2CL005 ' + diag(iCO2CL005 )%desc = 'Carbon Dioxide Column Burden Bin 5' + diag(iCO2CL005 )%unit = 'kg/m2' + + diag(iCO2CL006 )%name = 'CO2CL006 ' + diag(iCO2CL006 )%desc = 'Carbon Dioxide Column Burden Bin 6' + diag(iCO2CL006 )%unit = 'kg/m2' + + diag(iCO2CL007 )%name = 'CO2CL007 ' + diag(iCO2CL007 )%desc = 'Carbon Dioxide Column Burden Bin 7' + diag(iCO2CL007 )%unit = 'kg/m2' + + diag(iCO2CL008 )%name = 'CO2CL008 ' + diag(iCO2CL008 )%desc = 'Carbon Dioxide Column Burden Bin 8' + diag(iCO2CL008 )%unit = 'kg/m2' + + diag(iCO2SC001 )%name = 'CO2SC001 ' + diag(iCO2SC001 )%desc = 'Carbon Dioxide Surface Concentration Bin 1' + diag(iCO2SC001 )%unit = 'ppmv' + + diag(iCO2SC002 )%name = 'CO2SC002 ' + diag(iCO2SC002 )%desc = 'Carbon Dioxide Surface Concentration Bin 2' + diag(iCO2SC002 )%unit = 'ppmv' + + diag(iCO2SC003 )%name = 'CO2SC003 ' + diag(iCO2SC003 )%desc = 'Carbon Dioxide Surface Concentration Bin 3' + diag(iCO2SC003 )%unit = 'ppmv' + + diag(iCO2SC004 )%name = 'CO2SC004 ' + diag(iCO2SC004 )%desc = 'Carbon Dioxide Surface Concentration Bin 4' + diag(iCO2SC004 )%unit = 'ppmv' + + diag(iCO2SC005 )%name = 'CO2SC005 ' + diag(iCO2SC005 )%desc = 'Carbon Dioxide Surface Concentration Bin 5' + diag(iCO2SC005 )%unit = 'ppmv' + + diag(iCO2SC006 )%name = 'CO2SC006 ' + diag(iCO2SC006 )%desc = 'Carbon Dioxide Surface Concentration Bin 6' + diag(iCO2SC006 )%unit = 'ppmv' + + diag(iCO2SC007 )%name = 'CO2SC007 ' + diag(iCO2SC007 )%desc = 'Carbon Dioxide Surface Concentration Bin 7' + diag(iCO2SC007 )%unit = 'ppmv' + + diag(iCO2SC008 )%name = 'CO2SC008 ' + diag(iCO2SC008 )%desc = 'Carbon Dioxide Surface Concentration Bin 8' + diag(iCO2SC008 )%unit = 'ppmv' + + +#endif + +! ... 3-D diagnostic fields (in alphabetic order) +! + + diag(iAIRDENS )%name = 'AIRDENS ' + diag(iAIRDENS )%desc = 'Air Density' + diag(iAIRDENS )%unit = 'Kg m-3' + + diag(iCAPE )%name = 'CAPE ' + diag(iCAPE )%desc = 'CAPE' + diag(iCAPE )%unit = 'J/kg' + + diag(iCGS )%name = 'CGS ' + diag(iCGS )%desc = 'Counter-gradient coefficient on surface ' & + // 'kinematic fluxes' + diag(iCGS )%unit = 's/m2' + + diag(iCLDLWP )%name = 'CLDLWP ' + diag(iCLDLWP )%desc = 'Actual cloud liquid water path length' + diag(iCLDLWP )%unit = 'gram/m2' + + diag(iCLOUD )%name = 'CLOUD ' + diag(iCLOUD )%desc = 'Cloud fraction' + diag(iCLOUD )%unit = 'fraction' + diag(iCLOUD )%aname= 'CLDTOT ' + diag(iCLOUD )%adesc= '3-D Total Cloud Fraction' + + diag(iCLOUDUP )%name = 'CLOUDUP ' + diag(iCLOUDUP )%desc = 'Cloud fraction during omega < 0.' + diag(iCLOUDUP )%unit = 'fraction' + + diag(iCMFDQ )%name = 'CMFDQ ' + diag(iCMFDQ )%desc = 'q tendency - Hack convection' + diag(iCMFDQ )%unit = 'kg/kg/s' + + diag(iCMFDQR2 )%name = 'CMFDQR2 ' + diag(iCMFDQR2 )%desc = 'Rain production rate - Hack convection' + diag(iCMFDQR2 )%unit = 'kg/kg/s' + + diag(iCMFDT )%name = 'CMFDT ' + diag(iCMFDT )%desc = 'T tendency - Hack convection' + diag(iCMFDT )%unit = 'K/s' + + diag(iCMFDTR )%name = 'CMFDTR ' + diag(iCMFDTR )%desc = 'Detrainment mass flux - Hack convection' + diag(iCMFDTR )%unit = 'Pa/s' + + diag(iCMFETR )%name = 'CMFETR ' + diag(iCMFETR )%desc = 'Entrainment mass flux - Hack convection' + diag(iCMFETR )%unit = 'Pa/s' + + diag(iCMFMC )%name = 'CMFMC ' + diag(iCMFMC )%desc = 'Total Moist convection mass flux' + diag(iCMFMC )%unit = 'Pa/s' + diag(iCMFMC )%aname= 'CLDMAS ' + diag(iCMFMC )%adesc= 'Cloud mass flux' + diag(iCMFMC )%aunit= 'kg/m2/s' + diag(iCMFMC )%convfac = 1./9.80616 ! should use constant rga +! diag(iCMFMC )%convfac = rga ! include comcon when f90 + + diag(iCMFMC2 )%name = 'CMFMC2 ' + diag(iCMFMC2 )%desc = 'Hack Moist convection mass flux' + diag(iCMFMC2 )%unit = 'Pa/s' + + diag(iCONVCLD )%name = 'CONVCLD ' + diag(iCONVCLD )%desc = 'Convective cloud amount' + diag(iCONVCLD )%unit = 'fraction' + + diag(iDCAFDT )%name = 'DCAFDT ' + diag(iDCAFDT )%desc = 'T Tendency - Dry convective adjustment' + diag(iDCAFDT )%unit = 'K/s' + + diag(iDIABDT )%name = 'DIABDT ' + diag(iDIABDT )%desc = 'T Tendency - Total adiabatic (physics)' + diag(iDIABDT )%unit = 'K/s' + diag(iDIABDT )%aname= 'DIABT ' + diag(iDIABDT )%adesc= 'Temperature Tendency due to Diabatic Forcing' + diag(iDIABDT )%aunit= 'K/day' + diag(iDIABDT )%convfac = 86400.0 + + diag(iDQCOND )%name = 'DQCOND ' + diag(iDQCOND )%desc = 'Q tendency - moist physics' + diag(iDQCOND )%unit = 'kg/kg/s' + diag(iDQCOND )%aname= 'MOISTQ ' + diag(iDQCOND )%adesc= 'Specific Humidity Tendency due to Moist Processes' + diag(iDQCOND )%aunit= 'g/kg/day' + diag(iDQCOND )%convfac = 86400000.0 + + diag(iDQPBLCG )%name = 'DQPBLCG ' + diag(iDQPBLCG )%desc = 'Q tendency - PBL counter gradient' + diag(iDQPBLCG )%unit = 'kg/kg/s' + + diag(iDQRL )%name = 'DQRL ' + diag(iDQRL )%desc = 'Rain production rate - large-scale' + diag(iDQRL )%unit = 'kg/kg/s' + + diag(iDRUNOFF )%name = 'DRUNOFF ' + diag(iDRUNOFF )%desc = 'Sub-surface runoff' + diag(iDRUNOFF )%unit = 'mm/s' + + diag(iDTCOND )%name = 'DTCOND ' + diag(iDTCOND )%desc = 'T tendency - moist physics' + diag(iDTCOND )%unit = 'K/s' + diag(iDTCOND )%aname= 'MOISTT ' + diag(iDTCOND )%adesc= 'Temperature Tendency due to Moist Processes' + diag(iDTCOND )%aunit= 'K/day' + diag(iDTCOND )%convfac = 86400.0 + + diag(iDTPBLCG )%name = 'DTPBLCG ' + diag(iDTPBLCG )%desc = 'T tendency - PBL counter gradient' + diag(iDTPBLCG )%unit = 'K/s' + + diag(iDTRAIN )%name = 'DTRAIN ' + diag(iDTRAIN )%desc = 'Detrainment Cloud Mass Flux' + diag(iDTRAIN )%unit = 'Pa/s' + diag(iDTRAIN )%aunit= 'kg/m2/s' + diag(iDTRAIN )%convfac = 1./9.80616 ! should use constant rga +! diag(iDTRAIN )%convfac = rga ! include comcon when f90 + + diag(iDTV )%name = 'DTV ' + diag(iDTV )%desc = 'T vertical diffusion' + diag(iDTV )%unit = 'K/s' + diag(iDTV )%aname= 'TURBT ' + diag(iDTV )%adesc= 'Temperature Tendency due to Turbulence' + diag(iDTV )%aunit= 'K/day' + diag(iDTV )%convfac = 86400.0 + + diag(iDUV )%name = 'DUV ' + diag(iDUV )%desc = 'U tendency from vertical diffusion' + diag(iDUV )%unit = 'm/s2' + diag(iDUV )%aname= 'TURBU ' + diag(iDUV )%adesc= 'Zonal Wind Tendency due to Turbulence' + diag(iDUV )%aunit= 'm/s/day' + diag(iDUV )%convfac = 86400. + + diag(iDVV )%name = 'DVV ' + diag(iDVV )%desc = 'V tendency from vertical diffusion' + diag(iDVV )%unit = 'm/s2' + diag(iDVV )%aname= 'TURBV ' + diag(iDVV )%adesc= 'Meridional Wind Tendency due to Turbulence' + diag(iDVV )%aunit= 'm/s/day' + diag(iDVV )%convfac = 86400. + + diag(iEFFCLD )%name = 'EFFCLD ' + diag(iEFFCLD )%desc = 'Effective cloud fraction' + diag(iEFFCLD )%unit = 'fraction' + + diag(iEVAPL )%name = 'EVAPL ' + diag(iEVAPL )%desc = 'Large-scale evaporation' + diag(iEVAPL )%unit = 'kg/kg/s' + + diag(iH )%name = 'H ' + diag(iH )%desc = 'Geopotential height at mid-layer' + diag(iH )%unit = 'm' + diag(iH )%aname= 'HGHT ' + + diag(iHGHTE )%name = 'HGHTE ' + diag(iHGHTE )%desc = 'Geopotential height at layer top' + diag(iHGHTE )%unit = 'm' + + diag(iKVH )%name = 'KVH ' + diag(iKVH )%desc = 'Vertical diffusion diffusivities ' & + // '(heat/moisture)' + diag(iKVH )%unit = 'm2/s' + diag(iKVH )%aname= 'KH ' + + diag(iKVM )%name = 'KVM ' + diag(iKVM )%desc = 'Eddy diffusivity for momentum' + diag(iKVM )%unit = 'm2/s' + + diag(iO3VMR )%name = 'O3VMR ' + diag(iO3VMR )%desc = 'Ozone used in radiative transfer' + diag(iO3VMR )%unit = 'mol/mol' + + diag(iOMEGA )%name = 'OMEGA ' + diag(iOMEGA )%desc = 'Vertical pressure velocity' + diag(iOMEGA )%unit = 'Pa/s' + diag(iOMEGA )%adesc= 'Vertical velocity' + diag(iOMEGA )%aunit= 'hPa/day' + diag(iOMEGA )%convfac = 864.0 + + diag(iPV )%name = 'PV ' + diag(iPV )%desc = 'Ertels potential vorticity' + diag(iPV )%unit = 'm2/(kg*sec)' + + diag(iQ )%name = 'Q ' + diag(iQ )%desc = 'Specific humidity' + diag(iQ )%unit = 'kg/kg' + diag(iQ )%aname= 'SPHU ' + diag(iQ )%aunit= 'g/kg' + diag(iQ )%convfac = 1000.0 + + diag(iQC )%name = 'QC ' + diag(iQC )%desc = 'Specific humidity of cloud condensate' + diag(iQC )%unit = 'kg/kg' + + diag(iQRL )%name = 'QRL ' + diag(iQRL )%desc = 'Longwave heating rate' + diag(iQRL )%unit = 'K/s' + diag(iQRL )%aname= 'RADLW ' + diag(iQRL )%adesc= 'Temperature Tendency due to Longwave Radiation' + diag(iQRL )%aunit= 'K/day' + diag(iQRL )%convfac = 86400.0 + + diag(iQRS )%name = 'QRS ' + diag(iQRS )%desc = 'Shortwave heating rate' + diag(iQRS )%unit = 'K/s' + diag(iQRS )%aname= 'RADSW ' + diag(iQRS )%adesc= 'Temperature Tendency due to Shortwave Radiation' + diag(iQRS )%aunit= 'K/day' + diag(iQRS )%convfac = 86400.0 + + diag(iRAYFDT )%name = 'RAYFDT ' + diag(iRAYFDT )%desc = 'T Tendency - Rayleigh friction' + diag(iRAYFDT )%unit = 'K/s' + diag(iRAYFDT )%aname= 'RFT ' + diag(iRAYFDT )%adesc= 'Temperature Tendency due to Rayleigh Friction' + diag(iRAYFDT )%aunit= 'K/day' + diag(iRAYFDT )%convfac = 86400.0 + + diag(iRELHUM )%name = 'RELHUM ' + diag(iRELHUM )%desc = 'Relative Humidity after cloud physics' + diag(iRELHUM )%unit = '%' + + diag(iRHCLR )%name = 'RHCLR ' + diag(iRHCLR )%desc = 'Relative Humidity in clear region' + diag(iRHCLR )%unit = '%' + + diag(iRNEVPDQ )%name = 'RNEVPDQ ' + diag(iRNEVPDQ )%desc = 'Q Tendency - Rain evaporation' + diag(iRNEVPDQ )%unit = 'kg/kg/s' + diag(iRNEVPDQ )%aname= 'DQLS ' + diag(iRNEVPDQ )%adesc= 'Specific Humidity Tendency due to Stratiform Processes' + diag(iRNEVPDQ )%aunit= 'g/kg/day' + diag(iRNEVPDQ )%convfac = 86400000.0 + + diag(iRNEVPDT )%name = 'RNEVPDT ' + diag(iRNEVPDT )%desc = 'T Tendency - Rain evaporation' + diag(iRNEVPDT )%unit = 'K/s' + diag(iRNEVPDT )%aname= 'DTLS ' + diag(iRNEVPDT )%adesc= 'Temperature Tendency due to Stratiform Processes' + diag(iRNEVPDT )%aunit= 'K/day' + diag(iRNEVPDT )%convfac = 86400. + + diag(iSETLWP )%name = 'SETLWP ' + diag(iSETLWP )%desc = 'Specified liquid water path lengths' + diag(iSETLWP )%unit = 'gram/m2' + + diag(iSTRATCLD)%name = 'STRATCLD' + diag(iSTRATCLD)%desc = 'Stratiform cloud amount' + diag(iSTRATCLD)%unit = 'fraction' + + diag(iT )%name = 'T ' + diag(iT )%desc = 'Temperature' + diag(iT )%unit = 'K' + diag(iT )%aname= 'TMPU ' + + diag(iTKE )%name = 'TKE ' + diag(iTKE )%desc = 'Turbulent kinetic energy' + diag(iTKE )%unit = '(m/s)2' + + diag(iTTMGW )%name = 'TTMGW ' + diag(iTTMGW )%desc = 'T tendency - gravity wave drag' + diag(iTTMGW )%unit = 'K/s' + diag(iTTMGW )%aname= 'GWDT ' + diag(iTTMGW )%adesc= 'Temperature Tendency due to Gravity Wave Drag' + diag(iTTMGW )%aunit= 'K/day' + diag(iTTMGW )%convfac = 86400.0 + + diag(iU )%name = 'U ' + diag(iU )%desc = 'U wind' + diag(iU )%unit = 'm/s' + diag(iU )%aname= 'UWND ' + diag(iU )%adesc= 'Zonal Wind' + + diag(iUQ )%name = 'UQ ' + diag(iUQ )%desc = 'U wind * specific humidity' + diag(iUQ )%unit = 'm/s*kg/kg' + + diag(iUT )%name = 'UT ' + diag(iUT )%desc = 'U wind * temperature' + diag(iUT )%unit = 'm/s*K' + + diag(iUTGW )%name = 'UTGW ' + diag(iUTGW )%desc = 'U tendency - gravity wave drag' + diag(iUTGW )%unit = 'm/s2' + diag(iUTGW )%aname= 'GWDU ' + diag(iUTGW )%aunit= 'm/s/day' + diag(iUTGW )%adesc= 'Zonal Wind Tendency due to Gravity Wave Drag' + diag(iUTGW )%convfac = 86400. + + diag(iUU )%name = 'UU ' + diag(iUU )%desc = 'U wind * U wind' + diag(iUU )%unit = 'm/s*m/s' + + diag(iUV )%name = 'UV ' + diag(iUV )%desc = 'U wind * V wind' + diag(iUV )%unit = 'm/s*m/s' + + diag(iV )%name = 'V ' + diag(iV )%desc = 'V wind' + diag(iV )%unit = 'm/s' + diag(iV )%aname= 'VWND ' + diag(iV )%adesc= 'Meridional Wind' + + diag(iVD01 )%name = 'VD01 ' + diag(iVD01 )%desc = 'Vertical diffusion tendency of water vapor' + diag(iVD01 )%unit = 'kg/kg/s' + diag(iVD01 )%aname= 'TURBQ ' + diag(iVD01 )%adesc= 'Specific Humidity Tendency due to Turbulence' + diag(iVD01 )%aunit = 'g/kg/day' + diag(iVD01 )%convfac = 86400000.0 + + diag(iVQ )%name = 'VQ ' + diag(iVQ )%desc = 'V wind * specific humidity' + diag(iVQ )%unit = 'm/s*kg/kg' + + diag(iVT )%name = 'VT ' + diag(iVT )%desc = 'V wind * temperature' + diag(iVT )%unit = 'm/s*K' + + diag(iVTGW )%name = 'VTGW ' + diag(iVTGW )%desc = 'V tendency - gravity wave drag' + diag(iVTGW )%unit = 'm/s2' + diag(iVTGW )%aname= 'GWDV ' + diag(iVTGW )%adesc= 'Meridional Wind Tendency due to Gravity Wave Drag' + diag(iVTGW )%aunit= 'm/s/day' + diag(iVTGW )%convfac = 86400. + + diag(iVV )%name = 'VV ' + diag(iVV )%desc = 'V wind * V wind' + diag(iVV )%unit = 'm/s*m/s' + + diag(iZMCME )%name = 'ZMCME ' + diag(iZMCME )%desc = 'Condensation - evaporation from Z&M scheme' + diag(iZMCME )%unit = 'kg/kg/s' + + diag(iZMDLF )%name = 'ZMDLF ' + diag(iZMDLF )%desc = 'Detrainment of cloud water from Z&M scheme' + diag(iZMDLF )%unit = 'kg/kg/s' + + diag(iZMDQ )%name = 'ZMDQ ' + diag(iZMDQ )%desc = 'q tendency - Zhang-McFarlane convection' + diag(iZMDQ )%unit = 'kg/kg/s' + + diag(iZMDQR )%name = 'ZMDQR ' + diag(iZMDQR )%desc = 'Rain production rate - Z&M convection' + diag(iZMDQR )%unit = 'kg/kg/s' + + diag(iZMDT )%name = 'ZMDT ' + diag(iZMDT )%desc = 'T tendency - Zhang-McFarlane convection' + diag(iZMDT )%unit = 'K/s' + + diag(iZMDU )%name = 'ZMDU ' + diag(iZMDU )%desc = 'Updraft detrainment mass flux - Z&M' & + //' convection' + diag(iZMDU )%unit = 'Pa/s' + + diag(iZMED )%name = 'ZMED ' + diag(iZMED )%desc = 'Downdraft entrainment mass flux - Z&M' & + //' convection' + diag(iZMED )%unit = 'Pa/s' + + diag(iZMEPS )%name = 'ZMEPS ' + diag(iZMEPS )%desc = 'Fractional entrainment - Z&M convection' + diag(iZMEPS )%unit = '1/s' + + diag(iZMEU )%name = 'ZMEU ' + diag(iZMEU )%desc = 'Updraft entrainment mass flux - Z&M' & + //' convection' + diag(iZMEU )%unit = 'Pa/s' + + diag(iZMEVP )%name = 'ZMEVP ' + diag(iZMEVP )%desc = 'downdraft evaporation from Z&M convection' + diag(iZMEVP )%unit = 'kg/kg/s' + + diag(iZMMD )%name = 'ZMMD ' + diag(iZMMD )%desc = 'Downdraft mass flux - Z&M convection' + diag(iZMMD )%unit = 'Pa/s' + + diag(iZMMU )%name = 'ZMMU ' + diag(iZMMU )%desc = 'Updraft mass flux - Z&M convection' + diag(iZMMU )%unit = 'pa/s' + + diag(iZMPFLX )%name = 'ZMPFLX ' + diag(iZMPFLX )%desc = 'Precipitation flux - Z&M convection' + diag(iZMPFLX )%unit = 'kg/m2/s' + + diag(iZMQL )%name = 'ZMQL ' + diag(iZMQL )%desc = 'Cloud water in updraft - Z&M convection' + diag(iZMQL )%unit = 'kg/kg' + +#ifdef FVCHEM + diag(iBR )%name = 'BR ' + diag(iBR )%desc = 'Atomic bromine' + diag(iBR )%unit = 'mol/mol' + + diag(iBRCL )%name = 'BRCL ' + diag(iBRCL )%desc = 'Bromine chloride' + diag(iBRCL )%unit = 'mol/mol' + + diag(iBRO )%name = 'BRO ' + diag(iBRO )%desc = 'Bromine monoxide' + diag(iBRO )%unit = 'mol/mol' + + diag(iBRONO2 )%name = 'BRONO2 ' + diag(iBRONO2 )%desc = 'Bromine nitrate' + diag(iBRONO2 )%unit = 'mol/mol' + + diag(iBRX )%name = 'BRX ' + diag(iBRX )%desc = 'Odd bromine' + diag(iBRX )%unit = 'mol/mol' + + diag(iCCL4 )%name = 'CCL4 ' + diag(iCCL4 )%desc = 'Carbon tetrachloride' + diag(iCCL4 )%unit = 'mol/mol' + + diag(iCH2O )%name = 'CH2O ' + diag(iCH2O )%desc = 'Formaldehyde' + diag(iCH2O )%unit = 'mol/mol' + + diag(iCH3BR )%name = 'CH3BR ' + diag(iCH3BR )%desc = 'Methyl bromide' + diag(iCH3BR )%unit = 'mol/mol' + + diag(iCH3CCL3 )%name = 'CH3CCL3 ' + diag(iCH3CCL3 )%desc = 'Methyl chloroform' + diag(iCH3CCL3 )%unit = 'mol/mol' + + diag(iCH3CL )%name = 'CH3CL ' + diag(iCH3CL )%desc = 'Methyl chloride' + diag(iCH3CL )%unit = 'mol/mol' + + diag(iCH3O2 )%name = 'CH3O2 ' + diag(iCH3O2 )%desc = 'Methyl peroxide' + diag(iCH3O2 )%unit = 'mol/mol' + + diag(iCH3OOH )%name = 'CH3OOH ' + diag(iCH3OOH )%desc = 'Methyl hydroperoxide' + diag(iCH3OOH )%unit = 'mol/mol' + + diag(iCH4 )%name = 'CH4 ' + diag(iCH4 )%desc = 'Methane' + diag(iCH4 )%unit = 'mol/mol' + + diag(iCL )%name = 'CL ' + diag(iCL )%desc = 'Atomic chlorine' + diag(iCL )%unit = 'mol/mol' + + diag(iCL2 )%name = 'CL2 ' + diag(iCL2 )%desc = 'Molecular chlorine' + diag(iCL2 )%unit = 'mol/mol' + + diag(iCL2O2 )%name = 'CL2O2 ' + diag(iCL2O2 )%desc = 'Dichlorine peroxide' + diag(iCL2O2 )%unit = 'mol/mol' + + diag(iCLO )%name = 'CLO ' + diag(iCLO )%desc = 'Chlorine monoxide' + diag(iCLO )%unit = 'mol/mol' + + diag(iCLONO2 )%name = 'CLONO2 ' + diag(iCLONO2 )%desc = 'Chlorine nitrate' + diag(iCLONO2 )%unit = 'mol/mol' + + diag(iCLX )%name = 'CLX ' + diag(iCLX )%desc = 'Odd chlorine' + diag(iCLX )%unit = 'mol/mol' + +! -------------------------------------------------------------------- +! 8 CO regions and types for INTEX-B 2006 +! -------------------------------------------------------------------- + + diag(iCO )%name = 'CO ' + diag(iCO )%desc = 'Global Carbon Monoxide' + diag(iCO )%unit = 'mol/mol' + + diag(iCONOAMAN)%name = 'CONOAMAN' + diag(iCONOAMAN)%desc = 'North American anthropogenic CO' + diag(iCONOAMAN)%unit = 'mol/mol' + + diag(iCOCEAMAN)%name = 'COCEAMAN' + diag(iCOCEAMAN)%desc = 'Central American anthropogenic CO' + diag(iCOCEAMAN)%unit = 'mol/mol' + + diag(iCOWHBB )%name = 'COWHBB ' + diag(iCOWHBB )%desc = 'Western Hemisphere biomass burning CO' + diag(iCOWHBB )%unit = 'mol/mol' + + diag(iCOASIAAN)%name = 'COASIAAN' + diag(iCOASIAAN)%desc = 'Asian anthropogenic CO' + diag(iCOASIAAN)%unit = 'mol/mol' + + diag(iCOASNBB )%name = 'COASNBB ' + diag(iCOASNBB )%desc = 'Northern Asia biomass burning CO' + diag(iCOASNBB )%unit = 'mol/mol' + + diag(iCOASSBB )%name = 'COASSBB ' + diag(iCOASSBB )%desc = 'Southern Asia biomass burning CO' + diag(iCOASSBB )%unit = 'mol/mol' + + diag(iCOFDAN )%name = 'COFDAN ' + diag(iCOFDAN )%desc = 'Mexico City anthropogenic CO' + diag(iCOFDAN )%unit = 'mol/mol' + +! -------------------------------------------------------------------- + + diag(iCOFF )%name = 'COFF ' + diag(iCOFF )%desc = 'CO tagged to Fossil Fuel' + diag(iCOFF )%unit = 'mol/mol' + + diag(iCOBF )%name = 'COBF ' + diag(iCOBF )%desc = 'CO tagged to Biofuel' + diag(iCOBF )%unit = 'mol/mol' + + diag(iCOBB )%name = 'COBB ' + diag(iCOBB )%desc = 'CO tagged to Biomass Burning' + diag(iCOBB )%unit = 'mol/mol' + + diag(iCOBI )%name = 'COBI ' + diag(iCOBI )%desc = 'CO tagged to Biogenic' + diag(iCOBI )%unit = 'mol/mol' + + diag(iCONAMERI)%name = 'COnam ' + diag(iCONAMERI)%desc = 'North American CO' + diag(iCONAMERI)%unit = 'mol/mol' + + diag(iCOSAMERI)%name = 'COsam ' + diag(iCOSAMERI)%desc = 'South American CO' + diag(iCOSAMERI)%unit = 'mol/mol' + + diag(iCOAFRICA)%name = 'COafr ' + diag(iCOAFRICA)%desc = 'African CO' + diag(iCOAFRICA)%unit = 'mol/mol' + + diag(iCO2 )%name = 'CO2 ' + diag(iCO2 )%desc = 'Carbon Dioxide' + diag(iCO2 )%unit = 'mol/mol' + + diag(iCO2NAMER)%name = 'CO2nam ' + diag(iCO2NAMER)%desc = 'North American CO2' + diag(iCO2NAMER)%unit = 'mol/mol' + + diag(iCO2SAMER)%name = 'CO2sam ' + diag(iCO2SAMER)%desc = 'South American CO2' + diag(iCO2SAMER)%unit = 'mol/mol' + + diag(iCO2AFRIC)%name = 'CO2afr ' + diag(iCO2AFRIC)%desc = 'African CO2' + diag(iCO2AFRIC)%unit = 'mol/mol' + + diag(iF11 )%name = 'F11 ' + diag(iF11 )%desc = 'CFC-11 (CCl3F)' + diag(iF11 )%unit = 'mol/mol' + + diag(iF113 )%name = 'F113 ' + diag(iF113 )%desc = 'CFC-113 (CCl2FCClF2)' + diag(iF113 )%unit = 'mol/mol' + + diag(iF12 )%name = 'F12 ' + diag(iF12 )%desc = 'CFC-12 (CCl2F2)' + diag(iF12 )%unit = 'mol/mol' + + diag(iH12_24 )%name = 'H12_24 ' + diag(iH12_24 )%desc = 'Halon 12_24' + diag(iH12_24 )%unit = 'mol/mol' + + diag(iH1301 )%name = 'H1301 ' + diag(iH1301 )%desc = 'Halon 1301 (CBrF3)' + diag(iH1301 )%unit = 'mol/mol' + + diag(iH2O2 )%name = 'H2O2 ' + diag(iH2O2 )%desc = 'Hydrogen peroxide' + diag(iH2O2 )%unit = 'mol/mol' + + diag(iH2OCOND )%name = 'H2OCOND ' + diag(iH2OCOND )%desc = 'Condensed water vapor in chemistry' + diag(iH2OCOND )%unit = 'mol/mol' + + diag(iHATOMIC )%name = 'HATOMIC ' + diag(iHATOMIC )%desc = 'Atomic hydrogen' + diag(iHATOMIC )%unit = 'mol/mol' + + diag(iHBR )%name = 'HBR ' + diag(iHBR )%desc = 'Hydrogen bromide' + diag(iHBR )%unit = 'mol/mol' + + diag(iHCFC )%name = 'HCFC ' + diag(iHCFC )%desc = 'HCFC' + diag(iHCFC )%unit = 'mol/mol' + + diag(iHCL )%name = 'HCL ' + diag(iHCL )%desc = 'Hydrochloric acid' + diag(iHCL )%unit = 'mol/mol' + + diag(iHNO3 )%name = 'HNO3 ' + diag(iHNO3 )%desc = 'Nitric acid' + diag(iHNO3 )%unit = 'mol/mol' + + diag(iHNO3COND)%name = 'HNO3COND' + diag(iHNO3COND)%desc = 'Condensed nitric acid' + diag(iHNO3COND)%unit = 'mol/mol' + + diag(iHO2 )%name = 'HO2 ' + diag(iHO2 )%desc = 'Hydroperoxyl radical' + diag(iHO2 )%unit = 'mol/mol' + + diag(iHO2NO2 )%name = 'HO2NO2 ' + diag(iHO2NO2 )%desc = 'Peroxynitric acid' + diag(iHO2NO2 )%unit = 'mol/mol' + + diag(iHOBR )%name = 'HOBR ' + diag(iHOBR )%desc = 'Hypobromous acid' + diag(iHOBR )%unit = 'mol/mol' + + diag(iHOCL )%name = 'HOCL ' + diag(iHOCL )%desc = 'Hypochlorous acid' + diag(iHOCL )%unit = 'mol/mol' + + diag(iN )%name = 'N ' + diag(iN )%desc = 'Atomic nitrogen' + diag(iN )%unit = 'mol/mol' + + diag(iN2O )%name = 'N2O ' + diag(iN2O )%desc = 'Nitrous oxide' + diag(iN2O )%unit = 'mol/mol' + + diag(iN2O5 )%name = 'N2O5 ' + diag(iN2O5 )%desc = 'Dinitrogen pentoxide' + diag(iN2O5 )%unit = 'mol/mol' + + diag(iNO )%name = 'NO ' + diag(iNO )%desc = 'Nitric oxide' + diag(iNO )%unit = 'mol/mol' + + diag(iNO2 )%name = 'NO2 ' + diag(iNO2 )%desc = 'Nitrogen dioxide' + diag(iNO2 )%unit = 'mol/mol' + + diag(iNO3 )%name = 'NO3 ' + diag(iNO3 )%desc = 'Nitrogen trioxide' + diag(iNO3 )%unit = 'mol/mol' + + diag(iNOX )%name = 'NOX ' + diag(iNOX )%desc = 'Odd nitrogen' + diag(iNOX )%unit = 'mol/mol' + + diag(iO1D )%name = 'O1D ' + diag(iO1D )%desc = 'Atomic oxygen in the first excited state' + diag(iO1D )%unit = 'mol/mol' + + diag(iO3CHEM )%name = 'O3CHEM ' + diag(iO3CHEM )%desc = 'Ozone volume mixing ratio from chemistry' + diag(iO3CHEM )%unit = 'mol/mol' + + diag(iO3P )%name = 'O3P ' + diag(iO3P )%desc = 'Atomic oxygen in the ground state' + diag(iO3P )%unit = 'mol/mol' + + diag(iO3PARAM )%name = 'O3PARAM ' + diag(iO3PARAM )%desc = 'Parameterized ozone' + diag(iO3PARAM )%unit = 'mol/mol' + + diag(iOCLO )%name = 'OCLO ' + diag(iOCLO )%desc = 'Chlorine dioxide' + diag(iOCLO )%unit = 'mol/mol' + + diag(iOH )%name = 'OH ' + diag(iOH )%desc = 'Hydroxyl radical' + diag(iOH )%unit = 'mol/mol' + + diag(iOX )%name = 'OX ' + diag(iOX )%desc = 'Odd oxygen from Parameterized Chemistry' + diag(iOX )%unit = 'mol/mol' + + diag(iOXSTRAT )%name = 'OXSTRAT ' + diag(iOXSTRAT )%desc = 'Odd oxygen from Stratospheric Chemistry' + diag(iOXSTRAT )%unit = 'mol/mol' + + diag(iOXTROP )%name = 'OXTROP ' + diag(iOXTROP )%desc = 'Tropospheric odd oxygen' + diag(iOXTROP )%unit = 'mol/mol' + + diag(iDUMASS )%name = 'DUMASS ' + diag(iDUMASS )%desc = 'Dust 3D Mass Mixing Ratio' + diag(iDUMASS )%unit = 'kg/kg' + + diag(iDUMASS25 )%name = 'DUMASS25 ' + diag(iDUMASS25 )%desc = 'Dust 3D Mass Mixing Ratio (PM2.5)' + diag(iDUMASS25 )%unit = 'kg/kg' + + diag(iDUMASS1 )%name = 'DUMASS1 ' + diag(iDUMASS1 )%desc = 'Dust sub-micron 3D Mass Mixing Ratio' + diag(iDUMASS1 )%unit = 'kg/kg' + + diag(iSSMASS )%name = 'SSMASS ' + diag(iSSMASS )%desc = 'Seasalt 3D Mass Mixing Ratio' + diag(iSSMASS )%unit = 'kg/kg' + + diag(iSSMASS25 )%name = 'SSMASS25 ' + diag(iSSMASS25 )%desc = 'Seasalt 3D Mass Mixing Ratio (PM2.5)' + diag(iSSMASS25 )%unit = 'kg/kg' + + diag(iBCMASS )%name = 'BCMASS ' + diag(iBCMASS )%desc = 'Black Carbon 3D Mass Mixing Ratio' + diag(iBCMASS )%unit = 'kg/kg' + + diag(iOCMASS )%name = 'OCMASS ' + diag(iOCMASS )%desc = 'Organic Carbon 3D Mass Mixing Ratio' + diag(iOCMASS )%unit = 'kg/kg' + + diag(iSO4MASS )%name = 'SO4MASS ' + diag(iSO4MASS )%desc = 'SO4 Aerosol 3D Mass Mixing Ratio' + diag(iSO4MASS )%unit = 'kg/kg' + + diag(iPSO2 )%name = 'PSO2 ' + diag(iPSO2 )%desc = 'Chemical production of SO2 from DMS ox' + diag(iPSO2 )%unit = 'kg/m2/s' + + diag(iPMSA )%name = 'PMSA ' + diag(iPMSA )%desc = 'Chemical production of MSA from DMS ox' + diag(iPMSA )%unit = 'kg/m2/s' + + diag(iPSO4g )%name = 'PSO4g ' + diag(iPSO4g )%desc = 'Chemical production of SO4 from SO2 ox (gas)' + diag(iPSO4g )%unit = 'kg/m2/s' + + diag(iPSO4aq )%name = 'PSO4aq ' + diag(iPSO4aq )%desc = 'Chemical production of SO4 from SO2 ox (aqueous)' + diag(iPSO4aq )%unit = 'kg/m2/s' + + diag(iPSO4wet )%name = 'PSO4wet ' + diag(iPSO4wet )%desc = 'Chemical production of SO4 from SO2 ox (wet dep)' + diag(iPSO4wet )%unit = 'kg/m2/s' + + diag(iQ4AGE )%name = 'Q4AGE ' + diag(iQ4AGE )%desc = 'Surface souce gas for computation of age-of-air' + diag(iQ4AGE )%unit = 'kg/kg' + +#endif + + RETURN + END SUBROUTINE diaglist diff --git a/ESMF/Shared/Chem_Shared/diurnal.ctl b/ESMF/Shared/Chem_Shared/diurnal.ctl new file mode 100644 index 00000000..1eedb9a6 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/diurnal.ctl @@ -0,0 +1,11 @@ +dset ^diurnal.bin +undef 1e15 +options sequential +xdef 288 linear 0 1.25 +ydef 181 linear -90 1.00 +zdef 1 levels 1 +tdef 96 linear 0z5feb1960 15mn +vars 1 +bb 0 0 Diurnal BB +endvars + diff --git a/ESMF/Shared/Chem_Shared/gmi_drydep_data.h b/ESMF/Shared/Chem_Shared/gmi_drydep_data.h new file mode 100644 index 00000000..b640949e --- /dev/null +++ b/ESMF/Shared/Chem_Shared/gmi_drydep_data.h @@ -0,0 +1,263 @@ + +!============================================================================= +! +! $Id$ +! +! CODE DEVELOPER +! Dan Bergmann, LLNL +! dbergmann@llnl.gov +! +! FILE +! gmi_drydep_data.h +! +! DESCRIPTION +! This include file sets the data required for the dry deposition algorithm. +! It includes land types, resistances, and polynomial coefficients from +! files "drydep_table" and "drydep_coef", which were supplied by Daniel +! Jacob at Harvard. The original files follow these parameter statements. +! +! NOTE THAT SURFACE DEPENDENT PARAMETERS WERE ADDED ON 2/11/02 TO CALCULATE +! SURFACE RESISTANCE FOR AEROSOLS. +! +! Mar 30, 2017: Moved this file from GmiInclude/ to Chem_Shared/ for TR +! +!============================================================================= + + +! ------------------- +! Integer parameters. +! ------------------- + +! -------------------------------------------------------------------- +! IDEP : deposition surface type for each Olson surface type +! IRAC : resistance that depends on canopy height and density (s^-1) +! IRCLO : resistance for leaves, twig, bark in lower canopy (s^-1) +! IRCLS : resistance for leaves, twig, bark in lower canopy (s^-1) +! IRGSO : ground resistance (s^-1) +! IRGSS : ground resistance (s^-1) +! IRI : internal resistance (s^-1) +! IRLU : cuticular resistance (s^-1) +! IWATER : id's for surface types that are water +! IZO : roughness height (m/10000) +! NWATER : number of Olson's surface types that are water +! -------------------------------------------------------------------- + + integer, parameter :: IDEP(NVEGTYPE) = (/ & + & 11, 10, 5, 1, 1, 1, 2, 1, 8, 1, & + & 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, & + & 3, 3, 3, 3, 2, 2, 2, 3, 2, 2, & + & 4, 4, 2, 6, 1, 1, 9, 4, 4, 4, & + & 5, 5, 5, 5, 5, 9, 5, 5, 5, 5, & + & 8, 8, 5, 7, 6, 2, 2, 2, 2, 2, & + & 3, 3, 3, 5, 5, 11, 11, 11, 11, 8, & + & 1, 8, 9, 11 /) + + integer, parameter :: IRAC(NTYPE) = (/ & + & 0, 2000, 2000, 200, 100, & + & 2000, 0, 0, 300, 100, & + & 0, 0, 0, 0, 0 /) + + integer, parameter :: IRCLO(NTYPE) = (/ & + & 1000, 1000, 1000, 1000, 1000, & + & 9999, 9999, 9999, 1000, 9999, & + & 9999, 0, 0, 0, 0 /) + + integer, parameter :: IRCLS(NTYPE) = (/ & + & 9999, 2000, 2000, 2000, 2000, & + & 9999, 9999, 9999, 2500, 9999, & + & 9999, 0, 0, 0, 0 /) + + integer, parameter :: IRGSO(NTYPE) = (/ & + & 3500, 200, 200, 150, 200, & + & 200, 340, 400, 1000, 300, & + & 2000, 0, 0, 0, 0 /) + + integer, parameter :: IRGSS(NTYPE) = (/ & + & 100, 500, 500, 150, 350, & + & 200, 340, 1000, 0, 400, & + & 0, 0, 0, 0, 0 /) + + integer, parameter :: IRI(NTYPE) = (/ & + & 9999, 200, 400, 200, 200, & + & 200, 200, 9999, 200, 9999, & + & 9999, 0, 0, 0, 0 /) + + integer, parameter :: IRLU(NTYPE) = (/ & + & 9999, 9000, 9000, 9000, 9000, & + & 1000, 4000, 9999, 9000, 9999, & + & 9999, 0, 0, 0, 0 /) + + integer, parameter :: IWATER(NVEGTYPE) = (/ & + & 1, 66, 67, 68, 69, 74, 0, 0, 0, 0, & + & 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + & 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + & 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + & 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + & 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + & 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & + & 0, 0, 0, 0 /) + + integer, parameter :: IZO(NVEGTYPE) = (/ & + & 10, 25000, 100, 1000, 1000, 1000, 10000, 1000, 10, 1000, & + & 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1, 1000, 1000, & + & 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 1000, 10000, & + & 1000, 1000, 2000, 10000, 1000, 1000, 100, 1000, 1000, 1000, & + & 100, 100, 100, 100, 100, 100, 1000, 1000, 1000, 1000, & + & 10, 10, 100, 50, 10000, 2000, 2000, 2000, 2000, 2000, & + & 10000, 10000, 10000, 2000, 50, 100, 100, 100, 100, 10, & + & 1, 1, 500, 10 /) + + integer, parameter :: NWATER = 6 + + +! -------------------------------------------------- +! From Zhang et al. [Atmos. Env., p549-560, 2001] => +! +! IWET : flag for wet surface = 1, otherwise = -1 +! -------------------------------------------------- + + integer, parameter :: IWET(NTYPE) = (/ & + & 1, -1, -1, -1, -1, & + & -1, -1, -1, 1, -1, & + & 1, 0, 0, 0, 0 /) + + +! ---------------- +! Real parameters. +! ---------------- + +! ------------------------------------------ +! DRYCOEFF : polynomial fitting coefficients +! ------------------------------------------ + + real*8, parameter :: DRYCOEFF(NPOLY) = (/ & + & -3.58d-01, 3.02d+00, 3.85d+00, -9.78d-02, -3.66d+00, & + & 1.20d+01, 2.52d-01, -7.80d+00, 2.26d-01, 2.74d-01, & + & 1.14d+00, -2.19d+00, 2.61d-01, -4.62d+00, 6.85d-01, & + & -2.54d-01, 4.37d+00, -2.66d-01, -1.59d-01, -2.06d-01 /) + + +! ------------------------------------------------------------------------ +! From Zhang et al. [Atmos. Env., p549-560, 2001] => +! +! A_VEG : characteristic radius of collectors over vegetated surface (m) +! ALFA_IM : value for calculating collection efficiency from impaction (m) +! GAMA_BR : value for calculating collection efficiency from Brownian (m) +! ------------------------------------------------------------------------ + + real*8, parameter :: A_VEG(NTYPE) = (/ & + & -1.00d+00, 5.10d-03, 3.50d-03, 3.20d-03, 10.00d-03, & + & 5.00d-03, -1.00d+00, -1.00d+00, 10.00d-03, 10.00d-03, & + & -1.00d+00, 0.00d+00, 0.00d+00, 0.00d+00, 0.00d+00 /) + + real*8, parameter :: ALFA_IM(NTYPE) = (/ & + & 50.00d+00, 0.95d+00, 0.80d+00, 1.20d+00, 1.30d+00, & + & 0.80d+00, 50.00d+00, 50.00d+00, 2.00d+00, 1.50d+00, & + & 100.00d+00, 0.00d+00, 0.00d+00, 0.00d+00, 0.00d+00 /) + + real*8, parameter :: GAMA_BR(NTYPE) = (/ & + & 0.54d+00, 0.56d+00, 0.57d+00, 0.54d+00, 0.54d+00, & + & 0.56d+00, 0.54d+00, 0.54d+00, 0.54d+00, 0.56d+00, & + & 0.50d+00, 0.00d+00, 0.00d+00, 0.00d+00, 0.00d+00 /) + + +! ****************Daniel J. Jacob 6/27/94 **************************************** +! *** Olson surface types, corresponding surface types for deposition, +! *** and corresponding roughness height +! ******************************************************************************** +! Olson ID# - deposition ID# - z0 in 1.E-4 m +! 1 11 1 Water +! 2 10 10000 Urban +! 3 5 50 Shrub +! 4 1 1000 Not used +! 5 1 1000 ibid. +! 6 1 1000 ibid. +! 7 2 10000 Tropical evergreen +! 8 1 1000 Not used +! 9 8 1 Desert +! 10 1 1000 Not used +! 11 1 1000 ibid. +! 12 1 1000 ibid. +! 13 1 1000 ibid. +! 14 1 1000 ibid. +! 15 1 1000 ibid. +! 16 1 1000 ibid. +! 17 5 1000 Scrub +! 18 1 1 Ice +! 19 1 1000 Not used +! 20 1 1000 ibid. +! 21 3 10000 Conifer +! 22 3 10000 Conifer +! 23 3 10000 Conifer +! 24 3 10000 Conifer/deciduous +! 25 2 10000 Deciduous/conifer +! 26 2 10000 Deciduous +! 27 2 10000 Deciduous +! 28 3 10000 Conifer +! 29 2 1000 Dwarf forest +! 30 2 10000 Tropical broadleaf +! 31 4 1000 Agric. +! 32 4 1000 ibid. +! 33 2 1000 Dec. woodland +! 34 6 10000 Tropical rainforest +! 35 1 1000 Not used +! 36 1 1000 Not used +! 37 9 100 Rice paddies +! 38 4 1000 Agric. +! 39 4 1000 Agric. +! 40 4 1000 Agric. +! 41 5 100 Shrub/grass +! 42 5 100 Shrub/grass +! 43 5 100 Shrub/grass +! 44 5 100 Shrub/grass +! 45 5 100 Shrub/grass +! 46 9 100 Wetland +! 47 5 1000 Scrub +! 48 5 1000 Scrub +! 49 5 1000 Scrub +! 50 5 1000 Scrub +! 51 8 100 Desert +! 52 8 100 Desert +! 53 5 100 Steppe +! 54 7 50 Tundra +! 55 6 10000 Rainforest +! 56 2 1000 Mixed wood/open +! 57 2 1000 Mixed wood/open +! 58 2 1000 Mixed wood/open +! 59 2 1000 Mixed wood/open +! 60 2 1000 Mixed wood/open +! 61 3 10000 Conifers +! 62 3 10000 Conifers +! 63 3 10000 Conifers +! 64 5 1000 Wooded tundra +! 65 5 50 Moor +! 66 11 1 Coastal +! 67 11 1 Coastal +! 68 11 1 Coastal +! 69 11 1 Coastal +! 70 8 10 Desert +! 71 1 10 Ice +! 72 8 1 Salt flats +! 73 9 500 Wetland +! 74 11 1 Water +! ** +! 6 1 66 67 68 69 74 #/Olson ID's of water surface types +! ** Resistances (s m-1) for each deposition surface type, +! ** and maximum deposition velocity Vsmax(1.d-2 cm s-1) for aerosol +! Type Ri Rlu Rac RgsS RgsO RclS RclO Vsmax +! 1 9999 9999 0 100 3500 9999 1000 100 Snow/Ice (Wesely, AE 1989)- +! listed first. +! 2 200 9000 2000 500 200 2000 1000 100 Deciduous forest (Wesely) +! 3 400 9000 2000 500 200 2000 1000 100 Coniferous forest (Wesely) +! 4 200 9000 200 150 150 2000 1000 100 Agricultural land (Wesely) +! 5 200 9000 100 350 200 2000 1000 100 Shrub/grassland (Wesely) +! 6 200 1000 2000 200 200 9999 9999 100 Amazon forest +! (Jacob & Wofsy, JGR 1990) +! 7 200 4000 0 340 340 9999 9999 100 Tundra +! (Jacob et al., JGR 1992) +! 8 9999 9999 0 1000 400 9999 9999 10 Desert (Wesely) +! 9 200 9000 300 0 1000 2500 1000 100 Wetland (Wesely) +! 10 9999 9999 100 400 300 9999 9999 100 Urban (Wesely) +! 11 9999 9999 0 0 2000 9999 9999 10 Water (Wesely) +! + diff --git a/ESMF/Shared/Chem_Shared/gmi_emiss_constants.h b/ESMF/Shared/Chem_Shared/gmi_emiss_constants.h new file mode 100644 index 00000000..e7204a1c --- /dev/null +++ b/ESMF/Shared/Chem_Shared/gmi_emiss_constants.h @@ -0,0 +1,199 @@ + +!============================================================================= +! +! $Id$ +! +! CODE DEVELOPER +! John Tannahill, LLNL +! jrt@llnl.gov +! +! FILE +! gmi_emiss_constants.h +! +! Last modified: 03/29/04 +! - incorporated Bryan Duncan's suggested values. +! DESCRIPTION +! This include file contains constants for the Harvard biogenic and soil +! emissions. +! HISTORY +! - August 12, 2005 * Jules Kouatchou +! Remove "NLANDHAR" as a parameter in this file and add it as a namelist +! variable. This is done because we want the user to determine its value +! at run time. If not, the user would have to modify its value at +! compilation whenever there is a change of model resolution. +! +! Mar 30, 2017: Moved this file from GmiInclude/ to Chem_Shared/ for TR +! +!============================================================================= + + +!c!? Should be fixed sometime. +! ------------------------------------------------------------- +! NOTE THAT NEED TO MATCH THE NLANDHAR PARAMETER BELOW WITH THE +! RESOLUTION YOU ARE RUNNING AT! +! ------------------------------------------------------------- + +!! integer, parameter :: +!! & NLANDHAR = 3920 ! number of grids on land for 2x2.5 resolution +!! & NLANDHAR = 1118 ! number of grids on land for 4x5 resolution +! integer :: NLANDHAR + +! common /emiss_NLANDHAR/ NLANDHAR + + + integer, parameter :: & + & NPOLY = 20, & ! number of coefficients for polynomial fits + & NPULSE = 3, & ! number of types of pulsing + & NSOIL = 11, & ! defined soil types + & NTYPE = 15, & ! maximum number of vegetation types in any + ! grid box + & NVEGTYPE = 74 ! maximum number of surface types (Olson) + + +! ---------------------------------------------------------- +! MWTCARBON : molecular weight of Carbon (g/mol) +! MWTCO : molecular weight of CO (g/mol) +! MWTMONOT : molecular weight of monoterpene (C10H16) (g/mol) +! ---------------------------------------------------------- + + real*8, parameter :: & + & MWTCARBON = 12.01d0, & + & MWTCO = 28.01d0, & + & MWTMONOT = 136.00d0 + + +! --------------------------------------------- +! ATOMSC_PER_MOLECCO : atomsC/molec CO +! ATOMSC_PER_MOLECISOP : atomsC/molec isoprene +! ATOMSC_PER_MOLECMONOT : atomsC/molec monoterpene +! ATOMSC_PER_MOLECPRPE : atomsC/molec proprene +! --------------------------------------------- + + real*8, parameter :: & + & ATOMSC_PER_MOLECCO = 1.0d0, & + & ATOMSC_PER_MOLECISOP = 5.0d0, & + & ATOMSC_PER_MOLECMONOT = 10.0d0, & + & ATOMSC_PER_MOLECPRPE = 3.0d0 + + +! ---------------------------------------------------------------------- +! BIOSCAL : factor for biogenic source of propene, scaled from isoprene +! (atomsCalkenes / atomsCisoprene) +! +! We need to scale the isoprene flux to get the biogenic emissions of +! alkenes (probably OK for summertime conditions). +! +! The scaling factor is based on work by Allen Goldstein. His values +! indicate emission ratios of ethene:propene:butene=4:2:1 (on a per +! molecule basis), with total emissions approx. equal to 10% of isoprene +! emissions (again, on a per molecule basis): +! +! (10 molec alkenes / 100 molec isoprene) * +! ( 1 molec isoprene / 5 atomsC isoprene) * +! ( 3 molec butene + propene / 7 molec total alkenes) * +! ( 3.3333 atomsCbutene+propene mix / 1 molec butene+propene mix) = +! +! 0.0286 atomsCbutene+propene / atomsCisoprene +! +! Note that 3.3333 atomsC/molec is the weighted average for this mix. +! Note also that this factor now excludes ethene. +! ---------------------------------------------------------------------- + + real*8, parameter :: & + & BIOSCAL = 0.0286d0 + + +! ------------------------------------------------------------------ +! ICO_FAC_ISOP : factor for biogenic source of CO from methanol +! oxidation, scaled from isoprene +! +! We need to scale the isoprene flux to get the CH3OH (methanol) +! flux. Currently, the annual isoprene flux in GEOS-CHEM is +! ~397 tg C. +! +! Daniel Jacob recommends a flux of 100 tg/yr CO from CH3OH +! oxidation based on Singh et al., 2000 (JGR 105, 3795-3805), who +! estimate a global methanol source of 122 tg/yr, of which most +! (75 tg/yr) is "primary biogenic". He also recommends for now, +! that the CO flux from CH3OH oxidation be scaled from monthly mean +! isoprene flux. +! +! To get CO from methanol oxidation, we must therefore multiply +! the isoprene flux by the following scale factor: +! +! (100 tg CO from CH3OH oxidation / 380 tg C from isoprene flux) * +! ( 60 g C/mole isoprene / 68 g isoprene/mole) +! ------------------------------------------------------------------ + + real*8, parameter :: & + & ICO_FAC_ISOP = (100.0d0 / 380.0d0) * (60.0d0 / 68.0d0) + + +! ------------------------------------------------------------------ +! ICO_FAC_MONOT : factor for biogenic source of CO from monoterpene +! oxidation. +! +! Assume the production of CO from monoterpenes is instantaneous +! even though the lifetime of intermediate species may be on the +! order of hours or days. This assumption will likely cause CO +! from monoterpene oxidation to be too high in the box in which +! the monoterpene is emitted. +! +! The CO yield here is taken from: +! +! Hatakeyama et al., JGR, Vol. 96, p. 947-958 (1991) => +! "The ultimate yield of CO from the tropospheric oxidation of +! terpenes (including both O3 and OH reactions) was estimated to +! be 20% on the carbon number basis." (They studied alpha- & +! beta-pinene.) +! +! Vinckier et al., Fresenius Env. Bull., Vol. 7, p.361-368 (1998) => +! "R(CO) = 1.8+/-0.3" ((1.8/10) is about 20%.) +! ------------------------------------------------------------------ + + real*8, parameter :: & + & ICO_FAC_MONOT = & + & 0.2d0 * & + & (ATOMSC_PER_MOLECMONOT / ATOMSC_PER_MOLECCO) * & + & (MWTCO / MWTMONOT) + + + real*8, parameter :: & + & PULSE_DECAY(NPULSE) = & ! values from Yienger & Levy + & (/ 0.805d0, 0.384d0, 0.208d0 /) + + real*8, parameter :: & + & PULSE_FAC(NPULSE) = & ! initial pulsing factor following a precip. + ! event + & (/ 5.0d0, 10.0d0, 15.0d0 /) + + + real*8, parameter :: & + & SOIL_AD(NSOIL) = & ! dry biome coefficient + & (/ 0.0d0, 8.6d0, 0.22d0, 0.40d0, 0.22d0, 1.44d0, & + & 2.65d0, 2.65d0, 2.65d0, 0.003d0, 0.37d0 /) + + real*8, parameter :: & + & SOIL_AW(NSOIL) = & ! wet biome coefficient + & (/ 0.0d0, 2.6d0, 0.03d0, 0.06d0, 0.03d0, 0.17d0, & + & 0.36d0, 0.36d0, 0.36d0, 0.003d0, 0.05d0 /) + + + real*8, parameter :: & + & SOIL_EXT(NSOIL) = & ! canopy wind extinction coefficient + & (/ 0.1d0, 4.0d0, 4.0d0, 4.0d0, 4.0d0, 2.0d0, & + & 1.0d0, 2.0d0, 2.0d0, 0.5d0, 0.1d0 /) + + + real*8, parameter :: & + & SOIL_T1(NSOIL) = & ! first coefficient used to convert from + ! surface temperture to soil temperature + & (/ 0.0d0, 0.84d0, 0.84d0, 0.84d0, 0.84d0, 0.66d0, 0.66d0, & + & 1.03d0, 1.03d0, 0.92d0, 0.66d0 /) + + real*8, parameter :: & + & SOIL_T2(NSOIL) = & ! second coefficient used to convert from + ! surface temperture to soil temperature + & (/ 0.0d0, 3.6d0, 3.6d0, 3.6d0, 3.6d0, 8.8d0, 8.8d0, & + & 2.9d0, 2.9d0, 4.4d0, 8.8d0 /) + diff --git a/ESMF/Shared/Chem_Shared/gmi_phys_constants.h b/ESMF/Shared/Chem_Shared/gmi_phys_constants.h new file mode 100644 index 00000000..de4b3865 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/gmi_phys_constants.h @@ -0,0 +1,98 @@ + +!============================================================================= +! +! $Id$ +! +! CODE DEVELOPER +! John Tannahill, LLNL +! jrt@llnl.gov +! +! FILE +! gmi_phys_constants.h +! +! DESCRIPTION +! This include file contains some physical constants. +! +! Mar 30, 2017: Moved this file from GmiInclude/ to Chem_Shared/ for TR +! +!============================================================================= + + +! ------------------- +! Physical constants. +! ------------------- + + real*8, parameter :: & + & ABS_ZERO = -273.15d0, & ! absolute zero (degC) + & AVG_SRFPRS = 1000.0d0, & ! average surface pressure (mb) + & AVOGAD = 6.0221367d+23, & ! Avogadro number (mole^-1) + & BOLTZMN_E = 1.380662d-16, & ! Boltzman constant +! & & ! (erg *degK^-1*mole^-1) + & BOLTZMN_J = 1.380662d-23, & ! Boltzman constant +! & & ! (joule*degK^-1*mole^-1) +!c & GAS_CONST_E = 8.314409d+07, ! gas constant (erg *degK^-1*mole^-1) + & GAS_CONST_J = 8.314409d0, & ! gas constant (joule*degK^-1*mole^-1) + & GMI_G = 9.81d0, & ! mean surface gravity accel. (m/s^2) + & GMI_LN2 = 0.693147180559945d0, & ! natural logarithm of 2.0 + & GMI_PI = 3.141592653589793d0, & ! pi + & MASSATM = 5.14d18, & ! total mass of the atmosphere (kg) + & RADEAR = 6.371d+06, & ! radius of the earth (m) + & MXRN2 = 0.781d0, & ! N2 atmospheric volume mixing ratio + & MXRO2 = 0.209d0, & ! O2 atmospheric volume mixing ratio + & MXRH2 = 0.5d-06 ! H2 atmospheric volume mixing ratio + + +! --------------------------------------------- +! SAREA_EARTH : surface area of the earth (m^2) +! --------------------------------------------- + + real*8, parameter :: & + & SAREA_EARTH = 4.0d0 * GMI_PI * RADEAR * RADEAR + + +! -------------------------- +! Molecular weights (g/mol). +! -------------------------- + + real*8, parameter :: & + & MWTAIR = 28.96d0, & + & MWTH2O = 18.02d0 + + +! ---------------- +! Other constants. +! ---------------- + + real*8, parameter :: & + & CGS2MB = 0.001d0, & ! cgs units to millibars (cm^2/dyne) + & MB2CGS = 1000.0d0 ! millibars to cgs units (dyne/cm^2) + + real*8, parameter :: & + & DEGPRAD = 180.0d0 / GMI_PI, & ! degrees per radian + & RADPDEG = GMI_PI / 180.0d0 ! radians per degree + + real*8, parameter :: & + & KMPCM = 0.00001d0, & ! kilometers per centimeter + & KMPM = 0.001d0, & ! kilometers per meter + & MPCM = 0.01d0, & ! meters per centimeter + & CMPM = 100.0d0, & ! centimeters per meter + & MPKM = 1000.0d0, & ! meters per kilometer + & CMPKM = 100000.0d0 ! centimeters per kilometer + + real*8, parameter :: & + & TGPKG = 1.0d-09, & ! teragrams per kilogram + & KGPG = 0.001d0, & ! kilograms per gram + & GPKG = 1000.0d0, & ! grams per kilogram + & KGPTG = 1.0d+09 ! kilograms per teragram + + real*8, parameter :: & + & BPMB = 0.001d0, & ! bars per millibar + & MBPPAS = 0.01d0, & ! millibars per pascal + & PASPMB = 100.0d0, & ! pascals per millibar + & MBPB = 1000.0d0 ! millibars per bar + + real*8, parameter :: & + & PPT_FAC = 1.0d-12, & ! parts per trillion factor + & PPB_FAC = 1.0d-09, & ! parts per billion factor + & PPM_FAC = 1.0d-06 ! parts per million factor + diff --git a/ESMF/Shared/Chem_Shared/gmi_time_constants.h b/ESMF/Shared/Chem_Shared/gmi_time_constants.h new file mode 100644 index 00000000..aec59d85 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/gmi_time_constants.h @@ -0,0 +1,71 @@ + +!============================================================================= +! +! $Id$ +! +! CODE DEVELOPER +! John Tannahill, LLNL +! jrt@llnl.gov +! +! FILE +! gmi_time_constants.h +! +! DESCRIPTION +! This include file contains some time constants. +! +! Note that "LY" = "leap year". +! +! Mar 30, 2017: Moved this file from GmiInclude/ to Chem_Shared/ for TR +! +!============================================================================= + + +! ------------------ +! Integer constants. +! ------------------ + + integer, parameter :: & + & MINS_PER_HOUR = 60, & + & HRS_PER_DAY = 24, & + & DAYS_PER_WEEK = 7, & + & DAYS_PER_YEAR = 365, & + & DAYS_PER_YEAR_LY = 366 + + integer, parameter :: & + & MONTHS_PER_YEAR = 12 + + integer, parameter :: & + & SECPMN = 60, & ! seconds per minute + & SECPHR = SECPMN * MINS_PER_HOUR, & ! seconds per hour + & SECPDY = SECPHR * HRS_PER_DAY, & ! seconds per day + & SECPWK = SECPDY * DAYS_PER_WEEK, & ! seconds per week + & SECPYR = SECPDY * DAYS_PER_YEAR, & ! seconds per year + & SECPYR_LY = SECPDY * DAYS_PER_YEAR_LY ! seconds per leap year + + + integer, parameter :: DAYS_PER_MONTH (MONTHS_PER_YEAR) = & + & (/ 31, 28, 31, 30, 31, 30, & + & 31, 31, 30, 31, 30, 31 /) + + integer, parameter :: DAYS_PER_MONTH_LY(MONTHS_PER_YEAR) = & + & (/ 31, 29, 31, 30, 31, 30, & + & 31, 31, 30, 31, 30, 31 /) + + + integer, parameter :: START_DAY_OF_MONTH (MONTHS_PER_YEAR) = & + & (/ 1, 32, 60, 91, 121, 152, & + & 182, 213, 244, 274, 305, 335 /) + + integer, parameter :: START_DAY_OF_MONTH_LY(MONTHS_PER_YEAR) = & + & (/ 1, 32, 61, 92, 122, 153, & + & 183, 214, 245, 275, 306, 336 /) + + +! -------------------- +! Character constants. +! -------------------- + + character (len=3), parameter :: MONTH_NAME(MONTHS_PER_YEAR) = & + & (/ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', & + & 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' /) + diff --git a/ESMF/Shared/Chem_Shared/mod_diag.F90 b/ESMF/Shared/Chem_Shared/mod_diag.F90 new file mode 100644 index 00000000..b9b8b76b --- /dev/null +++ b/ESMF/Shared/Chem_Shared/mod_diag.F90 @@ -0,0 +1,929 @@ + MODULE mod_diag + +! !REVISION HISTORY: +! +! 16Jul2003 Norris Added a few comments. Will now allow a +! -ve history freq (-1) for non-output diags. +! 18Apr2005 Nielsen Removed iTRACER1-iTRACER5 and iCTRCR1-iCTRCR5, and +! added i-values for SC_GridComp species. + + implicit none +! +! ----------------------------------------------------------- +! Refer to ../README file for how to add or delete a field. +! ----------------------------------------------------------- +! +! ... 2-D diagnostic fields +! + integer iALBEDO + integer iALDIF + integer iALDIR + integer iASDIF + integer iASDIR + integer iBMA + integer iBULKTS + integer iCAPEMX + integer iCLDHGH + integer iCLDLOW + integer iCLDMED + integer iCLDPRS + integer iCLDTMP + integer iCLDTOT + integer iCNVCLD + integer iDRUNOFF + integer iDTG + integer iEMSFC + integer iFLNS + integer iFLNSC + integer iFLNT + integer iFLNTC + integer iFRACLAKE + integer iFRACVEG + integer iFSDS + integer iFSNS + integer iFSNSC + integer iFSNT + integer iFSNTC + integer iGWETROOT + integer iGWETTC + integer iGWETTOP + integer iH300 + integer iH500 + integer iHSURF + integer iHTLCL + integer iHTMMSE + integer iLAI + integer iLHFX + integer iLWSH + integer iO3DU + integer iORO + integer iOSR + integer iOSRCLR + integer iPARDF + integer iPARDR + integer iPBLH + integer iPREACC + integer iPRECC + integer iPRECL + integer iPRECL_RH + integer iQ10M + integer iQ2M + integer iQFLX + integer iQPERT + integer iSHFX + integer iSLP + integer iSNOWDP + integer iSNOWH + integer iSOILWC1 + integer iSOILWC2 + integer iSOLIN + integer iSRFRAD + integer iSRUNOFF + integer iSURFP + integer iT10M + integer iT200 + integer iT2M + integer iT850 + integer iTAUGWX + integer iTAUGWY + integer iTAUX + integer iTAUY + integer iTHICK + integer iTLAKE1 + integer iTPERT + integer iTQ + integer iTRAD + integer iTROPP + integer iTROPQ + integer iTROPT + integer iTSKIN + integer iTSLAKE + integer iTSOIL1 + integer iTVEG + integer iU10M + integer iU200 + integer iU2M + integer iU500 + integer iU850 + integer iUSTAR + integer iV10M + integer iV200 + integer iV2M + integer iV500 + integer iV850 + integer iVAVET + integer iVAVEU + integer iVAVEUQ + integer iVAVEUT + integer iVAVEV + integer iVAVEVQ + integer iVAVEVT + integer iWATCAN + integer iWBALLAKE + integer iZ0H + integer iZ0M + integer iZMMB + integer iZMPR + integer iZPD +! +! ... 3-D diagnostic fields +! + + integer iAIRDENS + integer iCAPE + integer iCGS + integer iCLDLWP + integer iCLOUD + integer iCLOUDUP + integer iCMFDQ + integer iCMFDQR2 + integer iCMFDT + integer iCMFDTR + integer iCMFETR + integer iCMFMC + integer iCMFMC2 + integer iCONVCLD + integer iDCAFDT + integer iDIABDT + integer iDQCOND + integer iDQPBLCG + integer iDQRL + integer iDTCOND + integer iDTPBLCG + integer iDTRAIN + integer iDTV + integer iDUV + integer iDVV + integer iEFFCLD + integer iEVAPL + integer iH + integer iHGHTE + integer iHKBETA + integer iHKETA + integer iKVH + integer iKVM + integer iO3VMR + integer iOMEGA + integer iPV + integer iQ + integer iQC + integer iQRL + integer iQRS + integer iRAYFDT + integer iRELHUM + integer iRHCLR + integer iRNEVPDQ + integer iRNEVPDT + integer iSETLWP + integer iSTRATCLD + integer iT + integer iTAUCLI + integer iTAUCLW + integer iTKE + integer iTTMGW + integer iU + integer iUQ + integer iUT + integer iUTGW + integer iUU + integer iUV + integer iV + integer iVD01 + integer iVQ + integer iVT + integer iVTGW + integer iVV + integer iZMCME + integer iZMDLF + integer iZMDQ + integer iZMDQR + integer iZMDT + integer iZMDU + integer iZMED + integer iZMEPS + integer iZMEU + integer iZMEVP + integer iZMMD + integer iZMMU + integer iZMPFLX + integer iZMQL + + integer pd2d ! Total number of 2-D diagnostic fields + integer pd3d ! Total number of 3-D diagnostic fields + integer pdiag ! Total number of diagnostic fields +! +! ... 2-D diagnosis fields +! + parameter (iALBEDO = 1) + parameter (iALDIF = iALBEDO + 1) + parameter (iALDIR = iALDIF + 1) + parameter (iASDIF = iALDIR + 1) + parameter (iASDIR = iASDIF + 1) + parameter (iBMA = iASDIR + 1) + parameter (iBULKTS = iBMA + 1) + parameter (iCAPEMX = iBULKTS + 1) + parameter (iCLDHGH = iCAPEMX + 1) + parameter (iCLDLOW = iCLDHGH + 1) + parameter (iCLDMED = iCLDLOW + 1) + parameter (iCLDPRS = iCLDMED + 1) + parameter (iCLDTMP = iCLDPRS + 1) + parameter (iCLDTOT = iCLDTMP + 1) + parameter (iCNVCLD = iCLDTOT + 1) + parameter (iDRUNOFF = iCNVCLD + 1) + parameter (iDTG = iDRUNOFF + 1) + parameter (iEMSFC = iDTG + 1) + parameter (iFLNS = iEMSFC + 1) + parameter (iFRACLAKE = iFLNS + 1) + parameter (iFRACVEG = iFRACLAKE+ 1) + parameter (iFLNSC = iFRACVEG + 1) + parameter (iFLNT = iFLNSC + 1) + parameter (iFLNTC = iFLNT + 1) + parameter (iFSDS = iFLNTC + 1) + parameter (iFSNS = iFSDS + 1) + parameter (iFSNSC = iFSNS + 1) + parameter (iFSNT = iFSNSC + 1) + parameter (iFSNTC = iFSNT + 1) + parameter (iGWETROOT = iFSNTC + 1) + parameter (iGWETTC = iGWETROOT+ 1) + parameter (iGWETTOP = iGWETTC + 1) + parameter (iH300 = iGWETTOP + 1) + parameter (iH500 = iH300 + 1) + parameter (iHSURF = iH500 + 1) + parameter (iHTLCL = iHSURF + 1) + parameter (iHTMMSE = iHTLCL + 1) + parameter (iLAI = iHTMMSE + 1) + parameter (iLHFX = iLAI + 1) + parameter (iLWSH = iLHFX + 1) + parameter (iO3DU = iLWSH + 1) + parameter (iORO = iO3DU + 1) + parameter (iOSR = iORO + 1) + parameter (iOSRCLR = iOSR + 1) + parameter (iPARDF = iOSRCLR + 1) + parameter (iPARDR = iPARDF + 1) + parameter (iPBLH = iPARDR + 1) + parameter (iPREACC = iPBLH + 1) + parameter (iPRECC = iPREACC + 1) + parameter (iPRECL = iPRECC + 1) + parameter (iPRECL_RH = iPRECL + 1) + parameter (iQ10M = iPRECL_RH+ 1) + parameter (iQ2M = iQ10M + 1) + parameter (iQFLX = iQ2M + 1) + parameter (iQPERT = iQFLX + 1) + parameter (iSHFX = iQPERT + 1) + parameter (iSLP = iSHFX + 1) + parameter (iSNOWDP = iSLP + 1) + parameter (iSNOWH = iSNOWDP + 1) + parameter (iSOILWC1 = iSNOWH + 1) + parameter (iSOILWC2 = iSOILWC1 + 1) + parameter (iSOLIN = iSOILWC2 + 1) + parameter (iSRFRAD = iSOLIN + 1) + parameter (iSRUNOFF = iSRFRAD + 1) + parameter (iSURFP = iSRUNOFF + 1) + parameter (iT10M = iSURFP + 1) + parameter (iT200 = iT10M + 1) + parameter (iT2M = iT200 + 1) + parameter (iT850 = iT2M + 1) + parameter (iTAUGWX = iT850 + 1) + parameter (iTAUGWY = iTAUGWX + 1) + parameter (iTAUX = iTAUGWY + 1) + parameter (iTAUY = iTAUX + 1) + parameter (iTHICK = iTAUY + 1) + parameter (iTLAKE1 = iTHICK + 1) + parameter (iTPERT = iTLAKE1 + 1) + parameter (iTQ = iTPERT + 1) + parameter (iTRAD = iTQ + 1) + parameter (iTROPP = iTRAD + 1) + parameter (iTROPQ = iTROPP + 1) + parameter (iTROPT = iTROPQ + 1) + parameter (iTSKIN = iTROPT + 1) + parameter (iTSLAKE = iTSKIN + 1) + parameter (iTSOIL1 = iTSLAKE + 1) + parameter (iTVEG = iTSOIL1 + 1) + parameter (iU10M = iTVEG + 1) + parameter (iU200 = iU10M + 1) + parameter (iU2M = iU200 + 1) + parameter (iU500 = iU2M + 1) + parameter (iU850 = iU500 + 1) + parameter (iUSTAR = iU850 + 1) + parameter (iV10M = iUSTAR + 1) + parameter (iV200 = iV10M + 1) + parameter (iV2M = iV200 + 1) + parameter (iV500 = iV2M + 1) + parameter (iV850 = iV500 + 1) + parameter (iVAVET = iV850 + 1) + parameter (iVAVEU = iVAVET + 1) + parameter (iVAVEUQ = iVAVEU + 1) + parameter (iVAVEUT = iVAVEUQ + 1) + parameter (iVAVEV = iVAVEUT + 1) + parameter (iVAVEVQ = iVAVEV + 1) + parameter (iVAVEVT = iVAVEVQ + 1) + parameter (iWATCAN = iVAVEVT + 1) + parameter (iWBALLAKE = iWATCAN + 1) + parameter (iZ0H = iWBALLAKE+ 1) + parameter (iZ0M = iZ0H + 1) + parameter (iZMMB = iZ0M + 1) + parameter (iZMPR = iZMMB + 1) + parameter (iZPD = iZMPR + 1) + +#ifdef FVCHEM + integer, parameter :: iDUEM001 = iZPD + 1 + integer, parameter :: iDUEM002 = iDUEM001 + 1 + integer, parameter :: iDUEM003 = iDUEM002 + 1 + integer, parameter :: iDUEM004 = iDUEM003 + 1 + integer, parameter :: iDUEM005 = iDUEM004 + 1 + integer, parameter :: iDUEM006 = iDUEM005 + 1 + integer, parameter :: iDUEM007 = iDUEM006 + 1 + integer, parameter :: iDUEM008 = iDUEM007 + 1 + + integer, parameter :: iDUSD001 = iDUEM008 + 1 + integer, parameter :: iDUSD002 = iDUSD001 + 1 + integer, parameter :: iDUSD003 = iDUSD002 + 1 + integer, parameter :: iDUSD004 = iDUSD003 + 1 + integer, parameter :: iDUSD005 = iDUSD004 + 1 + integer, parameter :: iDUSD006 = iDUSD005 + 1 + integer, parameter :: iDUSD007 = iDUSD006 + 1 + integer, parameter :: iDUSD008 = iDUSD007 + 1 + + integer, parameter :: iDUDP001 = iDUSD008 + 1 + integer, parameter :: iDUDP002 = iDUDP001 + 1 + integer, parameter :: iDUDP003 = iDUDP002 + 1 + integer, parameter :: iDUDP004 = iDUDP003 + 1 + integer, parameter :: iDUDP005 = iDUDP004 + 1 + integer, parameter :: iDUDP006 = iDUDP005 + 1 + integer, parameter :: iDUDP007 = iDUDP006 + 1 + integer, parameter :: iDUDP008 = iDUDP007 + 1 + + integer, parameter :: iDUWT001 = iDUDP008 + 1 + integer, parameter :: iDUWT002 = iDUWT001 + 1 + integer, parameter :: iDUWT003 = iDUWT002 + 1 + integer, parameter :: iDUWT004 = iDUWT003 + 1 + integer, parameter :: iDUWT005 = iDUWT004 + 1 + integer, parameter :: iDUWT006 = iDUWT005 + 1 + integer, parameter :: iDUWT007 = iDUWT006 + 1 + integer, parameter :: iDUWT008 = iDUWT007 + 1 + + integer, parameter :: iDUSV001 = iDUWT008 + 1 + integer, parameter :: iDUSV002 = iDUSV001 + 1 + integer, parameter :: iDUSV003 = iDUSV002 + 1 + integer, parameter :: iDUSV004 = iDUSV003 + 1 + integer, parameter :: iDUSV005 = iDUSV004 + 1 + integer, parameter :: iDUSV006 = iDUSV005 + 1 + integer, parameter :: iDUSV007 = iDUSV006 + 1 + integer, parameter :: iDUSV008 = iDUSV007 + 1 + + integer, parameter :: iDUSMASS = iDUSV008 + 1 + integer, parameter :: iDUCMASS = iDUSMASS + 1 + integer, parameter :: iDUSMASS1 = iDUCMASS + 1 + integer, parameter :: iDUCMASS1 = iDUSMASS1 + 1 + integer, parameter :: iDUEXTTAU = iDUCMASS1 + 1 + integer, parameter :: iDUSCATAU = iDUEXTTAU + 1 + integer, parameter :: iDUAERIDX = iDUSCATAU + 1 + +! Dust submicron diagnostics (column integral) + integer, parameter :: iDUSM25 = iDUAERIDX + 1 + integer, parameter :: iDUCM25 = iDUSM25 + 1 + integer, parameter :: iDUEXTT25 = iDUCM25 + 1 + integer, parameter :: iDUSCAT25 = iDUEXTT25 + 1 + + integer, parameter :: iSSEM001 = iDUSCAT25 + 1 + integer, parameter :: iSSEM002 = iSSEM001 + 1 + integer, parameter :: iSSEM003 = iSSEM002 + 1 + integer, parameter :: iSSEM004 = iSSEM003 + 1 + integer, parameter :: iSSEM005 = iSSEM004 + 1 + integer, parameter :: iSSEM006 = iSSEM005 + 1 + integer, parameter :: iSSEM007 = iSSEM006 + 1 + integer, parameter :: iSSEM008 = iSSEM007 + 1 + + integer, parameter :: iSSSD001 = iSSEM008 + 1 + integer, parameter :: iSSSD002 = iSSSD001 + 1 + integer, parameter :: iSSSD003 = iSSSD002 + 1 + integer, parameter :: iSSSD004 = iSSSD003 + 1 + integer, parameter :: iSSSD005 = iSSSD004 + 1 + integer, parameter :: iSSSD006 = iSSSD005 + 1 + integer, parameter :: iSSSD007 = iSSSD006 + 1 + integer, parameter :: iSSSD008 = iSSSD007 + 1 + + integer, parameter :: iSSDP001 = iSSSD008 + 1 + integer, parameter :: iSSDP002 = iSSDP001 + 1 + integer, parameter :: iSSDP003 = iSSDP002 + 1 + integer, parameter :: iSSDP004 = iSSDP003 + 1 + integer, parameter :: iSSDP005 = iSSDP004 + 1 + integer, parameter :: iSSDP006 = iSSDP005 + 1 + integer, parameter :: iSSDP007 = iSSDP006 + 1 + integer, parameter :: iSSDP008 = iSSDP007 + 1 + + integer, parameter :: iSSWT001 = iSSDP008 + 1 + integer, parameter :: iSSWT002 = iSSWT001 + 1 + integer, parameter :: iSSWT003 = iSSWT002 + 1 + integer, parameter :: iSSWT004 = iSSWT003 + 1 + integer, parameter :: iSSWT005 = iSSWT004 + 1 + integer, parameter :: iSSWT006 = iSSWT005 + 1 + integer, parameter :: iSSWT007 = iSSWT006 + 1 + integer, parameter :: iSSWT008 = iSSWT007 + 1 + + integer, parameter :: iSSSV001 = iSSWT008 + 1 + integer, parameter :: iSSSV002 = iSSSV001 + 1 + integer, parameter :: iSSSV003 = iSSSV002 + 1 + integer, parameter :: iSSSV004 = iSSSV003 + 1 + integer, parameter :: iSSSV005 = iSSSV004 + 1 + integer, parameter :: iSSSV006 = iSSSV005 + 1 + integer, parameter :: iSSSV007 = iSSSV006 + 1 + integer, parameter :: iSSSV008 = iSSSV007 + 1 + + integer, parameter :: iSSSMASS = iSSSV008 + 1 + integer, parameter :: iSSCMASS = iSSSMASS + 1 + integer, parameter :: iSSEXTTAU = iSSCMASS + 1 + integer, parameter :: iSSSCATAU = iSSEXTTAU + 1 + +! Seasalt submicron diagnostics (column integral) + integer, parameter :: iSSSM25 = iSSSCATAU + 1 + integer, parameter :: iSSCM25 = iSSSM25 + 1 + integer, parameter :: iSSEXTT25 = iSSCM25 + 1 + integer, parameter :: iSSSCAT25 = iSSEXTT25 + 1 + + integer, parameter :: iBCEM001 = iSSSCAT25 + 1 + integer, parameter :: iBCEM002 = iBCEM001 + 1 + integer, parameter :: iBCEM003 = iBCEM002 + 1 + integer, parameter :: iBCEM004 = iBCEM003 + 1 + integer, parameter :: iBCEM005 = iBCEM004 + 1 + integer, parameter :: iBCEM006 = iBCEM005 + 1 + integer, parameter :: iBCEM007 = iBCEM006 + 1 + integer, parameter :: iBCEM008 = iBCEM007 + 1 + + integer, parameter :: iBCDP001 = iBCEM008 + 1 + integer, parameter :: iBCDP002 = iBCDP001 + 1 + integer, parameter :: iBCDP003 = iBCDP002 + 1 + integer, parameter :: iBCDP004 = iBCDP003 + 1 + integer, parameter :: iBCDP005 = iBCDP004 + 1 + integer, parameter :: iBCDP006 = iBCDP005 + 1 + integer, parameter :: iBCDP007 = iBCDP006 + 1 + integer, parameter :: iBCDP008 = iBCDP007 + 1 + + integer, parameter :: iBCWT001 = iBCDP008 + 1 + integer, parameter :: iBCWT002 = iBCWT001 + 1 + integer, parameter :: iBCWT003 = iBCWT002 + 1 + integer, parameter :: iBCWT004 = iBCWT003 + 1 + integer, parameter :: iBCWT005 = iBCWT004 + 1 + integer, parameter :: iBCWT006 = iBCWT005 + 1 + integer, parameter :: iBCWT007 = iBCWT006 + 1 + integer, parameter :: iBCWT008 = iBCWT007 + 1 + + integer, parameter :: iBCSV001 = iBCWT008 + 1 + integer, parameter :: iBCSV002 = iBCSV001 + 1 + integer, parameter :: iBCSV003 = iBCSV002 + 1 + integer, parameter :: iBCSV004 = iBCSV003 + 1 + integer, parameter :: iBCSV005 = iBCSV004 + 1 + integer, parameter :: iBCSV006 = iBCSV005 + 1 + integer, parameter :: iBCSV007 = iBCSV006 + 1 + integer, parameter :: iBCSV008 = iBCSV007 + 1 + + integer, parameter :: iBCSMASS = iBCSV008 + 1 + integer, parameter :: iBCCMASS = iBCSMASS + 1 + integer, parameter :: iBCEXTTAU = iBCCMASS + 1 + integer, parameter :: iBCSCATAU = iBCEXTTAU + 1 + integer, parameter :: iBCEMBF = iBCSCATAU+1 + integer, parameter :: iBCEMBB = iBCEMBF+1 + integer, parameter :: iBCEMAN = iBCEMBB+1 + integer, parameter :: iBCHYPHIL = iBCEMAN+1 + + integer, parameter :: iOCEM001 = iBCHYPHIL + 1 + integer, parameter :: iOCEM002 = iOCEM001 + 1 + integer, parameter :: iOCEM003 = iOCEM002 + 1 + integer, parameter :: iOCEM004 = iOCEM003 + 1 + integer, parameter :: iOCEM005 = iOCEM004 + 1 + integer, parameter :: iOCEM006 = iOCEM005 + 1 + integer, parameter :: iOCEM007 = iOCEM006 + 1 + integer, parameter :: iOCEM008 = iOCEM007 + 1 + + integer, parameter :: iOCDP001 = iOCEM008 + 1 + integer, parameter :: iOCDP002 = iOCDP001 + 1 + integer, parameter :: iOCDP003 = iOCDP002 + 1 + integer, parameter :: iOCDP004 = iOCDP003 + 1 + integer, parameter :: iOCDP005 = iOCDP004 + 1 + integer, parameter :: iOCDP006 = iOCDP005 + 1 + integer, parameter :: iOCDP007 = iOCDP006 + 1 + integer, parameter :: iOCDP008 = iOCDP007 + 1 + + integer, parameter :: iOCWT001 = iOCDP008 + 1 + integer, parameter :: iOCWT002 = iOCWT001 + 1 + integer, parameter :: iOCWT003 = iOCWT002 + 1 + integer, parameter :: iOCWT004 = iOCWT003 + 1 + integer, parameter :: iOCWT005 = iOCWT004 + 1 + integer, parameter :: iOCWT006 = iOCWT005 + 1 + integer, parameter :: iOCWT007 = iOCWT006 + 1 + integer, parameter :: iOCWT008 = iOCWT007 + 1 + + integer, parameter :: iOCSV001 = iOCWT008 + 1 + integer, parameter :: iOCSV002 = iOCSV001 + 1 + integer, parameter :: iOCSV003 = iOCSV002 + 1 + integer, parameter :: iOCSV004 = iOCSV003 + 1 + integer, parameter :: iOCSV005 = iOCSV004 + 1 + integer, parameter :: iOCSV006 = iOCSV005 + 1 + integer, parameter :: iOCSV007 = iOCSV006 + 1 + integer, parameter :: iOCSV008 = iOCSV007 + 1 + + integer, parameter :: iOCSMASS = iOCSV008 + 1 + integer, parameter :: iOCCMASS = iOCSMASS + 1 + integer, parameter :: iOCEXTTAU = iOCCMASS + 1 + integer, parameter :: iOCSCATAU = iOCEXTTAU + 1 + integer, parameter :: iOCEMBF = iOCSCATAU + 1 + integer, parameter :: iOCEMBB = iOCEMBF + 1 + integer, parameter :: iOCEMAN = iOCEMBB + 1 + integer, parameter :: iOCEMBG = iOCEMAN + 1 + integer, parameter :: iOCHYPHIL = iOCEMBG + 1 + + integer, parameter :: iSUEM001 = iOCHYPHIL + 1 + integer, parameter :: iSUEM002 = iSUEM001 + 1 + integer, parameter :: iSUEM003 = iSUEM002 + 1 + integer, parameter :: iSUEM004 = iSUEM003 + 1 + integer, parameter :: iSUEM005 = iSUEM004 + 1 + integer, parameter :: iSUEM006 = iSUEM005 + 1 + integer, parameter :: iSUEM007 = iSUEM006 + 1 + integer, parameter :: iSUEM008 = iSUEM007 + 1 + + integer, parameter :: iSUDP001 = iSUEM008 + 1 + integer, parameter :: iSUDP002 = iSUDP001 + 1 + integer, parameter :: iSUDP003 = iSUDP002 + 1 + integer, parameter :: iSUDP004 = iSUDP003 + 1 + integer, parameter :: iSUDP005 = iSUDP004 + 1 + integer, parameter :: iSUDP006 = iSUDP005 + 1 + integer, parameter :: iSUDP007 = iSUDP006 + 1 + integer, parameter :: iSUDP008 = iSUDP007 + 1 + + integer, parameter :: iSUWT001 = iSUDP008 + 1 + integer, parameter :: iSUWT002 = iSUWT001 + 1 + integer, parameter :: iSUWT003 = iSUWT002 + 1 + integer, parameter :: iSUWT004 = iSUWT003 + 1 + integer, parameter :: iSUWT005 = iSUWT004 + 1 + integer, parameter :: iSUWT006 = iSUWT005 + 1 + integer, parameter :: iSUWT007 = iSUWT006 + 1 + integer, parameter :: iSUWT008 = iSUWT007 + 1 + + integer, parameter :: iSUSV001 = iSUWT008 + 1 + integer, parameter :: iSUSV002 = iSUSV001 + 1 + integer, parameter :: iSUSV003 = iSUSV002 + 1 + integer, parameter :: iSUSV004 = iSUSV003 + 1 + integer, parameter :: iSUSV005 = iSUSV004 + 1 + integer, parameter :: iSUSV006 = iSUSV005 + 1 + integer, parameter :: iSUSV007 = iSUSV006 + 1 + integer, parameter :: iSUSV008 = iSUSV007 + 1 + + integer, parameter :: iSUSO2SMASS = iSUSV008 + 1 + integer, parameter :: iSUSO2CMASS = iSUSO2SMASS + 1 + integer, parameter :: iSUSO4SMASS = iSUSO2CMASS + 1 + integer, parameter :: iSUSO4CMASS = iSUSO4SMASS + 1 + integer, parameter :: iSUDMSSMASS = iSUSO4CMASS + 1 + integer, parameter :: iSUDMSCMASS = iSUDMSSMASS + 1 + integer, parameter :: iSUPSO2 = iSUDMSCMASS + 1 + integer, parameter :: iSUPSO4g = iSUPSO2 + 1 + integer, parameter :: iSUPSO4aq = iSUPSO4g + 1 + integer, parameter :: iSUPMSA = iSUPSO4aq + 1 + integer, parameter :: iSUPSO4wet = iSUPMSA + 1 + integer, parameter :: iSUEXTTAU = iSUPSO4wet + 1 + integer, parameter :: iSUSCATAU = iSUEXTTAU + 1 + integer, parameter :: iSUEMSO4AN = iSUSCATAU+1 + integer, parameter :: iSUEMSO2AN = iSUEMSO4AN+1 + integer, parameter :: iSUEMSO2BB = iSUEMSO2AN+1 + integer, parameter :: iSUEMSO2VN = iSUEMSO2BB+1 + integer, parameter :: iSUEMSO2VE = iSUEMSO2VN+1 + + INTEGER, PARAMETER :: iN2OFLX = iSUEMSO2VE + 1 + INTEGER, PARAMETER :: iCH4FLX = iN2OFLX + 1 + INTEGER, PARAMETER :: iF11FLX = iCH4FLX + 1 + INTEGER, PARAMETER :: iF12FLX = iF11FLX + 1 + INTEGER, PARAMETER :: iF113FLX = iF12FLX + 1 + INTEGER, PARAMETER :: iHCFCFLX = iF113FLX + 1 + INTEGER, PARAMETER :: iCCL4FLX = iHCFCFLX + 1 + INTEGER, PARAMETER :: iCH3CCL3FLX = iCCL4FLX + 1 + INTEGER, PARAMETER :: iCH3CLFLX = iCH3CCL3FLX + 1 + INTEGER, PARAMETER :: iCH3BRFLX = iCH3CLFLX + 1 + INTEGER, PARAMETER :: iH1301FLX = iCH3BRFLX + 1 + INTEGER, PARAMETER :: iH12_24FLX = iH1301FLX + 1 + + integer, parameter :: iCOSSZA = iH12_24FLX + 1 + integer, parameter :: iTCOSZ = iCOSSZA + 1 + integer, parameter :: iXOH = iTCOSZ + 1 + integer, parameter :: iXNO3 = iXOH + 1 + integer, parameter :: iXH2O2 = iXNO3 + 1 + + integer, parameter :: iCOEM001 = iXH2O2 + 1 + integer, parameter :: iCOEM002 = iCOEM001 + 1 + integer, parameter :: iCOEM003 = iCOEM002 + 1 + integer, parameter :: iCOEM004 = iCOEM003 + 1 + integer, parameter :: iCOEM005 = iCOEM004 + 1 + integer, parameter :: iCOEM006 = iCOEM005 + 1 + integer, parameter :: iCOEM007 = iCOEM006 + 1 + integer, parameter :: iCOEM008 = iCOEM007 + 1 + + integer, parameter :: iCOLS001 = iCOEM008 + 1 + integer, parameter :: iCOLS002 = iCOLS001 + 1 + integer, parameter :: iCOLS003 = iCOLS002 + 1 + integer, parameter :: iCOLS004 = iCOLS003 + 1 + integer, parameter :: iCOLS005 = iCOLS004 + 1 + integer, parameter :: iCOLS006 = iCOLS005 + 1 + integer, parameter :: iCOLS007 = iCOLS006 + 1 + integer, parameter :: iCOLS008 = iCOLS007 + 1 + + integer, parameter :: iCOPD001 = iCOLS008 + 1 + integer, parameter :: iCOPD002 = iCOPD001 + 1 + integer, parameter :: iCOPD003 = iCOPD002 + 1 + integer, parameter :: iCOPD004 = iCOPD003 + 1 + integer, parameter :: iCOPD005 = iCOPD004 + 1 + integer, parameter :: iCOPD006 = iCOPD005 + 1 + integer, parameter :: iCOPD007 = iCOPD006 + 1 + integer, parameter :: iCOPD008 = iCOPD007 + 1 + + integer, parameter :: iCOCL001 = iCOPD008 + 1 + integer, parameter :: iCOCL002 = iCOCL001 + 1 + integer, parameter :: iCOCL003 = iCOCL002 + 1 + integer, parameter :: iCOCL004 = iCOCL003 + 1 + integer, parameter :: iCOCL005 = iCOCL004 + 1 + integer, parameter :: iCOCL006 = iCOCL005 + 1 + integer, parameter :: iCOCL007 = iCOCL006 + 1 + integer, parameter :: iCOCL008 = iCOCL007 + 1 + + integer, parameter :: iCOSC001 = iCOCL008 + 1 + integer, parameter :: iCOSC002 = iCOSC001 + 1 + integer, parameter :: iCOSC003 = iCOSC002 + 1 + integer, parameter :: iCOSC004 = iCOSC003 + 1 + integer, parameter :: iCOSC005 = iCOSC004 + 1 + integer, parameter :: iCOSC006 = iCOSC005 + 1 + integer, parameter :: iCOSC007 = iCOSC006 + 1 + integer, parameter :: iCOSC008 = iCOSC007 + 1 + + integer, parameter :: iCO2EM001 = iCOSC008 + 1 + integer, parameter :: iCO2EM002 = iCO2EM001 + 1 + integer, parameter :: iCO2EM003 = iCO2EM002 + 1 + integer, parameter :: iCO2EM004 = iCO2EM003 + 1 + integer, parameter :: iCO2EM005 = iCO2EM004 + 1 + integer, parameter :: iCO2EM006 = iCO2EM005 + 1 + integer, parameter :: iCO2EM007 = iCO2EM006 + 1 + integer, parameter :: iCO2EM008 = iCO2EM007 + 1 + + integer, parameter :: iCO2CL001 = iCO2EM008 + 1 + integer, parameter :: iCO2CL002 = iCO2CL001 + 1 + integer, parameter :: iCO2CL003 = iCO2CL002 + 1 + integer, parameter :: iCO2CL004 = iCO2CL003 + 1 + integer, parameter :: iCO2CL005 = iCO2CL004 + 1 + integer, parameter :: iCO2CL006 = iCO2CL005 + 1 + integer, parameter :: iCO2CL007 = iCO2CL006 + 1 + integer, parameter :: iCO2CL008 = iCO2CL007 + 1 + + integer, parameter :: iCO2SC001 = iCO2CL008 + 1 + integer, parameter :: iCO2SC002 = iCO2SC001 + 1 + integer, parameter :: iCO2SC003 = iCO2SC002 + 1 + integer, parameter :: iCO2SC004 = iCO2SC003 + 1 + integer, parameter :: iCO2SC005 = iCO2SC004 + 1 + integer, parameter :: iCO2SC006 = iCO2SC005 + 1 + integer, parameter :: iCO2SC007 = iCO2SC006 + 1 + integer, parameter :: iCO2SC008 = iCO2SC007 + 1 + + parameter (pd2d = iCO2SC008 ) + +#else + parameter (pd2d = iZPD ) +#endif + +! +! ... 3-D diagnosis fields +! + parameter (iAIRDENS = pd2d + 1) + parameter (iCAPE = iAIRDENS + 1) + parameter (iCGS = iCAPE + 1) + parameter (iCLDLWP = iCGS + 1) + parameter (iCLOUD = iCLDLWP + 1) + parameter (iCLOUDUP = iCLOUD + 1) + parameter (iCMFDQ = iCLOUDUP + 1) + parameter (iCMFDQR2 = iCMFDQ + 1) + parameter (iCMFDT = iCMFDQR2 + 1) + parameter (iCMFDTR = iCMFDT + 1) + parameter (iCMFETR = iCMFDTR + 1) + parameter (iCMFMC = iCMFETR + 1) + parameter (iCMFMC2 = iCMFMC + 1) + parameter (iCONVCLD = iCMFMC2 + 1) + parameter (iDCAFDT = iCONVCLD + 1) + parameter (iDIABDT = iDCAFDT + 1) + parameter (iDQCOND = iDIABDT + 1) + parameter (iDQPBLCG = iDQCOND + 1) + parameter (iDQRL = iDQPBLCG + 1) + parameter (iDTCOND = iDQRL + 1) + parameter (iDTPBLCG = iDTCOND + 1) + parameter (iDTRAIN = iDTPBLCG + 1) + parameter (iDTV = iDTRAIN + 1) + parameter (iDUV = iDTV + 1) + parameter (iDVV = iDUV + 1) + parameter (iEFFCLD = iDVV + 1) + parameter (iEVAPL = iEFFCLD + 1) + parameter (iH = iEVAPL + 1) + parameter (iHGHTE = iH + 1) + parameter (iHKBETA = iHGHTE + 1) + parameter (iHKETA = iHKBETA + 1) + parameter (iKVH = iHKETA + 1) + parameter (iKVM = iKVH + 1) + parameter (iO3VMR = iKVM + 1) + parameter (iOMEGA = iO3VMR + 1) + parameter (iPV = iOMEGA + 1) + parameter (iQ = iPV + 1) + parameter (iQC = iQ + 1) + parameter (iQRL = iQC + 1) + parameter (iQRS = iQRL + 1) + parameter (iRAYFDT = iQRS + 1) + parameter (iRELHUM = iRAYFDT + 1) + parameter (iRHCLR = iRELHUM + 1) + parameter (iRNEVPDQ = iRHCLR + 1) + parameter (iRNEVPDT = iRNEVPDQ + 1) + parameter (iSETLWP = iRNEVPDT + 1) + parameter (iSTRATCLD = iSETLWP + 1) + parameter (iT = iSTRATCLD+ 1) + parameter (iTAUCLI = iT + 1) + parameter (iTAUCLW = iTAUCLI + 1) + parameter (iTKE = iTAUCLW + 1) + parameter (iTTMGW = iTKE + 1) + parameter (iU = iTTMGW + 1) + parameter (iUQ = iU + 1) + parameter (iUT = iUQ + 1) + parameter (iUTGW = iUT + 1) + parameter (iUU = iUTGW + 1) + parameter (iUV = iUU + 1) + parameter (iV = iUV + 1) + parameter (iVD01 = iV + 1) + parameter (iVQ = iVD01 + 1) + parameter (iVT = iVQ + 1) + parameter (iVTGW = iVT + 1) + parameter (iVV = iVTGW + 1) + parameter (iZMCME = iVV + 1) + parameter (iZMDLF = iZMCME + 1) + parameter (iZMDQ = iZMDLF + 1) + parameter (iZMDQR = iZMDQ + 1) + parameter (iZMDT = iZMDQR + 1) + parameter (iZMDU = iZMDT + 1) + parameter (iZMED = iZMDU + 1) + parameter (iZMEPS = iZMED + 1) + parameter (iZMEU = iZMEPS + 1) + parameter (iZMEVP = iZMEU + 1) + parameter (iZMMD = iZMEVP + 1) + parameter (iZMMU = iZMMD + 1) + parameter (iZMPFLX = iZMMU + 1) + parameter (iZMQL = iZMPFLX + 1) + +#ifdef FVCHEM + INTEGER, PARAMETER :: iBR = iZMQL + 1 + INTEGER, PARAMETER :: iBRCL = iBR + 1 + INTEGER, PARAMETER :: iBRO = iBRCL + 1 + INTEGER, PARAMETER :: iBRONO2 = iBRO + 1 + INTEGER, PARAMETER :: iBRX = iBRONO2 + 1 + INTEGER, PARAMETER :: iCCL4 = iBRX + 1 + INTEGER, PARAMETER :: iCH2O = iCCL4 + 1 + INTEGER, PARAMETER :: iCH3BR = iCH2O + 1 + INTEGER, PARAMETER :: iCH3CCL3 = iCH3BR + 1 + INTEGER, PARAMETER :: iCH3CL = iCH3CCL3 + 1 + INTEGER, PARAMETER :: iCH3O2 = iCH3CL + 1 + INTEGER, PARAMETER :: iCH3OOH = iCH3O2 + 1 + INTEGER, PARAMETER :: iCH4 = iCH3OOH + 1 + INTEGER, PARAMETER :: iCL = iCH4 + 1 + INTEGER, PARAMETER :: iCL2 = iCL + 1 + INTEGER, PARAMETER :: iCL2O2 = iCL2 + 1 + INTEGER, PARAMETER :: iCLO = iCL2O2 + 1 + INTEGER, PARAMETER :: iCLONO2 = iCLO + 1 + INTEGER, PARAMETER :: iCLX = iCLONO2 + 1 + +! -------------------------------------------------------------------- +! 8 CO regions and types for INTEX-B 2006 +! -------------------------------------------------------------------- + + INTEGER, PARAMETER :: iCO = iCLX + 1 + INTEGER, PARAMETER :: iCONOAMAN= iCO + 1 + INTEGER, PARAMETER :: iCOCEAMAN= iCONOAMAN + 1 + INTEGER, PARAMETER :: iCOWHBB = iCOCEAMAN + 1 + INTEGER, PARAMETER :: iCOASIAAN= iCOWHBB + 1 + INTEGER, PARAMETER :: iCOASNBB = iCOASIAAN + 1 + INTEGER, PARAMETER :: iCOASSBB = iCOASNBB + 1 + INTEGER, PARAMETER :: iCOFDAN = iCOASSBB + 1 + +! -------------------------------------------------------------------- + + INTEGER, PARAMETER :: iCOFF = iCOFDAN + 1 + INTEGER, PARAMETER :: iCOBF = iCOFF + 1 + INTEGER, PARAMETER :: iCOBB = iCOBF + 1 + INTEGER, PARAMETER :: iCOBI = iCOBB + 1 + INTEGER, PARAMETER :: iCONAMERI= iCOBI + 1 + INTEGER, PARAMETER :: iCOSAMERI= iCONAMERI + 1 + INTEGER, PARAMETER :: iCOAFRICA= iCOSAMERI + 1 + INTEGER, PARAMETER :: iCO2 = iCOAFRICA + 1 + INTEGER, PARAMETER :: iCO2NAMER= iCO2 + 1 + INTEGER, PARAMETER :: iCO2SAMER= iCO2NAMER + 1 + INTEGER, PARAMETER :: iCO2AFRIC= iCO2SAMER + 1 + INTEGER, PARAMETER :: iF11 = iCO2AFRIC + 1 + INTEGER, PARAMETER :: iF113 = iF11 + 1 + INTEGER, PARAMETER :: iF12 = iF113 + 1 + INTEGER, PARAMETER :: iH12_24 = iF12 + 1 + INTEGER, PARAMETER :: iH1301 = iH12_24 + 1 + INTEGER, PARAMETER :: iH2O2 = iH1301 + 1 + INTEGER, PARAMETER :: iH2OCOND = iH2O2 + 1 + INTEGER, PARAMETER :: iHATOMIC = iH2OCOND + 1 + INTEGER, PARAMETER :: iHBR = iHATOMIC + 1 + INTEGER, PARAMETER :: iHCFC = iHBR + 1 + INTEGER, PARAMETER :: iHCL = iHCFC + 1 + INTEGER, PARAMETER :: iHNO3 = iHCL + 1 + INTEGER, PARAMETER :: iHNO3COND= iHNO3 + 1 + INTEGER, PARAMETER :: iHO2 = iHNO3COND + 1 + INTEGER, PARAMETER :: iHO2NO2 = iHO2 + 1 + INTEGER, PARAMETER :: iHOBR = iHO2NO2 + 1 + INTEGER, PARAMETER :: iHOCL = iHOBR + 1 + INTEGER, PARAMETER :: iN = iHOCL + 1 + INTEGER, PARAMETER :: iN2O = iN + 1 + INTEGER, PARAMETER :: iN2O5 = iN2O + 1 + INTEGER, PARAMETER :: iNO = iN2O5 + 1 + INTEGER, PARAMETER :: iNO2 = iNO + 1 + INTEGER, PARAMETER :: iNO3 = iNO2 + 1 + INTEGER, PARAMETER :: iNOX = iNO3 + 1 + INTEGER, PARAMETER :: iO1D = iNOX + 1 + INTEGER, PARAMETER :: iO3CHEM = iO1D + 1 + INTEGER, PARAMETER :: iO3P = iO3CHEM + 1 + INTEGER, PARAMETER :: iO3PARAM = iO3P + 1 + INTEGER, PARAMETER :: iOCLO = iO3PARAM + 1 + INTEGER, PARAMETER :: iOH = iOCLO + 1 + INTEGER, PARAMETER :: iOX = iOH + 1 + INTEGER, PARAMETER :: iOXSTRAT = iOX + 1 + INTEGER, PARAMETER :: iOXTROP = iOXSTRAT + 1 + + integer, parameter :: iDUMASS = iOXTROP + 1 + integer, parameter :: iDUMASS1 = iDUMASS + 1 + integer, parameter :: iDUMASS25 = iDUMASS1 + 1 + integer, parameter :: iSSMASS = iDUMASS25 + 1 + integer, parameter :: iSSMASS25 = iSSMASS + 1 + integer, parameter :: iBCMASS = iSSMASS25 + 1 + + integer, parameter :: iOCMASS = iBCMASS + 1 + integer, parameter :: iSO4MASS = iOCMASS + 1 + integer, parameter :: iPSO2 = iSO4MASS + 1 + integer, parameter :: iPSO4g = iPSO2 + 1 + integer, parameter :: iPSO4aq = iPSO4g + 1 + integer, parameter :: iPMSA = iPSO4aq + 1 + integer, parameter :: iPSO4wet = iPMSA + 1 + integer, parameter :: iQ4AGE = iPSO4wet + 1 + parameter (pdiag = iQ4AGE) +#else + parameter (pdiag = iZMQL) +#endif + + parameter (pd3d = pdiag - pd2d) + + integer maxlist + parameter (maxlist = 30) ! maximum number of output files + +! real*4 :: undef = 1.e25 + real :: undef = 1.e25 + +! There is one such diagnostic descriptor (diag_type) for each diagnostic +! which can be output using outfld. Each diagnostic can be output to multiple +! output streams (up to nlist of them, the index of % count and % alt and the +! second index of % fldloc) and for each output stream different types of +! the diagnostic may be output, currently averaged, instantaneous, maximum +! and minimum (the first index of % fldloc). + + type diag_type + character*8 :: name ! name for diagnostic + character*16 :: unit ! unit for diagnostic fields + character*80 :: desc ! description for diagnostic fields + integer :: pick ! is the diag needed for output 1:yes 0:no + logical :: counted ! if true, diagnostic is counted + integer :: vdim ! number of levels 1 or km + integer :: nlist ! number of output streams + integer, pointer :: fldloc(:,:) ! location in diagnostic buffer (negative if not on) + integer, pointer :: count(:) ! counter + logical, pointer :: alt(:) ! if true use alternate name/unit for output + character*8 :: aname ! Alternate name for diagnostic + character*16 :: aunit ! Alternate unit for diagnostic fields + character*80 :: adesc ! description for diagnostic fields + real*4 :: convfac ! conversion factor if alternate unit different than primary + endtype + +! Each output stream (history file) has a hist_type descriptor. Each stream has one +! frequency and any number of subset regions of the model grid (nreg of them, the array +! index in most of the fields). A positive frequency gives the period of periodic output. +! A zero frequency is used for segment end output. As of 7-16-03 we allow a negative +! frequency (-1) to indicate a set of non-output diagnostics. Such diagnostics (usually +! instantaneous) are maintained in the same way as a normal diagnostics but they are +! never output to file. They can be accessed through getdiag (). + + type hist_type + character*80, pointer :: name(:) ! Output Filenames for each region + integer :: frequency ! frequency for output stream HHMMSS + character*1 :: timestamp ! Time stamp for output stream Centered, Forward, Backward + character*3,pointer :: type(:) ! file type for output hdf or bin, hdf is default + integer, pointer :: imin(:) ! longitude minimum bounds for each region + integer, pointer :: imax(:) ! longitude maximum bounds for each region + integer, pointer :: jmin(:) ! latitude minimum bounds for each region + integer, pointer :: jmax(:) ! latitude maximum bounds for each region + integer, pointer :: ktop(:) ! vertical top bounds for each region + integer, pointer :: kbot(:) ! vertical bottom bounds for each region + integer, pointer :: nrec(:) ! diag record number (for binary not hdf output) + integer, pointer :: lun(:) ! logical unit numbers (binary, grads ctl reuses lun) + integer :: nreg ! Number of regions for the output stream + endtype + + logical doingDiag + + END MODULE mod_diag + diff --git a/ESMF/Shared/Chem_Shared/ut_diurnal.F90 b/ESMF/Shared/Chem_Shared/ut_diurnal.F90 new file mode 100644 index 00000000..8f20d804 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/ut_diurnal.F90 @@ -0,0 +1,46 @@ + program ut_diurnal_bb + + use Chem_UtilMod + implicit NONE + +! integer, parameter :: im = 720, jm=361 +! integer, parameter :: im = 288, jm=181 + integer, parameter :: im = 144, jm=91 + integer :: nhms, i, j, hh, mm, n + real :: dlon, dlat, cdt + real :: bb(im,jm), bb_(im,jm), lons(im), lats(jm) + + bb_ = 1. + dlon = 360. / im + dlat = 180. / (jm-1) + + print *, 'dlon = ', dlon + print *, 'dlat = ', dlat + + do i = 1, im + lons(i) = -180. + (i-1) * dlon + end do + do j = 1, jm + lats(j) = -90. + (j-1) * dlat + end do + + open(20,file='gfed2.bin',form='unformatted',status='old') + read(20) bb_ + close(20) + + n = 0 + cdt = 30 * 60. ! 15 min in secs + + open(10,file='diurnal2.bin',form='unformatted') + do hh = 0, 23 + do mm = 0, 30, 30 + n = n + 1 + nhms = hh * 10000 + mm*100 + print *, 'nhms = ', nhms, ' --- bb = ', minval(bb), maxval(bb), n + call Chem_BiomassDiurnal ( bb, bb_, lons, lats, nhms, cdt) + write(10) bb + end do + end do + close(10) + + end program ut_diurnal_bb diff --git a/ESMF/Shared/Chem_Shared/ut_mpread.F90 b/ESMF/Shared/Chem_Shared/ut_mpread.F90 new file mode 100644 index 00000000..f85c1398 --- /dev/null +++ b/ESMF/Shared/Chem_Shared/ut_mpread.F90 @@ -0,0 +1,63 @@ +! +! Unit test for Chem_UtilMPread() +! + +PROGRAM ut_mpread + +#if defined (SPMD) + use mod_comm, only : gid, mp_init, mp_exit, y_decomp +#endif + use Chem_UtilMod, only: CHem_UtilMPread + + implicit NONE + + integer, parameter :: im = 288, jm = 181, km = 55, nq = 1 + integer :: i1, i2, ig=0, j1, j2, jg=0 + integer :: jnp=jm, nl=km, jfirst=1, jlast=jm, kfirst=1, klast=km + integer nymd, nhms + character(len=255) :: filen + +#if !defined (SPMD) + integer :: gid = 0 +#endif + + real, allocatable :: src(:,:) + + +#if defined(SPMD) + call mp_init() + call y_decomp( jnp, nl, jfirst, jlast, kfirst, klast, gid) + if ( gid .eq. 0 ) then + print *, 'mod_comm initialized' + print *, 'gid, jnp, nl, jfirst, jlast, kfirst, klast = ' + end if +#endif + + print *, 'gid: ', gid, jnp, nl, jfirst, jlast, kfirst, klast + + allocate ( src(im,jfirst:jlast) ) + +!!! filen = '/share/fvchem/ginoux.DU_src.sfc_288x181.clm.hdf' + filen = 'ginoux.DU_src.sfc_288x181.clm.hdf' + nymd = 20021219 + nhms = 0 + i1 = 1 + i2 = im + ig = 0 + j1 = jfirst + j2 = jlast + jg = 0 + + call Chem_UtilMPread ( filen, 'du_src', nymd, nhms, & + i1, i2, ig, im, j1, j2, jg, jm, km, & + var2d = src ) + + print *, 'gid ', gid, ':', minval(src), maxval(src) + + deallocate ( src ) + +#if defined(SPMD) + call mp_exit( ) +#endif + +end Program ut_mpread diff --git a/Process_Library/CMakeLists.txt b/Process_Library/CMakeLists.txt new file mode 100644 index 00000000..ebd3ec5b --- /dev/null +++ b/Process_Library/CMakeLists.txt @@ -0,0 +1,16 @@ +esma_set_this () + +set (srcs + Chem_MieTableMod2G.F90 + GOCART2G_Process.F90 + ) + +esma_add_library(${this} + SRCS ${srcs} + # DEPENDENCIES GMAO_mpeu + ) + +target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) + +#include_directories (${esma_include}/${this}) + diff --git a/Process_Library/Chem_MieTableMod2G.F90 b/Process_Library/Chem_MieTableMod2G.F90 new file mode 100644 index 00000000..82a9a63b --- /dev/null +++ b/Process_Library/Chem_MieTableMod2G.F90 @@ -0,0 +1,861 @@ +!BOP +! +! !MODULE: Chem_MieTableMod --- Reader for aerosol mie tables +! +! !INTERFACE: +! + + module Chem_MieTableMod2G + +! !USES: + implicit none + include "netcdf.inc" ! Required for Mie tables stored as NCDF files + +! !PUBLIC TYPES: +! + private + public Chem_MieTable ! Holds Mie Lookup Tables + public Chem_Mie ! Holds Chem_MieTable and other information + +! +! !PUBLIC MEMBER FUNCTIONS: +! + public Chem_MieTableCreate ! Constructor + public Chem_MieTableRead ! Read the mie table from the file + public Chem_MieQuery +! +! !DESCRIPTION: +! +! This module read the mie aerosol tables. +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco - Initial code. +! 31Mar2005 Todling - Declared netcdf nf_ routines as external (OSF1) +! Removed # from include netcdf.inc +!EOP +!------------------------------------------------------------------------- +! +! Mie LUT table +! Will be reduced from input files to the desired channels +! -------- + + type Chem_MieTable + character(len=255) :: mietablename + integer :: nlambda ! number of wavelengths in table + integer :: nrh ! number of RH values in table + integer :: nbin ! number of size bins in table + integer :: nMom ! number of moments of phase function + integer :: nPol ! number of elements of scattering phase matrix + real, pointer :: lambda(:) => null() ! wavelengths [m] + real, pointer :: rh(:) => null() ! RH values [fraction] + real, pointer :: reff(:,:) => null() ! effective radius [m] + real, pointer :: bext(:,:,:) => null() ! bext values [m2 kg-1] + real, pointer :: bsca(:,:,:) => null() ! bsca values [m2 kg-1] + real, pointer :: bbck(:,:,:) => null() ! bbck values [m2 kg-1] + real, pointer :: g(:,:,:) => null() ! asymmetry parameter + real, pointer :: pback(:,:,:,:) => null() ! Backscatter phase function + real, pointer :: pmom(:,:,:,:,:) => null( ) ! moments of phase function + real, pointer :: gf(:,:) => null() ! hygroscopic growth factor + real, pointer :: rhop(:,:) => null() ! wet particle density [kg m-3] + real, pointer :: rhod(:,:) => null() ! wet particle density [kg m-3] + real, pointer :: vol(:,:) => null() ! wet particle volume [m3 kg-1] + real, pointer :: area(:,:) => null() ! wet particle cross section [m2 kg-1] + real, pointer :: refr(:,:,:) => null() ! real part of refractive index + real, pointer :: refi(:,:,:) => null() ! imaginary part of refractive index + + integer :: rhi(991) ! pointer to rh map + real :: rha(991) ! slope on rh map + end type Chem_MieTable + + type Chem_Mie + integer :: nch ! number of channels + integer :: nMom=0 ! number of moments (phase function) + integer :: nPol=0 ! number of moments (phase function) + real, pointer :: channels(:) ! wavelengths + + character(len=255) :: rcfile + character(len=255) :: optics_file + ! mie tables -- dim(nch,nrh,nbin) + type(Chem_MieTable), pointer :: mie_aerosol => null() + + integer :: nq ! number of tracers + character(len=255), pointer :: vname(:) => null() ! possibly remove lines 67-71 vname,vindex,vtable + integer, pointer :: vindex(:) => null() + type(Chem_MieTable), pointer :: vtable(:) => null() + ! mapping of vtable for given idx + type(Chem_MieTable), pointer :: vtableUse => null() + end type Chem_Mie + +# ifndef HAS_NETCDF3 + external nf_open, nf_inq_dimid, nf_inq_dimlen, nf_inq_varid, & + nf_get_var_double, nf_close +#endif + + + interface Chem_MieQuery + module procedure Chem_MieQueryByInt + module procedure Chem_MieQueryByIntWithpmom !possibly remove + end interface + + +CONTAINS + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieTableCreate --- Construct Chemistry Registry +! +! !INTERFACE: +! + + Function Chem_MieTableCreate ( rcfile, rc ) + + implicit none + type(Chem_MieTable) Chem_MieTableCreate + +! !INPUT PARAMETERS: + + character(len=*) :: rcfile ! Mie table file name + +! !OUTPUT PARAMETERS: + + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: +! +! +! !REVISION HISTORY: +! +! 09Mar2005 da Silva API, prologues. +! +!EOP +!------------------------------------------------------------------------- + character(len=*), parameter :: myname = 'Chem_MieTableCreate' + + type(Chem_MieTable) :: this + +! _Iam_("Chem_MieTableCreate") + + rc = 0 + + this%mietablename = rcfile + +! Note: The actual allocation is done when reading because dimensions are +! read from file + +! All done +! -------- + Chem_MieTableCreate = this + + return + + end Function Chem_MieTableCreate + + +!------------------------------------------------------------------------- +! NASA/GSFC, Global Modeling and Assimilation Office, Code 900.3 ! +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieTableRead --- Read and fill in the Mie table, interpolated +! to the requested channels +! +! !INTERFACE: +! + SUBROUTINE Chem_MieTableRead ( this, nch, channels, rc, nmom ) + +! !INPUT PARAMETERS: + + IMPLICIT none + TYPE(Chem_MieTable), intent(inout) :: this + integer, intent(in) :: nch ! number of channels to interpolate table to + real, intent(in) :: channels(:) ! channels to interpolate table to + integer, OPTIONAL, intent(in) :: nmom ! number of moments to keep (default=0) + integer, intent(out) :: rc ! return code + + +! !DESCRIPTION: +! +! Fills in the Mie table +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco +! +!EOP +!------------------------------------------------------------------------- + + character(len=*), parameter :: myname = 'Chem_MieTableRead' + + integer :: ncid, idimid, ivarid, n, i, j, ip1 + integer :: nch_table, nrh_table, nbin_table, nmom_table, nPol_table +! Tables are hard-wired as single precision + real*8, pointer :: channels_table(:), rh_table(:), reff_table(:,:), & + bext_table(:,:,:), bsca_table(:,:,:), & + bbck_table(:,:,:), g_table(:,:,:), & + pmom_table(:,:,:,:,:), pback_table(:,:,:,:), & + gf_table(:,:), rhop_table(:,:), rhod_table(:,:), & + vol_table(:,:), area_table(:,:), & + refr_table(:,:,:), refi_table(:,:,:) + + real :: yerr + integer :: nmom_, imom, ipol + +#define NF_VERIFY_(expr) rc = expr; if (rc /= 0) return + + rc = 0 + +! Whether or not doing phase function +! ----------------------------------- + if ( present(nmom) ) then + nmom_ = nmom + else + nmom_ = 0 + end if + +! Set up nPol_table for reading backscatter phase function +! This will get overwritten if pmoments is requested +! -------------------------------------------------------- + nPol_table = 6 + +! Open the table and get the dimensions +! ------------------------------------- + rc = nf_open(this%mietablename, NF_NOWRITE, ncid) + IF ( rc /= 0 ) THEN + print *, 'nf_open '//this%mietablename//' RETURN CODE=', rc + END IF + +! RH +! -- + NF_VERIFY_(nf_inq_dimid(ncid,'rh',idimid)) + NF_VERIFY_(nf_inq_dimlen(ncid,idimid,nrh_table)) + +! Channels +! -------- + NF_VERIFY_(nf_inq_dimid(ncid,'lambda',idimid)) + NF_VERIFY_(nf_inq_dimlen(ncid,idimid,nch_table)) + +! Dry Effective radius +! -------------------- + NF_VERIFY_(nf_inq_dimid(ncid,'radius',idimid)) + NF_VERIFY_(nf_inq_dimlen(ncid,idimid,nbin_table)) + +! Moments of phase function +! ------------------------- + if ( nmom_ > 0 ) then + NF_VERIFY_(nf_inq_dimid(ncid,'nMom',idimid)) + NF_VERIFY_(nf_inq_dimlen(ncid,idimid,nmom_table)) + if ( nmom_ > nmom_table ) then +! rc = 99 + print*,'Error: nmom_ > nmom_table, see:'//myname + return + end if + NF_VERIFY_(nf_inq_dimid(ncid,'nPol',idimid)) + NF_VERIFY_(nf_inq_dimlen(ncid,idimid,nPol_table)) + endif + +! Get the table contents +! ------------------------------------- +! allocate ( channels_table(nch_table), rh_table(nrh_table), & +! bext_table(nch_table,nrh_table,nbin_table), & +! bsca_table(nch_table,nrh_table,nbin_table), & +! bbck_table(nch_table,nrh_table,nbin_table), & +! g_table(nch_table,nrh_table,nbin_table), stat = rc ) + + allocate(channels_table(nch_table),stat = rc ) + allocate(rh_table(nrh_table),stat = rc ) + allocate(reff_table(nrh_table,nbin_table),stat = rc ) + allocate(bext_table(nch_table,nrh_table,nbin_table),stat = rc ) + allocate(bsca_table(nch_table,nrh_table,nbin_table),stat = rc ) + allocate(bbck_table(nch_table,nrh_table,nbin_table), stat = rc ) + allocate(g_table(nch_table,nrh_table,nbin_table), stat = rc ) + allocate(pback_table(nch_table,nrh_table,nbin_table,nPol_table), stat = rc ) + allocate(gf_table(nrh_table,nbin_table),stat = rc ) + allocate(rhop_table(nrh_table,nbin_table),stat = rc ) + allocate(rhod_table(nrh_table,nbin_table),stat = rc ) + allocate(vol_table(nrh_table,nbin_table),stat = rc ) + allocate(area_table(nrh_table,nbin_table),stat = rc ) + allocate(refr_table(nch_table,nrh_table,nbin_table), stat = rc ) + allocate(refi_table(nch_table,nrh_table,nbin_table), stat = rc ) + + if ( nmom_ > 0 ) then + allocate(pmom_table(nch_table,nrh_table,nbin_table,nmom_table,nPol_table), stat = rc ) + end if + NF_VERIFY_(nf_inq_varid(ncid,'lambda',ivarid)) + NF_VERIFY_(nf_get_var_double(ncid,ivarid,channels_table)) + NF_VERIFY_(nf_inq_varid(ncid,'rEff',ivarid)) + NF_VERIFY_(nf_get_var_double(ncid,ivarid,reff_table)) + NF_VERIFY_(nf_inq_varid(ncid,'bext',ivarid)) + NF_VERIFY_(nf_get_var_double(ncid,ivarid,bext_table)) + NF_VERIFY_(nf_inq_varid(ncid,'bsca',ivarid)) + NF_VERIFY_(nf_get_var_double(ncid,ivarid,bsca_table)) + NF_VERIFY_(nf_inq_varid(ncid,'bbck',ivarid)) + NF_VERIFY_(nf_get_var_double(ncid,ivarid,bbck_table)) + NF_VERIFY_(nf_inq_varid(ncid,'g',ivarid)) + NF_VERIFY_(nf_get_var_double(ncid,ivarid,g_table)) + NF_VERIFY_(nf_inq_varid(ncid,'rh',ivarid)) + NF_VERIFY_(nf_get_var_double(ncid,ivarid,rh_table)) + +! Get the backscatter phase function values + rc = nf_inq_varid(ncid,'pback',ivarid) + if(rc .ne. NF_NOERR) then ! pback not in table, fill in dummy variable + pback_table = 1. + else + NF_VERIFY_(nf_get_var_double(ncid,ivarid,pback_table)) + endif + + if ( nmom_ > 0 ) then + NF_VERIFY_(nf_inq_varid(ncid,'pmom',ivarid)) + NF_VERIFY_(nf_get_var_double(ncid,ivarid,pmom_table)) + end if + +! Aerosol optical properties not necessarily stored in all versions of the tables +! ---------------------- +! Particle growth factor + rc = nf_inq_varid(ncid,'growth_factor',ivarid) + if(rc .ne. NF_NOERR) then ! not in table, fill in dummy variable + gf_table = -999. + else + NF_VERIFY_(nf_get_var_double(ncid,ivarid,gf_table)) + endif + +! Wet particle density + rc = nf_inq_varid(ncid,'rhop',ivarid) + if(rc .ne. NF_NOERR) then ! not in table, fill in dummy variable + rhop_table = -999. + else + NF_VERIFY_(nf_get_var_double(ncid,ivarid,rhop_table)) + endif + +! Dry particle density (will be pulled from wet particle radius) + rc = nf_inq_varid(ncid,'rhop',ivarid) + if(rc .ne. NF_NOERR) then ! not in table, fill in dummy variable + rhod_table = -999. + else + rc = nf_get_var_double(ncid,ivarid,rhod_table) + do i = 1, nrh_table + rhod_table(i,:) = rhod_table(1,:) + enddo + if (rc /=0) return + endif + +! Wet particle real part of refractive index + rc = nf_inq_varid(ncid,'refreal',ivarid) + if(rc .ne. NF_NOERR) then ! not in table, fill in dummy variable + refr_table = -999. + else + NF_VERIFY_(nf_get_var_double(ncid,ivarid,refr_table)) + endif + +! Wet particle imaginary part of refractive index (ensure positive) + rc = nf_inq_varid(ncid,'refimag',ivarid) + if(rc .ne. NF_NOERR) then ! not in table, fill in dummy variable + refi_table = -999. + else + NF_VERIFY_(nf_get_var_double(ncid,ivarid,refi_table)) + refi_table = abs(refi_table) + endif + +! Wet particle volume [m3 kg-1] +! Ratio of wet to dry volume is gf^3, hence the following + vol_table = gf_table**3 / rhod_table + +! Wet particle cross sectional area [m2 kg-1] +! Assume area is volume divided by (4./3.*reff) + area_table = vol_table / (4./3.*reff_table) + +! Close the table file +! ------------------------------------- + NF_VERIFY_(nf_close(ncid)) + + +! Setup the table to be returned +! ------------------------------------- + this%nlambda = nch + this%nrh = nrh_table + this%nbin = nbin_table + this%nMom = nmom_ +! if ( nmom_ > 0 ) this%nPol = nPol_table + this%nPol = nPol_table + +! allocate ( this%lambda(this%nLambda), this%rh(this%nrh), & +! this%bext(this%nLambda,this%nrh,this%nbin), & +! this%bsca(this%nLambda,this%nrh,this%nbin), & +! this%bbck(this%nLambda,this%nrh,this%nbin), & +! this%g(this%nLambda,this%nrh,this%nbin), & +! stat = rc ) + + allocate (this%lambda(this%nLambda),stat = rc ) + allocate (this%rh(this%nrh),stat = rc ) + allocate (this%reff(this%nrh,this%nbin),stat = rc ) + allocate (this%bext(this%nrh,this%nLambda,this%nbin),stat = rc ) + allocate (this%bsca(this%nrh,this%nLambda,this%nbin),stat = rc ) + allocate (this%bbck(this%nrh,this%nLambda,this%nbin),stat = rc ) + allocate (this%g(this%nrh,this%nLambda,this%nbin), stat = rc ) + allocate (this%pback(this%nrh,this%nLambda,this%nbin,this%nPol), stat = rc ) + if ( nmom_ > 0 ) then + allocate (this%pmom(this%nrh,this%nLambda,this%nbin,this%nMom,this%nPol), stat = rc ) + end if + allocate (this%gf(this%nrh,this%nbin), stat = rc ) + allocate (this%rhop(this%nrh,this%nbin), stat = rc ) + allocate (this%rhod(this%nrh,this%nbin), stat = rc ) + allocate (this%vol(this%nrh,this%nbin), stat = rc ) + allocate (this%area(this%nrh,this%nbin), stat = rc ) + allocate (this%refr(this%nrh,this%nLambda,this%nbin),stat = rc ) + allocate (this%refi(this%nrh,this%nLambda,this%nbin),stat = rc ) + +! Preserve the full RH structure of the input table + this%rh(:) = rh_table(:) + +! Insert the requested channels in the output table + this%lambda(:) = channels(:) + +! Insert rEff (moist effective radius) + this%reff(:,:) = reff_table(:,:) + +! Now we linearly interpolate the input table to the output table grid +! of requested channels + do j = 1, this%nbin + do i = 1, this%nrh + do n = 1, this%nlambda + call polint(channels_table,bext_table(:,i,j),nch_table, & + this%lambda(n),this%bext(i,n,j),yerr) + call polint(channels_table,bsca_table(:,i,j),nch_table, & + this%lambda(n),this%bsca(i,n,j),yerr) + call polint(channels_table,bbck_table(:,i,j),nch_table, & + this%lambda(n),this%bbck(i,n,j),yerr) + call polint(channels_table,g_table(:,i,j),nch_table, & + this%lambda(n),this%g(i,n,j),yerr) + call polint(channels_table,refr_table(:,i,j),nch_table, & + this%lambda(n),this%refr(i,n,j),yerr) + call polint(channels_table,refi_table(:,i,j),nch_table, & + this%lambda(n),this%refi(i,n,j),yerr) + do ipol = 1, this%nPol + call polint(channels_table,pback_table(:,i,j,ipol),nch_table, & + this%lambda(n),this%pback(i,n,j,ipol),yerr) + end do + if ( nmom_ > 0 ) then + do imom = 1, this%nMom + do ipol = 1, this%nPol + call polint(channels_table,pmom_table(:,i,j,imom,ipol),nch_table, & + this%lambda(n),this%pmom(i,n,j,imom,ipol),yerr) + end do + end do + end if + enddo + enddo + enddo + +! Insert growth factor + this%gf(:,:) = gf_table(:,:) + +! Wet particle density [kg m-3] + this%rhop(:,:) = rhop_table(:,:) + +! Dry particle density [kg m-3] + this%rhod(:,:) = rhod_table(:,:) + +! Volume [m3 kg-1] + this%vol(:,:) = vol_table(:,:) + +! Area [m2 kg-1] + this%area(:,:) = area_table(:,:) + +! Now we do a mapping of the RH from the input table to some high +! resolution representation. This is to spare us the need to +! do a full-up interpolation later on. +! RH input from the table is scaled 0 - 0.99 +! We resolve the map to 0 - 0.990 in steps of 0.001 (991 total steps) + do j = 1, 991 + do i = this%nrh, 1, -1 + if( (j-1) .ge. int(this%rh(i)*1000)) then + ip1 = i + 1 + this%rhi(j) = i + if(ip1 .gt. this%nrh) then + this%rha(j) = 0. + else + this%rha(j) = ( (j-1)/1000. - this%rh(i)) & + / ( this%rh(ip1)- this%rh(i)) + endif + exit + endif + enddo +! print *, j, this%rhi(j), this%rha(j), this%rh(this%rhi(j)) + enddo + +! deallocate (channels_table, rh_table, bext_table, bsca_table, & +! bbck_table, g_table, stat = rc ) + + deallocate (channels_table, stat = rc ) + deallocate (rh_table, stat = rc ) + deallocate (reff_table, stat = rc ) + deallocate (bext_table, stat = rc ) + deallocate (bsca_table, stat = rc ) + deallocate (bbck_table, stat = rc ) + deallocate (g_table, stat = rc ) + deallocate (pback_table, stat = rc ) + if ( nmom_ > 0 ) then + deallocate (pmom_table, stat = rc ) + endif + deallocate (gf_table, stat = rc ) + deallocate (rhop_table, stat = rc ) + deallocate (rhod_table, stat = rc ) + deallocate (vol_table, stat = rc ) + deallocate (area_table, stat = rc ) + deallocate (refr_table, stat = rc ) + deallocate (refi_table, stat = rc ) + +return + +contains + + subroutine polint(x,y,n,xWant,yWant,yErr) + integer :: n +! recall, table hard-wired single precision + real*8 :: x(n),y(n) + real :: xWant, yWant, yErr + +! given array x(n) of independent variables and array y(n) of dependent +! variables, compute the linear interpolated result yWant at xWant and return +! with a dummy error estimate yErr. Hacked up from Numerical Recipes Chapter 3 + + integer :: i, j + real :: dx, slope + character(len=255) :: msg + +! on out of bounds, set i to lower or upper limit + i = 0 + if(xWant .lt. x(1)) then +! write(msg,*) "in polint, wanted: ", xWant, ", got lower bound: ", x(1) +! call warn(myname,msg) +! if (mapl_am_i_root()) print *,'in polint(), wnted: ', xWant, ', got lower bound: ', x(1) + i = 1 + endif + if(xWant .gt. x(n)) then +! write(msg,*) "in polint, wanted: ", xWant, ", got upper bound: ", x(n) +! call warn(myname,msg) +! if (mapl_am_i_root()) print *,'in polint(), wnted: ', xWant, ', got upper bound: ', x(n) + + i = n + endif + +! if i is still zero find i less than xWant + if(i .eq. 0) then + do j = 1, n + if(xWant .ge. x(j)) i = j + enddo + endif + +! slope + if(i .eq. n) then + slope = 0. + else + slope = (y(i+1)-y(i)) / (x(i+1)-x(i)) + endif + dx = xWant - x(i) + yWant = y(i) + slope*dx + + yErr = 0. + + return + end subroutine polint + +END SUBROUTINE Chem_MieTableRead +!---------------------------------------------------------------------------- + +!BOP +! +! !IROUTINE: Chem_MieQueryByInt --- Return Tau, SSA, etc +! +! +! !INTERFACE: +! + impure elemental subroutine Chem_MieQueryByInt ( this, idx, channel, q_mass, rh, & + tau, ssa, gasym, bext, bsca, bbck, & + reff, p11, p22, gf, rhop, rhod, & + vol, area, refr, refi, rc ) + +! !INPUT PARAMETERS: + + type(Chem_Mie), target, intent(in ) :: this + integer, intent(in ) :: idx ! variable index on Chem_Mie + real, intent(in ) :: channel ! channel number + real, intent(in ) :: q_mass ! aerosol mass [kg/m2], + real, intent(in ) :: rh ! relative himidity + +! !OUTPUT PARAMETERS: + + real, optional, intent(out) :: tau ! aerol extinction optical depth + real, optional, intent(out) :: ssa ! single scattering albedo + real, optional, intent(out) :: gasym ! asymmetry parameter + real, optional, intent(out) :: bext ! mass extinction efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: bsca ! mass scattering efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: bbck ! mass backscatter efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: reff ! effective radius (micron) + real, optional, intent(out) :: p11 ! P11 phase function at backscatter + real, optional, intent(out) :: p22 ! P22 phase function at backscatter + real, optional, intent(out) :: gf ! Growth factor (ratio of wet to dry radius) + real, optional, intent(out) :: rhop ! Wet particle density [kg m-3] + real, optional, intent(out) :: rhod ! Dry particle density [kg m-3] + real, optional, intent(out) :: vol ! Wet particle volume [m3 kg-1] + real, optional, intent(out) :: area ! Wet particle cross section [m2 kg-1] + real, optional, intent(out) :: refr ! Wet particle real part of ref. index + real, optional, intent(out) :: refi ! Wet particle imag. part of ref. index + integer, optional, intent(out) :: rc ! error code + +! !DESCRIPTION: +! +! Returns requested parameters from the Mie tables, as a function +! of species, relative humidity, and channel +! +! Notes: Needs some checking, and I still force an interpolation step + +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco +! 11Jul2005 da Silva Standardization. +! +!EOP +!------------------------------------------------------------------------- + + + integer :: ICHANNEL, TYPE + integer :: irh, irhp1, isnap + real :: rhUse, arh + real :: bextIn, bscaIn, bbckIn, gasymIn, p11In, p22In, & + gfIn, rhopIn, rhodIn, volIn, areaIn, & + refrIn, refiIn + type(Chem_MieTable), pointer :: TABLE + + character(len=*), parameter :: Iam = 'Chem_MieQuery' + + if ( present(rc) ) rc = 0 + + ICHANNEL = nint(CHANNEL) +! TABLE => this%vtableUse + Table => this%mie_aerosol + TYPE = idx + +! ASSERT_(TYPE>0) +! ASSERT_(ICHANNEL>=LBOUND(TABLE%bext,1)) +! ASSERT_(ICHANNEL<=UBOUND(TABLE%bext,1)) + +! Now map the input RH to the high resolution hash table for RH + rhUse = max(rh,0.) + rhUse = min(rh,0.99) + isnap = int((rhUse+0.001)*1000.) + if(isnap .lt. 1) isnap = 1 + arh = TABLE%rha( isnap ) + irh = TABLE%rhi( isnap ) + irhp1 = irh+1 + if(irhp1 .gt. TABLE%nrh) irhp1 = TABLE%nrh + +! Now linearly interpolate the input table for the requested aerosol and +! channel; rh is the relative humidity. + + if(present(bext) .or. present(tau) .or. present(ssa) ) then + bextIn = TABLE%bext(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%bext(irhp1,ichannel,TYPE) * arh + endif + + if(present(bsca) .or. present(ssa) ) then + bscaIn = TABLE%bsca(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%bsca(irhp1,ichannel,TYPE) * arh + endif + + if(present(bbck)) then + bbckIn = TABLE%bbck(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%bbck(irhp1,ichannel,TYPE) * arh + endif + + if(present(gasym)) then + gasymIn = TABLE%g(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%g(irhp1,ichannel,TYPE) * arh + endif + + if(present(rEff) ) then + rEff = TABLE%rEff(irh ,TYPE) * (1.-arh) & + + TABLE%rEff(irhp1,TYPE) * arh + rEff = 1.E6 * rEff ! convert to microns + endif + +! if(present(pmom)) then +! pmom(:,:) = TABLE%pmom(irh ,ichannel,TYPE,:,:) * (1.-arh) & +! + TABLE%pmom(irhp1,ichannel,TYPE,:,:) * arh +! endif + +! if(present(pmom)) then +! call Chem_MieQueryByIntWithpmom(this, idx, channel, q_mass, rh, pmom) +! endif + + + if(present(p11) ) then + p11In = TABLE%pback(irh ,ichannel,TYPE,1) * (1.-arh) & + + TABLE%pback(irhp1,ichannel,TYPE,1) * arh + endif + + if(present(p22) ) then + p22In = TABLE%pback(irh ,ichannel,TYPE,5) * (1.-arh) & + + TABLE%pback(irhp1,ichannel,TYPE,5) * arh + endif + + if(present(gf) ) then + gfIn = TABLE%gf(irh ,TYPE) * (1.-arh) & + + TABLE%gf(irhp1,TYPE) * arh + endif + + if(present(rhod) ) then + rhodIn = TABLE%rhod(1 ,TYPE) + endif + + if(present(vol) ) then + volIn = TABLE%vol(irh ,TYPE) * (1.-arh) & + + TABLE%vol(irhp1,TYPE) * arh + endif + + if(present(area) ) then + areaIn = TABLE%area(irh ,TYPE) * (1.-arh) & + + TABLE%area(irhp1,TYPE) * arh + endif + + if(present(refr) .or. present(tau) .or. present(ssa) ) then + refrIn = TABLE%refr(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%refr(irhp1,ichannel,TYPE) * arh + endif + + if(present(refi) .or. present(tau) .or. present(ssa) ) then + refiIn = TABLE%refi(irh ,ichannel,TYPE) * (1.-arh) & + + TABLE%refi(irhp1,ichannel,TYPE) * arh + endif + +! Fill the requested outputs + if(present(tau )) tau = bextIn * q_mass + if(present(ssa )) ssa = bscaIn/bextIn + if(present(bext )) bext = bextIn + if(present(bsca )) bsca = bscaIn + if(present(bbck )) bbck = bbckIn + if(present(gasym)) gasym = gasymIn + if(present(p11 )) p11 = p11In + if(present(p22 )) p22 = p22In + if(present(gf )) gf = gfIn + if(present(rhop )) rhop = rhopIn + if(present(rhod )) rhod = rhodIn + if(present(vol )) vol = volIn + if(present(area )) area = areaIn + if(present(refr )) refr = refrIn + if(present(refi )) refi = refiIn + +! All Done +!---------- + end subroutine Chem_MieQueryByInt + + +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: Chem_MieQueryByIntWithpmom --- Return Tau, SSA, etc +! +! +! !INTERFACE: +! + subroutine Chem_MieQueryByIntWithpmom ( this, idx, channel, q_mass, rh, & + tau, ssa, gasym, bext, bsca, bbck, & + reff, pmom, p11, p22, gf, rhop, rhod, & + vol, area, refr, refi, rc ) + +! !INPUT PARAMETERS: + + type(Chem_Mie), target, intent(in ) :: this + integer, intent(in ) :: idx ! variable index on Chem_Mie + real, intent(in ) :: channel ! channel number + real, intent(in ) :: q_mass ! aerosol mass [kg/m2], + real, intent(in ) :: rh ! relative himidity + +! !OUTPUT PARAMETERS: + + real, optional, intent(out) :: tau ! aerol extinction optical depth + real, optional, intent(out) :: ssa ! single scattering albedo + real, optional, intent(out) :: gasym ! asymmetry parameter + real, optional, intent(out) :: bext ! mass extinction efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: bsca ! mass scattering efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: bbck ! mass backscatter efficiency [m2 (kg dry mass)-1] + real, optional, intent(out) :: reff ! effective radius (micron) + real, intent(out) :: pmom(:,:) + real, optional, intent(out) :: p11 ! P11 phase function at backscatter + real, optional, intent(out) :: p22 ! P22 phase function at backscatter + real, optional, intent(out) :: gf ! Growth factor (ratio of wet to dry radius) + real, optional, intent(out) :: rhop ! Wet particle density [kg m-3] + real, optional, intent(out) :: rhod ! Dry particle density [kg m-3] + real, optional, intent(out) :: vol ! Wet particle volume [m3 kg-1] + real, optional, intent(out) :: area ! Wet particle cross section [m2 kg-1] + real, optional, intent(out) :: refr ! Wet particle real part of ref. index + real, optional, intent(out) :: refi ! Wet particle imag. part of ref. index + integer, optional, intent(out) :: rc ! error code + +! !DESCRIPTION: +! +! Returns requested parameters from the Mie tables, as a function +! of species, relative humidity, and channel +! +! Notes: Needs some checking, and I still force an interpolation step + +! +! !REVISION HISTORY: +! +! 23Mar2005 Colarco +! 11Jul2005 da Silva Standardization. +! +!EOP +!------------------------------------------------------------------------- + + + integer :: ICHANNEL, TYPE + integer :: irh, irhp1, isnap + real :: rhUse, arh + type(Chem_MieTable), pointer :: TABLE + + character(len=*), parameter :: Iam = 'Chem_MieQueryByIntWithpmom' + + if ( present(rc) ) rc = 0 + + ICHANNEL = nint(CHANNEL) + TABLE => this%vtableUse + TYPE = idx + +! Now map the input RH to the high resolution hash table for RH + rhUse = max(rh,0.) + rhUse = min(rh,0.99) + isnap = int((rhUse+0.001)*1000.) + if(isnap .lt. 1) isnap = 1 + arh = TABLE%rha( isnap ) + irh = TABLE%rhi( isnap ) + irhp1 = irh+1 + if(irhp1 .gt. TABLE%nrh) irhp1 = TABLE%nrh + +! Now linearly interpolate the input table for the requested aerosol and +! channel; rh is the relative humidity. + call Chem_MieQuery ( this, idx, channel, q_mass, rh, & + tau, ssa, gasym, bext, bsca, bbck, & + reff, p11, p22, gf, rhop, rhod, & + vol, area, refr, refi, rc ) + + pmom(:,:) = TABLE%pmom(irh ,ichannel,TYPE,:,:) * (1.-arh) & + + TABLE%pmom(irhp1,ichannel,TYPE,:,:) * arh + + + +! All Done +!---------- + end subroutine Chem_MieQueryByIntWithpmom + + + + + end module Chem_MieTableMod2G + diff --git a/Process_Library/GOCART2G_Process.F90 b/Process_Library/GOCART2G_Process.F90 new file mode 100644 index 00000000..7695170e --- /dev/null +++ b/Process_Library/GOCART2G_Process.F90 @@ -0,0 +1,9015 @@ +#define __SUCCESS__ 0 +#define __VERIFY__(x) if(x/=0) then; if(present(rc)) rc=x; return; endif +#define __RC__ rc=status); __VERIFY__(status +#define __STAT__ stat=status); __VERIFY__(status +#define __IOSTAT__ iostat=status); __VERIFY__(status +#define __RETURN__(x) if (present(rc)) rc=x; return +#define __ASSERT__(expr) if(.not. (expr)) then; if (present(rc)) rc=-1; return; endif +!------------------------------------------------------------------------- +! +! !MODULE: GOCART2G_Process -- GOCART2G process library +! +! !INTERFACE: + module GOCART2G_Process + +! !USES: +! Only instrinsic fortran types and functions are allowed. + use Chem_MieTableMod2G + use, intrinsic :: iso_fortran_env, only: IOSTAT_END + + implicit none + private + +! +! !PUBLIC MEMBER FUNCTIONS: +! + public DustEmissionGOCART2G + public DistributePointEmission + public updatePointwiseEmissions + public Chem_Settling2Gorig + public Chem_SettlingSimpleOrig + public DryDeposition + public WetRemovalGOCART2G + public UpdateAerosolState + public Aero_Compute_Diags + public jeagleSSTcorrection + public deepLakesMask + public weibullDistribution + public SeasaltEmission + public wetRadius + public hoppelCorrection + public CAEmission + public phobicTophilic + public NIheterogenousChem +! public CombineVolcEmiss + public SulfateDistributeEmissions + public DMSemission + public SUvolcanicEmissions + public SulfateUpdateOxidants + public SU_Wet_Removal + public SU_Compute_Diags + public SulfateChemDriver + public get_HenrysLawCts + public NIthermo + public Chem_UtilResVal + public Chem_UtilIdow + public Chem_UtilCdow + public Chem_BiomassDiurnal + public ReadPointEmissions + public EmissionReader + + real, parameter :: OCEAN=0.0, LAND = 1.0, SEA_ICE = 2.0 + integer, parameter :: DP = kind(1.0d0) + + type :: EmissionReader + private + integer, allocatable :: unit + contains + procedure :: open + procedure :: close + procedure :: rewind => rewind_reader + procedure :: is_end_marker + procedure :: read_table + procedure :: next_line + procedure :: count_words + procedure :: scan_to_label + procedure :: get_dims + end type EmissionReader + + type KeywordEnforcer + end type KeywordEnforcer + +! +! !DESCRIPTION: +! +! This module contains and implements all necessary process calculations for GOCART. +! +! !REVISION HISTORY: +! +! 11Feb2020 E.Sherman, A.da Silva, T.Clune, A.Darmenov - Ported/consolidated/refactored GOCART +! physics and chemistry code into a single process library that only uses +! intrinsic Fortran functions. +! +!EOP +!------------------------------------------------------------------------- +CONTAINS + +!================================================================================== +!BOP +! !IROUTINE: DustEmissionGOCART2G + + subroutine DustEmissionGOCART2G(radius, fraclake, gwettop, oro, u10m, & + v10m, Ch_DU, du_src, grav, & + emissions, rc ) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + real, intent(in) :: radius(:) ! particle radius [m] + real, pointer, dimension(:,:), intent(in) :: fraclake ! fraction of lake [1] + real, pointer, dimension(:,:), intent(in) :: gwettop ! surface soil wetness [1] + real, pointer, dimension(:,:), intent(in) :: oro ! land-ocean-ice mask [1] + real, pointer, dimension(:,:), intent(in) :: u10m ! 10-meter eastward wind [m/sec] + real, pointer, dimension(:,:), intent(in) :: v10m ! 10-meter northward wind [m/sec] + real, pointer, dimension(:,:), intent(in) :: du_src ! dust emissions [(sec^2 m^5)/kg] + real, intent(in) :: Ch_DU ! dust emission tuning coefficient [kg/(sec^2 m^5)] + real, intent(in) :: grav ! gravity [m/sec^2] + +! !OUTPUT PARAMETERS: + real, pointer, intent(inout) :: emissions(:,:) ! Local emission [kg/(m^2 sec)] + integer, intent(out) :: rc ! Error return code: + + +! !DESCRIPTION: Computes the dust emissions for one time step +! +! !REVISION HISTORY: +! +! 11Feb2020 E.Sherman - First attempt at refactor +! + +! !Local Variables + integer :: i, j, n + real, parameter :: air_dens = 1.25 ! Air density = 1.25 kg m-3 + real, parameter :: soil_density = 2650. ! km m-3 + real :: diameter ! dust effective diameter [m] + real :: u_thresh0 + real :: u_thresh + real :: w10m + integer :: i1, i2, j1, j2, nbins + integer :: dims(2) + real, allocatable :: emissions_(:,:) + +!EOP +!------------------------------------------------------------------------- +! Begin + +! Initialize local variables +! -------------------------- + emissions(:,:) = 0. + rc = 824 + +! Get dimensions +! --------------- + nbins = size(radius) + dims = shape(u10m) + i1 = 1; j1 = 1 + i2 = dims(1); j2 = dims(2) + + allocate(emissions_(i2,j2)) + +! Calculate the threshold velocity of wind erosion [m/s] for each radius +! for a dry soil, as in Marticorena et al. [1997]. +! The parameterization includes the air density which is assumed +! = 1.25 kg m-3 to speed the calculation. The error in air density is +! small compared to errors in other parameters. + +!print*,'DustEmiss shape(emissions) = ',shape(emissions) + + do n = 1, nbins + diameter = 2. * radius(n) + + u_thresh0 = 0.13 * sqrt(soil_density*grav*diameter/air_dens) & + * sqrt(1.+6.e-7/(soil_density*grav*diameter**2.5)) & + / sqrt(1.928*(1331.*(100.*diameter)**1.56+0.38)**0.092 - 1.) + + emissions_(:,:) = 0. + +! Spatially dependent part of calculation +! --------------------------------------- + do j = j1, j2 + do i = i1, i2 + if ( oro(i,j) /= LAND ) cycle ! only over LAND gridpoints + + w10m = sqrt(u10m(i,j)**2.+v10m(i,j)**2.) +! Modify the threshold depending on soil moisture as in Ginoux et al. [2001] + if(gwettop(i,j) .lt. 0.5) then + u_thresh = amax1(0.,u_thresh0* & + (1.2+0.2*alog10(max(1.e-3,gwettop(i,j))))) + + if(w10m .gt. u_thresh) then +! Emission of dust [kg m-2 s-1] + emissions_(i,j) = (1.-fraclake(i,j)) * w10m**2. * (w10m-u_thresh) + endif + endif !(gwettop(i,j) .lt. 0.5) + end do ! i + end do ! j + emissions = emissions + (Ch_DU * du_src * emissions_) + end do ! n + + rc=0 + + end subroutine DustEmissionGOCART2G + +!================================================================================== +!BOP + +! !IROUTINE: updatePointwiseEmissions + + subroutine updatePointwiseEmissions (km, pBase, pTop, pEmis, nPts, pStart, & + pEnd, hghte, area, & + iPoint, jPoint, nhms, emissions_point, rc) + implicit none + +! !ARGUMENTS: + integer, intent(in) :: km ! total model levels + real, dimension(:), intent(in) :: pBase ! base altitude (e.g., bottom of plume) + real, dimension(:), intent(in) :: pTop ! top altitude (e.g., top of plume) + real, dimension(:), intent(in) :: pEmis ! emission flux (e.g., kg/sec of species) + integer, intent(in) :: nPts ! number of events in file + integer, dimension(:), intent(in) :: pStart ! HHMMSS to start emissions + integer, dimension(:), intent(in) :: pEnd ! HHMMSS to end emissions + real, dimension(:,:,:), intent(in) :: hghte ! model level geopotential height [m] + real, dimension(:,:), intent(in) :: area ! grid cell area [m^2] + integer, dimension(:), intent(in) :: iPoint ! i dimension location of emission on grid + integer, dimension(:), intent(in) :: jPoint ! j dimension location of emission on grid + integer, intent(in) :: nhms ! model hour mintue second + real, dimension(:,:,:), intent(inout) :: emissions_point ![kg/kg] + integer, optional, intent(out) :: rc ! return code + +! !Local + real, dimension(km) :: point_column_emissions + integer :: n, i, j + real, dimension(:), allocatable :: pEmis_ + +! Description: Returns 3D array of pointwise emissions. +! +! Revision History: +!EOP +!----------------------------------------------------------------------------- +! Begin... + + pEmis_ = pEmis + + do n = 1, nPts + i = iPoint(n) + j = jPoint(n) + if( i<1 .OR. j<1 ) cycle ! Point emission not in this sub-domain + ! Emissions not occurring in current time step + if(nhms < pStart(n) .or. nhms >= pEnd(n)) cycle + + call DistributePointEmission(km, hghte(i,j,:), pBase(n), & + pTop(n), pEmis_(n), area(i,j), & + point_column_emissions, rc) + + emissions_point(i,j,:) = point_column_emissions + end do + rc = 0 + + end subroutine updatePointwiseEmissions + +!================================================================================== +!BOP +! !IROUTINE: DistributePointEmissions + +! !INTERFACE: + + subroutine DistributePointEmission(km, hghte, z_bot, z_top, & + emissions_point, area, & + point_column_emissions, rc) +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! total model levels + real, dimension(:), intent(in) :: hghte ! model level geopotential height [m] + real, intent(in) :: z_bot, z_top ! base and top altitude respectively + real, intent(in) :: area ! grid cell area [m^2] + real, intent(in) :: emissions_point ![kg/kg] + + +! !OUTPUT PARAMETERS: + real, dimension(:), intent(out) :: point_column_emissions ![kg/kg] + integer, optional, intent(out) :: rc ! Error return code: + + +! !DESCRIPTION: Distributes piont emissions uniformily in the vertical in height coordinates. +! +! !REVISION HISTORY: +! ??? A. Darmenov +! ??? P. Colarco +! +! !Locals + integer :: k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ !dz units = meters + +!EOP +!------------------------------------------------------------------------- +! Begin + +! z(1:km) = hghte(0:km-1) + z(1:km) = hghte(1:km) + + do k = km, 1, -1 +! dz(k) = hghte(k-1)-hghte(k) + dz(k) = hghte(k)-hghte(k+1) + end do + +! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + +! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + +! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot == k_top) then + if (z_top == z_bot) then ! for non-explosive volcanic emissions + w_(k_bot) = tiny(0.) + else + w_(k_bot) = z_top - z_bot + end if + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + +! distribute emissions in the vertical + point_column_emissions(:) = (w_ / sum(w_)) * emissions_point +! point_column_emissions(:) = ((w_ / sum(w_)) * emissions_point) / area + +!print*,'point_column_emissions = ',point_column_emissions +!print*,'emissions_point = ',emissions_point +!print*,'w_/sum(w_) = ',w_/sum(w_) +!print*,'area = ',area + + rc = 0 + + end subroutine DistributePointEmission +!================================================================================== + +!BOP +! !IROUTINE: Chem_Settling2G + + subroutine Chem_Settling2Gorig (km, klid, flag, bin, int_qa, grav, delp, & + radiusInp, rhopInp, cdt, tmpu, rhoa, & + rh, hghte, fluxout, vsettleOut, correctionMaring, rc) + +! !USES: + implicit none + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! total model levels + integer, intent(in) :: klid ! index for pressure lid + integer, intent(in) :: flag ! flag to control particle swelling (see note) + integer, intent(in) :: bin ! aerosol bin index + real, intent(in) :: grav ! gravity [m/sec^2] + real, intent(in) :: cdt ! chemistry model time-step + real, intent(in) :: radiusInp ! particle radius [microns] + real, intent(in) :: rhopInp ! soil class density [kg/m^3] + real, dimension(:,:,:), intent(inout) :: int_qa ! aerosol [kg/kg] + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:), intent(in) :: rhoa ! air density [kg/m^3] + real, pointer, dimension(:,:,:), intent(in) :: rh ! relative humidity [1] + real, pointer, dimension(:,:,:), intent(in) :: hghte ! geopotential height [m] + real, pointer, dimension(:,:,:), intent(in) :: delp ! pressure level thickness [Pa] + logical, optional, intent(in) :: correctionMaring + + +! !OUTPUT PARAMETERS: + real, pointer, dimension(:,:,:), intent(inout) :: fluxout ! Mass lost by settling to surface [kg/(m^2 sec)] + +! Optionally output the settling velocity calculated + real, dimension(:,:,:), optional, intent(out) :: vsettleOut !Layer fall speed [m/sec] + + integer, optional, intent(out) :: rc + +! !DESCRIPTION: Gravitational settling of aerosol between vertical +! layers. Assumes input radius in [m] and density (rhop) +! in [kg m-3]. If flag is set, use the Fitzgerald 1975 (flag = 1) +! or Gerber 1985 (flag = 2) parameterization to update the +! particle radius for the calculation (local variables radius +! and rhop). +! +! !REVISION HISTORY: +! +! 11Feb2020 E.Sherman - First attempt at refactor +! + +! !Local + real, parameter :: rhow = 1000. ! Density of water [kg m-3] +! parameter from Gerber 1985 (units require radius in cm, see rcm) + real, parameter :: c1=0.7674, c2=3.079, c3=2.573e-11, c4=-1.424 +! parameters for ammonium sulfate + real, parameter :: SU_c1=0.4809, SU_c2=3.082, SU_c3=3.110e-11, SU_c4=-1.428 + real, parameter :: epsilon = 1. ! soluble fraction of deliqeuscing particle + real, parameter :: alphaNaCl = 1.35 +! parameters from Maring et al, 2003 + real, parameter :: v_upwardMaring = 0.33e-2 ! upward velocity, [m s-1] + real, parameter :: diameterMaring = 7.30e-6 ! particle diameter, [m] + + integer :: i1=1, i2, j1=1, j2 + integer :: dims(3) + integer :: nSubSteps, ijl, dk + integer :: i, j, k, iit, n + + real, allocatable :: dz(:,:,:) + real :: radius, rhop ! particle radius and density passed to + ! fall velocity calculation + real :: minTime, qmin + real :: sat, rrat + real :: alpha, alpha1, alpharat, beta, theta, f1, f2 + real :: rcm + real :: diff_coef ! Brownian diffusion coefficient [m2 s-1] + real(kind=DP) :: dt_settle, gravDP +! real, allocatable, dimension(:,:) :: hsurf + real, pointer, dimension(:,:) :: hsurf + + real, dimension(:,:,:), allocatable :: vsettle ! fall speed [m s-1] + real(kind=DP), dimension(:,:,:), allocatable :: dzd, vsd, qa, qa_temp + real(kind=DP), dimension(:,:), allocatable :: cmass_before, cmass_after, qdel, & + d_p, dpm1, qsrc + + +!EOP +!------------------------------------------------------------------------- + +! Get dimensions +! --------------- +! nbins = size(radiusInp) + dims = shape(rhoa) + i2 = dims(1); j2 = dims(2) + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + +!print*,'nbins = ',nbins +!print*,'i2 = ',i2 +!print*,'j2 = ',j2 + + gravDP = grav + + hsurf => hghte(i1:i2,j1:j2,km) + +! Allocate arrays +! --------------- + allocate(dz, mold=rhoa); + allocate(dzd(i2,j2,km), vsd(i2,j2,km), qa(i2,j2,km), vsettle(i2,j2,km), qa_temp(i2,j2,km)) + allocate(cmass_before(i2,j2), cmass_after(i2,j2), qdel(i2,j2), d_p(i2,j2), & + dpm1(i2,j2), qsrc(i2,j2)) + +!#if 0 +! Handle the fact that hghte may be in the range [1,km+1] or [0,km] +! ----------------------------------------------------------------- + dk = lbound(hghte,3) - 1 ! This is either 0 or 1 + +! Layer thickness from hydrostatic equation + k = km + dz(:,:,k) = hghte(:,:,k+dk)-hsurf(:,:) + do k = km-1, 1, -1 + dz(:,:,k) = hghte(:,:,k+dk) - hghte(:,:,k+dk+1) + enddo + dzd = dz + +!print*,'CHEM_SETTLING TEST A' + +! Loop over the number of dust bins +! do n = 1, nbins + +! qa = w_c%qa(nbeg+n-1)%data3d +! qa(:,:,:) = int_qa(:,:,:,n) + qa(:,:,:) = int_qa(:,:,:) + +! radius = radiusInp(n) +! rhop = rhopInp(n) + radius = radiusInp + rhop = rhopInp + +! Reset a (large) minimum time to cross a grid cell in settling + minTime = cdt + + if(associated(fluxout)) fluxout(:,:,bin) = 0.0 +! fluxout = 0.0 + cmass_before(:,:) = 0.d0 + cmass_after(:,:) = 0.d0 + +! If radius le 0 then get out of loop + if(radius .le. 0.) then + rc = 100 + return + end if + +! do k = 1, km + do k = klid, km + do j = j1, j2 + do i = i1, i2 +! Find the column dry mass before sedimentation + cmass_before(i,j) = cmass_before(i,j) + qa(i,j,k)/gravDP * delp(i,j,k) + +! Adjust the particle size for relative humidity effects + sat = max(rh(i,j,k),tiny(1.0)) ! to avoid zero FPE + +! Fitzgerald + select case(flag) + case(1) + if (sat >= 0.80) then +! if(flag .eq. 1 .and. sat .ge. 0.80) then +! parameterization blows up for RH > 0.995, so set that as max +! rh needs to be scaled 0 - 1 + sat = min(0.995,sat) +! Calculate the alpha and beta parameters for the wet particle +! relative to amonium sulfate + beta = exp( (0.00077*sat) / (1.009-sat) ) + if(sat .le. 0.97) then + theta = 1.058 + else + theta = 1.058 - (0.0155*(sat-0.97)) /(1.02-sat**1.4) + endif + alpha1 = 1.2*exp( (0.066*sat) / (theta-sat) ) + f1 = 10.2 - 23.7*sat + 14.5*sat**2. + f2 = -6.7 + 15.5*sat - 9.2*sat**2. + alpharat = 1. - f1*(1.-epsilon) - f2*(1.-epsilon**2.) + alpha = alphaNaCl * (alpha1*alpharat) +! radius is the radius of the wet particle + radius = alpha * radiusInp**beta + rrat = (radiusInp/radius)**3. + rhop = rrat*rhopInp + (1.-rrat)*rhow + end if + case(2) +! elseif(flag .eq. 2) then ! Gerber + sat = min(0.995,sat) + rcm = radiusInp*100. + radius = 0.01 * (c1*rcm**c2 / (c3*rcm**c4-alog10(sat)) & + + rcm**3.)**(1./3.) + rrat = (radiusInp/radius)**3. + rhop = rrat*rhopInp + (1.-rrat)*rhow + case(3) +! elseif(flag .eq. 3) then +! Gerber parameterization for Ammonium Sulfate + sat = min(0.995,sat) + rcm = radiusInp*100. + radius = 0.01 * (SU_c1*rcm**SU_c2 / (SU_c3*rcm**SU_c4-alog10(sat)) & + + rcm**3.)**(1./3.) + rrat = (radiusInp/radius)**3. + rhop = rrat*rhopInp + (1.-rrat)*rhow + case(4) +! elseif(flag .eq. 4) then +! Petters and Kreidenweis (ACP2007) parameterization + sat = min(0.99,sat) + radius = (radiusInp**3 * (1+1.19*sat/(1-sat)))**(1./3.) + rrat = (radiusInp/radius)**3 + rhop = rrat*rhopInp + (1.-rrat)*rhow +! endif + end select + +! Calculate the settling velocity + call Chem_CalcVsettle2Gorig(radius, rhop, rhoa(i,j,k), tmpu(i,j,k), & + grav, diff_coef, vsettle(i,j,k)) + end do !do i + end do !do j + end do !do k + +!print*,'CHEM_SETTLING TEST2' + + if(present(correctionMaring)) then + if ((correctionMaring) .and. (radiusInp .le. (0.5*diameterMaring))) then + vsettle = max(1.0e-9, vsettle - v_upwardMaring) + endif + endif + + vsd = vsettle + + if(present(vsettleOut)) then +! vsettleOut(n)%data3d = vsettle +! vsettleOut(:,:,:,n) = vsettle + vsettleOut = vsettle + endif + +! Determine global min time to cross grid cell + qmin = minval(dz/vsettle) + +! call pmaxmin ( 'Chem_Settling: dt', dz(i1:i2,j1:j2,1:km)/vsettle(i1:i2,j1:j2,1:km), & +! qmin, qmax, ijl, km, 0. ) + + minTime = min(minTime,qmin) + +! Now, how many iterations do we need to do? + if ( minTime < 0 ) then + nSubSteps = 0 +!REVISIT THIS!!! +!---------------------- +! call mpout_log(myname,'no Settling because minTime = ', minTime ) +!--------------------- + else if(minTime .ge. cdt) then + nSubSteps = 1 + dt_settle = cdt + else + nSubSteps = cdt/minTime+1 + dt_settle = cdt/nSubSteps + endif + +!print*,'CHEM_SETTLING TEST3' + +qa_temp = qa + +! Loop over sub-timestep + do iit = 1, nSubSteps + +! Try a simple forward Euler scheme +! qdel = qa(i1:i2,j1:j2,1)*dt_settle*vsd(i1:i2,j1:j2,1)/dzd(i1:i2,j1:j2,1) +! qa(i1:i2,j1:j2,1) = qa(i1:i2,j1:j2,1) - qdel + + qdel = qa(i1:i2,j1:j2,klid)*dt_settle*vsd(i1:i2,j1:j2,klid)/dzd(i1:i2,j1:j2,klid) + qa(i1:i2,j1:j2,klid) = qa(i1:i2,j1:j2,klid) - qdel + +! do k = 2, km + do k = klid+1, km + d_p = delp(i1:i2,j1:j2,k) + dpm1 = delp(i1:i2,j1:j2,k-1) + qsrc = qdel * dpm1 / d_p + qdel = qa(i1:i2,j1:j2,k)*dt_settle*vsd(i1:i2,j1:j2,k)/dzd(i1:i2,j1:j2,k) + qa(i1:i2,j1:j2,k) = qa(i1:i2,j1:j2,k) - qdel + qsrc + enddo + +!commented out in original Chem_Settling +!! An alternative accumulator approach to computing the outgoing flux +!! if( associated(fluxout(n)%data2d) ) then +!! fluxout(n)%data2d = fluxout(n)%data2d + qdel * pdog/grav / dt_settle +!! endif + + end do ! iit + +!if (sum(qa_temp) < sum(qa)) then +! print*,'qa_temp = ',sum(qa_temp), ' : qa = ', sum(qa) +!end if + +! Find the column dry mass after sedimentation and thus the loss flux +! do k = 1, km +! do j = j1, j2 +! do i = i1, i2 +! cmass_after(i,j) = cmass_after(i,j) + qa(i,j,k)/ gravDP * delp(i,j,k) +! enddo +! enddo +! enddo + + cmass_after = sum(qa / gravDP * delp,3) + + if( associated(fluxout) ) then + fluxout(:,:,bin) = (cmass_before - cmass_after)/cdt + endif + +! fluxout = (cmass_before - cmass_after)/cdt + +! w_c%qa(nbeg+n-1)%data3d = qa +! int_qa(:,:,:,n) = qa + int_qa = qa +! end do ! n + + rc=0 + +!#endif + end subroutine Chem_Settling2Gorig + +!========================================================================================= + +!BOP +! +! !IROUTINE: Chem_CalcVsettle2G - Calculate the aerosol settling velocity +! +! !INTERFACE: +! + + subroutine Chem_CalcVsettle2Gorig ( radius, rhop, rhoa, tmpu, grav, & + diff_coef, vsettle ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + real, intent(in) :: radius ! Particle radius [m] + real, intent(in) :: rhop ! Particle density [kg/m^3] + real, intent(in) :: rhoa ! Layer air density [kg/m^3] + real, intent(in) :: tmpu ! Layer temperature [K] + real, intent(in) :: grav ! gravity [m/sec^2] + +! !OUTPUT PARAMETERS: + real, intent(out) :: diff_coef ! Brownian diffusion + ! coefficient [m2/sec] + real, intent(out) :: vsettle ! Layer fall speed [m s-1] + + character(len=*), parameter :: myname = 'Vsettle' + +! !DESCRIPTION: Calculates the aerosol settling velocity and Brownian diffusion +! coefficient +! Follows discussions in Seinfeld and Pandis, Pruppacher and +! Klett, and the coding in CARMA (Toon et al., 1988) +! Should work satisfactorily for al reasonable sized aerosols +! (up to Reynolds number 300) +! +! !REVISION HISTORY: +! +! 06Nov2003 Colarco Initial version. +! 23Jan2003 da Silva Standardization +! + +! !Local Variables + integer, parameter :: DP=kind(1.0d0) + real(kind=DP) :: rmu ! Dynamic viscosity [kg m-1 s-1] + real(kind=DP) :: vt ! Thermal velocity of air molecule [m s-1] + real(kind=DP) :: rmfp ! Air molecule mean free path [m] + real(kind=DP) :: bpm ! Cunningham slip correction factor + real(kind=DP) :: rkn ! Knudsen number + real(kind=DP) :: re, x, y ! reynold's number and parameters + real, parameter :: kb = 1.3807e-23 ! Boltzmann constant [kg m2 s-1 K-1 mol-1] + real, parameter :: m_air = 4.8096e-26 ! Mass of air molecule [kg] + real, parameter :: pi = 3.141529265 + +!EOP +!------------------------------------------------------------------------- +! Begin... + +! Dynamic viscosity from corrected Sutherland's Equation + rmu = 1.8325e-5*(416.16/(tmpu+120.))*(tmpu/296.16)**1.5 + +! Thermal velocity of air molecule + vt = sqrt(8.*kb*tmpu/pi/m_air) + +! Air molecule mean free path + rmfp = 2.*rmu/rhoa/vt + +! Knudsen number + rkn = rmfp/radius + +! Cunningham slip correction factor + bpm = 1. + 1.246*rkn + 0.42*rkn*exp(-0.87/rkn) + +! Brownian diffusion coefficient + diff_coef = kb*tmpu*bpm/3./pi/rmu/(2.*radius) + +! Fall speed (assumes Reynolds # < 0.01) + vsettle = 2./9.*rhop*radius**2.*grav*bpm/rmu + +! Check the Reynold's number to see if we need a drag correction +! First guess at Reynold's number using Stoke's calculation + re = 2.*rhoa*radius*vsettle/rmu + +! If Re > 0.01 then apply drag correction following Pruppacher and +! Klett regime 2 (eq. 10-142). Assuming reasonable aerosols we +! do not consider that particle Re may exceed 300. + if(re .gt. 0.01) then + x = log(24.*re/bpm) + y = -3.18657 + 0.992696 *x - .00153193 *x**2. & + - 0.000987059*x**3. - .000578878 *x**4. & + + 8.55176E-05*x**5. - 3.27815E-06*x**6. + re = exp(y)*bpm + vsettle = rmu*re/2./rhoa/radius + endif + + + end subroutine Chem_CalcVsettle2Gorig + +!================================================================================== +!BOP +! !IROUTINE: Chem_SettlingSimpleOrig + + subroutine Chem_SettlingSimpleOrig ( km, klid, flag, grav, cdt, radiusInp, rhopInp, & + int_qa, tmpu, rhoa, rh, delp, hghte, & + fluxout, rc, vsettleOut, correctionMaring ) + + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! total model levels + integer, intent(in) :: klid ! index for pressure level lid + integer, intent(in) :: flag ! flag to control particle swelling (see note) + real, intent(in) :: grav ! gravity [m/sec^2] + real, intent(in) :: cdt ! chemistry model time-step [sec] + real, intent(in) :: radiusInp ! aerosol radius microns + real, intent(in) :: rhopInp ! aerosol density [kg/m^3] + real, pointer, dimension(:,:,:), intent(inout) :: int_qa ! aerosol [kg/kg] + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:), intent(in) :: rhoa ! air density [kg/m^3] + real, pointer, dimension(:,:,:), intent(in) :: rh ! relative humidyt [1] + real, pointer, dimension(:,:,:), intent(in) :: hghte ! geopotential height [m] + real, pointer, dimension(:,:,:), intent(in) :: delp ! air pressure thickness [Pa] + logical, optional, intent(in) :: correctionMaring + +! !OUTPUT PARAMETERS: + real, pointer, dimension(:,:), intent(inout) :: fluxout + real, dimension(:,:,:), optional, intent(out) :: vsettleOut + integer, optional, intent(out) :: rc + +! !DESCRIPTION: Computes the dust emissions for one time step +! +! !REVISION HISTORY: +! +! 17Aug2020 E.Sherman - Ported and modified from Chem_SettlingMod.F90 +! + +! !Local Variables + real, parameter :: rhow = 1000. ! Density of water [kg m-3] +! parameter from Gerber 1985 (units require radius in cm, see rcm) + real, parameter :: c1=0.7674, c2=3.079, c3=2.573e-11, c4=-1.424 +! parameters for ammonium sulfate + real, parameter :: SU_c1=0.4809, SU_c2=3.082, SU_c3=3.110e-11, SU_c4=-1.428 + real, parameter :: epsilon = 1. ! soluble fraction of deliqeuscing particle + real, parameter :: alphaNaCl = 1.35 +! parameters from Maring et al, 2003 + real, parameter :: v_upwardMaring = 0.33e-2 ! upward velocity, [m s-1] + real, parameter :: diameterMaring = 7.30e-6 ! particle diameter, [m] + + integer :: i1=1, i2, j1=1, j2 + integer :: nSubSteps, ijl, dk + integer :: i, j, k, iit + + real, allocatable :: dz(:,:,:) + real :: radius, rhop ! particle radius and density passed to + ! fall velocity calculation + real :: minTime, qmin + real :: sat, rrat + real :: alpha, alpha1, alpharat, beta, theta, f1, f2 + real :: rcm + real :: diff_coef ! Brownian diffusion coefficient [m2 s-1] + real(kind=DP) :: dt_settle, gravDP +! real, allocatable, dimension(:,:) :: hsurf + real, pointer, dimension(:,:) :: hsurf + + real, dimension(:,:,:), allocatable :: vsettle ! fall speed [m s-1] + real(kind=DP), dimension(:,:,:), allocatable :: dzd, vsd, qa, qa_temp + real(kind=DP), dimension(:,:), allocatable :: cmass_before, cmass_after, qdel, & + dp, dpm1, qsrc + +!EOP +!------------------------------------------------------------------------- +! Begin + + gravDP = grav + + i2 = ubound(hghte,1) + j2 = ubound(hghte,2) + + hsurf => hghte(i1:i2,j1:j2,km) + +! Allocate arrays +! --------------- + allocate(dz, mold=rhoa); + allocate(dzd(i2,j2,km), vsd(i2,j2,km), qa(i2,j2,km), vsettle(i2,j2,km), qa_temp(i2,j2,km)) + allocate(cmass_before(i2,j2), cmass_after(i2,j2), qdel(i2,j2), dp(i2,j2), & + dpm1(i2,j2), qsrc(i2,j2)) + +! Handle the fact that hghte may be in the range [1,km+1] or [0,km] +! ----------------------------------------------------------------- + dk = lbound(hghte,3) - 1 ! This is either 0 or 1 + +! Layer thickness from hydrostatic equation + k = km + dz(:,:,k) = hghte(:,:,k+dk)-hsurf(:,:) + do k = km-1, 1, -1 + dz(:,:,k) = hghte(:,:,k+dk) - hghte(:,:,k+dk+1) + enddo + dzd = dz + +! qa = w_c%qa(ibin)%data3d + qa = int_qa + + radius = radiusInp + rhop = rhopInp + +! Reset a (large) minimum time to cross a grid cell in settling + minTime = cdt + + if( associated(fluxout) ) fluxout = 0.0 + cmass_before(:,:) = 0.d0 + cmass_after(:,:) = 0.d0 + +! If radius le 0 then get out of loop + if(radius .le. 0.) return + +! do k = 1, km + do k = klid, km + do j = j1, j2 + do i = i1, i2 + +! Find the column dry mass before sedimentation + cmass_before(i,j) = cmass_before(i,j) + qa(i,j,k)/gravDP * delp(i,j,k) + +! Adjust the particle size for relative humidity effects + sat = max(rh(i,j,k),tiny(1.0)) ! to avoid zero FPE + +! Fitzgerald + if(flag .eq. 1 .and. sat .ge. 0.80) then +! parameterization blows up for RH > 0.995, so set that as max +! rh needs to be scaled 0 - 1 + sat = min(0.995,sat) +! Calculate the alpha and beta parameters for the wet particle +! relative to amonium sulfate + beta = exp( (0.00077*sat) / (1.009-sat) ) + if(sat .le. 0.97) then + theta = 1.058 + else + theta = 1.058 - (0.0155*(sat-0.97)) /(1.02-sat**1.4) + endif + alpha1 = 1.2*exp( (0.066*sat) / (theta-sat) ) + f1 = 10.2 - 23.7*sat + 14.5*sat**2. + f2 = -6.7 + 15.5*sat - 9.2*sat**2. + alpharat = 1. - f1*(1.-epsilon) - f2*(1.-epsilon**2.) + alpha = alphaNaCl * (alpha1*alpharat) +! radius is the radius of the wet particle + radius = alpha * radiusInp**beta + rrat = (radiusInp/radius)**3. + rhop = rrat*rhopInp + (1.-rrat)*rhow + elseif(flag .eq. 2) then ! Gerber + sat = min(0.995,sat) + rcm = radiusInp*100. + radius = 0.01 * ( c1*rcm**c2 / (c3*rcm**c4-alog10(sat)) & + + rcm**3.)**(1./3.) + rrat = (radiusInp/radius)**3. + rhop = rrat*rhopInp + (1.-rrat)*rhow + elseif(flag .eq. 3) then +! Gerber parameterization for Ammonium Sulfate + sat = min(0.995,sat) + rcm = radiusInp*100. + radius = 0.01 * ( SU_c1*rcm**SU_c2 / (SU_c3*rcm**SU_c4-alog10(sat)) & + + rcm**3.)**(1./3.) + rrat = (radiusInp/radius)**3. + rhop = rrat*rhopInp + (1.-rrat)*rhow + elseif(flag .eq. 4) then +! Petters and Kreidenweis (ACP2007) parameterization + sat = min(0.99,sat) + radius = (radiusInp**3 * (1+1.19*sat/(1-sat)))**(1./3.) + rrat = (radiusInp/radius)**3 + rhop = rrat*rhopInp + (1.-rrat)*rhow + endif + +! Calculate the settling velocity +! call Chem_CalcVsettle(radius, rhop, rhoa(i,j,k), & +! tmpu(i,j,k), diff_coef, vsettle(i,j,k)) + call Chem_CalcVsettle2Gorig(radius, rhop, rhoa(i,j,k), tmpu(i,j,k), & + grav, diff_coef, vsettle(i,j,k)) + end do + end do + end do + + if(present(correctionMaring)) then + if ((correctionMaring) .and. (radiusInp .le. (0.5*diameterMaring))) then + vsettle = max(1.0e-9, vsettle - v_upwardMaring) + endif + endif + + vsd = vsettle + + if(present(vsettleOut)) then +! if(associated(vsettleOut)) vsettleOut = vsettle + vsettleOut = vsettle + endif + +! Determine global min time to cross grid cell +! call pmaxmin ( 'Chem_Settling: dt', dz(i1:i2,j1:j2,1:km)/vsettle(i1:i2,j1:j2,1:km), & +! qmin, qmax, ijl, km, 0. ) + qmin = minval(dz/vsettle) + minTime = min(minTime,qmin) + +! Now, how many iterations do we need to do? + if ( minTime < 0 ) then + nSubSteps = 0 +! call mpout_log(myname,'no Settling because minTime = ', minTime ) + else if(minTime .ge. cdt) then + nSubSteps = 1 + dt_settle = cdt + else + nSubSteps = cdt/minTime+1 + dt_settle = cdt/nSubSteps + endif + +! Loop over sub-timestep + do iit = 1, nSubSteps + +! Try a simple forward Euler scheme + qdel = qa(i1:i2,j1:j2,klid)*dt_settle*vsd(i1:i2,j1:j2,klid)/dzd(i1:i2,j1:j2,klid) + qa(i1:i2,j1:j2,klid) = qa(i1:i2,j1:j2,klid) - qdel +! qdel = qa(i1:i2,j1:j2,1)*dt_settle*vsd(i1:i2,j1:j2,1)/dzd(i1:i2,j1:j2,1) +! qa(i1:i2,j1:j2,1) = qa(i1:i2,j1:j2,1) - qdel + + do k = klid+1, km + dp = delp(i1:i2,j1:j2,k) + dpm1 = delp(i1:i2,j1:j2,k-1) + qsrc = qdel * dpm1 / dp + qdel = qa(i1:i2,j1:j2,k)*dt_settle*vsd(i1:i2,j1:j2,k)/dzd(i1:i2,j1:j2,k) + qa(i1:i2,j1:j2,k) = qa(i1:i2,j1:j2,k) - qdel + qsrc + enddo + + end do ! iit + +! Find the column dry mass after sedimentation and thus the loss flux +! do k = 1, km + do k = klid, km + do j = j1, j2 + do i = i1, i2 + cmass_after(i,j) = cmass_after(i,j) + qa(i,j,k)/ gravDP * delp(i,j,k) + enddo + enddo + enddo + + if( associated(fluxout) ) then + fluxout(i1:i2,j1:j2) & + = (cmass_before(i1:i2,j1:j2) - cmass_after(i1:i2,j1:j2))/cdt + endif + + +! w_c%qa(ibin)%data3d = qa + int_qa = qa + + rc = 0 + + end subroutine Chem_SettlingSimpleOrig + + +!============================================================================ +!BOP +! +! !IROUTINE: DryDeposition - Calculate aerosol dry deposition for lowest layer +! +! !INTERFACE: +! + + subroutine DryDeposition ( km, tmpu, rhoa, hghte, oro, ustar, pblh, shflux, & + von_karman, cpd, grav, z0h, drydepf, rc, & + radius, rhop, u10m, v10m, fraclake, gwettop ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! total model levels + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:), intent(in) :: rhoa ! air density [kg/m^3] + real, pointer, dimension(:,:,:), intent(in) :: hghte ! top of layer geopotential height [m] + real, pointer, dimension(:,:), intent(in) :: oro ! orography flag + real, pointer, dimension(:,:), intent(in) :: ustar ! friction speed [m/sec] + real, pointer, dimension(:,:), intent(in) :: pblh ! PBL height [m] + real, pointer, dimension(:,:), intent(in) :: shflux ! sfc. sens. heat flux [W m-2] + real, intent(in) :: von_karman ! Von Karman constant [unitless] + real, intent(in) :: cpd ! thermodynamic constant, specific heat of something? + real, intent(in) :: grav ! gravity [m/sec^2] + real, pointer, dimension(:,:) :: z0h ! rough height, sens. heat [m] + +! !OUTPUT PARAMETERS: + real, intent(inout) :: drydepf(:,:) ! Deposition frequency [1/sec] + integer, intent(out) :: rc ! Error return code: + +! !OPTIONAL PARAMETERS: +! If these parameters are provided we compute a "resuspension" term as +! if the particles are lifted like dust + real, optional :: radius ! particle radius [m] + real, optional :: rhop ! particle density [kg/m^3] + real, pointer, dimension(:,:), optional :: u10m ! 10-m u-wind component [m/sec] + real, pointer, dimension(:,:), optional :: v10m ! 10-m v-wind component [m/sec] + real, pointer, dimension(:,:), optional :: fraclake ! fraction covered by water [1] + real, pointer, dimension(:,:), optional :: gwettop ! fraction soil moisture [1] + + + +! !DESCRIPTION: Calculates the deposition velocity for aerosols in the lowest +! model layer. +! +! !REVISION HISTORY: +! +! 08Jan2010 - Colarco, based on GOCART implementation, does not +! include any size dependent deposition term + +! !Local Variables + character(len=*), parameter :: myname = 'DryDeposition' + integer, parameter :: DP=kind(1.0d0) + integer :: i, j + integer :: dims(3) + integer :: i1=1, i2, j1=1, j2 + real, parameter :: rhow = 1000. ! density of water [kg m-3] + real, parameter :: coll_size = 0.002 ! collector size [m] + real, allocatable :: dz(:,:) ! lowest layer thickness + real, allocatable :: rmu(:,:) ! dynamic viscosity [kg m-1 s-1] + real, allocatable :: Ra(:,:) ! aerodynamic resistance + real, allocatable :: Rs(:,:) ! surface resistance + real, allocatable :: vdep(:,:) ! Deposition speed [m s-1] + real, allocatable :: obk(:,:) ! Obukhov Length [m] + + real(kind=DP) :: Rttl ! total surface resistance + + real(kind=DP) :: R2, w10m, u_thresh0 + real(kind=DP) :: vds, vdsmax, czh + real(kind=DP) :: frac, cz, psi_h, eps, logmfrac, z0h_min, z0h_ + real(kind=DP) :: one = 1.0, zero = 0.0 +! +!EOP +!------------------------------------------------------------------------- +! Begin... + + dims = shape(rhoa) + i2 = dims(1); j2 = dims(2) + + allocate(dz(i2,j2),rmu(i2,j2),Ra(i2,j2),Rs(i2,j2),vdep(i2,j2), & + obk(i2,j2)) + +! Calculate the viscosity and thickness of the surface level + dz = hghte(:,:,km-1) - hghte(:,:,km) + rmu = 1.8325e-5*(416.16/(tmpu(i1:i2,j1:j2,km)+120.)) & + *(tmpu(i1:i2,j1:j2,km)/296.16)**1.5 + + z0h_min = 100. * tiny(1.0) ! because sometimes we may get z0h=0. + +! Calculate the Obukhov length scale +! ----------------------------------- + call ObukhovLength2G( i1, i2, j1, j2, von_karman, cpd, grav, & + tmpu(:,:,km), rhoa(:,:,km), shflux, ustar, & + obk ) +!print*,'DU sum(obk) = ',sum(obk) +! Aerodynamic Resistance +! psi_h and Ra are equations 2, 4-5 of Walcek et al. 1986 Atmospheric Environment +! ---------------------------- + do j = j1, j2 + do i = i1, i2 + + cz = dz(i,j) / 2. + frac = cz / obk(i,j) + if(frac .gt. 1.) frac = 1. + if(frac .gt. 0. .and. frac .le. 1.) then + psi_h = -5.0*frac + else if (frac .lt. 0.) then + eps = min(one,-frac) + logmfrac = log(eps) + psi_h = exp(0.598 + 0.39*logmfrac - 0.09*(logmfrac)**2.) + endif + + z0h_ = max ( z0h(i,j), z0h_min ) + + Ra(i,j) = (log(cz/z0h_) - psi_h) / (von_karman*ustar(i,j)) + + enddo + enddo + +! Surface Resistance term for aerosols +! Rs formulation from eqn. 15 - 18 of Walcek et al. 1986 Atmospheric Environment +! Loop over space +! ------------------------- + do j = j1, j2 + do i = i1, i2 + +! Calculate the surface resistance term + vds = 0.002*ustar(i,j) +! Set to small value of vds if ustar too small + vds = max(vds, 0.002 * 0.00001) + if(obk(i,j) .lt. 0.) vds = vds*(1.+(-300./obk(i,j))**0.6667) + czh = pblh(i,j)/obk(i,j) + if(czh .lt. -30.) vds = 0.0009*ustar(i,j)*(-czh)**0.6667 +! vdsMax is from Table 2 of Walcek et al. 1986 +! There are actually seasonal and regionally varying values, +! but for most of the world a value of 1.0 cm s-1 is used. + vdsMax = 0.01 + + Rs(i,j) = 1./min(vds,vdsmax) + + if(Rs(i,j) .gt. 9999.) Rs(i,j) = 9999. + if(Rs(i,j) .lt. 1.) Rs(i,j) = 1. + +! If doing dust over land, possibly re-emit +! Logic is to check on optional provided parameter and modify R2 + R2 = 1. + if(present(fraclake) .and. present(u10m) .and. present(v10m) .and. & + present(radius) .and. present(rhop) .and. present(gwettop)) then + +! Calculate the threshold velocity for dust emissions + u_thresh0 = 0.13 * sqrt(rhop*grav*2.*radius/rhoa(i,j,km)) & + * sqrt(1.+6.e-7/(rhop*grav*(2.*radius)**2.5)) & + / sqrt(1.928*(1331.*(100.*2.*radius)**1.56+0.38)**0.092 - 1.) + w10m = sqrt(u10m(i,j)**2. + v10m(i,j)**2.) + +! Calculate the coefficient for resuspension + if(oro(i,j) .eq. OCEAN) then + R2 = 1. + else + R2 = fraclake(i,j)+(1.-fraclake(i,j)) & + *( gwettop(i,j)+(1.-gwettop(i,j)) & + *exp(-max(zero,(w10m-u_thresh0)))) + endif + endif +! Now what is the deposition velocity + Rttl = Ra(i,j) + Rs(i,j) + + vdep(i,j) = 1./Rttl*R2 + +! Set a minimum value of deposition velocity + vdep(i,j) = max(vdep(i,j),1.e-4) + +!print*,'DU sum(vdep) = ',sum(vdep) +!print*,'DU sum(dz) = ',sum(dz) + +! Save the dry deposition frequency for the chemical removal terms +! in units of s-1 + drydepf(i,j) = max(0.,vdep(i,j) / dz(i,j)) + + end do ! i + end do ! j + +!print*,'DU sum(drydepf) = ', sum(drydepf) + + + rc = 0 + + end subroutine DryDeposition + +!==================================================================================== +! !IROUTINE: ObukhovLength - Calculate the Obukhov length scale stability parameter +! +! !INTERFACE: +! +! ========================================================================= +! Calculate the Obukhov length scale +! Wesely and Hicks (1977) Journal of Air Pollution Control Association +! Equation 9. Note: we have adopted this from GOCART, which neglected +! the latent heat of evaporation term. Also, we are using surface +! mid-layer values of air density and temperature, not absolute surface +! values (and not the potential temperature, either). + + subroutine ObukhovLength2G ( i1, i2, j1, j2, von_karman, cpd, grav, & + t, rhoa, shflux, ustar, & + obk ) + + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: i1, i2, j1, j2 + real, intent(in) :: von_karman ! Von Karman constant [unitless] + real, intent(in) :: cpd ! thermodynamic constant, specific heat of something? + real, intent(in) :: grav ! gravity [m/sec^2] + real, dimension(i1:i2,j1:j2) :: t ! temperature [K] + real, dimension(i1:i2,j1:j2) :: rhoa ! air density [kg/m^3] + real, pointer, dimension(:,:) :: ustar ! friction speed [m/sec] + real, pointer, dimension(:,:) :: shflux ! sfc. sens. heat flux [W/m^2] + +! !OUTPUT PARAMETERS + real, dimension(i1:i2,j1:j2) :: obk ! Obukhov length [m] + +! Local + +! Calculate the Monin-Obhukov length: +! -Air density * Cp * T(surface) * Ustar^3 +! OBK = ------------------------------------------- +! vK * g * Sensible heat flux +! vK = 0.4 von Karman constant +! Cp = 1000 J kg-1 K-1 specific heat of air at constant pressure +! If OBK < 0 the air is unstable; if OBK > 0 the air is stable +! For sensible heat flux of zero OBK goes to infinity (set to 1.e5) + + + obk = 1.e5 + where(abs(shflux) > 1.e-32) & + obk = - rhoa * cpd * t * ustar**3. & + / (von_karman * grav * shflux) + + return + end subroutine ObukhovLength2G + +!================================================================================== +!BOP + +! !IROUTINE: WetRemovalGOCART2G +!#if 0 + subroutine WetRemovalGOCART2G ( km, klid, n1, n2, bin_ind, cdt, aero_type, kin, grav, fwet, & + aerosol, ple, tmpu, rhoa, pfllsan, pfilsan, & + precc, precl, fluxout, rc ) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! total model levels + integer, intent(in) :: klid ! index for pressure lid + integer, intent(in) :: n1 ! total number of bins (probably can be removed) + integer, intent(in) :: n2 ! total number of bins (probably can be removed) + integer, intent(in) :: bin_ind ! bin index (usually the loop iteration) + real, intent(in) :: cdt ! chemistry model time-step [sec] + character(len=*) :: aero_type + logical, intent(inout) :: KIN ! true for aerosol + real, intent(in) :: grav ! gravity [m/sec^2] + real, intent(in) :: fwet + real, dimension(:,:,:), intent(inout) :: aerosol ! internal state aerosol [kg/kg] + real, pointer, dimension(:,:,:), intent(in) :: ple ! pressure level thickness [Pa] + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:), intent(in) :: rhoa ! moist air density [kg/m^3] + real, pointer, dimension(:,:,:), intent(in) :: pfllsan ! 3D flux of liquid nonconvective precipitation [kg/(m^2 sec)] + real, pointer, dimension(:,:,:), intent(in) :: pfilsan ! 3D flux of ice nonconvective precipitation [kg/(m^2 sec)] + real, pointer, dimension(:,:), intent(in) :: precc ! surface convective rain flux [kg/(m^2 sec)] + real, pointer, dimension(:,:), intent(in) :: precl ! Non-convective precipitation [kg/(m^2 sec)] + real, pointer, dimension(:,:,:) :: fluxout ! tracer loss flux [kg m-2 s-1] + +! !OUTPUT PARAMETERS: + integer, intent(out) :: rc ! Error return code: + +! !DESCRIPTION: Calculates the updated species concentration due to wet +! removal. As written, intended to function for large +! scale (not convective) wet removal processes +! +! !REVISION HISTORY: +! +! 08Jan2010 - Colarco, based on GOCART implementation, does not +! include any size dependent term +! +! !Local Variables + character(len=*), parameter :: myname = 'WetRemovalGOCART2G' + integer, parameter :: DP=kind(1.0d0) + integer :: i, j, k, n, LH, kk, ios, nbins + integer :: i1=1, i2, j1=1, j2, dims(3) +! real :: pdog(i1:i2,j1:j2,km) ! air mass factor dp/g [kg m-2] +! real :: delz(i1:i2,j1:j2,km) ! box height dp/g/rhoa [m] + real, allocatable, dimension(:,:,:) :: pdog ! air mass factor dp/g [kg m-2] + real, allocatable, dimension(:,:,:) :: delz ! box height dp/g/rhoa [m] + real :: pls, pcv, pac ! ls, cv, tot precip [mm day-1] + real :: qls(km), qcv(km) ! ls, cv portion of moisture tendency[kg m-3 s-1] + real :: qmx, qd, A ! temporary variables on moisture + real :: F, B, BT ! temporary variables on cloud, freq. + real :: WASHFRAC, WASHFRAC_F_14 + real, allocatable :: fd(:,:) ! flux across layers [kg m-2] + real, allocatable :: dpfli(:,:,:) ! vertical gradient of LS ice+rain precip flux + real, allocatable :: DC(:) ! scavenge change in mass mixing ratio +! real :: c_h2o(i1:i2,j1:j2,km), cldliq(i1:i2,j1:j2,km), cldice(i1:i2,j1:j2,km) + real, allocatable, dimension(:,:,:) :: c_h2o, cldliq, cldice + +! Rain parameters from Liu et al. + real, parameter :: B0_ls = 1.0e-4 + real, parameter :: F0_ls = 1.0 + real, parameter :: XL_ls = 5.0e-4 + real, parameter :: B0_cv = 1.5e-3 + real, parameter :: F0_cv = 0.3 + real, parameter :: XL_cv = 2.0e-3 + real, parameter :: k_wash = 1.d0 ! first order washout rate, constant, [cm^-1] +! Duration of rain: ls = model timestep, cv = 1800 s (<= cdt) + real :: Td_ls + real, parameter :: Td_cv = 1800. + real(kind=DP), PARAMETER :: R = 8.2057d-2 ! universal gas constant [L*atm/moles/K] + real(kind=DP), PARAMETER :: INV_T0 = 1d0 / 298d0 + real(kind=DP), PARAMETER :: conv_NH3 = 5.69209978831d-1 ! 0.6*SQRT(0.9) for ice to gas ratio + real(kind=DP) :: k_rain, Kstar298, H298_R, I2G, L2G, C_TOT, F_L, F_I + real(kind=DP) :: PP, LP + + logical :: snow_scavenging + +! Efficiency of dust wet removal (since dust is really not too hygroscopic) +! Applied only to in-cloud scavenging + real :: effRemoval + + rc=0 + +!EOP +!----------------------------------------------------------------------------- +! Begin... + + dims = shape(rhoa) + i2 = dims(1); j2 = dims(2) + +! Allocate arrays + allocate(c_h2o(i2,j2,km), cldliq(i2,j2,km), cldice(i2,j2,km), pdog(i2,j2,km), & + delz(i2,j2,km), dpfli(i2,j2,km)) + +! Initialize local variables +! -------------------------- +! c_h2o, cldliq, and cldice are respectively intended to be the +! water mixing ratio (liquid or vapor?, in or out of cloud?) +! cloud liquid water mixing ratio +! cloud ice water mixing ratio + c_h2o = (10d0**(-2663.5d0/tmpu(:,:,:) + 12.537d0 ) ) / & + (ple(:,:,0:km-1)+ple(:,:,1:km)) /2d0 + cldliq = 0.d0 + where(tmpu > 248.) cldliq = 1.d-6 * ( ( tmpu - 248.d0) / 20.d0 ) + where(tmpu >= 268.) cldliq = 1.d-6 + cldice = 1.d-6 - cldliq + + Td_ls = cdt + nbins = n2-n1+1 + + allocate(fd(km,nbins),stat=ios) + allocate(dc(nbins),stat=ios) + +! if( associated(fluxout%data2d) ) fluxout%data2d(i1:i2,j1:j2) = 0.0 + if( associated(fluxout) ) fluxout(i1:i2,j1:j2,bin_ind) = 0.0 + +! Accumulate the 3-dimensional arrays of rhoa and pdog + pdog = (ple(:,:,1:km)-ple(:,:,0:km-1)) / grav + delz = pdog / rhoa + dpfli = pfllsan(:,:,1:km)-pfllsan(:,:,0:km-1)+pfilsan(:,:,1:km)-pfilsan(:,:,0:km-1) + if (.not. KIN) then ! Gases + if (aero_type == 'NH3') then ! Only for NH3 at present + ! values adopted in Umich/IMPACT and GMI, effective Henry's law coefficient at pH=5 + Kstar298 = 1.05d6 + H298_R = -4.2d3 + else + print *, 'stop in WetRemoval, need Kstar298 and H298_R' + stop + endif + endif + + +! Snow scavenging flag + snow_scavenging = .true. + + if ( (aero_type == 'OC' ) .or. & + (aero_type == 'sea_salt') .or. & + (aero_type == 'sulfur' ) .or. & + (aero_type == 'seasalt' ) .or. & + (aero_type == 'sulfate' ) .or. & + (aero_type == 'NH3' ) .or. & + (aero_type == 'NH4a' ) .or. & + (aero_type == 'nitrate' ) .or. & + (aero_type == 'bromine' ) .or. & + (aero_type == 'dust' ) ) then + snow_scavenging = .false. + end if + +! Loop over spatial indices + do j = j1, j2 + do i = i1, i2 + +! Check for total precipitation amount +! Assume no precip in column if precl+precc = 0 + pac = precl(i,j) + precc(i,j) + if(pac .le. 0.) goto 100 + pls = precl(i,j) + pcv = precc(i,j) + +! Initialize the precipitation fields + qls(:) = 0. + qcv(:) = 0. + fd(:,:) = 0. + +! Find the highest model layer experiencing rainout. Assumes no +! scavenging if T < 258 K + LH = 0 +! do k = 1, km + do k = klid, km + if(dpfli(i,j,k) .gt. 0. ) then + LH = k + goto 15 + endif + end do + 15 continue + if(LH .lt. 1) goto 100 + + do k = LH, km + qls(k) = dpfli(i,j,k)/pdog(i,j,k)*rhoa(i,j,k) + end do + +! Loop over vertical to do the scavenging! + do k = LH, km + +!----------------------------------------------------------------------------- +! (1) LARGE-SCALE RAINOUT: +! Tracer loss by rainout = TC0 * F * exp(-B*dt) +! where B = precipitation frequency, +! F = fraction of grid box covered by precipitating clouds. +! We assume that tracer scavenged by rain is falling down to the +! next level, where a fraction could be re-evaporated to gas phase +! if Qls is less then 0 in that level. +!----------------------------------------------------------------------------- + if (qls(k) .gt. 0.) then + F = F0_ls / (1. + F0_ls*B0_ls*XL_ls/(qls(k)*cdt/Td_ls)) + k_rain = B0_ls/F0_ls +1./(F0_ls*XL_ls/qls(k)) + if ( kin ) then ! Aerosols + B = k_rain + else ! Gases + ! ice to gas ratio + if ( c_h2o(i,j,k) > 0.d0) then + I2G = (cldice(i,j,k) / c_h2o(i,j,k)) * conv_NH3 + else + I2G = 0.d0 + endif + L2G = cldliq(i,j,k) * R * tmpu(i,j,k) * & + Kstar298 * EXP( -H298_R * ( ( 1d0 / tmpu(i,j,k) ) - INV_T0 ) ) + ! fraction of NH3 in liquid & ice phases + C_TOT = 1d0 + L2G + I2G + F_L = L2G / C_TOT + F_I = I2G / C_TOT + ! compute kg, the retention factor for liquid NH3 is 0 at T < 248K and + ! 0.05 at 248K < T < 268K + if (tmpu(i,j,k) >=268d0) then + B = k_rain * ( F_L+F_I ) + elseif ( (248d0 < tmpu(i,j,k)) .and. (tmpu(i,j,k) < 268d0) ) then + B = k_rain * ( (0.05*F_L)+F_I ) + else + B = k_rain * F_I + endif + endif ! kin + BT = B * Td_ls + if (BT.gt.10.) BT = 10. !< Avoid overflow > +! Adjust du level: + do n = 1, nbins +! supress scavenging at cold T except for HNO3 + if (tmpu(i,j,k) < 258d0 .and. .not.snow_scavenging) then + F = 0.d0 + endif + + effRemoval = fwet +! DC(n) = qa(n1+n-1)%data3d(i,j,k) * F * effRemoval *(1.-exp(-BT)) + DC(n) = aerosol(i,j,k) * F * effRemoval *(1.-exp(-BT)) + if (DC(n).lt.0.) DC(n) = 0. +! qa(n1+n-1)%data3d(i,j,k) = qa(n1+n-1)%data3d(i,j,k)-DC(n) + aerosol(i,j,k) = aerosol(i,j,k)-DC(n) +! if (qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + if (aerosol(i,j,k) .lt. 1.0E-32) aerosol(i,j,k) = 1.0E-32 + end do +! Flux down: unit is kg m-2 +! Formulated in terms of production in the layer. In the revaporation step +! we consider possibly adding flux from above... + do n = 1, nbins + Fd(k,n) = DC(n)*pdog(i,j,k) + end do + + end if ! if Qls > 0 >>> + +!----------------------------------------------------------------------------- +! * (2) LARGE-SCALE WASHOUT: +! * Occurs when rain at this level is less than above. +!----------------------------------------------------------------------------- + if(k .gt. LH .and. qls(k) .ge. 0.) then + if(qls(k) .lt. qls(k-1)) then +! Find a maximum F overhead until the level where Qls<0. + Qmx = 0. + do kk = k-1,LH,-1 + if (Qls(kk).gt.0.) then + Qmx = max(Qmx,Qls(kk)) + else + goto 333 + end if + end do + + 333 continue + F = F0_ls / (1. + F0_ls*B0_ls*XL_ls/(Qmx*cdt/Td_ls)) + ! if (MAPL_AM_I_ROOT()) then + ! print *, 'hbianwdep WASHFmax =',F + ! endif + if (F.lt.0.01) F = 0.01 +!----------------------------------------------------------------------------- +! The following is to convert Q(k) from kgH2O/m3/sec to mm/sec in order +! to use the Harvard formula. Convert back to mixing ratio by multiplying +! by rhoa. Multiply by pdog gives kg/m2/s of precip. Divide by density +! of water (=1000 kg/m3) gives m/s of precip and multiply by 1000 gives +! units of mm/s (omit the multiply and divide by 1000). +!----------------------------------------------------------------------------- + +! Aerosols + Qd = Qmx /rhoa(i,j,k)*pdog(i,j,k) + if (Qd.ge.50.) then + B = 0. + else + B = Qd * 0.1 + end if + BT = B * cdt + if (BT.gt.10.) BT = 10. + +! Gases + if ( .not. KIN ) then + IF ( tmpu(i,j,k) >= 268d0 ) THEN + !------------------------ + ! T >= 268K: Do washout + !------------------------ + ! Rainwater content in the grid box (Eq. 17, Jacob et al, 2000) + PP = (PFLLSAN(i,j,k)/1000d0 + PFILSAN(i,j,k)/917d0 )*100d0 ! from kg H2O/m2/s to cm3 H2O/cm2/s + LP = ( PP * cdt ) / ( F * delz(i,j,k)*100.d0 ) ! DZ*100.d0 in cm + ! Compute liquid to gas ratio for H2O2, using the appropriate + ! parameters for Henry's law -- also use rainwater content Lp + ! (Eqs. 7, 8, and Table 1, Jacob et al, 2000) + !CALL COMPUTE_L2G( Kstar298, H298_R, tmpu(i,j,k), LP, L2G ) + L2G = Kstar298 * EXP( -H298_R*((1d0/tmpu(i,j,k))-INV_T0) ) & + * LP * R * tmpu(i,j,k) + ! Washout fraction from Henry's law (Eq. 16, Jacob et al, 2000) + WASHFRAC = L2G / ( 1d0 + L2G ) + ! Washout fraction / F from Eq. 14, Jacob et al, 2000 + ! Note: WASHFRAC_F_14 should match what's used for HNO3 (hma, 13aug2011) + WASHFRAC_F_14 = 1d0 - EXP( -K_WASH * ( PP / F ) * cdt ) + ! Do not let the Henry's law washout fraction exceed + IF ( WASHFRAC > WASHFRAC_F_14 ) THEN + WASHFRAC = WASHFRAC_F_14 + ENDIF + ELSE + !------------------------ + ! T < 268K: No washout + !------------------------ + WASHFRAC = 0d0 + ENDIF + endif + +! Adjust du level: + do n = 1, nbins + if ( KIN ) then +! DC(n) = qa(n1+n-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + DC(n) = aerosol(i,j,k) * F * (1.-exp(-BT)) + else +! DC(n) = qa(n1+n-1)%data3d(i,j,k) * F * WASHFRAC + DC(n) = aerosol(i,j,k) * F * WASHFRAC + endif + if (DC(n).lt.0.) DC(n) = 0. +! qa(n1+n-1)%data3d(i,j,k) = qa(n1+n-1)%data3d(i,j,k)-DC(n) + aerosol(i,j,k) = aerosol(i,j,k)-DC(n) +! if (qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) & + if (aerosol(i,j,k) .lt. 1.0E-32) & + aerosol(i,j,k) = 1.0E-32 +! if( associated(fluxout%data2d) ) then + if( associated(fluxout)) then +! fluxout%data2d(i,j) = fluxout%data2d(i,j)+DC(n)*pdog(i,j,k)/cdt + fluxout(i,j,bin_ind) = fluxout(i,j,bin_ind)+DC(n)*pdog(i,j,k)/cdt + + endif + end do + + end if + end if ! if ls washout >>> + +!----------------------------------------------------------------------------- +! (3) CONVECTIVE RAINOUT: +! Tracer loss by rainout = dd0 * F * exp(-B*dt) +! where B = precipitation frequency, +! F = fraction of grid box covered by precipitating clouds. +!----------------------------------------------------------------------------- + + if (qcv(k) .gt. 0.) then + F = F0_cv / (1. + F0_cv*B0_cv*XL_cv/(Qcv(k)*cdt/Td_cv)) + B = B0_cv + BT = B * Td_cv + if (BT.gt.10.) BT = 10. !< Avoid overflow > + +! Adjust du level: + do n = 1, nbins +! effRemoval = qa(n1+n-1)%fwet + effRemoval = fwet +! DC(n) = qa(n1+n-1)%data3d(i,j,k) * F * effRemoval * (1.-exp(-BT)) + DC(n) = aerosol(i,j,k) * F * effRemoval * (1.-exp(-BT)) + if (DC(n).lt.0.) DC(n) = 0. +! qa(n1+n-1)%data3d(i,j,k) = qa(n1+n-1)%data3d(i,j,k)-DC(n) + aerosol(i,j,k) = aerosol(i,j,k)-DC(n) +! if (qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + if (aerosol(i,j,k) .lt. 1.0E-32) aerosol(i,j,k) = 1.0E-32 + end do + +!------ Flux down: unit is kg. Including both ls and cv. + do n = 1, nbins + Fd(k,n) = Fd(k,n) + DC(n)*pdog(i,j,k) + end do + + end if ! if Qcv > 0 >>> + +!----------------------------------------------------------------------------- +! (4) CONVECTIVE WASHOUT: +! Occurs when rain at this level is less than above. +!----------------------------------------------------------------------------- + + if (k.gt.LH .and. Qcv(k).ge.0.) then + if (Qcv(k).lt.Qcv(k-1)) then +!----- Find a maximum F overhead until the level where Qls<0. + Qmx = 0. + do kk = k-1, LH, -1 + if (Qcv(kk).gt.0.) then + Qmx = max(Qmx,Qcv(kk)) + else + goto 444 + end if + end do + + 444 continue + F = F0_cv / (1. + F0_cv*B0_cv*XL_cv/(Qmx*cdt/Td_cv)) + if (F.lt.0.01) F = 0.01 + +!----------------------------------------------------------------------------- +! The following is to convert Q(k) from kgH2O/m3/sec to mm/sec in order +! to use the Harvard formula. Convert back to mixing ratio by multiplying +! by rhoa. Multiply by pdog gives kg/m2/s of precip. Divide by density +! of water (=1000 kg/m3) gives m/s of precip and multiply by 1000 gives +! units of mm/s (omit the multiply and divide by 1000). +!----------------------------------------------------------------------------- + + Qd = Qmx / rhoa(i,j,k)*pdog(i,j,k) + if (Qd.ge.50.) then + B = 0. + else + B = Qd * 0.1 + end if + BT = B * cdt + if (BT.gt.10.) BT = 10. + +! Adjust du level: + do n = 1, nbins +! DC(n) = qa(n1+n-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + DC(n) = aerosol(i,j,k) * F * (1.-exp(-BT)) + if (DC(n).lt.0.) DC(n) = 0. +! qa(n1+n-1)%data3d(i,j,k) = qa(n1+n-1)%data3d(i,j,k)-DC(n) + aerosol(i,j,k) = aerosol(i,j,k)-DC(n) +! if (qa(n1+n-1)%data3d(i,j,k) .lt. 1.0E-32) & + if (aerosol(i,j,k) .lt. 1.0E-32) & +! qa(n1+n-1)%data3d(i,j,k) = 1.0E-32 + aerosol(i,j,k) = 1.0E-32 + if( associated(fluxout)) then + fluxout(i,j,bin_ind) = fluxout(i,j,bin_ind)+DC(n)*pdog(i,j,k)/cdt + endif + end do + + end if + end if ! if cv washout >>> + +!----------------------------------------------------------------------------- +! (5) RE-EVAPORATION. Assume that SO2 is re-evaporated as SO4 since it +! has been oxidized by H2O2 at the level above. +!----------------------------------------------------------------------------- +! Add in the flux from above, which will be subtracted if reevaporation occurs + if(k .gt. LH) then + do n = 1, nbins + Fd(k,n) = Fd(k,n) + Fd(k-1,n) + end do + +! Is there evaporation in the currect layer? + if (dpfli(i,j,k) .lt. 0.) then +! Fraction evaporated = H2O(k)evap / H2O(next condensation level). + if (dpfli(i,j,k-1) .gt. 0.) then + + A = abs( dpfli(i,j,k) / dpfli(i,j,k-1) ) + if (A .gt. 1.) A = 1. + +! Adjust tracer in the level + do n = 1, nbins + DC(n) = Fd(k-1,n) / pdog(i,j,k) * A +! qa(n1+n-1)%data3d(i,j,k) = qa(n1+n-1)%data3d(i,j,k) + DC(n) + aerosol(i,j,k) = aerosol(i,j,k) + DC(n) +! qa(n1+n-1)%data3d(i,j,k) = max(qa(n1+n-1)%data3d(i,j,k),1.e-32) + aerosol(i,j,k) = max(aerosol(i,j,k),1.e-32) +! Adjust the flux out of the bottom of the layer + Fd(k,n) = Fd(k,n) - DC(n)*pdog(i,j,k) + end do + + endif + endif ! if -moistq < 0 + endif + end do ! k + + + do n = 1, nbins +! if( associated(fluxout%data2d) ) then + if( associated(fluxout)) then +! fluxout%data2d(i,j) = fluxout%data2d(i,j)+Fd(km,n)/cdt + fluxout(i,j,bin_ind) = fluxout(i,j,bin_ind)+Fd(km,n)/cdt + endif + end do + + 100 continue + end do ! i + end do ! j + + deallocate(fd,DC,dpfli,stat=ios) + + end subroutine WetRemovalGOCART2G + +!============================================================================= +!BOP + +! !IROUTINE: UpdateAerosolState + subroutine UpdateAerosolState (emissions, emissions_surface, emissions_point, & + sfrac, nPts, km, cdt, grav, nbins, delp, aero, rc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + real, pointer, dimension(:,:) :: emissions_surface + real, dimension(:,:,:,:), intent(inout) :: emissions + real, dimension(:,:,:), intent(in) :: emissions_point + + real, dimension(:), intent(in) :: sfrac ! source fraction [1] + integer, intent(in) :: nPts ! number of point emissions + integer, intent(in) :: km ! total model levels + real, intent(in) :: cdt ! chemistry model time-step [sec] + real, intent(in) :: grav ! gravity [m/sec^2] + integer, intent(in) :: nbins ! number of aerosol size bins + real, pointer, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, pointer, dimension(:,:,:,:), intent(inout) :: aero ! aerosol [kg/kg] + +! !OUTPUT PARAMETERS: + integer, intent(out) :: rc ! Error return code: + +! !DESCRIPTION: Updates internal state variables +! +! !REVISION HISTORY: +! +! 15May2020 - E.Sherman +! +! !Local Variables + integer :: n, kmin + + +!EOP +!-------------------------------------------------------------------------------- +! Begin... + + rc = 0 + + do n = 1, nbins + emissions(:,:,km,n) = emissions_surface * sfrac(n) + if (nPts > 0) then + kmin = 1 + emissions(:,:,:,n) = emissions(:,:,:,n) + emissions_point * sfrac(n) + else + kmin = km + end if + aero(:,:,kmin:km,n) = aero(:,:,kmin:km,n) + emissions(:,:,kmin:km,n) * & + cdt * grav / delp(:,:,kmin:km) + end do + + end subroutine UpdateAerosolState + +!============================================================================== + +!BOP +! +! !IROUTINE: Aero_Compute_Diags - Calculate aerosol diagnostics +! +! !INTERFACE: +! + + subroutine Aero_Compute_Diags (mie_table, km, klid, nbegin, nbins, rlow, rup, channels, & + aerosol, grav, tmpu, rhoa, rh, u, v, delp, & + sfcmass, colmass, mass, exttau, scatau, & + sfcmass25, colmass25, mass25, exttau25, scatau25, & + fluxu, fluxv, conc, extcoef, scacoef, & + exttaufm, scataufm, angstrom, aerindx, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + type(Chem_Mie), intent(in) :: mie_table ! mie table + integer, intent(in) :: km, nbegin, nbins + integer, intent(in) :: klid ! index for pressure lid + real, optional, dimension(:), intent(in) :: rlow ! bin radii - low bounds + real, optional, dimension(:), intent(in) :: rup ! bin radii - upper bounds + real, dimension(:), intent(in) :: channels +! real, pointer, dimension(:,:,:,:) :: aerosol ! + real, dimension(:,:,:,:), intent(inout) :: aerosol ! + real, intent(in) :: grav + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:), intent(in) :: rhoa ! air density [kg/m^3] + real, pointer, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, pointer, dimension(:,:,:), intent(in) :: rh ! relative humidity [1] + real, pointer, dimension(:,:,:), intent(in) :: u ! east-west wind [m/s] + real, pointer, dimension(:,:,:), intent(in) :: v ! north-south wind [m/s] + + +! !OUTPUT PARAMETERS: +! Total mass + real, optional, pointer, dimension(:,:), intent(inout) :: sfcmass ! sfc mass concentration kg/m3 + real, optional, pointer, dimension(:,:), intent(inout) :: colmass ! col mass density kg/m2 + real, pointer, dimension(:,:,:), intent(inout) :: mass ! 3d mass mixing ratio kg/kg + real, pointer, dimension(:,:,:), intent(inout) :: conc ! 3d mass concentration, kg/m3 +! Total optical properties + real, optional, pointer, dimension(:,:), intent(inout) :: exttau ! ext. AOT at 550 nm + real, optional, pointer, dimension(:,:), intent(inout) :: scatau ! sct. AOT at 550 nm + real, optional, pointer, dimension(:,:), intent(inout) :: sfcmass25 ! sfc mass concentration kg/m3 (pm2.5) + real, optional, pointer, dimension(:,:), intent(inout) :: colmass25 ! col mass density kg/m2 (pm2.5) + real, optional, pointer, dimension(:,:,:), intent(inout) :: mass25 ! 3d mass mixing ratio kg/kg (pm2.5) + real, optional, pointer, dimension(:,:), intent(inout) :: exttau25 ! ext. AOT at 550 nm (pm2.5) + real, optional, pointer, dimension(:,:), intent(inout) :: scatau25 ! sct. AOT at 550 nm (pm2.5) + real, optional, pointer, dimension(:,:), intent(inout) :: aerindx ! TOMS UV AI + real, optional, pointer, dimension(:,:), intent(inout) :: fluxu ! Column mass flux in x direction + real, optional, pointer, dimension(:,:), intent(inout) :: fluxv ! Column mass flux in y direction + real, optional, pointer, dimension(:,:,:), intent(inout) :: extcoef ! 3d ext. coefficient, 1/m + real, optional, pointer, dimension(:,:,:), intent(inout) :: scacoef ! 3d scat.coefficient, 1/m + real, optional, pointer, dimension(:,:), intent(inout) :: exttaufm ! fine mode (sub-micron) ext. AOT at 550 nm + real, optional, pointer, dimension(:,:), intent(inout) :: scataufm ! fine mode (sub-micron) sct. AOT at 550 nm + real, optional, pointer, dimension(:,:), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter + integer, optional, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Calculates some simple 2d diagnostics from the dust fields +! +! !REVISION HISTORY: +! +! 16APR2004, Colarco +! 11MAR2010, Nowottnick +! 11AUG2020, E.Sherman - refactored to work for multiple aerosols + +! !Local Variables + character(len=*), parameter :: myname = 'Aero_Compute_Diags' + integer :: i, j, k, n, ios, nch + integer :: i1 =1, i2, j1=1, j2 + real :: ilam550, ilam470, ilam870 + real :: tau, ssa + real :: fPMfm(nbins) ! fraction of bin with particles diameter < 1.0 um + real :: fPM25(nbins) ! fraction of bin with particles diameter < 2.5 um + logical :: do_angstrom + real, dimension(:,:), allocatable :: tau470, tau870 + +!EOP +!------------------------------------------------------------------------- +! Begin... + +! Initialize local variables +! -------------------------- + nch = size(channels) + i2 = size(rhoa,1) + j2 = size(rhoa,2) + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + ilam470 = 0. + ilam870 = 0. + if(nch .gt. 1) then + do i = 1, nch + if ( channels(i) .ge. 5.49e-7 .and. & + channels(i) .le. 5.51e-7) ilam550 = i + if ( channels(i) .ge. 4.69e-7 .and. & + channels(i) .le. 4.71e-7) ilam470 = i + if ( channels(i) .ge. 8.69e-7 .and. & + channels(i) .le. 8.71e-7) ilam870 = i + enddo + endif + +! Determine if going to do Angstrom parameter calculation +! ------------------------------------------------------- + do_angstrom = .false. +! If both 470 and 870 channels provided (and not the same) then +! possibly will do Angstrom parameter calculation + if(ilam470 .ne. 0. .and. & + ilam870 .ne. 0. .and. & + ilam470 .ne. ilam870) do_angstrom = .true. + + if( present(angstrom) .and. associated(angstrom) .and. do_angstrom ) then + allocate(tau470(i1:i2,j1:j2), tau870(i1:i2,j1:j2)) + end if + +! Compute the fine mode (sub-micron) and PM2.5 bin-wise fractions +! ------------------------------------ + if (present(rlow) .and. present(rup)) then + call Aero_Binwise_PM_Fractions(fPMfm, 0.50, rlow, rup, nbins) ! 2*r < 1.0 um + call Aero_Binwise_PM_Fractions(fPM25, 1.25, rlow, rup, nbins) ! 2*r < 2.5 um + end if + + if (present(aerindx) .and. associated(aerindx)) aerindx = 0.0 ! for now + +! Calculate the diagnostic variables if requested +! ----------------------------------------------- +! Calculate the surface mass concentration + if( present(sfcmass) .and. associated(sfcmass) ) then + sfcmass(i1:i2,j1:j2) = 0. + do n = nbegin, nbins + sfcmass(i1:i2,j1:j2) & + = sfcmass(i1:i2,j1:j2) & + + aerosol(i1:i2,j1:j2,km,n)*rhoa(i1:i2,j1:j2,km) + end do + endif + if( present(sfcmass25) .and. associated(sfcmass25) ) then + sfcmass25(i1:i2,j1:j2) = 0. + do n = nbegin, nbins + sfcmass25(i1:i2,j1:j2) & + = sfcmass25(i1:i2,j1:j2) & + + aerosol(i1:i2,j1:j2,km,n)*rhoa(i1:i2,j1:j2,km)*fPM25(n) + end do + endif + +! Calculate the aerosol column loading + if( present(colmass) .and. associated(colmass) ) then + colmass(i1:i2,j1:j2) = 0. + do n = nbegin, nbins + do k = klid, km + colmass(i1:i2,j1:j2) & + = colmass(i1:i2,j1:j2) & + + aerosol(i1:i2,j1:j2,k,n)*delp(i1:i2,j1:j2,k)/grav + end do + end do + endif + if( present(colmass25) .and. associated(colmass25)) then + colmass25(i1:i2,j1:j2) = 0. + do n = nbegin, nbins + do k = klid, km + colmass25(i1:i2,j1:j2) & + = colmass25(i1:i2,j1:j2) & + + aerosol(i1:i2,j1:j2,k,n)*delp(i1:i2,j1:j2,k)/grav*fPM25(n) + end do + end do + endif + +! Calculate the total mass concentration + if( associated(conc) ) then + conc(i1:i2,j1:j2,1:km) = 0. + do n = nbegin, nbins + conc(i1:i2,j1:j2,1:km) & + = conc(i1:i2,j1:j2,1:km) & + + aerosol(i1:i2,j1:j2,1:km,n)*rhoa(i1:i2,j1:j2,1:km) + end do + endif + +! Calculate the total mass mixing ratio + if( associated(mass) ) then + mass(i1:i2,j1:j2,1:km) = 0. + do n = nbegin, nbins + mass(i1:i2,j1:j2,1:km) & + = mass(i1:i2,j1:j2,1:km) & + + aerosol(i1:i2,j1:j2,1:km,n) + end do + endif + if( present(mass25) .and. associated(mass25) ) then + mass25(i1:i2,j1:j2,1:km) = 0. + do n = nbegin, nbins + mass25(i1:i2,j1:j2,1:km) & + = mass25(i1:i2,j1:j2,1:km) & + + aerosol(i1:i2,j1:j2,1:km,n)*fPM25(n) + end do + endif + +! Calculate the column mass flux in x direction + if( present(fluxu) .and. associated(fluxu) ) then + fluxu(i1:i2,j1:j2) = 0. + do n = nbegin, nbins + do k = klid, km + fluxu(i1:i2,j1:j2) & + = fluxu(i1:i2,j1:j2) & + + aerosol(i1:i2,j1:j2,k,n)*delp(i1:i2,j1:j2,k)/grav*u(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the column mass flux in y direction + if( present(fluxv) .and. associated(fluxv) ) then + fluxv(i1:i2,j1:j2) = 0. + do n = nbegin, nbins + do k = klid, km + fluxv(i1:i2,j1:j2) & + = fluxv(i1:i2,j1:j2) & + + aerosol(i1:i2,j1:j2,k,n)*delp(i1:i2,j1:j2,k)/grav*v(i1:i2,j1:j2,k) + end do + end do + endif + +! Calculate the extinction and/or scattering AOD + if( (present(exttau) .and. associated(exttau)) .or. & + (present(scatau) .and. associated(scatau)) ) then + +! if( associated(exttau)) exttau(i1:i2,j1:j2) = 0. +! if( associated(scatau)) scatau(i1:i2,j1:j2) = 0. + exttau = 0. + scatau = 0. + + if( present(exttau25) .and. associated(exttau25)) exttau25(i1:i2,j1:j2) = 0. + if( present(scatau25) .and. associated(scatau25)) scatau25(i1:i2,j1:j2) = 0. + + if( present(exttaufm) .and. associated(exttaufm)) exttaufm(i1:i2,j1:j2) = 0. + if( present(scataufm) .and. associated(scataufm)) scataufm(i1:i2,j1:j2) = 0. + + if( present(extcoef) .and. associated(extcoef)) extcoef(i1:i2,j1:j2,1:km) = 0. + if( present(scacoef) .and. associated(scacoef)) scacoef(i1:i2,j1:j2,1:km) = 0. + +!print*,'TEST 11' + + do n = nbegin, nbins + +! Select the name for species + do k = klid, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(mie_table, n, ilam550, & + aerosol(i,j,k,n)*delp(i,j,k)/grav, & + rh(i,j,k), tau=tau, ssa=ssa) + +! Calculate the total ext. and scat. coefficients + if( present(extcoef) .and. associated(extcoef) ) then + extcoef(i,j,k) = extcoef(i,j,k) + & + tau * (grav * rhoa(i,j,k) / delp(i,j,k)) + endif + if( present(scacoef) .and. associated(scacoef) ) then + scacoef(i,j,k) = scacoef(i,j,k) + & + ssa * tau * (grav * rhoa(i,j,k) / delp(i,j,k)) + endif + +! Integrate in the vertical + if( present(exttau) .and. associated(exttau) ) exttau(i,j) = exttau(i,j) + tau + if( present(exttaufm) .and. associated(exttaufm)) & + exttaufm(i,j) = exttaufm(i,j) + tau*fPMfm(n) + if( present(exttau25) .and. associated(exttau25)) & + exttau25(i,j) = exttau25(i,j) + tau*fPM25(n) + + if( present(scatau) .and. associated(scatau) ) scatau(i,j) = scatau(i,j) + tau*ssa + if( present(scataufm) .and. associated(scataufm) ) & + scataufm(i,j) = scataufm(i,j) + tau*ssa*fPMfm(n) + if( present(scatau25) .and. associated(scatau25) ) & + scatau25(i,j) = scatau25(i,j) + tau*ssa*fPM25(n) + + enddo + enddo + enddo + + enddo ! nbins + + endif + +! Calculate the 470-870 Angstrom parameter + if( present(angstrom) .and. associated(angstrom) .and. do_angstrom ) then + + angstrom(i1:i2,j1:j2) = 0. +! Set tau to small number by default + tau470(i1:i2,j1:j2) = tiny(1.0) + tau870(i1:i2,j1:j2) = tiny(1.0) + + do n = nbegin, nbins + +! Select the name for species + do k = klid, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(mie_table, n, ilam470, & + aerosol(i,j,k,n)*delp(i,j,k)/grav, & + rh(i,j,k), tau=tau) + tau470(i,j) = tau470(i,j) + tau + + call Chem_MieQuery(mie_table, n, ilam870, & + aerosol(i,j,k,n)*delp(i,j,k)/grav, & + rh(i,j,k), tau=tau) + tau870(i,j) = tau870(i,j) + tau + enddo + enddo + enddo + + enddo ! nbins + + angstrom(i1:i2,j1:j2) = & + -log(tau470(i1:i2,j1:j2)/tau870(i1:i2,j1:j2)) / & + log(470./870.) + endif + + rc = 0 + + end subroutine Aero_Compute_Diags +!==================================================================== + +!BOP +! +! !IROUTINE: Aero_Binwise_PM_Fractions - Calculate bin-wise PM fractions +! +! !INTERFACE: + subroutine Aero_Binwise_PM_Fractions(fPM, rPM, r_low, r_up, nbins) + +! !USES: + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + real, dimension(:), intent(inout) :: fPM ! bin-wise PM fraction (r < rPM) + +! !INPUT PARAMETERS: + real, intent(in) :: rPM ! PM radius + integer, intent(in) :: nbins ! number of bins + real, dimension(:), intent(in) :: r_low ! bin radii - low bounds + real, dimension(:), intent(in) :: r_up ! bin radii - upper bounds + +! !Local Variables + + integer :: n + + character(len=*), parameter :: myname = 'Aero_Binwise_PM_Fractions' +!EOP +!------------------------------------------------------------------------- +! Begin... + + do n = 1, nbins + if(r_up(n) < rPM) then + fPM(n) = 1.0 + else + if(r_low(n) < rPM) then +! Assume dm/dlnr = constant, i.e., dm/dr ~ 1/r + fPM(n) = log(rPM/r_low(n)) / log(r_up(n)/r_low(n)) + else + fPM(n) = 0.0 + endif + endif + enddo + + end subroutine Aero_Binwise_PM_Fractions + +!====================================================================================== + +!BOP +! +! !IROUTINE: deepLakesMask +! +! !INTERFACE: + subroutine deepLakesMask (lons, lats, radToDeg, deep_lakes_mask, rc) + +! !USES: + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + real, dimension(:,:), intent(inout) :: deep_lakes_mask + +! !INPUT PARAMETERS: + real, pointer, dimension(:,:), intent(in) :: lats ! latitude [radians] + real, pointer, dimension(:,:), intent(in) :: lons ! longtitude [radians] + real, intent(in) :: radToDeg + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc +!EOP + +! !Local Variables + real :: dummylon + integer :: i, j +!EOP +!------------------------------------------------------------------------- +! Begin... + + rc = 0 + + deep_lakes_mask = 1.0 + do j = 1, ubound(lons, 2) + do i = 1, ubound(lons, 1) + dummylon = lons(i,j)*radToDeg + if( dummylon < 0.0 ) dummylon = dummylon + 360.0 + ! The Great Lakes: lon = [91W,75W], lat = [40.5N, 50N] + if ((dummylon > 267.0) .and. & + (dummylon < 285.0) .and. & + (lats(i,j)*radToDeg > 40.5) .and. & + (lats(i,j)*radToDeg < 50.0)) deep_lakes_mask(i,j) = 0.0 + + ! The Caspian Sea: lon = [45.0, 56], lat = 35, 48] + if ((dummylon > 45.0) .and. & + (dummylon < 56.0) .and. & + (lats(i,j)*radToDeg > 35.0) .and. & + (lats(i,j)*radToDeg < 48.0)) deep_lakes_mask(i,j) = 0.0 + end do + end do + + end subroutine deepLakesMask + +!======================================================================================== +!BOP +! +! !IROUTINE: jeagleSSTcorrection - Apply SST correction following Jaegle et al. 2011 +! +! !INTERFACE: + subroutine jeagleSSTcorrection(sstEmisFlag, fsstemis, ts, rc) + +! !USES: + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + real, dimension(:,:), intent(inout) :: fsstemis ! + +! !INPUT PARAMETERS: + integer, intent(in) :: sstEmisFlag ! 1 or 2 + real, dimension(:,:), intent(in) :: ts ! surface temperature (K) + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc +!EOP + +! !Local Variables + real, allocatable, dimension(:,:) :: tskin_c +!EOP +!------------------------------------------------------------------------- +! Begin... + + rc = 0 + + fsstemis = 1.0 + + if (sstemisFlag == 1) then ! SST correction folowing Jaegle et al. 2011 + fsstemis = 0.0 + + allocate( tskin_c, mold=fsstemis ) + tskin_c = ts - 273.15 + fsstemis = (0.3 + 0.1*tskin_c - 0.0076*tskin_c**2 + 0.00021*tskin_c**3) + + where(fsstemis < 0.0) fsstemis = 0.0 + + deallocate( tskin_c ) + else if (sstemisFlag == 2) then ! GEOS5 SST correction + fsstemis = 0.0 + + allocate( tskin_c, mold=fsstemis ) + tskin_c = ts - 273.15 + + where(tskin_c < -0.1) tskin_c = -0.1 ! temperature range (0, 36) C + where(tskin_c > 36.0) tskin_c = 36.0 ! + + fsstemis = (-1.107211 -0.010681*tskin_c -0.002276*tskin_c**2 + 60.288927*1.0/(40.0 - tskin_c)) + where(fsstemis < 0.0) fsstemis = 0.0 + where(fsstemis > 7.0) fsstemis = 7.0 + + deallocate( tskin_c ) + end if + + end subroutine jeagleSSTcorrection + +!===================================================================================== +!BOP +! +! !IROUTINE: weibullDistribution - Apply a Weibull distribution to emissions wind speeds +! +! !INTERFACE: + subroutine weibullDistribution (gweibull, weibullFlag, u10m, v10m, rc) + +! !USES: + implicit NONE + +! !INPUT/OUTPUT PARAMETERS: + real(kind=DP), dimension(:,:), intent(inout) :: gweibull + +! !INPUT PARAMETERS: + logical, intent(in) :: weibullFlag + real, dimension(:,:), intent(in) :: u10m + real, dimension(:,:), intent(in) :: v10m + + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc + +! !Descrption: The Weibull distribution correction ends up being a multiplicative constant +! (g) times our present source function (see Eq. 12 in Fan & Toon, 2011 and notes for +! (9/22/11). This constant is derived from the incomplete and complete forms of the gamma +! function, hence the utilities pasted below. The Weibull function and shape +! parameters (k, c) assumed are from Justus 1978. + +!EOP + +! !Local Variables + real(kind=DP) :: a, c, k, wt, x + real(kind=DP), dimension(:,:), allocatable :: wm + integer :: i, j + +!EOP +!------------------------------------------------------------------------- +! Begin... + + gweibull = 1.0 + + allocate(wm(ubound(u10m, 1),ubound(u10m, 2))) + wm = sqrt(u10m**2 + v10m**2) ! mean wind speed + wt = 4.d0 ! a threshold (Fan & Toon, 2011) + + if (weibullFlag) then + gweibull = 0.0 + + do j = 1, ubound(u10m, 2) + do i = 1, ubound(u10m, 1) + if (wm(i,j) > 0.01) then + k = 0.94d0 * sqrt(wm(i,j)) ! Weibull shape parameter + c = wm(i,j) / gamma(1.d0 + 1.d0/k) ! Weibull shape parameter + x = (wt / c) ** k + a = 3.41d0 / k + 1.d0 + gweibull(i,j) = (c / wm(i,j))**3.41d0 * igamma(a,x) + end if + end do ! i + end do ! j + endif + + deallocate(wm) + + end subroutine weibullDistribution + +!===================================================================================== + + DOUBLE PRECISION function igamma(A, X) +!----------------------------------------------------------------------- +! incomplete Gamma function +!----------------------------------------------------------------------- + IMPLICIT NONE + double precision, intent(in) :: A + DOUBLE PRECISION, INTENT(IN) :: X +! LOCAL VARIABLE + DOUBLE PRECISION :: XAM, GIN, S, R, T0 + INTEGER K + XAM=-X+A*LOG(X) + IF (XAM.GT.700.0.OR.A.GT.170.0) THEN + WRITE(*,*)'IGAMMA: a and/or x too large, X = ', X + WRITE(*,*) 'A = ', A + STOP + + ENDIF + + IF (X.EQ.0.0) THEN + IGAMMA=GAMMA(A) + + ELSE IF (X.LE.1.0+A) THEN + S=1.0/A + R=S + DO K=1,60 + R=R*X/(A+K) + S=S+R + IF (ABS(R/S).LT.1.0e-15) EXIT + END DO + GIN=EXP(XAM)*S + IGAMMA=GAMMA(A)-GIN + ELSE IF (X.GT.1.0+A) THEN + T0=0.0 + DO K=60,1,-1 + T0=(K-A)/(1.0+K/(X+T0)) + end do + + IGAMMA=EXP(XAM)/(X+T0) + + ENDIF + + end function igamma + +!===================================================================================== + +! !IROUTINE: SeasaltEmission - Master driver to compute the sea salt emissions +! +! !INTERFACE: +! + subroutine SeasaltEmission ( rLow, rUp, method, u10m, v10m, ustar, & + memissions, nemissions, rc ) + +! !DESCRIPTION: Calculates the seasalt mass emission flux every timestep. +! The particular method (algorithm) used for the calculation is based +! on the value of "method" passed on input. Mostly these algorithms are +! a function of wind speed and particle size (nominally at 80% RH). +! Routine is called once for each size bin, passing in the edge radii +! "rLow" and "rUp" (in dry radius, units of um). Returned in the emission +! mass flux [kg m-2 s-1]. A sub-bin assumption is made to break (possibly) +! large size bins into a smaller space. +! +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + + real, intent(in) :: rLow, rUp ! Dry particle bin edge radii [um] + real, intent(in) :: u10m(:,:) ! 10-meter eastward wind [m s-1] + real, intent(in) :: v10m(:,:) ! 10-m northward wind [m s-1] + real, target, intent(in) :: ustar(:,:) ! friction velocity [m s-1] + integer, intent(in) :: method ! Algorithm to use + +! !INOUTPUT PARAMETERS: + real, dimension(:,:), intent(inout) :: memissions ! Mass Emissions Flux [kg m-2 s-1] + real, dimension(:,:), intent(inout) :: nemissions ! Number Emissions Flux [# m-2 s-1] + +! !OUTPUT PARAMETERS: + integer, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - +! !Local Variables + integer :: ir + real, pointer :: w(:,:) ! Intermediary wind speed [m s-1] + real :: r, dr ! sub-bin radius spacing (dry, um) + real :: rwet, drwet ! sub-bin radius spacing (rh=80%, um) + real :: aFac, bFac, scalefac, rpow, exppow, wpow + real, allocatable, dimension(:,:), target :: w10m ! 10-m wind speed [m s-1] + +! !CONSTANTS + real, parameter :: r80fac = 1.65 ! ratio of radius(RH=0.8)/radius(RH=0.) [Gerber] + real, parameter :: rhop = 2200. ! dry seasalt density [kg m-3] + real, parameter :: pi = 3.1415 ! ratio of circumference to diameter of circle + integer, parameter :: nr = 10 ! Number of (linear) sub-size bins + + character(len=*), parameter :: myname = 'SeasaltEmission' + +!EOP +!------------------------------------------------------------------------- +! Begin... + + rc = 0 + +! Define 10-m wind speed + allocate(w10m, mold=u10m) + w10m = sqrt(u10m*u10m + v10m*v10m) +! Define the sub-bins (still in dry radius) + dr = (rUp - rLow)/nr + r = rLow + 0.5*dr + +! Loop over size bins + nemissions = 0. + memissions = 0. + + do ir = 1, nr + + rwet = r80fac * r + drwet = r80fac * dr + + select case(method) + + case(1) ! Gong 2003 + aFac = 4.7*(1.+30.*rwet)**(-0.017*rwet**(-1.44)) + bFac = (0.433-log10(rwet))/0.433 + scalefac = 1. + rpow = 3.45 + exppow = 1.607 + wpow = 3.41 + w => w10m + + case(2) ! Gong 1997 + aFac = 3. + bFac = (0.380-log10(rwet))/0.650 + scalefac = 1. + rpow = 1.05 + exppow = 1.19 + wpow = 3.41 + w => w10m + + case(3) ! GEOS5 2012 + aFac = 4.7*(1.+30.*rwet)**(-0.017*rwet**(-1.44)) + bFac = (0.433-log10(rwet))/0.433 + scalefac = 33.0e3 + rpow = 3.45 + exppow = 1.607 + wpow = 3.41 - 1. + w => ustar + + case default + print *, 'SeasaltEmission missing algorithm method' + rc = 1 + return + + end select + +! Number emissions flux (# m-2 s-1) + nemissions = nemissions + SeasaltEmissionGong( rwet, drwet, w, scalefac, aFac, bFac, rpow, exppow, wpow ) + +! Mass emissions flux (kg m-2 s-1) + scalefac = scalefac * 4./3.*pi*rhop*r**3.*1.e-18 + memissions = memissions + SeasaltEmissionGong( rwet, drwet, w, scalefac, aFac, bFac, rpow, exppow, wpow ) + + r = r + dr + + end do + + deallocate(w10m) + + rc = 0 + + end subroutine SeasaltEmission + + +! Function to compute sea salt emissions following the Gong style +! parameterization. Functional form is from Gong 2003: +! dN/dr = scalefac * 1.373 * (w^wpow) * (r^-aFac) * (1+0.057*r^rpow) * 10^(exppow*exp(-bFac^2)) +! where r is the particle radius at 80% RH, dr is the size bin width at 80% RH, and w is the wind speed + + function SeasaltEmissionGong ( r, dr, w, scalefac, aFac, bFac, rpow, exppow, wpow ) + + real, intent(in) :: r, dr ! Wet particle radius, bin width [um] + real, pointer, intent(in) :: w(:,:) ! Grid box mean wind speed [m s-1] (10-m or ustar wind) + real, intent(in) :: scalefac, aFac, bFac, rpow, exppow, wpow + real :: SeasaltEmissionGong(size(w,1),size(w,2)) + +! Initialize + SeasaltEmissionGong = 0. + +! Particle size distribution function + SeasaltEmissionGong = scalefac * 1.373*r**(-aFac)*(1.+0.057*r**rpow) & + *10**(exppow*exp(-bFac**2.))*dr +! Apply wind speed function + SeasaltEmissionGong = w**wpow * SeasaltEmissionGong + + end function SeasaltEmissionGong + +!============================================================================================ + +!BOP +! +! !IROUTINE: wetRadius - Compute the wet radius of sea salt particle +! +! !INTERFACE: + subroutine wetRadius (radius, rhop, rh, flag, radius_wet, rhop_wet, rc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + real, intent(in) :: radius ! dry radius [m] + real, intent(in) :: rhop ! dry density [kg m-3] + real, intent(in) :: rh ! relative humidity [0-1] + integer :: flag ! 1 (Fitzgerald, 1975) + ! 2 (Gerber, 1985) + +! !OUTPUT PARAMETERS: + real, intent(out) :: radius_wet ! humidified radius [m] + real, intent(out) :: rhop_wet ! wet density [kg m-3] + integer, intent(out) :: rc + +! !Local Variables + real :: sat, rcm, rrat + real, parameter :: rhow = 1000. ! Density of water [kg m-3] + +! The following parameters relate to the swelling of seasalt like particles +! following Fitzgerald, Journal of Applied Meteorology, 1975. + real, parameter :: epsilon = 1. ! soluble fraction of deliqeuscing particle + real, parameter :: alphaNaCl = 1.35 + real :: alpha, alpha1, alpharat, beta, theta, f1, f2 + +! parameter from Gerber 1985 (units require radius in cm, see rcm) + real, parameter :: c1=0.7674, c2=3.079, c3=2.573e-11, c4=-1.424 + +!EOP +!------------------------------------------------------------------------------------ +! Begin... + + rc = 0 + +! Default is to return radius as radius_wet, rhop as rhop_wet + radius_wet = radius + rhop_wet = rhop + +! Make sure saturation ratio (RH) is sensible + sat = max(rh,tiny(1.0)) ! to avoid zero FPE + +! Fitzgerald Scheme + if(flag .eq. 1 .and. sat .ge. 0.80) then +! parameterization blows up for RH > 0.995, so set that as max +! rh needs to be scaled 0 - 1 + sat = min(0.995,sat) +! Calculate the alpha and beta parameters for the wet particle +! relative to amonium sulfate + beta = exp( (0.00077*sat) / (1.009-sat) ) + if(sat .le. 0.97) then + theta = 1.058 + else + theta = 1.058 - (0.0155*(sat-0.97)) /(1.02-sat**1.4) + endif + alpha1 = 1.2*exp( (0.066*sat) / (theta-sat) ) + f1 = 10.2 - 23.7*sat + 14.5*sat**2. + f2 = -6.7 + 15.5*sat - 9.2*sat**2. + alpharat = 1. - f1*(1.-epsilon) - f2*(1.-epsilon**2.) + alpha = alphaNaCl * (alpha1*alpharat) +! radius_wet is the radius of the wet particle + radius_wet = alpha * radius**beta + rrat = (radius/radius_wet)**3. + rhop_wet = rrat*rhop + (1.-rrat)*rhow + elseif(flag .eq. 2) then ! Gerber + sat = min(0.995,sat) + rcm = radius*100. + radius_wet = 0.01 * (c1*rcm**c2 / (c3*rcm**c4-alog10(sat)) & + + rcm**3.)**(1./3.) + rrat = (radius/radius_wet)**3. + rhop_wet = rrat*rhop + (1.-rrat)*rhow + endif + + end subroutine wetRadius + +!=============================================================================== + +!BOP +! +! !IROUTINE: hoppelCorrection +! +! !INTERFACE: + subroutine hoppelCorrection (radius, rhop, rh, dz, ustar, rhFlag, & + airdens, t, grav, karman, fhoppel, rc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + real, intent(in) :: radius ! dry radius [m] + real, intent(in) :: rhop ! dry density [kg m-3] + integer, intent(in) :: rhFlag ! 1 (Fitzgerald, 1975) + ! 2 (Gerber, 1985) + real, dimension(:,:), intent(in) :: rh ! relative humidity [0-1] + real, dimension(:,:), intent(in) :: dz ! surface layer height [m] + real, dimension(:,:), intent(in) :: ustar ! surface velocity scale [m s-1] + real, dimension(:,:), intent(in) :: airdens ! air density [kg/m^3]s + real, dimension(:,:), intent(in) :: t ! temperature [k] + real, intent(in) :: grav ! gravity [m/sec^2] + real, intent(in) :: karman ! Von Karman constant [unitless] + + +! !INOUTPUT PARAMETERS: + real, dimension(:,:), intent(inout) :: fhoppel + +! !OUTPUT PARAMETERS: + integer, intent(out) :: rc + +! !Local Variables + real :: radius_wet ! humidified radius [m] + real :: rhop_wet ! wet density [kg m-3] + real :: diff_coef + real, allocatable, dimension(:,:) :: vsettle + integer :: i, j + + +!EOP +!------------------------------------------------------------------------------------ +! Begin.. + + rc = 0 + fhoppel = 1.0 + allocate(vsettle, mold=rh) + + do j = 1, ubound(rh,2) + do i = 1, ubound(rh,1) + call wetRadius (radius, rhop, rh(i,j), rhFlag, & + radius_wet, rhop_wet, rc) + if (rc /= 0) return + call Chem_CalcVsettle2Gorig (radius_wet, rhop_wet, airdens(i,j), t(i,j), & + GRAV, diff_coef, vsettle(i,j)) + fhoppel(i,j) = (10./dz(i,j)) ** (vsettle(i,j)/KARMAN/ustar(i,j)) + end do + end do + + + deallocate(vsettle) + + end subroutine hoppelCorrection + +!=============================================================================== +!BOP +! +! !IROUTINE: CAEmission - Adds Carbonaceous Aerosol emission for one timestep +! We have emissions from 6 sources, which are distributed +! differently in the vertical +! 1) biomass burning - uniformly mixed in PBL +! 2) biofuel sources - emitted into lowest 100 m +! 3) anthropogenic l1 - emitted into lowest 100 m +! 4) anthropogenic l2 - emitted into 100 - 500 m levels +! 5) terpene - emitted to surface (hydrophilic only) +! 6) point sources - emitted in altitudes specified in input +! +! !INTERFACE: +! + + subroutine CAEmission (mie_table, km, nbins, cdt, grav, prefix, ratPOM, fTerpene, aviation_lto_src, aviation_cds_src,& + aviation_crs_src, fHydrophobic, pblh, tmpu, rhoa, rh, aerosolPhilic, aerosolPhobic, & + delp, aviation_layers, & + biomass_src, terpene_src, eocant1_src, eocant2_src, oc_ship_src, biofuel_src, & + OC_emis, OC_emisAN, OC_emisBB, OC_emisBF, OC_emisBG, rc ) + +! !USES: + + implicit NONE + +! !INPUT PARAMETERS: + type(Chem_Mie), intent(in) :: mie_table ! mie table + integer, intent(in) :: km ! total model levels + integer, intent(in) :: nbins ! number of aerosol size bins + real, intent(in) :: cdt ! chemistry model time-step [sec] + real, intent(in) :: grav ! gravity [m/sec^2] + character(len=2), intent(in) :: prefix ! varaible name prefix + real, intent(in) :: ratPOM + real, intent(in) :: fTerpene + real, dimension(:), intent(in) :: aviation_layers ! Heights [m] of LTO, CDS and CRS aviation emissions layers + real, pointer, dimension(:,:), intent(in) :: pblh ! PBL height [m] + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:), intent(in) :: rhoa ! air density [kg m-3] + real, pointer, dimension(:,:,:), intent(in) :: rh ! relative humidity [1] + real, pointer, dimension(:,:,:), intent(in) :: delp ! pressure level thickness [Pa] + real, dimension(:,:), intent(in) :: aviation_cds_src ! Climb/Descent aircraft fuel emission [1] + real, dimension(:,:), intent(in) :: aviation_crs_src ! Cruise aircraft fuel emission [1] + real, dimension(:,:), intent(in) :: aviation_lto_src ! Landing/Take-off aircraft fuel emission [1] + real, dimension(:,:), intent(in) :: biomass_src + real, dimension(:,:), intent(in) :: terpene_src + real, dimension(:,:), intent(in) :: eocant1_src ! anthropogenic emissions + real, dimension(:,:), intent(in) :: eocant2_src ! anthropogenic emissions + real, dimension(:,:), intent(in) :: oc_ship_src ! ship emissions + real, dimension(:,:), intent(in) :: biofuel_src ! biofuel emissions + real, intent(in) :: fHydrophobic + +! !OUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: aerosolPhobic + real, dimension(:,:,:), intent(inout) :: aerosolPhilic + real, pointer, dimension(:,:,:) :: OC_emis ! OC emissions, kg/m2/s + real, pointer, dimension(:,:) :: OC_emisAN ! OC emissions, kg/m2/s + real, pointer, dimension(:,:) :: OC_emisBB ! OC emissions, kg/m2/s + real, pointer, dimension(:,:) :: OC_emisBF ! OC emissions, kg/m2/s + real, pointer, dimension(:,:) :: OC_emisBG ! OC emissions, kg/m2/s + integer, optional, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + character(len=*), parameter :: myname = 'CAEmission' + +! !DESCRIPTION: Updates the OC concentration with emissions every timestep +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! Based on Ginoux +! June2020 E.Sherman - moved to process library +!EOP +!------------------------------------------------------------------------- + +! !Local Variables + integer :: i, j, k, n, ios, ijl + integer :: n1, n2 + integer :: i1=1, i2, j1=1, j2 +! pressure at 100m, 500m, & PBLH + real, dimension(:,:), allocatable :: p100, p500, pPBL + real, dimension(:,:), allocatable :: p0, z0, ps + real :: p1, z1, dz, delz, delp_, f100, f500, fPBL, fBot + real :: qmax, qmin, eBiofuel, eBiomass, eTerpene, eAnthro + + real, dimension(:,:), allocatable :: factor, srcHydrophobic, srcHydrophilic + real, dimension(:,:), allocatable :: srcBiofuel, srcBiomass, srcAnthro, srcBiogenic + real :: srcTmp, zpbl, maxAll + + real, dimension(:,:,:), allocatable :: emis_aviation + real, dimension(:,:,:), allocatable :: srcAviation + real :: z_lto_bot, z_lto_top + real :: z_cds_bot, z_cds_top + real :: z_crs_bot, z_crs_top + + real, dimension(:,:), allocatable :: f_bb_ ! scaling factor for BB emissions based on maximum allowed exttau + real, dimension(:,:), allocatable :: exttau_bb_ ! increment of exttau due to BB during the current time step + real, allocatable, dimension(:,:,:,:) :: qa_bb_ ! increment of qa due to BB during the current time step (nbins,i1:i2,j1:j2:km) + real :: cutoff_bb_exttau + integer :: nch, idx + real :: ilam550 + real :: tau, ssa + character(len=255) :: qname + real, parameter :: max_bb_exttau = 30.0 + +! Indices for point emissions + real, dimension(km) :: point_column_emissions + +! Source function terms for SOA from Anthropogenic VOCs + real :: srcSOAanthro = 0.0 + +! Initialize local variables +! -------------------------- + i2 = size(rhoa,1) + j2 = size(rhoa,2) +! n1 = w_c%reg%i_OC +! n2 = w_c%reg%j_OC + ijl = ( i2 - i1 + 1 ) * ( j2 - j1 + 1 ) + + allocate(factor(i2,j2), srcHydrophobic(i2,j2), srcHydrophilic(i2,j2), srcBiofuel(i2,j2), & + srcBiomass(i2,j2), srcAnthro(i2,j2), srcBiogenic(i2,j2), f_bb_(i2,j2), exttau_bb_(i2,j2)) + +! Emission factors scaling from source files to desired mass quantity + eBiomass = ratPOM + eBiofuel = ratPOM + eTerpene = ratPOM * fTerpene + eAnthro = ratPOM + +! Zero diagnostic accumulators + if(associated(OC_emis)) OC_emis = 0.0 + if(associated(OC_emisAN)) OC_emisAN = 0.0 + if(associated(OC_emisBF)) OC_emisBF = 0.0 + if(associated(OC_emisBB)) OC_emisBB = 0.0 + if(associated(OC_emisBG)) OC_emisBG = 0.0 + +! Distribute aircraft emissions from LTO, CDS and CRS layers +! ---------------------------------------------------------- + z_lto_bot = max(1e-3, aviation_layers(1)) + z_lto_top = max(2e-3, aviation_layers(2)) + + z_cds_bot = max(2e-3, aviation_layers(2)) + z_cds_top = max(3e-3, aviation_layers(3)) + + z_crs_bot = max(3e-3, aviation_layers(3)) + z_crs_top = max(4e-3, aviation_layers(4)) + + allocate(emis_aviation, mold=tmpu) + allocate(srcAviation, mold=tmpu) + emis_aviation = 0.0 + srcAviation = 0.0 + + call distribute_aviation_emissions(delp, rhoa, z_lto_bot, z_lto_top, aviation_lto_src, emis_aviation, i1, i2, j1, j2, km, grav) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(delp, rhoa, z_cds_bot, z_cds_top, aviation_cds_src, emis_aviation, i1, i2, j1, j2, km, grav) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(delp, rhoa, z_crs_bot, z_crs_top, aviation_crs_src, emis_aviation, i1, i2, j1, j2, km, grav) + srcAviation = srcAviation + emis_aviation + + +! Determine surface pressure +! AMS Note: pass this in +! -------------------------- + allocate(ps, mold=pblh) + allocate(p0, mold=pblh) + allocate(z0, mold=pblh) + allocate(p100, mold=pblh) + allocate(p500, mold=pblh) + allocate(pPBL, mold=pblh) + ps = 0.0 + do k = 1, km + ps(i1:i2,j1:j2) = ps(i1:i2,j1:j2) + delp(i1:i2,j1:j2,k) + end do + +! Find the pressure of the 100m, 500m, and PBLH altitudes +! AMS Note: this could be greatly simplified by using ze/zm and having a +! generic routine from the bottom up with an early exit condition +! ----------------------------------------------------------------------- + p0 = ps + z0(i1:i2,j1:j2) = 0. + do k = km, 1, -1 + do j = j1, j2 + do i = i1, i2 + p1 = p0(i,j) - delp(i,j,k) + dz = delp(i,j,k)/rhoa(i,j,k)/grav + z1 = z0(i,j)+dz + if(z0(i,j) .lt. 100 .and. z1 .ge. 100.) then + delz = z1-100. + delp_ = delz*rhoa(i,j,k)*grav + p100(i,j) = p1+delp_ + endif + if(z0(i,j) .lt. 500 .and. z1 .ge. 500.) then + delz = z1-500. + delp_ = delz*rhoa(i,j,k)*grav + p500(i,j) = p1+delp_ + endif + zpbl = max ( pblh(i,j), 100. ) + if(z0(i,j) .lt. zpbl .and. z1 .ge. zpbl ) then + delz = z1-zpbl + delp_ = delz*rhoa(i,j,k)*grav + pPBL(i,j) = p1+delp_ + endif + p0(i,j) = p1 + z0(i,j) = z1 + end do + end do + end do + +! Limit biomass burning emissions +! ------------------------------- + allocate(qa_bb_(nbins,i1:i2,j1:j2,km)) + qa_bb_ = 0.0 + + p0 = ps +K_LOOP_BB: do k = km, 1, -1 + +! First determine emissions for this layer +! ---------------------------------------- + maxAll = 0.0 + do j = j1, j2 + do i = i1, i2 + + p1 = p0(i,j) - delp(i,j,k) + +! Pressure @ PBL height +! --------------------- + fPBL = 0. + if(p1 .ge. pPBL(i,j)) fPBL = delp(i,j,k)/(ps(i,j)-pPBL(i,j)) + if(p1 .lt. pPBL(i,j) .and. p0(i,j) .ge. pPBL(i,j)) fPBL = (p0(i,j)-pPBL(i,j))/(ps(i,j)-pPBL(i,j)) + +! Sources by class in kg m-2 s-1 +! ------------------------------ + srcBiomass(i,j) = fPBL * eBiomass * biomass_src(i,j) + + srcHydrophobic(i,j) = fHydrophobic * srcBiomass(i,j) + srcHydrophilic(i,j) = (1.-fHydrophobic) * srcBiomass(i,j) + +! Update pressure of lower level +! ------------------------------ + p0(i,j) = p1 + + end do ! i + end do ! j + +! REPLACE PMAXPMIN WITH SOMETIHNG????? +! Determine global max/min +! ------------------------ +! call pmaxmin ( 'OC: Phobic ', srcHydrophobic, qmin, qmax, ijl, 1, 0. ) +! maxAll = abs(qmax) + abs(qmin) +! call pmaxmin ( 'OC: Philic ', srcHydrophilic, qmin, qmax, ijl, 1, 0. ) +! maxAll = max ( maxAll, abs(qmax) + abs(qmin) ) + +! If emissions are zero at this level (globally), we are done +! ----------------------------------------------------------- +! if ( maxAll .eq. 0.0 ) exit K_LOOP_BB + + +! Update concentrations at this layer +! The "1" element is hydrophobic +! The "2" element is hydrophilic +! ----------------------------------- + factor = cdt * grav / delp(:,:,k) + + qa_bb_(1,:,:,k) = factor * srcHydrophobic + qa_bb_(2,:,:,k) = factor * srcHydrophilic + + end do K_LOOP_BB + + nch = mie_table%nch + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + if(nch .gt. 1) then + do i = 1, nch + if ( mie_table%channels(i) .ge. 5.49e-7 .and. & + mie_table%channels(i) .le. 5.51e-7) ilam550 = i + enddo + endif + +! Calculate the extinction and/or scattering AOD + + exttau_bb_(i1:i2,j1:j2) = 0.0 + + do n = 1, nbins +! Select the name for species and the index + do k = 1, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(mie_table, n, ilam550, & + qa_bb_(n,i,j,k)*delp(i,j,k)/grav, & + rh(i,j,k), tau=tau, ssa=ssa) + +! Integrate in the vertical + exttau_bb_(i,j) = exttau_bb_(i,j) + tau + + enddo + enddo + enddo + + enddo ! nbins + + f_bb_ = 1.0 + cutoff_bb_exttau = (cdt / (24 * 3600.0)) * max_bb_exttau + + do j = j1, j2 + do i = i1, i2 + if (exttau_bb_(i,j) > cutoff_bb_exttau) then + f_bb_(i,j) = cutoff_bb_exttau / exttau_bb_(i,j) + end if + enddo + enddo + + deallocate(qa_bb_) + +! Now update the tracer mixing ratios with the aerosol sources +! ------------------------------------------------------------ + p0 = ps +K_LOOP: do k = km, 1, -1 + +!!! print *, 'OC_Emissions: getting emissions for layer ', k + +! First determine emissions for this layer +! ---------------------------------------- + maxAll = 0.0 + do j = j1, j2 + do i = i1, i2 + + p1 = p0(i,j) - delp(i,j,k) + +! Pressure @ 100m +! --------------- + f100 = 0. + if(p1 .ge. p100(i,j)) f100 = delp(i,j,k)/(ps(i,j)-p100(i,j)) + if(p1 .lt. p100(i,j) .and. p0(i,j) .ge. p100(i,j)) & + f100 = (p0(i,j)-p100(i,j))/(ps(i,j)-p100(i,j)) + +! Pressure @ 500m +! --------------- + f500 = 0. + if ( p0(i,j) .ge. p100(i,j) .and. p1 .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = (p100(i,j)-p1)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = delp(i,j,k)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .ge. p500(i,j) .and. p1 .lt. p500(i,j)) & + f500 = (p0(i,j)-p500(i,j))/(p100(i,j)-p500(i,j)) + +! Pressure @ PBL height +! --------------------- + fPBL = 0. + if(p1 .ge. pPBL(i,j)) fPBL = delp(i,j,k)/(ps(i,j)-pPBL(i,j)) + if(p1 .lt. pPBL(i,j) .and. p0(i,j) .ge. pPBL(i,j)) & + fPBL = (p0(i,j)-pPBL(i,j))/(ps(i,j)-pPBL(i,j)) + +! Terpene is tree-top emission; only add in bottom layer +! ------------------------------------------------------ + if ( k .eq. km ) then + fBot = 1.0 + else + fBot = 0.0 + end if + +! Sources by class in kg m-2 s-1 +! ------------------------------ + srcBiofuel(i,j) = f100 * eBiofuel * biofuel_src(i,j) + srcAnthro(i,j) = f100 * eAnthro * eocant1_src(i,j) & + + f500 * eAnthro * eocant2_src(i,j) & + + f100 * eAnthro * oc_ship_src(i,j) & + + eAnthro * srcAviation(i,j,k) + if ((prefix == 'OC') .or. (prefix == 'BR')) then + srcBiomass(i,j) = fPBL * eBiomass * biomass_src(i,j) * f_bb_(i,j) + else + srcBiomass(i,j) = fPBL * eBiomass * biomass_src(i,j) + end if + + srcBiogenic(i,j) = fBot * eTerpene * terpene_src(i,j) !Black carbon has no biogenic source. Should be zeros. + + srcTmp = srcBiofuel(i,j) + srcAnthro(i,j) + srcBiomass(i,j) + + srcHydrophobic(i,j) = fHydrophobic * srcTmp + srcHydrophilic(i,j) = (1.-fHydrophobic) * srcTmp + srcBiogenic(i,j) + +! Update pressure of lower level +! ------------------------------ + p0(i,j) = p1 + + end do ! i + end do ! j + +! Determine global max/min +! ------------------------ +! call pmaxmin ( 'OC: Phobic ', srcHydrophobic, qmin, qmax, ijl, 1, 0. ) +! maxAll = abs(qmax) + abs(qmin) +! call pmaxmin ( 'OC: Philic ', srcHydrophilic, qmin, qmax, ijl, 1, 0. ) +! maxAll = max ( maxAll, abs(qmax) + abs(qmin) ) + +! If emissions are zero at this level (globally), we are done +! ----------------------------------------------------------- +! if ( maxAll .eq. 0.0 ) exit K_LOOP + +! Update concentrations at this layer +! The "1" element is hydrophobic +! The "2" element is hydrophilic +! ----------------------------------- + factor = cdt * grav / delp(:,:,k) + + aerosolPhobic(:,:,k) = aerosolPhobic(:,:,k) & + + factor * srcHydrophobic + + aerosolPhilic(:,:,k) = aerosolPhilic(:,:,k) & + + factor * srcHydrophilic + +! Fill in diagnostics if requested +! -------------------------------- + if ( associated(OC_emis)) & + OC_emis(:,:,1) = OC_emis(:,:,1) + srcHydrophobic + + if ( associated(OC_emis)) & + OC_emis(:,:,2) = OC_emis(:,:,2) + srcHydrophilic + + if ( associated(OC_emisBF)) & + OC_emisBF = OC_emisBF + srcBiofuel + + if ( associated(OC_emisBB)) & + OC_emisBB = OC_emisBB + srcBiomass + + if ( associated(OC_emisAN)) & + OC_emisAN = OC_emisAN + srcAnthro + + if ( associated(OC_emisBG)) & + OC_emisBG = OC_emisBG + srcBiogenic + end do K_LOOP + + rc = 0 + end subroutine CAEmission + + subroutine distribute_aviation_emissions(delp, rhoa, z_bot, z_top, emissions_layer, emissions, i1, i2, j1, j2, km, grav) + + implicit none + + integer, intent(in) :: i1, i2, j1, j2, km + + real, dimension(:,:,:), intent(in) :: delp + real, dimension(:,:,:), intent(in) :: rhoa + real, dimension(:,:), intent(in) :: emissions_layer + real, intent(in) :: z_bot + real, intent(in) :: z_top + real, dimension(:,:,:), intent(out):: emissions + real, intent(in) :: grav +! local + integer :: i, j, k + integer :: k_bot, k_top + real :: z_ + real, dimension(km) :: z, dz, w_ + + do j = j1, j2 + do i = i1, i2 + ! find level height + z = 0.0 + z_= 0.0 + + do k = km, 1, -1 + dz(k) = delp(i,j,k)/rhoa(i,j,k)/grav + z_ = z_ + dz(k) + z(k) = z_ + end do + + ! find the bottom level + do k = km, 1, -1 + if (z(k) >= z_bot) then + k_bot = k + exit + end if + end do + + ! find the top level + do k = k_bot, 1, -1 + if (z(k) >= z_top) then + k_top = k + exit + end if + end do + + ! find the weights + w_ = 0 + +! if (k_top > k_bot) then +! need to bail - something went wrong here +! end if + + if (k_bot .eq. k_top) then + w_(k_bot) = z_top - z_bot + else + do k = k_bot, k_top, -1 + if ((k < k_bot) .and. (k > k_top)) then + w_(k) = dz(k) + else + if (k == k_bot) then + w_(k) = (z(k) - z_bot) + end if + + if (k == k_top) then + w_(k) = z_top - (z(k)-dz(k)) + end if + end if + end do + end if + ! distribute emissions in the vertical + emissions(i,j,:) = (w_ / sum(w_)) * emissions_layer(i,j) + end do + end do + + end subroutine distribute_aviation_emissions + +!============================================================================ + +!BOP +! +! !IROUTINE: phobicTophilic +! +! !INTERFACE: + subroutine phobicTophilic (aerosol_phobic, aerosol_philic, aerosol_toHydrophilic, & + km, cdt, grav, delp, rc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! total model level + real, intent(in) :: cdt ! chemistry model time-step [sec] + real, intent(in) :: grav ! [m/sec^2] + real, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: aerosol_phobic ! OCphobic [kg kg-1] + real, dimension(:,:,:), intent(inout) :: aerosol_philic ! OCphilic [kg kg-1] + real, dimension(:,:), pointer :: aerosol_toHydrophilic ! OCHYPHIL [kg m-2 s-1] +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc + +! !Local Variables + integer :: i, j, k + real :: qUpdate, delq + +!EOP +!------------------------------------------------------------------------------------ +! Begin... + + if(associated(aerosol_toHydrophilic)) aerosol_toHydrophilic = 0.0 + + do k = 1, km + do j = 1, ubound(delp, 2) + do i = 1, ubound(delp, 1) + qUpdate = aerosol_phobic(i,j,k)*exp(-4.63e-6*cdt) + qUpdate = max(qUpdate,1.e-32) + delq = max(0.,aerosol_phobic(i,j,k)-qUpdate) + aerosol_phobic(i,j,k) = qUpdate + aerosol_philic(i,j,k) = aerosol_philic(i,j,k)+delq + if(associated(aerosol_toHydrophilic)) & + aerosol_toHydrophilic(i,j) = aerosol_toHydrophilic(i,j) & + + delq*delp(i,j,k)/grav/cdt + end do + end do + end do + + rc = 0 + + + end subroutine phobicTophilic + +!============================================================================ +!BOP +! +! !IROUTINE: NIheterogenousChem +! +! !INTERFACE: + subroutine NIheterogenousChem (NI_phet, xhno3, AVOGAD, AIRMW, PI, RUNIV, rhoa, tmpu, relhum, delp, & + DU, SS, rmedDU, rmedSS, fnumDU, fnumSS, nbinsDU, nbinsSS, & + km, klid, cdt, grav, fMassHNO3, fMassNO3, fmassair, nNO3an1, nNO3an2, & + nNO3an3, HNO3_conc, HNO3_sfcmass, HNO3_colmass, rc) + + +! !DESCRIPTION: Nitrogen heterogeneous chemistry + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + real, intent(in) :: AVOGAD ! Avogadro's number [1/kmol] + real, intent(in) :: AIRMW ! molecular weight of air [kg/kmol] + real, intent(in) :: PI ! pi constant + real, intent(in) :: RUNIV ! ideal gas constant [J/(Kmole*K)] + real, dimension(:,:,:), intent(in) :: rhoa ! Layer air density [kg/m^3] + real, dimension(:,:,:), intent(in) :: tmpu ! Layer temperature [K] + real, dimension(:,:,:), intent(in) :: relhum ! relative humidity [1] + real, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, pointer, dimension(:,:,:,:), intent(in) :: DU ! dust aerosol [kg/kg] + real, pointer, dimension(:,:,:,:), intent(in) :: SS ! sea salt aerosol [kg/kg] + real, dimension(:) ,intent(in) :: rmedDU ! dust aerosol radius [um] + real, dimension(:) ,intent(in) :: rmedSS ! sea salt aerosol radius [um] + real, dimension(:) ,intent(in) :: fnumDU ! number of dust particles per kg mass + real, dimension(:) ,intent(in) :: fnumSS ! number of sea salt particles per kg mass + integer, intent(in) :: nbinsDU ! number of dust bins + integer, intent(in) :: nbinsSS ! number of sea salt bins + integer, intent(in) :: km ! number of model levels + integer, intent(in) :: klid ! index for pressure lid + real, intent(in) :: cdt ! chemistry model timestep (sec) + real, intent(in) :: grav ! gravity (m/sec) + real, intent(in) :: fMassHNO3 ! gram molecular weight + real, intent(in) :: fMassNO3 ! gram molecular weight + real, intent(in) :: fMassair ! gram molecular weight + + +! !INOUTPUT PARAMETERS: + real, pointer, dimension(:,:,:), intent(inout) :: NI_phet ! Nitrate Production from Het Chem [kg/(m^2 sec)] + real, dimension(:,:,:), intent(inout) :: xhno3 ! buffer for NITRATE_HNO3 [kg/(m^2 sec)] + real, pointer, dimension(:,:,:), intent(inout) :: HNO3_conc ! Nitric Acid Mass Concentration [kg/m^3] + real, pointer, dimension(:,:), intent(inout) :: HNO3_sfcmass ! Nitric Acid Surface Mass Concentration [kg/m^3] + real, pointer, dimension(:,:), intent(inout) :: HNO3_colmass ! Nitric Acid Column Mass Density [kg/m^3] + real, pointer, dimension(:,:,:), intent(inout) :: nNO3an1 ! Nitrate bin 1 [kg/kg] + real, pointer, dimension(:,:,:), intent(inout) :: nNO3an2 ! Nitrate bin 2 [kg/kg] + real, pointer, dimension(:,:,:), intent(inout) :: nNO3an3 ! Nitrate bin 3 [kg/kg] + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc + +! !Local Variables + real(kind=DP) :: kan1, kan2, kan3, sad, ad, rad, deltahno3, temp, rh +! real :: kan1, kan2, kan3, sad, ad, rad, deltahno3, temp, rh + integer :: i, j, k, n, j1, j2, i1, i2 + +!EOP +!------------------------------------------------------------------------------------ +! Begin.. + +! Heterogeneous chemistry +! ----------------------- +! Heterogeneous chemistry wants to know about GOCART dust and sea +! salt tracers. This code is not at the moment generalized as it +! seems very wedded to the traditional GOCART arrangement (5 dust, +! 5 sea salt) and the particulars of the nitrate aerosol arrangement. + rc = 0 + + if(associated(NI_phet)) NI_phet = 0. + + j1 = lbound(tmpu, 2) + j2 = ubound(tmpu, 2) + i1 = lbound(tmpu, 1) + i2 = ubound(tmpu, 1) + + do k = klid, km + do j = j1, j2 + do i = i1, i2 + kan1 = 0. + kan2 = 0. + kan3 = 0. + ad = 1.e-6*rhoa(i,j,k)*AVOGAD/AIRMW ! air number density # cm-3 + temp = tmpu(i,j,k) +! rh = w_c%rh(i,j,k) + rh = relhum(i,j,k) +! Dust + if (associated(DU)) then + do n = 1, nbinsDU + sad = 0.01*4.*PI*rmedDU(n)**2.*fnumDU(n) * & + rhoa(i,j,k) * DU(i,j,k,n) ! surface area density cm2 cm-3 + rad = 100.*rmedDU(n) ! radius cm + + if (sad > 0.) then + if(n == 1) & + kan1 = kan1 + sktrs_hno3(temp,rh,sad,ad,rad,PI,RUNIV,fMassHNO3) + if(n == 2) & + kan2 = kan2 + sktrs_hno3(temp,rh,sad,ad,rad,PI,RUNIV,fMassHNO3) + if(n == 3) & + kan2 = kan2 + sktrs_hno3(temp,rh,sad,ad,rad,PI,RUNIV,fMassHNO3) + if(n == 4) & + kan3 = kan3 + sktrs_hno3(temp,rh,sad,ad,rad,PI,RUNIV,fMassHNO3) + if(n == 5) & + kan3 = kan3 + sktrs_hno3(temp,rh,sad,ad,rad,PI,RUNIV,fMassHNO3) + end if + enddo + endif + +! Sea salt + if (associated(SS)) then + do n = 1, nbinsSS + sad = 0.01*4.*PI*rmedSS(n)**2.*fnumSS(n) * & + rhoa(i,j,k) * SS(i,j,k,n) ! surface area density cm2 cm-3 + rad = 100.*rmedSS(n) ! radius cm + + if (sad > 0.) then + if(n == 1) & + kan1 = kan1 + sktrs_sslt(temp,sad,ad,rad,PI,RUNIV,fMassHNO3) + if(n == 2) & + kan1 = kan1 + sktrs_sslt(temp,sad,ad,rad,PI,RUNIV,fMassHNO3) + if(n == 3) & + kan2 = kan2 + sktrs_sslt(temp,sad,ad,rad,PI,RUNIV,fMassHNO3) + if(n == 4) & + kan2 = kan2 + sktrs_sslt(temp,sad,ad,rad,PI,RUNIV,fMassHNO3) + if(n == 5) & + kan3 = kan3 + sktrs_sslt(temp,sad,ad,rad,PI,RUNIV,fMassHNO3) + end if + enddo + endif + +! Compute the nitric acid loss (but don't actually update) + if( (kan1+kan2+kan3) > 0.) then +! deltahno3 = xhno3(i,j,k) * fMassHNO3 / AIRMW * (1.-exp(-(kan1+kan2+kan3)*cdt)) +! xhno3(i,j,k) = xhno3(i,j,k) - deltahno3 * AIRMW / fMassHNO3 + deltahno3 = xhno3(i,j,k) * fMassHNO3 / fmassair * (1.-exp(-(kan1+kan2+kan3)*cdt)) + xhno3(i,j,k) = xhno3(i,j,k) - deltahno3 * fmassair / fMassHNO3 + nNO3an1(i,j,k) = & + nNO3an1(i,j,k) + kan1/(kan1+kan2+kan3)*deltahno3*fMassNO3/fMassHNO3 + nNO3an2(i,j,k) = & + nNO3an2(i,j,k) + kan2/(kan1+kan2+kan3)*deltahno3*fMassNO3/fMassHNO3 + nNO3an3(i,j,k) = & + nNO3an3(i,j,k) + kan3/(kan1+kan2+kan3)*deltahno3*fMassNO3/fMassHNO3 + + if(associated(NI_phet)) then + NI_phet(i,j,1) = NI_phet(i,j,1) + kan1/(kan1+kan2+kan3)*deltahno3*delp(i,j,k)/grav/cdt + NI_phet(i,j,2) = NI_phet(i,j,2) + kan2/(kan1+kan2+kan3)*deltahno3*delp(i,j,k)/grav/cdt + NI_phet(i,j,3) = NI_phet(i,j,3) + kan3/(kan1+kan2+kan3)*deltahno3*delp(i,j,k)/grav/cdt + end if + endif !(kan1+kan2+kan3) > 0. + + enddo !i + enddo !j + enddo !k + +! Output diagnostic HNO3 +! ---------------------- +! Calculate the HNO3 mass concentration + if( associated(HNO3_conc) ) then + HNO3_conc = xhno3 * fMassHNO3 / AIRMW * rhoa + endif +! Calculate the HNO3 surface mass concentration + if( associated(HNO3_sfcmass) ) then + HNO3_sfcmass(i1:i2,j1:j2) = xhno3(i1:i2,j1:j2,km) * fMassHNO3 / AIRMW * rhoa(i1:i2,j1:j2,km) + endif +! Calculate the HNO3 column loading + if( associated(HNO3_colmass) ) then + HNO3_colmass(i1:i2,j1:j2) = 0. + do k = klid, km + HNO3_colmass(i1:i2,j1:j2) & + = HNO3_colmass(i1:i2,j1:j2) + xhno3(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav + end do + endif + + end subroutine NIheterogenousChem + +!============================================================================ +!BOP +! +! !IROUTINE: sktrs_hno3 +! +! !INTERFACE: + function sktrs_hno3 ( tk, frh, sad, ad, radA, pi, rgas, fMassHNO3 ) + +! !DESCRIPTION: +! Below are the series of heterogeneous reactions +! The reactions sktrs_hno3n1, sktrs_hno3n2, and sktrs_hno3n3 are provided +! as given by Huisheng Bian. As written they depend on knowing the GOCART +! structure and operate per column but the functions themselves are +! repetitive. I cook up a single sktrs_hno3 function which is called per +! grid box per species with an optional parameter gamma being passed. +! Following is objective: +! loss rate (k = 1/s) of species on aerosol surfaces +! +! k = sad * [ radA/Dg +4/(vL) ]^(-1) +! +! where +! Dg = gas phase diffusion coefficient (cm2/s) +! L = sticking coefficient (unitless) = gamma +! v = mean molecular speed (cm/s) = [ 8RT / (pi*M) ]^1/2 +! +! radA/Dg = uptake by gas-phase diffusion to the particle surface +! 4/(vL) = uptake by free molecular collisions of gas molecules with the surface + +! !INPUT PARAMETERS: + real(kind=DP) :: tk ! temperature [K] + real(kind=DP) :: frh ! fractional relative humidity [0 - 1] + real(kind=DP) :: sad ! aerosol surface area density [cm2 cm-3] + real(kind=DP) :: ad ! air number concentration [# cm-3] + real(kind=DP) :: radA ! aerosol radius [cm] + real(kind=DP) :: sktrs_hno3 + + real :: pi ! pi constant + real :: rgas ! ideal gas constant [J/(K*mol)] + real :: fMassHNO3 ! gram molecular weight of HNO3 +! real(kind=DP), optional :: gammaInp ! optional uptake coefficient (e.g., 0.2 for SS, else calculated) + +! !Local Variables + real(kind=DP), parameter :: GAMMA_HNO3 = 1.0e-3 + real(kind=DP) :: dfkg + real(kind=DP) :: avgvel + real(kind=DP) :: gamma + +!EOP +!------------------------------------------------------------------------------------ +! Begin.. + sktrs_hno3 = 0.d0 + gamma = 3.d-5 + +! Following uptake coefficients of Liu et al.(2007) + if (frh >= 0.1d0 .and. frh < 0.3d0 ) gamma = gamma_hno3 * (0.03d0 + 0.08d0 * (frh - 0.1d0)) + if (frh >= 0.3d0 .and. frh < 0.5d0 ) gamma = gamma_hno3 * (0.19d0 + 0.255d0 * (frh - 0.3d0)) + if (frh >= 0.5d0 .and. frh < 0.6d0 ) gamma = gamma_hno3 * (0.7d0 + 0.3d0 * (frh - 0.5d0)) + if (frh >= 0.6d0 .and. frh < 0.7d0 ) gamma = gamma_hno3 * (1.0d0 + 0.3d0 * (frh - 0.6d0)) + if (frh >= 0.7d0 .and. frh < 0.8d0 ) gamma = gamma_hno3 * (1.3d0 + 0.7d0 * (frh - 0.7d0)) + if (frh >= 0.8d0 ) gamma = gamma_hno3 * 2.0d0 + +! calculate gas phase diffusion coefficient (cm2/s) + dfkg = 9.45D17 / ad * ( tk * (3.472D-2 + 1.D0/fmassHNO3) )**0.5d0 + +! calculate mean molecular speed (cm/s) + avgvel = 100.0d0 * (8.0d0 * rgas * tk * 1000.0d0 / (pi * fmassHNO3))**0.5d0 + +! calculate rate coefficient + sktrs_hno3 = sad * ( 4.0d0 / ( gamma * avgvel )+ radA / dfkg )**(-1.0d0) + + end function sktrs_hno3 + +!============================================================================ +!BOP +! +! !IROUTINE: sktrs_sslt +! +! !INTERFACE: + function sktrs_sslt ( tk, sad, ad, radA, pi, rgas, fMassHNO3 ) + +! !DESCRIPTION: +! Below are the series of heterogeneous reactions +! The reactions sktrs_hno3n1, sktrs_hno3n2, and sktrs_hno3n3 are provided +! as given by Huisheng Bian. As written they depend on knowing the GOCART +! structure and operate per column but the functions themselves are +! repetitive. I cook up a single sktrs_hno3 function which is called per +! grid box per species with an optional parameter gamma being passed. +! Following is objective: +! loss rate (k = 1/s) of species on aerosol surfaces +! +! k = sad * [ radA/Dg +4/(vL) ]^(-1) +! +! where +! Dg = gas phase diffusion coefficient (cm2/s) +! L = sticking coefficient (unitless) = gamma +! v = mean molecular speed (cm/s) = [ 8RT / (pi*M) ]^1/2 +! +! radA/Dg = uptake by gas-phase diffusion to the particle surface +! 4/(vL) = uptake by free molecular collisions of gas molecules with the surface + +! !INPUT PARAMETERS: + real(kind=DP) :: tk ! temperature [K] + real(kind=DP) :: sad ! aerosol surface area density [cm2 cm-3] + real(kind=DP) :: ad ! air number concentration [# cm-3] + real(kind=DP) :: radA ! aerosol radius [cm] + real(kind=DP) :: sktrs_sslt + real :: pi ! pi constant + real :: rgas ! ideal gas constant [J/(K*mol)] + real :: fMassHNO3 ! gram molecular weight of HNO3 +! real(kind=DP), optional :: gammaInp ! optional uptake coefficient (e.g., 0.2 for SS, else calculated) + +! !Local Variables + real(kind=DP), parameter :: GAMMA_SSLT = 0.1d0 + real(kind=DP) :: dfkg + real(kind=DP) :: avgvel + +!EOP +!------------------------------------------------------------------------------------ +! Begin.. +! Initialize + sktrs_sslt = 0.d0 + +! calculate gas phase diffusion coefficient (cm2/s) + dfkg = 9.45D17 / ad * ( tk * (3.472D-2 + 1.D0/fmassHNO3) )**0.5d0 + +! calculate mean molecular speed (cm/s) + avgvel = 100.0d0 * (8.0d0 * rgas * tk * 1000.0d0 / (pi * fmassHNO3))**0.5d0 + +! calculate rate coefficient + sktrs_sslt = sad * ( 4.0d0 / ( GAMMA_SSLT * avgvel )+ radA / dfkg )**(-1.0d0) + + end function sktrs_sslt + +!================================================================================== + + subroutine CombineVolcEmiss (nVolcE, vLatE, vLonE, vElevE, vCloudE, vSO2E, & + nVolcC, vLatC, vLonC, vElevC, vCloudC, vSO2C, & + nVolc, vLat, vLon, vElev, vCloud, vSO2, vStart, vEnd, rc) +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(inout) :: nVolcE + real, pointer, dimension(:), intent(inout) :: vLatE, vLonE, & + vSO2E, vElevE, vCloudE + + integer, intent(inout) :: nVolcC + real, pointer, dimension(:), intent(inout) :: vLatC, vLonC, & + vSO2C, vElevC, vCloudC + + integer, intent(inout) :: nVolc + real, pointer, dimension(:), intent(inout) :: vLat, vLon, & + vSO2, vElev, vCloud + integer, pointer, dimension(:), intent(inout) :: vStart, vEnd + + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc ! Error return code: + +! !DESCRIPTION: ! Combines volcanic emissions comes from the data tables +! and upates internal private state of Sulfate gridded component. + +! !Local Variables + integer :: i + + +!***************************************************************************** +! Begin... + nVolc = nVolcE + nVolcC + + allocate(vLat(nvolc), vLon(nvolc), & + vSO2(nvolc), vElev(nvolc), & + vCloud(nvolc)) + + if(nVolc > 0) then + if(nVolcE > 0) then + do i = 1, nVolcE + vLat(i) = vLatE(i) + vLon(i) = vLonE(i) + vElev(i) = vElevE(i) + vCloud(i) = vCloudE(i) + vSO2(i) = vSO2E(i) + end do + end if + if(nVolcC > 0) then + do i = 1, nVolcC + vLat(i+nVolcE) = vLatC(i) + vLon(i+nVolcE) = vLonC(i) + vElev(i+nVolcE) = vElevC(i) + vCloud(i+nVolcE) = vCloudC(i) + vSO2(i+nVolcE) = vSO2C(i) + end do + end if + vStart = 000000 + vEnd = 240000 + end if + + rc = 0 + + end subroutine CombineVolcEmiss + +!================================================================================== +!BOP +! !IROUTINE: SulfateDistributeEmissions + + subroutine SulfateDistributeEmissions ( km, nbins, cdt, grav, nymd, nhms, & + fMassSO4, fMassSO2, fSO4ant, eAircraftFuel, & + nSO2, nSO4, & + so2anthro_l1_src, so2anthro_l2_src, & + so2biomass_src, dmso_conc, & + so2ship_src, so4ship_src, & + aircraft_fuel_src, & + so2, so4, & + oro, u10m, v10m, hghte, pblh, & + tmpu, rhoa, delp, & + SU_emis, SU_SO4eman, SU_SO2eman, SU_SO2embb, & +! maskString, gridMask, & + aviation_layers, & + aviation_lto_src, & + aviation_cds_src, & + aviation_crs_src, rc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km, nbins ! number model layers, and number of species respectively + real, intent(in) :: cdt, grav ! model time, and gravity respectively + integer, intent(in) :: nymd, nhms + real, intent(in) :: fMassSO4 ! gram molecular weight of SO4 + real, intent(in) :: fMassSO2 ! gram molecular weight of SO2 + real, intent(in) :: fSO4ant ! Fraction of anthropogenic emissions that are SO4 + integer, intent(in) :: nSO2 ! index of SO2 relative to other sulfate tracers + integer, intent(in) :: nSO4 ! index of SO2 relative to other sulfate tracers + real, intent(in) :: eAircraftFuel ! Aircraft emission factor: go from kg fuel to kg SO2 + real, dimension(:,:), intent(in) :: so2anthro_l1_src ! anthropogenic source surface[1] + real, dimension(:,:), intent(in) :: so2anthro_l2_src ! anthropogenic source [1] + real, dimension(:,:), intent(in) :: so2biomass_src ! biomass burning source [1] + real, dimension(:,:), intent(in) :: dmso_conc ! DMS source [1] + real, dimension(:,:), intent(in) :: so2ship_src ! SO2 ship emissions [1] + real, dimension(:,:), intent(in) :: so4ship_src ! SO4 ship emissions [1] + real, dimension(:,:,:), intent(in) :: aircraft_fuel_src ! aircraft fuel source [1] + + real, pointer, dimension(:,:), intent(in) :: oro ! orography flag + real, pointer, dimension(:,:), intent(in) :: u10m ! 10-m u-wind component [m s-1] + real, pointer, dimension(:,:), intent(in) :: v10m ! 10-m v-wind component [m s-1] + real, pointer, dimension(:,:,:), intent(in) :: hghte ! top of layer geopotential height [m] + real, pointer, dimension(:,:), intent(in) :: pblh + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:), intent(in) :: rhoa ! Layer air density [kg/m^3] +! real, pointer, dimension(:,:,:), intent(in) :: rh ! relative humidity [1] + real, pointer, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, dimension(:), intent(in) :: aviation_layers ! Heights [m] of LTO, CDS and CRS aviation emissions layers + real, dimension(:,:), intent(in) :: aviation_cds_src ! Climb/Descent aircraft fuel emission [1] + real, dimension(:,:), intent(in) :: aviation_crs_src ! Cruise aircraft fuel emission [1] + real, dimension(:,:), intent(in) :: aviation_lto_src ! Landing/Take-off aircraft fuel emission [1] + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: so2, so4 ! Sulfate internal state varaibles [kg/kg] + real, pointer, dimension(:,:,:) :: SU_emis ! SU emissions, kg/m2/s + real, pointer, dimension(:,:) :: SU_SO4eman ! SO4 anthro emissions, kg/m2/s + real, pointer, dimension(:,:) :: SU_SO2eman ! SO2 anthro emissions, kg/m2/s + real, pointer, dimension(:,:) :: SU_SO2embb ! SO2 bioburn emissions, kg/m2/s + +! OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc ! Error return code: + ! 0 - all is well + +! !DESCRIPTION: SulfateDistributeEmissions - Adds sulfate source emission for one timestep +! We have emissions from 4 sources, which are distributed +! differently in the vertical +! 1) biomass burning - uniformly mixed in PBL (SO2) +! 2) anthropogenic l1 - emitted into lowest 100 m (SO2,SO4) +! 3) anthropogenic l2 - emitted into 100 - 500 m levels (SO2,SO4) +! 4) volcanic emissions +! Additionally have a source of DMS from transfer from seawater +! into lowest model layer +! Consider factors in conversion: we estimate that 5% of sulfur +! from anthropogenic sources (by mass) goes directly to SO4. +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco - Based on Ginoux +! 17July2020, Sherman - Refactored for GOCART2G. Only uses intrinsic Fortran + +! !Local Variables + integer :: i, j, k + integer :: i1=1, j1=1, i2, j2 + + real, dimension(:,:), allocatable :: srcSO2, srcSO4, srcDMS, srcSO4anthro, & + srcSO2anthro, srcSO2bioburn + real, allocatable, dimension(:,:) :: hsurf + + real :: p1, z1, dz, deltaz, deltap, f100, f500, fPblh + real :: zpbl + ! pressure at 100m, 500m, & PBLH + real, dimension(:,:), allocatable :: p100, p500, pPblh, p0, z0, ps + + real, dimension(:,:,:), allocatable :: emis_aviation + real, dimension(:,:,:), allocatable :: srcAviation + real :: z_lto_bot, z_lto_top + real :: z_cds_bot, z_cds_top + real :: z_crs_bot, z_crs_top + +!EOP +!------------------------------------------------------------------------- +! Begin + + i2 = size(rhoa,1) + j2 = size(rhoa,2) + allocate(hsurf(i1:i2,j1:j2)) + hsurf = hghte(i1:i2,j1:j2,km) + + allocate(srcSO2(i2,j2), srcSO4(i2,j2), srcDMS(i2,j2), srcSO4anthro(i2,j2), & + srcSO2anthro(i2,j2), srcSO2bioburn(i2,j2)) + +! Initialize local variables +! -------------------------- + srcSO2 = 0.0 + srcSO4 = 0.0 + srcDMS = 0.0 + + if (associated(SU_emis)) SU_emis = 0.0 + if (associated(SU_SO4eman)) SU_SO4eman = 0.0 + if (associated(SU_SO2eman)) SU_SO2eman = 0.0 + if (associated(SU_SO2embb)) SU_SO2embb = 0.0 + +! Distribute aircraft emissions from LTO, CDS and CRS layers +! ---------------------------------------------------------- + z_lto_bot = max(1e-3, aviation_layers(1)) + z_lto_top = max(2e-3, aviation_layers(2)) + + z_cds_bot = max(2e-3, aviation_layers(2)) + z_cds_top = max(3e-3, aviation_layers(3)) + + z_crs_bot = max(3e-3, aviation_layers(3)) + z_crs_top = max(4e-3, aviation_layers(4)) + + allocate(emis_aviation, mold=tmpu) + allocate(srcAviation, mold=tmpu) + emis_aviation = 0.0 + srcAviation = 0.0 + + call distribute_aviation_emissions(delp, rhoa, z_lto_bot, z_lto_top, aviation_lto_src, & + emis_aviation, i1, i2, j1, j2, km, grav) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(delp, rhoa, z_cds_bot, z_cds_top, aviation_cds_src, & + emis_aviation, i1, i2, j1, j2, km, grav) + srcAviation = srcAviation + emis_aviation + + call distribute_aviation_emissions(delp, rhoa, z_crs_bot, z_crs_top, aviation_crs_src, & + emis_aviation, i1, i2, j1, j2, km, grav) + srcAviation = srcAviation + emis_aviation + +! Find the pressure of the 100m, 500m, and PBLH altitudes + allocate(ps, mold=pblh) + allocate(p0, mold=pblh) + allocate(z0, mold=pblh) + allocate(p100, mold=pblh) + allocate(p500, mold=pblh) + allocate(pPblh, mold=pblh) + + ps = 0.0 + do k = 1, km + ps(i1:i2,j1:j2) = ps(i1:i2,j1:j2) + delp(i1:i2,j1:j2,k) + end do + p0 = ps + z0(i1:i2,j1:j2) = 0. + do k = km, 1, -1 + do j = j1, j2 + do i = i1, i2 + p1 = p0(i,j) - delp(i,j,k) + dz = delp(i,j,k)/rhoa(i,j,k)/grav + z1 = z0(i,j)+dz + if(z0(i,j) .lt. 100 .and. z1 .ge. 100.) then + deltaz = z1-100. + deltap = deltaz*rhoa(i,j,k)*grav + p100(i,j) = p1+deltap + endif + if(z0(i,j) .lt. 500 .and. z1 .ge. 500.) then + deltaz = z1-500. + deltap = deltaz*rhoa(i,j,k)*grav + p500(i,j) = p1+deltap + endif + zpbl = max ( pblh(i,j), 100. ) + if(z0(i,j) .lt. zpbl .and. z1 .ge. zpbl) then + deltaz = z1-zpbl + deltap = deltaz*rhoa(i,j,k)*grav + pPblh(i,j) = p1+deltap + endif + p0(i,j) = p1 + z0(i,j) = z1 + end do + end do + end do + +! Now update the tracer mixing ratios with the aerosol sources + p0 = ps + z0 = hsurf + do k = km, 1, -1 + + do j = j1, j2 + do i = i1, i2 + + p1 = p0(i,j) - delp(i,j,k) + f100 = 0. + if(p1 .ge. p100(i,j)) f100 = delp(i,j,k)/(ps(i,j)-p100(i,j)) + if(p1 .lt. p100(i,j) .and. p0(i,j) .ge. p100(i,j)) & + f100 = (p0(i,j)-p100(i,j))/(ps(i,j)-p100(i,j)) + + f500 = 0. + if(p0(i,j) .ge. p100(i,j) .and. p1 .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = (p100(i,j)-p1)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .lt. p100(i,j) .and. p1 .ge. p500(i,j)) & + f500 = delp(i,j,k)/(p100(i,j)-p500(i,j)) + if(p0(i,j) .ge. p500(i,j) .and. p1 .lt. p500(i,j)) & + f500 = (p0(i,j)-p500(i,j))/(p100(i,j)-p500(i,j)) + + fPblh = 0. + if(p1 .ge. pPblh(i,j)) fPblh = delp(i,j,k)/(ps(i,j)-pPblh(i,j)) + if(p1 .lt. pPblh(i,j) .and. p0(i,j) .ge. pPblh(i,j)) & + fPblh = (p0(i,j)-pPblh(i,j))/(ps(i,j)-pPblh(i,j)) + +! All source from files specified in kg SO2 m-2 s-1 (unless filename +! indicates otherwise!). + srcSO4anthro(i,j) = fSO4ant * fMassSO4/fMassSO2 * & + ( f100 * so2anthro_l1_src(i,j) & + + f500 * so2anthro_l2_src(i,j) ) + srcSO2anthro(i,j) = (1.-fSO4ant) * & + ( f100 * so2anthro_l1_src(i,j) & + + f500 * so2anthro_l2_src(i,j) ) + + srcSO2bioburn(i,j) = fPblh*so2biomass_src(i,j) + +! Add the ship emissions to anthro + srcSO2anthro(i,j) = srcSO2anthro(i,j) + f100*so2ship_src(i,j) + srcSO4anthro(i,j) = srcSO4anthro(i,j) + f100*so4ship_src(i,j) + +! Add the aircraft fuel emissions to anthro SO2 + srcSO2anthro(i,j) = srcSO2anthro(i,j) + & + eAircraftFuel * aircraft_fuel_src(i,j,k) + + srcSO2anthro(i,j) = srcSO2anthro(i,j) + srcAviation(i,j,k) + + srcSO4(i,j) = srcSO4anthro(i,j) + srcSO2(i,j) = srcSO2anthro(i,j)+srcSO2bioburn(i,j) + + so2(i,j,k) = so2(i,j,k) + srcSO2(i,j)*cdt*grav/delp(i,j,k) + so4(i,j,k) = so4(i,j,k) + srcSO4(i,j)*cdt*grav/delp(i,j,k) + + p0(i,j) = p1 + + end do ! i + end do ! j + + if (associated(SU_emis)) SU_emis(:,:,nSO2) = SU_emis(:,:,nSO2) + srcSO2 + if (associated(SU_emis)) SU_emis(:,:,nSO4) = SU_emis(:,:,nSO4) + srcSO4 + if (associated(SU_SO4eman)) SU_SO4eman = SU_SO4eman + srcSO4anthro + if (associated(SU_SO2eman)) SU_SO2eman = SU_SO2eman + srcSO2anthro + if (associated(SU_SO2embb)) SU_SO2embb = SU_SO2embb + srcSO2bioburn + + end do ! k + + rc = 0 + + end subroutine SulfateDistributeEmissions + +!================================================================================== +!BOP +! !IROUTINE: DMSemission + + subroutine DMSemission (km, cdt, grav, tmpu, u10m, v10m, oro, delp, & + fMassDMS, dmso_conc, dms, SU_emis, ndms, rc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! number model layers, and number of species respectively + real, intent(in) :: cdt ! model time step [seconds] + real, intent(in) :: grav ! gravity [m sec-1] + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, pointer, dimension(:,:), intent(in) :: u10m ! 10-m u-wind component [m s-1] + real, pointer, dimension(:,:), intent(in) :: v10m ! 10-m v-wind component [m s-1] + real, pointer, dimension(:,:), intent(in) :: oro ! orography flag + real, pointer, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, dimension(:,:), intent(in) :: dmso_conc ! DMS source [1] + integer, intent(in) :: ndms ! index of DMS relative to other sulfate tracers + real, intent(in) :: fMassDMS ! gram molecular weight of DMS + + +! !INOUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: dms ! dms [kg kg-1] + real, pointer, dimension(:,:,:) :: SU_emis ! SU emissions, kg/m2/s + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc ! Error return code: + ! 0 - all is well + +! !DESCRIPTION: Computes the dust emissions for one time step +! +! !REVISION HISTORY: +! +! 11Feb2020 E.Sherman - First attempt at refactor +! + +! !Local Variables + integer :: i, j, k + integer :: i1=1, j1=1, i2, j2 + + real, dimension(:,:), allocatable :: srcDMS + real :: sCO2, schmidt, w10m, akw, sst + +!EOP +!------------------------------------------------------------------------- +! Begin + +! Add in the DMS source +! --------------------- +! DMS emissions go into the lowest model layer only +! The transfer of DMS from the ocean surface to the atmosphere is +! a function of surface temperature and wind speed. +! For now we use the lowest atmospheric temperature (really want SST) +! and the 10-m wind speed. +! This code follows from GOCART with the following notes: +! :the Schmidt number for CO2 is assumed to be 600 +! :the Schmidt number of DMSo follows Saltzman et al., 1993 +! :the Schmidt number dependence breaks for high SST +! :following www.knmi.nl/~velthove/TM/input we introduce a maximum +! temperature of 28 C for the calculation +! :the w10m dependence is from Liss and Merlivat (1986) +! All this needs some thorough checking! + + i2 = size(tmpu,1) + j2 = size(tmpu,2) + + allocate(srcDMS(i2,j2)) + + k = km + sCO2 = 600. + do j = j1, j2 + do i = i1, i2 + sst = tmpu(i,j,k)-273.15 + if(sst .gt. 28.) sst = 28. +! only valid for ocean and warm enough temperatures + if( (oro(i,j) /= OCEAN) .or. (sst .lt. -20.)) cycle + schmidt = 2764.0 - 147.12*sst + 3.726*(sst**2.) - 0.038*(sst**3.) +! w10m is the 10-m wind speed in m s-1 + w10m = sqrt(u10m(i,j)**2. + v10m(i,j)**2.) + if(w10m .le. 3.6) then + akw = 0.17*w10m*((sCO2/schmidt)**0.667) + else if (w10m .le. 13.) then + akw = (2.85*w10m - 9.65)*sqrt(sCO2/schmidt) + else + akw = (5.90*w10m - 49.3)*sqrt(sCO2/schmidt) + endif +! This parameterization has put akw in units cm hr-1 -> goto m s-1 + akw = akw/100./3600. +! DMSo concentration is nMol/L +! Want to put the source into units of kg m-2 s-1 + srcDMS(i,j) = akw * (fmassDMS/1000.)*(dmso_conc(i,j)*1.e-9/1.e-3) + dms(i,j,k) = dms(i,j,k) + srcDMS(i,j)*cdt*grav/delp(i,j,k) + end do + end do + + if( associated(SU_emis )) SU_emis(:,:,ndms) = srcDMS + + + end subroutine DMSemission + + +!================================================================================== +!BOP +! !IROUTINE: SUvolcanicEmissions + +! subroutine SUvolcanicEmissions (nVolc, vStart, vEnd, vSO2, vElev, vCloud, iPoint, & +! jPoint, nhms, SO2EMVN, SO2EMVE, SO2, km, cdt, grav, & +! airdens, delp, area, vLat, vLon, rc) + + subroutine SUvolcanicEmissions (nVolc, vStart, vEnd, vSO2, vElev, vCloud, iPoint, & + jPoint, nhms, SO2EMVN, SO2EMVE, SO2, km, cdt, grav,& + hghte, delp, area, vLat, vLon, rc) +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: nVolc ! number of emissions + integer, dimension(:), intent(in) :: vStart ! emission start time [sec] + integer, dimension(:), intent(in) :: vEnd ! emission end time [sec] + real, dimension(:), intent(in) :: vSO2 ! volcanic emission from file [kg] + real, dimension(:), intent(in) :: vCloud ! top elevation of emissions [m] + integer, dimension(:), intent(in) :: iPoint, jPoint ! sub-domain locations of volcanos + integer, intent(in) :: nhms ! current model time [sec] + integer, intent(in) :: km ! number of model levels + real, intent(in) :: cdt ! model time step [sec] + real, pointer, dimension(:,:,:) :: hghte ! top of layer geopotential height [m] + real, intent(in) :: grav ! gravity [m sec-1] +! real, dimension(:,:,:), intent(in) :: airdens ! layer air density [kg/m^3] + real, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, dimension(:,:), intent(in) :: area ! area of grid cell [m^2] + real, dimension(:), intent(in) :: vLat ! latitude specified in file [degree] + real, dimension(:), intent(in) :: vLon ! longitude specified in file [degree] +! !INOUT PARAMETERS: + real, pointer, dimension(:,:), intent(inout) :: SO2EMVN ! non-explosive volcanic emissions [kg m-2 s-1] + real, pointer, dimension(:,:), intent(inout) :: SO2EMVE ! explosive volcanic emissions [kg m-2 s-1] + real, pointer, dimension(:,:,:), intent(inout) :: SO2 ! SO2 [kg kg-1] + real, dimension(:), intent(inout) :: vElev ! bottom elevation of emissions [m] + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc ! Error return code: + ! 0 - all is well + +! !DESCRIPTION: +! +! !REVISION HISTORY: +! +! 22July2020 E.Sherman +! + +! !Local Variables + integer :: i, j, it + real, dimension(:,:,:), allocatable :: emissions_point + real :: so2volcano + + real :: hup, hlow, dzvolc, dz, z1, k + real :: deltaSO2v + real, dimension(:,:), allocatable :: z0 + +!EOP +!------------------------------------------------------------------------- +! Begin + + do it = 1, nVolc + so2volcano = 0. + i = iPoint(it) + j = jPoint(it) + +! Skip this volcano? + if (i<1 .or. j<1) cycle ! volcano not in sub-domain + +! Check time against time range of eruption + if(nhms < vStart(it) .or. nhms >= vEnd(it)) cycle + +! Emissions per volcano + if(area(i,j) > 1.) then + so2volcano = vSO2(it) / area(i,j) ! to kg SO2/sec/m2 + so2volcano = max(so2volcano,tiny(so2volcano)) + endif + if (vElev(it) == vCloud(it)) then + if(associated(SO2EMVN)) SO2EMVN(i,j) = SO2EMVN(i,j) + so2volcano +! Database provides altitude of top of volcano cone (vElev) and altitude +! of plume top (vCloud). If vCloud != vElev then distribute emissions +! in top 1/3 of column extending from vElev to vCloud (case of explosive +! eruption), else put emissions in grid cell containing vElev (degassing) + else if (vElev(it) /= vCloud(it)) then + vElev(it) = vCloud(it) - (vCloud(it) - vElev(it)) / 3 + if(associated(SO2EMVE)) SO2EMVE(i,j) = SO2EMVE(i,j) + so2volcano + end if + end do + +! Loop over all volcanoes in the database + allocate(z0, mold=area) + z0 = hghte(:,:,km) + + if(nvolc > 0) then + do it = 1, nvolc + + i = iPoint(it) + j = jPoint(it) + +! Skip this volcano? +! ------------------ + if ( i<1 .OR. j<1 ) cycle ! volcano not in sub-domain +! if(doingMasking) then +! if( mask(i,j) == 0 ) cycle +! end if + +! Check time against time range of eruption +! ----------------------------------------- + if(nhms < vStart(it) .or. nhms >= vEnd(it)) cycle + + so2volcano = 0. + +! Emissions per volcano +! ------------------------------------------------------------------------------- + if(area(i,j) .gt. 1.) then + so2volcano = vSO2(it) /area(i,j) ! to kg SO2/sec/m2 + so2volcano = max(so2volcano,tiny(so2volcano)) + endif + +! Distribute in the vertical +! Database provides altitude of top of volcano cone (vElev) and altitude +! of plume top (vCloud). If vCloud != vElev then distribute emissions +! in top 1/3 of column extending from vElev to vCloud (case of explosive +! eruption), else put emissions in grid cell containing vElev (degassing) +! -------------------------- + hup = vCloud(it) + hlow = vElev(it) + if (hup .ne. hlow) then + hlow = hup - (hup-hlow)/3. + endif + + dzvolc = hup-hlow + do k = km, 1, -1 + z1 = hghte(i,j,k-1) ! geopotential altitude at gridbox top + dz = z1-z0(i,j) ! thickness of gridbox + deltaSO2v = 0. + +! Volcano is above this level +! --------------------------- + if(z1 .lt. hlow) then + z0(i,j) = z1 + cycle + end if + +! Volcano is below this level (except at surface) +! ----------------------------------------------- + if(z0(i,j) .gt. hup .and. k .ne. km) then + z0(i,j) = z1 + cycle + end if + +! Volcano is in this level +! ------------------------ + if( (k .eq. km .and. z0(i,j) .gt. hup) .or. & ! below surface + (z0(i,j) .le. hlow .and. z1 .ge. hup) ) then ! in level + deltaSO2v = so2volcano + +! Volcano only partly in level ! Cell: +! ---------------------------- + else if (z0(i,j) .lt. hlow .and. z1 .lt. hup) then ! has bottom of cloud + deltaSO2v = (z1-hlow)/dzvolc*so2volcano + + else if (z0(i,j) .gt. hlow .and. z1 .gt. hup) then ! has top of cloud + deltaSO2v = (hup-z0(i,j))/dzvolc*so2volcano + + else ! is filled with cloud + deltaSO2v = dz/dzvolc*so2volcano + end if + + z0(i,j) = z1 + so2(i,j,k) = so2(i,j,k) + deltaSO2v*cdt*grav/delp(i,j,k) + + end do ! k + enddo ! it + end if + + +#if 0 + allocate(emissions_point, mold=SO2) + emissions_point = 0.0 + call updatePointwiseEmissions (km, vElev, vCloud, vSO2, nVolc, & + vStart, vEnd, hghte, & + area, iPoint, jPoint, nhms, emissions_point, rc) + + SO2 = SO2 + cdt * grav / delp * emissions_point +#endif + + rc = 0 +!print*,'sum(emissions_point) = ',sum(emissions_point) + +#if 0 +block + use pflogger + class (logger), pointer :: lgr + lgr => logging%get_logger('volcanic_emissions') + + do it = 1, nVolc + i = iPoint(it) + j = jPoint(it) + if (i<1 .or. j<1) cycle ! volcano not in sub-domain + if(nhms < vStart(it) .or. nhms >= vEnd(it)) cycle + call lgr%debug('emissions at %g0 %g0 : %g25.17', vLat(it), vLon(it), sum(emissions_point(i,j,:))) + end do +end block +#endif + + end subroutine SUvolcanicEmissions + +!================================================================================== +!BOP +! !IROUTINE: SulfateUpdateOxidants + +! subroutine SulfateUpdateOxidants (using_GMI_OH, using_GMI_NO3, using_GMI_H2O2, & +! nymd_current, nhms_current, lonRad, latRad, & +! rhoa, km, cdt, & +! nymd_last, undefval, & +! oh_clim, no3_clim, h2o2_clim, & +! xoh, xno3, xh2o2, recycle_h2o2, rc) + + subroutine SulfateUpdateOxidants (nymd_current, nhms_current, lonRad, latRad, & + rhoa, km, cdt, & + nymd_last, undefval, & + oh_clim, no3_clim, h2o2_clim, & + xoh, xno3, xh2o2, recycle_h2o2, rc) +! !USES: + implicit NONE + +! !INPUT PARAMETERS: +! logical, intent(in) :: using_GMI_OH, & ! are these oxidants coming from GMI? +! using_GMI_NO3, & +! using_GMI_H2O2 + integer, intent(in) :: nymd_current, & ! current model NYMD + nhms_current ! current model NHMS + real, dimension(:,:), intent(in) :: lonRad, latRad ! model grid lon and lat + real, dimension(:,:,:), intent(in) :: rhoa ! layer air density [kg/m^3] + integer, intent(in) :: km ! number of model levels + real, intent(in) :: cdt ! chemistry model time-step + integer, intent(inout) :: nymd_last ! NYMD of last emission update + real, intent(in) :: undefval ! value for undefined values + real, pointer, dimension(:,:,:) :: oh_clim, & ! climatological OH + no3_clim, & ! climatological NO3 + h2o2_clim ! climatological H2O2 + real, dimension(:,:,:), intent(inout) :: xoh, xno3, xh2o2 ! returned oxidant values + logical, intent(inout) :: recycle_h2o2 + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc ! Error return code: + ! 0 - all is well + +! !DESCRIPTION: Update Oxidant Fields for Sulfate +! We have 3 oxidant fields (OH, NO3, H2O2) which may come +! from either a climatological file or from interactive GMI. +! IF from climatology, update (reset) values from climatology +! if necessary (e.g., for a new day) and set to current values +! needed by chemistry. +! IF from GMI read as is + +! +! !REVISION HISTORY: +! ??? ??? - Legacy code +! 23July2020 E.Sherman - ported/refactored for use in process library. +! + +! !Local Variables + integer :: i, j, k, jday + real :: qmax, xhour, xhouruse + real, dimension(:,:), allocatable :: cossza, sza + real, dimension(:,:), allocatable :: tcosz, tday, tnight + integer :: n, ndystep + integer :: i1=1, j1=1, i2, j2 + + +! REPLACE WITH MAPL!!!!! +!************************** +!data pi / 3.1415926 / +real, parameter :: radToDeg = 57.2957795 +real, parameter :: nAvogadro = 6.022e23 ! molecules per mole of air +real, parameter :: pi = 3.1415926, rearth = 6.37e6 +real, parameter :: airMolWght = 28.97 ! molecular weight of air +!************************* + + + +!EOP +!------------------------------------------------------------------------- +! Begin... + + i2 = size(rhoa,1) + j2 = size(rhoa,2) + + allocate(cossza(i1:i2,j1:j2), sza(i1:i2,j1:j2), tcosz(i1:i2,j1:j2), & + tday(i1:i2,j1:j2), tnight(i1:i2,j1:j2)) + +! Update emissions/production if necessary (daily) +! ----------------------------------------------- +! Oxidant fields +! The expectation here is that OH is being read in the form +! volume mixing ratio from a file (so, like GMI would provide). +! Below, in the scaling by solar zenith angle, we convert from +! VMR to # cm-3 expected by the chemistry. + where(1.01*oh_clim(i1:i2,j1:j2,1:km) > undefval) oh_clim(i1:i2,j1:j2,1:km) = 0. + where( oh_clim(i1:i2,j1:j2,1:km) < 0 ) oh_clim(i1:i2,j1:j2,1:km) = 0. + + where(1.01*no3_clim(i1:i2,j1:j2,1:km) > undefval) no3_clim(i1:i2,j1:j2,1:km) = 0. + where( no3_clim(i1:i2,j1:j2,1:km) < 0 ) no3_clim(i1:i2,j1:j2,1:km) = 0. + + where(1.01*h2o2_clim(i1:i2,j1:j2,1:km) > undefval) h2o2_clim(i1:i2,j1:j2,1:km) = 0. + where( h2o2_clim(i1:i2,j1:j2,1:km) < 0 ) h2o2_clim(i1:i2,j1:j2,1:km) = 0. + +! The first time through the reads we will save the h2o2 monthly +! average in the instantaneous field +! --------------------------------- + if (nymd_last == nymd_current) then + xh2o2 = h2o2_clim + nymd_last = nymd_current + end if + +! Find the day number of the year and hour (needed for later doing sza) +! ---------------------------------- + jday = idaynum(nymd_current) + xhour = ( real(nhms_current/10000)*3600. & + + real(mod(nhms_current,10000)/100)*60. & + + real(mod(nhms_current,100)) & + ) / 3600. + +! Recycle H2O2 to input on 3 hour boundaries if not coupled to GMI +! ---------------------------------- + if (recycle_h2o2) then + xh2o2 = h2o2_clim + recycle_h2o2 = .false. + end if + +! If not getting instantaneous values from GMI, update for time of day. +! --------------------------------------------------------------------- +! OH + xoh = oh_clim + cossza(:,:) = 0. + +! Want to find the sum of the cos(sza) for use in scaling OH diurnal variation +! tcosz is the sum of cossza over the whole day +! tday is the time of day spent in light +! Requires integrating over future times, so cannot use w_c%cosz + xHourUse = xHour + ndystep = 86400. / cdt + tcosz(:,:) = 0. + tday(:,:) = 0. + do n = 1, ndystep + call szangle(jday,xHourUse,lonRad,latRad,PI,radToDeg,sza,cossza, i2, j2) + tcosz = tcosz + cossza + xHourUse = xHourUse + cdt/3600. + if(xHourUse .gt. 24.) xHourUse = xHourUse - 24. +! Find the daylight portion of the day + do j = j1, j2 + do i = i1, i2 + if(cossza(i,j) .gt. 0.) tday(i,j) = tday(i,j) + cdt + end do + end do + end do + +! Find the cos(sza) now for use in scaling OH and NO3 + call szangle(jday,xHour,lonRad,latRad,PI,radToDeg,sza,cossza, i2, j2) + + tnight(i1:i2,j1:j2) = (86400.-tday(i1:i2,j1:j2)) + + do k = 1, km + where (tcosz(i1:i2,j1:j2) > 0) + xoh(i1:i2,j1:j2,k) = oh_clim(i1:i2,j1:j2,k)*(86400./cdt)*cossza(i1:i2,j1:j2) / tcosz(i1:i2,j1:j2) + elsewhere + xoh(i1:i2,j1:j2,k) = 0.00 + end where + end do + where(xoh(i1:i2,j1:j2,1:km) < 0.00) xoh(i1:i2,j1:j2,1:km) = 0.00 + +! To go from volume mixing ratio to # cm-3 (expected in chemistry) +! include the following line + xoh = xoh * 1000.*rhoa / airMolWght * nAvogadro * 1.e-6 + +! NO3 + xno3 = no3_clim + cossza(:,:) = 0. + call szangle(jday,xHour,lonRad,latRad,PI,radToDeg,sza,cossza, i2, j2) + +! If there is daylight then no3 is small (assume zero) and the +! average is distributed only over the night time portion + + do k=1,km + where(cossza(i1:i2,j1:j2) > 0 .OR. tnight(i1:i2,j1:j2) < tiny(1.0)) + xno3(i1:i2,j1:j2,k) = 0.00 + elsewhere + xno3(i1:i2,j1:j2,k) = no3_clim(i1:i2,j1:j2,k) * 86400./ tnight(i1:i2,j1:j2) + end where + end do + + rc = 0 + + end subroutine SulfateUpdateOxidants + +!================================================================================== +!BOP +! !IROUTINE: SulfateUpdateOxidants + + subroutine szangle (jday, xhour, lonRad, latRad, PI, radToDeg, sza, cossza, i2, j2) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: jday ! day # of the year + real, intent(in) :: xhour + real, dimension(:,:), intent(in) :: lonRad, latRad ! model grid lon and lat + real, intent(in) :: PI, radToDeg + real, dimension(:,:), intent(inout) :: cossza, sza + integer, intent(in) :: i2, j2 ! size of i and j grid dimensions + +! !OUTPUT PARAMETERS: + +! !DESCRIPTION: given locations and hour find the sza +! from legacy GOCART (source?) + +! +! !REVISION HISTORY: +! 29July2004 P.Colarco - legacy code +! 23July2020 E.Sherman - ported to process library. + +! !Local Variables + integer :: i, j, i1=1, j1=1 + real :: a0, a1, a2, a3, b1, b2, b3, r, dec + real :: timloc, ahr, xlon, rlat + + a0 = 0.006918 + a1 = 0.399912 + a2 = 0.006758 + a3 = 0.002697 + b1 = 0.070257 + b2 = 0.000907 + b3 = 0.000148 + r = 2.*pi*float(jday-1)/365. ! where jday is day # of the year + + +!EOP +!------------------------------------------------------------------------- +! Begin + +! dec is the solar declination in radians + dec = a0 - a1*cos( r) + b1*sin( r) & + - a2*cos(2.*r) + b2*sin(2.*r) & + - a3*cos(3.*r) + b3*sin(3.*r) + + do j = j1, j2 + do i = i1, i2 +! timloc is the local time in hours + xlon = lonRad(i,j)*radToDeg + timloc = xhour + xlon/15. + if(timloc .lt. 0.) timloc = timloc+24. + if(timloc .gt. 24.) timloc = timloc-24. +! ahr is the hour angle in radians + ahr = abs(timloc - 12.)*15.*pi/180. + rlat = latRad(i,j) + cossza(i,j) = sin(rlat)*sin(dec) & + + cos(rlat)*cos(dec)*cos(ahr) + + cossza(i,j) = min(max(cossza(i,j),-1.0),1.0) !ALT make sure cos stays between -1.0 and 1.0 + sza(i,j) = acos(cossza(i,j)) * radToDeg + if(cossza(i,j) .lt. 0.) cossza(i,j) = 0. + end do + end do + + end subroutine szangle + +!================================================================================== +!BOP +! !IROUTINE: idaynum + + integer function idaynum (nymd) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer :: nymd + +! !OUTPUT PARAMETERS: + +! !DESCRIPTION: Given nymd compute the day number of the year. + +! +! !REVISION HISTORY: +! 29July2004 P.Colarco - Legacy code +! 23July2020 E.Sherman - moved from SulfateChemDriverMod.F90 for use in process library. + +! !Local Variables + + integer :: yyyy, mm, dd, imon, isleapyr + integer :: ndays(12) + + data ndays /31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/ + + yyyy = nymd / 10000 + mm = mod(nymd,10000) / 100 + dd = mod(nymd,100) + +!EOP +!------------------------------------------------------------------------- +! Begin... + +! Is it a leap year? + isleapyr = 0 + if(mod(yyyy,4) .eq. 0) then + isleapyr = 1 + if(mod(yyyy,100) .eq. 0) then + isleapyr = 0 + if(mod(yyyy,400) .eq. 0) then + isleapyr = 1 + endif + endif + endif + +! What day number + idaynum = 0 + if(mm .eq. 1) then + idaynum = dd + else + do imon = 1, mm-1 + if(imon .eq. 2 .and. isleapyr .eq. 1) then + idaynum = idaynum+29 + else + idaynum = idaynum + ndays(imon) + endif + enddo + idaynum = idaynum + dd + endif + + return + end function idaynum + +!================================================================================== +!BOP +! !IROUTINE: SU_Wet_Removal + + subroutine SU_Wet_Removal ( km, nbins, klid, cdt, kin, grav, airMolWght, delp, fMassSO4, fMassSO2, & + h2o2_int, ple, rhoa, precc, precl, pfllsan, pfilsan, tmpu, & + nDMS, nSO2, nSO4, nMSA, DMS, SO2, SO4, MSA, & + fluxout, pSO4_colflux, pSO4wet_colflux, & + pso4, pso4wet, rc ) + + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + + integer, intent(in) :: km, nbins ! number of model levels and number of species respectively + integer, intent(in) :: klid ! index for pressure lid + real, intent(in) :: cdt ! chemisty model timestep + logical, intent(in) :: KIN ! true for aerosol + real, intent(in) :: grav ! gravity [m/sec] + real, intent(in) :: airMolWght ! air molecular weight [kg] + real, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, intent(in) :: fMassSO4, fMassSO2 + real, dimension(:,:,:) :: h2o2_int + real, pointer, dimension(:,:,:), intent(in) :: ple ! level edge air pressure + real, pointer, dimension(:,:,:), intent(in) :: rhoa ! air density, [kg m-3] + real, pointer, dimension(:,:), intent(in) :: precc ! total convective precip, [mm day-1] + real, pointer, dimension(:,:), intent(in) :: precl ! total large-scale prec, [mm day-1] + real, pointer, dimension(:,:,:), intent(in) :: pfllsan ! 3D flux of liquid nonconvective precipitation [kg/(m^2 sec)] + real, pointer, dimension(:,:,:), intent(in) :: pfilsan ! 3D flux of ice nonconvective precipitation [kg/(m^2 sec)] + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature, [K] + integer, intent(in) :: nDMS, nSO2, nSO4, nMSA !index position of sulfates + real, dimension(:,:,:), intent(inout) :: DMS ! [kg/kg] + real, dimension(:,:,:), intent(inout) :: SO2 ! [kg/kg] + real, dimension(:,:,:), intent(inout) :: SO4 ! [kg/kg] + real, dimension(:,:,:), intent(inout) :: MSA ! [kg/kg] + +! !OUTPUT PARAMETERS: + real, pointer, dimension(:,:,:),intent(inout) :: fluxout + real, pointer, dimension(:,:),intent(inout) :: pSO4_colflux + real, pointer, dimension(:,:),intent(inout) :: pSO4wet_colflux + real, pointer, dimension(:,:,:),intent(inout) :: pso4 + real, pointer, dimension(:,:,:),intent(inout) :: pso4wet + integer, optional, intent(out) :: rc ! Error return code: + ! 0 - all is well + + +! !DESCRIPTION: Updates the SU concentration due to chemistry +! The SU grid component is currently established with 4 different +! species (bins) following this convection: +! 1) DMS +! 2) SO2 +! 3) SO4 +! 4) MSA +! Accordingly we have 4 chemical cycles to follow through, which are +! sub-subroutines under this one. +! The chemistry is a function of OH, NO3, and H2O2 concentrations +! as well as DMS, SO2, SO4, MSA concentrations. It is also a function +! of solar zenith angle and temperature. We pass in temperature. SZA +! will be a function of time of day and lat/lon. For now we simply add +! this to the grid component before calculating it. I bet this is +! somewhere else in the model. + +! +! !REVISION HISTORY: +! +! +! !Local Variables + integer :: i1=1, j1=1, i2, j2 + integer :: dims(3) + + integer :: i, j, k, iit, n, LH, kk, ios +! real :: pdog(i1:i2,j1:j2,km) ! air mass factor dp/g [kg m-2] + real, dimension(:,:,:), allocatable :: pdog ! air mass factor dp/g [kg m-2] + real*8 :: Td_ls, Td_cv ! ls and cv timescales [s] + real*8 :: pls, pcv, pac ! ls, cv, tot precip [mm day-1] + real*8 :: qls(km), qcv(km) ! ls, cv portion of moisture tendency [kg m-3 s-1] + real*8 :: qmx, qd, A ! temporary variables on moisture + real*8 :: F, B, BT ! temporary variables on cloud, freq. + real*8, allocatable :: fd(:,:) ! flux across layers [kg m-2] + real*8, allocatable :: dpfli(:,:,:) ! + real*8, allocatable :: DC(:) ! scavenge change in mass mixing ratio +! real :: c_h2o(i1:i2,j1:j2,km), cldliq(i1:i2,j1:j2,km), cldice(i1:i2,j1:j2,km) + real, dimension(:,:,:), allocatable :: c_h2o, cldliq, cldice + real, parameter :: kb = 1.3807e-23 ! Boltzmann constant [kg m2 s-1 K-1 mol-1] + +! Rain parameters (from where?) + real, parameter :: B0_ls = 1.0e-4 + real, parameter :: F0_ls = 1.0 + real, parameter :: XL_ls = 5.0e-4 + real, parameter :: B0_cv = 1.5e-3 + real, parameter :: F0_cv = 0.3 + real, parameter :: XL_cv = 2.0e-3 + real, parameter :: one = 1.0, zero = 0.0 + +! Conversion of SO2 mmr to SO2 vmr (since H2O2 is carried around like +! a volume mixing ratio) + real*8 :: fmr, SO2Soluble + fMR = airMolWght / fMassSO2 + +!EOP +!------------------------------------------------------------------------- +! Begin + + allocate(c_h2o, mold=rhoa) + allocate(cldliq, mold=rhoa) + allocate(cldice, mold=rhoa) +! Initialize local variables +! -------------------------- +! c_h2o, cldliq, and cldice are respectively intended to be the +! water mixing ratio (liquid or vapor?, in or out of cloud?) +! cloud liquid water mixing ratio +! cloud ice water mixing ratio + c_h2o = (10d0**(-2663.5d0/tmpu(:,:,:) + 12.537d0 ) ) / & + (ple(:,:,0:km-1)+ple(:,:,1:km)) /2d0 + cldliq = 0.d0 + where(tmpu > 248.) cldliq = 1.d-6 * ( ( tmpu - 248.d0) / 20.d0 ) + where(tmpu >= 268.) cldliq = 1.d-6 + cldice = 1.d-6 - cldliq + + dims = shape(rhoa) + i2 = dims(1); j2 = dims(2) + + do n = 1, nbins + if( associated(fluxout)) fluxout(:,:,n) = 0.0 + end do + if( associated(pso4wet_colflux)) pso4wet_colflux(i1:i2,j1:j2) = 0. + if( associated(pso4wet)) pso4wet(i1:i2,j1:j2,1:km) = 0. + +! Allocate the dynamic arrays + allocate(fd(km,nbins),stat=ios) + if(ios .ne. 0) stop + allocate(dc(nbins),stat=ios) + if(ios .ne. 0) stop + allocate(dpfli(i1:i2, j1:j2, km),stat=ios) + if(ios .ne. 0) stop + +! Duration of rain: ls = model timestep, cv = 1800 s (<= cdt) + Td_ls = cdt + Td_cv = 1800. + +! Accumulate the 3-dimensional arrays of rhoa and pdog + pdog = delp/grav + + dpfli = pfllsan(:,:,1:km)-pfllsan(:,:,0:km-1)+pfilsan(:,:,1:km)-pfilsan(:,:,0:km-1) + +! Loop over spatial indices + do j = j1, j2 + do i = i1, i2 + +! Check for total precipitation amount +! Assume no precip in column if precl+precc = 0 + pac = precl(i,j) + precc(i,j) + if(pac .le. 0.) goto 100 + pls = precl(i,j) + pcv = precc(i,j) + +! Initialize the precipitation fields + qls(:) = 0. + qcv(:) = 0. + fd(:,:) = 0. + Dc(:) = 0. + +! Find the highest model layer experiencing rainout. Assumes no +! scavenging if T < 258 K + LH = 0 +! do k = 1, km + do k = klid, km + if(dpfli(i,j,k) .gt. 0. .and. tmpu(i,j,k) .gt. 258.) then + LH = k + goto 15 + endif + end do + 15 continue + if(LH .lt. 1) goto 100 + + do k = LH, km + qls(k) = dpfli(i,j,k)/pdog(i,j,k)*rhoa(i,j,k) + end do + +! Loop over vertical to do the scavenging! + do k = LH, km + +!----------------------------------------------------------------------------- +! (1) LARGE-SCALE RAINOUT: +! Tracer loss by rainout = TC0 * F * exp(-B*dt) +! where B = precipitation frequency, +! F = fraction of grid box covered by precipitating clouds. +! We assume that tracer scavenged by rain is falling down to the +! next level, where a fraction could be re-evaporated to gas phase +! if Qls is less then 0 in that level. +!----------------------------------------------------------------------------- + if (qls(k) .gt. 0.) then + F = F0_ls / (1. + F0_ls*B0_ls*XL_ls/(qls(k)*cdt/Td_ls)) + B = B0_ls/F0_ls +1./(F0_ls*XL_ls/qls(k)) + BT = B * Td_ls + if (BT.gt.10.) BT = 10. !< Avoid overflow > +! What is the soluble amount of SO2? + SO2Soluble = min(fmr*SO2(i,j,k),h2o2_int(i,j,k)*one)/fmr + if(SO2Soluble .lt. 0.) SO2Soluble = 0. + +! Adjust SU amounts + DC(nDMS) = 0. + DC(nSO2) = SO2Soluble * F * (1.-exp(-BT)) + DC(nSO4) = SO4(i,j,k) * F * (1.-exp(-BT)) + DC(nMSA) = MSA(i,j,k) * F * (1.-exp(-BT)) + +! Adjust H2O2 concentration in cloudy portion of cell + if(fmr*SO2(i,j,k) .gt. h2o2_int(i,j,k)) then +! gcSU%h2o2_int(i,j,k) = max(zero,(1.-F)*gcSU%h2o2_int(i,j,k)) +! GOCART removes all + h2o2_int(i,j,k) = 0. + else + h2o2_int(i,j,k) & + = h2o2_int(i,j,k) - F*fmr*SO2(i,j,k) + endif + + do n = 1, nbins + if (DC(n).lt.0.) DC(n) = 0. + end do + + call updateAerosol(DMS(i,j,k), DC(nDMS)) + call updateAerosol(SO2(i,j,k), DC(nSO2)) + call updateAerosol(SO4(i,j,k), DC(nSO4)) + call updateAerosol(MSA(i,j,k), DC(nMSA)) + +! Flux down: unit is kg m-2 +! Formulated in terms of production in the layer. In the revaporation step +! we consider possibly adding flux from above... + do n = 1, nbins + Fd(k,n) = DC(n) * pdog(i,j,k) + end do + + end if ! if Qls > 0 >>> + +!----------------------------------------------------------------------------- +! * (2) LARGE-SCALE WASHOUT: +! * Occurs when rain at this level is less than above. +!----------------------------------------------------------------------------- + if(k .gt. LH .and. qls(k) .ge. 0.) then + if(qls(k) .lt. qls(k-1)) then +! Find a maximum F overhead until the level where Qls<0. + Qmx = 0. + do kk = k-1,LH,-1 + if (Qls(kk).gt.0.) then + Qmx = max(Qmx,Qls(kk)) + else + goto 333 + end if + end do + + 333 continue + F = F0_ls / (1. + F0_ls*B0_ls*XL_ls/(Qmx*cdt/Td_ls)) + if (F.lt.0.01) F = 0.01 + +!----------------------------------------------------------------------------- +! The following is to convert Q(k) from kgH2O/m3/sec to mm/sec in order +! to use the Harvard formula. Convert back to mixing ratio by multiplying +! by rhoa. Multiply by pdog gives kg/m2/s of precip. Divide by density +! of water (=1000 kg/m3) gives m/s of precip and multiply by 1000 gives +! units of mm/s (omit the multiply and divide by 1000). +!----------------------------------------------------------------------------- + + Qd = Qmx /rhoa(i,j,k)*pdog(i,j,k) + if (Qd.ge.50.) then + B = 0. + else + B = Qd * 0.1 + end if + BT = B * cdt + if (BT.gt.10.) BT = 10. + +! What is the soluble amount of SO2? + SO2Soluble = min(fmr*SO2(i,j,k),h2o2_int(i,j,k)*one)/fmr + if(SO2Soluble .lt. 0.) SO2Soluble = 0. + +! Adjust SU amounts + DC(nDMS) = 0. + DC(nSO2) = SO2Soluble * F * (1.-exp(-BT)) + DC(nSO4) = SO4(i,j,k) * F * (1.-exp(-BT)) + DC(nMSA) = MSA(i,j,k) * F * (1.-exp(-BT)) + + +! Adjust H2O2 concentration in cloudy portion of cell + if(fmr*SO2(i,j,k) .gt. h2o2_int(i,j,k)) then + h2o2_int(i,j,k) = max(zero,(one-F)*h2o2_int(i,j,k)) +! GOCART removes all +! gcSU%h2o2_int(i,j,k) = 0. + else + h2o2_int(i,j,k) & + = h2o2_int(i,j,k) - F*fmr*SO2(i,j,k) + endif + + do n = 1, nbins + if (DC(n).lt.0.) DC(n) = 0. + end do + + call updateAerosol(DMS(i,j,k), DC(nDMS)) + call updateAerosol(SO2(i,j,k), DC(nSO2)) + call updateAerosol(SO4(i,j,k), DC(nSO4)) + call updateAerosol(MSA(i,j,k), DC(nMSA)) + + do n = 1, nbins + if( associated(fluxout) ) then + fluxout(i,j,n) = fluxout(i,j,n)+DC(n)*pdog(i,j,k)/cdt + endif + end do + + end if + end if ! if ls washout >>> + +!----------------------------------------------------------------------------- +! (3) CONVECTIVE RAINOUT: +! Tracer loss by rainout = dd0 * F * exp(-B*dt) +! where B = precipitation frequency, +! F = fraction of grid box covered by precipitating clouds. +!----------------------------------------------------------------------------- + if (qcv(k) .gt. 0.) then + F = F0_cv / (1. + F0_cv*B0_cv*XL_cv/(Qcv(k)*cdt/Td_cv)) + B = B0_cv + BT = B * Td_cv + if (BT.gt.10.) BT = 10. !< Avoid overflow > + +! Adjust SO2 for H2O2 oxidation + SO2Soluble = min(fmr*SO2(i,j,k),h2o2_int(i,j,k)*one)/fmr + if(SO2Soluble .lt. 0.) SO2Soluble = 0. + +! Adjust SU amounts + DC(nDMS) = 0. + DC(nSO2) = SO2Soluble * F * (1.-exp(-BT)) + DC(nSO4) = SO4(i,j,k) * F * (1.-exp(-BT)) + DC(nMSA) = MSA(i,j,k) * F * (1.-exp(-BT)) + DC(nSO4) = 0. + DC(nMSA) = 0. + +! Adjust H2O2 concentration in cloudy portion of cell + if(fmr*SO2(i,j,k) .gt. h2o2_int(i,j,k)) then + h2o2_int(i,j,k) = max(zero,(one-F)*h2o2_int(i,j,k)) + else + h2o2_int(i,j,k) & + = h2o2_int(i,j,k) - F*fmr*SO2(i,j,k) + endif + + do n = 1, nbins + if (DC(n).lt.0.) DC(n) = 0. + end do + + call updateAerosol(DMS(i,j,k), DC(nDMS)) + call updateAerosol(SO2(i,j,k), DC(nSO2)) + call updateAerosol(SO4(i,j,k), DC(nSO4)) + call updateAerosol(MSA(i,j,k), DC(nMSA)) + +! Flux down: unit is kg m-2 +! Formulated in terms of production in the layer. In the revaporation step +! we consider possibly adding flux from above... + do n = 1, nbins + Fd(k,n) = Fd(k,n) + DC(n)*pdog(i,j,k) + end do + + end if ! if Qcv > 0 >>> + +!----------------------------------------------------------------------------- +! (4) CONVECTIVE WASHOUT: +! Occurs when rain at this level is less than above. +!----------------------------------------------------------------------------- + + if (k.gt.LH .and. Qcv(k).ge.0.) then + if (Qcv(k).lt.Qcv(k-1)) then +!----- Find a maximum F overhead until the level where Qls<0. + Qmx = 0. + do kk = k-1, LH, -1 + if (Qcv(kk).gt.0.) then + Qmx = max(Qmx,Qcv(kk)) + else + goto 444 + end if + end do + + 444 continue + F = F0_cv / (1. + F0_cv*B0_cv*XL_cv/(Qmx*cdt/Td_cv)) + if (F.lt.0.01) F = 0.01 +!----------------------------------------------------------------------------- +! The following is to convert Q(k) from kgH2O/m3/sec to mm/sec in order +! to use the Harvard formula. Convert back to mixing ratio by multiplying +! by rhoa. Multiply by pdog gives kg/m2/s of precip. Divide by density +! of water (=1000 kg/m3) gives m/s of precip and multiply by 1000 gives +! units of mm/s (omit the multiply and divide by 1000). +!----------------------------------------------------------------------------- + + Qd = Qmx / rhoa(i,j,k)*pdog(i,j,k) + if (Qd.ge.50.) then + B = 0. + else + B = Qd * 0.1 + end if + BT = B * cdt + if (BT.gt.10.) BT = 10. + +! Adjust SO2 for H2O2 oxidation + SO2Soluble = min(fmr*SO2(i,j,k),h2o2_int(i,j,k)*one)/fmr + if(SO2Soluble .lt. 0.) SO2Soluble = 0. + +! Adjust SU amounts + DC(nDMS) = 0. + DC(nSO2) = SO2Soluble * F * (1.-exp(-BT)) +! Sulfate scavenged in moist +! DC(nSO4) = w_c%qa(n1+nSO4-1)%data3d(i,j,k) * F * (1.-exp(-BT)) +! DC(nMSA) = w_c%qa(n1+nMSA-1)%data3d(i,j,k) * F * (1.-exp(-BT)) + DC(nSO4) = 0. + DC(nMSA) = 0. + +! Adjust H2O2 concentration in cloudy portion of cell + if(fmr*SO2(i,j,k) .gt. h2o2_int(i,j,k)) then + h2o2_int(i,j,k) = max(zero,(one-F)*h2o2_int(i,j,k)) + else + h2o2_int(i,j,k) & + = h2o2_int(i,j,k) - F*fmr*SO2(i,j,k) + endif + + do n = 1, nbins + if (DC(n).lt.0.) DC(n) = 0. + end do + + call updateAerosol(DMS(i,j,k), DC(nDMS)) + call updateAerosol(SO2(i,j,k), DC(nSO2)) + call updateAerosol(SO4(i,j,k), DC(nSO4)) + call updateAerosol(MSA(i,j,k), DC(nMSA)) + + do n = 1, nbins + if( associated(fluxout) ) then + fluxout(i,j,n) = fluxout(i,j,n)+DC(n)*pdog(i,j,k)/cdt + endif + end do + + end if + end if ! if cv washout >>> + +!----------------------------------------------------------------------------- +! (5) RE-EVAPORATION. Assume that SO2 is re-evaporated as SO4 since it +! has been oxidized by H2O2 at the level above. +!----------------------------------------------------------------------------- +! Add in the flux from above, which will be subtracted if reevaporation occurs + if(k .gt. LH) then + do n = 1, nbins + Fd(k,n) = Fd(k,n) + Fd(k-1,n) + end do + +! Is there evaporation in the currect layer? + if (dpfli(i,j,k) .lt. 0.) then +! Fraction evaporated = H2O(k)evap / H2O(next condensation level). + if (dpfli(i,j,k-1) .gt. 0.) then + + A = abs( dpfli(i,j,k) / dpfli(i,j,k-1) ) + if (A .gt. 1.) A = 1. + +! Adjust tracer in the level +! For the SO2 tracer we do not allow re-evaporation. +! We compute DC(nSO2) solely to add this to DC(nSO4) and to remove +! from Fd(k,nSO2) +! Instead, the SO2 gets re-evaporated to the SO4 bin because of +! previous H2O2 oxidation + + DC(nDMS) = 0. + DC(nSO2) = Fd(k-1,nSO2) / pdog(i,j,k) * A + DC(nSO4) = Fd(k-1,nSO4) / pdog(i,j,k) * A + DC(nMSA) = Fd(k-1,nMSA) / pdog(i,j,k) * A + do n = 1, nbins + if (DC(n).lt.0.) DC(n) = 0. + end do + + MSA(i,j,k) = MSA(i,j,k) + DC(nMSA) +! SO2 gets added to SO4, but remember to remove the SO2 from FD! + SO4(i,j,k) = SO4(i,j,k) + DC(nSO4) + DC(nSO2)*fMassSO4/fMassSO2 + if( associated(pso4wet_colflux)) & + pso4wet_colflux(i,j) = pso4wet_colflux(i,j) & + + DC(nSO2)*fMassSO4/fMassSO2 / cdt * delp(i,j,k)/grav + if( associated(pso4wet) ) & + pso4wet(i,j,k) = DC(nSO2)*fMassSO4/fMassSO2 / cdt + + if( associated(pso4_colflux)) & + pso4_colflux(i,j) = pso4_colflux(i,j) & + + DC(nSO2)*fMassSO4/fMassSO2 / cdt * delp(i,j,k)/grav + if( associated(pso4) ) & + pso4(i,j,k) = pso4(i,j,k) + DC(nSO2)*fMassSO4/fMassSO2 / cdt + + +! Adjust the flux out of the bottom of the layer--remove SO2 here! + DMS = max(DMS,tiny(1.0)) + Fd(k,nDMS) = Fd(k,nDMS) - DC(nDMS)*pdog(i,j,k) + SO2 = max(SO2,tiny(1.0)) + Fd(k,nSO2) = Fd(k,nSO2) - DC(nSO2)*pdog(i,j,k) + SO4 = max(SO4,tiny(1.0)) + Fd(k,nSO4) = Fd(k,nSO4) - DC(nSO4)*pdog(i,j,k) + MSA = max(MSA,tiny(1.0)) + Fd(k,nMSA) = Fd(k,nMSA) - DC(nMSA)*pdog(i,j,k) + + endif + endif ! if -moistq < 0 + endif + end do ! k + + do n = 1, nbins + if( associated(fluxout) ) then + fluxout(i,j,n) = fluxout(i,j,n)+Fd(km,n)/cdt + endif + end do + + 100 continue + end do ! i + end do ! j + + deallocate(fd,DC,dpfli,stat=ios) + + + contains + subroutine updateAerosol (aerosol, DC) + + ! !USES: + implicit NONE + ! !INPUT PARAMETERS: + real, intent(inout) :: aerosol + real*8, intent(in) :: DC + + aerosol = aerosol - DC + if (aerosol .lt. 1.0E-32) aerosol = 1.0E-32 + + end subroutine updateAerosol + + end subroutine SU_Wet_Removal + +!================================================================================== +!BOP +! !IROUTINE: DustEmissionGOCART2G + + subroutine SU_Compute_Diags ( km, klid, rmed, sigma, rhop, grav, pi, nSO4, mie_table, channels, & + tmpu, rhoa, delp, rh, u, v, & + DMS, SO2, SO4, MSA, & + dmssfcmass, dmscolmass, & + msasfcmass, msacolmass, & + so2sfcmass, so2colmass, & + so4sfcmass, so4colmass, & + exttau, scatau, so4mass, so4conc, extcoef, & + scacoef, angstrom, fluxu, fluxv, sarea, snum, rc ) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! number of model levels + integer, intent(in) :: klid ! index for pressure lid + real, intent(in) :: rmed ! mean radius [um] + real, intent(in) :: sigma ! Sigma of lognormal number distribution + real, intent(in) :: rhop ! dry particle density [kg m-3] + real, intent(in) :: grav ! gravity [m/sec] + real, intent(in) :: pi ! pi constant + integer, intent(in) :: nSO4 ! index of SO4 relative to other internal variables + type(Chem_Mie), intent(in) :: mie_table ! mie table + real, dimension(:), intent(in) :: channels + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, pointer, dimension(:,:,:), intent(in) :: rhoa ! air density [kg/m^3] + real, pointer, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, pointer, dimension(:,:,:), intent(in) :: rh ! relative humidity [1] + real, pointer, dimension(:,:,:), intent(in) :: u ! east-west wind [m s-1] + real, pointer, dimension(:,:,:), intent(in) :: v ! north-south wind [m s-1] + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: DMS ! dimethyl sulfide [kg/kg] + real, dimension(:,:,:), intent(inout) :: SO2 ! sulfer dioxide [kg/kg] + real, dimension(:,:,:), intent(inout) :: SO4 ! sulfate aerosol [kg/kg] + real, dimension(:,:,:), intent(inout) :: MSA ! methanesulphonic acid [kg/kg] + real, pointer, dimension(:,:), intent(inout) :: dmssfcmass ! sfc mass concentration [kg/m3] + real, pointer, dimension(:,:), intent(inout) :: dmscolmass ! col mass density [kg/m2] + real, pointer, dimension(:,:), intent(inout) :: msasfcmass ! sfc mass concentration [kg/m3] + real, pointer, dimension(:,:), intent(inout) :: msacolmass ! col mass density [kg/m2] + real, pointer, dimension(:,:), intent(inout) :: so2sfcmass ! sfc mass concentration [kg/m3] + real, pointer, dimension(:,:), intent(inout) :: so2colmass ! col mass density [kg/m2] + real, pointer, dimension(:,:), intent(inout) :: so4sfcmass ! sfc mass concentration [kg/m3] + real, pointer, dimension(:,:), intent(inout) :: so4colmass ! col mass density [kg/m2] + real, pointer, dimension(:,:), intent(inout) :: exttau ! ext. AOT at 550 nm + real, pointer, dimension(:,:), intent(inout) :: scatau ! sct. AOT at 550 nm + real, pointer, dimension(:,:,:), intent(inout) :: so4mass ! 3D sulfate mass mr + real, pointer, dimension(:,:,:), intent(inout) :: so4conc ! 3D mass concentration, [kg/m3] + real, pointer, dimension(:,:,:), intent(inout) :: extcoef ! 3D ext. coefficient, [1/m] + real, pointer, dimension(:,:,:), intent(inout) :: scacoef ! 3D scat.coefficient, [1/m] + real, pointer, dimension(:,:), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter + real, pointer, dimension(:,:), intent(inout) :: fluxu ! Column mass flux in x direction + real, pointer, dimension(:,:), intent(inout) :: fluxv ! Column mass flux in y direction + real, pointer, dimension(:,:,:), intent(inout) :: sarea ! Sulfate surface area density [m2 m-3] + real, pointer, dimension(:,:,:), intent(inout) :: snum ! Sulfate number density [# m-2] + integer, optional, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + + +! !DESCRIPTION: Calculates some simple 2d diagnostics from the SU fields +! +! !REVISION HISTORY: +! +! 16APR2004, Colarco +! 29july2020, E.Sherman - refactored for process library + +! !Local Variables + integer :: i, j, k, i1=1, j1=1, i2, j2, nch + real :: tau, ssa + real, dimension(:,:), allocatable :: tau470, tau870 + real :: ilam550, ilam470, ilam870 + logical :: do_angstrom + real :: rh_, gf, rwet, svol + + +!EOP +!------------------------------------------------------------------------- +! Begin + + nch = size(channels) + j2 = ubound(tmpu, 2) + i2 = ubound(tmpu, 1) + + allocate(tau470(i1:i2,j1:j2), tau870(i1:i2,j1:j2)) + +! Get the wavelength indices +! -------------------------- +! Must provide ilam550 for AOT calculation + ilam550 = 1. + ilam470 = 0. + ilam870 = 0. + if(nch .gt. 1) then + do i = 1, nch + if ( channels(i) .ge. 5.49e-7 .and. & + channels(i) .le. 5.51e-7) ilam550 = i + if ( channels(i) .ge. 4.69e-7 .and. & + channels(i) .le. 4.71e-7) ilam470 = i + if ( channels(i) .ge. 8.69e-7 .and. & + channels(i) .le. 8.71e-7) ilam870 = i + enddo + endif + +! Determine if going to do Angstrom parameter calculation +! ------------------------------------------------------- + do_angstrom = .false. +! If both 470 and 870 channels provided (and not the same) then +! possibly will do Angstrom parameter calculation + if(ilam470 .ne. 0. .and. & + ilam870 .ne. 0. .and. & + ilam470 .ne. ilam870) do_angstrom = .true. + + +! Calculate the diagnostic variables if requested +! ----------------------------------------------- + +! Calculate the surface mass concentration + if( associated(so4sfcmass) ) then + so4sfcmass(i1:i2,j1:j2) = 0. + so4sfcmass(i1:i2,j1:j2) & + = SO4(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + endif + if( associated(so2sfcmass) ) then + so2sfcmass(i1:i2,j1:j2) = 0. + so2sfcmass(i1:i2,j1:j2) & + = SO2(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + endif + if( associated(dmssfcmass) ) then + dmssfcmass(i1:i2,j1:j2) = 0. + dmssfcmass(i1:i2,j1:j2) & + = DMS(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + endif + if( associated(msasfcmass) ) then + msasfcmass(i1:i2,j1:j2) = 0. + msasfcmass(i1:i2,j1:j2) & + = MSA(i1:i2,j1:j2,km)*rhoa(i1:i2,j1:j2,km) + endif + + +! Initialize the diagnostic variables +! ----------------------------------- + +! Calculate the column loading + if( associated(so4colmass) ) then + so4colmass(i1:i2,j1:j2) = 0. + do k = klid, km + so4colmass(i1:i2,j1:j2) & + = so4colmass(i1:i2,j1:j2) & + + SO4(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav + enddo + endif + if( associated(so2colmass) ) then + so2colmass(i1:i2,j1:j2) = 0. + do k = klid, km + so2colmass(i1:i2,j1:j2) & + = so2colmass(i1:i2,j1:j2) & + + SO2(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav + enddo + endif + if( associated(dmscolmass) ) then + dmscolmass(i1:i2,j1:j2) = 0. + do k = klid, km + dmscolmass(i1:i2,j1:j2) & + = dmscolmass(i1:i2,j1:j2) & + + DMS(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav + enddo + endif + if( associated(msacolmass) ) then + msacolmass(i1:i2,j1:j2) = 0. + do k = klid, km + msacolmass(i1:i2,j1:j2) & + = msacolmass(i1:i2,j1:j2) & + + MSA(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav + enddo + endif + + +! Calculate the mass concentration of sulfate + if( associated(so4conc) ) then + so4conc(i1:i2,j1:j2,1:km) = 0. + so4conc(i1:i2,j1:j2,1:km) = SO4(i1:i2,j1:j2,1:km)*rhoa(i1:i2,j1:j2,1:km) + endif + +! Mass mixing ratio of sulfate + if( associated(so4mass) ) then + so4mass(i1:i2,j1:j2,1:km) = 0. + so4mass(i1:i2,j1:j2,1:km) = SO4(i1:i2,j1:j2,1:km) + endif + +! Calculate the column mass flux in x direction + if( associated(fluxu) ) then + fluxu(i1:i2,j1:j2) = 0. + do k = klid, km + fluxu(i1:i2,j1:j2) & + = fluxu(i1:i2,j1:j2) & + + SO4(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav*u(i1:i2,j1:j2,k) + end do + endif + +! Calculate the column mass flux in y direction + if( associated(fluxv) ) then + fluxv(i1:i2,j1:j2) = 0. + do k = klid, km + fluxv(i1:i2,j1:j2) & + = fluxv(i1:i2,j1:j2) & + + SO4(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav*v(i1:i2,j1:j2,k) + end do + endif + +! Calculate the extinction and/or scattering AOD + if( associated(exttau) .or. associated(scatau) ) then + + if( associated(exttau) ) then + exttau(i1:i2,j1:j2) = 0. + endif + if( associated(scatau) ) then + scatau(i1:i2,j1:j2) = 0. + endif + + if( associated(extcoef) ) then + extcoef(i1:i2,j1:j2,1:km) = 0. + endif + if( associated(scacoef) ) then + scacoef(i1:i2,j1:j2,1:km) = 0. + endif + + do k = klid, km + do j = j1, j2 + do i = i1, i2 + call Chem_MieQuery(mie_table, 1, ilam550, & ! Only SO4 exists in the MieTable, so its index is 1 + SO4(i,j,k)*delp(i,j,k)/grav, & + rh(i,j,k), tau=tau, ssa=ssa) + +! Calculate the total ext. and scat. coefficients + if( associated(extcoef) ) then + extcoef(i,j,k) = extcoef(i,j,k) + & + tau * (grav * rhoa(i,j,k) / delp(i,j,k)) + endif + if( associated(scacoef) ) then + scacoef(i,j,k) = scacoef(i,j,k) + & + ssa * tau * (grav * rhoa(i,j,k) / delp(i,j,k)) + endif + +! Integrate in the vertical + if( associated(exttau) ) then + exttau(i,j) = exttau(i,j) + tau + endif + if( associated(scatau) ) then + scatau(i,j) = scatau(i,j) + tau*ssa + endif + + enddo + enddo + enddo + +! enddo ! nbins + + endif + + +! Calculate the 470-870 Angstrom parameter + if( associated(angstrom) .and. do_angstrom ) then + + angstrom(i1:i2,j1:j2) = 0. +! Set tau to small number by default + tau470(i1:i2,j1:j2) = tiny(1.0) + tau870(i1:i2,j1:j2) = tiny(1.0) + + do k = klid, km + do j = j1, j2 + do i = i1, i2 + + call Chem_MieQuery(mie_table, 1, ilam470, & ! Only SO4 exists in the MieTable, so its index is 1 + SO4(i,j,k)*delp(i,j,k)/grav, rh(i,j,k), tau=tau) + tau470(i,j) = tau470(i,j) + tau + + call Chem_MieQuery(mie_table, 1, ilam870, & + SO4(i,j,k)*delp(i,j,k)/grav,rh(i,j,k), tau=tau) + tau870(i,j) = tau870(i,j) + tau + + enddo + enddo + enddo + +! enddo ! nbins + angstrom(i1:i2,j1:j2) = & + -log(tau470(i1:i2,j1:j2)/tau870(i1:i2,j1:j2)) / & + log(470./870.) + endif + +! Calculate the sulfate surface area density [m2 m-3], possibly for use in +! StratChem or other component. Assumption here is a specified effective +! radius (gcSU%radius for sulfate) and standard deviation of lognormal +! distribution. Hydration is by grid box provided RH and is follows Petters +! and Kreeidenweis (ACP2007) + if(associated(sarea) .or. associated(snum)) then +! rmed = w_c%reg%rmed(n1+nSO4-1) ! median radius, m + if(rmed > 0.) then +! sigma = w_c%reg%sigma(n1+nSO4-1) ! width of lognormal distribution + do k = klid, km + do j = j1, j2 + do i = i1, i2 + rh_ = min(0.95,rh(i,j,k)) + gf = (1. + 1.19*rh_/(1.-rh_) ) ! ratio of wet/dry volume, eq. 5 + rwet = rmed * gf**(1./3.) ! wet effective radius, m +! Wet particle volume m3 m-3 + svol = SO4(i,j,k) * rhoa(i,j,k) / rhop * gf +! Integral of lognormal surface area m2 m-3 + if(associated(sarea)) sarea(i,j,k) = 3./rwet*svol*exp(-5./2.*alog(sigma)**2.) +! Integral of lognormal number density # m-3 + if(associated(snum)) snum(i,j,k) = svol / (rwet**3) * exp(-9/2.*alog(sigma)**2.) * 3./4./pi + enddo + enddo + enddo + endif + endif + + rc = 0 + + end subroutine SU_Compute_Diags + +!================================================================================== +!BOP +! !IROUTINE: SulfateChemDriver + +!#if 0 + subroutine SulfateChemDriver (km, klid, cdt, PI, radToDeg, von_karman, & + airMolWght, nAvogadro, cpd, grav, & + fMassMSA, fMassDMS, fMassSO2, fMassSO4, & + nymd, nhms, lonRad, latRad, & + dms, so2, so4, msa, & + nDMS, nSO2, nSO4, nMSA, & + xoh, xno3, xh2o2, h2o2_init, & + delp, tmpu, cloud, rhoa, hghte, & + ustar, shflux, oro, pblh, z0h, & + SU_dep, SU_PSO2, SU_PMSA, & + SU_PSO4, SU_PSO4g, SU_PSO4aq, & ! 2d diagnostics + pso2, pmsa, pso4, pso4g, pso4aq, drydepositionfrequency, & ! 3d diagnostics + rc) + + + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! number of model levels + integer, intent(in) :: klid ! index for pressure lid + real, intent(in) :: cdt ! chemisty model timestep [sec] + real, intent(in) :: PI ! pi constnat + real, intent(in) :: radToDeg ! radians to degree conversion + real, intent(in) :: von_karman ! Von Karman constant [unitless] + real, intent(in) :: nAvogadro ! Avogadro's number [1/kmol] + real, intent(in) :: airMolWght ! molecular weight of air [kg/kmol] + real, intent(in) :: cpd + real, intent(in) :: grav ! gravity [m/sec] + real, intent(in) :: fMassMSA, fMassDMS, fMassSO2, fMassSO4 ! gram molecular weights of species + integer, intent(in) :: nymd ! model year month day + integer, intent(in) :: nhms ! model hour mintue second + real, dimension(:,:), intent(in) :: lonRad ! model grid lon [radians] + real, dimension(:,:), intent(in) :: latRad ! model grid lat [radians] + real, dimension(:,:,:), intent(inout) :: dms ! dimethyl sulfide [kg/kg] + real, dimension(:,:,:), intent(inout) :: so2 ! sulfer dioxide [kg/kg] + real, dimension(:,:,:), intent(inout) :: so4 ! sulfate aerosol [kg/kg] + real, dimension(:,:,:), intent(inout) :: msa ! methanesulphonic acid [kg/kg] + integer, intent(in) :: nDMS, nSO2, nSO4, nMSA ! index position of sulfates + real, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, pointer, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, dimension(:,:,:), intent(in) :: cloud ! cloud fraction for radiation [1] + real, pointer, dimension(:,:,:), intent(in) :: rhoa ! layer air density [kg/m^3] + real, pointer, dimension(:,:,:), intent(in) :: hghte ! top of layer geopotential height [m] + real, pointer, dimension(:,:), intent(in) :: ustar ! surface velocity scale [m/sec] + real, pointer, dimension(:,:), intent(in) :: shflux ! sensible heat flux from turbulence [w/m^2] + real, pointer, dimension(:,:), intent(in) :: oro ! land-ocean-ice mask + real, pointer, dimension(:,:), intent(in) :: pblh ! planetary boundary layer height [m] + real, pointer, dimension(:,:), intent(in) :: z0h ! surface roughness for heat [m] + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: xoh, xno3, xh2o2 ! OH, NO3, H2O2 respectievly [kg/kg] + real, dimension(:,:,:) :: h2o2_init ! private H2O2 that is saved and used to initialize [kg/kg] + real, pointer, dimension(:,:,:), intent(inout) :: SU_dep ! Sulfate Dry Deposition All Bins [kg m-2 s-1] + real, pointer, dimension(:,:), intent(inout) :: SU_PSO2 ! SO2 Prod from DMS Oxidation [kg m-2 s-1] + real, pointer, dimension(:,:), intent(inout) :: SU_PMSA ! MSA Prod from DMS Oxidation [kg m-2 s-1] + real, pointer, dimension(:,:), intent(inout) :: SU_PSO4 ! SO4 Prod from All SO2 Oxidation [kg m-2 s-1] + real, pointer, dimension(:,:), intent(inout) :: SU_PSO4g ! SO4 Prod from Gaseous SO2 Oxidation [kg m-2 s-1] + real, pointer, dimension(:,:), intent(inout) :: SU_PSO4aq ! SO4 Prod from Aqueous SO2 Oxidation [kg m-2 s-1] + real, pointer, dimension(:,:,:), intent(inout) :: pso2 ! SO2 Prod from DMS oxidation [kg m-2 s-1] + real, pointer, dimension(:,:,:), intent(inout) :: pmsa ! MSA Prod from DMS oxidation [kg m-2 s-1] + real, pointer, dimension(:,:,:), intent(inout) :: pso4 ! SO4 Prod from all SO2 oxidation [kg m-2 s-1] + real, pointer, dimension(:,:,:), intent(inout) :: pso4g ! SO4 Prod from gaseous SO2 oxidation [kg m-2 s-1] + real, pointer, dimension(:,:,:), intent(inout) :: pso4aq ! SO4 Prod from aqueous SO2 oxidation [kg m-2 s-1] + real, dimension(:,:), allocatable, intent(out) :: drydepositionfrequency + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc ! Error return code: + ! 0 - all is well + ! 1 - + +! !DESCRIPTION: Updates the SU concentration due to chemistry +! The SU grid component is currently established with 4 different +! species (bins) following this convection: +! 1) DMS +! 2) SO2 +! 3) SO4 +! 4) MSA +! Accordingly we have 4 chemical cycles to follow through, which are +! sub-subroutines under this one. +! The chemistry is a function of OH, NO3, and H2O2 concentrations +! as well as DMS, SO2, SO4, MSA concentrations. It is also a function +! of solar zenith angle and temperature. We pass in temperature. SZA +! will be a function of time of day and lat/lon. For now we simply add +! this to the grid component before calculating it. I bet this is +! somewhere else in the model. + +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! Based on Ginoux +! 30july2020 E.Sherman - ported to process library +! + +! !Local Variables + real, dimension(:,:), allocatable :: cossza, sza + integer :: k, jday, i2, j2 + real, dimension(:,:,:), allocatable :: pSO2_DMS, pMSA_DMS, pSO4g_SO2, pSO4aq_SO2 +! real, dimension(:,:), allocatable :: drydepositionfrequency + real :: xhour + + + + +!EOP +!------------------------------------------------------------------------- +! Begin + + j2 = ubound(tmpu, 2) + i2 = ubound(tmpu, 1) + + allocate(drydepositionfrequency, mold=oro) + allocate(cossza, mold=oro) + allocate(sza, mold=oro) + +! Reset the production terms + allocate(pSO2_DMS, mold=tmpu) + allocate(pMSA_DMS, mold=tmpu) + allocate(pSO4g_SO2, mold=tmpu) + allocate(pSO4aq_SO2, mold=tmpu) + pSO2_DMS = 0. + pMSA_DMS = 0. + pSO4g_SO2 = 0. + pSO4aq_SO2 = 0. + + if( associated(su_pSO2) ) su_pSO2 = 0. + if( associated(su_pMSA) ) su_pMSA = 0. + if( associated(su_pSO4) ) su_pSO4 = 0. + if( associated(su_pSO4) ) su_pSO4g = 0. + if( associated(su_pSO4) ) su_pSO4aq = 0. + if( associated(pSO2) ) pSO2 = 0. + if( associated(pMSA) ) pMSA = 0. + if( associated(pSO4) ) pSO4 = 0. + if( associated(pSO4g) ) pSO4g = 0. + if( associated(pSO4aq) ) pSO4aq = 0. + + +! Find the cossza +! ---------------------------------- + jday = idaynum(nymd) + xhour = ( real(nhms/10000)*3600. & + + real(mod(nhms,10000)/100)*60. & + + real(mod(nhms,100)) & + ) / 3600. + + call szangle (jday, xhour, lonRad, latRad, PI, radToDeg, sza, cossza, i2, j2) +! Reset the dry deposition fluxes & frequencies +! do n = 1, nbins + if( associated(su_dep) ) su_dep = 0.0 +! end do + + call DryDeposition ( km, tmpu, rhoa, hghte, oro, ustar, pblh, shflux, & + von_karman, cpd, grav, z0h, drydepositionfrequency, rc ) + + +! Now call the chemistry packages... +! ---------------------------------- + +! DMS source and oxidation to SO2 and MSA + call SulfateChemDriver_DMS (km, klid, cdt, airMolWght, nAvogadro, cpd,& + fMassMSA, fMassDMS, fMassSO2, & + dms, nDMS, xoh, xno3, & + cossza, tmpu, rhoa, & + pSO2_DMS, pMSA_DMS, SU_dep, & + rc) + + if( associated(pSO2) ) pSO2 = pSO2_DMS + if( associated(su_pSO2)) then + do k = klid, km + su_pSO2(:,:) = su_pSO2(:,:) + pSO2_DMS(:,:,k)*delp(:,:,k)/grav + enddo + endif + + if( associated(pMSA) ) pMSA = pMSA_DMS + if( associated(su_pMSA)) then + do k = klid, km + su_pMSA(:,:) = su_pMSA(:,:) + pMSA_DMS(:,:,k)*delp(:,:,k)/grav + enddo + endif + +! SO2 source and oxidation to SO4 + call SulfateChemDriver_SO2 (km, klid, cdt, airMolWght, nAvogadro, cpd, grav, & + fMassSO4, fMassSO2, & + so2, nSO2, xoh, xh2o2, & + tmpu, rhoa, delp, oro, cloud, drydepositionfrequency, & + pSO2_DMS, pSO4g_SO2, pSO4aq_SO2, SU_dep, & + rc) + + if( associated(pSO4g) ) pSO4g = pSO4g_SO2 + if( associated(su_pSO4g)) then + do k = klid, km + su_pSO4g(:,:) = su_pSO4g(:,:) + pSO4g_SO2(:,:,k)*delp(:,:,k)/grav + enddo + endif + + if( associated(pSO4aq) ) pSO4aq = pSO4aq_SO2 + if( associated(su_pSO4aq)) then + do k = klid, km + su_pSO4aq(:,:) = su_pSO4aq(:,:) + pSO4aq_SO2(:,:,k)*delp(:,:,k)/grav + enddo + endif + + if( associated(pSO4) ) pSO4 = pSO4g_SO2 + pSO4aq_SO2 + if( associated(su_pSO4)) then + do k = klid, km + su_pSO4(:,:) = su_pSO4(:,:) + pSO4g_SO2(:,:,k)*delp(:,:,k)/grav & + + pSO4aq_SO2(:,:,k)*delp(:,:,k)/grav + enddo + endif + +! SO4 source and loss + call SulfateChemDriver_SO4 (km, klid, cdt, grav, so4, nSO4, delp, & + drydepositionfrequency, pSO4g_SO2, pSO4aq_SO2, SU_dep, & + rc) + +! MSA source and loss + call SulfateChemDriver_MSA (km, klid, cdt, grav, msa, nMSA, delp, & + drydepositionfrequency, pMSA_DMS, SU_dep, & + rc) + +! Save the h2o2 value after chemistry + h2o2_init = xh2o2 + + rc = 0 + + end subroutine SulfateChemDriver + +!#endif + +!================================================================================== +!BOP +! !IROUTINE: SulfateChemDriver_DMS + + subroutine SulfateChemDriver_DMS (km, klid, cdt, airMolWght, nAvogadro, cpd, & + fMassMSA, fMassDMS, fMassSO2, & + qa, nDMS, xoh, xno3, & + cossza, tmpu, rhoa, & + pSO2_DMS, pMSA_DMS, SU_dep, & + rc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! number of model levels + integer, intent(in) :: klid ! index for pressure lid + real, intent(in) :: cdt ! chemisty model timestep [sec] + real, intent(in) :: nAvogadro ! Avogadro's number [1/kmol] + real, intent(in) :: airMolWght ! molecular weight of air [kg/kmol] + real, intent(in) :: cpd + real, intent(in) :: fMassMSA, fMassDMS, fMassSO2 ! gram molecular weights of species + integer, intent(in) :: nDMS !index position of sulfates + real, dimension(:,:,:), intent(in) :: xoh, xno3 ! OH, NO3 respectievly [kg/kg] + real, dimension(:,:), intent(in) :: cossza + real, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, dimension(:,:,:), intent(in) :: rhoa ! layer air density [kg/m^3] + + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: qa ! dimethyl sulfide [kg/kg] + real, pointer, dimension(:,:,:), intent(inout) :: SU_dep ! Sulfate Dry Deposition All Bins [kg m-2 s-1] + +! !OUTPUT PARAMETERS: + real, dimension(:,:,:), allocatable, intent(out) :: pSO2_DMS ! SO2 production from DMS oxidation [kg kg-1 s-1] + real, dimension(:,:,:), allocatable, intent(out) :: pMSA_DMS ! MSA production from DMS oxidation [kg kg-1 s-1] + integer, optional, intent(out) :: rc + +! !DESCRIPTION: Computes the production of SO2 and MSA due to DMS oxidation +! +! R1: DMS + OH -> a*SO2 + b*MSA OH addition channel +! k1 = { 1.7d-42*exp(7810/T)*[O2] / (1+5.5e-31*exp(7460/T)*[O2] } +! a = 0.75, b = 0.25 +! +! R2: DMS + OH -> SO2 + ... OH abstraction channel +! k2 = 1.2e-11*exp(-260/T) +! +! DMS_OH = DMS0 * exp(-(r1+r2)*NDT1) +! where DMS0 is the DMS concentration at the beginning, +! r1 = k1*[OH], r2 = k2*[OH] +! +! R3: DMS + NO3 -> SO2 + ... +! k3 = 1.9e-13*exp(500/T) +! +! DMS = DMS_OH * exp(-r3*NDT1) +! where r3 = k3*[NO3] +! +! R4: DMS + X -> SO2 + ... +! assume to be at the rate of DMS+OH and DMS+NO3 combined. +! +! The production of SO2 and MSA here, PSO2_DMS and PMSA_DMS, are saved +! for use in CHEM_SO2 and CHEM_MSA subroutines as a source term. They +! are in unit of MixingRatio/second. +! +! !REVISION HISTORY: +! +! 06Nov2003, Colarco +! Based on Ginoux +! +! 03Aug2020 E.Sherman - ported to process library + + +! !Local Variables + integer :: i, j, k, i1=1, j1=1, i2, j2 + real*8 :: Fx, b, eff + real*8 :: rk1, rk2, rk3, rk4 + real*8 :: tk, o2, oh, no3, air + real*8 :: dms, dms0, dms_oh + + data Fx / 1.0 / + data b / 0.25 / + data eff / 1. / + +!EOP +!------------------------------------------------------------------------- +! Begin... + + j2 = ubound(tmpu, 2) + i2 = ubound(tmpu, 1) + + allocate(pSO2_DMS, mold=tmpu) + allocate(pMSA_DMS, mold=tmpu) + +! spatial loop + do k = klid, km + do j = j1, j2 + do i = i1, i2 + + rk1 = 0. + rk2 = 0. + rk3 = 0. + rk4 = 0. + + tk = tmpu(i,j,k) + oh = xoh(i,j,k) +! air molecules in # cm-3 + air = 1000.*rhoa(i,j,k) / airMolWght * nAvogadro * 1.e-6 +! oxygen molecules in # cm-3 + o2 = 0.21 * air +! no3 -> go from volume mixing ratio to # cm-3 + no3 = xno3(i,j,k) * air + +! initial DMS concentration (kg kg-1) + dms0 = qa(i,j,k) + dms0 = max(dms0,tiny(dms0)) + +! 1 & 2) DMS + OH: RK1 = addition, RK2 = abstraction + if(oh .gt. 0.) then + rk1 = (1.7d-42 * exp(7810./tk) * o2) / & + (1. + 5.5e-31 * exp(7460./tk) * o2) * oh + rk2 = (1.2e-11 * exp(-260./tk)) * oh + endif + +! 3) DMS + NO3: only happens at night + if(cossza(i,j) .le. 0.) then + rk3 = (1.9e-13 * exp(500./tk)) * no3 + endif + +! Now do the DMS loss + dms_oh = dms0 * exp( -(rk1+rk2)* Fx * cdt) + dms = dms_oh * exp( -(rk3) * Fx * cdt) + +! SO2 and MSA production terms +! MSA is formed from the DMS+OH addition step +! Production should go as mass mixing ratio change in MSA + if( (rk1+rk2) .eq. 0.) then + pMSA_DMS(i,j,k) = 0. + else + pMSA_DMS(i,j,k) = (dms0 - dms_oh) * b*rk1/((rk1+rk2)*Fx) * eff & + * (fMassMSA/fMassDMS) / cdt + endif + +! Everything else goes into SO2 formation step + pSO2_DMS(i,j,k) = ( dms0 - dms - & + pMSA_DMS(i,j,k)*cdt*(fMassDMS/fMassMSA) & + ) * (fMassSO2/fMassDMS) / cdt + + +! 4) Dry deposition of DMS (not in GOCART?) +! if(k .eq. km) rk4 = drydepf(i,j) +! dms0 = dms +! dms = dms0 * exp(-rk4*cdt) +! dms = max(dms,1.e-32) + +! Update the mass mixing ratio and the dry deposition flux out of DMS + dms = max(dms,tiny(dms)) + qa(i,j,k) = dms + + end do ! i + end do ! j + if(k .eq. km .and. associated(SU_dep) ) SU_dep(:,:,nDMS) = 0. + end do ! k + + + rc = 0 + + end subroutine SulfateChemDriver_DMS + + +!================================================================================== +!BOP +! !IROUTINE: SulfateChemDriver_SO2 + + subroutine SulfateChemDriver_SO2 (km, klid, cdt, airMolWght, nAvogadro, cpd, grav, & + fMassSO4, fMassSO2, & + qa, nSO2, xoh, xh2o2, & + tmpu, rhoa, delp, oro, cloud, drydepf, & + pSO2_DMS, pSO4g_SO2, pSO4aq_SO2, SU_dep, & + rc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! number of model levels + integer, intent(in) :: klid ! index for pressure lid + real, intent(in) :: cdt ! chemisty model timestep [sec] + real, intent(in) :: nAvogadro ! Avogadro's number [1/kmol] + real, intent(in) :: airMolWght ! molecular weight of air [kg/kmol] + real, intent(in) :: cpd + real, intent(in) :: grav ! gravity [m/sec] + real, intent(in) :: fMassSO4, fMassSO2 ! gram molecular weights of species + integer, intent(in) :: nSO2 !index position of sulfates + real, dimension(:,:,:), intent(in) :: tmpu ! temperature [K] + real, dimension(:,:,:), intent(in) :: rhoa ! layer air density [kg/m^3] + real, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, dimension(:,:,:), intent(in) :: cloud ! cloud fraction for radiation [1] + real, dimension(:,:), intent(in) :: drydepf ! dry deposition frequency [s-1] + real, pointer, dimension(:,:), intent(in) :: oro ! land-ocean-ice mask + real, dimension(:,:,:), intent(in) :: pSO2_DMS ! SO2 production from DMS oxidation [kg m-2 s-1] + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: qa ! dimethyl sulfide [kg/kg] + real, dimension(:,:,:), intent(inout) :: xoh, xh2o2 ! OH, H2O2 respectievly [kg/kg] + real, pointer, dimension(:,:,:), intent(inout) :: SU_dep ! Sulfate Dry Deposition All Bins [kg m-2 s-1] + +! !OUTPUT PARAMETERS: + real, dimension(:,:,:), allocatable, intent(out) :: pSO4g_SO2 ! SO4 production - gas phase [kg kg-1 s-1] + real, dimension(:,:,:), allocatable, intent(out) :: pSO4aq_SO2 ! SO4 production - aqueous [kg kg-1 s-1] + integer, optional, intent(out) :: rc + +! !DESCRIPTION: Computes the concentration of SO2 and production of SO4 +! +! SO2 production: +! DMS + OH, DMS + NO3 (saved in SU_ChemDrv_DMS) +! +! SO2 loss: +! SO2 + OH -> SO4 +! SO2 -> drydep +! SO2 + H2O2 or O3 (aq) -> SO4 +! +! SO2 = SO2_0 * exp(-bt) +! + PSO2_DMS*dt/bt * [1-exp(-bt)] +! where b is the sum of the reaction rate of SO2 + OH and the dry +! deposition rate of SO2, PSO2_DMS is SO2 production from DMS in +! MixingRatio/timestep. +! +! If there is cloud in the gridbox (fraction = fc), then the aqueous +! phase chemistry also takes place in cloud. The amount of SO2 oxidized +! by H2O2 in cloud is limited by the available H2O2; the rest may be +! oxidized due to additional chemistry, e.g, reaction with O3 or O2 +! (catalyzed by trace metal). +! +! !REVISION HISTORY: +! +! 15Jul2010, Colarco - modularized +! 06Nov2003, Colarco +! Based on Ginoux +! +! 03Aug2020 E.Sherman - ported to process library + + +! !Local Variables + integer :: i, j, k, j2, i2 + real*8 :: rk1, rk2, rk, rkt, f1 + real*8 :: L1, L2, Ld, SO2, SO2_cd, fc, fMR + real*8 :: oh, h2o2, SO20, tk, air, k0, ki, kk + real, dimension(:,:), allocatable :: fout + + data ki / 1.5e-12 / + +!EOP +!------------------------------------------------------------------------- +! Begin... + + j2 = ubound(tmpu, 2) + i2 = ubound(tmpu, 1) + + allocate(pSO4g_SO2, mold=tmpu) + allocate(pSO4aq_SO2, mold=tmpu) + allocate(fout(i2,j2)) + +! Conversion of SO2 mmr to SO2 vmr + fMR = airMolWght / fMassSO2 + +! Initialize flux variable + fout = 0. + +! spatial loop + do k = klid, km + do j = 1, j2 + do i = 1, i2 + + rk1 = 0. + rk2 = 0. + L1 = 0. + L2 = 0. + Ld = 0. + + tk = tmpu(i,j,k) + oh = xoh(i,j,k) + h2o2 = max(xh2o2(i,j,k),tiny(xh2o2(i,j,k))) + +! air molecules in # cm-3 + air = 1000.*rhoa(i,j,k) / airMolWght * nAvogadro * 1.e-6 +! 1) SO2 + OH(g) in s-1 + k0 = 3.0e-31 * (300./tk)**4.3 + kk = k0 * air / ki + f1 = (1. + (log10(kk))**2.)**(-1.) + rk1 = ( (k0*air/(1.+kk)) * 0.6**f1) * oh + +! 2) rk2 is the loss of SO2 due to dry deposition. + if(k .eq. km) then +! drydepf calculated for aerosol +! follow Walcek: ocean drydepf_so2 = 10*drydepf_aer +! or if land drydepf_so2 = 3*drydepf_aer + if(oro(i,j) .eq. OCEAN) then + rk2 = 10.*drydepf(i,j) + else + rk2 = 3.*drydepf(i,j) + endif +! rk2 = drydepf(i,j) + else + rk2 = 0. + endif + + rk = (rk1 + rk2) + rkt = rk*cdt + +! Update the SO2 concentration +! Originally this was solved like a simple exponential solution +! after Jacobson eq. 13.38, which is more accurate but not mass +! conserving. We've already timesplit everything, so accuracy is +! out to lunch, and I'd prefer to conserve mass. + +! initial SO2 concentration (kg kg-1) after adding source + SO20 = qa(i,j,k) + pSO2_DMS(i,j,k)*cdt + SO20 = max(SO20,tiny(SO20)) + + if(rk .gt. 0.) then + SO2_cd = SO20 * exp(-rkt) + L1 = (SO20 - SO2_cd) * rk1/rk + if(k .eq. km) then + Ld = (SO20 - SO2_cd) * rk2/rk + fout(i,j) = Ld * delp(i,j,km)/grav/cdt + else + Ld = 0. + endif + else + SO2_cd = SO20 + L1 = 0. + endif + +! Update SO2 concentration after cloud chemistry, if it occurs + fc = cloud(i,j,k) + if(fc .gt. 0. .and. SO2_cd .gt. 0. .and. tk .gt. 258.) then +! Check on H2O2 vmr -> is SO2 vmr greater? + if(fMr * SO2_cd .gt. h2o2) then + fc = fc*(h2o2/(fMR*SO2_cd)) + h2o2 = h2o2*(1.-cloud(i,j,k)) + else + h2o2 = h2o2*(1. - cloud(i,j,k)*(fMR*SO2_cd)/h2o2) + endif + SO2 = SO2_cd*(1.-fc) +! aqueous loss rate (mixing ratio/timestep) + L2 = SO2_cd * fc + else + SO2 = SO2_cd + L2 = 0. + endif + +! Ideally you would update the H2O2 mixing ratio at this point +! and then reset it periodically + xh2o2(i,j,k) = max(h2o2,tiny(h2o2)) + + SO2 = max(SO2,tiny(SO2)) + qa(i,j,k) = SO2 + pSO4g_SO2(i,j,k) = L1 * (fMassSO4/fMassSO2) / cdt + pSO4aq_SO2(i,j,k) = L2 * (fMassSO4/fMassSO2) / cdt + + end do + end do + end do + + if( associated(SU_dep) ) SU_dep(:,:,nSO2) = fout + + rc = 0 + + end subroutine SulfateChemDriver_SO2 + +!================================================================================== +!BOP +! !IROUTINE: SulfateChemDriver_SO4 + + subroutine SulfateChemDriver_SO4 (km, klid, cdt, grav, qa, nSO4, delp, drydepf, & + pSO4g_SO2, pSO4aq_SO2, SU_dep, & + rc) +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! number of model levels + integer, intent(in) :: klid ! index for pressure lid + real, intent(in) :: cdt ! chemisty model timestep [sec] + real, intent(in) :: grav ! gravity [m/sec] + integer, intent(in) :: nSO4 ! index position of sulfate + real, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, dimension(:,:), intent(in) :: drydepf ! dry deposition frequency [s-1] + real, dimension(:,:,:), intent(in) :: pSO4g_SO2 ! SO4 production - gas phase [kg kg-1 s-1] + real, dimension(:,:,:), intent(in) :: pSO4aq_SO2 ! SO4 production - aqueous [kg kg-1 s-1] + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: qa ! dimethyl sulfide [kg/kg] + real, pointer, dimension(:,:,:), intent(inout) :: SU_dep ! Sulfate Dry Deposition All Bins [kg m-2 s-1] + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc + +! !DESCRIPTION: +! +! SO4 production: +! The only production term is due to SO2 oxidation. +! SO4 = SO4_0 * exp(-kt) + pSO4_SO2/kt * (1.-exp(-kt)) +! where k is the dry deposition +! +! !REVISION HISTORY: +! +! 15Jul2010, Colarco - Modularized +! 06Nov2003, Colarco +! Based on Ginoux +! +! 03Aug2020 E.Sherman - ported to process library +! +! !Local Variables + integer :: i, j, k, i2, j2 + real*8 :: rk, rkt, Ld + real*8 :: SO4, SO40, pSO4 + real, dimension(:,:), allocatable :: fout + +!EOP +!------------------------------------------------------------------------- + +! Begin... + + j2 = ubound(qa, 2) + i2 = ubound(qa, 1) + + allocate(fout(i2,j2)) + +! Initialize flux variable + fout = 0. + +! spatial loop + do k = klid, km + do j = 1, j2 + do i = 1, i2 + + pSO4 = pSO4g_SO2(i,j,k)+pSO4aq_SO2(i,j,k) + +! initial SO4 concentration (kg kg-1) + SO40 = qa(i,j,k) + SO40 = max(SO40,tiny(SO40)) + +! Update the SO4 concentration +! Originally this was solved like a simple exponential solution +! after Jacobson eq. 13.38, which is more accurate but not mass +! conserving. We've already timesplit everything, so accuracy is +! out to lunch, and I'd prefer to conserve mass. +! RK is the dry deposition frequency + if(k .eq. km) then + RK = drydepf(i,j) + RKT = RK*cdt + SO4 = (SO40 + pSO4*cdt) * exp(-rkt) + Ld = (SO40 - SO4 + pSO4*cdt) + fout(i,j) = Ld * delp(i,j,km)/grav/cdt + else + SO4 = SO40 + pSO4*cdt + Ld = 0. + endif + + SO4 = max(SO4,tiny(SO4)) + qa(i,j,k) = SO4 + + end do + end do + end do + + if( associated(SU_dep) ) SU_dep(:,:,nSO4) = fout + + rc = 0 + + end subroutine SulfateChemDriver_SO4 + +!================================================================================== +!BOP +! !IROUTINE: SulfateChemDriver_MSA + + subroutine SulfateChemDriver_MSA (km, klid, cdt, grav, qa, nMSA, delp, drydepf, & + pMSA_DMS, SU_dep, & + rc) +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! number of model levels + integer, intent(in) :: klid ! index for pressure lid + real, intent(in) :: cdt ! chemisty model timestep [sec] + real, intent(in) :: grav ! gravity [m/sec] + integer, intent(in) :: nMSA ! index position of sulfate + real, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, dimension(:,:), intent(in) :: drydepf ! dry deposition frequency [s-1] + real, dimension(:,:,:), intent(in) :: pMSA_DMS ! MSA production - gas phase [kg kg-1 s-1] + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: qa ! dimethyl sulfide [kg/kg] + real, pointer, dimension(:,:,:), intent(inout) :: SU_dep ! Sulfate Dry Deposition All Bins [kg m-2 s-1] + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc + +! !DESCRIPTION: +! +! MSA production: +! The only production term is due to DMS oxidation. +! MSA = MSA_0 * exp(-kt) + pSO4_SO2/kt * (1.-exp(-kt)) +! where k is the dry deposition +! +! !REVISION HISTORY: +! +! 15Jul2010, Colarco -- modularized +! 06Nov2003, Colarco +! Based on Ginoux +! +! 03Aug2020 E.Sherman - ported to process library + +! !Local Variables + integer :: i, j, k, i2, j2 + real*8 :: rk, rkt, Ld + real*8 :: MSA, MSA0 + real, dimension(:,:), allocatable :: fout + +!EOP +!------------------------------------------------------------------------- +! Begin... + + j2 = ubound(qa, 2) + i2 = ubound(qa, 1) + + allocate(fout(i2,j2)) + +! spatial loop + do k = klid, km + do j = 1, j2 + do i = 1, i2 + +! initial MSA concentration (kg kg-1) + MSA0 = qa(i,j,k) + MSA0 = max(MSA0,tiny(MSA0)) + +! Update the MSA concentration +! Originally this was solved like a simple exponential solution +! after Jacobson eq. 13.38, which is more accurate but not mass +! conserving. We've already timesplit everything, so accuracy is +! out to lunch, and I'd prefer to conserve mass. +! RK is the dry deposition frequency + if(k .eq. km) then + RK = drydepf(i,j) + RKT = RK*cdt + MSA = (MSA0 + pMSA_DMS(i,j,k)*cdt) * exp(-rkt) + Ld = (MSA0 + pMSA_DMS(i,j,k)*cdt - MSA) + fout(i,j) = Ld * delp(i,j,km)/grav/cdt + else + MSA = MSA0 + pMSA_DMS(i,j,k)*cdt + Ld = 0. + endif + + MSA = max(MSA,tiny(MSA)) + qa(i,j,k) = MSA + + end do + end do + end do + + if( associated(SU_dep) ) SU_dep(:,:,nMSA) = fout + + rc = 0 + + + end subroutine SulfateChemDriver_MSA + +!================================================================================== +!BOP +! !IROUTINE: get_HenrysLawCts + + subroutine get_HenrysLawCts(name,c1,c2,c3,c4,rc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + character(len=*), intent(in) :: name + +! !OUTPUT PARAMETERS: + real, intent(out):: c1,c2,c3,c4 + integer, optional, intent(out) :: rc ! Error return code: + + +! !DESCRIPTION: Provides Henry's Law coefficients for species. +! +! !REVISION HISTORY: +! +! 05Aug2020 E.Sherman - Moved over from Henrys_Law_cts.F90 +! + +! !Local Variables + integer :: l,found + + INTEGER,PARAMETER :: nspecies_HL=051 + REAL ,PARAMETER :: notfound = -1. + + !Name of species + CHARACTER(LEN=8),PARAMETER,DIMENSION(nspecies_HL) :: spc_name=(/ & + 'O3 ' & !001 + ,'H2O2' & !002 + ,'NO ' & !003 + ,'NO2 ' & !004 + ,'NO3 ' & !005 + ,'N2O5' & !006 + ,'HONO' & !007 + ,'HNO3' & !008 + ,'HNO4' & !009 + ,'SO2 ' & !010 + ,'SULF' & !011 + ,'CO ' & !012 + ,'CO2 ' & !013 + ,'N2 ' & !014 + ,'O2 ' & !015 + ,'H2O ' & !016 + ,'H2 ' & !017 + ,'O3P ' & !018 + ,'O1D ' & !019 + ,'HO ' & !020 + ,'HO2 ' & !021 + ,'CH4 ' & !022 + ,'ETH ' & !023 + ,'ALKA' & !024 + ,'ALKE' & !025 + ,'BIO ' & !026 + ,'ARO ' & !027 + ,'HCHO' & !028 + ,'ALD ' & !029 + ,'KET ' & !030 + ,'CRBO' & !031 + ,'ONIT' & !032 + ,'PAN ' & !033 + ,'OP1 ' & !034 + ,'OP2 ' & !035 + ,'ORA1' & !036 + ,'ORA2' & !037 + ,'MO2 ' & !038 + ,'AKAP' & !039 + ,'AKEP' & !040 + ,'BIOP' & !041 + ,'PHO ' & !042 + ,'ADD ' & !043 + ,'AROP' & !044 + ,'CBOP' & !045 + ,'OLN ' & !046 + ,'XO2 ' & !047 + ,'DMS ' & !048 + ,'NH3 ' & !049 + ,'CFC ' & !050 + ,'N2O ' & !050 + /) + + + !Number of each specie + INTEGER,PARAMETER :: O3 =001 + INTEGER,PARAMETER :: H2O2=002 + INTEGER,PARAMETER :: NO =003 + INTEGER,PARAMETER :: NO2 =004 + INTEGER,PARAMETER :: NO3 =005 + INTEGER,PARAMETER :: N2O5=006 + INTEGER,PARAMETER :: HONO=007 + INTEGER,PARAMETER :: HNO3=008 + INTEGER,PARAMETER :: HNO4=009 + INTEGER,PARAMETER :: SO2 =010 + INTEGER,PARAMETER :: SULF=011 + INTEGER,PARAMETER :: CO =012 + INTEGER,PARAMETER :: CO2 =013 + INTEGER,PARAMETER :: N2 =014 + INTEGER,PARAMETER :: O2 =015 + INTEGER,PARAMETER :: H2O =016 + INTEGER,PARAMETER :: H2 =017 + INTEGER,PARAMETER :: O3P =018 + INTEGER,PARAMETER :: O1D =019 + INTEGER,PARAMETER :: HO =020 + INTEGER,PARAMETER :: HO2 =021 + INTEGER,PARAMETER :: CH4 =022 + INTEGER,PARAMETER :: ETH =023 + INTEGER,PARAMETER :: ALKA=024 + INTEGER,PARAMETER :: ALKE=025 + INTEGER,PARAMETER :: BIO =026 + INTEGER,PARAMETER :: ARO =027 + INTEGER,PARAMETER :: HCHO=028 + INTEGER,PARAMETER :: ALD =029 + INTEGER,PARAMETER :: KET =030 + INTEGER,PARAMETER :: CRBO=031 + INTEGER,PARAMETER :: ONIT=032 + INTEGER,PARAMETER :: PAN =033 + INTEGER,PARAMETER :: OP1 =034 + INTEGER,PARAMETER :: OP2 =035 + INTEGER,PARAMETER :: ORA1=036 + INTEGER,PARAMETER :: ORA2=037 + INTEGER,PARAMETER :: MO2 =038 + INTEGER,PARAMETER :: AKAP=039 + INTEGER,PARAMETER :: AKEP=040 + INTEGER,PARAMETER :: BIOP=041 + INTEGER,PARAMETER :: PHO =042 + INTEGER,PARAMETER :: ADD =043 + INTEGER,PARAMETER :: AROP=044 + INTEGER,PARAMETER :: CBOP=045 + INTEGER,PARAMETER :: OLN =046 + INTEGER,PARAMETER :: XO2 =047 + INTEGER,PARAMETER :: DMS =048 + INTEGER,PARAMETER :: NH3 =049 + INTEGER,PARAMETER :: CFC =050 + INTEGER,PARAMETER :: N2O =051 + +! HENRYS LAW COEFFICIENTS +! Henrys law coefficient +! [KH298]=mole/(l atm) +! Referencias em R. Sander (1999) +! Compilation of Henry Law Constants +! for Inorganic and Organic Species +! of Potential Importance in +! Environmental Chemistry (Version 3) +! http://www.henrys-law.org +! * indica artigos nao encontrados nesse endereço eletronico + REAL,PARAMETER,DIMENSION(nspecies_HL) :: hstar=(/& + 1.10E-2 , & ! O3 - 001 + 8.30E+4 , & ! H2O2 - 002 + 1.90E-3 , & ! NO - 003 + 1.20E-2 , & ! NO2 - 004 + 6.1E-01 , & ! NO3 - 005 + 2.1E+00 , & ! N2O5 - 006 + 5.00E+1 , & ! HONO - 007 + 2.10E+5 , & ! HNO3 - 008 + 1.20E+4 , & ! HNO4 - 009 + 1.40E+0 , & ! SO2 - 010 + 2.10E+5 , & ! SULF - 011 + 9.90E-4 , & ! CO - 012 + 3.6E-02 , & ! CO2 - 013 + 6.1E-04 , & ! N2 - 014 + 1.3E-03 , & ! O2 - 015 + 0.0E+00 , & ! H2O - 016 + 7.8E-04 , & ! H2 - 017 + 0.00E+0 , & ! O3P - 018 + 0.00E+0 , & ! O1D - 019 + 3.00E+1 , & ! HO - 020 + 5.70E+3 , & ! HO2 - 021 + 1.40E-3 , & ! CH4 - 022 + 1.90E-3 , & ! ETH - 023 + 1.00E-3 , & ! ALKA - 024 + 5.00E-3 , & ! ALKE - 025 + 2.80E-2 , & ! BIO - 026 + 1.73E-1 , & ! ARO - 027 + 3.20E+3 , & ! HCHO - 028 + 1.40E+1 , & ! ALD - 029 + 3.00E+1 , & ! KET - 030 + 2.1E+05 , & ! CRBO - 031 + 1.00E+0 , & ! ONIT - 032 + 3.60E+0 , & ! PAN - 033 + 3.10E+2 , & ! OP1 - 034 + 3.40E+2 , & ! OP2 - 035 + 8.90E+3 , & ! ORA1 - 036 + 4.10E+3 , & ! ORA2 - 037 + 2.00E+3 , & ! MO2 - 038 + 0.0E+00 , & ! AKAP - 039 + 0.0E+00 , & ! AKEP - 040 + 0.0E+00 , & ! BIOP - 041 + 0.0E+00 , & ! PHO - 042 + 0.0E+00 , & ! ADD - 043 + 0.0E+00 , & ! AROP - 044 + 1.14E+1 , & ! CBOP - 045 + 0.0E+00 , & ! OLN - 046 + 0.0E+00 , & ! XO2 - 047 + 5.6E-01 , & ! DMS - 048 + 5.9E+01 , & ! NH3 - 048 + -1. , & ! CFC - 048 + 2.4E-02 & ! N2O - 051 + /) + + +! -DH/R (for temperature correction) +! [-DH/R]=K +! Referencias em R. Sander (1999) +! Compilation of Henry Law Constants +! for Inorganic and Organic Species +! of Potential Importance in +! Environmental Chemistry (Version 3) +! http://www.henrys-law.org + REAL,PARAMETER,DIMENSION(nspecies_HL) :: dhr=(/& + 2400. , & ! O3 - 001 + 7400. , & ! H2O2 - 002 + 1400. , & ! NO - 003 + 2500. , & ! NO2 - 004 + 2000. , & ! NO3 - 005 + 3400. , & ! N2O5 - 006 + 4900. , & ! HONO - 007 + 8700. , & ! HNO3 - 008 + 6900. , & ! HNO4 - 009 + 2900. , & ! SO2 - 010 + 0. , & ! SULF - 011 + 1300. , & ! CO - 012 + 2200. , & ! CO2 - 013 + 1300. , & ! N2 - 014 + 1500. , & ! O2 - 015 + 0. , & ! H2O - 016 + 500. , & ! H2 - 017 + 0. , & ! O3P - 018 + 0. , & ! O1D - 019 + 4500. , & ! HO - 020 + 5900. , & ! HO2 - 021 + 1600. , & ! CH4 - 022 + 2300. , & ! ETH - 023 + 2700. , & ! ALKA - 024 + 3000. , & ! ALKE - 025 + 0. , & ! BIO - 026 + 4045. , & ! ARO - 027 + 6800. , & ! HCHO - 028 + 5600. , & ! ALD - 029 + 4600. , & ! KET - 030 + 5300. , & ! CRBO - 031 + 5800. , & ! ONIT - 032 + 6500. , & ! PAN - 033 + 5200. , & ! OP1 - 034 + 6000. , & ! OP2 - 035 + 5700. , & ! ORA1 - 036 + 6300. , & ! ORA2 - 037 + 6600. , & ! MO2 - 038 + 0. , & ! AKAP - 039 + 0. , & ! AKEP - 040 + 0. , & ! BIOP - 041 + 0. , & ! PHO - 042 + 0. , & ! ADD - 043 + 0. , & ! AROP - 044 + 0. , & ! CBOP - 045 + 0. , & ! OLN - 046 + 0. , & ! XO2 - 047 + 3500. , & ! DMS - 048 + 4200. , & ! NH3 - 048 + -1. , & ! CFC - 048 + 2700. & ! N2O - 048 + /) + + + REAL,PARAMETER,DIMENSION(nspecies_HL) :: weight=(/& + 48. , & ! O3 - 001 + 34. , & ! H2O2 - 002 + 30. , & ! NO - 003 + 46. , & ! NO2 - 004 + 62. , & ! NO3 - 005 + 108. , & ! N2O5 - 006 + 47. , & ! HONO - 007 + 63. , & ! HNO3 - 008 + 79. , & ! HNO4 - 009 + 64. , & ! SO2 - 010 + 98. , & ! SULF - 011 + 28. , & ! CO - 012 + 44. , & ! CO2 - 013 + 28. , & ! N2 - 014 + 32. , & ! O2 - 015 + 18. , & ! H2O - 016 + 2. , & ! H2 - 017 + 16. , & ! O3P - 018 + 16. , & ! O1D - 019 + 17. , & ! HO - 020 + 33. , & ! HO2 - 021 + 16. , & ! CH4 - 022 + 30. , & ! ETH - 023 + 61.6 , & ! ALKA - 024 + 33.0 , & ! ALKE - 025 + 68. , & ! BIO - 026 + 97.9 , & ! ARO - 027 + 30. , & ! HCHO - 028 + 44. , & ! ALD - 029 + 72. , & ! KET - 030 + 68.6 , & ! CRBO - 031 + 119. , & ! ONIT - 032 + 122. , & ! PAN - 033 + 48. , & ! OP1 - 034 + 62. , & ! OP2 - 035 + 46. , & ! ORA1 - 036 + 60. , & ! ORA2 - 037 + 47. , & ! MO2 - 038 + 102. , & ! AKAP - 039 + 88.4 , & ! AKEP - 040 + 117. , & ! BIOP - 041 + 107. , & ! PHO - 042 + 107. , & ! ADD - 043 + 151. , & ! AROP - 044 + 85.4 , & ! CBOP - 045 + 136. , & ! OLN - 046 + 44. , & ! XO2 - 047 + 62.13, & ! DMS - 048 + 17.03, & ! NH3 - 048 + -1. , & ! CFC - 048 + 44. & ! CFC - 048 + /) + + +! ACID DISSOCIATION CONSTANT AT 298K +! [mole/liter of liquid water] +! Referencias: Barth et al. JGR 112, D13310 2007 +! Martell and Smith, 1976, Critical stability +! vol1-4 Plenum Press New York + REAL,PARAMETER,DIMENSION(nspecies_HL) :: ak0=(/& + 0.00E+00 , & ! O3 - 001 + 2.20E-12 , & ! H2O2 - 002 + 0.00E+00 , & ! NO - 003 + 0.00E+00 , & ! NO2 - 004 + 0.00E+00 , & ! NO3 - 005 + 0.00E+00 , & ! N2O5 - 006 + 7.10E-04 , & ! HONO - 007 + 1.54E+01 , & ! HNO3 - 008 + 0.00E+00 , & ! HNO4 - 009 + 1.30E-02 , & ! SO2 - 010 + 1.00E-02 , & ! SULF - 011 + 0.00E+00 , & ! CO - 012 + 4.50E-07 , & ! CO2 - 013 + 0.00E+00 , & ! N2 - 014 + 0.00E+00 , & ! O2 - 015 + 0.00E+00 , & ! H2O - 016 + 0.00E+00 , & ! H2 - 017 + 0.00E+00 , & ! O3P - 018 + 0.00E+00 , & ! O1D - 019 + 0.00E+00 , & ! HO - 020 + 3.50E-05 , & ! HO2 - 021 + 0.00E+00 , & ! CH4 - 022 + 0.00E+00 , & ! ETH - 023 + 0.00E+00 , & ! ALKA - 024 + 0.00E+00 , & ! ALKE - 025 + 0.00E+00 , & ! BIO - 026 + 0.00E+00 , & ! ARO - 027 + 0.00E+00 , & ! HCHO - 028 + 0.00E+00 , & ! ALD - 029 + 0.00E+00 , & ! KET - 030 + 0.00E+00 , & ! CRBO - 031 + 0.00E+00 , & ! ONIT - 032 + 0.00E+00 , & ! PAN - 033 + 0.00E+00 , & ! OP1 - 034 + 0.00E+00 , & ! OP2 - 035 + 1.80E-04 , & ! ORA1 - 036 + 1.75E-05 , & ! ORA2 - 037 + 0.00E+00 , & ! MO2 - 038 + 0.00E+00 , & ! AKAP - 039 + 0.00E+00 , & ! AKEP - 040 + 0.00E+00 , & ! BIOP - 041 + 0.00E+00 , & ! PHO - 042 + 0.00E+00 , & ! ADD - 043 + 0.00E+00 , & ! AROP - 044 + 0.00E+00 , & ! CBOP - 045 + 0.00E+00 , & ! OLN - 046 + 0.00E+00 , & ! XO2 - 047 + 0.00E+00 , & ! DMS - 048 + 0.00E+00 , & ! NH3 - 049 + 0.00E+00 , & ! NH3 - 049 + 0.00E+00 & ! CFC - 050 + /) + +! Temperature correction factor for +! acid dissociation constants +! [K] +! Referencias: Barth et al. JGR 112, D13310 2007 + REAL,PARAMETER,DIMENSION(nspecies_HL) :: dak=(/& + 0. , & ! O3 - 001 + -3700. , & ! H2O2 - 002 + 0. , & ! NO - 003 + 0. , & ! NO2 - 004 + 0. , & ! NO3 - 005 + 0. , & ! N2O5 - 006 + 0. , & ! HONO - 007 + 0. , & ! HNO3 - 008 + 0. , & ! HNO4 - 009 + 2000. , & ! SO2 - 010 + 0. , & ! SULF - 011 + 0. , & ! CO - 012 + -1000. , & ! CO2 - 013 + 0. , & ! N2 - 014 + 0. , & ! O2 - 015 + 0. , & ! H2O - 016 + 0. , & ! H2 - 017 + 0. , & ! O3P - 018 + 0. , & ! O1D - 019 + 0. , & ! HO - 020 + 0. , & ! HO2 - 021 + 0. , & ! CH4 - 022 + 0. , & ! ETH - 023 + 0. , & ! ALKA - 024 + 0. , & ! ALKE - 025 + 0. , & ! BIO - 026 + 0. , & ! ARO - 027 + 0. , & ! HCHO - 028 + 0. , & ! ALD - 029 + 0. , & ! KET - 030 + 0. , & ! CRBO - 031 + 0. , & ! ONIT - 032 + 0. , & ! PAN - 033 + 0. , & ! OP1 - 034 + 0. , & ! OP2 - 035 + -1500. , & ! ORA1 - 036 + 0. , & ! ORA2 - 037 + 0. , & ! MO2 - 038 + 0. , & ! AKAP - 039 + 0. , & ! AKEP - 040 + 0. , & ! BIOP - 041 + 0. , & ! PHO - 042 + 0. , & ! ADD - 043 + 0. , & ! AROP - 044 + 0. , & ! CBOP - 045 + 0. , & ! OLN - 046 + 0. , & ! XO2 - 047 + 0. , & ! DMS - 048 + 0. , & ! NH3 - 049 + 0. , & ! NH3 - 049 + 0. & ! CFC - 050 + /) + + +!EOP +!------------------------------------------------------------------------- +! Begin + found = 0 +loop2: DO l = 1,nspecies_HL + IF(TRIM(spc_name(l)) == TRIM(name)) then + c1 = hstar(l) + c2 = dhr(l) + c3 = ak0(l) + c4 = dak(l) + found = 1 + EXIT loop2 + ENDIF + enddo loop2 + IF(found == 0) then + c1 = notfound + c2 = notfound + c3 = notfound + c4 = notfound + ENDIF + + rc = 0 + + end subroutine get_HenrysLawCts + +!================================================================================== +!BOP +! !IROUTINE: NIthermo + + subroutine NIthermo (km, klid, cdt, grav, delp, rhoa, tmpu, rh, fMassHNO3, fMassAir, & + SO4, NH3, NO3an1, NH4a, xhno3, & + NI_pno3aq, NI_pnh4aq, NI_pnh3aq, rc) + + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + integer, intent(in) :: km ! total model levels + integer, intent(in) :: klid ! index for pressure lid + real, intent(in) :: cdt ! model time step [sec] + real, intent(in) :: grav ! gravity [m/sec] + real, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa] + real, dimension(:,:,:), intent(in) :: rhoa ! Layer air density [kg m-3] + real, dimension(:,:,:), intent(in) :: tmpu ! Layer temperature [K] + real, dimension(:,:,:), intent(in) :: rh ! relative humidity [0-1] + real, intent(in) :: fMassHNO3 ! gram molecular weight of HNO3 + real, intent(in) :: fMassAir ! gram molecular weight of air + +! !INOUTPUT PARAMETERS: + real, dimension(:,:,:), intent(inout) :: SO4 ! Sulphate aerosol [kg kg-1] + real, dimension(:,:,:), intent(inout) :: NH3 ! Ammonia (NH3, gas phase) [kg kg-1] + real, dimension(:,:,:), intent(inout) :: NO3an1 ! Nitrate size bin 001 [kg kg-1] + real, dimension(:,:,:), intent(inout) :: NH4a ! Ammonium ion (NH4+, aerosol phase) [kg kg-1] + real, dimension(:,:,:), intent(inout) :: xhno3 ! buffer for NITRATE_HNO3 [kg m-2 sec-1] + real, pointer, dimension(:,:), intent(inout) :: NI_pno3aq ! Nitrate Production from Aqueous Chemistry [kg m-2 s-1] + real, pointer, dimension(:,:), intent(inout) :: NI_pnh4aq ! Ammonium Production from Aqueous Chemistry [kg m-2 s-1] + real, pointer, dimension(:,:), intent(inout) :: NI_pnh3aq ! Ammonia Change from Aqueous Chemistry [kg m-2 s-1] + +! !OUTPUT PARAMETERS: + integer, optional, intent(out) :: rc ! Error return code: + + +! !DESCRIPTION: Prepares variables and calls the RPMARES (thermodynamics module) +! +! !REVISION HISTORY: +! +! Aug2020 E.Sherman - Refactored for process library +! + +! !Local Variables + real :: fmmr_to_conc + real(kind=DP) :: SO4_, GNO3, GNH3, RH_, TEMP, ASO4, AHSO4, AH2O, ANO3, ANH4 + integer :: k, j, i + +!EOP +!------------------------------------------------------------------------- +! Begin... + + do k = klid, km + do j = 1, ubound(tmpu,2) + do i = 1, ubound(tmpu,1) + +! Conversion of mass mixing ratio to concentration (ug m-3) + fmmr_to_conc = 1.e9 * rhoa(i,j,k) + +! Unit conversion for input to thermodynamic module +! Per grid box call to RPMARES thermodynamic module +! We do not presently treat chemistry of sulfate completely, +! hence we ignore terms for ASO4, AHSO4, AH2O, and we do +! not update SO4 on output from RPMARES. +! At present we are importing HNO3 from offline file, so we +! do not update on return. + SO4_ = 1.d-32 + SO4_ = max(1.d-32,SO4(i,j,k) * fmmr_to_conc) + GNO3 = max(1.d-32,xhno3(i,j,k) * fMassHNO3 / fMassAir * fmmr_to_conc) + GNH3 = max(1.d-32,NH3(i,j,k) * fmmr_to_conc) + RH_ = rh(i,j,k) + TEMP = tmpu(i,j,k) + ASO4 = 1.d-32 + AHSO4 = 1.d-32 + ANO3 = max(1.d-32,NO3an1(i,j,k) * fmmr_to_conc) + AH2O = 1.d-32 + ANH4 = max(1.d-32,NH4a(i,j,k) * fmmr_to_conc) + + call RPMARES ( SO4_, GNO3, GNH3, RH_, TEMP, & + ASO4, AHSO4, ANO3, AH2O, ANH4 ) + +! Diagnostic terms + if(associated(NI_pno3aq)) & + NI_pno3aq(i,j) = NI_pno3aq(i,j) & + + (ANO3 / fmmr_to_conc - NO3an1(i,j,k)) & + * delp(i,j,k)/grav/cdt + if(associated(NI_pnh4aq)) & + NI_pnh4aq(i,j) = NI_pnh4aq(i,j) & + + (ANH4 / fmmr_to_conc - NH4a(i,j,k)) & + * delp(i,j,k)/grav/cdt + if(associated(NI_pnh3aq)) & + NI_pnh3aq(i,j) = NI_pnh3aq(i,j) & + + (GNH3 / fmmr_to_conc - NH3(i,j,k)) & + * delp(i,j,k)/grav/cdt + +! Unit conversion back on return from thermodynamic module + NH3(i,j,k) = GNH3 / fmmr_to_conc + NO3an1(i,j,k) = ANO3 / fmmr_to_conc + NH4a(i,j,k) = ANH4 / fmmr_to_conc + xhno3(i,j,k) = max(1.d-32, GNO3 * fMassAir / fMassHNO3 / fmmr_to_conc) + + enddo + enddo + enddo + + rc = 0 + + end subroutine NIthermo + +!================================================================================== +!BOP +! !IROUTINE: RPMARES + + subroutine RPMARES( SO4, GNO3, GNH3, RH, TEMP, & + ASO4, AHSO4, ANO3, AH2O, ANH4 ) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + real(kind=DP) :: SO4 ! Total sulfate in micrograms / m**3 + real(kind=DP) :: GNO3 ! Gas-phase nitric acid in micrograms / m**3 + real(kind=DP) :: GNH3 ! Gas-phase ammonia in micrograms / m**3 + real(kind=DP) :: RH ! Fractional relative humidity + real(kind=DP) :: TEMP ! Temperature in Kelvin + real(kind=DP) :: ASO4 ! Aerosol sulfate in micrograms / m**3 + real(kind=DP) :: AHSO4 ! Aerosol bisulfate in micrograms / m**3 + real(kind=DP) :: ANO3 ! Aerosol nitrate in micrograms / m**3 + real(kind=DP) :: AH2O ! Aerosol liquid water content water in + ! micrograms / m**3 + real(kind=DP) :: ANH4 ! Aerosol ammonium in micrograms / m**3 + +! !OUTPUT PARAMETERS: + + +! !DESCRIPTION: +! ARES calculates the chemical composition of a sulfate/nitrate/ +! ammonium/water aerosol based on equilibrium thermodynamics. +! +! This code considers two regimes depending upon the molar ratio +! of ammonium to sulfate. +! +! For values of this ratio less than 2,the code solves a cubic for +! hydrogen ion molality, H+, and if enough ammonium and liquid +! water are present calculates the dissolved nitric acid. For molal +! ionic strengths greater than 50, nitrate is assumed not to be present. +! +! For values of the molar ratio of 2 or greater, all sulfate is assumed +! to be ammonium sulfate and a calculation is made for the presence of +! ammonium nitrate. +! +! The Pitzer multicomponent approach is used in subroutine ACTCOF to +! obtain the activity coefficients. Abandoned -7/30/97 FSB +! +! The Bromley method of calculating the multicomponent activity coefficients +! is used in this version 7/30/97 SJR/FSB +! +! The calculation of liquid water +! is done in subroutine water. Details for both calculations are given +! in the respective subroutines. +! +! Based upon MARS due to +! P. Saxena, A.B. Hudischewskyj, C. Seigneur, and J.H. Seinfeld, +! Atmos. Environ., vol. 20, Number 7, Pages 1471-1483, 1986. +! +! and SCAPE due to +! Kim, Seinfeld, and Saxeena, Aerosol Sience and Technology, +! Vol 19, number 2, pages 157-181 and pages 182-198, 1993. +! +! NOTE: All concentrations supplied to this subroutine are TOTAL +! over gas and aerosol phases + +! +! !REVISION HISTORY: +! +! Who When Detailed description of changes +! --------- -------- ------------------------------------------- +! S.Roselle 11/10/87 Received the first version of the MARS code +! S.Roselle 12/30/87 Restructured code +! S.Roselle 2/12/88 Made correction to compute liquid-phase +! concentration of H2O2. +! S.Roselle 5/26/88 Made correction as advised by SAI, for +! computing H+ concentration. +! S.Roselle 3/1/89 Modified to operate with EM2 +! S.Roselle 5/19/89 Changed the maximum ionic strength from +! 100 to 20, for numerical stability. +! F.Binkowski 3/3/91 Incorporate new method for ammonia rich case +! using equations for nitrate budget. +! F.Binkowski 6/18/91 New ammonia poor case which +! omits letovicite. +! F.Binkowski 7/25/91 Rearranged entire code, restructured +! ammonia poor case. +! F.Binkowski 9/9/91 Reconciled all cases of ASO4 to be output +! as SO4-- +! F.Binkowski 12/6/91 Changed the ammonia defficient case so that +! there is only neutralized sulfate (ammonium +! sulfate) and sulfuric acid. +! F.Binkowski 3/5/92 Set RH bound on AWAS to 37 % to be in agreement +! with the Cohen et al. (1987) maximum molality +! of 36.2 in Table III.( J. Phys Chem (91) page +! 4569, and Table IV p 4587.) +! F.Binkowski 3/9/92 Redid logic for ammonia defficient case to remove +! possibility for denomenator becoming zero; +! this involved solving for H+ first. +! Note that for a relative humidity +! less than 50%, the model assumes that there is no +! aerosol nitrate. +! F.Binkowski 4/17/95 Code renamed ARES (AeRosol Equilibrium System) +! Redid logic as follows +! 1. Water algorithm now follows Spann & Richardson +! 2. Pitzer Multicomponent method used +! 3. Multicomponent practical osmotic coefficient +! use to close iterations. +! 4. The model now assumes that for a water +! mass fraction WFRAC less than 50% there is +! no aerosol nitrate. +! F.Binkowski 7/20/95 Changed how nitrate is calculated in ammonia poor +! case, and changed the WFRAC criterion to 40%. +! For ammonium to sulfate ratio less than 1.0 +! all ammonium is aerosol and no nitrate aerosol +! exists. +! F.Binkowski 7/21/95 Changed ammonia-ammonium in ammonia poor case to +! allow gas-phase ammonia to exist. +! F.Binkowski 7/26/95 Changed equilibrium constants to values from +! Kim et al. (1993) +! F.Binkowski 6/27/96 Changed to new water format +! F.Binkowski 7/30/97 Changed to Bromley method for multicomponent +! activity coefficients. The binary activity +! coefficients +! are the same as the previous version +! F.Binkowski 8/1/97 Changed minimum sulfate from 0.0 to 1.0e-6 i.e. +! 1 picogram per cubic meter +! F.Binkowski 2/23/98 Changes to code made by Ingmar Ackermann to +! deal with precision problems on workstations +! incorporated in to this version. Also included +! are his improved descriptions of variables. +! F. Binkowski 8/28/98 changed logic as follows: +! If iterations fail, initial values of nitrate +! are retained. +! Total mass budgets are changed to account for gas +! phase returned. +! F.Binkowski 10/01/98 Removed setting RATIO to 5 for low to +! to zero sulfate sulfate case. +! F.Binkowski 01/10/2000 reconcile versions +! +! F.Binkowski 05/17/2000 change to logic for calculating RATIO +! F.Binkowski 04/09/2001 change for very low values of RATIO, +! RATIO < 0.5, no iterative calculations are done +! in low ammonia case a MAX(1.0e-10, MSO4) IS +! applied, and the iteration count is +! reduced to fifty for each iteration loop. +! R. Yantosca 09/25/2002 Bundled into "rpmares_mod.f". Declared all REALs +! as REAL*8's. Cleaned up comments. Also now force +! double precision explicitly with "D" exponents. +! P. Le Sager and Bug fix for low ammonia case -- prevent floating +! R. Yantosca 04/10/2008 point underflow and NaN's. +! S. Steenrod 04/15/2010 Modified to include into GMI model +! E. Sherman 08/06/2020 Moved to GOCART2G process library + +! !Local Variables + !================================================================= + ! PARAMETERS and their descriptions: + !================================================================= + ! Molecular weights + real(kind=DP), PARAMETER :: MWNO3 = 62.0049d0 ! NO3 + real(kind=DP), PARAMETER :: MWHNO3 = 63.01287d0 ! HNO3 + real(kind=DP), PARAMETER :: MWSO4 = 96.0576d0 ! SO4 + real(kind=DP), PARAMETER :: MWNH3 = 17.03061d0 ! NH3 + real(kind=DP), PARAMETER :: MWNH4 = 18.03858d0 ! NH4 + + ! Minimum value of sulfate aerosol concentration + real(kind=DP), PARAMETER :: MINSO4 = 1.0d-6 / MWSO4 + + ! Minimum total nitrate cncentration + real(kind=DP), PARAMETER :: MINNO3 = 1.0d-6 / MWNO3 + + ! Force a minimum concentration + real(kind=DP), PARAMETER :: FLOOR = 1.0d-30 + + ! Tolerances for convergence test. NOTE: We now have made these + ! parameters so they don't lose their values (phs, bmy, 4/10/08) + real(kind=DP), PARAMETER :: TOLER1 = 0.00001d0 + real(kind=DP), PARAMETER :: TOLER2 = 0.001d0 + + ! Limit to test for zero ionic activity (phs, bmy, 4/10/08) + real(kind=DP), PARAMETER :: EPS = 1.0d-30 + + !================================================================= + ! SCRATCH LOCAL VARIABLES and their descriptions: + !================================================================= + + INTEGER :: IRH ! Index set to percent relative humidity + INTEGER :: NITR ! Number of iterations for activity + ! coefficients + INTEGER :: NNN ! Loop index for iterations + INTEGER :: NR ! Number of roots to cubic equation for + ! H+ ciaprecision + real(kind=DP) :: A0 ! Coefficients and roots of + real(kind=DP) :: A1 ! Coefficients and roots of + real(kind=DP) :: A2 ! Coefficients and roots of + REAL :: AA ! Coefficients and discriminant for + ! quadratic equation for ammonium nitrate + real(kind=DP) :: BAL ! internal variables ( high ammonia case) + real(kind=DP) :: BB ! Coefficients and discriminant for + ! quadratic equation for ammonium nitrate + real(kind=DP) :: BHAT ! Variables used for ammonia solubility + real(kind=DP) :: CC ! Coefficients and discriminant for + ! quadratic equation for ammonium nitrate + real(kind=DP) :: CONVT ! Factor for conversion of units + real(kind=DP) :: DD ! Coefficients and discriminant for + ! quadratic equation for ammonium nitrate + real(kind=DP) :: DISC ! Coefficients and discriminant for + ! quadratic equation for ammonium nitrate + real(kind=DP) :: EROR ! Relative error used for convergence test + real(kind=DP) :: FNH3 ! "Free ammonia concentration", that + ! which exceeds TWOSO4 + real(kind=DP) :: GAMAAB ! Activity Coefficient for (NH4+, + ! HSO4-)GAMS( 2,3 ) + real(kind=DP) :: GAMAAN ! Activity coefficient for (NH4+, NO3-) + ! GAMS( 2,2 ) + real(kind=DP) :: GAMAHAT ! Variables used for ammonia solubility + real(kind=DP) :: GAMANA ! Activity coefficient for (H+ ,NO3-) + ! GAMS( 1,2 ) + real(kind=DP) :: GAMAS1 ! Activity coefficient for (2H+, SO4--) + ! GAMS( 1,1 ) + real(kind=DP) :: GAMAS2 ! Activity coefficient for (H+, HSO4-) + ! GAMS( 1,3 ) + real(kind=DP) :: GAMOLD ! used for convergence of iteration + real(kind=DP) :: GASQD ! internal variables ( high ammonia case) + real(kind=DP) :: HPLUS ! Hydrogen ion (low ammonia case) (moles + ! / kg water) + real(kind=DP) :: K1A ! Equilibrium constant for ammonia to + ! ammonium + real(kind=DP) :: K2SA ! Equilibrium constant for + ! sulfate-bisulfate (aqueous) + real(kind=DP) :: K3 ! Dissociation constant for ammonium + ! nitrate + real(kind=DP) :: KAN ! Equilibrium constant for ammonium + ! nitrate (aqueous) + real(kind=DP) :: KHAT ! Variables used for ammonia solubility + real(kind=DP) :: KNA ! Equilibrium constant for nitric acid + ! (aqueous) + real(kind=DP) :: KPH ! Henry's Law Constant for ammonia + real(kind=DP) :: KW ! Equilibrium constant for water + ! dissociation + real(kind=DP) :: KW2 ! Internal variable using KAN + real(kind=DP) :: MAN ! Nitrate (high ammonia case) (moles / + ! kg water) + real(kind=DP) :: MAS ! Sulfate (high ammonia case) (moles / + ! kg water) + real(kind=DP) :: MHSO4 ! Bisulfate (low ammonia case) (moles / + ! kg water) + real(kind=DP) :: MNA ! Nitrate (low ammonia case) (moles / kg + ! water) + real(kind=DP) :: MNH4 ! Ammonium (moles / kg water) + real(kind=DP) :: MOLNU ! Total number of moles of all ions + real(kind=DP) :: MSO4 ! Sulfate (low ammonia case) (moles / kg + ! water) + real(kind=DP) :: PHIBAR ! Practical osmotic coefficient + real(kind=DP) :: PHIOLD ! Previous value of practical osmotic + ! coefficient used for convergence of + ! iteration + real(kind=DP) :: RATIO ! Molar ratio of ammonium to sulfate + real(kind=DP) :: RK2SA ! Internal variable using K2SA + real(kind=DP) :: RKNA ! Internal variables using KNA + real(kind=DP) :: RKNWET ! Internal variables using KNA + real(kind=DP) :: RR1 + real(kind=DP) :: RR2 + real(kind=DP) :: STION ! Ionic strength + real(kind=DP) :: T1 ! Internal variables for temperature + ! corrections + real(kind=DP) :: T2 ! Internal variables for temperature + ! corrections + real(kind=DP) :: T21 ! Internal variables of convenience (low + ! ammonia case) + real(kind=DP) :: T221 ! Internal variables of convenience (low + ! ammonia case) + real(kind=DP) :: T3 ! Internal variables for temperature + ! corrections + real(kind=DP) :: T4 ! Internal variables for temperature + ! corrections + real(kind=DP) :: T6 ! Internal variables for temperature + ! corrections + real(kind=DP) :: TNH4 ! Total ammonia and ammonium in + ! micromoles / meter ** 3 + real(kind=DP) :: TNO3 ! Total nitrate in micromoles / meter ** 3 + !----------------------------------------------------------------------- + ! Prior to 4/10/08: + ! Now make these PARAMETERS instead of variables (bmy, 4/10/08) + !real(kind=DP) :: TOLER1 ! Tolerances for convergence test + !real(kind=DP) :: TOLER2 ! Tolerances for convergence test + !----------------------------------------------------------------------- + real(kind=DP) :: TSO4 ! Total sulfate in micromoles / meter ** 3 + real(kind=DP) :: TWOSO4 ! 2.0 * TSO4 (high ammonia case) (moles + ! / kg water) + real(kind=DP) :: WFRAC ! Water mass fraction + real(kind=DP) :: WH2O ! Aerosol liquid water content (internally) + ! micrograms / meter **3 on output + ! internally it is 10 ** (-6) kg (water) + ! / meter ** 3 + ! the conversion factor (1000 g = 1 kg) + ! is applied for AH2O output + real(kind=DP) :: WSQD ! internal variables ( high ammonia case) + real(kind=DP) :: XNO3 ! Nitrate aerosol concentration in + ! micromoles / meter ** 3 + real(kind=DP) :: XXQ ! Variable used in quadratic solution + real(kind=DP) :: YNH4 ! Ammonium aerosol concentration in + ! micromoles / meter** 3 + real(kind=DP) :: ZH2O ! Water variable saved in case ionic + ! strength too high. + real(kind=DP) :: ZSO4 ! Total sulfate molality - mso4 + mhso4 + ! (low ammonia case) (moles / kg water) + real(kind=DP) :: CAT( 2 ) ! Array for cations (1, H+); (2, NH4+) + ! (moles / kg water) + real(kind=DP) :: AN ( 3 ) ! Array for anions (1, SO4--); (2, + ! NO3-); (3, HSO4-) (moles / kg water) + real(kind=DP) :: CRUTES( 3 ) ! Coefficients and roots of + real(kind=DP) :: GAMS( 2, 3 ) ! Array of activity coefficients + real(kind=DP) :: TMASSHNO3 ! Total nitrate (vapor and particle) + real(kind=DP) :: GNO3_IN, ANO3_IN + character (len=75) :: err_msg + +!EOP +!------------------------------------------------------------------------- +! Begin... + + ! For extremely low relative humidity ( less than 1% ) set the + ! water content to a minimum and skip the calculation. + IF ( RH .LT. 0.01 ) THEN + AH2O = FLOOR + RETURN + ENDIF + + ! total sulfate concentration + TSO4 = MAX( FLOOR, SO4 / MWSO4 ) + ASO4 = SO4 + + !Cia models3 merge NH3/NH4 , HNO3,NO3 here + !c *** recommended by Dr. Ingmar Ackermann + + ! total nitrate + TNO3 = MAX( 0.0d0, ( ANO3 / MWNO3 + GNO3 / MWHNO3 ) ) + + ! total ammonia + TNH4 = MAX( 0.0d0, ( GNH3 / MWNH3 + ANH4 / MWNH4 ) ) + + GNO3_IN = GNO3 + ANO3_IN = ANO3 + TMASSHNO3 = MAX( 0.0d0, GNO3 + ANO3 ) + + ! set the molar ratio of ammonium to sulfate + RATIO = TNH4 / TSO4 + + ! validity check for negative concentration + IF ( TSO4 < 0.0d0 .OR. TNO3 < 0.0d0 .OR. TNH4 < 0.0d0 ) THEN + PRINT*, 'TSO4 : ', TSO4 + PRINT*, 'TNO3 : ', TNO3 + PRINT*, 'TNH4 : ', TNH4 + +!.sds CALL GEOS_CHEM_STOP + err_msg = 'negative concen problem in RPMARES - TSO4, TNO3, TNH4:' + call PrintError & + & (err_msg, .true., 0, 0, 0, 2, TSO4, TNO3) + ENDIF + + ! now set humidity index IRH as a percent + IRH = NINT( 100.0 * RH ) + + ! now set humidity index IRH as a percent + IRH = MAX( 1, IRH ) + IRH = MIN( 99, IRH ) + + !================================================================= + ! Specify the equilibrium constants at correct temperature. + ! Also change units from ATM to MICROMOLE/M**3 (for KAN, KPH, and K3 ) + ! Values from Kim et al. (1993) except as noted. + ! Equilibrium constant in Kim et al. (1993) + ! K = K0 exp[ a(T0/T -1) + b(1+log(T0/T)-T0/T) ], T0 = 298.15 K + ! K = K0 EXP[ a T3 + b T4 ] in the code here. + !================================================================= + CONVT = 1.0d0 / ( 0.082d0 * TEMP ) + T6 = 0.082d-9 * TEMP + T1 = 298.0d0 / TEMP + T2 = LOG( T1 ) + T3 = T1 - 1.0d0 + T4 = 1.0d0 + T2 - T1 + + !================================================================= + ! Equilibrium Relation + ! + ! HSO4-(aq) = H+(aq) + SO4--(aq) ; K2SA + ! NH3(g) = NH3(aq) ; KPH + ! NH3(aq) + H2O(aq) = NH4+(aq) + OH-(aq) ; K1A + ! HNO3(g) = H+(aq) + NO3-(aq) ; KNA + ! NH3(g) + HNO3(g) = NH4NO3(s) ; K3 + ! H2O(aq) = H+(aq) + OH-(aq) ; KW + !================================================================= + KNA = 2.511d+06 * EXP( 29.17d0 * T3 + 16.83d0 * T4 ) * T6 + K1A = 1.805d-05 * EXP( -1.50d0 * T3 + 26.92d0 * T4 ) + K2SA = 1.015d-02 * EXP( 8.85d0 * T3 + 25.14d0 * T4 ) + KW = 1.010d-14 * EXP( -22.52d0 * T3 + 26.92d0 * T4 ) + KPH = 57.639d0 * EXP( 13.79d0 * T3 - 5.39d0 * T4 ) * T6 + !K3 = 5.746E-17 * EXP( -74.38 * T3 + 6.12 * T4 ) * T6 * T6 + KHAT = KPH * K1A / KW + KAN = KNA * KHAT + + ! Compute temperature dependent equilibrium constant for NH4NO3 + ! (from Mozurkewich, 1993) + K3 = EXP( 118.87d0 - 24084.0d0 / TEMP - 6.025d0 * LOG( TEMP ) ) + + ! Convert to (micromoles/m**3) **2 + K3 = K3 * CONVT * CONVT + + WH2O = 0.0d0 + STION = 0.0d0 +!.sds AH2O = 0.0d0 + AH2O = FLOOR + + MAS = 0.0d0 + MAN = 0.0d0 + HPLUS = 0.0d0 + !-------------------------------------------------------------- + ! Prior to 4/10/08: + ! Now make these parameters so that they won't lose their + ! values. (phs, bmy, 4/10/08) + !TOLER1 = 0.00001d0 + !TOLER2 = 0.001d0 + !-------------------------------------------------------------- + NITR = 0 + NR = 0 + GAMAAN = 1.0d0 + GAMOLD = 1.0d0 + + ! If there is very little sulfate and nitrate + ! set concentrations to a very small value and return. + IF ( ( TSO4 .LT. MINSO4 ) .AND. ( TNO3 .LT. MINNO3 ) ) THEN + ASO4 = MAX( FLOOR, ASO4 ) + AHSO4 = MAX( FLOOR, AHSO4 ) ! [rjp, 12/12/01] + ANO3 = MAX( FLOOR, ANO3 ) + ANH4 = MAX( FLOOR, ANH4 ) + WH2O = FLOOR + AH2O = FLOOR + GNH3 = MAX( FLOOR, GNH3 ) + GNO3 = MAX( FLOOR, GNO3 ) + + RETURN + ENDIF + + !================================================================= + ! High Ammonia Case + !================================================================= + IF ( RATIO .GT. 2.0d0 ) THEN + + GAMAAN = 0.1d0 + + ! Set up twice the sulfate for future use. + TWOSO4 = 2.0d0 * TSO4 + XNO3 = 0.0d0 + YNH4 = TWOSO4 + + ! Treat different regimes of relative humidity + ! + ! ZSR relationship is used to set water levels. Units are + ! 10**(-6) kg water/ (cubic meter of air) + ! start with ammomium sulfate solution without nitrate + + CALL AWATER( IRH, TSO4, YNH4, TNO3, AH2O ) !**** note TNO3 + WH2O = 1.0d-3 * AH2O + + ASO4 = TSO4 * MWSO4 + + ! In sulfate poor case, Sulfate ion is preferred + ! Set bisulfate equal to zero [rjp, 12/12/01] + AHSO4 = 0.0d0 + ANO3 = 0.0d0 + ANH4 = YNH4 * MWNH4 + WFRAC = AH2O / ( ASO4 + ANH4 + AH2O ) + + !IF ( WFRAC .EQ. 0.0 ) RETURN ! No water + IF ( WFRAC .LT. 0.2d0 ) THEN + + ! "dry" ammonium sulfate and ammonium nitrate + ! compute free ammonia + FNH3 = TNH4 - TWOSO4 + CC = TNO3 * FNH3 - K3 + + ! check for not enough to support aerosol + IF ( CC .LE. 0.0d0 ) THEN + XNO3 = 0.0d0 + ELSE + AA = 1.0d0 + BB = -( TNO3 + FNH3 ) + DISC = BB * BB - 4.0d0 * CC + + ! Check for complex roots of the quadratic + ! set retain initial values of nitrate and RETURN + ! if complex roots are found + IF ( DISC .LT. 0.0d0 ) THEN + XNO3 = 0.0d0 + AH2O = 1000.0d0 * WH2O + YNH4 = TWOSO4 + ASO4 = TSO4 * MWSO4 + AHSO4 = 0.0d0 + ANH4 = YNH4 * MWNH4 + GNH3 = MWNH3 * MAX( FLOOR, ( TNH4 - YNH4 ) ) + GNO3 = GNO3_IN + ANO3 = ANO3_IN + RETURN + ENDIF + + ! to get here, BB .lt. 0.0, CC .gt. 0.0 always + DD = SQRT( DISC ) + XXQ = -0.5d0 * ( BB + SIGN ( 1.0d0, BB ) * DD ) + + + ! Since both roots are positive, select smaller root. + XNO3 = MIN( XXQ / AA, CC / XXQ ) + + ENDIF ! CC .LE. 0.0 + + AH2O = 1000.0d0 * WH2O + YNH4 = TWOSO4 + XNO3 + ASO4 = TSO4 * MWSO4 + AHSO4 = FLOOR + ANO3 = XNO3 * MWNO3 + ANH4 = YNH4 * MWNH4 + GNH3 = MWNH3 * MAX( FLOOR, ( TNH4 - YNH4 ) ) + GNO3 = MAX( FLOOR, ( TMASSHNO3 - ANO3 ) ) + RETURN + ENDIF ! WFRAC .LT. 0.2 + + ! liquid phase containing completely neutralized sulfate and + ! some nitrate. Solve for composition and quantity. + MAS = TSO4 / WH2O + MAN = 0.0d0 + XNO3 = 0.0d0 + YNH4 = TWOSO4 + PHIOLD = 1.0d0 + + !=============================================================== + ! Start loop for iteration + ! + ! The assumption here is that all sulfate is ammonium sulfate, + ! and is supersaturated at lower relative humidities. + !=============================================================== + DO NNN = 1, 50 ! loop count reduced 0409/2001 by FSB + + NITR = NNN + GASQD = GAMAAN * GAMAAN + WSQD = WH2O * WH2O + KW2 = KAN * WSQD / GASQD + AA = 1.0 - KW2 + BB = TWOSO4 + KW2 * ( TNO3 + TNH4 - TWOSO4 ) + CC = -KW2 * TNO3 * ( TNH4 - TWOSO4 ) + + ! This is a quadratic for XNO3 [MICROMOLES / M**3] + ! of nitrate in solution + DISC = BB * BB - 4.0d0 * AA * CC + + ! Check for complex roots, retain inital values and RETURN + IF ( DISC .LT. 0.0 ) THEN + XNO3 = 0.0d0 + AH2O = 1000.0d0 * WH2O + YNH4 = TWOSO4 + ASO4 = TSO4 * MWSO4 + AHSO4 = FLOOR ! [rjp, 12/12/01] + ANH4 = YNH4 * MWNH4 + GNH3 = MWNH3 * MAX( FLOOR, (TNH4 - YNH4 ) ) + GNO3 = GNO3_IN + ANO3 = ANO3_IN + RETURN + ENDIF + + ! Deal with degenerate case (yoj) + IF ( AA .NE. 0.0d0 ) THEN + DD = SQRT( DISC ) + XXQ = -0.5d0 * ( BB + SIGN( 1.0d0, BB ) * DD ) + RR1 = XXQ / AA + RR2 = CC / XXQ + + ! choose minimum positve root + IF ( ( RR1 * RR2 ) .LT. 0.0d0 ) THEN + XNO3 = MAX( RR1, RR2 ) + ELSE + XNO3 = MIN( RR1, RR2 ) + ENDIF + ELSE + XNO3 = - CC / BB ! AA equals zero here. + ENDIF + + XNO3 = MIN( XNO3, TNO3 ) + + ! This version assumes no solid sulfate forms (supersaturated ) + ! Now update water + CALL AWATER ( IRH, TSO4, YNH4, XNO3, AH2O ) + + ! ZSR relationship is used to set water levels. Units are + ! 10**(-6) kg water/ (cubic meter of air). The conversion + ! from micromoles to moles is done by the units of WH2O. + WH2O = 1.0d-3 * AH2O + + ! Ionic balance determines the ammonium in solution. + MAN = XNO3 / WH2O + MAS = TSO4 / WH2O + MNH4 = 2.0d0 * MAS + MAN + YNH4 = MNH4 * WH2O + + ! MAS, MAN and MNH4 are the aqueous concentrations of sulfate, + ! nitrate, and ammonium in molal units (moles/(kg water) ). + STION = 3.0d0 * MAS + MAN + CAT( 1 ) = 0.0d0 + CAT( 2 ) = MNH4 + AN ( 1 ) = MAS + AN ( 2 ) = MAN + AN ( 3 ) = 0.0d0 +! CALL ACTCOF ( CAT, AN, GAMS, MOLNU, PHIBAR ) + CALL ACTCOF ( CAT, AN, GAMS ) + GAMAAN = GAMS( 2, 2 ) + + ! Use GAMAAN for convergence control + EROR = ABS( GAMOLD - GAMAAN ) / GAMOLD + GAMOLD = GAMAAN + + ! Check to see if we have a solution + IF ( EROR .LE. TOLER1 ) THEN + ASO4 = TSO4 * MWSO4 + AHSO4 = 0.0d0 ! [rjp, 12/12/01] + ANO3 = XNO3 * MWNO3 + ANH4 = YNH4 * MWNH4 + GNO3 = MAX( FLOOR, ( TMASSHNO3 - ANO3 ) ) + GNH3 = MWNH3 * MAX( FLOOR, ( TNH4 - YNH4 ) ) + AH2O = 1000.0d0 * WH2O + RETURN + ENDIF + + ENDDO + + ! If after NITR iterations no solution is found, then: + ! FSB retain the initial values of nitrate particle and vapor + ! note whether or not convert all bisulfate to sulfate + ASO4 = TSO4 * MWSO4 + AHSO4 = FLOOR + XNO3 = TNO3 / MWNO3 + YNH4 = TWOSO4 + ANH4 = YNH4 * MWNH4 + + CALL AWATER ( IRH, TSO4, YNH4, XNO3, AH2O ) + + GNO3 = GNO3_IN + ANO3 = ANO3_IN + GNH3 = MAX( FLOOR, MWNH3 * (TNH4 - YNH4 ) ) + RETURN + + !================================================================ + ! Low Ammonia Case + ! + ! Coded by Dr. Francis S. Binkowski 12/8/91.(4/26/95) + ! modified 8/28/98 + ! modified 04/09/2001 + ! + ! All cases covered by this logic + !================================================================= + ELSE + + WH2O = 0.0d0 + CALL AWATER ( IRH, TSO4, TNH4, TNO3, AH2O ) + WH2O = 1.0d-3 * AH2O + ZH2O = AH2O + + ! convert 10**(-6) kg water/(cubic meter of air) to micrograms + ! of water per cubic meter of air (1000 g = 1 kg) + ! in sulfate rich case, preferred form is HSO4- + !ASO4 = TSO4 * MWSO4 + ASO4 = FLOOR ![rjp, 12/12/01] + AHSO4 = TSO4 * MWSO4 ![rjp, 12/12/01] + ANH4 = TNH4 * MWNH4 + ANO3 = ANO3_IN + GNO3 = TMASSHNO3 - ANO3 + GNH3 = FLOOR + + !============================================================== + ! *** Examine special cases and return if necessary. + ! + ! FSB For values of RATIO less than 0.5 do no further + ! calculations. The code will cycle and still predict the + ! same amount of ASO4, ANH4, ANO3, AH2O so terminate early + ! to swame computation + !============================================================== + IF ( RATIO .LT. 0.5d0 ) RETURN ! FSB 04/09/2001 + + ! Check for zero water. + IF ( WH2O .EQ. 0.0d0 ) RETURN + ZSO4 = TSO4 / WH2O + + ! ZSO4 is the molality of total sulfate i.e. MSO4 + MHSO4 + ! do not solve for aerosol nitrate for total sulfate molality + ! greater than 11.0 because the model parameters break down + !### IF ( ZSO4 .GT. 11.0 ) THEN + !IF ( ZSO4 .GT. 9.0 ) THEN ! 18 June 97 + !IF ( ZSO4 .GT. 9.d0 ) THEN ! H. Bian 24 June 2015 + IF ( ZSO4 .GT. 9.00 ) THEN ! H. Bian 24 June 2015 + RETURN + ENDIF + IF ( ZSO4 .GT. 0.1d0 .and. TEMP .le. 220.d0) THEN ! H. Bian 24 June 2015 + RETURN + ENDIF + + ! *** Calculation may now proceed. + ! + ! First solve with activity coeffs of 1.0, then iterate. + PHIOLD = 1.0d0 + GAMANA = 1.0d0 + GAMAS1 = 1.0d0 + GAMAS2 = 1.0d0 + GAMAAB = 1.0d0 + GAMOLD = 1.0d0 + + ! All ammonia is considered to be aerosol ammonium. + MNH4 = TNH4 / WH2O + + ! MNH4 is the molality of ammonium ion. + YNH4 = TNH4 + + ! loop for iteration + DO NNN = 1, 50 ! loop count reduced 04/09/2001 by FSB + NITR = NNN + + ! set up equilibrium constants including activities + ! solve the system for hplus first then sulfate & nitrate + RK2SA = K2SA * GAMAS2 * GAMAS2 / (GAMAS1 * GAMAS1 * GAMAS1) + RKNA = KNA / ( GAMANA * GAMANA ) + RKNWET = RKNA * WH2O + T21 = ZSO4 - MNH4 + T221 = ZSO4 + T21 + + ! set up coefficients for cubic + A2 = RK2SA + RKNWET - T21 + A1 = RK2SA * RKNWET - T21 * ( RK2SA + RKNWET ) & + & - RK2SA * ZSO4 - RKNA * TNO3 + A0 = - (T21 * RK2SA * RKNWET & + & + RK2SA * RKNWET * ZSO4 + RK2SA * RKNA * TNO3 ) + + CALL CUBIC ( A2, A1, A0, NR, CRUTES ) + + ! Code assumes the smallest positive root is in CRUTES(1) + HPLUS = CRUTES( 1 ) + BAL = HPLUS **3 + A2 * HPLUS**2 + A1 * HPLUS + A0 + + ! molality of sulfate ion + MSO4 = RK2SA * ZSO4 / ( HPLUS + RK2SA ) + + ! molality of bisulfate ion + ! MAX added 04/09/2001 by FSB + MHSO4 = MAX( 1.0d-10, ZSO4 - MSO4 ) + + ! molality of nitrate ion + MNA = RKNA * TNO3 / ( HPLUS + RKNWET ) + MNA = MAX( 0.0d0, MNA ) + MNA = MIN( MNA, TNO3 / WH2O ) + XNO3 = MNA * WH2O + ANO3 = MNA * WH2O * MWNO3 + GNO3 = MAX( FLOOR, TMASSHNO3 - ANO3 ) + ASO4 = MSO4 * WH2O * MWSO4 ![rjp, 12/12/01] + AHSO4 = MHSO4 * WH2O * MWSO4 ![rjp, 12/12/01] + + ! Calculate ionic strength + STION = 0.5d0 * ( HPLUS + MNA + MNH4 + MHSO4 + 4.0d0 * MSO4) + + ! Update water + CALL AWATER ( IRH, TSO4, YNH4, XNO3, AH2O ) + + ! Convert 10**(-6) kg water/(cubic meter of air) to micrograms + ! of water per cubic meter of air (1000 g = 1 kg) + WH2O = 1.0d-3 * AH2O + CAT( 1 ) = HPLUS + CAT( 2 ) = MNH4 + AN ( 1 ) = MSO4 + AN ( 2 ) = MNA + AN ( 3 ) = MHSO4 + + CALL ACTCOF ( CAT, AN, GAMS ) + + GAMANA = GAMS( 1, 2 ) + GAMAS1 = GAMS( 1, 1 ) + GAMAS2 = GAMS( 1, 3 ) + GAMAAN = GAMS( 2, 2 ) + + !------------------------------------------------------------ + ! Add robustness: now check if GAMANA or GAMAS1 is too small + ! for the division in RKNA and RK2SA. If they are, return w/ + ! original values: basically replicate the procedure used + ! after the current DO-loop in case of no-convergence + ! (phs, bmy, rjp, 4/10/08) + !-------------------------------------------------------------- + IF ( ( ABS( GAMANA ) < EPS ) .OR. ( ABS( GAMAS1 ) < EPS ) ) THEN + + ! Reset to original values + ANH4 = TNH4 * MWNH4 + GNH3 = FLOOR + GNO3 = GNO3_IN + ANO3 = ANO3_IN + ASO4 = TSO4 * MWSO4 + AHSO4 = FLOOR + + ! Update water + CALL AWATER ( IRH, TSO4, TNH4, TNO3, AH2O ) + + ! Exit this subroutine + RETURN + ENDIF + + GAMAHAT = ( GAMAS2 * GAMAS2 / ( GAMAAB * GAMAAB ) ) + BHAT = KHAT * GAMAHAT + !### EROR = ABS ( ( PHIOLD - PHIBAR ) / PHIOLD ) + !### PHIOLD = PHIBAR + EROR = ABS ( GAMOLD - GAMAHAT ) / GAMOLD + GAMOLD = GAMAHAT + + ! return with good solution + IF ( EROR .LE. TOLER2 ) THEN + RETURN + ENDIF + + ENDDO + + ! after NITR iterations, failure to solve the system + ! convert all ammonia to aerosol ammonium and return input + ! values of NO3 and HNO3 + ANH4 = TNH4 * MWNH4 + GNH3 = FLOOR + GNO3 = GNO3_IN + ANO3 = ANO3_IN + ASO4 = TSO4 * MWSO4 ! [rjp, 12/17/01] + AHSO4= FLOOR ! [rjp, 12/17/01] + + CALL AWATER ( IRH, TSO4, TNH4, TNO3, AH2O ) + + RETURN + + ENDIF ! ratio .gt. 2.0 + + ! Return to calling program + + end subroutine RPMARES + +!------------------------------------------------------------------------------ + + SUBROUTINE AWATER( IRHX, MSO4, MNH4, MNO3, WH2O ) +! +!****************************************************************************** +! NOTE!!! wh2o is returned in micrograms / cubic meter +! mso4,mnh4,mno3 are in microMOLES / cubic meter +! +! This version uses polynomials rather than tables, and uses empirical +! polynomials for the mass fraction of solute (mfs) as a function of water +! activity +! where: +! +! mfs = ms / ( ms + mw) +! ms is the mass of solute +! mw is the mass of water. +! +! Define y = mw/ ms +! +! then mfs = 1 / (1 + y) +! +! y can then be obtained from the values of mfs as +! +! y = (1 - mfs) / mfs +! +! +! the aerosol is assumed to be in a metastable state if the rh is +! is below the rh of deliquescence, but above the rh of crystallization. +! +! ZSR interpolation is used for sulfates with x ( the molar ratio of +! ammonium to sulfate in eh range 0 <= x <= 2, by sections. +! section 1: 0 <= x < 1 +! section 2: 1 <= x < 1.5 +! section 3: 1.5 <= x < 2.0 +! section 4: 2 <= x +! In sections 1 through 3, only the sulfates can affect the amount of water +! on the particles. +! In section 4, we have fully neutralized sulfate, and extra ammonium which +! allows more nitrate to be present. Thus, the ammount of water is +! calculated +! using ZSR for ammonium sulfate and ammonium nitrate. Crystallization is +! assumed to occur in sections 2,3,and 4. See detailed discussion below. +! +! definitions: +! mso4, mnh4, and mno3 are the number of micromoles/(cubic meter of air) +! for sulfate, ammonium, and nitrate respectively +! irhx is the relative humidity (%) +! wh2o is the returned water amount in micrograms / cubic meter of air +! x is the molar ratio of ammonium to sulfate +! y0,y1,y1.5, y2 are the water contents in mass of water/mass of solute +! for pure aqueous solutions with x equal 1, 1.5, and 2 respectively. +! y3 is the value of the mass ratio of water to solute for +! a pure ammonium nitrate solution. +! +! +! coded by Dr. Francis S. Binkowski, 4/8/96. +! +! *** modified 05/30/2000 +! The use of two values of mfs at an ammonium to sulfate ratio +! representative of ammonium sulfate led to an minor inconsistancy +! in nitrate behavior as the ratio went from a value less than two +! to a value greater than two and vice versa with either ammonium +! held constant and sulfate changing, or sulfate held constant and +! ammonium changing. the value of Chan et al. (1992) is the only value +! now used. +! +! *** Modified 09/25/2002 +! Ported into "rpmares_mod.f". Now declare all variables with REAL*8. +! Also cleaned up comments and made cosmetic changes. Force double +! precision explicitly with "D" exponents. +!****************************************************************************** +! + ! Arguments + INTEGER :: IRHX + REAL*8 :: MSO4, MNH4, MNO3, WH2O + + ! Local variables + INTEGER :: IRH + REAL*8 :: TSO4, TNH4, TNO3, X, AW, AWC + REAL*8 :: MFS0, MFS1, MFS15, Y + REAL*8 :: Y0, Y1, Y15, Y2, Y3, Y40 + REAL*8 :: Y140, Y1540, YC, MFSSO4, MFSNO3 + + ! Molecular weight parameters + REAL*8, PARAMETER :: MWSO4 = 96.0636d0 + REAL*8, PARAMETER :: MWNH4 = 18.0985d0 + REAL*8, PARAMETER :: MWNO3 = 62.0649d0 + REAL*8, PARAMETER :: MW2 = MWSO4 + 2.0d0 * MWNH4 + REAL*8, PARAMETER :: MWANO3 = MWNO3 + MWNH4 + + !================================================================= + ! The polynomials use data for aw as a function of mfs from Tang + ! and Munkelwitz, JGR 99: 18801-18808, 1994. The polynomials were + ! fit to Tang's values of water activity as a function of mfs. + ! + ! *** coefficients of polynomials fit to Tang and Munkelwitz data + ! now give mfs as a function of water activity. + !================================================================= + REAL*8 :: C1(4) = (/ 0.9995178d0, -0.7952896d0, & + & 0.99683673d0, -1.143874d0 /) + + REAL*8 :: C15(4) = (/ 1.697092d0, -4.045936d0, & + & 5.833688d0, -3.463783d0 /) + + !================================================================= + ! The following coefficients are a fit to the data in Table 1 of + ! Nair & Vohra, J. Aerosol Sci., 6: 265-271, 1975 + ! data c0/0.8258941, -1.899205, 3.296905, -2.214749 / + ! + ! New data fit to data from + ! Nair and Vohra J. Aerosol Sci., 6: 265-271, 1975 + ! Giaque et al. J.Am. Chem. Soc., 82: 62-70, 1960 + ! Zeleznik J. Phys. Chem. Ref. Data, 20: 157-1200 + !================================================================= + REAL*8 :: C0(4) = (/ 0.798079d0, -1.574367d0, & + & 2.536686d0, -1.735297d0 /) + + !================================================================= + ! Polynomials for ammonium nitrate and ammonium sulfate are from: + ! Chan et al.1992, Atmospheric Environment (26A): 1661-1673. + !================================================================= + REAL*8 :: KNO3(6) = (/ 0.2906d0, 6.83665d0, -26.9093d0, & + & 46.6983d0, -38.803d0, 11.8837d0 /) + + REAL*8 :: KSO4(6) = (/ 2.27515d0, -11.147d0, 36.3369d0, & + & -64.2134d0, 56.8341d0, -20.0953d0 /) + + !================================================================= + ! AWATER begins here! + !================================================================= + + ! Check range of per cent relative humidity + IRH = IRHX + IRH = MAX( 1, IRH ) + IRH = MIN( IRH, 100 ) + + ! Water activity = fractional relative humidity + AW = DBLE( IRH ) / 100.0d0 + TSO4 = MAX( MSO4 , 0.0d0 ) + TNH4 = MAX( MNH4 , 0.0d0 ) + TNO3 = MAX( MNO3 , 0.0d0 ) + X = 0.0d0 + + ! If there is non-zero sulfate calculate the molar ratio + ! otherwise check for non-zero nitrate and ammonium + IF ( TSO4 .GT. 0.0d0 ) THEN + X = TNH4 / TSO4 + ELSE + IF ( TNO3 .GT. 0.0d0 .AND. TNH4 .GT. 0.0d0 ) X = 10.0d0 + ENDIF + + ! *** begin screen on x for calculating wh2o + IF ( X .LT. 1.0d0 ) THEN + MFS0 = nh3_POLY4( C0, AW ) + MFS1 = nh3_POLY4( C1, AW ) + Y0 = ( 1.0d0 - MFS0 ) / MFS0 + Y1 = ( 1.0d0 - MFS1 ) / MFS1 + Y = ( 1.0d0 - X ) * Y0 + X * Y1 + + ELSE IF ( X .LT. 1.5d0 ) THEN + + IF ( IRH .GE. 40 ) THEN + MFS1 = nh3_POLY4( C1, AW ) + MFS15 = nh3_POLY4( C15, AW ) + Y1 = ( 1.0d0 - MFS1 ) / MFS1 + Y15 = ( 1.0d0 - MFS15 ) / MFS15 + Y = 2.0d0 * ( Y1 * ( 1.5d0 - X ) + Y15 *( X - 1.0d0 ) ) + + !============================================================== + ! Set up for crystalization + ! + ! Crystallization is done as follows: + ! + ! For 1.5 <= x, crystallization is assumed to occur + ! at rh = 0.4 + ! + ! For x <= 1.0, crystallization is assumed to occur at an + ! rh < 0.01, and since the code does not allow ar rh < 0.01, + ! crystallization is assumed not to occur in this range. + ! + ! For 1.0 <= x <= 1.5 the crystallization curve is a straignt + ! line from a value of y15 at rh = 0.4 to a value of zero at + ! y1. From point B to point A in the diagram. The algorithm + ! does a double interpolation to calculate the amount of + ! water. + ! + ! y1(0.40) y15(0.40) + ! + + Point B + ! + ! + ! + ! + ! +--------------------+ + ! x=1 x=1.5 + ! Point A + !============================================================== + ELSE + + ! rh along the crystallization curve. + AWC = 0.80d0 * ( X - 1.0d0 ) + Y = 0.0d0 + + ! interpolate using crystalization curve + IF ( AW .GE. AWC ) THEN + MFS1 = nh3_POLY4( C1, 0.40d0 ) + MFS15 = nh3_POLY4( C15, 0.40d0 ) + Y140 = ( 1.0d0 - MFS1 ) / MFS1 + Y1540 = ( 1.0d0 - MFS15 ) / MFS15 + Y40 = 2.0d0 * ( Y140 * ( 1.5d0 - X ) + & + & Y1540 * ( X - 1.0d0 ) ) + + ! Y along crystallization curve + YC = 2.0d0 * Y1540 * ( X - 1.0d0 ) + Y = Y40 - (Y40 - YC) * (0.40d0 - AW) / (0.40d0 - AWC) + ENDIF + ENDIF + + ELSE IF ( X .LT. 2.0d0 ) then ! changed 12/11/2000 by FSB + Y = 0.0D0 + + IF ( IRH .GE. 40 ) THEN + MFS15 = nh3_POLY4( C15, AW ) + !MFS2 = nh3_POLY4( C2, AW ) + Y15 = ( 1.0d0 - MFS15 ) / MFS15 + !y2 = ( 1.0d0 - MFS2 ) / MFS2 + MFSSO4 = nh3_POLY6( KSO4, AW ) ! Changed 05/30/2000 by FSB + Y2 = ( 1.0d0 - MFSSO4 ) / MFSSO4 + Y = 2.0d0 * (Y15 * (2.0d0 - X) + Y2 * (X - 1.5d0) ) + ENDIF + + ELSE ! 2.0 <= x changed 12/11/2000 by FSB + + !============================================================== + ! Regime where ammonium sulfate and ammonium nitrate are + ! in solution. + ! + ! following cf&s for both ammonium sulfate and ammonium nitrate + ! check for crystallization here. their data indicate a 40% + ! value is appropriate. + !============================================================== + Y2 = 0.0d0 + Y3 = 0.0d0 + + IF ( IRH .GE. 40 ) THEN + MFSSO4 = nh3_POLY6( KSO4, AW ) + MFSNO3 = nh3_POLY6( KNO3, AW ) + Y2 = ( 1.0d0 - MFSSO4 ) / MFSSO4 + Y3 = ( 1.0d0 - MFSNO3 ) / MFSNO3 + + ENDIF + + ENDIF ! end of checking on x + + !================================================================= + ! Now set up output of WH2O + ! WH2O units are micrograms (liquid water) / cubic meter of air + !================================================================= + IF ( X .LT. 2.0D0 ) THEN ! changed 12/11/2000 by FSB + + WH2O = Y * ( TSO4 * MWSO4 + MWNH4 * TNH4 ) + + ELSE + + ! this is the case that all the sulfate is ammonium sulfate + ! and the excess ammonium forms ammonum nitrate + WH2O = Y2 * TSO4 * MW2 + Y3 * TNO3 * MWANO3 + + ENDIF + + ! Return to calling program + END SUBROUTINE AWATER + +!------------------------------------------------------------------------------ + + FUNCTION nh3_POLY4( A, X ) RESULT( Y ) + + ! Arguments + REAL*8, INTENT(IN) :: A(4), X + + ! Return value + REAL*8 :: Y + + !================================================================= + ! nh3_POLY4 begins here! + !================================================================= + Y = A(1) + X * ( A(2) + X * ( A(3) + X * ( A(4) ))) + + ! Return to calling program + END FUNCTION nh3_POLY4 + +!------------------------------------------------------------------------------ + + FUNCTION nh3_POLY6( A, X ) RESULT( Y ) + + ! Arguments + REAL*8, INTENT(IN) :: A(6), X + + ! Return value + REAL*8 :: Y + + !================================================================= + ! nh3_POLY6 begins here! + !================================================================= + Y = A(1) + X * ( A(2) + X * ( A(3) + X * ( A(4) + & + & X * ( A(5) + X * ( A(6) ))))) + + ! Return to calling program + END FUNCTION nh3_POLY6 + +!------------------------------------------------------------------------------ + + SUBROUTINE CUBIC( A2, A1, A0, NR, CRUTES ) +! +!****************************************************************************** +! Subroutine to find the roots of a cubic equation / 3rd order polynomial +! Formulae can be found in numer. recip. on page 145 +! kiran developed this version on 25/4/1990 +! Dr. Francis S. Binkowski modified the routine on 6/24/91, 8/7/97 +! *** +! *** modified 2/23/98 by fsb to incorporate Dr. Ingmar Ackermann's +! recommendations for setting a0, a1,a2 as real*8 variables. +! +! Modified by Bob Yantosca (10/15/02) +! - Now use upper case / white space +! - force double precision with "D" exponents +! - updated comments / cosmetic changes +! - now call ERROR_STOP from "error_mod.f" to stop the run safely +!****************************************************************************** +! + ! Arguments + INTEGER :: NR + REAL*8 :: A2, A1, A0 + REAL*8 :: CRUTES(3) + + ! Local variables + REAL*8 :: QQ, RR, A2SQ, THETA, DUM1, DUM2 + REAL*8 :: PART1, PART2, PART3, RRSQ, PHI, YY1 + REAL*8 :: YY2, YY3, COSTH, SINTH + REAL*8, PARAMETER :: ONE = 1.0d0 + REAL*8, PARAMETER :: SQRT3 = 1.732050808d0 + REAL*8, PARAMETER :: ONE3RD = 0.333333333d0 + ! !LOCAL VARIABLES: + character (len=75) :: err_msg + + !================================================================= + ! CUBIC begins here! + !================================================================= + A2SQ = A2 * A2 + QQ = ( A2SQ - 3.d0*A1 ) / 9.d0 + RR = ( A2*( 2.d0*A2SQ - 9.d0*A1 ) + 27.d0*A0 ) / 54.d0 + + ! CASE 1 THREE REAL ROOTS or CASE 2 ONLY ONE REAL ROOT + DUM1 = QQ * QQ * QQ + RRSQ = RR * RR + DUM2 = DUM1 - RRSQ + + IF ( DUM2 .GE. 0.d0 ) THEN + + ! Now we have three real roots + PHI = SQRT( DUM1 ) + + IF ( ABS( PHI ) .LT. 1.d-20 ) THEN + CRUTES(1) = 0.0d0 + CRUTES(2) = 0.0d0 + CRUTES(3) = 0.0d0 + NR = 0 +!.sds no such module - what is ours? +!.sds CALL ERROR_STOP( 'PHI < 1d-20', 'CUBIC (rpmares_mod.f)' ) + print *,'PHI < 1d-20 in CUBIC (rpmares_mod.f)' + err_msg = 'PHI < 1d-20 in CUBIC (rpmares_mod.f):' + call PrintError & + & (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0) + + ENDIF + + THETA = ACOS( RR / PHI ) / 3.0d0 + COSTH = COS( THETA ) + SINTH = SIN( THETA ) + + ! Use trig identities to simplify the expressions + ! Binkowski's modification + PART1 = SQRT( QQ ) + YY1 = PART1 * COSTH + YY2 = YY1 - A2/3.0d0 + YY3 = SQRT3 * PART1 * SINTH + CRUTES(3) = -2.0d0*YY1 - A2/3.0d0 + CRUTES(2) = YY2 + YY3 + CRUTES(1) = YY2 - YY3 + + ! Set negative roots to a large positive value + IF ( CRUTES(1) .LT. 0.0d0 ) CRUTES(1) = 1.0d9 + IF ( CRUTES(2) .LT. 0.0d0 ) CRUTES(2) = 1.0d9 + IF ( CRUTES(3) .LT. 0.0d0 ) CRUTES(3) = 1.0d9 + + ! Put smallest positive root in crutes(1) + CRUTES(1) = MIN( CRUTES(1), CRUTES(2), CRUTES(3) ) + NR = 3 + + ELSE + + ! Now here we have only one real root + PART1 = SQRT( RRSQ - DUM1 ) + PART2 = ABS( RR ) + PART3 = ( PART1 + PART2 )**ONE3RD + CRUTES(1) = -SIGN(ONE,RR) * ( PART3 + (QQ/PART3) ) - A2/3.D0 + CRUTES(2) = 0.D0 + CRUTES(3) = 0.D0 + NR = 1 + + ENDIF + + ! Return to calling program + END SUBROUTINE CUBIC + +!------------------------------------------------------------------------------ + + SUBROUTINE ACTCOF( CAT, AN, GAMA, MOLNU, PHIMULT ) +! +!****************************************************************************** +! +! DESCRIPTION: +! +! This subroutine computes the activity coefficients of (2NH4+,SO4--), +! (NH4+,NO3-),(2H+,SO4--),(H+,NO3-),AND (H+,HSO4-) in aqueous +! multicomponent solution, using Bromley's model and Pitzer's method. +! +! REFERENCES: +! +! Bromley, L.A. (1973) Thermodynamic properties of strong electrolytes +! in aqueous solutions. AIChE J. 19, 313-320. +! +! Chan, C.K. R.C. Flagen, & J.H. Seinfeld (1992) Water Activities of +! NH4NO3 / (NH4)2SO4 solutions, Atmos. Environ. (26A): 1661-1673. +! +! Clegg, S.L. & P. Brimblecombe (1988) Equilibrium partial pressures +! of strong acids over saline solutions - I HNO3, +! Atmos. Environ. (22): 91-100 +! +! Clegg, S.L. & P. Brimblecombe (1990) Equilibrium partial pressures +! and mean activity and osmotic coefficients of 0-100% nitric acid +! as a function of temperature, J. Phys. Chem (94): 5369 - 5380 +! +! Pilinis, C. and J.H. Seinfeld (1987) Continued development of a +! general equilibrium model for inorganic multicomponent atmospheric +! aerosols. Atmos. Environ. 21(11), 2453-2466. +! +! +! +! +! ARGUMENT DESCRIPTION: +! +! CAT(1) : conc. of H+ (moles/kg) +! CAT(2) : conc. of NH4+ (moles/kg) +! AN(1) : conc. of SO4-- (moles/kg) +! AN(2) : conc. of NO3- (moles/kg) +! AN(3) : conc. of HSO4- (moles/kg) +! GAMA(2,1) : mean molal ionic activity coeff for (2NH4+,SO4--) +! GAMA(2,2) : " " " " " " (NH4+,NO3-) +! GAMA(2,3) : " " " " " " (NH4+. HSO4-) +! GAMA(1,1) : " " " " " " (2H+,SO4--) +! GAMA(1,2) : " " " " " " (H+,NO3-) +! GAMA(1,3) : " " " " " " (H+,HSO4-) +! MOLNU : the total number of moles of all ions. +! PHIMULT : the multicomponent paractical osmotic coefficient. +! +! REVISION HISTORY: +! Who When Detailed description of changes +! --------- -------- ------------------------------------------- +! S.Roselle 7/26/89 Copied parts of routine BROMLY, and began this +! new routine using a method described by Pilinis +! and Seinfeld 1987, Atmos. Envirn. 21 pp2453-2466. +! S.Roselle 7/30/97 Modified for use in Models-3 +! F.Binkowski 8/7/97 Modified coefficients BETA0, BETA1, CGAMA +! R.Yantosca 9/25/02 Ported into "rpmares_mod.f" for GEOS-CHEM. Cleaned +! up comments, etc. Also force double precision by +! declaring REALs as REAL*8 and by using "D" exponents. +!****************************************************************************** + ! Error codes + + + + !================================================================= + ! PARAMETERS and their descriptions: + !================================================================= + INTEGER, PARAMETER :: NCAT = 2 ! number of cation + INTEGER, PARAMETER :: NAN = 3 ! number of anions + REAL*8, PARAMETER :: XSTAT0 = 0 ! Normal, successful completion + REAL*8, PARAMETER :: XSTAT1 = 1 ! File I/O error + REAL*8, PARAMETER :: XSTAT2 = 2 ! Execution error + REAL*8, PARAMETER :: XSTAT3 = 3 ! Special error + + !================================================================= + ! ARGUMENTS and their descriptions + !================================================================= + REAL*8, optional :: MOLNU ! tot # moles of all ions + REAL*8, optional :: PHIMULT ! multicomponent paractical + ! osmotic coef + REAL*8 :: CAT(NCAT) ! cation conc in moles/kg (input) + REAL*8 :: AN(NAN) ! anion conc in moles/kg (input) + REAL*8 :: GAMA(NCAT,NAN) ! mean molal ionic activity coefs + + !================================================================= + ! SCRATCH LOCAL VARIABLES and their descriptions: + !================================================================= + INTEGER :: IAN ! anion indX + INTEGER :: ICAT ! cation indX + REAL*8 :: FGAMA ! + REAL*8 :: I ! ionic strength + REAL*8 :: R ! + REAL*8 :: S ! + REAL*8 :: TA ! + REAL*8 :: TB ! + REAL*8 :: TC ! + REAL*8 :: TEXPV ! + REAL*8 :: TRM ! + REAL*8 :: TWOI ! 2*ionic strength + REAL*8 :: TWOSRI ! 2*sqrt of ionic strength + REAL*8 :: ZBAR ! + REAL*8 :: ZBAR2 ! + REAL*8 :: ZOT1 ! + REAL*8 :: SRI ! square root of ionic strength + REAL*8 :: F2(NCAT) ! + REAL*8 :: F1(NAN) ! + REAL*8 :: BGAMA (NCAT,NAN) ! + REAL*8 :: X (NCAT,NAN) ! + REAL*8 :: M (NCAT,NAN) ! molality of each electrolyte + REAL*8 :: LGAMA0(NCAT,NAN) ! binary activity coefficients + REAL*8 :: Y (NAN,NCAT) ! + REAL*8 :: BETA0 (NCAT,NAN) ! binary activity coef parameter + REAL*8 :: BETA1 (NCAT,NAN) ! binary activity coef parameter + REAL*8 :: CGAMA (NCAT,NAN) ! binary activity coef parameter + REAL*8 :: V1 (NCAT,NAN) ! # of cations in electrolyte + ! formula + REAL*8 :: V2 (NCAT,NAN) ! # of anions in electrolyte + ! formula + ! absolute value of charges of cation + REAL*8 :: ZP(NCAT) = (/ 1.0d0, 1.0d0 /) + + ! absolute value of charges of anion + REAL*8 :: ZM(NAN) = (/ 2.0d0, 1.0d0, 1.0d0 /) + + ! Character values. + CHARACTER(LEN=120) :: XMSG = ' ' +! CHARACTER(LEN=16), SAVE :: PNAME = ' driver program name' + + !================================================================ + ! *** Sources for the coefficients BETA0, BETA1, CGAMA + ! (1,1);(1,3) - Clegg & Brimblecombe (1988) + ! (2,3) - Pilinis & Seinfeld (1987), cgama different + ! (1,2) - Clegg & Brimblecombe (1990) + ! (2,1);(2,2) - Chan, Flagen & Seinfeld (1992) + !================================================================ + + ! now set the basic constants, BETA0, BETA1, CGAMA + DATA BETA0(1,1) /2.98d-2/, BETA1(1,1) / 0.0d0/, & + & CGAMA(1,1) /4.38d-2/ ! 2H+SO4- + + DATA BETA0(1,2) / 1.2556d-1/, BETA1(1,2) / 2.8778d-1/, & + & CGAMA(1,2) / -5.59d-3/ ! HNO3 + + DATA BETA0(1,3) / 2.0651d-1/, BETA1(1,3) / 5.556d-1/, & + & CGAMA(1,3) /0.0d0/ ! H+HSO4- + + DATA BETA0(2,1) / 4.6465d-2/, BETA1(2,1) /-0.54196d0/, & + & CGAMA(2,1) /-1.2683d-3/ ! (NH4)2SO4 + + DATA BETA0(2,2) /-7.26224d-3/, BETA1(2,2) /-1.168858d0/, & + & CGAMA(2,2) / 3.51217d-5/ ! NH4NO3 + + DATA BETA0(2,3) / 4.494d-2/, BETA1(2,3) / 2.3594d-1/, & + & CGAMA(2,3) /-2.962d-3/ ! NH4HSO4 + + DATA V1(1,1), V2(1,1) / 2.0d0, 1.0d0 / ! 2H+SO4- + DATA V1(2,1), V2(2,1) / 2.0d0, 1.0d0 / ! (NH4)2SO4 + DATA V1(1,2), V2(1,2) / 1.0d0, 1.0d0 / ! HNO3 + DATA V1(2,2), V2(2,2) / 1.0d0, 1.0d0 / ! NH4NO3 + DATA V1(1,3), V2(1,3) / 1.0d0, 1.0d0 / ! H+HSO4- + DATA V1(2,3), V2(2,3) / 1.0d0, 1.0d0 / ! NH4HSO4 + + !================================================================= + ! ACTCOF begins here! + !================================================================= + + ! Compute ionic strength + I = 0.0d0 + DO ICAT = 1, NCAT + I = I + CAT( ICAT ) * ZP( ICAT ) * ZP( ICAT ) + ENDDO + + DO IAN = 1, NAN + I = I + AN( IAN ) * ZM( IAN ) * ZM( IAN ) + ENDDO + + I = 0.5d0 * I + + ! check for problems in the ionic strength + IF ( I .EQ. 0.0d0 ) THEN + + DO IAN = 1, NAN + DO ICAT = 1, NCAT + GAMA( ICAT, IAN ) = 0.0d0 + ENDDO + ENDDO + + XMSG = 'Ionic strength is zero...returning zero activities' + !CALL M3WARN ( PNAME, 0, 0, XMSG ) + RETURN + + ELSE IF ( I .LT. 0.0d0 ) THEN + XMSG = 'Ionic strength below zero...negative concentrations' + !CALL M3EXIT ( PNAME, 0, 0, XMSG, XSTAT1 ) + ENDIF + + ! Compute some essential expressions + SRI = SQRT( I ) + TWOSRI = 2.0d0 * SRI + TWOI = 2.0d0 * I + TEXPV = 1.0d0 - EXP( -TWOSRI ) * ( 1.0d0 + TWOSRI - TWOI ) + R = 1.0d0 + 0.75d0 * I + S = 1.0d0 + 1.5d0 * I + ZOT1 = 0.511d0 * SRI / ( 1.0d0 + SRI ) + + ! Compute binary activity coeffs + FGAMA = -0.392d0 * ( ( SRI / ( 1.0d0 + 1.2d0 * SRI ) & + & + ( 2.0d0 / 1.2d0 ) * LOG( 1.0d0 + 1.2d0 * SRI ) ) ) + + DO ICAT = 1, NCAT + DO IAN = 1, NAN + + BGAMA( ICAT, IAN ) = 2.0d0 * BETA0( ICAT, IAN ) & + & + ( 2.0d0 * BETA1( ICAT, IAN ) / ( 4.0d0 * I ) ) & + & * TEXPV + + ! Compute the molality of each electrolyte for given ionic strength + M( ICAT, IAN ) = ( CAT( ICAT )**V1( ICAT, IAN ) & + & * AN( IAN )**V2( ICAT, IAN ) )**( 1.0d0 & + & / ( V1( ICAT, IAN ) + V2( ICAT, IAN ) ) ) + + ! Calculate the binary activity coefficients + LGAMA0( ICAT, IAN ) = ( ZP( ICAT ) * ZM( IAN ) * FGAMA & + & + M( ICAT, IAN ) & + & * ( 2.0d0 * V1( ICAT, IAN ) * V2( ICAT, IAN ) & + & / ( V1( ICAT, IAN ) + V2( ICAT, IAN ) ) & + & * BGAMA( ICAT, IAN ) ) & + & + M( ICAT, IAN ) * M( ICAT, IAN ) & + & * ( 2.0d0 * ( V1( ICAT, IAN ) & + & * V2( ICAT, IAN ) )**1.5d0 & + & / ( V1( ICAT, IAN ) + V2( ICAT, IAN ) ) & + & * CGAMA( ICAT, IAN ) ) ) / 2.302585093d0 + + ENDDO + ENDDO + + ! prepare variables for computing the multicomponent activity coeffs + DO IAN = 1, NAN + DO ICAT = 1, NCAT + ZBAR = ( ZP( ICAT ) + ZM( IAN ) ) * 0.5d0 + ZBAR2 = ZBAR * ZBAR + Y( IAN, ICAT ) = ZBAR2 * AN( IAN ) / I + X( ICAT, IAN ) = ZBAR2 * CAT( ICAT ) / I + ENDDO + ENDDO + + DO IAN = 1, NAN + F1( IAN ) = 0.0d0 + DO ICAT = 1, NCAT + F1( IAN ) = F1( IAN ) + X( ICAT, IAN ) * LGAMA0( ICAT, IAN ) & + & + ZOT1 * ZP( ICAT ) * ZM( IAN ) * X( ICAT, IAN ) + ENDDO + ENDDO + + DO ICAT = 1, NCAT + F2( ICAT ) = 0.0d0 + DO IAN = 1, NAN + F2( ICAT ) = F2( ICAT ) + Y( IAN, ICAT ) * LGAMA0(ICAT, IAN) & + & + ZOT1 * ZP( ICAT ) * ZM( IAN ) * Y( IAN, ICAT ) + ENDDO + ENDDO + + ! now calculate the multicomponent activity coefficients + DO IAN = 1, NAN + DO ICAT = 1, NCAT + + TA = -ZOT1 * ZP( ICAT ) * ZM( IAN ) + TB = ZP( ICAT ) * ZM( IAN ) / ( ZP( ICAT ) + ZM( IAN ) ) + TC = ( F2( ICAT ) / ZP( ICAT ) + F1( IAN ) / ZM( IAN ) ) + TRM = TA + TB * TC + + IF ( TRM .GT. 30.0d0 ) THEN + GAMA( ICAT, IAN ) = 1.0d+30 + ELSE + GAMA( ICAT, IAN ) = 10.0d0**TRM + ENDIF + + ENDDO + ENDDO + + ! Return to calling program + END SUBROUTINE ACTCOF + +!------------------------------------------------------------------------------ + +!------------------------------------------------------------------------- +!BOP +! +! !IROUTINE: PrintError +! +! !INTERFACE: +! + subroutine PrintError & + (err_msg, err_do_stop, err_num_ints, err_int1, err_int2, & + err_num_reals, err_real1, err_real2) +! + implicit none +! +! !INPUT PARAMETERS: +!! err_msg : error message to be printed out +!! err_do_stop : do stop on error? +!! err_num_ints : number of integers to be printed out (0, 1, or 2) +!! err_int1 : integer 1 to print out +!! err_int2 : integer 2 to print out +!! err_num_reals : number of reals to be printed out (0, 1, or 2) +!! err_real1 : real 1 to print out +!! err_real2 : real 2 to print out + character (len=*), intent(in) :: err_msg + logical , intent(in) :: err_do_stop + integer , intent(in) :: err_num_ints + integer , intent(in) :: err_int1 + integer , intent(in) :: err_int2 + integer , intent(in) :: err_num_reals + real*8 , intent(in) :: err_real1 + real*8 , intent(in) :: err_real2 +! +! !DESCRIPTION: +! Output error messages, and exits if requested. +! +! !AUTHOR: +! Jules Kouatchou +! +! !REVISION HISTORY: +! Initial code. +! +!EOP +!------------------------------------------------------------------------- +!BOC + Write (6,*) + Write (6,*) & + '--------------------------------------------------------------' + + Write (6,*) '!! ' // Trim (err_msg) + + if (err_num_ints == 1) then + Write (6,*) ' ', err_int1 + else if (err_num_ints == 2) then + Write (6,*) ' ', err_int1, err_int2 + end if + + if (err_num_reals == 1) then + Write (6,*) ' ', err_real1 + else if (err_num_reals == 2) then + Write (6,*) ' ', err_real1, err_real2 + end if + + Write (6,*) & + '--------------------------------------------------------------' + Write (6,*) + + if (err_do_stop) then + stop "Code stopped by PrintError." + end if + + return + + end subroutine PrintError + +!================================================================================== +!BOP +! +! !IROUTINE: Chem_UtilResVal --- returns resolution dependent value +! +! !INTERFACE: +! + function Chem_UtilResVal( im_World, jm_World, res_value, rc ) result (val) + +! !USES: + + implicit NONE + + real :: val ! resolution dependent value + +! !INPUT/OUTPUT PARAMETERS: + integer, intent(in) :: im_World, jm_World ! number of global grid cells + real, intent(in) :: res_value(:) ! array with the resolution dependent values: + ! the 'a', 'b', ..., 'e' resolution values have + ! indexes 1, 2, ..., 5. + +! !OUTPUT PARAMETERS: + integer, intent(inout) :: rc ! return code + + +! !DESCRIPTION: +! +! !REVISION HISTORY: +! +! 13 Feb2012 Anton Darmenov First crack. +! 25 Oct2012 Anton Darmenov Added support for FV3 resolutions. +! 19 Aug2020 E. Sherman - moved from Chem_UtilMod.F90 to process library +! +!EOP +!------------------------------------------------------------------------- + character(len=*), parameter :: Iam = 'Chem_UtilResVal' + + integer :: i_res + integer, parameter :: res_a = 1 ! 'a' to 'e' resolution indexes + integer, parameter :: res_b = 2 ! + integer, parameter :: res_c = 3 ! + integer, parameter :: res_d = 4 ! + integer, parameter :: res_e = 5 ! + integer, parameter :: res_f = 6 ! + + i_res = 0 + + if ((im_World < 1) .or. (jm_World < 1)) then +! call die(Iam, 'incorrect model resolution') + print*,'GOCART2G_Process::Chem_UtilResVal - incorrect model resolution' + return + end if + + if (jm_World == 6*im_World) then + if (im_World <= 24) then + i_res = res_a + else if (im_World <= 48) then + i_res = res_b + else if (im_World <= 90) then + i_res = res_c + else if (im_World <= 180) then + i_res = res_d + else if (im_World <= 360) then + i_res = res_e + else if (im_World <= 720) then + i_res = res_f + else + i_res = res_f + end if + else + if ((im_World <= 72) .and. (jm_World <= 46)) then + i_res = res_a + else if ((im_World <= 144) .and. (jm_World <= 91)) then + i_res = res_b + else if ((im_World <= 288) .and. (jm_World <= 181)) then + i_res = res_c + else if ((im_World <= 576) .and. (jm_World <= 361)) then + i_res = res_d + else if ((im_World <= 1152) .and. (jm_World <= 721)) then + i_res = res_e + else if ((im_World <= 2304) .and. (jm_World <=1441)) then + i_res = res_f + else + i_res = res_f + end if + + + end if + + if ((i_res < 1) .or. (i_res > size(res_value))) then + val = 0.0 + rc = 42 + else + val = res_value(i_res) + rc = 0 + end if + + end function Chem_UtilResVal + +!================================================================================== + + function Chem_UtilIdow(nymd) result (idow) + implicit NONE + integer, intent(in) :: nymd + integer :: idow ! day of the week: Sun=1, Mon=2, etc. + integer :: y, m, d + integer, parameter :: t(0:11) = (/ 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 /) + y = nymd / 10000 + m = (nymd - y*10000)/100 + d = nymd - (y*10000 + m*100) + if ( m<3 ) then + y = y - 1 + end if + idow = 1+mod(y + y/4 - y/100 + y/400 + t(m-1) + d,7) + return + end function Chem_UtilIdow + + function Chem_UtilCdow(nymd) result (cdow) + implicit NONE + integer, intent(in) :: nymd + character(len=3) :: cdow ! day of the week: Sun, Mon, etc. + character(len=3) :: cday(7) = (/ 'Sun','Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' /) + cdow = cday(Chem_UtilIdow(nymd)) + return + end function Chem_UtilCdow + + +!================================================================================== + +!BOP +! +! !ROUTINE: Chem_BiomassDiurnal - Applies diurnal cycle to biomass emissions. +! +! !INTERFACE: +! + + subroutine Chem_BiomassDiurnal ( Eout, Ein, lons, lats, nhms, cdt) + +! !USES: + + IMPLICIT NONE + +! !ARGUMENTS: + + real, intent(out) :: Eout(:,:) ! Emissions valid at NHMS + real, intent(in) :: Ein(:,:) ! Daily-mean emissions + real, intent(in) :: lons(:,:) ! Latitudes in degrees + real, intent(in) :: lats(:,:) ! Latitudes in degrees + integer, intent(in) :: nhms + real, intent(in) :: cdt ! time step in seconds + +! !DESCRIPTION: +! +! Applies diurnal cycle to biomass emissions. +! +! !DESCRIPTION: +! +! This module implements assorted odds & ends for fvChem. +! +! !REVISION HISTORY: +! +! 13nov2009 da Silva First crack. +! 19Aug2020 E. Sherman - moved from Chem_UtilMod.F90 to process library +! +!EOP +!------------------------------------------------------------------------- + +! Hardwired diurnal cycle (multiplied by 100) +! These numbers were derived from GOES-12 +! fire counts for 2003-2007. +! ------------------------------------------- + integer, parameter :: N = 240 + real, parameter :: DT = 86400. / N + +! Apply flat diurnal cycle for boreal forests as a +! temporary solution to prevent very high aerosol +! optical depth during the day + real, parameter :: Boreal(N) = 1.0 +! real, parameter :: Boreal(N) = & +! (/ 0.0277, 0.0292, 0.0306, 0.0318, 0.0327, 0.0335, & +! 0.0340, 0.0342, 0.0341, 0.0338, 0.0333, 0.0326, & +! 0.0316, 0.0305, 0.0292, 0.0278, 0.0263, 0.0248, & +! 0.0233, 0.0217, 0.0202, 0.0187, 0.0172, 0.0158, & +! 0.0145, 0.0133, 0.0121, 0.0110, 0.0100, 0.0091, & +! 0.0083, 0.0075, 0.0068, 0.0062, 0.0056, 0.0051, & +! 0.0046, 0.0042, 0.0038, 0.0035, 0.0032, 0.0030, & +! 0.0028, 0.0026, 0.0025, 0.0024, 0.0024, 0.0024, & +! 0.0024, 0.0026, 0.0027, 0.0030, 0.0033, 0.0036, & +! 0.0041, 0.0046, 0.0052, 0.0060, 0.0069, 0.0079, & +! 0.0090, 0.0104, 0.0119, 0.0137, 0.0157, 0.0180, & +! 0.0205, 0.0235, 0.0268, 0.0305, 0.0346, 0.0393, & +! 0.0444, 0.0502, 0.0565, 0.0634, 0.0711, 0.0794, & +! 0.0884, 0.0982, 0.1087, 0.1201, 0.1323, 0.1453, & +! 0.1593, 0.1742, 0.1900, 0.2069, 0.2249, 0.2439, & +! 0.2642, 0.2858, 0.3086, 0.3329, 0.3587, 0.3860, & +! 0.4149, 0.4455, 0.4776, 0.5115, 0.5470, 0.5840, & +! 0.6227, 0.6628, 0.7043, 0.7470, 0.7908, 0.8355, & +! 0.8810, 0.9271, 0.9735, 1.0200, 1.0665, 1.1126, & +! 1.1580, 1.2026, 1.2460, 1.2880, 1.3282, 1.3664, & +! 1.4023, 1.4356, 1.4660, 1.4933, 1.5174, 1.5379, & +! 1.5548, 1.5679, 1.5772, 1.5826, 1.5841, 1.5818, & +! 1.5758, 1.5661, 1.5529, 1.5365, 1.5169, 1.4944, & +! 1.4693, 1.4417, 1.4119, 1.3801, 1.3467, 1.3117, & +! 1.2755, 1.2383, 1.2003, 1.1616, 1.1225, 1.0832, & +! 1.0437, 1.0044, 0.9653, 0.9265, 0.8882, 0.8504, & +! 0.8134, 0.7771, 0.7416, 0.7070, 0.6734, 0.6407, & +! 0.6092, 0.5787, 0.5493, 0.5210, 0.4939, 0.4680, & +! 0.4433, 0.4197, 0.3974, 0.3763, 0.3565, 0.3380, & +! 0.3209, 0.3051, 0.2907, 0.2777, 0.2662, 0.2561, & +! 0.2476, 0.2407, 0.2352, 0.2313, 0.2289, 0.2279, & +! 0.2283, 0.2300, 0.2329, 0.2369, 0.2417, 0.2474, & +! 0.2536, 0.2602, 0.2670, 0.2738, 0.2805, 0.2869, & +! 0.2927, 0.2979, 0.3024, 0.3059, 0.3085, 0.3101, & +! 0.3107, 0.3102, 0.3087, 0.3061, 0.3026, 0.2983, & +! 0.2931, 0.2871, 0.2806, 0.2735, 0.2659, 0.2579, & +! 0.2497, 0.2412, 0.2326, 0.2240, 0.2153, 0.2066, & +! 0.1979, 0.1894, 0.1809, 0.1726, 0.1643, 0.1562, & +! 0.1482, 0.1404, 0.1326, 0.1250, 0.1175, 0.1101, & +! 0.1028, 0.0956, 0.0886, 0.0818, 0.0751, 0.0687 /) + real, parameter :: NonBoreal(N) = & + (/ 0.0121, 0.0150, 0.0172, 0.0185, 0.0189, 0.0184, & + 0.0174, 0.0162, 0.0151, 0.0141, 0.0133, 0.0126, & + 0.0121, 0.0117, 0.0115, 0.0114, 0.0114, 0.0116, & + 0.0120, 0.0126, 0.0133, 0.0142, 0.0151, 0.0159, & + 0.0167, 0.0174, 0.0180, 0.0184, 0.0187, 0.0189, & + 0.0190, 0.0190, 0.0191, 0.0192, 0.0192, 0.0193, & + 0.0194, 0.0194, 0.0193, 0.0192, 0.0190, 0.0187, & + 0.0185, 0.0182, 0.0180, 0.0178, 0.0177, 0.0176, & + 0.0174, 0.0172, 0.0169, 0.0166, 0.0162, 0.0158, & + 0.0153, 0.0149, 0.0144, 0.0138, 0.0132, 0.0126, & + 0.0118, 0.0109, 0.0101, 0.0092, 0.0085, 0.0081, & + 0.0080, 0.0083, 0.0091, 0.0102, 0.0117, 0.0135, & + 0.0157, 0.0182, 0.0210, 0.0240, 0.0273, 0.0308, & + 0.0345, 0.0387, 0.0432, 0.0483, 0.0540, 0.0606, & + 0.0683, 0.0775, 0.0886, 0.1022, 0.1188, 0.1388, & + 0.1625, 0.1905, 0.2229, 0.2602, 0.3025, 0.3500, & + 0.4031, 0.4623, 0.5283, 0.6016, 0.6824, 0.7705, & + 0.8650, 0.9646, 1.0676, 1.1713, 1.2722, 1.3662, & + 1.4491, 1.5174, 1.5685, 1.6014, 1.6173, 1.6200, & + 1.6150, 1.6082, 1.6040, 1.6058, 1.6157, 1.6353, & + 1.6651, 1.7045, 1.7513, 1.8024, 1.8541, 1.9022, & + 1.9429, 1.9738, 1.9947, 2.0072, 2.0132, 2.0141, & + 2.0096, 1.9994, 1.9829, 1.9604, 1.9321, 1.8977, & + 1.8562, 1.8052, 1.7419, 1.6646, 1.5738, 1.4734, & + 1.3693, 1.2676, 1.1724, 1.0851, 1.0052, 0.9317, & + 0.8637, 0.8004, 0.7414, 0.6862, 0.6348, 0.5871, & + 0.5434, 0.5037, 0.4682, 0.4368, 0.4097, 0.3864, & + 0.3667, 0.3499, 0.3355, 0.3231, 0.3123, 0.3029, & + 0.2944, 0.2862, 0.2773, 0.2670, 0.2547, 0.2402, & + 0.2238, 0.2061, 0.1882, 0.1712, 0.1562, 0.1434, & + 0.1332, 0.1251, 0.1189, 0.1141, 0.1103, 0.1071, & + 0.1043, 0.1018, 0.0996, 0.0979, 0.0968, 0.0964, & + 0.0966, 0.0970, 0.0973, 0.0970, 0.0959, 0.0938, & + 0.0909, 0.0873, 0.0831, 0.0784, 0.0732, 0.0676, & + 0.0618, 0.0565, 0.0521, 0.0491, 0.0475, 0.0473, & + 0.0480, 0.0492, 0.0504, 0.0514, 0.0519, 0.0521, & + 0.0520, 0.0517, 0.0513, 0.0510, 0.0507, 0.0507, & + 0.0508, 0.0512, 0.0515, 0.0518, 0.0519, 0.0518, & + 0.0513, 0.0506, 0.0496, 0.0482, 0.0465, 0.0443, & + 0.0418, 0.0387, 0.0351, 0.0310, 0.0263, 0.0214 /) + +! Fixed normalization factors; a more accurate normalization would take +! in consideration longitude and time step +! --------------------------------------------------------------------- + real*8, save :: fBoreal = -1., fNonBoreal = -1 + real, save :: fDT=-1 + + integer :: hh, mm, ss, ndt, i, j, k + integer :: NN + real :: secs, secs_local, aBoreal, aNonBoreal, alpha + +! ----- + +! Normalization factor depends on timestep +! ---------------------------------------- + if ( fDT /= cdt ) then + fBoreal = 0.0 + fNonBoreal = 0.0 + NN = 0 + ndt = max(1,nint(cdt/DT)) + + do k = 1, N, ndt + NN = NN + 1 + fBoreal = fBoreal + Boreal(k) + fNonBoreal = fNonBoreal + NonBoreal(k) + end do + + fBoreal = fBoreal / NN + fnonBoreal = fnonBoreal / NN + fDT = cdt ! so it recalculates only if necessary + end if + + +! Find number of secs since begining of the day (GMT) +! --------------------------------------------------- + hh = nhms/10000 + mm = (nhms - 10000*hh) / 100 + ss = nhms - 10000*hh - 100*mm + secs = 3600.*hh + 60.*mm + ss + +! Apply factors depending on latitude +! ----------------------------------- + do j = lbound(Ein,2), ubound(Ein,2) + do i = lbound(Ein,1), ubound(Ein,1) + +! Find corresponding index in hardwired diurnal cycle +! 240 = 24 * 60 * 60 secs / 360 deg +! --------------------------------------------------- + secs_local = secs + 240. * lons(i,j) + k = 1 + mod(nint(secs_local/DT),N) + if ( k < 1 ) k = N + k + +! Apply diurnal cycle +! ------------------- + aBoreal = Boreal(k) / fBoreal + aNonBoreal = NonBoreal(k) / fNonBoreal + + if ( lats(i,j) >= 50. ) then + Eout(i,j) = aBoreal * Ein(i,j) + else if ( lats(i,j) >= 30. ) then + alpha = (lats(i,j) - 30. ) / 20. + Eout(i,j) = (1-alpha) * aNonBoreal * Ein(i,j) + & + alpha * aBoreal * Ein(i,j) + else + Eout(i,j) = aNonBoreal * Ein(i,j) + end if + end do + end do + + end subroutine Chem_BiomassDiurnal +!================================================================================== + + subroutine ReadPointEmissions( nymd, filename, nPts, vLat, vLon, vBase, vTop, vEmis, vStart, vEnd, unusable, label, rc) + integer, intent(in) :: nymd + character(*), intent(in) :: filename + integer, intent(out) :: nPts + real, allocatable, dimension(:), intent(out) :: vLat, vLon, vTop, vBase, vEmis + integer, allocatable, dimension(:), intent(out) :: vStart, vEnd + + type(KeywordEnforcer), optional, intent(in) :: unusable + character(*), optional, intent(in) :: label + integer, optional, intent(out) :: rc + + ! Local arguments + type(EmissionReader) :: reader + character(:), allocatable :: label_ + real, allocatable :: table(:,:) + integer :: nCols + integer :: status + + if (present(label)) then + label_ = trim(label) + else + label_ = 'source' + end if + + reader = EmissionReader() + call reader%open(filename, __RC__) + table = reader%read_table(label=label_, __RC__) + call reader%close(__RC__) + + nCols = size(table,1) + nPts = size(table,2) + vStart = spread(-1, 1, nPts) + vEnd = spread(-1, 1, nPts) + + vLat = table(1,:) + vLon = table(2,:) + vEmis = table(3,:) + vBase = table(4,:) + vTop = table(5,:) + if (nCols >= 6) vStart = table(6,:) + if (nCols >= 7) vEnd = table(7,:) + + where(vStart < 0) vStart = 000000 + where(vEnd < 0) vEnd = 240000 + call reader%close() + + __RETURN__(__SUCCESS__) + end subroutine ReadPointEmissions + +!================================================================================== + subroutine open(this, filename, rc) + class(EmissionReader), intent(inout) :: this + character(*), intent(in) :: filename + integer, optional, intent(out) :: rc + + integer :: status + + __ASSERT__(.not. allocated(this%unit)) + allocate(this%unit) + + open(newunit=this%unit, file=filename, & + form='formatted', access = 'sequential', status='old', & + action='read', __IOSTAT__) + + __RETURN__(__SUCCESS__) + end subroutine open + + + subroutine close(this, rc) + class(EmissionReader), intent(inout) :: this + integer, optional, intent(out) :: rc + + integer :: status + + __ASSERT__(allocated(this%unit)) + close(this%unit, __IOSTAT__) + deallocate(this%unit) + + end subroutine close + + + subroutine rewind_reader(this, rc) + class(EmissionReader), intent(in) :: this + integer, optional, intent(out) :: rc + + integer :: status + + __ASSERT__(allocated(this%unit)) + rewind(this%unit, __IOSTAT__) + + __RETURN__(__SUCCESS__) + end subroutine rewind_reader + + function get_dims(this, label, rc) result(dims) + integer :: dims(2) + class(EmissionReader), intent(in) :: this + character(*), intent(in) :: label + integer, optional, intent(out) :: rc + + integer :: status + logical :: eof + character(:), allocatable :: line + integer :: n_words + + call this%rewind(__RC__) + call this%scan_to_label(label, __RC__) +! print*,__FILE__,__LINE__, ' found label' + + dims = 0 + do + line = this%next_line(eof=eof, __RC__) + __ASSERT__(.not. eof) + if (this%is_end_marker(line)) exit + + dims(2) = dims(2) + 1 + + n_words = this%count_words(line) + dims(1) = max(dims(1), n_words) + end do + + __RETURN__(__SUCCESS__) + end function get_dims + + integer function count_words(this, line) result(n_words) + class(EmissionReader), intent(in) :: this + character(*), intent(in) :: line + + integer :: idx, i0 + + n_words = 0 + i0 = 0 + do + ! scan to start of next word + idx = verify(line(i0+1:), ' ') + + n_words = n_words + 1 + i0 = i0 + idx + + ! scan to end of current word + idx = index(line(i0+1:), ' ') + i0 = i0 + idx + if (idx == 0) exit + + end do + + return + end function count_words + + logical function is_end_marker(this, line) + class(EmissionReader), intent(in) :: this + character(*), intent(in) :: line + + is_end_marker = (line == '::') + + end function is_end_marker + + function read_table(this, label, rc) result(table) + class(EmissionReader), intent(in) :: this + real, allocatable :: table(:,:) + character(*), intent(in) :: label + integer, optional, intent(out) :: rc + + integer :: i, j + integer :: dims(2) + integer :: status + logical :: eof + character(:), allocatable :: line + + dims = this%get_dims(label, __RC__) + call this%scan_to_label(label, __RC__) + + associate (n_words => dims(1), n_lines => dims(2)) + allocate(table(n_words, n_lines), __STAT__) + + do j = 1, n_lines + line = this%next_line(eof=eof) + __ASSERT__(.not. eof) + + read(line,*, iostat=status) (table(i,j),i=1,n_words) + __VERIFY__(status) + end do + + end associate + + end function read_table + + function next_line(this, eof, rc) result(line) + character(:), allocatable :: line + class(EmissionReader), intent(in) :: this + logical, intent(out) :: eof + integer, optional, intent(out) :: rc + + integer, parameter :: MAX_LINE_LEN=1024 + character(len=MAX_LINE_LEN) :: buffer + integer :: idx + integer :: status + + eof = .false. + do + + read(this%unit,'(a)', iostat=status) buffer + if (status == IOSTAT_END) then + eof = .true. + __RETURN__(__SUCCESS__) + end if + __VERIFY__(status) + + idx = index(buffer, '#') + if (idx == 0) idx = len(buffer) + + line = trim(buffer(:idx-1)) + if (line /= '') exit + + end do + + __RETURN__(__SUCCESS__) + end function next_line + + subroutine scan_to_label(this, label, rc) + class(EmissionReader), intent(in) :: this + character(*), intent(in) :: label + integer, optional, intent(out) :: rc + + integer :: status + logical :: eof + character(:), allocatable :: line + + call this%rewind(__RC__) + do + line = this%next_line(eof=eof, __RC__) + if (line == label // '::') exit + end do + + __RETURN__(__SUCCESS__) + end subroutine scan_to_label + + + + + end module GOCART2G_Process diff --git a/components.yaml b/components.yaml new file mode 100644 index 00000000..3f475b7f --- /dev/null +++ b/components.yaml @@ -0,0 +1,34 @@ +cmake: + local: ./cmake@ + remote: ../ESMA_cmake.git + tag: v3.0.6 + develop: develop + +ecbuild: + local: ./cmake@/ecbuild@ + remote: ../ecbuild.git + tag: geos/v1.0.5 + +HEMCO: + local: ./ESMF/HEMCO_GridComp@ + remote: ../HEMCO.git + branch: bugfix/GOCART_Build_error + +NCEP_Shared: + local: ./ESMF/Shared/NCEP_Shared@ + remote: ../NCEP_Shared.git + tag: v1.0.0 + sparse: ./config/NCEP_Shared.sparse + develop: main + +GMAO_Shared: + local: ./ESMF/Shared/GMAO_Shared@ + remote: ../GMAO_Shared.git + tag: v1.1.8 + sparse: ./config/GMAO_Shared.sparse + develop: main + +MAPL: + local: ./ESMF/Shared/MAPL@ + remote: ../MAPL.git + branch: NUOPC_MAPLcap diff --git a/config/GMAO_Shared.sparse b/config/GMAO_Shared.sparse new file mode 100644 index 00000000..9ee2012a --- /dev/null +++ b/config/GMAO_Shared.sparse @@ -0,0 +1,8 @@ +/* +!/GMAO_ncdiag +!/GMAO_ods +!/GMAO_psas +!/GMAO_pyobs +!/GEOS_Pert +!/arpack +!/pnagpack diff --git a/config/NCEP_Shared.sparse b/config/NCEP_Shared.sparse new file mode 100644 index 00000000..f2d558ae --- /dev/null +++ b/config/NCEP_Shared.sparse @@ -0,0 +1,7 @@ +!/* +/NCEP_sp +/NCEP_w3 +/NCEP_bacio +/NCEP_sfcio +/NCEP_sigio +/CMakeLists.txt