Ignore:
Timestamp:
Aug 31, 2011, 2:53:29 PM (13 years ago)
Author:
jghattas
Message:

Added interface with chemestry model REPROBUS :

  • Compile LMDZ together with Reprobus code (dependecies in both directions) and cpp key REPROBUS :

./makelmdz_fcm -ext_src my_path_to_reprobus -cpp REPROBUS ...

  • For running, add type_trac=repr in run.def.

/Marion Marchand, JG

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/radiation_AR4.F

    r1279 r1565  
    163163        allocate(ZFSUPAI(KDLON,KFLEV+1))
    164164        allocate(ZFSDNAI(KDLON,KFLEV+1))
    165         DO JK = 1 , KDLON*(KFLEV+1)
    166           ZFSUPAD(JK,1) = 0.0     ! ZFSUPAD(:,:)=0.
    167           ZFSDNAD(JK,1) = 0.0     ! ZFSDNAD(:,:)=0.
    168           ZFSUPAI(JK,1) = 0.0     ! ZFSUPAI(:,:)=0.
    169           ZFSDNAI(JK,1) = 0.0     ! ZFSDNAI(:,:)=0.
    170         END DO
     165
     166        ZFSUPAD(:,:)=0.
     167        ZFSDNAD(:,:)=0.
     168        ZFSUPAI(:,:)=0.
     169        ZFSDNAI(:,:)=0.
    171170      endif
    172 !rv
    173      
    174 c
     171
    175172      IF (appel1er) THEN
    176173         PRINT*, 'SW calling frequency : ', swpas
     
    526523      USE dimphy
    527524      USE radiation_AR4_param, only : RSUN, RRAY
     525      USE infotrac, ONLY : type_trac
     526#ifdef REPROBUS
     527      USE CHEM_REP, ONLY : RSUNTIME, ok_SUNTIME
     528#endif
     529
    528530      IMPLICIT none
    529531cym#include "dimensions.h"
     
    613615      INTEGER jl, jk, k, jaj, ikm1, ikl
    614616
     617C If running with Reporbus, overwrite default values of RSUN.
     618C Otherwise keep default values from radiation_AR4_param module. 
     619      IF (type_trac == 'repr') THEN
     620#ifdef REPROBUS
     621         IF (ok_SUNTIME) THEN
     622            RSUN(1) = RSUNTIME(1)
     623            RSUN(2) = RSUNTIME(2)
     624         ENDIF
     625         PRINT*,'RSUN(1): ',RSUN(1)
     626#endif
     627      END IF
     628
    615629C     ------------------------------------------------------------------
    616630C
     
    754768      USE dimphy
    755769      USE radiation_AR4_param, only : RSUN, RRAY
     770      USE infotrac, ONLY : type_trac
     771#ifdef REPROBUS
     772      use CHEM_REP, only : RSUNTIME, ok_SUNTIME
     773#endif
     774
    756775      IMPLICIT none
    757776cym#include "dimensions.h"
     
    873892      INTEGER jref, jkl, jklp1, jajp, jkki, jkkp4, jn2j, iabs
    874893      REAL(KIND=8) ZRMUM1, ZWH2O, ZCNEB, ZAA, ZBB, ZRKI, ZRE11
     894
     895C If running with Reporbus, overwrite default values of RSUN.
     896C Otherwise keep default values from radiation_AR4_param module. 
     897      IF (type_trac == 'repr') THEN
     898#ifdef REPROBUS
     899         IF (ok_SUNTIME) THEN
     900            RSUN(1)=RSUNTIME(1)
     901            RSUN(2)=RSUNTIME(2)
     902         END IF
     903#endif
     904      END IF
     905
    875906C
    876907
     
    24852516      USE dimphy
    24862517      USE radiation_AR4_param, only : TREF, RT1, RAER, AT, BT, OCT
     2518      USE infotrac, ONLY : type_trac
     2519#ifdef REPROBUS
     2520      USE CHEM_REP, ONLY: RCH42D,
     2521     $                    RN2O2D,
     2522     $                    RCFC112D,
     2523     $                    RCFC122D,
     2524     $                    ok_Rtime2D
     2525#endif
     2526
    24872527      IMPLICIT none
    24882528cym#include "dimensions.h"
     
    28002840     S                +ZUAER(JL,5)    *ZDUC(JL,JC)*ZDIFF
    28012841C
    2802       PABCU(JL,19,JC)=PABCU(JL,19,JCP1)
    2803      S               +ZABLY(JL,8,JC)*RCH4/RCO2*ZPHM6(JL)*ZDIFF
    2804       PABCU(JL,20,JC)=PABCU(JL,20,JCP1)
     2842C
     2843
     2844      IF (type_trac == 'repr') THEN
     2845         IF (ok_Rtime2D) THEN
     2846#ifdef REPROBUS
     2847            PABCU(JL,19,JC)=PABCU(JL,19,JCP1)
     2848     S           +ZABLY(JL,8,JC)*RCH42D(JL,JC)/RCO2*ZPHM6(JL)*ZDIFF
     2849            PABCU(JL,20,JC)=PABCU(JL,20,JCP1)
     2850     S           +ZABLY(JL,9,JC)*RCH42D(JL,JC)/RCO2*ZPSM6(JL)*ZDIFF
     2851            PABCU(JL,21,JC)=PABCU(JL,21,JCP1)
     2852     S           +ZABLY(JL,8,JC)*RN2O2D(JL,JC)/RCO2*ZPHN6(JL)*ZDIFF
     2853            PABCU(JL,22,JC)=PABCU(JL,22,JCP1)
     2854     S           +ZABLY(JL,9,JC)*RN2O2D(JL,JC)/RCO2*ZPSN6(JL)*ZDIFF
     2855C
     2856            PABCU(JL,23,JC)=PABCU(JL,23,JCP1)
     2857     S           +ZABLY(JL,8,JC)*RCFC112D(JL,JC)/RCO2         *ZDIFF
     2858            PABCU(JL,24,JC)=PABCU(JL,24,JCP1)
     2859     S           +ZABLY(JL,8,JC)*RCFC122D(JL,JC)/RCO2         *ZDIFF
     2860#endif
     2861         ELSE
     2862            ! Same calculation as for type_trac /= repr
     2863            PABCU(JL,19,JC)=PABCU(JL,19,JCP1)
     2864     S           +ZABLY(JL,8,JC)*RCH4/RCO2*ZPHM6(JL)*ZDIFF
     2865            PABCU(JL,20,JC)=PABCU(JL,20,JCP1)
     2866     S           +ZABLY(JL,9,JC)*RCH4/RCO2*ZPSM6(JL)*ZDIFF
     2867            PABCU(JL,21,JC)=PABCU(JL,21,JCP1)
     2868     S           +ZABLY(JL,8,JC)*RN2O/RCO2*ZPHN6(JL)*ZDIFF
     2869            PABCU(JL,22,JC)=PABCU(JL,22,JCP1)
     2870     S           +ZABLY(JL,9,JC)*RN2O/RCO2*ZPSN6(JL)*ZDIFF
     2871C     
     2872            PABCU(JL,23,JC)=PABCU(JL,23,JCP1)
     2873     S               +ZABLY(JL,8,JC)*RCFC11/RCO2         *ZDIFF
     2874            PABCU(JL,24,JC)=PABCU(JL,24,JCP1)
     2875     S           +ZABLY(JL,8,JC)*RCFC12/RCO2         *ZDIFF
     2876         END IF
     2877      ELSE
     2878         PABCU(JL,19,JC)=PABCU(JL,19,JCP1)
     2879     S        +ZABLY(JL,8,JC)*RCH4/RCO2*ZPHM6(JL)*ZDIFF
     2880         PABCU(JL,20,JC)=PABCU(JL,20,JCP1)
    28052881     S               +ZABLY(JL,9,JC)*RCH4/RCO2*ZPSM6(JL)*ZDIFF
    2806       PABCU(JL,21,JC)=PABCU(JL,21,JCP1)
    2807      S               +ZABLY(JL,8,JC)*RN2O/RCO2*ZPHN6(JL)*ZDIFF
    2808       PABCU(JL,22,JC)=PABCU(JL,22,JCP1)
    2809      S               +ZABLY(JL,9,JC)*RN2O/RCO2*ZPSN6(JL)*ZDIFF
    2810 C
    2811       PABCU(JL,23,JC)=PABCU(JL,23,JCP1)
    2812      S               +ZABLY(JL,8,JC)*RCFC11/RCO2         *ZDIFF
    2813       PABCU(JL,24,JC)=PABCU(JL,24,JCP1)
    2814      S               +ZABLY(JL,8,JC)*RCFC12/RCO2         *ZDIFF
     2882         PABCU(JL,21,JC)=PABCU(JL,21,JCP1)
     2883     S        +ZABLY(JL,8,JC)*RN2O/RCO2*ZPHN6(JL)*ZDIFF
     2884         PABCU(JL,22,JC)=PABCU(JL,22,JCP1)
     2885     S        +ZABLY(JL,9,JC)*RN2O/RCO2*ZPSN6(JL)*ZDIFF
     2886C     
     2887         PABCU(JL,23,JC)=PABCU(JL,23,JCP1)
     2888     S        +ZABLY(JL,8,JC)*RCFC11/RCO2         *ZDIFF
     2889         PABCU(JL,24,JC)=PABCU(JL,24,JCP1)
     2890     S        +ZABLY(JL,8,JC)*RCFC12/RCO2         *ZDIFF
     2891      END IF
     2892     
    28152893 523  CONTINUE
    28162894 524  CONTINUE
Note: See TracChangeset for help on using the changeset viewer.