Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ target_compile_definitions(CCTM PUBLIC SUBST_FILES_ID="FILES_CTM.EXT"
SUBST_COMM=NOOP_COMM
SUBST_BARRIER=NOOP_BARRIER
SUBST_SUBGRID_INDEX=NOOP_SUBGRID_INDEX
AQCHEM=DUMMY_AQCHEM
CONVCLD_ACM=DUMMY_CONVCLD_ACM
EDDYX=DUMMY_EDDYX
MOSAIC_MOD=MOSAIC_MODULE
Mosaic_Mod=Mosaic_Module
Expand Down
13 changes: 10 additions & 3 deletions aqm_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ list(APPEND aqm_files
list(APPEND aqm_shr_files
src/shr/aqm_config_mod.F90
src/shr/aqm_const_mod.F90
src/shr/aqm_domain_mod.F90
src/shr/aqm_domain_mod.F90
src/shr/aqm_emis_mod.F90
src/shr/aqm_fires_mod.F90
src/shr/aqm_internal_mod.F90
src/shr/aqm_model_mod.F90
src/shr/aqm_model_mod.F90
src/shr/aqm_rc_mod.F90
src/shr/aqm_methods.F90
src/shr/aqm_species_mod.F90
src/shr/aqm_state_mod.F90
src/shr/aqm_state_mod.F90
src/shr/aqm_tools_mod.F90
src/shr/aqm_types_mod.F90
)
Expand Down Expand Up @@ -114,6 +114,13 @@ list(APPEND aqm_CCTM_files
${BIOG}/tmpbeis.F
${BIOG}/wrdaymsg.f
${CLOUD}/hlconst.F
${CLOUD}/cldproc_acm.F
${CLOUD}/getalpha.F
${CLOUD}/indexn.f
${CLOUD}/rescld.F
${CLOUD}/scavwdep.F
${CLOUD}/aq_map.F
${CLOUD}/AQ_DATA.F
${DEPV}/ABFLUX_MOD.F
${DEPV}/BIDI_MOD.F
${DEPV}/cgrid_depv.F
Expand Down
8 changes: 7 additions & 1 deletion examples/aqm.rc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ omi_data: /scratch1/NCEPDEV/nems/Raffaele.Montuoro/dev/aqm/epa/data/omi_cmaq_
init_concentrations: true

#
# Run aerosol module
# Run options:
#
# - enable aerosol module
#
run_aerosol: true
#
# - enable wet deposition processes in resolved-scale clouds
#
run_rescld: true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the option here


#
# Microphysics scheme used by coupled atmospheric model
Expand Down
13 changes: 11 additions & 2 deletions src/drv/cmaq_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ subroutine cmaq_init(rc)

end subroutine cmaq_init

subroutine cmaq_advance(jdate, jtime, tstep, run_aero, rc)
subroutine cmaq_advance(jdate, jtime, tstep, run_aero, run_rescld, rc)

integer, intent(in) :: jdate, jtime, tstep(3)
logical, intent(in) :: run_aero
logical, intent(in) :: run_aero, run_rescld
integer, optional, intent(out) :: rc

! -- local variables
Expand All @@ -131,6 +131,11 @@ SUBROUTINE VDIFF ( CGRID, JDATE, JTIME, TSTEP )
INTEGER :: JDATE, JTIME
INTEGER :: TSTEP( 3 )
END SUBROUTINE VDIFF
SUBROUTINE CLDPROC ( CGRID, JDATE, JTIME, TSTEP )
REAL, POINTER :: CGRID( :,:,:,: )
INTEGER :: JDATE, JTIME
INTEGER :: TSTEP( 3 )
END SUBROUTINE CLDPROC
SUBROUTINE CHEM ( CGRID, JDATE, JTIME, TSTEP )
REAL, POINTER :: CGRID( :,:,:,: )
INTEGER :: JDATE, JTIME
Expand All @@ -149,6 +154,10 @@ END SUBROUTINE AERO
! -- advance all physical and chemical processes on a grid
CALL VDIFF ( CGRID, JDATE, JTIME, TSTEP )

if (run_rescld) then
CALL CLDPROC ( CGRID, JDATE, JTIME, TSTEP )
end if

CALL CHEM ( CGRID, JDATE, JTIME, TSTEP )

if (run_aero) then
Expand Down
2 changes: 1 addition & 1 deletion src/drv/cmaq_model_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ subroutine cmaq_model_advance(jdate, jtime, tstep, rc)
end if

! -- advance model
call cmaq_advance(jdate, jtime, tstep, config % run_aero, rc=localrc)
call cmaq_advance(jdate, jtime, tstep, config % run_aero, config % run_rescld, rc=localrc)
if (aqm_rc_check(localrc, msg="Failed to advance CMAQ on local DE", &
file=__FILE__, line=__LINE__, rc=rc)) return

Expand Down
37 changes: 21 additions & 16 deletions src/io/aqmio/aqmio.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ module AQMIO
type(ioData), pointer :: IO => null()
end type ioWrapper

integer, parameter :: AQMIO_FMT_BIN = 101, &
AQMIO_FMT_NETCDF = 102

private

public :: AQMIO_FMT_BIN
public :: AQMIO_FMT_NETCDF

public :: AQMIO_Create
public :: AQMIO_Destroy
public :: AQMIO_FileCreate
Expand Down Expand Up @@ -332,20 +337,20 @@ subroutine AQMIO_Open(IOComp, fileName, filePath, iomode, iofmt, rc)
character(len=*), intent(in) :: fileName
character(len=*), intent(in), optional :: filePath
character(len=*), intent(in), optional :: iomode
type(ESMF_IOFmt_flag), intent(in), optional :: iofmt
integer, intent(in), optional :: iofmt
integer, intent(out), optional :: rc

! -- local variables
integer :: localrc
integer :: ncStatus
integer :: item, localDe, localDeCount, tileCount
integer :: liofmt
integer :: cmode
logical :: create
character(len=ESMF_MAXPATHLEN) :: fullName
character(len=6) :: liomode, fmode
type(ioWrapper) :: is
type(ESMF_Grid) :: grid
type(ESMF_IOFmt_flag) :: liofmt

! -- begin
if (present(rc)) rc = ESMF_SUCCESS
Expand All @@ -363,7 +368,7 @@ subroutine AQMIO_Open(IOComp, fileName, filePath, iomode, iofmt, rc)

localDeCount = size(is % IO % IOLayout)

liofmt = ESMF_IOFMT_NETCDF
liofmt = AQMIO_FMT_NETCDF
if (present(iofmt)) liofmt = iofmt

liomode = "read"
Expand Down Expand Up @@ -409,7 +414,7 @@ subroutine AQMIO_Open(IOComp, fileName, filePath, iomode, iofmt, rc)
else
call AQMIO_FileNameGet(fullName, fileName, filePath=filePath)
end if
if (liofmt == ESMF_IOFMT_NETCDF) then
if (liofmt == AQMIO_FMT_NETCDF) then
#if HAVE_NETCDF
if (create) then
ncStatus = nf90_create(trim(fullName), cmode, &
Expand Down Expand Up @@ -442,7 +447,7 @@ subroutine AQMIO_Open(IOComp, fileName, filePath, iomode, iofmt, rc)
rcToReturn=rc)
return
#endif
else if (liofmt == ESMF_IOFMT_BIN) then
else if (liofmt == AQMIO_FMT_BIN) then

call ESMF_UtilIOUnitGet (unit=is % IO % IOLayout(localDe) % iounit, rc=localrc)
if (ESMF_LogFoundError(rcToCheck=localrc, msg=ESMF_LOGERR_PASSTHRU, &
Expand Down Expand Up @@ -547,18 +552,18 @@ logical function AQMIO_IsOpen(IOComp, fileName, filePath, iofmt, rc)
type(ESMF_GridComp), intent(inout) :: IOComp
character(len=*), intent(in) :: fileName
character(len=*), intent(in), optional :: filePath
type(ESMF_IOFmt_flag), intent(in), optional :: iofmt
integer, intent(in), optional :: iofmt
integer, intent(out), optional :: rc

! -- local variables
integer :: localrc
integer :: ncStatus
integer :: item, localDe, localDeCount, tileCount, pathLen
integer :: liofmt
logical :: isFileOpen
character(len=ESMF_MAXPATHLEN) :: fullName, pathIn
type(ioWrapper) :: is
type(ESMF_Grid) :: grid
type(ESMF_IOFmt_flag) :: liofmt

! -- begin
if (present(rc)) rc = ESMF_SUCCESS
Expand All @@ -578,7 +583,7 @@ logical function AQMIO_IsOpen(IOComp, fileName, filePath, iofmt, rc)

localDeCount = size(is % IO % IOLayout)

liofmt = ESMF_IOFMT_NETCDF
liofmt = AQMIO_FMT_NETCDF
if (present(iofmt)) liofmt = iofmt

call ESMF_GridCompGet(IOComp, grid=grid, rc=localrc)
Expand All @@ -602,7 +607,7 @@ logical function AQMIO_IsOpen(IOComp, fileName, filePath, iofmt, rc)
else
call AQMIO_FileNameGet(fullName, fileName, filePath=filePath)
end if
if (liofmt == ESMF_IOFMT_NETCDF) then
if (liofmt == AQMIO_FMT_NETCDF) then
#if HAVE_NETCDF
if (is % IO % IOLayout(localDe) % ncid > 0) then
ncStatus = nf90_inq_path(is % IO % IOLayout(localDe) % ncid, &
Expand Down Expand Up @@ -642,21 +647,21 @@ subroutine AQMIO_Write(IOComp, fieldList, fieldNameList, timeSlice, &
integer, intent(in), optional :: timeSlice
character(len=*), intent(in), optional :: fileName
character(len=*), intent(in), optional :: filePath
type(ESMF_IOFmt_flag), intent(in), optional :: iofmt
integer, intent(in), optional :: iofmt
integer, intent(out), optional :: rc

! -- local variables
integer :: localrc
integer :: item, localDe, localDeCount
integer :: liofmt
type(ioWrapper) :: is
type(ESMF_IOFmt_flag) :: liofmt

! -- begin
if (present(rc)) rc = ESMF_SUCCESS

if (.not.ESMF_GridCompIsPetLocal(IOComp)) return

liofmt = ESMF_IOFMT_NETCDF
liofmt = AQMIO_FMT_NETCDF
if (present(iofmt)) liofmt = iofmt

if (present(fieldNameList)) then
Expand Down Expand Up @@ -736,7 +741,7 @@ subroutine AQMIO_Read(IOComp, fieldList, fieldNameList, timeSlice, &
integer, intent(in), optional :: timeSlice
character(len=*), intent(in), optional :: fileName
character(len=*), intent(in), optional :: filePath
type(ESMF_IOFmt_flag), intent(in), optional :: iofmt
integer, intent(in), optional :: iofmt
integer, intent(out), optional :: rc

! -- local variables
Expand Down Expand Up @@ -833,7 +838,7 @@ subroutine AQMIO_ReadTimes(IOComp, variableName, timesList, fileName, filePath,
type(ESMF_Time), intent(inout), pointer :: timesList(:)
character(len=*), intent(in), optional :: fileName
character(len=*), intent(in), optional :: filePath
type(ESMF_IOFmt_flag), intent(in), optional :: iofmt
integer, intent(in), optional :: iofmt
integer, intent(out), optional :: rc

! -- local variables
Expand All @@ -857,7 +862,7 @@ subroutine AQMIO_ReadTimes(IOComp, variableName, timesList, fileName, filePath,
if (.not.associated(is % IO % IOLayout)) return

if (present(iofmt)) then
if (.not.(iofmt == ESMF_IOFMT_NETCDF)) then
if (.not.(iofmt == AQMIO_FMT_NETCDF)) then
call ESMF_LogSetError(ESMF_RC_ARG_INCOMP, &
msg="This function only supports NetCDF I/O", &
line=__LINE__, &
Expand Down Expand Up @@ -925,6 +930,7 @@ subroutine AQMIO_FieldAccess(IOComp, field, action, variableName, timeSlice, rc)
integer :: localrc
integer :: localDe, localDeCount, rank
integer :: de, deCount, dimCount, tile, tileCount, ungriddedCount
integer :: iofmt
integer, dimension(:), pointer :: ungriddedLBound, ungriddedUBound
integer, dimension(:), allocatable :: deToTileMap, localDeToDeMap
integer, dimension(:,:), allocatable :: minIndexPDe, maxIndexPDe
Expand All @@ -936,7 +942,6 @@ subroutine AQMIO_FieldAccess(IOComp, field, action, variableName, timeSlice, rc)
type(ESMF_GeomType_flag) :: geomtype
type(ESMF_StaggerLoc) :: staggerloc
type(ESMF_TypeKind_Flag) :: typekind
type(ESMF_IOFmt_flag) :: iofmt

! -- begin
if (present(rc)) rc = ESMF_SUCCESS
Expand Down
2 changes: 1 addition & 1 deletion src/io/ioapi/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ libioapi_a_SOURCES += crlf.F currec.f currstep.f dt2str.f findc.f getefile.F ind
poly.f promptmfile.f sec2time.f secsdiff.F setlam.f sortic.f str2real.f time2sec.f upcase.f wkday.F yr2day.F
libioapi_a_SOURCES += m3exit.F90 m3mesg.F90 m3msg2.F90 m3warn.F90 m3utilio.F90

libioapi_a_FFLAGS = $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS)
libioapi_a_FFLAGS = $(CCTM_FFLAGS) $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS)

libioapi_a_FCFLAGS = $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS)
libioapi_a_FCFLAGS += -DSUBST_FILES_ID=\"FILES_CTM.EXT\"
Expand Down
2 changes: 1 addition & 1 deletion src/io/ioapi/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ libioapi_a_SOURCES = FDESC3.EXT PARMS3.EXT crlf.F currec.f currstep.f \
setlam.f sortic.f str2real.f time2sec.f upcase.f wkday.F \
yr2day.F m3exit.F90 m3mesg.F90 m3msg2.F90 m3warn.F90 \
m3utilio.F90
libioapi_a_FFLAGS = $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS)
libioapi_a_FFLAGS = $(CCTM_FFLAGS) $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS)
libioapi_a_FCFLAGS = $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) \
$(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS) \
-DSUBST_FILES_ID=\"FILES_CTM.EXT\" -I \
Expand Down
8 changes: 8 additions & 0 deletions src/model/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ CLOUD = $(CCTM)/cloud/acm_ae6
libCLOUD = $(CLOUD)/$(libCCTM)-
libCCTM_a_SOURCES += \
$(CLOUD)/hlconst.F
$(CLOUD)/cldproc_acm.F
$(CLOUD)/getalpha.F
$(CLOUD)/indexn.f
$(CLOUD)/rescld.F
$(CLOUD)/scavwdep.F
$(CLOUD)/aq_map.F
$(CLOUD)/AQ_DATA.F

# depv
DEPV = $(CCTM)/depv/m3dry
Expand Down Expand Up @@ -254,6 +261,7 @@ libCCTM_a_CPPFLAGS += -DSUBST_COMM=NOOP_COMM
libCCTM_a_CPPFLAGS += -DSUBST_BARRIER=NOOP_BARRIER
libCCTM_a_CPPFLAGS += -DSUBST_SUBGRID_INDEX=NOOP_SUBGRID_INDEX
libCCTM_a_CPPFLAGS += -DMOSAIC_MOD=MOSAIC_MODULE -DMosaic_Mod=Mosaic_Module
libCCTM_a_CPPFLAGS += -DAQCHEM=DUMMY_AQCHEM -DCONVCLD_ACM=DUMMY_CONVCLD_ACM
libCCTM_a_CPPFLAGS += -DEDDYX=DUMMY_EDDYX
libCCTM_a_CPPFLAGS += -DOPCONC=DUMMY_OPCONC -DOPACONC=DUMMY_OPACONC
libCCTM_a_CPPFLAGS += -DOPWDEP=DUMMY_OPWDEP -DWR_INIT=DUMMY_WR_INIT
Expand Down
Loading