19 subroutine read_h2odata (h2o_phys, me, master)
20 use machine,
only: kind_phys
23 logical,
intent(in) :: h2o_phys
24 integer,
intent(in) :: me
25 integer,
intent(in) :: master
28 real(kind=4), allocatable,
dimension(:) :: h2o_lat4, h2o_pres4
29 real(kind=4), allocatable,
dimension(:) :: h2o_time4, tempin
31 if (.not. h2o_phys)
then
40 open(unit=kh2opltc,file=
'global_h2oprdlos.f77', form=
'unformatted', convert=
'big_endian')
44 read (kh2opltc) h2o_coeff, latsh2o, levh2o, timeh2o
45 if (me == master)
then
46 write(*,*)
'Reading in h2odata from global_h2oprdlos.f77 '
47 write(*,*)
' h2o_coeff = ', h2o_coeff
48 write(*,*)
' latsh2o = ', latsh2o
49 write(*,*)
' levh2o = ', levh2o
50 write(*,*)
' timeh2o = ', timeh2o
58 allocate (h2o_lat(latsh2o), h2o_pres(levh2o),h2o_time(timeh2o+1))
59 allocate (h2o_lat4(latsh2o), h2o_pres4(levh2o),h2o_time4(timeh2o+1))
61 read (kh2opltc) h2o_coeff, latsh2o, levh2o, timeh2o, h2o_lat4, h2o_pres4, h2o_time4
62 h2o_pres(:) = h2o_pres4(:)
64 h2o_pres(:) = log(100.0*h2o_pres(:))
65 h2o_lat(:) = h2o_lat4(:)
66 h2o_time(:) = h2o_time4(:)
67 deallocate (h2o_lat4, h2o_pres4, h2o_time4)
72 allocate (tempin(latsh2o))
73 allocate (h2oplin(latsh2o,levh2o,h2o_coeff,timeh2o))
78 h2oplin(:,k,n,i) = tempin(:)
90 subroutine setindxh2o(npts,dlat,jindx1,jindx2,ddy)
94 use machine,
only: kind_phys
95 use h2o_def,
only: jh2o => latsh2o, h2o_lat, h2o_time
100 integer,
dimension(npts) :: jindx1, jindx2
101 real(kind=kind_phys) :: dlat(npts),ddy(npts)
108 if (dlat(j) < h2o_lat(i))
then
113 jindx1(j) = max(jindx2(j)-1,1)
114 jindx2(j) = min(jindx2(j),jh2o)
115 if (jindx2(j) /= jindx1(j))
then
116 ddy(j) = (dlat(j) - h2o_lat(jindx1(j))) &
117 / (h2o_lat(jindx2(j)) - h2o_lat(jindx1(j)))
131 subroutine h2ointerpol(me,npts,idate,fhour,jindx1,jindx2,h2oplout,ddy)
135 use machine ,
only : kind_phys, kind_dbl_prec
138 integer j,j1,j2,l,npts,nc,n1,n2
139 real(kind=kind_phys) fhour,tem, tx1, tx2
142 integer jindx1(npts), jindx2(npts)
144 integer idat(8),jdat(8)
146 real(kind=kind_phys) ddy(npts)
147 real(kind=kind_phys) h2oplout(npts,levh2o,h2o_coeff)
148 real(kind=kind_phys) rjday
149 real(kind=kind_dbl_prec) rinc(5)
150 integer jdow, jdoy, jday
159 CALL w3movdat(rinc,idat,jdat)
164 call w3doxdat(jdat,jdow,jdoy,jday)
165 rjday = jdoy + jdat(5) / 24.
166 if (rjday < h2o_time(1)) rjday = rjday+365.
170 if (rjday < h2o_time(j))
then
180 tx1 = (h2o_time(n2) - rjday) / (h2o_time(n2) - h2o_time(n1))
182 if (n2 > timeh2o) n2 = n2 - timeh2o
191 tx1*(tem*h2oplin(j1,l,nc,n1)+ddy(j)*h2oplin(j2,l,nc,n1)) &
192 + tx2*(tem*h2oplin(j1,l,nc,n2)+ddy(j)*h2oplin(j2,l,nc,n2))