SURFEX v7.3
General documentation of Surfex
 All Classes Files Functions Variables Typedefs
/home/dasprezs/EXPORT_v7_3/src/LIB/TRIP/trip_ground_water.F90
Go to the documentation of this file.
00001 !     #########
00002       SUBROUTINE TRIP_GROUND_WATER (PTSTEP,PGROUND_STO,PGROUND_STO2,PDRAIN,PTAUG, &
00003                                       PGOUT,PGSTO_ALL,PGSTO2_ALL,PGIN_ALL,PGOUT_ALL)  
00004 !     #############################################################################
00005 !
00006 !!****  *TRIP_GROUND_WATER*  
00007 !!
00008 !!    PURPOSE
00009 !!    -------
00010 !
00011 !     Calculate the storage in the next time step based on the storage
00012 !     of current time step.The deep drainage is constant during the time step.
00013 !     
00014 !!**  METHOD
00015 !!    ------
00016 !
00017 !     Direct calculation
00018 !
00019 !!    EXTERNAL
00020 !!    --------
00021 !
00022 !     None
00023 !!
00024 !!    IMPLICIT ARGUMENTS
00025 !!    ------------------
00026 !!
00027 !!      
00028 !!    REFERENCE
00029 !!    ---------
00030 !!      
00031 !!    AUTHOR
00032 !!    ------
00033 !!      B. Decharme     
00034 !!
00035 !!    MODIFICATIONS
00036 !!    -------------
00037 !!      Original    01/02/05 
00038 !-------------------------------------------------------------------------------
00039 !
00040 !*       0.     DECLARATIONS
00041 !               ------------
00042 !
00043 !
00044 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
00045 USE PARKIND1  ,ONLY : JPRB
00046 !
00047 IMPLICIT NONE
00048 !
00049 !*      0.1    declarations of arguments
00050 !
00051 REAL, INTENT(IN)                     :: PTSTEP
00052 !                                       KTSTEP = timestep value (=FRC) [s]
00053 !                                              = 10800s
00054 !
00055 !
00056 REAL, DIMENSION(:,:), INTENT(IN)     :: PDRAIN, PTAUG
00057 !                                       PRUNOFF = Surface runoff from ISBA    [kg/mē]
00058 !                                       PTAUG   = ground water transfer time  [s]
00059 !
00060 REAL, DIMENSION(:,:), INTENT(IN   )  :: PGROUND_STO
00061 REAL, DIMENSION(:,:), INTENT(INOUT)  :: PGROUND_STO2
00062 !                                       PGROUND_STO  = ground water storage at t    [kg]
00063 !                                       PGROUND_STO2 = ground water storage at t+1  [kg]
00064 !
00065 REAL, DIMENSION(:,:), INTENT(OUT)    :: PGOUT
00066 !                                       PGOUT = Outflow from the ground reservoir  
00067 !
00068 REAL,                 INTENT(OUT)    :: PGSTO_ALL,PGSTO2_ALL,PGIN_ALL,PGOUT_ALL
00069 !                                       Final budget variable
00070 !
00071 !*      0.2    declarations of local variables
00072 !
00073 REAL, DIMENSION(SIZE(PGROUND_STO,1),SIZE(PGROUND_STO,2)) :: ZGSTOMAX, ZGOUT
00074 REAL(KIND=JPRB) :: ZHOOK_HANDLE
00075 !
00076 !-------------------------------------------------------------------------------
00077 !-------------------------------------------------------------------------------
00078 !
00079 IF (LHOOK) CALL DR_HOOK('TRIP_GROUND_WATER',0,ZHOOK_HANDLE)
00080 !
00081 PGROUND_STO2(:,:) = 0.0
00082 PGOUT       (:,:) = 0.0
00083 !
00084 ZGSTOMAX    (:,:) = 0.0
00085 ZGOUT       (:,:) = 0.0
00086 !
00087 PGSTO_ALL  = 0.0
00088 PGSTO2_ALL = 0.0
00089 PGIN_ALL   = 0.0
00090 PGOUT_ALL  = 0.0
00091 !
00092 WHERE(PTAUG(:,:)>0.0)
00093 !
00094 !     ---------------------------------------------------------------------------
00095 !     ground water storage calculation
00096 !
00097       PGROUND_STO2(:,:)=PGROUND_STO(:,:)*EXP(-PTSTEP/PTAUG(:,:)) &
00098                          + (1.0-EXP(-PTSTEP/PTAUG(:,:)))*PDRAIN(:,:)*PTAUG(:,:)  
00099 !
00100 !     ---------------------------------------------------------------------------
00101 !     supress numerical artifacs
00102 !
00103       ZGSTOMAX(:,:)=PDRAIN(:,:)*PTSTEP+PGROUND_STO(:,:)
00104 !      
00105       PGROUND_STO2(:,:)=MIN(ZGSTOMAX(:,:),PGROUND_STO2(:,:))
00106 !
00107 !     ---------------------------------------------------------------------------
00108 !     ground water discharge calculation                
00109 !
00110       ZGOUT(:,:)=(PGROUND_STO(:,:)-PGROUND_STO2(:,:))/PTSTEP+PDRAIN(:,:)
00111 !      
00112 !     ---------------------------------------------------------------------------
00113 !     supress numerical artifacs
00114 !
00115       PGOUT(:,:)=MAX(0.0,ZGOUT(:,:))
00116       PGROUND_STO2(:,:) = PGROUND_STO2(:,:) + (PGOUT(:,:)-ZGOUT(:,:))             
00117 !
00118 ENDWHERE
00119 !
00120 !-------------------------------------------------------------------------------
00121 !budget calculation
00122 !
00123 PGSTO_ALL  = SUM(PGROUND_STO (:,:), PTAUG(:,:)>0.0)
00124 PGSTO2_ALL = SUM(PGROUND_STO2(:,:), PTAUG(:,:)>0.0)
00125 PGIN_ALL   = SUM(PDRAIN      (:,:), PTAUG(:,:)>0.0)
00126 PGOUT_ALL  = SUM(PGOUT       (:,:), PTAUG(:,:)>0.0)
00127 !
00128 IF (LHOOK) CALL DR_HOOK('TRIP_GROUND_WATER',1,ZHOOK_HANDLE)
00129 !
00130 !-------------------------------------------------------------------------------
00131 !-------------------------------------------------------------------------------
00132 END SUBROUTINE TRIP_GROUND_WATER