Skip to content

Commit

Permalink
Merge pull request #637 from USEPA/master
Browse files Browse the repository at this point in the history
Update Research Branch with Master Improvements
  • Loading branch information
bnmurphy authored Apr 8, 2020
2 parents 2ac32d2 + 33525ef commit 6bf6a3c
Show file tree
Hide file tree
Showing 26 changed files with 623 additions and 4,653 deletions.
10 changes: 9 additions & 1 deletion CCTM/src/MECHS/cb6r3_ae7_aq/SpecDef_cb6r3_ae7_aq.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ AMNJ ,ug m-3 ,AMNJ[1]
ASOILJ ,ug m-3 ,2.20*AALJ[1]+2.49*ASIJ[1]+1.63*ACAJ[1]+2.42*AFEJ[1]+1.94*ATIJ[1]

!! Non-Crustal Inorganic Particle Species
AHPLUSIJ ,ug m-3 ,(AH3OPI[1]+AH3OPJ[1])*1.0/19.0
AHPLUSIJ ,umol m-3 ,(AH3OPI[1]+AH3OPJ[1])*1.0/19.0
ANAK ,ug m-3 ,0.8373*ASEACAT[1]+0.0626*ASOIL[1]+0.0023*ACORS[1]
AMGK ,ug m-3 ,0.0997*ASEACAT[1]+0.0170*ASOIL[1]+0.0032*ACORS[1]
AKK ,ug m-3 ,0.0310*ASEACAT[1]+0.0242*ASOIL[1]+0.0176*ACORS[1]
Expand Down Expand Up @@ -270,6 +270,14 @@ PM25_TOT ,ug m-3 ,ATOTI[0]*PM25AT[3]+ATOTJ[0]*PM25AC[3]+ATOTK[0]*PM25
PM25_UNSPEC1 ,ug m-3 ,PM25_TOT[0]-(PM25_CL[0]+PM25_EC[0]+PM25_NA[0]+PM25_NH4[0] \
+PM25_NO3[0]+PM25_OC[0]+PM25_SOIL[0]+PM25_SO4[0])

!! Fine particle acidity (pH). pH is undefined if there is no aerosol water.
!Do not trust predictions when hourly water is <0.01 ug m-3. FINEPHF will
!have large negative value (-9.999E36) when pH is not to be trusted.
!AH2OIJ ,ug m-3 ,AH2OI[1]+AH2OJ[1]
!HPMOLAL ,mol kg-1 ,AHPLUSIJ[0]/AH2OIJ[0]*1000.0
!ACIDITYTEMP , ,-1*LOG10(HPMOLAL[0])
!FINEPHF , ,AH2OIJ[0]>0.01 ? ACIDITYTEMP[0] : -9.999E36

!! PM10.0 and Coarse-Sized Species
PM10 ,ug m-3 ,ATOTI[0]*PM10AT[3]+ATOTJ[0]*PM10AC[3]+ATOTK[0]*PM10CO[3]

Expand Down
10 changes: 9 additions & 1 deletion CCTM/src/MECHS/cb6r3m_ae7_kmtbr/SpecDef_cb6r3m_ae7_kmtbr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ AMNJ ,ug m-3 ,AMNJ[1]
ASOILJ ,ug m-3 ,2.20*AALJ[1]+2.49*ASIJ[1]+1.63*ACAJ[1]+2.42*AFEJ[1]+1.94*ATIJ[1]

!! Non-Crustal Inorganic Particle Species
AHPLUSIJ ,ug m-3 ,(AH3OPI[1]+AH3OPJ[1])*1.0/19.0
AHPLUSIJ ,umol m-3 ,(AH3OPI[1]+AH3OPJ[1])*1.0/19.0
ANAK ,ug m-3 ,0.8373*ASEACAT[1]+0.0626*ASOIL[1]+0.0023*ACORS[1]
AMGK ,ug m-3 ,0.0997*ASEACAT[1]+0.0170*ASOIL[1]+0.0032*ACORS[1]
AKK ,ug m-3 ,0.0310*ASEACAT[1]+0.0242*ASOIL[1]+0.0176*ACORS[1]
Expand Down Expand Up @@ -271,6 +271,14 @@ PM25_TOT ,ug m-3 ,ATOTI[0]*PM25AT[3]+ATOTJ[0]*PM25AC[3]+ATOTK[0]*PM25
PM25_UNSPEC1 ,ug m-3 ,PM25_TOT[0]-(PM25_CL[0]+PM25_EC[0]+PM25_NA[0]+PM25_NH4[0] \
+PM25_NO3[0]+PM25_OC[0]+PM25_SOIL[0]+PM25_SO4[0])

