GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — wrf-python/fortran/eqthecalc.f90 at develop · wsf1990/wrf-python

Expand file tree

/

eqthecalc.f90

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
54 lines (46 loc) · 1.54 KB
/

eqthecalc.f90

Copy path

File metadata and controls

54 lines (46 loc) · 1.54 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
! Theta-e
!NCLFORTSTART
SUBROUTINE DEQTHECALC(qvp, tmk, prs, eth, miy, mjx, mkzh)
USE wrf_constants, ONLY : EPS, GAMMA, GAMMAMD, TLCLC1, TLCLC2, TLCLC3, TLCLC4, &
THTECON1, THTECON2, THTECON3
IMPLICIT NONE
!f2py threadsafe
!f2py intent(in,out) :: eth
! Input variables
! Sizes
INTEGER,INTENT(IN) :: miy, mjx, mkzh
! Qvapor [g/kg]
REAL(KIND=8), DIMENSION(miy,mjx,mkzh), INTENT(IN) :: qvp
! Temperature [K]
REAL(KIND=8), DIMENSION(miy,mjx,mkzh), INTENT(IN) :: tmk
! full pressure (=P+PB) [hPa]
REAL(KIND=8), DIMENSION(miy,mjx,mkzh), INTENT(IN) :: prs
! Output variable
! equivalent potential temperature [K]
REAL(KIND=8), DIMENSION(miy,mjx,mkzh), INTENT(OUT) :: eth
!NCLEND
! local variables
REAL(KIND=8) :: q
REAL(KIND=8) :: t
REAL(KIND=8) :: p
REAL(KIND=8) :: e
REAL(KIND=8) :: tlcl
INTEGER :: i, j, k
!$OMP PARALLEL DO COLLAPSE(3) PRIVATE(i, j, k, q, t, p, e, tlcl) &
!$OMP SCHEDULE(runtime)
DO k = 1,mkzh
DO j = 1,mjx
DO i = 1,miy
q = MAX(qvp(i,j,k), 1.D-15)
t = tmk(i,j,k)
p = prs(i,j,k)/100.
e = q*p/(EPS + q)
tlcl = TLCLC1/(LOG(t**TLCLC2/e) - TLCLC3) + TLCLC4
eth(i,j,k) = tmk(i,j,k)*(1000.D0/p)**(GAMMA*(1.D0 + GAMMAMD*q))* &
EXP((THTECON1/tlcl - THTECON2)*q*(1.D0 + THTECON3*q))
END DO
END DO
END DO
!$OMP END PARALLEL DO
RETURN
END SUBROUTINE DEQTHECALC
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.