For more information, contact k1yoshimura[at]ucsd.edu.

Adding CO2 as one of prognostic variables in G-RSM is done by followings:
  1. In define.h, specify ntrac_=3 (for your information, ntrac=1 is vapor, ntrac=2 is dummy ozone)
  2. Change following files in src/fcst. Diff result is attached below.
    1. gbphys.F: 3 parts. (call new moninp)
    2. gsmstep.F: 2 parts. The biggest change. (reading co2 surface flux)
    3. moninp.F: 5 parts. (surface flux to atmosphere)
    4. rdsig.F: 1 part. (constant initial value input)
    5. subpgb.F: 4 parts. (co2 concentration output)
    6. wriflx.F: 1 part. (co2 surface flux output)
    7. zerflx.F: 1 part. (co2 surface flux reset)
  3. Change src/share/idsdef.F: add "ids(119)=9" between ids(117) and ids(121).
  4. Do following in src/sfcl.
    1. copy fixrd.F as fixrd_clim.F. add line of "kpds(16)=51."
    2. add "fixrd_clim.o" in Makefile(.in)
    3. add "fixrd_clim.o" in src/sfcl_par/Makefile(.in)
  5. Change src/include/comfphys.h: add "dqsfci1(LONF2S,LATG2S)" in "comfphys" block.
  6. Re-compile everything ($ cd gsm ; make)

IMPORTANT NOTES
  • In output pgb files, CO2 concentration (unit: kg/kg) will be saved as cloud water (grib ID=153).
  • In output flx files, CO2 flux (unit: kgCO2/m2/s) will be saved as grib ID=119.
  • If you want to start constant value (default: 376 ppmv), change the number in src/fcst/rdsig.F
  • "transcom_nep_clim.grb" is read by default.

In easy simulation, you can start from constant value, but if you want realistic initial condition for CO2, it can be done using AIRS data. If you need the data, please contact k1yoshimura[at]ucsd.edu.


