/[lmdze]/trunk/Sources/test_inter_barxy.f
ViewVC logotype

Contents of /trunk/Sources/test_inter_barxy.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: 1846 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 program test_inter_barxy
2
3 use comconst, only: dtvr, daysec, iniconst
4 use comgeom, only: inigeom
5 use conf_gcm_m, only: conf_gcm, day_step
6 use dimens_m, only: iim, jjm
7 USE dynetat0_m, only: rlonu, rlatv
8 use disvert_m, only: pa
9 use inter_barxy_m, only: inter_barxy
10 USE nr_util, ONLY : pi
11 use read_serre_m, only: read_serre
12
13 implicit none
14
15 integer:: iml_dyn = 3, jml_dyn = 6
16 real, allocatable:: lon_rad(:), lon_ini(:)
17 real, allocatable:: lat_rad(:), lat_ini(:)
18 integer i
19 real, allocatable:: var_ana3d(:, :)
20 REAL var_tmp2d(iim, jjm + 1)
21
22 namelist /main/iml_dyn, jml_dyn
23
24 !------------------------
25
26 print *, "Enter namelist 'main'."
27 read (unit=*, nml=main)
28 write(unit=*, nml=main)
29
30 allocate(lon_rad(iml_dyn), lon_ini(iml_dyn))
31 allocate(lat_rad(jml_dyn-1), lat_ini(jml_dyn))
32 allocate(var_ana3d(iml_dyn, jml_dyn))
33
34 CALL conf_gcm
35 dtvr = daysec / real(day_step)
36 print *, 'dtvr = ', dtvr
37 pa = 5e4
38 CALL iniconst
39 call read_serre
40 CALL inigeom
41
42 lon_ini = - pi + 2 * pi / iml_dyn * (/(i, i = 0, iml_dyn - 1)/)
43
44 forall (i = 1: iml_dyn - 1) lon_rad(i) = (lon_ini(i) + lon_ini(i + 1)) / 2
45 lon_rad(iml_dyn) = (lon_ini(iml_dyn) + pi) / 2
46
47 lat_ini = pi / 2 - pi / (jml_dyn - 1) * (/(i, i = 0, jml_dyn - 1)/)
48 forall (i = 1: jml_dyn - 1) lat_rad(i) = (lat_ini(i) + lat_ini(i + 1)) / 2
49
50 !!forall (i = 1: jml_dyn) var_ana3d(:, i) = i
51 forall (i = 1: jml_dyn) var_ana3d(:, i) = 240. + real(i) / 2
52
53 call inter_barxy(lon_rad, lat_rad, var_ana3d, rlonu(:iim), rlatv, var_tmp2d)
54
55 !!print *, "lon_rad * 180. / pi = ", lon_rad * 180. / pi
56 print *, "lat_rad * 180. / pi = ", lat_rad * 180. / pi
57 !!print *, "var_tmp2d = ", var_tmp2d
58
59 print *, "minval(var_tmp2d, dim=1) = ", minval(var_tmp2d, dim=1)
60 print *, "maxval(var_tmp2d, dim=1) = ", maxval(var_tmp2d, dim=1)
61
62 end program test_inter_barxy

  ViewVC Help
Powered by ViewVC 1.1.21