CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
sfc_nst_post.f90
1
3
6
7 use machine , only : kind_phys, kp => kind_phys
9
10 implicit none
11
12contains
13
14 ! \defgroup GFS_NSST_POST GFS Near-Surface Sea Temperature Post
15
19 ! \section NSST_general_post_algorithm General Algorithm
20 !
21 ! \section NSST_detailed_post_algorithm Detailed Algorithm
22 ! @{
23 subroutine sfc_nst_post_run &
24 ( im, kdt, rlapse, tgice, wet, use_lake_model, icy, oro, &
25 oro_uf, nstf_name1, &
26 nstf_name4, nstf_name5, xt, xz, dt_cool, z_c, tref, xlon, &
27 tsurf_wat, tsfc_wat, nthreads, dtzm, errmsg, errflg &
28 )
29 ! --- inputs:
30 integer, intent(in) :: im, kdt, nthreads
31 logical, dimension(:), intent(in) :: wet, icy
32 integer, dimension(:), intent(in) :: use_lake_model
33 real (kind=kind_phys), intent(in) :: rlapse, tgice
34 real (kind=kind_phys), dimension(:), intent(in) :: oro, oro_uf
35 integer, intent(in) :: nstf_name1, nstf_name4, nstf_name5
36 real (kind=kind_phys), dimension(:), intent(in) :: xlon
37 real (kind=kind_phys), dimension(:), intent(in), optional :: xt, xz, dt_cool, z_c, tref
38
39 ! --- input/outputs:
40 real (kind=kind_phys), dimension(:), intent(inout) :: tsurf_wat, tsfc_wat
41
42 ! --- outputs:
43 real (kind=kind_phys), dimension(:), intent(out) :: dtzm
44
45 character(len=*), intent(out) :: errmsg
46 integer, intent(out) :: errflg
47
48 ! --- locals
49 integer :: i
50 real(kind=kind_phys) :: zsea1, zsea2
51
52 ! Initialize CCPP error handling variables
53 errmsg = ''
54 errflg = 0
55
56 ! if (lprnt) print *,' tseaz2=',tseal(ipr),' tref=',tref(ipr),
57 ! & ' dt_cool=',dt_cool(ipr),' dt_warm=',2.0*xt(ipr)/xz(ipr),
58 ! & ' kdt=',kdt
59
60 ! do i = 1, im
61 ! if (wet(i) .and. .not. icy(i)) then
62 ! tsurf_wat(i) = tsurf_wat(i) - (oro(i)-oro_uf(i)) * rlapse
63 ! endif
64 ! enddo
65
66 ! --- ... run nsst model ... ---
67
68 if (nstf_name1 > 1) then
69 zsea1 = 0.001_kp*real(nstf_name4)
70 zsea2 = 0.001_kp*real(nstf_name5)
71 call get_dtzm_2d (xt, xz, dt_cool, z_c, wet, zsea1, zsea2, im, 1, nthreads, dtzm)
72 do i = 1, im
73 ! if (wet(i) .and. .not.icy(i)) then
74 ! if (wet(i) .and. (frac_grid .or. .not. icy(i))) then
75 if (wet(i) .and. use_lake_model(i) /=1) then
76 tsfc_wat(i) = max(tgice, tref(i) + dtzm(i))
77 ! tsfc_wat(i) = max(271.2, tref(i) + dtzm(i)) - &
78 ! (oro(i)-oro_uf(i))*rlapse
79 endif
80 enddo
81 endif
82
83 ! if (lprnt) print *,' tseaz2=',tsea(ipr),' tref=',tref(ipr), &
84 ! & ' dt_cool=',dt_cool(ipr),' dt_warm=',dt_warm(ipr),' kdt=',kdt
85
86 return
87 end subroutine sfc_nst_post_run
88
89end module sfc_nst_post
subroutine, public get_dtzm_2d(xt, xz, dt_cool, zc, wet, z1, z2, nx, ny, nth, dtm)
This module contains GFS NSST water property subroutines.
This module contains code to be executed after the near-surface sea temperature scheme.