/[MITgcm]/MITgcm/pkg/fizhi/update_chemistry_exports.F
ViewVC logotype

Diff of /MITgcm/pkg/fizhi/update_chemistry_exports.F

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

revision 1.9 by molod, Mon Jul 26 18:45:17 2004 UTC revision 1.14 by jmc, Tue Mar 16 00:19:33 2010 UTC
# Line 5  C $Name$ Line 5  C $Name$
5         subroutine update_chemistry_exports (myTime, myIter, myThid)         subroutine update_chemistry_exports (myTime, myIter, myThid)
6  c----------------------------------------------------------------------  c----------------------------------------------------------------------
7  c  Subroutine update_chemistry_exports - 'Wrapper' routine to update  c  Subroutine update_chemistry_exports - 'Wrapper' routine to update
8  c        the fields related to the earth's chemistry that are needed  c        the fields related to the earth chemistry that are needed
9  c        by fizhi.  c        by fizhi.
10  c        Also: Set up "bi, bj loop" and some timers and clocks here.  c        Also: Set up "bi, bj loop" and some timers and clocks here.
11  c  c
# Line 23  c--------------------------------------- Line 23  c---------------------------------------
23  #include "EEPARAMS.h"  #include "EEPARAMS.h"
24  #include "chronos.h"  #include "chronos.h"
25    
26        integer myTime, myIter, myThid        integer myIter, myThid
27          _RL myTime
28    
29  c pe on physics grid refers to bottom edge  c pe on physics grid refers to bottom edge
30        _RL pephy(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nrphys+1,nSx,nSy)        _RL pephy(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nrphys+1,nSx,nSy)
# Line 32  c pe on physics grid refers to bottom ed Line 33  c pe on physics grid refers to bottom ed
33        _RL waterin(sNx,sNy,Nrphys), xlat(sNx,sNy)        _RL waterin(sNx,sNy,Nrphys), xlat(sNx,sNy)
34    
35        integer i, j, L, LL, bi, bj        integer i, j, L, LL, bi, bj
36        integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2        integer im1, im2, jm1, jm2
37        integer nhms1,nymd1,nhms2,nymd2,imns,ipls        integer nhms1,nymd1,nhms2,nymd2,imns,ipls
38        _RL facm, facp        _RL facm, facp
39        logical alarm        logical alarm
40        external alarm        external alarm
41    
42        im1 = 1-OLx        im1 = 1
43        im2 = sNx+OLx        im2 = sNx
44        jm1 = 1-OLy        jm1 = 1
45        jm2 = sNy+OLy        jm2 = sNy
       idim1 = 1  
       idim2 = sNx  
       jdim1 = 1  
       jdim2 = sNy  
