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

Annotation of /trunk/dyn3d/grid_change.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 266 - (hide annotations)
Thu Apr 19 17:54:55 2018 UTC (6 years, 1 month ago) by guez
File size: 1996 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 guez 3 module grid_change
2    
3 guez 265 use dimensions, only: iim, jjm
4 guez 3
5     IMPLICIT NONE
6    
7     logical, save:: dyn_phy(iim + 1, jjm + 1)
8     ! (mask for distinct points in the scalar grid and the "u" grid,
9     ! first index is for longitude, second index is for latitude)
10    
11     private iim, jjm
12    
13     contains
14    
15     subroutine init_dyn_phy
16    
17     ! Construct the mask:
18     dyn_phy = .true.
19     dyn_phy(2:, 1) = .false.
20     dyn_phy(2:, jjm + 1) = .false.
21     dyn_phy(iim + 1, 2:jjm) = .false.
22     ! Note that "count(dyn_phy)" equals "klon"
23    
24     end subroutine init_dyn_phy
25    
26     !********************************************
27    
28     function gr_fi_dyn(pfi)
29    
30 guez 266 ! From gr_fi_dyn.F, version 1.1.1.1, 2004/05/19 12:53:05
31     ! Passage d'un champ de la grille physique \`a la grille dynamique.
32 guez 3
33     use dimphy, only: klon
34    
35 guez 47 REAL, intent(in):: pfi(:) ! (klon)
36 guez 3 real gr_fi_dyn(iim + 1, jjm + 1)
37    
38     ! Variable local to the procedure:
39     real field(iim + 1, jjm + 1)
40    
41     !-----------------------------------------------------------------------
42    
43     if (size(pfi) /= klon) stop "gr_fi_dyn"
44    
45 guez 168 ! Traitement des p\^oles :
46 guez 3 field(2:, 1) = pfi(1)
47     field(2:, jjm + 1) = pfi(klon)
48     ! (We leave undefined elements in "field")
49    
50     gr_fi_dyn = unpack(pfi, dyn_phy, field)
51     ! Undefined elements at last longitude in "gr_fi_dyn" come from
52     ! undefined elements in "field".
53     ! Overwrite them now, knowing that last longitude equals first longitude:
54     gr_fi_dyn(iim + 1, 2:jjm) = gr_fi_dyn(1, 2:jjm)
55    
56     END function gr_fi_dyn
57    
58     !********************************************
59    
60 guez 168 function gr_dyn_phy(v)
61    
62     ! Passage d'un champ 3D de la grille dynamique \`a la grille physique
63    
64     use dimphy, only: klon
65    
66     REAL, intent(in):: v(:, :, :) ! (iim + 1, jjm + 1, :)
67     real gr_dyn_phy(klon, size(v, 3))
68    
69     ! Local:
70     integer k
71    
72     !-----------------------------------------------------------------------
73    
74     forall (k = 1:size(v, 3)) gr_dyn_phy(:, k) = pack(v(:, :, k), dyn_phy)
75    
76     END function gr_dyn_phy
77    
78 guez 3 end module grid_change

  ViewVC Help
Powered by ViewVC 1.1.21