/[lmdze]/trunk/libf/phylmd/o3_mob_ph_m.f90
ViewVC logotype

Contents of /trunk/libf/phylmd/o3_mob_ph_m.f90

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations)
Wed Feb 27 13:16:39 2008 UTC (16 years, 2 months ago) by guez
File size: 1655 byte(s)
Initial import
1 module o3_Mob_ph_m
2
3 implicit none
4
5 contains
6
7 function o3_Mob_ph(ncid, name)
8
9 ! This function reads a single Mobidic ozone parameter from a file and
10 ! packs it on the "physics" grid.
11
12 use dimens_m, only: iim, jjm, llm
13 use dimphy, only: klon
14 use netcdf95, only: nf95_inq_varid, nf90_get_var, handle_err
15 use grid_change, only: dyn_phy
16
17 integer, intent(in):: ncid ! NetCDF ID of the file
18 character(len=*), intent(in):: name ! of the NetCDF variable
19
20 real o3_Mob_ph(klon, llm, 12)
21 ! (ozone parameter from Mobidic on the "physics" grid)
22 ! (Third dimension is the number of the month in the year.
23 ! "o3_Mob_ph(i, k, month)" is at longitude "xlon(i)", latitude
24 ! "xlat(i)", middle of layer "k".)
25
26 ! Variables local to the procedure:
27 integer varid, ncerr
28 integer k, month
29
30 real o3_Mob_dyn(iim + 1, jjm + 1, llm, 12)
31 ! (ozone parameter from Mobidic on the "dynamics" grid)
32 ! Fourth dimension is the number of the month in the year.
33 ! "o3_Mob_dyn(i, j, k, month)" is at longitude "rlonv(i)", latitude
34 ! "rlatu(j)", middle of layer "k".)
35
36 !--------------------------------------------
37
38 call nf95_inq_varid(ncid, name, varid)
39 ncerr = nf90_get_var(ncid, varid, o3_Mob_dyn)
40 call handle_err("o3_Mob_ph nf90_get_var " // name, ncerr, ncid)
41
42 ! Latitudes are in increasing order in the input file while
43 ! "rlatu" is in decreasing order, so invert:
44 o3_Mob_dyn = o3_Mob_dyn(:, jjm+1:1:-1, :, :)
45 forall (k = 1:llm, month = 1:12) &
46 o3_Mob_ph(:, k, month) = pack(o3_Mob_dyn(:, :, k, month), dyn_phy)
47
48 end function o3_Mob_ph
49
50 end module o3_Mob_ph_m

  ViewVC Help
Powered by ViewVC 1.1.21