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

Contents of /trunk/Sources/dyn3d/start_init_phys_m.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 139 - (show annotations)
Tue May 26 17:46:03 2015 UTC (8 years, 11 months ago) by guez
File size: 2559 byte(s)
dynetat0 read rlonu, rlatu, rlonv, rlatv, cu_2d, cv_2d, aire_2d from
"start.nc" and then these variables were overwritten by
inigeom. Corrected this. Now, inigeom does not compute rlonu, rlatu,
rlonv and rlatv. Moreover, cu_2d, cv_2d, aire_2d are not written to
"restart.nc". Since xprimu, xprimv, xprimm025, xprimp025, rlatu1,
rlatu2, yprimu1, yprimu2 are computed at the same time as rlonu,
rlatu, rlonv, rlatv, and since it would not be convenient to separate
those computations, we decide to write xprimu, xprimv, xprimm025,
xprimp025, rlatu1, rlatu2, yprimu1, yprimu2 into "restart.nc", read
them from "start.nc" and not compute them in inigeom. So, in summary,
"start.nc" contains all the coordinates and their derivatives, and
inigeom only computes the 2D-variables.

Technical details:

Moved variables rlatu, rlonv, rlonu, rlatv, xprimu, xprimv from module
comgeom to module dynetat0_m. Upgraded local variables rlatu1,
yprimu1, rlatu2, yprimu2, xprimm025, xprimp025 of procedure inigeom to
variables of module dynetat0_m.

Removed unused local variable yprimu of procedure inigeom and
corresponding argument yyprimu of fyhyp.

Moved variables clat, clon, grossismx, grossismy, dzoomx, dzoomy,
taux, tauy from module serre to module dynetat0_m (since they are read
from "start.nc"). The default values are now defined in read_serre
instead of in the declarations. Changed name of module serre to
read_serre_m, no more module variable here.

The calls to fxhyp and fyhyp are moved from inigeom to etat0.

Side effects in programs other than gcm: etat0 and read_serre write
variables of module dynetat0; the programs test_fxyp and
test_inter_barxy need more source files.

Removed unused arguments len and nd of cv3_tracer. Removed unused
argument PPSOL of LWU.

Bug fix in test_inter_barxy: forgotten call to read_serre.

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

  ViewVC Help
Powered by ViewVC 1.1.21