46    
47        if( alarm('radsw').or.alarm('radlw') ) then        if( alarm('radsw').or.alarm('radlw') ) then
48    
# Line 66  c Line 63  c
63          do j = 1,sNy          do j = 1,sNy
64          do i = 1,sNx          do i = 1,sNx
65           do L = 1,Nrphys           do L = 1,Nrphys
66            pphy(i,j,L,bi,bj)=(pephy(i,j,L+1,bi,bj)+pephy(i,j,L,bi,bj))/2.            pphy(i,j,L,bi,bj)=(pephy(i,j,L+1,bi,bj)+pephy(i,j,L,bi,bj))
67         .                                              /200.
68           enddo           enddo
69          enddo          enddo
70          enddo          enddo
# Line 88  c Line 86  c
86           oz1(j,L) = ozone(j,L,imns)*facm + ozone(j,L,ipls)*facp           oz1(j,L) = ozone(j,L,imns)*facm + ozone(j,L,ipls)*facp
87          enddo          enddo
88          enddo          enddo
89                                                                                
90          do L = 1,nlevsq          do L = 1,nlevsq
91          do j = 1,nlatsq          do j = 1,nlatsq
92           strq1(j,L) = stratq(j,L,imns)*facm + stratq(j,L,ipls)*facp           strq1(j,L) = stratq(j,L,imns)*facm + stratq(j,L,ipls)*facp
# Line 96  c Line 94  c
94          enddo          enddo
95    
96          call interp_chemistry(strq1,nlevsq,nlatsq,levsq,latsq,          call interp_chemistry(strq1,nlevsq,nlatsq,levsq,latsq,
97       .   oz1,nlevsoz,nlatsoz,levsoz,latsoz,waterin,pphy,xlat,       .   oz1,nlevsoz,nlatsoz,levsoz,latsoz,
98         .   waterin,pphy(1,1,1,bi,bj),xlat,
99       .   im2,jm2,Nrphys,nSx,nSy,bi,bj,o3,qstr)       .   im2,jm2,Nrphys,nSx,nSy,bi,bj,o3,qstr)
100    
101         enddo         enddo
# Line 130  C ****           Get Ozone and Stratosph Line 129  C ****           Get Ozone and Stratosph
129  C **********************************************************************  C **********************************************************************
130    
131        call interp_qz (stratq,nwatlevs,nwatlats,watlevs,watlats,im*jm,        call interp_qz (stratq,nwatlevs,nwatlats,watlevs,watlats,im*jm,
132       .                                xlat,lm,plz,qz,qzrad(1,1,1,bi,bj))       .                         bi,bj, xlat,lm,plz,qz,qzrad(1,1,1,bi,bj))
133        call interp_oz (ozone ,nozlevs,nozlats,ozlevs,ozlats,im*jm,        call interp_oz (ozone ,nozlevs,nozlats,ozlevs,ozlats,im*jm,
134       .                                xlat,lm,plz,ozrad(1,1,1,bi,bj))       .                         bi,bj, xlat,lm,plz,ozrad(1,1,1,bi,bj))
135    
136        return        return
137        end        end
138    
139        subroutine interp_qz(stratq,nwatlevs,nwatlats,watlevs,watlats,        subroutine interp_qz(stratq,nwatlevs,nwatlats,watlevs,watlats,
140       .                               irun,xlat,nlevs,pres,qz_in,qz_out )       .                         irun,bi,bj,xlat,nlevs,pres,qz_in,qz_out )
141  C***********************************************************************  C***********************************************************************
142  C  Purpose  C  Purpose
143  C     To Interpolate Chemistry Moisture from Chemistry Grid to Physics Grid  C     To Interpolate Chemistry Moisture from Chemistry Grid to Physics Grid
# Line 149  C     xlat ...... Latitude in Degrees Line 149  C     xlat ...... Latitude in Degrees
149  C     nlevs ..... Vertical   Dimension  C     nlevs ..... Vertical   Dimension
150  C     pres ...... PRES (IM,JM,nlevs) Three-dimensional array of pressures  C     pres ...... PRES (IM,JM,nlevs) Three-dimensional array of pressures
151  C     qz_in ..... Model Moisture (kg/kg mass mixing radtio)  C     qz_in ..... Model Moisture (kg/kg mass mixing radtio)
152  C     qz_out .... Combination of Chemistry Moisture and Model Moisture  C     qz_out .... Combination of Chemistry Moisture and Model Moisture
153  C                 (kg/kg mass mixing ratio)  C                 (kg/kg mass mixing ratio)
154  C  C
155  C***********************************************************************  C***********************************************************************
156    
157        implicit none        implicit none
158        integer nwatlevs,nwatlats        integer nwatlevs,nwatlats
159          integer bi,bj
160        _RL stratq ( nwatlats,nwatlevs )        _RL stratq ( nwatlats,nwatlevs )
161        _RL watlats (nwatlats)        _RL watlats (nwatlats)
162        _RL watlevs (nwatlevs)        _RL watlevs (nwatlevs)
# Line 185  c --------------- Line 186  c ---------------
186  C **********************************************************************  C **********************************************************************
187  C ****         Interpolate Moisture data to model latitudes          ***  C ****         Interpolate Moisture data to model latitudes          ***
188  C **********************************************************************  C **********************************************************************
189    
190        DO 32 k = 1, nwatlevs        DO 32 k = 1, nwatlevs
191          DO 34   i = 1,irun          DO 34   i = 1,irun
192    
# Line 221  C ************************************** Line 222  C **************************************
222  C **********************************************************************  C **********************************************************************
223  C ****     Interpolate Latitude Moisture data to model pressures     ***  C ****     Interpolate Latitude Moisture data to model pressures     ***
224  C **********************************************************************  C **********************************************************************
225    
226        DO 40 L2 = 1,nlevs        DO 40 L2 = 1,nlevs
227    
228          DO 44 i= 1, irun          DO 44 i= 1, irun
# Line 275  c Line 276  c
276        end        end
277    
278        subroutine interp_oz (ozone,nozlevs,nozlats,ozlevs,ozlats,        subroutine interp_oz (ozone,nozlevs,nozlats,ozlevs,ozlats,
279       .                                      irun,xlat,nlevs,plevs,ozrad)       .                            irun,bi,bj,xlat,nlevs,plevs,ozrad)
280  C***********************************************************************  C***********************************************************************
281  C  Purpose  C  Purpose
282  C     To Interpolate Chemistry Ozone from Chemistry Grid to Physics Grid  C     To Interpolate Chemistry Ozone from Chemistry Grid to Physics Grid
# Line 292  C Line 293  C
293  C***********************************************************************  C***********************************************************************
294        implicit none        implicit none
295        integer nozlevs,nozlats,irun,nlevs        integer nozlevs,nozlats,irun,nlevs
296          integer bi,bj
297        _RL ozone(nozlats,nozlevs)        _RL ozone(nozlats,nozlevs)
298        _RL xlat(irun)        _RL xlat(irun)
299        _RL plevs(irun,nlevs)        _RL plevs(irun,nlevs)
# Line 392  C ************************************** Line 394  C **************************************
394  C ****     CONVERT FROM VOLUME MIXING RATIO TO MASS MIXING RATIO     ***  C ****     CONVERT FROM VOLUME MIXING RATIO TO MASS MIXING RATIO     ***
395  C **********************************************************************  C **********************************************************************
396    
397        DO 60 I=1,IRUN*NLEVS        DO 60 L2=1,NLEVS
398        ozrad (I,1) = ozrad(I,1) * VOLTOMAS        DO 60 I=1,IRUN
399    c     DO 60 I=1,IRUN*NLEVS
400    c     ozrad (I,1) = ozrad(I,1) * VOLTOMAS
401          ozrad (I,L2) = ozrad(I,L2) * VOLTOMAS
402    60  CONTINUE    60  CONTINUE
403    
404        RETURN        RETURN

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.22