Ignore:
Timestamp:
Jun 23, 2015, 10:34:03 AM (9 years ago)
Author:
emillour
Message:

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

Location:
trunk/LMDZ.TITAN/libf/phytitan
Files:
15 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/libf/phytitan/cld.F

    r495 r1461  
    33C THIS ROUTINE SETS UP THE CLOUD DISTRIBUTION
    44C
     5      USE TGMDAT_MOD, ONLY: RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,
     6     &                      RCLOUD,FARGON
     7      USE TGMDAT_MOD, ONLY: PI
    58#include "dimensions.h"
    69      PARAMETER(NLAYER=llm,NLEVEL=NLAYER+1)
     
    1114      COMMON /CLOUD/ RADCLD(NLAYER), XNCLD(NLAYER)
    1215     & , RCLDI(NSPECI), XICLDI(NSPECI), RCLDV(NSPECV), XICLDV(NSPECV)
    13       COMMON /PLANT/ CSUBP,F0PI
    14       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    15       COMMON /CONST/RGAS,RHOP,PI,SIGMA
    1616      TOTALC=0.0
    1717CCC
  • trunk/LMDZ.TITAN/libf/phytitan/cooling.F

    r1356 r1461  
    5656
    5757      use dimphy
     58      use tgmdat_mod, only: CSUBP,F0PI
    5859      IMPLICIT NONE
    5960#include "dimensions.h"
     
    8586      REAL dtauip(ngrid,NLAYER,NSPECI)
    8687      COMMON /IRTAUS/ dtaui,dtauip
    87 
    88       COMMON /PLANT/ CSUBP,F0PI
    89       REAL CSUBP,F0PI
    9088
    9189c   Local:
  • trunk/LMDZ.TITAN/libf/phytitan/gasses.F

    r1072 r1461  
    22C THIS SUBROUTINE SETS UP THE MASS MIXING RATIOS OF THE
    33C OPTICALLY ACTIVE GASES: CH4, C2H2, AND C2H6
    4 #include "dimensions.h"
     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"
    58      PARAMETER(NLAYER=llm,NLEVEL=NLAYER+1)
    69      COMMON /ATM/ Z(NLEVEL),PRESS(NLEVEL),DEN(NLEVEL),TEMP(NLEVEL)
     
    811     & ,XMU(NLEVEL),GAS1(NLAYER),COLDEN(NLAYER)
    912      COMMON /STRATO/ C2H2(NLAYER),C2H6(NLAYER)
    10       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    11       COMMON /CONST/RGAS,RHOP,PI,SIGMA
    1213C*
    1314C NOW CALCULATE THE LAYER AVERAGE GAS MIXING RATIOS.
  • trunk/LMDZ.TITAN/libf/phytitan/gfluxv.F

    r3 r1461  
    22     &          , F0PI,RSF,BTOP,BSURF,FP,FM,FMIDP,FMIDM,IPRINT)
    33c      PARAMETER (NL=101)
     4        USE TGMDAT_MOD, ONLY: UBARI,UBARV,UBAR0
    45        IMPLICIT NONE
    56      INTEGER IPRINT,I,J,K,IDELTA,NAYER,NL,NTODO
     
    1718C J.A.S., 37, 630-642, 1980.
    1819      REAL B81,B82,R81
    19       REAL AP,AM,F0PI,DENOM,UBARI,UBARV,UBAR0,CMMID,TAUMID,RSF,BTOP
     20      REAL AP,AM,F0PI,DENOM,CMMID,TAUMID,RSF,BTOP
    2021      REAL EM,EP,PI,WAVEN,CPMID,BSURF,G4
    21       COMMON /UBARED/ UBARI,UBARV,UBAR0
    2222C THIS NEXT ROW OF VARIABLES ARE THOSE ACTUALLY USED IN THE
    2323C ROUTINE
  • trunk/LMDZ.TITAN/libf/phytitan/heating.F

    r1356 r1461  
    3333
    3434      use dimphy
     35      use TGMDAT_MOD, ONLY: UBARI,UBARV,UBAR0
     36      use TGMDAT_MOD, ONLY: CSUBP,F0PI
    3537      IMPLICIT NONE
    36 #include "dimensions.h"
     38      include "dimensions.h"
    3739
    3840      INTEGER NLEVEL,NLAYER,NSPECV
     
    6466c   ---------------------------------------------
    6567
    66       REAL UBARI,UBARV,UBAR0
    6768      REAL  CH4(NLEVEL),XN2(NLEVEL),H2(NLEVEL),AR(NLEVEL)
    6869      REAL  XMU(NLEVEL),GAS1(NLAYER),COLDEN(NLAYER)
    6970      REAL FNETV(ngrid,NLEVEL),FUPV(ngrid,NLEVEL,NSPECV) 
    7071      REAL FDV(ngrid,NLEVEL,NSPECV),FMNETV(ngrid,NLEVEL)
    71       REAL CSUBP,F0PI
    72 
    73       COMMON /UBARED/ UBARI,UBARV,UBAR0
    7472
    7573      COMMON /GASS/ CH4,XN2
     
    8280     &               FDV,
    8381     &               FMNETV
    84 
    85       COMMON /PLANT/ CSUBP,F0PI
    8682
    8783
  • trunk/LMDZ.TITAN/libf/phytitan/optci.F

    r1126 r1461  
    33      use infotrac
    44      use common_mod, only:rmcbar,xfbar,ncount,TauHID,TauCID,TauGID
     5      USE TGMDAT_MOD, ONLY: RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,
     6     &                      RCLOUD,FARGON
    57#include "dimensions.h"
    68#include "microtab.h"
     
    5961      COMMON /IRTAUS/ DTAUP,DTAUPP
    6062
    61       COMMON /PLANT/ CSUBP,F0PI
    62       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    63       COMMON /CONST/RGAS,RHOP,PI,SIGMA
    6463      COMMON /part/v,rayon,vrat,dr,dv
    6564
  • trunk/LMDZ.TITAN/libf/phytitan/optci_1pt.F

    r808 r1461  
    11      SUBROUTINE optci_1pt(zqaer_1pt,rcdb,xfrb,iopti,IPRINT)
    22      use dimphy
     3      USE TGMDAT_MOD, ONLY: RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,
     4     &                      RCLOUD,FARGON
     5      USE TGMDAT_MOD, ONLY: RGAS
    36#include "dimensions.h"
    47#include "microtab.h"
     
    3841     &                DWNI(NSPECI), WLNI(NSPECI)
    3942
    40       COMMON /PLANT/ CSUBP,F0PI
    41       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    42       COMMON /CONST/RGAS,RHOP,PI,SIGMA
    4343      COMMON /part/v,rayon,vrat,dr,dv
    4444
  • trunk/LMDZ.TITAN/libf/phytitan/optci_1pt_2.F

    r808 r1461  
    22
    33      use dimphy
     4      USE TGMDAT_MOD, ONLY: RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,
     5     &                      RCLOUD,FARGON
     6      USE TGMDAT_MOD, ONLY: RGAS
    47#include "dimensions.h"
    58#include "microtab.h"
     
    3942     &                DWNI(NSPECI), WLNI(NSPECI)
    4043
    41       COMMON /PLANT/ CSUBP,F0PI
    42       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    43       COMMON /CONST/RGAS,RHOP,PI,SIGMA
    4444      COMMON /part/v,rayon,vrat,dr,dv
    4545
  • trunk/LMDZ.TITAN/libf/phytitan/optci_1pt_3.F

    r1126 r1461  
    11      SUBROUTINE optci_1pt3(zqaer_1pt,rcdb,xfrb,iopti,IPRINT)
    22      use dimphy
     3      USE TGMDAT_MOD, ONLY: RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,
     4     &                      RCLOUD,FARGON
     5      USE TGMDAT_MOD, ONLY: RGAS
    36      IMPLICIT NONE
    47#include "dimensions.h"
     
    912      integer nlayer, nlevel, nspeci, nspc1i, nspecv, nspc1v
    1013      real z,press, den, temp, ch4, xn2, h2, ar, xmu, gas1,
    11      &     colden, c2h2, c2h6, hcn, radius, xnumb, reali
     14     &     colden, c2h2, c2h6, hcn, radius, xnumb,
    1215     &     ximgi, realv, ximgv, rcldi, xicldi, rcldv, xicldv, rcldi2,
    13      &     xicldi2, rcldv2, xicldv2,real bwni, wnoi, dwni, wlni, csubp,
    14      &     f0pi, rhch4, fh2, fhaze, fhvis
    15      &     reali, ximgi, bwni, fhir, taufac, rcloud, fargon, rgas, rhop,
    16      &     pi, sigma, prod,reali,fhvis
     16     &     xicldi2, rcldv2, xicldv2
     17      real bwni, wnoi, dwni, wlni,   
     18     &     prod,reali
    1719
    1820      integer k, j,inq,kgas
     
    5557     &                DWNI(NSPECI), WLNI(NSPECI)
    5658
    57       COMMON /PLANT/ CSUBP,F0PI
    58       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    59       COMMON /CONST/RGAS,RHOP,PI,SIGMA
    6059      COMMON /part/v,rayon,vrat,dr,dv
    6160
  • trunk/LMDZ.TITAN/libf/phytitan/optcv.F

    r1126 r1461  
    44      use infotrac
    55      use common_mod, only:rmcbar,xfbar,ncount,TauHVD,TauCVD,TauGVD
     6      USE TGMDAT_MOD, ONLY: RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,
     7     &                      RCLOUD,FARGON
    68#include "dimensions.h"
    79#include "microtab.h"
     
    5557     &               ,DWNV(NSPECV),WLNV(NSPECV)
    5658
    57       COMMON /PLANT/ CSUBP,F0PI
    58       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    59       COMMON /CONST/ RGAS,RHOP,PI,SIGMA
    6059      COMMON /part/ v(nrad),rayon(nrad),vrat,dr(nrad),dv(nrad)
    6160
  • trunk/LMDZ.TITAN/libf/phytitan/optcv_1pt.F

    r495 r1461  
    3939     &               ,DWNV(NSPECV),WLNV(NSPECV)
    4040
    41       COMMON /PLANT/ CSUBP,F0PI
    42       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    43       COMMON /CONST/ RGAS,RHOP,PI,SIGMA
    4441* nrad dans microtab.h
    4542      COMMON /part/ v(nrad),rayon(nrad),vrat,dr(nrad),dv(nrad)
  • trunk/LMDZ.TITAN/libf/phytitan/optcv_1pt_2.F

    r495 r1461  
    22
    33      use dimphy
     4      USE TGMDAT_MOD, ONLY: RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,
     5     &                      RCLOUD,FARGON
    46#include "dimensions.h"
    57#include "microtab.h"
     
    3840     &               ,DWNV(NSPECV),WLNV(NSPECV)
    3941
    40       COMMON /PLANT/ CSUBP,F0PI
    41       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    42       COMMON /CONST/ RGAS,RHOP,PI,SIGMA
    4342* nrad dans microtab.h
    4443      COMMON /part/ v(nrad),rayon(nrad),vrat,dr(nrad),dv(nrad)
  • trunk/LMDZ.TITAN/libf/phytitan/optcv_1pt_3.F

    r1126 r1461  
    22
    33      use dimphy
     4      USE TGMDAT_MOD, ONLY: RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,
     5     &                      RCLOUD,FARGON
    46      IMPLICIT NONE
    57#include "dimensions.h"
     
    911      integer nlayer, nlevel, nspeci, nspc1i, nspecv, nspc1v,nterm
    1012      real z,press, den, temp, ch4, xn2, h2, ar, xmu, gas1,
    11      &     colden, c2h2, c2h6, hcn, radius, xnumb, reali
     13     &     colden, c2h2, c2h6, hcn, radius, xnumb, reali,
    1214     &     ximgi, realv, ximgv, rcldi, xicldi, rcldv, xicldv, rcldi2,
    13      &     xicldi2, rcldv2, xicldv2,real bwni, wnoi, dwni, wlni, csubp,
    14      &     f0pi, rhch4, fh2, fhaze, fhvis
    15      &     reali, ximgi, bwni, fhir, taufac, rcloud, fargon, rgas, rhop,
    16      &     pi, sigma, prod,reali,fhvis
     15     &     xicldi2, rcldv2, xicldv2
     16      real bwni, wnoi, dwni, wlni,prod
    1717
    1818      integer k, j,inq,nt
     
    5858     &               ,DWNV(NSPECV),WLNV(NSPECV)
    5959
    60       COMMON /PLANT/ CSUBP,F0PI
    61       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    62       COMMON /CONST/ RGAS,RHOP,PI,SIGMA
    6360* nrad dans microtab.h
    6461      COMMON /part/ v(nrad),rayon(nrad),vrat,dr(nrad),dv(nrad)
  • trunk/LMDZ.TITAN/libf/phytitan/radtitan.F

    r1058 r1461  
    3636      USE optcld, only : iniqcld
    3737      use moyzon_mod, only:plevmoy
     38      USE TGMDAT_MOD, ONLY: RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,
     39     &                      RCLOUD,FARGON
     40      USE TGMDAT_MOD, ONLY: RHOP
    3841      IMPLICIT NONE
    3942#include "dimensions.h"
     
    8891      REAL  XMU(NLEVEL),GAS1(NLAYER),COLDEN(NLAYER)
    8992      REAL  C2H2(NLAYER),C2H6(NLAYER),HCN(NLAYER)
    90       REAL  RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    91       REAL RGAS,RHOP,PI,SIGMA
    9293
    9394      COMMON /VERTICAL/ DZED
     
    104105      COMMON /STRATO/ C2H2,C2H6
    105106      COMMON /STRAT2/ HCN
    106 
    107       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    108       COMMON /CONST/RGAS,RHOP,PI,SIGMA
    109107
    110108c-----------------------------------------------------------------------
     
    179177C    NOW CALCULATE THE LAYER AVERAGE GAS MIXING RATIOS.
    180178          CALL GASSES(IPRINT)
    181          
     179
    182180      else
    183181c------------------------------------------------------
  • trunk/LMDZ.TITAN/libf/phytitan/sfluxv.F

    r495 r1461  
    22
    33      use dimphy
     4      USE TGMDAT_MOD, ONLY: UBARI,UBARV,UBAR0
     5      USE TGMDAT_MOD, ONLY: F0PI
    46      IMPLICIT NONE
    57#include "dimensions.h"
     
    3840     &      FMNETV(ngrid,NLEVEL),
    3941     &      FMUPV(NLEVEL),FMDV(NLEVEL)
    40       REAL CSUBP,F0PI
    41       REAL UBARI,UBARV,UBAR0
    4242
    4343      COMMON /VISGAS/SOLARF,NTERM,PEXPON,
     
    6060     &               FDV,
    6161     &               FMNETV
    62 
    63       COMMON /PLANT/ CSUBP,F0PI
    64       COMMON /UBARED/ UBARI,UBARV,UBAR0
    6562
    6663
  • trunk/LMDZ.TITAN/libf/phytitan/tgmdat_mod.F90

    r1451 r1461  
    1       BLOCK DATA  TGMDAT
    2 #include "dimensions.h"
    3       PARAMETER(NLAYER=llm,NLEVEL=NLAYER+1)
    4       COMMON /UBARED/ UBARI,UBARV,UBAR0
    5       COMMON /LAPSE/ DTDP(NLAYER),CONVEQ
    6       COMMON /PLANT/ CSUBP,F0PI
    7       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
    8       COMMON /CONST/RGAS,RHOP,PI,SIGMA
    9 C
    10       DATA PI/3.14159265358979323846/
    11 C RGAS IS THE UNIVERSAL GAS CONSTANT IN UNITS OF: M SEC-2 AMU K-1 KM
    12       DATA RGAS/8.31432/
    13 C SIGMA IS THE STEFAN-BOLTZMAN CONSTATNT IN CGS UNITS
    14       DATA SIGMA/5.6677E-5/
    15 C
    16 C RT CONSTANTS
    17       DATA UBARI,UBARV,UBAR0/0.5,0.5,0.5/
    18 C PLANET SPECIFIC CONSTANTS
    19 C
    20 C CONVEQ IS THE DRY N2 ADIABATE DLNT/DLNP
    21       DATA CONVEQ/0.2994/
    22 C CSUBP IS THE SPECIFIC HEAT AT CONSTANT P OF THE ATMOSPHERE
    23 C IN UNITS OF ERGS K-1 G-1
    24       DATA CSUBP/1.039E7/
    25 C RHOP IS THE UNITS CONVERSION FROM TO GET MASS UNITS (G CM-2)
    26 C FROM PRESSURE (BARS)  DEVIDED BY GRAVITY (M SEC-2)
    27 C IS EQUAL TO ONE  GM CM-2  BARS-1  M SEC-2
    28 C IF ONE WHATS TO CHANGE UNITS ON PRESSURE THIS
    29 C CONSTANT MUST BE CHANGED
    30       DATA RHOP/1.E4/
    31 C FOPI IS THE ACTUAL SOLAR FLUX IN ERGS/CM2
    32       DATA F0PI/1.5E4/
    33 C RHCH4 IS THE METHANE RH AT THE SURFACE
    34       DATA RHCH4 /0.60/   !! .65
    35 C FH2 IS THE CONSTANT MIXING RATIO OF H2
    36       DATA FH2/0.04/   !!  0.003
    37 C FHAZE IS THE HAZE PRODUCTION SCALING FACTOR
    38       DATA FHAZE/0.35/
    39 C FHIR IS THE HAZE INFRARED ABSORPTION SCALE FACTOR
    40       DATA FHIR/0.7/     ! anciennement 0.5
    41 C FHVIS IS THE HAZE INFRARED ABSORPTION SCALE FACTOR
    42       DATA FHVIS/1.1/              !!!!  1.333333333/
    43 C TAUFAC IS THE 200 CM-1 SCALING FACTOR
    44       DATA TAUFAC/2.00/
    45 C RCLOUD IS THE PARTICLE SIZE IN THE CLOUD IN MICRONS
    46       DATA RCLOUD/60./     !! 100
     1MODULE  TGMDAT_MOD
     2      IMPLICIT NONE
     3      include "dimensions.h"
    474
    48       data FARGON/0./
    49       END
     5      INTEGER,PARAMETER :: NLAYER=llm,NLEVEL=NLAYER+1
     6      REAL,SAVE :: PI=3.14159265358979323846
     7! RGAS IS THE UNIVERSAL GAS CONSTANT IN UNITS OF: M SEC-2 AMU K-1 KM
     8      REAL,SAVE :: RGAS=8.31432
     9! SIGMA IS THE STEFAN-BOLTZMAN CONSTATNT IN CGS UNITS
     10      REAL,SAVE :: SIGMA=5.6677E-5
     11!
     12! RT CONSTANTS
     13      REAL,SAVE :: UBARI=0.5,UBARV=0.5,UBAR0=0.5
     14! PLANET SPECIFIC CONSTANTS
     15!
     16! CONVEQ IS THE DRY N2 ADIABATE DLNT/DLNP
     17      REAL,SAVE :: CONVEQ=0.2994
     18! CSUBP IS THE SPECIFIC HEAT AT CONSTANT P OF THE ATMOSPHERE
     19! IN UNITS OF ERGS K-1 G-1
     20      REAL,SAVE :: CSUBP=1.039E7
     21! RHOP IS THE UNITS CONVERSION FROM TO GET MASS UNITS (G CM-2)
     22! FROM PRESSURE (BARS)  DEVIDED BY GRAVITY (M SEC-2)
     23! IS EQUAL TO ONE  GM CM-2  BARS-1  M SEC-2
     24! IF ONE WHATS TO CHANGE UNITS ON PRESSURE THIS
     25! CONSTANT MUST BE CHANGED
     26      REAL,SAVE :: RHOP=1.E4
     27! FOPI IS THE ACTUAL SOLAR FLUX IN ERGS/CM2
     28      REAL,SAVE :: F0PI=1.5E4
     29! RHCH4 IS THE METHANE RH AT THE SURFACE
     30      REAL,SAVE :: RHCH4=0.60   !! .65
     31! FH2 IS THE CONSTANT MIXING RATIO OF H2
     32      REAL,SAVE :: FH2=0.04   !!  0.003
     33! FHAZE IS THE HAZE PRODUCTION SCALING FACTOR
     34      REAL,SAVE :: FHAZE=0.35
     35! FHIR IS THE HAZE INFRARED ABSORPTION SCALE FACTOR
     36      REAL,SAVE :: FHIR=0.7     ! anciennement 0.5
     37! FHVIS IS THE HAZE INFRARED ABSORPTION SCALE FACTOR
     38      REAL,SAVE :: FHVIS=1.1              !!!!  1.333333333/
     39! TAUFAC IS THE 200 CM-1 SCALING FACTOR
     40      REAL,SAVE :: TAUFAC=2.00
     41! RCLOUD IS THE PARTICLE SIZE IN THE CLOUD IN MICRONS
     42      REAL,SAVE ::RCLOUD=60.     !! 100
     43
     44      REAL,SAVE :: FARGON=0.
     45END MODULE TGMDAT_MOD
Note: See TracChangeset for help on using the changeset viewer.