source: trunk/LMDZ.TITAN.old/libf/phytitan/gasses.F @ 3094

Last change on this file since 3094 was 1461, checked in by emillour, 10 years ago

Titan GCM:
Turned the common block "tgmdat.F" into a module "tgmdat_mod.F90".
This fixes issues in "debug" mode with common variables which seemed to not be correctly shared between routines.
EM

File size: 1.9 KB
Line 
1      SUBROUTINE GASSES(IPRINT)
2C THIS SUBROUTINE SETS UP THE MASS MIXING RATIOS OF THE
3C OPTICALLY ACTIVE GASES: CH4, C2H2, AND C2H6
4      USE TGMDAT_MOD, ONLY: RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,
5     &                      RCLOUD,FARGON
6      USE TGMDAT_MOD, ONLY: RGAS,RHOP,PI,SIGMA
7      include "dimensions.h"
8      PARAMETER(NLAYER=llm,NLEVEL=NLAYER+1)
9      COMMON /ATM/ Z(NLEVEL),PRESS(NLEVEL),DEN(NLEVEL),TEMP(NLEVEL)
10      COMMON /GASS/ CH4(NLEVEL),XN2(NLEVEL),H2(NLEVEL),AR(NLEVEL)
11     & ,XMU(NLEVEL),GAS1(NLAYER),COLDEN(NLAYER)
12      COMMON /STRATO/ C2H2(NLAYER),C2H6(NLAYER)
13C*
14C NOW CALCULATE THE LAYER AVERAGE GAS MIXING RATIOS.
15C OF THE ABSORBING GAS IN UNITS OF GRAMS PER GRAM
16C AND THE TOTAL LAYER COLUMN MASS GRAMS CM-2.
17      DO 159 J=1,NLAYER
18      EMU=(XMU(J+1)+XMU(J))*0.5
19c attention ici, Z en km doit etre passe en m
20      COLDEN(J)=RHOP*(PRESS(J+1)-PRESS(J))/EFFG(Z(J)*1000.)
21      GAS1(J)=(16./EMU)*AVERGE(CH4(J+1),CH4(J))
22159   CONTINUE
23C WE NOW ALSO CALCULTE THE MASS MIXING RATIOS OF THE
24C STRATOSPHERIC GASES USED IN THE IR WITHIN EACH LAYER.
25      J=1
26      FC2H2=1.8E-6 ! NEW FROM ATHENA OLD= 2.E-6
27      FC2H6=1.2E-5 ! NEW FORM ATHENA OLD= 2.E-5
28      C2H2(J) = MIN(FC2H2,PC2H2(TEMP(J))/PRESS(J))
29      C2H6(J) = MIN(FC2H6,PC2H6(TEMP(J))/PRESS(J))
30      DO 101 J=2,NLAYER
31      C2H2(J) = MIN(FC2H2,PC2H2(TEMP(J))/PRESS(J),C2H2(J-1))
32      C2H6(J) = MIN(FC2H6,PC2H6(TEMP(J))/PRESS(J),C2H6(J-1))
33101   CONTINUE
34C NOW CONVERT TO MASS MIXING RATIO
35      DO 102 J=1,NLAYER
36      EMU=(XMU(J+1)+XMU(J))*0.5
37      C2H2(J)=C2H2(J)*26.0/EMU
38      C2H6(J)=C2H6(J)*30.0/EMU
39102   CONTINUE
40C
41      IF (IPRINT .LT. 1) RETURN
42      WRITE (6,9)
43  9   FORMAT(///' ALT   CH4      C2H2        C2H6: MASS MIXING RATIOS')
44      DO 103 J=1,NLAYER
45      WRITE (6,*)Z(J),GAS1(J),C2H2(J),C2H6(J)
46c     WRITE (6,10)Z(J),GAS1(J),C2H2(J),C2H6(J)
47103   CONTINUE
48 10   FORMAT(1X,F6.2,1P3E9.1)
49      RETURN
50      END
Note: See TracBrowser for help on using the repository browser.