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

Contents of /trunk/dyn3d/start_inter_3d.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: 2601 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 module start_inter_3d_m
2
3 IMPLICIT NONE
4
5 contains
6
7 subroutine start_inter_3d(varname, lon_in2, lat_in2, pls_in, var3d)
8
9 ! This procedure gets a 3D variable from a file and interpolates it.
10
11 use nr_util, only: assert_eq
12 use numer_rec_95, only: spline, splint
13 use inter_barxy_m, only: inter_barxy
14 use gr_int_dyn_m, only: gr_int_dyn
15 use conf_dat3d_m, only: conf_dat3d
16 use netcdf, only: nf90_nowrite
17 use netcdf95, only: nf95_open, nf95_close, nf95_get_var, nf95_inq_varid
18 use startdyn, only: IML_DYN, JML_DYN, LLM_DYN, LAT_INI, LEVDYN_INI, LON_INI
19
20 CHARACTER(len=*), intent(in):: varname
21 REAL, intent(in):: lon_in2(:) ! (iml) longitude, in rad
22 REAL, intent(in):: lat_in2(:) ! latitude, in rad
23 REAL, intent(in):: pls_in(:, :, :) ! (iml, jml, lml)
24 REAL, intent(out):: var3d(:, :, :) ! (iml, jml, lml)
25
26 ! LOCAL:
27 INTEGER iml, jml, lml, ncid, varid
28 INTEGER ii, ij, il
29 REAL lon_rad(iml_dyn), lat_rad(jml_dyn)
30 REAL lev_dyn(llm_dyn)
31 REAL var_tmp2d(size(lon_in2)-1, size(pls_in, 2))
32 real var_tmp3d(size(lon_in2), size(pls_in, 2), llm_dyn)
33 REAL ax(llm_dyn), ay(llm_dyn), yder(llm_dyn)
34 real var_ana3d(iml_dyn, jml_dyn, llm_dyn)
35
36 !--------------------------------
37
38 print *, "Call sequence information: start_inter_3d"
39
40 iml = assert_eq(size(pls_in, 1), size(lon_in2), size(var3d, 1), &
41 "start_inter_3d iml")
42 jml = assert_eq(size(pls_in, 2), size(var3d, 2), "start_inter_3d jml")
43 lml = assert_eq(size(pls_in, 3), size(var3d, 3), "start_inter_3d lml")
44
45 print *, "iml = ", iml, ", jml = ", jml
46 print *, "varname = ", varname
47 call nf95_open('ECDYN.nc', nf90_nowrite, ncid)
48 call nf95_inq_varid(ncid, varname, varid)
49 call nf95_get_var(ncid, varid, var_ana3d)
50 call nf95_close(ncid)
51 CALL conf_dat3d(lon_ini, lat_ini, levdyn_ini, lon_rad, lat_rad, lev_dyn, &
52 var_ana3d)
53
54 DO il = 1, llm_dyn
55 CALL inter_barxy(lon_rad, lat_rad(:jml_dyn-1), var_ana3d(:, :, il), &
56 lon_in2(:iml-1), lat_in2, var_tmp2d)
57 var_tmp3d(:, :, il) = gr_int_dyn(var_tmp2d)
58 ENDDO
59
60 ! Pour l'interpolation verticale, on interpole du haut de l'atmosphère
61 ! vers le sol :
62 ax = lev_dyn(llm_dyn:1:-1)
63 DO ij=1, jml
64 DO ii=1, iml-1
65 ay = var_tmp3d(ii, ij, llm_dyn:1:-1)
66 yder = SPLINE(ax, ay)
67 do il=1, lml
68 var3d(ii, ij, il) = SPLINT(ax, ay, yder, pls_in(ii, ij, il))
69 END do
70 ENDDO
71 ENDDO
72 var3d(iml, :, :) = var3d(1, :, :)
73
74 END subroutine start_inter_3d
75
76 end module start_inter_3d_m

  ViewVC Help
Powered by ViewVC 1.1.21