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

Annotation of /trunk/Sources/dyn3d/Inter_barxy/test_inter_barxy.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 191 - (hide annotations)
Mon May 9 19:56:28 2016 UTC (8 years, 2 months ago) by guez
File size: 1909 byte(s)
Extracted the call to read_comdissnew out of conf_gcm.

Made ok_instan a variable of module clesphys, itau_phy a variable of
module phyetat0_m, nid_ins a variable of module ini_histins_m, itap a
variable of new module time_phylmdz, so that histwrite_phy can be
called from any procedure without the need to cascade those variables
into that procedure. Made itau_w a variable of module time_phylmdz so
that it is computed only once per time step of physics.

Extracted variables of module clesphys which were in namelist
conf_phys_nml into their own namelist, clesphys_nml, and created
procedure read_clesphys reading clesphys_nml, to avoid side effect.

No need for double precision in procedure getso4fromfile. Assume there
is a single variable for the whole year in the NetCDF file instead of
one variable per month.

Created generic procedure histwrite_phy and removed procedure
write_histins, following LMDZ. histwrite_phy has only two arguments,
can be called from anywhere, and should manage the logic of writing or
not writing into various history files with various operations. So the
test on ok_instan goes inside histwrite_phy.

Test for raz_date in phyetat0 instead of physiq to avoid side effect.

Created procedure increment_itap to avoid side effect.

Removed unnecessary differences between procedures readsulfate and
readsulfate_pi.

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

  ViewVC Help
Powered by ViewVC 1.1.21