[1403] | 1 | ! $Id: friction.F90 5118 2024-07-24 14:39:59Z abarral $ |
---|
[5099] | 2 | |
---|
[5103] | 3 | !======================================================================= |
---|
| 4 | SUBROUTINE friction(ucov, vcov, pdt) |
---|
[1403] | 5 | |
---|
[5103] | 6 | USE control_mod |
---|
| 7 | USE IOIPSL |
---|
| 8 | USE comconst_mod, ONLY: pi |
---|
[5118] | 9 | USE lmdz_iniprint, ONLY: lunout, prt_level |
---|
[5103] | 10 | IMPLICIT NONE |
---|
[524] | 11 | |
---|
[5103] | 12 | !======================================================================= |
---|
[5099] | 13 | |
---|
[5103] | 14 | ! Friction for the Newtonian case: |
---|
| 15 | ! -------------------------------- |
---|
| 16 | ! 2 possibilities (depending on flag 'friction_type' |
---|
| 17 | ! friction_type=0 : A friction that is only applied to the lowermost |
---|
| 18 | ! atmospheric layer |
---|
| 19 | ! friction_type=1 : Friction applied on all atmospheric layer (but |
---|
| 20 | ! (default) with stronger magnitude near the surface; see |
---|
| 21 | ! iniacademic.F) |
---|
| 22 | !======================================================================= |
---|
[524] | 23 | |
---|
[5103] | 24 | include "dimensions.h" |
---|
| 25 | include "paramet.h" |
---|
| 26 | include "comgeom2.h" |
---|
| 27 | include "academic.h" |
---|
[524] | 28 | |
---|
[5103] | 29 | ! arguments: |
---|
[5117] | 30 | REAL, INTENT(OUT) :: ucov(iip1, jjp1, llm) |
---|
| 31 | REAL, INTENT(OUT) :: vcov(iip1, jjm, llm) |
---|
| 32 | REAL, INTENT(IN) :: pdt ! time step |
---|
[1454] | 33 | |
---|
[5103] | 34 | ! local variables: |
---|
[1454] | 35 | |
---|
[5103] | 36 | REAL :: modv(iip1, jjp1), zco, zsi |
---|
| 37 | REAL :: vpn, vps, upoln, upols, vpols, vpoln |
---|
| 38 | REAL :: u2(iip1, jjp1), v2(iip1, jjm) |
---|
| 39 | INTEGER :: i, j, l |
---|
| 40 | REAL, PARAMETER :: cfric = 1.e-5 |
---|
| 41 | LOGICAL, SAVE :: firstcall = .TRUE. |
---|
| 42 | INTEGER, SAVE :: friction_type = 1 |
---|
| 43 | CHARACTER(len = 20) :: modname = "friction" |
---|
| 44 | CHARACTER(len = 80) :: abort_message |
---|
[524] | 45 | |
---|
[5103] | 46 | IF (firstcall) THEN |
---|
[5113] | 47 | ! set friction type |
---|
[5103] | 48 | CALL getin("friction_type", friction_type) |
---|
[5117] | 49 | IF ((friction_type<0).OR.(friction_type>1)) THEN |
---|
[5103] | 50 | abort_message = "wrong friction type" |
---|
[5116] | 51 | WRITE(lunout, *)'Friction: wrong friction type', friction_type |
---|
[5103] | 52 | CALL abort_gcm(modname, abort_message, 42) |
---|
| 53 | endif |
---|
| 54 | firstcall = .FALSE. |
---|
| 55 | ENDIF |
---|
| 56 | |
---|
[5117] | 57 | IF (friction_type==0) THEN |
---|
[5103] | 58 | ! calcul des composantes au carre du vent naturel |
---|
| 59 | do j = 1, jjp1 |
---|
| 60 | do i = 1, iip1 |
---|
| 61 | u2(i, j) = ucov(i, j, 1) * ucov(i, j, 1) * unscu2(i, j) |
---|
[524] | 62 | enddo |
---|
[5103] | 63 | enddo |
---|
| 64 | do j = 1, jjm |
---|
| 65 | do i = 1, iip1 |
---|
| 66 | v2(i, j) = vcov(i, j, 1) * vcov(i, j, 1) * unscv2(i, j) |
---|
[524] | 67 | enddo |
---|
[5103] | 68 | enddo |
---|
[524] | 69 | |
---|
[5103] | 70 | ! calcul du module de V en dehors des poles |
---|
| 71 | do j = 2, jjm |
---|
| 72 | do i = 2, iip1 |
---|
| 73 | modv(i, j) = sqrt(0.5 * (u2(i - 1, j) + u2(i, j) + v2(i, j - 1) + v2(i, j))) |
---|
[524] | 74 | enddo |
---|
[5103] | 75 | modv(1, j) = modv(iip1, j) |
---|
| 76 | enddo |
---|
[524] | 77 | |
---|
[5103] | 78 | ! les deux composantes du vent au pole sont obtenues comme |
---|
| 79 | ! premiers modes de fourier de v pres du pole |
---|
| 80 | upoln = 0. |
---|
| 81 | vpoln = 0. |
---|
| 82 | upols = 0. |
---|
| 83 | vpols = 0. |
---|
| 84 | do i = 2, iip1 |
---|
| 85 | zco = cos(rlonv(i)) * (rlonu(i) - rlonu(i - 1)) |
---|
| 86 | zsi = sin(rlonv(i)) * (rlonu(i) - rlonu(i - 1)) |
---|
| 87 | vpn = vcov(i, 1, 1) / cv(i, 1) |
---|
| 88 | vps = vcov(i, jjm, 1) / cv(i, jjm) |
---|
| 89 | upoln = upoln + zco * vpn |
---|
| 90 | vpoln = vpoln + zsi * vpn |
---|
| 91 | upols = upols + zco * vps |
---|
| 92 | vpols = vpols + zsi * vps |
---|
| 93 | enddo |
---|
| 94 | vpn = sqrt(upoln * upoln + vpoln * vpoln) / pi |
---|
| 95 | vps = sqrt(upols * upols + vpols * vpols) / pi |
---|
| 96 | do i = 1, iip1 |
---|
| 97 | ! modv(i,1)=vpn |
---|
| 98 | ! modv(i,jjp1)=vps |
---|
| 99 | modv(i, 1) = modv(i, 2) |
---|
| 100 | modv(i, jjp1) = modv(i, jjm) |
---|
| 101 | enddo |
---|
[524] | 102 | |
---|
[5103] | 103 | ! calcul du frottement au sol. |
---|
| 104 | do j = 2, jjm |
---|
| 105 | do i = 1, iim |
---|
| 106 | ucov(i, j, 1) = ucov(i, j, 1) & |
---|
| 107 | - cfric * pdt * 0.5 * (modv(i + 1, j) + modv(i, j)) * ucov(i, j, 1) |
---|
[524] | 108 | enddo |
---|
[5103] | 109 | ucov(iip1, j, 1) = ucov(1, j, 1) |
---|
| 110 | enddo |
---|
| 111 | do j = 1, jjm |
---|
| 112 | do i = 1, iip1 |
---|
| 113 | vcov(i, j, 1) = vcov(i, j, 1) & |
---|
| 114 | - cfric * pdt * 0.5 * (modv(i, j + 1) + modv(i, j)) * vcov(i, j, 1) |
---|
[524] | 115 | enddo |
---|
[5103] | 116 | vcov(iip1, j, 1) = vcov(1, j, 1) |
---|
| 117 | enddo |
---|
[5117] | 118 | ENDIF ! of if (friction_type.EQ.0) |
---|
[524] | 119 | |
---|
[5117] | 120 | IF (friction_type==1) THEN |
---|
[5103] | 121 | do l = 1, llm |
---|
| 122 | ucov(:, :, l) = ucov(:, :, l) * (1. - pdt * kfrict(l)) |
---|
| 123 | vcov(:, :, l) = vcov(:, :, l) * (1. - pdt * kfrict(l)) |
---|
| 124 | enddo |
---|
[5117] | 125 | ENDIF |
---|
[524] | 126 | |
---|
[5103] | 127 | END SUBROUTINE friction |
---|
| 128 | |
---|