From 2fcfa0d73a75966aa1e85c0aadcda80703d657e8 Mon Sep 17 00:00:00 2001 From: Matt Dawson Date: Fri, 19 Jan 2024 12:58:45 -0800 Subject: [PATCH 1/3] fix ch4 example config --- examples/ts1_tsmlt.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ts1_tsmlt.json b/examples/ts1_tsmlt.json index aa287644..8d7cece4 100644 --- a/examples/ts1_tsmlt.json +++ b/examples/ts1_tsmlt.json @@ -1506,7 +1506,7 @@ }, "quantum yield": { "type": "base", - "constant value": 0.55 + "constant value": 0.45 } }, { @@ -1520,7 +1520,7 @@ }, "quantum yield": { "type": "base", - "constant value": 0.45 + "constant value": 0.55 } }, { From 9e135740ec653a0ffcabf35c3969685b4dee3f10 Mon Sep 17 00:00:00 2001 From: Matt Dawson Date: Fri, 19 Jan 2024 13:21:03 -0800 Subject: [PATCH 2/3] add ch3cl data set and configuration --- data/cross_sections/CH3CL_JPL06.nc | Bin 0 -> 11488 bytes examples/ts1_tsmlt.json | 39 +++- test/data/xsqy.doug.config.json | 36 ++++ test/unit/tuv_doug/JCALC/CMakeLists.txt | 1 + test/unit/tuv_doug/JCALC/XSQY_CH3CL.f | 236 ++++++++++++++++++++++++ test/unit/tuv_doug/driver.F90 | 3 + 6 files changed, 307 insertions(+), 8 deletions(-) create mode 100644 data/cross_sections/CH3CL_JPL06.nc create mode 100644 test/unit/tuv_doug/JCALC/XSQY_CH3CL.f diff --git a/data/cross_sections/CH3CL_JPL06.nc b/data/cross_sections/CH3CL_JPL06.nc new file mode 100644 index 0000000000000000000000000000000000000000..823cff31755dbee9220c9dc205a65fbb2f26a825 GIT binary patch literal 11488 zcmeHNeQX@X6(9Rz$KD+IAgKavN(PfQcDY;K-km?sNo=3bPGbA)`tpgQn!UR@-^P2p z?(Uu;=|@aefv8eIma0He8zTcGYj59m%4e18x;i4ud!n2V@tTNexG?ssJBPRS zj#dXxRyX){ff~^yyDX+kHK{_D&#WU$fCOsEVh;HnY(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L~^F^;c~U0v|hctp4-kXA9ro9`F3eYi)amMzzkC z;eG#p_FSm*%?;oD@wusuoy&V00%teg+`0RmQ(qYQ(~X^X|DwV9TK($Ip7*@xM>j6( z9DaDYa`JE0o&OBIc6?;*g+zb4sj9a5twdq9b4I=W^~9b#UVh;0k6umuppo8s=qwoW{kIJ4*C&yV&zm3Z}`FQ2M;=7~hjUw1W~zyElGk9REb=HZ!hyDuI|yl{We zKDqgU#OX6VZ{HL8cA~3sO?PV5!Nh~F1Un~=PA1B~U9tK8LOyYQ{if$4Z|_aKlY8Nw z6Gui8OZTmO`Q44F#7*k@m!{Sv5`)2=PafN*C2qaz!cBju{bJ&!$7hbduwh-|KTA>9 AWdHyG literal 0 HcmV?d00001 diff --git a/examples/ts1_tsmlt.json b/examples/ts1_tsmlt.json index 8d7cece4..247b430c 100644 --- a/examples/ts1_tsmlt.json +++ b/examples/ts1_tsmlt.json @@ -479,14 +479,37 @@ "name": "jacet", "__reaction": "CH3COCH3 + hv -> CH3CO + CH3", "cross section": { - "netcdf files": [ - { "file path": "data/cross_sections/CH3COCH3_1.nc" } - ], - "type": "CH3COCH3+hv->CH3CO+CH3" - }, - "quantum yield": { - "type": "CH3COCH3+hv->CH3CO+CH3" - } + "type": "temperature based", + "netcdf file": "data/cross_sections/CH3CL_JPL06.nc", + "parameterization": { + "AA": [ -299.80, 5.1047, -3.3630e-2, 9.5805e-5, -1.0135e-7 ], + "BB": [ -7.1727, 1.4837e-1, -1.1463e-3, 3.9188e-6, -4.9994e-9 ], + "lp": [ 0.0, 1.0, 2.0, 3.0, 4.0 ], + "minimum wavelength": 174.1, + "maximum wavelength": 216.0, + "base temperature": 273.0, + "base wavelength": 0.0, + "logarithm": "base 10", + "temperature ranges": [ + { + "maximum": 209.999999999999, + "fixed value": 210.0 + }, + { + "minimum": 210, + "maximum": 300 + }, + { + "minimum": 300.00000000001, + "fixed value": 300.0 + } + ] + } + }, + "quantum yield": { + "type": "base", + "constant value": 1.0 + } }, { "name": "jmgly", diff --git a/test/data/xsqy.doug.config.json b/test/data/xsqy.doug.config.json index eda410a8..2ec744c7 100644 --- a/test/data/xsqy.doug.config.json +++ b/test/data/xsqy.doug.config.json @@ -971,5 +971,41 @@ "__note": "second test: including edges of interpolation with relaxed tolerance", "tolerance": 1.0e-3, "mask": [ { "index": 79 } ] + }, + { + "cross section": { + "type": "temperature based", + "netcdf file": "data/cross_sections/CH3CL_JPL06.nc", + "parameterization": { + "AA": [ -299.80, 5.1047, -3.3630e-2, 9.5805e-5, -1.0135e-7 ], + "BB": [ -7.1727, 1.4837e-1, -1.1463e-3, 3.9188e-6, -4.9994e-9 ], + "lp": [ 0.0, 1.0, 2.0, 3.0, 4.0 ], + "minimum wavelength": 174.1, + "maximum wavelength": 216.0, + "base temperature": 273.0, + "base wavelength": 0.0, + "logarithm": "base 10", + "temperature ranges": [ + { + "maximum": 209.999999999999, + "fixed value": 210.0 + }, + { + "minimum": 210, + "maximum": 300 + }, + { + "minimum": 300.00000000001, + "fixed value": 300.0 + } + ] + } + }, + "quantum yield": { + "type": "base", + "constant value": 1.0 + }, + "label": "CH3Cl + hv -> Cl", + "tolerance": 5.0e-3 } ] diff --git a/test/unit/tuv_doug/JCALC/CMakeLists.txt b/test/unit/tuv_doug/JCALC/CMakeLists.txt index 8f251b71..7b97673c 100644 --- a/test/unit/tuv_doug/JCALC/CMakeLists.txt +++ b/test/unit/tuv_doug/JCALC/CMakeLists.txt @@ -12,6 +12,7 @@ target_sources(tuv_doug XSQY_CFCL3.f XSQY_CH2BR2.f XSQY_CH3BR.f + XSQY_CH3CL.f XSQY_CHBR3.f XSQY_CL2O2.f XSQY_CLO.f diff --git a/test/unit/tuv_doug/JCALC/XSQY_CH3CL.f b/test/unit/tuv_doug/JCALC/XSQY_CH3CL.f new file mode 100644 index 00000000..7f14e97a --- /dev/null +++ b/test/unit/tuv_doug/JCALC/XSQY_CH3CL.f @@ -0,0 +1,236 @@ + subroutine XSQY_CH3CL(nw,wl,wc,nz,tlev,airlev,j,sq,jlabel,pn) +!-----------------------------------------------------------------------------! +! purpose: ! +! provide product (cross section) x (quantum yield) for ch3cl photolysis: ! +! ch3cl + hv -> products ! +! cross section: from JPL06 recommendation ! +! quantum yield: assumed to be unity ! +!-----------------------------------------------------------------------------! +! parameters: ! +! nw - integer, number of specified intervals + 1 in working (i) ! +! wavelength grid ! +! wl - real, vector of lower limits of wavelength intervals in (i) ! +! working wavelength grid ! +! wc - real, vector of center points of wavelength intervals in (i) ! +! working wavelength grid ! +! nz - integer, number of altitude levels in working altitude grid (i) ! +! tlev - real, temperature (k) at each specified altitude level (i) ! +! airlev - real, air density (molec/cc) at each altitude level (i) ! +! j - integer, counter for number of weighting functions defined (io) ! +! sq - real, cross section x quantum yield (cm^2) for each (o) ! +! photolysis reaction defined, at each defined wavelength and ! +! at each defined altitude level ! +! jlabel - character*60, string identifier for each photolysis reaction (o) ! +! defined ! +!-----------------------------------------------------------------------------! +! edit history: ! +! 07/30/07 Doug Kinnison ! +!-----------------------------------------------------------------------------! + implicit none + include 'params' + +!-----------------------------------------------------------------------------! +! ... input ! +!-----------------------------------------------------------------------------! + real, intent(in) :: wl(kw) + real, intent(in) :: wc(kw) + real, intent(in) :: tlev(kz) + real, intent(in) :: airlev(kz) + + integer, intent(in) :: nz + integer, intent(in) :: nw + + character*80, intent(in) :: pn + character*60, intent(out) :: jlabel(kj) + real, intent(out) :: sq(kj,kz,kw) + +!-----------------------------------------------------------------------------! +! ... input/output ! +!-----------------------------------------------------------------------------! + integer, intent(inout) :: j + +!-----------------------------------------------------------------------------! +! ... local ! +!-----------------------------------------------------------------------------! + integer kdata + parameter(kdata=300) + integer i, iw, n, idum, nloop, n1 + integer ierr, iz, iwc, icnt + real x1 (kdata), y1 (kdata) + real xin (kdata), yin (kdata) + real wctmp(kdata), wcb (kdata) + real ytmp (nz,kdata), ycomb(nz,kdata) + real ytd (nz,kw), tin (nz) + real AA(5), BB(5), lp(5) + real yg1 (kw) + real qy, ysave + + AA(1) = -299.80 + AA(2) = 5.1047 + AA(3) = -3.3630e-2 + AA(4) = 9.5805e-5 + AA(5) = -1.0135e-7 + + BB(1) = -7.1727 + BB(2) = 1.4837e-1 + BB(3) = -1.1463e-3 + BB(4) = 3.9188e-6 + BB(5) = -4.9994e-9 + + lp(1) = 0.0 + lp(2) = 1.0 + lp(3) = 2.0 + lp(4) = 3.0 + lp(5) = 4.0 + +!---------------------------------------------- +! ... tin set to tlev +!---------------------------------------------- + tin(:) = tlev(:) + +!---------------------------------------------- +! ... jlabel(j) = 'CH3Cl + hv -> Cl' +!---------------------------------------------- + j = j+1 + jlabel(j) = 'CH3Cl + hv -> Cl' + +!---------------------------------------------- +! Derive temperature dependence +!---------------------------------------------- +! Temperature dependence good between 210-300K +! and 174 nm-216 nm. +!---------------------------------------------- + iwc = 1 + ytmp(:,:)= 0.0 + + do iw = 1, nw-1 + + IF ((wc(iw) .GE. 174.) .AND. (wc(iw) .LE.216.)) THEN + + do iz = 1, nz + + IF (tin(iz) .LT. 210.) THEN + do nloop = 1, 5 + ytmp(iz,iwc) = ytmp(iz,iwc) + & + AA(nloop)* (wc(iw)**lp(nloop)) + & + (210.0-273.0)*BB(nloop)*wc(iw)**lp(nloop) + enddo + wctmp(iwc) = wc(iw) + ENDIF + + IF ((tin(iz) .GE. 210.).AND.(tin(iz) .LE. 300.)) THEN + do nloop = 1,5 + + ytmp(iz,iwc) = ytmp(iz,iwc) + & + AA(nloop)* (wc(iw)**lp(nloop)) + & + (tin(iz)-273.0)*BB(nloop)*wc(iw)**lp(nloop) + enddo + wctmp(iwc) = wc(iw) + ENDIF + + IF (tin(iz) .GT. 300.) THEN + do nloop = 1, 5 + ytmp(iz,iwc) = ytmp(iz,iwc) + & + AA(nloop)* (wc(iw)**lp(nloop)) + & + (300.0-273.0)*BB(nloop)*wc(iw)**lp(nloop) + enddo + wctmp(iwc) = wc(iw) + ENDIF + enddo + iwc = iwc+ 1 + + ENDIF + + enddo + +!---------------------------------------------- +! ... For wavelengths >216 nm and <174 nm +!---------------------------------------------- + open(kin,file=TRIM(pn)//'XS_CH3CL_JPL06.txt',status='old') + + read(kin,*) idum, n + do i = 1, idum-2 + read(kin,*) + enddo + + do i = 1, n + read(kin,*) xin(i), yin(i) + enddo + close(kin) + +!---------------------------------------------- +! ... Combine cross sections +!---------------------------------------------- + do iz = 1, nz + icnt = 1 + +! ... < 174nm + do i = 1, n + IF (xin(i) .LT. 174.1) THEN + ycomb(iz,icnt) = yin(i) + wcb (icnt) = xin(i) + icnt = icnt + 1 + ENDIF + enddo +! ... 174-216 nm + do i = 1, iwc-1 + ycomb(iz,icnt) = 10**(ytmp(iz,i)) + wcb (icnt) = wctmp(i) + icnt = icnt+1 + enddo +! ... >216nm + do i = 1, n + IF (xin(i) .GT. 216.) THEN + ycomb(iz,icnt) = yin(i) + wcb (icnt) = xin(i) + icnt = icnt+1 + ENDIF + enddo + enddo + +!---------------------------------------------- +! ... interpolate +!---------------------------------------------- + do iz = 1, nz + n1 = icnt-1 + y1 = ycomb(iz,:) + x1 = wcb +!---------------------------------------------- +! Check routine +! do iw = 1, icnt-1 +! print*, iw, wcb(iw), ycomb(iz,iw), tin(iz) +! enddo +! stop +!---------------------------------------------- + call addpnt(x1,y1,kdata,n1,x1(1)*(1.-deltax),0.) + call addpnt(x1,y1,kdata,n1, 0.,0.) + call addpnt(x1,y1,kdata,n1,x1(n1)*(1.+deltax),0.) + call addpnt(x1,y1,kdata,n1, 1e38,0.) + call inter2(nw,wl,yg1,n1,x1,y1,ierr) + ytd(iz,:) = yg1(:) + + if (ierr .ne. 0) then + write(*,*) ierr, jlabel(j) + stop + endif + enddo + +!---------------------------------------------- +! Check routine +! iz = 1 +! do iw = 19, 64 +! print*, iw, wc(iw), ytd(iz,iw), tin(iz) +! enddo +! stop +!---------------------------------------------- +!---------------------------------------------- +! ...quantum yield assumed to be unity +!---------------------------------------------- + qy = 1. + do iw = 1, nw-1 + do iz = 1, nz + sq(j,iz,iw) = qy * ytd(iz,iw) + enddo + enddo + + end subroutine XSQY_CH3CL diff --git a/test/unit/tuv_doug/driver.F90 b/test/unit/tuv_doug/driver.F90 index 5ba2c12a..1ca91b37 100644 --- a/test/unit/tuv_doug/driver.F90 +++ b/test/unit/tuv_doug/driver.F90 @@ -201,6 +201,9 @@ subroutine calculate( label, temperature, air_density, xsqy ) case( "HO2NO2 + hv -> HO2 + NO2" ) call XSQY_HO2NO2(nw,wl,wc,nz,temperature,air_density,j,l_xsqy,all_labels,pn) xsqy(:,:) = l_xsqy(2,:nz,:nw) + case( "CH3Cl + hv -> Cl" ) + call XSQY_CH3CL(nw,wl,wc,nz,temperature,air_density,j,l_xsqy,all_labels,pn) + xsqy(:,:) = l_xsqy(1,:nz,:nw) case default call die( 946669022 ) end select From a083881e96ef6f88f1e6d74b9a77901e46dc0cde Mon Sep 17 00:00:00 2001 From: Matt Dawson Date: Fri, 19 Jan 2024 13:41:51 -0800 Subject: [PATCH 3/3] add SO2 data set --- data/cross_sections/SO2_Mills.nc | Bin 0 -> 9680 bytes examples/ts1_tsmlt.json | 2 +- test/data/xsqy.doug.config.json | 14 +++ test/unit/tuv_doug/JCALC/CMakeLists.txt | 1 + test/unit/tuv_doug/JCALC/XSQY_SO2.f | 108 ++++++++++++++++++++++++ test/unit/tuv_doug/driver.F90 | 3 + 6 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 data/cross_sections/SO2_Mills.nc create mode 100644 test/unit/tuv_doug/JCALC/XSQY_SO2.f diff --git a/data/cross_sections/SO2_Mills.nc b/data/cross_sections/SO2_Mills.nc new file mode 100644 index 0000000000000000000000000000000000000000..455770ec28c0474be9a0756eff387ae934bda31c GIT binary patch literal 9680 zcmeHKeQ;FO6~DWi&t(abuTTqkgR~V$!tRm)!NuILSwbM$gd`whVcBHgW*^zFynRUk z`IN7s!HHM|oe=`&-dMIno%~rzx95rIU|Eex{lQSJ;AZ#!l2K}cU8|Qt2NsWn@1TuODZl& zm7CFOCMFOWGMuDvu%wZjCFHwp49HoCjsI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|0Np%FDoBmO0sG@&*{IIl6X&^hL=oMPiwH4MdDrW#ZxBn6II*)?S{HMiUpsXJVTm$`5zaRXwa2!*v)JfSqm#BJJ&M+gP}wdj0_js;CG30ebW5d^|V4 z2*kKRU!q?*`5InBeDU_E++AI16e;Ybw0?7y@Ban>1y^g?}`g6ll!a=ri=!frp zxiiS#+Ij!@k3I;pvsYFwe$(2-=4Ry|da1ODeKGsU$n{H`*x&=@pDa7n#M0JmbwB+@ z6I)SIwD9N;LX1BvY=IDae-zi;9b%zp|F*p3lMv%tf1OQLHgN5+-|q6O48$vbsKYB*qvE1 z)-u)lho5LMHUa2E#N0S*hd?|UXD`0M>6y6j>)p86&(y-eUGpO?!u}^(*#6<%pf_3= zx2k&cwHC%tKYYAIV@CegYi!5GJ@3pqsj)*Z@ee~1?3H(BP1@v7i1mYrL>KQhh+T-6 z5Lv5O??gO@Xm1nz)rj4Qv|aGyh{q7Kmk9nM#Dj=rso>Wjb|GFuWXr^QC*nCo`xAn{ z8nGLZE*Jbb;xWYR6@tGA@gO2uDfl&rU5J+u*($N#iFgii*lNLNh#|yI#3P935Hr>Y zc{}1f#MOweAa*1E3z0r4^kyK&5w{~AL%e{Py_ON6$%u;(e}s4t@eCqaC*&Vm$9Ol^ z{b~L>_A}ll4ZGK|7&Oq|*BN#Fi_-NB%Kvwr>lu{czK_>4DDR~O8(0@_-_a{K82xqX z)CQxDUmLNJg_~ym{K!O)EAQ!FcMiH*?#dZnoVssYrEA)z!WYlSye@y}x&7X2vt2_s z*KaJ@Fx!>eVe8m?tlniCv4)f`c+9m%dE;ouzQ Cl", "tolerance": 5.0e-3 + }, + { + "cross section": { + "type": "base", + "netcdf files": [ + { "file path": "data/cross_sections/SO2_Mills.nc" } + ] + }, + "quantum yield": { + "type": "base", + "constant value": 1.0 + }, + "label": "SO2 + hv -> SO + O", + "tolerance": 1.0e-4 } ] diff --git a/test/unit/tuv_doug/JCALC/CMakeLists.txt b/test/unit/tuv_doug/JCALC/CMakeLists.txt index 7b97673c..124cd4af 100644 --- a/test/unit/tuv_doug/JCALC/CMakeLists.txt +++ b/test/unit/tuv_doug/JCALC/CMakeLists.txt @@ -25,6 +25,7 @@ target_sources(tuv_doug XSQY_HNO3.f XSQY_HO2NO2.f XSQY_N2O5.f + XSQY_SO2.f ) ################################################################################ diff --git a/test/unit/tuv_doug/JCALC/XSQY_SO2.f b/test/unit/tuv_doug/JCALC/XSQY_SO2.f new file mode 100644 index 00000000..c0e49950 --- /dev/null +++ b/test/unit/tuv_doug/JCALC/XSQY_SO2.f @@ -0,0 +1,108 @@ + SUBROUTINE XSQY_SO2(nw,wl,wc,nz,tlev,airden,j,sq,jlabel,pn) +!---------------------------------------------------------------------------! +! PURPOSE: ! +! Provide the product (cross section) x (quantum yield) for photolysis: ! +! SO2 + hv -> Products ! +! ! +! Cross section from Mike Mills, CU/LASP, Base on: ! +! 1. Yung, Y.L., and W.B. Demore (1982) Photochemistry of the Stratosphere ! +! of Venus: Implications for Atmospheric Evolution, Icarus, 51, 199-247. ! +! 2. Okabe, H. In Photochemistry of Small Molecules; John Wiley and Sons ! +! Inc.: New York, 1978; pp 248-249 ! +! ! +! Quantum yield = 1.0 ! +!---------------------------------------------------------------------------! +! PARAMETERS: ! +! NW - INTEGER, number of specified intervals + 1 in working (I)! +! wavelength grid ! +! WL - REAL, vector of lower limits of wavelength intervals in (I)! +! working wavelength grid ! +! WC - REAL, vector of center points of wavelength intervals in (I)! +! working wavelength grid ! +! NZ - INTEGER, number of altitude levels in working altitude grid (I)! +! TLEV - REAL, temperature (K) at each specified altitude level (I)! +! AIRDEN - REAL, air density (molec/cc) at each altitude level (I)! +! J - INTEGER, counter for number of weighting functions defined (IO)! +! SQ - REAL, cross section x quantum yield (cm^2) for each (O)! +! photolysis reaction defined, at each defined wavelength and ! +! at each defined altitude level ! +! JLABEL - CHARACTER*50, string identifier for each photolysis reaction (O)! +! defined ! +!---------------------------------------------------------------------------! + IMPLICIT NONE + INCLUDE 'params' + +!---------------------------------------------------------------------------! +! ... input ! +!---------------------------------------------------------------------------! + real, intent(in) :: wl(kw) + real, intent(in) :: wc(kw) + real, intent(in) :: tlev(kz) + real, intent(in) :: airden(kz) + + integer, intent(in) :: nz + integer, intent(in) :: nw + + character*80, intent(in) :: pn + character*60, intent(out) :: jlabel(kj) + real, intent(out) :: sq(kj,kz,kw) + +!---------------------------------------------------------------------------! +! ... input/output ! +!---------------------------------------------------------------------------! + integer, intent(inout) :: j + +!---------------------------------------------------------------------------! +! ... local ! +!---------------------------------------------------------------------------! + integer kdata + parameter (kdata=300) + integer i, n, ierr, iw + real x_min(kdata), x_max(kdata), x(kdata), y(kdata) + real yg(kw) + real qy + +!----------------------------------------------- +! ... SO2 photolysis +!----------------------------------------------- + j = j+1 + jlabel(j) = 'SO2 + hv -> SO + O' + +!----------------------------------------------- +! ... SO2 cross sections +!---------------------------------------------- + OPEN(UNIT=kin,FILE=TRIM(pn)//'XS_SO2_mills.txt', + $ STATUS='old') + DO i = 1, 13 + READ(kin,*) + ENDDO + n = 125 + DO i = 1, n + READ(kin,*) x_min(i), x_max(i), y(i) + x(i) = (x_min(i)+x_max(i)) / 2.0 + ENDDO + + CLOSE(kin) + + CALL addpnt(x,y,kdata,n,x(1)*(1.-deltax),0.) + CALL addpnt(x,y,kdata,n, 0.,0.) + CALL addpnt(x,y,kdata,n,x(n)*(1.+deltax),0.) + CALL addpnt(x,y,kdata,n, 1.e+38,0.) + CALL inter2(nw,wl,yg,n,x,y,ierr) + IF (ierr .NE. 0) THEN + WRITE(*,*) ierr, jlabel(j) + STOP + ENDIF + +!----------------------------------------------- +! ... combine +!----------------------------------------------- + qy = 1.0 + + DO iw = 1, nw - 1 + DO i = 1, nz + sq(j,i,iw) = yg(iw) * qy + ENDDO + ENDDO + + end subroutine XSQY_SO2 diff --git a/test/unit/tuv_doug/driver.F90 b/test/unit/tuv_doug/driver.F90 index 1ca91b37..025555c7 100644 --- a/test/unit/tuv_doug/driver.F90 +++ b/test/unit/tuv_doug/driver.F90 @@ -204,6 +204,9 @@ subroutine calculate( label, temperature, air_density, xsqy ) case( "CH3Cl + hv -> Cl" ) call XSQY_CH3CL(nw,wl,wc,nz,temperature,air_density,j,l_xsqy,all_labels,pn) xsqy(:,:) = l_xsqy(1,:nz,:nw) + case( "SO2 + hv -> SO + O" ) + call XSQY_SO2(nw,wl,wc,nz,temperature,air_density,j,l_xsqy,all_labels,pn) + xsqy(:,:) = l_xsqy(1,:nz,:nw) case default call die( 946669022 ) end select