meteo.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\meteo.f
00002 !
00085                       SUBROUTINE METEO
00086 !                    ****************
00087 !
00088      &(PATMOS,WINDX,WINDY,FUAIR,FVAIR,X,Y,AT,LT,NPOIN,VENT,ATMOS,
00089      & HN,TRA01,GRAV,ROEAU,NORD,PRIVE,FO1,FILES,LISTIN,
00090      & WATER_QUALITY,PLUIE,ATMOSEXCH)
00091 !
00092 !***********************************************************************
00093 ! TELEMAC2D   V7P0                                   09/07/2014
00094 !***********************************************************************
00095 !
00096 !
00097 !
00098 !
00099 !
00100 !
00101 !
00102 !
00103 !
00104 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00105 !| AT             |-->| TIME
00106 !| ATMOS          |-->| YES IF PRESSURE TAKEN INTO ACCOUNT
00107 !| FILES          |-->| BIEF_FILES STRUCTURES OF ALL FILES
00108 !| FO1            |-->| LOGICAL UNIT OF THE FORMATTED DATA FILE
00109 !| FUAIR          |<->| VELOCITY OF WIND ALONG X, IF CONSTANT
00110 !| FVAIR          |<->| VELOCITY OF WIND ALONG Y, IF CONSTANT
00111 !| GRAV           |-->| GRAVITY ACCELERATION
00112 !| HN             |-->| DEPTH
00113 !| LISTIN         |-->| IF YES, PRINTS INFORMATION
00114 !| LT             |-->| ITERATION NUMBER
00115 !| NORD           |-->| DIRECTION OF NORTH, COUNTER-CLOCK-WISE
00116 !|                |   | STARTING FROM VERTICAL AXIS
00117 !| NPOIN          |-->| NUMBER OF POINTS IN THE MESH
00118 !| PATMOS         |<--| ATMOSPHERIC PRESSURE
00119 !| PRIVE          |-->| USER WORKING ARRAYS (BIEF_OBJ BLOCK)
00120 !| ROEAU          |-->| WATER DENSITY
00121 !| TRA01          |-->| WORKING ARRAY
00122 !| VENT           |-->| YES IF WIND TAKEN INTO ACCOUNT
00123 !| WINDX          |<--| FIRST COMPONENT OF WIND VELOCITY
00124 !| WINDY          |<--| SECOND COMPONENT OF WIND VELOCITY
00125 !| X              |-->| ABSCISSAE OF POINTS
00126 !| Y              |-->| ORDINATES OF POINTS
00127 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00128 !
00129       USE BIEF
00130       USE DECLARATIONS_WAQTEL ,ONLY:PVAP,RAY3,TAIR,NEBU,NWIND
00131       USE DECLARATIONS_TELEMAC2D, ONLY: OPTWIND,WIND_SPD,PATMOS_VALUE
00132 !
00133       IMPLICIT NONE
00134       INTEGER LNG,LU
00135       COMMON/INFO/LNG,LU
00136 !
00137 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00138 !
00139       INTEGER, INTENT(IN)             :: LT,NPOIN,FO1
00140       LOGICAL, INTENT(IN)             :: ATMOS,VENT,LISTIN
00141       DOUBLE PRECISION, INTENT(IN)    :: X(NPOIN),Y(NPOIN),HN(NPOIN)
00142       DOUBLE PRECISION, INTENT(INOUT) :: WINDX(NPOIN),WINDY(NPOIN)
00143       DOUBLE PRECISION, INTENT(INOUT) :: PATMOS(NPOIN),TRA01(NPOIN)
00144       DOUBLE PRECISION, INTENT(IN)    :: AT,GRAV,ROEAU,NORD
00145       DOUBLE PRECISION, INTENT(INOUT) :: FUAIR,FVAIR
00146       TYPE(BIEF_OBJ), INTENT(INOUT)   :: PRIVE
00147       TYPE(BIEF_FILE), INTENT(IN)     :: FILES(*)
00148 !     OPTIONAL
00149       LOGICAL, INTENT(IN)          ,OPTIONAL :: WATER_QUALITY
00150       TYPE(BIEF_OBJ), INTENT(INOUT),OPTIONAL :: PLUIE
00151       INTEGER, INTENT(IN)          ,OPTIONAL :: ATMOSEXCH
00152 !
00153 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00154 !
00155       INTEGER UL
00156       DOUBLE PRECISION Z(1),AT1,AT2,FUAIR1,FUAIR2,FVAIR1,FVAIR2,COEF
00157       DOUBLE PRECISION UAIR,VAIR
00158 !     EXCHANGE WITH ATMOSPHERE
00159       DOUBLE PRECISION HREL,RAINFALL,PATM,WW,PI
00160 !
00161       DOUBLE PRECISION, PARAMETER :: EPS = 1.D-3
00162 !
00163 !-----------------------------------------------------------------------
00164 !
00165 !     DATA THAT YOU DECLARE AND READ HERE ONCE IN A FILE MAY HAVE TO BE
00166 !     KEPT BECAUSE THIS SUBROUTINE IS CALLED AT EVERY TIME STEP.
00167 !     WITHOUT THE SAVE COMMAND, ALL LOCAL DATA ARE FORGOTTEN IN THE NEXT
00168 !     CALL.
00169 !
00170       SAVE
00171 !
00172 !-----------------------------------------------------------------------
00173 !
00174 !     AT FIRST TIMESTEP
00175 !
00176       IF(LT.EQ.0) THEN
00177 !
00178         UL = FILES(FO1)%LU
00179         PI = ACOS(-1.D0)
00180 !
00181 !       ATMOSPHERIC PRESSURE
00182 !
00183         IF(ATMOS.OR.WATER_QUALITY) THEN
00184           CALL OV( 'X=C     ' , PATMOS,Y,Z,PATMOS_VALUE,NPOIN )
00185         ENDIF
00186 !
00187 !       WIND :
00188 !
00189         IF(VENT.OR.WATER_QUALITY) THEN
00190           IF(OPTWIND.EQ.1)THEN
00191 !         IN THIS CASE THE WIND IS CONSTANT, VALUE GIVEN IN STEERING FILE.
00192 !            MAY REQUIRE A ROTATION,
00193 !            DEPENDING ON THE SYSTEM IN WHICH THE WIND VELOCITY WAS SUPPLIED
00194             IF(WIND_SPD(1).GT.EPS)THEN ! THERE IS WIND !!!
00195               FUAIR = WIND_SPD(1)*SIN(WIND_SPD(2)*PI/180.D0)
00196               FVAIR = WIND_SPD(1)*COS(WIND_SPD(2)*PI/180.D0)
00197             ELSE
00198               IF(LNG.EQ.1)THEN
00199                 WRITE(LU,*)''
00200                 WRITE(LU,*)'ATTENTION: PAS DE VENT OU VENT TRES FAIBLE '
00201                 WRITE(LU,*)''
00202               ELSE
00203                 WRITE(LU,*)''
00204                 WRITE(LU,*)'NO WIND GIVEN OR VERY WEAK VALUE OF WIND'
00205                 WRITE(LU,*)''
00206               ENDIF
00207             ENDIF
00208 !        IN NEXT RELEASE, MAYBE THINK TO REMOVE KEYWORD FOR FUAIR AND FVAIR
00209             CALL OV( 'X=C     ' , WINDX , Y , Z , FUAIR , NPOIN )
00210             CALL OV( 'X=C     ' , WINDY , Y , Z , FVAIR , NPOIN )
00211 
00212           ELSEIF(OPTWIND.EQ.2) THEN
00213 !           JUMPING TWO LINES OF COMMENTS
00214             READ(UL,*)
00215             READ(UL,*)
00216 !           READING THE FIRST TWO LINES OF DATA
00217             READ(UL,*) AT1,FUAIR1,FVAIR1
00218             IF(AT.LT.AT1) THEN
00219               WRITE(LU,*) ' '
00220               WRITE(LU,*) 'METEO'
00221               IF(LNG.EQ.1) WRITE(LU,*) 'DEBUT TARDIF DU FICHIER DE VENT'
00222               IF(LNG.EQ.2) WRITE(LU,*) 'LATE BEGINNING OF THE WIND FILE'
00223               CALL PLANTE(1)
00224             ENDIF
00225           ENDIF
00226         ENDIF
00227       ENDIF
00228 !
00229 !-----------------------------------------------------------------------
00230 !     FOR THE REMAINING TIME STEPS
00231       IF(VENT.OR.WATER_QUALITY.OR.
00232      &  (PRESENT(ATMOSEXCH).AND.(ATMOSEXCH.EQ.1.OR.ATMOSEXCH.EQ.2)))THEN
00233 !
00234 !       WATER QUALITY
00235 !
00236         IF(WATER_QUALITY.AND.FILES(FO1)%NAME(1:1).NE.' ')THEN
00237           CALL INTERPMETEO2(NWIND,UAIR,VAIR,TAIR,PATM,NEBU,RAINFALL,
00238      &                      PVAP,RAY3,AT,UL)
00239 !
00240           CALL OV('X=C     ',WINDX,WINDX,WINDX,UAIR,NPOIN)
00241           CALL OV('X=C     ',WINDY,WINDY,WINDY,VAIR,NPOIN)
00242           CALL OV('X=C     ',PATMOS,PATMOS,PATMOS,PATM,NPOIN)
00243           IF(PRESENT(PLUIE))THEN
00244             CALL OS('X=C     ',X = PLUIE, C=RAINFALL) ! MM/S
00245           ENDIF
00246 !
00247 !       HEAT EXCHANGE WITH ATMOSPHERE
00248 !
00249         ELSEIF(PRESENT(ATMOSEXCH).AND.
00250      &         (ATMOSEXCH.EQ.1.OR.ATMOSEXCH.EQ.2)) THEN
00251           IF(VENT.OR.ATMOS) THEN
00252             CALL INTERPMETEO(WW,UAIR,VAIR,
00253      &                       TAIR,PATM,HREL,NEBU,RAINFALL,AT,UL)
00254           ENDIF
00255 !
00256           IF(VENT) THEN
00257             CALL OV('X=C     ',WINDX,Y,Z,UAIR,NPOIN)
00258             CALL OV('X=C     ',WINDY,Y,Z,VAIR,NPOIN)
00259           ENDIF
00260 !
00261           IF(ATMOS) THEN
00262             CALL OV('X=C     ',PATMOS,Y,Z,PATM,NPOIN)
00263           ENDIF
00264 !
00265 !      NO HEAT EXHANGE NEITHER WATER_QUALITY
00266 !
00267         ELSE
00268 !
00269 !         WIND VARYING IN TIME CONSTANT IN SPACE
00270 !
00271           IF(OPTWIND.EQ.2)THEN
00272 10          CONTINUE
00273             IF(AT.GE.AT1.AND.AT.LT.AT2) THEN
00274               IF(AT2-AT1.GT.1.D-6) THEN
00275                 COEF=(AT-AT1)/(AT2-AT1)
00276               ELSE
00277                 COEF=0.D0
00278               ENDIF
00279               UAIR=FUAIR1+COEF*(FUAIR2-FUAIR1)
00280               VAIR=FVAIR1+COEF*(FVAIR2-FVAIR1)
00281               IF(LISTIN) THEN
00282                 IF(LNG.EQ.1) WRITE(LU,*) 'VENT A T=',AT,' UAIR=',UAIR,
00283      &                                                  ' VAIR=',VAIR
00284                 IF(LNG.EQ.2) WRITE(LU,*) 'WIND AT T=',AT,' UAIR=',UAIR,
00285      &                                                   ' VAIR=',VAIR
00286               ENDIF
00287             ELSE
00288               AT1=AT2
00289               FUAIR1=FUAIR2
00290               FVAIR1=FVAIR2
00291               READ(UL,*,ERR=100,END=200) AT2,FUAIR2,FVAIR2
00292               GO TO 10
00293 !
00294 !-----------------------------------------------------------------------
00295 !
00296 100           CONTINUE
00297               WRITE(LU,*) ' '
00298               WRITE(LU,*) 'METEO'
00299               IF(LNG.EQ.1) WRITE(LU,*) 'ERREUR DANS LE FICHIER DE VENT'
00300               IF(LNG.EQ.2) WRITE(LU,*) 'ERROR IN THE WIND FILE'
00301               CALL PLANTE(1)
00302               STOP
00303 200           CONTINUE
00304               WRITE(LU,*) ' '
00305               WRITE(LU,*) 'METEO'
00306               IF(LNG.EQ.1)WRITE(LU,*)'FIN PREMATUREE DU FICHIER DE VENT'
00307               IF(LNG.EQ.2)WRITE(LU,*) 'WIND FILE TOO SHORT'
00308               CALL PLANTE(1)
00309               STOP
00310 !
00311 !-----------------------------------------------------------------------
00312 !
00313             ENDIF
00314 !
00315             CALL OV('X=C     ',WINDX,Y,Z,UAIR,NPOIN)
00316             CALL OV('X=C     ',WINDY,Y,Z,VAIR,NPOIN)
00317 !
00318             FUAIR = UAIR
00319             FVAIR = VAIR
00320 !
00321 !         WIND VARYING IN TIME AND SPACE
00322 !
00323           ELSEIF(OPTWIND.EQ.3)THEN
00324             IF(LNG.EQ.1) THEN
00325               WRITE(LU,*) 'CETTE OPTION N EST PAS ENCORE PROGRAMMEE'
00326               WRITE(LU,*) 'VOIR CAS DE VALIDATION WIND_TXY '
00327               WRITE(LU,*) 'DANS LE DOSSIER EXAMPLES/TELEMAC2D'
00328             ELSE
00329               WRITE(LU,*) 'THIS OPTION IS NOT IMPLEMENTED YET'
00330               WRITE(LU,*) 'SEE VALIDATION CASE WIND_TXY '
00331               WRITE(LU,*) 'LOCATED AT THE FOLDER EXAMPLES/TELEMAC2D'
00332             ENDIF
00333             CALL PLANTE(1)
00334             STOP
00335           ENDIF
00336         ENDIF
00337       ENDIF
00338 !
00339       RETURN
00340       END

Generated on Fri Aug 31 2013 18:12:58 by S.E.Bourban (HRW) using doxygen 1.7.0