1 | MODULE vorticity_mod |
---|
2 | |
---|
3 | CONTAINS |
---|
4 | |
---|
5 | SUBROUTINE vorticity(f_ue,f_vort) |
---|
6 | USE icosa |
---|
7 | IMPLICIT NONE |
---|
8 | TYPE(t_field), POINTER :: f_ue(:) |
---|
9 | TYPE(t_field), POINTER :: f_vort(:) |
---|
10 | |
---|
11 | REAL(rstd), POINTER :: ue(:,:) |
---|
12 | REAL(rstd), POINTER :: vort(:,:) |
---|
13 | INTEGER :: ind |
---|
14 | |
---|
15 | CALL transfert_request(f_ue,req_e1) |
---|
16 | CALL transfert_request(f_ue,req_e1) |
---|
17 | |
---|
18 | DO ind=1,ndomain |
---|
19 | CALL swap_dimensions(ind) |
---|
20 | CALL swap_geometry(ind) |
---|
21 | ue=f_ue(ind) |
---|
22 | vort=f_vort(ind) |
---|
23 | CALL compute_vorticity(ue, vort) |
---|
24 | ENDDO |
---|
25 | |
---|
26 | END SUBROUTINE vorticity |
---|
27 | |
---|
28 | SUBROUTINE compute_vorticity(ue,vort) |
---|
29 | USE icosa |
---|
30 | USE disvert_mod |
---|
31 | IMPLICIT NONE |
---|
32 | REAL(rstd),INTENT(IN) :: ue(3*iim*jjm,llm) |
---|
33 | REAL(rstd),INTENT(OUT) :: vort(2*iim*jjm,llm) |
---|
34 | INTEGER :: i,j,ij,l |
---|
35 | |
---|
36 | DO l = 1,llm |
---|
37 | DO j=jj_begin-1,jj_end+1 |
---|
38 | DO i=ii_begin-1,ii_end+1 |
---|
39 | ij=(j-1)*iim+i |
---|
40 | |
---|
41 | vort(ij+z_up,l) = 1./Av(ij+z_up)*( ne(ij,rup) * ue(ij+u_rup,l) * de(ij+u_rup) & |
---|
42 | + ne(ij+t_rup,left) * ue(ij+t_rup+u_left,l) * de(ij+t_rup+u_left) & |
---|
43 | - ne(ij,lup) * ue(ij+u_lup,l) * de(ij+u_lup) ) |
---|
44 | |
---|
45 | vort(ij+z_down,l) = 1./Av(ij+z_down)*( ne(ij,ldown) * ue(ij+u_ldown,l) * de(ij+u_ldown) & |
---|
46 | + ne(ij+t_ldown,right) * ue(ij+t_ldown+u_right,l) * de(ij+t_ldown+u_right) & |
---|
47 | - ne(ij,rdown) * ue(ij+u_rdown,l) * de(ij+u_rdown) ) |
---|
48 | |
---|
49 | ENDDO |
---|
50 | ENDDO |
---|
51 | ENDDO |
---|
52 | |
---|
53 | END SUBROUTINE compute_vorticity |
---|
54 | |
---|
55 | END MODULE vorticity_mod |
---|