diff from the version of 2009-2-22:
Index: gbphys.F
===================================================================
RCS file: /rokka1/kana/cvs-server-root/cpscvs/src/fcst/gbphys.F,v
retrieving revision 1.60
diff -r1.60 gbphys.F
260a261,262
> ** co2 **
>       dimension dqsfc1i1(LONF2S)
477a480,481
> ** co2 **
>       common /co2/co2fl(LONF2S,LATG2S)
1385a1390,1391
>      7         hpbl(1,lat),gamt,gamq,slmsk(1,lat),
>      $         co2fl(1,lat),dqsfc1i1,
1387c1393,1394
<      7         hpbl(1,lat),gamt,gamq,slmsk(1,lat),kpbl)
---
> ** co2**
>      $         kpbl)
1389,1390c1396,1397
<      7         hpbl(1,lat),gamt,gamq,slmsk(1,lat),kpbl,
<      $         heat,evp)
---
> ** co2**
>      $         kpbl,heat,evp)
1431a1439
>       dqsfci1(j,lat)=dqsfci1(j,lat)+dqsfc1i1(j)*dtf/2500000
Index: gsmstep.F
===================================================================
RCS file: /rokka1/kana/cvs-server-root/cpscvs/src/fcst/gsmstep.F,v
retrieving revision 1.44
diff -r1.44 gsmstep.F
133a134,141
> ** co2 **
>       dimension
>      *     out(lonf_*latg_),dummy2(lonf_,latg_),
>      *     data(720*360),dummy1(720,360)
>       common /co2/co2fl(LONF2S,LATG2S)
>       integer  kpd(25),imdata,jmdata,imaxgrb,jmaxgrb,
>      $     kpds5,kgds1,iret,kgau,idim,jdim,ijdim
>       character*128 fngrib
540a549,614
> c
> ** co2 **
> cc read net carbon emission file cc
>         imdata=720 !! temporary
>         jmdata=360
>         ijmdim=imdata*jmdata
>         idim=lonf_
>         jdim=latg_
>         ijdim=idim*jdim
> #ifdef MP
>       if(iope) then
> #endif
>         print *,'========== start reading nep ========='
>         do k=1,25
>           kpd(k)=-1
>         enddo
>         kpd(5)=1
>         kpd(6)=1
>         kpd(7)=0
>         fngrib='/home/kei/data/FLUX_data/transcom_nep_clim.grb'
>         call fixrd_clim(n1,fngrib,
>      $             kpd,
>      &             idate(4),idate(2),idate(3),idate(1),thour,
>      &             imdata,jmdata,
>      &             imaxgrb,jmaxgrb,
>      &             kpds5,kgds1,
>      &             proj,orient,truth,cotru,
>      &             delx,dely,rlat1,rlat2,rlon1,rlon2,
>      &             dlon,dlat,wlon,rnlat,
>      &             data,iret)
>         if(iret.gt.0) then
>           print *,' read failed '
> #ifdef MP
>           call mpabort
> #else
>           call abort
> #endif
>         endif
>         do ij=1,imaxgrb*jmaxgrb
>           dummy1(ij,1)=1.
>         enddo
>         do ij=1,idim*jdim
>           dummy2(ij,1)=1.
>         enddo
>         kgau=0
>         if(kgds1.eq.4) kgau=1
>         call la2ga(data,imaxgrb,jmaxgrb,
>      &             abs(dlon),abs(dlat),wlon,rnlat,
>      &             out,idim,jdim,.false.,dummy1,dummy2,kgau,
>      &             0)
> c
> #ifdef MP
> #define CO2FL out
> #else
> #define CO2FL co2fl
> #endif
>         do ij=1,idim*jdim
>           CO2FL(ij)=out(ij)*44./12. !! kgC->kgCO2
>         enddo
>         call row1ns(CO2FL)
> #ifdef MP
>       endif
>         call mpgf2p(out,lonf2_,latg2_,co2fl,
>      1            LONF2S,LATG2S,1)
> #endif
> #undef CO2FL
Index: moninp.F
===================================================================
RCS file: /rokka1/kana/cvs-server-root/cpscvs/src/fcst/moninp.F,v
retrieving revision 1.19
diff -r1.19 moninp.F
22a23,24
> ** co2 **
>      *     co2fl,dqsfci1,
132a135,137
> ** co2 **
>       dimension
>      $     co2fl(imx2),dqsfci1(imx2)
248a254
>          dqsfci1(i) = 0.
484a491,492
> ** co2 **
>          a2(i,1+2*km)=q1(i,1+2*km)+dt*rdzt1(i)/t1(i,1)*co2fl(i)
487c495,496
<         do k = 2, ndiff
---
> c        do k = 2, ndiff
>         do k = 2, 2
543a553,556
> ** co2 **
>             qtend = (a2(i,k+2*km)-q1(i,k+2*km))*rdt
>             rtg(i,k+2*km) = rtg(i,k+2*km)+qtend
>             dqsfci1(i) = dqsfci1(i)+conq*del(i,k)*pstar(i)*qtend
547c560,562
<         do kk = 2, ndiff
---
> ** co2 **
> c        do kk = 2, ndiff
>         do kk = 2, 2
Index: rdsig.F
===================================================================
RCS file: /rokka1/kana/cvs-server-root/cpscvs/src/fcst/rdsig.F,v
retrieving revision 1.8
diff -r1.8 rdsig.F
372a373,393
> ** co2 uniform intial **
>            nt=3
>            ktrace = (nt-1)*levs_+1
> #ifdef MP
>            if( mype.eq.master ) then
>              do k=1,levs_
>                do i=1,lnt2_
>                  coef1(i,k)=0.
>                enddo
>                coef1(1,k)=376.e-6 * 44. / 29. * 2.**0.5 !! ppmv=moleco2/moleair
>              enddo
>            endif
>            call mpsf2p(coef1,lnt22_,rq(1,ktrace),lnt22p_,levs_)
> #else
>            do k=1,levs_
>              do i=1,lnt2_
>                rq(i,k+ktrace-1) = 0.
>              enddo
>              rq(1,k+ktrace-1)=376.e-6 * 44. / 29. * 2.**0.5 !! ppmv=moleco2/moleair
>            enddo
> #endif
Index: subpgb.F
===================================================================
RCS file: /rokka1/kana/cvs-server-root/cpscvs/src/fcst/subpgb.F,v
retrieving revision 1.58
diff -r1.58 subpgb.F
260c260
< c              cldwat
---
> c              cldwat
264c264,266
<      $          ko_*.false.,
---
> ** co2 **
> c     $          ko_*.false.,
>      $          ko_*.true.,
298c300,302
<      $           .false.,
---
> ** co2 **
> c     $           .false.,
>      $           .true.,
424c428,430
<       lpcl=ncldg_.ge.1
---
> ** co2 **
> c      lpcl=ncldg_.ge.1
>       lpcl=.true.
839c845,847
<         kc=ntrac_*levs_+1      ! cloud water
---
> ** co2 **
> c        kc=ntrac_*levs_+1      ! cloud water
>         kc=levs_*2+1      ! tracer 3
Index: wriflx.F
===================================================================
RCS file: /rokka1/kana/cvs-server-root/cpscvs/src/fcst/wriflx.F,v
retrieving revision 1.60
diff -r1.60 wriflx.F
95a96,97
> ** co2 **
>      $          ilhflxi1=119,
256c258
<         write(6,*) ' error in opening file ',fno(1:ncho)
---
>         write(6,*) 'wriflx: error in opening file ',fno(1:ncho)
2699a2702,2746
> ** co2 **
> c
> c co2 flux
> c
> #ifdef MP
>       call MPGP2F(dqsfci1,ILEN2S,JLEN2S,work,ILEN2,JLEN2,1)
>       if(mype.eq.master) then
> #endif
>       do n=1,len
> #ifdef MP
>       work(n,1)=work(n,1)*rtime
> #else
>       work(n,1)=dqsfci1(n,1)*rtime
> #endif
>       enddo
> #ifdef RSM
>       call shalfo(work,1)
> #else
>       call rowsep(work)
> #endif
> #ifdef DBG
>       call maxmin(work,ILEN*JLEN,1,1,1,'qflx1')
> #endif
>       GRIBIT work,lbm,idrt,ILEN,JLEN,maxbit,colat,
>      &            ilpds,iptv,icen,igen,
>      &            ibm0,ilhflxi1,isfc,il1k,il2k,iyr,imo,ida,ihr,
>      &          ifhour,ifhr,ithr,iavg,ina,inm,icen2,ids(ilhflxi1),iens,
>      &            rlat1,rlon1,rlat2,rlon2,delx,dely,ortru,proj
> #ifdef MRG_POST
>      &           ,g,lg,ierr)
>       if(ierr.eq.0) then
>         call wryte(nn,lg,g)
> #ifdef DBG
>         print *,'qflx1 grib created    '
> #endif
>       else
>         print *,'qflx1 grib make failed'
>       endif
> #endif
> #ifdef COUPLE
>       write(nnp) (work(n,1),n=1,len)
> #endif
> #ifdef MP
>       endif
> #endif
Index: zerflx.F
===================================================================
RCS file: /rokka1/kana/cvs-server-root/cpscvs/src/fcst/zerflx.F,v
retrieving revision 1.17
diff -r1.17 zerflx.F
143a144,145
> ** co2 **
>           dqsfci1(i,lat) = 0.0 e 0