!! Fine particle acidity (pH). pH is undefined if there is no aerosol water.
!Do not trust predictions when hourly water is <0.01 ug m-3. FINEPHF will
!have large negative value (-9.999E36) when pH is not to be trusted.
!AH2OIJ ,ug m-3 ,AH2OI[1]+AH2OJ[1]
!HPMOLAL ,mol kg-1 ,AHPLUSIJ[0]/AH2OIJ[0]*1000.0
!ACIDITYTEMP , ,-1*LOG10(HPMOLAL[0])
!FINEPHF , ,AH2OIJ[0]>0.01 ? ACIDITYTEMP[0] : -9.999E36

!! PM10.0 and Coarse-Sized Species
PM10 ,ug m-3 ,ATOTI[0]*PM10AT[3]+ATOTJ[0]*PM10AC[3]+ATOTK[0]*PM10CO[3]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ AMNJ ,ug m-3 ,AMNJ[1]
ASOILJ ,ug m-3 ,2.20*AALJ[1]+2.49*ASIJ[1]+1.63*ACAJ[1]+2.42*AFEJ[1]+1.94*ATIJ[1]

!! Non-Crustal Inorganic Particle Species
AHPLUSIJ ,ug m-3 ,(AH3OPI[1]+AH3OPJ[1])*1.0/19.0
AHPLUSIJ ,umol m-3 ,(AH3OPI[1]+AH3OPJ[1])*1.0/19.0
ANAK ,ug m-3 ,0.8373*ASEACAT[1]+0.0626*ASOIL[1]+0.0023*ACORS[1]
AMGK ,ug m-3 ,0.0997*ASEACAT[1]+0.0170*ASOIL[1]+0.0032*ACORS[1]
AKK ,ug m-3 ,0.0310*ASEACAT[1]+0.0242*ASOIL[1]+0.0176*ACORS[1]
Expand Down Expand Up @@ -274,6 +274,14 @@ PM25_TOT ,ug m-3 ,ATOTI[0]*PM25AT[3]+ATOTJ[0]*PM25AC[3]+ATOTK[0]*PM25C
PM25_UNSPEC1 ,ug m-3 ,PM25_TOT[0]-(PM25_CL[0]+PM25_EC[0]+PM25_NA[0]+PM25_NH4[0] \
+PM25_NO3[0]+PM25_OC[0]+PM25_SOIL[0]+PM25_SO4[0])

!! Fine particle acidity (pH). pH is undefined if there is no aerosol water.
!Do not trust predictions when hourly water is <0.01 ug m-3. FINEPHF will
!have large negative value (-9.999E36) when pH is not to be trusted.
!AH2OIJ ,ug m-3 ,AH2OI[1]+AH2OJ[1]
!HPMOLAL ,mol kg-1 ,AHPLUSIJ[0]/AH2OIJ[0]*1000.0
!ACIDITYTEMP , ,-1*LOG10(HPMOLAL[0])
!FINEPHF , ,AH2OIJ[0]>0.01 ? ACIDITYTEMP[0] : -9.999E36

!! PM10.0 and Coarse-Sized Species
PM10 ,ug m-3 ,ATOTI[0]*PM10AT[3]+ATOTJ[0]*PM10AC[3]+ATOTK[0]*PM10CO[3]

Expand Down
4 changes: 0 additions & 4 deletions CCTM/src/vdiff/acm2_m3dry/VDIFF_MAP.F
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,7 @@ FUNCTION VDIFF_MAP_INIT( ) RESULT ( SUCCESS )
END DO

CMPSPC( 1 ) = 'NH3_Emis'
#ifdef stage_opt
CMPSPC( 2 ) = 'NH3_Flux'
#elif m3dry_opt
CMPSPC( 2 ) = 'NH3_Dep '
#endif
CMPSPC( 3 ) = 'NH3_Stom'
CMPSPC( 4 ) = 'NH3_Cut '
CMPSPC( 5 ) = 'NH3_Soil'
Expand Down
21 changes: 4 additions & 17 deletions CCTM/src/vdiff/acm2_m3dry/opddep.F
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ SUBROUTINE OPDDEP ( JDATE, JTIME, TSTEP, N_SPC_DDEP )
CHARACTER( 16 ) :: PNAME = 'OPDDEP'
CHARACTER( 96 ) :: XMSG = ' '

! component flux varialbes
INTEGER, PARAMETER :: LCMP = 8
CHARACTER( 16 ), SAVE :: CMPSPC( LCMP )

INTEGER V, N, L ! loop induction variables
INTEGER STRT, FINI ! loop induction variables

Expand All @@ -76,15 +72,6 @@ SUBROUTINE OPDDEP ( JDATE, JTIME, TSTEP, N_SPC_DDEP )

IF ( .NOT. OPEN3( CTM_DRY_DEP_1, FSRDWR3, PNAME ) ) THEN

CMPSPC( 1 ) = 'NH3_Emis'
CMPSPC( 2 ) = 'NH3_Dep '
CMPSPC( 3 ) = 'NH3_Stom'
CMPSPC( 4 ) = 'NH3_Cut '
CMPSPC( 5 ) = 'NH3_Soil'
CMPSPC( 6 ) = 'NH3_Ag '
CMPSPC( 7 ) = 'NH3_Nat '
CMPSPC( 8 ) = 'NH3_Wat '

