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

Annotation of /trunk/dyn3d/start_init_phys_m.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 49 - (hide annotations)
Wed Aug 24 11:43:14 2011 UTC (12 years, 9 months ago) by guez
Original Path: trunk/libf/dyn3d/start_init_phys_m.f90
File size: 2604 byte(s)
LMDZE now uses library Jumble.

Removed all calls to "flinget". Replaced calls to "flinget",
"flininfo", "flinopen_nozoom" by calls to NetCDF95 and Jumble.

Split file "cv_driver.f" into "cv_driver.f90", "cv_flag.f90" and
"cv_thermo.f90".

Bug fix: "QANCIEN" was read twice in "phyeytat0".

In "physiq", initialization of "d_t", "d_u", "d_v" was useless.

1 guez 3 MODULE start_init_phys_m
2    
3     ! From startvar.F, version 1.4
4     ! 2006/01/27 15:14:22 Fairhead
5    
6     IMPLICIT NONE
7    
8     CONTAINS
9    
10 guez 43 SUBROUTINE start_init_phys(tsol_2d, qsol_2d)
11 guez 3
12 guez 49 use comgeom, only: rlonu, rlatv
13 guez 3 use conf_dat2d_m, only: conf_dat2d
14 guez 49 use dimens_m, only: iim, jjm
15     use gr_int_dyn_m, only: gr_int_dyn
16 guez 3 use inter_barxy_m, only: inter_barxy
17 guez 49 use jumble, only: find_longitude, find_latitude
18 guez 48 use netcdf, only: nf90_nowrite
19 guez 49 use netcdf95, only: nf95_open, nf95_close, nf95_get_var, nf95_inq_varid, &
20     nf95_gw_var
21     use nr_util, only: assert, pi
22 guez 3
23 guez 43 REAL, intent(out):: tsol_2d(:, :), qsol_2d(:, :) ! (iim + 1, jjm + 1)
24 guez 3
25 guez 42 ! Variables local to the procedure:
26 guez 3
27 guez 49 INTEGER iml_phys, jml_phys, ncid, varid
28 guez 3 REAL, ALLOCATABLE:: lon_rad(:), lat_rad(:)
29 guez 49 REAL, pointer:: lon_ini(:), lat_ini(:) ! longitude and latitude in rad
30 guez 3 REAL, ALLOCATABLE:: var_ana(:, :)
31     real tmp_var(iim, jjm + 1)
32    
33     !-----------------------------------
34    
35     print *, "Call sequence information: start_init_phys"
36 guez 43
37     call assert((/size(tsol_2d, 1), size(qsol_2d, 1)/) == iim + 1, &
38     "start_init_phys 1")
39     call assert((/size(tsol_2d, 2), size(qsol_2d, 2)/) == jjm + 1, &
40     "start_init_phys 2")
41    
42 guez 49 call nf95_open('ECPHY.nc', nf90_nowrite, ncid)
43 guez 3
44 guez 49 call find_longitude(ncid, varid=varid)
45     call nf95_gw_var(ncid, varid, lon_ini)
46     lon_ini = lon_ini * pi / 180. ! convert to rad
47     iml_phys = size(lon_ini)
48 guez 3
49 guez 49 call find_latitude(ncid, varid=varid)
50     call nf95_gw_var(ncid, varid, lat_ini)
51     lat_ini = lat_ini * pi / 180. ! convert to rad
52     jml_phys = size(lat_ini)
53 guez 3
54     ! Allocate the space we will need to get the data out of this file
55     ALLOCATE(var_ana(iml_phys, jml_phys))
56    
57     ALLOCATE(lon_rad(iml_phys))
58     ALLOCATE(lat_rad(jml_phys))
59    
60 guez 42 ! We get the two standard variables
61     ! 'ST': surface temperature
62 guez 48 call nf95_inq_varid(ncid, 'ST', varid)
63     call nf95_get_var(ncid, varid, var_ana)
64 guez 3 CALL conf_dat2d(lon_ini, lat_ini, lon_rad, lat_rad, var_ana)
65     CALL inter_barxy(lon_rad, lat_rad(:jml_phys -1), var_ana, rlonu(:iim), &
66     rlatv, tmp_var)
67 guez 43 tsol_2d = gr_int_dyn(tmp_var)
68 guez 3
69     ! Soil moisture
70 guez 48 call nf95_inq_varid(ncid, 'CDSW', varid)
71     call nf95_get_var(ncid, varid, var_ana)
72 guez 3 CALL conf_dat2d(lon_ini, lat_ini, lon_rad, lat_rad, var_ana)
73     CALL inter_barxy(lon_rad, lat_rad(:jml_phys -1), var_ana, rlonu(:iim), &
74     rlatv, tmp_var)
75 guez 43 qsol_2d = gr_int_dyn(tmp_var)
76 guez 3
77 guez 48 call nf95_close(ncid)
78 guez 49 deallocate(lon_ini, lat_ini) ! pointers
79 guez 3
80     END SUBROUTINE start_init_phys
81    
82     END MODULE start_init_phys_m

  ViewVC Help
Powered by ViewVC 1.1.21