/[lmdze]/trunk/Sources/phylmd/Mobidic/press_coefoz.f
ViewVC logotype

Annotation of /trunk/Sources/phylmd/Mobidic/press_coefoz.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 225 - (hide annotations)
Mon Oct 16 12:35:41 2017 UTC (6 years, 8 months ago) by guez
File size: 1633 byte(s)
LMDZE is now in Fortran 2003 (use of allocatable arguments).

gradsdef was not used.

Change names: [uv]10m to [uv]10m_srf in clmain, y[uv]1 to
[uv]1lay. Remove useless complication: zx_alf[12]. Do not modify
[uv]1lay after initial definition from [uv].

Add [uv]10m_srf to output.

Change names in physiq: [uv]10m to [uv]10m_srf, z[uv]10m to [uv]10m,
corresponding to NetCDF output names.

Remove unused complication couchelimite and useless variable inirnpb
in phytrac.

1 guez 17 module press_coefoz_m
2    
3     implicit none
4    
5 guez 225 real, allocatable, save:: plev(:)
6 guez 17 ! (pressure level of Mobidic input data, converted to Pa, in
7     ! ascending order)
8    
9     real, allocatable, save:: press_in_edg(:)
10     ! (edges of pressure intervals for Mobidic input data, in Pa, in
11     ! ascending order)
12    
13     contains
14    
15     subroutine press_coefoz
16    
17     ! This procedure is called once per run.
18     ! It reads the pressure levels from "coefoz_LMDZ.nc".
19     ! We assume that, in "coefoz_LMDZ.nc", the pressure levels are in hPa
20     ! and strictly increasing.
21    
22 guez 22 use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, nf95_gw_var
23 guez 17 use netcdf, only: nf90_nowrite
24    
25     ! Variables local to the procedure:
26 guez 22 integer ncid, varid ! for NetCDF
27 guez 17 integer n_plev ! number of pressure levels in the input data
28     integer k
29    
30     !---------------------------------------
31    
32     print *, "Call sequence information: press_coefoz"
33    
34     call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid)
35    
36 guez 22 call nf95_inq_varid(ncid, "plev", varid)
37     call nf95_gw_var(ncid, varid, plev)
38 guez 17 ! Convert from hPa to Pa because "regr_pr_av" and "regr_pr_int"
39     ! require so:
40     plev = plev * 100.
41     n_plev = size(plev)
42    
43     call nf95_close(ncid)
44    
45     ! Compute edges of pressure intervals:
46     allocate(press_in_edg(n_plev + 1))
47     press_in_edg(1) = 0.
48     ! We choose edges halfway in logarithm:
49     forall (k = 2:n_plev) press_in_edg(k) = sqrt(plev(k - 1) * plev(k))
50     press_in_edg(n_plev + 1) = huge(0.)
51     ! (infinity, but any value guaranteed to be greater than the
52     ! surface pressure would do)
53    
54     end subroutine press_coefoz
55    
56     end module press_coefoz_m

  ViewVC Help
Powered by ViewVC 1.1.21