Newer
Older
PROGRAM main_ddt
USE param
USE inputdata
USE drag3
type (data_lutyp) :: data_lutyp1
integer :: numst, i
real :: cflh, z0in
character(len = 50) :: filename_in
character(len = 50) :: filename_out
character(len = 50) :: filename_in2
!type :: datatype_inMAS1
! real, allocatable :: mas_w(:) !
! real, allocatable :: mas_dt(:)
! real, allocatable :: mas_st(:)
! real, allocatable :: mas_dq(:)
! real, allocatable :: mas_cflh(:)
! real, allocatable :: mas_z0in(:)
!end type
type(meteoDataVecType) :: meteo
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
!input
! mas_w - abs(wind velocity) at constant flux layer (cfl) hight (m/s)
! mas_dt - difference between potential temperature at cfl hight and at surface ( deg. k)
! mas_st - semi-sum of potential temperature at cfl hight and and at surface ( deg. k)
! mas_dq - difference between humidity at cfl hight and a surface ( gr/gr )
! cflh - - cfl hight ( m )
! z0in=0.01 - roughness of surface ( m );
! it - number of iterations
! lu_indx - 1 for land, 2 for sea, 3 for lake
! test - file input
type :: datatype_outMAS1
real, allocatable :: masout_zl(:)
real, allocatable :: masout_ri(:)
real, allocatable :: masout_re(:)
real, allocatable :: masout_lnzuzt(:)
real, allocatable :: masout_zu(:)
real, allocatable :: masout_ztout(:)
real, allocatable :: masout_rith(:)
real, allocatable :: masout_cm(:)
real, allocatable :: masout_ch(:)
real, allocatable :: masout_ct(:)
real, allocatable :: masout_ckt(:)
end type
type(datatype_outMAS1) :: data_outMAS
!output
!masout_zl - non-dimensional cfl hight
!masout_ri - richardson number
!masout_re - reynods number
!masout_lnzuzt - ln(zu/zt)
!masout_zu - dynamical roughness zu (m)
!masout_ztout - thermal roughness zt (m)
!masout_rith - critical richardson number
!masout_cm - transfer coefficient for momentum
!masout_ch - transfer coefficient fr heat
!masout_ct - coefficient of turbulence (km) at cfl hight (m**2/s)
!masout_ckt - alft=kt/km ( kt-coefficient of turbulence for heat)
!> @brief Test - file selection for test
write(*,*) 'running code'
if (TEST==1) then
filename_in='data/MOSAiC.txt'
filename_out='out_MOSAiC.txt'
filename_in2='data/MOSAiC_zh.txt'
elseif (TEST==2) then
filename_in='data/Irgason1.txt'
filename_out='out_IRGASON1.txt'
filename_in2='data/IRGASON_zh.txt'
endif
open (1, file= filename_in, status ='old')
open (2, file=filename_out)
numst=0
do WHILE (ioer.eq.0)
read (1,*, iostat=ioer) data_in1%U, data_in1%dT, data_in1%Tsemi, data_in1%dQ
numst=numst+1
enddo
close (1)
numst=numst-1
allocate(meteo%h(numst))
allocate(meteo%U(numst))
allocate(meteo%dT(numst))
allocate(meteo%Tsemi(numst))
allocate(meteo%dQ(numst))
allocate(meteo%z0_m(numst))
allocate(data_outMAS%masout_zl(numst))
allocate(data_outMAS%masout_ri(numst))
allocate(data_outMAS%masout_re(numst))
allocate(data_outMAS%masout_lnzuzt(numst))
allocate(data_outMAS%masout_zu(numst))
allocate(data_outMAS%masout_ztout(numst))
allocate(data_outMAS%masout_rith(numst))
allocate(data_outMAS%masout_cm(numst))
allocate(data_outMAS%masout_ch(numst))
allocate(data_outMAS%masout_ct(numst))
allocate(data_outMAS%masout_ckt(numst))
open (11, file=filename_in2, status ='old')
open (1, file= filename_in, status ='old')
read (11, *) cflh, z0in
do i=1,numst
read (1,*) data_in1%U, data_in1%dT, data_in1%Tsemi, data_in1%dQ
meteo%h(i)=cflh
meteo%U(i) = meteo%U(i)+data_in1%U
meteo%dT(i) = meteo%dT(i)+data_in1%dT
meteo%Tsemi(i) = meteo%Tsemi(i)+data_in1%Tsemi
meteo%dQ(i) = meteo%dQ(i)+data_in1%dQ
meteo%z0_m(i)=z0in
data_outMAS%masout_zl, data_outMAS%masout_ri, data_outMAS%masout_re, data_outMAS%masout_lnzuzt,&
data_outMAS%masout_zu,data_outMAS%masout_ztout,data_outMAS%masout_rith,data_outMAS%masout_cm,&
data_outMAS%masout_ch,data_outMAS%masout_ct,data_outMAS%masout_ckt,&
data_par1, data_lutyp1,numst)
!CALL surf_fluxMAS(meteo%mas_w, meteo%mas_dt, meteo%mas_st, meteo%mas_dq,&
! meteo%mas_cflh, meteo%mas_z0in,&
! data_outMAS%masout_zl, data_outMAS%masout_ri, data_outMAS%masout_re, data_outMAS%masout_lnzuzt,&
! data_outMAS%masout_zu,data_outMAS%masout_ztout,data_outMAS%masout_rith,data_outMAS%masout_cm,&
! data_outMAS%masout_ch,data_outMAS%masout_ct,data_outMAS%masout_ckt,&
! data_par1, data_lutyp1,numst)
do i=1,numst
write (2,20) data_outMAS%masout_zl(i), data_outMAS%masout_ri(i), data_outMAS%masout_re(i), data_outMAS%masout_lnzuzt(i),&
data_outMAS%masout_zu(i), data_outMAS%masout_ztout(i), data_outMAS%masout_rith(i), data_outMAS%masout_cm(i),&
data_outMAS%masout_ch(i), data_outMAS%masout_ct(i), data_outMAS%masout_ckt(i)
enddo
deallocate(meteo%h)
deallocate(meteo%U)
deallocate(meteo%dT)
deallocate(meteo%Tsemi)
deallocate(meteo%dQ)
deallocate(meteo%z0_m)
deallocate(data_outMAS%masout_zl)
deallocate(data_outMAS%masout_ri)
deallocate(data_outMAS%masout_re)
deallocate(data_outMAS%masout_lnzuzt)
deallocate(data_outMAS%masout_zu)
deallocate(data_outMAS%masout_ztout)
deallocate(data_outMAS%masout_rith)
deallocate(data_outMAS%masout_cm)
deallocate(data_outMAS%masout_ch)
deallocate(data_outMAS%masout_ct)
deallocate(data_outMAS%masout_ckt)
10 format (f8.4,2x,f8.4)
20 format (11(f10.4,3x))