CCPP SciDoc v7.0.x  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) :: xt, xz, dt_cool, z_c, tref, xlon
37
38 ! --- input/outputs:
39 real (kind=kind_phys), dimension(:), intent(inout) :: tsurf_wat, tsfc_wat
40
41 ! --- outputs:
42 real (kind=kind_phys), dimension(:), intent(out) :: dtzm
43
44 character(len=*), intent(out) :: errmsg
45 integer, intent(out) :: errflg
46
47 ! --- locals
48 integer :: i
49 real(kind=kind_phys) :: zsea1, zsea2
50
51 ! Initialize CCPP error handling variables
52 errmsg = ''
53 errflg = 0
54
55 ! if (lprnt) print *,' tseaz2=',tseal(ipr),' tref=',tref(ipr),
56 ! & ' dt_cool=',dt_cool(ipr),' dt_warm=',2.0*xt(ipr)/xz(ipr),
57 ! & ' kdt=',kdt
58
59 ! do i = 1, im
60 ! if (wet(i) .and. .not. icy(i)) then
61 ! tsurf_wat(i) = tsurf_wat(i) - (oro(i)-oro_uf(i)) * rlapse
62 ! endif
63 ! enddo
64
65 ! --- ... run nsst model ... ---
66
67 if (nstf_name1 > 1) then
68 zsea1 = 0.001_kp*real(nstf_name4)
69 zsea2 = 0.001_kp*real(nstf_name5)
70 call get_dtzm_2d (xt, xz, dt_cool, z_c, wet, zsea1, zsea2, im, 1, nthreads, dtzm)
71 do i = 1, im
72 ! if (wet(i) .and. .not.icy(i)) then
73 ! if (wet(i) .and. (frac_grid .or. .not. icy(i))) then
74 if (wet(i) .and. use_lake_model(i) /=1) then
75 tsfc_wat(i) = max(tgice, tref(i) + dtzm(i))
76 ! tsfc_wat(i) = max(271.2, tref(i) + dtzm(i)) - &
77 ! (oro(i)-oro_uf(i))*rlapse
78 endif
79 enddo
80 endif
81
82 ! if (lprnt) print *,' tseaz2=',tsea(ipr),' tref=',tref(ipr), &
83 ! & ' dt_cool=',dt_cool(ipr),' dt_warm=',dt_warm(ipr),' kdt=',kdt
84
85 return
86 end subroutine sfc_nst_post_run
87
88end 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.