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
5
6 use machine , only : kind_phys, kp => kind_phys
8
9 implicit none
10
11contains
12
13 ! \defgroup GFS_NSST_POST GFS Near-Surface Sea Temperature Post
14
18 ! \section NSST_general_post_algorithm General Algorithm
19 !
20 ! \section NSST_detailed_post_algorithm Detailed Algorithm
21 ! @{
22 subroutine sfc_nst_post_run &
23 ( im, kdt, rlapse, tgice, wet, use_lake_model, icy, oro, &
24 oro_uf, nstf_name1, &
25 nstf_name4, nstf_name5, xt, xz, dt_cool, z_c, tref, xlon, &
26 tsurf_wat, tsfc_wat, nthreads, dtzm, errmsg, errflg &
27 )
28 ! --- inputs:
29 integer, intent(in) :: im, kdt, nthreads
30 logical, dimension(:), intent(in) :: wet, icy
31 integer, dimension(:), intent(in) :: use_lake_model
32 real (kind=kind_phys), intent(in) :: rlapse, tgice
33 real (kind=kind_phys), dimension(:), intent(in) :: oro, oro_uf
34 integer, intent(in) :: nstf_name1, nstf_name4, nstf_name5
35 real (kind=kind_phys), dimension(:), intent(in) :: xlon
36 real (kind=kind_phys), dimension(:), intent(in), optional :: xt, xz, dt_cool, z_c, tref
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)