source: codes/icosagcm/devel/src/kernels_hex_master/compute_hydrostatic_pressure.k90 @ 977

Last change on this file since 977 was 966, checked in by dubos, 5 years ago

devel : add missing kernels

File size: 2.1 KB
Line 
1   !--------------------------------------------------------------------------
2   !---------------------------- compute_hydrostatic_pressure ----------------------------------
3   SELECT CASE(caldyn_thermo)
4   CASE(thermo_boussinesq)
5      ! use hydrostatic balance with theta*rhodz to find pk (=Lagrange multiplier=pressure)
6      !DIR$ SIMD
7      DO ij=ij_begin_ext,ij_end_ext
8         pk(ij,llm) = ptop + .5*g* theta_rhodz(ij,llm,1)
9      END DO
10      DO l = llm-1,1,-1
11         !DIR$ SIMD
12         DO ij=ij_begin_ext,ij_end_ext
13            pk(ij,l) = pk(ij,l+1) + (.5*g)*( theta_rhodz(ij,l,1) + theta_rhodz(ij,l+1,1) )
14         END DO
15      END DO
16      IF(caldyn_eta == eta_lag) THEN
17         !DIR$ SIMD
18         DO ij=ij_begin_ext,ij_end_ext
19            ps(ij) = pk(ij,1) + .5*g* theta_rhodz(ij,1,1)
20         END DO
21      END IF
22   CASE(thermo_theta, thermo_entropy, thermo_variable_Cp)
23      !DIR$ SIMD
24      DO ij=ij_begin_ext,ij_end_ext
25         pk(ij,llm) = ptop + .5*g* rhodz(ij,llm)
26      END DO
27      DO l = llm-1,1,-1
28         !DIR$ SIMD
29         DO ij=ij_begin_ext,ij_end_ext
30            pk(ij,l) = pk(ij,l+1) + (.5*g)*( rhodz(ij,l) + rhodz(ij,l+1) )
31         END DO
32      END DO
33      IF(caldyn_eta == eta_lag) THEN
34         !DIR$ SIMD
35         DO ij=ij_begin_ext,ij_end_ext
36            ps(ij) = pk(ij,1) + .5*g* rhodz(ij,1)
37         END DO
38      END IF
39   CASE(thermo_moist)
40      !DIR$ SIMD
41      DO ij=ij_begin_ext,ij_end_ext
42         pk(ij,llm) = ptop + .5*g* (rhodz(ij,llm)+theta_rhodz(ij,llm,2))
43      END DO
44      DO l = llm-1,1,-1
45         !DIR$ SIMD
46         DO ij=ij_begin_ext,ij_end_ext
47            pk(ij,l) = pk(ij,l+1) + (.5*g)*( (rhodz(ij,l)+theta_rhodz(ij,l,2)) + (rhodz(ij,l+1)+theta_rhodz(ij,l+1,2)) )
48         END DO
49      END DO
50      IF(caldyn_eta == eta_lag) THEN
51         !DIR$ SIMD
52         DO ij=ij_begin_ext,ij_end_ext
53            ps(ij) = pk(ij,1) + .5*g* (rhodz(ij,1)+theta_rhodz(ij,1,2))
54         END DO
55      END IF
56   END SELECT
57   !---------------------------- compute_hydrostatic_pressure ----------------------------------
58   !--------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.