/[lmdze]/trunk/dyn3d/Inter_barxy/test_inter_barxy.f
ViewVC logotype

Contents of /trunk/dyn3d/Inter_barxy/test_inter_barxy.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 266 - (show annotations)
Thu Apr 19 17:54:55 2018 UTC (6 years ago) by guez
File size: 2117 byte(s)
Define macros of the preprocessor CPP_IIM, CPP_JJM, CPP_LLM so we can
control the resolution from the compilation command, and automate
compilation for several resolutions.

In module yoethf_m, transform variables into named constants. So we do
not need procedure yoethf any longer.

Bug fix in program test_inter_barxy, missing calls to fyhyp and fxhyp,
and definition of rlatu.

Remove variable iecri of module conf_gcm_m. The files dyn_hist*.nc are
written every time step. We are simplifying the output system, pending
replacement by a whole new system.

Modify possible value of vert_sampling from "param" to
"strato_custom", following LMDZ. Default values of corresponding
namelist variables are now the values used for LMDZ CMIP6.

1 program test_inter_barxy
2
3 use comconst, only: iniconst
4 use comdissnew, only: read_comdissnew
5 use comgeom, only: inigeom
6 use conf_gcm_m, only: conf_gcm
7 use dimensions, only: iim, jjm
8 USE dynetat0_m, only: rlonu, rlatv, rlatu, rlatu1, rlatu2, rlonv, xprimm025, &
9 xprimp025, xprimu, xprimv, yprimu1, yprimu2
10 use fxhyp_m, only: fxhyp
11 use fyhyp_m, only: fyhyp
12 use inter_barxy_m, only: inter_barxy
13 USE nr_util, ONLY : pi
14 use read_serre_m, only: read_serre
15
16 implicit none
17
18 integer:: iml_dyn = 3, jml_dyn = 6
19 real, allocatable:: lon_rad(:), lon_ini(:)
20 real, allocatable:: lat_rad(:), lat_ini(:)
21 integer i
22 real, allocatable:: var_ana3d(:, :)
23 REAL var_tmp2d(iim, jjm + 1)
24
25 namelist /main/iml_dyn, jml_dyn
26
27 !------------------------
28
29 print *, "Enter namelist 'main'."
30 read (unit=*, nml=main)
31 write(unit=*, nml=main)
32
33 allocate(lon_rad(iml_dyn), lon_ini(iml_dyn))
34 allocate(lat_rad(jml_dyn-1), lat_ini(jml_dyn))
35 allocate(var_ana3d(iml_dyn, jml_dyn))
36
37 CALL conf_gcm
38 call read_comdissnew
39 CALL iniconst
40 call read_serre
41 CALL fyhyp(rlatu, rlatv, rlatu2, yprimu2, rlatu1, yprimu1)
42 CALL fxhyp(xprimm025, rlonv, xprimv, rlonu, xprimu, xprimp025)
43
44 rlatu(1) = pi / 2.
45 rlatu(jjm + 1) = -rlatu(1)
46
47 CALL inigeom
48
49 lon_ini = - pi + 2 * pi / iml_dyn * (/(i, i = 0, iml_dyn - 1)/)
50
51 forall (i = 1: iml_dyn - 1) lon_rad(i) = (lon_ini(i) + lon_ini(i + 1)) / 2
52 lon_rad(iml_dyn) = (lon_ini(iml_dyn) + pi) / 2
53
54 lat_ini = pi / 2 - pi / (jml_dyn - 1) * (/(i, i = 0, jml_dyn - 1)/)
55 forall (i = 1: jml_dyn - 1) lat_rad(i) = (lat_ini(i) + lat_ini(i + 1)) / 2
56
57 !!forall (i = 1: jml_dyn) var_ana3d(:, i) = i
58 forall (i = 1: jml_dyn) var_ana3d(:, i) = 240. + real(i) / 2
59
60 call inter_barxy(lon_rad, lat_rad, var_ana3d, rlonu(:iim), rlatv, var_tmp2d)
61
62 !!print *, "lon_rad * 180. / pi = ", lon_rad * 180. / pi
63 print *, "lat_rad * 180. / pi = ", lat_rad * 180. / pi
64 !!print *, "var_tmp2d = ", var_tmp2d
65
66 print *, "minval(var_tmp2d, dim=1) = ", minval(var_tmp2d, dim=1)
67 print *, "maxval(var_tmp2d, dim=1) = ", maxval(var_tmp2d, dim=1)
68
69 end program test_inter_barxy

  ViewVC Help
Powered by ViewVC 1.1.21