source: codes/icosagcm/devel/src/kernels_unst/compute_hydrostatic_pressure.k90 @ 966

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

devel : add missing kernels

File size: 1.8 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      !$OMP DO SCHEDULE(STATIC)
7      DO ij=1,primal_num
8         pk(llm,ij) = ptop + .5*g* theta_rhodz(llm,ij,1)
9         DO l = llm-1,1,-1
10            pk(l,ij) = pk(l+1,ij) + (.5*g)*( theta_rhodz(l,ij,1) + theta_rhodz(l+1,ij,1) )
11         END DO
12         IF(caldyn_eta == eta_lag) THEN
13            ps(ij) = pk(1,ij) + .5*g* theta_rhodz(1,ij,1)
14         END IF
15      END DO
16      !$OMP END DO
17   CASE(thermo_theta, thermo_entropy, thermo_variable_Cp)
18      !$OMP DO SCHEDULE(STATIC)
19      DO ij=1,primal_num
20         pk(llm,ij) = ptop + .5*g* rhodz(llm,ij)
21         DO l = llm-1,1,-1
22            pk(l,ij) = pk(l+1,ij) + (.5*g)*( rhodz(l,ij) + rhodz(l+1,ij) )
23         END DO
24         IF(caldyn_eta == eta_lag) THEN
25            ps(ij) = pk(1,ij) + .5*g* rhodz(1,ij)
26         END IF
27      END DO
28      !$OMP END DO
29   CASE(thermo_moist)
30      !$OMP DO SCHEDULE(STATIC)
31      DO ij=1,primal_num
32         pk(llm,ij) = ptop + .5*g* (rhodz(llm,ij)+theta_rhodz(llm,ij,2))
33         DO l = llm-1,1,-1
34            pk(l,ij) = pk(l+1,ij) + (.5*g)*( (rhodz(l,ij)+theta_rhodz(l,ij,2)) + (rhodz(l+1,ij)+theta_rhodz(l+1,ij,2)) )
35         END DO
36         IF(caldyn_eta == eta_lag) THEN
37            ps(ij) = pk(1,ij) + .5*g* (rhodz(1,ij)+theta_rhodz(1,ij,2))
38         END IF
39      END DO
40      !$OMP END DO
41   END SELECT
42   !---------------------------- compute_hydrostatic_pressure ----------------------------------
43   !--------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.