source: trunk/LMDZ.MARS/libf/aeronomars/read_phototable.F @ 461

Last change on this file since 461 was 461, checked in by emillour, 13 years ago

Mars GCM: Ooops, forgot something in previous commit on "read_phototable"
EM

File size: 2.7 KB
Line 
1      subroutine read_phototable
2c
3cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
4c
5c   subject:
6c   --------
7c
8c   read photolysis lookup table
9c
10c   VERSION: 17/03/2011
11c
12c   Author:   Franck Lefevre
13c
14c   Arguments:
15c   ----------
16c
17c   The output variable is jphot and is put in common chimiedata.
18c
19cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
20c
21! to use  'getin'
22      USE ioipsl_getincom
23
24      implicit none
25c
26#include "dimensions.h"
27#include "chimiedata.h"
28#include "datafile.h"
29c
30cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
31c     local:
32cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
33c
34      integer fic, ij, iozo, isza, itemp, iz, itau, ierr
35c
36      real xsza
37      character(len=128) :: phototable ! photolysis table file name
38c
39cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
40c
41! set photolysis table input file name
42      phototable="jmars.20111014" ! default
43      ! look for a " phototable= ..." option in def files
44      call getin("phototable",phototable)
45
46      fic = 81
47
48      open(fic, form = 'formatted', status = 'old',
49     &file =trim(datafile)//"/"//trim(phototable),iostat=ierr)
50
51      IF (ierr.NE.0) THEN
52        write(*,*)'Error : cannot open photolysis lookup table ',
53     &             trim(phototable)
54        write(*,*)'(in aeronomars/init_chemistry.F)'
55        write(*,*)'It should be in :',trim(datafile),'/'
56        write(*,*)'1) You can change this directory path in physiq.def'
57        write(*,*)'   with:'
58        write(*,*)'   datadir=/path/to/the/directory'
59        write(*,*)'2) You can change the input phototable file name in'
60        write(*,*)'   physiq.def with:'
61        write(*,*)'   phototable=filename'
62        STOP
63      ENDIF
64
65c
66      print*, 'read photolysis lookup table ',trim(phototable)
67c
68      do itau = 1,ntau
69         do itemp = 1,ntemp
70            do iozo = 1,nozo
71               do isza = 1,nsza
72                  do iz = 200,0,-1
73                     read(fic,*) colairtab(iz), xsza, table_ozo(iozo)
74c                    print*, colairtab(iz), xsza, table_ozo(iozo)
75                     read(fic,'(7e11.4)')
76     $               (jphot(itemp,isza,iz,iozo,itau,ij), ij= 1,nd)
77                     do ij = 1,nd
78                        if (jphot(itemp,isza,iz,iozo,itau,ij)
79     $                     .eq. 1.e-30) then
80                           jphot(itemp,isza,iz,iozo,itau,ij) = 0.
81                        end if
82                     end do
83                  end do
84               end do
85            end do
86         end do
87      end do
88c
89      print*, 'lookup table...ok'
90      close(fic)
91c
92      return
93      end
Note: See TracBrowser for help on using the repository browser.