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

Annotation of /trunk/phylmd/condsurf.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 71 - (hide annotations)
Mon Jul 8 18:12:18 2013 UTC (10 years, 10 months ago) by guez
Original Path: trunk/libf/phylmd/condsurf.f
File size: 3302 byte(s)
No reason to call inidissip in ce0l.

In inidissip, set random seed to 1 beacuse PGI compiler does not
accept all zeros.

dq was computed needlessly in caladvtrac. Arguments masse and dq of
calfis not used.

Replaced real*8 by double precision.

Pass arrays with inverted order of vertical levels to conflx instead
of creating local variables for this inside conflx.

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 guez 12 use clesphys2, only: ok_limitvrai
9 guez 61 use netcdf
10 guez 3 IMPLICIT none
11     c
12     c I. Musat 05.2005
13     c
14     c Lire chaque jour le bilan de chaleur au sol issu
15     c d'un run atmospherique afin de l'utiliser dans
16     c dans un run "slab" ocean
17     c -----------------------------------------
18     c jour : input , numero du jour a lire
19     c jourvrai : input , vrai jour de la simulation
20     c
21     c lmt_bils: bilan chaleur au sol (a utiliser pour "slab-ocean")
22     c
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 guez 71 stop 1
72 guez 3 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 guez 61 ierr = NF90_OPEN (fich, NF90_NOWRITE,nid)
84     IF (ierr.NE.NF90_NOERR) THEN
85 guez 3 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 guez 71 stop 1
90 guez 3 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 guez 61 ierr = NF90_INQ_VARID (nid, "BILS", nvarid)
102     IF (ierr .NE. NF90_NOERR) THEN
103 guez 3 PRINT*, "condsurf: Le champ <BILS> est absent"
104     stop 1
105     ENDIF
106     c PRINT*,'debut,epais',debut,epais
107 guez 61 ierr = NF90_GET_VAR(nid, nvarid,lmt_bils,debut,epais)
108     IF (ierr .NE. NF90_NOERR) THEN
109 guez 3 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 guez 61 ierr = NF90_CLOSE(nid)
117 guez 3 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