source: trunk/LMDZ.TITAN/libf/phytitan/call_profilgases.F90 @ 3567

Last change on this file since 3567 was 2743, checked in by aslmd, 2 years ago

made the vertical discretization for Titan LES similar to that of Mars (simple linear law for znw and refinement close to the surface). no more need to prepare a file levels, just put ztop and number of levels in namelist. a file levels is saved at the end of the znw computation so that it can be read in update_inputs_physiq_mod in the case of Titan.

added MESOSCALE precompiling flags in call_profilgases to set constant methane abundance. therefore no need for profile.def file and the number of vertical levels is set by namelist -- no need to set the same number in both levels and profile.def

outputing ustar from vdifc

ending hardcoding of ptop in update_inputs_physiq_mod for Titan and generic LES/mesoscale. streamlining grod%ptop through module_lmd_driver as ptopwrf within variables_mod module.

adding flux outputs to check surface and atmosphere energy budgets

File size: 2.2 KB
Line 
1subroutine call_profilgases(nlayer)
2
3  use gases_h
4
5  implicit none
6
7
8  !============================================================================
9  !
10  !     Purpose
11  !     -------
12  !     Set atmospheric composition for Titan main gases (N2, CH4, H2) from :
13  !       - Interactive tracers if we run with chemistry
14  !       or
15  !       - CH4 vertical profile file (profile.def) at firstcall only
16  !
17  !     Author
18  !     ------
19  !     J. Vatant d'Ollone (2017)
20  !
21  !============================================================================
22
23
24  !--------------------------
25  ! 0. Declarations
26  ! -------------------------
27
28  integer, intent(in) :: nlayer
29 
30 
31  logical, save :: firstcall=.true.
32!$OMP THREADPRIVATE(firstcall)
33
34
35  integer ilay, ierr
36
37 
38  ! -----------------------------------------------
39  ! 1. First case : no interactive CH4 tracer
40  ! -----------------------------------------------
41
42  if (firstcall) then
43
44!$OMP MASTER
45#ifndef MESOSCALE     
46     ! Load CH4 vertical profile from file 'profile.def'
47     open(90,file='profile.def',status='old',form='formatted',iostat=ierr)
48
49     if (ierr.eq.0) then
50        write(*,*) "call_profilgases.F90: reading file profile.def"
51        read(90,*) ! header
52
53        write(*,*) "call_profilgases.F90: reading CH4 vertical profile..."
54
55        do ilay=1,nlayer
56           read(90,*,iostat=ierr) gfrac(igas_CH4,ilay)
57           if (ierr.ne.0) then
58              write(*,*) 'call_profilgases.F90: error reading CH4 vertical profile... aborting'
59              call abort
60           endif         
61        enddo       
62#else       
63        gfrac(igas_CH4,:) = 1.443E-02
64        print*,"MESOSCALE. setting constant CH4",gfrac(igas_CH4,1)
65#endif
66        ! Then set H2 (fixed) and N2 (what remains)
67
68        gfrac(igas_H2,:) = 1.0E-3
69        gfrac(igas_N2,:) = 1.0 - ( gfrac(igas_CH4,:) + gfrac(igas_H2,:) )
70
71
72#ifndef MESOSCALE       
73     else
74        write(*,*) 'Cannot find required file "profile.def"'
75        call abort
76     endif
77
78     close(90)
79#endif
80!$OMP END MASTER
81!$OMP BARRIER
82     
83     firstcall=.false.
84  endif ! if (firstcall)
85
86
87  ! -----------------------------------------------
88  ! 2. Second case : interactive CH4 tracer
89  ! -----------------------------------------------
90 
91end subroutine call_profilgases
Note: See TracBrowser for help on using the repository browser.