/[lmdze]/trunk/Sources/dyn3d/initfluxsto.f
ViewVC logotype

Annotation of /trunk/Sources/dyn3d/initfluxsto.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 178 - (hide annotations)
Fri Mar 11 18:47:26 2016 UTC (8 years, 3 months ago) by guez
File size: 6296 byte(s)
Moved variables date0, deltat, datasz_max, ncvar_ids, point, buff_pos,
buffer, regular from module histcom_var to modules where they are
defined.

Removed procedure ioipslmpp, useless for a sequential program.

Added argument datasz_max to histwrite_real (to avoid circular
dependency with histwrite).

Removed useless variables and computations everywhere.

Changed real litteral constants from default kind to double precision
in lwb, lwu, lwvn, sw1s, swtt, swtt1, swu.

Removed unused arguments: paer of sw, sw1s, sw2s, swclr; pcldsw of
sw1s, sw2s; pdsig, prayl of swr; co2_ppm of clmain, clqh; tsol of
transp_lay; nsrf of screenp; kcrit and kknu of gwstress; pstd of
orosetup.

Added output of relative humidity.

1 guez 178 module initfluxsto_m
2 guez 3
3 guez 178 IMPLICIT NONE
4 guez 3
5 guez 178 contains
6 guez 3
7 guez 178 SUBROUTINE initfluxsto(tstep, t_ops, t_wrt, fileid, filevid, filedid)
8 guez 3
9 guez 178 ! From bibio/initfluxsto.F, v 1.1.1.1 2004/05/19 12:53:05
10 guez 3
11 guez 178 ! Routine d'initialisation des ecritures des fichiers histoires LMDZ
12     ! au format IOIPSL
13     ! Appels succesifs des routines: histbeg
14     ! histhori
15     ! histver
16     ! histdef
17     ! histend
18 guez 3
19 guez 178 ! Entree:
20     ! day0, anne0: date de reference
21     ! tstep: duree du pas de temps en seconde
22     ! t_ops: frequence de l'operation pour IOIPSL
23     ! t_wrt: frequence d'ecriture sur le fichier
24 guez 3
25 guez 178 ! Sortie:
26     ! fileid: ID du fichier netcdf cree
27     ! filevid:ID du fichier netcdf pour la grille v
28 guez 3
29 guez 178 ! L. Fairhead, 03/99
30 guez 3
31 guez 178 USE comconst
32     use conf_gcm_m
33     USE dimens_m
34     USE disvert_m
35     use dynetat0_m, only: day_ref, annee_ref, rlonu, rlatu, rlonv, rlatv
36     USE histbeg_totreg_m, ONLY : histbeg_totreg
37     USE histdef_m, ONLY : histdef
38     USE histend_m, ONLY : histend
39     use histhori_regular_m, only: histhori_regular
40     use histsync_m, only: histsync
41     USE histvert_m, ONLY : histvert
42     USE nr_util, ONLY : pi
43     USE paramet_m
44     USE temps, ONLY : itau_dyn
45     use ymds2ju_m, only: ymds2ju
46 guez 3
47 guez 178 ! Arguments
48     REAL, INTENT (IN) :: tstep
49     REAL t_ops, t_wrt
50     INTEGER fileid, filevid, filedid
51     REAL nivd(1)
52 guez 3
53 guez 178 ! Variables locales
54     REAL zjulian
55     REAL rlong(iip1, jjp1), rlat(iip1, jjp1)
56     INTEGER uhoriid, vhoriid, thoriid, zvertiid, dhoriid, dvertiid
57     INTEGER ii, jj, l
58     LOGICAL ok_sync
59 guez 3
60 guez 178 !---------------------------------------------------------
61 guez 3
62 guez 178 ! Initialisations
63     ok_sync = .TRUE.
64 guez 3
65 guez 178 ! Appel a histbeg: creation du fichier netcdf et initialisations diverses
66 guez 3
67 guez 178 CALL ymds2ju(annee_ref, 1, day_ref, 0.0, zjulian)
68 guez 31
69 guez 178 DO jj = 1, jjp1
70     DO ii = 1, iip1
71     rlong(ii, jj) = rlonu(ii)*180./pi
72     rlat(ii, jj) = rlatu(jj)*180./pi
73     END DO
74     END DO
75 guez 31
76 guez 178 CALL histbeg_totreg('fluxstoke', rlong(:, 1), rlat(1, :), 1, iip1, 1, jjp1, &
77     itau_dyn, zjulian, tstep, uhoriid, fileid)
78 guez 31
79 guez 178 ! Creation du fichier histoire pour la grille en V (oblige pour l'instant,
80     ! IOIPSL ne permet pas de grilles avec des nombres de point differents dans
81     ! un meme fichier)
82 guez 31
83 guez 178 DO jj = 1, jjm
84     DO ii = 1, iip1
85     rlong(ii, jj) = rlonv(ii)*180./pi
86     rlat(ii, jj) = rlatv(jj)*180./pi
87     END DO
88     END DO
89 guez 31
90 guez 178 CALL histbeg_totreg('fluxstokev.nc', rlong(:, 1), rlat(1, :jjm), 1, iip1, &
91     1, jjm, itau_dyn, zjulian, tstep, vhoriid, filevid)
92 guez 31
93 guez 178 CALL histbeg_totreg('defstoke.nc', (/1./), (/1./), 1, 1, 1, 1, itau_dyn, &
94     zjulian, tstep, dhoriid, filedid)
95 guez 31
96 guez 178 ! Appel a histhori pour rajouter les autres grilles horizontales
97 guez 31
98 guez 178 DO jj = 1, jjp1
99     DO ii = 1, iip1
100     rlong(ii, jj) = rlonv(ii)*180./pi
101     rlat(ii, jj) = rlatu(jj)*180./pi
102     END DO
103     END DO
104 guez 31
105 guez 178 CALL histhori_regular(fileid, iip1, rlong, jjp1, rlat, 'scalar', &
106     'Grille points scalaires', thoriid)
107 guez 31
108 guez 178 ! Appel a histvert pour la grille verticale
109 guez 31
110 guez 178 CALL histvert(fileid, 'sig_s', 'Niveaux sigma', 'sigma_level', &
111     (/(real(l), l = 1, llm)/), zvertiid)
112     ! Pour le fichier V
113     CALL histvert(filevid, 'sig_s', 'Niveaux sigma', 'sigma_level', &
114     (/(real(l), l = 1, llm)/), zvertiid)
115     ! pour le fichier def
116     nivd(1) = 1
117     CALL histvert(filedid, 'sig_s', 'Niveaux sigma', 'sigma_level', nivd, &
118     dvertiid)
119 guez 31
120 guez 178 ! Appels a histdef pour la definition des variables a sauvegarder
121     CALL histdef(fileid, 'phis', 'Surface geop. height', '-', iip1, jjp1, &
122     thoriid, 1, 1, 1, -99, 'once', t_ops, t_wrt)
123     CALL histdef(fileid, 'aire', 'Grid area', '-', iip1, jjp1, thoriid, 1, 1, &
124     1, -99, 'once', t_ops, t_wrt)
125     CALL histdef(filedid, 'dtvr', 'tps dyn', 's', 1, 1, dhoriid, 1, 1, 1, -99, &
126     'once', t_ops, t_wrt)
127     CALL histdef(filedid, 'istdyn', 'tps stock', 's', 1, 1, dhoriid, 1, 1, 1, &
128     -99, 'once', t_ops, t_wrt)
129     CALL histdef(filedid, 'istphy', 'tps stock phy', 's', 1, 1, dhoriid, 1, 1, &
130     1, -99, 'once', t_ops, t_wrt)
131     CALL histdef(fileid, 'masse', 'Masse', 'kg', iip1, jjp1, thoriid, llm, 1, &
132     llm, zvertiid, 'inst(X)', t_ops, t_wrt)
133     CALL histdef(fileid, 'pbaru', 'flx de masse zonal', 'kg m/s', iip1, jjp1, &
134     uhoriid, llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt)
135     CALL histdef(filevid, 'pbarv', 'flx de masse mer', 'kg m/s', iip1, jjm, &
136     vhoriid, llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt)
137     CALL histdef(fileid, 'w', 'flx de masse vert', 'kg m/s', iip1, jjp1, &
138     thoriid, llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt)
139     CALL histdef(fileid, 'teta', 'temperature potentielle', '-', iip1, jjp1, &
140     thoriid, llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt)
141     CALL histdef(fileid, 'phi', 'geopotentiel instantane', '-', iip1, jjp1, &
142     thoriid, llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt)
143    
144     CALL histend(fileid)
145     CALL histend(filevid)
146     CALL histend(filedid)
147     IF (ok_sync) THEN
148     CALL histsync(fileid)
149     CALL histsync(filevid)
150     CALL histsync(filedid)
151     END IF
152    
153     END SUBROUTINE initfluxsto
154    
155     end module initfluxsto_m

  ViewVC Help
Powered by ViewVC 1.1.21