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

Annotation of /trunk/dyn3d/startdyn.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 139 - (hide annotations)
Tue May 26 17:46:03 2015 UTC (9 years ago) by guez
Original Path: trunk/Sources/dyn3d/startdyn.f
File size: 3248 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 guez 3 MODULE startdyn
2    
3     ! From startvar.F, version 1.4
4 guez 73 ! January 27th, 2006 15:14:22
5 guez 3
6 guez 54 INTEGER iml_dyn, jml_dyn, llm_dyn
7 guez 3
8 guez 73 REAL, pointer:: lon_ini(:), lat_ini(:)
9     ! longitude and latitude from the input file, converted to rad
10 guez 3
11 guez 73 real, pointer:: levdyn_ini(:)
12 guez 3
13     CONTAINS
14    
15 guez 78 SUBROUTINE start_init_dyn(tsol_2d, phis, ps)
16 guez 3
17 guez 139 use comgeom, only: aire_2d, apoln, apols
18 guez 3 use conf_dat2d_m, only: conf_dat2d
19     use dimens_m, only: iim, jjm
20 guez 139 use dynetat0_m, only: rlonu, rlatv
21 guez 3 use gr_int_dyn_m, only: gr_int_dyn
22 guez 73 use inter_barxy_m, only: inter_barxy
23     use netcdf, only: nf90_nowrite
24     use netcdf95, only: nf95_open, nf95_close, nf95_get_var, nf95_inq_varid, &
25     nf95_gw_var, find_coord
26     use nr_util, only: assert, pi
27 guez 3
28 guez 43 REAL, intent(in):: tsol_2d(:, :) ! (iim + 1, jjm + 1)
29 guez 3
30 guez 78 REAL, intent(in):: phis(:, :) ! (iim + 1, jjm + 1)
31     ! surface geopotential, in m2 s-2
32    
33     REAL, intent(out):: ps(:, :) ! (iim + 1, jjm + 1) surface pressure, in Pa
34    
35 guez 3 ! Local:
36    
37 guez 73 INTEGER ncid, varid
38 guez 3 REAL, ALLOCATABLE:: lon_rad(:), lat_rad(:)
39 guez 36 REAL, ALLOCATABLE:: var_ana(:, :)
40     real z(iim + 1, jjm + 1)
41 guez 3 real tmp_var(iim, jjm + 1)
42    
43     !--------------------------
44    
45     print *, "Call sequence information: start_init_dyn"
46 guez 78 call assert((/size(tsol_2d, 1), size(phis, 1), size(ps, 1)/) == iim + 1, &
47 guez 42 "start_init_dyn size 1")
48 guez 78 call assert((/size(tsol_2d, 2), size(phis, 2), size(ps, 2)/) == jjm + 1, &
49 guez 42 "start_init_dyn size 2")
50 guez 54
51 guez 73 call nf95_open('ECDYN.nc', nf90_nowrite, ncid)
52 guez 3
53 guez 73 call find_coord(ncid, varid=varid, std_name="longitude")
54     call nf95_gw_var(ncid, varid, lon_ini)
55     lon_ini = lon_ini * pi / 180. ! convert to rad
56     iml_dyn = size(lon_ini)
57     print *, "iml_dyn = ", iml_dyn
58 guez 3
59 guez 73 call find_coord(ncid, varid=varid, std_name="latitude")
60     call nf95_gw_var(ncid, varid, lat_ini)
61     lat_ini = lat_ini * pi / 180. ! convert to rad
62     jml_dyn = size(lat_ini)
63     print *, "jml_dyn = ", jml_dyn
64 guez 3
65 guez 73 call nf95_inq_varid(ncid, "level", varid)
66     call nf95_gw_var(ncid, varid, levdyn_ini)
67     llm_dyn = size(levdyn_ini)
68     print *, "llm_dyn = ", llm_dyn
69 guez 3
70 guez 73 ALLOCATE(var_ana(iml_dyn, jml_dyn), lon_rad(iml_dyn), lat_rad(jml_dyn))
71 guez 3
72     ! 'Z': Surface geopotential
73 guez 48 call nf95_inq_varid(ncid, 'Z', varid)
74     call nf95_get_var(ncid, varid, var_ana)
75 guez 3 CALL conf_dat2d(lon_ini, lat_ini, lon_rad, lat_rad, var_ana)
76     CALL inter_barxy(lon_rad, lat_rad(:jml_dyn -1), var_ana, rlonu(:iim), &
77     rlatv, tmp_var)
78 guez 36 z = gr_int_dyn(tmp_var)
79 guez 3
80     ! 'SP': Surface pressure
81 guez 48 call nf95_inq_varid(ncid, 'SP', varid)
82     call nf95_get_var(ncid, varid, var_ana)
83 guez 3 CALL conf_dat2d(lon_ini, lat_ini, lon_rad, lat_rad, var_ana)
84     CALL inter_barxy(lon_rad, lat_rad(:jml_dyn -1), var_ana, rlonu(:iim), &
85     rlatv, tmp_var)
86 guez 78 ps = gr_int_dyn(tmp_var)
87 guez 3
88 guez 48 call nf95_close(ncid)
89    
90 guez 78 ! Adapt the surface pressure to "phis", with the hypsometric equation:
91     ps(:iim, :) = ps(:iim, :) &
92 guez 36 * (1. + (z(:iim, :) - phis(:iim, :)) / 287. / tsol_2d(:iim, :))
93 guez 3
94 guez 78 ps(iim + 1, :) = ps(1, :)
95     ps(:, 1) = SUM(aire_2d(:iim, 1) * ps(:iim, 1)) / apoln
96     ps(:, jjm + 1) = SUM(aire_2d(:iim, jjm + 1) * ps(:iim, jjm + 1)) / apols
97 guez 3
98     END SUBROUTINE start_init_dyn
99    
100     END MODULE startdyn

  ViewVC Help
Powered by ViewVC 1.1.21