12 |
|
|
13 |
C !DESCRIPTION: |
C !DESCRIPTION: |
14 |
C Calculate the atmospheric pCO2 |
C Calculate the atmospheric pCO2 |
15 |
C gchem_int1: |
C dic_int1: |
16 |
C 0=use default 278.d-6 |
C 0=use default 278.d-6 |
17 |
C 1=use constant value - gchem_rl1, read in from data.gchem |
C 1=use constant value - dic_pCO2, read in from data.dic |
18 |
C 2=read in from file |
C 2=read in from file |
19 |
C 3=interact with atmospheric box |
C 3=interact with atmospheric box |
20 |
C !USES: =============================================================== |
C !USES: =============================================================== |
28 |
#include "DIC_VARS.h" |
#include "DIC_VARS.h" |
29 |
#include "PTRACERS_SIZE.h" |
#include "PTRACERS_SIZE.h" |
30 |
#include "PTRACERS_FIELDS.h" |
#include "PTRACERS_FIELDS.h" |
|
#include "GCHEM.h" |
|
31 |
#include "DIC_ATMOS.h" |
#include "DIC_ATMOS.h" |
32 |
|
|
33 |
C !INPUT PARAMETERS: =================================================== |
C !INPUT PARAMETERS: =================================================== |
69 |
#ifndef USE_ATMOSCO2 |
#ifndef USE_ATMOSCO2 |
70 |
|
|
71 |
IF ( nThreads .GT. 1 .AND. |
IF ( nThreads .GT. 1 .AND. |
72 |
& ( gchem_int1.EQ.2 .OR. gchem_int1.EQ.3 ) ) THEN |
& ( dic_int1.EQ.2 .OR. dic_int1.EQ.3 ) ) THEN |
73 |
C Problem with I/O and global-sum for multi-threaded execution |
C Problem with I/O and global-sum for multi-threaded execution |
74 |
C Needs to be fixed before using this S/R in multi-threaded run |
C Needs to be fixed before using this S/R in multi-threaded run |
75 |
STOP 'S/R DIC_ATMOS: multi-threaded not right' |
STOP 'S/R DIC_ATMOS: multi-threaded not right' |
76 |
ENDIF |
ENDIF |
77 |
|
|
78 |
c default - set only once |
c default - set only once |
79 |
if (gchem_int1.eq.0.and.istate.eq.0) then |
if (dic_int1.eq.0.and.istate.eq.0) then |
80 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
81 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
82 |
|
|
91 |
endif |
endif |
92 |
|
|
93 |
c user specified value - set only once |
c user specified value - set only once |
94 |
if (gchem_int1.eq.1.and.istate.eq.0) then |
if (dic_int1.eq.1.and.istate.eq.0) then |
95 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
96 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
97 |
|
|
98 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
99 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
100 |
AtmospCO2(i,j,bi,bj)=gchem_rl1 |
AtmospCO2(i,j,bi,bj)=dic_pCO2 |
101 |
ENDDO |
ENDDO |
102 |
ENDDO |
ENDDO |
103 |
|
|
106 |
endif |
endif |
107 |
|
|
108 |
c read from a file (note: |
c read from a file (note: |
109 |
c gchem_int2=number entries to read |
c dic_int2=number entries to read |
110 |
c gchem_int3=start timestep, |
c dic_int3=start timestep, |
111 |
c gchem_int4=timestep between file entries) |
c dic_int4=timestep between file entries) |
112 |
if (gchem_int1.eq.2) then |
if (dic_int1.eq.2) then |
113 |
if (istate.eq.0) then |
if (istate.eq.0) then |
114 |
OPEN(28,FILE='co2atmos.dat',STATUS='old') |
OPEN(28,FILE='co2atmos.dat',STATUS='old') |
115 |
do it=1,gchem_int2 |
do it=1,dic_int2 |
116 |
READ(28,*) co2atmos(it) |
READ(28,*) co2atmos(it) |
117 |
print*,'co2atmos',co2atmos(it) |
print*,'co2atmos',co2atmos(it) |
118 |
enddo |
enddo |
119 |
endif |
endif |
120 |
c linearly interpolate between file entries |
c linearly interpolate between file entries |
121 |
ntim=int((myIter-gchem_int3)/gchem_int4)+1 |
ntim=int((myIter-dic_int3)/dic_int4)+1 |
122 |
aWght = FLOAT(myIter-gchem_int3) |
aWght = FLOAT(myIter-dic_int3) |
123 |
bWght = FLOAT(gchem_int4) |
bWght = FLOAT(dic_int4) |
124 |
aWght = 0.5 _d 0 + aWght/bWght - FLOAT(ntim-1) |
aWght = 0.5 _d 0 + aWght/bWght - FLOAT(ntim-1) |
125 |
if (aWght.gt.1. _d 0) then |
if (aWght.gt.1. _d 0) then |
126 |
ntim=ntim+1 |
ntim=ntim+1 |
150 |
|
|
151 |
|
|
152 |
c interactive atmosphere |
c interactive atmosphere |
153 |
if (gchem_int1.eq.3) then |
if (dic_int1.eq.3) then |
154 |
|
|
155 |
c _BEGIN_MASTER(myThid) |
c _BEGIN_MASTER(myThid) |
156 |
|
|