/[lmdze]/trunk/dyn3d/caldyn0.f
ViewVC logotype

Contents of /trunk/dyn3d/caldyn0.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 259 - (show annotations)
Tue Mar 6 16:19:52 2018 UTC (6 years, 2 months ago) by guez
File size: 2732 byte(s)
Try to clarify the logic. Remove module ener. Move variables from
module ener to module dynetat0_m, where they are defined in program
gcm. In sortvarc, I do not see how ptot0 could be 0, discard this possibility.

Remove dummy argument resetvarc of procedure sortvarc. The difference
is that sortvarc is called by caldyn or caldyn0 so just do different
processing in caldyn and caldyn0 instead of inside sortvarc.

No need for variables ang, etot, ptot, rmsdpdt, rmsv, stot, ztot to be
at module level in module sortvarc_m, downgrade them to arguments of
sortvarc. Instead of modyfying the meaning of ang, etot, ptot,
rmsdpdt, rmsv, stot, ztot from absolute quantities to variations of
these quantities, print the ratio in caldyn.

1 module caldyn0_m
2
3 IMPLICIT NONE
4
5 contains
6
7 SUBROUTINE caldyn0(ucov, vcov, teta, ps, pk, phis, phi)
8
9 ! From dyn3d/caldyn0.F, version 1.1.1.1, 2004/05/19 12:53:07
10 ! Authors: P. Le Van, F. Forget
11 ! Objet : calcul des tendances dynamiques
12
13 use bernoui_m, only: bernoui
14 USE comgeom, ONLY: airesurg_2d
15 use convmas_m, only: convmas
16 use covcont_m, only: covcont
17 USE dimens_m, ONLY: iim, jjm, llm
18 USE disvert_m, ONLY: ap, bp
19 use dynetat0_m, only: ang0, etot0, ptot0, stot0, ztot0
20 use enercin_m, only: enercin
21 use flumass_m, only: flumass
22 use massbar_m, only: massbar
23 use massbarxy_m, only: massbarxy
24 use massdair_m, only: massdair
25 USE paramet_m, ONLY: iip1, ip1jmp1, jjp1, llmp1
26 use sortvarc_m, only: sortvarc
27 use tourpot_m, only: tourpot
28 use vitvert_m, only: vitvert
29
30 REAL, INTENT(IN):: ucov(:, :, :) ! (iim + 1, jjm + 1, llm) vent covariant
31 REAL, INTENT(IN):: vcov(:, :, :) ! (iim + 1, jjm, llm) ! vent covariant
32 REAL, INTENT(IN):: teta(ip1jmp1, llm)
33 REAL, INTENT (IN):: ps(ip1jmp1)
34 REAL, INTENT (IN):: pk(iip1, jjp1, llm)
35 REAL, INTENT (IN):: phis(ip1jmp1)
36 REAL, INTENT (IN):: phi(iim + 1, jjm + 1, llm)
37
38 ! Local:
39 real masse(ip1jmp1, llm)
40 REAL w(iim + 1, jjm + 1, llm)
41 REAL pbaru(ip1jmp1, llm), pbarv((iim + 1) * jjm, llm)
42 REAL vcont((iim + 1) * jjm, llm), ucont(ip1jmp1, llm)
43 REAL p(ip1jmp1, llmp1)
44 REAL massebx(ip1jmp1, llm), masseby((iim + 1) * jjm, llm)
45 REAL vorpot(iim + 1, jjm, llm)
46 real ecin(iim + 1, jjm + 1, llm), convm(iim + 1, jjm + 1, llm)
47 REAL massebxy(iim + 1, jjm, llm), dp(iim + 1, jjm + 1)
48 INTEGER l
49 real ang, etot, ptot, ztot, stot, rmsdpdt, rmsv
50
51 !-----------------------------------------------------------------------
52
53 PRINT *, 'Call sequence information: caldyn0'
54
55 CALL covcont(llm, ucov, vcov, ucont, vcont)
56 forall (l = 1: llm + 1) p(:, l) = ap(l) + bp(l) * ps
57 CALL massdair(p, masse)
58 CALL massbar(masse, massebx, masseby)
59 CALL massbarxy(masse, massebxy)
60 CALL flumass(massebx, masseby, vcont, ucont, pbaru, pbarv)
61 CALL convmas(pbaru, pbarv, convm)
62 dp = convm(:, :, 1) / airesurg_2d
63 w = vitvert(convm)
64 CALL tourpot(vcov, ucov, massebxy, vorpot)
65 CALL enercin(vcov, ucov, vcont, ucont, ecin)
66 CALL sortvarc(ucov, teta, ps, masse, pk, phis, vorpot, phi, &
67 bernoui(phi, ecin), dp, ang, etot, ptot, ztot, stot, rmsdpdt, rmsv)
68 PRINT *, 'ptot = ', ptot
69 PRINT *, 'etot = ', etot
70 PRINT *, 'ztot = ', ztot
71 PRINT *, 'stot = ', stot
72 PRINT *, 'ang = ', ang
73 etot0 = etot
74 ptot0 = ptot
75 ztot0 = ztot
76 stot0 = stot
77 ang0 = ang
78
79 END SUBROUTINE caldyn0
80
81 end module caldyn0_m

  ViewVC Help
Powered by ViewVC 1.1.21