/[lmdze]/trunk/dyn3d/Inter_barxy/inter_bary.f
ViewVC logotype

Contents of /trunk/dyn3d/Inter_barxy/inter_bary.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 98 - (show annotations)
Tue May 13 17:23:16 2014 UTC (10 years ago) by guez
File size: 2259 byte(s)
Split inter_barxy.f : one procedure per module, one module per
file. Grouped the files into a directory.

Split orbite.f.

Value of raz_date read from the namelist is taken into account
(resetting the step counter) even if annee_ref == anneeref and day_ref
== dayref. raz_date is no longer modified by gcm main unit. (Following
LMDZ.)

Removed argument klon of interfsur_lim. Renamed arguments lmt_alb,
lmt_rug to alb_new, z0_new (same name as corresponding actual
arguments in interfsurf_hq).

Removed argument klon of interfsurf_hq.

Removed arguments qs and d_qs of diagetpq. Were always
zero. Downgraded arguments d_qw, d_ql of diagetpq to local variables,
they were not used in physiq. Removed all computations for solid water
in diagetpq, was just zero.


Downgraded arguments fs_bound, fq_bound of diagphy to local variables,
they were not used in physiq. Encapsulated in a test on iprt all
computations in diagphy.

Removed parameter nbtr of module dimphy. Replaced it everywhere in the
program by nqmx - 2.

Removed parameter rnpb of procedure physiq. Kept the true case in
physiq and phytrac. Could not work with false case anyway.

Removed arguments klon, llm, airephy of qcheck. Removed argument ftsol
of initrrnpb, was not used.

1 module inter_bary_m
2
3 implicit none
4
5 contains
6
7
8 !******************************
9
10 function inter_bary(yjdat, fdat, yjmod)
11
12 ! From dyn3d/inter_bary.F, version 1.1.1.1 2004/05/19 12:53:06
13 ! Authors: R. Sadourny, P. Le Van
14
15 ! Interpolation barycentrique basée sur les aires.
16 ! Version unidimensionnelle, en latitude.
17 ! L'indice 1 correspond à l'interface maille 1 -- maille 2.
18
19 use nr_util, only: assert
20
21
22 REAL, intent(in):: yjdat(:)
23 ! (angles, ordonnées des interfaces des mailles des données, in
24 ! degrees, in increasing order)
25
26 REAL, intent(in):: fdat(:) ! champ de données
27
28 REAL, intent(in):: yjmod(:)
29 ! (ordonnées des interfaces des mailles du modèle)
30 ! (in degrees, in strictly increasing order)
31
32 REAL inter_bary(size(yjmod)) ! champ du modèle
33
34 ! Variables local to the procedure:
35
36 REAL y0, dy, dym
37 INTEGER jdat ! indice du champ de données
38 integer jmod ! indice du champ du modèle
39
40 !------------------------------------
41
42 call assert(size(yjdat) == size(fdat), "inter_bary")
43
44 ! Initialisation des variables
45 inter_bary(:) = 0.
46 y0 = -90.
47 dym = 0.
48 jmod = 1
49 jdat = 1
50
51 do while (jmod <= size(yjmod))
52 do while (yjmod(jmod) > yjdat(jdat))
53 dy = yjdat(jdat) - y0
54 dym = dym + dy
55 inter_bary(jmod) = inter_bary(jmod) + dy * fdat(jdat)
56 y0 = yjdat(jdat)
57 jdat = jdat + 1
58 end do
59 IF (yjmod(jmod) < yjdat(jdat)) THEN
60 dy = yjmod(jmod) - y0
61 dym = dym + dy
62 inter_bary(jmod) = (inter_bary(jmod) + dy * fdat(jdat)) / dym
63 y0 = yjmod(jmod)
64 dym = 0.
65 jmod = jmod + 1
66 ELSE
67 ! {yjmod(jmod) == yjdat(jdat)}
68 dy = yjmod(jmod) - y0
69 dym = dym + dy
70 inter_bary(jmod) = (inter_bary(jmod) + dy * fdat(jdat)) / dym
71 y0 = yjmod(jmod)
72 dym = 0.
73 jmod = jmod + 1
74 jdat = jdat + 1
75 END IF
76 end do
77 ! Le test de fin suppose que l'interface 0 est commune aux deux
78 ! grilles "yjdat" et "yjmod".
79
80 END function inter_bary
81
82 end module inter_bary_m

  ViewVC Help
Powered by ViewVC 1.1.21