7 & flx_fld, nst_fld, g3d_fld,
8 & g2d_fld, aoi_fld, importdata,
9 & lats_nodes_r,global_lats_r,
10 & lonsperlar,xlon,xlat,coszdg,
11 & hprime,swh,swhc,hlw,hlwc,
13 & fluxr,sfalb, slag,sdec,cdec,
14 & ozplin, jindx1, jindx2, ddy,
15 & h2oplin, jindx1_h, jindx2_h, ddy_h,
16 & phy_f3d, phy_f2d, phy_fctd, nctp,
17 & nblck, zhour_dfi,n3, n4,
19 & lsout,colat1,cfhour1,restart_step,
71 USE machine
, ONLY: kind_grid, kind_rad, kind_phys
76 use namelist_physics_def
77 use physcons
, only : rlapse
81 use module_nst_water_prop
, only: get_dtzm_2d
82 use gfs_physics_sfc_flx_mod
83 use gfs_physics_sfc_flx_set_mod
84 use gfs_physics_gridgr_mod
, ONLY: grid_var_data
85 use gfs_physics_nst_var_mod
, ONLY: nst_var_data
86 use gfs_physics_aoi_var_mod
, ONLY: aoi_var_data
87 use gfs_physics_g3d_mod
, ONLY: g3d_var_data
88 use gfs_physics_g2d_mod
, ONLY: g2d_var_data, g2d_zerout
90 use d3d_def
, ONLY: d3d_zero, cldcov
92 use module_radsw_parameters
, only : nbdsw
93 use module_radlw_parameters
, only : nbdlw
94 use module_cplfields
, only : nimportfields, queryfieldlist
100 TYPE(sfc_var_data) :: sfc_fld
101 TYPE(flx_var_data) :: flx_fld
102 TYPE(grid_var_data) :: grid_fld
103 TYPE(nst_var_data) :: nst_fld
104 TYPE(g3d_var_data) :: g3d_fld
105 TYPE(g2d_var_data) :: g2d_fld
106 type(aoi_var_data) :: aoi_fld
109 CHARACTER(16) :: CFHOUR1
110 logical :: restart_step
113 REAL(KIND=KIND_EVOD),
INTENT(IN)::
114 & importdata(lonr,lats_node_r,nimportfields)
118 REAL(KIND=KIND_EVOD),
INTENT(IN) :: deltim,PHOUR
119 REAL(KIND=KIND_EVOD),
INTENT(INOUT) :: ZHOUR_DFI
122 REAL(KIND=KIND_EVOD) :: delt_cpl
124 INTEGER n3, n4, nblck, nctp, kdt
125 character(len=128) :: fldname
127 INTEGER LATS_NODES_R(nodes)
128 integer,
dimension(latr) :: global_lats_r, lonsperlar
129 real (kind=kind_rad) dtzm(lonr,lats_node_r)
132 real(kind=kind_evod) colat1, phyhour, phydt, dtp
133 real (kind=kind_phys),
dimension(lonr,lats_node_r) :: xlon, xlat,
135 real (kind=kind_phys),
dimension(ngptc,levs,nblck,lats_node_r) ::
136 & swh, swhc, hlw, hlwc
137 REAL (KIND=KIND_RAD) HPRIME(nmtvr,lonr,lats_node_r),
138 & fluxr(nfxr,lonr,lats_node_r)
143 REAL (kind=kind_phys) phy_f3d(ngptc,levs,ntot3d,nblck,lats_node_r)
144 &, phy_f2d(lonr,lats_node_r,ntot2d)
145 &, phy_fctd(lonr,lats_node_r,nctp)
146 &, ddy(lats_node_r), ddy_h(lats_node_r)
150 INTEGER,
dimension(lats_node_r) :: JINDX1, JINDX2
151 &, jindx1_h, jindx2_h
152 REAL OZPLIN(latsozp,levozp,pl_coeff,timeoz)
153 &, h2oplin(latsh2o,levh2o,h2o_coeff,timeh2o)
155 REAL(KIND=KIND_EVOD) SLAG,SDEC,CDEC
156 INTEGER IERR,I,J,K,L,LOCL,N,iprint, findex, kdt_dif
158 real(kind=kind_phys),
parameter:: omz1 = 10.0
162 real (kind=kind_phys) dt_warm, tem1, tem2
163 real (kind=kind_phys),
save :: zhour_dfin=0.
172 fhour = shour / 3600.
175 kdt_dif = kdt - kdt_start
180 if(ndfi > 0 .and. kdt_dif > ndfi/2 .and.
181 & kdt_dif <= ndfi .and. ldfi )
then 184 if(.not. ldfi .and. ndfi > 0. and. kdt_dif == ndfi/2+1)
then 190 lscca = mod(kdt ,nsswr) == 0
191 lsswr = mod(kdt ,nsswr) == 1
192 lslwr = mod(kdt ,nslwr) == 1
200 if(.not. semilag .and. lsfwd) phydt = 0.5*deltim
207 if (nscyc > 0 .and. mod(kdt,nscyc) == 1)
then 208 if (me == 0) print*,
' calling gcycle at kdt=',kdt
211 do j = 1, lats_node_r
213 if ( sfc_fld%slmsk(i,j) == 0 )
then 214 sfc_fld%tsea(i,j) = nst_fld%tref(i,j)
219 call gcycle(me,lats_node_r,lonsperlar,global_lats_r,
220 & ipt_lats_node_r,idate,phour,fhcyc,
221 & xlon ,xlat, sfc_fld, ialb,isot,ivegsrc)
224 do j = 1, lats_node_r
226 if ( sfc_fld%slmsk(i,j) == 0 )
then 227 nst_fld%tref(i,j) = sfc_fld%tsea(i,j)
232 call get_dtzm_2d(nst_fld%xt,nst_fld%xz,nst_fld%dt_cool,
233 & nst_fld%z_c,nst_fld%slmsk,zsea1,zsea2,
234 & lonr,lats_node_r,dtzm)
237 do j = 1, lats_node_r
239 if ( sfc_fld%slmsk(i,j) == 0 )
then 240 sfc_fld%tsea(i,j) = nst_fld%tref(i,j) + dtzm(i,j)
246 call gcycle(me,lats_node_r,lonsperlar,global_lats_r,
247 & ipt_lats_node_r,idate,phour,fhcyc,
248 & xlon ,xlat, sfc_fld, ialb,isot,ivegsrc)
252 if (num_p3d == 3)
then 253 dtp = min(phydt,dtphys)
254 call init_micro(dtp,ngptc,levs,ntot3d,
255 & nblck*lats_node_r, phy_f3d(1,1,1,1,1),
266 findex = queryfieldlist(importfieldslist,fldname)
267 if (importfieldsvalid(findex) .and.
268 & importdata(1,1,findex) > -99999.0)
then 270 do j = 1, lats_node_r
272 aoi_fld%slimskin(i,j) = 1.0
273 if (importdata(i,j,findex) < 0.01)
then 274 aoi_fld%FICEIN(i,j) = 0.0
275 aoi_fld%slimskin(i,j) = 3.0
281 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
286 fldname=
'sea_surface_temperature' 287 findex = queryfieldlist(importfieldslist,fldname)
288 if (importfieldsvalid(findex) .and.
289 & importdata(1,1,findex) > -99999.0)
then 291 do j = 1, lats_node_r
293 if (aoi_fld%slimskin(i,j) < 3.1 .and.
294 & aoi_fld%slimskin(i,j) > 2.9)
then 295 if (sfc_fld%slmsk(i,j) < 0.1 .or.
296 & sfc_fld%slmsk(i,j) > 1.9)
then 297 sfc_fld%TSEA(i,j) = importdata(i,j,findex)
304 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
307 if (nstf_name(1) > 1)
then 308 if (importfieldsvalid(findex) .and.
309 & importdata(1,1,findex) > -99999.0)
then 314 call get_dtzm_2d(nst_fld%xt,nst_fld%xz,nst_fld%dt_cool,
315 & nst_fld%z_c,sfc_fld%slmsk,
316 & 0.0,omz1,lonr,lats_node_r,dtzm)
318 do j = 1, lats_node_r
320 if ( sfc_fld%slmsk(i,j) == 0 )
then 321 nst_fld%tref(i,j) = sfc_fld%tsea(i,j) - dtzm(i,j)
322 & + (sfc_fld%oro(i,j)-sfc_fld%oro_uf(i,j))*rlapse
329 call get_dtzm_2d(nst_fld%xt,nst_fld%xz,nst_fld%dt_cool,
330 & nst_fld%z_c,sfc_fld%slmsk,
331 & zsea1,zsea2,lonr,lats_node_r,dtzm)
334 do j = 1, lats_node_r
336 if ( sfc_fld%slmsk(i,j) == 0 )
then 337 sfc_fld%tsea(i,j) = nst_fld%tref(i,j) + dtzm(i,j)
338 & - (sfc_fld%oro(i,j)-sfc_fld%oro_uf(i,j))*rlapse
347 call get_dtzm_2d(nst_fld%xt,nst_fld%xz,nst_fld%dt_cool,
348 & nst_fld%z_c,sfc_fld%slmsk,
349 & zsea1,zsea2,lonr,lats_node_r,dtzm)
351 do j = 1, lats_node_r
353 if ( sfc_fld%slmsk(i,j) == 0 )
then 354 nst_fld%tref(i,j) = sfc_fld%tsea(i,j) - dtzm(i,j)
355 & + (sfc_fld%oro(i,j)-sfc_fld%oro_uf(i,j))*rlapse
364 fldname=
'surface_temperature' 365 findex = queryfieldlist(importfieldslist,fldname)
366 if (importfieldsvalid(findex) .and.
367 & importdata(1,1,findex) > -99999.0)
then 368 do j = 1, lats_node_r
371 if (aoi_fld%slimskin(i,j) < 3.1 .and.
372 & aoi_fld%slimskin(i,j) > 2.9)
then 373 aoi_fld%TSEAIN(i,j) = importdata(i,j,findex)
379 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
384 fldname=
'ice_fraction' 385 findex = queryfieldlist(importfieldslist,fldname)
386 if (importfieldsvalid(findex) .and.
387 & importdata(1,1,findex) > -99999.0)
then 389 do j = 1, lats_node_r
392 if (importdata(i,j,findex) > 0.15)
then 393 if (aoi_fld%slimskin(i,j) < 3.1 .and.
394 & aoi_fld%slimskin(i,j) > 2.9)
then 395 if (sfc_fld%slmsk(i,j) < 0.1 .or.
396 & sfc_fld%slmsk(i,j) > 1.9)
then 397 aoi_fld%FICEIN(i,j) = importdata(i,j,findex)
398 sfc_fld%FICE(i,j) = importdata(i,j,findex)
399 aoi_fld%slimskin(i,j) = 4.0
400 sfc_fld%slmsk(i,j) = 2.0
401 sfc_fld%TSEA(i,j) = aoi_fld%TSEAIN(i,j)
405 if (aoi_fld%slimskin(i,j) > 2.9 .and.
406 & aoi_fld%slimskin(i,j) < 3.1 .and.
407 & sfc_fld%FICE(i,j) > 0.15)
then 408 sfc_fld%FICE(i,j) = 0.0
409 sfc_fld%slmsk(i,j) = 0.0
410 sfc_fld%TSEA(i,j) = aoi_fld%TSEAIN(i,j)
417 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
420 fldname=
'mean_ice_volume' 421 findex = queryfieldlist(importfieldslist,fldname)
422 if (importfieldsvalid(findex) .and.
423 & importdata(1,1,findex) > -99999.0)
then 425 do j = 1, lats_node_r
428 if (aoi_fld%slimskin(i,j) > 2.5)
then 429 aoi_fld%HICEIN(i,j)=importdata(i,j,findex)
430 if (sfc_fld%FICE(i,j) > 0.15)
then 431 sfc_fld%HICE(i,j)=aoi_fld%HICEIN(i,j)
440 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
443 fldname=
'mean_snow_volume' 444 findex = queryfieldlist(importfieldslist,fldname)
445 if (importfieldsvalid(findex) .and.
446 & importdata(1,1,findex) > -99999.0)
then 447 do j = 1, lats_node_r
450 if (aoi_fld%slimskin(i,j) > 2.5)
then 451 aoi_fld%HSNOIN(i,j)=importdata(i,j,findex)
452 if (sfc_fld%FICE(i,j) > 0.15)
then 453 sfc_fld%SNWDPH(i,j)=aoi_fld%HSNOIN(i,j)
455 sfc_fld%SNWDPH(i,j)=0.
462 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
465 fldname=
'mean_up_lw_flx' 466 findex = queryfieldlist(importfieldslist,fldname)
467 if (importfieldsvalid(findex) .and.
468 & importdata(1,1,findex) > -99999.0)
then 469 do j = 1, lats_node_r
472 if (aoi_fld%slimskin(i,j) > 3.9 .and.
473 & aoi_fld%slimskin(i,j) < 4.1)
then 474 aoi_fld%ULWSFCIN(i,j)=-importdata(i,j,findex)
480 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
482 fldname=
'mean_laten_heat_flx' 483 findex = queryfieldlist(importfieldslist,fldname)
484 if (importfieldsvalid(findex) .and.
485 & importdata(1,1,findex) > -99999.0)
then 487 do j = 1, lats_node_r
490 if (aoi_fld%slimskin(i,j) > 3.9 .and.
491 & aoi_fld%slimskin(i,j) < 4.1)
then 492 aoi_fld%DQSFCIN(i,j) = -importdata(i,j,findex)
498 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
500 fldname=
'mean_sensi_heat_flx' 501 findex = queryfieldlist(importfieldslist,fldname)
502 if (importfieldsvalid(findex) .and.
503 & importdata(1,1,findex) > -99999.0)
then 505 do j = 1, lats_node_r
508 if (aoi_fld%slimskin(i,j) > 3.9 .and.
509 & aoi_fld%slimskin(i,j) < 4.1)
then 510 aoi_fld%DTSFCIN(i,j) = -importdata(i,j,findex)
516 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
518 fldname=
'mean_zonal_moment_flx' 519 findex = queryfieldlist(importfieldslist,fldname)
520 if (importfieldsvalid(findex) .and.
521 & importdata(1,1,findex) > -99999.0)
then 523 do j = 1, lats_node_r
526 if (aoi_fld%slimskin(i,j) > 3.9 .and.
527 & aoi_fld%slimskin(i,j) < 4.1)
then 528 aoi_fld%DUSFCIN(i,j) = -importdata(i,j,findex)
534 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
536 fldname=
'mean_merid_moment_flx' 537 findex = queryfieldlist(importfieldslist,fldname)
538 if (importfieldsvalid(findex) .and.
539 & importdata(1,1,findex) > -99999.0)
then 541 do j = 1, lats_node_r
543 if (aoi_fld%slimskin(i,j) > 3.9 .and.
544 & aoi_fld%slimskin(i,j) < 4.1)
then 545 aoi_fld%DVSFCIN(i,j) = -importdata(i,j,findex)
551 &
write(0,*)
'do_physics_one_step skip field ',trim(fldname)
556 if (lsswr .or. lslwr)
then 569 CALL gloopr (grid_fld, g3d_fld, aoi_fld, lats_nodes_r
570 &, global_lats_r, lonsperlar, phyhour
571 &, deltim, xlon, xlat, coszdg, flx_fld%COSZEN
572 &, sfc_fld%SLMSK, sfc_fld%weasd, sfc_fld%SNCOVR
573 &, sfc_fld%SNOALB, sfc_fld%ZORL, sfc_fld%TSEA
574 &, hprime, sfalb, sfc_fld%ALVSF, sfc_fld%ALNSF
575 &, sfc_fld%ALVWF, sfc_fld%ALNWF, sfc_fld%FACSF
576 &, sfc_fld%FACWF, sfc_fld%CV, sfc_fld%CVT
577 &, sfc_fld%CVB, swh, swhc, hlw, hlwc, flx_fld%SFCNSW
578 &, flx_fld%SFCDLW, sfc_fld%FICE, sfc_fld%TISFC
579 &, flx_fld%SFCDSW, flx_fld%sfcemis
581 &, flx_fld%TSFLW, fluxr, phy_f3d, phy_f2d
582 &, slag, sdec, cdec, nblck, kdt, mdl_parm
591 call gloopb (grid_fld, g3d_fld, sfc_fld,
592 & flx_fld, aoi_fld, nst_fld,
593 & lats_nodes_r, global_lats_r, lonsperlar,
594 & phydt, phyhour, sfalb, xlon,
595 & swh, swhc, hlw, hlwc,
597 & hprime, slag, sdec, cdec,
598 & ozplin, jindx1, jindx2, ddy,
599 & h2oplin, jindx1_h, jindx2_h, ddy_h,
600 & phy_f3d, phy_f2d, phy_fctd, nctp,
601 & xlat, nblck, kdt, restart_step,
615 if (lsout .and. kdt /= 0 )
then 618 IF(.NOT.
ALLOCATED(sl))
ALLOCATE(sl(levs))
619 IF(.NOT.
ALLOCATED(si))
ALLOCATE(si(levs + 1))
620 CALL wrtout_physics(phyhour,fhour,zhour,idate,
622 & sfc_fld, flx_fld, nst_fld, g2d_fld,
624 & global_lats_r,lonsperlar,nblck,
626 & colat1,cfhour1,pl_coeff,
627 &
'SFC.F',
'NST.F',
'FLX.F',
'D3D.F')
636 call aoicpl_prep(deltim,delt_cpl,phyhour,fhour,idate,
637 & aoi_fld,global_lats_r,lonsperlar)
640 IF (kdt > 0 .and. mod(kdt,nsres) == 0)
THEN 642 CALL wrtout_restart_physics(sfc_fld, nst_fld, fhour,idate,
643 & lats_nodes_r,global_lats_r,lonsperlar,
644 & phy_f3d, phy_f2d, ngptc, nblck, ens_nam)
647 IF (mod(kdt,nszer) == 0 .and. lsout.and.kdt /= 0)
THEN 648 call flx_init(flx_fld,ierr)
649 if(ldfi .and. kdt_dif == ndfi/2)
then 674 call g2d_zerout(g2d_fld,ierr)
679 if(ldfi .and. kdt_dif == ndfi)
then 685 if(ndfi > 0 .and. kdt_dif == ndfi .and. ldfi )
then 693 & global_lats_r,lonsperlar,chr)
698 real(kind=kind_grid) grid_gr(lonr*lats_node_r_max,lotgr)
699 integer,
intent(in):: global_lats_r(latr),g_pnt,km
700 integer,
intent(in):: lonsperlar(latr)
703 integer lan,lat,lons_lat,k
706 lat = global_lats_r(ipt_lats_node_r-1+lan)
707 lons_lat = lonsperlar(lat)
709 call mymaxmin(grid_gr(1,g_pnt+k-1),lons_lat,lonr,1,chr)
subroutine do_physics_one_step(deltim, kdt, PHOUR,
subroutine gloopr(grid_fld, g3d_fld, aoi_fld,
subroutine gloopr invokes the physcis driver's call to the radiation portion of the physics through t...
subroutine do_physics_gridcheck(grid_gr, g_pnt, km,
DDT for non-changing model parameters - set once in initialize.
subroutine gloopb(grid_fld, g3d_fld, sfc_fld,
the interface between the dynamic core and the physics packages