/[MITgcm]/MITgcm_contrib/jscott/igsm/src_chem/chemcheck.F
ViewVC logotype

Annotation of /MITgcm_contrib/jscott/igsm/src_chem/chemcheck.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Thu Sep 17 17:40:32 2009 UTC (15 years, 10 months ago) by jscott
Branch: MAIN
CVS Tags: HEAD
chem module archive

1 jscott 1.1
2     #include "ctrparam.h"
3    
4     ! ============================================================
5     !
6     ! CHEMCHECK.F: Subroutine for checking negative values and
7     ! forcing them to be passitive ones
8     ! of MIT Global Chemistry Model
9     !
10     ! ------------------------------------------------------------
11     !
12     ! Author: Chien Wang
13     ! MIT Joint Program on Science and Policy
14     ! of Global Change
15     !
16     ! ----------------------------------------------------------
17     !
18     ! Revision History:
19     !
20     ! When Who What
21     ! ---- ---------- -------
22     ! 081795 Chien Wang rev.
23     ! 080100 Chien Wang repack based on CliChem3 & add cpp
24     ! 051804 Chien Wang rev.
25     !
26     ! ==========================================================
27    
28     Subroutine chemcheck(x00,x11,dta)
29    
30     #include "chem_para"
31     #include "BD2G04.COM"
32    
33     dimension x00 (nlon,nlat,nlev)
34    
35     ! ----------------------------------------------------------
36     #if ( defined CPL_CHEM )
37    
38     c ===
39     c === 081295: check for negative values:
40     c ===
41    
42     oneover3 = 1./3.
43    
44     do i=1,nlon
45     do j=1,nlat
46    
47     if(x00(i,j,1).lt.0.0) then
48     xmean = max(0.0,
49     & (x00(i,j,1) + x00(i,j,2))*0.5 )
50     x00(i,j,1) = xmean
51     x00(i,j,2) = xmean
52     endif
53    
54     do k =2,nlev1
55     if(x00(i,j,k).lt.0.0)then
56     xmeanv = max(0.0,
57     & (x00(i,j,k)
58     & + x00(i,j,k-1) + x00(i,j,k+1))*oneover3 )
59     x00(i,j,k-1) = xmeanv
60     x00(i,j,k) = xmeanv
61     x00(i,j,k+1) = xmeanv
62     endif
63     end do
64    
65     if(x00(i,j,nlev).lt.0.0) then
66     xmean = max(0.0,
67     & (x00(i,j,nlev)
68     & + x00(i,j,nlev1))*0.5 )
69     x00(i,j,nlev) = xmean
70     x00(i,j,nlev1) = xmean
71     endif
72    
73     end do
74     end do
75    
76     #endif
77    
78     return
79     end
80    

  ViewVC Help
Powered by ViewVC 1.1.22