7 use netcdf95, only: nf95_close, nf95_gw_var, nf95_inq_dimid, &
8 nf95_inq_varid, nf95_open
9 use netcdf
, only: nf90_get_var, nf90_noerr, nf90_nowrite
30 real,
pointer:: latitude(:)
31 real,
pointer:: longitude(:)
32 real,
pointer:: time(:)
34 integer,
save :: mth_pre
38 real,
allocatable:: chlorocon(:, :, :)
39 real,
allocatable:: chlorocon_mois(:, :)
40 real,
allocatable:: chlorocon_mois_glo(:)
51 IF (debut.OR.
mth_cur.NE.mth_pre)
THEN
56 CALL nf95_open(
"chlorophyll.nc", nf90_nowrite, ncid_in)
58 CALL nf95_inq_varid(ncid_in,
"lon", varid)
59 CALL nf95_gw_var(ncid_in, varid, longitude)
60 n_lon =
size(longitude)
63 print *,
'Le nombre de lon n est pas egal a nbp_lon'
68 CALL nf95_inq_varid(ncid_in,
"lat", varid)
69 CALL nf95_gw_var(ncid_in, varid, latitude)
70 n_lat =
size(latitude)
73 print *,
'Le nombre de lat n est pas egal a jnbp_lat'
77 CALL nf95_inq_varid(ncid_in,
"time", varid)
78 CALL nf95_gw_var(ncid_in, varid, time)
81 IF (n_month.NE.12)
THEN
82 print *,
'Le nombre de month n est pas egal a 12'
86 IF (.not.
ALLOCATED(chlorocon))
ALLOCATE(chlorocon(n_lon, n_lat, n_month))
87 IF (.not.
ALLOCATED(chlorocon_mois))
ALLOCATE(chlorocon_mois(n_lon, n_lat))
88 IF (.not.
ALLOCATED(chlorocon_mois_glo))
ALLOCATE(chlorocon_mois_glo(
klon_glo))
91 CALL nf95_inq_varid(ncid_in,
"CHL", varid)
92 ncerr = nf90_get_var(ncid_in, varid, chlorocon)
93 print *,
'code erreur readchlorophyll=', ncerr, varid
95 CALL nf95_close(ncid_in)
99 print *,
'probleme avec le mois dans readchlorophyll =',
mth_cur
101 chlorocon_mois(:,:) = chlorocon(:,:,
mth_cur)
107 print*,
"chrolophyll current month",
mth_cur
111 if(chlorocon_mois_glo(i).ne.chlorocon_mois_glo(i))
then
112 chlorocon_mois_glo(i)=0.
124 CALL scatter(chlorocon_mois_glo,
chl_con)
subroutine readchlorophyll(debut)
real, dimension(:), allocatable, save chl_con
logical, save is_mpi_root