/[lmdze]/trunk/libf/phylmd/condsurf.f
ViewVC logotype

Annotation of /trunk/libf/phylmd/condsurf.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (hide annotations)
Wed Feb 27 13:16:39 2008 UTC (16 years, 3 months ago) by guez
File size: 3287 byte(s)
Initial import
1 guez 3 c $Header: /home/cvsroot/LMDZ4/libf/phylmd/condsurf.F,v 1.2 2005/12/01 11:27:29 fairhead Exp $
2     c
3     SUBROUTINE condsurf( jour, jourvrai, lmt_bils )
4     use dimens_m
5     use indicesol
6     use dimphy
7     use temps
8     use clesphys
9     IMPLICIT none
10     c
11     c I. Musat 05.2005
12     c
13     c Lire chaque jour le bilan de chaleur au sol issu
14     c d'un run atmospherique afin de l'utiliser dans
15     c dans un run "slab" ocean
16     c -----------------------------------------
17     c jour : input , numero du jour a lire
18     c jourvrai : input , vrai jour de la simulation
19     c
20     c lmt_bils: bilan chaleur au sol (a utiliser pour "slab-ocean")
21     c
22     include "netcdf.inc"
23     INTEGER nid, nvarid
24     INTEGER debut(2)
25     INTEGER epais(2)
26     c
27     c
28     INTEGER nannemax
29     PARAMETER ( nannemax = 60 )
30     c
31     INTEGER jour
32     INTEGER jourvrai
33     REAL lmt_bils(klon) !bilan chaleur au sol
34     c
35     c Variables locales:
36     INTEGER ig, i, kt, ierr
37     LOGICAL ok
38     INTEGER anneelim,anneemax
39     CHARACTER*20 fich
40     cc
41     cc .....................................................................
42     cc
43     cc Pour lire le fichier limit correspondant vraiment a l'annee de la
44     cc simulation en cours , il suffit de mettre ok_limitvrai = .TRUE.
45     cc
46     cc ......................................................................
47     c
48     c
49     IF (jour.LT.0 .OR. jour.GT.(360-1)) THEN
50     PRINT*,'Le jour demande n est pas correct: ', jour
51     STOP 1
52     ENDIF
53     c
54     anneelim = annee_ref
55     anneemax = annee_ref + nannemax
56     c
57     c
58     IF( ok_limitvrai ) THEN
59     DO kt = 1, nannemax
60     IF(jourvrai.LE. (kt-1)*360 + 359 ) THEN
61     WRITE(fich,'("limit",i4,".nc")') anneelim
62     c PRINT *,' Fichier Limite ',fich
63     GO TO 100
64     ENDIF
65     anneelim = anneelim + 1
66     ENDDO
67    
68     PRINT *,' PBS ! Le jour a lire sur le fichier limit ne se '
69     PRINT *,' trouve pas sur les ',nannemax,' annees a partir de '
70     PRINT *,' l annee de debut', annee_ref
71     CALL EXIT(1)
72     c
73     100 CONTINUE
74     c
75     ELSE
76    
77     WRITE(fich,'("limitNEW.nc")')
78     c PRINT *,' Fichier Limite ',fich
79     ENDIF
80     c
81     c Ouvrir le fichier en format NetCDF:
82     c
83     ierr = NF_OPEN (fich, NF_NOWRITE,nid)
84     IF (ierr.NE.NF_NOERR) THEN
85     WRITE(6,*)' Pb d''ouverture du fichier ', fich
86     WRITE(6,*)' Le fichier limit ',fich,' (avec 4 chiffres , pour'
87     WRITE(6,*)' l an 2000 ) , n existe pas ! '
88     WRITE(6,*)' ierr = ', ierr
89     CALL EXIT(1)
90     ENDIF
91     c DO k = 1, jour
92     c La tranche de donnees a lire:
93     c
94     debut(1) = 1
95     debut(2) = jour
96     epais(1) = klon
97     epais(2) = 1
98     c
99     c Bilan flux de chaleur au sol:
100     c
101     ierr = NF_INQ_VARID (nid, "BILS", nvarid)
102     IF (ierr .NE. NF_NOERR) THEN
103     PRINT*, "condsurf: Le champ <BILS> est absent"
104     stop 1
105     ENDIF
106     c PRINT*,'debut,epais',debut,epais
107     ierr = NF_GET_VARA_REAL(nid, nvarid,debut,epais,lmt_bils)
108     IF (ierr .NE. NF_NOERR) THEN
109     PRINT*, "condsurf: Lecture echouee pour <BILS>"
110     stop 1
111     ENDIF
112     c ENDDO !k = 1, jour
113     c
114     c Fermer le fichier:
115     c
116     ierr = NF_CLOSE(nid)
117     c
118     c
119     c PRINT*, 'lmt_bils est lu pour jour: ', jour
120     c
121     RETURN
122     END

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.21