/[lmdze]/trunk/libf/phylmd/plevel.f
ViewVC logotype

Contents of /trunk/libf/phylmd/plevel.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (show annotations)
Mon Jul 21 16:05:07 2008 UTC (15 years, 9 months ago) by guez
File size: 3225 byte(s)
-- Minor modification of input/output:

Created procedure "read_logic". Variables of module "logic" are read
by "read_logic" instead of "conf_gcm". Variable "offline" of module
"conf_gcm" is read from namelist instead of "*.def".

Deleted arguments "dtime", "co2_ppm_etat0", "solaire_etat0",
"tabcntr0" and local variables "radpas", "tab_cntrl" of
"phyetat0". "phyetat0" does not read "controle" in "startphy.nc" any
longer. "phyetat0" now reads global attribute "itau_phy" from
"startphy.nc". "phyredem" does not create variable "controle" in
"startphy.nc" any longer. "phyredem" now writes global attribute
"itau_phy" of "startphy.nc". Deleted argument "tabcntr0" of
"printflag". Removed diagnostic messages written by "printflag" for
comparison of the variable "controle" of "startphy.nc" and the
variables read from "*.def" or namelist input.

-- Removing unwanted functionality:

Removed variable "lunout" from module "iniprint", replaced everywhere
by standard output.

Removed case "ocean == 'couple'" in "clmain", "interfsurf_hq" and
"physiq". Removed procedure "interfoce_cpl".

-- Should not change anything at run time:

Automated creation of graphs in documentation. More documentation on
input files.

Converted Fortran files to free format: "phyredem.f90", "printflag.f90".

Split module "clesphy" into "clesphys" and "clesphys2".

Removed variables "conser", "leapf", "forward", "apphys", "apdiss" and
"statcl" from module "logic". Added arguments "conser" to "advect",
"leapf" to "integrd". Added local variables "forward", "leapf",
"apphys", "conser", "apdiss" in "leapfrog".

Added intent attributes.

Deleted arguments "dtime" of "phyredem", "pdtime" of "flxdtdq", "sh"
of "phytrac", "dt" of "yamada".

Deleted local variables "dtime", "co2_ppm_etat0", "solaire_etat0",
"length", "tabcntr0" in "physiq". Replaced all references to "dtime"
by references to "pdtphys".

1 !
2 ! $Header: /home/cvsroot/LMDZ4/libf/phylmd/plevel.F,v 1.1.1.1 2004/05/19 12:53:08 lmdzadmin Exp $
3 !
4 c================================================================
5 c================================================================
6 SUBROUTINE plevel(ilon,ilev,lnew,pgcm,pres,Qgcm,Qpres)
7 c================================================================
8 c================================================================
9
10 use dimens_m
11 use dimphy
12 IMPLICIT none
13
14
15 c================================================================
16 c
17 c Interpoler des champs 3-D u, v et g du modele a un niveau de
18 c pression donnee (pres)
19 c
20 c INPUT: ilon ----- nombre de points
21 c ilev ----- nombre de couches
22 c lnew ----- true si on doit reinitialiser les poids
23 c pgcm ----- pressions modeles
24 c pres ----- pression vers laquelle on interpolle
25 c Qgcm ----- champ GCM
26 c Qpres ---- champ interpolle au niveau pres
27 c
28 c================================================================
29 c
30 c arguments :
31 c -----------
32
33 INTEGER ilon, ilev
34 logical lnew
35
36 REAL, intent(in):: pgcm(ilon,ilev)
37 REAL, intent(in):: Qgcm(ilon,ilev)
38 real pres
39 REAL Qpres(ilon)
40
41 c local :
42 c -------
43
44 INTEGER lt(klon), lb(klon)
45 REAL ptop, pbot, aist(klon), aisb(klon)
46
47 save lt,lb,ptop,pbot,aist,aisb
48
49 INTEGER i, k
50 c
51
52 c=====================================================================
53 if (lnew) then
54 c on réinitialise les réindicages et les poids
55 c=====================================================================
56
57
58 c Chercher les 2 couches les plus proches du niveau a obtenir
59 c
60 c Eventuellement, faire l'extrapolation a partir des deux couches
61 c les plus basses ou les deux couches les plus hautes:
62 DO 130 i = 1, klon
63 IF ( ABS(pres-pgcm(i,ilev) ) .LT.
64 . ABS(pres-pgcm(i,1)) ) THEN
65 lt(i) = ilev ! 2
66 lb(i) = ilev-1 ! 1
67 ELSE
68 lt(i) = 2
69 lb(i) = 1
70 ENDIF
71 130 CONTINUE
72 DO 150 k = 1, ilev-1
73 DO 140 i = 1, klon
74 pbot = pgcm(i,k)
75 ptop = pgcm(i,k+1)
76 IF (ptop.LE.pres .AND. pbot.GE.pres) THEN
77 lt(i) = k+1
78 lb(i) = k
79 ENDIF
80 140 CONTINUE
81 150 CONTINUE
82 c
83 c Interpolation lineaire:
84 c
85 DO i = 1, klon
86 c interpolation en logarithme de pression:
87 c
88 c ... Modif . P. Le Van ( 20/01/98) ....
89 c Modif Frédéric Hourdin (3/01/02)
90
91 aist(i) = LOG( pgcm(i,lb(i))/ pres )
92 . / LOG( pgcm(i,lb(i))/ pgcm(i,lt(i)) )
93 aisb(i) = LOG( pres / pgcm(i,lt(i)) )
94 . / LOG( pgcm(i,lb(i))/ pgcm(i,lt(i)))
95 enddo
96
97
98 endif ! lnew
99
100 c======================================================================
101 c inteprollation
102 c======================================================================
103
104 do i=1,klon
105 Qpres(i)= Qgcm(i,lb(i))*aisb(i)+Qgcm(i,lt(i))*aist(i)
106 enddo
107 c
108 c Je mets les vents a zero quand je rencontre une montagne
109 do i = 1, klon
110 if (pgcm(i,1).LT.pres) THEN
111 c Qpres(i)=1e33
112 Qpres(i)=1e+20
113 endif
114 enddo
115
116 c
117 RETURN
118 END

  ViewVC Help
Powered by ViewVC 1.1.21