11 use fv_mp_nlm_mod,
only: is,js,ie,je, isd,jsd,ied,jed,
gid,
masterproc, domain, mp_reduce_sum
16 use fms_mod,
only: write_version_number, open_namelist_file, &
33 real(FVPRC),
allocatable::
ak0(:),
bk0(:)
34 real(FVPRC),
allocatable::
lat(:),
lon(:)
49 real(FVPRC),
allocatable::
s2c(:,:,:)
51 real(FVPRC),
allocatable ::
ps_dat(:,:,:)
53 real(FVPRC),
allocatable::
gz0(:,:)
109 real(FVPRC),
parameter::
del_r = 50.e3
134 subroutine do_nwp_nudge ( Time, dt, npz, ps_dt, u_dt, v_dt, t_dt, q_dt, zvir, &
135 ak, bk, ts, ps, delp, ua, va, pt, nwat, q, phis )
138 integer,
intent(in):: npz
139 integer,
intent(in):: nwat
140 real(FVPRC),
intent(in):: dt
141 real(FVPRC),
intent(in):: zvir
142 real(FVPRC),
intent(in ),
dimension(npz+1):: ak, bk
143 real(FVPRC),
intent(in ),
dimension(isd:ied,jsd:jed ):: phis
144 real(FVPRC),
intent(inout),
dimension(isd:ied,jsd:jed,npz):: pt, ua, va, delp
145 real(FVPRC),
intent(inout):: q(isd:ied,jsd:jed,npz,nwat)
146 real(FVPRC),
intent(inout),
dimension(isd:ied,jsd:jed):: ps
148 real(FVPRC),
intent(inout),
dimension(isd:ied,jsd:jed,npz):: u_dt, v_dt
149 real(FVPRC),
intent(out):: t_dt(is:ie,js:je,npz)
150 real(FVPRC),
intent(out):: q_dt(is:ie,js:je,npz)
151 real(FVPRC),
intent(out),
dimension(is:ie,js:je):: ps_dt, ts
153 real(FVPRC):: tpw_dat(is:ie,js:je)
154 real(FVPRC):: tpw_mod(is:ie,js:je)
155 real(FVPRC):: mask(is:ie,js:je)
156 real(FVPRC):: gz_int(is:ie,js:je), gz(is:ie,npz+1), peln(is:ie,npz+1), pk(is:ie,npz+1)
157 real(FVPRC):: pe1(is:ie)
158 real(FVPRC):: pkz, ptmp
159 real(FVPRC),
allocatable :: ps_obs(:,:)
160 real(FVPRC),
allocatable,
dimension(:,:,:):: u_obs, v_obs, t_obs, q_obs
161 integer :: seconds, days
162 integer :: i,j,k, iq, kht
163 real(FVPRC) :: factor
164 real(FVPRC) :: dbk, rdt, press(npz), profile(npz), prof_t(npz), prof_q(npz), du, dv
168 call mpp_error(fatal,
'==> Error from do_nwp_nudge: module not initialized')
185 press(k) = 0.5*(ak(k) + ak(k+1)) + 0.5*(bk(k)+bk(k+1))*1.e5
186 if ( press(k) < 30.e2 )
then 187 profile(k) =
max(0.01, press(k)/30.e2)
195 if ( press(k) < 30.e2 )
then 196 prof_t(k) =
max(0.01, press(k)/30.e2)
204 if ( press(k) < 300.e2 )
then 205 prof_q(k) =
max(0., press(k)/300.e2)
214 ptmp = ak(k+1) + bk(k+1)*1.e5
224 factor =
max(1.e-5, factor)
229 allocate (ps_obs(is:ie,js:je) )
230 allocate ( t_obs(is:ie,js:je,npz) )
231 allocate ( q_obs(is:ie,js:je,npz) )
234 allocate (u_obs(is:ie,js:je,npz) )
235 allocate (v_obs(is:ie,js:je,npz) )
239 call get_obs(time, dt, zvir, ak, bk, ps, ts, ps_obs, delp, u_obs, v_obs, t_obs, q_obs, &
240 tpw_dat, phis, gz_int, npz)
253 u_obs(i,j,k) = profile(k)*(u_obs(i,j,k)-ua(i,j,k))*rdt
254 v_obs(i,j,k) = profile(k)*(v_obs(i,j,k)-va(i,j,k))*rdt
265 u_obs(i,j,k) = u_obs(i,j,k) * mask(i,j)
266 v_obs(i,j,k) = v_obs(i,j,k) * mask(i,j)
268 u_dt(i,j,k) = u_dt(i,j,k) + u_obs(i,j,k)
269 v_dt(i,j,k) = v_dt(i,j,k) + v_obs(i,j,k)
270 ua(i,j,k) = ua(i,j,k) + u_obs(i,j,k)*dt
271 va(i,j,k) = va(i,j,k) + v_obs(i,j,k)*dt
303 peln(i,1) = log(pe1(i))
304 pk(i,1) = pe1(i)**
kappa 308 pe1(i) = pe1(i) + delp(i,j,k-1)
309 peln(i,k) = log(pe1(i))
310 pk(i,k) = pe1(i)**
kappa 315 gz(i,npz+1) = phis(i,j)
319 gz(i,k) = gz(i,k+1) +
rdgas*pt(i,j,k)*(1.+zvir*q(i,j,k,1))*(peln(i,k+1)-peln(i,k))
326 pkz = (pk(i,k+1)-pk(i,k))/(
kappa*(peln(i,k+1)-peln(i,k)))
327 pt(i,j,k) = pt(i,j,k) + mask(i,j)*rdt*pkz*(gz_int(i,j)-gz(i,
k_trop+1)) / &
328 (
cp_air*(1.+zvir*q(i,j,k,1))*(pk(i,npz+1)-pk(i,
k_trop+1)))
335 rdt = 1./(
tau_t/factor + dt)
339 t_dt(i,j,k) = prof_t(k)*(t_obs(i,j,k)-pt(i,j,k))*rdt
348 t_dt(i,j,k) = prof_t(k)*(t_obs(i,j,k)/(1.+zvir*q(i,j,k,1))-pt(i,j,k))*rdt
363 pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt*mask(i,j)
371 rdt = 1./(
tau_q/factor + dt)
373 if ( press(k) >
p_wvp )
then 377 q(i,j,k,iq) = q(i,j,k,iq)*delp(i,j,k)
384 delp(i,j,k) = delp(i,j,k)*(1.-q(i,j,k,1))
385 q_dt(i,j,k) = prof_q(k)*(
max(
q_min,q_obs(i,j,k))-q(i,j,k,1))*rdt*mask(i,j)
386 q(i,j,k,1) = q(i,j,k,1) + q_dt(i,j,k)*dt
387 delp(i,j,k) = delp(i,j,k)/(1.-q(i,j,k,1))
393 q(i,j,k,iq) = q(i,j,k,iq)/delp(i,j,k)
405 tpw_mod(i,j) = tpw_mod(i,j) + q(i,j,k,1)*delp(i,j,k)
412 tpw_dat = tpw_dat(i,j) /
max(tpw_mod(i,j),
q_min)
422 q(i,j,k,iq) = q(i,j,k,iq)*delp(i,j,k)
429 delp(i,j,k) = delp(i,j,k)*(1.-q(i,j,k,1))
431 q(i,j,k,1) = q(i,j,k,1)*(
tau_tpw/factor + mask(i,j)*dt*
q_rat)/(
tau_tpw/factor + mask(i,j)*dt)
432 delp(i,j,k) = delp(i,j,k)/(1.-q(i,j,k,1))
439 q(i,j,k,iq) = q(i,j,k,iq)/delp(i,j,k)
448 deallocate ( ps_obs )
453 call breed_slp(time, dt, npz, ak, bk, ps, phis, delp, ua, va, u_dt, v_dt, pt, q, nwat, zvir)
458 subroutine get_obs(Time, dt, zvir, ak, bk, ps, ts, ps_obs, delp, u_obs, v_obs, t_obs, q_obs, &
459 tpw_dat, phis, gz_int, npz)
460 type(time_type),
intent(in):: Time
461 integer,
intent(in):: npz
462 real(FVPRC),
intent(in):: zvir
463 real(FVPRC),
intent(in):: dt
464 real(FVPRC),
intent(in),
dimension(npz+1):: ak, bk
465 real(FVPRC),
intent(in),
dimension(isd:ied,jsd:jed):: phis
466 real(FVPRC),
intent(in),
dimension(isd:ied,jsd:jed,npz):: delp
467 real(FVPRC),
intent(inout),
dimension(isd:ied,jsd:jed):: ps
468 real(FVPRC),
intent(out),
dimension(is:ie,js:je):: ts, ps_obs
469 real(FVPRC),
intent(out),
dimension(is:ie,js:je,npz):: u_obs, v_obs, t_obs, q_obs
470 real(FVPRC),
intent(out):: gz_int(is:ie,js:je)
471 real(FVPRC),
intent(out):: tpw_dat(is:ie,js:je)
473 real*4,
allocatable:: ut(:,:,:), vt(:,:,:)
474 real(FVPRC),
dimension(is:ie,js:je):: h1, h2
475 integer :: seconds, days
477 real(FVPRC) :: alpha, beta
481 seconds = seconds - nint(dt)
505 call get_ncep_analysis (
ps_dat(:,:,2),
u_dat(:,:,:,2),
v_dat(:,:,:,2), &
520 if ( beta < 0. .or. beta > (1.+1.e-7) )
then 521 call mpp_error(fatal,
'==> Error from get_obs:data out of range')
529 allocate ( ut(is:ie,js:je,npz) )
530 allocate ( vt(is:ie,js:je,npz) )
534 call remap_uv(npz, ak, bk, ps(is:ie,js:je), delp, ut, vt, &
535 km,
ps_dat(is:ie,js:je,1),
u_dat(:,:,:,1),
v_dat(:,:,:,1) )
537 u_obs(:,:,:) = alpha*ut(:,:,:)
538 v_obs(:,:,:) = alpha*vt(:,:,:)
540 call remap_uv(npz, ak, bk, ps(is:ie,js:je), delp, ut, vt, &
541 km,
ps_dat(is:ie,js:je,2),
u_dat(:,:,:,2),
v_dat(:,:,:,2) )
543 u_obs(:,:,:) = u_obs(:,:,:) + beta*ut(:,:,:)
544 v_obs(:,:,:) = v_obs(:,:,:) + beta*vt(:,:,:)
549 call remap_tq(npz, ak, bk, ps(is:ie,js:je), delp, ut, vt, &
550 km,
ps_dat(is:ie,js:je,1),
t_dat(:,:,:,1),
q_dat(:,:,:,1), zvir)
552 t_obs(:,:,:) = alpha*ut(:,:,:)
553 q_obs(:,:,:) = alpha*vt(:,:,:)
555 call remap_tq(npz, ak, bk, ps(is:ie,js:je), delp, ut, vt, &
556 km,
ps_dat(is:ie,js:je,2),
t_dat(:,:,:,2),
q_dat(:,:,:,2), zvir)
558 t_obs(:,:,:) = t_obs(:,:,:) + beta*ut(:,:,:)
559 q_obs(:,:,:) = q_obs(:,:,:) + beta*vt(:,:,:)
570 tpw_dat(i,j) = tpw_dat(i,j) + q_obs(i,j,k) * &
579 call get_int_hght(h1, npz, ak, bk, ps(is:ie,js:je), delp,
ps_dat(is:ie,js:je,1),
t_dat(:,:,:,1))
582 call get_int_hght(h2, npz, ak, bk, ps(is:ie,js:je), delp,
ps_dat(is:ie,js:je,2),
t_dat(:,:,:,2))
585 gz_int(:,:) = alpha*h1(:,:) + beta*h2(:,:)
595 integer,
intent(in):: npz
596 real(FVPRC),
intent(in):: zvir
597 real(FVPRC),
intent(in),
dimension(isd:ied,jsd:jed):: phis
598 real(FVPRC),
intent(in),
dimension(npz+1):: ak, bk
599 real(FVPRC),
intent(out),
dimension(is:ie,js:je):: ts
602 integer :: i, j, unit, io, ierr, nt, k
615 if( file_exist(
'input.nml' ) )
then 616 unit = open_namelist_file()
618 do while ( io .ne. 0 )
619 read( unit, nml = nwp_nudge_nml, iostat = io, end = 10 )
622 10
call close_file ( unit )
626 write( stdlog(), nml = nwp_nudge_nml )
627 write(*,*)
'NWP nudging initialized.' 638 if (
file_names(nt) ==
"No_File_specified" )
then 651 im = tsize(1);
jm = tsize(2);
km = tsize(3)
652 if(
master)
write(*,*)
'NCEP analysis dimensions:', tsize
654 call mpp_error(fatal,
'==> Error from get_ncep_analysis: T field not found')
657 allocate (
s2c(is:ie,js:je,4) )
658 allocate (
id1(is:ie,js:je) )
659 allocate (
id2(is:ie,js:je) )
660 allocate (
jdc(is:ie,js:je) )
676 allocate (
ak0(
km+1) )
677 allocate (
bk0(
km+1) )
690 write(*,*) k, 0.5*(ak(k)+ak(k+1))+0.5*(bk(k)+bk(k+1))*1.e5,
'del-B=', bk(k+1)-bk(k)
704 allocate (
gz0(is:ie,js:je) )
705 allocate (
ps_dat(is:ie,js:je,2) )
706 allocate (
u_dat(is:ie,js:je,
km,2) )
707 allocate (
v_dat(is:ie,js:je,
km,2) )
708 allocate (
t_dat(is:ie,js:je,
km,2) )
709 allocate (
q_dat(is:ie,js:je,
km,2) )
714 call get_ncep_analysis (
ps_dat(:,:,nt),
u_dat(:,:,:,nt),
v_dat(:,:,:,nt), &
725 real(FVPRC),
intent(in):: zvir
726 character(len=128),
intent(in):: fname
727 integer,
intent(inout):: nfile
729 real(FVPRC),
intent(out),
dimension(is:ie,js:je):: ts
730 real(FVPRC),
intent(out),
dimension(is:ie,js:je):: ps
731 real*4,
intent(out),
dimension(is:ie,js:je,km):: u, v, t, q
733 real(FVPRC),
allocatable:: oro(:,:), wk2(:,:), wk3(:,:,:)
735 integer:: i, j, k, npt
738 logical:: read_ts = .true.
739 logical:: land_ts = .false.
741 if( .not. file_exist(fname) )
then 742 call mpp_error(fatal,
'==> Error from get_ncep_analysis: file not found')
744 if(
master)
write(*,*)
'Reading NCEP anlysis file:', fname
750 allocate ( wk2(
im,
jm) )
751 call read_data (fname,
'PS', wk2, no_domain=.true.)
759 ps(i,j) =
s2c(i,j,1)*wk2(i1,j1 ) +
s2c(i,j,2)*wk2(i2,j1 ) + &
760 s2c(i,j,3)*wk2(i2,j1+1) +
s2c(i,j,4)*wk2(i1,j1+1)
764 call read_data (fname,
'PHIS', wk2, no_domain=.true.)
771 gz0(i,j) =
s2c(i,j,1)*wk2(i1,j1 ) +
s2c(i,j,2)*wk2(i2,j1 ) + &
772 s2c(i,j,3)*wk2(i2,j1+1) +
s2c(i,j,4)*wk2(i1,j1+1)
779 call read_data (fname,
'TS', wk2, no_domain=.true.)
781 if ( .not. land_ts )
then 782 allocate ( oro(
im,
jm) )
784 call read_data (fname,
'ORO', oro, no_domain=.true.)
790 if( abs(oro(i,j)-1.) > 0.5 )
then 791 tmean = tmean + wk2(i,j)
799 tmean= tmean /
real(npt)
801 if( abs(oro(i,j)-1.) <= 0.5 )
then 804 elseif ( i==
im )
then 809 if ( abs(oro(i2,j)-1.)>0.5 )
then 811 elseif ( abs(oro(i1,j)-1.)>0.5 )
then 829 ts(i,j) =
s2c(i,j,1)*wk2(i1,j1 ) +
s2c(i,j,2)*wk2(i2,j1 ) + &
830 s2c(i,j,3)*wk2(i2,j1+1) +
s2c(i,j,4)*wk2(i1,j1+1)
837 if(
gid==0)
call pmaxmin(
'SST_ncep_fms', sst_ncep, i_sst, j_sst, 1.)
844 allocate ( wk3(
im,
jm,
km) )
849 call read_data (fname,
'U', wk3, no_domain=.true.)
858 u(i,j,k) =
s2c(i,j,1)*wk3(i1,j1 ,k) +
s2c(i,j,2)*wk3(i2,j1 ,k) + &
859 s2c(i,j,3)*wk3(i2,j1+1,k) +
s2c(i,j,4)*wk3(i1,j1+1,k)
864 call read_data (fname,
'V', wk3, no_domain=.true.)
872 v(i,j,k) =
s2c(i,j,1)*wk3(i1,j1 ,k) +
s2c(i,j,2)*wk3(i2,j1 ,k) + &
873 s2c(i,j,3)*wk3(i2,j1+1,k) +
s2c(i,j,4)*wk3(i1,j1+1,k)
883 call read_data (fname,
'Q', wk3, no_domain=.true.)
891 q(i,j,k) =
s2c(i,j,1)*wk3(i1,j1 ,k) +
s2c(i,j,2)*wk3(i2,j1 ,k) + &
892 s2c(i,j,3)*wk3(i2,j1+1,k) +
s2c(i,j,4)*wk3(i1,j1+1,k)
897 call read_data (fname,
'T', wk3, no_domain=.true.)
906 t(i,j,k) =
s2c(i,j,1)*wk3(i1,j1 ,k) +
s2c(i,j,2)*wk3(i2,j1 ,k) + &
907 s2c(i,j,3)*wk3(i2,j1+1,k) +
s2c(i,j,4)*wk3(i1,j1+1,k)
909 t(i,j,k) = t(i,j,k)*(1.+zvir*q(i,j,k))
927 real(FVPRC) :: rdlon(im)
928 real(FVPRC) :: rdlat(jm)
930 integer i,j, i1, i2, jc, i0, j0
933 rdlon(i) = 1. / (
lon(i+1) -
lon(i))
935 rdlon(im) = 1. / (
lon(1) + 2.*
pi -
lon(im))
938 rdlat(j) = 1. / (
lat(j+1) -
lat(j))
946 if ( agrid(i,j,1)>
lon(im) )
then 948 a1 = (agrid(i,j,1)-
lon(im)) * rdlon(im)
949 elseif ( agrid(i,j,1)<
lon(1) )
then 951 a1 = (agrid(i,j,1)+2.*
pi-
lon(im)) * rdlon(im)
954 if ( agrid(i,j,1)>=
lon(i0) .and. agrid(i,j,1)<=
lon(i0+1) )
then 956 a1 = (agrid(i,j,1)-
lon(i1)) * rdlon(i0)
963 if ( agrid(i,j,2)<
lat(1) )
then 966 elseif ( agrid(i,j,2)>
lat(jm) )
then 971 if ( agrid(i,j,2)>=
lat(j0) .and. agrid(i,j,2)<=
lat(j0+1) )
then 973 b1 = (agrid(i,j,2)-
lat(jc)) * rdlat(jc)
980 if ( a1<0.0 .or. a1>1.0 .or. b1<0.0 .or. b1>1.0 )
then 981 write(*,*)
'gid=',
gid, i,j,a1, b1
984 s2c(i,j,1) = (1.-a1) * (1.-b1)
985 s2c(i,j,2) = a1 * (1.-b1)
987 s2c(i,j,4) = (1.-a1) * b1
998 real(FVPRC),
intent(in):: sst(im,jm)
1000 real(FVPRC) :: rdlon(im)
1001 real(FVPRC) :: rdlat(jm)
1002 real(FVPRC):: a1, b1
1003 real(FVPRC):: delx, dely
1004 real(FVPRC):: xc, yc
1005 real(FVPRC):: c1, c2, c3, c4
1006 integer i,j, i1, i2, jc, i0, j0, it, jt
1009 rdlon(i) = 1. / (
lon(i+1) -
lon(i))
1011 rdlon(im) = 1. / (
lon(1) + 2.*
pi -
lon(im))
1014 rdlat(j) = 1. / (
lat(j+1) -
lat(j))
1021 delx = 360./
real(i_sst) 1022 dely = 180./
real(j_sst) 1027 yc = (-90. + dely * (0.5+
real(j-1))) * deg2rad
1028 if ( yc<
lat(1) )
then 1031 elseif ( yc>
lat(jm) )
then 1036 if ( yc>=
lat(j0) .and. yc<=
lat(j0+1) )
then 1039 b1 = (yc-
lat(jc)) * rdlat(jc)
1048 xc = delx * (0.5+
real(i-1)) * deg2rad
1049 if ( xc>
lon(im) )
then 1051 a1 = (xc-
lon(im)) * rdlon(im)
1052 elseif ( xc<
lon(1) )
then 1054 a1 = (xc+2.*
pi-
lon(im)) * rdlon(im)
1057 if ( xc>=
lon(i0) .and. xc<=
lon(i0+1) )
then 1060 a1 = (xc-
lon(i1)) * rdlon(i0)
1070 c1 = (1.-a1) * (1.-b1)
1075 sst_ncep(i,j) = c1*sst(i1,jc ) + c2*sst(i2,jc ) + &
1076 c3*sst(i2,jc+1) + c4*sst(i1,jc+1)
1083 subroutine get_int_hght(h_int, npz, ak, bk, ps, delp, ps0, tv)
1084 integer,
intent(in):: npz
1085 real(FVPRC),
intent(in):: ak(npz+1), bk(npz+1)
1086 real(FVPRC),
intent(in),
dimension(is:ie,js:je):: ps, ps0
1087 real(FVPRC),
intent(in),
dimension(isd:ied,jsd:jed,npz):: delp
1088 real*4,
intent(in),
dimension(is:ie,js:je,km):: tv
1089 real(FVPRC),
intent(out),
dimension(is:ie,js:je):: h_int
1091 real(FVPRC),
dimension(is:ie,km+1):: pn0, gz
1092 real(FVPRC):: logp(is:ie)
1101 pn0(i,k) = log(
ak0(k) +
bk0(k)*ps0(i,j) )
1112 logp(i) = logp(i) + delp(i,j,k)
1116 logp(i) = log( logp(i) )
1117 gz(i,
km+1) =
gz0(i,j)
1123 gz(i,k) = gz(i,k+1) +
rdgas*tv(i,j,k)*(pn0(i,k+1)-pn0(i,k))
1124 if ( logp(i)>=pn0(i,k) .and. logp(i)<=pn0(i,k+1) )
then 1125 h_int(i,j) = gz(i,k+1) + (gz(i,k)-gz(i,k+1))*(pn0(i,k+1)-logp(i))/(pn0(i,k+1)-pn0(i,k))
1139 subroutine remap_tq( npz, ak, bk, ps, delp, t, q, &
1140 kmd, ps0, ta, qa, zvir)
1141 integer,
intent(in):: npz, kmd
1142 real(FVPRC),
intent(in):: zvir
1143 real(FVPRC),
intent(in):: ak(npz+1), bk(npz+1)
1144 real(FVPRC),
intent(in),
dimension(is:ie,js:je):: ps0
1145 real(FVPRC),
intent(inout),
dimension(is:ie,js:je):: ps
1146 real(FVPRC),
intent(in),
dimension(isd:ied,jsd:jed,npz):: delp
1147 real*4,
intent(in),
dimension(is:ie,js:je,kmd):: ta
1148 real*4,
intent(in),
dimension(is:ie,js:je,kmd):: qa
1149 real*4,
intent(out),
dimension(is:ie,js:je,npz):: t
1150 real*4,
intent(out),
dimension(is:ie,js:je,npz):: q
1152 real(FVPRC),
dimension(is:ie,kmd):: tp, qp
1153 real(FVPRC),
dimension(is:ie,kmd+1):: pe0, pn0
1154 real(FVPRC),
dimension(is:ie,npz):: qn1
1155 real(FVPRC),
dimension(is:ie,npz+1):: pe1, pn1
1163 pe0(i,k) =
ak0(k) +
bk0(k)*ps0(i,j)
1164 pn0(i,k) = log(pe0(i,k))
1175 pe1(i,k+1) = pe1(i,k) + delp(i,j,k)
1179 ps(i,j) = pe1(i,npz+1)
1183 pn1(i,k) = log(pe1(i,k))
1211 t(i,j,k) = qn1(i,k)/(1.+zvir*q(i,j,k))
1227 subroutine remap_uv(npz, ak, bk, ps, delp, u, v, kmd, ps0, u0, v0)
1228 integer,
intent(in):: npz
1229 real(FVPRC),
intent(in):: ak(npz+1), bk(npz+1)
1230 real(FVPRC),
intent(inout):: ps(is:ie,js:je)
1231 real(FVPRC),
intent(in),
dimension(isd:ied,jsd:jed,npz):: delp
1232 real*4,
intent(inout),
dimension(is:ie,js:je,npz):: u, v
1234 integer,
intent(in):: kmd
1235 real(FVPRC),
intent(in):: ps0(is:ie,js:je)
1236 real*4,
intent(in),
dimension(is:ie,js:je,kmd):: u0, v0
1239 real(FVPRC),
dimension(is:ie,kmd+1):: pe0
1240 real(FVPRC),
dimension(is:ie,npz+1):: pe1
1241 real(FVPRC),
dimension(is:ie,kmd):: qt
1242 real(FVPRC),
dimension(is:ie,npz):: qn1
1251 pe0(i,k) =
ak0(k) +
bk0(k)*ps0(i,j)
1262 pe1(i,k+1) = pe1(i,k) + delp(i,j,k)
1266 ps(i,j) = pe1(i,npz+1)
1305 deallocate (
t_dat )
1306 deallocate (
q_dat )
1309 deallocate (
u_dat )
1310 deallocate (
v_dat )
1329 real(FVPRC) :: slp_mask = 100900.
1331 type(time_type),
intent(in):: time
1332 real(FVPRC),
intent(inout):: mask(is:ie,js:je)
1334 real(FVPRC):: pos(2)
1336 real(FVPRC):: r_vor, p_vor
1344 call get_slp_obs(time,
nobs_tc(n),
x_obs(1,n),
y_obs(1,n),
mslp_obs(1,n),
mslp_out(i,n),
rad_out(1,n), &
1345 time_tc(1,n), pos(1), pos(2), slp_o, r_vor, p_vor)
1347 if ( slp_o<880.e2 .or. slp_o>
min(
slp_env,slp_mask) .or. abs(pos(2))*
rad2deg>38. )
goto 5000
1349 if ( r_vor < 30.e3 )
then 1356 if( dist < 5.*r_vor )
then 1358 mask(i,j) = mask(i,j) * ( 1. - exp(-(0.5*dist/r_vor)**2)*
min(1.,(
slp_env-slp_o)/5.e2) )
1361 mask(i,j) = mask(i,j) * ( 1. - exp(-(0.75*dist/r_vor)**2)*
min(1.,(
slp_env-slp_o)/10.e2) )
1372 subroutine breed_slp_inline(nstep, dt, npz, ak, bk, phis, pe, pk, peln, delp, u, v, pt, q, nwat, zvir)
1378 integer,
intent(in):: nstep, npz, nwat
1379 real(FVPRC),
intent(in):: dt
1380 real(FVPRC),
intent(in):: zvir
1381 real(FVPRC),
intent(in),
dimension(npz+1):: ak, bk
1382 real(FVPRC),
intent(in):: phis(isd:ied,jsd:jed)
1384 real(FVPRC),
intent(inout):: u(isd:ied,jsd:jed+1,npz)
1385 real(FVPRC),
intent(inout):: v(isd:ied+1,jsd:jed,npz)
1386 real(FVPRC),
intent(inout),
dimension(isd:ied,jsd:jed,npz):: delp, pt
1387 real(FVPRC),
intent(inout)::q(isd:ied,jsd:jed,npz,*)
1389 real(FVPRC),
intent(inout):: pk(is:ie,js:je, npz+1)
1390 real(FVPRC),
intent(inout):: pe(is-1:ie+1, npz+1,js-1:je+1)
1391 real(FVPRC),
intent(out):: peln(is:ie,npz+1,js:je)
1394 real(FVPRC):: ps(is:ie,js:je)
1395 real(FVPRC):: dist(is:ie,js:je)
1396 real(FVPRC):: tm(is:ie,js:je)
1397 real(FVPRC):: slp(is:ie,js:je)
1398 real(FVPRC):: pos(2)
1402 real(FVPRC):: relx0, relx, f1, pbreed, pbtop, pkz
1403 real(FVPRC):: p_obs, ratio, p_count, p_sum, mass_sink, delps
1404 real(FVPRC):: p_lo, p_hi, tau_vt
1405 real(FVPRC):: split_time, fac, pdep
1406 integer year, month, day, hour, minute, second
1407 integer n, i, j, k, iq, k0
1410 if(
master)
write(*,*)
'NO TC data to process' 1422 if (
master)
write(*,*)
'Warning: The year in storm track data is not the same as model year' 1426 split_time =
calday(year, month, day, hour, minute, second) + dt*
real(nstep)/86400.
1435 ps(i,j) = ps(i,j) + delp(i,j,k)
1440 pkz = (pk(i,j,npz+1)-pk(i,j,npz))/(
kappa*log(ps(i,j)/(ps(i,j)-delp(i,j,npz))))
1441 tm(i,j) = pkz*pt(i,j,npz)/(
cp_air*(1.+zvir*q(i,j,npz,1)))
1449 u(i,j,k) = u(i,j,k) * (delp(i,j-1,k)+delp(i,j,k))
1454 v(i,j,k) = v(i,j,k) * (delp(i-1,j,k)+delp(i,j,k))
1459 pt(i,j,k) = pt(i,j,k)*(pk(i,j,k+1)-pk(i,j,k))
1466 q(i,j,k,iq) = q(i,j,k,iq) * delp(i,j,k)
1478 call get_slp_obs(time,
nobs_tc(n),
x_obs(1,n),
y_obs(1,n),
mslp_obs(1,n),
mslp_out(i,n),
rad_out(1,n), &
1479 time_tc(1,n), pos(1), pos(2), slp_o, r_vor, p_env, stime=split_time, fact=fac)
1481 if ( slp_o<87500. .or. slp_o>
slp_env .or. abs(pos(2))*
rad2deg>40. )
then 1486 write(*,*)
'Vortex breeding for TC:', n,
' slp=',slp_o/100.,pos(1)*
rad2deg,pos(2)*
rad2deg 1488 #ifndef CONST_BREED_DEPTH 1491 if ( slp_o > 1000.e2 )
then 1494 pbtop =
max(125.e2, 850.e2-30.*(1000.e2-slp_o))
1498 pbreed = ak(k) + bk(k)*1000.e2
1499 if ( pbreed>pbtop )
then 1515 slp(i,j) = ps(i,j)*exp(phis(i,j)/(
rdgas*(tm(i,j)+3.25e-3*phis(i,j)/
grav)))
1520 if ( r_vor < 30.e3 .or. p_env<900.e2 )
then 1530 if( dist(i,j)<(r_vor+
del_r) .and. dist(i,j)>r_vor .and. phis(i,j)<200.*
grav )
then 1531 p_count = p_count + 1.
1532 p_sum = p_sum + slp(i,j)
1537 call mp_reduce_sum(p_count)
1539 if ( p_count<32. )
then 1540 if(
nudge_debug .and.
master)
write(*,*) p_count,
'Skipping obs: too few p_count' 1544 call mp_reduce_sum(p_sum)
1545 p_env = p_sum / p_count
1547 if(
nudge_debug .and.
master)
write(*,*)
'Environmental SLP=', p_env/100.,
' computed radius=', r_vor/1.e3
1549 if ( p_env>1020.e2 .or. p_env<900.e2 )
then 1551 if(
master)
write(*,*)
'Environmental SLP out of bound; skipping obs. p_count=', p_count, p_sum
1560 if ( p_env <
max(1000.e2, slp_o+250.0) )
then 1562 write(*,*)
'Computed environmental SLP too low' 1563 write(*,*)
' ', p_env/100., slp_o/100.,pos(1)*
rad2deg, pos(2)*
rad2deg 1565 if ( r_vor < 750.e3 )
then 1566 r_vor = r_vor +
del_r 1567 if(
nudge_debug .and.
master)
write(*,*)
'Vortex radius (km) increased to:', r_vor/1.e3
1570 p_env =
max( slp_o + 250.0, 1000.e2)
1577 tau_vt =
max(dt, tau_vt)
1580 relx0 =
min(1., fac*dt/tau_vt)
1582 relx0 =
min(1., dt/tau_vt)
1587 if( dist(i,j) < r_vor .and. phis(i,j)<200.*
grav )
then 1588 f1 = dist(i,j)/r_vor
1589 relx = relx0*exp( -4.*f1**2 )
1591 p_hi = p_env - (p_env-slp_o) * exp( -5.0*f1**2 )
1592 p_lo = p_env - (p_env-slp_o) * exp( -2.0*f1**2 )
1594 if ( ps(i,j) > p_hi )
then 1596 delps = relx*(ps(i,j) - p_hi)
1598 elseif ( slp(i,j) < p_lo )
then 1600 delps = relx*(slp(i,j) - p_lo)
1605 mass_sink = mass_sink + delps*area(i,j)
1608 if ( delps > 0. )
then 1611 pbreed = pbreed + delp(i,j,k)
1613 f1 = 1. - delps/(ps(i,j)-pbreed)
1615 delp(i,j,k) = delp(i,j,k)*f1
1619 if ( abs(delps) < 1. )
then 1620 delp(i,j,k) = delp(i,j,k) - delps
1624 pdep =
max(1.0,
min(abs(0.4*delps), 0.025*delp(i,j,k)))
1625 pdep = sign(
min(pdep, abs(delps)), delps )
1626 delp(i,j,k) = delp(i,j,k) - pdep
1627 delps = delps - pdep
1631 delp(i,j,k0+1) = delp(i,j,k0+1) - delps
1640 call mp_reduce_sum(mass_sink)
1641 if ( abs(mass_sink)<1.e-40 )
goto 5000
1646 if( dist(i,j)<6.*r_vor .and. dist(i,j)>r_vor+
del_r )
then 1647 p_sum = p_sum + area(i,j)
1652 call mp_reduce_sum(p_sum)
1653 mass_sink = mass_sink / p_sum
1654 if(
master .and.
nudge_debug)
write(*,*)
'TC#',n,
'Mass tele-ported (pa)=', mass_sink
1658 if( dist(i,j)<6.*r_vor .and. dist(i,j)>r_vor+
del_r )
then 1661 pbreed = pbreed + delp(i,j,k)
1663 f1 = 1. + mass_sink/(ps(i,j)-pbreed)
1665 delp(i,j,k) = delp(i,j,k)*f1
1678 ps(i,j) = ps(i,j) + delp(i,j,k)
1693 pe(i,k,j) = pe(i,k-1,j) + delp(i,j,k-1)
1701 peln(i,k,j) = log(pe(i,k,j))
1702 pk(i,j,k) = pe(i,k,j)**
kappa 1711 u(i,j,k) = u(i,j,k) / (delp(i,j-1,k)+delp(i,j,k))
1716 v(i,j,k) = v(i,j,k) / (delp(i-1,j,k)+delp(i,j,k))
1721 pt(i,j,k) = pt(i,j,k) / (pk(i,j,k+1)-pk(i,j,k))
1731 q(i,j,k,iq) = q(i,j,k,iq) / delp(i,j,k)
1742 subroutine breed_slp(time, dt, npz, ak, bk, ps, phis, delp, ua, va, u_dt, v_dt, pt, q, nwat, zvir)
1748 type(time_type),
intent(in):: time
1749 integer,
intent(in):: npz, nwat
1750 real(FVPRC),
intent(in):: dt
1751 real(FVPRC),
intent(in):: zvir
1752 real(FVPRC),
intent(in),
dimension(npz+1):: ak, bk
1753 real(FVPRC),
intent(in):: phis(isd:ied,jsd:jed)
1754 real(FVPRC),
intent(in):: ps(isd:ied,jsd:jed)
1756 real(FVPRC),
intent(inout),
dimension(isd:ied,jsd:jed,npz):: delp, pt, ua, va, u_dt, v_dt
1757 real(FVPRC),
intent(inout)::q(isd:ied,jsd:jed,npz,nwat)
1759 real(FVPRC):: dist(is:ie,js:je)
1760 real(FVPRC):: slp(is:ie,js:je)
1761 real(FVPRC):: p0(npz+1), p1(npz+1), dm(npz), tvir(npz)
1762 real(FVPRC):: pos(2)
1766 real(FVPRC):: relx0, relx, f1, rdt
1767 real(FVPRC):: p_obs, ratio, p_count, p_sum, mass_sink, delps
1768 real(FVPRC):: p_lo, p_hi
1769 integer n, i, j, k, iq
1772 if(
master)
write(*,*)
'NO TC data to process' 1781 slp(i,j) = ps(i,j)*exp(phis(i,j)/(
rdgas*(pt(i,j,npz)+3.25e-3*phis(i,j)/
grav)))
1790 call get_slp_obs(time,
nobs_tc(n),
x_obs(1,n),
y_obs(1,n),
mslp_obs(1,n),
mslp_out(i,n),
rad_out(1,n), &
1791 time_tc(1,n), pos(1), pos(2), slp_o, r_vor, p_env)
1793 if ( slp_o<87000. .or. slp_o>
slp_env .or. abs(pos(2))*
rad2deg>40. )
then 1798 write(*,*)
'Vortex breeding for TC:', n,
' slp=',slp_o/100.,pos(1)*
rad2deg,pos(2)*
rad2deg 1806 if ( r_vor < 30.e3 .or. p_env<900.e2 )
then 1816 if( dist(i,j)<(r_vor+
del_r) .and. dist(i,j)>r_vor .and. phis(i,j)<250.*
grav )
then 1817 p_count = p_count + 1.
1818 p_sum = p_sum + slp(i,j)
1823 call mp_reduce_sum(p_count)
1825 if ( p_count<32. )
then 1826 if(
nudge_debug .and.
master)
write(*,*) p_count,
'Skipping obs: too few p_count' 1830 call mp_reduce_sum(p_sum)
1831 p_env = p_sum / p_count
1833 if(
nudge_debug .and.
master)
write(*,*)
'Environmental SLP=', p_env/100.,
' computed radius=', r_vor/1.e3
1835 if ( p_env>1020.e2 .or. p_env<900.e2 )
then 1837 if(
master)
write(*,*)
'Environmental SLP out of bound; skipping obs. p_count=', p_count, p_sum
1845 if ( p_env <
max(slp_o, 1000.e2) )
then 1847 write(*,*)
'Computed environmental SLP too low' 1848 write(*,*)
' ', p_env/100., slp_o/100.,pos(1)*
rad2deg, pos(2)*
rad2deg 1851 if ( r_vor < 500.e3 )
then 1852 r_vor = r_vor +
del_r 1853 if(
nudge_debug .and.
master)
write(*,*)
'Vortex radius (km) increased to:', r_vor/1.e3
1856 p_env =
max(slp_o + 200., 1000.e2)
1863 if( dist(i,j) < r_vor .and. phis(i,j)<250.*
grav )
then 1866 tvir(k) = pt(i,j,k) * (1.+ zvir*q(i,j,k,1))
1867 p0(k+1) = p0(k) + delp(i,j,k)
1870 f1 = dist(i,j)/r_vor
1872 p_hi = p_env - (p_env-slp_o) * exp( -5.0*f1**2 )
1873 p_lo = p_env - (p_env-slp_o) * exp( -2.0*f1**2 )
1874 relx = relx0 * exp( -4.*f1**2 )
1877 if ( ps(i,j) > p_hi )
then 1879 delps = relx*(ps(i,j) - p_hi)
1881 elseif ( slp(i,j) < p_lo )
then 1883 delps = relx*(slp(i,j) - p_lo)
1894 mass_sink = mass_sink + delps*area(i,j)
1897 dm(k) = delp(i,j,k) - delps*(bk(k+1)-bk(k))
1898 p1(k+1) = p1(k) + dm(k)
1899 ratio = delp(i,j,k)/dm(k)
1902 q(i,j,k,iq) = q(i,j,k,iq) * ratio
1905 pt(i,j,k) = tvir(k)*log(p0(k+1)/p0(k))/(log(p1(k+1)/p1(k))*(1.+zvir*q(i,j,k,1)))
1907 u_dt(i,j,k) = u_dt(i,j,k) + ua(i,j,k)*(ratio - 1.)*rdt
1908 v_dt(i,j,k) = v_dt(i,j,k) + va(i,j,k)*(ratio - 1.)*rdt
1909 ua(i,j,k) = ua(i,j,k) * ratio
1910 va(i,j,k) = va(i,j,k) * ratio
1917 call mp_reduce_sum(mass_sink)
1918 if ( mass_sink==0. )
goto 5000
1923 if( dist(i,j)<(6.*r_vor+
del_r) .and. dist(i,j)>r_vor+
del_r )
then 1924 p_sum = p_sum + area(i,j)
1929 call mp_reduce_sum(p_sum)
1930 mass_sink = mass_sink / p_sum
1931 if(
master .and.
nudge_debug)
write(*,*)
'TC#',n,
'Mass tele-ported (pa)=', mass_sink
1935 if( dist(i,j)<(6.*r_vor+
del_r) .and. dist(i,j)>r_vor+
del_r )
then 1938 tvir(k) = pt(i,j,k) * (1.+ zvir*q(i,j,k,1))
1939 p0(k+1) = p0(k) + delp(i,j,k)
1943 dm(k) = delp(i,j,k) + (bk(k+1)-bk(k))*mass_sink
1944 p1(k+1) = p1(k) + dm(k)
1945 ratio = delp(i,j,k)/dm(k)
1948 q(i,j,k,iq) = q(i,j,k,iq) * ratio
1950 pt(i,j,k) = tvir(k)*log(p0(k+1)/p0(k))/(log(p1(k+1)/p1(k))*(1.+zvir*q(i,j,k,1)))
1951 u_dt(i,j,k) = u_dt(i,j,k) + ua(i,j,k)*(ratio - 1.)*rdt
1952 v_dt(i,j,k) = v_dt(i,j,k) + va(i,j,k)*(ratio - 1.)*rdt
1953 ua(i,j,k) = ua(i,j,k) * ratio
1954 va(i,j,k) = va(i,j,k) * ratio
1965 subroutine get_slp_obs(time, nobs, lon_obs, lat_obs, mslp, slp_out, r_out, time_obs, &
1966 x_o, y_o, slp_o, r_vor, p_vor, stime, fact)
1968 type(time_type),
intent(in):: time
1969 integer,
intent(in):: nobs
1970 real*4,
intent(in):: lon_obs(nobs)
1971 real*4,
intent(in):: lat_obs(nobs)
1972 real*4,
intent(in):: mslp(nobs)
1973 real*4,
intent(in):: slp_out(nobs)
1974 real*4,
intent(in):: r_out(nobs)
1975 real*4,
intent(in):: time_obs(nobs)
1976 real(FVPRC),
optional,
intent(in):: stime
1977 real(FVPRC),
optional,
intent(out):: fact
1979 real(FVPRC),
intent(out):: x_o , y_o
1980 real(FVPRC),
intent(out):: slp_o
1981 real(FVPRC),
intent(out):: r_vor, p_vor
1983 real(FVPRC):: p1(2), p2(2)
1984 real(FVPRC) time_model
1986 integer year, month, day, hour, minute, second, n
1994 if (
present(stime) )
then 1997 call get_date(time, year, month, day, hour, minute, second)
2000 if (
master)
write(*,*)
'Warning: The year in storm track data is not the same as model year' 2004 time_model =
calday(year, month, day, hour, minute, second)
2008 if ( time_model <= time_obs(1) .or. time_model >= time_obs(nobs) )
then 2013 if( time_model >= time_obs(n) .and. time_model <= time_obs(n+1) )
then 2014 fac = (time_model-time_obs(n)) / (time_obs(n+1)-time_obs(n))
2015 slp_o = mslp(n) + ( mslp(n+1)- mslp(n)) * fac
2019 x_o = lon_obs(n) + (lon_obs(n+1)-lon_obs(n)) * fac
2020 y_o = lat_obs(n) + (lat_obs(n+1)-lat_obs(n)) * fac
2022 p1(1) = lon_obs(n); p1(2) = lat_obs(n)
2023 p2(1) = lon_obs(n+1); p2(2) = lat_obs(n+1)
2027 if (
present(fact) ) fact = 1. + 0.5*cos(fac*2.*
pi)
2042 integer:: unit, n, nobs
2043 character(len=3):: GMT
2044 character(len=9):: ts_name
2045 character(len=19):: comment
2046 integer:: mmddhh, yr, year, month, day, hour, MPH, islp
2047 integer:: it, i1, i2, p_ring, d_ring
2048 real(FVPRC):: lon_deg, lat_deg, cald, slp, mps
2060 if(
master)
write(*,*)
'No TC track file specified' 2068 if(
master)
write(*,*)
'Reading TC track data for YEAR=', year
2082 read(unit, *) ts_name, nobs, yr, month, day, hour
2084 if ( yr /= year )
then 2085 if(
master)
write(*, *)
'Year inconsistency found !!!' 2086 call mpp_error(fatal,
'==> Error in reading best track data')
2089 do while ( ts_name==
'start' )
2096 read(unit, *) lon_deg, lat_deg, mps, slp, yr, month, day, hour
2100 cald =
calday(yr, month, day, hour, 0, 0)
2102 if(
master)
write(*, 100) cald, month, day, hour, lon_deg, lat_deg, mps, slp
2109 read(unit, *) ts_name, nobs, yr, month, day, hour
2111 100
format(1x, f9.2, 1x, i3, 1x, i2, 1x, i2, 1x, f6.1, 1x, f6.1, 1x, f4.1, 1x, f6.1)
2115 do while ( month /= 0 )
2117 read(unit, *) month, day, hour, gmt, lat_deg, lon_deg, mph, islp, comment
2124 if(
master)
write(*, *)
'Reading data for TC#',
nstorms, comment
2126 if(
master)
write(*, *)
'End of record reached' 2129 cald =
calday(year, month, day, hour, 0, 0)
2133 if(
master)
write(*, 200) nobs, cald, month, day, hour, gmt, lat_deg, lon_deg, mph, islp, comment
2136 if ( gmt ==
'GMT' )
then 2138 if ( lon_deg < 0 )
then 2143 elseif ( gmt ==
'PAC' )
then 2155 write(*,*)
'TC vortex breeding: total storms=',
nstorms 2158 write(*, *)
'TC#',n,
' contains ',
nobs_tc(n),
' observations' 2163 200
format(i3, 1x,f9.4, 1x, i2, 1x, i2, 1x, i2, 1x, a3, f5.1, 1x, f5.1, 1x, i3, 1x, i4, 1x, a19)
2168 real(FVPRC) function calday(year, month, day, hour, minute, sec)
2171 integer,
intent(in):: year, month, day, hour
2172 integer,
intent(in):: minute, sec
2174 integer n, m, ds, nday
2177 data days /31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/
2181 if( month /= 1 )
then 2197 calday =
real((year-year_track_data)*nday + ds) +
real(hour*3600 + minute*60 + sec)/86400.
2203 integer,
intent(in):: ny
2211 parameter( ny00 = 0000 )
2213 if( ny >= ny00 )
then 2214 if( mod(ny,100) == 0. .and. mod(ny,400) == 0. )
then 2216 elseif( mod(ny,4) == 0. .and. mod(ny,100) /= 0. )
then 2228 subroutine pmaxmin( qname, a, imax, jmax, fac )
2233 real(FVPRC) a(imax,jmax)
2235 real(FVPRC) qmin(jmax), qmax(jmax)
2236 real(FVPRC) pmax, pmin
2243 pmax =
max(pmax, a(i,j))
2244 pmin =
min(pmin, a(i,j))
2255 pmax =
max(pmax, qmax(j))
2256 pmin =
min(pmin, qmin(j))
2259 write(*,*) qname,
' max = ', pmax*fac,
' min = ', pmin*fac
2264 subroutine del2_uv(du, dv, cd, kmd, ntimes)
2266 integer,
intent(in):: kmd
2267 integer,
intent(in):: ntimes
2268 real(FVPRC),
intent(in):: cd
2269 real(FVPRC),
intent(inout):: du(is:ie,js:je,kmd)
2270 real(FVPRC),
intent(inout):: dv(is:ie,js:je,kmd)
2272 real(FVPRC),
dimension(is:ie,js:je,kmd):: v1, v2, v3
2279 v1(i,j,k) = du(i,j,k)*vlon(i,j,1) + dv(i,j,k)*vlat(i,j,1)
2280 v2(i,j,k) = du(i,j,k)*vlon(i,j,2) + dv(i,j,k)*vlat(i,j,2)
2281 v3(i,j,k) = du(i,j,k)*vlon(i,j,3) + dv(i,j,k)*vlat(i,j,3)
2295 du(i,j,k) = v1(i,j,k)*vlon(i,j,1) + v2(i,j,k)*vlon(i,j,2) + v3(i,j,k)*vlon(i,j,3)
2296 dv(i,j,k) = v1(i,j,k)*vlat(i,j,1) + v2(i,j,k)*vlat(i,j,2) + v3(i,j,k)*vlat(i,j,3)
2305 integer,
intent(in):: kmd
2306 integer,
intent(in):: ntimes
2307 real(FVPRC),
intent(in):: cd
2308 real(FVPRC),
intent(inout):: qdt(is:ie,js:je,kmd)
2310 real(FVPRC):: q(isd:ied,jsd:jed,kmd)
2311 real(FVPRC):: fx(isd:ied+1,jsd:jed), fy(isd:ied,jsd:jed+1)
2312 integer i,j,k, n, nt
2320 q(i,j,k) = qdt(i,j,k)
2337 fx(i,j) = dy(i,j)*sina_u(i,j)*(q(i-1,j,k)-q(i,j,k))*rdxc(i,j)
2344 fy(i,j) = dx(i,j)*sina_v(i,j)*(q(i,j-1,k)-q(i,j,k))*rdyc(i,j)
2351 qdt(i,j,k) = q(i,j,k) + damp*rarea(i,j)*(fx(i,j)-fx(i+1,j)+fy(i,j)-fy(i,j+1))
2357 q(i,j,k) = q(i,j,k) + damp*rarea(i,j)*(fx(i,j)-fx(i+1,j)+fy(i,j)-fy(i,j+1))
real(fvprc), parameter del_r
subroutine, public get_date(time, year, month, day, hour, minute, second, tick, err_msg)
real(fvprc), dimension(:), allocatable bk0
real, parameter, public radius
Radius of the Earth [m].
integer, dimension(max_storm) nobs_tc
integer, dimension(:,:), allocatable jdc
subroutine breed_slp(time, dt, npz, ak, bk, ps, phis, delp, ua, va, u_dt, v_dt, pt, q, nwat, zvir)
real(fvprc), dimension(:,:,:), allocatable ps_dat
real *4, dimension(:,:,:,:), allocatable u_dat
integer, parameter nobs_max
subroutine del2_uv(du, dv, cd, kmd, ntimes)
subroutine get_obs(Time, dt, zvir, ak, bk, ps, ts, ps_obs, delp, u_obs, v_obs, t_obs, q_obs, tpw_dat, phis, gz_int, npz)
real *4, dimension(:,:,:,:), allocatable q_dat
real(fvprc), dimension(:), allocatable lon
subroutine get_int_hght(h_int, npz, ak, bk, ps, delp, ps0, tv)
subroutine get_ncep_analysis(ps, u, v, t, q, zvir, ts, nfile, fname)
real, parameter, public rdgas
Gas constant for dry air [J/kg/deg].
real(fvprc), dimension(:), allocatable ak0
real *4, dimension(nobs_max, max_storm) x_obs
real *4, dimension(nobs_max, max_storm) y_obs
subroutine, public nwp_nudge_init(npz, zvir, ak, bk, ts, phis)
real *4, dimension(nobs_max, max_storm) mslp_obs
logical function leap_year(ny)
character(len=128) version
character(len=128) track_file_name
integer function, public check_nml_error(IOSTAT, NML_NAME)
real *4, dimension(nobs_max, max_storm) time_tc
integer, parameter max_storm
subroutine pmaxmin(qname, a, imax, jmax, fac)
int field_exist(const char *file, const char *name)
logical module_is_initialized
integer, dimension(:,:), allocatable id2
subroutine remap_tq(npz, ak, bk, ps, delp, t, q, kmd, ps0, ta, qa, zvir)
subroutine, public do_nwp_nudge(Time, dt, npz, ps_dt, u_dt, v_dt, t_dt, q_dt, zvir, ak, bk, ts, ps, delp, ua, va, pt, nwat, q, phis)
real *4, dimension(:,:,:,:), allocatable v_dat
real(fvprc), dimension(:,:), allocatable gz0
subroutine, public field_size(filename, fieldname, siz, field_found, domain, no_domain)
subroutine timing_on(blk_name)
subroutine get_slp_obs(time, nobs, lon_obs, lat_obs, mslp, slp_out, r_out, time_obs, x_o, y_o, slp_o, r_vor, p_vor, stime, fact)
subroutine del2_scalar(qdt, cd, kmd, ntimes)
real, parameter, public cp_air
Specific heat capacity of dry air at constant pressure [J/kg/deg].
real(fvprc), dimension(:,:,:), allocatable s2c
subroutine, public breed_slp_inline(nstep, dt, npz, ak, bk, phis, pe, pk, peln, delp, u, v, pt, q, nwat, zvir)
real function, public great_circle_dist(q1, q2, radius)
real(fvprc), dimension(:), allocatable lat
real, parameter, public grav
Acceleration due to gravity [m/s^2].
subroutine, public mappm(km, pe1, q1, kn, pe2, q2, i1, i2, iv, kord, ptop)
subroutine, public intp_great_circle(beta, p1, p2, x_o, y_o)
character(len=128) tagname
subroutine, public copy_corners(q, npx, npy, dir, nested, bd, sw_corner, se_corner, nw_corner, ne_corner)
subroutine, public prt_maxmin(qname, q, is, ie, js, je, n_g, km, fac)
subroutine get_tc_mask(time, mask)
integer, parameter nfile_max
real(fvprc) function calday(year, month, day, hour, minute, sec)
integer, public masterproc
subroutine, public nwp_nudge_end
subroutine, public get_time(Time, seconds, days, ticks, err_msg)
real, parameter, public kappa
RDGAS / CP_AIR [dimensionless].
real *4, dimension(nobs_max, max_storm) rad_out
type(time_type), public fv_time
subroutine remap_uv(npz, ak, bk, ps, delp, u, v, kmd, ps0, u0, v0)
integer, dimension(:,:), allocatable id1
real(fp), parameter, public pi
subroutine timing_off(blk_name)
character(len=128), dimension(nfile_max) file_names
real *4, dimension(:,:,:,:), allocatable t_dat
real *4, dimension(nobs_max, max_storm) mslp_out