XMSG = 'Could not open ' // CTM_DRY_DEP_1 // ' file for update - '
& // 'try to open new'
CALL M3MESG( XMSG )
Expand Down Expand Up @@ -176,14 +163,14 @@ SUBROUTINE OPDDEP ( JDATE, JTIME, TSTEP, N_SPC_DDEP )

IF ( ABFLUX ) THEN
VTYPE3D( V ) = M3REAL
VNAME3D( V ) = 'NH3_DDEP'
VNAME3D( V ) = 'NH3_Flux'
UNITS3D( V ) = 'kg/hectare'
VDESC3D( V ) = 'hourly NH3_DryDep values'
VDESC3D( V ) = 'hourly bidi flux values'

VTYPE3D( V+1 ) = M3REAL
VNAME3D( V+1 ) = 'NH3_EMIS'
VNAME3D( V+1 ) = 'NH3_Emis'
UNITS3D( V+1 ) = 'kg/hectare'
VDESC3D( V+1 ) = 'hourly NH3_EMIS values'
VDESC3D( V+1 ) = 'hourly NH3_Emis values'
END IF

FDESC3D( 1 ) = 'hourly 1-layer cross-point RADM dry deposition data'
Expand Down
25 changes: 13 additions & 12 deletions CCTM/src/vdiff/acm2_m3dry/vdiffproc.F
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ SUBROUTINE VDIFF ( CGRID, JDATE, JTIME, TSTEP )
REAL :: SEDDY ( NLAYS,NCOLS,NROWS ) ! flipped EDDYV
REAL DTSEC ! model time step in seconds

REAL :: DDEP_NH3( NCOLS,NROWS )
REAL :: NH3_FLUX( NCOLS,NROWS )

REAL, ALLOCATABLE, SAVE :: VSED_AE( :,:,:,: )
INTEGER, SAVE :: NH3_HIT
Expand All @@ -157,8 +157,8 @@ SUBROUTINE VDIFF ( CGRID, JDATE, JTIME, TSTEP )
INTEGER ASTAT
INTEGER C, R, L, S, V, I, J, OFF ! loop induction variables
INTEGER MDATE, MTIME, MSTEP ! internal simulation date&time
CHARACTER(LEN=8), PARAMETER :: NAME_NH3_EMIS = 'NH3_EMIS'
CHARACTER(LEN=8), PARAMETER :: NAME_NH3_DDEP = 'NH3_DDEP'
CHARACTER(LEN=8), PARAMETER :: NAME_NH3_EMIS = 'NH3_Emis'
CHARACTER(LEN=8), PARAMETER :: NAME_NH3_FLUX = 'NH3_Flux'

INTERFACE
SUBROUTINE PA_UPDATE_EMIS ( PNAME, VDEMIS_DIFF, JDATE, JTIME, TSTEP )
Expand Down Expand Up @@ -408,7 +408,6 @@ END SUBROUTINE SA_OPWDDEP
IF ( WSTEP .EQ. 0 ) THEN
DDEP = 0.0 ! array assignment
ICMP = 0.0 ! array assignment
DDEP_NH3 = 0.0
#ifdef sens
S_DDEP = 0.0
#endif
Expand Down Expand Up @@ -486,7 +485,14 @@ END SUBROUTINE SA_OPWDDEP
END IF ! .NOT. IO_PE_INCLUSIVE
END IF
#endif

IF ( ABFLUX ) THEN
DO R = 1, NROWS
DO C = 1, NCOLS
NH3_FLUX(C,R) = DDEP( DD2DV(NH3_HIT),C,R )
DDEP( DD2DV(NH3_HIT),C,R ) = NH3_EMIS(C,R)+NH3_FLUX(C,R)
END DO
END DO
ENDIF
DO V = 1, N_SPC_DDEP
S = DD2DV( V )
DO R = 1, NROWS
Expand All @@ -503,14 +509,9 @@ END SUBROUTINE SA_OPWDDEP
END DO
C Write extra arrays for NH3 emission and net flux for bidi
IF ( ABFLUX ) THEN
DO R = 1, NROWS
DO C = 1, NCOLS
DDEP_NH3(C,R) = NH3_EMIS(C,R)+DDEP( DD2DV(NH3_HIT),C,R )
END DO
END DO

IF ( .NOT. WRITE3( CTM_DRY_DEP_1, NAME_NH3_DDEP,
& MDATE, MTIME, DDEP_NH3 ) ) THEN
IF ( .NOT. WRITE3( CTM_DRY_DEP_1, NAME_NH3_FLUX,
& MDATE, MTIME, NH3_FLUX ) ) THEN
XMSG = 'Could not write ' // CTM_DRY_DEP_1 // ' file'
CALL M3EXIT( PNAME, MDATE, MTIME, XMSG, XSTAT1 )
END IF
Expand Down
Loading

0 comments on commit 6bf6a3c

Please sign in to comment.