| Directory: | ./ |
|---|---|
| File: | misc/q_sat.f |
| Date: | 2022-01-11 19:19:34 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 8 | 8 | 100.0% |
| Branches: | 4 | 4 | 100.0% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | ! | ||
| 2 | ! $Header$ | ||
| 3 | ! | ||
| 4 | ! | ||
| 5 | ! | ||
| 6 | |||
| 7 | 480 | subroutine q_sat(np,temp,pres,qsat) | |
| 8 | ! | ||
| 9 | IMPLICIT none | ||
| 10 | !====================================================================== | ||
| 11 | ! Autheur(s): Z.X. Li (LMD/CNRS) | ||
| 12 | ! reecriture vectorisee par F. Hourdin. | ||
| 13 | ! Objet: calculer la vapeur d'eau saturante (formule Centre Euro.) | ||
| 14 | !====================================================================== | ||
| 15 | ! Arguments: | ||
| 16 | ! kelvin---input-R: temperature en Kelvin | ||
| 17 | ! millibar--input-R: pression en mb | ||
| 18 | ! | ||
| 19 | ! q_sat----output-R: vapeur d'eau saturante en kg/kg | ||
| 20 | !====================================================================== | ||
| 21 | ! | ||
| 22 | integer np | ||
| 23 | REAL temp(np),pres(np),qsat(np) | ||
| 24 | ! | ||
| 25 | REAL r2es | ||
| 26 | PARAMETER (r2es=611.14 *18.0153/28.9644) | ||
| 27 | ! | ||
| 28 | REAL r3les, r3ies, r3es | ||
| 29 | PARAMETER (R3LES=17.269) | ||
| 30 | PARAMETER (R3IES=21.875) | ||
| 31 | ! | ||
| 32 | REAL r4les, r4ies, r4es | ||
| 33 | PARAMETER (R4LES=35.86) | ||
| 34 | PARAMETER (R4IES=7.66) | ||
| 35 | ! | ||
| 36 | REAL rtt | ||
| 37 | PARAMETER (rtt=273.16) | ||
| 38 | ! | ||
| 39 | REAL retv | ||
| 40 | PARAMETER (retv=28.9644/18.0153 - 1.0) | ||
| 41 | |||
| 42 | real zqsat | ||
| 43 | integer ip | ||
| 44 | ! | ||
| 45 | ! ------------------------------------------------------------------ | ||
| 46 | ! | ||
| 47 | ! | ||
| 48 | |||
| 49 |
2/2✓ Branch 0 taken 18607680 times.
✓ Branch 1 taken 480 times.
|
18608160 | do ip=1,np |
| 50 | |||
| 51 | ! write(*,*)'kelvin,millibar=',kelvin,millibar | ||
| 52 | ! write(*,*)'temp,pres=',temp(ip),pres(ip) | ||
| 53 | ! | ||
| 54 |
2/2✓ Branch 0 taken 2681820 times.
✓ Branch 1 taken 15925860 times.
|
18607680 | IF (temp(ip) .LE. rtt) THEN |
| 55 | r3es = r3ies | ||
| 56 | r4es = r4ies | ||
| 57 | ELSE | ||
| 58 | r3es = r3les | ||
| 59 | r4es = r4les | ||
| 60 | ENDIF | ||
| 61 | ! | ||
| 62 | 18607680 | zqsat=r2es/pres(ip)*EXP(r3es*(temp(ip)-rtt)/(temp(ip)-r4es)) | |
| 63 | 18607680 | zqsat=MIN(0.5,ZQSAT) | |
| 64 | 18607680 | zqsat=zqsat/(1.-retv *zqsat) | |
| 65 | ! | ||
| 66 | 18608160 | qsat(ip)= zqsat | |
| 67 | ! write(*,*)'qsat=',qsat(ip) | ||
| 68 | |||
| 69 | enddo | ||
| 70 | ! | ||
| 71 | 480 | RETURN | |
| 72 | END | ||
| 73 |