source: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/replay1d.F90

Last change on this file was 5159, checked in by abarral, 7 weeks ago

Put dimensions.h and paramet.h into modules

File size: 3.8 KB
Line 
1PROGRAM rejouer
2
3  USE mod_const_mpi, ONLY: comm_lmdz
4  USE inigeomphy_mod, ONLY: inigeomphy
5  USE comvert_mod, ONLY: presnivs
6  USE comvert_mod, ONLY: preff, pa
7  USE ioipsl, ONLY: getin
8  USE lmdz_iotd, ONLY: iotd_ini
9
10USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
11  IMPLICIT NONE
12
13
14  REAL :: airefi
15  REAL :: zcufi = 1.
16  REAL :: zcvfi = 1.
17  REAL :: rlat_rad(1), rlon_rad(1)
18
19  INTEGER ntime
20  INTEGER jour0, mois0, an0, day_step, anneeref, dayref
21  INTEGER klev, klon
22  CHARACTER (len = 10) :: calend
23  CHARACTER(len = 20) :: calendrier
24
25
26  !---------------------------------------------------------------------
27  ! L'appel a inigeomphy n'est utile que pour avoir getin_p dans
28  ! les initialisations
29  !---------------------------------------------------------------------
30  zcufi = 1.
31  zcvfi = 1.
32  rlat_rad(1) = 0.
33  rlon_rad(1) = 0.
34
35  preff = 101325.
36  !preff=100000.
37  pa = 50000.
38  CALL disvert()
39  CALL inigeomphy(1, 1, llm, &
40          1, comm_lmdz, &
41          (/rlat_rad(1), 0./), (/0./), &
42          (/0., 0./), (/rlon_rad(1), 0./), &
43          (/ (/airefi, 0./), (/0., 0./) /), &
44          (/zcufi, 0., 0., 0./), &
45          (/zcvfi, 0./))
46
47  CALL suphel
48  !ntime=4320
49  ntime = 10000000
50  dayref = 1
51  anneeref = 2000
52  CALL getin('dayref', dayref)
53  CALL getin('anneeref', anneeref)
54  CALL getin('calend', calend)
55  CALL getin('day_step', day_step)
56  calendrier = calend
57  IF (calendrier == "earth_360d") calendrier = "360_day"
58
59  jour0 = dayref
60  mois0 = (jour0 - 1) / 30 + 1
61  jour0 = jour0 - 30 * ((jour0 - 1) / 30)
62  an0 = anneeref
63
64  !PRINT*,"REPLAY1D jour0,mois0,an0",jour0,mois0,an0
65
66  klon = 1
67  klev = llm
68  CALL iotd_ini('phys.nc', 1, 1, klev, 0., 0., presnivs, jour0, mois0, an0, 0., 86400. / day_step, calendrier)
69  ! Consistent with ... CALL iophys_ini(600.)
70
71  !---------------------------------------------------------------------
72  ! Initialisation de la parametrisation
73  !---------------------------------------------------------------------
74  CALL call_ini_replay
75
76  !---------------------------------------------------------------------
77  ! Boucle en temps sur l'appel à la parametrisation
78  !---------------------------------------------------------------------
79  CALL call_param_replay(klon, klev)
80
81end
82
83!---------------------------------------------------------------------
84!/////////////////////////////////////////////////////////////////////
85!/////////////////////////////////////////////////////////////////////
86!     routine additionnelles utiles, prises dans 1DUTILS.h
87!/////////////////////////////////////////////////////////////////////
88!/////////////////////////////////////////////////////////////////////
89!---------------------------------------------------------------------
90
91!=======================================================================
92SUBROUTINE gr_dyn_fi(nfield, im, jm, ngrid, pdyn, pfi)
93  USE lmdz_ssum_scopy, ONLY: scopy
94
95  IMPLICIT NONE
96  !   passage d'un champ de la grille scalaire a la grille physique
97  !=======================================================================
98
99  !-----------------------------------------------------------------------
100  !   declarations:
101  !   -------------
102
103  INTEGER im, jm, ngrid, nfield
104  REAL pdyn(im, jm, nfield)
105  REAL pfi(ngrid, nfield)
106
107  INTEGER j, ifield, ig
108
109  !-----------------------------------------------------------------------
110  !   calcul:
111  !   -------
112
113  IF(ngrid/=2 + (jm - 2) * (im - 1).AND.ngrid/=1)                          &
114          STOP 'probleme de dim'
115  !   traitement des poles
116  CALL SCOPY(nfield, pdyn, im * jm, pfi, ngrid)
117  CALL SCOPY(nfield, pdyn(1, jm, 1), im * jm, pfi(ngrid, 1), ngrid)
118
119  !   traitement des point normaux
120  DO ifield = 1, nfield
121    DO j = 2, jm - 1
122      ig = 2 + (j - 2) * (im - 1)
123      CALL SCOPY(im - 1, pdyn(1, j, ifield), 1, pfi(ig, ifield), 1)
124    ENDDO
125  ENDDO
126
127  RETURN
128END
Note: See TracBrowser for help on using the repository browser.