3 use netcdf95, only: nf95_close, nf95_gw_var, nf95_inq_dimid, &
5 use netcdf
, only: nf90_get_var, nf90_noerr, nf90_nowrite
19 include
"dimensions.h"
29 real,
pointer:: latitude(:)
30 real,
pointer:: longitude(:)
31 real,
pointer::
time(:)
32 real,
pointer:: lev(:)
33 integer i,
k, band, wave
34 integer,
save :: mth_pre
36 real,
allocatable,
dimension(:,:),
save :: tau_aer_strat
40 real,
allocatable:: tauaerstrat(:, :, :, :)
41 real,
allocatable:: tauaerstrat_mois(:, :, :)
42 real,
allocatable:: tauaerstrat_mois_glo(:, :)
43 real,
allocatable:: tauaerstrat_mois_glo_bands(:,:,:)
52 real,
dimension(nbands) :: alpha_strat, piz_strat, cg_strat
53 data alpha_strat/0.9922547, 0.7114912 /
54 data piz_strat /0.9999998, 0.99762493/
55 data cg_strat /0.73107845,0.73229635/
56 real,
dimension(nwave) :: alpha_strat_wave
57 data alpha_strat_wave/3.36780953,3.34667683,3.20444202,3.0293026,2.82108808/
61 IF (.not.
ALLOCATED(tau_aer_strat))
ALLOCATE(tau_aer_strat(klon,
klev))
65 IF (debut.OR.mth_cur.NE.mth_pre)
THEN
68 print *,
'nbands doit etre egal a 2 dans readaerosolstrat'
72 CALL
nf95_open(
"taustrat.nc", nf90_nowrite, ncid_in)
75 CALL nf95_gw_var(ncid_in, varid, lev)
77 IF (n_lev.NE.
klev)
THEN
78 print *,
'Le nombre de niveaux n est pas egal a klev'
83 CALL nf95_gw_var(ncid_in, varid, latitude)
84 n_lat =
size(latitude)
85 print *,
'LAT aerosol strato=', n_lat, latitude
86 IF (n_lat.NE.jjm+1)
THEN
87 print *,
'Le nombre de lat n est pas egal a jjm+1'
92 CALL nf95_gw_var(ncid_in, varid, longitude)
93 n_lon =
size(longitude)
94 print *,
'LON aerosol strato=', n_lon, longitude
95 IF (n_lon.NE.
iim)
THEN
96 print *,
'Le nombre de lon n est pas egal a iim'
101 CALL nf95_gw_var(ncid_in, varid,
time)
103 print *,
'TIME aerosol strato=', n_month,
time
104 IF (n_month.NE.12)
THEN
105 print *,
'Le nombre de month n est pas egal a 12'
109 ALLOCATE(tauaerstrat(n_lon, n_lat, n_lev, n_month))
110 ALLOCATE(tauaerstrat_mois(n_lon, n_lat, n_lev))
111 ALLOCATE(tauaerstrat_mois_glo(klon_glo, n_lev))
112 ALLOCATE(tauaerstrat_mois_glo_bands(klon_glo, n_lev,nbands))
116 ncerr = nf90_get_var(ncid_in, varid, tauaerstrat)
117 print *,
'code erreur readaerosolstrato=', ncerr, varid
122 IF (mth_cur.LT.1.OR.mth_cur.GT.12)
THEN
123 print *,
'probleme avec le mois dans readaerosolstrat =', mth_cur
125 tauaerstrat_mois(:,:,:) = tauaerstrat(:,:,:,mth_cur)
131 CALL
scatter(tauaerstrat_mois_glo,tau_aer_strat)
133 DEALLOCATE(tauaerstrat)
134 DEALLOCATE(tauaerstrat_mois)
135 DEALLOCATE(tauaerstrat_mois_glo)
146 tausum_aero(:,wave,id_strat)=tausum_aero(:,wave,id_strat)+tau_aer_strat(:,
k)*alpha_strat_wave(wave)/alpha_strat_wave(2)
153 cg_aero(:,:,3,band) = ( cg_aero(:,:,3,band)*piz_aero(:,:,3,band)*tau_aero(:,:,3,band) + &
154 cg_strat(band)*piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:) ) / &
155 max( piz_aero(:,:,3,band)*tau_aero(:,:,3,band) + &
156 piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:), 1.e-15 )
157 piz_aero(:,:,3,band) = ( piz_aero(:,:,3,band)*tau_aero(:,:,3,band) + &
158 piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:) ) / &
159 max( tau_aero(:,:,3,band) + alpha_strat(band)*tau_aer_strat(:,:), 1.e-15 )
160 tau_aero(:,:,3,band) = tau_aero(:,:,3,band) + alpha_strat(band)*tau_aer_strat(:,:)
162 cg_aero(:,:,2,band) = ( cg_aero(:,:,2,band)*piz_aero(:,:,2,band)*tau_aero(:,:,2,band) + &
163 cg_strat(band)*piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:) ) / &
164 max( piz_aero(:,:,2,band)*tau_aero(:,:,2,band) + &
165 piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:), 1.e-15 )
166 piz_aero(:,:,2,band) = ( piz_aero(:,:,2,band)*tau_aero(:,:,2,band) + &
167 piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:) ) / &
168 max( tau_aero(:,:,2,band) + alpha_strat(band)*tau_aer_strat(:,:),1.e-15 )
169 tau_aero(:,:,2,band) = tau_aero(:,:,2,band) + alpha_strat(band)*tau_aer_strat(:,:)