source: codes/icosagcm/trunk/src/kernels/caldyn_fast.k90 @ 580

Last change on this file since 580 was 580, checked in by dubos, 7 years ago

trunk : upgrading to devel

File size: 2.0 KB
Line 
1   !--------------------------------------------------------------------------
2   !---------------------------- caldyn_fast ----------------------------------
3   !
4   SELECT CASE(caldyn_thermo)
5   CASE(thermo_boussinesq)
6      DO l = ll_begin, ll_end
7         !DIR$ SIMD
8         DO ij=ij_begin, ij_end
9            berni(ij,l) = pk(ij,l)
10            ! from now on pk contains the vertically-averaged geopotential
11            pk(ij,l) = .5*(geopot(ij,l)+geopot(ij,l+1))
12         END DO
13      END DO
14   CASE(thermo_theta)
15      DO l = ll_begin, ll_end
16         !DIR$ SIMD
17         DO ij=ij_begin, ij_end
18            berni(ij,l) = .5*(geopot(ij,l)+geopot(ij,l+1))
19         END DO
20      END DO
21   CASE(thermo_entropy)
22      DO l = ll_begin, ll_end
23         !DIR$ SIMD
24         DO ij=ij_begin, ij_end
25            berni(ij,l) = .5*(geopot(ij,l)+geopot(ij,l+1))
26            berni(ij,l) = berni(ij,l) + pk(ij,l)*(cpp-theta(ij,l,1)) ! Gibbs = Cp.T-Ts = T(Cp-s)
27         END DO
28      END DO
29   CASE DEFAULT
30      PRINT *, 'Unsupported value of caldyn_thermo : ',caldyn_thermo ! FIXME
31      STOP
32   END SELECT
33   !
34   DO l = ll_begin, ll_end
35      !DIR$ SIMD
36      DO ij=ij_begin, ij_end
37         due = .5*(theta(ij,l,1)+theta(ij+t_right,l,1))*(pk(ij+t_right,l)-pk(ij,l)) + berni(ij+t_right,l)-berni(ij,l)
38         du(ij+u_right,l) = du(ij+u_right,l) - ne_right*due
39         u(ij+u_right,l) = u(ij+u_right,l) + tau*du(ij+u_right,l)
40         due = .5*(theta(ij,l,1)+theta(ij+t_lup,l,1))*(pk(ij+t_lup,l)-pk(ij,l)) + berni(ij+t_lup,l)-berni(ij,l)
41         du(ij+u_lup,l) = du(ij+u_lup,l) - ne_lup*due
42         u(ij+u_lup,l) = u(ij+u_lup,l) + tau*du(ij+u_lup,l)
43         due = .5*(theta(ij,l,1)+theta(ij+t_ldown,l,1))*(pk(ij+t_ldown,l)-pk(ij,l)) + berni(ij+t_ldown,l)-berni(ij,l)
44         du(ij+u_ldown,l) = du(ij+u_ldown,l) - ne_ldown*due
45         u(ij+u_ldown,l) = u(ij+u_ldown,l) + tau*du(ij+u_ldown,l)
46      END DO
47   END DO
48   !
49   !---------------------------- caldyn_fast ----------------------------------
50   !--------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.