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

Contents of /trunk/phylmd/getso4fromfile.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 68 - (show annotations)
Wed Nov 14 16:59:30 2012 UTC (11 years, 6 months ago) by guez
Original Path: trunk/libf/phylmd/getso4fromfile.f90
File size: 2144 byte(s)
Split "flincom.f90" into "flinclo.f90", "flinfindcood.f90",
"flininfo.f90" and "flinopen_nozoom.f90", in directory
"IOIPSL/Flincom".

Renamed "etat0_lim" to "ce0l", as in LMDZ.

Split "readsulfate.f" into "readsulfate.f90", "readsulfate_preind.f90"
and "getso4fromfile.f90".

In etat0, renamed variable q3d to q, as in "dynredem1". Replaced calls
to Flicom procedures by calls to NetCDF95.

In leapfrog, added call to writehist.

Extracted ASCII art from "grid_noro" into a file
"grid_noro.txt". Transformed explicit-shape local arrays into
automatic arrays, so that test on values of iim and jjm is no longer
needed. Test on weight:
          IF (weight(ii, jj) /= 0.) THEN
is useless. There is already a test before:
    if (any(weight == 0.)) stop "zero weight in grid_noro"

In "aeropt", replaced duplicated lines with different values of inu by
a loop on inu.

Removed arguments of "conf_phys". Corresponding variables are now
defined in "physiq", in a namelist. In "conf_phys", read a namelist
instead of using getin.

1 SUBROUTINE getso4fromfile (cyr, so4)
2
3 ! Routine for reading SO4 data from files
4
5 use dimens_m
6 use dimphy
7 use netcdf
8 CHARACTER*15 fname
9 CHARACTER*4 cyr
10
11 CHARACTER*6 cvar
12 INTEGER START(3), COUNT(3)
13 INTEGER STATUS, NCID, VARID
14 INTEGER imth, i, j, k, ny
15 PARAMETER (ny=jjm+1)
16
17
18 double precision so4mth(iim, ny, klev)
19 double precision so4(iim, ny, klev, 12)
20
21
22 fname = 'so4.run'//cyr//'.cdf'
23
24 write (*,*) 'reading ', fname
25 STATUS = NF_OPEN (fname, NF_NOWRITE, NCID)
26 IF (STATUS .NE. NF_NOERR) write (*,*) 'err in open ',status
27
28 DO imth=1, 12
29 IF (imth.eq.1) THEN
30 cvar='SO4JAN'
31 ELSEIF (imth.eq.2) THEN
32 cvar='SO4FEB'
33 ELSEIF (imth.eq.3) THEN
34 cvar='SO4MAR'
35 ELSEIF (imth.eq.4) THEN
36 cvar='SO4APR'
37 ELSEIF (imth.eq.5) THEN
38 cvar='SO4MAY'
39 ELSEIF (imth.eq.6) THEN
40 cvar='SO4JUN'
41 ELSEIF (imth.eq.7) THEN
42 cvar='SO4JUL'
43 ELSEIF (imth.eq.8) THEN
44 cvar='SO4AUG'
45 ELSEIF (imth.eq.9) THEN
46 cvar='SO4SEP'
47 ELSEIF (imth.eq.10) THEN
48 cvar='SO4OCT'
49 ELSEIF (imth.eq.11) THEN
50 cvar='SO4NOV'
51 ELSEIF (imth.eq.12) THEN
52 cvar='SO4DEC'
53 ENDIF
54 start(1)=1
55 start(2)=1
56 start(3)=1
57 count(1)=iim
58 count(2)=ny
59 count(3)=klev
60 ! write(*,*) 'here i am'
61 STATUS = NF_INQ_VARID (NCID, cvar, VARID)
62 write (*,*) ncid,imth,cvar, varid
63 ! STATUS = NF_INQ_VARID (NCID, VARMONTHS(i), VARID(i))
64 IF (STATUS .NE. NF_NOERR) write (*,*) 'err in read ',status
65 STATUS = NF_GET_VARA_DOUBLE &
66 (NCID, VARID, START,COUNT, so4mth)
67 IF (STATUS .NE. NF_NOERR) write (*,*) 'err in read data',status
68
69 DO k=1,klev
70 DO j=1,jjm+1
71 DO i=1,iim
72 IF (so4mth(i,j,k).LT.0.) then
73 write(*,*) 'this is shit'
74 write(*,*) 'so4(',i,j,k,') =',so4mth(i,j,k)
75 endif
76 so4(i,j,k,imth)=so4mth(i,j,k)
77 ! so4(i,j,k,imth)=so4mth(k,j,i)
78 ENDDO
79 ENDDO
80 ENDDO
81 ENDDO
82
83 STATUS = NF_CLOSE(NCID)
84 END SUBROUTINE getso4fromfile

  ViewVC Help
Powered by ViewVC 1.1.21