Commit e1d0d719 authored by ldemaine's avatar ldemaine
Browse files

réglage confusion entre zsurf_0 et zref

parent 0f66ee57
......@@ -1503,12 +1503,12 @@ c******************************
endif ! of if (perturkey.eq.5)
c 4.3.5 Computation of high precision wind
write(*,*) 'temp', temp
c$$$ write(*,*) 'temp', temp
if (hireskey.eq.1) then
call slope_wind(dset,xlon,xlat,zsurface,zradius,
call slope_wind(dset,xlon,xlat,zsurface,zradius,z_0,
& tl,temp_gcm,sheight,
& ul,vl,old_zonwind,old_merwind,
& upslope_wind,crossslope_wind)
......@@ -7426,22 +7426,22 @@ c$$$ double precision double_hA, double_hB, double_hC
parameter (pi=3.14159265358979d0)
parameter (degtorad=pi/180.0d0)
write(*,*) '|-----------------------------------------|'
write(*,*) '| Input get_slopes'
write(*,*) '|-----------------------------------------|'
write(*,*) '|'
write(*,*) '| latitude', latitude
write(*,*) '| longitude', longitude
write(*,*) '| distance', distance
write(*,*) '| zradius', zradius
write(*,*) '|-----------------------------------------|'
write(*,*) '|'
c$$$ write(*,*) '|-----------------------------------------|'
c$$$ write(*,*) '| Input get_slopes'
c$$$ write(*,*) '|-----------------------------------------|'
c$$$ write(*,*) '|'
c$$$ write(*,*) '| latitude', latitude
c$$$ write(*,*) '| longitude', longitude
c$$$ write(*,*) '| distance', distance
c$$$ write(*,*) '| zradius', zradius
c$$$ write(*,*) '|-----------------------------------------|'
c$$$ write(*,*) '|'
! 1. Computation of the coordinates of A, B and C
distance = distance*1000
write(*,*) '| distance', distance
c$$$ write(*,*) '| distance', distance
c$$$ distance_local = distance
......@@ -7455,13 +7455,13 @@ c$$$ distance_local = distance
lonC = longitude-distance*sqrt(3.)/
& (2*Zradius*cos(latBC*degtorad)*degtorad)
write(*,*) '|'
write(*,*) '| lonA', lonA
write(*,*) '| lonB', lonB
write(*,*) '| lonC', lonC
write(*,*) '| latA', latA
write(*,*) '| latB', latBC
write(*,*) '| latC', latBC
c$$$ write(*,*) '|'
c$$$ write(*,*) '| lonA', lonA
c$$$ write(*,*) '| lonB', lonB
c$$$ write(*,*) '| lonC', lonC
c$$$ write(*,*) '| latA', latA
c$$$ write(*,*) '| latB', latBC
c$$$ write(*,*) '| latC', latBC
c$$$ write(*,*) 'xlon-lonA, xlon-lonB, xlon-lonC'
c$$$ write(*,*) longitude-lonA, longitude-lonB, longitude-lonC
......@@ -7474,10 +7474,10 @@ c$$$ write(*,*) latitude-latA, latitude-latBC, latitude-latBC
call mola(dset,latBC,lonB,hB,ier)
call mola(dset,latBC,lonC,hC,ier)
write(*,*) '|'
write(*,*) '| hA', hA
write(*,*) '| hB', hB
write(*,*) '| hC', hC
c$$$ write(*,*) '|'
c$$$ write(*,*) '| hA', hA
c$$$ write(*,*) '| hB', hB
c$$$ write(*,*) '| hC', hC
c$$$ double_hA, double_hB, double_hC = hA, hB, hC
......@@ -7495,14 +7495,14 @@ c$$$ double_hA, double_hB, double_hC = hA, hB, hC
theta_s = theta_s/degtorad
write(*,*) '|'
write(*,*) '| theta_s', theta_s
c$$$ write(*,*) '|'
c$$$ write(*,*) '| theta_s', theta_s
psy_s = atan2( hC-hB,
& sqrt(3.)*(hB + hC - 2*hA))
psy_s = psy_s/degtorad
write(*,*) '| psy_s', psy_s
c$$$ write(*,*) '| psy_s', psy_s
return
......@@ -7711,7 +7711,7 @@ c$$$ write(*,*) 'Ftot:', F
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine slope_wind(dset,xlon,xlat,zsurface,zradius,
subroutine slope_wind(dset,xlon,xlat,zsurface,zradius,zsurf_0,
& temp,temp_gcm,sheight,
& zonwind,merwind,old_zonwind,old_merwind,
& upslope_wind,crossslope_wind)
......@@ -7726,8 +7726,8 @@ ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
real,intent(in) :: xlon
real,intent(in) :: xlat
real,intent(in) :: zsurface
c$$$ real,intent(in) :: zsurf_0
real,intent(in) :: zradius ! to compute get_slopes
real,intent(in) :: zsurf_0
real,intent(in) :: temp
real,intent(in) :: temp_gcm(dimlevs)
!inutile pour le moment car temp déjà un imput
......@@ -7777,33 +7777,35 @@ c$$$ real,intent(in) :: pratio
parameter (pi=3.14159265358979d0)
parameter (degtorad=pi/180.0d0)
open(1, file='Test_slope/TEST_5.txt', status = 'old')
write(1,*) ''
write(1,*) '|-----------------------------------------|'
write(1,*) '| Input slope_wind |'
write(1,*) '|-----------------------------------------|'
write(1,*) '|'
write(1,*) '| xlon', xlon
write(1,*) '| xlat', xlat
write(1,*) '| zsurface', zsurface
write(1,*) '| zradius', zradius
write(1,*) '| temp', temp
write(1,*) '| temp_gcm', temp_gcm
write(1,*) '| sheight', sheight
write(1,*) '| zonwind', zonwind
write(1,*) '| merwind', merwind
write(1,*) '|'
write(1,*) '|-----------------------------------------|'
write(1,*) '|'
c$$$
c$$$ open(1, file='Test_slope/TEST_5.txt', status = 'old')
c$$$
c$$$ write(1,*) ''
c$$$ write(1,*) '|-----------------------------------------|'
c$$$ write(1,*) '| Input slope_wind |'
c$$$ write(1,*) '|-----------------------------------------|'
c$$$ write(1,*) '|'
c$$$ write(1,*) '| xlon', xlon
c$$$ write(1,*) '| xlat', xlat
c$$$ write(1,*) '| zsurface', zsurface
c$$$ write(1,*) '| zradius', zradius
c$$$ write(1,*) '| temp', temp
c$$$ write(1,*) '| temp_gcm', temp_gcm
c$$$ write(1,*) '| sheight', sheight
c$$$ write(1,*) '| zonwind', zonwind
c$$$ write(1,*) '| merwind', merwind
c$$$ write(1,*) '|'
c$$$ write(1,*) '|-----------------------------------------|'
c$$$ write(1,*) '|'
slopes_scale = 1
call get_slopes(dset,xlon,xlat,slopes_scale,zradius,
& theta_s,psy_s,ier)
write(1,*) '| slopes_scale', slopes_scale
write(1,*) '| theta_s', theta_s
write(1,*) '| psy_s', psy_s
c$$$ write(1,*) '| slopes_scale', slopes_scale
write(*,*) 'zsurface',zsurface
write(*,*) '| theta_s', theta_s
c$$$ write(1,*) '| theta_s', theta_s
c$$$ write(1,*) '| psy_s', psy_s
c$$$! TODO: cas où l'altitude est inférieure à la première maille de mcd
......@@ -7820,9 +7822,10 @@ c$$$! TODO: cas où l'altitude est inférieure à la première maille de mcd
zref = 10000*sin(theta_s*degtorad)
write(1,*) '| zref', zref
write(*,*) '| zref', zref
c$$$ write(1,*) '| zref', zref
if (zsurface.le.zref) then
if (zsurface.le.zref.and.zsurface.gt.0) then
!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
! calcul des valeurs pour la ref (sur le modèle de getsi)
......@@ -7832,7 +7835,7 @@ c$$$! TODO: cas où l'altitude est inférieure à la première maille de mcd
if (zref.lt.sheight(1)) then
! ! below the lowest layer
write(*,*) '/!\ zref trop bas'
c$$$ write(*,*) 'ATTENTION! zref trop bas'
levhi_0=1
levlow_0=1
levweight_0=1.
......@@ -7840,7 +7843,7 @@ c$$$ levweight_0(2)=0.
c$$$ pratio_0=exp((sheight(1)-zref)*g/(R_gcm(1)*temp_gcm(1)))
pratio_0 = 1.
elseif (zref.ge.sheight(dimlevs)) then
write(*,*) '/!\ zref trop haut'
c$$$ write(*,*) 'ATTENTION! zref trop haut'
! ! above the top layer
levhi_0=dimlevs
levlow_0=dimlevs
......@@ -7878,33 +7881,39 @@ c$$$ & /(1.-(sigma(levhi_0)/sigma(levlow_0)))
endif
enddo
endif
write(1,*) '| levhi_0', levhi_0
write(1,*) '| levlow_0', levlow_0
write(1,*) '| levweight_0', levweight_0
write(1,*) '| pratio_0', pratio_0
c$$$ write(1,*) '| levhi_0', levhi_0
c$$$ write(1,*) '| levlow_0', levlow_0
c$$$ write(1,*) '| levweight_0', levweight_0
c$$$ write(1,*) '| pratio_0', pratio_0
temp_0 = temp_gcm(levlow_0)
& + (temp_gcm(levhi_0)-temp_gcm(levlow_0))*levweight_0
write(1,*) '| temp_0', temp_0
c$$$ write(1,*) '| temp_0', temp_0
!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
! Computation of float terme
Float = g_0*(temp - temp_0)*sin(theta_s*degtorad)/temp_0
write(1,*) '| Float', Float
c$$$ write(1,*) '| Float', Float
write(*,*) '| Float', Float
if (zsurface.le.zsurf_0) then
write(*,*) 'zsurface.le.zsurf_0'
endif
Cd = (k_vk/log(zsurface/zref))**2
write(1,*) '| Cd', Cd
Cd = (k_vk/log(zsurface/zsurf_0))**2
c$$$ write(1,*) '| Cd', Cd
write(*,*) '| Cd', Cd
upslope_wind = sign(sqrt(abs(Float / Cd)), Float/Cd)
c$$$ upslope_wind = sign(abs(sqrt(Float / Cd)), Float/Cd)
write(1,*) '| upslope_wind', upslope_wind
c$$$ write(1,*) '| upslope_wind', upslope_wind
c$$$ do i=0,1000
c$$$
......@@ -7943,22 +7952,21 @@ c$$$ enddo
& + upslope_wind*sin(psy_s*degtorad)
& +crossslope_wind*cos(psy_s*degtorad)
write(1,*) '|'
write(1,*) '|-----------------------------------------|'
write(1,*) '| Output slope_wind |'
write(1,*) '|-----------------------------------------|'
write(1,*) '|'
write(1,*) '| upslope_wind', upslope_wind
write(1,*) '| crossslope_wind', crossslope_wind
write(1,*) '| zonwind', zonwind
write(1,*) '| merwind', merwind
write(1,*) '| old_zonwind', old_zonwind
write(1,*) '| old_merwind', old_merwind
write(1,*) '|'
write(1,*) '|-----------------------------------------|'
write(1,*) ''
close(1)
c$$$ write(1,*) '|'
c$$$ write(1,*) '|-----------------------------------------|'
c$$$ write(1,*) '| Output slope_wind |'
c$$$ write(1,*) '|-----------------------------------------|'
c$$$ write(1,*) '|'
c$$$ write(1,*) '| upslope_wind', upslope_wind
c$$$ write(1,*) '| crossslope_wind', crossslope_wind
c$$$ write(1,*) '| zonwind', zonwind
c$$$ write(1,*) '| merwind', merwind
c$$$ write(1,*) '| old_zonwind', old_zonwind
c$$$ write(1,*) '| old_merwind', old_merwind
c$$$ write(1,*) '|'
c$$$ write(1,*) '|-----------------------------------------|'
c$$$ write(1,*) ''
c$$$ close(1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment