/[lmdze]/trunk/phylmd/Interface_surf/limit_read_sst.f
ViewVC logotype

Annotation of /trunk/phylmd/Interface_surf/limit_read_sst.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 293 - (hide annotations)
Wed Jul 25 16:16:53 2018 UTC (5 years, 10 months ago) by guez
File size: 1315 byte(s)
Rename procedure read_sst to limit_read_sst, to be closer to LMDZ.

1 guez 293 module limit_read_sst_m
2 guez 202
3     implicit none
4    
5     contains
6    
7 guez 293 SUBROUTINE limit_read_sst(julien, knindex, tsurf)
8 guez 202
9     ! From interfoce_lim
10    
11 guez 279 ! Libraries:
12 guez 202 USE netcdf, ONLY: nf90_nowrite
13     use netcdf95, only: NF95_CLOSE, nf95_get_var, NF95_INQ_VARID, nf95_open
14     use nr_util, only: assert
15 guez 279
16     use conf_gcm_m, only: lmt_pas
17     USE dimphy, ONLY: klon
18 guez 202 use time_phylmdz, only: itap
19    
20 guez 221 integer, intent(IN):: julien ! jour a lire dans l'annee
21 guez 202
22     integer, intent(in):: knindex(:) ! (knon)
23     ! index des points de la surface a traiter
24    
25 guez 222 real, intent(out):: tsurf(:) ! (knon)
26 guez 202 ! SST lues dans le fichier de conditions aux limites
27    
28     ! Local:
29    
30     ! Champ lu dans le fichier de conditions aux limites :
31 guez 221 real, save:: sst_lu(klon)
32 guez 202
33     integer ncid, varid ! pour NetCDF
34    
35     ! --------------------------------------------------
36    
37 guez 293 call assert(size(knindex) == size(tsurf), "limit_read_sst knon")
38 guez 202
39     ! Tester d'abord si c'est le moment de lire le fichier
40 guez 221 if (mod(itap - 1, lmt_pas) == 0) then
41 guez 202 call NF95_OPEN ('limit.nc', NF90_NOWRITE, ncid)
42    
43     call NF95_INQ_VARID(ncid, 'SST', varid)
44 guez 221 call NF95_GET_VAR(ncid, varid, sst_lu, start = (/1, julien/))
45 guez 202
46     call NF95_CLOSE(ncid)
47     endif
48    
49 guez 222 tsurf = sst_lu(knindex)
50 guez 202
51 guez 293 END SUBROUTINE limit_read_sst
52 guez 202
53 guez 293 end module limit_read_sst_m

  ViewVC Help
Powered by ViewVC 1.1.21